From 8b8edb99291ca651c8e8c7cdab1f511b4631fbe4 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Fri, 2 Jan 2026 16:35:18 +0000 Subject: [PATCH] add pymc console endpoints and ui --- repeater/engine.py | 1 + repeater/web/api_endpoints.py | 60 +++ repeater/web/html/assets/index-B5977VlB.css | 32 -- .../{index-BAQsJZnI.js => index-CTGOZYs8.js} | 464 +++++++++--------- repeater/web/html/assets/index-cuiYbziQ.css | 32 ++ repeater/web/html/index.html | 4 +- 6 files changed, 327 insertions(+), 266 deletions(-) delete mode 100644 repeater/web/html/assets/index-B5977VlB.css rename repeater/web/html/assets/{index-BAQsJZnI.js => index-CTGOZYs8.js} (68%) create mode 100644 repeater/web/html/assets/index-cuiYbziQ.css diff --git a/repeater/engine.py b/repeater/engine.py index b98b906..5a1888d 100644 --- a/repeater/engine.py +++ b/repeater/engine.py @@ -728,6 +728,7 @@ class RepeaterHandler(BaseHandler): "direct_tx_delay_factor": delays_config.get("direct_tx_delay_factor", 0.5), "rx_delay_base": delays_config.get("rx_delay_base", 0.0), }, + "web": self.config.get("web", {}), # Include web configuration }, "public_key": None, } diff --git a/repeater/web/api_endpoints.py b/repeater/web/api_endpoints.py index 7687296..b79ebc3 100644 --- a/repeater/web/api_endpoints.py +++ b/repeater/web/api_endpoints.py @@ -599,6 +599,66 @@ class APIEndpoints: logger.error(f"Error updating duty cycle config: {e}") return self._error(str(e)) + @cherrypy.expose + @cherrypy.tools.json_out() + def check_pymc_console(self): + """Check if PyMC Console directory exists.""" + self._set_cors_headers() + + if cherrypy.request.method == "OPTIONS": + return "" + + try: + pymc_console_path = '/opt/pymc_console/web/html' + exists = os.path.isdir(pymc_console_path) + + return self._success({ + "exists": exists, + "path": pymc_console_path + }) + except Exception as e: + logger.error(f"Error checking PyMC Console directory: {e}") + return self._error(str(e)) + + @cherrypy.expose + @cherrypy.tools.json_out() + @cherrypy.tools.json_in() + def update_web_config(self): + """Update web configuration (CORS, frontend path) using ConfigManager.""" + self._set_cors_headers() + + if cherrypy.request.method == "OPTIONS": + return "" + + try: + self._require_post() + updates = cherrypy.request.json or {} + + if not updates: + return self._error("No configuration updates provided") + + # Use ConfigManager to update and save configuration + # Web changes (CORS, web_path) don't require live update + result = self.config_manager.update_and_save( + updates=updates, + live_update=False + ) + + if result.get("success"): + logger.info(f"Web configuration updated: {list(updates.keys())}") + return self._success({ + "persisted": result.get("saved", False), + "message": "Web configuration saved successfully. Restart required for changes to take effect." + }) + else: + return self._error(result.get("error", "Failed to update web configuration")) + + except cherrypy.HTTPError: + raise + except Exception as e: + logger.error(f"Error updating web config: {e}") + return self._error(str(e)) + @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() diff --git a/repeater/web/html/assets/index-B5977VlB.css b/repeater/web/html/assets/index-B5977VlB.css deleted file mode 100644 index b19e248..0000000 --- a/repeater/web/html/assets/index-B5977VlB.css +++ /dev/null @@ -1,32 +0,0 @@ -@tailwind base;@tailwind components;@tailwind utilities;:root{--vt-c-white: #ffffff;--vt-c-white-soft: #f8f8f8;--vt-c-white-mute: #f2f2f2;--vt-c-black: #181818;--vt-c-black-soft: #222222;--vt-c-black-mute: #282828;--vt-c-indigo: #2c3e50;--vt-c-divider-light-1: rgba(60, 60, 60, .29);--vt-c-divider-light-2: rgba(60, 60, 60, .12);--vt-c-divider-dark-1: rgba(84, 84, 84, .65);--vt-c-divider-dark-2: rgba(84, 84, 84, .48);--vt-c-text-light-1: var(--vt-c-indigo);--vt-c-text-light-2: rgba(60, 60, 60, .66);--vt-c-text-dark-1: var(--vt-c-white);--vt-c-text-dark-2: rgba(235, 235, 235, .64)}:root{--color-background: var(--vt-c-white);--color-background-soft: var(--vt-c-white-soft);--color-background-mute: var(--vt-c-white-mute);--color-border: var(--vt-c-divider-light-2);--color-border-hover: var(--vt-c-divider-light-1);--color-heading: var(--vt-c-text-light-1);--color-text: var(--vt-c-text-light-1);--section-gap: 160px}@media (prefers-color-scheme: dark){:root{--color-background: var(--vt-c-black);--color-background-soft: var(--vt-c-black-soft);--color-background-mute: var(--vt-c-black-mute);--color-border: var(--vt-c-divider-dark-2);--color-border-hover: var(--vt-c-divider-dark-1);--color-heading: var(--vt-c-text-dark-1);--color-text: var(--vt-c-text-dark-2)}}*,*:before,*:after{box-sizing:border-box;margin:0;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);transition:color .5s,background-color .5s;line-height:1.6;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Noto Sans,-apple-system,Roboto,Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-left-\[92px\]{left:-92px}.-right-1{right:-.25rem}.-right-6{right:-1.5rem}.-top-1{top:-.25rem}.-top-\[79px\]{top:-79px}.-top-\[94px\]{top:-94px}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-3{bottom:.75rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3{left:.75rem}.left-5{left:1.25rem}.left-\[246px\]{left:246px}.left-\[575px\]{left:575px}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-0{top:0}.top-1\/2{top:50%}.top-14{top:3.5rem}.top-2{top:.5rem}.top-3{top:.75rem}.top-4{top:1rem}.top-\[373px\]{top:373px}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1001\]{z-index:1001}.z-\[100\]{z-index:100}.z-\[1010\]{z-index:1010}.z-\[60\]{z-index:60}.z-\[9998\]{z-index:9998}.z-\[999999\]{z-index:999999}.z-\[99999\]{z-index:99999}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.-mx-3{margin-left:-.75rem;margin-right:-.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.ml-24{margin-left:6rem}.ml-28{margin-left:7rem}.ml-32{margin-left:8rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-6{margin-right:1.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\[30px\]{height:30px}.h-\[35px\]{height:35px}.h-\[512px\]{height:512px}.h-\[85vh\]{height:85vh}.h-full{height:100%}.h-px{height:1px}.max-h-0{max-height:0px}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-\[600px\]{max-height:600px}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[196px\]{width:196px}.w-\[285px\]{width:285px}.w-\[35px\]{width:35px}.w-\[705px\]{width:705px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\[120px\]{min-width:120px}.min-w-full{min-width:100%}.max-w-12{max-width:3rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-\[80px\]{max-width:80px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-\[24\.22deg\]{--tw-rotate: -24.22deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-white\/5>:not([hidden])~:not([hidden]){border-color:#ffffff0d}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[15px\]{border-radius:15px}.rounded-\[16px\]{border-radius:16px}.rounded-\[20px\]{border-radius:20px}.rounded-\[24px\]{border-radius:24px}.rounded-\[8px\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-b-\[15px\]{border-bottom-right-radius:15px;border-bottom-left-radius:15px}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-accent-green{--tw-border-opacity: 1;border-color:rgb(165 229 182 / var(--tw-border-opacity, 1))}.border-accent-green\/20{border-color:#a5e5b633}.border-accent-green\/30{border-color:#a5e5b64d}.border-accent-green\/40{border-color:#a5e5b666}.border-accent-green\/50{border-color:#a5e5b680}.border-accent-green\/60{border-color:#a5e5b699}.border-accent-purple\/50{border-color:#eba0fc80}.border-accent-red\/20{border-color:#fb787b33}.border-accent-red\/30{border-color:#fb787b4d}.border-accent-red\/50{border-color:#fb787b80}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/50{border-color:#3b82f680}.border-cyan-400\/30{border-color:#22d3ee4d}.border-cyan-400\/40{border-color:#22d3ee66}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(75 75 75 / var(--tw-border-opacity, 1))}.border-dark-border\/50{border-color:#4b4b4b80}.border-gray-400\/30{border-color:#9ca3af4d}.border-gray-500\/50{border-color:#6b728080}.border-gray-700\/50{border-color:#37415180}.border-green-400\/30{border-color:#4ade804d}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/50{border-color:#22c55e80}.border-orange-400\/30{border-color:#fb923c4d}.border-orange-400\/40{border-color:#fb923c66}.border-primary{--tw-border-opacity: 1;border-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.border-primary\/20{border-color:#aae8e833}.border-primary\/30{border-color:#aae8e84d}.border-primary\/40{border-color:#aae8e866}.border-primary\/50{border-color:#aae8e880}.border-primary\/60{border-color:#aae8e899}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/50{border-color:#ef444480}.border-secondary{--tw-border-opacity: 1;border-color:rgb(255 194 70 / var(--tw-border-opacity, 1))}.border-secondary\/30{border-color:#ffc2464d}.border-secondary\/40{border-color:#ffc24666}.border-secondary\/50{border-color:#ffc24680}.border-secondary\/70{border-color:#ffc246b3}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-white\/10{border-color:#ffffff1a}.border-white\/20{border-color:#fff3}.border-white\/30{border-color:#ffffff4d}.border-white\/5{border-color:#ffffff0d}.border-yellow-300{--tw-border-opacity: 1;border-color:rgb(253 224 71 / var(--tw-border-opacity, 1))}.border-yellow-400\/30{border-color:#facc154d}.border-yellow-500\/30{border-color:#eab3084d}.border-yellow-500\/50{border-color:#eab30880}.border-l-accent-cyan{--tw-border-opacity: 1;border-left-color:rgb(209 230 228 / var(--tw-border-opacity, 1))}.border-l-accent-green{--tw-border-opacity: 1;border-left-color:rgb(165 229 182 / var(--tw-border-opacity, 1))}.border-l-accent-purple{--tw-border-opacity: 1;border-left-color:rgb(235 160 252 / var(--tw-border-opacity, 1))}.border-l-accent-red{--tw-border-opacity: 1;border-left-color:rgb(251 120 123 / var(--tw-border-opacity, 1))}.border-l-gray-500{--tw-border-opacity: 1;border-left-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.border-l-primary{--tw-border-opacity: 1;border-left-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.border-l-secondary{--tw-border-opacity: 1;border-left-color:rgb(255 194 70 / var(--tw-border-opacity, 1))}.border-t-blue-400{--tw-border-opacity: 1;border-top-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-t-green-400{--tw-border-opacity: 1;border-top-color:rgb(74 222 128 / var(--tw-border-opacity, 1))}.border-t-orange-400{--tw-border-opacity: 1;border-top-color:rgb(251 146 60 / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.border-t-purple-400{--tw-border-opacity: 1;border-top-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.border-t-white\/70{border-top-color:#ffffffb3}.bg-\[\#0B1014\]{--tw-bg-opacity: 1;background-color:rgb(11 16 20 / var(--tw-bg-opacity, 1))}.bg-\[\#1A1E1F\]{--tw-bg-opacity: 1;background-color:rgb(26 30 31 / var(--tw-bg-opacity, 1))}.bg-\[\#223231\]{--tw-bg-opacity: 1;background-color:rgb(34 50 49 / var(--tw-bg-opacity, 1))}.bg-\[\#588187\]{--tw-bg-opacity: 1;background-color:rgb(88 129 135 / var(--tw-bg-opacity, 1))}.bg-accent-cyan{--tw-bg-opacity: 1;background-color:rgb(209 230 228 / var(--tw-bg-opacity, 1))}.bg-accent-green{--tw-bg-opacity: 1;background-color:rgb(165 229 182 / var(--tw-bg-opacity, 1))}.bg-accent-green\/10{background-color:#a5e5b61a}.bg-accent-green\/20{background-color:#a5e5b633}.bg-accent-green\/50{background-color:#a5e5b680}.bg-accent-purple{--tw-bg-opacity: 1;background-color:rgb(235 160 252 / var(--tw-bg-opacity, 1))}.bg-accent-purple\/20{background-color:#eba0fc33}.bg-accent-red{--tw-bg-opacity: 1;background-color:rgb(251 120 123 / var(--tw-bg-opacity, 1))}.bg-accent-red\/10{background-color:#fb787b1a}.bg-accent-red\/20{background-color:#fb787b33}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/20{background-color:#0003}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-black\/90{background-color:#000000e6}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/20{background-color:#3b82f633}.bg-blue-900\/20{background-color:#1e3a8a33}.bg-current{background-color:currentColor}.bg-cyan-400{--tw-bg-opacity: 1;background-color:rgb(34 211 238 / var(--tw-bg-opacity, 1))}.bg-cyan-400\/20{background-color:#22d3ee33}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity, 1))}.bg-dark-bg\/30{background-color:#09090b4d}.bg-dark-bg\/50{background-color:#09090b80}.bg-dark-card{background-color:#0006}.bg-dark-card\/30{background-color:#0000004d}.bg-dark-card\/50{background-color:#00000080}.bg-dark-card\/90{background-color:#000000e6}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity, 1))}.bg-gray-500\/20{background-color:#6b728033}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-900\/20{background-color:#11182733}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-400\/20{background-color:#4ade8033}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600\/20{background-color:#16a34a33}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity, 1))}.bg-orange-400\/20{background-color:#fb923c33}.bg-orange-500\/20{background-color:#f9731633}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(170 232 232 / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:#aae8e81a}.bg-primary\/20{background-color:#aae8e833}.bg-primary\/30{background-color:#aae8e84d}.bg-primary\/5{background-color:#aae8e80d}.bg-primary\/70{background-color:#aae8e8b3}.bg-purple-400{--tw-bg-opacity: 1;background-color:rgb(192 132 252 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/20{background-color:#ef444433}.bg-red-900\/20{background-color:#7f1d1d33}.bg-secondary{--tw-bg-opacity: 1;background-color:rgb(255 194 70 / var(--tw-bg-opacity, 1))}.bg-secondary\/20{background-color:#ffc24633}.bg-secondary\/30{background-color:#ffc2464d}.bg-secondary\/40{background-color:#ffc24666}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/20{background-color:#fff3}.bg-white\/5{background-color:#ffffff0d}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-yellow-400\/20{background-color:#facc1533}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.bg-yellow-500\/20{background-color:#eab30833}.bg-yellow-900\/20{background-color:#713f1233}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.bg-gradient-to-tl{background-image:linear-gradient(to top left,var(--tw-gradient-stops))}.from-accent-green\/10{--tw-gradient-from: rgb(165 229 182 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(165 229 182 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-blue-500\/20{--tw-gradient-from: rgb(59 130 246 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-400\/25{--tw-gradient-from: rgb(34 211 238 / .25) var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 211 238 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-400\/30{--tw-gradient-from: rgb(34 211 238 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 211 238 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500\/20{--tw-gradient-from: rgb(6 182 212 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500\/50{--tw-gradient-from: rgb(6 182 212 / .5) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500\/20{--tw-gradient-from: rgb(249 115 22 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-500\/50{--tw-gradient-from: rgb(249 115 22 / .5) var(--tw-gradient-from-position);--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary{--tw-gradient-from: #AAE8E8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/10{--tw-gradient-from: rgb(170 232 232 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/20{--tw-gradient-from: rgb(170 232 232 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/30{--tw-gradient-from: rgb(170 232 232 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\/5{--tw-gradient-from: rgb(170 232 232 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500\/20{--tw-gradient-from: rgb(239 68 68 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500\/50{--tw-gradient-from: rgb(239 68 68 / .5) var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-secondary\/20{--tw-gradient-from: rgb(255 194 70 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 194 70 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-secondary\/5{--tw-gradient-from: rgb(255 194 70 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 194 70 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\/5{--tw-gradient-from: rgb(255 255 255 / .05) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-400\/30{--tw-gradient-from: rgb(250 204 21 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(250 204 21 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-yellow-500\/50{--tw-gradient-from: rgb(234 179 8 / .5) var(--tw-gradient-from-position);--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-primary\/20{--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(170 232 232 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-secondary\/10{--tw-gradient-to: rgb(255 194 70 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 194 70 / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-transparent{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), transparent var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/5{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .05) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-accent-green{--tw-gradient-to: #A5E5B6 var(--tw-gradient-to-position)}.to-accent-purple\/20{--tw-gradient-to: rgb(235 160 252 / .2) var(--tw-gradient-to-position)}.to-cyan-200\/10{--tw-gradient-to: rgb(165 243 252 / .1) var(--tw-gradient-to-position)}.to-cyan-200\/15{--tw-gradient-to: rgb(165 243 252 / .15) var(--tw-gradient-to-position)}.to-cyan-400\/20{--tw-gradient-to: rgb(34 211 238 / .2) var(--tw-gradient-to-position)}.to-cyan-500\/20{--tw-gradient-to: rgb(6 182 212 / .2) var(--tw-gradient-to-position)}.to-cyan-600\/50{--tw-gradient-to: rgb(8 145 178 / .5) var(--tw-gradient-to-position)}.to-orange-400\/30{--tw-gradient-to: rgb(251 146 60 / .3) var(--tw-gradient-to-position)}.to-orange-600\/50{--tw-gradient-to: rgb(234 88 12 / .5) var(--tw-gradient-to-position)}.to-primary\/10{--tw-gradient-to: rgb(170 232 232 / .1) var(--tw-gradient-to-position)}.to-primary\/20{--tw-gradient-to: rgb(170 232 232 / .2) var(--tw-gradient-to-position)}.to-primary\/80{--tw-gradient-to: rgb(170 232 232 / .8) var(--tw-gradient-to-position)}.to-red-500\/10{--tw-gradient-to: rgb(239 68 68 / .1) var(--tw-gradient-to-position)}.to-red-600\/50{--tw-gradient-to: rgb(220 38 38 / .5) var(--tw-gradient-to-position)}.to-secondary\/30{--tw-gradient-to: rgb(255 194 70 / .3) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white\/10{--tw-gradient-to: rgb(255 255 255 / .1) var(--tw-gradient-to-position)}.to-white\/70{--tw-gradient-to: rgb(255 255 255 / .7) var(--tw-gradient-to-position)}.to-yellow-500\/20{--tw-gradient-to: rgb(234 179 8 / .2) var(--tw-gradient-to-position)}.to-yellow-600\/50{--tw-gradient-to: rgb(202 138 4 / .5) var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[15px\]{padding:15px}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pl-9{padding-left:2.25rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:Noto Sans,-apple-system,Roboto,Helvetica,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[20px\]{font-size:20px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-\[\#212122\]{--tw-text-opacity: 1;color:rgb(33 33 34 / var(--tw-text-opacity, 1))}.text-\[\#C3C3C3\]{--tw-text-opacity: 1;color:rgb(195 195 195 / var(--tw-text-opacity, 1))}.text-accent-cyan{--tw-text-opacity: 1;color:rgb(209 230 228 / var(--tw-text-opacity, 1))}.text-accent-green{--tw-text-opacity: 1;color:rgb(165 229 182 / var(--tw-text-opacity, 1))}.text-accent-green\/90{color:#a5e5b6e6}.text-accent-purple{--tw-text-opacity: 1;color:rgb(235 160 252 / var(--tw-text-opacity, 1))}.text-accent-red{--tw-text-opacity: 1;color:rgb(251 120 123 / var(--tw-text-opacity, 1))}.text-accent-red\/70{color:#fb787bb3}.text-accent-red\/80{color:#fb787bcc}.text-accent-red\/90{color:#fb787be6}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-blue-100{--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.text-blue-200{--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-cyan-300{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-cyan-400\/60{color:#22d3ee99}.text-dark-bg{--tw-text-opacity: 1;color:rgb(9 9 11 / var(--tw-text-opacity, 1))}.text-dark-text{--tw-text-opacity: 1;color:rgb(173 173 173 / var(--tw-text-opacity, 1))}.text-dark-text\/60{color:#adadad99}.text-dark-text\/70{color:#adadadb3}.text-dark-text\/80{color:#adadadcc}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-orange-400\/60{color:#fb923c99}.text-primary{--tw-text-opacity: 1;color:rgb(170 232 232 / var(--tw-text-opacity, 1))}.text-primary\/70{color:#aae8e8b3}.text-primary\/80{color:#aae8e8cc}.text-primary\/90{color:#aae8e8e6}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-secondary{--tw-text-opacity: 1;color:rgb(255 194 70 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/20{color:#fff3}.text-white\/30{color:#ffffff4d}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.text-white\/90{color:#ffffffe6}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.decoration-green-400\/60{text-decoration-color:#4ade8099}.decoration-white\/30{text-decoration-color:#ffffff4d}.underline-offset-2{text-underline-offset:2px}.placeholder-white\/30::-moz-placeholder{color:#ffffff4d}.placeholder-white\/30::placeholder{color:#ffffff4d}.placeholder-white\/40::-moz-placeholder{color:#fff6}.placeholder-white\/40::placeholder{color:#fff6}.placeholder-white\/50::-moz-placeholder{color:#ffffff80}.placeholder-white\/50::placeholder{color:#ffffff80}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.mix-blend-screen{mix-blend-mode:screen}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_0_rgba\(170\,232\,232\,0\.20\)\]{--tw-shadow: 0 0 6px 0 rgba(170,232,232,.2);--tw-shadow-colored: 0 0 6px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_8px_32px_0_rgba\(0\,0\,0\,0\.37\)\]{--tw-shadow: 0 8px 32px 0 rgba(0,0,0,.37);--tw-shadow-colored: 0 8px 32px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-accent-green\/50{--tw-shadow-color: rgb(165 229 182 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/20{--tw-shadow-color: rgb(170 232 232 / .2);--tw-shadow: var(--tw-shadow-colored)}.shadow-primary\/30{--tw-shadow-color: rgb(170 232 232 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-yellow-400\/20{--tw-shadow-color: rgb(250 204 21 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/50{--tw-ring-color: rgb(170 232 232 / .5)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-3xl{--tw-blur: blur(64px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\[120px\]{--tw-blur: blur(120px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-xl{--tw-blur: blur(24px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-\[0_0_6px_rgba\(59\,130\,246\,0\.8\)\]{--tw-drop-shadow: drop-shadow(0 0 6px rgba(59,130,246,.8));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-\[50px\]{--tw-backdrop-blur: blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-lg{--tw-backdrop-blur: blur(16px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.glass-card{border-radius:10px;--tw-backdrop-blur: blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);background:#0006}.glass-card-green{border-radius:10px;--tw-backdrop-blur: blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);background:linear-gradient(91deg,#2222226e 1.17%,#8787881a 99.82%)}.glass-card-orange{border-radius:10px;--tw-backdrop-blur: blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);background:linear-gradient(91deg,#fb787b33 1.17%,#fb787b1a 99.82%)}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-\[1\.02\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-dark-border:hover{--tw-border-opacity: 1;border-color:rgb(75 75 75 / var(--tw-border-opacity, 1))}.hover\:border-orange-400\/60:hover{border-color:#fb923c99}.hover\:border-primary:hover{--tw-border-opacity: 1;border-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.hover\:border-primary\/30:hover{border-color:#aae8e84d}.hover\:border-primary\/50:hover{border-color:#aae8e880}.hover\:border-secondary\/30:hover{border-color:#ffc2464d}.hover\:border-white\/20:hover{border-color:#fff3}.hover\:border-white\/30:hover{border-color:#ffffff4d}.hover\:border-yellow-500\/50:hover{border-color:#eab30880}.hover\:bg-\[\#2A2E2F\]:hover{--tw-bg-opacity: 1;background-color:rgb(42 46 47 / var(--tw-bg-opacity, 1))}.hover\:bg-accent-green\/10:hover{background-color:#a5e5b61a}.hover\:bg-accent-green\/20:hover{background-color:#a5e5b633}.hover\:bg-accent-green\/30:hover{background-color:#a5e5b64d}.hover\:bg-accent-purple\/30:hover{background-color:#eba0fc4d}.hover\:bg-accent-red\/10:hover{background-color:#fb787b1a}.hover\:bg-accent-red\/20:hover{background-color:#fb787b33}.hover\:bg-accent-red\/30:hover{background-color:#fb787b4d}.hover\:bg-black\/90:hover{background-color:#000000e6}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:#aae8e81a}.hover\:bg-primary\/30:hover{background-color:#aae8e84d}.hover\:bg-primary\/5:hover{background-color:#aae8e80d}.hover\:bg-primary\/80:hover{background-color:#aae8e8cc}.hover\:bg-primary\/90:hover{background-color:#aae8e8e6}.hover\:bg-red-500\/30:hover{background-color:#ef44444d}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary\/30:hover{background-color:#ffc2464d}.hover\:bg-secondary\/90:hover{background-color:#ffc246e6}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:bg-white\/5:hover{background-color:#ffffff0d}.hover\:bg-yellow-600:hover{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.hover\:from-cyan-500\/30:hover{--tw-gradient-from: rgb(6 182 212 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-primary\/30:hover{--tw-gradient-from: rgb(170 232 232 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-primary\/40:hover{--tw-gradient-from: rgb(170 232 232 / .4) var(--tw-gradient-from-position);--tw-gradient-to: rgb(170 232 232 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-red-500\/30:hover{--tw-gradient-from: rgb(239 68 68 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-white\/10:hover{--tw-gradient-from: rgb(255 255 255 / .1) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-cyan-400\/30:hover{--tw-gradient-to: rgb(34 211 238 / .3) var(--tw-gradient-to-position)}.hover\:to-primary\/20:hover{--tw-gradient-to: rgb(170 232 232 / .2) var(--tw-gradient-to-position)}.hover\:to-red-500\/20:hover{--tw-gradient-to: rgb(239 68 68 / .2) var(--tw-gradient-to-position)}.hover\:to-secondary\/40:hover{--tw-gradient-to: rgb(255 194 70 / .4) var(--tw-gradient-to-position)}.hover\:to-white\/15:hover{--tw-gradient-to: rgb(255 255 255 / .15) var(--tw-gradient-to-position)}.hover\:text-accent-green\/80:hover{color:#a5e5b6cc}.hover\:text-accent-red\/80:hover{color:#fb787bcc}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(173 173 173 / var(--tw-text-opacity, 1))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(170 232 232 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:#aae8e8cc}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:text-white\/80:hover{color:#fffc}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-accent-green\/20:hover{--tw-shadow-color: rgb(165 229 182 / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-primary\/10:hover{--tw-shadow-color: rgb(170 232 232 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-primary\/20:hover{--tw-shadow-color: rgb(170 232 232 / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-secondary\/10:hover{--tw-shadow-color: rgb(255 194 70 / .1);--tw-shadow: var(--tw-shadow-colored)}.hover\:shadow-secondary\/20:hover{--tw-shadow-color: rgb(255 194 70 / .2);--tw-shadow: var(--tw-shadow-colored)}.focus\:border-accent-purple\/50:focus{border-color:#eba0fc80}.focus\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.focus\:border-primary\/50:focus{border-color:#aae8e880}.focus\:border-transparent:focus{border-color:transparent}.focus\:bg-white\/10:focus{background-color:#ffffff1a}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(170 232 232 / var(--tw-ring-opacity, 1))}.focus\:ring-primary\/20:focus{--tw-ring-color: rgb(170 232 232 / .2)}.focus\:ring-primary\/50:focus{--tw-ring-color: rgb(170 232 232 / .5)}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:border-gray-500\/20:disabled{border-color:#6b728033}.disabled\:bg-gray-500\/10:disabled{background-color:#6b72801a}.disabled\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:translate-y-1{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/delete:hover .group-hover\/delete\:rotate-12,.group:hover .group-hover\:rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:border-white\/50{border-color:#ffffff80}.group:hover .group-hover\:bg-accent-green\/30{background-color:#a5e5b64d}.group:hover .group-hover\:bg-primary\/30{background-color:#aae8e84d}.group:hover .group-hover\:bg-white\/20{background-color:#fff3}.group:hover .group-hover\:text-primary{--tw-text-opacity: 1;color:rgb(170 232 232 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.group:hover .group-hover\:opacity-100{opacity:1}.peer:checked~.peer-checked\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:border-primary{--tw-border-opacity: 1;border-color:rgb(170 232 232 / var(--tw-border-opacity, 1))}.peer:checked~.peer-checked\:bg-primary\/20{background-color:#aae8e833}.group:has(:checked) .group-has-\[\:checked\]\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:has(:checked) .group-has-\[\:checked\]\:border-accent-green{--tw-border-opacity: 1;border-color:rgb(165 229 182 / var(--tw-border-opacity, 1))}.group:has(:checked) .group-has-\[\:checked\]\:border-accent-green\/50{border-color:#a5e5b680}.group:has(:checked) .group-has-\[\:checked\]\:border-accent-red{--tw-border-opacity: 1;border-color:rgb(251 120 123 / var(--tw-border-opacity, 1))}.group:has(:checked) .group-has-\[\:checked\]\:border-accent-red\/50{border-color:#fb787b80}.group:has(:checked) .group-has-\[\:checked\]\:bg-accent-green{--tw-bg-opacity: 1;background-color:rgb(165 229 182 / var(--tw-bg-opacity, 1))}.group:has(:checked) .group-has-\[\:checked\]\:bg-accent-green\/10{background-color:#a5e5b61a}.group:has(:checked) .group-has-\[\:checked\]\:bg-accent-red{--tw-bg-opacity: 1;background-color:rgb(251 120 123 / var(--tw-bg-opacity, 1))}.group:has(:checked) .group-has-\[\:checked\]\:bg-accent-red\/10{background-color:#fb787b1a}@media (min-width: 640px){.sm\:mx-0{margin-left:0;margin-right:0}.sm\:mb-10{margin-bottom:2.5rem}.sm\:mb-2{margin-bottom:.5rem}.sm\:mb-3{margin-bottom:.75rem}.sm\:mb-4{margin-bottom:1rem}.sm\:mb-6{margin-bottom:1.5rem}.sm\:ml-4{margin-left:1rem}.sm\:mr-4{margin-right:1rem}.sm\:mr-6{margin-right:1.5rem}.sm\:mt-2{margin-top:.5rem}.sm\:mt-8{margin-top:2rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-3{height:.75rem}.sm\:h-4{height:1rem}.sm\:h-48{height:12rem}.sm\:h-5{height:1.25rem}.sm\:h-64{height:16rem}.sm\:h-8{height:2rem}.sm\:h-9{height:2.25rem}.sm\:w-10{width:2.5rem}.sm\:w-3{width:.75rem}.sm\:w-32{width:8rem}.sm\:w-4{width:1rem}.sm\:w-48{width:12rem}.sm\:w-5{width:1.25rem}.sm\:w-64{width:16rem}.sm\:w-8{width:2rem}.sm\:w-auto{width:auto}.sm\:max-w-16{max-width:4rem}.sm\:max-w-xs{max-width:20rem}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:.5rem}.sm\:gap-2\.5{gap:.625rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:gap-6{gap:1.5rem}.sm\:space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:rounded-\[24px\]{border-radius:24px}.sm\:border{border-width:1px}.sm\:border-white\/20{border-color:#fff3}.sm\:p-1{padding:.25rem}.sm\:p-10{padding:2.5rem}.sm\:p-3\.5{padding:.875rem}.sm\:p-4{padding:1rem}.sm\:p-6{padding:1.5rem}.sm\:p-8{padding:2rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:pt-4{padding-top:1rem}.sm\:pt-6{padding-top:1.5rem}.sm\:text-right{text-align:right}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-\[10px\]{font-size:10px}.sm\:text-\[32px\]{font-size:32px}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}.sm\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 768px){.md\:block{display:block}.md\:grid{display:grid}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:gap-3{gap:.75rem}.md\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.md\:p-12{padding:3rem}.md\:p-4{padding:1rem}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:mb-3{margin-bottom:.75rem}.lg\:mb-4{margin-bottom:1rem}.lg\:mt-2{margin-top:.5rem}.lg\:mt-3{margin-top:.75rem}.lg\:mt-4{margin-top:1rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:hidden{display:none}.lg\:h-48{height:12rem}.lg\:h-64{height:16rem}.lg\:h-80{height:20rem}.lg\:w-7{width:1.75rem}.lg\:max-w-20{max-width:5rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:justify-between{justify-content:space-between}.lg\:gap-3{gap:.75rem}.lg\:gap-4{gap:1rem}.lg\:gap-6{gap:1.5rem}.lg\:p-6{padding:1.5rem}.lg\:p-\[15px\]{padding:15px}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:text-2xl{font-size:1.5rem;line-height:2rem}.lg\:text-\[30px\]{font-size:30px}.lg\:text-\[35px\]{font-size:35px}.lg\:text-base{font-size:1rem;line-height:1.5rem}.lg\:text-sm{font-size:.875rem;line-height:1.25rem}.lg\:text-xl{font-size:1.25rem;line-height:1.75rem}.lg\:text-xs{font-size:.75rem;line-height:1rem}}.sparkline-container[data-v-9bdf7700]{background:#0006;border-radius:10px;padding:16px;-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);transition:padding .2s ease-out;will-change:auto;contain:layout style}@media (min-width: 1024px){.sparkline-container[data-v-9bdf7700]{padding:24px}}.value-display[data-v-9bdf7700]{transition:color .3s ease-out;will-change:auto}.sparkline-svg[data-v-9bdf7700]{transition:all .2s ease-out;width:105px;height:30px}@media (min-width: 1024px){.sparkline-svg[data-v-9bdf7700]{width:131px;height:37px}}.sparkline-path[data-v-9bdf7700]{transition:d .5s ease-out,stroke-width .2s ease-out}.sparkline-path.animate-draw[data-v-9bdf7700]{stroke-dasharray:1000;stroke-dashoffset:1000;animation:drawPath-9bdf7700 1s ease-out forwards}.sparkline-fill[data-v-9bdf7700]{transition:d .5s ease-out,opacity .3s ease-out}.sparkline-dot[data-v-9bdf7700]{transition:cx .5s ease-out,cy .5s ease-out,r .2s ease-out}@keyframes drawPath-9bdf7700{to{stroke-dashoffset:0}}@keyframes fadeInFill-9bdf7700{to{opacity:1}}@keyframes fadeInDot-9bdf7700{to{opacity:1}}.sparkline-container:hover .sparkline-path[data-v-9bdf7700]{stroke-width:2.5}.sparkline-container:hover .sparkline-dot[data-v-9bdf7700]{r:3;animation:pulse-9bdf7700 2s infinite}@keyframes pulse-9bdf7700{0%,to{opacity:1}50%{opacity:.7}}.stats-cards-container[data-v-6e98c4b6]{will-change:auto;contain:layout}.stat-card[data-v-6e98c4b6]{transition:opacity .3s ease-out}.stat-card[data-v-6e98c4b6] .text-lg,.stat-card[data-v-6e98c4b6] .text-\[30px\]{transition:color .2s ease-out}canvas[data-v-d68902be]{width:100%;height:100%}.modal-enter-active[data-v-57e9f282]{transition:all .3s cubic-bezier(.4,0,.2,1)}.modal-leave-active[data-v-57e9f282]{transition:all .2s ease-in}.modal-enter-from[data-v-57e9f282]{opacity:0;transform:scale(.95) translateY(-10px)}.modal-leave-to[data-v-57e9f282]{opacity:0;transform:scale(1.05)}.custom-scrollbar[data-v-57e9f282]{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.3) transparent}.custom-scrollbar[data-v-57e9f282]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-57e9f282]::-webkit-scrollbar-track{background:#ffffff1a;border-radius:3px}.custom-scrollbar[data-v-57e9f282]::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:3px}.custom-scrollbar[data-v-57e9f282]::-webkit-scrollbar-thumb:hover{background:#fff6}.glass-card[data-v-57e9f282]{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px)}.fade-enter-active[data-v-71406a39],.fade-leave-active[data-v-71406a39]{transition:opacity .3s ease-out,transform .3s ease-out}.fade-enter-from[data-v-71406a39],.fade-leave-to[data-v-71406a39]{opacity:0;transform:translateY(-10px)}@keyframes spin-71406a39{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin[data-v-71406a39]{animation:spin-71406a39 .8s linear infinite}.packet-list-enter-active[data-v-71406a39],.packet-list-leave-active[data-v-71406a39],.packet-list-move[data-v-71406a39]{transition:all .4s ease-out}.packet-list-enter-from[data-v-71406a39]{opacity:0;transform:translateY(-30px) scale(.98)}.packet-list-enter-to[data-v-71406a39],.packet-list-leave-from[data-v-71406a39]{opacity:1;transform:translateY(0) scale(1)}.packet-list-leave-to[data-v-71406a39]{opacity:0;transform:translateY(-20px) scale(.95)}.packet-row[data-v-71406a39]{position:relative;transition:all .3s ease}.packet-list-enter-active .packet-row[data-v-71406a39]{background:linear-gradient(90deg,rgba(78,201,176,.1) 0%,rgba(78,201,176,.05) 50%,transparent 100%);box-shadow:0 0 20px #4ec9b033;border-left:3px solid rgba(78,201,176,.6);border-radius:8px;padding-left:12px}.packet-row[data-v-71406a39]:hover{background:#ffffff05;border-radius:8px;transition:background .2s ease}@media (max-width: 1023px){.filter-container[data-v-71406a39]{flex-direction:column;gap:1rem;align-items:stretch}.header-info[data-v-71406a39]{flex-direction:column;align-items:flex-start;gap:.5rem}.packet-count[data-v-71406a39]{order:1}.live-mode-badge[data-v-71406a39]{order:2;align-self:flex-start}.loading-indicator[data-v-71406a39],.error-indicator[data-v-71406a39]{order:3;align-self:flex-start}.filter-controls[data-v-71406a39]{display:grid!important;grid-template-columns:1fr 1fr;gap:.75rem;flex-direction:column}.filter-controls .flex.flex-col[data-v-71406a39]{flex-direction:column;align-items:stretch;gap:.25rem}.filter-controls .flex.flex-col label[data-v-71406a39]{margin-bottom:0;font-size:.75rem}.reset-container[data-v-71406a39]{grid-column:span 2!important;display:flex;justify-content:center;margin-top:.5rem}.pagination-container[data-v-71406a39]{flex-direction:column;gap:1rem;align-items:stretch}.pagination-info[data-v-71406a39]{justify-content:center;text-align:center;flex-direction:column;gap:.5rem}.load-more-section[data-v-71406a39]{justify-content:center}.load-more-count[data-v-71406a39]{display:none}.pagination-controls[data-v-71406a39]{justify-content:center}.page-numbers[data-v-71406a39]{max-width:200px;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.page-numbers[data-v-71406a39]::-webkit-scrollbar{display:none}.ellipsis[data-v-71406a39]{display:none}.page-number[data-v-71406a39]{min-width:40px;flex-shrink:0}}@media (max-width: 640px){.filter-controls[data-v-71406a39]{grid-template-columns:1fr!important;gap:.75rem}.reset-container[data-v-71406a39]{grid-column:span 1!important}.header-info h3[data-v-71406a39]{font-size:1.125rem}.packet-count[data-v-71406a39]{font-size:.75rem}.live-mode-badge[data-v-71406a39]{font-size:.75rem;padding:.25rem .5rem}.pagination-info span[data-v-71406a39]{font-size:.75rem}.prev-next-btn[data-v-71406a39]{min-width:40px;padding:.5rem}.page-numbers[data-v-71406a39]{max-width:150px;gap:.25rem}.page-number[data-v-71406a39]{min-width:36px;padding:.5rem .25rem;font-size:.75rem}.load-more-section button[data-v-71406a39]{font-size:.6rem;padding:.375rem .75rem}}.modal-enter-active[data-v-967bf6dc],.modal-leave-active[data-v-967bf6dc]{transition:opacity .2s ease}.modal-enter-from[data-v-967bf6dc],.modal-leave-to[data-v-967bf6dc]{opacity:0}.modal-enter-active>div[data-v-967bf6dc],.modal-leave-active>div[data-v-967bf6dc]{transition:transform .2s ease}.modal-enter-from>div[data-v-967bf6dc],.modal-leave-to>div[data-v-967bf6dc]{transform:scale(.95)}.packet-enter-active[data-v-967bf6dc],.packet-leave-active[data-v-967bf6dc]{transition:all .15s ease}.packet-enter-from[data-v-967bf6dc],.packet-leave-to[data-v-967bf6dc]{opacity:0;transform:translate(-50%) scale(.5)}.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.map-container[data-v-9c7dd490]{position:relative;background:transparent;border-radius:15px;overflow:hidden}.leaflet-map-container[data-v-9c7dd490]{background:linear-gradient(135deg,#09090bcc,#0009);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}.map-legend[data-v-9c7dd490]{position:absolute;top:10px;right:10px;background:#0006;border:1px solid rgba(255,255,255,.1);border-radius:15px;padding:12px;font-size:12px;color:#fff;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000;min-width:150px;max-width:180px;box-shadow:0 8px 32px #0000004d}.legend-title[data-v-9c7dd490]{font-weight:700;margin-bottom:10px;color:#fff;font-size:13px}.legend-section[data-v-9c7dd490]{margin-bottom:10px}.legend-section[data-v-9c7dd490]:last-of-type{margin-bottom:8px}.legend-subtitle[data-v-9c7dd490]{font-weight:600;margin-bottom:6px;color:#fffc;font-size:11px;text-transform:uppercase;letter-spacing:.5px}.legend-footer[data-v-9c7dd490]{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,.1);color:#fff9;font-size:10px;text-align:center}.legend-items[data-v-9c7dd490]{display:flex;flex-direction:column;gap:4px}.legend-item[data-v-9c7dd490]{display:flex;align-items:center;gap:6px}.legend-icon[data-v-9c7dd490]{width:8px;height:8px;border-radius:50%;border:1px solid rgba(255,255,255,.8);box-shadow:0 1px 2px #0003;flex-shrink:0}.legend-icon.cluster-icon[data-v-9c7dd490]{width:16px;height:16px;border-radius:50%;border:1px solid #AAE8E8;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.legend-line[data-v-9c7dd490]{width:16px;height:2px;border-radius:1px;flex-shrink:0;position:relative}.legend-line-dashed[data-v-9c7dd490]{background-image:repeating-linear-gradient(90deg,currentColor 0px,currentColor 4px,transparent 4px,transparent 8px)!important;background-color:transparent!important}.legend-line-dashed[style*="#FFC246"][data-v-9c7dd490]{color:#ffc246!important}.legend-line-dashed[style*="#ea580c"][data-v-9c7dd490]{color:#ea580c!important}.marker-highlight{position:relative!important;z-index:1000!important;animation:marker-glow-9c7dd490 1s ease-in-out infinite!important;border-radius:50%!important;box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6!important;transform:scale(1.2)!important}@keyframes marker-glow-9c7dd490{0%,to{box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6;filter:brightness(1)}50%{box-shadow:0 0 0 5px #a5e5b6,0 0 12px #a5e5b6,0 0 24px #a5e5b6;filter:brightness(1.3)}}@keyframes pulse-highlight-9c7dd490{0%{box-shadow:0 0 #3b82f6b3}70%{box-shadow:0 0 0 8px #3b82f600}to{box-shadow:0 0 #3b82f600}}.leaflet-popup-content-wrapper{background:#0006!important;color:#fff!important;border-radius:15px!important;box-shadow:0 8px 32px #0000004d!important;border:1px solid rgba(255,255,255,.1)!important;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important}.leaflet-popup-tip{background:#0006!important;border:1px solid rgba(255,255,255,.1)!important}.leaflet-popup-close-button{color:#fff9!important;font-size:18px!important}.leaflet-popup-close-button:hover{color:#fff!important}.custom-div-icon,.custom-cluster-icon{background:transparent!important;border:none!important}.custom-cluster-icon div{transition:all .3s ease!important;cursor:pointer!important}.custom-cluster-icon:hover div{transform:scale(1.1)!important;box-shadow:0 6px 16px #aae8e880!important}.leaflet-control-zoom{border:1px solid rgba(255,255,255,.1)!important;border-radius:15px!important;overflow:hidden;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important}.leaflet-control-zoom a{background-color:#0006!important;color:#fff!important;border-bottom:1px solid rgba(255,255,255,.1)!important;transition:all .2s ease!important}.leaflet-control-zoom a:hover{background-color:#ffffff1a!important;color:#fff!important}.leaflet-control-attribution{background-color:#1f2937cc!important;color:#9ca3af!important;border-top:1px solid rgba(75,85,99,.3)!important;border-radius:4px!important;padding:4px 8px!important;font-size:11px!important}.leaflet-control-attribution a{color:#60a5fa!important;text-decoration:none}.leaflet-control-attribution a:hover{color:#93c5fd!important;text-decoration:underline}.leaflet-bottom.leaflet-left .leaflet-control-attribution{margin-left:10px!important;margin-bottom:10px!important}.map-attribution[data-v-9c7dd490]{position:absolute;bottom:10px;left:10px;background:#0006;color:#fff9;border:1px solid rgba(255,255,255,.1);border-radius:15px;padding:4px 8px;font-size:10px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000}@media (max-width: 640px){.leaflet-control-attribution{display:none!important}}.plotly-chart[data-v-f0302052]{background:transparent!important}.glass-card[data-v-04026a5d]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#ffffff0d;border:1px solid rgba(255,255,255,.1)}.chart-updating[data-v-04026a5d]{animation:subtle-pulse-04026a5d .8s ease-in-out}@keyframes subtle-pulse-04026a5d{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.chart-container[data-v-04026a5d]{position:relative;transition:all .3s ease}.chart-container[data-v-04026a5d]:hover{background:#ffffff14}.process-row[data-v-04026a5d]{transition:all .3s ease}.process-row[data-v-04026a5d]:hover{background:#ffffff0d;transform:translate(2px)}.process-row-enter-active[data-v-04026a5d],.process-row-leave-active[data-v-04026a5d]{transition:all .4s ease}.process-row-enter-from[data-v-04026a5d]{opacity:0;transform:translateY(-10px) scale(.95)}.process-row-leave-to[data-v-04026a5d]{opacity:0;transform:translateY(10px) scale(.95)}.process-row-move[data-v-04026a5d]{transition:transform .4s ease}.cpu-value[data-v-04026a5d],.memory-value[data-v-04026a5d]{transition:all .3s ease;padding:2px 6px;border-radius:4px}.cpu-value[data-v-04026a5d]:hover,.memory-value[data-v-04026a5d]:hover{background:#f59e0b1a;transform:scale(1.05)}@keyframes value-update-04026a5d{0%{background:#f59e0b4d}to{background:transparent}}.value-updated[data-v-04026a5d]{animation:value-update-04026a5d .6s ease-out}.leaflet-pane[data-v-5793518c],.leaflet-tile[data-v-5793518c],.leaflet-marker-icon[data-v-5793518c],.leaflet-marker-shadow[data-v-5793518c],.leaflet-tile-container[data-v-5793518c],.leaflet-pane>svg[data-v-5793518c],.leaflet-pane>canvas[data-v-5793518c],.leaflet-zoom-box[data-v-5793518c],.leaflet-image-layer[data-v-5793518c],.leaflet-layer[data-v-5793518c]{position:absolute;left:0;top:0}.leaflet-container[data-v-5793518c]{overflow:hidden}.leaflet-tile[data-v-5793518c],.leaflet-marker-icon[data-v-5793518c],.leaflet-marker-shadow[data-v-5793518c]{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile[data-v-5793518c]::-moz-selection{background:transparent}.leaflet-tile[data-v-5793518c]::selection{background:transparent}.leaflet-safari .leaflet-tile[data-v-5793518c]{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container[data-v-5793518c]{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon[data-v-5793518c],.leaflet-marker-shadow[data-v-5793518c]{display:block}.leaflet-container .leaflet-overlay-pane svg[data-v-5793518c]{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img[data-v-5793518c],.leaflet-container .leaflet-shadow-pane img[data-v-5793518c],.leaflet-container .leaflet-tile-pane img[data-v-5793518c],.leaflet-container img.leaflet-image-layer[data-v-5793518c],.leaflet-container .leaflet-tile[data-v-5793518c]{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile[data-v-5793518c]{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom[data-v-5793518c]{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag[data-v-5793518c]{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom[data-v-5793518c]{touch-action:none}.leaflet-container[data-v-5793518c]{-webkit-tap-highlight-color:transparent}.leaflet-container a[data-v-5793518c]{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile[data-v-5793518c]{filter:inherit;visibility:hidden}.leaflet-tile-loaded[data-v-5793518c]{visibility:inherit}.leaflet-zoom-box[data-v-5793518c]{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg[data-v-5793518c]{-moz-user-select:none}.leaflet-pane[data-v-5793518c]{z-index:400}.leaflet-tile-pane[data-v-5793518c]{z-index:200}.leaflet-overlay-pane[data-v-5793518c]{z-index:400}.leaflet-shadow-pane[data-v-5793518c]{z-index:500}.leaflet-marker-pane[data-v-5793518c]{z-index:600}.leaflet-tooltip-pane[data-v-5793518c]{z-index:650}.leaflet-popup-pane[data-v-5793518c]{z-index:700}.leaflet-map-pane canvas[data-v-5793518c]{z-index:100}.leaflet-map-pane svg[data-v-5793518c]{z-index:200}.leaflet-vml-shape[data-v-5793518c]{width:1px;height:1px}.lvml[data-v-5793518c]{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control[data-v-5793518c]{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top[data-v-5793518c],.leaflet-bottom[data-v-5793518c]{position:absolute;z-index:1000;pointer-events:none}.leaflet-top[data-v-5793518c]{top:0}.leaflet-right[data-v-5793518c]{right:0}.leaflet-bottom[data-v-5793518c]{bottom:0}.leaflet-left[data-v-5793518c]{left:0}.leaflet-control[data-v-5793518c]{float:left;clear:both}.leaflet-right .leaflet-control[data-v-5793518c]{float:right}.leaflet-top .leaflet-control[data-v-5793518c]{margin-top:10px}.leaflet-bottom .leaflet-control[data-v-5793518c]{margin-bottom:10px}.leaflet-left .leaflet-control[data-v-5793518c]{margin-left:10px}.leaflet-right .leaflet-control[data-v-5793518c]{margin-right:10px}.leaflet-fade-anim .leaflet-popup[data-v-5793518c]{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup[data-v-5793518c]{opacity:1}.leaflet-zoom-animated[data-v-5793518c]{transform-origin:0 0}svg.leaflet-zoom-animated[data-v-5793518c]{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated[data-v-5793518c]{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile[data-v-5793518c],.leaflet-pan-anim .leaflet-tile[data-v-5793518c]{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide[data-v-5793518c]{visibility:hidden}.leaflet-interactive[data-v-5793518c]{cursor:pointer}.leaflet-grab[data-v-5793518c]{cursor:grab}.leaflet-crosshair[data-v-5793518c],.leaflet-crosshair .leaflet-interactive[data-v-5793518c]{cursor:crosshair}.leaflet-popup-pane[data-v-5793518c],.leaflet-control[data-v-5793518c]{cursor:auto}.leaflet-dragging .leaflet-grab[data-v-5793518c],.leaflet-dragging .leaflet-grab .leaflet-interactive[data-v-5793518c],.leaflet-dragging .leaflet-marker-draggable[data-v-5793518c]{cursor:move;cursor:grabbing}.leaflet-marker-icon[data-v-5793518c],.leaflet-marker-shadow[data-v-5793518c],.leaflet-image-layer[data-v-5793518c],.leaflet-pane>svg path[data-v-5793518c],.leaflet-tile-container[data-v-5793518c]{pointer-events:none}.leaflet-marker-icon.leaflet-interactive[data-v-5793518c],.leaflet-image-layer.leaflet-interactive[data-v-5793518c],.leaflet-pane>svg path.leaflet-interactive[data-v-5793518c],svg.leaflet-image-layer.leaflet-interactive path[data-v-5793518c]{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container[data-v-5793518c]{background:#ddd;outline-offset:1px}.leaflet-container a[data-v-5793518c]{color:#0078a8}.leaflet-zoom-box[data-v-5793518c]{border:2px dotted #38f;background:#ffffff80}.leaflet-container[data-v-5793518c]{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar[data-v-5793518c]{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a[data-v-5793518c]{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a[data-v-5793518c],.leaflet-control-layers-toggle[data-v-5793518c]{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a[data-v-5793518c]:hover,.leaflet-bar a[data-v-5793518c]:focus{background-color:#f4f4f4}.leaflet-bar a[data-v-5793518c]:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a[data-v-5793518c]:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled[data-v-5793518c]{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a[data-v-5793518c]{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a[data-v-5793518c]:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a[data-v-5793518c]:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in[data-v-5793518c],.leaflet-control-zoom-out[data-v-5793518c]{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in[data-v-5793518c],.leaflet-touch .leaflet-control-zoom-out[data-v-5793518c]{font-size:22px}.leaflet-control-layers[data-v-5793518c]{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle[data-v-5793518c]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle[data-v-5793518c]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle[data-v-5793518c]{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list[data-v-5793518c],.leaflet-control-layers-expanded .leaflet-control-layers-toggle[data-v-5793518c]{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list[data-v-5793518c]{display:block;position:relative}.leaflet-control-layers-expanded[data-v-5793518c]{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar[data-v-5793518c]{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector[data-v-5793518c]{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label[data-v-5793518c]{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator[data-v-5793518c]{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path[data-v-5793518c]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution[data-v-5793518c]{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution[data-v-5793518c],.leaflet-control-scale-line[data-v-5793518c]{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a[data-v-5793518c]{text-decoration:none}.leaflet-control-attribution a[data-v-5793518c]:hover,.leaflet-control-attribution a[data-v-5793518c]:focus{text-decoration:underline}.leaflet-attribution-flag[data-v-5793518c]{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale[data-v-5793518c]{margin-left:5px}.leaflet-bottom .leaflet-control-scale[data-v-5793518c]{margin-bottom:5px}.leaflet-control-scale-line[data-v-5793518c]{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line[data-v-5793518c]:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line[data-v-5793518c]:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution[data-v-5793518c],.leaflet-touch .leaflet-control-layers[data-v-5793518c],.leaflet-touch .leaflet-bar[data-v-5793518c]{box-shadow:none}.leaflet-touch .leaflet-control-layers[data-v-5793518c],.leaflet-touch .leaflet-bar[data-v-5793518c]{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup[data-v-5793518c]{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper[data-v-5793518c]{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content[data-v-5793518c]{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p[data-v-5793518c]{margin:1.3em 0}.leaflet-popup-tip-container[data-v-5793518c]{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip[data-v-5793518c]{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper[data-v-5793518c],.leaflet-popup-tip[data-v-5793518c]{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button[data-v-5793518c]{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button[data-v-5793518c]:hover,.leaflet-container a.leaflet-popup-close-button[data-v-5793518c]:focus{color:#585858}.leaflet-popup-scrolled[data-v-5793518c]{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper[data-v-5793518c]{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip[data-v-5793518c]{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom[data-v-5793518c],.leaflet-oldie .leaflet-control-layers[data-v-5793518c],.leaflet-oldie .leaflet-popup-content-wrapper[data-v-5793518c],.leaflet-oldie .leaflet-popup-tip[data-v-5793518c]{border:1px solid #999}.leaflet-div-icon[data-v-5793518c]{background:#fff;border:1px solid #666}.leaflet-tooltip[data-v-5793518c]{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive[data-v-5793518c]{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top[data-v-5793518c]:before,.leaflet-tooltip-bottom[data-v-5793518c]:before,.leaflet-tooltip-left[data-v-5793518c]:before,.leaflet-tooltip-right[data-v-5793518c]:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom[data-v-5793518c]{margin-top:6px}.leaflet-tooltip-top[data-v-5793518c]{margin-top:-6px}.leaflet-tooltip-bottom[data-v-5793518c]:before,.leaflet-tooltip-top[data-v-5793518c]:before{left:50%;margin-left:-6px}.leaflet-tooltip-top[data-v-5793518c]:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom[data-v-5793518c]:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left[data-v-5793518c]{margin-left:-6px}.leaflet-tooltip-right[data-v-5793518c]{margin-left:6px}.leaflet-tooltip-left[data-v-5793518c]:before,.leaflet-tooltip-right[data-v-5793518c]:before{top:50%;margin-top:-6px}.leaflet-tooltip-left[data-v-5793518c]:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right[data-v-5793518c]:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control[data-v-5793518c]{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.ml-0[data-v-59e9974c]{margin-left:0rem}.ml-4[data-v-59e9974c]{margin-left:1rem}.ml-8[data-v-59e9974c]{margin-left:2rem}.ml-12[data-v-59e9974c]{margin-left:3rem}.ml-16[data-v-59e9974c]{margin-left:4rem}.ml-20[data-v-59e9974c]{margin-left:5rem}.ml-24[data-v-59e9974c]{margin-left:6rem}.ml-28[data-v-59e9974c]{margin-left:7rem}.ml-32[data-v-59e9974c]{margin-left:8rem}.glass-card[data-v-854f5f55]{background:#ffffff0d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1)}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:-moz-fit-content;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.terminal-container[data-v-8d4a6a2a]{height:calc(100vh - 220px);min-height:400px;min-height:calc(100dvh - 220px)}@media (max-width: 768px){.terminal-container[data-v-8d4a6a2a]{height:calc(100vh - 140px);min-height:300px;min-height:calc(100dvh - 140px)}}@media (max-width: 640px){.terminal-container[data-v-8d4a6a2a]{height:calc(100vh - 120px);min-height:250px;min-height:calc(100dvh - 120px)}}[data-v-8d4a6a2a] .xterm{padding:1.5rem;height:100%!important}@media (max-width: 768px){[data-v-8d4a6a2a] .xterm{padding:1rem}}@media (max-width: 640px){[data-v-8d4a6a2a] .xterm{padding:.75rem}}[data-v-8d4a6a2a] .xterm-viewport,[data-v-8d4a6a2a] .xterm-screen{background-color:transparent!important}[data-v-8d4a6a2a] .xterm-selection{background-color:#00d9ff4d!important}kbd[data-v-8d4a6a2a]{font-family:Menlo,Monaco,Courier New,monospace;box-shadow:0 2px 4px #0003}.mobile-keyboard-input[data-v-8d4a6a2a]{position:absolute;bottom:0;left:0;width:1px;height:1px;opacity:.01;border:none;padding:0;margin:0;pointer-events:none;z-index:9999}.fullscreen-terminal[data-v-8d4a6a2a]{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;margin:0!important;border-radius:0!important;z-index:9999!important}.fullscreen-content[data-v-8d4a6a2a]{height:100%!important;min-height:100%!important}.fullscreen-terminal[data-v-8d4a6a2a] .xterm{padding:2rem}@media (max-width: 768px){.fullscreen-terminal[data-v-8d4a6a2a] .xterm{padding:1rem}}.full-window-terminal[data-v-8d4a6a2a]{position:fixed!important;inset:0;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;max-height:100dvh!important;z-index:9998;border-radius:0!important;margin:0!important;overflow:hidden}.full-window-terminal .terminal-container[data-v-8d4a6a2a]{height:100vh!important;height:100dvh!important;width:100vw!important;overflow:auto}.full-window-terminal[data-v-8d4a6a2a] .xterm{padding:1rem;height:100%!important}@media (max-width: 768px){.full-window-terminal[data-v-8d4a6a2a]{touch-action:none}.full-window-terminal .terminal-container[data-v-8d4a6a2a]{overscroll-behavior:none}.full-window-terminal[data-v-8d4a6a2a] .xterm{padding:.75rem}}.login-card[data-v-79c5750f]{background:#11191c66;backdrop-filter:blur(40px) saturate(180%);-webkit-backdrop-filter:blur(40px) saturate(180%)}.input-glass[data-v-79c5750f]{backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}.input-glass[data-v-79c5750f]:focus{box-shadow:0 0 0 1px #aae8e833,0 0 20px #aae8e826,inset 0 1px #ffffff1a}.input-glow[data-v-79c5750f]{opacity:0;transition:opacity .3s ease;box-shadow:inset 0 1px #ffffff0d}.input-glass:focus+.input-glow[data-v-79c5750f]{opacity:1;box-shadow:0 0 20px #aae8e833,inset 0 1px #ffffff1a}.button-glass[data-v-79c5750f]{backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);position:relative}.button-glass[data-v-79c5750f]:before{content:"";position:absolute;inset:0;border-radius:12px;padding:1px;background:linear-gradient(90deg,transparent 0%,rgba(170,232,232,.3) 50%,transparent 100%);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;transform:translate(-100%);transition:transform 1s ease}.button-glass[data-v-79c5750f]:hover:not(:disabled):before{transform:translate(100%)}.button-glass[data-v-79c5750f]{box-shadow:0 0 0 1px #aae8e833,0 4px 16px #0003,inset 0 1px #ffffff1a}.button-glass[data-v-79c5750f]:hover:not(:disabled){box-shadow:0 0 0 1px #aae8e866,0 0 30px #aae8e84d,0 4px 20px #0000004d,inset 0 1px #ffffff26}.login-content:has(.button-glass:hover:not(:disabled)) .logo-image[data-v-79c5750f]{filter:brightness(1.4) drop-shadow(0 0 12px rgba(170,232,232,.7));transform:scale(1.02)}.login-content:has(.button-glass:hover:not(:disabled)) .logo-glow[data-v-79c5750f]{opacity:.6;transform:scale(1.15)}@keyframes float-79c5750f{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse-slow-79c5750f{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.05)}}@keyframes pulse-slower-79c5750f{0%,to{opacity:.75;transform:scale(1)}50%{opacity:.5;transform:scale(1.08)}}@keyframes pulse-slowest-79c5750f{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.06)}}.animate-pulse-slow[data-v-79c5750f]{animation:pulse-slow-79c5750f 8s ease-in-out infinite}.animate-pulse-slower[data-v-79c5750f]{animation:pulse-slower-79c5750f 10s ease-in-out infinite}.animate-pulse-slowest[data-v-79c5750f]{animation:pulse-slowest-79c5750f 12s ease-in-out infinite}@keyframes shake-79c5750f{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-5px)}20%,40%,60%,80%{transform:translate(5px)}}.animate-shake[data-v-79c5750f]{animation:shake-79c5750f .5s ease-in-out}.form-group[data-v-79c5750f]{position:relative}.form-group:hover label[data-v-79c5750f]{color:#aae8e8e6;transition:color .3s ease}.glass-card[data-v-5f6343d4]{background:#ffffff0d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1)}.modal-enter-active[data-v-5f6343d4],.modal-leave-active[data-v-5f6343d4]{transition:opacity .3s ease}.modal-enter-from[data-v-5f6343d4],.modal-leave-to[data-v-5f6343d4]{opacity:0}.modal-enter-active .glass-card[data-v-5f6343d4],.modal-leave-active .glass-card[data-v-5f6343d4]{transition:transform .3s ease}.modal-enter-from .glass-card[data-v-5f6343d4],.modal-leave-to .glass-card[data-v-5f6343d4]{transform:scale(.9)}.slide-enter-active[data-v-5f6343d4],.slide-leave-active[data-v-5f6343d4]{transition:all .3s ease}.slide-enter-from[data-v-5f6343d4],.slide-leave-to[data-v-5f6343d4]{opacity:0;transform:translateY(-10px)}@keyframes float-slow-5f6343d4{0%,to{opacity:.8;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.6;transform:translate(20px,-20px) scale(1.05) rotate(-24.22deg)}}@keyframes float-slower-5f6343d4{0%,to{opacity:.75;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.5;transform:translate(-30px,20px) scale(1.08) rotate(-24.22deg)}}@keyframes float-slowest-5f6343d4{0%,to{opacity:.8;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.55;transform:translate(25px,25px) scale(1.1) rotate(-24.22deg)}}.animate-pulse-slow[data-v-5f6343d4]{animation:float-slow-5f6343d4 15s ease-in-out infinite;will-change:transform,opacity}.animate-pulse-slower[data-v-5f6343d4]{animation:float-slower-5f6343d4 18s ease-in-out infinite;will-change:transform,opacity}.animate-pulse-slowest[data-v-5f6343d4]{animation:float-slowest-5f6343d4 20s ease-in-out infinite;will-change:transform,opacity}@keyframes sparkline-draw-ad12b3cb{0%{stroke-dasharray:1000;stroke-dashoffset:1000}to{stroke-dasharray:1000;stroke-dashoffset:0}}.sparkline-animate[data-v-ad12b3cb]{animation:sparkline-draw-ad12b3cb 1s ease-out}.glass-card[data-v-a5eb8c7f]{background:#000000b3;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.1)}@keyframes ping-a5eb8c7f{75%,to{transform:scale(2);opacity:0}}@keyframes ping-fast-a5eb8c7f{0%{transform:scale(1);opacity:1}75%,to{transform:scale(4);opacity:0}}.animate-ping[data-v-a5eb8c7f]{animation:ping-a5eb8c7f cubic-bezier(0,0,.2,1) infinite}.animate-ping-fast[data-v-a5eb8c7f]{animation:ping-fast-a5eb8c7f .8s cubic-bezier(0,0,.2,1) 3}body{background-color:#09090b!important;color:#fff!important;margin:0;padding:0}html{scrollbar-width:thin;scrollbar-color:#374151 #1f2937}html::-webkit-scrollbar{width:8px}html::-webkit-scrollbar-track{background:#1f2937}html::-webkit-scrollbar-thumb{background-color:#374151;border-radius:4px}html::-webkit-scrollbar-thumb:hover{background-color:#4b5563}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none} diff --git a/repeater/web/html/assets/index-BAQsJZnI.js b/repeater/web/html/assets/index-CTGOZYs8.js similarity index 68% rename from repeater/web/html/assets/index-BAQsJZnI.js rename to repeater/web/html/assets/index-CTGOZYs8.js index 88057a9..1db6992 100644 --- a/repeater/web/html/assets/index-BAQsJZnI.js +++ b/repeater/web/html/assets/index-CTGOZYs8.js @@ -1,54 +1,54 @@ -function kie(t,e){for(var r=0;rc[S]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))c(S);new MutationObserver(S=>{for(const H of S)if(H.type==="childList")for(const Z of H.addedNodes)Z.tagName==="LINK"&&Z.rel==="modulepreload"&&c(Z)}).observe(document,{childList:!0,subtree:!0});function r(S){const H={};return S.integrity&&(H.integrity=S.integrity),S.referrerPolicy&&(H.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?H.credentials="include":S.crossOrigin==="anonymous"?H.credentials="omit":H.credentials="same-origin",H}function c(S){if(S.ep)return;S.ep=!0;const H=r(S);fetch(S.href,H)}})();/** +function Cie(t,e){for(var r=0;rc[S]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const S of document.querySelectorAll('link[rel="modulepreload"]'))c(S);new MutationObserver(S=>{for(const $ of S)if($.type==="childList")for(const Z of $.addedNodes)Z.tagName==="LINK"&&Z.rel==="modulepreload"&&c(Z)}).observe(document,{childList:!0,subtree:!0});function r(S){const $={};return S.integrity&&($.integrity=S.integrity),S.referrerPolicy&&($.referrerPolicy=S.referrerPolicy),S.crossOrigin==="use-credentials"?$.credentials="include":S.crossOrigin==="anonymous"?$.credentials="omit":$.credentials="same-origin",$}function c(S){if(S.ep)return;S.ep=!0;const $=r(S);fetch(S.href,$)}})();/** * @vue/shared v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function nE(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const Cf={},A2=[],Ev=()=>{},Tie=()=>!1,uS=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),aE=t=>t.startsWith("onUpdate:"),zp=Object.assign,oE=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},Sie=Object.prototype.hasOwnProperty,Zh=(t,e)=>Sie.call(t,e),du=Array.isArray,M2=t=>K5(t)==="[object Map]",cS=t=>K5(t)==="[object Set]",mO=t=>K5(t)==="[object Date]",Xu=t=>typeof t=="function",Ad=t=>typeof t=="string",Fg=t=>typeof t=="symbol",Af=t=>t!==null&&typeof t=="object",HN=t=>(Af(t)||Xu(t))&&Xu(t.then)&&Xu(t.catch),VN=Object.prototype.toString,K5=t=>VN.call(t),Cie=t=>K5(t).slice(8,-1),WN=t=>K5(t)==="[object Object]",sE=t=>Ad(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,c5=nE(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),hS=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Aie=/-(\w)/g,bg=hS(t=>t.replace(Aie,(e,r)=>r?r.toUpperCase():"")),Mie=/\B([A-Z])/g,g_=hS(t=>t.replace(Mie,"-$1").toLowerCase()),fS=hS(t=>t.charAt(0).toUpperCase()+t.slice(1)),s7=hS(t=>t?`on${fS(t)}`:""),l_=(t,e)=>!Object.is(t,e),oT=(t,...e)=>{for(let r=0;r{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:c,value:r})},LT=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Eie=t=>{const e=Ad(t)?Number(t):NaN;return isNaN(e)?t:e};let gO;const dS=()=>gO||(gO=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function om(t){if(du(t)){const e={};for(let r=0;r{if(r){const c=r.split(Pie);c.length>1&&(e[c[0].trim()]=c[1].trim())}}),e}function eo(t){let e="";if(Ad(t))e=t;else if(du(t))for(let r=0;rz2(r,e))}const GN=t=>!!(t&&t.__v_isRef===!0),Si=t=>Ad(t)?t:t==null?"":du(t)||Af(t)&&(t.toString===VN||!Xu(t.toString))?GN(t)?Si(t.value):JSON.stringify(t,ZN,2):String(t),ZN=(t,e)=>GN(e)?ZN(t,e.value):M2(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[c,S],H)=>(r[l7(c,H)+" =>"]=S,r),{})}:cS(e)?{[`Set(${e.size})`]:[...e.values()].map(r=>l7(r))}:Fg(e)?l7(e):Af(e)&&!du(e)&&!WN(e)?String(e):e,l7=(t,e="")=>{var r;return Fg(t)?`Symbol(${(r=t.description)!=null?r:e})`:t};/** +**//*! #__NO_SIDE_EFFECTS__ */function oE(t){const e=Object.create(null);for(const r of t.split(","))e[r]=1;return r=>r in e}const Cf={},M2=[],Ev=()=>{},Aie=()=>!1,h8=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),sE=t=>t.startsWith("onUpdate:"),Op=Object.assign,lE=(t,e)=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)},Mie=Object.prototype.hasOwnProperty,Zh=(t,e)=>Mie.call(t,e),du=Array.isArray,E2=t=>X5(t)==="[object Map]",f8=t=>X5(t)==="[object Set]",vO=t=>X5(t)==="[object Date]",Xu=t=>typeof t=="function",Md=t=>typeof t=="string",Fg=t=>typeof t=="symbol",Mf=t=>t!==null&&typeof t=="object",WN=t=>(Mf(t)||Xu(t))&&Xu(t.then)&&Xu(t.catch),qN=Object.prototype.toString,X5=t=>qN.call(t),Eie=t=>X5(t).slice(8,-1),GN=t=>X5(t)==="[object Object]",uE=t=>Md(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,f5=oE(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),d8=t=>{const e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Lie=/-(\w)/g,wg=d8(t=>t.replace(Lie,(e,r)=>r?r.toUpperCase():"")),Pie=/\B([A-Z])/g,x_=d8(t=>t.replace(Pie,"-$1").toLowerCase()),p8=d8(t=>t.charAt(0).toUpperCase()+t.slice(1)),u7=d8(t=>t?`on${p8(t)}`:""),h_=(t,e)=>!Object.is(t,e),lT=(t,...e)=>{for(let r=0;r{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:c,value:r})},IT=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Iie=t=>{const e=Md(t)?Number(t):NaN;return isNaN(e)?t:e};let yO;const m8=()=>yO||(yO=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function om(t){if(du(t)){const e={};for(let r=0;r{if(r){const c=r.split(zie);c.length>1&&(e[c[0].trim()]=c[1].trim())}}),e}function Ga(t){let e="";if(Md(t))e=t;else if(du(t))for(let r=0;rO2(r,e))}const KN=t=>!!(t&&t.__v_isRef===!0),ki=t=>Md(t)?t:t==null?"":du(t)||Mf(t)&&(t.toString===qN||!Xu(t.toString))?KN(t)?ki(t.value):JSON.stringify(t,YN,2):String(t),YN=(t,e)=>KN(e)?YN(t,e.value):E2(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((r,[c,S],$)=>(r[c7(c,$)+" =>"]=S,r),{})}:f8(e)?{[`Set(${e.size})`]:[...e.values()].map(r=>c7(r))}:Fg(e)?c7(e):Mf(e)&&!du(e)&&!GN(e)?String(e):e,c7=(t,e="")=>{var r;return Fg(t)?`Symbol(${(r=t.description)!=null?r:e})`:t};/** * @vue/reactivity v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let O0;class KN{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=O0,!e&&O0&&(this.index=(O0.scopes||(O0.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e0&&--this._on===0&&(O0=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,c;for(r=0,c=this.effects.length;r0)return;if(f5){let e=f5;for(f5=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;h5;){let e=h5;for(h5=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(c){t||(t=c)}e=r}}if(t)throw t}function tj(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function rj(t){let e,r=t.depsTail,c=r;for(;c;){const S=c.prevDep;c.version===-1?(c===r&&(r=S),cE(c),Nie(c)):e=c,c.dep.activeLink=c.prevActiveLink,c.prevActiveLink=void 0,c=S}t.deps=e,t.depsTail=r}function AM(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ij(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function ij(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===A5)||(t.globalVersion=A5,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!AM(t))))return;t.flags|=2;const e=t.dep,r=zf,c=Rg;zf=t,Rg=!0;try{tj(t);const S=t.fn(t._value);(e.version===0||l_(S,t._value))&&(t.flags|=128,t._value=S,e.version++)}catch(S){throw e.version++,S}finally{zf=r,Rg=c,rj(t),t.flags&=-3}}function cE(t,e=!1){const{dep:r,prevSub:c,nextSub:S}=t;if(c&&(c.nextSub=S,t.prevSub=void 0),S&&(S.prevSub=c,t.nextSub=void 0),r.subs===t&&(r.subs=c,!c&&r.computed)){r.computed.flags&=-5;for(let H=r.computed.deps;H;H=H.nextDep)cE(H,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function Nie(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let Rg=!0;const nj=[];function N1(){nj.push(Rg),Rg=!1}function j1(){const t=nj.pop();Rg=t===void 0?!0:t}function vO(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=zf;zf=void 0;try{e()}finally{zf=r}}}let A5=0;class jie{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hE{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!zf||!Rg||zf===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==zf)r=this.activeLink=new jie(zf,this),zf.deps?(r.prevDep=zf.depsTail,zf.depsTail.nextDep=r,zf.depsTail=r):zf.deps=zf.depsTail=r,aj(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const c=r.nextDep;c.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=c),r.prevDep=zf.depsTail,r.nextDep=void 0,zf.depsTail.nextDep=r,zf.depsTail=r,zf.deps===r&&(zf.deps=c)}return r}trigger(e){this.version++,A5++,this.notify(e)}notify(e){lE();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{uE()}}}function aj(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let c=e.deps;c;c=c.nextDep)aj(c)}const r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}const PT=new WeakMap,Ax=Symbol(""),MM=Symbol(""),M5=Symbol("");function B0(t,e,r){if(Rg&&zf){let c=PT.get(t);c||PT.set(t,c=new Map);let S=c.get(r);S||(c.set(r,S=new hE),S.map=c,S.key=r),S.track()}}function P1(t,e,r,c,S,H){const Z=PT.get(t);if(!Z){A5++;return}const ue=be=>{be&&be.trigger()};if(lE(),e==="clear")Z.forEach(ue);else{const be=du(t),Se=be&&sE(r);if(be&&r==="length"){const Re=Number(c);Z.forEach((Xe,vt)=>{(vt==="length"||vt===M5||!Fg(vt)&&vt>=Re)&&ue(Xe)})}else switch((r!==void 0||Z.has(void 0))&&ue(Z.get(r)),Se&&ue(Z.get(M5)),e){case"add":be?Se&&ue(Z.get("length")):(ue(Z.get(Ax)),M2(t)&&ue(Z.get(MM)));break;case"delete":be||(ue(Z.get(Ax)),M2(t)&&ue(Z.get(MM)));break;case"set":M2(t)&&ue(Z.get(Ax));break}}uE()}function Uie(t,e){const r=PT.get(t);return r&&r.get(e)}function h2(t){const e=Ou(t);return e===t?e:(B0(e,"iterate",M5),vg(t)?e:e.map(y0))}function pS(t){return B0(t=Ou(t),"iterate",M5),t}const $ie={__proto__:null,[Symbol.iterator](){return c7(this,Symbol.iterator,y0)},concat(...t){return h2(this).concat(...t.map(e=>du(e)?h2(e):e))},entries(){return c7(this,"entries",t=>(t[1]=y0(t[1]),t))},every(t,e){return m1(this,"every",t,e,void 0,arguments)},filter(t,e){return m1(this,"filter",t,e,r=>r.map(y0),arguments)},find(t,e){return m1(this,"find",t,e,y0,arguments)},findIndex(t,e){return m1(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return m1(this,"findLast",t,e,y0,arguments)},findLastIndex(t,e){return m1(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return m1(this,"forEach",t,e,void 0,arguments)},includes(...t){return h7(this,"includes",t)},indexOf(...t){return h7(this,"indexOf",t)},join(t){return h2(this).join(t)},lastIndexOf(...t){return h7(this,"lastIndexOf",t)},map(t,e){return m1(this,"map",t,e,void 0,arguments)},pop(){return C3(this,"pop")},push(...t){return C3(this,"push",t)},reduce(t,...e){return yO(this,"reduce",t,e)},reduceRight(t,...e){return yO(this,"reduceRight",t,e)},shift(){return C3(this,"shift")},some(t,e){return m1(this,"some",t,e,void 0,arguments)},splice(...t){return C3(this,"splice",t)},toReversed(){return h2(this).toReversed()},toSorted(t){return h2(this).toSorted(t)},toSpliced(...t){return h2(this).toSpliced(...t)},unshift(...t){return C3(this,"unshift",t)},values(){return c7(this,"values",y0)}};function c7(t,e,r){const c=pS(t),S=c[e]();return c!==t&&!vg(t)&&(S._next=S.next,S.next=()=>{const H=S._next();return H.value&&(H.value=r(H.value)),H}),S}const Hie=Array.prototype;function m1(t,e,r,c,S,H){const Z=pS(t),ue=Z!==t&&!vg(t),be=Z[e];if(be!==Hie[e]){const Xe=be.apply(t,H);return ue?y0(Xe):Xe}let Se=r;Z!==t&&(ue?Se=function(Xe,vt){return r.call(this,y0(Xe),vt,t)}:r.length>2&&(Se=function(Xe,vt){return r.call(this,Xe,vt,t)}));const Re=be.call(Z,Se,c);return ue&&S?S(Re):Re}function yO(t,e,r,c){const S=pS(t);let H=r;return S!==t&&(vg(t)?r.length>3&&(H=function(Z,ue,be){return r.call(this,Z,ue,be,t)}):H=function(Z,ue,be){return r.call(this,Z,y0(ue),be,t)}),S[e](H,...c)}function h7(t,e,r){const c=Ou(t);B0(c,"iterate",M5);const S=c[e](...r);return(S===-1||S===!1)&&pE(r[0])?(r[0]=Ou(r[0]),c[e](...r)):S}function C3(t,e,r=[]){N1(),lE();const c=Ou(t)[e].apply(t,r);return uE(),j1(),c}const Vie=nE("__proto__,__v_isRef,__isVue"),oj=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Fg));function Wie(t){Fg(t)||(t=String(t));const e=Ou(this);return B0(e,"has",t),e.hasOwnProperty(t)}class sj{constructor(e=!1,r=!1){this._isReadonly=e,this._isShallow=r}get(e,r,c){if(r==="__v_skip")return e.__v_skip;const S=this._isReadonly,H=this._isShallow;if(r==="__v_isReactive")return!S;if(r==="__v_isReadonly")return S;if(r==="__v_isShallow")return H;if(r==="__v_raw")return c===(S?H?tne:hj:H?cj:uj).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(c)?e:void 0;const Z=du(e);if(!S){let be;if(Z&&(be=$ie[r]))return be;if(r==="hasOwnProperty")return Wie}const ue=Reflect.get(e,r,up(e)?e:c);return(Fg(r)?oj.has(r):Vie(r))||(S||B0(e,"get",r),H)?ue:up(ue)?Z&&sE(r)?ue:ue.value:Af(ue)?S?dj(ue):Ox(ue):ue}}class lj extends sj{constructor(e=!1){super(!1,e)}set(e,r,c,S){let H=e[r];if(!this._isShallow){const be=f_(H);if(!vg(c)&&!f_(c)&&(H=Ou(H),c=Ou(c)),!du(e)&&up(H)&&!up(c))return be?!1:(H.value=c,!0)}const Z=du(e)&&sE(r)?Number(r)t,Ak=t=>Reflect.getPrototypeOf(t);function Yie(t,e,r){return function(...c){const S=this.__v_raw,H=Ou(S),Z=M2(H),ue=t==="entries"||t===Symbol.iterator&&Z,be=t==="keys"&&Z,Se=S[t](...c),Re=r?EM:e?IT:y0;return!e&&B0(H,"iterate",be?MM:Ax),{next(){const{value:Xe,done:vt}=Se.next();return vt?{value:Xe,done:vt}:{value:ue?[Re(Xe[0]),Re(Xe[1])]:Re(Xe),done:vt}},[Symbol.iterator](){return this}}}}function Mk(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function Xie(t,e){const r={get(S){const H=this.__v_raw,Z=Ou(H),ue=Ou(S);t||(l_(S,ue)&&B0(Z,"get",S),B0(Z,"get",ue));const{has:be}=Ak(Z),Se=e?EM:t?IT:y0;if(be.call(Z,S))return Se(H.get(S));if(be.call(Z,ue))return Se(H.get(ue));H!==Z&&H.get(S)},get size(){const S=this.__v_raw;return!t&&B0(Ou(S),"iterate",Ax),Reflect.get(S,"size",S)},has(S){const H=this.__v_raw,Z=Ou(H),ue=Ou(S);return t||(l_(S,ue)&&B0(Z,"has",S),B0(Z,"has",ue)),S===ue?H.has(S):H.has(S)||H.has(ue)},forEach(S,H){const Z=this,ue=Z.__v_raw,be=Ou(ue),Se=e?EM:t?IT:y0;return!t&&B0(be,"iterate",Ax),ue.forEach((Re,Xe)=>S.call(H,Se(Re),Se(Xe),Z))}};return zp(r,t?{add:Mk("add"),set:Mk("set"),delete:Mk("delete"),clear:Mk("clear")}:{add(S){!e&&!vg(S)&&!f_(S)&&(S=Ou(S));const H=Ou(this);return Ak(H).has.call(H,S)||(H.add(S),P1(H,"add",S,S)),this},set(S,H){!e&&!vg(H)&&!f_(H)&&(H=Ou(H));const Z=Ou(this),{has:ue,get:be}=Ak(Z);let Se=ue.call(Z,S);Se||(S=Ou(S),Se=ue.call(Z,S));const Re=be.call(Z,S);return Z.set(S,H),Se?l_(H,Re)&&P1(Z,"set",S,H):P1(Z,"add",S,H),this},delete(S){const H=Ou(this),{has:Z,get:ue}=Ak(H);let be=Z.call(H,S);be||(S=Ou(S),be=Z.call(H,S)),ue&&ue.call(H,S);const Se=H.delete(S);return be&&P1(H,"delete",S,void 0),Se},clear(){const S=Ou(this),H=S.size!==0,Z=S.clear();return H&&P1(S,"clear",void 0,void 0),Z}}),["keys","values","entries",Symbol.iterator].forEach(S=>{r[S]=Yie(S,t,e)}),r}function fE(t,e){const r=Xie(t,e);return(c,S,H)=>S==="__v_isReactive"?!t:S==="__v_isReadonly"?t:S==="__v_raw"?c:Reflect.get(Zh(r,S)&&S in c?r:c,S,H)}const Jie={get:fE(!1,!1)},Qie={get:fE(!1,!0)},ene={get:fE(!0,!1)};const uj=new WeakMap,cj=new WeakMap,hj=new WeakMap,tne=new WeakMap;function rne(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ine(t){return t.__v_skip||!Object.isExtensible(t)?0:rne(Cie(t))}function Ox(t){return f_(t)?t:dE(t,!1,Gie,Jie,uj)}function fj(t){return dE(t,!1,Kie,Qie,cj)}function dj(t){return dE(t,!0,Zie,ene,hj)}function dE(t,e,r,c,S){if(!Af(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const H=ine(t);if(H===0)return t;const Z=S.get(t);if(Z)return Z;const ue=new Proxy(t,H===2?c:r);return S.set(t,ue),ue}function u_(t){return f_(t)?u_(t.__v_raw):!!(t&&t.__v_isReactive)}function f_(t){return!!(t&&t.__v_isReadonly)}function vg(t){return!!(t&&t.__v_isShallow)}function pE(t){return t?!!t.__v_raw:!1}function Ou(t){const e=t&&t.__v_raw;return e?Ou(e):t}function mE(t){return!Zh(t,"__v_skip")&&Object.isExtensible(t)&&CM(t,"__v_skip",!0),t}const y0=t=>Af(t)?Ox(t):t,IT=t=>Af(t)?dj(t):t;function up(t){return t?t.__v_isRef===!0:!1}function vn(t){return pj(t,!1)}function nne(t){return pj(t,!0)}function pj(t,e){return up(t)?t:new ane(t,e)}class ane{constructor(e,r){this.dep=new hE,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?e:Ou(e),this._value=r?e:y0(e),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(e){const r=this._rawValue,c=this.__v_isShallow||vg(e)||f_(e);e=c?e:Ou(e),l_(e,r)&&(this._rawValue=e,this._value=c?e:y0(e),this.dep.trigger())}}function Po(t){return up(t)?t.value:t}const one={get:(t,e,r)=>e==="__v_raw"?t:Po(Reflect.get(t,e,r)),set:(t,e,r,c)=>{const S=t[e];return up(S)&&!up(r)?(S.value=r,!0):Reflect.set(t,e,r,c)}};function mj(t){return u_(t)?t:new Proxy(t,one)}function sne(t){const e=du(t)?new Array(t.length):{};for(const r in t)e[r]=une(t,r);return e}class lne{constructor(e,r,c){this._object=e,this._key=r,this._defaultValue=c,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Uie(Ou(this._object),this._key)}}function une(t,e,r){const c=t[e];return up(c)?c:new lne(t,e,r)}class cne{constructor(e,r,c){this.fn=e,this.setter=r,this._value=void 0,this.dep=new hE(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=A5-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=c}notify(){if(this.flags|=16,!(this.flags&8)&&zf!==this)return ej(this,!0),!0}get value(){const e=this.dep.track();return ij(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function hne(t,e,r=!1){let c,S;return Xu(t)?c=t:(c=t.get,S=t.set),new cne(c,S,r)}const Ek={},DT=new WeakMap;let fx;function fne(t,e=!1,r=fx){if(r){let c=DT.get(r);c||DT.set(r,c=[]),c.push(t)}}function dne(t,e,r=Cf){const{immediate:c,deep:S,once:H,scheduler:Z,augmentJob:ue,call:be}=r,Se=ur=>S?ur:vg(ur)||S===!1||S===0?I1(ur,1):I1(ur);let Re,Xe,vt,bt,kt=!1,Dt=!1;if(up(t)?(Xe=()=>t.value,kt=vg(t)):u_(t)?(Xe=()=>Se(t),kt=!0):du(t)?(Dt=!0,kt=t.some(ur=>u_(ur)||vg(ur)),Xe=()=>t.map(ur=>{if(up(ur))return ur.value;if(u_(ur))return Se(ur);if(Xu(ur))return be?be(ur,2):ur()})):Xu(t)?e?Xe=be?()=>be(t,2):t:Xe=()=>{if(vt){N1();try{vt()}finally{j1()}}const ur=fx;fx=Re;try{return be?be(t,3,[bt]):t(bt)}finally{fx=ur}}:Xe=Ev,e&&S){const ur=Xe,Ir=S===!0?1/0:S;Xe=()=>I1(ur(),Ir)}const rr=XN(),Er=()=>{Re.stop(),rr&&rr.active&&oE(rr.effects,Re)};if(H&&e){const ur=e;e=(...Ir)=>{ur(...Ir),Er()}}let Fe=Dt?new Array(t.length).fill(Ek):Ek;const wi=ur=>{if(!(!(Re.flags&1)||!Re.dirty&&!ur))if(e){const Ir=Re.run();if(S||kt||(Dt?Ir.some((Ti,_i)=>l_(Ti,Fe[_i])):l_(Ir,Fe))){vt&&vt();const Ti=fx;fx=Re;try{const _i=[Ir,Fe===Ek?void 0:Dt&&Fe[0]===Ek?[]:Fe,bt];Fe=Ir,be?be(e,3,_i):e(..._i)}finally{fx=Ti}}}else Re.run()};return ue&&ue(wi),Re=new JN(Xe),Re.scheduler=Z?()=>Z(wi,!1):wi,bt=ur=>fne(ur,!1,Re),vt=Re.onStop=()=>{const ur=DT.get(Re);if(ur){if(be)be(ur,4);else for(const Ir of ur)Ir();DT.delete(Re)}},e?c?wi(!0):Fe=Re.run():Z?Z(wi.bind(null,!0),!0):Re.run(),Er.pause=Re.pause.bind(Re),Er.resume=Re.resume.bind(Re),Er.stop=Er,Er}function I1(t,e=1/0,r){if(e<=0||!Af(t)||t.__v_skip||(r=r||new Set,r.has(t)))return t;if(r.add(t),e--,up(t))I1(t.value,e,r);else if(du(t))for(let c=0;c{I1(c,e,r)});else if(WN(t)){for(const c in t)I1(t[c],e,r);for(const c of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,c)&&I1(t[c],e,r)}return t}/** +**/let O0;class XN{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=O0,!e&&O0&&(this.index=(O0.scopes||(O0.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,r;if(this.scopes)for(e=0,r=this.scopes.length;e0&&--this._on===0&&(O0=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let r,c;for(r=0,c=this.effects.length;r0)return;if(p5){let e=p5;for(p5=void 0;e;){const r=e.next;e.next=void 0,e.flags&=-9,e=r}}let t;for(;d5;){let e=d5;for(d5=void 0;e;){const r=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(c){t||(t=c)}e=r}}if(t)throw t}function ij(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function nj(t){let e,r=t.depsTail,c=r;for(;c;){const S=c.prevDep;c.version===-1?(c===r&&(r=S),fE(c),$ie(c)):e=c,c.dep.activeLink=c.prevActiveLink,c.prevActiveLink=void 0,c=S}t.deps=e,t.depsTail=r}function EM(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(aj(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function aj(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===E5)||(t.globalVersion=E5,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!EM(t))))return;t.flags|=2;const e=t.dep,r=Of,c=Rg;Of=t,Rg=!0;try{ij(t);const S=t.fn(t._value);(e.version===0||h_(S,t._value))&&(t.flags|=128,t._value=S,e.version++)}catch(S){throw e.version++,S}finally{Of=r,Rg=c,nj(t),t.flags&=-3}}function fE(t,e=!1){const{dep:r,prevSub:c,nextSub:S}=t;if(c&&(c.nextSub=S,t.prevSub=void 0),S&&(S.prevSub=c,t.nextSub=void 0),r.subs===t&&(r.subs=c,!c&&r.computed)){r.computed.flags&=-5;for(let $=r.computed.deps;$;$=$.nextDep)fE($,!0)}!e&&!--r.sc&&r.map&&r.map.delete(r.key)}function $ie(t){const{prevDep:e,nextDep:r}=t;e&&(e.nextDep=r,t.prevDep=void 0),r&&(r.prevDep=e,t.nextDep=void 0)}let Rg=!0;const oj=[];function j1(){oj.push(Rg),Rg=!1}function U1(){const t=oj.pop();Rg=t===void 0?!0:t}function _O(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const r=Of;Of=void 0;try{e()}finally{Of=r}}}let E5=0;class Hie{constructor(e,r){this.sub=e,this.dep=r,this.version=r.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class dE{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Of||!Rg||Of===this.computed)return;let r=this.activeLink;if(r===void 0||r.sub!==Of)r=this.activeLink=new Hie(Of,this),Of.deps?(r.prevDep=Of.depsTail,Of.depsTail.nextDep=r,Of.depsTail=r):Of.deps=Of.depsTail=r,sj(r);else if(r.version===-1&&(r.version=this.version,r.nextDep)){const c=r.nextDep;c.prevDep=r.prevDep,r.prevDep&&(r.prevDep.nextDep=c),r.prevDep=Of.depsTail,r.nextDep=void 0,Of.depsTail.nextDep=r,Of.depsTail=r,Of.deps===r&&(Of.deps=c)}return r}trigger(e){this.version++,E5++,this.notify(e)}notify(e){cE();try{for(let r=this.subs;r;r=r.prevSub)r.sub.notify()&&r.sub.dep.notify()}finally{hE()}}}function sj(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let c=e.deps;c;c=c.nextDep)sj(c)}const r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}const DT=new WeakMap,Lx=Symbol(""),LM=Symbol(""),L5=Symbol("");function B0(t,e,r){if(Rg&&Of){let c=DT.get(t);c||DT.set(t,c=new Map);let S=c.get(r);S||(c.set(r,S=new dE),S.map=c,S.key=r),S.track()}}function L1(t,e,r,c,S,$){const Z=DT.get(t);if(!Z){E5++;return}const ue=xe=>{xe&&xe.trigger()};if(cE(),e==="clear")Z.forEach(ue);else{const xe=du(t),Se=xe&&uE(r);if(xe&&r==="length"){const Ne=Number(c);Z.forEach((it,pt)=>{(pt==="length"||pt===L5||!Fg(pt)&&pt>=Ne)&&ue(it)})}else switch((r!==void 0||Z.has(void 0))&&ue(Z.get(r)),Se&&ue(Z.get(L5)),e){case"add":xe?Se&&ue(Z.get("length")):(ue(Z.get(Lx)),E2(t)&&ue(Z.get(LM)));break;case"delete":xe||(ue(Z.get(Lx)),E2(t)&&ue(Z.get(LM)));break;case"set":E2(t)&&ue(Z.get(Lx));break}}hE()}function Vie(t,e){const r=DT.get(t);return r&&r.get(e)}function f2(t){const e=Ou(t);return e===t?e:(B0(e,"iterate",L5),yg(t)?e:e.map(_0))}function g8(t){return B0(t=Ou(t),"iterate",L5),t}const Wie={__proto__:null,[Symbol.iterator](){return f7(this,Symbol.iterator,_0)},concat(...t){return f2(this).concat(...t.map(e=>du(e)?f2(e):e))},entries(){return f7(this,"entries",t=>(t[1]=_0(t[1]),t))},every(t,e){return p1(this,"every",t,e,void 0,arguments)},filter(t,e){return p1(this,"filter",t,e,r=>r.map(_0),arguments)},find(t,e){return p1(this,"find",t,e,_0,arguments)},findIndex(t,e){return p1(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return p1(this,"findLast",t,e,_0,arguments)},findLastIndex(t,e){return p1(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return p1(this,"forEach",t,e,void 0,arguments)},includes(...t){return d7(this,"includes",t)},indexOf(...t){return d7(this,"indexOf",t)},join(t){return f2(this).join(t)},lastIndexOf(...t){return d7(this,"lastIndexOf",t)},map(t,e){return p1(this,"map",t,e,void 0,arguments)},pop(){return M3(this,"pop")},push(...t){return M3(this,"push",t)},reduce(t,...e){return xO(this,"reduce",t,e)},reduceRight(t,...e){return xO(this,"reduceRight",t,e)},shift(){return M3(this,"shift")},some(t,e){return p1(this,"some",t,e,void 0,arguments)},splice(...t){return M3(this,"splice",t)},toReversed(){return f2(this).toReversed()},toSorted(t){return f2(this).toSorted(t)},toSpliced(...t){return f2(this).toSpliced(...t)},unshift(...t){return M3(this,"unshift",t)},values(){return f7(this,"values",_0)}};function f7(t,e,r){const c=g8(t),S=c[e]();return c!==t&&!yg(t)&&(S._next=S.next,S.next=()=>{const $=S._next();return $.value&&($.value=r($.value)),$}),S}const qie=Array.prototype;function p1(t,e,r,c,S,$){const Z=g8(t),ue=Z!==t&&!yg(t),xe=Z[e];if(xe!==qie[e]){const it=xe.apply(t,$);return ue?_0(it):it}let Se=r;Z!==t&&(ue?Se=function(it,pt){return r.call(this,_0(it),pt,t)}:r.length>2&&(Se=function(it,pt){return r.call(this,it,pt,t)}));const Ne=xe.call(Z,Se,c);return ue&&S?S(Ne):Ne}function xO(t,e,r,c){const S=g8(t);let $=r;return S!==t&&(yg(t)?r.length>3&&($=function(Z,ue,xe){return r.call(this,Z,ue,xe,t)}):$=function(Z,ue,xe){return r.call(this,Z,_0(ue),xe,t)}),S[e]($,...c)}function d7(t,e,r){const c=Ou(t);B0(c,"iterate",L5);const S=c[e](...r);return(S===-1||S===!1)&&gE(r[0])?(r[0]=Ou(r[0]),c[e](...r)):S}function M3(t,e,r=[]){j1(),cE();const c=Ou(t)[e].apply(t,r);return hE(),U1(),c}const Gie=oE("__proto__,__v_isRef,__isVue"),lj=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Fg));function Zie(t){Fg(t)||(t=String(t));const e=Ou(this);return B0(e,"has",t),e.hasOwnProperty(t)}class uj{constructor(e=!1,r=!1){this._isReadonly=e,this._isShallow=r}get(e,r,c){if(r==="__v_skip")return e.__v_skip;const S=this._isReadonly,$=this._isShallow;if(r==="__v_isReactive")return!S;if(r==="__v_isReadonly")return S;if(r==="__v_isShallow")return $;if(r==="__v_raw")return c===(S?$?nne:dj:$?fj:hj).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(c)?e:void 0;const Z=du(e);if(!S){let xe;if(Z&&(xe=Wie[r]))return xe;if(r==="hasOwnProperty")return Zie}const ue=Reflect.get(e,r,cp(e)?e:c);return(Fg(r)?lj.has(r):Gie(r))||(S||B0(e,"get",r),$)?ue:cp(ue)?Z&&uE(r)?ue:ue.value:Mf(ue)?S?mj(ue):m_(ue):ue}}class cj extends uj{constructor(e=!1){super(!1,e)}set(e,r,c,S){let $=e[r];if(!this._isShallow){const xe=g_($);if(!yg(c)&&!g_(c)&&($=Ou($),c=Ou(c)),!du(e)&&cp($)&&!cp(c))return xe?!1:($.value=c,!0)}const Z=du(e)&&uE(r)?Number(r)t,Ek=t=>Reflect.getPrototypeOf(t);function Qie(t,e,r){return function(...c){const S=this.__v_raw,$=Ou(S),Z=E2($),ue=t==="entries"||t===Symbol.iterator&&Z,xe=t==="keys"&&Z,Se=S[t](...c),Ne=r?PM:e?zT:_0;return!e&&B0($,"iterate",xe?LM:Lx),{next(){const{value:it,done:pt}=Se.next();return pt?{value:it,done:pt}:{value:ue?[Ne(it[0]),Ne(it[1])]:Ne(it),done:pt}},[Symbol.iterator](){return this}}}}function Lk(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function ene(t,e){const r={get(S){const $=this.__v_raw,Z=Ou($),ue=Ou(S);t||(h_(S,ue)&&B0(Z,"get",S),B0(Z,"get",ue));const{has:xe}=Ek(Z),Se=e?PM:t?zT:_0;if(xe.call(Z,S))return Se($.get(S));if(xe.call(Z,ue))return Se($.get(ue));$!==Z&&$.get(S)},get size(){const S=this.__v_raw;return!t&&B0(Ou(S),"iterate",Lx),Reflect.get(S,"size",S)},has(S){const $=this.__v_raw,Z=Ou($),ue=Ou(S);return t||(h_(S,ue)&&B0(Z,"has",S),B0(Z,"has",ue)),S===ue?$.has(S):$.has(S)||$.has(ue)},forEach(S,$){const Z=this,ue=Z.__v_raw,xe=Ou(ue),Se=e?PM:t?zT:_0;return!t&&B0(xe,"iterate",Lx),ue.forEach((Ne,it)=>S.call($,Se(Ne),Se(it),Z))}};return Op(r,t?{add:Lk("add"),set:Lk("set"),delete:Lk("delete"),clear:Lk("clear")}:{add(S){!e&&!yg(S)&&!g_(S)&&(S=Ou(S));const $=Ou(this);return Ek($).has.call($,S)||($.add(S),L1($,"add",S,S)),this},set(S,$){!e&&!yg($)&&!g_($)&&($=Ou($));const Z=Ou(this),{has:ue,get:xe}=Ek(Z);let Se=ue.call(Z,S);Se||(S=Ou(S),Se=ue.call(Z,S));const Ne=xe.call(Z,S);return Z.set(S,$),Se?h_($,Ne)&&L1(Z,"set",S,$):L1(Z,"add",S,$),this},delete(S){const $=Ou(this),{has:Z,get:ue}=Ek($);let xe=Z.call($,S);xe||(S=Ou(S),xe=Z.call($,S)),ue&&ue.call($,S);const Se=$.delete(S);return xe&&L1($,"delete",S,void 0),Se},clear(){const S=Ou(this),$=S.size!==0,Z=S.clear();return $&&L1(S,"clear",void 0,void 0),Z}}),["keys","values","entries",Symbol.iterator].forEach(S=>{r[S]=Qie(S,t,e)}),r}function pE(t,e){const r=ene(t,e);return(c,S,$)=>S==="__v_isReactive"?!t:S==="__v_isReadonly"?t:S==="__v_raw"?c:Reflect.get(Zh(r,S)&&S in c?r:c,S,$)}const tne={get:pE(!1,!1)},rne={get:pE(!1,!0)},ine={get:pE(!0,!1)};const hj=new WeakMap,fj=new WeakMap,dj=new WeakMap,nne=new WeakMap;function ane(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function one(t){return t.__v_skip||!Object.isExtensible(t)?0:ane(Eie(t))}function m_(t){return g_(t)?t:mE(t,!1,Yie,tne,hj)}function pj(t){return mE(t,!1,Jie,rne,fj)}function mj(t){return mE(t,!0,Xie,ine,dj)}function mE(t,e,r,c,S){if(!Mf(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const $=one(t);if($===0)return t;const Z=S.get(t);if(Z)return Z;const ue=new Proxy(t,$===2?c:r);return S.set(t,ue),ue}function f_(t){return g_(t)?f_(t.__v_raw):!!(t&&t.__v_isReactive)}function g_(t){return!!(t&&t.__v_isReadonly)}function yg(t){return!!(t&&t.__v_isShallow)}function gE(t){return t?!!t.__v_raw:!1}function Ou(t){const e=t&&t.__v_raw;return e?Ou(e):t}function vE(t){return!Zh(t,"__v_skip")&&Object.isExtensible(t)&&MM(t,"__v_skip",!0),t}const _0=t=>Mf(t)?m_(t):t,zT=t=>Mf(t)?mj(t):t;function cp(t){return t?t.__v_isRef===!0:!1}function fn(t){return gj(t,!1)}function sne(t){return gj(t,!0)}function gj(t,e){return cp(t)?t:new lne(t,e)}class lne{constructor(e,r){this.dep=new dE,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=r?e:Ou(e),this._value=r?e:_0(e),this.__v_isShallow=r}get value(){return this.dep.track(),this._value}set value(e){const r=this._rawValue,c=this.__v_isShallow||yg(e)||g_(e);e=c?e:Ou(e),h_(e,r)&&(this._rawValue=e,this._value=c?e:_0(e),this.dep.trigger())}}function Po(t){return cp(t)?t.value:t}const une={get:(t,e,r)=>e==="__v_raw"?t:Po(Reflect.get(t,e,r)),set:(t,e,r,c)=>{const S=t[e];return cp(S)&&!cp(r)?(S.value=r,!0):Reflect.set(t,e,r,c)}};function vj(t){return f_(t)?t:new Proxy(t,une)}function cne(t){const e=du(t)?new Array(t.length):{};for(const r in t)e[r]=fne(t,r);return e}class hne{constructor(e,r,c){this._object=e,this._key=r,this._defaultValue=c,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Vie(Ou(this._object),this._key)}}function fne(t,e,r){const c=t[e];return cp(c)?c:new hne(t,e,r)}class dne{constructor(e,r,c){this.fn=e,this.setter=r,this._value=void 0,this.dep=new dE(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=E5-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!r,this.isSSR=c}notify(){if(this.flags|=16,!(this.flags&8)&&Of!==this)return rj(this,!0),!0}get value(){const e=this.dep.track();return aj(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function pne(t,e,r=!1){let c,S;return Xu(t)?c=t:(c=t.get,S=t.set),new dne(c,S,r)}const Pk={},OT=new WeakMap;let gx;function mne(t,e=!1,r=gx){if(r){let c=OT.get(r);c||OT.set(r,c=[]),c.push(t)}}function gne(t,e,r=Cf){const{immediate:c,deep:S,once:$,scheduler:Z,augmentJob:ue,call:xe}=r,Se=or=>S?or:yg(or)||S===!1||S===0?P1(or,1):P1(or);let Ne,it,pt,bt,wt=!1,Dt=!1;if(cp(t)?(it=()=>t.value,wt=yg(t)):f_(t)?(it=()=>Se(t),wt=!0):du(t)?(Dt=!0,wt=t.some(or=>f_(or)||yg(or)),it=()=>t.map(or=>{if(cp(or))return or.value;if(f_(or))return Se(or);if(Xu(or))return xe?xe(or,2):or()})):Xu(t)?e?it=xe?()=>xe(t,2):t:it=()=>{if(pt){j1();try{pt()}finally{U1()}}const or=gx;gx=Ne;try{return xe?xe(t,3,[bt]):t(bt)}finally{gx=or}}:it=Ev,e&&S){const or=it,Cr=S===!0?1/0:S;it=()=>P1(or(),Cr)}const Zt=QN(),Mr=()=>{Ne.stop(),Zt&&Zt.active&&lE(Zt.effects,Ne)};if($&&e){const or=e;e=(...Cr)=>{or(...Cr),Mr()}}let ze=Dt?new Array(t.length).fill(Pk):Pk;const ni=or=>{if(!(!(Ne.flags&1)||!Ne.dirty&&!or))if(e){const Cr=Ne.run();if(S||wt||(Dt?Cr.some((gi,Si)=>h_(gi,ze[Si])):h_(Cr,ze))){pt&&pt();const gi=gx;gx=Ne;try{const Si=[Cr,ze===Pk?void 0:Dt&&ze[0]===Pk?[]:ze,bt];ze=Cr,xe?xe(e,3,Si):e(...Si)}finally{gx=gi}}}else Ne.run()};return ue&&ue(ni),Ne=new ej(it),Ne.scheduler=Z?()=>Z(ni,!1):ni,bt=or=>mne(or,!1,Ne),pt=Ne.onStop=()=>{const or=OT.get(Ne);if(or){if(xe)xe(or,4);else for(const Cr of or)Cr();OT.delete(Ne)}},e?c?ni(!0):ze=Ne.run():Z?Z(ni.bind(null,!0),!0):Ne.run(),Mr.pause=Ne.pause.bind(Ne),Mr.resume=Ne.resume.bind(Ne),Mr.stop=Mr,Mr}function P1(t,e=1/0,r){if(e<=0||!Mf(t)||t.__v_skip||(r=r||new Set,r.has(t)))return t;if(r.add(t),e--,cp(t))P1(t.value,e,r);else if(du(t))for(let c=0;c{P1(c,e,r)});else if(GN(t)){for(const c in t)P1(t[c],e,r);for(const c of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,c)&&P1(t[c],e,r)}return t}/** * @vue/runtime-core v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Y5(t,e,r,c){try{return c?t(...c):t()}catch(S){mS(S,e,r)}}function Ng(t,e,r,c){if(Xu(t)){const S=Y5(t,e,r,c);return S&&HN(S)&&S.catch(H=>{mS(H,e,r)}),S}if(du(t)){const S=[];for(let H=0;H>>1,S=nm[c],H=E5(S);H=E5(r)?nm.push(t):nm.splice(mne(e),0,t),t.flags|=1,vj()}}function vj(){zT||(zT=gj.then(_j))}function gne(t){du(t)?E2.push(...t):Ky&&t.id===-1?Ky.splice(x2+1,0,t):t.flags&1||(E2.push(t),t.flags|=1),vj()}function _O(t,e,r=bv+1){for(;rE5(r)-E5(c));if(E2.length=0,Ky){Ky.push(...e);return}for(Ky=e,x2=0;x2t.id==null?t.flags&2?-1:1/0:t.id;function _j(t){try{for(bv=0;bv{c._d&&DO(-1);const H=OT(e);let Z;try{Z=t(...S)}finally{OT(H),c._d&&DO(1)}return Z};return c._n=!0,c._c=!0,c._d=!0,c}function Sl(t,e){if(b0===null)return t;const r=kS(b0),c=t.dirs||(t.dirs=[]);for(let S=0;St.__isTeleport,d5=t=>t&&(t.disabled||t.disabled===""),xO=t=>t&&(t.defer||t.defer===""),bO=t=>typeof SVGElement<"u"&&t instanceof SVGElement,wO=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,LM=(t,e)=>{const r=t&&t.to;return Ad(r)?e?e(r):null:r},kj={name:"Teleport",__isTeleport:!0,process(t,e,r,c,S,H,Z,ue,be,Se){const{mc:Re,pc:Xe,pbc:vt,o:{insert:bt,querySelector:kt,createText:Dt,createComment:rr}}=Se,Er=d5(e.props);let{shapeFlag:Fe,children:wi,dynamicChildren:ur}=e;if(t==null){const Ir=e.el=Dt(""),Ti=e.anchor=Dt("");bt(Ir,r,c),bt(Ti,r,c);const _i=(ii,Ji)=>{Fe&16&&(S&&S.isCE&&(S.ce._teleportTarget=ii),Re(wi,ii,Ji,S,H,Z,ue,be))},Ci=()=>{const ii=e.target=LM(e.props,kt),Ji=Tj(ii,e,Dt,bt);ii&&(Z!=="svg"&&bO(ii)?Z="svg":Z!=="mathml"&&wO(ii)&&(Z="mathml"),Er||(_i(ii,Ji),sT(e,!1)))};Er&&(_i(r,Ti),sT(e,!0)),xO(e.props)?(e.el.__isMounted=!1,rm(()=>{Ci(),delete e.el.__isMounted},H)):Ci()}else{if(xO(e.props)&&t.el.__isMounted===!1){rm(()=>{kj.process(t,e,r,c,S,H,Z,ue,be,Se)},H);return}e.el=t.el,e.targetStart=t.targetStart;const Ir=e.anchor=t.anchor,Ti=e.target=t.target,_i=e.targetAnchor=t.targetAnchor,Ci=d5(t.props),ii=Ci?r:Ti,Ji=Ci?Ir:_i;if(Z==="svg"||bO(Ti)?Z="svg":(Z==="mathml"||wO(Ti))&&(Z="mathml"),ur?(vt(t.dynamicChildren,ur,ii,S,H,Z,ue),xE(t,e,!0)):be||Xe(t,e,ii,Ji,S,H,Z,ue,!1),Er)Ci?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Lk(e,r,Ir,Se,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const vi=e.target=LM(e.props,kt);vi&&Lk(e,vi,null,Se,0)}else Ci&&Lk(e,Ti,_i,Se,1);sT(e,Er)}},remove(t,e,r,{um:c,o:{remove:S}},H){const{shapeFlag:Z,children:ue,anchor:be,targetStart:Se,targetAnchor:Re,target:Xe,props:vt}=t;if(Xe&&(S(Se),S(Re)),H&&S(be),Z&16){const bt=H||!d5(vt);for(let kt=0;kt{t.isMounted=!0}),$g(()=>{t.isUnmounting=!0}),t}const og=[Function,Array],Cj={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:og,onEnter:og,onAfterEnter:og,onEnterCancelled:og,onBeforeLeave:og,onLeave:og,onAfterLeave:og,onLeaveCancelled:og,onBeforeAppear:og,onAppear:og,onAfterAppear:og,onAppearCancelled:og},Aj=t=>{const e=t.subTree;return e.component?Aj(e.component):e},yne={name:"BaseTransition",props:Cj,setup(t,{slots:e}){const r=wS(),c=Sj();return()=>{const S=e.default&&vE(e.default(),!0);if(!S||!S.length)return;const H=Mj(S),Z=Ou(t),{mode:ue}=Z;if(c.isLeaving)return f7(H);const be=kO(H);if(!be)return f7(H);let Se=L5(be,Z,c,r,Xe=>Se=Xe);be.type!==R0&&Bx(be,Se);let Re=r.subTree&&kO(r.subTree);if(Re&&Re.type!==R0&&!_x(be,Re)&&Aj(r).type!==R0){let Xe=L5(Re,Z,c,r);if(Bx(Re,Xe),ue==="out-in"&&be.type!==R0)return c.isLeaving=!0,Xe.afterLeave=()=>{c.isLeaving=!1,r.job.flags&8||r.update(),delete Xe.afterLeave,Re=void 0},f7(H);ue==="in-out"&&be.type!==R0?Xe.delayLeave=(vt,bt,kt)=>{const Dt=Ej(c,Re);Dt[String(Re.key)]=Re,vt[Yy]=()=>{bt(),vt[Yy]=void 0,delete Se.delayedLeave,Re=void 0},Se.delayedLeave=()=>{kt(),delete Se.delayedLeave,Re=void 0}}:Re=void 0}else Re&&(Re=void 0);return H}}};function Mj(t){let e=t[0];if(t.length>1){for(const r of t)if(r.type!==R0){e=r;break}}return e}const _ne=yne;function Ej(t,e){const{leavingVNodes:r}=t;let c=r.get(e.type);return c||(c=Object.create(null),r.set(e.type,c)),c}function L5(t,e,r,c,S){const{appear:H,mode:Z,persisted:ue=!1,onBeforeEnter:be,onEnter:Se,onAfterEnter:Re,onEnterCancelled:Xe,onBeforeLeave:vt,onLeave:bt,onAfterLeave:kt,onLeaveCancelled:Dt,onBeforeAppear:rr,onAppear:Er,onAfterAppear:Fe,onAppearCancelled:wi}=e,ur=String(t.key),Ir=Ej(r,t),Ti=(ii,Ji)=>{ii&&Ng(ii,c,9,Ji)},_i=(ii,Ji)=>{const vi=Ji[1];Ti(ii,Ji),du(ii)?ii.every(vr=>vr.length<=1)&&vi():ii.length<=1&&vi()},Ci={mode:Z,persisted:ue,beforeEnter(ii){let Ji=be;if(!r.isMounted)if(H)Ji=rr||be;else return;ii[Yy]&&ii[Yy](!0);const vi=Ir[ur];vi&&_x(t,vi)&&vi.el[Yy]&&vi.el[Yy](),Ti(Ji,[ii])},enter(ii){let Ji=Se,vi=Re,vr=Xe;if(!r.isMounted)if(H)Ji=Er||Se,vi=Fe||Re,vr=wi||Xe;else return;let dr=!1;const Ar=ii[Pk]=ti=>{dr||(dr=!0,ti?Ti(vr,[ii]):Ti(vi,[ii]),Ci.delayedLeave&&Ci.delayedLeave(),ii[Pk]=void 0)};Ji?_i(Ji,[ii,Ar]):Ar()},leave(ii,Ji){const vi=String(t.key);if(ii[Pk]&&ii[Pk](!0),r.isUnmounting)return Ji();Ti(vt,[ii]);let vr=!1;const dr=ii[Yy]=Ar=>{vr||(vr=!0,Ji(),Ar?Ti(Dt,[ii]):Ti(kt,[ii]),ii[Yy]=void 0,Ir[vi]===t&&delete Ir[vi])};Ir[vi]=t,bt?_i(bt,[ii,dr]):dr()},clone(ii){const Ji=L5(ii,e,r,c,S);return S&&S(Ji),Ji}};return Ci}function f7(t){if(vS(t))return t=d_(t),t.children=null,t}function kO(t){if(!vS(t))return wj(t.type)&&t.children?Mj(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:r}=t;if(r){if(e&16)return r[0];if(e&32&&Xu(r.default))return r.default()}}function Bx(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Bx(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function vE(t,e=!1,r){let c=[],S=0;for(let H=0;H1)for(let H=0;Hp5(kt,e&&(du(e)?e[Dt]:e),r,c,S));return}if(L2(c)&&!S){c.shapeFlag&512&&c.type.__asyncResolved&&c.component.subTree.component&&p5(t,e,r,c.component.subTree);return}const H=c.shapeFlag&4?kS(c.component):c.el,Z=S?null:H,{i:ue,r:be}=t,Se=e&&e.r,Re=ue.refs===Cf?ue.refs={}:ue.refs,Xe=ue.setupState,vt=Ou(Xe),bt=Xe===Cf?()=>!1:kt=>Zh(vt,kt);if(Se!=null&&Se!==be&&(Ad(Se)?(Re[Se]=null,bt(Se)&&(Xe[Se]=null)):up(Se)&&(Se.value=null)),Xu(be))Y5(be,ue,12,[Z,Re]);else{const kt=Ad(be),Dt=up(be);if(kt||Dt){const rr=()=>{if(t.f){const Er=kt?bt(be)?Xe[be]:Re[be]:be.value;S?du(Er)&&oE(Er,H):du(Er)?Er.includes(H)||Er.push(H):kt?(Re[be]=[H],bt(be)&&(Xe[be]=Re[be])):(be.value=[H],t.k&&(Re[t.k]=be.value))}else kt?(Re[be]=Z,bt(be)&&(Xe[be]=Z)):Dt&&(be.value=Z,t.k&&(Re[t.k]=Z))};Z?(rr.id=-1,rm(rr,r)):rr()}}}dS().requestIdleCallback;dS().cancelIdleCallback;const L2=t=>!!t.type.__asyncLoader,vS=t=>t.type.__isKeepAlive;function xne(t,e){Pj(t,"a",e)}function bne(t,e){Pj(t,"da",e)}function Pj(t,e,r=F0){const c=t.__wdc||(t.__wdc=()=>{let S=r;for(;S;){if(S.isDeactivated)return;S=S.parent}return t()});if(yS(e,c,r),r){let S=r.parent;for(;S&&S.parent;)vS(S.parent.vnode)&&wne(c,e,r,S),S=S.parent}}function wne(t,e,r,c){const S=yS(e,t,c,!0);Dv(()=>{oE(c[e],S)},r)}function yS(t,e,r=F0,c=!1){if(r){const S=r[t]||(r[t]=[]),H=e.__weh||(e.__weh=(...Z)=>{N1();const ue=X5(r),be=Ng(e,r,t,Z);return ue(),j1(),be});return c?S.unshift(H):S.push(H),H}}const $1=t=>(e,r=F0)=>{(!D5||t==="sp")&&yS(t,(...c)=>e(...c),r)},kne=$1("bm"),ud=$1("m"),Tne=$1("bu"),Ij=$1("u"),$g=$1("bum"),Dv=$1("um"),Sne=$1("sp"),Cne=$1("rtg"),Ane=$1("rtc");function Mne(t,e=F0){yS("ec",t,e)}const Dj="components";function _S(t,e){return Oj(Dj,t,!0,e)||t}const zj=Symbol.for("v-ndc");function r_(t){return Ad(t)?Oj(Dj,t,!1)||t:t||zj}function Oj(t,e,r=!0,c=!1){const S=b0||F0;if(S){const H=S.type;{const ue=gae(H,!1);if(ue&&(ue===e||ue===bg(e)||ue===fS(bg(e))))return H}const Z=TO(S[t]||H[t],e)||TO(S.appContext[t],e);return!Z&&c?H:Z}}function TO(t,e){return t&&(t[e]||t[bg(e)]||t[fS(bg(e))])}function au(t,e,r,c){let S;const H=r,Z=du(t);if(Z||Ad(t)){const ue=Z&&u_(t);let be=!1,Se=!1;ue&&(be=!vg(t),Se=f_(t),t=pS(t)),S=new Array(t.length);for(let Re=0,Xe=t.length;Ree(ue,be,void 0,H));else{const ue=Object.keys(t);S=new Array(ue.length);for(let be=0,Se=ue.length;beI5(e)?!(e.type===R0||e.type===js&&!Bj(e.children)):!0)?t:null}const PM=t=>t?tU(t)?kS(t):PM(t.parent):null,m5=zp(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>PM(t.parent),$root:t=>PM(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Fj(t),$forceUpdate:t=>t.f||(t.f=()=>{gE(t.update)}),$nextTick:t=>t.n||(t.n=x0.bind(t.proxy)),$watch:t=>Xne.bind(t)}),d7=(t,e)=>t!==Cf&&!t.__isScriptSetup&&Zh(t,e),Lne={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:r,setupState:c,data:S,props:H,accessCache:Z,type:ue,appContext:be}=t;let Se;if(e[0]!=="$"){const bt=Z[e];if(bt!==void 0)switch(bt){case 1:return c[e];case 2:return S[e];case 4:return r[e];case 3:return H[e]}else{if(d7(c,e))return Z[e]=1,c[e];if(S!==Cf&&Zh(S,e))return Z[e]=2,S[e];if((Se=t.propsOptions[0])&&Zh(Se,e))return Z[e]=3,H[e];if(r!==Cf&&Zh(r,e))return Z[e]=4,r[e];IM&&(Z[e]=0)}}const Re=m5[e];let Xe,vt;if(Re)return e==="$attrs"&&B0(t.attrs,"get",""),Re(t);if((Xe=ue.__cssModules)&&(Xe=Xe[e]))return Xe;if(r!==Cf&&Zh(r,e))return Z[e]=4,r[e];if(vt=be.config.globalProperties,Zh(vt,e))return vt[e]},set({_:t},e,r){const{data:c,setupState:S,ctx:H}=t;return d7(S,e)?(S[e]=r,!0):c!==Cf&&Zh(c,e)?(c[e]=r,!0):Zh(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(H[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:c,appContext:S,propsOptions:H}},Z){let ue;return!!r[Z]||t!==Cf&&Zh(t,Z)||d7(e,Z)||(ue=H[0])&&Zh(ue,Z)||Zh(c,Z)||Zh(m5,Z)||Zh(S.config.globalProperties,Z)},defineProperty(t,e,r){return r.get!=null?t._.accessCache[e]=0:Zh(r,"value")&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}};function SO(t){return du(t)?t.reduce((e,r)=>(e[r]=null,e),{}):t}let IM=!0;function Pne(t){const e=Fj(t),r=t.proxy,c=t.ctx;IM=!1,e.beforeCreate&&CO(e.beforeCreate,t,"bc");const{data:S,computed:H,methods:Z,watch:ue,provide:be,inject:Se,created:Re,beforeMount:Xe,mounted:vt,beforeUpdate:bt,updated:kt,activated:Dt,deactivated:rr,beforeDestroy:Er,beforeUnmount:Fe,destroyed:wi,unmounted:ur,render:Ir,renderTracked:Ti,renderTriggered:_i,errorCaptured:Ci,serverPrefetch:ii,expose:Ji,inheritAttrs:vi,components:vr,directives:dr,filters:Ar}=e;if(Se&&Ine(Se,c,null),Z)for(const ei in Z){const Di=Z[ei];Xu(Di)&&(c[ei]=Di.bind(r))}if(S){const ei=S.call(r,r);Af(ei)&&(t.data=Ox(ei))}if(IM=!0,H)for(const ei in H){const Di=H[ei],qn=Xu(Di)?Di.bind(r,r):Xu(Di.get)?Di.get.bind(r,r):Ev,Qn=!Xu(Di)&&Xu(Di.set)?Di.set.bind(r):Ev,ka=Do({get:qn,set:Qn});Object.defineProperty(c,ei,{enumerable:!0,configurable:!0,get:()=>ka.value,set:Ta=>ka.value=Ta})}if(ue)for(const ei in ue)Rj(ue[ei],c,r,ei);if(be){const ei=Xu(be)?be.call(r):be;Reflect.ownKeys(ei).forEach(Di=>{lT(Di,ei[Di])})}Re&&CO(Re,t,"c");function Xr(ei,Di){du(Di)?Di.forEach(qn=>ei(qn.bind(r))):Di&&ei(Di.bind(r))}if(Xr(kne,Xe),Xr(ud,vt),Xr(Tne,bt),Xr(Ij,kt),Xr(xne,Dt),Xr(bne,rr),Xr(Mne,Ci),Xr(Ane,Ti),Xr(Cne,_i),Xr($g,Fe),Xr(Dv,ur),Xr(Sne,ii),du(Ji))if(Ji.length){const ei=t.exposed||(t.exposed={});Ji.forEach(Di=>{Object.defineProperty(ei,Di,{get:()=>r[Di],set:qn=>r[Di]=qn,enumerable:!0})})}else t.exposed||(t.exposed={});Ir&&t.render===Ev&&(t.render=Ir),vi!=null&&(t.inheritAttrs=vi),vr&&(t.components=vr),dr&&(t.directives=dr),ii&&Lj(t)}function Ine(t,e,r=Ev){du(t)&&(t=DM(t));for(const c in t){const S=t[c];let H;Af(S)?"default"in S?H=yg(S.from||c,S.default,!0):H=yg(S.from||c):H=yg(S),up(H)?Object.defineProperty(e,c,{enumerable:!0,configurable:!0,get:()=>H.value,set:Z=>H.value=Z}):e[c]=H}}function CO(t,e,r){Ng(du(t)?t.map(c=>c.bind(e.proxy)):t.bind(e.proxy),e,r)}function Rj(t,e,r,c){let S=c.includes(".")?Yj(r,c):()=>r[c];if(Ad(t)){const H=e[t];Xu(H)&&w0(S,H)}else if(Xu(t))w0(S,t.bind(r));else if(Af(t))if(du(t))t.forEach(H=>Rj(H,e,r,c));else{const H=Xu(t.handler)?t.handler.bind(r):e[t.handler];Xu(H)&&w0(S,H,t)}}function Fj(t){const e=t.type,{mixins:r,extends:c}=e,{mixins:S,optionsCache:H,config:{optionMergeStrategies:Z}}=t.appContext,ue=H.get(e);let be;return ue?be=ue:!S.length&&!r&&!c?be=e:(be={},S.length&&S.forEach(Se=>BT(be,Se,Z,!0)),BT(be,e,Z)),Af(e)&&H.set(e,be),be}function BT(t,e,r,c=!1){const{mixins:S,extends:H}=e;H&&BT(t,H,r,!0),S&&S.forEach(Z=>BT(t,Z,r,!0));for(const Z in e)if(!(c&&Z==="expose")){const ue=Dne[Z]||r&&r[Z];t[Z]=ue?ue(t[Z],e[Z]):e[Z]}return t}const Dne={data:AO,props:MO,emits:MO,methods:Q3,computed:Q3,beforeCreate:Q0,created:Q0,beforeMount:Q0,mounted:Q0,beforeUpdate:Q0,updated:Q0,beforeDestroy:Q0,beforeUnmount:Q0,destroyed:Q0,unmounted:Q0,activated:Q0,deactivated:Q0,errorCaptured:Q0,serverPrefetch:Q0,components:Q3,directives:Q3,watch:One,provide:AO,inject:zne};function AO(t,e){return e?t?function(){return zp(Xu(t)?t.call(this,this):t,Xu(e)?e.call(this,this):e)}:e:t}function zne(t,e){return Q3(DM(t),DM(e))}function DM(t){if(du(t)){const e={};for(let r=0;r1)return r&&Xu(e)?e.call(c&&c.proxy):e}}function Fne(){return!!(wS()||Mx)}const jj={},Uj=()=>Object.create(jj),$j=t=>Object.getPrototypeOf(t)===jj;function Nne(t,e,r,c=!1){const S={},H=Uj();t.propsDefaults=Object.create(null),Hj(t,e,S,H);for(const Z in t.propsOptions[0])Z in S||(S[Z]=void 0);r?t.props=c?S:fj(S):t.type.props?t.props=S:t.props=H,t.attrs=H}function jne(t,e,r,c){const{props:S,attrs:H,vnode:{patchFlag:Z}}=t,ue=Ou(S),[be]=t.propsOptions;let Se=!1;if((c||Z>0)&&!(Z&16)){if(Z&8){const Re=t.vnode.dynamicProps;for(let Xe=0;Xe{be=!0;const[vt,bt]=Vj(Xe,e,!0);zp(Z,vt),bt&&ue.push(...bt)};!r&&e.mixins.length&&e.mixins.forEach(Re),t.extends&&Re(t.extends),t.mixins&&t.mixins.forEach(Re)}if(!H&&!be)return Af(t)&&c.set(t,A2),A2;if(du(H))for(let Re=0;Ret==="_"||t==="__"||t==="_ctx"||t==="$stable",_E=t=>du(t)?t.map(Tv):[Tv(t)],$ne=(t,e,r)=>{if(e._n)return e;const c=Iv((...S)=>_E(e(...S)),r);return c._c=!1,c},Wj=(t,e,r)=>{const c=t._ctx;for(const S in t){if(yE(S))continue;const H=t[S];if(Xu(H))e[S]=$ne(S,H,c);else if(H!=null){const Z=_E(H);e[S]=()=>Z}}},qj=(t,e)=>{const r=_E(e);t.slots.default=()=>r},Gj=(t,e,r)=>{for(const c in e)(r||!yE(c))&&(t[c]=e[c])},Hne=(t,e,r)=>{const c=t.slots=Uj();if(t.vnode.shapeFlag&32){const S=e.__;S&&CM(c,"__",S,!0);const H=e._;H?(Gj(c,e,r),r&&CM(c,"_",H,!0)):Wj(e,c)}else e&&qj(t,e)},Vne=(t,e,r)=>{const{vnode:c,slots:S}=t;let H=!0,Z=Cf;if(c.shapeFlag&32){const ue=e._;ue?r&&ue===1?H=!1:Gj(S,e,r):(H=!e.$stable,Wj(e,S)),Z=e}else e&&(qj(t,e),Z={default:1});if(H)for(const ue in S)!yE(ue)&&Z[ue]==null&&delete S[ue]},rm=nae;function Wne(t){return qne(t)}function qne(t,e){const r=dS();r.__VUE__=!0;const{insert:c,remove:S,patchProp:H,createElement:Z,createText:ue,createComment:be,setText:Se,setElementText:Re,parentNode:Xe,nextSibling:vt,setScopeId:bt=Ev,insertStaticContent:kt}=t,Dt=(Ur,Mi,Xi,oo=null,go=null,ko=null,ss=void 0,ys=null,ns=!!Mi.dynamicChildren)=>{if(Ur===Mi)return;Ur&&!_x(Ur,Mi)&&(oo=zn(Ur),Ta(Ur,go,ko,!0),Ur=null),Mi.patchFlag===-2&&(ns=!1,Mi.dynamicChildren=null);const{type:Qo,ref:Rl,shapeFlag:Ws}=Mi;switch(Qo){case bS:rr(Ur,Mi,Xi,oo);break;case R0:Er(Ur,Mi,Xi,oo);break;case uT:Ur==null&&Fe(Mi,Xi,oo,ss);break;case js:vr(Ur,Mi,Xi,oo,go,ko,ss,ys,ns);break;default:Ws&1?Ir(Ur,Mi,Xi,oo,go,ko,ss,ys,ns):Ws&6?dr(Ur,Mi,Xi,oo,go,ko,ss,ys,ns):(Ws&64||Ws&128)&&Qo.process(Ur,Mi,Xi,oo,go,ko,ss,ys,ns,zo)}Rl!=null&&go?p5(Rl,Ur&&Ur.ref,ko,Mi||Ur,!Mi):Rl==null&&Ur&&Ur.ref!=null&&p5(Ur.ref,null,ko,Ur,!0)},rr=(Ur,Mi,Xi,oo)=>{if(Ur==null)c(Mi.el=ue(Mi.children),Xi,oo);else{const go=Mi.el=Ur.el;Mi.children!==Ur.children&&Se(go,Mi.children)}},Er=(Ur,Mi,Xi,oo)=>{Ur==null?c(Mi.el=be(Mi.children||""),Xi,oo):Mi.el=Ur.el},Fe=(Ur,Mi,Xi,oo)=>{[Ur.el,Ur.anchor]=kt(Ur.children,Mi,Xi,oo,Ur.el,Ur.anchor)},wi=({el:Ur,anchor:Mi},Xi,oo)=>{let go;for(;Ur&&Ur!==Mi;)go=vt(Ur),c(Ur,Xi,oo),Ur=go;c(Mi,Xi,oo)},ur=({el:Ur,anchor:Mi})=>{let Xi;for(;Ur&&Ur!==Mi;)Xi=vt(Ur),S(Ur),Ur=Xi;S(Mi)},Ir=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns)=>{Mi.type==="svg"?ss="svg":Mi.type==="math"&&(ss="mathml"),Ur==null?Ti(Mi,Xi,oo,go,ko,ss,ys,ns):ii(Ur,Mi,go,ko,ss,ys,ns)},Ti=(Ur,Mi,Xi,oo,go,ko,ss,ys)=>{let ns,Qo;const{props:Rl,shapeFlag:Ws,transition:ql,dirs:Su}=Ur;if(ns=Ur.el=Z(Ur.type,ko,Rl&&Rl.is,Rl),Ws&8?Re(ns,Ur.children):Ws&16&&Ci(Ur.children,ns,null,oo,go,p7(Ur,ko),ss,ys),Su&&rx(Ur,null,oo,"created"),_i(ns,Ur,Ur.scopeId,ss,oo),Rl){for(const Th in Rl)Th!=="value"&&!c5(Th)&&H(ns,Th,null,Rl[Th],ko,oo);"value"in Rl&&H(ns,"value",null,Rl.value,ko),(Qo=Rl.onVnodeBeforeMount)&&fv(Qo,oo,Ur)}Su&&rx(Ur,null,oo,"beforeMount");const uc=Gne(go,ql);uc&&ql.beforeEnter(ns),c(ns,Mi,Xi),((Qo=Rl&&Rl.onVnodeMounted)||uc||Su)&&rm(()=>{Qo&&fv(Qo,oo,Ur),uc&&ql.enter(ns),Su&&rx(Ur,null,oo,"mounted")},go)},_i=(Ur,Mi,Xi,oo,go)=>{if(Xi&&bt(Ur,Xi),oo)for(let ko=0;ko{for(let Qo=ns;Qo{const ys=Mi.el=Ur.el;let{patchFlag:ns,dynamicChildren:Qo,dirs:Rl}=Mi;ns|=Ur.patchFlag&16;const Ws=Ur.props||Cf,ql=Mi.props||Cf;let Su;if(Xi&&ix(Xi,!1),(Su=ql.onVnodeBeforeUpdate)&&fv(Su,Xi,Mi,Ur),Rl&&rx(Mi,Ur,Xi,"beforeUpdate"),Xi&&ix(Xi,!0),(Ws.innerHTML&&ql.innerHTML==null||Ws.textContent&&ql.textContent==null)&&Re(ys,""),Qo?Ji(Ur.dynamicChildren,Qo,ys,Xi,oo,p7(Mi,go),ko):ss||Di(Ur,Mi,ys,null,Xi,oo,p7(Mi,go),ko,!1),ns>0){if(ns&16)vi(ys,Ws,ql,Xi,go);else if(ns&2&&Ws.class!==ql.class&&H(ys,"class",null,ql.class,go),ns&4&&H(ys,"style",Ws.style,ql.style,go),ns&8){const uc=Mi.dynamicProps;for(let Th=0;Th{Su&&fv(Su,Xi,Mi,Ur),Rl&&rx(Mi,Ur,Xi,"updated")},oo)},Ji=(Ur,Mi,Xi,oo,go,ko,ss)=>{for(let ys=0;ys{if(Mi!==Xi){if(Mi!==Cf)for(const ko in Mi)!c5(ko)&&!(ko in Xi)&&H(Ur,ko,Mi[ko],null,go,oo);for(const ko in Xi){if(c5(ko))continue;const ss=Xi[ko],ys=Mi[ko];ss!==ys&&ko!=="value"&&H(Ur,ko,ys,ss,go,oo)}"value"in Xi&&H(Ur,"value",Mi.value,Xi.value,go)}},vr=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns)=>{const Qo=Mi.el=Ur?Ur.el:ue(""),Rl=Mi.anchor=Ur?Ur.anchor:ue("");let{patchFlag:Ws,dynamicChildren:ql,slotScopeIds:Su}=Mi;Su&&(ys=ys?ys.concat(Su):Su),Ur==null?(c(Qo,Xi,oo),c(Rl,Xi,oo),Ci(Mi.children||[],Xi,Rl,go,ko,ss,ys,ns)):Ws>0&&Ws&64&&ql&&Ur.dynamicChildren?(Ji(Ur.dynamicChildren,ql,Xi,go,ko,ss,ys),(Mi.key!=null||go&&Mi===go.subTree)&&xE(Ur,Mi,!0)):Di(Ur,Mi,Xi,Rl,go,ko,ss,ys,ns)},dr=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns)=>{Mi.slotScopeIds=ys,Ur==null?Mi.shapeFlag&512?go.ctx.activate(Mi,Xi,oo,ss,ns):Ar(Mi,Xi,oo,go,ko,ss,ns):ti(Ur,Mi,ns)},Ar=(Ur,Mi,Xi,oo,go,ko,ss)=>{const ys=Ur.component=hae(Ur,oo,go);if(vS(Ur)&&(ys.ctx.renderer=zo),fae(ys,!1,ss),ys.asyncDep){if(go&&go.registerDep(ys,Xr,ss),!Ur.el){const ns=ys.subTree=il(R0);Er(null,ns,Mi,Xi),Ur.placeholder=ns.el}}else Xr(ys,Ur,Mi,Xi,go,ko,ss)},ti=(Ur,Mi,Xi)=>{const oo=Mi.component=Ur.component;if(rae(Ur,Mi,Xi))if(oo.asyncDep&&!oo.asyncResolved){ei(oo,Mi,Xi);return}else oo.next=Mi,oo.update();else Mi.el=Ur.el,oo.vnode=Mi},Xr=(Ur,Mi,Xi,oo,go,ko,ss)=>{const ys=()=>{if(Ur.isMounted){let{next:Ws,bu:ql,u:Su,parent:uc,vnode:Th}=Ur;{const um=Zj(Ur);if(um){Ws&&(Ws.el=Th.el,ei(Ur,Ws,ss)),um.asyncDep.then(()=>{Ur.isUnmounted||ys()});return}}let Gc=Ws,Bp;ix(Ur,!1),Ws?(Ws.el=Th.el,ei(Ur,Ws,ss)):Ws=Th,ql&&oT(ql),(Bp=Ws.props&&Ws.props.onVnodeBeforeUpdate)&&fv(Bp,uc,Ws,Th),ix(Ur,!0);const wp=PO(Ur),W0=Ur.subTree;Ur.subTree=wp,Dt(W0,wp,Xe(W0.el),zn(W0),Ur,go,ko),Ws.el=wp.el,Gc===null&&iae(Ur,wp.el),Su&&rm(Su,go),(Bp=Ws.props&&Ws.props.onVnodeUpdated)&&rm(()=>fv(Bp,uc,Ws,Th),go)}else{let Ws;const{el:ql,props:Su}=Mi,{bm:uc,m:Th,parent:Gc,root:Bp,type:wp}=Ur,W0=L2(Mi);ix(Ur,!1),uc&&oT(uc),!W0&&(Ws=Su&&Su.onVnodeBeforeMount)&&fv(Ws,Gc,Mi),ix(Ur,!0);{Bp.ce&&Bp.ce._def.shadowRoot!==!1&&Bp.ce._injectChildStyle(wp);const um=Ur.subTree=PO(Ur);Dt(null,um,Xi,oo,Ur,go,ko),Mi.el=um.el}if(Th&&rm(Th,go),!W0&&(Ws=Su&&Su.onVnodeMounted)){const um=Mi;rm(()=>fv(Ws,Gc,um),go)}(Mi.shapeFlag&256||Gc&&L2(Gc.vnode)&&Gc.vnode.shapeFlag&256)&&Ur.a&&rm(Ur.a,go),Ur.isMounted=!0,Mi=Xi=oo=null}};Ur.scope.on();const ns=Ur.effect=new JN(ys);Ur.scope.off();const Qo=Ur.update=ns.run.bind(ns),Rl=Ur.job=ns.runIfDirty.bind(ns);Rl.i=Ur,Rl.id=Ur.uid,ns.scheduler=()=>gE(Rl),ix(Ur,!0),Qo()},ei=(Ur,Mi,Xi)=>{Mi.component=Ur;const oo=Ur.vnode.props;Ur.vnode=Mi,Ur.next=null,jne(Ur,Mi.props,oo,Xi),Vne(Ur,Mi.children,Xi),N1(),_O(Ur),j1()},Di=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns=!1)=>{const Qo=Ur&&Ur.children,Rl=Ur?Ur.shapeFlag:0,Ws=Mi.children,{patchFlag:ql,shapeFlag:Su}=Mi;if(ql>0){if(ql&128){Qn(Qo,Ws,Xi,oo,go,ko,ss,ys,ns);return}else if(ql&256){qn(Qo,Ws,Xi,oo,go,ko,ss,ys,ns);return}}Su&8?(Rl&16&&an(Qo,go,ko),Ws!==Qo&&Re(Xi,Ws)):Rl&16?Su&16?Qn(Qo,Ws,Xi,oo,go,ko,ss,ys,ns):an(Qo,go,ko,!0):(Rl&8&&Re(Xi,""),Su&16&&Ci(Ws,Xi,oo,go,ko,ss,ys,ns))},qn=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns)=>{Ur=Ur||A2,Mi=Mi||A2;const Qo=Ur.length,Rl=Mi.length,Ws=Math.min(Qo,Rl);let ql;for(ql=0;qlRl?an(Ur,go,ko,!0,!1,Ws):Ci(Mi,Xi,oo,go,ko,ss,ys,ns,Ws)},Qn=(Ur,Mi,Xi,oo,go,ko,ss,ys,ns)=>{let Qo=0;const Rl=Mi.length;let Ws=Ur.length-1,ql=Rl-1;for(;Qo<=Ws&&Qo<=ql;){const Su=Ur[Qo],uc=Mi[Qo]=ns?Xy(Mi[Qo]):Tv(Mi[Qo]);if(_x(Su,uc))Dt(Su,uc,Xi,null,go,ko,ss,ys,ns);else break;Qo++}for(;Qo<=Ws&&Qo<=ql;){const Su=Ur[Ws],uc=Mi[ql]=ns?Xy(Mi[ql]):Tv(Mi[ql]);if(_x(Su,uc))Dt(Su,uc,Xi,null,go,ko,ss,ys,ns);else break;Ws--,ql--}if(Qo>Ws){if(Qo<=ql){const Su=ql+1,uc=Suql)for(;Qo<=Ws;)Ta(Ur[Qo],go,ko,!0),Qo++;else{const Su=Qo,uc=Qo,Th=new Map;for(Qo=uc;Qo<=ql;Qo++){const Rp=Mi[Qo]=ns?Xy(Mi[Qo]):Tv(Mi[Qo]);Rp.key!=null&&Th.set(Rp.key,Qo)}let Gc,Bp=0;const wp=ql-uc+1;let W0=!1,um=0;const Vg=new Array(wp);for(Qo=0;Qo=wp){Ta(Rp,go,ko,!0);continue}let cm;if(Rp.key!=null)cm=Th.get(Rp.key);else for(Gc=uc;Gc<=ql;Gc++)if(Vg[Gc-uc]===0&&_x(Rp,Mi[Gc])){cm=Gc;break}cm===void 0?Ta(Rp,go,ko,!0):(Vg[cm-uc]=Qo+1,cm>=um?um=cm:W0=!0,Dt(Rp,Mi[cm],Xi,null,go,ko,ss,ys,ns),Bp++)}const q1=W0?Zne(Vg):A2;for(Gc=q1.length-1,Qo=wp-1;Qo>=0;Qo--){const Rp=uc+Qo,cm=Mi[Rp],Wg=Mi[Rp+1],Zx=Rp+1{const{el:ko,type:ss,transition:ys,children:ns,shapeFlag:Qo}=Ur;if(Qo&6){ka(Ur.component.subTree,Mi,Xi,oo);return}if(Qo&128){Ur.suspense.move(Mi,Xi,oo);return}if(Qo&64){ss.move(Ur,Mi,Xi,zo);return}if(ss===js){c(ko,Mi,Xi);for(let Ws=0;Wsys.enter(ko),go);else{const{leave:Ws,delayLeave:ql,afterLeave:Su}=ys,uc=()=>{Ur.ctx.isUnmounted?S(ko):c(ko,Mi,Xi)},Th=()=>{Ws(ko,()=>{uc(),Su&&Su()})};ql?ql(ko,uc,Th):Th()}else c(ko,Mi,Xi)},Ta=(Ur,Mi,Xi,oo=!1,go=!1)=>{const{type:ko,props:ss,ref:ys,children:ns,dynamicChildren:Qo,shapeFlag:Rl,patchFlag:Ws,dirs:ql,cacheIndex:Su}=Ur;if(Ws===-2&&(go=!1),ys!=null&&(N1(),p5(ys,null,Xi,Ur,!0),j1()),Su!=null&&(Mi.renderCache[Su]=void 0),Rl&256){Mi.ctx.deactivate(Ur);return}const uc=Rl&1&&ql,Th=!L2(Ur);let Gc;if(Th&&(Gc=ss&&ss.onVnodeBeforeUnmount)&&fv(Gc,Mi,Ur),Rl&6)sn(Ur.component,Xi,oo);else{if(Rl&128){Ur.suspense.unmount(Xi,oo);return}uc&&rx(Ur,null,Mi,"beforeUnmount"),Rl&64?Ur.type.remove(Ur,Mi,Xi,zo,oo):Qo&&!Qo.hasOnce&&(ko!==js||Ws>0&&Ws&64)?an(Qo,Mi,Xi,!1,!0):(ko===js&&Ws&384||!go&&Rl&16)&&an(ns,Mi,Xi),oo&&so(Ur)}(Th&&(Gc=ss&&ss.onVnodeUnmounted)||uc)&&rm(()=>{Gc&&fv(Gc,Mi,Ur),uc&&rx(Ur,null,Mi,"unmounted")},Xi)},so=Ur=>{const{type:Mi,el:Xi,anchor:oo,transition:go}=Ur;if(Mi===js){Yn(Xi,oo);return}if(Mi===uT){ur(Ur);return}const ko=()=>{S(Xi),go&&!go.persisted&&go.afterLeave&&go.afterLeave()};if(Ur.shapeFlag&1&&go&&!go.persisted){const{leave:ss,delayLeave:ys}=go,ns=()=>ss(Xi,ko);ys?ys(Ur.el,ko,ns):ns()}else ko()},Yn=(Ur,Mi)=>{let Xi;for(;Ur!==Mi;)Xi=vt(Ur),S(Ur),Ur=Xi;S(Mi)},sn=(Ur,Mi,Xi)=>{const{bum:oo,scope:go,job:ko,subTree:ss,um:ys,m:ns,a:Qo,parent:Rl,slots:{__:Ws}}=Ur;LO(ns),LO(Qo),oo&&oT(oo),Rl&&du(Ws)&&Ws.forEach(ql=>{Rl.renderCache[ql]=void 0}),go.stop(),ko&&(ko.flags|=8,Ta(ss,Ur,Mi,Xi)),ys&&rm(ys,Mi),rm(()=>{Ur.isUnmounted=!0},Mi),Mi&&Mi.pendingBranch&&!Mi.isUnmounted&&Ur.asyncDep&&!Ur.asyncResolved&&Ur.suspenseId===Mi.pendingId&&(Mi.deps--,Mi.deps===0&&Mi.resolve())},an=(Ur,Mi,Xi,oo=!1,go=!1,ko=0)=>{for(let ss=ko;ss{if(Ur.shapeFlag&6)return zn(Ur.component.subTree);if(Ur.shapeFlag&128)return Ur.suspense.next();const Mi=vt(Ur.anchor||Ur.el),Xi=Mi&&Mi[bj];return Xi?vt(Xi):Mi};let Ra=!1;const Ya=(Ur,Mi,Xi)=>{Ur==null?Mi._vnode&&Ta(Mi._vnode,null,null,!0):Dt(Mi._vnode||null,Ur,Mi,null,null,null,Xi),Mi._vnode=Ur,Ra||(Ra=!0,_O(),yj(),Ra=!1)},zo={p:Dt,um:Ta,m:ka,r:so,mt:Ar,mc:Ci,pc:Di,pbc:Ji,n:zn,o:t};return{render:Ya,hydrate:void 0,createApp:Rne(Ya)}}function p7({type:t,props:e},r){return r==="svg"&&t==="foreignObject"||r==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:r}function ix({effect:t,job:e},r){r?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Gne(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function xE(t,e,r=!1){const c=t.children,S=e.children;if(du(c)&&du(S))for(let H=0;H>1,t[r[ue]]0&&(e[c]=r[H-1]),r[H]=c)}}for(H=r.length,Z=r[H-1];H-- >0;)r[H]=Z,Z=e[Z];return r}function Zj(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Zj(e)}function LO(t){if(t)for(let e=0;eyg(Kne);function w0(t,e,r){return Kj(t,e,r)}function Kj(t,e,r=Cf){const{immediate:c,deep:S,flush:H,once:Z}=r,ue=zp({},r),be=e&&c||!e&&H!=="post";let Se;if(D5){if(H==="sync"){const bt=Yne();Se=bt.__watcherHandles||(bt.__watcherHandles=[])}else if(!be){const bt=()=>{};return bt.stop=Ev,bt.resume=Ev,bt.pause=Ev,bt}}const Re=F0;ue.call=(bt,kt,Dt)=>Ng(bt,Re,kt,Dt);let Xe=!1;H==="post"?ue.scheduler=bt=>{rm(bt,Re&&Re.suspense)}:H!=="sync"&&(Xe=!0,ue.scheduler=(bt,kt)=>{kt?bt():gE(bt)}),ue.augmentJob=bt=>{e&&(bt.flags|=4),Xe&&(bt.flags|=2,Re&&(bt.id=Re.uid,bt.i=Re))};const vt=dne(t,e,ue);return D5&&(Se?Se.push(vt):be&&vt()),vt}function Xne(t,e,r){const c=this.proxy,S=Ad(t)?t.includes(".")?Yj(c,t):()=>c[t]:t.bind(c,c);let H;Xu(e)?H=e:(H=e.handler,r=e);const Z=X5(this),ue=Kj(S,H.bind(c),r);return Z(),ue}function Yj(t,e){const r=e.split(".");return()=>{let c=t;for(let S=0;Se==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${bg(e)}Modifiers`]||t[`${g_(e)}Modifiers`];function Qne(t,e,...r){if(t.isUnmounted)return;const c=t.vnode.props||Cf;let S=r;const H=e.startsWith("update:"),Z=H&&Jne(c,e.slice(7));Z&&(Z.trim&&(S=r.map(Re=>Ad(Re)?Re.trim():Re)),Z.number&&(S=r.map(LT)));let ue,be=c[ue=s7(e)]||c[ue=s7(bg(e))];!be&&H&&(be=c[ue=s7(g_(e))]),be&&Ng(be,t,6,S);const Se=c[ue+"Once"];if(Se){if(!t.emitted)t.emitted={};else if(t.emitted[ue])return;t.emitted[ue]=!0,Ng(Se,t,6,S)}}function Xj(t,e,r=!1){const c=e.emitsCache,S=c.get(t);if(S!==void 0)return S;const H=t.emits;let Z={},ue=!1;if(!Xu(t)){const be=Se=>{const Re=Xj(Se,e,!0);Re&&(ue=!0,zp(Z,Re))};!r&&e.mixins.length&&e.mixins.forEach(be),t.extends&&be(t.extends),t.mixins&&t.mixins.forEach(be)}return!H&&!ue?(Af(t)&&c.set(t,null),null):(du(H)?H.forEach(be=>Z[be]=null):zp(Z,H),Af(t)&&c.set(t,Z),Z)}function xS(t,e){return!t||!uS(e)?!1:(e=e.slice(2).replace(/Once$/,""),Zh(t,e[0].toLowerCase()+e.slice(1))||Zh(t,g_(e))||Zh(t,e))}function PO(t){const{type:e,vnode:r,proxy:c,withProxy:S,propsOptions:[H],slots:Z,attrs:ue,emit:be,render:Se,renderCache:Re,props:Xe,data:vt,setupState:bt,ctx:kt,inheritAttrs:Dt}=t,rr=OT(t);let Er,Fe;try{if(r.shapeFlag&4){const ur=S||c,Ir=ur;Er=Tv(Se.call(Ir,ur,Re,Xe,bt,vt,kt)),Fe=ue}else{const ur=e;Er=Tv(ur.length>1?ur(Xe,{attrs:ue,slots:Z,emit:be}):ur(Xe,null)),Fe=e.props?ue:eae(ue)}}catch(ur){g5.length=0,mS(ur,t,1),Er=il(R0)}let wi=Er;if(Fe&&Dt!==!1){const ur=Object.keys(Fe),{shapeFlag:Ir}=wi;ur.length&&Ir&7&&(H&&ur.some(aE)&&(Fe=tae(Fe,H)),wi=d_(wi,Fe,!1,!0))}return r.dirs&&(wi=d_(wi,null,!1,!0),wi.dirs=wi.dirs?wi.dirs.concat(r.dirs):r.dirs),r.transition&&Bx(wi,r.transition),Er=wi,OT(rr),Er}const eae=t=>{let e;for(const r in t)(r==="class"||r==="style"||uS(r))&&((e||(e={}))[r]=t[r]);return e},tae=(t,e)=>{const r={};for(const c in t)(!aE(c)||!(c.slice(9)in e))&&(r[c]=t[c]);return r};function rae(t,e,r){const{props:c,children:S,component:H}=t,{props:Z,children:ue,patchFlag:be}=e,Se=H.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&be>=0){if(be&1024)return!0;if(be&16)return c?IO(c,Z,Se):!!Z;if(be&8){const Re=e.dynamicProps;for(let Xe=0;Xet.__isSuspense;function nae(t,e){e&&e.pendingBranch?du(t)?e.effects.push(...t):e.effects.push(t):gne(t)}const js=Symbol.for("v-fgt"),bS=Symbol.for("v-txt"),R0=Symbol.for("v-cmt"),uT=Symbol.for("v-stc"),g5=[];let Km=null;function Wr(t=!1){g5.push(Km=t?null:[])}function aae(){g5.pop(),Km=g5[g5.length-1]||null}let P5=1;function DO(t,e=!1){P5+=t,t<0&&Km&&e&&(Km.hasOnce=!0)}function Qj(t){return t.dynamicChildren=P5>0?Km||A2:null,aae(),P5>0&&Km&&Km.push(t),t}function Qr(t,e,r,c,S,H){return Qj(Le(t,e,r,c,S,H,!0))}function Sd(t,e,r,c,S){return Qj(il(t,e,r,c,S,!0))}function I5(t){return t?t.__v_isVNode===!0:!1}function _x(t,e){return t.type===e.type&&t.key===e.key}const eU=({key:t})=>t??null,cT=({ref:t,ref_key:e,ref_for:r})=>(typeof t=="number"&&(t=""+t),t!=null?Ad(t)||up(t)||Xu(t)?{i:b0,r:t,k:e,f:!!r}:t:null);function Le(t,e=null,r=null,c=0,S=null,H=t===js?0:1,Z=!1,ue=!1){const be={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&eU(e),ref:e&&cT(e),scopeId:xj,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:H,patchFlag:c,dynamicProps:S,dynamicChildren:null,appContext:null,ctx:b0};return ue?(bE(be,r),H&128&&t.normalize(be)):r&&(be.shapeFlag|=Ad(r)?8:16),P5>0&&!Z&&Km&&(be.patchFlag>0||H&6)&&be.patchFlag!==32&&Km.push(be),be}const il=oae;function oae(t,e=null,r=null,c=0,S=null,H=!1){if((!t||t===zj)&&(t=R0),I5(t)){const ue=d_(t,e,!0);return r&&bE(ue,r),P5>0&&!H&&Km&&(ue.shapeFlag&6?Km[Km.indexOf(t)]=ue:Km.push(ue)),ue.patchFlag=-2,ue}if(vae(t)&&(t=t.__vccOpts),e){e=sae(e);let{class:ue,style:be}=e;ue&&!Ad(ue)&&(e.class=eo(ue)),Af(be)&&(pE(be)&&!du(be)&&(be=zp({},be)),e.style=om(be))}const Z=Ad(t)?1:Jj(t)?128:wj(t)?64:Af(t)?4:Xu(t)?2:0;return Le(t,e,r,c,S,Z,H,!0)}function sae(t){return t?pE(t)||$j(t)?zp({},t):t:null}function d_(t,e,r=!1,c=!1){const{props:S,ref:H,patchFlag:Z,children:ue,transition:be}=t,Se=e?lae(S||{},e):S,Re={__v_isVNode:!0,__v_skip:!0,type:t.type,props:Se,key:Se&&eU(Se),ref:e&&e.ref?r&&H?du(H)?H.concat(cT(e)):[H,cT(e)]:cT(e):H,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:ue,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==js?Z===-1?16:Z|16:Z,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:be,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&d_(t.ssContent),ssFallback:t.ssFallback&&d_(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return be&&c&&Bx(Re,be.clone(Re)),Re}function ul(t=" ",e=0){return il(bS,null,t,e)}function qc(t,e){const r=il(uT,null,t);return r.staticCount=e,r}function Ma(t="",e=!1){return e?(Wr(),Sd(R0,null,t)):il(R0,null,t)}function Tv(t){return t==null||typeof t=="boolean"?il(R0):du(t)?il(js,null,t.slice()):I5(t)?Xy(t):il(bS,null,String(t))}function Xy(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:d_(t)}function bE(t,e){let r=0;const{shapeFlag:c}=t;if(e==null)e=null;else if(du(e))r=16;else if(typeof e=="object")if(c&65){const S=e.default;S&&(S._c&&(S._d=!1),bE(t,S()),S._c&&(S._d=!0));return}else{r=32;const S=e._;!S&&!$j(e)?e._ctx=b0:S===3&&b0&&(b0.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Xu(e)?(e={default:e,_ctx:b0},r=32):(e=String(e),c&64?(r=16,e=[ul(e)]):r=8);t.children=e,t.shapeFlag|=r}function lae(...t){const e={};for(let r=0;rF0||b0;let RT,OM;{const t=dS(),e=(r,c)=>{let S;return(S=t[r])||(S=t[r]=[]),S.push(c),H=>{S.length>1?S.forEach(Z=>Z(H)):S[0](H)}};RT=e("__VUE_INSTANCE_SETTERS__",r=>F0=r),OM=e("__VUE_SSR_SETTERS__",r=>D5=r)}const X5=t=>{const e=F0;return RT(t),t.scope.on(),()=>{t.scope.off(),RT(e)}},zO=()=>{F0&&F0.scope.off(),RT(null)};function tU(t){return t.vnode.shapeFlag&4}let D5=!1;function fae(t,e=!1,r=!1){e&&OM(e);const{props:c,children:S}=t.vnode,H=tU(t);Nne(t,c,H,e),Hne(t,S,r||e);const Z=H?dae(t,e):void 0;return e&&OM(!1),Z}function dae(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Lne);const{setup:c}=r;if(c){N1();const S=t.setupContext=c.length>1?mae(t):null,H=X5(t),Z=Y5(c,t,0,[t.props,S]),ue=HN(Z);if(j1(),H(),(ue||t.sp)&&!L2(t)&&Lj(t),ue){if(Z.then(zO,zO),e)return Z.then(be=>{OO(t,be)}).catch(be=>{mS(be,t,0)});t.asyncDep=Z}else OO(t,Z)}else rU(t)}function OO(t,e,r){Xu(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Af(e)&&(t.setupState=mj(e)),rU(t)}function rU(t,e,r){const c=t.type;t.render||(t.render=c.render||Ev);{const S=X5(t);N1();try{Pne(t)}finally{j1(),S()}}}const pae={get(t,e){return B0(t,"get",""),t[e]}};function mae(t){const e=r=>{t.exposed=r||{}};return{attrs:new Proxy(t.attrs,pae),slots:t.slots,emit:t.emit,expose:e}}function kS(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(mj(mE(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in m5)return m5[r](t)},has(e,r){return r in e||r in m5}})):t.proxy}function gae(t,e=!0){return Xu(t)?t.displayName||t.name:t.name||e&&t.__name}function vae(t){return Xu(t)&&"__vccOpts"in t}const Do=(t,e)=>hne(t,e,D5);function wE(t,e,r){const c=arguments.length;return c===2?Af(e)&&!du(e)?I5(e)?il(t,null,[e]):il(t,e):il(t,null,e):(c>3?r=Array.prototype.slice.call(arguments,2):c===3&&I5(r)&&(r=[r]),il(t,e,r))}const yae="3.5.18";/** +**/function J5(t,e,r,c){try{return c?t(...c):t()}catch(S){v8(S,e,r)}}function Ng(t,e,r,c){if(Xu(t)){const S=J5(t,e,r,c);return S&&WN(S)&&S.catch($=>{v8($,e,r)}),S}if(du(t)){const S=[];for(let $=0;$>>1,S=nm[c],$=P5(S);$=P5(r)?nm.push(t):nm.splice(yne(e),0,t),t.flags|=1,_j()}}function _j(){BT||(BT=yj.then(bj))}function _ne(t){du(t)?L2.push(...t):Jy&&t.id===-1?Jy.splice(b2+1,0,t):t.flags&1||(L2.push(t),t.flags|=1),_j()}function bO(t,e,r=bv+1){for(;rP5(r)-P5(c));if(L2.length=0,Jy){Jy.push(...e);return}for(Jy=e,b2=0;b2t.id==null?t.flags&2?-1:1/0:t.id;function bj(t){try{for(bv=0;bv{c._d&&OO(-1);const $=RT(e);let Z;try{Z=t(...S)}finally{RT($),c._d&&OO(1)}return Z};return c._n=!0,c._c=!0,c._d=!0,c}function Sl(t,e){if(w0===null)return t;const r=S8(w0),c=t.dirs||(t.dirs=[]);for(let S=0;St.__isTeleport,m5=t=>t&&(t.disabled||t.disabled===""),wO=t=>t&&(t.defer||t.defer===""),kO=t=>typeof SVGElement<"u"&&t instanceof SVGElement,TO=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,IM=(t,e)=>{const r=t&&t.to;return Md(r)?e?e(r):null:r},Sj={name:"Teleport",__isTeleport:!0,process(t,e,r,c,S,$,Z,ue,xe,Se){const{mc:Ne,pc:it,pbc:pt,o:{insert:bt,querySelector:wt,createText:Dt,createComment:Zt}}=Se,Mr=m5(e.props);let{shapeFlag:ze,children:ni,dynamicChildren:or}=e;if(t==null){const Cr=e.el=Dt(""),gi=e.anchor=Dt("");bt(Cr,r,c),bt(gi,r,c);const Si=(ri,on)=>{ze&16&&(S&&S.isCE&&(S.ce._teleportTarget=ri),Ne(ni,ri,on,S,$,Z,ue,xe))},Ci=()=>{const ri=e.target=IM(e.props,wt),on=Cj(ri,e,Dt,bt);ri&&(Z!=="svg"&&kO(ri)?Z="svg":Z!=="mathml"&&TO(ri)&&(Z="mathml"),Mr||(Si(ri,on),uT(e,!1)))};Mr&&(Si(r,gi),uT(e,!0)),wO(e.props)?(e.el.__isMounted=!1,rm(()=>{Ci(),delete e.el.__isMounted},$)):Ci()}else{if(wO(e.props)&&t.el.__isMounted===!1){rm(()=>{Sj.process(t,e,r,c,S,$,Z,ue,xe,Se)},$);return}e.el=t.el,e.targetStart=t.targetStart;const Cr=e.anchor=t.anchor,gi=e.target=t.target,Si=e.targetAnchor=t.targetAnchor,Ci=m5(t.props),ri=Ci?r:gi,on=Ci?Cr:Si;if(Z==="svg"||kO(gi)?Z="svg":(Z==="mathml"||TO(gi))&&(Z="mathml"),or?(pt(t.dynamicChildren,or,ri,S,$,Z,ue),wE(t,e,!0)):xe||it(t,e,ri,on,S,$,Z,ue,!1),Mr)Ci?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Ik(e,r,Cr,Se,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const yi=e.target=IM(e.props,wt);yi&&Ik(e,yi,null,Se,0)}else Ci&&Ik(e,gi,Si,Se,1);uT(e,Mr)}},remove(t,e,r,{um:c,o:{remove:S}},$){const{shapeFlag:Z,children:ue,anchor:xe,targetStart:Se,targetAnchor:Ne,target:it,props:pt}=t;if(it&&(S(Se),S(Ne)),$&&S(xe),Z&16){const bt=$||!m5(pt);for(let wt=0;wt{t.isMounted=!0}),$g(()=>{t.isUnmounting=!0}),t}const sg=[Function,Array],Mj={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:sg,onEnter:sg,onAfterEnter:sg,onEnterCancelled:sg,onBeforeLeave:sg,onLeave:sg,onAfterLeave:sg,onLeaveCancelled:sg,onBeforeAppear:sg,onAppear:sg,onAfterAppear:sg,onAppearCancelled:sg},Ej=t=>{const e=t.subTree;return e.component?Ej(e.component):e},bne={name:"BaseTransition",props:Mj,setup(t,{slots:e}){const r=T8(),c=Aj();return()=>{const S=e.default&&_E(e.default(),!0);if(!S||!S.length)return;const $=Lj(S),Z=Ou(t),{mode:ue}=Z;if(c.isLeaving)return p7($);const xe=SO($);if(!xe)return p7($);let Se=I5(xe,Z,c,r,it=>Se=it);xe.type!==R0&&Fx(xe,Se);let Ne=r.subTree&&SO(r.subTree);if(Ne&&Ne.type!==R0&&!wx(xe,Ne)&&Ej(r).type!==R0){let it=I5(Ne,Z,c,r);if(Fx(Ne,it),ue==="out-in"&&xe.type!==R0)return c.isLeaving=!0,it.afterLeave=()=>{c.isLeaving=!1,r.job.flags&8||r.update(),delete it.afterLeave,Ne=void 0},p7($);ue==="in-out"&&xe.type!==R0?it.delayLeave=(pt,bt,wt)=>{const Dt=Pj(c,Ne);Dt[String(Ne.key)]=Ne,pt[Qy]=()=>{bt(),pt[Qy]=void 0,delete Se.delayedLeave,Ne=void 0},Se.delayedLeave=()=>{wt(),delete Se.delayedLeave,Ne=void 0}}:Ne=void 0}else Ne&&(Ne=void 0);return $}}};function Lj(t){let e=t[0];if(t.length>1){for(const r of t)if(r.type!==R0){e=r;break}}return e}const wne=bne;function Pj(t,e){const{leavingVNodes:r}=t;let c=r.get(e.type);return c||(c=Object.create(null),r.set(e.type,c)),c}function I5(t,e,r,c,S){const{appear:$,mode:Z,persisted:ue=!1,onBeforeEnter:xe,onEnter:Se,onAfterEnter:Ne,onEnterCancelled:it,onBeforeLeave:pt,onLeave:bt,onAfterLeave:wt,onLeaveCancelled:Dt,onBeforeAppear:Zt,onAppear:Mr,onAfterAppear:ze,onAppearCancelled:ni}=e,or=String(t.key),Cr=Pj(r,t),gi=(ri,on)=>{ri&&Ng(ri,c,9,on)},Si=(ri,on)=>{const yi=on[1];gi(ri,on),du(ri)?ri.every(gr=>gr.length<=1)&&yi():ri.length<=1&&yi()},Ci={mode:Z,persisted:ue,beforeEnter(ri){let on=xe;if(!r.isMounted)if($)on=Zt||xe;else return;ri[Qy]&&ri[Qy](!0);const yi=Cr[or];yi&&wx(t,yi)&&yi.el[Qy]&&yi.el[Qy](),gi(on,[ri])},enter(ri){let on=Se,yi=Ne,gr=it;if(!r.isMounted)if($)on=Mr||Se,yi=ze||Ne,gr=ni||it;else return;let fr=!1;const Sr=ri[Dk]=ei=>{fr||(fr=!0,ei?gi(gr,[ri]):gi(yi,[ri]),Ci.delayedLeave&&Ci.delayedLeave(),ri[Dk]=void 0)};on?Si(on,[ri,Sr]):Sr()},leave(ri,on){const yi=String(t.key);if(ri[Dk]&&ri[Dk](!0),r.isUnmounting)return on();gi(pt,[ri]);let gr=!1;const fr=ri[Qy]=Sr=>{gr||(gr=!0,on(),Sr?gi(Dt,[ri]):gi(wt,[ri]),ri[Qy]=void 0,Cr[yi]===t&&delete Cr[yi])};Cr[yi]=t,bt?Si(bt,[ri,fr]):fr()},clone(ri){const on=I5(ri,e,r,c,S);return S&&S(on),on}};return Ci}function p7(t){if(_8(t))return t=v_(t),t.children=null,t}function SO(t){if(!_8(t))return Tj(t.type)&&t.children?Lj(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:r}=t;if(r){if(e&16)return r[0];if(e&32&&Xu(r.default))return r.default()}}function Fx(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Fx(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function _E(t,e=!1,r){let c=[],S=0;for(let $=0;$1)for(let $=0;$g5(wt,e&&(du(e)?e[Dt]:e),r,c,S));return}if(P2(c)&&!S){c.shapeFlag&512&&c.type.__asyncResolved&&c.component.subTree.component&&g5(t,e,r,c.component.subTree);return}const $=c.shapeFlag&4?S8(c.component):c.el,Z=S?null:$,{i:ue,r:xe}=t,Se=e&&e.r,Ne=ue.refs===Cf?ue.refs={}:ue.refs,it=ue.setupState,pt=Ou(it),bt=it===Cf?()=>!1:wt=>Zh(pt,wt);if(Se!=null&&Se!==xe&&(Md(Se)?(Ne[Se]=null,bt(Se)&&(it[Se]=null)):cp(Se)&&(Se.value=null)),Xu(xe))J5(xe,ue,12,[Z,Ne]);else{const wt=Md(xe),Dt=cp(xe);if(wt||Dt){const Zt=()=>{if(t.f){const Mr=wt?bt(xe)?it[xe]:Ne[xe]:xe.value;S?du(Mr)&&lE(Mr,$):du(Mr)?Mr.includes($)||Mr.push($):wt?(Ne[xe]=[$],bt(xe)&&(it[xe]=Ne[xe])):(xe.value=[$],t.k&&(Ne[t.k]=xe.value))}else wt?(Ne[xe]=Z,bt(xe)&&(it[xe]=Z)):Dt&&(xe.value=Z,t.k&&(Ne[t.k]=Z))};Z?(Zt.id=-1,rm(Zt,r)):Zt()}}}m8().requestIdleCallback;m8().cancelIdleCallback;const P2=t=>!!t.type.__asyncLoader,_8=t=>t.type.__isKeepAlive;function kne(t,e){Dj(t,"a",e)}function Tne(t,e){Dj(t,"da",e)}function Dj(t,e,r=F0){const c=t.__wdc||(t.__wdc=()=>{let S=r;for(;S;){if(S.isDeactivated)return;S=S.parent}return t()});if(x8(e,c,r),r){let S=r.parent;for(;S&&S.parent;)_8(S.parent.vnode)&&Sne(c,e,r,S),S=S.parent}}function Sne(t,e,r,c){const S=x8(e,t,c,!0);Iv(()=>{lE(c[e],S)},r)}function x8(t,e,r=F0,c=!1){if(r){const S=r[t]||(r[t]=[]),$=e.__weh||(e.__weh=(...Z)=>{j1();const ue=Q5(r),xe=Ng(e,r,t,Z);return ue(),U1(),xe});return c?S.unshift($):S.push($),$}}const V1=t=>(e,r=F0)=>{(!O5||t==="sp")&&x8(t,(...c)=>e(...c),r)},Cne=V1("bm"),Jf=V1("m"),Ane=V1("bu"),zj=V1("u"),$g=V1("bum"),Iv=V1("um"),Mne=V1("sp"),Ene=V1("rtg"),Lne=V1("rtc");function Pne(t,e=F0){x8("ec",t,e)}const Oj="components";function b8(t,e){return Rj(Oj,t,!0,e)||t}const Bj=Symbol.for("v-ndc");function a_(t){return Md(t)?Rj(Oj,t,!1)||t:t||Bj}function Rj(t,e,r=!0,c=!1){const S=w0||F0;if(S){const $=S.type;{const ue=_ae($,!1);if(ue&&(ue===e||ue===wg(e)||ue===p8(wg(e))))return $}const Z=CO(S[t]||$[t],e)||CO(S.appContext[t],e);return!Z&&c?$:Z}}function CO(t,e){return t&&(t[e]||t[wg(e)]||t[p8(wg(e))])}function au(t,e,r,c){let S;const $=r,Z=du(t);if(Z||Md(t)){const ue=Z&&f_(t);let xe=!1,Se=!1;ue&&(xe=!yg(t),Se=g_(t),t=g8(t)),S=new Array(t.length);for(let Ne=0,it=t.length;Nee(ue,xe,void 0,$));else{const ue=Object.keys(t);S=new Array(ue.length);for(let xe=0,Se=ue.length;xez5(e)?!(e.type===R0||e.type===js&&!Fj(e.children)):!0)?t:null}const DM=t=>t?iU(t)?S8(t):DM(t.parent):null,v5=Op(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>DM(t.parent),$root:t=>DM(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>jj(t),$forceUpdate:t=>t.f||(t.f=()=>{yE(t.update)}),$nextTick:t=>t.n||(t.n=b0.bind(t.proxy)),$watch:t=>eae.bind(t)}),m7=(t,e)=>t!==Cf&&!t.__isScriptSetup&&Zh(t,e),Dne={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:r,setupState:c,data:S,props:$,accessCache:Z,type:ue,appContext:xe}=t;let Se;if(e[0]!=="$"){const bt=Z[e];if(bt!==void 0)switch(bt){case 1:return c[e];case 2:return S[e];case 4:return r[e];case 3:return $[e]}else{if(m7(c,e))return Z[e]=1,c[e];if(S!==Cf&&Zh(S,e))return Z[e]=2,S[e];if((Se=t.propsOptions[0])&&Zh(Se,e))return Z[e]=3,$[e];if(r!==Cf&&Zh(r,e))return Z[e]=4,r[e];zM&&(Z[e]=0)}}const Ne=v5[e];let it,pt;if(Ne)return e==="$attrs"&&B0(t.attrs,"get",""),Ne(t);if((it=ue.__cssModules)&&(it=it[e]))return it;if(r!==Cf&&Zh(r,e))return Z[e]=4,r[e];if(pt=xe.config.globalProperties,Zh(pt,e))return pt[e]},set({_:t},e,r){const{data:c,setupState:S,ctx:$}=t;return m7(S,e)?(S[e]=r,!0):c!==Cf&&Zh(c,e)?(c[e]=r,!0):Zh(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:($[e]=r,!0)},has({_:{data:t,setupState:e,accessCache:r,ctx:c,appContext:S,propsOptions:$}},Z){let ue;return!!r[Z]||t!==Cf&&Zh(t,Z)||m7(e,Z)||(ue=$[0])&&Zh(ue,Z)||Zh(c,Z)||Zh(v5,Z)||Zh(S.config.globalProperties,Z)},defineProperty(t,e,r){return r.get!=null?t._.accessCache[e]=0:Zh(r,"value")&&this.set(t,e,r.value,null),Reflect.defineProperty(t,e,r)}};function AO(t){return du(t)?t.reduce((e,r)=>(e[r]=null,e),{}):t}let zM=!0;function zne(t){const e=jj(t),r=t.proxy,c=t.ctx;zM=!1,e.beforeCreate&&MO(e.beforeCreate,t,"bc");const{data:S,computed:$,methods:Z,watch:ue,provide:xe,inject:Se,created:Ne,beforeMount:it,mounted:pt,beforeUpdate:bt,updated:wt,activated:Dt,deactivated:Zt,beforeDestroy:Mr,beforeUnmount:ze,destroyed:ni,unmounted:or,render:Cr,renderTracked:gi,renderTriggered:Si,errorCaptured:Ci,serverPrefetch:ri,expose:on,inheritAttrs:yi,components:gr,directives:fr,filters:Sr}=e;if(Se&&One(Se,c,null),Z)for(const ti in Z){const Di=Z[ti];Xu(Di)&&(c[ti]=Di.bind(r))}if(S){const ti=S.call(r,r);Mf(ti)&&(t.data=m_(ti))}if(zM=!0,$)for(const ti in $){const Di=$[ti],En=Xu(Di)?Di.bind(r,r):Xu(Di.get)?Di.get.bind(r,r):Ev,Zn=!Xu(Di)&&Xu(Di.set)?Di.set.bind(r):Ev,ga=Io({get:En,set:Zn});Object.defineProperty(c,ti,{enumerable:!0,configurable:!0,get:()=>ga.value,set:ya=>ga.value=ya})}if(ue)for(const ti in ue)Nj(ue[ti],c,r,ti);if(xe){const ti=Xu(xe)?xe.call(r):xe;Reflect.ownKeys(ti).forEach(Di=>{cT(Di,ti[Di])})}Ne&&MO(Ne,t,"c");function Jr(ti,Di){du(Di)?Di.forEach(En=>ti(En.bind(r))):Di&&ti(Di.bind(r))}if(Jr(Cne,it),Jr(Jf,pt),Jr(Ane,bt),Jr(zj,wt),Jr(kne,Dt),Jr(Tne,Zt),Jr(Pne,Ci),Jr(Lne,gi),Jr(Ene,Si),Jr($g,ze),Jr(Iv,or),Jr(Mne,ri),du(on))if(on.length){const ti=t.exposed||(t.exposed={});on.forEach(Di=>{Object.defineProperty(ti,Di,{get:()=>r[Di],set:En=>r[Di]=En,enumerable:!0})})}else t.exposed||(t.exposed={});Cr&&t.render===Ev&&(t.render=Cr),yi!=null&&(t.inheritAttrs=yi),gr&&(t.components=gr),fr&&(t.directives=fr),ri&&Ij(t)}function One(t,e,r=Ev){du(t)&&(t=OM(t));for(const c in t){const S=t[c];let $;Mf(S)?"default"in S?$=_g(S.from||c,S.default,!0):$=_g(S.from||c):$=_g(S),cp($)?Object.defineProperty(e,c,{enumerable:!0,configurable:!0,get:()=>$.value,set:Z=>$.value=Z}):e[c]=$}}function MO(t,e,r){Ng(du(t)?t.map(c=>c.bind(e.proxy)):t.bind(e.proxy),e,r)}function Nj(t,e,r,c){let S=c.includes(".")?Jj(r,c):()=>r[c];if(Md(t)){const $=e[t];Xu($)&&Af(S,$)}else if(Xu(t))Af(S,t.bind(r));else if(Mf(t))if(du(t))t.forEach($=>Nj($,e,r,c));else{const $=Xu(t.handler)?t.handler.bind(r):e[t.handler];Xu($)&&Af(S,$,t)}}function jj(t){const e=t.type,{mixins:r,extends:c}=e,{mixins:S,optionsCache:$,config:{optionMergeStrategies:Z}}=t.appContext,ue=$.get(e);let xe;return ue?xe=ue:!S.length&&!r&&!c?xe=e:(xe={},S.length&&S.forEach(Se=>FT(xe,Se,Z,!0)),FT(xe,e,Z)),Mf(e)&&$.set(e,xe),xe}function FT(t,e,r,c=!1){const{mixins:S,extends:$}=e;$&&FT(t,$,r,!0),S&&S.forEach(Z=>FT(t,Z,r,!0));for(const Z in e)if(!(c&&Z==="expose")){const ue=Bne[Z]||r&&r[Z];t[Z]=ue?ue(t[Z],e[Z]):e[Z]}return t}const Bne={data:EO,props:LO,emits:LO,methods:t5,computed:t5,beforeCreate:Q0,created:Q0,beforeMount:Q0,mounted:Q0,beforeUpdate:Q0,updated:Q0,beforeDestroy:Q0,beforeUnmount:Q0,destroyed:Q0,unmounted:Q0,activated:Q0,deactivated:Q0,errorCaptured:Q0,serverPrefetch:Q0,components:t5,directives:t5,watch:Fne,provide:EO,inject:Rne};function EO(t,e){return e?t?function(){return Op(Xu(t)?t.call(this,this):t,Xu(e)?e.call(this,this):e)}:e:t}function Rne(t,e){return t5(OM(t),OM(e))}function OM(t){if(du(t)){const e={};for(let r=0;r1)return r&&Xu(e)?e.call(c&&c.proxy):e}}function Une(){return!!(T8()||Px)}const $j={},Hj=()=>Object.create($j),Vj=t=>Object.getPrototypeOf(t)===$j;function $ne(t,e,r,c=!1){const S={},$=Hj();t.propsDefaults=Object.create(null),Wj(t,e,S,$);for(const Z in t.propsOptions[0])Z in S||(S[Z]=void 0);r?t.props=c?S:pj(S):t.type.props?t.props=S:t.props=$,t.attrs=$}function Hne(t,e,r,c){const{props:S,attrs:$,vnode:{patchFlag:Z}}=t,ue=Ou(S),[xe]=t.propsOptions;let Se=!1;if((c||Z>0)&&!(Z&16)){if(Z&8){const Ne=t.vnode.dynamicProps;for(let it=0;it{xe=!0;const[pt,bt]=qj(it,e,!0);Op(Z,pt),bt&&ue.push(...bt)};!r&&e.mixins.length&&e.mixins.forEach(Ne),t.extends&&Ne(t.extends),t.mixins&&t.mixins.forEach(Ne)}if(!$&&!xe)return Mf(t)&&c.set(t,M2),M2;if(du($))for(let Ne=0;Ne<$.length;Ne++){const it=wg($[Ne]);PO(it)&&(Z[it]=Cf)}else if($)for(const Ne in $){const it=wg(Ne);if(PO(it)){const pt=$[Ne],bt=Z[it]=du(pt)||Xu(pt)?{type:pt}:Op({},pt),wt=bt.type;let Dt=!1,Zt=!0;if(du(wt))for(let Mr=0;Mrt==="_"||t==="__"||t==="_ctx"||t==="$stable",bE=t=>du(t)?t.map(Tv):[Tv(t)],Wne=(t,e,r)=>{if(e._n)return e;const c=$1((...S)=>bE(e(...S)),r);return c._c=!1,c},Gj=(t,e,r)=>{const c=t._ctx;for(const S in t){if(xE(S))continue;const $=t[S];if(Xu($))e[S]=Wne(S,$,c);else if($!=null){const Z=bE($);e[S]=()=>Z}}},Zj=(t,e)=>{const r=bE(e);t.slots.default=()=>r},Kj=(t,e,r)=>{for(const c in e)(r||!xE(c))&&(t[c]=e[c])},qne=(t,e,r)=>{const c=t.slots=Hj();if(t.vnode.shapeFlag&32){const S=e.__;S&&MM(c,"__",S,!0);const $=e._;$?(Kj(c,e,r),r&&MM(c,"_",$,!0)):Gj(e,c)}else e&&Zj(t,e)},Gne=(t,e,r)=>{const{vnode:c,slots:S}=t;let $=!0,Z=Cf;if(c.shapeFlag&32){const ue=e._;ue?r&&ue===1?$=!1:Kj(S,e,r):($=!e.$stable,Gj(e,S)),Z=e}else e&&(Zj(t,e),Z={default:1});if($)for(const ue in S)!xE(ue)&&Z[ue]==null&&delete S[ue]},rm=sae;function Zne(t){return Kne(t)}function Kne(t,e){const r=m8();r.__VUE__=!0;const{insert:c,remove:S,patchProp:$,createElement:Z,createText:ue,createComment:xe,setText:Se,setElementText:Ne,parentNode:it,nextSibling:pt,setScopeId:bt=Ev,insertStaticContent:wt}=t,Dt=($r,Mi,Xi,so=null,go=null,ko=null,ss=void 0,ys=null,ns=!!Mi.dynamicChildren)=>{if($r===Mi)return;$r&&!wx($r,Mi)&&(so=On($r),ya($r,go,ko,!0),$r=null),Mi.patchFlag===-2&&(ns=!1,Mi.dynamicChildren=null);const{type:Qo,ref:Rl,shapeFlag:Ws}=Mi;switch(Qo){case k8:Zt($r,Mi,Xi,so);break;case R0:Mr($r,Mi,Xi,so);break;case hT:$r==null&&ze(Mi,Xi,so,ss);break;case js:gr($r,Mi,Xi,so,go,ko,ss,ys,ns);break;default:Ws&1?Cr($r,Mi,Xi,so,go,ko,ss,ys,ns):Ws&6?fr($r,Mi,Xi,so,go,ko,ss,ys,ns):(Ws&64||Ws&128)&&Qo.process($r,Mi,Xi,so,go,ko,ss,ys,ns,zo)}Rl!=null&&go?g5(Rl,$r&&$r.ref,ko,Mi||$r,!Mi):Rl==null&&$r&&$r.ref!=null&&g5($r.ref,null,ko,$r,!0)},Zt=($r,Mi,Xi,so)=>{if($r==null)c(Mi.el=ue(Mi.children),Xi,so);else{const go=Mi.el=$r.el;Mi.children!==$r.children&&Se(go,Mi.children)}},Mr=($r,Mi,Xi,so)=>{$r==null?c(Mi.el=xe(Mi.children||""),Xi,so):Mi.el=$r.el},ze=($r,Mi,Xi,so)=>{[$r.el,$r.anchor]=wt($r.children,Mi,Xi,so,$r.el,$r.anchor)},ni=({el:$r,anchor:Mi},Xi,so)=>{let go;for(;$r&&$r!==Mi;)go=pt($r),c($r,Xi,so),$r=go;c(Mi,Xi,so)},or=({el:$r,anchor:Mi})=>{let Xi;for(;$r&&$r!==Mi;)Xi=pt($r),S($r),$r=Xi;S(Mi)},Cr=($r,Mi,Xi,so,go,ko,ss,ys,ns)=>{Mi.type==="svg"?ss="svg":Mi.type==="math"&&(ss="mathml"),$r==null?gi(Mi,Xi,so,go,ko,ss,ys,ns):ri($r,Mi,go,ko,ss,ys,ns)},gi=($r,Mi,Xi,so,go,ko,ss,ys)=>{let ns,Qo;const{props:Rl,shapeFlag:Ws,transition:ql,dirs:Su}=$r;if(ns=$r.el=Z($r.type,ko,Rl&&Rl.is,Rl),Ws&8?Ne(ns,$r.children):Ws&16&&Ci($r.children,ns,null,so,go,g7($r,ko),ss,ys),Su&&ox($r,null,so,"created"),Si(ns,$r,$r.scopeId,ss,so),Rl){for(const Th in Rl)Th!=="value"&&!f5(Th)&&$(ns,Th,null,Rl[Th],ko,so);"value"in Rl&&$(ns,"value",null,Rl.value,ko),(Qo=Rl.onVnodeBeforeMount)&&fv(Qo,so,$r)}Su&&ox($r,null,so,"beforeMount");const uc=Yne(go,ql);uc&&ql.beforeEnter(ns),c(ns,Mi,Xi),((Qo=Rl&&Rl.onVnodeMounted)||uc||Su)&&rm(()=>{Qo&&fv(Qo,so,$r),uc&&ql.enter(ns),Su&&ox($r,null,so,"mounted")},go)},Si=($r,Mi,Xi,so,go)=>{if(Xi&&bt($r,Xi),so)for(let ko=0;ko{for(let Qo=ns;Qo<$r.length;Qo++){const Rl=$r[Qo]=ys?e_($r[Qo]):Tv($r[Qo]);Dt(null,Rl,Mi,Xi,so,go,ko,ss,ys)}},ri=($r,Mi,Xi,so,go,ko,ss)=>{const ys=Mi.el=$r.el;let{patchFlag:ns,dynamicChildren:Qo,dirs:Rl}=Mi;ns|=$r.patchFlag&16;const Ws=$r.props||Cf,ql=Mi.props||Cf;let Su;if(Xi&&sx(Xi,!1),(Su=ql.onVnodeBeforeUpdate)&&fv(Su,Xi,Mi,$r),Rl&&ox(Mi,$r,Xi,"beforeUpdate"),Xi&&sx(Xi,!0),(Ws.innerHTML&&ql.innerHTML==null||Ws.textContent&&ql.textContent==null)&&Ne(ys,""),Qo?on($r.dynamicChildren,Qo,ys,Xi,so,g7(Mi,go),ko):ss||Di($r,Mi,ys,null,Xi,so,g7(Mi,go),ko,!1),ns>0){if(ns&16)yi(ys,Ws,ql,Xi,go);else if(ns&2&&Ws.class!==ql.class&&$(ys,"class",null,ql.class,go),ns&4&&$(ys,"style",Ws.style,ql.style,go),ns&8){const uc=Mi.dynamicProps;for(let Th=0;Th{Su&&fv(Su,Xi,Mi,$r),Rl&&ox(Mi,$r,Xi,"updated")},so)},on=($r,Mi,Xi,so,go,ko,ss)=>{for(let ys=0;ys{if(Mi!==Xi){if(Mi!==Cf)for(const ko in Mi)!f5(ko)&&!(ko in Xi)&&$($r,ko,Mi[ko],null,go,so);for(const ko in Xi){if(f5(ko))continue;const ss=Xi[ko],ys=Mi[ko];ss!==ys&&ko!=="value"&&$($r,ko,ys,ss,go,so)}"value"in Xi&&$($r,"value",Mi.value,Xi.value,go)}},gr=($r,Mi,Xi,so,go,ko,ss,ys,ns)=>{const Qo=Mi.el=$r?$r.el:ue(""),Rl=Mi.anchor=$r?$r.anchor:ue("");let{patchFlag:Ws,dynamicChildren:ql,slotScopeIds:Su}=Mi;Su&&(ys=ys?ys.concat(Su):Su),$r==null?(c(Qo,Xi,so),c(Rl,Xi,so),Ci(Mi.children||[],Xi,Rl,go,ko,ss,ys,ns)):Ws>0&&Ws&64&&ql&&$r.dynamicChildren?(on($r.dynamicChildren,ql,Xi,go,ko,ss,ys),(Mi.key!=null||go&&Mi===go.subTree)&&wE($r,Mi,!0)):Di($r,Mi,Xi,Rl,go,ko,ss,ys,ns)},fr=($r,Mi,Xi,so,go,ko,ss,ys,ns)=>{Mi.slotScopeIds=ys,$r==null?Mi.shapeFlag&512?go.ctx.activate(Mi,Xi,so,ss,ns):Sr(Mi,Xi,so,go,ko,ss,ns):ei($r,Mi,ns)},Sr=($r,Mi,Xi,so,go,ko,ss)=>{const ys=$r.component=pae($r,so,go);if(_8($r)&&(ys.ctx.renderer=zo),mae(ys,!1,ss),ys.asyncDep){if(go&&go.registerDep(ys,Jr,ss),!$r.el){const ns=ys.subTree=nl(R0);Mr(null,ns,Mi,Xi),$r.placeholder=ns.el}}else Jr(ys,$r,Mi,Xi,go,ko,ss)},ei=($r,Mi,Xi)=>{const so=Mi.component=$r.component;if(aae($r,Mi,Xi))if(so.asyncDep&&!so.asyncResolved){ti(so,Mi,Xi);return}else so.next=Mi,so.update();else Mi.el=$r.el,so.vnode=Mi},Jr=($r,Mi,Xi,so,go,ko,ss)=>{const ys=()=>{if($r.isMounted){let{next:Ws,bu:ql,u:Su,parent:uc,vnode:Th}=$r;{const um=Yj($r);if(um){Ws&&(Ws.el=Th.el,ti($r,Ws,ss)),um.asyncDep.then(()=>{$r.isUnmounted||ys()});return}}let Gc=Ws,Rp;sx($r,!1),Ws?(Ws.el=Th.el,ti($r,Ws,ss)):Ws=Th,ql&&lT(ql),(Rp=Ws.props&&Ws.props.onVnodeBeforeUpdate)&&fv(Rp,uc,Ws,Th),sx($r,!0);const kp=DO($r),W0=$r.subTree;$r.subTree=kp,Dt(W0,kp,it(W0.el),On(W0),$r,go,ko),Ws.el=kp.el,Gc===null&&oae($r,kp.el),Su&&rm(Su,go),(Rp=Ws.props&&Ws.props.onVnodeUpdated)&&rm(()=>fv(Rp,uc,Ws,Th),go)}else{let Ws;const{el:ql,props:Su}=Mi,{bm:uc,m:Th,parent:Gc,root:Rp,type:kp}=$r,W0=P2(Mi);sx($r,!1),uc&&lT(uc),!W0&&(Ws=Su&&Su.onVnodeBeforeMount)&&fv(Ws,Gc,Mi),sx($r,!0);{Rp.ce&&Rp.ce._def.shadowRoot!==!1&&Rp.ce._injectChildStyle(kp);const um=$r.subTree=DO($r);Dt(null,um,Xi,so,$r,go,ko),Mi.el=um.el}if(Th&&rm(Th,go),!W0&&(Ws=Su&&Su.onVnodeMounted)){const um=Mi;rm(()=>fv(Ws,Gc,um),go)}(Mi.shapeFlag&256||Gc&&P2(Gc.vnode)&&Gc.vnode.shapeFlag&256)&&$r.a&&rm($r.a,go),$r.isMounted=!0,Mi=Xi=so=null}};$r.scope.on();const ns=$r.effect=new ej(ys);$r.scope.off();const Qo=$r.update=ns.run.bind(ns),Rl=$r.job=ns.runIfDirty.bind(ns);Rl.i=$r,Rl.id=$r.uid,ns.scheduler=()=>yE(Rl),sx($r,!0),Qo()},ti=($r,Mi,Xi)=>{Mi.component=$r;const so=$r.vnode.props;$r.vnode=Mi,$r.next=null,Hne($r,Mi.props,so,Xi),Gne($r,Mi.children,Xi),j1(),bO($r),U1()},Di=($r,Mi,Xi,so,go,ko,ss,ys,ns=!1)=>{const Qo=$r&&$r.children,Rl=$r?$r.shapeFlag:0,Ws=Mi.children,{patchFlag:ql,shapeFlag:Su}=Mi;if(ql>0){if(ql&128){Zn(Qo,Ws,Xi,so,go,ko,ss,ys,ns);return}else if(ql&256){En(Qo,Ws,Xi,so,go,ko,ss,ys,ns);return}}Su&8?(Rl&16&&nn(Qo,go,ko),Ws!==Qo&&Ne(Xi,Ws)):Rl&16?Su&16?Zn(Qo,Ws,Xi,so,go,ko,ss,ys,ns):nn(Qo,go,ko,!0):(Rl&8&&Ne(Xi,""),Su&16&&Ci(Ws,Xi,so,go,ko,ss,ys,ns))},En=($r,Mi,Xi,so,go,ko,ss,ys,ns)=>{$r=$r||M2,Mi=Mi||M2;const Qo=$r.length,Rl=Mi.length,Ws=Math.min(Qo,Rl);let ql;for(ql=0;qlRl?nn($r,go,ko,!0,!1,Ws):Ci(Mi,Xi,so,go,ko,ss,ys,ns,Ws)},Zn=($r,Mi,Xi,so,go,ko,ss,ys,ns)=>{let Qo=0;const Rl=Mi.length;let Ws=$r.length-1,ql=Rl-1;for(;Qo<=Ws&&Qo<=ql;){const Su=$r[Qo],uc=Mi[Qo]=ns?e_(Mi[Qo]):Tv(Mi[Qo]);if(wx(Su,uc))Dt(Su,uc,Xi,null,go,ko,ss,ys,ns);else break;Qo++}for(;Qo<=Ws&&Qo<=ql;){const Su=$r[Ws],uc=Mi[ql]=ns?e_(Mi[ql]):Tv(Mi[ql]);if(wx(Su,uc))Dt(Su,uc,Xi,null,go,ko,ss,ys,ns);else break;Ws--,ql--}if(Qo>Ws){if(Qo<=ql){const Su=ql+1,uc=Suql)for(;Qo<=Ws;)ya($r[Qo],go,ko,!0),Qo++;else{const Su=Qo,uc=Qo,Th=new Map;for(Qo=uc;Qo<=ql;Qo++){const Fp=Mi[Qo]=ns?e_(Mi[Qo]):Tv(Mi[Qo]);Fp.key!=null&&Th.set(Fp.key,Qo)}let Gc,Rp=0;const kp=ql-uc+1;let W0=!1,um=0;const Vg=new Array(kp);for(Qo=0;Qo=kp){ya(Fp,go,ko,!0);continue}let cm;if(Fp.key!=null)cm=Th.get(Fp.key);else for(Gc=uc;Gc<=ql;Gc++)if(Vg[Gc-uc]===0&&wx(Fp,Mi[Gc])){cm=Gc;break}cm===void 0?ya(Fp,go,ko,!0):(Vg[cm-uc]=Qo+1,cm>=um?um=cm:W0=!0,Dt(Fp,Mi[cm],Xi,null,go,ko,ss,ys,ns),Rp++)}const Z1=W0?Xne(Vg):M2;for(Gc=Z1.length-1,Qo=kp-1;Qo>=0;Qo--){const Fp=uc+Qo,cm=Mi[Fp],Wg=Mi[Fp+1],Kx=Fp+1{const{el:ko,type:ss,transition:ys,children:ns,shapeFlag:Qo}=$r;if(Qo&6){ga($r.component.subTree,Mi,Xi,so);return}if(Qo&128){$r.suspense.move(Mi,Xi,so);return}if(Qo&64){ss.move($r,Mi,Xi,zo);return}if(ss===js){c(ko,Mi,Xi);for(let Ws=0;Wsys.enter(ko),go);else{const{leave:Ws,delayLeave:ql,afterLeave:Su}=ys,uc=()=>{$r.ctx.isUnmounted?S(ko):c(ko,Mi,Xi)},Th=()=>{Ws(ko,()=>{uc(),Su&&Su()})};ql?ql(ko,uc,Th):Th()}else c(ko,Mi,Xi)},ya=($r,Mi,Xi,so=!1,go=!1)=>{const{type:ko,props:ss,ref:ys,children:ns,dynamicChildren:Qo,shapeFlag:Rl,patchFlag:Ws,dirs:ql,cacheIndex:Su}=$r;if(Ws===-2&&(go=!1),ys!=null&&(j1(),g5(ys,null,Xi,$r,!0),U1()),Su!=null&&(Mi.renderCache[Su]=void 0),Rl&256){Mi.ctx.deactivate($r);return}const uc=Rl&1&&ql,Th=!P2($r);let Gc;if(Th&&(Gc=ss&&ss.onVnodeBeforeUnmount)&&fv(Gc,Mi,$r),Rl&6)ln($r.component,Xi,so);else{if(Rl&128){$r.suspense.unmount(Xi,so);return}uc&&ox($r,null,Mi,"beforeUnmount"),Rl&64?$r.type.remove($r,Mi,Xi,zo,so):Qo&&!Qo.hasOnce&&(ko!==js||Ws>0&&Ws&64)?nn(Qo,Mi,Xi,!1,!0):(ko===js&&Ws&384||!go&&Rl&16)&&nn(ns,Mi,Xi),so&&ro($r)}(Th&&(Gc=ss&&ss.onVnodeUnmounted)||uc)&&rm(()=>{Gc&&fv(Gc,Mi,$r),uc&&ox($r,null,Mi,"unmounted")},Xi)},ro=$r=>{const{type:Mi,el:Xi,anchor:so,transition:go}=$r;if(Mi===js){qn(Xi,so);return}if(Mi===hT){or($r);return}const ko=()=>{S(Xi),go&&!go.persisted&&go.afterLeave&&go.afterLeave()};if($r.shapeFlag&1&&go&&!go.persisted){const{leave:ss,delayLeave:ys}=go,ns=()=>ss(Xi,ko);ys?ys($r.el,ko,ns):ns()}else ko()},qn=($r,Mi)=>{let Xi;for(;$r!==Mi;)Xi=pt($r),S($r),$r=Xi;S(Mi)},ln=($r,Mi,Xi)=>{const{bum:so,scope:go,job:ko,subTree:ss,um:ys,m:ns,a:Qo,parent:Rl,slots:{__:Ws}}=$r;IO(ns),IO(Qo),so&&lT(so),Rl&&du(Ws)&&Ws.forEach(ql=>{Rl.renderCache[ql]=void 0}),go.stop(),ko&&(ko.flags|=8,ya(ss,$r,Mi,Xi)),ys&&rm(ys,Mi),rm(()=>{$r.isUnmounted=!0},Mi),Mi&&Mi.pendingBranch&&!Mi.isUnmounted&&$r.asyncDep&&!$r.asyncResolved&&$r.suspenseId===Mi.pendingId&&(Mi.deps--,Mi.deps===0&&Mi.resolve())},nn=($r,Mi,Xi,so=!1,go=!1,ko=0)=>{for(let ss=ko;ss<$r.length;ss++)ya($r[ss],Mi,Xi,so,go)},On=$r=>{if($r.shapeFlag&6)return On($r.component.subTree);if($r.shapeFlag&128)return $r.suspense.next();const Mi=pt($r.anchor||$r.el),Xi=Mi&&Mi[kj];return Xi?pt(Xi):Mi};let Ra=!1;const Xa=($r,Mi,Xi)=>{$r==null?Mi._vnode&&ya(Mi._vnode,null,null,!0):Dt(Mi._vnode||null,$r,Mi,null,null,null,Xi),Mi._vnode=$r,Ra||(Ra=!0,bO(),xj(),Ra=!1)},zo={p:Dt,um:ya,m:ga,r:ro,mt:Sr,mc:Ci,pc:Di,pbc:on,n:On,o:t};return{render:Xa,hydrate:void 0,createApp:jne(Xa)}}function g7({type:t,props:e},r){return r==="svg"&&t==="foreignObject"||r==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:r}function sx({effect:t,job:e},r){r?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Yne(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function wE(t,e,r=!1){const c=t.children,S=e.children;if(du(c)&&du(S))for(let $=0;$>1,t[r[ue]]0&&(e[c]=r[$-1]),r[$]=c)}}for($=r.length,Z=r[$-1];$-- >0;)r[$]=Z,Z=e[Z];return r}function Yj(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Yj(e)}function IO(t){if(t)for(let e=0;e_g(Jne);function Af(t,e,r){return Xj(t,e,r)}function Xj(t,e,r=Cf){const{immediate:c,deep:S,flush:$,once:Z}=r,ue=Op({},r),xe=e&&c||!e&&$!=="post";let Se;if(O5){if($==="sync"){const bt=Qne();Se=bt.__watcherHandles||(bt.__watcherHandles=[])}else if(!xe){const bt=()=>{};return bt.stop=Ev,bt.resume=Ev,bt.pause=Ev,bt}}const Ne=F0;ue.call=(bt,wt,Dt)=>Ng(bt,Ne,wt,Dt);let it=!1;$==="post"?ue.scheduler=bt=>{rm(bt,Ne&&Ne.suspense)}:$!=="sync"&&(it=!0,ue.scheduler=(bt,wt)=>{wt?bt():yE(bt)}),ue.augmentJob=bt=>{e&&(bt.flags|=4),it&&(bt.flags|=2,Ne&&(bt.id=Ne.uid,bt.i=Ne))};const pt=gne(t,e,ue);return O5&&(Se?Se.push(pt):xe&&pt()),pt}function eae(t,e,r){const c=this.proxy,S=Md(t)?t.includes(".")?Jj(c,t):()=>c[t]:t.bind(c,c);let $;Xu(e)?$=e:($=e.handler,r=e);const Z=Q5(this),ue=Xj(S,$.bind(c),r);return Z(),ue}function Jj(t,e){const r=e.split(".");return()=>{let c=t;for(let S=0;Se==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${wg(e)}Modifiers`]||t[`${x_(e)}Modifiers`];function rae(t,e,...r){if(t.isUnmounted)return;const c=t.vnode.props||Cf;let S=r;const $=e.startsWith("update:"),Z=$&&tae(c,e.slice(7));Z&&(Z.trim&&(S=r.map(Ne=>Md(Ne)?Ne.trim():Ne)),Z.number&&(S=r.map(IT)));let ue,xe=c[ue=u7(e)]||c[ue=u7(wg(e))];!xe&&$&&(xe=c[ue=u7(x_(e))]),xe&&Ng(xe,t,6,S);const Se=c[ue+"Once"];if(Se){if(!t.emitted)t.emitted={};else if(t.emitted[ue])return;t.emitted[ue]=!0,Ng(Se,t,6,S)}}function Qj(t,e,r=!1){const c=e.emitsCache,S=c.get(t);if(S!==void 0)return S;const $=t.emits;let Z={},ue=!1;if(!Xu(t)){const xe=Se=>{const Ne=Qj(Se,e,!0);Ne&&(ue=!0,Op(Z,Ne))};!r&&e.mixins.length&&e.mixins.forEach(xe),t.extends&&xe(t.extends),t.mixins&&t.mixins.forEach(xe)}return!$&&!ue?(Mf(t)&&c.set(t,null),null):(du($)?$.forEach(xe=>Z[xe]=null):Op(Z,$),Mf(t)&&c.set(t,Z),Z)}function w8(t,e){return!t||!h8(e)?!1:(e=e.slice(2).replace(/Once$/,""),Zh(t,e[0].toLowerCase()+e.slice(1))||Zh(t,x_(e))||Zh(t,e))}function DO(t){const{type:e,vnode:r,proxy:c,withProxy:S,propsOptions:[$],slots:Z,attrs:ue,emit:xe,render:Se,renderCache:Ne,props:it,data:pt,setupState:bt,ctx:wt,inheritAttrs:Dt}=t,Zt=RT(t);let Mr,ze;try{if(r.shapeFlag&4){const or=S||c,Cr=or;Mr=Tv(Se.call(Cr,or,Ne,it,bt,pt,wt)),ze=ue}else{const or=e;Mr=Tv(or.length>1?or(it,{attrs:ue,slots:Z,emit:xe}):or(it,null)),ze=e.props?ue:iae(ue)}}catch(or){y5.length=0,v8(or,t,1),Mr=nl(R0)}let ni=Mr;if(ze&&Dt!==!1){const or=Object.keys(ze),{shapeFlag:Cr}=ni;or.length&&Cr&7&&($&&or.some(sE)&&(ze=nae(ze,$)),ni=v_(ni,ze,!1,!0))}return r.dirs&&(ni=v_(ni,null,!1,!0),ni.dirs=ni.dirs?ni.dirs.concat(r.dirs):r.dirs),r.transition&&Fx(ni,r.transition),Mr=ni,RT(Zt),Mr}const iae=t=>{let e;for(const r in t)(r==="class"||r==="style"||h8(r))&&((e||(e={}))[r]=t[r]);return e},nae=(t,e)=>{const r={};for(const c in t)(!sE(c)||!(c.slice(9)in e))&&(r[c]=t[c]);return r};function aae(t,e,r){const{props:c,children:S,component:$}=t,{props:Z,children:ue,patchFlag:xe}=e,Se=$.emitsOptions;if(e.dirs||e.transition)return!0;if(r&&xe>=0){if(xe&1024)return!0;if(xe&16)return c?zO(c,Z,Se):!!Z;if(xe&8){const Ne=e.dynamicProps;for(let it=0;itt.__isSuspense;function sae(t,e){e&&e.pendingBranch?du(t)?e.effects.push(...t):e.effects.push(t):_ne(t)}const js=Symbol.for("v-fgt"),k8=Symbol.for("v-txt"),R0=Symbol.for("v-cmt"),hT=Symbol.for("v-stc"),y5=[];let Km=null;function jr(t=!1){y5.push(Km=t?null:[])}function lae(){y5.pop(),Km=y5[y5.length-1]||null}let D5=1;function OO(t,e=!1){D5+=t,t<0&&Km&&e&&(Km.hasOnce=!0)}function tU(t){return t.dynamicChildren=D5>0?Km||M2:null,lae(),D5>0&&Km&&Km.push(t),t}function Kr(t,e,r,c,S,$){return tU(Ee(t,e,r,c,S,$,!0))}function Cd(t,e,r,c,S){return tU(nl(t,e,r,c,S,!0))}function z5(t){return t?t.__v_isVNode===!0:!1}function wx(t,e){return t.type===e.type&&t.key===e.key}const rU=({key:t})=>t??null,fT=({ref:t,ref_key:e,ref_for:r})=>(typeof t=="number"&&(t=""+t),t!=null?Md(t)||cp(t)||Xu(t)?{i:w0,r:t,k:e,f:!!r}:t:null);function Ee(t,e=null,r=null,c=0,S=null,$=t===js?0:1,Z=!1,ue=!1){const xe={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&rU(e),ref:e&&fT(e),scopeId:wj,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:$,patchFlag:c,dynamicProps:S,dynamicChildren:null,appContext:null,ctx:w0};return ue?(kE(xe,r),$&128&&t.normalize(xe)):r&&(xe.shapeFlag|=Md(r)?8:16),D5>0&&!Z&&Km&&(xe.patchFlag>0||$&6)&&xe.patchFlag!==32&&Km.push(xe),xe}const nl=uae;function uae(t,e=null,r=null,c=0,S=null,$=!1){if((!t||t===Bj)&&(t=R0),z5(t)){const ue=v_(t,e,!0);return r&&kE(ue,r),D5>0&&!$&&Km&&(ue.shapeFlag&6?Km[Km.indexOf(t)]=ue:Km.push(ue)),ue.patchFlag=-2,ue}if(xae(t)&&(t=t.__vccOpts),e){e=cae(e);let{class:ue,style:xe}=e;ue&&!Md(ue)&&(e.class=Ga(ue)),Mf(xe)&&(gE(xe)&&!du(xe)&&(xe=Op({},xe)),e.style=om(xe))}const Z=Md(t)?1:eU(t)?128:Tj(t)?64:Mf(t)?4:Xu(t)?2:0;return Ee(t,e,r,c,S,Z,$,!0)}function cae(t){return t?gE(t)||Vj(t)?Op({},t):t:null}function v_(t,e,r=!1,c=!1){const{props:S,ref:$,patchFlag:Z,children:ue,transition:xe}=t,Se=e?hae(S||{},e):S,Ne={__v_isVNode:!0,__v_skip:!0,type:t.type,props:Se,key:Se&&rU(Se),ref:e&&e.ref?r&&$?du($)?$.concat(fT(e)):[$,fT(e)]:fT(e):$,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:ue,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==js?Z===-1?16:Z|16:Z,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:xe,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&v_(t.ssContent),ssFallback:t.ssFallback&&v_(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return xe&&c&&Fx(Ne,xe.clone(Ne)),Ne}function il(t=" ",e=0){return nl(k8,null,t,e)}function Dc(t,e){const r=nl(hT,null,t);return r.staticCount=e,r}function Sa(t="",e=!1){return e?(jr(),Cd(R0,null,t)):nl(R0,null,t)}function Tv(t){return t==null||typeof t=="boolean"?nl(R0):du(t)?nl(js,null,t.slice()):z5(t)?e_(t):nl(k8,null,String(t))}function e_(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:v_(t)}function kE(t,e){let r=0;const{shapeFlag:c}=t;if(e==null)e=null;else if(du(e))r=16;else if(typeof e=="object")if(c&65){const S=e.default;S&&(S._c&&(S._d=!1),kE(t,S()),S._c&&(S._d=!0));return}else{r=32;const S=e._;!S&&!Vj(e)?e._ctx=w0:S===3&&w0&&(w0.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Xu(e)?(e={default:e,_ctx:w0},r=32):(e=String(e),c&64?(r=16,e=[il(e)]):r=8);t.children=e,t.shapeFlag|=r}function hae(...t){const e={};for(let r=0;rF0||w0;let NT,RM;{const t=m8(),e=(r,c)=>{let S;return(S=t[r])||(S=t[r]=[]),S.push(c),$=>{S.length>1?S.forEach(Z=>Z($)):S[0]($)}};NT=e("__VUE_INSTANCE_SETTERS__",r=>F0=r),RM=e("__VUE_SSR_SETTERS__",r=>O5=r)}const Q5=t=>{const e=F0;return NT(t),t.scope.on(),()=>{t.scope.off(),NT(e)}},BO=()=>{F0&&F0.scope.off(),NT(null)};function iU(t){return t.vnode.shapeFlag&4}let O5=!1;function mae(t,e=!1,r=!1){e&&RM(e);const{props:c,children:S}=t.vnode,$=iU(t);$ne(t,c,$,e),qne(t,S,r||e);const Z=$?gae(t,e):void 0;return e&&RM(!1),Z}function gae(t,e){const r=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Dne);const{setup:c}=r;if(c){j1();const S=t.setupContext=c.length>1?yae(t):null,$=Q5(t),Z=J5(c,t,0,[t.props,S]),ue=WN(Z);if(U1(),$(),(ue||t.sp)&&!P2(t)&&Ij(t),ue){if(Z.then(BO,BO),e)return Z.then(xe=>{RO(t,xe)}).catch(xe=>{v8(xe,t,0)});t.asyncDep=Z}else RO(t,Z)}else nU(t)}function RO(t,e,r){Xu(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Mf(e)&&(t.setupState=vj(e)),nU(t)}function nU(t,e,r){const c=t.type;t.render||(t.render=c.render||Ev);{const S=Q5(t);j1();try{zne(t)}finally{U1(),S()}}}const vae={get(t,e){return B0(t,"get",""),t[e]}};function yae(t){const e=r=>{t.exposed=r||{}};return{attrs:new Proxy(t.attrs,vae),slots:t.slots,emit:t.emit,expose:e}}function S8(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(vj(vE(t.exposed)),{get(e,r){if(r in e)return e[r];if(r in v5)return v5[r](t)},has(e,r){return r in e||r in v5}})):t.proxy}function _ae(t,e=!0){return Xu(t)?t.displayName||t.name:t.name||e&&t.__name}function xae(t){return Xu(t)&&"__vccOpts"in t}const Io=(t,e)=>pne(t,e,O5);function TE(t,e,r){const c=arguments.length;return c===2?Mf(e)&&!du(e)?z5(e)?nl(t,null,[e]):nl(t,e):nl(t,null,e):(c>3?r=Array.prototype.slice.call(arguments,2):c===3&&z5(r)&&(r=[r]),nl(t,e,r))}const bae="3.5.18";/** * @vue/runtime-dom v3.5.18 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let BM;const BO=typeof window<"u"&&window.trustedTypes;if(BO)try{BM=BO.createPolicy("vue",{createHTML:t=>t})}catch{}const iU=BM?t=>BM.createHTML(t):t=>t,_ae="http://www.w3.org/2000/svg",xae="http://www.w3.org/1998/Math/MathML",M1=typeof document<"u"?document:null,RO=M1&&M1.createElement("template"),bae={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,c)=>{const S=e==="svg"?M1.createElementNS(_ae,t):e==="mathml"?M1.createElementNS(xae,t):r?M1.createElement(t,{is:r}):M1.createElement(t);return t==="select"&&c&&c.multiple!=null&&S.setAttribute("multiple",c.multiple),S},createText:t=>M1.createTextNode(t),createComment:t=>M1.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>M1.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,c,S,H){const Z=r?r.previousSibling:e.lastChild;if(S&&(S===H||S.nextSibling))for(;e.insertBefore(S.cloneNode(!0),r),!(S===H||!(S=S.nextSibling)););else{RO.innerHTML=iU(c==="svg"?`${t}`:c==="mathml"?`${t}`:t);const ue=RO.content;if(c==="svg"||c==="mathml"){const be=ue.firstChild;for(;be.firstChild;)ue.appendChild(be.firstChild);ue.removeChild(be)}e.insertBefore(ue,r)}return[Z?Z.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},Oy="transition",A3="animation",O2=Symbol("_vtc"),nU={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},aU=zp({},Cj,nU),wae=t=>(t.displayName="Transition",t.props=aU,t),Rx=wae((t,{slots:e})=>wE(_ne,oU(t),e)),nx=(t,e=[])=>{du(t)?t.forEach(r=>r(...e)):t&&t(...e)},FO=t=>t?du(t)?t.some(e=>e.length>1):t.length>1:!1;function oU(t){const e={};for(const vr in t)vr in nU||(e[vr]=t[vr]);if(t.css===!1)return e;const{name:r="v",type:c,duration:S,enterFromClass:H=`${r}-enter-from`,enterActiveClass:Z=`${r}-enter-active`,enterToClass:ue=`${r}-enter-to`,appearFromClass:be=H,appearActiveClass:Se=Z,appearToClass:Re=ue,leaveFromClass:Xe=`${r}-leave-from`,leaveActiveClass:vt=`${r}-leave-active`,leaveToClass:bt=`${r}-leave-to`}=t,kt=kae(S),Dt=kt&&kt[0],rr=kt&&kt[1],{onBeforeEnter:Er,onEnter:Fe,onEnterCancelled:wi,onLeave:ur,onLeaveCancelled:Ir,onBeforeAppear:Ti=Er,onAppear:_i=Fe,onAppearCancelled:Ci=wi}=e,ii=(vr,dr,Ar,ti)=>{vr._enterCancelled=ti,Hy(vr,dr?Re:ue),Hy(vr,dr?Se:Z),Ar&&Ar()},Ji=(vr,dr)=>{vr._isLeaving=!1,Hy(vr,Xe),Hy(vr,bt),Hy(vr,vt),dr&&dr()},vi=vr=>(dr,Ar)=>{const ti=vr?_i:Fe,Xr=()=>ii(dr,vr,Ar);nx(ti,[dr,Xr]),NO(()=>{Hy(dr,vr?be:H),yv(dr,vr?Re:ue),FO(ti)||jO(dr,c,Dt,Xr)})};return zp(e,{onBeforeEnter(vr){nx(Er,[vr]),yv(vr,H),yv(vr,Z)},onBeforeAppear(vr){nx(Ti,[vr]),yv(vr,be),yv(vr,Se)},onEnter:vi(!1),onAppear:vi(!0),onLeave(vr,dr){vr._isLeaving=!0;const Ar=()=>Ji(vr,dr);yv(vr,Xe),vr._enterCancelled?(yv(vr,vt),RM()):(RM(),yv(vr,vt)),NO(()=>{vr._isLeaving&&(Hy(vr,Xe),yv(vr,bt),FO(ur)||jO(vr,c,rr,Ar))}),nx(ur,[vr,Ar])},onEnterCancelled(vr){ii(vr,!1,void 0,!0),nx(wi,[vr])},onAppearCancelled(vr){ii(vr,!0,void 0,!0),nx(Ci,[vr])},onLeaveCancelled(vr){Ji(vr),nx(Ir,[vr])}})}function kae(t){if(t==null)return null;if(Af(t))return[m7(t.enter),m7(t.leave)];{const e=m7(t);return[e,e]}}function m7(t){return Eie(t)}function yv(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.add(r)),(t[O2]||(t[O2]=new Set)).add(e)}function Hy(t,e){e.split(/\s+/).forEach(c=>c&&t.classList.remove(c));const r=t[O2];r&&(r.delete(e),r.size||(t[O2]=void 0))}function NO(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Tae=0;function jO(t,e,r,c){const S=t._endId=++Tae,H=()=>{S===t._endId&&c()};if(r!=null)return setTimeout(H,r);const{type:Z,timeout:ue,propCount:be}=sU(t,e);if(!Z)return c();const Se=Z+"end";let Re=0;const Xe=()=>{t.removeEventListener(Se,vt),H()},vt=bt=>{bt.target===t&&++Re>=be&&Xe()};setTimeout(()=>{Re(r[kt]||"").split(", "),S=c(`${Oy}Delay`),H=c(`${Oy}Duration`),Z=UO(S,H),ue=c(`${A3}Delay`),be=c(`${A3}Duration`),Se=UO(ue,be);let Re=null,Xe=0,vt=0;e===Oy?Z>0&&(Re=Oy,Xe=Z,vt=H.length):e===A3?Se>0&&(Re=A3,Xe=Se,vt=be.length):(Xe=Math.max(Z,Se),Re=Xe>0?Z>Se?Oy:A3:null,vt=Re?Re===Oy?H.length:be.length:0);const bt=Re===Oy&&/\b(transform|all)(,|$)/.test(c(`${Oy}Property`).toString());return{type:Re,timeout:Xe,propCount:vt,hasTransform:bt}}function UO(t,e){for(;t.length$O(r)+$O(t[c])))}function $O(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function RM(){return document.body.offsetHeight}function Sae(t,e,r){const c=t[O2];c&&(e=(e?[e,...c]:[...c]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const FT=Symbol("_vod"),lU=Symbol("_vsh"),dx={beforeMount(t,{value:e},{transition:r}){t[FT]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):M3(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:c}){!e!=!r&&(c?e?(c.beforeEnter(t),M3(t,!0),c.enter(t)):c.leave(t,()=>{M3(t,!1)}):M3(t,e))},beforeUnmount(t,{value:e}){M3(t,e)}};function M3(t,e){t.style.display=e?t[FT]:"none",t[lU]=!e}const Cae=Symbol(""),Aae=/(^|;)\s*display\s*:/;function Mae(t,e,r){const c=t.style,S=Ad(r);let H=!1;if(r&&!S){if(e)if(Ad(e))for(const Z of e.split(";")){const ue=Z.slice(0,Z.indexOf(":")).trim();r[ue]==null&&hT(c,ue,"")}else for(const Z in e)r[Z]==null&&hT(c,Z,"");for(const Z in r)Z==="display"&&(H=!0),hT(c,Z,r[Z])}else if(S){if(e!==r){const Z=c[Cae];Z&&(r+=";"+Z),c.cssText=r,H=Aae.test(r)}}else e&&t.removeAttribute("style");FT in t&&(t[FT]=H?c.display:"",t[lU]&&(c.display="none"))}const HO=/\s*!important$/;function hT(t,e,r){if(du(r))r.forEach(c=>hT(t,e,c));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const c=Eae(t,e);HO.test(r)?t.setProperty(g_(c),r.replace(HO,""),"important"):t[c]=r}}const VO=["Webkit","Moz","ms"],g7={};function Eae(t,e){const r=g7[e];if(r)return r;let c=bg(e);if(c!=="filter"&&c in t)return g7[e]=c;c=fS(c);for(let S=0;Sv7||(Dae.then(()=>v7=0),v7=Date.now());function Oae(t,e){const r=c=>{if(!c._vts)c._vts=Date.now();else if(c._vts<=r.attached)return;Ng(Bae(c,r.value),e,5,[c])};return r.value=t,r.attached=zae(),r}function Bae(t,e){if(du(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(c=>S=>!S._stopped&&c&&c(S))}else return e}const YO=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Rae=(t,e,r,c,S,H)=>{const Z=S==="svg";e==="class"?Sae(t,c,Z):e==="style"?Mae(t,r,c):uS(e)?aE(e)||Pae(t,e,r,c,H):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Fae(t,e,c,Z))?(GO(t,e,c),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&qO(t,e,c,Z,H,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Ad(c))?GO(t,bg(e),c,H,e):(e==="true-value"?t._trueValue=c:e==="false-value"&&(t._falseValue=c),qO(t,e,c,Z))};function Fae(t,e,r,c){if(c)return!!(e==="innerHTML"||e==="textContent"||e in t&&YO(e)&&Xu(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const S=t.tagName;if(S==="IMG"||S==="VIDEO"||S==="CANVAS"||S==="SOURCE")return!1}return YO(e)&&Ad(r)?!1:e in t}const uU=new WeakMap,cU=new WeakMap,NT=Symbol("_moveCb"),XO=Symbol("_enterCb"),Nae=t=>(delete t.props.mode,t),jae=Nae({name:"TransitionGroup",props:zp({},aU,{tag:String,moveClass:String}),setup(t,{slots:e}){const r=wS(),c=Sj();let S,H;return Ij(()=>{if(!S.length)return;const Z=t.moveClass||`${t.name||"v"}-move`;if(!Wae(S[0].el,r.vnode.el,Z)){S=[];return}S.forEach($ae),S.forEach(Hae);const ue=S.filter(Vae);RM(),ue.forEach(be=>{const Se=be.el,Re=Se.style;yv(Se,Z),Re.transform=Re.webkitTransform=Re.transitionDuration="";const Xe=Se[NT]=vt=>{vt&&vt.target!==Se||(!vt||/transform$/.test(vt.propertyName))&&(Se.removeEventListener("transitionend",Xe),Se[NT]=null,Hy(Se,Z))};Se.addEventListener("transitionend",Xe)}),S=[]}),()=>{const Z=Ou(t),ue=oU(Z);let be=Z.tag||js;if(S=[],H)for(let Se=0;Se{ue.split(/\s+/).forEach(be=>be&&c.classList.remove(be))}),r.split(/\s+/).forEach(ue=>ue&&c.classList.add(ue)),c.style.display="none";const H=e.nodeType===1?e:e.parentNode;H.appendChild(c);const{hasTransform:Z}=sU(c);return H.removeChild(c),Z}const B2=t=>{const e=t.props["onUpdate:modelValue"]||!1;return du(e)?r=>oT(e,r):e};function qae(t){t.target.composing=!0}function JO(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const F1=Symbol("_assign"),sc={created(t,{modifiers:{lazy:e,trim:r,number:c}},S){t[F1]=B2(S);const H=c||S.props&&S.props.type==="number";t_(t,e?"change":"input",Z=>{if(Z.target.composing)return;let ue=t.value;r&&(ue=ue.trim()),H&&(ue=LT(ue)),t[F1](ue)}),r&&t_(t,"change",()=>{t.value=t.value.trim()}),e||(t_(t,"compositionstart",qae),t_(t,"compositionend",JO),t_(t,"change",JO))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:r,modifiers:{lazy:c,trim:S,number:H}},Z){if(t[F1]=B2(Z),t.composing)return;const ue=(H||t.type==="number")&&!/^0\d/.test(t.value)?LT(t.value):t.value,be=e??"";ue!==be&&(document.activeElement===t&&t.type!=="range"&&(c&&e===r||S&&t.value.trim()===be)||(t.value=be))}},z5={created(t,{value:e},r){t.checked=z2(e,r.props.value),t[F1]=B2(r),t_(t,"change",()=>{t[F1](O5(t))})},beforeUpdate(t,{value:e,oldValue:r},c){t[F1]=B2(c),e!==r&&(t.checked=z2(e,c.props.value))}},_g={deep:!0,created(t,{value:e,modifiers:{number:r}},c){const S=cS(e);t_(t,"change",()=>{const H=Array.prototype.filter.call(t.options,Z=>Z.selected).map(Z=>r?LT(O5(Z)):O5(Z));t[F1](t.multiple?S?new Set(H):H:H[0]),t._assigning=!0,x0(()=>{t._assigning=!1})}),t[F1]=B2(c)},mounted(t,{value:e}){QO(t,e)},beforeUpdate(t,e,r){t[F1]=B2(r)},updated(t,{value:e}){t._assigning||QO(t,e)}};function QO(t,e){const r=t.multiple,c=du(e);if(!(r&&!c&&!cS(e))){for(let S=0,H=t.options.length;SString(Se)===String(ue)):Z.selected=Rie(e,ue)>-1}else Z.selected=e.has(ue);else if(z2(O5(Z),e)){t.selectedIndex!==S&&(t.selectedIndex=S);return}}!r&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function O5(t){return"_value"in t?t._value:t.value}const Gae=["ctrl","shift","alt","meta"],Zae={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Gae.some(r=>t[`${r}Key`]&&!e.includes(r))},Yf=(t,e)=>{const r=t._withMods||(t._withMods={}),c=e.join(".");return r[c]||(r[c]=(S,...H)=>{for(let Z=0;Z{const r=t._withKeys||(t._withKeys={}),c=e.join(".");return r[c]||(r[c]=S=>{if(!("key"in S))return;const H=g_(S.key);if(e.some(Z=>Z===H||Kae[Z]===H))return t(S)})},Yae=zp({patchProp:Rae},bae);let eB;function Xae(){return eB||(eB=Wne(Yae))}const Jae=(...t)=>{const e=Xae().createApp(...t),{mount:r}=e;return e.mount=c=>{const S=eoe(c);if(!S)return;const H=e._component;!Xu(H)&&!H.render&&!H.template&&(H.template=S.innerHTML),S.nodeType===1&&(S.textContent="");const Z=r(S,!1,Qae(S));return S instanceof Element&&(S.removeAttribute("v-cloak"),S.setAttribute("data-v-app","")),Z},e};function Qae(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function eoe(t){return Ad(t)?document.querySelector(t):t}/*! +**/let FM;const FO=typeof window<"u"&&window.trustedTypes;if(FO)try{FM=FO.createPolicy("vue",{createHTML:t=>t})}catch{}const aU=FM?t=>FM.createHTML(t):t=>t,wae="http://www.w3.org/2000/svg",kae="http://www.w3.org/1998/Math/MathML",A1=typeof document<"u"?document:null,NO=A1&&A1.createElement("template"),Tae={insert:(t,e,r)=>{e.insertBefore(t,r||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,r,c)=>{const S=e==="svg"?A1.createElementNS(wae,t):e==="mathml"?A1.createElementNS(kae,t):r?A1.createElement(t,{is:r}):A1.createElement(t);return t==="select"&&c&&c.multiple!=null&&S.setAttribute("multiple",c.multiple),S},createText:t=>A1.createTextNode(t),createComment:t=>A1.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>A1.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,r,c,S,$){const Z=r?r.previousSibling:e.lastChild;if(S&&(S===$||S.nextSibling))for(;e.insertBefore(S.cloneNode(!0),r),!(S===$||!(S=S.nextSibling)););else{NO.innerHTML=aU(c==="svg"?`${t}`:c==="mathml"?`${t}`:t);const ue=NO.content;if(c==="svg"||c==="mathml"){const xe=ue.firstChild;for(;xe.firstChild;)ue.appendChild(xe.firstChild);ue.removeChild(xe)}e.insertBefore(ue,r)}return[Z?Z.nextSibling:e.firstChild,r?r.previousSibling:e.lastChild]}},Ry="transition",E3="animation",B2=Symbol("_vtc"),oU={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},sU=Op({},Mj,oU),Sae=t=>(t.displayName="Transition",t.props=sU,t),R2=Sae((t,{slots:e})=>TE(wne,lU(t),e)),lx=(t,e=[])=>{du(t)?t.forEach(r=>r(...e)):t&&t(...e)},jO=t=>t?du(t)?t.some(e=>e.length>1):t.length>1:!1;function lU(t){const e={};for(const gr in t)gr in oU||(e[gr]=t[gr]);if(t.css===!1)return e;const{name:r="v",type:c,duration:S,enterFromClass:$=`${r}-enter-from`,enterActiveClass:Z=`${r}-enter-active`,enterToClass:ue=`${r}-enter-to`,appearFromClass:xe=$,appearActiveClass:Se=Z,appearToClass:Ne=ue,leaveFromClass:it=`${r}-leave-from`,leaveActiveClass:pt=`${r}-leave-active`,leaveToClass:bt=`${r}-leave-to`}=t,wt=Cae(S),Dt=wt&&wt[0],Zt=wt&&wt[1],{onBeforeEnter:Mr,onEnter:ze,onEnterCancelled:ni,onLeave:or,onLeaveCancelled:Cr,onBeforeAppear:gi=Mr,onAppear:Si=ze,onAppearCancelled:Ci=ni}=e,ri=(gr,fr,Sr,ei)=>{gr._enterCancelled=ei,Wy(gr,fr?Ne:ue),Wy(gr,fr?Se:Z),Sr&&Sr()},on=(gr,fr)=>{gr._isLeaving=!1,Wy(gr,it),Wy(gr,bt),Wy(gr,pt),fr&&fr()},yi=gr=>(fr,Sr)=>{const ei=gr?Si:ze,Jr=()=>ri(fr,gr,Sr);lx(ei,[fr,Jr]),UO(()=>{Wy(fr,gr?xe:$),yv(fr,gr?Ne:ue),jO(ei)||$O(fr,c,Dt,Jr)})};return Op(e,{onBeforeEnter(gr){lx(Mr,[gr]),yv(gr,$),yv(gr,Z)},onBeforeAppear(gr){lx(gi,[gr]),yv(gr,xe),yv(gr,Se)},onEnter:yi(!1),onAppear:yi(!0),onLeave(gr,fr){gr._isLeaving=!0;const Sr=()=>on(gr,fr);yv(gr,it),gr._enterCancelled?(yv(gr,pt),NM()):(NM(),yv(gr,pt)),UO(()=>{gr._isLeaving&&(Wy(gr,it),yv(gr,bt),jO(or)||$O(gr,c,Zt,Sr))}),lx(or,[gr,Sr])},onEnterCancelled(gr){ri(gr,!1,void 0,!0),lx(ni,[gr])},onAppearCancelled(gr){ri(gr,!0,void 0,!0),lx(Ci,[gr])},onLeaveCancelled(gr){on(gr),lx(Cr,[gr])}})}function Cae(t){if(t==null)return null;if(Mf(t))return[v7(t.enter),v7(t.leave)];{const e=v7(t);return[e,e]}}function v7(t){return Iie(t)}function yv(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.add(r)),(t[B2]||(t[B2]=new Set)).add(e)}function Wy(t,e){e.split(/\s+/).forEach(c=>c&&t.classList.remove(c));const r=t[B2];r&&(r.delete(e),r.size||(t[B2]=void 0))}function UO(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Aae=0;function $O(t,e,r,c){const S=t._endId=++Aae,$=()=>{S===t._endId&&c()};if(r!=null)return setTimeout($,r);const{type:Z,timeout:ue,propCount:xe}=uU(t,e);if(!Z)return c();const Se=Z+"end";let Ne=0;const it=()=>{t.removeEventListener(Se,pt),$()},pt=bt=>{bt.target===t&&++Ne>=xe&&it()};setTimeout(()=>{Ne(r[wt]||"").split(", "),S=c(`${Ry}Delay`),$=c(`${Ry}Duration`),Z=HO(S,$),ue=c(`${E3}Delay`),xe=c(`${E3}Duration`),Se=HO(ue,xe);let Ne=null,it=0,pt=0;e===Ry?Z>0&&(Ne=Ry,it=Z,pt=$.length):e===E3?Se>0&&(Ne=E3,it=Se,pt=xe.length):(it=Math.max(Z,Se),Ne=it>0?Z>Se?Ry:E3:null,pt=Ne?Ne===Ry?$.length:xe.length:0);const bt=Ne===Ry&&/\b(transform|all)(,|$)/.test(c(`${Ry}Property`).toString());return{type:Ne,timeout:it,propCount:pt,hasTransform:bt}}function HO(t,e){for(;t.lengthVO(r)+VO(t[c])))}function VO(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function NM(){return document.body.offsetHeight}function Mae(t,e,r){const c=t[B2];c&&(e=(e?[e,...c]:[...c]).join(" ")),e==null?t.removeAttribute("class"):r?t.setAttribute("class",e):t.className=e}const jT=Symbol("_vod"),cU=Symbol("_vsh"),qy={beforeMount(t,{value:e},{transition:r}){t[jT]=t.style.display==="none"?"":t.style.display,r&&e?r.beforeEnter(t):L3(t,e)},mounted(t,{value:e},{transition:r}){r&&e&&r.enter(t)},updated(t,{value:e,oldValue:r},{transition:c}){!e!=!r&&(c?e?(c.beforeEnter(t),L3(t,!0),c.enter(t)):c.leave(t,()=>{L3(t,!1)}):L3(t,e))},beforeUnmount(t,{value:e}){L3(t,e)}};function L3(t,e){t.style.display=e?t[jT]:"none",t[cU]=!e}const Eae=Symbol(""),Lae=/(^|;)\s*display\s*:/;function Pae(t,e,r){const c=t.style,S=Md(r);let $=!1;if(r&&!S){if(e)if(Md(e))for(const Z of e.split(";")){const ue=Z.slice(0,Z.indexOf(":")).trim();r[ue]==null&&dT(c,ue,"")}else for(const Z in e)r[Z]==null&&dT(c,Z,"");for(const Z in r)Z==="display"&&($=!0),dT(c,Z,r[Z])}else if(S){if(e!==r){const Z=c[Eae];Z&&(r+=";"+Z),c.cssText=r,$=Lae.test(r)}}else e&&t.removeAttribute("style");jT in t&&(t[jT]=$?c.display:"",t[cU]&&(c.display="none"))}const WO=/\s*!important$/;function dT(t,e,r){if(du(r))r.forEach(c=>dT(t,e,c));else if(r==null&&(r=""),e.startsWith("--"))t.setProperty(e,r);else{const c=Iae(t,e);WO.test(r)?t.setProperty(x_(c),r.replace(WO,""),"important"):t[c]=r}}const qO=["Webkit","Moz","ms"],y7={};function Iae(t,e){const r=y7[e];if(r)return r;let c=wg(e);if(c!=="filter"&&c in t)return y7[e]=c;c=p8(c);for(let S=0;S_7||(Bae.then(()=>_7=0),_7=Date.now());function Fae(t,e){const r=c=>{if(!c._vts)c._vts=Date.now();else if(c._vts<=r.attached)return;Ng(Nae(c,r.value),e,5,[c])};return r.value=t,r.attached=Rae(),r}function Nae(t,e){if(du(e)){const r=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{r.call(t),t._stopped=!0},e.map(c=>S=>!S._stopped&&c&&c(S))}else return e}const JO=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,jae=(t,e,r,c,S,$)=>{const Z=S==="svg";e==="class"?Mae(t,c,Z):e==="style"?Pae(t,r,c):h8(e)?sE(e)||zae(t,e,r,c,$):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Uae(t,e,c,Z))?(KO(t,e,c),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&ZO(t,e,c,Z,$,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Md(c))?KO(t,wg(e),c,$,e):(e==="true-value"?t._trueValue=c:e==="false-value"&&(t._falseValue=c),ZO(t,e,c,Z))};function Uae(t,e,r,c){if(c)return!!(e==="innerHTML"||e==="textContent"||e in t&&JO(e)&&Xu(r));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const S=t.tagName;if(S==="IMG"||S==="VIDEO"||S==="CANVAS"||S==="SOURCE")return!1}return JO(e)&&Md(r)?!1:e in t}const hU=new WeakMap,fU=new WeakMap,UT=Symbol("_moveCb"),QO=Symbol("_enterCb"),$ae=t=>(delete t.props.mode,t),Hae=$ae({name:"TransitionGroup",props:Op({},sU,{tag:String,moveClass:String}),setup(t,{slots:e}){const r=T8(),c=Aj();let S,$;return zj(()=>{if(!S.length)return;const Z=t.moveClass||`${t.name||"v"}-move`;if(!Zae(S[0].el,r.vnode.el,Z)){S=[];return}S.forEach(Wae),S.forEach(qae);const ue=S.filter(Gae);NM(),ue.forEach(xe=>{const Se=xe.el,Ne=Se.style;yv(Se,Z),Ne.transform=Ne.webkitTransform=Ne.transitionDuration="";const it=Se[UT]=pt=>{pt&&pt.target!==Se||(!pt||/transform$/.test(pt.propertyName))&&(Se.removeEventListener("transitionend",it),Se[UT]=null,Wy(Se,Z))};Se.addEventListener("transitionend",it)}),S=[]}),()=>{const Z=Ou(t),ue=lU(Z);let xe=Z.tag||js;if(S=[],$)for(let Se=0;Se<$.length;Se++){const Ne=$[Se];Ne.el&&Ne.el instanceof Element&&(S.push(Ne),Fx(Ne,I5(Ne,ue,c,r)),hU.set(Ne,Ne.el.getBoundingClientRect()))}$=e.default?_E(e.default()):[];for(let Se=0;Se<$.length;Se++){const Ne=$[Se];Ne.key!=null&&Fx(Ne,I5(Ne,ue,c,r))}return nl(xe,null,$)}}}),Vae=Hae;function Wae(t){const e=t.el;e[UT]&&e[UT](),e[QO]&&e[QO]()}function qae(t){fU.set(t,t.el.getBoundingClientRect())}function Gae(t){const e=hU.get(t),r=fU.get(t),c=e.left-r.left,S=e.top-r.top;if(c||S){const $=t.el.style;return $.transform=$.webkitTransform=`translate(${c}px,${S}px)`,$.transitionDuration="0s",t}}function Zae(t,e,r){const c=t.cloneNode(),S=t[B2];S&&S.forEach(ue=>{ue.split(/\s+/).forEach(xe=>xe&&c.classList.remove(xe))}),r.split(/\s+/).forEach(ue=>ue&&c.classList.add(ue)),c.style.display="none";const $=e.nodeType===1?e:e.parentNode;$.appendChild(c);const{hasTransform:Z}=uU(c);return $.removeChild(c),Z}const F2=t=>{const e=t.props["onUpdate:modelValue"]||!1;return du(e)?r=>lT(e,r):e};function Kae(t){t.target.composing=!0}function eB(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const N1=Symbol("_assign"),sc={created(t,{modifiers:{lazy:e,trim:r,number:c}},S){t[N1]=F2(S);const $=c||S.props&&S.props.type==="number";n_(t,e?"change":"input",Z=>{if(Z.target.composing)return;let ue=t.value;r&&(ue=ue.trim()),$&&(ue=IT(ue)),t[N1](ue)}),r&&n_(t,"change",()=>{t.value=t.value.trim()}),e||(n_(t,"compositionstart",Kae),n_(t,"compositionend",eB),n_(t,"change",eB))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:r,modifiers:{lazy:c,trim:S,number:$}},Z){if(t[N1]=F2(Z),t.composing)return;const ue=($||t.type==="number")&&!/^0\d/.test(t.value)?IT(t.value):t.value,xe=e??"";ue!==xe&&(document.activeElement===t&&t.type!=="range"&&(c&&e===r||S&&t.value.trim()===xe)||(t.value=xe))}},B5={created(t,{value:e},r){t.checked=O2(e,r.props.value),t[N1]=F2(r),n_(t,"change",()=>{t[N1](R5(t))})},beforeUpdate(t,{value:e,oldValue:r},c){t[N1]=F2(c),e!==r&&(t.checked=O2(e,c.props.value))}},xg={deep:!0,created(t,{value:e,modifiers:{number:r}},c){const S=f8(e);n_(t,"change",()=>{const $=Array.prototype.filter.call(t.options,Z=>Z.selected).map(Z=>r?IT(R5(Z)):R5(Z));t[N1](t.multiple?S?new Set($):$:$[0]),t._assigning=!0,b0(()=>{t._assigning=!1})}),t[N1]=F2(c)},mounted(t,{value:e}){tB(t,e)},beforeUpdate(t,e,r){t[N1]=F2(r)},updated(t,{value:e}){t._assigning||tB(t,e)}};function tB(t,e){const r=t.multiple,c=du(e);if(!(r&&!c&&!f8(e))){for(let S=0,$=t.options.length;S<$;S++){const Z=t.options[S],ue=R5(Z);if(r)if(c){const xe=typeof ue;xe==="string"||xe==="number"?Z.selected=e.some(Se=>String(Se)===String(ue)):Z.selected=jie(e,ue)>-1}else Z.selected=e.has(ue);else if(O2(R5(Z),e)){t.selectedIndex!==S&&(t.selectedIndex=S);return}}!r&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function R5(t){return"_value"in t?t._value:t.value}const Yae=["ctrl","shift","alt","meta"],Xae={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Yae.some(r=>t[`${r}Key`]&&!e.includes(r))},Xf=(t,e)=>{const r=t._withMods||(t._withMods={}),c=e.join(".");return r[c]||(r[c]=(S,...$)=>{for(let Z=0;Z{const r=t._withKeys||(t._withKeys={}),c=e.join(".");return r[c]||(r[c]=S=>{if(!("key"in S))return;const $=x_(S.key);if(e.some(Z=>Z===$||Jae[Z]===$))return t(S)})},Qae=Op({patchProp:jae},Tae);let rB;function eoe(){return rB||(rB=Zne(Qae))}const toe=(...t)=>{const e=eoe().createApp(...t),{mount:r}=e;return e.mount=c=>{const S=ioe(c);if(!S)return;const $=e._component;!Xu($)&&!$.render&&!$.template&&($.template=S.innerHTML),S.nodeType===1&&(S.textContent="");const Z=r(S,!1,roe(S));return S instanceof Element&&(S.removeAttribute("v-cloak"),S.setAttribute("data-v-app","")),Z},e};function roe(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function ioe(t){return Md(t)?document.querySelector(t):t}/*! * pinia v3.0.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let hU;const TS=t=>hU=t,fU=Symbol();function FM(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var v5;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(v5||(v5={}));function toe(){const t=YN(!0),e=t.run(()=>vn({}));let r=[],c=[];const S=mE({install(H){TS(S),S._a=H,H.provide(fU,S),H.config.globalProperties.$pinia=S,c.forEach(Z=>r.push(Z)),c=[]},use(H){return this._a?r.push(H):c.push(H),this},_p:r,_a:null,_e:t,_s:new Map,state:e});return S}const dU=()=>{};function tB(t,e,r,c=dU){t.add(e);const S=()=>{t.delete(e)&&c()};return!r&&XN()&&Fie(S),S}function f2(t,...e){t.forEach(r=>{r(...e)})}const roe=t=>t(),rB=Symbol(),y7=Symbol();function NM(t,e){t instanceof Map&&e instanceof Map?e.forEach((r,c)=>t.set(c,r)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const r in e){if(!e.hasOwnProperty(r))continue;const c=e[r],S=t[r];FM(S)&&FM(c)&&t.hasOwnProperty(r)&&!up(c)&&!u_(c)?t[r]=NM(S,c):t[r]=c}return t}const ioe=Symbol();function noe(t){return!FM(t)||!Object.prototype.hasOwnProperty.call(t,ioe)}const{assign:Vy}=Object;function aoe(t){return!!(up(t)&&t.effect)}function ooe(t,e,r,c){const{state:S,actions:H,getters:Z}=e,ue=r.state.value[t];let be;function Se(){ue||(r.state.value[t]=S?S():{});const Re=sne(r.state.value[t]);return Vy(Re,H,Object.keys(Z||{}).reduce((Xe,vt)=>(Xe[vt]=mE(Do(()=>{TS(r);const bt=r._s.get(t);return Z[vt].call(bt,bt)})),Xe),{}))}return be=pU(t,Se,e,r,c,!0),be}function pU(t,e,r={},c,S,H){let Z;const ue=Vy({actions:{}},r),be={deep:!0};let Se,Re,Xe=new Set,vt=new Set,bt;const kt=c.state.value[t];!H&&!kt&&(c.state.value[t]={}),vn({});let Dt;function rr(Ci){let ii;Se=Re=!1,typeof Ci=="function"?(Ci(c.state.value[t]),ii={type:v5.patchFunction,storeId:t,events:bt}):(NM(c.state.value[t],Ci),ii={type:v5.patchObject,payload:Ci,storeId:t,events:bt});const Ji=Dt=Symbol();x0().then(()=>{Dt===Ji&&(Se=!0)}),Re=!0,f2(Xe,ii,c.state.value[t])}const Er=H?function(){const{state:ii}=r,Ji=ii?ii():{};this.$patch(vi=>{Vy(vi,Ji)})}:dU;function Fe(){Z.stop(),Xe.clear(),vt.clear(),c._s.delete(t)}const wi=(Ci,ii="")=>{if(rB in Ci)return Ci[y7]=ii,Ci;const Ji=function(){TS(c);const vi=Array.from(arguments),vr=new Set,dr=new Set;function Ar(ei){vr.add(ei)}function ti(ei){dr.add(ei)}f2(vt,{args:vi,name:Ji[y7],store:Ir,after:Ar,onError:ti});let Xr;try{Xr=Ci.apply(this&&this.$id===t?this:Ir,vi)}catch(ei){throw f2(dr,ei),ei}return Xr instanceof Promise?Xr.then(ei=>(f2(vr,ei),ei)).catch(ei=>(f2(dr,ei),Promise.reject(ei))):(f2(vr,Xr),Xr)};return Ji[rB]=!0,Ji[y7]=ii,Ji},ur={_p:c,$id:t,$onAction:tB.bind(null,vt),$patch:rr,$reset:Er,$subscribe(Ci,ii={}){const Ji=tB(Xe,Ci,ii.detached,()=>vi()),vi=Z.run(()=>w0(()=>c.state.value[t],vr=>{(ii.flush==="sync"?Re:Se)&&Ci({storeId:t,type:v5.direct,events:bt},vr)},Vy({},be,ii)));return Ji},$dispose:Fe},Ir=Ox(ur);c._s.set(t,Ir);const _i=(c._a&&c._a.runWithContext||roe)(()=>c._e.run(()=>(Z=YN()).run(()=>e({action:wi}))));for(const Ci in _i){const ii=_i[Ci];if(up(ii)&&!aoe(ii)||u_(ii))H||(kt&&noe(ii)&&(up(ii)?ii.value=kt[Ci]:NM(ii,kt[Ci])),c.state.value[t][Ci]=ii);else if(typeof ii=="function"){const Ji=wi(ii,Ci);_i[Ci]=Ji,ue.actions[Ci]=ii}}return Vy(Ir,_i),Vy(Ou(Ir),_i),Object.defineProperty(Ir,"$state",{get:()=>c.state.value[t],set:Ci=>{rr(ii=>{Vy(ii,Ci)})}}),c._p.forEach(Ci=>{Vy(Ir,Z.run(()=>Ci({store:Ir,app:c._a,pinia:c,options:ue})))}),kt&&H&&r.hydrate&&r.hydrate(Ir.$state,kt),Se=!0,Re=!0,Ir}/*! #__NO_SIDE_EFFECTS__ */function SS(t,e,r){let c;const S=typeof e=="function";c=S?r:e;function H(Z,ue){const be=Fne();return Z=Z||(be?yg(fU,null):null),Z&&TS(Z),Z=hU,Z._s.has(t)||(S?pU(t,e,c,Z):ooe(t,c,Z)),Z._s.get(t)}return H.$id=t,H}/*! + */let dU;const C8=t=>dU=t,pU=Symbol();function jM(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var _5;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(_5||(_5={}));function noe(){const t=JN(!0),e=t.run(()=>fn({}));let r=[],c=[];const S=vE({install($){C8(S),S._a=$,$.provide(pU,S),$.config.globalProperties.$pinia=S,c.forEach(Z=>r.push(Z)),c=[]},use($){return this._a?r.push($):c.push($),this},_p:r,_a:null,_e:t,_s:new Map,state:e});return S}const mU=()=>{};function iB(t,e,r,c=mU){t.add(e);const S=()=>{t.delete(e)&&c()};return!r&&QN()&&Uie(S),S}function d2(t,...e){t.forEach(r=>{r(...e)})}const aoe=t=>t(),nB=Symbol(),x7=Symbol();function UM(t,e){t instanceof Map&&e instanceof Map?e.forEach((r,c)=>t.set(c,r)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const r in e){if(!e.hasOwnProperty(r))continue;const c=e[r],S=t[r];jM(S)&&jM(c)&&t.hasOwnProperty(r)&&!cp(c)&&!f_(c)?t[r]=UM(S,c):t[r]=c}return t}const ooe=Symbol();function soe(t){return!jM(t)||!Object.prototype.hasOwnProperty.call(t,ooe)}const{assign:Gy}=Object;function loe(t){return!!(cp(t)&&t.effect)}function uoe(t,e,r,c){const{state:S,actions:$,getters:Z}=e,ue=r.state.value[t];let xe;function Se(){ue||(r.state.value[t]=S?S():{});const Ne=cne(r.state.value[t]);return Gy(Ne,$,Object.keys(Z||{}).reduce((it,pt)=>(it[pt]=vE(Io(()=>{C8(r);const bt=r._s.get(t);return Z[pt].call(bt,bt)})),it),{}))}return xe=gU(t,Se,e,r,c,!0),xe}function gU(t,e,r={},c,S,$){let Z;const ue=Gy({actions:{}},r),xe={deep:!0};let Se,Ne,it=new Set,pt=new Set,bt;const wt=c.state.value[t];!$&&!wt&&(c.state.value[t]={}),fn({});let Dt;function Zt(Ci){let ri;Se=Ne=!1,typeof Ci=="function"?(Ci(c.state.value[t]),ri={type:_5.patchFunction,storeId:t,events:bt}):(UM(c.state.value[t],Ci),ri={type:_5.patchObject,payload:Ci,storeId:t,events:bt});const on=Dt=Symbol();b0().then(()=>{Dt===on&&(Se=!0)}),Ne=!0,d2(it,ri,c.state.value[t])}const Mr=$?function(){const{state:ri}=r,on=ri?ri():{};this.$patch(yi=>{Gy(yi,on)})}:mU;function ze(){Z.stop(),it.clear(),pt.clear(),c._s.delete(t)}const ni=(Ci,ri="")=>{if(nB in Ci)return Ci[x7]=ri,Ci;const on=function(){C8(c);const yi=Array.from(arguments),gr=new Set,fr=new Set;function Sr(ti){gr.add(ti)}function ei(ti){fr.add(ti)}d2(pt,{args:yi,name:on[x7],store:Cr,after:Sr,onError:ei});let Jr;try{Jr=Ci.apply(this&&this.$id===t?this:Cr,yi)}catch(ti){throw d2(fr,ti),ti}return Jr instanceof Promise?Jr.then(ti=>(d2(gr,ti),ti)).catch(ti=>(d2(fr,ti),Promise.reject(ti))):(d2(gr,Jr),Jr)};return on[nB]=!0,on[x7]=ri,on},or={_p:c,$id:t,$onAction:iB.bind(null,pt),$patch:Zt,$reset:Mr,$subscribe(Ci,ri={}){const on=iB(it,Ci,ri.detached,()=>yi()),yi=Z.run(()=>Af(()=>c.state.value[t],gr=>{(ri.flush==="sync"?Ne:Se)&&Ci({storeId:t,type:_5.direct,events:bt},gr)},Gy({},xe,ri)));return on},$dispose:ze},Cr=m_(or);c._s.set(t,Cr);const Si=(c._a&&c._a.runWithContext||aoe)(()=>c._e.run(()=>(Z=JN()).run(()=>e({action:ni}))));for(const Ci in Si){const ri=Si[Ci];if(cp(ri)&&!loe(ri)||f_(ri))$||(wt&&soe(ri)&&(cp(ri)?ri.value=wt[Ci]:UM(ri,wt[Ci])),c.state.value[t][Ci]=ri);else if(typeof ri=="function"){const on=ni(ri,Ci);Si[Ci]=on,ue.actions[Ci]=ri}}return Gy(Cr,Si),Gy(Ou(Cr),Si),Object.defineProperty(Cr,"$state",{get:()=>c.state.value[t],set:Ci=>{Zt(ri=>{Gy(ri,Ci)})}}),c._p.forEach(Ci=>{Gy(Cr,Z.run(()=>Ci({store:Cr,app:c._a,pinia:c,options:ue})))}),wt&&$&&r.hydrate&&r.hydrate(Cr.$state,wt),Se=!0,Ne=!0,Cr}/*! #__NO_SIDE_EFFECTS__ */function A8(t,e,r){let c;const S=typeof e=="function";c=S?r:e;function $(Z,ue){const xe=Une();return Z=Z||(xe?_g(pU,null):null),Z&&C8(Z),Z=dU,Z._s.has(t)||(S?gU(t,e,c,Z):uoe(t,c,Z)),Z._s.get(t)}return $.$id=t,$}/*! * vue-router v4.6.3 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const b2=typeof document<"u";function mU(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function soe(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&mU(t.default)}const Gh=Object.assign;function _7(t,e){const r={};for(const c in e){const S=e[c];r[c]=jg(S)?S.map(t):t(S)}return r}const y5=()=>{},jg=Array.isArray;function iB(t,e){const r={};for(const c in t)r[c]=c in e?e[c]:t[c];return r}const gU=/#/g,loe=/&/g,uoe=/\//g,coe=/=/g,hoe=/\?/g,vU=/\+/g,foe=/%5B/g,doe=/%5D/g,yU=/%5E/g,poe=/%60/g,_U=/%7B/g,moe=/%7C/g,xU=/%7D/g,goe=/%20/g;function kE(t){return t==null?"":encodeURI(""+t).replace(moe,"|").replace(foe,"[").replace(doe,"]")}function voe(t){return kE(t).replace(_U,"{").replace(xU,"}").replace(yU,"^")}function jM(t){return kE(t).replace(vU,"%2B").replace(goe,"+").replace(gU,"%23").replace(loe,"%26").replace(poe,"`").replace(_U,"{").replace(xU,"}").replace(yU,"^")}function yoe(t){return jM(t).replace(coe,"%3D")}function _oe(t){return kE(t).replace(gU,"%23").replace(hoe,"%3F")}function xoe(t){return _oe(t).replace(uoe,"%2F")}function B5(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const boe=/\/$/,woe=t=>t.replace(boe,"");function x7(t,e,r="/"){let c,S={},H="",Z="";const ue=e.indexOf("#");let be=e.indexOf("?");return be=ue>=0&&be>ue?-1:be,be>=0&&(c=e.slice(0,be),H=e.slice(be,ue>0?ue:e.length),S=t(H.slice(1))),ue>=0&&(c=c||e.slice(0,ue),Z=e.slice(ue,e.length)),c=Coe(c??e,r),{fullPath:c+H+Z,path:c,query:S,hash:B5(Z)}}function koe(t,e){const r=e.query?t(e.query):"";return e.path+(r&&"?")+r+(e.hash||"")}function nB(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Toe(t,e,r){const c=e.matched.length-1,S=r.matched.length-1;return c>-1&&c===S&&R2(e.matched[c],r.matched[S])&&bU(e.params,r.params)&&t(e.query)===t(r.query)&&e.hash===r.hash}function R2(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function bU(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(!Soe(t[r],e[r]))return!1;return!0}function Soe(t,e){return jg(t)?aB(t,e):jg(e)?aB(e,t):t===e}function aB(t,e){return jg(e)?t.length===e.length&&t.every((r,c)=>r===e[c]):t.length===1&&t[0]===e}function Coe(t,e){if(t.startsWith("/"))return t;if(!t)return e;const r=e.split("/"),c=t.split("/"),S=c[c.length-1];(S===".."||S===".")&&c.push("");let H=r.length-1,Z,ue;for(Z=0;Z1&&H--;else break;return r.slice(0,H).join("/")+"/"+c.slice(Z).join("/")}const By={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let UM=function(t){return t.pop="pop",t.push="push",t}({}),b7=function(t){return t.back="back",t.forward="forward",t.unknown="",t}({});function Aoe(t){if(!t)if(b2){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),woe(t)}const Moe=/^[^#]+#/;function Eoe(t,e){return t.replace(Moe,"#")+e}function Loe(t,e){const r=document.documentElement.getBoundingClientRect(),c=t.getBoundingClientRect();return{behavior:e.behavior,left:c.left-r.left-(e.left||0),top:c.top-r.top-(e.top||0)}}const CS=()=>({left:window.scrollX,top:window.scrollY});function Poe(t){let e;if("el"in t){const r=t.el,c=typeof r=="string"&&r.startsWith("#"),S=typeof r=="string"?c?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!S)return;e=Loe(S,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function oB(t,e){return(history.state?history.state.position-e:-1)+t}const $M=new Map;function Ioe(t,e){$M.set(t,e)}function Doe(t){const e=$M.get(t);return $M.delete(t),e}function zoe(t){return typeof t=="string"||t&&typeof t=="object"}function wU(t){return typeof t=="string"||typeof t=="symbol"}let Nd=function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t}({});const kU=Symbol("");Nd.MATCHER_NOT_FOUND+"",Nd.NAVIGATION_GUARD_REDIRECT+"",Nd.NAVIGATION_ABORTED+"",Nd.NAVIGATION_CANCELLED+"",Nd.NAVIGATION_DUPLICATED+"";function F2(t,e){return Gh(new Error,{type:t,[kU]:!0},e)}function g1(t,e){return t instanceof Error&&kU in t&&(e==null||!!(t.type&e))}const Ooe=["params","query","hash"];function Boe(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const r of Ooe)r in t&&(e[r]=t[r]);return JSON.stringify(e,null,2)}function Roe(t){const e={};if(t===""||t==="?")return e;const r=(t[0]==="?"?t.slice(1):t).split("&");for(let c=0;cS&&jM(S)):[c&&jM(c)]).forEach(S=>{S!==void 0&&(e+=(e.length?"&":"")+r,S!=null&&(e+="="+S))})}return e}function Foe(t){const e={};for(const r in t){const c=t[r];c!==void 0&&(e[r]=jg(c)?c.map(S=>S==null?null:""+S):c==null?c:""+c)}return e}const Noe=Symbol(""),lB=Symbol(""),AS=Symbol(""),TE=Symbol(""),HM=Symbol("");function E3(){let t=[];function e(c){return t.push(c),()=>{const S=t.indexOf(c);S>-1&&t.splice(S,1)}}function r(){t=[]}return{add:e,list:()=>t.slice(),reset:r}}function Jy(t,e,r,c,S,H=Z=>Z()){const Z=c&&(c.enterCallbacks[S]=c.enterCallbacks[S]||[]);return()=>new Promise((ue,be)=>{const Se=vt=>{vt===!1?be(F2(Nd.NAVIGATION_ABORTED,{from:r,to:e})):vt instanceof Error?be(vt):zoe(vt)?be(F2(Nd.NAVIGATION_GUARD_REDIRECT,{from:e,to:vt})):(Z&&c.enterCallbacks[S]===Z&&typeof vt=="function"&&Z.push(vt),ue())},Re=H(()=>t.call(c&&c.instances[S],e,r,Se));let Xe=Promise.resolve(Re);t.length<3&&(Xe=Xe.then(Se)),Xe.catch(vt=>be(vt))})}function w7(t,e,r,c,S=H=>H()){const H=[];for(const Z of t)for(const ue in Z.components){let be=Z.components[ue];if(!(e!=="beforeRouteEnter"&&!Z.instances[ue]))if(mU(be)){const Se=(be.__vccOpts||be)[e];Se&&H.push(Jy(Se,r,c,Z,ue,S))}else{let Se=be();H.push(()=>Se.then(Re=>{if(!Re)throw new Error(`Couldn't resolve component "${ue}" at "${Z.path}"`);const Xe=soe(Re)?Re.default:Re;Z.mods[ue]=Re,Z.components[ue]=Xe;const vt=(Xe.__vccOpts||Xe)[e];return vt&&Jy(vt,r,c,Z,ue,S)()}))}}return H}function joe(t,e){const r=[],c=[],S=[],H=Math.max(e.matched.length,t.matched.length);for(let Z=0;ZR2(Se,ue))?c.push(ue):r.push(ue));const be=t.matched[Z];be&&(e.matched.find(Se=>R2(Se,be))||S.push(be))}return[r,c,S]}/*! + */const w2=typeof document<"u";function vU(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function coe(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&vU(t.default)}const Gh=Object.assign;function b7(t,e){const r={};for(const c in e){const S=e[c];r[c]=jg(S)?S.map(t):t(S)}return r}const x5=()=>{},jg=Array.isArray;function aB(t,e){const r={};for(const c in t)r[c]=c in e?e[c]:t[c];return r}const yU=/#/g,hoe=/&/g,foe=/\//g,doe=/=/g,poe=/\?/g,_U=/\+/g,moe=/%5B/g,goe=/%5D/g,xU=/%5E/g,voe=/%60/g,bU=/%7B/g,yoe=/%7C/g,wU=/%7D/g,_oe=/%20/g;function SE(t){return t==null?"":encodeURI(""+t).replace(yoe,"|").replace(moe,"[").replace(goe,"]")}function xoe(t){return SE(t).replace(bU,"{").replace(wU,"}").replace(xU,"^")}function $M(t){return SE(t).replace(_U,"%2B").replace(_oe,"+").replace(yU,"%23").replace(hoe,"%26").replace(voe,"`").replace(bU,"{").replace(wU,"}").replace(xU,"^")}function boe(t){return $M(t).replace(doe,"%3D")}function woe(t){return SE(t).replace(yU,"%23").replace(poe,"%3F")}function koe(t){return woe(t).replace(foe,"%2F")}function F5(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const Toe=/\/$/,Soe=t=>t.replace(Toe,"");function w7(t,e,r="/"){let c,S={},$="",Z="";const ue=e.indexOf("#");let xe=e.indexOf("?");return xe=ue>=0&&xe>ue?-1:xe,xe>=0&&(c=e.slice(0,xe),$=e.slice(xe,ue>0?ue:e.length),S=t($.slice(1))),ue>=0&&(c=c||e.slice(0,ue),Z=e.slice(ue,e.length)),c=Eoe(c??e,r),{fullPath:c+$+Z,path:c,query:S,hash:F5(Z)}}function Coe(t,e){const r=e.query?t(e.query):"";return e.path+(r&&"?")+r+(e.hash||"")}function oB(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Aoe(t,e,r){const c=e.matched.length-1,S=r.matched.length-1;return c>-1&&c===S&&N2(e.matched[c],r.matched[S])&&kU(e.params,r.params)&&t(e.query)===t(r.query)&&e.hash===r.hash}function N2(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function kU(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(!Moe(t[r],e[r]))return!1;return!0}function Moe(t,e){return jg(t)?sB(t,e):jg(e)?sB(e,t):t===e}function sB(t,e){return jg(e)?t.length===e.length&&t.every((r,c)=>r===e[c]):t.length===1&&t[0]===e}function Eoe(t,e){if(t.startsWith("/"))return t;if(!t)return e;const r=e.split("/"),c=t.split("/"),S=c[c.length-1];(S===".."||S===".")&&c.push("");let $=r.length-1,Z,ue;for(Z=0;Z1&&$--;else break;return r.slice(0,$).join("/")+"/"+c.slice(Z).join("/")}const Fy={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let HM=function(t){return t.pop="pop",t.push="push",t}({}),k7=function(t){return t.back="back",t.forward="forward",t.unknown="",t}({});function Loe(t){if(!t)if(w2){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Soe(t)}const Poe=/^[^#]+#/;function Ioe(t,e){return t.replace(Poe,"#")+e}function Doe(t,e){const r=document.documentElement.getBoundingClientRect(),c=t.getBoundingClientRect();return{behavior:e.behavior,left:c.left-r.left-(e.left||0),top:c.top-r.top-(e.top||0)}}const M8=()=>({left:window.scrollX,top:window.scrollY});function zoe(t){let e;if("el"in t){const r=t.el,c=typeof r=="string"&&r.startsWith("#"),S=typeof r=="string"?c?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!S)return;e=Doe(S,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function lB(t,e){return(history.state?history.state.position-e:-1)+t}const VM=new Map;function Ooe(t,e){VM.set(t,e)}function Boe(t){const e=VM.get(t);return VM.delete(t),e}function Roe(t){return typeof t=="string"||t&&typeof t=="object"}function TU(t){return typeof t=="string"||typeof t=="symbol"}let jd=function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t}({});const SU=Symbol("");jd.MATCHER_NOT_FOUND+"",jd.NAVIGATION_GUARD_REDIRECT+"",jd.NAVIGATION_ABORTED+"",jd.NAVIGATION_CANCELLED+"",jd.NAVIGATION_DUPLICATED+"";function j2(t,e){return Gh(new Error,{type:t,[SU]:!0},e)}function m1(t,e){return t instanceof Error&&SU in t&&(e==null||!!(t.type&e))}const Foe=["params","query","hash"];function Noe(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const r of Foe)r in t&&(e[r]=t[r]);return JSON.stringify(e,null,2)}function joe(t){const e={};if(t===""||t==="?")return e;const r=(t[0]==="?"?t.slice(1):t).split("&");for(let c=0;cS&&$M(S)):[c&&$M(c)]).forEach(S=>{S!==void 0&&(e+=(e.length?"&":"")+r,S!=null&&(e+="="+S))})}return e}function Uoe(t){const e={};for(const r in t){const c=t[r];c!==void 0&&(e[r]=jg(c)?c.map(S=>S==null?null:""+S):c==null?c:""+c)}return e}const $oe=Symbol(""),cB=Symbol(""),E8=Symbol(""),CE=Symbol(""),WM=Symbol("");function P3(){let t=[];function e(c){return t.push(c),()=>{const S=t.indexOf(c);S>-1&&t.splice(S,1)}}function r(){t=[]}return{add:e,list:()=>t.slice(),reset:r}}function t_(t,e,r,c,S,$=Z=>Z()){const Z=c&&(c.enterCallbacks[S]=c.enterCallbacks[S]||[]);return()=>new Promise((ue,xe)=>{const Se=pt=>{pt===!1?xe(j2(jd.NAVIGATION_ABORTED,{from:r,to:e})):pt instanceof Error?xe(pt):Roe(pt)?xe(j2(jd.NAVIGATION_GUARD_REDIRECT,{from:e,to:pt})):(Z&&c.enterCallbacks[S]===Z&&typeof pt=="function"&&Z.push(pt),ue())},Ne=$(()=>t.call(c&&c.instances[S],e,r,Se));let it=Promise.resolve(Ne);t.length<3&&(it=it.then(Se)),it.catch(pt=>xe(pt))})}function T7(t,e,r,c,S=$=>$()){const $=[];for(const Z of t)for(const ue in Z.components){let xe=Z.components[ue];if(!(e!=="beforeRouteEnter"&&!Z.instances[ue]))if(vU(xe)){const Se=(xe.__vccOpts||xe)[e];Se&&$.push(t_(Se,r,c,Z,ue,S))}else{let Se=xe();$.push(()=>Se.then(Ne=>{if(!Ne)throw new Error(`Couldn't resolve component "${ue}" at "${Z.path}"`);const it=coe(Ne)?Ne.default:Ne;Z.mods[ue]=Ne,Z.components[ue]=it;const pt=(it.__vccOpts||it)[e];return pt&&t_(pt,r,c,Z,ue,S)()}))}}return $}function Hoe(t,e){const r=[],c=[],S=[],$=Math.max(e.matched.length,t.matched.length);for(let Z=0;Z<$;Z++){const ue=e.matched[Z];ue&&(t.matched.find(Se=>N2(Se,ue))?c.push(ue):r.push(ue));const xe=t.matched[Z];xe&&(e.matched.find(Se=>N2(Se,xe))||S.push(xe))}return[r,c,S]}/*! * vue-router v4.6.3 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Uoe=()=>location.protocol+"//"+location.host;function TU(t,e){const{pathname:r,search:c,hash:S}=e,H=t.indexOf("#");if(H>-1){let Z=S.includes(t.slice(H))?t.slice(H).length:1,ue=S.slice(Z);return ue[0]!=="/"&&(ue="/"+ue),nB(ue,"")}return nB(r,t)+c+S}function $oe(t,e,r,c){let S=[],H=[],Z=null;const ue=({state:vt})=>{const bt=TU(t,location),kt=r.value,Dt=e.value;let rr=0;if(vt){if(r.value=bt,e.value=vt,Z&&Z===kt){Z=null;return}rr=Dt?vt.position-Dt.position:0}else c(bt);S.forEach(Er=>{Er(r.value,kt,{delta:rr,type:UM.pop,direction:rr?rr>0?b7.forward:b7.back:b7.unknown})})};function be(){Z=r.value}function Se(vt){S.push(vt);const bt=()=>{const kt=S.indexOf(vt);kt>-1&&S.splice(kt,1)};return H.push(bt),bt}function Re(){if(document.visibilityState==="hidden"){const{history:vt}=window;if(!vt.state)return;vt.replaceState(Gh({},vt.state,{scroll:CS()}),"")}}function Xe(){for(const vt of H)vt();H=[],window.removeEventListener("popstate",ue),window.removeEventListener("pagehide",Re),document.removeEventListener("visibilitychange",Re)}return window.addEventListener("popstate",ue),window.addEventListener("pagehide",Re),document.addEventListener("visibilitychange",Re),{pauseListeners:be,listen:Se,destroy:Xe}}function uB(t,e,r,c=!1,S=!1){return{back:t,current:e,forward:r,replaced:c,position:window.history.length,scroll:S?CS():null}}function Hoe(t){const{history:e,location:r}=window,c={value:TU(t,r)},S={value:e.state};S.value||H(c.value,{back:null,current:c.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function H(be,Se,Re){const Xe=t.indexOf("#"),vt=Xe>-1?(r.host&&document.querySelector("base")?t:t.slice(Xe))+be:Uoe()+t+be;try{e[Re?"replaceState":"pushState"](Se,"",vt),S.value=Se}catch(bt){console.error(bt),r[Re?"replace":"assign"](vt)}}function Z(be,Se){H(be,Gh({},e.state,uB(S.value.back,be,S.value.forward,!0),Se,{position:S.value.position}),!0),c.value=be}function ue(be,Se){const Re=Gh({},S.value,e.state,{forward:be,scroll:CS()});H(Re.current,Re,!0),H(be,Gh({},uB(c.value,be,null),{position:Re.position+1},Se),!1),c.value=be}return{location:c,state:S,push:ue,replace:Z}}function Voe(t){t=Aoe(t);const e=Hoe(t),r=$oe(t,e.state,e.location,e.replace);function c(H,Z=!0){Z||r.pauseListeners(),history.go(H)}const S=Gh({location:"",base:t,go:c,createHref:Eoe.bind(null,t)},e,r);return Object.defineProperty(S,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(S,"state",{enumerable:!0,get:()=>e.state.value}),S}let wx=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t}({});var Ip=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t}(Ip||{});const Woe={type:wx.Static,value:""},qoe=/[a-zA-Z0-9_]/;function Goe(t){if(!t)return[[]];if(t==="/")return[[Woe]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(bt){throw new Error(`ERR (${r})/"${Se}": ${bt}`)}let r=Ip.Static,c=r;const S=[];let H;function Z(){H&&S.push(H),H=[]}let ue=0,be,Se="",Re="";function Xe(){Se&&(r===Ip.Static?H.push({type:wx.Static,value:Se}):r===Ip.Param||r===Ip.ParamRegExp||r===Ip.ParamRegExpEnd?(H.length>1&&(be==="*"||be==="+")&&e(`A repeatable param (${Se}) must be alone in its segment. eg: '/:ids+.`),H.push({type:wx.Param,value:Se,regexp:Re,repeatable:be==="*"||be==="+",optional:be==="*"||be==="?"})):e("Invalid state to consume buffer"),Se="")}function vt(){Se+=be}for(;uee.length?e.length===1&&e[0]===im.Static+im.Segment?1:-1:0}function SU(t,e){let r=0;const c=t.score,S=e.score;for(;r0&&e[e.length-1]<0}const Joe={strict:!1,end:!0,sensitive:!1};function Qoe(t,e,r){const c=Yoe(Goe(t.path),r),S=Gh(c,{record:t,parent:e,children:[],alias:[]});return e&&!S.record.aliasOf==!e.record.aliasOf&&e.children.push(S),S}function ese(t,e){const r=[],c=new Map;e=iB(Joe,e);function S(Xe){return c.get(Xe)}function H(Xe,vt,bt){const kt=!bt,Dt=dB(Xe);Dt.aliasOf=bt&&bt.record;const rr=iB(e,Xe),Er=[Dt];if("alias"in Xe){const ur=typeof Xe.alias=="string"?[Xe.alias]:Xe.alias;for(const Ir of ur)Er.push(dB(Gh({},Dt,{components:bt?bt.record.components:Dt.components,path:Ir,aliasOf:bt?bt.record:Dt})))}let Fe,wi;for(const ur of Er){const{path:Ir}=ur;if(vt&&Ir[0]!=="/"){const Ti=vt.record.path,_i=Ti[Ti.length-1]==="/"?"":"/";ur.path=vt.record.path+(Ir&&_i+Ir)}if(Fe=Qoe(ur,vt,rr),bt?bt.alias.push(Fe):(wi=wi||Fe,wi!==Fe&&wi.alias.push(Fe),kt&&Xe.name&&!pB(Fe)&&Z(Xe.name)),CU(Fe)&&be(Fe),Dt.children){const Ti=Dt.children;for(let _i=0;_i{Z(wi)}:y5}function Z(Xe){if(wU(Xe)){const vt=c.get(Xe);vt&&(c.delete(Xe),r.splice(r.indexOf(vt),1),vt.children.forEach(Z),vt.alias.forEach(Z))}else{const vt=r.indexOf(Xe);vt>-1&&(r.splice(vt,1),Xe.record.name&&c.delete(Xe.record.name),Xe.children.forEach(Z),Xe.alias.forEach(Z))}}function ue(){return r}function be(Xe){const vt=ise(Xe,r);r.splice(vt,0,Xe),Xe.record.name&&!pB(Xe)&&c.set(Xe.record.name,Xe)}function Se(Xe,vt){let bt,kt={},Dt,rr;if("name"in Xe&&Xe.name){if(bt=c.get(Xe.name),!bt)throw F2(Nd.MATCHER_NOT_FOUND,{location:Xe});rr=bt.record.name,kt=Gh(fB(vt.params,bt.keys.filter(wi=>!wi.optional).concat(bt.parent?bt.parent.keys.filter(wi=>wi.optional):[]).map(wi=>wi.name)),Xe.params&&fB(Xe.params,bt.keys.map(wi=>wi.name))),Dt=bt.stringify(kt)}else if(Xe.path!=null)Dt=Xe.path,bt=r.find(wi=>wi.re.test(Dt)),bt&&(kt=bt.parse(Dt),rr=bt.record.name);else{if(bt=vt.name?c.get(vt.name):r.find(wi=>wi.re.test(vt.path)),!bt)throw F2(Nd.MATCHER_NOT_FOUND,{location:Xe,currentLocation:vt});rr=bt.record.name,kt=Gh({},vt.params,Xe.params),Dt=bt.stringify(kt)}const Er=[];let Fe=bt;for(;Fe;)Er.unshift(Fe.record),Fe=Fe.parent;return{name:rr,path:Dt,params:kt,matched:Er,meta:rse(Er)}}t.forEach(Xe=>H(Xe));function Re(){r.length=0,c.clear()}return{addRoute:H,resolve:Se,removeRoute:Z,clearRoutes:Re,getRoutes:ue,getRecordMatcher:S}}function fB(t,e){const r={};for(const c of e)c in t&&(r[c]=t[c]);return r}function dB(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:tse(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function tse(t){const e={},r=t.props||!1;if("component"in t)e.default=r;else for(const c in t.components)e[c]=typeof r=="object"?r[c]:r;return e}function pB(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function rse(t){return t.reduce((e,r)=>Gh(e,r.meta),{})}function ise(t,e){let r=0,c=e.length;for(;r!==c;){const H=r+c>>1;SU(t,e[H])<0?c=H:r=H+1}const S=nse(t);return S&&(c=e.lastIndexOf(S,c-1)),c}function nse(t){let e=t;for(;e=e.parent;)if(CU(e)&&SU(t,e)===0)return e}function CU({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function mB(t){const e=yg(AS),r=yg(TE),c=Do(()=>{const be=Po(t.to);return e.resolve(be)}),S=Do(()=>{const{matched:be}=c.value,{length:Se}=be,Re=be[Se-1],Xe=r.matched;if(!Re||!Xe.length)return-1;const vt=Xe.findIndex(R2.bind(null,Re));if(vt>-1)return vt;const bt=gB(be[Se-2]);return Se>1&&gB(Re)===bt&&Xe[Xe.length-1].path!==bt?Xe.findIndex(R2.bind(null,be[Se-2])):vt}),H=Do(()=>S.value>-1&&use(r.params,c.value.params)),Z=Do(()=>S.value>-1&&S.value===r.matched.length-1&&bU(r.params,c.value.params));function ue(be={}){if(lse(be)){const Se=e[Po(t.replace)?"replace":"push"](Po(t.to)).catch(y5);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>Se),Se}return Promise.resolve()}return{route:c,href:Do(()=>c.value.href),isActive:H,isExactActive:Z,navigate:ue}}function ase(t){return t.length===1?t[0]:t}const ose=Uu({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:mB,setup(t,{slots:e}){const r=Ox(mB(t)),{options:c}=yg(AS),S=Do(()=>({[vB(t.activeClass,c.linkActiveClass,"router-link-active")]:r.isActive,[vB(t.exactActiveClass,c.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const H=e.default&&ase(e.default(r));return t.custom?H:wE("a",{"aria-current":r.isExactActive?t.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:S.value},H)}}}),sse=ose;function lse(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function use(t,e){for(const r in e){const c=e[r],S=t[r];if(typeof c=="string"){if(c!==S)return!1}else if(!jg(S)||S.length!==c.length||c.some((H,Z)=>H!==S[Z]))return!1}return!0}function gB(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const vB=(t,e,r)=>t??e??r,cse=Uu({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:r}){const c=yg(HM),S=Do(()=>t.route||c.value),H=yg(lB,0),Z=Do(()=>{let Se=Po(H);const{matched:Re}=S.value;let Xe;for(;(Xe=Re[Se])&&!Xe.components;)Se++;return Se}),ue=Do(()=>S.value.matched[Z.value]);lT(lB,Do(()=>Z.value+1)),lT(Noe,ue),lT(HM,S);const be=vn();return w0(()=>[be.value,ue.value,t.name],([Se,Re,Xe],[vt,bt,kt])=>{Re&&(Re.instances[Xe]=Se,bt&&bt!==Re&&Se&&Se===vt&&(Re.leaveGuards.size||(Re.leaveGuards=bt.leaveGuards),Re.updateGuards.size||(Re.updateGuards=bt.updateGuards))),Se&&Re&&(!bt||!R2(Re,bt)||!vt)&&(Re.enterCallbacks[Xe]||[]).forEach(Dt=>Dt(Se))},{flush:"post"}),()=>{const Se=S.value,Re=t.name,Xe=ue.value,vt=Xe&&Xe.components[Re];if(!vt)return yB(r.default,{Component:vt,route:Se});const bt=Xe.props[Re],kt=bt?bt===!0?Se.params:typeof bt=="function"?bt(Se):bt:null,rr=wE(vt,Gh({},kt,e,{onVnodeUnmounted:Er=>{Er.component.isUnmounted&&(Xe.instances[Re]=null)},ref:be}));return yB(r.default,{Component:rr,route:Se})||rr}}});function yB(t,e){if(!t)return null;const r=t(e);return r.length===1?r[0]:r}const hse=cse;function fse(t){const e=ese(t.routes,t),r=t.parseQuery||Roe,c=t.stringifyQuery||sB,S=t.history,H=E3(),Z=E3(),ue=E3(),be=nne(By);let Se=By;b2&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Re=_7.bind(null,zn=>""+zn),Xe=_7.bind(null,xoe),vt=_7.bind(null,B5);function bt(zn,Ra){let Ya,zo;return wU(zn)?(Ya=e.getRecordMatcher(zn),zo=Ra):zo=zn,e.addRoute(zo,Ya)}function kt(zn){const Ra=e.getRecordMatcher(zn);Ra&&e.removeRoute(Ra)}function Dt(){return e.getRoutes().map(zn=>zn.record)}function rr(zn){return!!e.getRecordMatcher(zn)}function Er(zn,Ra){if(Ra=Gh({},Ra||be.value),typeof zn=="string"){const Xi=x7(r,zn,Ra.path),oo=e.resolve({path:Xi.path},Ra),go=S.createHref(Xi.fullPath);return Gh(Xi,oo,{params:vt(oo.params),hash:B5(Xi.hash),redirectedFrom:void 0,href:go})}let Ya;if(zn.path!=null)Ya=Gh({},zn,{path:x7(r,zn.path,Ra.path).path});else{const Xi=Gh({},zn.params);for(const oo in Xi)Xi[oo]==null&&delete Xi[oo];Ya=Gh({},zn,{params:Xe(Xi)}),Ra.params=Xe(Ra.params)}const zo=e.resolve(Ya,Ra),_a=zn.hash||"";zo.params=Re(vt(zo.params));const Ur=koe(c,Gh({},zn,{hash:voe(_a),path:zo.path})),Mi=S.createHref(Ur);return Gh({fullPath:Ur,hash:_a,query:c===sB?Foe(zn.query):zn.query||{}},zo,{redirectedFrom:void 0,href:Mi})}function Fe(zn){return typeof zn=="string"?x7(r,zn,be.value.path):Gh({},zn)}function wi(zn,Ra){if(Se!==zn)return F2(Nd.NAVIGATION_CANCELLED,{from:Ra,to:zn})}function ur(zn){return _i(zn)}function Ir(zn){return ur(Gh(Fe(zn),{replace:!0}))}function Ti(zn,Ra){const Ya=zn.matched[zn.matched.length-1];if(Ya&&Ya.redirect){const{redirect:zo}=Ya;let _a=typeof zo=="function"?zo(zn,Ra):zo;return typeof _a=="string"&&(_a=_a.includes("?")||_a.includes("#")?_a=Fe(_a):{path:_a},_a.params={}),Gh({query:zn.query,hash:zn.hash,params:_a.path!=null?{}:zn.params},_a)}}function _i(zn,Ra){const Ya=Se=Er(zn),zo=be.value,_a=zn.state,Ur=zn.force,Mi=zn.replace===!0,Xi=Ti(Ya,zo);if(Xi)return _i(Gh(Fe(Xi),{state:typeof Xi=="object"?Gh({},_a,Xi.state):_a,force:Ur,replace:Mi}),Ra||Ya);const oo=Ya;oo.redirectedFrom=Ra;let go;return!Ur&&Toe(c,zo,Ya)&&(go=F2(Nd.NAVIGATION_DUPLICATED,{to:oo,from:zo}),ka(zo,zo,!0,!1)),(go?Promise.resolve(go):Ji(oo,zo)).catch(ko=>g1(ko)?g1(ko,Nd.NAVIGATION_GUARD_REDIRECT)?ko:Qn(ko):Di(ko,oo,zo)).then(ko=>{if(ko){if(g1(ko,Nd.NAVIGATION_GUARD_REDIRECT))return _i(Gh({replace:Mi},Fe(ko.to),{state:typeof ko.to=="object"?Gh({},_a,ko.to.state):_a,force:Ur}),Ra||oo)}else ko=vr(oo,zo,!0,Mi,_a);return vi(oo,zo,ko),ko})}function Ci(zn,Ra){const Ya=wi(zn,Ra);return Ya?Promise.reject(Ya):Promise.resolve()}function ii(zn){const Ra=Yn.values().next().value;return Ra&&typeof Ra.runWithContext=="function"?Ra.runWithContext(zn):zn()}function Ji(zn,Ra){let Ya;const[zo,_a,Ur]=joe(zn,Ra);Ya=w7(zo.reverse(),"beforeRouteLeave",zn,Ra);for(const Xi of zo)Xi.leaveGuards.forEach(oo=>{Ya.push(Jy(oo,zn,Ra))});const Mi=Ci.bind(null,zn,Ra);return Ya.push(Mi),an(Ya).then(()=>{Ya=[];for(const Xi of H.list())Ya.push(Jy(Xi,zn,Ra));return Ya.push(Mi),an(Ya)}).then(()=>{Ya=w7(_a,"beforeRouteUpdate",zn,Ra);for(const Xi of _a)Xi.updateGuards.forEach(oo=>{Ya.push(Jy(oo,zn,Ra))});return Ya.push(Mi),an(Ya)}).then(()=>{Ya=[];for(const Xi of Ur)if(Xi.beforeEnter)if(jg(Xi.beforeEnter))for(const oo of Xi.beforeEnter)Ya.push(Jy(oo,zn,Ra));else Ya.push(Jy(Xi.beforeEnter,zn,Ra));return Ya.push(Mi),an(Ya)}).then(()=>(zn.matched.forEach(Xi=>Xi.enterCallbacks={}),Ya=w7(Ur,"beforeRouteEnter",zn,Ra,ii),Ya.push(Mi),an(Ya))).then(()=>{Ya=[];for(const Xi of Z.list())Ya.push(Jy(Xi,zn,Ra));return Ya.push(Mi),an(Ya)}).catch(Xi=>g1(Xi,Nd.NAVIGATION_CANCELLED)?Xi:Promise.reject(Xi))}function vi(zn,Ra,Ya){ue.list().forEach(zo=>ii(()=>zo(zn,Ra,Ya)))}function vr(zn,Ra,Ya,zo,_a){const Ur=wi(zn,Ra);if(Ur)return Ur;const Mi=Ra===By,Xi=b2?history.state:{};Ya&&(zo||Mi?S.replace(zn.fullPath,Gh({scroll:Mi&&Xi&&Xi.scroll},_a)):S.push(zn.fullPath,_a)),be.value=zn,ka(zn,Ra,Ya,Mi),Qn()}let dr;function Ar(){dr||(dr=S.listen((zn,Ra,Ya)=>{if(!sn.listening)return;const zo=Er(zn),_a=Ti(zo,sn.currentRoute.value);if(_a){_i(Gh(_a,{replace:!0,force:!0}),zo).catch(y5);return}Se=zo;const Ur=be.value;b2&&Ioe(oB(Ur.fullPath,Ya.delta),CS()),Ji(zo,Ur).catch(Mi=>g1(Mi,Nd.NAVIGATION_ABORTED|Nd.NAVIGATION_CANCELLED)?Mi:g1(Mi,Nd.NAVIGATION_GUARD_REDIRECT)?(_i(Gh(Fe(Mi.to),{force:!0}),zo).then(Xi=>{g1(Xi,Nd.NAVIGATION_ABORTED|Nd.NAVIGATION_DUPLICATED)&&!Ya.delta&&Ya.type===UM.pop&&S.go(-1,!1)}).catch(y5),Promise.reject()):(Ya.delta&&S.go(-Ya.delta,!1),Di(Mi,zo,Ur))).then(Mi=>{Mi=Mi||vr(zo,Ur,!1),Mi&&(Ya.delta&&!g1(Mi,Nd.NAVIGATION_CANCELLED)?S.go(-Ya.delta,!1):Ya.type===UM.pop&&g1(Mi,Nd.NAVIGATION_ABORTED|Nd.NAVIGATION_DUPLICATED)&&S.go(-1,!1)),vi(zo,Ur,Mi)}).catch(y5)}))}let ti=E3(),Xr=E3(),ei;function Di(zn,Ra,Ya){Qn(zn);const zo=Xr.list();return zo.length?zo.forEach(_a=>_a(zn,Ra,Ya)):console.error(zn),Promise.reject(zn)}function qn(){return ei&&be.value!==By?Promise.resolve():new Promise((zn,Ra)=>{ti.add([zn,Ra])})}function Qn(zn){return ei||(ei=!zn,Ar(),ti.list().forEach(([Ra,Ya])=>zn?Ya(zn):Ra()),ti.reset()),zn}function ka(zn,Ra,Ya,zo){const{scrollBehavior:_a}=t;if(!b2||!_a)return Promise.resolve();const Ur=!Ya&&Doe(oB(zn.fullPath,0))||(zo||!Ya)&&history.state&&history.state.scroll||null;return x0().then(()=>_a(zn,Ra,Ur)).then(Mi=>Mi&&Poe(Mi)).catch(Mi=>Di(Mi,zn,Ra))}const Ta=zn=>S.go(zn);let so;const Yn=new Set,sn={currentRoute:be,listening:!0,addRoute:bt,removeRoute:kt,clearRoutes:e.clearRoutes,hasRoute:rr,getRoutes:Dt,resolve:Er,options:t,push:ur,replace:Ir,go:Ta,back:()=>Ta(-1),forward:()=>Ta(1),beforeEach:H.add,beforeResolve:Z.add,afterEach:ue.add,onError:Xr.add,isReady:qn,install(zn){zn.component("RouterLink",sse),zn.component("RouterView",hse),zn.config.globalProperties.$router=sn,Object.defineProperty(zn.config.globalProperties,"$route",{enumerable:!0,get:()=>Po(be)}),b2&&!so&&be.value===By&&(so=!0,ur(S.location).catch(zo=>{}));const Ra={};for(const zo in By)Object.defineProperty(Ra,zo,{get:()=>be.value[zo],enumerable:!0});zn.provide(AS,sn),zn.provide(TE,fj(Ra)),zn.provide(HM,be);const Ya=zn.unmount;Yn.add(zn),zn.unmount=function(){Yn.delete(zn),Yn.size<1&&(Se=By,dr&&dr(),dr=null,be.value=By,so=!1,ei=!1),Ya()}}};function an(zn){return zn.reduce((Ra,Ya)=>Ra.then(()=>ii(Ya)),Promise.resolve())}return sn}function J5(){return yg(AS)}function SE(t){return yg(TE)}const AU="/assets/meshcore-DQNtEl5I.svg";function MU(t,e){return function(){return t.apply(e,arguments)}}const{toString:dse}=Object.prototype,{getPrototypeOf:CE}=Object,{iterator:MS,toStringTag:EU}=Symbol,ES=(t=>e=>{const r=dse.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Hg=t=>(t=t.toLowerCase(),e=>ES(e)===t),LS=t=>e=>typeof e===t,{isArray:V2}=Array,N2=LS("undefined");function Q5(t){return t!==null&&!N2(t)&&t.constructor!==null&&!N2(t.constructor)&&Sm(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const LU=Hg("ArrayBuffer");function pse(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&LU(t.buffer),e}const mse=LS("string"),Sm=LS("function"),PU=LS("number"),e4=t=>t!==null&&typeof t=="object",gse=t=>t===!0||t===!1,fT=t=>{if(ES(t)!=="object")return!1;const e=CE(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(EU in t)&&!(MS in t)},vse=t=>{if(!e4(t)||Q5(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},yse=Hg("Date"),_se=Hg("File"),xse=Hg("Blob"),bse=Hg("FileList"),wse=t=>e4(t)&&Sm(t.pipe),kse=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Sm(t.append)&&((e=ES(t))==="formdata"||e==="object"&&Sm(t.toString)&&t.toString()==="[object FormData]"))},Tse=Hg("URLSearchParams"),[Sse,Cse,Ase,Mse]=["ReadableStream","Request","Response","Headers"].map(Hg),Ese=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function t4(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let c,S;if(typeof t!="object"&&(t=[t]),V2(t))for(c=0,S=t.length;c0;)if(S=r[c],e===S.toLowerCase())return S;return null}const kx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,DU=t=>!N2(t)&&t!==kx;function VM(){const{caseless:t,skipUndefined:e}=DU(this)&&this||{},r={},c=(S,H)=>{const Z=t&&IU(r,H)||H;fT(r[Z])&&fT(S)?r[Z]=VM(r[Z],S):fT(S)?r[Z]=VM({},S):V2(S)?r[Z]=S.slice():(!e||!N2(S))&&(r[Z]=S)};for(let S=0,H=arguments.length;S(t4(e,(S,H)=>{r&&Sm(S)?t[H]=MU(S,r):t[H]=S},{allOwnKeys:c}),t),Pse=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ise=(t,e,r,c)=>{t.prototype=Object.create(e.prototype,c),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Dse=(t,e,r,c)=>{let S,H,Z;const ue={};if(e=e||{},t==null)return e;do{for(S=Object.getOwnPropertyNames(t),H=S.length;H-- >0;)Z=S[H],(!c||c(Z,t,e))&&!ue[Z]&&(e[Z]=t[Z],ue[Z]=!0);t=r!==!1&&CE(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},zse=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const c=t.indexOf(e,r);return c!==-1&&c===r},Ose=t=>{if(!t)return null;if(V2(t))return t;let e=t.length;if(!PU(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Bse=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&CE(Uint8Array)),Rse=(t,e)=>{const c=(t&&t[MS]).call(t);let S;for(;(S=c.next())&&!S.done;){const H=S.value;e.call(t,H[0],H[1])}},Fse=(t,e)=>{let r;const c=[];for(;(r=t.exec(e))!==null;)c.push(r);return c},Nse=Hg("HTMLFormElement"),jse=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,c,S){return c.toUpperCase()+S}),_B=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Use=Hg("RegExp"),zU=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),c={};t4(r,(S,H)=>{let Z;(Z=e(S,H,t))!==!1&&(c[H]=Z||S)}),Object.defineProperties(t,c)},$se=t=>{zU(t,(e,r)=>{if(Sm(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const c=t[r];if(Sm(c)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Hse=(t,e)=>{const r={},c=S=>{S.forEach(H=>{r[H]=!0})};return V2(t)?c(t):c(String(t).split(e)),r},Vse=()=>{},Wse=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function qse(t){return!!(t&&Sm(t.append)&&t[EU]==="FormData"&&t[MS])}const Gse=t=>{const e=new Array(10),r=(c,S)=>{if(e4(c)){if(e.indexOf(c)>=0)return;if(Q5(c))return c;if(!("toJSON"in c)){e[S]=c;const H=V2(c)?[]:{};return t4(c,(Z,ue)=>{const be=r(Z,S+1);!N2(be)&&(H[ue]=be)}),e[S]=void 0,H}}return c};return r(t,0)},Zse=Hg("AsyncFunction"),Kse=t=>t&&(e4(t)||Sm(t))&&Sm(t.then)&&Sm(t.catch),OU=((t,e)=>t?setImmediate:e?((r,c)=>(kx.addEventListener("message",({source:S,data:H})=>{S===kx&&H===r&&c.length&&c.shift()()},!1),S=>{c.push(S),kx.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Sm(kx.postMessage)),Yse=typeof queueMicrotask<"u"?queueMicrotask.bind(kx):typeof process<"u"&&process.nextTick||OU,Xse=t=>t!=null&&Sm(t[MS]),mo={isArray:V2,isArrayBuffer:LU,isBuffer:Q5,isFormData:kse,isArrayBufferView:pse,isString:mse,isNumber:PU,isBoolean:gse,isObject:e4,isPlainObject:fT,isEmptyObject:vse,isReadableStream:Sse,isRequest:Cse,isResponse:Ase,isHeaders:Mse,isUndefined:N2,isDate:yse,isFile:_se,isBlob:xse,isRegExp:Use,isFunction:Sm,isStream:wse,isURLSearchParams:Tse,isTypedArray:Bse,isFileList:bse,forEach:t4,merge:VM,extend:Lse,trim:Ese,stripBOM:Pse,inherits:Ise,toFlatObject:Dse,kindOf:ES,kindOfTest:Hg,endsWith:zse,toArray:Ose,forEachEntry:Rse,matchAll:Fse,isHTMLForm:Nse,hasOwnProperty:_B,hasOwnProp:_B,reduceDescriptors:zU,freezeMethods:$se,toObjectSet:Hse,toCamelCase:jse,noop:Vse,toFiniteNumber:Wse,findKey:IU,global:kx,isContextDefined:DU,isSpecCompliantForm:qse,toJSONObject:Gse,isAsyncFn:Zse,isThenable:Kse,setImmediate:OU,asap:Yse,isIterable:Xse};function lc(t,e,r,c,S){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),c&&(this.request=c),S&&(this.response=S,this.status=S.status?S.status:null)}mo.inherits(lc,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:mo.toJSONObject(this.config),code:this.code,status:this.status}}});const BU=lc.prototype,RU={};["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(t=>{RU[t]={value:t}});Object.defineProperties(lc,RU);Object.defineProperty(BU,"isAxiosError",{value:!0});lc.from=(t,e,r,c,S,H)=>{const Z=Object.create(BU);mo.toFlatObject(t,Z,function(Re){return Re!==Error.prototype},Se=>Se!=="isAxiosError");const ue=t&&t.message?t.message:"Error",be=e==null&&t?t.code:e;return lc.call(Z,ue,be,r,c,S),t&&Z.cause==null&&Object.defineProperty(Z,"cause",{value:t,configurable:!0}),Z.name=t&&t.name||"Error",H&&Object.assign(Z,H),Z};const Jse=null;function WM(t){return mo.isPlainObject(t)||mo.isArray(t)}function FU(t){return mo.endsWith(t,"[]")?t.slice(0,-2):t}function xB(t,e,r){return t?t.concat(e).map(function(S,H){return S=FU(S),!r&&H?"["+S+"]":S}).join(r?".":""):e}function Qse(t){return mo.isArray(t)&&!t.some(WM)}const ele=mo.toFlatObject(mo,{},null,function(e){return/^is[A-Z]/.test(e)});function PS(t,e,r){if(!mo.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=mo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Dt,rr){return!mo.isUndefined(rr[Dt])});const c=r.metaTokens,S=r.visitor||Re,H=r.dots,Z=r.indexes,be=(r.Blob||typeof Blob<"u"&&Blob)&&mo.isSpecCompliantForm(e);if(!mo.isFunction(S))throw new TypeError("visitor must be a function");function Se(kt){if(kt===null)return"";if(mo.isDate(kt))return kt.toISOString();if(mo.isBoolean(kt))return kt.toString();if(!be&&mo.isBlob(kt))throw new lc("Blob is not supported. Use a Buffer instead.");return mo.isArrayBuffer(kt)||mo.isTypedArray(kt)?be&&typeof Blob=="function"?new Blob([kt]):Buffer.from(kt):kt}function Re(kt,Dt,rr){let Er=kt;if(kt&&!rr&&typeof kt=="object"){if(mo.endsWith(Dt,"{}"))Dt=c?Dt:Dt.slice(0,-2),kt=JSON.stringify(kt);else if(mo.isArray(kt)&&Qse(kt)||(mo.isFileList(kt)||mo.endsWith(Dt,"[]"))&&(Er=mo.toArray(kt)))return Dt=FU(Dt),Er.forEach(function(wi,ur){!(mo.isUndefined(wi)||wi===null)&&e.append(Z===!0?xB([Dt],ur,H):Z===null?Dt:Dt+"[]",Se(wi))}),!1}return WM(kt)?!0:(e.append(xB(rr,Dt,H),Se(kt)),!1)}const Xe=[],vt=Object.assign(ele,{defaultVisitor:Re,convertValue:Se,isVisitable:WM});function bt(kt,Dt){if(!mo.isUndefined(kt)){if(Xe.indexOf(kt)!==-1)throw Error("Circular reference detected in "+Dt.join("."));Xe.push(kt),mo.forEach(kt,function(Er,Fe){(!(mo.isUndefined(Er)||Er===null)&&S.call(e,Er,mo.isString(Fe)?Fe.trim():Fe,Dt,vt))===!0&&bt(Er,Dt?Dt.concat(Fe):[Fe])}),Xe.pop()}}if(!mo.isObject(t))throw new TypeError("data must be an object");return bt(t),e}function bB(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(c){return e[c]})}function AE(t,e){this._pairs=[],t&&PS(t,this,e)}const NU=AE.prototype;NU.append=function(e,r){this._pairs.push([e,r])};NU.toString=function(e){const r=e?function(c){return e.call(this,c,bB)}:bB;return this._pairs.map(function(S){return r(S[0])+"="+r(S[1])},"").join("&")};function tle(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jU(t,e,r){if(!e)return t;const c=r&&r.encode||tle;mo.isFunction(r)&&(r={serialize:r});const S=r&&r.serialize;let H;if(S?H=S(e,r):H=mo.isURLSearchParams(e)?e.toString():new AE(e,r).toString(c),H){const Z=t.indexOf("#");Z!==-1&&(t=t.slice(0,Z)),t+=(t.indexOf("?")===-1?"?":"&")+H}return t}class wB{constructor(){this.handlers=[]}use(e,r,c){return this.handlers.push({fulfilled:e,rejected:r,synchronous:c?c.synchronous:!1,runWhen:c?c.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){mo.forEach(this.handlers,function(c){c!==null&&e(c)})}}const UU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rle=typeof URLSearchParams<"u"?URLSearchParams:AE,ile=typeof FormData<"u"?FormData:null,nle=typeof Blob<"u"?Blob:null,ale={isBrowser:!0,classes:{URLSearchParams:rle,FormData:ile,Blob:nle},protocols:["http","https","file","blob","url","data"]},ME=typeof window<"u"&&typeof document<"u",qM=typeof navigator=="object"&&navigator||void 0,ole=ME&&(!qM||["ReactNative","NativeScript","NS"].indexOf(qM.product)<0),sle=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lle=ME&&window.location.href||"http://localhost",ule=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ME,hasStandardBrowserEnv:ole,hasStandardBrowserWebWorkerEnv:sle,navigator:qM,origin:lle},Symbol.toStringTag,{value:"Module"})),N0={...ule,...ale};function cle(t,e){return PS(t,new N0.classes.URLSearchParams,{visitor:function(r,c,S,H){return N0.isNode&&mo.isBuffer(r)?(this.append(c,r.toString("base64")),!1):H.defaultVisitor.apply(this,arguments)},...e})}function hle(t){return mo.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function fle(t){const e={},r=Object.keys(t);let c;const S=r.length;let H;for(c=0;c=r.length;return Z=!Z&&mo.isArray(S)?S.length:Z,be?(mo.hasOwnProp(S,Z)?S[Z]=[S[Z],c]:S[Z]=c,!ue):((!S[Z]||!mo.isObject(S[Z]))&&(S[Z]=[]),e(r,c,S[Z],H)&&mo.isArray(S[Z])&&(S[Z]=fle(S[Z])),!ue)}if(mo.isFormData(t)&&mo.isFunction(t.entries)){const r={};return mo.forEachEntry(t,(c,S)=>{e(hle(c),S,r,0)}),r}return null}function dle(t,e,r){if(mo.isString(t))try{return(e||JSON.parse)(t),mo.trim(t)}catch(c){if(c.name!=="SyntaxError")throw c}return(r||JSON.stringify)(t)}const r4={transitional:UU,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const c=r.getContentType()||"",S=c.indexOf("application/json")>-1,H=mo.isObject(e);if(H&&mo.isHTMLForm(e)&&(e=new FormData(e)),mo.isFormData(e))return S?JSON.stringify($U(e)):e;if(mo.isArrayBuffer(e)||mo.isBuffer(e)||mo.isStream(e)||mo.isFile(e)||mo.isBlob(e)||mo.isReadableStream(e))return e;if(mo.isArrayBufferView(e))return e.buffer;if(mo.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let ue;if(H){if(c.indexOf("application/x-www-form-urlencoded")>-1)return cle(e,this.formSerializer).toString();if((ue=mo.isFileList(e))||c.indexOf("multipart/form-data")>-1){const be=this.env&&this.env.FormData;return PS(ue?{"files[]":e}:e,be&&new be,this.formSerializer)}}return H||S?(r.setContentType("application/json",!1),dle(e)):e}],transformResponse:[function(e){const r=this.transitional||r4.transitional,c=r&&r.forcedJSONParsing,S=this.responseType==="json";if(mo.isResponse(e)||mo.isReadableStream(e))return e;if(e&&mo.isString(e)&&(c&&!this.responseType||S)){const Z=!(r&&r.silentJSONParsing)&&S;try{return JSON.parse(e,this.parseReviver)}catch(ue){if(Z)throw ue.name==="SyntaxError"?lc.from(ue,lc.ERR_BAD_RESPONSE,this,null,this.response):ue}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:N0.classes.FormData,Blob:N0.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mo.forEach(["delete","get","head","post","put","patch"],t=>{r4.headers[t]={}});const ple=mo.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"]),mle=t=>{const e={};let r,c,S;return t&&t.split(` -`).forEach(function(Z){S=Z.indexOf(":"),r=Z.substring(0,S).trim().toLowerCase(),c=Z.substring(S+1).trim(),!(!r||e[r]&&ple[r])&&(r==="set-cookie"?e[r]?e[r].push(c):e[r]=[c]:e[r]=e[r]?e[r]+", "+c:c)}),e},kB=Symbol("internals");function L3(t){return t&&String(t).trim().toLowerCase()}function dT(t){return t===!1||t==null?t:mo.isArray(t)?t.map(dT):String(t)}function gle(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let c;for(;c=r.exec(t);)e[c[1]]=c[2];return e}const vle=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function k7(t,e,r,c,S){if(mo.isFunction(c))return c.call(this,e,r);if(S&&(e=r),!!mo.isString(e)){if(mo.isString(c))return e.indexOf(c)!==-1;if(mo.isRegExp(c))return c.test(e)}}function yle(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,c)=>r.toUpperCase()+c)}function _le(t,e){const r=mo.toCamelCase(" "+e);["get","set","has"].forEach(c=>{Object.defineProperty(t,c+r,{value:function(S,H,Z){return this[c].call(this,e,S,H,Z)},configurable:!0})})}let Cm=class{constructor(e){e&&this.set(e)}set(e,r,c){const S=this;function H(ue,be,Se){const Re=L3(be);if(!Re)throw new Error("header name must be a non-empty string");const Xe=mo.findKey(S,Re);(!Xe||S[Xe]===void 0||Se===!0||Se===void 0&&S[Xe]!==!1)&&(S[Xe||be]=dT(ue))}const Z=(ue,be)=>mo.forEach(ue,(Se,Re)=>H(Se,Re,be));if(mo.isPlainObject(e)||e instanceof this.constructor)Z(e,r);else if(mo.isString(e)&&(e=e.trim())&&!vle(e))Z(mle(e),r);else if(mo.isObject(e)&&mo.isIterable(e)){let ue={},be,Se;for(const Re of e){if(!mo.isArray(Re))throw TypeError("Object iterator must return a key-value pair");ue[Se=Re[0]]=(be=ue[Se])?mo.isArray(be)?[...be,Re[1]]:[be,Re[1]]:Re[1]}Z(ue,r)}else e!=null&&H(r,e,c);return this}get(e,r){if(e=L3(e),e){const c=mo.findKey(this,e);if(c){const S=this[c];if(!r)return S;if(r===!0)return gle(S);if(mo.isFunction(r))return r.call(this,S,c);if(mo.isRegExp(r))return r.exec(S);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=L3(e),e){const c=mo.findKey(this,e);return!!(c&&this[c]!==void 0&&(!r||k7(this,this[c],c,r)))}return!1}delete(e,r){const c=this;let S=!1;function H(Z){if(Z=L3(Z),Z){const ue=mo.findKey(c,Z);ue&&(!r||k7(c,c[ue],ue,r))&&(delete c[ue],S=!0)}}return mo.isArray(e)?e.forEach(H):H(e),S}clear(e){const r=Object.keys(this);let c=r.length,S=!1;for(;c--;){const H=r[c];(!e||k7(this,this[H],H,e,!0))&&(delete this[H],S=!0)}return S}normalize(e){const r=this,c={};return mo.forEach(this,(S,H)=>{const Z=mo.findKey(c,H);if(Z){r[Z]=dT(S),delete r[H];return}const ue=e?yle(H):String(H).trim();ue!==H&&delete r[H],r[ue]=dT(S),c[ue]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return mo.forEach(this,(c,S)=>{c!=null&&c!==!1&&(r[S]=e&&mo.isArray(c)?c.join(", "):c)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const c=new this(e);return r.forEach(S=>c.set(S)),c}static accessor(e){const c=(this[kB]=this[kB]={accessors:{}}).accessors,S=this.prototype;function H(Z){const ue=L3(Z);c[ue]||(_le(S,Z),c[ue]=!0)}return mo.isArray(e)?e.forEach(H):H(e),this}};Cm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);mo.reduceDescriptors(Cm.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(c){this[r]=c}}});mo.freezeMethods(Cm);function T7(t,e){const r=this||r4,c=e||r,S=Cm.from(c.headers);let H=c.data;return mo.forEach(t,function(ue){H=ue.call(r,H,S.normalize(),e?e.status:void 0)}),S.normalize(),H}function HU(t){return!!(t&&t.__CANCEL__)}function W2(t,e,r){lc.call(this,t??"canceled",lc.ERR_CANCELED,e,r),this.name="CanceledError"}mo.inherits(W2,lc,{__CANCEL__:!0});function VU(t,e,r){const c=r.config.validateStatus;!r.status||!c||c(r.status)?t(r):e(new lc("Request failed with status code "+r.status,[lc.ERR_BAD_REQUEST,lc.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function xle(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ble(t,e){t=t||10;const r=new Array(t),c=new Array(t);let S=0,H=0,Z;return e=e!==void 0?e:1e3,function(be){const Se=Date.now(),Re=c[H];Z||(Z=Se),r[S]=be,c[S]=Se;let Xe=H,vt=0;for(;Xe!==S;)vt+=r[Xe++],Xe=Xe%t;if(S=(S+1)%t,S===H&&(H=(H+1)%t),Se-Z{r=Re,S=null,H&&(clearTimeout(H),H=null),t(...Se)};return[(...Se)=>{const Re=Date.now(),Xe=Re-r;Xe>=c?Z(Se,Re):(S=Se,H||(H=setTimeout(()=>{H=null,Z(S)},c-Xe)))},()=>S&&Z(S)]}const jT=(t,e,r=3)=>{let c=0;const S=ble(50,250);return wle(H=>{const Z=H.loaded,ue=H.lengthComputable?H.total:void 0,be=Z-c,Se=S(be),Re=Z<=ue;c=Z;const Xe={loaded:Z,total:ue,progress:ue?Z/ue:void 0,bytes:be,rate:Se||void 0,estimated:Se&&ue&&Re?(ue-Z)/Se:void 0,event:H,lengthComputable:ue!=null,[e?"download":"upload"]:!0};t(Xe)},r)},TB=(t,e)=>{const r=t!=null;return[c=>e[0]({lengthComputable:r,total:t,loaded:c}),e[1]]},SB=t=>(...e)=>mo.asap(()=>t(...e)),kle=N0.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,N0.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(N0.origin),N0.navigator&&/(msie|trident)/i.test(N0.navigator.userAgent)):()=>!0,Tle=N0.hasStandardBrowserEnv?{write(t,e,r,c,S,H,Z){if(typeof document>"u")return;const ue=[`${t}=${encodeURIComponent(e)}`];mo.isNumber(r)&&ue.push(`expires=${new Date(r).toUTCString()}`),mo.isString(c)&&ue.push(`path=${c}`),mo.isString(S)&&ue.push(`domain=${S}`),H===!0&&ue.push("secure"),mo.isString(Z)&&ue.push(`SameSite=${Z}`),document.cookie=ue.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Sle(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Cle(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function WU(t,e,r){let c=!Sle(e);return t&&(c||r==!1)?Cle(t,e):e}const CB=t=>t instanceof Cm?{...t}:t;function Fx(t,e){e=e||{};const r={};function c(Se,Re,Xe,vt){return mo.isPlainObject(Se)&&mo.isPlainObject(Re)?mo.merge.call({caseless:vt},Se,Re):mo.isPlainObject(Re)?mo.merge({},Re):mo.isArray(Re)?Re.slice():Re}function S(Se,Re,Xe,vt){if(mo.isUndefined(Re)){if(!mo.isUndefined(Se))return c(void 0,Se,Xe,vt)}else return c(Se,Re,Xe,vt)}function H(Se,Re){if(!mo.isUndefined(Re))return c(void 0,Re)}function Z(Se,Re){if(mo.isUndefined(Re)){if(!mo.isUndefined(Se))return c(void 0,Se)}else return c(void 0,Re)}function ue(Se,Re,Xe){if(Xe in e)return c(Se,Re);if(Xe in t)return c(void 0,Se)}const be={url:H,method:H,data:H,baseURL:Z,transformRequest:Z,transformResponse:Z,paramsSerializer:Z,timeout:Z,timeoutMessage:Z,withCredentials:Z,withXSRFToken:Z,adapter:Z,responseType:Z,xsrfCookieName:Z,xsrfHeaderName:Z,onUploadProgress:Z,onDownloadProgress:Z,decompress:Z,maxContentLength:Z,maxBodyLength:Z,beforeRedirect:Z,transport:Z,httpAgent:Z,httpsAgent:Z,cancelToken:Z,socketPath:Z,responseEncoding:Z,validateStatus:ue,headers:(Se,Re,Xe)=>S(CB(Se),CB(Re),Xe,!0)};return mo.forEach(Object.keys({...t,...e}),function(Re){const Xe=be[Re]||S,vt=Xe(t[Re],e[Re],Re);mo.isUndefined(vt)&&Xe!==ue||(r[Re]=vt)}),r}const qU=t=>{const e=Fx({},t);let{data:r,withXSRFToken:c,xsrfHeaderName:S,xsrfCookieName:H,headers:Z,auth:ue}=e;if(e.headers=Z=Cm.from(Z),e.url=jU(WU(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),ue&&Z.set("Authorization","Basic "+btoa((ue.username||"")+":"+(ue.password?unescape(encodeURIComponent(ue.password)):""))),mo.isFormData(r)){if(N0.hasStandardBrowserEnv||N0.hasStandardBrowserWebWorkerEnv)Z.setContentType(void 0);else if(mo.isFunction(r.getHeaders)){const be=r.getHeaders(),Se=["content-type","content-length"];Object.entries(be).forEach(([Re,Xe])=>{Se.includes(Re.toLowerCase())&&Z.set(Re,Xe)})}}if(N0.hasStandardBrowserEnv&&(c&&mo.isFunction(c)&&(c=c(e)),c||c!==!1&&kle(e.url))){const be=S&&H&&Tle.read(H);be&&Z.set(S,be)}return e},Ale=typeof XMLHttpRequest<"u",Mle=Ale&&function(t){return new Promise(function(r,c){const S=qU(t);let H=S.data;const Z=Cm.from(S.headers).normalize();let{responseType:ue,onUploadProgress:be,onDownloadProgress:Se}=S,Re,Xe,vt,bt,kt;function Dt(){bt&&bt(),kt&&kt(),S.cancelToken&&S.cancelToken.unsubscribe(Re),S.signal&&S.signal.removeEventListener("abort",Re)}let rr=new XMLHttpRequest;rr.open(S.method.toUpperCase(),S.url,!0),rr.timeout=S.timeout;function Er(){if(!rr)return;const wi=Cm.from("getAllResponseHeaders"in rr&&rr.getAllResponseHeaders()),Ir={data:!ue||ue==="text"||ue==="json"?rr.responseText:rr.response,status:rr.status,statusText:rr.statusText,headers:wi,config:t,request:rr};VU(function(_i){r(_i),Dt()},function(_i){c(_i),Dt()},Ir),rr=null}"onloadend"in rr?rr.onloadend=Er:rr.onreadystatechange=function(){!rr||rr.readyState!==4||rr.status===0&&!(rr.responseURL&&rr.responseURL.indexOf("file:")===0)||setTimeout(Er)},rr.onabort=function(){rr&&(c(new lc("Request aborted",lc.ECONNABORTED,t,rr)),rr=null)},rr.onerror=function(ur){const Ir=ur&&ur.message?ur.message:"Network Error",Ti=new lc(Ir,lc.ERR_NETWORK,t,rr);Ti.event=ur||null,c(Ti),rr=null},rr.ontimeout=function(){let ur=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded";const Ir=S.transitional||UU;S.timeoutErrorMessage&&(ur=S.timeoutErrorMessage),c(new lc(ur,Ir.clarifyTimeoutError?lc.ETIMEDOUT:lc.ECONNABORTED,t,rr)),rr=null},H===void 0&&Z.setContentType(null),"setRequestHeader"in rr&&mo.forEach(Z.toJSON(),function(ur,Ir){rr.setRequestHeader(Ir,ur)}),mo.isUndefined(S.withCredentials)||(rr.withCredentials=!!S.withCredentials),ue&&ue!=="json"&&(rr.responseType=S.responseType),Se&&([vt,kt]=jT(Se,!0),rr.addEventListener("progress",vt)),be&&rr.upload&&([Xe,bt]=jT(be),rr.upload.addEventListener("progress",Xe),rr.upload.addEventListener("loadend",bt)),(S.cancelToken||S.signal)&&(Re=wi=>{rr&&(c(!wi||wi.type?new W2(null,t,rr):wi),rr.abort(),rr=null)},S.cancelToken&&S.cancelToken.subscribe(Re),S.signal&&(S.signal.aborted?Re():S.signal.addEventListener("abort",Re)));const Fe=xle(S.url);if(Fe&&N0.protocols.indexOf(Fe)===-1){c(new lc("Unsupported protocol "+Fe+":",lc.ERR_BAD_REQUEST,t));return}rr.send(H||null)})},Ele=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let c=new AbortController,S;const H=function(Se){if(!S){S=!0,ue();const Re=Se instanceof Error?Se:this.reason;c.abort(Re instanceof lc?Re:new W2(Re instanceof Error?Re.message:Re))}};let Z=e&&setTimeout(()=>{Z=null,H(new lc(`timeout ${e} of ms exceeded`,lc.ETIMEDOUT))},e);const ue=()=>{t&&(Z&&clearTimeout(Z),Z=null,t.forEach(Se=>{Se.unsubscribe?Se.unsubscribe(H):Se.removeEventListener("abort",H)}),t=null)};t.forEach(Se=>Se.addEventListener("abort",H));const{signal:be}=c;return be.unsubscribe=()=>mo.asap(ue),be}},Lle=function*(t,e){let r=t.byteLength;if(r{const S=Ple(t,e);let H=0,Z,ue=be=>{Z||(Z=!0,c&&c(be))};return new ReadableStream({async pull(be){try{const{done:Se,value:Re}=await S.next();if(Se){ue(),be.close();return}let Xe=Re.byteLength;if(r){let vt=H+=Xe;r(vt)}be.enqueue(new Uint8Array(Re))}catch(Se){throw ue(Se),Se}},cancel(be){return ue(be),S.return()}},{highWaterMark:2})},MB=64*1024,{isFunction:Ik}=mo,Dle=(({Request:t,Response:e})=>({Request:t,Response:e}))(mo.global),{ReadableStream:EB,TextEncoder:LB}=mo.global,PB=(t,...e)=>{try{return!!t(...e)}catch{return!1}},zle=t=>{t=mo.merge.call({skipUndefined:!0},Dle,t);const{fetch:e,Request:r,Response:c}=t,S=e?Ik(e):typeof fetch=="function",H=Ik(r),Z=Ik(c);if(!S)return!1;const ue=S&&Ik(EB),be=S&&(typeof LB=="function"?(kt=>Dt=>kt.encode(Dt))(new LB):async kt=>new Uint8Array(await new r(kt).arrayBuffer())),Se=H&&ue&&PB(()=>{let kt=!1;const Dt=new r(N0.origin,{body:new EB,method:"POST",get duplex(){return kt=!0,"half"}}).headers.has("Content-Type");return kt&&!Dt}),Re=Z&&ue&&PB(()=>mo.isReadableStream(new c("").body)),Xe={stream:Re&&(kt=>kt.body)};S&&["text","arrayBuffer","blob","formData","stream"].forEach(kt=>{!Xe[kt]&&(Xe[kt]=(Dt,rr)=>{let Er=Dt&&Dt[kt];if(Er)return Er.call(Dt);throw new lc(`Response type '${kt}' is not supported`,lc.ERR_NOT_SUPPORT,rr)})});const vt=async kt=>{if(kt==null)return 0;if(mo.isBlob(kt))return kt.size;if(mo.isSpecCompliantForm(kt))return(await new r(N0.origin,{method:"POST",body:kt}).arrayBuffer()).byteLength;if(mo.isArrayBufferView(kt)||mo.isArrayBuffer(kt))return kt.byteLength;if(mo.isURLSearchParams(kt)&&(kt=kt+""),mo.isString(kt))return(await be(kt)).byteLength},bt=async(kt,Dt)=>{const rr=mo.toFiniteNumber(kt.getContentLength());return rr??vt(Dt)};return async kt=>{let{url:Dt,method:rr,data:Er,signal:Fe,cancelToken:wi,timeout:ur,onDownloadProgress:Ir,onUploadProgress:Ti,responseType:_i,headers:Ci,withCredentials:ii="same-origin",fetchOptions:Ji}=qU(kt),vi=e||fetch;_i=_i?(_i+"").toLowerCase():"text";let vr=Ele([Fe,wi&&wi.toAbortSignal()],ur),dr=null;const Ar=vr&&vr.unsubscribe&&(()=>{vr.unsubscribe()});let ti;try{if(Ti&&Se&&rr!=="get"&&rr!=="head"&&(ti=await bt(Ci,Er))!==0){let ka=new r(Dt,{method:"POST",body:Er,duplex:"half"}),Ta;if(mo.isFormData(Er)&&(Ta=ka.headers.get("content-type"))&&Ci.setContentType(Ta),ka.body){const[so,Yn]=TB(ti,jT(SB(Ti)));Er=AB(ka.body,MB,so,Yn)}}mo.isString(ii)||(ii=ii?"include":"omit");const Xr=H&&"credentials"in r.prototype,ei={...Ji,signal:vr,method:rr.toUpperCase(),headers:Ci.normalize().toJSON(),body:Er,duplex:"half",credentials:Xr?ii:void 0};dr=H&&new r(Dt,ei);let Di=await(H?vi(dr,Ji):vi(Dt,ei));const qn=Re&&(_i==="stream"||_i==="response");if(Re&&(Ir||qn&&Ar)){const ka={};["status","statusText","headers"].forEach(sn=>{ka[sn]=Di[sn]});const Ta=mo.toFiniteNumber(Di.headers.get("content-length")),[so,Yn]=Ir&&TB(Ta,jT(SB(Ir),!0))||[];Di=new c(AB(Di.body,MB,so,()=>{Yn&&Yn(),Ar&&Ar()}),ka)}_i=_i||"text";let Qn=await Xe[mo.findKey(Xe,_i)||"text"](Di,kt);return!qn&&Ar&&Ar(),await new Promise((ka,Ta)=>{VU(ka,Ta,{data:Qn,headers:Cm.from(Di.headers),status:Di.status,statusText:Di.statusText,config:kt,request:dr})})}catch(Xr){throw Ar&&Ar(),Xr&&Xr.name==="TypeError"&&/Load failed|fetch/i.test(Xr.message)?Object.assign(new lc("Network Error",lc.ERR_NETWORK,kt,dr),{cause:Xr.cause||Xr}):lc.from(Xr,Xr&&Xr.code,kt,dr)}}},Ole=new Map,GU=t=>{let e=t&&t.env||{};const{fetch:r,Request:c,Response:S}=e,H=[c,S,r];let Z=H.length,ue=Z,be,Se,Re=Ole;for(;ue--;)be=H[ue],Se=Re.get(be),Se===void 0&&Re.set(be,Se=ue?new Map:zle(e)),Re=Se;return Se};GU();const EE={http:Jse,xhr:Mle,fetch:{get:GU}};mo.forEach(EE,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const IB=t=>`- ${t}`,Ble=t=>mo.isFunction(t)||t===null||t===!1;function Rle(t,e){t=mo.isArray(t)?t:[t];const{length:r}=t;let c,S;const H={};for(let Z=0;Z`adapter ${be} `+(Se===!1?"is not supported by the environment":"is not available in the build"));let ue=r?Z.length>1?`since : -`+Z.map(IB).join(` -`):" "+IB(Z[0]):"as no adapter specified";throw new lc("There is no suitable adapter to dispatch the request "+ue,"ERR_NOT_SUPPORT")}return S}const ZU={getAdapter:Rle,adapters:EE};function S7(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new W2(null,t)}function DB(t){return S7(t),t.headers=Cm.from(t.headers),t.data=T7.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ZU.getAdapter(t.adapter||r4.adapter,t)(t).then(function(c){return S7(t),c.data=T7.call(t,t.transformResponse,c),c.headers=Cm.from(c.headers),c},function(c){return HU(c)||(S7(t),c&&c.response&&(c.response.data=T7.call(t,t.transformResponse,c.response),c.response.headers=Cm.from(c.response.headers))),Promise.reject(c)})}const KU="1.13.2",IS={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{IS[t]=function(c){return typeof c===t||"a"+(e<1?"n ":" ")+t}});const zB={};IS.transitional=function(e,r,c){function S(H,Z){return"[Axios v"+KU+"] Transitional option '"+H+"'"+Z+(c?". "+c:"")}return(H,Z,ue)=>{if(e===!1)throw new lc(S(Z," has been removed"+(r?" in "+r:"")),lc.ERR_DEPRECATED);return r&&!zB[Z]&&(zB[Z]=!0,console.warn(S(Z," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(H,Z,ue):!0}};IS.spelling=function(e){return(r,c)=>(console.warn(`${c} is likely a misspelling of ${e}`),!0)};function Fle(t,e,r){if(typeof t!="object")throw new lc("options must be an object",lc.ERR_BAD_OPTION_VALUE);const c=Object.keys(t);let S=c.length;for(;S-- >0;){const H=c[S],Z=e[H];if(Z){const ue=t[H],be=ue===void 0||Z(ue,H,t);if(be!==!0)throw new lc("option "+H+" must be "+be,lc.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new lc("Unknown option "+H,lc.ERR_BAD_OPTION)}}const pT={assertOptions:Fle,validators:IS},dv=pT.validators;let Ex=class{constructor(e){this.defaults=e||{},this.interceptors={request:new wB,response:new wB}}async request(e,r){try{return await this._request(e,r)}catch(c){if(c instanceof Error){let S={};Error.captureStackTrace?Error.captureStackTrace(S):S=new Error;const H=S.stack?S.stack.replace(/^.+\n/,""):"";try{c.stack?H&&!String(c.stack).endsWith(H.replace(/^.+\n.+\n/,""))&&(c.stack+=` -`+H):c.stack=H}catch{}}throw c}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Fx(this.defaults,r);const{transitional:c,paramsSerializer:S,headers:H}=r;c!==void 0&&pT.assertOptions(c,{silentJSONParsing:dv.transitional(dv.boolean),forcedJSONParsing:dv.transitional(dv.boolean),clarifyTimeoutError:dv.transitional(dv.boolean)},!1),S!=null&&(mo.isFunction(S)?r.paramsSerializer={serialize:S}:pT.assertOptions(S,{encode:dv.function,serialize:dv.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),pT.assertOptions(r,{baseUrl:dv.spelling("baseURL"),withXsrfToken:dv.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let Z=H&&mo.merge(H.common,H[r.method]);H&&mo.forEach(["delete","get","head","post","put","patch","common"],kt=>{delete H[kt]}),r.headers=Cm.concat(Z,H);const ue=[];let be=!0;this.interceptors.request.forEach(function(Dt){typeof Dt.runWhen=="function"&&Dt.runWhen(r)===!1||(be=be&&Dt.synchronous,ue.unshift(Dt.fulfilled,Dt.rejected))});const Se=[];this.interceptors.response.forEach(function(Dt){Se.push(Dt.fulfilled,Dt.rejected)});let Re,Xe=0,vt;if(!be){const kt=[DB.bind(this),void 0];for(kt.unshift(...ue),kt.push(...Se),vt=kt.length,Re=Promise.resolve(r);Xe{if(!c._listeners)return;let H=c._listeners.length;for(;H-- >0;)c._listeners[H](S);c._listeners=null}),this.promise.then=S=>{let H;const Z=new Promise(ue=>{c.subscribe(ue),H=ue}).then(S);return Z.cancel=function(){c.unsubscribe(H)},Z},e(function(H,Z,ue){c.reason||(c.reason=new W2(H,Z,ue),r(c.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=c=>{e.abort(c)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new YU(function(S){e=S}),cancel:e}}};function jle(t){return function(r){return t.apply(null,r)}}function Ule(t){return mo.isObject(t)&&t.isAxiosError===!0}const GM={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(GM).forEach(([t,e])=>{GM[e]=t});function XU(t){const e=new Ex(t),r=MU(Ex.prototype.request,e);return mo.extend(r,Ex.prototype,e,{allOwnKeys:!0}),mo.extend(r,e,null,{allOwnKeys:!0}),r.create=function(S){return XU(Fx(t,S))},r}const sd=XU(r4);sd.Axios=Ex;sd.CanceledError=W2;sd.CancelToken=Nle;sd.isCancel=HU;sd.VERSION=KU;sd.toFormData=PS;sd.AxiosError=lc;sd.Cancel=sd.CanceledError;sd.all=function(e){return Promise.all(e)};sd.spread=jle;sd.isAxiosError=Ule;sd.mergeConfig=Fx;sd.AxiosHeaders=Cm;sd.formToJSON=t=>$U(mo.isHTMLForm(t)?new FormData(t):t);sd.getAdapter=ZU.getAdapter;sd.HttpStatusCode=GM;sd.default=sd;const{Axios:rBe,AxiosError:iBe,CanceledError:nBe,isCancel:aBe,CancelToken:oBe,VERSION:sBe,all:lBe,Cancel:uBe,isAxiosError:cBe,spread:hBe,toFormData:fBe,AxiosHeaders:dBe,HttpStatusCode:pBe,formToJSON:mBe,getAdapter:gBe,mergeConfig:vBe}=sd,LE="pymc_jwt_token",OB="pymc_client_id";function JU(){let t=localStorage.getItem(OB);return t||(t=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(OB,t)),t}function Hx(){return localStorage.getItem(LE)}function ZM(t){localStorage.setItem(LE,t)}function q2(){localStorage.removeItem(LE)}function QU(){return Hx()!==null}function PE(t){try{const r=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),c=decodeURIComponent(atob(r).split("").map(S=>"%"+("00"+S.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(c)}catch{return null}}function e$(){const t=Hx();if(!t)return!0;const e=PE(t);return!e||!e.exp?!0:Date.now()>=e.exp*1e3-3e4}function t$(){const t=Hx();if(!t)return!1;const e=PE(t);if(!e||!e.exp)return!1;const r=e.exp*1e3-Date.now();return r>0&&r<3e5}function $le(){const t=Hx();if(!t)return null;const e=PE(t);return!e||!e.sub?null:e.sub}const Hle={class:"sparkline-container"},Vle={class:"text-white text-xs lg:text-sm font-semibold mb-3 lg:mb-4"},Wle={class:"flex items-end gap-2 lg:gap-4"},qle=["id","width","height","viewBox"],Gle=["id"],Zle=["stop-color"],Kle=["stop-color"],Yle=["d","fill"],Xle=["d","stroke"],Jle=["cx","cy","fill"],Qle=Uu({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},width:{default:131},height:{default:37},animate:{type:Boolean,default:!0},showChart:{type:Boolean,default:!0}},setup(t){const e=t,r=Do(()=>{if(e.data&&e.data.length>0)return e.data;const Z=typeof e.value=="number"?e.value:10,ue=20,be=Z*.3;return Array.from({length:ue},(Se,Re)=>{const Xe=Math.sin(Re/ue*Math.PI*2)*be*.5,vt=(Math.random()-.5)*be*.3;return Math.max(0,Z+Xe+vt)})}),c=Do(()=>{const Z=r.value;if(Z.length<2)return"";const ue=Math.max(...Z),be=Math.min(...Z),Se=ue-be||1,Re=e.width/(Z.length-1);let Xe="";return Z.forEach((vt,bt)=>{const kt=bt*Re,Dt=e.height-(vt-be)/Se*e.height;if(bt===0)Xe+=`M ${kt} ${Dt}`;else{const Er=((bt-1)*Re+kt)/2;Xe+=` Q ${Er} ${Dt} ${kt} ${Dt}`}}),Xe}),S=vn("");ud(()=>{S.value=c.value}),w0(()=>e.data,(Z,ue)=>{ue&&Z.length===ue.length&&!Z.some((Se,Re)=>Math.abs(Se-ue[Re])>.1)||(S.value=c.value)},{deep:!1});const H=Do(()=>`sparkline-${e.title.replace(/\s+/g,"-").toLowerCase()}`);return(Z,ue)=>(Wr(),Qr("div",Hle,[Le("p",Vle,Si(Z.title),1),Le("div",Wle,[Le("span",{class:"text-lg lg:text-[30px] font-bold leading-none value-display",style:om({color:Z.color})},[ul(Si(Z.value),1),Ene(Z.$slots,"unit",{},void 0)],4),Z.showChart?(Wr(),Qr("svg",{key:0,id:H.value,class:"mb-1 lg:mb-3 sparkline-svg",width:Z.width,height:Z.height,viewBox:`0 0 ${Z.width} ${Z.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("defs",null,[Le("linearGradient",{id:`gradient-${H.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[Le("stop",{offset:"0%","stop-color":Z.color,"stop-opacity":"0.3"},null,8,Zle),Le("stop",{offset:"100%","stop-color":Z.color,"stop-opacity":"0.1"},null,8,Kle)],8,Gle)]),Le("path",{d:`${S.value} L ${Z.width} ${Z.height} L 0 ${Z.height} Z`,fill:`url(#gradient-${H.value})`,class:"sparkline-fill"},null,8,Yle),Le("path",{d:S.value,stroke:Z.color,"stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:eo(["sparkline-path",{"animate-draw":Z.animate}])},null,10,Xle),r.value.length>0?(Wr(),Qr("circle",{key:0,cx:Z.width,cy:Z.height-(r.value[r.value.length-1]-Math.min(...r.value))/(Math.max(...r.value)-Math.min(...r.value)||1)*Z.height,r:"2",fill:Z.color,class:eo(["sparkline-dot",{"animate-pulse":Z.animate}])},null,10,Jle)):Ma("",!0)],8,qle)):Ma("",!0)])]))}}),kh=(t,e)=>{const r=t.__vccOpts||t;for(const[c,S]of e)r[c]=S;return r},Av=kh(Qle,[["__scopeId","data-v-9bdf7700"]]),i4=SS("packets",()=>{const t=vn(null),e=vn(null),r=vn([]),c=vn([]),S=vn(null),H=vn(!1),Z=vn(null),ue=vn(null),be=vn([]),Se=vn([]),Re=Do(()=>t.value!==null),Xe=Do(()=>e.value!==null),vt=Do(()=>r.value.length>0),bt=Do(()=>c.value.length>0),kt=Do(()=>S.value?.avg_noise_floor??0),Dt=Do(()=>t.value?.total_packets??0),rr=Do(()=>t.value?.avg_rssi??0),Er=Do(()=>t.value?.avg_snr??0),Fe=Do(()=>e.value?.uptime_seconds??0),wi=Do(()=>{if(!t.value?.packet_types)return[];const Xr=t.value.packet_types,ei=Xr.reduce((Di,qn)=>Di+qn.count,0);return Xr.map(Di=>({type:Di.type.toString(),count:Di.count,percentage:ei>0?Di.count/ei*100:0}))}),ur=Do(()=>{const Xr={};return r.value.forEach(ei=>{Xr[ei.type]||(Xr[ei.type]=[]),Xr[ei.type].push(ei)}),Xr});async function Ir(){try{const Xr=await zs.get("/stats");if(Xr.success&&Xr.data){e.value=Xr.data;const ei=new Date;return Se.value.push({timestamp:ei,stats:Xr.data}),Se.value.length>50&&(Se.value=Se.value.slice(-50)),Xr.data}else if(Xr&&"version"in Xr){const ei=Xr;e.value=ei;const Di=new Date;return Se.value.push({timestamp:Di,stats:ei}),Se.value.length>50&&(Se.value=Se.value.slice(-50)),ei}else throw new Error(Xr.error||"Failed to fetch system stats")}catch(Xr){throw Z.value=Xr instanceof Error?Xr.message:"Unknown error occurred",console.error("Error fetching system stats:",Xr),Xr}}async function Ti(Xr={hours:24}){try{const ei=await zs.get("/noise_floor_history",Xr);if(ei.success&&ei.data&&ei.data.history)return c.value=ei.data.history,ue.value=new Date,ei.data.history;throw new Error(ei.error||"Failed to fetch noise floor history")}catch(ei){throw Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching noise floor history:",ei),ei}}async function _i(Xr={hours:24}){try{const ei=await zs.get("/noise_floor_stats",Xr);if(ei.success&&ei.data&&ei.data.stats)return S.value=ei.data.stats,ue.value=new Date,ei.data.stats;throw new Error(ei.error||"Failed to fetch noise floor stats")}catch(ei){throw Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",ei),ei}}const Ci=Do(()=>!c.value||!Array.isArray(c.value)?[]:c.value.slice(-50).map(Xr=>Xr.noise_floor_dbm));async function ii(Xr={hours:24}){try{H.value=!0,Z.value=null;const ei=await zs.get("/packet_stats",Xr);if(ei.success&&ei.data){t.value=ei.data;const Di=new Date;be.value.push({timestamp:Di,stats:ei.data}),be.value.length>50&&(be.value=be.value.slice(-50)),ue.value=Di}else throw new Error(ei.error||"Failed to fetch packet stats")}catch(ei){Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching packet stats:",ei)}finally{H.value=!1}}async function Ji(Xr={limit:100}){try{H.value=!0,Z.value=null;const ei=await zs.get("/recent_packets",Xr);if(ei.success&&ei.data)r.value=ei.data,ue.value=new Date;else throw new Error(ei.error||"Failed to fetch recent packets")}catch(ei){Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching recent packets:",ei)}finally{H.value=!1}}async function vi(Xr){try{H.value=!0,Z.value=null;const ei=await zs.get("/filtered_packets",Xr);if(ei.success&&ei.data)return r.value=ei.data,ue.value=new Date,ei.data;throw new Error(ei.error||"Failed to fetch filtered packets")}catch(ei){throw Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching filtered packets:",ei),ei}finally{H.value=!1}}async function vr(Xr){try{H.value=!0,Z.value=null;const ei=await zs.get("/packet_by_hash",{packet_hash:Xr});if(ei.success&&ei.data)return ei.data;throw new Error(ei.error||"Packet not found")}catch(ei){throw Z.value=ei instanceof Error?ei.message:"Unknown error occurred",console.error("Error fetching packet by hash:",ei),ei}finally{H.value=!1}}const dr=Do(()=>{const Xr=be.value,ei=Se.value;return{totalPackets:Xr.map(Di=>Di.stats.total_packets),transmittedPackets:Xr.map(Di=>Di.stats.transmitted_packets),droppedPackets:Xr.map(Di=>Di.stats.dropped_packets),avgRssi:Xr.map(Di=>Di.stats.avg_rssi),uptimeHours:ei.map(Di=>Math.floor((Di.stats.uptime_seconds||0)/3600))}});async function Ar(Xr=3e4){await Promise.all([Ir(),ii(),Ji(),Ti({hours:1}),_i({hours:1})]);const ei=setInterval(async()=>{try{await Promise.all([Ir(),ii(),Ji(),Ti({hours:1}),_i({hours:1})])}catch(Di){console.error("Auto-refresh error:",Di)}},Xr);return()=>clearInterval(ei)}function ti(){t.value=null,e.value=null,r.value=[],c.value=[],S.value=null,be.value=[],Se.value=[],Z.value=null,ue.value=null,H.value=!1}return{packetStats:t,systemStats:e,recentPackets:r,noiseFloorHistory:c,noiseFloorStats:S,packetStatsHistory:be,systemStatsHistory:Se,isLoading:H,error:Z,lastUpdated:ue,hasPacketStats:Re,hasSystemStats:Xe,hasRecentPackets:vt,hasNoiseFloorData:bt,currentNoiseFloor:kt,totalPackets:Dt,averageRSSI:rr,averageSNR:Er,uptime:Fe,packetTypeBreakdown:wi,recentPacketsByType:ur,sparklineData:dr,noiseFloorSparklineData:Ci,fetchSystemStats:Ir,fetchPacketStats:ii,fetchRecentPackets:Ji,fetchFilteredPackets:vi,getPacketByHash:vr,fetchNoiseFloorHistory:Ti,fetchNoiseFloorStats:_i,startAutoRefresh:Ar,reset:ti}}),eue={class:"grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4 mb-5 stats-cards-container"},tue=Uu({name:"StatsCards",__name:"StatsCards",setup(t){const e=i4(),r=vn(null),c=vn(!1),S=Do(()=>{const ue=e.packetStats,be=e.systemStats,Se=Re=>{const Xe=Math.floor(Re/86400),vt=Math.floor(Re%86400/3600),bt=Math.floor(Re%3600/60);return Xe>0?`${Xe}d ${vt}h`:vt>0?`${vt}h ${bt}m`:`${bt}m`};return{packetsReceived:ue?.total_packets||0,packetsForwarded:ue?.transmitted_packets||0,uptimeFormatted:be?Se(be.uptime_seconds||0):"0m",uptimeHours:be?Math.floor((be.uptime_seconds||0)/3600):0,droppedPackets:ue?.dropped_packets||0,signalQuality:Math.round((ue?.avg_rssi||0)+120)}}),H=Do(()=>e.sparklineData),Z=async()=>{if(!c.value)try{c.value=!0,await Promise.all([e.fetchSystemStats(),e.fetchPacketStats({hours:24})]),await x0()}catch(ue){console.error("Error fetching stats:",ue)}finally{c.value=!1}};return ud(()=>{Z(),r.value=window.setInterval(Z,5e3)}),$g(()=>{r.value&&clearInterval(r.value)}),(ue,be)=>(Wr(),Qr("div",eue,[(Wr(),Sd(Av,{key:`rx-${S.value.packetsReceived}`,title:"RX Packets",value:S.value.packetsReceived,color:"#AAE8E8",data:H.value.totalPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"])),(Wr(),Sd(Av,{key:`fwd-${S.value.packetsForwarded}`,title:"Forward",value:S.value.packetsForwarded,color:"#FFC246",data:H.value.transmittedPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"])),(Wr(),Sd(Av,{key:`uptime-${S.value.uptimeFormatted}`,title:"Up Time",value:S.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"mobile-compact stat-card",animate:!1},null,8,["value"])),(Wr(),Sd(Av,{key:`drop-${S.value.droppedPackets}`,title:"Dropped",value:S.value.droppedPackets,color:"#FB787B",data:H.value.droppedPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"]))]))}}),rue=kh(tue,[["__scopeId","data-v-6e98c4b6"]]),iue={class:"glass-card rounded-[10px] p-4 lg:p-6"},nue={class:"h-64 lg:h-80 relative"},aue={key:0,class:"absolute inset-0 flex items-center justify-center"},oue={key:1,class:"absolute inset-0 flex items-center justify-center"},sue={class:"text-red-400 text-sm lg:text-base"},lue={key:2,class:"absolute inset-0 flex items-center justify-center"},uue={key:3,class:"h-full flex items-end justify-around gap-1 sm:gap-2 px-1 sm:px-2 lg:px-4"},cue={class:"relative w-full h-48 lg:h-64 flex flex-col justify-end"},hue={class:"text-white text-[10px] sm:text-xs font-semibold drop-shadow-lg backdrop-blur-sm bg-black/20 px-1 py-0.5 rounded-md border border-white/10"},fue={class:"mt-1 lg:mt-2 text-center w-full px-0.5"},due={class:"text-white text-[9px] sm:text-[10px] lg:text-xs font-medium leading-tight break-words"},pue={key:0,class:"mt-3 lg:mt-4 text-xs lg:text-sm text-white text-center"},mue=Uu({name:"SignalQualityChart",__name:"SignalQualityChart",setup(t){const e=vn([]),r=vn(null),c=vn(!0),S=vn(null),H=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(139, 92, 246, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(6, 182, 212, 0.8)","rgba(249, 115, 22, 0.8)","rgba(132, 204, 22, 0.8)","rgba(236, 72, 153, 0.8)","rgba(107, 114, 128, 0.8)"],Z=async()=>{try{S.value=null;const be=await zs.get("/packet_type_graph_data");if(be?.success&&be?.data){const Se=be.data;if(Se?.series){const Re=[];Se.series.forEach((Xe,vt)=>{let bt=0;Xe.data&&Array.isArray(Xe.data)&&(bt=Xe.data.reduce((kt,Dt)=>kt+(Dt[1]||0),0)),bt>0&&Re.push({name:Xe.name||`Type ${Xe.type}`,type:Xe.type,count:bt,color:H[vt%H.length]})}),Re.sort((Xe,vt)=>vt.count-Xe.count),e.value=Re,c.value=!1}else console.error("No series data found in response"),S.value="No series data in server response",c.value=!1}else console.error("Invalid API response structure:",be),S.value="Invalid response from server",c.value=!1}catch(be){console.error("Failed to fetch packet type data:",be),S.value=be instanceof Error?be.message:"Failed to load data",c.value=!1}},ue=be=>{if(e.value.length===0)return 0;const Se=Math.max(...e.value.map(Re=>Re.count));return Math.max(be/Se*100,2)};return ud(()=>{Z(),r.value=setInterval(()=>{Z()},3e4)}),$g(()=>{r.value&&clearInterval(r.value)}),(be,Se)=>(Wr(),Qr("div",iue,[Se[2]||(Se[2]=Le("h3",{class:"text-white text-lg lg:text-xl font-semibold mb-3 lg:mb-4"},"Packet Types",-1)),Se[3]||(Se[3]=Le("p",{class:"text-white text-xs lg:text-sm uppercase mb-3 lg:mb-4"},"Distribution by Type",-1)),Le("div",nue,[c.value?(Wr(),Qr("div",aue,Se[0]||(Se[0]=[Le("div",{class:"text-white text-sm lg:text-base"},"Loading packet types...",-1)]))):S.value?(Wr(),Qr("div",oue,[Le("div",sue,Si(S.value),1)])):e.value.length===0?(Wr(),Qr("div",lue,Se[1]||(Se[1]=[Le("div",{class:"text-white text-sm lg:text-base"},"No packet data available",-1)]))):(Wr(),Qr("div",uue,[(Wr(!0),Qr(js,null,au(e.value,Re=>(Wr(),Qr("div",{key:Re.type,class:"flex flex-col items-center flex-1 max-w-12 sm:max-w-16 lg:max-w-20 h-full"},[Le("div",cue,[Le("div",{class:"w-full rounded-t-[10px] transition-all duration-500 ease-out flex items-end justify-center pb-1 backdrop-blur-[50px] shadow-lg border border-white/20 hover:border-white/30",style:om({height:ue(Re.count)+"%",background:`linear-gradient(135deg, - ${Re.color} 0%, - ${Re.color.replace("0.8","0.6")} 30%, - ${Re.color.replace("0.8","0.4")} 70%, - ${Re.color.replace("0.8","0.3")} 100%), + */let Voe=()=>location.protocol+"//"+location.host;function CU(t,e){const{pathname:r,search:c,hash:S}=e,$=t.indexOf("#");if($>-1){let Z=S.includes(t.slice($))?t.slice($).length:1,ue=S.slice(Z);return ue[0]!=="/"&&(ue="/"+ue),oB(ue,"")}return oB(r,t)+c+S}function Woe(t,e,r,c){let S=[],$=[],Z=null;const ue=({state:pt})=>{const bt=CU(t,location),wt=r.value,Dt=e.value;let Zt=0;if(pt){if(r.value=bt,e.value=pt,Z&&Z===wt){Z=null;return}Zt=Dt?pt.position-Dt.position:0}else c(bt);S.forEach(Mr=>{Mr(r.value,wt,{delta:Zt,type:HM.pop,direction:Zt?Zt>0?k7.forward:k7.back:k7.unknown})})};function xe(){Z=r.value}function Se(pt){S.push(pt);const bt=()=>{const wt=S.indexOf(pt);wt>-1&&S.splice(wt,1)};return $.push(bt),bt}function Ne(){if(document.visibilityState==="hidden"){const{history:pt}=window;if(!pt.state)return;pt.replaceState(Gh({},pt.state,{scroll:M8()}),"")}}function it(){for(const pt of $)pt();$=[],window.removeEventListener("popstate",ue),window.removeEventListener("pagehide",Ne),document.removeEventListener("visibilitychange",Ne)}return window.addEventListener("popstate",ue),window.addEventListener("pagehide",Ne),document.addEventListener("visibilitychange",Ne),{pauseListeners:xe,listen:Se,destroy:it}}function hB(t,e,r,c=!1,S=!1){return{back:t,current:e,forward:r,replaced:c,position:window.history.length,scroll:S?M8():null}}function qoe(t){const{history:e,location:r}=window,c={value:CU(t,r)},S={value:e.state};S.value||$(c.value,{back:null,current:c.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function $(xe,Se,Ne){const it=t.indexOf("#"),pt=it>-1?(r.host&&document.querySelector("base")?t:t.slice(it))+xe:Voe()+t+xe;try{e[Ne?"replaceState":"pushState"](Se,"",pt),S.value=Se}catch(bt){console.error(bt),r[Ne?"replace":"assign"](pt)}}function Z(xe,Se){$(xe,Gh({},e.state,hB(S.value.back,xe,S.value.forward,!0),Se,{position:S.value.position}),!0),c.value=xe}function ue(xe,Se){const Ne=Gh({},S.value,e.state,{forward:xe,scroll:M8()});$(Ne.current,Ne,!0),$(xe,Gh({},hB(c.value,xe,null),{position:Ne.position+1},Se),!1),c.value=xe}return{location:c,state:S,push:ue,replace:Z}}function Goe(t){t=Loe(t);const e=qoe(t),r=Woe(t,e.state,e.location,e.replace);function c($,Z=!0){Z||r.pauseListeners(),history.go($)}const S=Gh({location:"",base:t,go:c,createHref:Ioe.bind(null,t)},e,r);return Object.defineProperty(S,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(S,"state",{enumerable:!0,get:()=>e.state.value}),S}let Sx=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t}({});var Dp=function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t}(Dp||{});const Zoe={type:Sx.Static,value:""},Koe=/[a-zA-Z0-9_]/;function Yoe(t){if(!t)return[[]];if(t==="/")return[[Zoe]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(bt){throw new Error(`ERR (${r})/"${Se}": ${bt}`)}let r=Dp.Static,c=r;const S=[];let $;function Z(){$&&S.push($),$=[]}let ue=0,xe,Se="",Ne="";function it(){Se&&(r===Dp.Static?$.push({type:Sx.Static,value:Se}):r===Dp.Param||r===Dp.ParamRegExp||r===Dp.ParamRegExpEnd?($.length>1&&(xe==="*"||xe==="+")&&e(`A repeatable param (${Se}) must be alone in its segment. eg: '/:ids+.`),$.push({type:Sx.Param,value:Se,regexp:Ne,repeatable:xe==="*"||xe==="+",optional:xe==="*"||xe==="?"})):e("Invalid state to consume buffer"),Se="")}function pt(){Se+=xe}for(;uee.length?e.length===1&&e[0]===im.Static+im.Segment?1:-1:0}function AU(t,e){let r=0;const c=t.score,S=e.score;for(;r0&&e[e.length-1]<0}const tse={strict:!1,end:!0,sensitive:!1};function rse(t,e,r){const c=Qoe(Yoe(t.path),r),S=Gh(c,{record:t,parent:e,children:[],alias:[]});return e&&!S.record.aliasOf==!e.record.aliasOf&&e.children.push(S),S}function ise(t,e){const r=[],c=new Map;e=aB(tse,e);function S(it){return c.get(it)}function $(it,pt,bt){const wt=!bt,Dt=mB(it);Dt.aliasOf=bt&&bt.record;const Zt=aB(e,it),Mr=[Dt];if("alias"in it){const or=typeof it.alias=="string"?[it.alias]:it.alias;for(const Cr of or)Mr.push(mB(Gh({},Dt,{components:bt?bt.record.components:Dt.components,path:Cr,aliasOf:bt?bt.record:Dt})))}let ze,ni;for(const or of Mr){const{path:Cr}=or;if(pt&&Cr[0]!=="/"){const gi=pt.record.path,Si=gi[gi.length-1]==="/"?"":"/";or.path=pt.record.path+(Cr&&Si+Cr)}if(ze=rse(or,pt,Zt),bt?bt.alias.push(ze):(ni=ni||ze,ni!==ze&&ni.alias.push(ze),wt&&it.name&&!gB(ze)&&Z(it.name)),MU(ze)&&xe(ze),Dt.children){const gi=Dt.children;for(let Si=0;Si{Z(ni)}:x5}function Z(it){if(TU(it)){const pt=c.get(it);pt&&(c.delete(it),r.splice(r.indexOf(pt),1),pt.children.forEach(Z),pt.alias.forEach(Z))}else{const pt=r.indexOf(it);pt>-1&&(r.splice(pt,1),it.record.name&&c.delete(it.record.name),it.children.forEach(Z),it.alias.forEach(Z))}}function ue(){return r}function xe(it){const pt=ose(it,r);r.splice(pt,0,it),it.record.name&&!gB(it)&&c.set(it.record.name,it)}function Se(it,pt){let bt,wt={},Dt,Zt;if("name"in it&&it.name){if(bt=c.get(it.name),!bt)throw j2(jd.MATCHER_NOT_FOUND,{location:it});Zt=bt.record.name,wt=Gh(pB(pt.params,bt.keys.filter(ni=>!ni.optional).concat(bt.parent?bt.parent.keys.filter(ni=>ni.optional):[]).map(ni=>ni.name)),it.params&&pB(it.params,bt.keys.map(ni=>ni.name))),Dt=bt.stringify(wt)}else if(it.path!=null)Dt=it.path,bt=r.find(ni=>ni.re.test(Dt)),bt&&(wt=bt.parse(Dt),Zt=bt.record.name);else{if(bt=pt.name?c.get(pt.name):r.find(ni=>ni.re.test(pt.path)),!bt)throw j2(jd.MATCHER_NOT_FOUND,{location:it,currentLocation:pt});Zt=bt.record.name,wt=Gh({},pt.params,it.params),Dt=bt.stringify(wt)}const Mr=[];let ze=bt;for(;ze;)Mr.unshift(ze.record),ze=ze.parent;return{name:Zt,path:Dt,params:wt,matched:Mr,meta:ase(Mr)}}t.forEach(it=>$(it));function Ne(){r.length=0,c.clear()}return{addRoute:$,resolve:Se,removeRoute:Z,clearRoutes:Ne,getRoutes:ue,getRecordMatcher:S}}function pB(t,e){const r={};for(const c of e)c in t&&(r[c]=t[c]);return r}function mB(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:nse(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function nse(t){const e={},r=t.props||!1;if("component"in t)e.default=r;else for(const c in t.components)e[c]=typeof r=="object"?r[c]:r;return e}function gB(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function ase(t){return t.reduce((e,r)=>Gh(e,r.meta),{})}function ose(t,e){let r=0,c=e.length;for(;r!==c;){const $=r+c>>1;AU(t,e[$])<0?c=$:r=$+1}const S=sse(t);return S&&(c=e.lastIndexOf(S,c-1)),c}function sse(t){let e=t;for(;e=e.parent;)if(MU(e)&&AU(t,e)===0)return e}function MU({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function vB(t){const e=_g(E8),r=_g(CE),c=Io(()=>{const xe=Po(t.to);return e.resolve(xe)}),S=Io(()=>{const{matched:xe}=c.value,{length:Se}=xe,Ne=xe[Se-1],it=r.matched;if(!Ne||!it.length)return-1;const pt=it.findIndex(N2.bind(null,Ne));if(pt>-1)return pt;const bt=yB(xe[Se-2]);return Se>1&&yB(Ne)===bt&&it[it.length-1].path!==bt?it.findIndex(N2.bind(null,xe[Se-2])):pt}),$=Io(()=>S.value>-1&&fse(r.params,c.value.params)),Z=Io(()=>S.value>-1&&S.value===r.matched.length-1&&kU(r.params,c.value.params));function ue(xe={}){if(hse(xe)){const Se=e[Po(t.replace)?"replace":"push"](Po(t.to)).catch(x5);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>Se),Se}return Promise.resolve()}return{route:c,href:Io(()=>c.value.href),isActive:$,isExactActive:Z,navigate:ue}}function lse(t){return t.length===1?t[0]:t}const use=Bu({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:vB,setup(t,{slots:e}){const r=m_(vB(t)),{options:c}=_g(E8),S=Io(()=>({[_B(t.activeClass,c.linkActiveClass,"router-link-active")]:r.isActive,[_B(t.exactActiveClass,c.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive}));return()=>{const $=e.default&&lse(e.default(r));return t.custom?$:TE("a",{"aria-current":r.isExactActive?t.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:S.value},$)}}}),cse=use;function hse(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function fse(t,e){for(const r in e){const c=e[r],S=t[r];if(typeof c=="string"){if(c!==S)return!1}else if(!jg(S)||S.length!==c.length||c.some(($,Z)=>$!==S[Z]))return!1}return!0}function yB(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const _B=(t,e,r)=>t??e??r,dse=Bu({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:r}){const c=_g(WM),S=Io(()=>t.route||c.value),$=_g(cB,0),Z=Io(()=>{let Se=Po($);const{matched:Ne}=S.value;let it;for(;(it=Ne[Se])&&!it.components;)Se++;return Se}),ue=Io(()=>S.value.matched[Z.value]);cT(cB,Io(()=>Z.value+1)),cT($oe,ue),cT(WM,S);const xe=fn();return Af(()=>[xe.value,ue.value,t.name],([Se,Ne,it],[pt,bt,wt])=>{Ne&&(Ne.instances[it]=Se,bt&&bt!==Ne&&Se&&Se===pt&&(Ne.leaveGuards.size||(Ne.leaveGuards=bt.leaveGuards),Ne.updateGuards.size||(Ne.updateGuards=bt.updateGuards))),Se&&Ne&&(!bt||!N2(Ne,bt)||!pt)&&(Ne.enterCallbacks[it]||[]).forEach(Dt=>Dt(Se))},{flush:"post"}),()=>{const Se=S.value,Ne=t.name,it=ue.value,pt=it&&it.components[Ne];if(!pt)return xB(r.default,{Component:pt,route:Se});const bt=it.props[Ne],wt=bt?bt===!0?Se.params:typeof bt=="function"?bt(Se):bt:null,Zt=TE(pt,Gh({},wt,e,{onVnodeUnmounted:Mr=>{Mr.component.isUnmounted&&(it.instances[Ne]=null)},ref:xe}));return xB(r.default,{Component:Zt,route:Se})||Zt}}});function xB(t,e){if(!t)return null;const r=t(e);return r.length===1?r[0]:r}const pse=dse;function mse(t){const e=ise(t.routes,t),r=t.parseQuery||joe,c=t.stringifyQuery||uB,S=t.history,$=P3(),Z=P3(),ue=P3(),xe=sne(Fy);let Se=Fy;w2&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Ne=b7.bind(null,On=>""+On),it=b7.bind(null,koe),pt=b7.bind(null,F5);function bt(On,Ra){let Xa,zo;return TU(On)?(Xa=e.getRecordMatcher(On),zo=Ra):zo=On,e.addRoute(zo,Xa)}function wt(On){const Ra=e.getRecordMatcher(On);Ra&&e.removeRoute(Ra)}function Dt(){return e.getRoutes().map(On=>On.record)}function Zt(On){return!!e.getRecordMatcher(On)}function Mr(On,Ra){if(Ra=Gh({},Ra||xe.value),typeof On=="string"){const Xi=w7(r,On,Ra.path),so=e.resolve({path:Xi.path},Ra),go=S.createHref(Xi.fullPath);return Gh(Xi,so,{params:pt(so.params),hash:F5(Xi.hash),redirectedFrom:void 0,href:go})}let Xa;if(On.path!=null)Xa=Gh({},On,{path:w7(r,On.path,Ra.path).path});else{const Xi=Gh({},On.params);for(const so in Xi)Xi[so]==null&&delete Xi[so];Xa=Gh({},On,{params:it(Xi)}),Ra.params=it(Ra.params)}const zo=e.resolve(Xa,Ra),xa=On.hash||"";zo.params=Ne(pt(zo.params));const $r=Coe(c,Gh({},On,{hash:xoe(xa),path:zo.path})),Mi=S.createHref($r);return Gh({fullPath:$r,hash:xa,query:c===uB?Uoe(On.query):On.query||{}},zo,{redirectedFrom:void 0,href:Mi})}function ze(On){return typeof On=="string"?w7(r,On,xe.value.path):Gh({},On)}function ni(On,Ra){if(Se!==On)return j2(jd.NAVIGATION_CANCELLED,{from:Ra,to:On})}function or(On){return Si(On)}function Cr(On){return or(Gh(ze(On),{replace:!0}))}function gi(On,Ra){const Xa=On.matched[On.matched.length-1];if(Xa&&Xa.redirect){const{redirect:zo}=Xa;let xa=typeof zo=="function"?zo(On,Ra):zo;return typeof xa=="string"&&(xa=xa.includes("?")||xa.includes("#")?xa=ze(xa):{path:xa},xa.params={}),Gh({query:On.query,hash:On.hash,params:xa.path!=null?{}:On.params},xa)}}function Si(On,Ra){const Xa=Se=Mr(On),zo=xe.value,xa=On.state,$r=On.force,Mi=On.replace===!0,Xi=gi(Xa,zo);if(Xi)return Si(Gh(ze(Xi),{state:typeof Xi=="object"?Gh({},xa,Xi.state):xa,force:$r,replace:Mi}),Ra||Xa);const so=Xa;so.redirectedFrom=Ra;let go;return!$r&&Aoe(c,zo,Xa)&&(go=j2(jd.NAVIGATION_DUPLICATED,{to:so,from:zo}),ga(zo,zo,!0,!1)),(go?Promise.resolve(go):on(so,zo)).catch(ko=>m1(ko)?m1(ko,jd.NAVIGATION_GUARD_REDIRECT)?ko:Zn(ko):Di(ko,so,zo)).then(ko=>{if(ko){if(m1(ko,jd.NAVIGATION_GUARD_REDIRECT))return Si(Gh({replace:Mi},ze(ko.to),{state:typeof ko.to=="object"?Gh({},xa,ko.to.state):xa,force:$r}),Ra||so)}else ko=gr(so,zo,!0,Mi,xa);return yi(so,zo,ko),ko})}function Ci(On,Ra){const Xa=ni(On,Ra);return Xa?Promise.reject(Xa):Promise.resolve()}function ri(On){const Ra=qn.values().next().value;return Ra&&typeof Ra.runWithContext=="function"?Ra.runWithContext(On):On()}function on(On,Ra){let Xa;const[zo,xa,$r]=Hoe(On,Ra);Xa=T7(zo.reverse(),"beforeRouteLeave",On,Ra);for(const Xi of zo)Xi.leaveGuards.forEach(so=>{Xa.push(t_(so,On,Ra))});const Mi=Ci.bind(null,On,Ra);return Xa.push(Mi),nn(Xa).then(()=>{Xa=[];for(const Xi of $.list())Xa.push(t_(Xi,On,Ra));return Xa.push(Mi),nn(Xa)}).then(()=>{Xa=T7(xa,"beforeRouteUpdate",On,Ra);for(const Xi of xa)Xi.updateGuards.forEach(so=>{Xa.push(t_(so,On,Ra))});return Xa.push(Mi),nn(Xa)}).then(()=>{Xa=[];for(const Xi of $r)if(Xi.beforeEnter)if(jg(Xi.beforeEnter))for(const so of Xi.beforeEnter)Xa.push(t_(so,On,Ra));else Xa.push(t_(Xi.beforeEnter,On,Ra));return Xa.push(Mi),nn(Xa)}).then(()=>(On.matched.forEach(Xi=>Xi.enterCallbacks={}),Xa=T7($r,"beforeRouteEnter",On,Ra,ri),Xa.push(Mi),nn(Xa))).then(()=>{Xa=[];for(const Xi of Z.list())Xa.push(t_(Xi,On,Ra));return Xa.push(Mi),nn(Xa)}).catch(Xi=>m1(Xi,jd.NAVIGATION_CANCELLED)?Xi:Promise.reject(Xi))}function yi(On,Ra,Xa){ue.list().forEach(zo=>ri(()=>zo(On,Ra,Xa)))}function gr(On,Ra,Xa,zo,xa){const $r=ni(On,Ra);if($r)return $r;const Mi=Ra===Fy,Xi=w2?history.state:{};Xa&&(zo||Mi?S.replace(On.fullPath,Gh({scroll:Mi&&Xi&&Xi.scroll},xa)):S.push(On.fullPath,xa)),xe.value=On,ga(On,Ra,Xa,Mi),Zn()}let fr;function Sr(){fr||(fr=S.listen((On,Ra,Xa)=>{if(!ln.listening)return;const zo=Mr(On),xa=gi(zo,ln.currentRoute.value);if(xa){Si(Gh(xa,{replace:!0,force:!0}),zo).catch(x5);return}Se=zo;const $r=xe.value;w2&&Ooe(lB($r.fullPath,Xa.delta),M8()),on(zo,$r).catch(Mi=>m1(Mi,jd.NAVIGATION_ABORTED|jd.NAVIGATION_CANCELLED)?Mi:m1(Mi,jd.NAVIGATION_GUARD_REDIRECT)?(Si(Gh(ze(Mi.to),{force:!0}),zo).then(Xi=>{m1(Xi,jd.NAVIGATION_ABORTED|jd.NAVIGATION_DUPLICATED)&&!Xa.delta&&Xa.type===HM.pop&&S.go(-1,!1)}).catch(x5),Promise.reject()):(Xa.delta&&S.go(-Xa.delta,!1),Di(Mi,zo,$r))).then(Mi=>{Mi=Mi||gr(zo,$r,!1),Mi&&(Xa.delta&&!m1(Mi,jd.NAVIGATION_CANCELLED)?S.go(-Xa.delta,!1):Xa.type===HM.pop&&m1(Mi,jd.NAVIGATION_ABORTED|jd.NAVIGATION_DUPLICATED)&&S.go(-1,!1)),yi(zo,$r,Mi)}).catch(x5)}))}let ei=P3(),Jr=P3(),ti;function Di(On,Ra,Xa){Zn(On);const zo=Jr.list();return zo.length?zo.forEach(xa=>xa(On,Ra,Xa)):console.error(On),Promise.reject(On)}function En(){return ti&&xe.value!==Fy?Promise.resolve():new Promise((On,Ra)=>{ei.add([On,Ra])})}function Zn(On){return ti||(ti=!On,Sr(),ei.list().forEach(([Ra,Xa])=>On?Xa(On):Ra()),ei.reset()),On}function ga(On,Ra,Xa,zo){const{scrollBehavior:xa}=t;if(!w2||!xa)return Promise.resolve();const $r=!Xa&&Boe(lB(On.fullPath,0))||(zo||!Xa)&&history.state&&history.state.scroll||null;return b0().then(()=>xa(On,Ra,$r)).then(Mi=>Mi&&zoe(Mi)).catch(Mi=>Di(Mi,On,Ra))}const ya=On=>S.go(On);let ro;const qn=new Set,ln={currentRoute:xe,listening:!0,addRoute:bt,removeRoute:wt,clearRoutes:e.clearRoutes,hasRoute:Zt,getRoutes:Dt,resolve:Mr,options:t,push:or,replace:Cr,go:ya,back:()=>ya(-1),forward:()=>ya(1),beforeEach:$.add,beforeResolve:Z.add,afterEach:ue.add,onError:Jr.add,isReady:En,install(On){On.component("RouterLink",cse),On.component("RouterView",pse),On.config.globalProperties.$router=ln,Object.defineProperty(On.config.globalProperties,"$route",{enumerable:!0,get:()=>Po(xe)}),w2&&!ro&&xe.value===Fy&&(ro=!0,or(S.location).catch(zo=>{}));const Ra={};for(const zo in Fy)Object.defineProperty(Ra,zo,{get:()=>xe.value[zo],enumerable:!0});On.provide(E8,ln),On.provide(CE,pj(Ra)),On.provide(WM,xe);const Xa=On.unmount;qn.add(On),On.unmount=function(){qn.delete(On),qn.size<1&&(Se=Fy,fr&&fr(),fr=null,xe.value=Fy,ro=!1,ti=!1),Xa()}}};function nn(On){return On.reduce((Ra,Xa)=>Ra.then(()=>ri(Xa)),Promise.resolve())}return ln}function e4(){return _g(E8)}function AE(t){return _g(CE)}const EU="/assets/meshcore-DQNtEl5I.svg";function LU(t,e){return function(){return t.apply(e,arguments)}}const{toString:gse}=Object.prototype,{getPrototypeOf:ME}=Object,{iterator:L8,toStringTag:PU}=Symbol,P8=(t=>e=>{const r=gse.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Hg=t=>(t=t.toLowerCase(),e=>P8(e)===t),I8=t=>e=>typeof e===t,{isArray:q2}=Array,U2=I8("undefined");function t4(t){return t!==null&&!U2(t)&&t.constructor!==null&&!U2(t.constructor)&&Sm(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const IU=Hg("ArrayBuffer");function vse(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&IU(t.buffer),e}const yse=I8("string"),Sm=I8("function"),DU=I8("number"),r4=t=>t!==null&&typeof t=="object",_se=t=>t===!0||t===!1,pT=t=>{if(P8(t)!=="object")return!1;const e=ME(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(PU in t)&&!(L8 in t)},xse=t=>{if(!r4(t)||t4(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},bse=Hg("Date"),wse=Hg("File"),kse=Hg("Blob"),Tse=Hg("FileList"),Sse=t=>r4(t)&&Sm(t.pipe),Cse=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Sm(t.append)&&((e=P8(t))==="formdata"||e==="object"&&Sm(t.toString)&&t.toString()==="[object FormData]"))},Ase=Hg("URLSearchParams"),[Mse,Ese,Lse,Pse]=["ReadableStream","Request","Response","Headers"].map(Hg),Ise=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function i4(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let c,S;if(typeof t!="object"&&(t=[t]),q2(t))for(c=0,S=t.length;c0;)if(S=r[c],e===S.toLowerCase())return S;return null}const Cx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,OU=t=>!U2(t)&&t!==Cx;function qM(){const{caseless:t,skipUndefined:e}=OU(this)&&this||{},r={},c=(S,$)=>{const Z=t&&zU(r,$)||$;pT(r[Z])&&pT(S)?r[Z]=qM(r[Z],S):pT(S)?r[Z]=qM({},S):q2(S)?r[Z]=S.slice():(!e||!U2(S))&&(r[Z]=S)};for(let S=0,$=arguments.length;S<$;S++)arguments[S]&&i4(arguments[S],c);return r}const Dse=(t,e,r,{allOwnKeys:c}={})=>(i4(e,(S,$)=>{r&&Sm(S)?t[$]=LU(S,r):t[$]=S},{allOwnKeys:c}),t),zse=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ose=(t,e,r,c)=>{t.prototype=Object.create(e.prototype,c),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Bse=(t,e,r,c)=>{let S,$,Z;const ue={};if(e=e||{},t==null)return e;do{for(S=Object.getOwnPropertyNames(t),$=S.length;$-- >0;)Z=S[$],(!c||c(Z,t,e))&&!ue[Z]&&(e[Z]=t[Z],ue[Z]=!0);t=r!==!1&&ME(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Rse=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const c=t.indexOf(e,r);return c!==-1&&c===r},Fse=t=>{if(!t)return null;if(q2(t))return t;let e=t.length;if(!DU(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Nse=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ME(Uint8Array)),jse=(t,e)=>{const c=(t&&t[L8]).call(t);let S;for(;(S=c.next())&&!S.done;){const $=S.value;e.call(t,$[0],$[1])}},Use=(t,e)=>{let r;const c=[];for(;(r=t.exec(e))!==null;)c.push(r);return c},$se=Hg("HTMLFormElement"),Hse=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,c,S){return c.toUpperCase()+S}),bB=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Vse=Hg("RegExp"),BU=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),c={};i4(r,(S,$)=>{let Z;(Z=e(S,$,t))!==!1&&(c[$]=Z||S)}),Object.defineProperties(t,c)},Wse=t=>{BU(t,(e,r)=>{if(Sm(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const c=t[r];if(Sm(c)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},qse=(t,e)=>{const r={},c=S=>{S.forEach($=>{r[$]=!0})};return q2(t)?c(t):c(String(t).split(e)),r},Gse=()=>{},Zse=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Kse(t){return!!(t&&Sm(t.append)&&t[PU]==="FormData"&&t[L8])}const Yse=t=>{const e=new Array(10),r=(c,S)=>{if(r4(c)){if(e.indexOf(c)>=0)return;if(t4(c))return c;if(!("toJSON"in c)){e[S]=c;const $=q2(c)?[]:{};return i4(c,(Z,ue)=>{const xe=r(Z,S+1);!U2(xe)&&($[ue]=xe)}),e[S]=void 0,$}}return c};return r(t,0)},Xse=Hg("AsyncFunction"),Jse=t=>t&&(r4(t)||Sm(t))&&Sm(t.then)&&Sm(t.catch),RU=((t,e)=>t?setImmediate:e?((r,c)=>(Cx.addEventListener("message",({source:S,data:$})=>{S===Cx&&$===r&&c.length&&c.shift()()},!1),S=>{c.push(S),Cx.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Sm(Cx.postMessage)),Qse=typeof queueMicrotask<"u"?queueMicrotask.bind(Cx):typeof process<"u"&&process.nextTick||RU,ele=t=>t!=null&&Sm(t[L8]),mo={isArray:q2,isArrayBuffer:IU,isBuffer:t4,isFormData:Cse,isArrayBufferView:vse,isString:yse,isNumber:DU,isBoolean:_se,isObject:r4,isPlainObject:pT,isEmptyObject:xse,isReadableStream:Mse,isRequest:Ese,isResponse:Lse,isHeaders:Pse,isUndefined:U2,isDate:bse,isFile:wse,isBlob:kse,isRegExp:Vse,isFunction:Sm,isStream:Sse,isURLSearchParams:Ase,isTypedArray:Nse,isFileList:Tse,forEach:i4,merge:qM,extend:Dse,trim:Ise,stripBOM:zse,inherits:Ose,toFlatObject:Bse,kindOf:P8,kindOfTest:Hg,endsWith:Rse,toArray:Fse,forEachEntry:jse,matchAll:Use,isHTMLForm:$se,hasOwnProperty:bB,hasOwnProp:bB,reduceDescriptors:BU,freezeMethods:Wse,toObjectSet:qse,toCamelCase:Hse,noop:Gse,toFiniteNumber:Zse,findKey:zU,global:Cx,isContextDefined:OU,isSpecCompliantForm:Kse,toJSONObject:Yse,isAsyncFn:Xse,isThenable:Jse,setImmediate:RU,asap:Qse,isIterable:ele};function lc(t,e,r,c,S){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),c&&(this.request=c),S&&(this.response=S,this.status=S.status?S.status:null)}mo.inherits(lc,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:mo.toJSONObject(this.config),code:this.code,status:this.status}}});const FU=lc.prototype,NU={};["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(t=>{NU[t]={value:t}});Object.defineProperties(lc,NU);Object.defineProperty(FU,"isAxiosError",{value:!0});lc.from=(t,e,r,c,S,$)=>{const Z=Object.create(FU);mo.toFlatObject(t,Z,function(Ne){return Ne!==Error.prototype},Se=>Se!=="isAxiosError");const ue=t&&t.message?t.message:"Error",xe=e==null&&t?t.code:e;return lc.call(Z,ue,xe,r,c,S),t&&Z.cause==null&&Object.defineProperty(Z,"cause",{value:t,configurable:!0}),Z.name=t&&t.name||"Error",$&&Object.assign(Z,$),Z};const tle=null;function GM(t){return mo.isPlainObject(t)||mo.isArray(t)}function jU(t){return mo.endsWith(t,"[]")?t.slice(0,-2):t}function wB(t,e,r){return t?t.concat(e).map(function(S,$){return S=jU(S),!r&&$?"["+S+"]":S}).join(r?".":""):e}function rle(t){return mo.isArray(t)&&!t.some(GM)}const ile=mo.toFlatObject(mo,{},null,function(e){return/^is[A-Z]/.test(e)});function D8(t,e,r){if(!mo.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=mo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Dt,Zt){return!mo.isUndefined(Zt[Dt])});const c=r.metaTokens,S=r.visitor||Ne,$=r.dots,Z=r.indexes,xe=(r.Blob||typeof Blob<"u"&&Blob)&&mo.isSpecCompliantForm(e);if(!mo.isFunction(S))throw new TypeError("visitor must be a function");function Se(wt){if(wt===null)return"";if(mo.isDate(wt))return wt.toISOString();if(mo.isBoolean(wt))return wt.toString();if(!xe&&mo.isBlob(wt))throw new lc("Blob is not supported. Use a Buffer instead.");return mo.isArrayBuffer(wt)||mo.isTypedArray(wt)?xe&&typeof Blob=="function"?new Blob([wt]):Buffer.from(wt):wt}function Ne(wt,Dt,Zt){let Mr=wt;if(wt&&!Zt&&typeof wt=="object"){if(mo.endsWith(Dt,"{}"))Dt=c?Dt:Dt.slice(0,-2),wt=JSON.stringify(wt);else if(mo.isArray(wt)&&rle(wt)||(mo.isFileList(wt)||mo.endsWith(Dt,"[]"))&&(Mr=mo.toArray(wt)))return Dt=jU(Dt),Mr.forEach(function(ni,or){!(mo.isUndefined(ni)||ni===null)&&e.append(Z===!0?wB([Dt],or,$):Z===null?Dt:Dt+"[]",Se(ni))}),!1}return GM(wt)?!0:(e.append(wB(Zt,Dt,$),Se(wt)),!1)}const it=[],pt=Object.assign(ile,{defaultVisitor:Ne,convertValue:Se,isVisitable:GM});function bt(wt,Dt){if(!mo.isUndefined(wt)){if(it.indexOf(wt)!==-1)throw Error("Circular reference detected in "+Dt.join("."));it.push(wt),mo.forEach(wt,function(Mr,ze){(!(mo.isUndefined(Mr)||Mr===null)&&S.call(e,Mr,mo.isString(ze)?ze.trim():ze,Dt,pt))===!0&&bt(Mr,Dt?Dt.concat(ze):[ze])}),it.pop()}}if(!mo.isObject(t))throw new TypeError("data must be an object");return bt(t),e}function kB(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(c){return e[c]})}function EE(t,e){this._pairs=[],t&&D8(t,this,e)}const UU=EE.prototype;UU.append=function(e,r){this._pairs.push([e,r])};UU.toString=function(e){const r=e?function(c){return e.call(this,c,kB)}:kB;return this._pairs.map(function(S){return r(S[0])+"="+r(S[1])},"").join("&")};function nle(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $U(t,e,r){if(!e)return t;const c=r&&r.encode||nle;mo.isFunction(r)&&(r={serialize:r});const S=r&&r.serialize;let $;if(S?$=S(e,r):$=mo.isURLSearchParams(e)?e.toString():new EE(e,r).toString(c),$){const Z=t.indexOf("#");Z!==-1&&(t=t.slice(0,Z)),t+=(t.indexOf("?")===-1?"?":"&")+$}return t}class TB{constructor(){this.handlers=[]}use(e,r,c){return this.handlers.push({fulfilled:e,rejected:r,synchronous:c?c.synchronous:!1,runWhen:c?c.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){mo.forEach(this.handlers,function(c){c!==null&&e(c)})}}const HU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ale=typeof URLSearchParams<"u"?URLSearchParams:EE,ole=typeof FormData<"u"?FormData:null,sle=typeof Blob<"u"?Blob:null,lle={isBrowser:!0,classes:{URLSearchParams:ale,FormData:ole,Blob:sle},protocols:["http","https","file","blob","url","data"]},LE=typeof window<"u"&&typeof document<"u",ZM=typeof navigator=="object"&&navigator||void 0,ule=LE&&(!ZM||["ReactNative","NativeScript","NS"].indexOf(ZM.product)<0),cle=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hle=LE&&window.location.href||"http://localhost",fle=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:LE,hasStandardBrowserEnv:ule,hasStandardBrowserWebWorkerEnv:cle,navigator:ZM,origin:hle},Symbol.toStringTag,{value:"Module"})),N0={...fle,...lle};function dle(t,e){return D8(t,new N0.classes.URLSearchParams,{visitor:function(r,c,S,$){return N0.isNode&&mo.isBuffer(r)?(this.append(c,r.toString("base64")),!1):$.defaultVisitor.apply(this,arguments)},...e})}function ple(t){return mo.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function mle(t){const e={},r=Object.keys(t);let c;const S=r.length;let $;for(c=0;c=r.length;return Z=!Z&&mo.isArray(S)?S.length:Z,xe?(mo.hasOwnProp(S,Z)?S[Z]=[S[Z],c]:S[Z]=c,!ue):((!S[Z]||!mo.isObject(S[Z]))&&(S[Z]=[]),e(r,c,S[Z],$)&&mo.isArray(S[Z])&&(S[Z]=mle(S[Z])),!ue)}if(mo.isFormData(t)&&mo.isFunction(t.entries)){const r={};return mo.forEachEntry(t,(c,S)=>{e(ple(c),S,r,0)}),r}return null}function gle(t,e,r){if(mo.isString(t))try{return(e||JSON.parse)(t),mo.trim(t)}catch(c){if(c.name!=="SyntaxError")throw c}return(r||JSON.stringify)(t)}const n4={transitional:HU,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const c=r.getContentType()||"",S=c.indexOf("application/json")>-1,$=mo.isObject(e);if($&&mo.isHTMLForm(e)&&(e=new FormData(e)),mo.isFormData(e))return S?JSON.stringify(VU(e)):e;if(mo.isArrayBuffer(e)||mo.isBuffer(e)||mo.isStream(e)||mo.isFile(e)||mo.isBlob(e)||mo.isReadableStream(e))return e;if(mo.isArrayBufferView(e))return e.buffer;if(mo.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let ue;if($){if(c.indexOf("application/x-www-form-urlencoded")>-1)return dle(e,this.formSerializer).toString();if((ue=mo.isFileList(e))||c.indexOf("multipart/form-data")>-1){const xe=this.env&&this.env.FormData;return D8(ue?{"files[]":e}:e,xe&&new xe,this.formSerializer)}}return $||S?(r.setContentType("application/json",!1),gle(e)):e}],transformResponse:[function(e){const r=this.transitional||n4.transitional,c=r&&r.forcedJSONParsing,S=this.responseType==="json";if(mo.isResponse(e)||mo.isReadableStream(e))return e;if(e&&mo.isString(e)&&(c&&!this.responseType||S)){const Z=!(r&&r.silentJSONParsing)&&S;try{return JSON.parse(e,this.parseReviver)}catch(ue){if(Z)throw ue.name==="SyntaxError"?lc.from(ue,lc.ERR_BAD_RESPONSE,this,null,this.response):ue}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:N0.classes.FormData,Blob:N0.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};mo.forEach(["delete","get","head","post","put","patch"],t=>{n4.headers[t]={}});const vle=mo.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"]),yle=t=>{const e={};let r,c,S;return t&&t.split(` +`).forEach(function(Z){S=Z.indexOf(":"),r=Z.substring(0,S).trim().toLowerCase(),c=Z.substring(S+1).trim(),!(!r||e[r]&&vle[r])&&(r==="set-cookie"?e[r]?e[r].push(c):e[r]=[c]:e[r]=e[r]?e[r]+", "+c:c)}),e},SB=Symbol("internals");function I3(t){return t&&String(t).trim().toLowerCase()}function mT(t){return t===!1||t==null?t:mo.isArray(t)?t.map(mT):String(t)}function _le(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let c;for(;c=r.exec(t);)e[c[1]]=c[2];return e}const xle=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function S7(t,e,r,c,S){if(mo.isFunction(c))return c.call(this,e,r);if(S&&(e=r),!!mo.isString(e)){if(mo.isString(c))return e.indexOf(c)!==-1;if(mo.isRegExp(c))return c.test(e)}}function ble(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,c)=>r.toUpperCase()+c)}function wle(t,e){const r=mo.toCamelCase(" "+e);["get","set","has"].forEach(c=>{Object.defineProperty(t,c+r,{value:function(S,$,Z){return this[c].call(this,e,S,$,Z)},configurable:!0})})}let Cm=class{constructor(e){e&&this.set(e)}set(e,r,c){const S=this;function $(ue,xe,Se){const Ne=I3(xe);if(!Ne)throw new Error("header name must be a non-empty string");const it=mo.findKey(S,Ne);(!it||S[it]===void 0||Se===!0||Se===void 0&&S[it]!==!1)&&(S[it||xe]=mT(ue))}const Z=(ue,xe)=>mo.forEach(ue,(Se,Ne)=>$(Se,Ne,xe));if(mo.isPlainObject(e)||e instanceof this.constructor)Z(e,r);else if(mo.isString(e)&&(e=e.trim())&&!xle(e))Z(yle(e),r);else if(mo.isObject(e)&&mo.isIterable(e)){let ue={},xe,Se;for(const Ne of e){if(!mo.isArray(Ne))throw TypeError("Object iterator must return a key-value pair");ue[Se=Ne[0]]=(xe=ue[Se])?mo.isArray(xe)?[...xe,Ne[1]]:[xe,Ne[1]]:Ne[1]}Z(ue,r)}else e!=null&&$(r,e,c);return this}get(e,r){if(e=I3(e),e){const c=mo.findKey(this,e);if(c){const S=this[c];if(!r)return S;if(r===!0)return _le(S);if(mo.isFunction(r))return r.call(this,S,c);if(mo.isRegExp(r))return r.exec(S);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=I3(e),e){const c=mo.findKey(this,e);return!!(c&&this[c]!==void 0&&(!r||S7(this,this[c],c,r)))}return!1}delete(e,r){const c=this;let S=!1;function $(Z){if(Z=I3(Z),Z){const ue=mo.findKey(c,Z);ue&&(!r||S7(c,c[ue],ue,r))&&(delete c[ue],S=!0)}}return mo.isArray(e)?e.forEach($):$(e),S}clear(e){const r=Object.keys(this);let c=r.length,S=!1;for(;c--;){const $=r[c];(!e||S7(this,this[$],$,e,!0))&&(delete this[$],S=!0)}return S}normalize(e){const r=this,c={};return mo.forEach(this,(S,$)=>{const Z=mo.findKey(c,$);if(Z){r[Z]=mT(S),delete r[$];return}const ue=e?ble($):String($).trim();ue!==$&&delete r[$],r[ue]=mT(S),c[ue]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return mo.forEach(this,(c,S)=>{c!=null&&c!==!1&&(r[S]=e&&mo.isArray(c)?c.join(", "):c)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const c=new this(e);return r.forEach(S=>c.set(S)),c}static accessor(e){const c=(this[SB]=this[SB]={accessors:{}}).accessors,S=this.prototype;function $(Z){const ue=I3(Z);c[ue]||(wle(S,Z),c[ue]=!0)}return mo.isArray(e)?e.forEach($):$(e),this}};Cm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);mo.reduceDescriptors(Cm.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(c){this[r]=c}}});mo.freezeMethods(Cm);function C7(t,e){const r=this||n4,c=e||r,S=Cm.from(c.headers);let $=c.data;return mo.forEach(t,function(ue){$=ue.call(r,$,S.normalize(),e?e.status:void 0)}),S.normalize(),$}function WU(t){return!!(t&&t.__CANCEL__)}function G2(t,e,r){lc.call(this,t??"canceled",lc.ERR_CANCELED,e,r),this.name="CanceledError"}mo.inherits(G2,lc,{__CANCEL__:!0});function qU(t,e,r){const c=r.config.validateStatus;!r.status||!c||c(r.status)?t(r):e(new lc("Request failed with status code "+r.status,[lc.ERR_BAD_REQUEST,lc.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function kle(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Tle(t,e){t=t||10;const r=new Array(t),c=new Array(t);let S=0,$=0,Z;return e=e!==void 0?e:1e3,function(xe){const Se=Date.now(),Ne=c[$];Z||(Z=Se),r[S]=xe,c[S]=Se;let it=$,pt=0;for(;it!==S;)pt+=r[it++],it=it%t;if(S=(S+1)%t,S===$&&($=($+1)%t),Se-Z{r=Ne,S=null,$&&(clearTimeout($),$=null),t(...Se)};return[(...Se)=>{const Ne=Date.now(),it=Ne-r;it>=c?Z(Se,Ne):(S=Se,$||($=setTimeout(()=>{$=null,Z(S)},c-it)))},()=>S&&Z(S)]}const $T=(t,e,r=3)=>{let c=0;const S=Tle(50,250);return Sle($=>{const Z=$.loaded,ue=$.lengthComputable?$.total:void 0,xe=Z-c,Se=S(xe),Ne=Z<=ue;c=Z;const it={loaded:Z,total:ue,progress:ue?Z/ue:void 0,bytes:xe,rate:Se||void 0,estimated:Se&&ue&&Ne?(ue-Z)/Se:void 0,event:$,lengthComputable:ue!=null,[e?"download":"upload"]:!0};t(it)},r)},CB=(t,e)=>{const r=t!=null;return[c=>e[0]({lengthComputable:r,total:t,loaded:c}),e[1]]},AB=t=>(...e)=>mo.asap(()=>t(...e)),Cle=N0.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,N0.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(N0.origin),N0.navigator&&/(msie|trident)/i.test(N0.navigator.userAgent)):()=>!0,Ale=N0.hasStandardBrowserEnv?{write(t,e,r,c,S,$,Z){if(typeof document>"u")return;const ue=[`${t}=${encodeURIComponent(e)}`];mo.isNumber(r)&&ue.push(`expires=${new Date(r).toUTCString()}`),mo.isString(c)&&ue.push(`path=${c}`),mo.isString(S)&&ue.push(`domain=${S}`),$===!0&&ue.push("secure"),mo.isString(Z)&&ue.push(`SameSite=${Z}`),document.cookie=ue.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Mle(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ele(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function GU(t,e,r){let c=!Mle(e);return t&&(c||r==!1)?Ele(t,e):e}const MB=t=>t instanceof Cm?{...t}:t;function Nx(t,e){e=e||{};const r={};function c(Se,Ne,it,pt){return mo.isPlainObject(Se)&&mo.isPlainObject(Ne)?mo.merge.call({caseless:pt},Se,Ne):mo.isPlainObject(Ne)?mo.merge({},Ne):mo.isArray(Ne)?Ne.slice():Ne}function S(Se,Ne,it,pt){if(mo.isUndefined(Ne)){if(!mo.isUndefined(Se))return c(void 0,Se,it,pt)}else return c(Se,Ne,it,pt)}function $(Se,Ne){if(!mo.isUndefined(Ne))return c(void 0,Ne)}function Z(Se,Ne){if(mo.isUndefined(Ne)){if(!mo.isUndefined(Se))return c(void 0,Se)}else return c(void 0,Ne)}function ue(Se,Ne,it){if(it in e)return c(Se,Ne);if(it in t)return c(void 0,Se)}const xe={url:$,method:$,data:$,baseURL:Z,transformRequest:Z,transformResponse:Z,paramsSerializer:Z,timeout:Z,timeoutMessage:Z,withCredentials:Z,withXSRFToken:Z,adapter:Z,responseType:Z,xsrfCookieName:Z,xsrfHeaderName:Z,onUploadProgress:Z,onDownloadProgress:Z,decompress:Z,maxContentLength:Z,maxBodyLength:Z,beforeRedirect:Z,transport:Z,httpAgent:Z,httpsAgent:Z,cancelToken:Z,socketPath:Z,responseEncoding:Z,validateStatus:ue,headers:(Se,Ne,it)=>S(MB(Se),MB(Ne),it,!0)};return mo.forEach(Object.keys({...t,...e}),function(Ne){const it=xe[Ne]||S,pt=it(t[Ne],e[Ne],Ne);mo.isUndefined(pt)&&it!==ue||(r[Ne]=pt)}),r}const ZU=t=>{const e=Nx({},t);let{data:r,withXSRFToken:c,xsrfHeaderName:S,xsrfCookieName:$,headers:Z,auth:ue}=e;if(e.headers=Z=Cm.from(Z),e.url=$U(GU(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),ue&&Z.set("Authorization","Basic "+btoa((ue.username||"")+":"+(ue.password?unescape(encodeURIComponent(ue.password)):""))),mo.isFormData(r)){if(N0.hasStandardBrowserEnv||N0.hasStandardBrowserWebWorkerEnv)Z.setContentType(void 0);else if(mo.isFunction(r.getHeaders)){const xe=r.getHeaders(),Se=["content-type","content-length"];Object.entries(xe).forEach(([Ne,it])=>{Se.includes(Ne.toLowerCase())&&Z.set(Ne,it)})}}if(N0.hasStandardBrowserEnv&&(c&&mo.isFunction(c)&&(c=c(e)),c||c!==!1&&Cle(e.url))){const xe=S&&$&&Ale.read($);xe&&Z.set(S,xe)}return e},Lle=typeof XMLHttpRequest<"u",Ple=Lle&&function(t){return new Promise(function(r,c){const S=ZU(t);let $=S.data;const Z=Cm.from(S.headers).normalize();let{responseType:ue,onUploadProgress:xe,onDownloadProgress:Se}=S,Ne,it,pt,bt,wt;function Dt(){bt&&bt(),wt&&wt(),S.cancelToken&&S.cancelToken.unsubscribe(Ne),S.signal&&S.signal.removeEventListener("abort",Ne)}let Zt=new XMLHttpRequest;Zt.open(S.method.toUpperCase(),S.url,!0),Zt.timeout=S.timeout;function Mr(){if(!Zt)return;const ni=Cm.from("getAllResponseHeaders"in Zt&&Zt.getAllResponseHeaders()),Cr={data:!ue||ue==="text"||ue==="json"?Zt.responseText:Zt.response,status:Zt.status,statusText:Zt.statusText,headers:ni,config:t,request:Zt};qU(function(Si){r(Si),Dt()},function(Si){c(Si),Dt()},Cr),Zt=null}"onloadend"in Zt?Zt.onloadend=Mr:Zt.onreadystatechange=function(){!Zt||Zt.readyState!==4||Zt.status===0&&!(Zt.responseURL&&Zt.responseURL.indexOf("file:")===0)||setTimeout(Mr)},Zt.onabort=function(){Zt&&(c(new lc("Request aborted",lc.ECONNABORTED,t,Zt)),Zt=null)},Zt.onerror=function(or){const Cr=or&&or.message?or.message:"Network Error",gi=new lc(Cr,lc.ERR_NETWORK,t,Zt);gi.event=or||null,c(gi),Zt=null},Zt.ontimeout=function(){let or=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded";const Cr=S.transitional||HU;S.timeoutErrorMessage&&(or=S.timeoutErrorMessage),c(new lc(or,Cr.clarifyTimeoutError?lc.ETIMEDOUT:lc.ECONNABORTED,t,Zt)),Zt=null},$===void 0&&Z.setContentType(null),"setRequestHeader"in Zt&&mo.forEach(Z.toJSON(),function(or,Cr){Zt.setRequestHeader(Cr,or)}),mo.isUndefined(S.withCredentials)||(Zt.withCredentials=!!S.withCredentials),ue&&ue!=="json"&&(Zt.responseType=S.responseType),Se&&([pt,wt]=$T(Se,!0),Zt.addEventListener("progress",pt)),xe&&Zt.upload&&([it,bt]=$T(xe),Zt.upload.addEventListener("progress",it),Zt.upload.addEventListener("loadend",bt)),(S.cancelToken||S.signal)&&(Ne=ni=>{Zt&&(c(!ni||ni.type?new G2(null,t,Zt):ni),Zt.abort(),Zt=null)},S.cancelToken&&S.cancelToken.subscribe(Ne),S.signal&&(S.signal.aborted?Ne():S.signal.addEventListener("abort",Ne)));const ze=kle(S.url);if(ze&&N0.protocols.indexOf(ze)===-1){c(new lc("Unsupported protocol "+ze+":",lc.ERR_BAD_REQUEST,t));return}Zt.send($||null)})},Ile=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let c=new AbortController,S;const $=function(Se){if(!S){S=!0,ue();const Ne=Se instanceof Error?Se:this.reason;c.abort(Ne instanceof lc?Ne:new G2(Ne instanceof Error?Ne.message:Ne))}};let Z=e&&setTimeout(()=>{Z=null,$(new lc(`timeout ${e} of ms exceeded`,lc.ETIMEDOUT))},e);const ue=()=>{t&&(Z&&clearTimeout(Z),Z=null,t.forEach(Se=>{Se.unsubscribe?Se.unsubscribe($):Se.removeEventListener("abort",$)}),t=null)};t.forEach(Se=>Se.addEventListener("abort",$));const{signal:xe}=c;return xe.unsubscribe=()=>mo.asap(ue),xe}},Dle=function*(t,e){let r=t.byteLength;if(r{const S=zle(t,e);let $=0,Z,ue=xe=>{Z||(Z=!0,c&&c(xe))};return new ReadableStream({async pull(xe){try{const{done:Se,value:Ne}=await S.next();if(Se){ue(),xe.close();return}let it=Ne.byteLength;if(r){let pt=$+=it;r(pt)}xe.enqueue(new Uint8Array(Ne))}catch(Se){throw ue(Se),Se}},cancel(xe){return ue(xe),S.return()}},{highWaterMark:2})},LB=64*1024,{isFunction:zk}=mo,Ble=(({Request:t,Response:e})=>({Request:t,Response:e}))(mo.global),{ReadableStream:PB,TextEncoder:IB}=mo.global,DB=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Rle=t=>{t=mo.merge.call({skipUndefined:!0},Ble,t);const{fetch:e,Request:r,Response:c}=t,S=e?zk(e):typeof fetch=="function",$=zk(r),Z=zk(c);if(!S)return!1;const ue=S&&zk(PB),xe=S&&(typeof IB=="function"?(wt=>Dt=>wt.encode(Dt))(new IB):async wt=>new Uint8Array(await new r(wt).arrayBuffer())),Se=$&&ue&&DB(()=>{let wt=!1;const Dt=new r(N0.origin,{body:new PB,method:"POST",get duplex(){return wt=!0,"half"}}).headers.has("Content-Type");return wt&&!Dt}),Ne=Z&&ue&&DB(()=>mo.isReadableStream(new c("").body)),it={stream:Ne&&(wt=>wt.body)};S&&["text","arrayBuffer","blob","formData","stream"].forEach(wt=>{!it[wt]&&(it[wt]=(Dt,Zt)=>{let Mr=Dt&&Dt[wt];if(Mr)return Mr.call(Dt);throw new lc(`Response type '${wt}' is not supported`,lc.ERR_NOT_SUPPORT,Zt)})});const pt=async wt=>{if(wt==null)return 0;if(mo.isBlob(wt))return wt.size;if(mo.isSpecCompliantForm(wt))return(await new r(N0.origin,{method:"POST",body:wt}).arrayBuffer()).byteLength;if(mo.isArrayBufferView(wt)||mo.isArrayBuffer(wt))return wt.byteLength;if(mo.isURLSearchParams(wt)&&(wt=wt+""),mo.isString(wt))return(await xe(wt)).byteLength},bt=async(wt,Dt)=>{const Zt=mo.toFiniteNumber(wt.getContentLength());return Zt??pt(Dt)};return async wt=>{let{url:Dt,method:Zt,data:Mr,signal:ze,cancelToken:ni,timeout:or,onDownloadProgress:Cr,onUploadProgress:gi,responseType:Si,headers:Ci,withCredentials:ri="same-origin",fetchOptions:on}=ZU(wt),yi=e||fetch;Si=Si?(Si+"").toLowerCase():"text";let gr=Ile([ze,ni&&ni.toAbortSignal()],or),fr=null;const Sr=gr&&gr.unsubscribe&&(()=>{gr.unsubscribe()});let ei;try{if(gi&&Se&&Zt!=="get"&&Zt!=="head"&&(ei=await bt(Ci,Mr))!==0){let ga=new r(Dt,{method:"POST",body:Mr,duplex:"half"}),ya;if(mo.isFormData(Mr)&&(ya=ga.headers.get("content-type"))&&Ci.setContentType(ya),ga.body){const[ro,qn]=CB(ei,$T(AB(gi)));Mr=EB(ga.body,LB,ro,qn)}}mo.isString(ri)||(ri=ri?"include":"omit");const Jr=$&&"credentials"in r.prototype,ti={...on,signal:gr,method:Zt.toUpperCase(),headers:Ci.normalize().toJSON(),body:Mr,duplex:"half",credentials:Jr?ri:void 0};fr=$&&new r(Dt,ti);let Di=await($?yi(fr,on):yi(Dt,ti));const En=Ne&&(Si==="stream"||Si==="response");if(Ne&&(Cr||En&&Sr)){const ga={};["status","statusText","headers"].forEach(ln=>{ga[ln]=Di[ln]});const ya=mo.toFiniteNumber(Di.headers.get("content-length")),[ro,qn]=Cr&&CB(ya,$T(AB(Cr),!0))||[];Di=new c(EB(Di.body,LB,ro,()=>{qn&&qn(),Sr&&Sr()}),ga)}Si=Si||"text";let Zn=await it[mo.findKey(it,Si)||"text"](Di,wt);return!En&&Sr&&Sr(),await new Promise((ga,ya)=>{qU(ga,ya,{data:Zn,headers:Cm.from(Di.headers),status:Di.status,statusText:Di.statusText,config:wt,request:fr})})}catch(Jr){throw Sr&&Sr(),Jr&&Jr.name==="TypeError"&&/Load failed|fetch/i.test(Jr.message)?Object.assign(new lc("Network Error",lc.ERR_NETWORK,wt,fr),{cause:Jr.cause||Jr}):lc.from(Jr,Jr&&Jr.code,wt,fr)}}},Fle=new Map,KU=t=>{let e=t&&t.env||{};const{fetch:r,Request:c,Response:S}=e,$=[c,S,r];let Z=$.length,ue=Z,xe,Se,Ne=Fle;for(;ue--;)xe=$[ue],Se=Ne.get(xe),Se===void 0&&Ne.set(xe,Se=ue?new Map:Rle(e)),Ne=Se;return Se};KU();const PE={http:tle,xhr:Ple,fetch:{get:KU}};mo.forEach(PE,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zB=t=>`- ${t}`,Nle=t=>mo.isFunction(t)||t===null||t===!1;function jle(t,e){t=mo.isArray(t)?t:[t];const{length:r}=t;let c,S;const $={};for(let Z=0;Z`adapter ${xe} `+(Se===!1?"is not supported by the environment":"is not available in the build"));let ue=r?Z.length>1?`since : +`+Z.map(zB).join(` +`):" "+zB(Z[0]):"as no adapter specified";throw new lc("There is no suitable adapter to dispatch the request "+ue,"ERR_NOT_SUPPORT")}return S}const YU={getAdapter:jle,adapters:PE};function A7(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new G2(null,t)}function OB(t){return A7(t),t.headers=Cm.from(t.headers),t.data=C7.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),YU.getAdapter(t.adapter||n4.adapter,t)(t).then(function(c){return A7(t),c.data=C7.call(t,t.transformResponse,c),c.headers=Cm.from(c.headers),c},function(c){return WU(c)||(A7(t),c&&c.response&&(c.response.data=C7.call(t,t.transformResponse,c.response),c.response.headers=Cm.from(c.response.headers))),Promise.reject(c)})}const XU="1.13.2",z8={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{z8[t]=function(c){return typeof c===t||"a"+(e<1?"n ":" ")+t}});const BB={};z8.transitional=function(e,r,c){function S($,Z){return"[Axios v"+XU+"] Transitional option '"+$+"'"+Z+(c?". "+c:"")}return($,Z,ue)=>{if(e===!1)throw new lc(S(Z," has been removed"+(r?" in "+r:"")),lc.ERR_DEPRECATED);return r&&!BB[Z]&&(BB[Z]=!0,console.warn(S(Z," has been deprecated since v"+r+" and will be removed in the near future"))),e?e($,Z,ue):!0}};z8.spelling=function(e){return(r,c)=>(console.warn(`${c} is likely a misspelling of ${e}`),!0)};function Ule(t,e,r){if(typeof t!="object")throw new lc("options must be an object",lc.ERR_BAD_OPTION_VALUE);const c=Object.keys(t);let S=c.length;for(;S-- >0;){const $=c[S],Z=e[$];if(Z){const ue=t[$],xe=ue===void 0||Z(ue,$,t);if(xe!==!0)throw new lc("option "+$+" must be "+xe,lc.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new lc("Unknown option "+$,lc.ERR_BAD_OPTION)}}const gT={assertOptions:Ule,validators:z8},dv=gT.validators;let Ix=class{constructor(e){this.defaults=e||{},this.interceptors={request:new TB,response:new TB}}async request(e,r){try{return await this._request(e,r)}catch(c){if(c instanceof Error){let S={};Error.captureStackTrace?Error.captureStackTrace(S):S=new Error;const $=S.stack?S.stack.replace(/^.+\n/,""):"";try{c.stack?$&&!String(c.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(c.stack+=` +`+$):c.stack=$}catch{}}throw c}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Nx(this.defaults,r);const{transitional:c,paramsSerializer:S,headers:$}=r;c!==void 0&&gT.assertOptions(c,{silentJSONParsing:dv.transitional(dv.boolean),forcedJSONParsing:dv.transitional(dv.boolean),clarifyTimeoutError:dv.transitional(dv.boolean)},!1),S!=null&&(mo.isFunction(S)?r.paramsSerializer={serialize:S}:gT.assertOptions(S,{encode:dv.function,serialize:dv.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),gT.assertOptions(r,{baseUrl:dv.spelling("baseURL"),withXsrfToken:dv.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let Z=$&&mo.merge($.common,$[r.method]);$&&mo.forEach(["delete","get","head","post","put","patch","common"],wt=>{delete $[wt]}),r.headers=Cm.concat(Z,$);const ue=[];let xe=!0;this.interceptors.request.forEach(function(Dt){typeof Dt.runWhen=="function"&&Dt.runWhen(r)===!1||(xe=xe&&Dt.synchronous,ue.unshift(Dt.fulfilled,Dt.rejected))});const Se=[];this.interceptors.response.forEach(function(Dt){Se.push(Dt.fulfilled,Dt.rejected)});let Ne,it=0,pt;if(!xe){const wt=[OB.bind(this),void 0];for(wt.unshift(...ue),wt.push(...Se),pt=wt.length,Ne=Promise.resolve(r);it{if(!c._listeners)return;let $=c._listeners.length;for(;$-- >0;)c._listeners[$](S);c._listeners=null}),this.promise.then=S=>{let $;const Z=new Promise(ue=>{c.subscribe(ue),$=ue}).then(S);return Z.cancel=function(){c.unsubscribe($)},Z},e(function($,Z,ue){c.reason||(c.reason=new G2($,Z,ue),r(c.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=c=>{e.abort(c)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new JU(function(S){e=S}),cancel:e}}};function Hle(t){return function(r){return t.apply(null,r)}}function Vle(t){return mo.isObject(t)&&t.isAxiosError===!0}const KM={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(KM).forEach(([t,e])=>{KM[e]=t});function QU(t){const e=new Ix(t),r=LU(Ix.prototype.request,e);return mo.extend(r,Ix.prototype,e,{allOwnKeys:!0}),mo.extend(r,e,null,{allOwnKeys:!0}),r.create=function(S){return QU(Nx(t,S))},r}const ud=QU(n4);ud.Axios=Ix;ud.CanceledError=G2;ud.CancelToken=$le;ud.isCancel=WU;ud.VERSION=XU;ud.toFormData=D8;ud.AxiosError=lc;ud.Cancel=ud.CanceledError;ud.all=function(e){return Promise.all(e)};ud.spread=Hle;ud.isAxiosError=Vle;ud.mergeConfig=Nx;ud.AxiosHeaders=Cm;ud.formToJSON=t=>VU(mo.isHTMLForm(t)?new FormData(t):t);ud.getAdapter=YU.getAdapter;ud.HttpStatusCode=KM;ud.default=ud;const{Axios:LBe,AxiosError:PBe,CanceledError:IBe,isCancel:DBe,CancelToken:zBe,VERSION:OBe,all:BBe,Cancel:RBe,isAxiosError:FBe,spread:NBe,toFormData:jBe,AxiosHeaders:UBe,HttpStatusCode:$Be,formToJSON:HBe,getAdapter:VBe,mergeConfig:WBe}=ud,IE="pymc_jwt_token",RB="pymc_client_id";function e$(){let t=localStorage.getItem(RB);return t||(t=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(RB,t)),t}function Vx(){return localStorage.getItem(IE)}function YM(t){localStorage.setItem(IE,t)}function Z2(){localStorage.removeItem(IE)}function t$(){return Vx()!==null}function DE(t){try{const r=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),c=decodeURIComponent(atob(r).split("").map(S=>"%"+("00"+S.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(c)}catch{return null}}function r$(){const t=Vx();if(!t)return!0;const e=DE(t);return!e||!e.exp?!0:Date.now()>=e.exp*1e3-3e4}function i$(){const t=Vx();if(!t)return!1;const e=DE(t);if(!e||!e.exp)return!1;const r=e.exp*1e3-Date.now();return r>0&&r<3e5}function Wle(){const t=Vx();if(!t)return null;const e=DE(t);return!e||!e.sub?null:e.sub}const qle={class:"sparkline-container"},Gle={class:"text-white text-xs lg:text-sm font-semibold mb-3 lg:mb-4"},Zle={class:"flex items-end gap-2 lg:gap-4"},Kle=["id","width","height","viewBox"],Yle=["id"],Xle=["stop-color"],Jle=["stop-color"],Qle=["d","fill"],eue=["d","stroke"],tue=["cx","cy","fill"],rue=Bu({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},width:{default:131},height:{default:37},animate:{type:Boolean,default:!0},showChart:{type:Boolean,default:!0}},setup(t){const e=t,r=Io(()=>{if(e.data&&e.data.length>0)return e.data;const Z=typeof e.value=="number"?e.value:10,ue=20,xe=Z*.3;return Array.from({length:ue},(Se,Ne)=>{const it=Math.sin(Ne/ue*Math.PI*2)*xe*.5,pt=(Math.random()-.5)*xe*.3;return Math.max(0,Z+it+pt)})}),c=Io(()=>{const Z=r.value;if(Z.length<2)return"";const ue=Math.max(...Z),xe=Math.min(...Z),Se=ue-xe||1,Ne=e.width/(Z.length-1);let it="";return Z.forEach((pt,bt)=>{const wt=bt*Ne,Dt=e.height-(pt-xe)/Se*e.height;if(bt===0)it+=`M ${wt} ${Dt}`;else{const Mr=((bt-1)*Ne+wt)/2;it+=` Q ${Mr} ${Dt} ${wt} ${Dt}`}}),it}),S=fn("");Jf(()=>{S.value=c.value}),Af(()=>e.data,(Z,ue)=>{ue&&Z.length===ue.length&&!Z.some((Se,Ne)=>Math.abs(Se-ue[Ne])>.1)||(S.value=c.value)},{deep:!1});const $=Io(()=>`sparkline-${e.title.replace(/\s+/g,"-").toLowerCase()}`);return(Z,ue)=>(jr(),Kr("div",qle,[Ee("p",Gle,ki(Z.title),1),Ee("div",Zle,[Ee("span",{class:"text-lg lg:text-[30px] font-bold leading-none value-display",style:om({color:Z.color})},[il(ki(Z.value),1),Ine(Z.$slots,"unit",{},void 0)],4),Z.showChart?(jr(),Kr("svg",{key:0,id:$.value,class:"mb-1 lg:mb-3 sparkline-svg",width:Z.width,height:Z.height,viewBox:`0 0 ${Z.width} ${Z.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("defs",null,[Ee("linearGradient",{id:`gradient-${$.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[Ee("stop",{offset:"0%","stop-color":Z.color,"stop-opacity":"0.3"},null,8,Xle),Ee("stop",{offset:"100%","stop-color":Z.color,"stop-opacity":"0.1"},null,8,Jle)],8,Yle)]),Ee("path",{d:`${S.value} L ${Z.width} ${Z.height} L 0 ${Z.height} Z`,fill:`url(#gradient-${$.value})`,class:"sparkline-fill"},null,8,Qle),Ee("path",{d:S.value,stroke:Z.color,"stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:Ga(["sparkline-path",{"animate-draw":Z.animate}])},null,10,eue),r.value.length>0?(jr(),Kr("circle",{key:0,cx:Z.width,cy:Z.height-(r.value[r.value.length-1]-Math.min(...r.value))/(Math.max(...r.value)-Math.min(...r.value)||1)*Z.height,r:"2",fill:Z.color,class:Ga(["sparkline-dot",{"animate-pulse":Z.animate}])},null,10,tue)):Sa("",!0)],8,Kle)):Sa("",!0)])]))}}),kh=(t,e)=>{const r=t.__vccOpts||t;for(const[c,S]of e)r[c]=S;return r},Av=kh(rue,[["__scopeId","data-v-9bdf7700"]]),a4=A8("packets",()=>{const t=fn(null),e=fn(null),r=fn([]),c=fn([]),S=fn(null),$=fn(!1),Z=fn(null),ue=fn(null),xe=fn([]),Se=fn([]),Ne=Io(()=>t.value!==null),it=Io(()=>e.value!==null),pt=Io(()=>r.value.length>0),bt=Io(()=>c.value.length>0),wt=Io(()=>S.value?.avg_noise_floor??0),Dt=Io(()=>t.value?.total_packets??0),Zt=Io(()=>t.value?.avg_rssi??0),Mr=Io(()=>t.value?.avg_snr??0),ze=Io(()=>e.value?.uptime_seconds??0),ni=Io(()=>{if(!t.value?.packet_types)return[];const Jr=t.value.packet_types,ti=Jr.reduce((Di,En)=>Di+En.count,0);return Jr.map(Di=>({type:Di.type.toString(),count:Di.count,percentage:ti>0?Di.count/ti*100:0}))}),or=Io(()=>{const Jr={};return r.value.forEach(ti=>{Jr[ti.type]||(Jr[ti.type]=[]),Jr[ti.type].push(ti)}),Jr});async function Cr(){try{const Jr=await bs.get("/stats");if(Jr.success&&Jr.data){e.value=Jr.data;const ti=new Date;return Se.value.push({timestamp:ti,stats:Jr.data}),Se.value.length>50&&(Se.value=Se.value.slice(-50)),Jr.data}else if(Jr&&"version"in Jr){const ti=Jr;e.value=ti;const Di=new Date;return Se.value.push({timestamp:Di,stats:ti}),Se.value.length>50&&(Se.value=Se.value.slice(-50)),ti}else throw new Error(Jr.error||"Failed to fetch system stats")}catch(Jr){throw Z.value=Jr instanceof Error?Jr.message:"Unknown error occurred",console.error("Error fetching system stats:",Jr),Jr}}async function gi(Jr={hours:24}){try{const ti=await bs.get("/noise_floor_history",Jr);if(ti.success&&ti.data&&ti.data.history)return c.value=ti.data.history,ue.value=new Date,ti.data.history;throw new Error(ti.error||"Failed to fetch noise floor history")}catch(ti){throw Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching noise floor history:",ti),ti}}async function Si(Jr={hours:24}){try{const ti=await bs.get("/noise_floor_stats",Jr);if(ti.success&&ti.data&&ti.data.stats)return S.value=ti.data.stats,ue.value=new Date,ti.data.stats;throw new Error(ti.error||"Failed to fetch noise floor stats")}catch(ti){throw Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching noise floor stats:",ti),ti}}const Ci=Io(()=>!c.value||!Array.isArray(c.value)?[]:c.value.slice(-50).map(Jr=>Jr.noise_floor_dbm));async function ri(Jr={hours:24}){try{$.value=!0,Z.value=null;const ti=await bs.get("/packet_stats",Jr);if(ti.success&&ti.data){t.value=ti.data;const Di=new Date;xe.value.push({timestamp:Di,stats:ti.data}),xe.value.length>50&&(xe.value=xe.value.slice(-50)),ue.value=Di}else throw new Error(ti.error||"Failed to fetch packet stats")}catch(ti){Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching packet stats:",ti)}finally{$.value=!1}}async function on(Jr={limit:100}){try{$.value=!0,Z.value=null;const ti=await bs.get("/recent_packets",Jr);if(ti.success&&ti.data)r.value=ti.data,ue.value=new Date;else throw new Error(ti.error||"Failed to fetch recent packets")}catch(ti){Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching recent packets:",ti)}finally{$.value=!1}}async function yi(Jr){try{$.value=!0,Z.value=null;const ti=await bs.get("/filtered_packets",Jr);if(ti.success&&ti.data)return r.value=ti.data,ue.value=new Date,ti.data;throw new Error(ti.error||"Failed to fetch filtered packets")}catch(ti){throw Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching filtered packets:",ti),ti}finally{$.value=!1}}async function gr(Jr){try{$.value=!0,Z.value=null;const ti=await bs.get("/packet_by_hash",{packet_hash:Jr});if(ti.success&&ti.data)return ti.data;throw new Error(ti.error||"Packet not found")}catch(ti){throw Z.value=ti instanceof Error?ti.message:"Unknown error occurred",console.error("Error fetching packet by hash:",ti),ti}finally{$.value=!1}}const fr=Io(()=>{const Jr=xe.value,ti=Se.value;return{totalPackets:Jr.map(Di=>Di.stats.total_packets),transmittedPackets:Jr.map(Di=>Di.stats.transmitted_packets),droppedPackets:Jr.map(Di=>Di.stats.dropped_packets),avgRssi:Jr.map(Di=>Di.stats.avg_rssi),uptimeHours:ti.map(Di=>Math.floor((Di.stats.uptime_seconds||0)/3600))}});async function Sr(Jr=3e4){await Promise.all([Cr(),ri(),on(),gi({hours:1}),Si({hours:1})]);const ti=setInterval(async()=>{try{await Promise.all([Cr(),ri(),on(),gi({hours:1}),Si({hours:1})])}catch(Di){console.error("Auto-refresh error:",Di)}},Jr);return()=>clearInterval(ti)}function ei(){t.value=null,e.value=null,r.value=[],c.value=[],S.value=null,xe.value=[],Se.value=[],Z.value=null,ue.value=null,$.value=!1}return{packetStats:t,systemStats:e,recentPackets:r,noiseFloorHistory:c,noiseFloorStats:S,packetStatsHistory:xe,systemStatsHistory:Se,isLoading:$,error:Z,lastUpdated:ue,hasPacketStats:Ne,hasSystemStats:it,hasRecentPackets:pt,hasNoiseFloorData:bt,currentNoiseFloor:wt,totalPackets:Dt,averageRSSI:Zt,averageSNR:Mr,uptime:ze,packetTypeBreakdown:ni,recentPacketsByType:or,sparklineData:fr,noiseFloorSparklineData:Ci,fetchSystemStats:Cr,fetchPacketStats:ri,fetchRecentPackets:on,fetchFilteredPackets:yi,getPacketByHash:gr,fetchNoiseFloorHistory:gi,fetchNoiseFloorStats:Si,startAutoRefresh:Sr,reset:ei}}),iue={class:"grid grid-cols-2 lg:grid-cols-4 gap-3 lg:gap-4 mb-5 stats-cards-container"},nue=Bu({name:"StatsCards",__name:"StatsCards",setup(t){const e=a4(),r=fn(null),c=fn(!1),S=Io(()=>{const ue=e.packetStats,xe=e.systemStats,Se=Ne=>{const it=Math.floor(Ne/86400),pt=Math.floor(Ne%86400/3600),bt=Math.floor(Ne%3600/60);return it>0?`${it}d ${pt}h`:pt>0?`${pt}h ${bt}m`:`${bt}m`};return{packetsReceived:ue?.total_packets||0,packetsForwarded:ue?.transmitted_packets||0,uptimeFormatted:xe?Se(xe.uptime_seconds||0):"0m",uptimeHours:xe?Math.floor((xe.uptime_seconds||0)/3600):0,droppedPackets:ue?.dropped_packets||0,signalQuality:Math.round((ue?.avg_rssi||0)+120)}}),$=Io(()=>e.sparklineData),Z=async()=>{if(!c.value)try{c.value=!0,await Promise.all([e.fetchSystemStats(),e.fetchPacketStats({hours:24})]),await b0()}catch(ue){console.error("Error fetching stats:",ue)}finally{c.value=!1}};return Jf(()=>{Z(),r.value=window.setInterval(Z,5e3)}),$g(()=>{r.value&&clearInterval(r.value)}),(ue,xe)=>(jr(),Kr("div",iue,[(jr(),Cd(Av,{key:`rx-${S.value.packetsReceived}`,title:"RX Packets",value:S.value.packetsReceived,color:"#AAE8E8",data:$.value.totalPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"])),(jr(),Cd(Av,{key:`fwd-${S.value.packetsForwarded}`,title:"Forward",value:S.value.packetsForwarded,color:"#FFC246",data:$.value.transmittedPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"])),(jr(),Cd(Av,{key:`uptime-${S.value.uptimeFormatted}`,title:"Up Time",value:S.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"mobile-compact stat-card",animate:!1},null,8,["value"])),(jr(),Cd(Av,{key:`drop-${S.value.droppedPackets}`,title:"Dropped",value:S.value.droppedPackets,color:"#FB787B",data:$.value.droppedPackets,class:"mobile-compact stat-card",animate:!1},null,8,["value","data"]))]))}}),aue=kh(nue,[["__scopeId","data-v-6e98c4b6"]]),oue={class:"glass-card rounded-[10px] p-4 lg:p-6"},sue={class:"h-64 lg:h-80 relative"},lue={key:0,class:"absolute inset-0 flex items-center justify-center"},uue={key:1,class:"absolute inset-0 flex items-center justify-center"},cue={class:"text-red-400 text-sm lg:text-base"},hue={key:2,class:"absolute inset-0 flex items-center justify-center"},fue={key:3,class:"h-full flex items-end justify-around gap-1 sm:gap-2 px-1 sm:px-2 lg:px-4"},due={class:"relative w-full h-48 lg:h-64 flex flex-col justify-end"},pue={class:"text-white text-[10px] sm:text-xs font-semibold drop-shadow-lg backdrop-blur-sm bg-black/20 px-1 py-0.5 rounded-md border border-white/10"},mue={class:"mt-1 lg:mt-2 text-center w-full px-0.5"},gue={class:"text-white text-[9px] sm:text-[10px] lg:text-xs font-medium leading-tight break-words"},vue={key:0,class:"mt-3 lg:mt-4 text-xs lg:text-sm text-white text-center"},yue=Bu({name:"SignalQualityChart",__name:"SignalQualityChart",setup(t){const e=fn([]),r=fn(null),c=fn(!0),S=fn(null),$=["rgba(59, 130, 246, 0.8)","rgba(16, 185, 129, 0.8)","rgba(139, 92, 246, 0.8)","rgba(245, 158, 11, 0.8)","rgba(239, 68, 68, 0.8)","rgba(6, 182, 212, 0.8)","rgba(249, 115, 22, 0.8)","rgba(132, 204, 22, 0.8)","rgba(236, 72, 153, 0.8)","rgba(107, 114, 128, 0.8)"],Z=async()=>{try{S.value=null;const xe=await bs.get("/packet_type_graph_data");if(xe?.success&&xe?.data){const Se=xe.data;if(Se?.series){const Ne=[];Se.series.forEach((it,pt)=>{let bt=0;it.data&&Array.isArray(it.data)&&(bt=it.data.reduce((wt,Dt)=>wt+(Dt[1]||0),0)),bt>0&&Ne.push({name:it.name||`Type ${it.type}`,type:it.type,count:bt,color:$[pt%$.length]})}),Ne.sort((it,pt)=>pt.count-it.count),e.value=Ne,c.value=!1}else console.error("No series data found in response"),S.value="No series data in server response",c.value=!1}else console.error("Invalid API response structure:",xe),S.value="Invalid response from server",c.value=!1}catch(xe){console.error("Failed to fetch packet type data:",xe),S.value=xe instanceof Error?xe.message:"Failed to load data",c.value=!1}},ue=xe=>{if(e.value.length===0)return 0;const Se=Math.max(...e.value.map(Ne=>Ne.count));return Math.max(xe/Se*100,2)};return Jf(()=>{Z(),r.value=setInterval(()=>{Z()},3e4)}),$g(()=>{r.value&&clearInterval(r.value)}),(xe,Se)=>(jr(),Kr("div",oue,[Se[2]||(Se[2]=Ee("h3",{class:"text-white text-lg lg:text-xl font-semibold mb-3 lg:mb-4"},"Packet Types",-1)),Se[3]||(Se[3]=Ee("p",{class:"text-white text-xs lg:text-sm uppercase mb-3 lg:mb-4"},"Distribution by Type",-1)),Ee("div",sue,[c.value?(jr(),Kr("div",lue,Se[0]||(Se[0]=[Ee("div",{class:"text-white text-sm lg:text-base"},"Loading packet types...",-1)]))):S.value?(jr(),Kr("div",uue,[Ee("div",cue,ki(S.value),1)])):e.value.length===0?(jr(),Kr("div",hue,Se[1]||(Se[1]=[Ee("div",{class:"text-white text-sm lg:text-base"},"No packet data available",-1)]))):(jr(),Kr("div",fue,[(jr(!0),Kr(js,null,au(e.value,Ne=>(jr(),Kr("div",{key:Ne.type,class:"flex flex-col items-center flex-1 max-w-12 sm:max-w-16 lg:max-w-20 h-full"},[Ee("div",due,[Ee("div",{class:"w-full rounded-t-[10px] transition-all duration-500 ease-out flex items-end justify-center pb-1 backdrop-blur-[50px] shadow-lg border border-white/20 hover:border-white/30",style:om({height:ue(Ne.count)+"%",background:`linear-gradient(135deg, + ${Ne.color} 0%, + ${Ne.color.replace("0.8","0.6")} 30%, + ${Ne.color.replace("0.8","0.4")} 70%, + ${Ne.color.replace("0.8","0.3")} 100%), linear-gradient(91deg, rgba(34, 34, 34, 0.43) 1.17%, rgba(135, 135, 136, 0.10) 99.82%)`,backgroundBlendMode:"overlay, normal",minHeight:"8px",boxShadow:` - 0 8px 32px ${Re.color.replace("0.8","0.3")}, + 0 8px 32px ${Ne.color.replace("0.8","0.3")}, 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2) - `})},[Le("span",hue,Si(Re.count),1)],4)]),Le("div",fue,[Le("div",due,Si(Re.name.replace(/\([^)]*\)/g,"").trim()),1)])]))),128))]))]),e.value.length>0?(Wr(),Qr("div",pue," Total packet types: "+Si(e.value.length)+" | Total packets: "+Si(e.value.reduce((Re,Xe)=>Re+Xe.count,0)),1)):Ma("",!0)]))}}),gue=kh(mue,[["__scopeId","data-v-e4b8fd1c"]]),vue={class:"glass-card rounded-[10px] p-4 lg:p-6"},yue={class:"relative h-40 lg:h-48"},_ue={class:"mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4"},xue={class:"text-center"},bue={class:"text-lg lg:text-2xl font-bold text-white"},wue={class:"text-center"},kue={class:"text-lg lg:text-2xl font-bold text-white"},Tue={class:"mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center"},Sue={class:"text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1"},Cue={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},Aue={class:"text-xs text-white/60"},Mue={class:"text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1"},Eue={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},Lue={class:"text-xs text-white/60"},Pue={class:"text-xs lg:text-sm font-semibold text-white"},Iue=Uu({name:"PerformanceChart",__name:"PerformanceChart",setup(t){const e=i4(),r=kg(),c=vn(null),S=vn([]),H=vn(null),Z=vn(!0),ue=Do(()=>{const Re=r.stats?.uptime_seconds||0,Xe=e.packetStats?.total_packets||0,vt=e.packetStats?.transmitted_packets||0,bt=Math.max(Re/3600,.1);if(bt<1){const Dt=Math.max(Re/60,1);return{rxRate:{value:Math.round(Xe/Dt*100)/100,label:bt<.5?"RX/min (early)":"RX/min"},txRate:{value:Math.round(vt/Dt*100)/100,label:bt<.5?"TX/min (early)":"TX/min"},confidence:"low"}}else{const Dt=Math.round(Xe/bt*100)/100,rr=Math.round(vt/bt*100)/100;let Er,Fe;return bt<6?(Er=`RX/hr (${Math.round(bt)}h)`,Fe="medium"):bt<24?(Er=`RX/hr (${Math.round(bt)}h)`,Fe="high"):(Er="RX/hr",Fe="high"),{rxRate:{value:Dt,label:Er},txRate:{value:rr,label:Er.replace("RX","TX")},confidence:Fe}}}),be=async()=>{try{Z.value=!0;const Re=await zs.get("/recent_packets",{limit:50});if(!Re.success){S.value=[],Z.value=!1,x0(()=>{Se()});return}const Xe=Re.data||[],vt=Date.now(),bt=24,kt=12,Dt=bt*60*60*1e3/kt,rr=[];for(let Er=0;Er{const Ci=_i.timestamp*1e3;return Ci>=Fe&&Ci!_i.transmitted).length,Ti=ur.filter(_i=>_i.transmitted).length;rr.push({time:new Date(Fe+Dt/2).toISOString(),rxPackets:Ir,txPackets:Ti})}S.value=rr,Z.value=!1,x0(()=>{Se()})}catch{S.value=[],Z.value=!1,x0(()=>{Se()})}},Se=()=>{if(!c.value)return;const Re=c.value,Xe=Re.getContext("2d");if(!Xe)return;const vt=Re.parentElement;if(!vt)return;const bt=vt.getBoundingClientRect(),kt=bt.width,Dt=bt.height;Re.width=kt*window.devicePixelRatio,Re.height=Dt*window.devicePixelRatio,Re.style.width=kt+"px",Re.style.height=Dt+"px",Xe.scale(window.devicePixelRatio,window.devicePixelRatio);const rr=20;if(Xe.clearRect(0,0,kt,Dt),Z.value){Xe.fillStyle="#666",Xe.font="16px sans-serif",Xe.textAlign="center",Xe.fillText("Loading chart data...",kt/2,Dt/2);return}if(S.value.length===0){Xe.fillStyle="#666",Xe.font="16px sans-serif",Xe.textAlign="center",Xe.fillText("No data available",kt/2,Dt/2);return}const Er=S.value.every(Ji=>Ji.rxPackets===0&&Ji.txPackets===0),Fe=kt-rr*2,wi=Dt-rr*2,ur=S.value.flatMap(Ji=>[Ji.rxPackets,Ji.txPackets]),Ir=Math.min(...ur),Ti=Math.max(...ur),_i=Ir,Ci=Ti,ii=Math.max(Ci-_i,1);if(Xe.strokeStyle="rgba(255, 255, 255, 0.1)",Xe.lineWidth=1,_i<=0&&Ci>=0){Xe.strokeStyle="rgba(255, 255, 255, 0.3)",Xe.lineWidth=2;const Ji=Dt-rr-(0-_i)/ii*wi;Xe.beginPath(),Xe.moveTo(rr,Ji),Xe.lineTo(kt-rr,Ji),Xe.stroke(),Ji>20&&Ji1&&(Xe.strokeStyle="#EBA0FC",Xe.lineWidth=2,Xe.beginPath(),S.value.forEach((Ji,vi)=>{const vr=rr+Fe*vi/(S.value.length-1),dr=Dt-rr-(Ji.rxPackets-_i)/ii*wi;vi===0?Xe.moveTo(vr,dr):Xe.lineTo(vr,dr)}),Xe.stroke(),Xe.fillStyle="#EBA0FC",S.value.forEach((Ji,vi)=>{const vr=rr+Fe*vi/(S.value.length-1),dr=Dt-rr-(Ji.rxPackets-_i)/ii*wi;Xe.beginPath(),Xe.arc(vr,dr,2,0,2*Math.PI),Xe.fill()})),S.value.length>1&&(Xe.strokeStyle="#FB787B",Xe.lineWidth=2,Xe.beginPath(),S.value.forEach((Ji,vi)=>{const vr=rr+Fe*vi/(S.value.length-1),dr=Dt-rr-(Ji.txPackets-_i)/ii*wi;vi===0?Xe.moveTo(vr,dr):Xe.lineTo(vr,dr)}),Xe.stroke(),Xe.fillStyle="#FB787B",S.value.forEach((Ji,vi)=>{const vr=rr+Fe*vi/(S.value.length-1),dr=Dt-rr-(Ji.txPackets-_i)/ii*wi;Xe.beginPath(),Xe.arc(vr,dr,2,0,2*Math.PI),Xe.fill()})),Xe.fillStyle="rgba(255, 255, 255, 0.6)",Xe.font="12px system-ui",Xe.textAlign="center",Er&&(Xe.fillStyle="rgba(255, 255, 255, 0.6)",Xe.font="14px system-ui",Xe.textAlign="center",Xe.fillText("No packet activity in last 24 hours",kt/2,Dt-15))};return ud(()=>{be(),H.value=window.setInterval(be,3e4),x0(()=>{Se(),setTimeout(()=>{Se()},100)}),window.addEventListener("resize",Se)}),$g(()=>{H.value&&clearInterval(H.value),window.removeEventListener("resize",Se)}),(Re,Xe)=>(Wr(),Qr("div",vue,[Xe[3]||(Xe[3]=qc('

Performance Metrics

Packet Activity (Last 24 Hours)

Received
Transmitted
',3)),Le("div",yue,[Le("canvas",{ref_key:"chartRef",ref:c,class:"absolute inset-0 w-full h-full"},null,512)]),Le("div",_ue,[Le("div",xue,[Le("div",bue,Si(Po(e).packetStats?.total_packets||0),1),Xe[0]||(Xe[0]=Le("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Received",-1))]),Le("div",wue,[Le("div",kue,Si(Po(e).packetStats?.transmitted_packets||0),1),Xe[1]||(Xe[1]=Le("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Transmitted",-1))])]),Le("div",Tue,[Le("div",null,[Le("div",Sue,[ul(Si(ue.value.rxRate.value)+" ",1),ue.value.confidence==="low"?(Wr(),Qr("span",Cue)):Ma("",!0)]),Le("div",Aue,Si(ue.value.rxRate.label),1)]),Le("div",null,[Le("div",Mue,[ul(Si(ue.value.txRate.value)+" ",1),ue.value.confidence==="low"?(Wr(),Qr("span",Eue)):Ma("",!0)]),Le("div",Lue,Si(ue.value.txRate.label),1)]),Le("div",null,[Le("div",Pue,Si(Po(e).packetStats?.dropped_packets||0),1),Xe[2]||(Xe[2]=Le("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Due=kh(Iue,[["__scopeId","data-v-d68902be"]]),zue={class:"relative w-full max-w-4xl max-h-[90vh] overflow-hidden"},Oue={class:"glass-card rounded-[20px] p-8 backdrop-blur-[50px] shadow-2xl border border-white/20"},Bue={class:"flex items-center justify-between mb-6"},Rue={class:"text-white/70 text-sm"},Fue={class:"max-h-[70vh] overflow-y-auto custom-scrollbar"},Nue={class:"mb-6"},jue={class:"glass-card bg-white/5 rounded-[15px] p-4"},Uue={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},$ue={class:"space-y-3"},Hue={class:"flex justify-between py-2 border-b border-white/10"},Vue={class:"text-white font-mono text-sm"},Wue={class:"flex justify-between py-2 border-b border-white/10"},que={class:"text-white font-mono text-xs break-all"},Gue={key:0,class:"flex justify-between py-2 border-b border-white/10"},Zue={class:"text-white font-mono text-xs"},Kue={class:"space-y-3"},Yue={class:"flex justify-between py-2 border-b border-white/10"},Xue={class:"text-white font-semibold"},Jue={class:"flex justify-between py-2 border-b border-white/10"},Que={class:"text-white font-semibold"},ece={class:"flex justify-between py-2 border-b border-white/10"},tce={class:"mb-6"},rce={class:"glass-card bg-white/5 rounded-[15px] p-4"},ice={class:"space-y-3"},nce={class:"flex justify-between py-2 border-b border-white/10"},ace={class:"text-white"},oce={key:0,class:"pt-2"},sce={class:"glass-card bg-black/30 rounded-[10px] p-4 mb-4"},lce={class:"w-full overflow-x-auto"},uce={class:"text-white/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},cce={class:"flex items-center justify-between mb-3"},hce={class:"text-white/80 text-sm font-semibold"},fce={class:"text-white/60 text-xs"},dce={class:"glass-card bg-black/40 rounded-[8px] p-3 mb-3"},pce={class:"font-mono text-xs text-white break-all whitespace-pre-wrap leading-relaxed"},mce={class:"glass-card bg-white/5 rounded-[10px] overflow-hidden"},gce={class:"text-cyan-400 text-sm font-mono break-words min-w-0"},vce={class:"text-white text-sm break-words min-w-0"},yce={class:"text-white text-sm font-semibold break-all min-w-0 overflow-hidden"},_ce=["title"],xce={class:"text-orange-400 text-xs font-mono break-all min-w-0 overflow-hidden"},bce=["title"],wce={class:"grid grid-cols-2 gap-2"},kce={class:"text-cyan-400 text-sm font-mono break-words"},Tce={class:"text-white text-sm break-words"},Sce=["title"],Cce=["title"],Ace={key:0,class:"text-white/60 text-xs italic mt-2 px-1"},Mce={key:1,class:"py-2"},Ece={class:"mb-6"},Lce={class:"glass-card bg-white/5 rounded-[15px] p-4"},Pce={class:"space-y-4"},Ice={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Dce={class:"flex justify-between py-2 border-b border-white/10"},zce={class:"flex justify-between py-2 border-b border-white/10"},Oce={key:0,class:"py-2"},Bce={class:"glass-card bg-black/20 rounded-[10px] p-4"},Rce={class:"flex items-center flex-wrap gap-2"},Fce={class:"relative group"},Nce={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},jce={class:"font-mono text-xs font-semibold text-white/90"},Uce={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},$ce={key:0,class:"mx-2 text-cyan-400/60"},Hce={key:1,class:"py-2"},Vce={class:"text-white/70 text-sm mb-2 flex items-center"},Wce={key:0,class:"w-4 h-4 ml-2 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},qce={key:1,class:"text-yellow-400 text-xs ml-1"},Gce={class:"glass-card bg-black/20 rounded-[10px] p-4"},Zce={class:"flex items-center flex-wrap gap-2"},Kce={class:"relative group"},Yce={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},Xce={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},Jce={key:0,class:"mx-1 text-orange-400/60"},Qce={class:"mb-6"},ehe={class:"glass-card bg-white/5 rounded-[15px] p-4"},the={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},rhe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},ihe={class:"text-lg font-bold text-white"},nhe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},ahe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},ohe={class:"text-lg font-bold text-white"},she={key:0,class:"mb-4"},lhe={class:"flex items-center gap-3"},uhe={class:"flex gap-1"},che={class:"text-white/80 text-sm capitalize"},hhe={key:1,class:"mb-4"},fhe={key:2,class:"mb-4"},dhe={class:"text-white/70 text-sm mb-3"},phe={class:"space-y-2"},mhe={class:"flex items-center gap-3"},ghe={class:"text-white/60 text-sm"},vhe={key:3,class:"mt-6 pt-4 border-t border-white/10"},yhe={class:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4"},_he={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},xhe={class:"text-2xl font-bold text-white"},bhe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},whe={class:"text-2xl font-bold text-white"},khe={class:"text-white/60 text-xs mt-1"},The={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},She={class:"text-white/60 text-xs mt-1"},Che={key:0,class:"glass-card bg-black/20 rounded-[10px] p-4"},Ahe={class:"space-y-3"},Mhe={class:"flex-shrink-0 w-16 text-right"},Ehe={class:"text-white/70 text-xs"},Lhe={class:"flex-1 relative"},Phe={class:"h-8 rounded-lg overflow-hidden bg-white/5 relative"},Ihe={class:"absolute inset-0 flex items-center px-3"},Dhe={class:"text-white text-xs font-mono font-semibold"},zhe={class:"flex-shrink-0 w-12 text-left"},Ohe={class:"text-white/50 text-xs"},Bhe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Rhe={class:"space-y-2"},Fhe={class:"flex justify-between py-2 border-b border-white/10"},Nhe={class:"text-white"},jhe={class:"flex justify-between py-2 border-b border-white/10"},Uhe={class:"space-y-2"},$he={class:"flex justify-between py-2 border-b border-white/10"},Hhe={key:0,class:"flex justify-between py-2 border-b border-white/10"},Vhe={class:"text-red-400 text-sm"},Whe={class:"mt-6 pt-4 border-t border-white/10 flex justify-end"},qhe=Uu({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=ur=>new Date(ur*1e3).toLocaleString(),H=ur=>ur.transmitted?ur.is_duplicate?"text-amber-400":ur.drop_reason?"text-red-400":"text-green-400":"text-red-400",Z=ur=>ur.transmitted?ur.is_duplicate?"Duplicate":ur.drop_reason?"Dropped":"Forwarded":"Dropped",ue=ur=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[ur]||`Unknown Type (${ur})`,be=ur=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[ur]||`Unknown Route (${ur})`,Se=ur=>{if(!ur)return"None";const Ti=ur.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],_i=[];for(let Ci=0;Ci{try{let _i=0;const Ci=Ir.length/2;if(Ci>=100){if(Ir.length>=_i+64){const ii=Ir.slice(_i,_i+64);ur.push({name:"Public Key",byteRange:`${(Ti+_i)/2}-${(Ti+_i+63)/2}`,hexData:ii.match(/.{8}/g)?.join(" ")||ii,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${ii.slice(0,16)}...${ii.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),_i+=64}if(Ir.length>=_i+8){const ii=Ir.slice(_i,_i+8),Ji=parseInt(ii,16),vi=new Date(Ji*1e3);ur.push({name:"Timestamp",byteRange:`${(Ti+_i)/2}-${(Ti+_i+7)/2}`,hexData:ii.match(/.{2}/g)?.join(" ")||ii,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${Ji} (${vi.toLocaleString()})`,binary:Ji.toString(2).padStart(32,"0")}]}),_i+=8}if(Ir.length>=_i+128){const ii=Ir.slice(_i,_i+128);ur.push({name:"Signature",byteRange:`${(Ti+_i)/2}-${(Ti+_i+127)/2}`,hexData:ii.match(/.{8}/g)?.join(" ")||ii,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${ii.slice(0,16)}...${ii.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),_i+=128}if(Ir.length>_i){const ii=Ir.slice(_i);Xe(ur,ii,Ti+_i)}}else ur.push({name:"ADVERT AppData (Partial)",byteRange:`${Ti/2}-${Ti/2+Ci-1}`,hexData:Ir.match(/.{2}/g)?.join(" ")||Ir,description:`Partial ADVERT data - appears to be just AppData portion (${Ci} bytes)`,fields:[{bits:`0-${Ci*8-1}`,name:"Partial Data",value:`${Ci} bytes - attempting to decode as AppData`,binary:`${Ci} bytes (${Ci*8} bits)`}]}),Xe(ur,Ir,Ti)}catch(_i){ur.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:Ir.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${_i instanceof Error?_i.message:"Unknown error"}`,binary:"Invalid"}]})}},Xe=(ur,Ir,Ti)=>{try{const _i=Ir.length/2;ur.push({name:"AppData",byteRange:`${Ti/2}-${Ti/2+_i-1}`,hexData:Ir.match(/.{2}/g)?.join(" ")||Ir,description:`Node advertisement application data (${_i} bytes)`,fields:[{bits:`0-${_i*8-1}`,name:"Application Data",value:`${_i} bytes (contains flags, location, name, etc.)`,binary:`${_i} bytes (${_i*8} bits)`}]});let Ci=0;if(Ir.length>=2){const ii=parseInt(Ir.slice(Ci,Ci+2),16),Ji=[],vi=!!(ii&16),vr=!!(ii&32),dr=!!(ii&64),Ar=!!(ii&128);if(ii&1&&Ji.push("is chat node"),ii&2&&Ji.push("is repeater"),ii&4&&Ji.push("is room server"),ii&8&&Ji.push("is sensor"),vi&&Ji.push("has location"),vr&&Ji.push("has feature 1"),dr&&Ji.push("has feature 2"),Ar&&Ji.push("has name"),ur.push({name:"AppData Flags",byteRange:`${(Ti+Ci)/2}`,hexData:`0x${Ir.slice(Ci,Ci+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:Ji.join(", ")||"none",binary:ii.toString(2).padStart(8,"0")}]}),Ci+=2,vi&&Ir.length>=Ci+16){const ti=Ir.slice(Ci,Ci+8),Xr=[];for(let sn=6;sn>=0;sn-=2)Xr.push(ti.slice(sn,sn+2));const ei=parseInt(Xr.join(""),16),Di=ei>2147483647?ei-4294967296:ei,qn=Di/1e6,Qn=Ir.slice(Ci+8,Ci+16),ka=[];for(let sn=6;sn>=0;sn-=2)ka.push(Qn.slice(sn,sn+2));const Ta=parseInt(ka.join(""),16),so=Ta>2147483647?Ta-4294967296:Ta,Yn=so/1e6;ur.push({name:"Location Data",byteRange:`${(Ti+Ci)/2}-${(Ti+Ci+15)/2}`,hexData:`${ti.match(/.{2}/g)?.join(" ")||ti} ${Qn.match(/.{2}/g)?.join(" ")||Qn}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${qn.toFixed(6)}° (raw: ${Di})`,binary:Di.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${Yn.toFixed(6)}° (raw: ${so})`,binary:so.toString(2).padStart(32,"0")}]}),Ci+=16}if(vr&&Ir.length>=Ci+4){const ti=Ir.slice(Ci,Ci+4),Xr=parseInt(ti,16);ur.push({name:"Feature 1",byteRange:`${(Ti+Ci)/2}-${(Ti+Ci+3)/2}`,hexData:ti.match(/.{2}/g)?.join(" ")||ti,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${Xr}`,binary:Xr.toString(2).padStart(16,"0")}]}),Ci+=4}if(dr&&Ir.length>=Ci+4){const ti=Ir.slice(Ci,Ci+4),Xr=parseInt(ti,16);ur.push({name:"Feature 2",byteRange:`${(Ti+Ci)/2}-${(Ti+Ci+3)/2}`,hexData:ti.match(/.{2}/g)?.join(" ")||ti,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${Xr}`,binary:Xr.toString(2).padStart(16,"0")}]}),Ci+=4}if(Ar&&Ir.length>Ci){const ti=Ir.slice(Ci),Xr=ti.match(/.{2}/g)||[],ei=Xr.map(Di=>{const qn=parseInt(Di,16);return qn>=32&&qn<=126?String.fromCharCode(qn):"."}).join("").replace(/\.+$/,"");ur.push({name:"Node Name",byteRange:`${(Ti+Ci)/2}-${(Ti+Ir.length-1)/2}`,hexData:ti.match(/.{2}/g)?.join(" ")||ti,description:`Node name string (${Xr.length} bytes)`,fields:[{bits:`0-${Xr.length*8-1}`,name:"Node Name",value:`"${ei}"`,binary:`ASCII text (${Xr.length} bytes)`}]})}}}catch(_i){ur.push({name:"AppData Parse Error",byteRange:"N/A",hexData:Ir.slice(0,Math.min(32,Ir.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${_i instanceof Error?_i.message:"Unknown error"}`,binary:"Invalid"}]})}},vt=ur=>{if(!ur)return[];if(Array.isArray(ur))return ur;if(typeof ur=="string")try{return JSON.parse(ur)}catch{return[]}return[]},bt=ur=>{const Ir=[];if(!ur)return Ir;try{const Ti=ur.raw_packet;if(Ti){const _i=Ti.replace(/\s+/g,"").toUpperCase();let Ci=0;if(_i.length>=2){const ii=_i.slice(Ci,Ci+2),Ji=parseInt(ii,16),vi=Ji&3,vr=(Ji&60)>>2,dr=(Ji&192)>>6,Ar={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},ti={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(Ir.push({name:"Header",byteRange:"0",hexData:`0x${ii}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Ar[vi]||"Unknown",binary:vi.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:ti[vr]||"Unknown",binary:vr.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:dr.toString(),binary:dr.toString(2).padStart(2,"0")}]}),Ci+=2,(vi===0||vi===3)&&_i.length>=Ci+8){const ei=_i.slice(Ci,Ci+8),Di=parseInt(ei.slice(0,4),16),qn=parseInt(ei.slice(4,8),16);Ir.push({name:"Transport Codes",byteRange:"1-4",hexData:`${ei.slice(0,4)} ${ei.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:Di.toString(),binary:Di.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:qn.toString(),binary:qn.toString(2).padStart(16,"0")}]}),Ci+=8}if(_i.length>=Ci+2){const ei=_i.slice(Ci,Ci+2),Di=parseInt(ei,16);if(Ir.push({name:"Path Length",byteRange:`${Ci/2}`,hexData:`0x${ei}`,description:`${Di} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${Di} bytes`,binary:Di.toString(2).padStart(8,"0")}]}),Ci+=2,Di>0&&_i.length>=Ci+Di*2){const qn=_i.slice(Ci,Ci+Di*2);Ir.push({name:"Path Data",byteRange:`${Ci/2}-${(Ci+Di*2-2)/2}`,hexData:qn.match(/.{2}/g)?.join(" ")||qn,description:"Routing path information",fields:[{bits:`0-${Di*8-1}`,name:"Route Path",value:`${Di} bytes of routing data`,binary:`${Di} bytes (${Di*8} bits)`}]}),Ci+=Di*2}}if(_i.length>Ci){const ei=_i.slice(Ci),Di=ei.length/2;vr===4?Re(Ir,ei,Ci):Ir.push({name:"Payload Data",byteRange:`${Ci/2}-${Ci/2+Di-1}`,hexData:ei.match(/.{2}/g)?.join(" ")||ei,description:"Application data content",fields:[{bits:`0-${Di*8-1}`,name:"Application Data",value:`${Di} bytes`,binary:`${Di} bytes (${Di*8} bits)`}]})}}}else{if(ur.header){const _i=ur.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),Ci=parseInt(_i,16),ii=Ci&3,Ji=(Ci&60)>>2,vi=(Ci&192)>>6,vr={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},dr={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};Ir.push({name:"Header",byteRange:"0",hexData:`0x${_i}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:vr[ii]||"Unknown",binary:ii.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:dr[Ji]||"Unknown",binary:Ji.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:vi.toString(),binary:vi.toString(2).padStart(2,"0")}]}),ur.transport_codes&&Ir.push({name:"Transport Codes",byteRange:"1-4",hexData:ur.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:ur.transport_codes,binary:"Available in separate field"}]}),ur.original_path&&ur.original_path.length>0&&Ir.push({name:"Original Path",byteRange:"?",hexData:ur.original_path.join(" "),description:`Original routing path (${ur.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${ur.original_path.length} nodes`,binary:"Available as node list"}]}),ur.forwarded_path&&ur.forwarded_path.length>0&&Ir.push({name:"Forwarded Path",byteRange:"?",hexData:ur.forwarded_path.join(" "),description:`Forwarded routing path (${ur.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${ur.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(ur.payload){const _i=ur.payload.replace(/\s+/g,"").toUpperCase(),Ci=_i.length/2;ur.type===4?Re(Ir,_i,0):Ir.push({name:"Payload Data",byteRange:`0-${Ci-1}`,hexData:_i.match(/.{2}/g)?.join(" ")||_i,description:`Application data content (${Ci} bytes)`,fields:[{bits:`0-${Ci*8-1}`,name:"Application Data",value:`${Ci} bytes`,binary:`${Ci} bytes (${Ci*8} bits)`}]})}}}catch{Ir.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return Ir},kt=ur=>ur==null?"text-white/50":ur>=10?"text-green-400":ur>=5?"text-cyan-400":ur>=0?"text-yellow-400":"text-red-400",Dt=(ur,Ir=8)=>{if(ur==null)return{level:0,className:"signal-none"};const _i={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[Ir]||-10;let Ci,ii;return ur>=_i+10?(Ci=4,ii="signal-excellent"):ur>=_i+5?(Ci=3,ii="signal-good"):ur>=_i?(Ci=2,ii="signal-fair"):(Ci=1,ii="signal-poor"),{level:Ci,className:ii}},rr=ur=>{if(!ur)return[];try{const Ir=JSON.parse(ur);return Array.isArray(Ir)?Ir:[]}catch{return[]}},Er=ur=>ur>=1e3?`${(ur/1e3).toFixed(2)}s`:`${Math.round(ur)}ms`,Fe=ur=>{ur.key==="Escape"&&c("close")},wi=ur=>{ur.target===ur.currentTarget&&c("close")};return(ur,Ir)=>(Wr(),Sd(gS,{to:"body"},[il(Rx,{name:"modal",appear:""},{default:Iv(()=>[ur.isOpen&&ur.packet?(Wr(),Qr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:wi,onKeydown:Fe,tabindex:"0"},[Ir[46]||(Ir[46]=Le("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),Le("div",zue,[Le("div",Oue,[Le("div",Bue,[Le("div",null,[Ir[2]||(Ir[2]=Le("h2",{class:"text-2xl font-bold text-white mb-1"},"Packet Details",-1)),Le("p",Rue,Si(ue(ur.packet.type))+" - "+Si(be(ur.packet.route)),1)]),Le("button",{onClick:Ir[0]||(Ir[0]=Ti=>c("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-colors duration-200 text-white/70 hover:text-white"},Ir[3]||(Ir[3]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",Fue,[Le("div",Nue,[Ir[10]||(Ir[10]=Le("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Le("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),ul(" Basic Information ")],-1)),Le("div",jue,[Le("div",Uue,[Le("div",$ue,[Le("div",Hue,[Ir[4]||(Ir[4]=Le("span",{class:"text-white/70 text-sm"},"Timestamp",-1)),Le("span",Vue,Si(S(ur.packet.timestamp)),1)]),Le("div",Wue,[Ir[5]||(Ir[5]=Le("span",{class:"text-white/70 text-sm"},"Packet Hash",-1)),Le("span",que,Si(ur.packet.packet_hash),1)]),ur.packet.header?(Wr(),Qr("div",Gue,[Ir[6]||(Ir[6]=Le("span",{class:"text-white/70 text-sm"},"Header",-1)),Le("span",Zue,Si(ur.packet.header),1)])):Ma("",!0)]),Le("div",Kue,[Le("div",Yue,[Ir[7]||(Ir[7]=Le("span",{class:"text-white/70 text-sm"},"Type",-1)),Le("span",Xue,Si(ur.packet.type)+" ("+Si(ue(ur.packet.type))+")",1)]),Le("div",Jue,[Ir[8]||(Ir[8]=Le("span",{class:"text-white/70 text-sm"},"Route",-1)),Le("span",Que,Si(ur.packet.route)+" ("+Si(be(ur.packet.route))+")",1)]),Le("div",ece,[Ir[9]||(Ir[9]=Le("span",{class:"text-white/70 text-sm"},"Status",-1)),Le("span",{class:eo(["font-semibold",H(ur.packet)])},Si(Z(ur.packet)),3)])])])])]),Le("div",tce,[Ir[20]||(Ir[20]=Le("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Le("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),ul(" Payload Data ")],-1)),Le("div",rce,[Le("div",ice,[Le("div",nce,[Ir[11]||(Ir[11]=Le("span",{class:"text-white/70 text-sm"},"Payload Length",-1)),Le("span",ace,Si(ur.packet.payload_length||ur.packet.length)+" bytes",1)]),ur.packet.payload?(Wr(),Qr("div",oce,[Ir[18]||(Ir[18]=Le("div",{class:"text-white/70 text-sm mb-3"},"Payload Analysis",-1)),Le("div",sce,[Ir[12]||(Ir[12]=Le("div",{class:"text-white/70 text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),Le("div",lce,[Le("pre",uce,Si(Se(ur.packet.payload)),1)])]),(Wr(!0),Qr(js,null,au(bt(ur.packet).filter(Ti=>!Ti.name.includes("Parse Error")),(Ti,_i)=>(Wr(),Qr("div",{key:_i,class:"mb-4"},[Le("div",cce,[Le("h4",hce,Si(Ti.name),1),Le("span",fce,"Bytes "+Si(Ti.byteRange),1)]),Le("div",dce,[Le("div",pce,Si(Ti.hexData),1)]),Le("div",mce,[Ir[17]||(Ir[17]=Le("div",{class:"hidden md:grid grid-cols-4 gap-3 p-3 bg-white/10 text-white/70 text-xs font-semibold uppercase tracking-wide"},[Le("div",{class:"min-w-0"},"Bits"),Le("div",{class:"min-w-0"},"Field"),Le("div",{class:"min-w-0"},"Value"),Le("div",{class:"min-w-0"},"Binary")],-1)),(Wr(!0),Qr(js,null,au(Ti.fields,(Ci,ii)=>(Wr(),Qr("div",{key:ii,class:"hidden md:grid grid-cols-4 gap-3 p-3 border-b border-white/5 last:border-b-0 hover:bg-white/5 transition-colors"},[Le("div",gce,Si(Ci.bits),1),Le("div",vce,Si(Ci.name),1),Le("div",yce,[Le("span",{class:"block",title:Ci.value},Si(Ci.value),9,_ce)]),Le("div",xce,[Le("span",{class:"block",title:Ci.binary},Si(Ci.binary),9,bce)])]))),128)),(Wr(!0),Qr(js,null,au(Ti.fields,(Ci,ii)=>(Wr(),Qr("div",{key:`mobile-${ii}`,class:"md:hidden p-3 border-b border-white/5 last:border-b-0 space-y-2"},[Le("div",wce,[Le("div",null,[Ir[13]||(Ir[13]=Le("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Bits:",-1)),Le("div",kce,Si(Ci.bits),1)]),Le("div",null,[Ir[14]||(Ir[14]=Le("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Field:",-1)),Le("div",Tce,Si(Ci.name),1)])]),Le("div",null,[Ir[15]||(Ir[15]=Le("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Value:",-1)),Le("div",{class:"text-white text-sm font-semibold break-all",title:Ci.value},Si(Ci.value),9,Sce)]),Le("div",null,[Ir[16]||(Ir[16]=Le("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Binary:",-1)),Le("div",{class:"text-orange-400 text-xs font-mono break-all",title:Ci.binary},Si(Ci.binary),9,Cce)])]))),128))]),Ti.description?(Wr(),Qr("div",Ace,Si(Ti.description),1)):Ma("",!0)]))),128))])):(Wr(),Qr("div",Mce,Ir[19]||(Ir[19]=[Le("span",{class:"text-white/70 text-sm"},"Payload:",-1),Le("span",{class:"text-white/50 ml-2"},"None",-1)])))])])]),Le("div",Ece,[Ir[28]||(Ir[28]=Le("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Le("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),ul(" Path Information ")],-1)),Le("div",Lce,[Le("div",Pce,[Le("div",Ice,[Le("div",Dce,[Ir[21]||(Ir[21]=Le("span",{class:"text-white/70 text-sm"},"Source Hash",-1)),Le("span",{class:eo(["text-white font-mono text-xs",r.localHash&&ur.packet.src_hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},Si(ur.packet.src_hash||"Unknown"),3)]),Le("div",zce,[Ir[22]||(Ir[22]=Le("span",{class:"text-white/70 text-sm"},"Destination Hash",-1)),Le("span",{class:eo(["text-white font-mono text-xs",r.localHash&&ur.packet.dst_hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},Si(ur.packet.dst_hash||"Broadcast"),3)])]),vt(ur.packet.original_path).length>0?(Wr(),Qr("div",Oce,[Ir[24]||(Ir[24]=Le("div",{class:"text-white/70 text-sm mb-2"},"Original Path",-1)),Le("div",Bce,[Le("div",Rce,[(Wr(!0),Qr(js,null,au(vt(ur.packet.original_path),(Ti,_i)=>(Wr(),Qr("div",{key:_i,class:"flex items-center"},[Le("div",Fce,[Le("div",Nce,[Le("div",jce,Si(Ti.length<=2?Ti.toUpperCase():Ti.slice(0,2).toUpperCase()),1)]),Le("div",Uce," Node: "+Si(Ti),1)]),_i0?(Wr(),Qr("div",Hce,[Le("div",Vce,[Ir[26]||(Ir[26]=ul(" Forwarded Path ",-1)),JSON.stringify(vt(ur.packet.original_path))!==JSON.stringify(vt(ur.packet.forwarded_path))?(Wr(),Qr("svg",Wce,Ir[25]||(Ir[25]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Ma("",!0),JSON.stringify(vt(ur.packet.original_path))!==JSON.stringify(vt(ur.packet.forwarded_path))?(Wr(),Qr("span",qce,"(Modified)")):Ma("",!0)]),Le("div",Gce,[Le("div",Zce,[(Wr(!0),Qr(js,null,au(vt(ur.packet.forwarded_path),(Ti,_i)=>(Wr(),Qr("div",{key:_i,class:"flex items-center"},[Le("div",Kce,[Le("div",{class:eo(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-400/40 rounded-lg transform transition-all hover:scale-105",r.localHash&&Ti===r.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-400/60"])},[Le("div",{class:eo(["font-mono text-xs font-semibold",r.localHash&&Ti===r.localHash?"text-yellow-200":"text-white/90"])},Si(Ti.slice(0,2).toUpperCase()),3),r.localHash&&Ti===r.localHash?(Wr(),Qr("div",Yce)):Ma("",!0)],2),Le("div",Xce,Si(Ti),1)]),_iLe("div",{key:Ti,class:eo(["w-2 h-6 rounded-sm transition-all duration-300",Ti<=Dt(ur.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[Dt(ur.packet.snr).className]:"bg-white/10"])},null,2)),64))]),Le("span",che,Si(Dt(ur.packet.snr).className.replace("signal-","")),1)])])):(Wr(),Qr("div",hhe,Ir[35]||(Ir[35]=[Le("div",{class:"text-white/70 text-sm mb-2"},"Signal Quality",-1),Le("div",{class:"text-white/50 text-sm italic"},"N/A (TX Packet)",-1)]))),ur.packet.is_trace&&ur.packet.path_snr_details&&ur.packet.path_snr_details.length>0?(Wr(),Qr("div",fhe,[Le("div",dhe,"Path SNR Details ("+Si(ur.packet.path_snr_details.length)+" hops)",1),Le("div",phe,[(Wr(!0),Qr(js,null,au(ur.packet.path_snr_details,(Ti,_i)=>(Wr(),Qr("div",{key:_i,class:"flex items-center justify-between p-2 glass-card bg-black/20 rounded-[8px]"},[Le("div",mhe,[Le("span",ghe,Si(_i+1)+".",1),Le("span",{class:eo(["font-mono text-xs text-white",r.localHash&&Ti.hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},Si(Ti.hash),3)]),Le("span",{class:eo(["text-sm font-bold",kt(Ti.snr_db)])},Si(Ti.snr_db.toFixed(1))+"dB ",3)]))),128))])])):Ma("",!0),ur.packet.transmitted&&ur.packet.lbt_attempts!==void 0?(Wr(),Qr("div",vhe,[Ir[40]||(Ir[40]=Le("div",{class:"text-white/70 text-sm mb-3 flex items-center"},[Le("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),ul(" Listen Before Talk (LBT) Metrics ")],-1)),Le("div",yhe,[Le("div",_he,[Ir[36]||(Ir[36]=Le("div",{class:"text-white/70 text-xs mb-1"},"CAD Attempts",-1)),Le("div",xhe,Si(ur.packet.lbt_attempts),1)]),Le("div",bhe,[Ir[37]||(Ir[37]=Le("div",{class:"text-white/70 text-xs mb-1"},"Total LBT Delay",-1)),Le("div",whe,Si(Er(rr(ur.packet.lbt_backoff_delays_ms).reduce((Ti,_i)=>Ti+_i,0))),1),Le("div",khe,Si(rr(ur.packet.lbt_backoff_delays_ms).length)+" backoffs ",1)]),Le("div",The,[Ir[38]||(Ir[38]=Le("div",{class:"text-white/70 text-xs mb-1"},"Channel Status",-1)),Le("div",{class:eo(["text-lg font-bold",ur.packet.lbt_channel_busy?"text-yellow-400":"text-green-400"])},Si(ur.packet.lbt_channel_busy?"BUSY":"CLEAR"),3),Le("div",She,Si(ur.packet.lbt_channel_busy?"Waited for clear":"Immediate TX"),1)])]),rr(ur.packet.lbt_backoff_delays_ms).length>0?(Wr(),Qr("div",Che,[Ir[39]||(Ir[39]=Le("div",{class:"text-white/70 text-xs mb-3 font-semibold"},"Backoff Pattern (Exponential with Jitter)",-1)),Le("div",Ahe,[(Wr(!0),Qr(js,null,au(rr(ur.packet.lbt_backoff_delays_ms),(Ti,_i)=>(Wr(),Qr("div",{key:_i,class:"flex items-center gap-3"},[Le("div",Mhe,[Le("span",Ehe,"Attempt "+Si(_i+1),1)]),Le("div",Lhe,[Le("div",Phe,[Le("div",{class:eo(["h-full rounded-lg transition-all duration-300",[_i===0?"bg-gradient-to-r from-cyan-500/50 to-cyan-600/50":_i===1?"bg-gradient-to-r from-yellow-500/50 to-yellow-600/50":_i===2?"bg-gradient-to-r from-orange-500/50 to-orange-600/50":"bg-gradient-to-r from-red-500/50 to-red-600/50"]]),style:om({width:`${Math.min(100,Ti/Math.max(...rr(ur.packet.lbt_backoff_delays_ms))*100)}%`})},[Le("div",Ihe,[Le("span",Dhe,Si(Er(Ti)),1)])],6)])]),Le("div",zhe,[Le("span",Ohe,Si(Math.round(Ti/rr(ur.packet.lbt_backoff_delays_ms).reduce((Ci,ii)=>Ci+ii,0)*100))+"% ",1)])]))),128))])])):Ma("",!0)])):Ma("",!0),Le("div",Bhe,[Le("div",Rhe,[Le("div",Fhe,[Ir[41]||(Ir[41]=Le("span",{class:"text-white/70 text-sm"},"TX Delay",-1)),Le("span",Nhe,Si(Number(ur.packet.tx_delay_ms)>0?Number(ur.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),Le("div",jhe,[Ir[42]||(Ir[42]=Le("span",{class:"text-white/70 text-sm"},"Transmitted",-1)),Le("span",{class:eo(ur.packet.transmitted?"text-green-400":"text-red-400")},Si(ur.packet.transmitted?"Yes":"No"),3)])]),Le("div",Uhe,[Le("div",$he,[Ir[43]||(Ir[43]=Le("span",{class:"text-white/70 text-sm"},"Is Duplicate",-1)),Le("span",{class:eo(ur.packet.is_duplicate?"text-amber-400":"text-white/60")},Si(ur.packet.is_duplicate?"Yes":"No"),3)]),ur.packet.drop_reason?(Wr(),Qr("div",Hhe,[Ir[44]||(Ir[44]=Le("span",{class:"text-white/70 text-sm"},"Drop Reason",-1)),Le("span",Vhe,Si(ur.packet.drop_reason),1)])):Ma("",!0)])])])])]),Le("div",Whe,[Le("button",{onClick:Ir[1]||(Ir[1]=Ti=>c("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-white transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):Ma("",!0)]),_:1})]))}}),Ghe=kh(qhe,[["__scopeId","data-v-57e9f282"]]),Zhe={class:"glass-card rounded-[20px] p-6"},Khe={class:"flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container"},Yhe={class:"flex items-center gap-2 header-info relative"},Xhe={class:"text-dark-text text-sm packet-count"},Jhe=["title"],Qhe={class:"hidden sm:inline"},efe={key:0,class:"absolute -right-6 top-1/2 -translate-y-1/2 text-primary loading-indicator"},tfe={key:1,class:"text-accent-red text-sm error-indicator"},rfe={class:"flex items-center gap-3 lg:flex filter-controls"},ife={class:"flex flex-col"},nfe=["value"],afe={class:"flex flex-col"},ofe=["value"],sfe={class:"flex flex-col"},lfe={class:"flex flex-col reset-container"},ufe=["disabled"],cfe={class:"space-y-4 overflow-hidden"},hfe=["onClick"],ffe={class:"hidden lg:grid grid-cols-12 gap-2 items-center"},dfe={class:"col-span-1 text-white text-sm"},pfe={class:"col-span-1 flex items-center gap-2"},mfe={class:"flex flex-col"},gfe={class:"text-white text-xs"},vfe=["title"],yfe={class:"col-span-2"},_fe={class:"col-span-1 text-white text-xs"},xfe={class:"col-span-2"},bfe={class:"space-y-1"},wfe={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},kfe={class:"col-span-1 text-white text-xs"},Tfe={class:"col-span-1 text-white text-xs"},Sfe={class:"col-span-1 text-white text-xs"},Cfe={class:"col-span-1 text-white text-xs"},Afe={key:0,class:"flex items-center gap-1"},Mfe={class:"col-span-1"},Efe={key:0,class:"text-accent-red text-[8px] italic truncate"},Lfe={class:"lg:hidden space-y-2"},Pfe={class:"flex items-center justify-between"},Ife={class:"flex items-center gap-2"},Dfe={class:"flex flex-col"},zfe={class:"text-white text-sm font-medium"},Ofe=["title"],Bfe={class:"flex items-center gap-2 text-right"},Rfe={class:"text-white/70 text-xs"},Ffe={class:"flex items-center justify-between"},Nfe={class:"flex items-center gap-2"},jfe={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},Ufe={class:"flex items-center gap-2"},$fe={class:"flex items-center gap-1"},Hfe={key:0,class:"flex gap-0.5"},Vfe={class:"text-white text-xs"},Wfe={class:"flex items-center justify-between text-white/60 text-xs"},qfe={class:"flex items-center gap-3"},Gfe={class:"flex items-center gap-2"},Zfe={key:0,class:"flex items-center gap-1"},Kfe={key:0,class:"text-accent-red text-xs italic"},Yfe={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-dark-border pagination-container"},Xfe={class:"flex items-center gap-4 pagination-info"},Jfe={class:"text-dark-text text-sm"},Qfe={key:0,class:"flex items-center gap-2 load-more-section"},ede=["disabled"],tde={class:"text-dark-text text-xs load-more-count"},rde={class:"flex items-center gap-2 pagination-controls"},ide=["disabled"],nde={class:"flex items-center gap-1 page-numbers"},ade={key:1,class:"text-dark-text text-sm px-2 ellipsis"},ode=["onClick"],sde={key:2,class:"text-dark-text text-sm px-2 ellipsis"},lde=["disabled"],ude={key:1,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},cde={class:"flex items-center gap-4"},hde={class:"text-dark-text text-sm"},fde={class:"text-dark-text text-xs"},dde={key:2,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},P3=10,ax=1e3,pde=Uu({name:"PacketTable",__name:"PacketTable",setup(t){const e=i4(),r=vn(1),c=vn(null),S=vn(100),H=vn(!1),Z=vn(!1);let ue=null;w0(()=>e.isLoading,Yn=>{Yn?(ue&&(clearTimeout(ue),ue=null),Z.value=!0):ue=window.setTimeout(()=>{Z.value=!1,ue=null},600)});const be=vn(null),Se=vn(!1),Re=Yn=>{be.value=Yn,Se.value=!0},Xe=()=>{Se.value=!1,be.value=null},vt=vn("all"),bt=vn("all"),kt=vn(!1),Dt=vn(null),rr=["all","0","1","2","3","4","5","6","7","8","9","10","11"],Er=["all","1","2"],Fe=Do(()=>{let Yn=e.recentPackets;if(vt.value!=="all"){const sn=parseInt(vt.value);Yn=Yn.filter(an=>an.type===sn)}if(bt.value!=="all"){const sn=parseInt(bt.value);Yn=Yn.filter(an=>an.route===sn)}return kt.value&&Dt.value!==null&&(Yn=Yn.filter(sn=>sn.timestamp>=Dt.value)),Yn}),wi=Do(()=>{const Yn=(r.value-1)*P3,sn=Yn+P3;return Fe.value.slice(Yn,sn)}),ur=Do(()=>Math.ceil(Fe.value.length/P3)),Ir=Do(()=>r.value===ur.value),Ti=Do(()=>e.recentPackets.length>=S.value&&S.valueIr.value&&Ti.value&&!H.value),Ci=Yn=>new Date(Yn*1e3).toLocaleTimeString(void 0,{hour12:!0}),ii=Yn=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTI_PART",11:"CONTROL"})[Yn]||`TYPE_${Yn}`,Ji=Yn=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[Yn]||`Route ${Yn}`,vi=Yn=>Yn.transmitted?"text-accent-green":"text-primary",vr=Yn=>Yn.drop_reason?"Dropped":Yn.transmitted?"Forward":"Received",dr=Yn=>Yn===1?"bg-[#223231] text-accent-cyan":"bg-secondary/30 text-secondary",Ar=Yn=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[Yn]||"bg-gray-500",ti=Yn=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[Yn]||"border-l-gray-500",Xr=Yn=>!Yn.transmitted||!Yn.lbt_attempts||Yn.lbt_attempts===0?"bg-green-400":Yn.lbt_attempts===1?"bg-cyan-400":Yn.lbt_attempts===2?"bg-yellow-400":"bg-orange-400",ei=Yn=>Yn>=1e3?(Yn/1e3).toFixed(2)+"s":Yn.toFixed(1)+"ms",Di=Yn=>{if(Yn.type!==4||!Yn.payload)return null;try{const sn=Yn.payload.replace(/\s+/g,"").toUpperCase();let an=sn,zn=0;if(sn.length/2>=100)if(sn.length>200)an=sn.slice(200),zn=0;else return null;if(an.length>=2){const Ya=parseInt(an.slice(0,2),16);zn+=2;const zo=!!(Ya&16),_a=!!(Ya&32),Ur=!!(Ya&64);if(!!!(Ya&128))return null;if(zo&&an.length>=zn+16&&(zn+=16),_a&&an.length>=zn+4&&(zn+=4),Ur&&an.length>=zn+4&&(zn+=4),an.length>zn){const go=(an.slice(zn).match(/.{2}/g)||[]).map(ko=>{const ss=parseInt(ko,16);return ss>=32&&ss<=126?String.fromCharCode(ss):"."}).join("").replace(/\.*$/,"");return go.length>0?go:null}}}catch(sn){console.error("Error parsing ADVERT node name:",sn)}return null},qn=()=>{vt.value="all",bt.value="all",kt.value=!1,Dt.value=null,r.value=1},Qn=()=>{kt.value?(kt.value=!1,Dt.value=null):(kt.value=!0,Dt.value=Date.now()/1e3),r.value=1},ka=Do(()=>Dt.value?new Date(Dt.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):""),Ta=async Yn=>{try{const sn=Yn||S.value;await e.fetchRecentPackets({limit:sn})}catch(sn){console.error("Error fetching packet data:",sn)}},so=async()=>{if(!(H.value||S.value>=ax)){H.value=!0;try{const Yn=Math.min(S.value+200,ax);S.value=Yn,await Ta(Yn)}catch(Yn){console.error("Error loading more records:",Yn)}finally{H.value=!1}}};return ud(async()=>{await Ta(),c.value=window.setInterval(Ta,1e4)}),$g(()=>{c.value&&clearInterval(c.value),ue&&clearTimeout(ue)}),(Yn,sn)=>(Wr(),Qr(js,null,[Le("div",Zhe,[Le("div",Khe,[Le("div",Yhe,[sn[8]||(sn[8]=Le("h3",{class:"text-white text-xl font-semibold"},"Recent Packets",-1)),Le("span",Xhe," ("+Si(Fe.value.length)+" of "+Si(Po(e).recentPackets.length)+") ",1),kt.value?(Wr(),Qr("span",{key:0,class:"text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap",title:`Filter activated at ${ka.value}`},[Le("span",Qhe,"Live Mode (since "+Si(ka.value)+")",1),sn[6]||(sn[6]=Le("span",{class:"sm:hidden"},"Live",-1))],8,Jhe)):Ma("",!0),il(Rx,{name:"fade"},{default:Iv(()=>[Z.value?(Wr(),Qr("div",efe,sn[7]||(sn[7]=[Le("div",{class:"w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin"},null,-1)]))):Ma("",!0)]),_:1}),Po(e).error?(Wr(),Qr("span",tfe,Si(Po(e).error),1)):Ma("",!0)]),Le("div",rfe,[Le("div",ife,[sn[9]||(sn[9]=Le("label",{class:"text-dark-text text-xs mb-1"},"Type",-1)),Sl(Le("select",{"onUpdate:modelValue":sn[0]||(sn[0]=an=>vt.value=an),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Wr(),Qr(js,null,au(rr,an=>Le("option",{key:an,value:an,class:"bg-[#1A1E1F] text-white"},Si(an==="all"?"All Types":`Type ${an} (${ii(parseInt(an))})`),9,nfe)),64))],512),[[_g,vt.value]])]),Le("div",afe,[sn[10]||(sn[10]=Le("label",{class:"text-dark-text text-xs mb-1"},"Route",-1)),Sl(Le("select",{"onUpdate:modelValue":sn[1]||(sn[1]=an=>bt.value=an),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(Wr(),Qr(js,null,au(Er,an=>Le("option",{key:an,value:an,class:"bg-[#1A1E1F] text-white"},Si(an==="all"?"All Routes":`Route ${an} (${Ji(parseInt(an))})`),9,ofe)),64))],512),[[_g,bt.value]])]),Le("div",sfe,[sn[11]||(sn[11]=Le("label",{class:"text-dark-text text-xs mb-1"},"Filter",-1)),Le("button",{onClick:Qn,class:eo(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":kt.value,"border-dark-border text-dark-text hover:border-primary hover:text-white hover:bg-primary/5":!kt.value}])},Si(kt.value?"New Only":"Show New"),3)]),Le("div",lfe,[sn[12]||(sn[12]=Le("label",{class:"text-transparent text-xs mb-1"},".",-1)),Le("button",{onClick:qn,class:eo(["glass-card border border-dark-border hover:border-primary rounded-[10px] px-4 py-2 text-dark-text hover:text-white text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-dark-border hover:text-dark-text":vt.value==="all"&&bt.value==="all"&&!kt.value,"hover:bg-primary/10":vt.value!=="all"||bt.value!=="all"||kt.value}]),disabled:vt.value==="all"&&bt.value==="all"&&!kt.value}," Reset ",10,ufe)])])]),sn[18]||(sn[18]=qc('',1)),Le("div",cfe,[il(Uae,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:Iv(()=>[(Wr(!0),Qr(js,null,au(wi.value,(an,zn)=>(Wr(),Qr("div",{key:`${an.packet_hash}_${an.timestamp}_${zn}`,class:eo(["packet-row border-b border-dark-border/50 pb-4 hover:bg-white/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",ti(an.type)]),onClick:Ra=>Re(an)},[Le("div",ffe,[Le("div",dfe,Si(Ci(an.timestamp)),1),Le("div",pfe,[Le("div",{class:eo(["w-2 h-2 rounded-full",Ar(an.type)])},null,2),Le("div",mfe,[Le("span",gfe,Si(ii(an.type)),1),an.type===4&&Di(an)?(Wr(),Qr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate",title:Di(an)||void 0},Si(Di(an)),9,vfe)):Ma("",!0)])]),Le("div",yfe,[Le("span",{class:eo(["inline-block px-2 py-1 rounded text-xs font-medium",dr(an.route)])},Si(Ji(an.route)),3)]),Le("div",_fe,Si(an.length)+"B",1),Le("div",xfe,[Le("div",bfe,[Le("span",wfe,Si(an.src_hash?.slice(-4)||"????")+" → "+Si(an.dst_hash?.slice(-4)||"????"),1)])]),Le("div",kfe,Si(an.rssi!=null?an.rssi.toFixed(0):"N/A"),1),Le("div",Tfe,Si(an.snr!=null?an.snr.toFixed(1)+"dB":"N/A"),1),Le("div",Sfe,Si(an.score!=null?an.score.toFixed(2):"N/A"),1),Le("div",Cfe,[Number(an.tx_delay_ms)>0?(Wr(),Qr("div",Afe,[an.transmitted?(Wr(),Qr("div",{key:0,class:eo(["w-1.5 h-1.5 rounded-full flex-shrink-0",Xr(an)])},null,2)):Ma("",!0),Le("span",null,Si(ei(Number(an.tx_delay_ms))),1)])):Ma("",!0)]),Le("div",Mfe,[Le("div",null,[Le("span",{class:eo(["text-xs font-medium",vi(an)])},Si(vr(an)),3),an.drop_reason?(Wr(),Qr("p",Efe,Si(an.drop_reason),1)):Ma("",!0)])])]),Le("div",Lfe,[Le("div",Pfe,[Le("div",Ife,[Le("div",{class:eo(["w-2 h-2 rounded-full flex-shrink-0",Ar(an.type)])},null,2),Le("div",Dfe,[Le("span",zfe,Si(ii(an.type)),1),an.type===4&&Di(an)?(Wr(),Qr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium leading-tight",title:Di(an)||void 0},Si(Di(an)),9,Ofe)):Ma("",!0)]),Le("span",{class:eo(["inline-block px-2 py-1 rounded text-xs font-medium ml-2",dr(an.route)])},Si(Ji(an.route)),3)]),Le("div",Bfe,[Le("span",Rfe,Si(Ci(an.timestamp)),1),Le("span",{class:eo(["text-xs font-medium",vi(an)])},Si(vr(an)),3)])]),Le("div",Ffe,[Le("div",Nfe,[Le("span",jfe,Si(an.src_hash?.slice(-4)||"????")+" → "+Si(an.dst_hash?.slice(-4)||"????"),1)]),Le("div",Ufe,[Le("div",$fe,[an.snr!=null?(Wr(),Qr("div",Hfe,[Le("div",{class:eo(["w-1 h-3 rounded-sm",an.snr>=-10?"bg-green-400":"bg-white/20"])},null,2),Le("div",{class:eo(["w-1 h-4 rounded-sm",an.snr>=-5?"bg-green-400":"bg-white/20"])},null,2),Le("div",{class:eo(["w-1 h-5 rounded-sm",an.snr>=0?"bg-green-400":"bg-white/20"])},null,2),Le("div",{class:eo(["w-1 h-6 rounded-sm",an.snr>=10?"bg-green-400":"bg-white/20"])},null,2)])):Ma("",!0),Le("span",Vfe,Si(an.rssi!=null?an.rssi.toFixed(0)+"dBm":"TX"),1)])])]),Le("div",Wfe,[Le("div",qfe,[Le("span",null,Si(an.length)+"B",1),Le("span",null,"SNR: "+Si(an.snr!=null?an.snr.toFixed(1)+"dB":"N/A"),1),Le("span",null,"Score: "+Si(an.score!=null?an.score.toFixed(2):"N/A"),1)]),Le("div",Gfe,[Number(an.tx_delay_ms)>0?(Wr(),Qr("span",Zfe,[an.transmitted?(Wr(),Qr("div",{key:0,class:eo(["w-1.5 h-1.5 rounded-full flex-shrink-0",Xr(an)])},null,2)):Ma("",!0),Le("span",null,Si(ei(Number(an.tx_delay_ms))),1)])):Ma("",!0)])]),an.drop_reason?(Wr(),Qr("div",Kfe,Si(an.drop_reason),1)):Ma("",!0)])],10,hfe))),128))]),_:1})]),ur.value>1?(Wr(),Qr("div",Yfe,[Le("div",Xfe,[Le("span",Jfe," Showing "+Si((r.value-1)*P3+1)+" - "+Si(Math.min(r.value*P3,Fe.value.length))+" of "+Si(Fe.value.length)+" packets ",1),_i.value?(Wr(),Qr("div",Qfe,[sn[13]||(sn[13]=Le("span",{class:"text-dark-text text-xs"},"•",-1)),Le("button",{onClick:so,disabled:H.value,class:eo(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!H.value,"text-dark-text border-dark-border cursor-not-allowed opacity-50":H.value}])},Si(H.value?"Loading...":`Load ${Math.min(200,ax-S.value)} more`),11,ede),Le("span",tde,"("+Si(S.value)+"/"+Si(ax)+" max)",1)])):Ma("",!0)]),Le("div",rde,[Le("button",{onClick:sn[2]||(sn[2]=an=>r.value=r.value-1),disabled:r.value<=1,class:eo(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":r.value<=1,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value>1}])},sn[14]||(sn[14]=[Le("span",{class:"hidden sm:inline"},"Previous",-1),Le("span",{class:"sm:hidden"},"‹",-1)]),10,ide),Le("div",nde,[r.value>3?(Wr(),Qr("button",{key:0,onClick:sn[3]||(sn[3]=an=>r.value=1),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):Ma("",!0),r.value>4?(Wr(),Qr("span",ade,"...")):Ma("",!0),(Wr(!0),Qr(js,null,au(Array.from({length:Math.min(5,ur.value)},(an,zn)=>Math.max(1,Math.min(r.value-2,ur.value-4))+zn).filter(an=>an<=ur.value),an=>(Wr(),Qr("button",{key:an,onClick:zn=>r.value=an,class:eo(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number",{"border-primary bg-primary/10 text-primary":r.value===an,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value!==an}])},Si(an),11,ode))),128)),r.valuer.value=ur.value),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},Si(ur.value),1)):Ma("",!0)]),Le("button",{onClick:sn[5]||(sn[5]=an=>r.value=r.value+1),disabled:r.value>=ur.value,class:eo(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":r.value>=ur.value,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value(Wr(),Qr("div",null,[il(rue),Le("div",gde,[il(Due),il(gue)]),il(mde)]))}}),yde={class:"bg-white/5 border border-white/10 rounded-lg p-4 mb-6"},_de={class:"flex items-center gap-3"},xde={class:"flex-1 min-w-0"},bde={class:"text-white font-medium truncate"},wde={class:"text-white/60 text-sm font-mono"},kde={key:0,class:"text-white/50 text-xs"},Tde={key:1,class:"text-white/50 text-xs"},Sde=Uu({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup(t,{emit:e}){const r=t,c=e,S=()=>{r.neighbor&&(c("delete",r.neighbor.id),H())},H=()=>{c("close")},Z=ue=>{ue.target===ue.currentTarget&&H()};return(ue,be)=>ue.show&&ue.neighbor?(Wr(),Qr("div",{key:0,onClick:Z,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:be[0]||(be[0]=Yf(()=>{},["stop"]))},[Le("div",{class:"flex items-center gap-3 mb-6"},[be[2]||(be[2]=Le("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),be[3]||(be[3]=Le("div",null,[Le("h3",{class:"text-xl font-semibold text-white"},"Delete Neighbor"),Le("p",{class:"text-white/60 text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),Le("button",{onClick:H,class:"ml-auto text-white/60 hover:text-white transition-colors"},be[1]||(be[1]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",yde,[Le("div",_de,[Le("div",xde,[Le("div",bde,Si(ue.neighbor?.node_name||ue.neighbor?.long_name||ue.neighbor?.short_name||"Unknown"),1),Le("div",wde," ID: "+Si(ue.neighbor?.node_num_hex||ue.neighbor?.node_num||ue.neighbor?.id||"N/A"),1),ue.neighbor?.contact_type?(Wr(),Qr("div",kde,Si(ue.neighbor.contact_type),1)):Ma("",!0),ue.neighbor?.hw_model?(Wr(),Qr("div",Tde,Si(ue.neighbor.hw_model),1)):Ma("",!0)])])]),be[4]||(be[4]=Le("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[Le("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),Le("span",null,"This action cannot be undone")])],-1)),Le("div",{class:"flex gap-3"},[Le("button",{onClick:H,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Le("button",{onClick:S,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"}," Delete ")])])])):Ma("",!0)}}),Cde={class:"bg-gradient-to-r from-primary/20 to-accent-blue/20 border-b border-white/10 px-6 py-4"},Ade={class:"flex items-center justify-between"},Mde={class:"flex items-center gap-3"},Ede={key:0,class:"text-sm text-dark-text"},Lde={class:"p-6"},Pde={key:0,class:"text-center py-8"},Ide={key:1,class:"text-center py-8"},Dde={class:"text-dark-text text-sm"},zde={key:2,class:"space-y-4"},Ode={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Bde={class:"flex items-center justify-between mb-2"},Rde={class:"flex items-baseline gap-2"},Fde={class:"text-3xl font-bold text-white"},Nde={class:"grid grid-cols-2 gap-3"},jde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Ude={class:"flex items-center gap-2 mb-2"},$de={class:"flex gap-0.5"},Hde={class:"flex items-baseline gap-1"},Vde={class:"text-xl font-bold text-white"},Wde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},qde={class:"flex items-baseline gap-1"},Gde={class:"text-xl font-bold text-white"},Zde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Kde={class:"relative"},Yde={class:"flex items-center gap-2 overflow-x-auto pb-2"},Xde={key:0,class:"relative flex items-center"},Jde={key:0,class:"absolute left-1/2 -translate-x-1/2 animate-pulse"},Qde={class:"text-dark-text/60 text-xs mt-2 flex items-center justify-between"},epe={key:0,class:"text-primary animate-pulse"},tpe={class:"flex items-center justify-between text-xs text-dark-text/60 pt-2"},rpe=Uu({__name:"PingResultModal",props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=vn(0),H=vn(!1),Z=Do(()=>{if(!r.result)return{color:"text-gray-400",label:"Unknown"};const Re=r.result.rtt_ms;return Re<100?{color:"text-green-400",label:"Excellent"}:Re<250?{color:"text-yellow-400",label:"Good"}:Re<500?{color:"text-orange-400",label:"Fair"}:{color:"text-red-400",label:"Poor"}}),ue=Do(()=>{if(!r.result)return{bars:0,color:"text-gray-400"};const Re=r.result.rssi;return Re>=-50?{bars:5,color:"text-green-400"}:Re>=-60?{bars:4,color:"text-green-300"}:Re>=-70?{bars:3,color:"text-yellow-400"}:Re>=-80?{bars:2,color:"text-orange-400"}:Re>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}});w0(()=>r.result,Re=>{if(Re&&!H.value){H.value=!0,S.value=0;const Xe=Re.path.length,bt=1500/(Xe*2);let kt=0;const Dt=Xe*2-2,rr=()=>{kt<=Dt?(S.value=kt/Dt,kt++,setTimeout(rr,bt)):(H.value=!1,S.value=1)};setTimeout(rr,100)}},{immediate:!0});const be=Do(()=>{if(!r.result||!H.value)return-1;const Re=r.result.path.length;if(Re<=1)return-1;const Xe=S.value,vt=.5;if(Xe<=vt)return Xe/vt*(Re-1);{const bt=(Xe-vt)/vt;return(Re-1)*(1-bt)}}),Se=()=>{c("close")};return(Re,Xe)=>(Wr(),Sd(gS,{to:"body"},[il(Rx,{name:"modal"},{default:Iv(()=>[Re.show?(Wr(),Qr("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4",onClick:Yf(Se,["self"])},[Le("div",{class:"bg-dark-card border border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden",onClick:Xe[0]||(Xe[0]=Yf(()=>{},["stop"]))},[Le("div",Cde,[Le("div",Ade,[Le("div",Mde,[Xe[2]||(Xe[2]=Le("div",{class:"p-2 bg-primary/20 rounded-lg"},[Le("svg",{class:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})])],-1)),Le("div",null,[Xe[1]||(Xe[1]=Le("h2",{class:"text-xl font-bold text-white"},"Ping Result",-1)),Re.nodeName?(Wr(),Qr("p",Ede,Si(Re.nodeName),1)):Ma("",!0)])]),Le("button",{onClick:Se,class:"p-2 hover:bg-white/10 rounded-lg transition-colors text-white/60 hover:text-white"},Xe[3]||(Xe[3]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),Le("div",Lde,[Re.loading?(Wr(),Qr("div",Pde,Xe[4]||(Xe[4]=[Le("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"},null,-1),Le("p",{class:"text-dark-text"},"Sending ping...",-1),Le("p",{class:"text-dark-text/60 text-sm mt-1"},"Waiting for response...",-1)]))):Re.error?(Wr(),Qr("div",Ide,[Xe[5]||(Xe[5]=Le("div",{class:"p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center"},[Le("svg",{class:"w-8 h-8 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})])],-1)),Xe[6]||(Xe[6]=Le("h3",{class:"text-accent-red font-semibold mb-2"},"Ping Failed",-1)),Le("p",Dde,Si(Re.error),1)])):Re.result?(Wr(),Qr("div",zde,[Le("div",Ode,[Le("div",Bde,[Xe[7]||(Xe[7]=Le("span",{class:"text-dark-text text-sm"},"Round-Trip Time",-1)),Le("span",{class:eo(["text-xs font-medium px-2 py-1 rounded-full",Z.value.color,"bg-current/10"])},Si(Z.value.label),3)]),Le("div",Rde,[Le("span",Fde,Si(Re.result.rtt_ms.toFixed(2)),1),Xe[8]||(Xe[8]=Le("span",{class:"text-dark-text"},"ms",-1))])]),Le("div",Nde,[Le("div",jde,[Le("div",Ude,[Xe[9]||(Xe[9]=Le("span",{class:"text-dark-text text-sm"},"RSSI",-1)),Le("div",$de,[(Wr(),Qr(js,null,au(5,vt=>Le("div",{key:vt,class:eo(["w-1 h-3 rounded-sm",vt<=ue.value.bars?ue.value.color:"bg-white/10"])},null,2)),64))])]),Le("div",Hde,[Le("span",Vde,Si(Re.result.rssi),1),Xe[10]||(Xe[10]=Le("span",{class:"text-dark-text text-xs"},"dBm",-1))])]),Le("div",Wde,[Xe[12]||(Xe[12]=Le("div",{class:"text-dark-text text-sm mb-2"},"SNR",-1)),Le("div",qde,[Le("span",Gde,Si(Re.result.snr_db),1),Xe[11]||(Xe[11]=Le("span",{class:"text-dark-text text-xs"},"dB",-1))])])]),Le("div",Zde,[Xe[15]||(Xe[15]=Le("div",{class:"text-dark-text text-sm mb-3"},"Network Path",-1)),Le("div",Kde,[Le("div",Yde,[(Wr(!0),Qr(js,null,au(Re.result.path,(vt,bt)=>(Wr(),Qr("div",{key:bt,class:"flex items-center gap-2 flex-shrink-0 relative"},[Le("div",{class:eo(["bg-primary/20 text-primary border border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300",H.value&&Math.floor(be.value)===bt?"ring-2 ring-primary/50 scale-105":""])},Si(vt),3),bt[H.value&&be.value>=bt&&be.value0?(jr(),Kr("div",vue," Total packet types: "+ki(e.value.length)+" | Total packets: "+ki(e.value.reduce((Ne,it)=>Ne+it.count,0)),1)):Sa("",!0)]))}}),_ue=kh(yue,[["__scopeId","data-v-e4b8fd1c"]]),xue={class:"glass-card rounded-[10px] p-4 lg:p-6"},bue={class:"relative h-40 lg:h-48"},wue={class:"mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4"},kue={class:"text-center"},Tue={class:"text-lg lg:text-2xl font-bold text-white"},Sue={class:"text-center"},Cue={class:"text-lg lg:text-2xl font-bold text-white"},Aue={class:"mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center"},Mue={class:"text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1"},Eue={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},Lue={class:"text-xs text-white/60"},Pue={class:"text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1"},Iue={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},Due={class:"text-xs text-white/60"},zue={class:"text-xs lg:text-sm font-semibold text-white"},Oue=Bu({name:"AirtimeUtilizationChart",__name:"AirtimeUtilizationChart",setup(t){const e=a4(),r=Ym(),c=fn(null),S=fn([]),$=fn(!0),Z=fn(null),ue=fn(30),xe=fn({totalReceived:0,totalTransmitted:0,dropped:0,firstPacketTime:0}),Se=fn({sf:9,bwHz:62500,cr:5,preamble:17}),Ne=Dt=>{const{sf:Zt,bwHz:Mr,cr:ze,preamble:ni}=Se.value,or=1,Cr=0,gi=Zt>=11&&Mr<=125e3?1:0,Si=Mr/1e3,Ci=Math.pow(2,Zt)/Si,ri=(ni+4.25)*Ci,on=Math.max(8*Dt-4*Zt+28+16*or-20*Cr,0),yi=4*(Zt-2*gi),fr=(8+Math.ceil(on/yi)*ze)*Ci;return ri+fr},it=(Dt,Zt=60)=>{if(Dt.length===0)return[];const Mr=1-Math.pow(.5,1/Zt),ze=Math.min(Dt.length,Math.max(10,Math.floor(Zt/3)));let ni=0,or=0;for(let Cr=0;Cr(ni=Mr*Cr.rxUtil+(1-Mr)*ni,or=Mr*Cr.txUtil+(1-Mr)*or,{...Cr,rxUtil:ni,txUtil:or}))},pt=Io(()=>{const Dt=e.packetStats?.total_packets||0,Zt=e.packetStats?.transmitted_packets||0,Mr=r.stats?.uptime_seconds||0,ze=Dt||xe.value.totalReceived,ni=Zt||xe.value.totalTransmitted,or=xe.value.firstPacketTime>0?Math.floor(Date.now()/1e3)-xe.value.firstPacketTime:0,Cr=Mr||or,gi=Math.max(Cr/3600,.1);if(gi<1){const gr=Math.max(Cr/60,1);return{rxRate:{value:Math.round(ze/gr*100)/100,label:gi<.5?"RX/min (early)":"RX/min"},txRate:{value:Math.round(ni/gr*100)/100,label:gi<.5?"TX/min (early)":"TX/min"},confidence:"low"}}const Ci=Math.round(ze/gi*100)/100,ri=Math.round(ni/gi*100)/100;let on,yi;return gi<6?(on=`RX/hr (${Math.round(gi)}h)`,yi="medium"):gi<24?(on=`RX/hr (${Math.round(gi)}h)`,yi="high"):(on="RX/hr",yi="high"),{rxRate:{value:Ci,label:on},txRate:{value:ri,label:on.replace("RX","TX")},confidence:yi}}),bt=async()=>{$.value=!0;try{const ni=Math.floor(Date.now()/1e3),or=ni-24*3600;let Cr=0;try{const En=await bs.get("/stats");if(En.success&&En.data){const Zn=En.data,ga=Zn.config;if(ga?.radio){const ya=ga.radio;Se.value={sf:ya.spreading_factor??9,bwHz:ya.bandwidth??62500,cr:ya.coding_rate??5,preamble:ya.preamble_length??17}}Cr=Zn.dropped_count??0}}catch{}const gi=await bs.get("/filtered_packets",{start_timestamp:or,end_timestamp:ni,limit:5e4});if(!gi.success){S.value=[],$.value=!1,b0(()=>wt());return}const Si=gi.data||[],Ci=new Float64Array(8640),ri=new Float64Array(8640);let on=0,yi=0,gr=1/0;for(const En of Si){const Zn=Math.floor((En.timestamp-or)/10);if(Zn<0||Zn>=8640)continue;const ga=En.length??En.payload_length??32,ya=Ne(ga),ro=En.packet_origin;En.timestamp[En.rxUtil,En.txUtil]))*1.05;ue.value=Math.max(5,Math.ceil(Di/5)*5),$.value=!1,b0(()=>wt())}catch(Dt){console.error("Failed to fetch airtime data:",Dt),S.value=[],$.value=!1,b0(()=>wt())}},wt=()=>{if(!c.value)return;const Dt=c.value,Zt=Dt.getContext("2d");if(!Zt)return;const Mr=Dt.parentElement;if(!Mr)return;const ze=Mr.getBoundingClientRect(),ni=ze.width,or=ze.height;Dt.width=ni*window.devicePixelRatio,Dt.height=or*window.devicePixelRatio,Dt.style.width=ni+"px",Dt.style.height=or+"px",Zt.scale(window.devicePixelRatio,window.devicePixelRatio);const Cr=20,gi=45;if(Zt.clearRect(0,0,ni,or),$.value){Zt.fillStyle="#666",Zt.font="16px system-ui",Zt.textAlign="center",Zt.fillText("Loading chart data...",ni/2,or/2);return}if(S.value.length===0){Zt.fillStyle="#666",Zt.font="16px system-ui",Zt.textAlign="center",Zt.fillText("No data available",ni/2,or/2);return}const Si=ni-gi-Cr,Ci=or-Cr*2,ri=ue.value,on=ue.value;Zt.strokeStyle="rgba(255, 255, 255, 0.1)",Zt.lineWidth=1,Zt.font="10px system-ui",Zt.textAlign="right";for(let yi=0;yi<=5;yi++){const gr=Cr+Ci*yi/5;Zt.beginPath(),Zt.moveTo(gi,gr),Zt.lineTo(ni-Cr,gr),Zt.stroke();const fr=ri-yi/5*on;Zt.fillStyle="rgba(255, 255, 255, 0.5)",Zt.fillText(`${fr.toFixed(0)}%`,gi-5,gr+3)}for(let yi=0;yi<=6;yi++){const gr=gi+Si*yi/6;Zt.beginPath(),Zt.moveTo(gr,Cr),Zt.lineTo(gr,or-Cr),Zt.stroke()}S.value.length>1&&(Zt.strokeStyle="#EBA0FC",Zt.lineWidth=2,Zt.beginPath(),S.value.forEach((yi,gr)=>{const fr=gi+Si*gr/(S.value.length-1),Sr=or-Cr-Math.min(yi.rxUtil,ue.value)/on*Ci;gr===0?Zt.moveTo(fr,Sr):Zt.lineTo(fr,Sr)}),Zt.stroke()),S.value.length>1&&(Zt.strokeStyle="#FB787B",Zt.lineWidth=2,Zt.beginPath(),S.value.forEach((yi,gr)=>{const fr=gi+Si*gr/(S.value.length-1),Sr=or-Cr-Math.min(yi.txUtil,ue.value)/on*Ci;gr===0?Zt.moveTo(fr,Sr):Zt.lineTo(fr,Sr)}),Zt.stroke())};return Jf(()=>{bt(),Z.value=window.setInterval(bt,3e4),b0(()=>{wt(),setTimeout(()=>wt(),100)}),window.addEventListener("resize",wt)}),$g(()=>{Z.value&&clearInterval(Z.value),window.removeEventListener("resize",wt)}),(Dt,Zt)=>(jr(),Kr("div",xue,[Zt[3]||(Zt[3]=Dc('

Airtime Utilization

Activity (Last 24 Hours)

Rx Util
Tx Util
',3)),Ee("div",bue,[Ee("canvas",{ref_key:"chartRef",ref:c,class:"absolute inset-0 w-full h-full"},null,512)]),Ee("div",wue,[Ee("div",kue,[Ee("div",Tue,ki(Po(e).packetStats?.total_packets||xe.value.totalReceived),1),Zt[0]||(Zt[0]=Ee("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Received",-1))]),Ee("div",Sue,[Ee("div",Cue,ki(Po(e).packetStats?.transmitted_packets||xe.value.totalTransmitted),1),Zt[1]||(Zt[1]=Ee("div",{class:"text-xs text-white/70 uppercase tracking-wide"},"Total Transmitted",-1))])]),Ee("div",Aue,[Ee("div",null,[Ee("div",Mue,[il(ki(pt.value.rxRate.value)+" ",1),pt.value.confidence==="low"?(jr(),Kr("span",Eue)):Sa("",!0)]),Ee("div",Lue,ki(pt.value.rxRate.label),1)]),Ee("div",null,[Ee("div",Pue,[il(ki(pt.value.txRate.value)+" ",1),pt.value.confidence==="low"?(jr(),Kr("span",Iue)):Sa("",!0)]),Ee("div",Due,ki(pt.value.txRate.label),1)]),Ee("div",null,[Ee("div",zue,ki(Po(e).packetStats?.dropped_packets||xe.value.dropped),1),Zt[2]||(Zt[2]=Ee("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),Bue=kh(Oue,[["__scopeId","data-v-70dcae98"]]),Rue={class:"relative w-full max-w-4xl max-h-[90vh] overflow-hidden"},Fue={class:"glass-card rounded-[20px] p-8 backdrop-blur-[50px] shadow-2xl border border-white/20"},Nue={class:"flex items-center justify-between mb-6"},jue={class:"text-white/70 text-sm"},Uue={class:"max-h-[70vh] overflow-y-auto custom-scrollbar"},$ue={class:"mb-6"},Hue={class:"glass-card bg-white/5 rounded-[15px] p-4"},Vue={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Wue={class:"space-y-3"},que={class:"flex justify-between py-2 border-b border-white/10"},Gue={class:"text-white font-mono text-sm"},Zue={class:"flex justify-between py-2 border-b border-white/10"},Kue={class:"text-white font-mono text-xs break-all"},Yue={key:0,class:"flex justify-between py-2 border-b border-white/10"},Xue={class:"text-white font-mono text-xs"},Jue={class:"space-y-3"},Que={class:"flex justify-between py-2 border-b border-white/10"},ece={class:"text-white font-semibold"},tce={class:"flex justify-between py-2 border-b border-white/10"},rce={class:"text-white font-semibold"},ice={class:"flex justify-between py-2 border-b border-white/10"},nce={class:"mb-6"},ace={class:"glass-card bg-white/5 rounded-[15px] p-4"},oce={class:"space-y-3"},sce={class:"flex justify-between py-2 border-b border-white/10"},lce={class:"text-white"},uce={key:0,class:"pt-2"},cce={class:"glass-card bg-black/30 rounded-[10px] p-4 mb-4"},hce={class:"w-full overflow-x-auto"},fce={class:"text-white/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},dce={class:"flex items-center justify-between mb-3"},pce={class:"text-white/80 text-sm font-semibold"},mce={class:"text-white/60 text-xs"},gce={class:"glass-card bg-black/40 rounded-[8px] p-3 mb-3"},vce={class:"font-mono text-xs text-white break-all whitespace-pre-wrap leading-relaxed"},yce={class:"glass-card bg-white/5 rounded-[10px] overflow-hidden"},_ce={class:"text-cyan-400 text-sm font-mono break-words min-w-0"},xce={class:"text-white text-sm break-words min-w-0"},bce={class:"text-white text-sm font-semibold break-all min-w-0 overflow-hidden"},wce=["title"],kce={class:"text-orange-400 text-xs font-mono break-all min-w-0 overflow-hidden"},Tce=["title"],Sce={class:"grid grid-cols-2 gap-2"},Cce={class:"text-cyan-400 text-sm font-mono break-words"},Ace={class:"text-white text-sm break-words"},Mce=["title"],Ece=["title"],Lce={key:0,class:"text-white/60 text-xs italic mt-2 px-1"},Pce={key:1,class:"py-2"},Ice={class:"mb-6"},Dce={class:"glass-card bg-white/5 rounded-[15px] p-4"},zce={class:"space-y-4"},Oce={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Bce={class:"flex justify-between py-2 border-b border-white/10"},Rce={class:"flex justify-between py-2 border-b border-white/10"},Fce={key:0,class:"py-2"},Nce={class:"glass-card bg-black/20 rounded-[10px] p-4"},jce={class:"flex items-center flex-wrap gap-2"},Uce={class:"relative group"},$ce={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},Hce={class:"font-mono text-xs font-semibold text-white/90"},Vce={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},Wce={key:0,class:"mx-2 text-cyan-400/60"},qce={key:1,class:"py-2"},Gce={class:"text-white/70 text-sm mb-2 flex items-center"},Zce={key:0,class:"w-4 h-4 ml-2 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Kce={key:1,class:"text-yellow-400 text-xs ml-1"},Yce={class:"glass-card bg-black/20 rounded-[10px] p-4"},Xce={class:"flex items-center flex-wrap gap-2"},Jce={class:"relative group"},Qce={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},ehe={class:"absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 px-2 py-1 bg-black/90 text-white text-xs rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap z-10"},the={key:0,class:"mx-1 text-orange-400/60"},rhe={class:"mb-6"},ihe={class:"glass-card bg-white/5 rounded-[15px] p-4"},nhe={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},ahe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},ohe={class:"text-lg font-bold text-white"},she={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},lhe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},uhe={class:"text-lg font-bold text-white"},che={key:0,class:"mb-4"},hhe={class:"flex items-center gap-3"},fhe={class:"flex gap-1"},dhe={class:"text-white/80 text-sm capitalize"},phe={key:1,class:"mb-4"},mhe={key:2,class:"mb-4"},ghe={class:"text-white/70 text-sm mb-3"},vhe={class:"space-y-2"},yhe={class:"flex items-center gap-3"},_he={class:"text-white/60 text-sm"},xhe={key:3,class:"mt-6 pt-4 border-t border-white/10"},bhe={class:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4"},whe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},khe={class:"text-2xl font-bold text-white"},The={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},She={class:"text-2xl font-bold text-white"},Che={class:"text-white/60 text-xs mt-1"},Ahe={class:"text-center p-3 glass-card bg-black/20 rounded-[10px]"},Mhe={class:"text-white/60 text-xs mt-1"},Ehe={key:0,class:"glass-card bg-black/20 rounded-[10px] p-4"},Lhe={class:"space-y-3"},Phe={class:"flex-shrink-0 w-16 text-right"},Ihe={class:"text-white/70 text-xs"},Dhe={class:"flex-1 relative"},zhe={class:"h-8 rounded-lg overflow-hidden bg-white/5 relative"},Ohe={class:"absolute inset-0 flex items-center px-3"},Bhe={class:"text-white text-xs font-mono font-semibold"},Rhe={class:"flex-shrink-0 w-12 text-left"},Fhe={class:"text-white/50 text-xs"},Nhe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},jhe={class:"space-y-2"},Uhe={class:"flex justify-between py-2 border-b border-white/10"},$he={class:"text-white"},Hhe={class:"flex justify-between py-2 border-b border-white/10"},Vhe={class:"space-y-2"},Whe={class:"flex justify-between py-2 border-b border-white/10"},qhe={key:0,class:"flex justify-between py-2 border-b border-white/10"},Ghe={class:"text-red-400 text-sm"},Zhe={class:"mt-6 pt-4 border-t border-white/10 flex justify-end"},Khe=Bu({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=or=>new Date(or*1e3).toLocaleString(),$=or=>or.transmitted?or.is_duplicate?"text-amber-400":or.drop_reason?"text-red-400":"text-green-400":"text-red-400",Z=or=>or.transmitted?or.is_duplicate?"Duplicate":or.drop_reason?"Dropped":"Forwarded":"Dropped",ue=or=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[or]||`Unknown Type (${or})`,xe=or=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[or]||`Unknown Route (${or})`,Se=or=>{if(!or)return"None";const gi=or.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],Si=[];for(let Ci=0;Ci{try{let Si=0;const Ci=Cr.length/2;if(Ci>=100){if(Cr.length>=Si+64){const ri=Cr.slice(Si,Si+64);or.push({name:"Public Key",byteRange:`${(gi+Si)/2}-${(gi+Si+63)/2}`,hexData:ri.match(/.{8}/g)?.join(" ")||ri,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${ri.slice(0,16)}...${ri.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),Si+=64}if(Cr.length>=Si+8){const ri=Cr.slice(Si,Si+8),on=parseInt(ri,16),yi=new Date(on*1e3);or.push({name:"Timestamp",byteRange:`${(gi+Si)/2}-${(gi+Si+7)/2}`,hexData:ri.match(/.{2}/g)?.join(" ")||ri,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${on} (${yi.toLocaleString()})`,binary:on.toString(2).padStart(32,"0")}]}),Si+=8}if(Cr.length>=Si+128){const ri=Cr.slice(Si,Si+128);or.push({name:"Signature",byteRange:`${(gi+Si)/2}-${(gi+Si+127)/2}`,hexData:ri.match(/.{8}/g)?.join(" ")||ri,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${ri.slice(0,16)}...${ri.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),Si+=128}if(Cr.length>Si){const ri=Cr.slice(Si);it(or,ri,gi+Si)}}else or.push({name:"ADVERT AppData (Partial)",byteRange:`${gi/2}-${gi/2+Ci-1}`,hexData:Cr.match(/.{2}/g)?.join(" ")||Cr,description:`Partial ADVERT data - appears to be just AppData portion (${Ci} bytes)`,fields:[{bits:`0-${Ci*8-1}`,name:"Partial Data",value:`${Ci} bytes - attempting to decode as AppData`,binary:`${Ci} bytes (${Ci*8} bits)`}]}),it(or,Cr,gi)}catch(Si){or.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:Cr.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Si instanceof Error?Si.message:"Unknown error"}`,binary:"Invalid"}]})}},it=(or,Cr,gi)=>{try{const Si=Cr.length/2;or.push({name:"AppData",byteRange:`${gi/2}-${gi/2+Si-1}`,hexData:Cr.match(/.{2}/g)?.join(" ")||Cr,description:`Node advertisement application data (${Si} bytes)`,fields:[{bits:`0-${Si*8-1}`,name:"Application Data",value:`${Si} bytes (contains flags, location, name, etc.)`,binary:`${Si} bytes (${Si*8} bits)`}]});let Ci=0;if(Cr.length>=2){const ri=parseInt(Cr.slice(Ci,Ci+2),16),on=[],yi=!!(ri&16),gr=!!(ri&32),fr=!!(ri&64),Sr=!!(ri&128);if(ri&1&&on.push("is chat node"),ri&2&&on.push("is repeater"),ri&4&&on.push("is room server"),ri&8&&on.push("is sensor"),yi&&on.push("has location"),gr&&on.push("has feature 1"),fr&&on.push("has feature 2"),Sr&&on.push("has name"),or.push({name:"AppData Flags",byteRange:`${(gi+Ci)/2}`,hexData:`0x${Cr.slice(Ci,Ci+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:on.join(", ")||"none",binary:ri.toString(2).padStart(8,"0")}]}),Ci+=2,yi&&Cr.length>=Ci+16){const ei=Cr.slice(Ci,Ci+8),Jr=[];for(let ln=6;ln>=0;ln-=2)Jr.push(ei.slice(ln,ln+2));const ti=parseInt(Jr.join(""),16),Di=ti>2147483647?ti-4294967296:ti,En=Di/1e6,Zn=Cr.slice(Ci+8,Ci+16),ga=[];for(let ln=6;ln>=0;ln-=2)ga.push(Zn.slice(ln,ln+2));const ya=parseInt(ga.join(""),16),ro=ya>2147483647?ya-4294967296:ya,qn=ro/1e6;or.push({name:"Location Data",byteRange:`${(gi+Ci)/2}-${(gi+Ci+15)/2}`,hexData:`${ei.match(/.{2}/g)?.join(" ")||ei} ${Zn.match(/.{2}/g)?.join(" ")||Zn}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${En.toFixed(6)}° (raw: ${Di})`,binary:Di.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${qn.toFixed(6)}° (raw: ${ro})`,binary:ro.toString(2).padStart(32,"0")}]}),Ci+=16}if(gr&&Cr.length>=Ci+4){const ei=Cr.slice(Ci,Ci+4),Jr=parseInt(ei,16);or.push({name:"Feature 1",byteRange:`${(gi+Ci)/2}-${(gi+Ci+3)/2}`,hexData:ei.match(/.{2}/g)?.join(" ")||ei,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${Jr}`,binary:Jr.toString(2).padStart(16,"0")}]}),Ci+=4}if(fr&&Cr.length>=Ci+4){const ei=Cr.slice(Ci,Ci+4),Jr=parseInt(ei,16);or.push({name:"Feature 2",byteRange:`${(gi+Ci)/2}-${(gi+Ci+3)/2}`,hexData:ei.match(/.{2}/g)?.join(" ")||ei,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${Jr}`,binary:Jr.toString(2).padStart(16,"0")}]}),Ci+=4}if(Sr&&Cr.length>Ci){const ei=Cr.slice(Ci),Jr=ei.match(/.{2}/g)||[],ti=Jr.map(Di=>{const En=parseInt(Di,16);return En>=32&&En<=126?String.fromCharCode(En):"."}).join("").replace(/\.+$/,"");or.push({name:"Node Name",byteRange:`${(gi+Ci)/2}-${(gi+Cr.length-1)/2}`,hexData:ei.match(/.{2}/g)?.join(" ")||ei,description:`Node name string (${Jr.length} bytes)`,fields:[{bits:`0-${Jr.length*8-1}`,name:"Node Name",value:`"${ti}"`,binary:`ASCII text (${Jr.length} bytes)`}]})}}}catch(Si){or.push({name:"AppData Parse Error",byteRange:"N/A",hexData:Cr.slice(0,Math.min(32,Cr.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${Si instanceof Error?Si.message:"Unknown error"}`,binary:"Invalid"}]})}},pt=or=>{if(!or)return[];if(Array.isArray(or))return or;if(typeof or=="string")try{return JSON.parse(or)}catch{return[]}return[]},bt=or=>{const Cr=[];if(!or)return Cr;try{const gi=or.raw_packet;if(gi){const Si=gi.replace(/\s+/g,"").toUpperCase();let Ci=0;if(Si.length>=2){const ri=Si.slice(Ci,Ci+2),on=parseInt(ri,16),yi=on&3,gr=(on&60)>>2,fr=(on&192)>>6,Sr={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},ei={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(Cr.push({name:"Header",byteRange:"0",hexData:`0x${ri}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:Sr[yi]||"Unknown",binary:yi.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:ei[gr]||"Unknown",binary:gr.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:fr.toString(),binary:fr.toString(2).padStart(2,"0")}]}),Ci+=2,(yi===0||yi===3)&&Si.length>=Ci+8){const ti=Si.slice(Ci,Ci+8),Di=parseInt(ti.slice(0,4),16),En=parseInt(ti.slice(4,8),16);Cr.push({name:"Transport Codes",byteRange:"1-4",hexData:`${ti.slice(0,4)} ${ti.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:Di.toString(),binary:Di.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:En.toString(),binary:En.toString(2).padStart(16,"0")}]}),Ci+=8}if(Si.length>=Ci+2){const ti=Si.slice(Ci,Ci+2),Di=parseInt(ti,16);if(Cr.push({name:"Path Length",byteRange:`${Ci/2}`,hexData:`0x${ti}`,description:`${Di} bytes of path data`,fields:[{bits:"0-7",name:"Path Length",value:`${Di} bytes`,binary:Di.toString(2).padStart(8,"0")}]}),Ci+=2,Di>0&&Si.length>=Ci+Di*2){const En=Si.slice(Ci,Ci+Di*2);Cr.push({name:"Path Data",byteRange:`${Ci/2}-${(Ci+Di*2-2)/2}`,hexData:En.match(/.{2}/g)?.join(" ")||En,description:"Routing path information",fields:[{bits:`0-${Di*8-1}`,name:"Route Path",value:`${Di} bytes of routing data`,binary:`${Di} bytes (${Di*8} bits)`}]}),Ci+=Di*2}}if(Si.length>Ci){const ti=Si.slice(Ci),Di=ti.length/2;gr===4?Ne(Cr,ti,Ci):Cr.push({name:"Payload Data",byteRange:`${Ci/2}-${Ci/2+Di-1}`,hexData:ti.match(/.{2}/g)?.join(" ")||ti,description:"Application data content",fields:[{bits:`0-${Di*8-1}`,name:"Application Data",value:`${Di} bytes`,binary:`${Di} bytes (${Di*8} bits)`}]})}}}else{if(or.header){const Si=or.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),Ci=parseInt(Si,16),ri=Ci&3,on=(Ci&60)>>2,yi=(Ci&192)>>6,gr={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},fr={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};Cr.push({name:"Header",byteRange:"0",hexData:`0x${Si}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:gr[ri]||"Unknown",binary:ri.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:fr[on]||"Unknown",binary:on.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:yi.toString(),binary:yi.toString(2).padStart(2,"0")}]}),or.transport_codes&&Cr.push({name:"Transport Codes",byteRange:"1-4",hexData:or.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:or.transport_codes,binary:"Available in separate field"}]}),or.original_path&&or.original_path.length>0&&Cr.push({name:"Original Path",byteRange:"?",hexData:or.original_path.join(" "),description:`Original routing path (${or.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${or.original_path.length} nodes`,binary:"Available as node list"}]}),or.forwarded_path&&or.forwarded_path.length>0&&Cr.push({name:"Forwarded Path",byteRange:"?",hexData:or.forwarded_path.join(" "),description:`Forwarded routing path (${or.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${or.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(or.payload){const Si=or.payload.replace(/\s+/g,"").toUpperCase(),Ci=Si.length/2;or.type===4?Ne(Cr,Si,0):Cr.push({name:"Payload Data",byteRange:`0-${Ci-1}`,hexData:Si.match(/.{2}/g)?.join(" ")||Si,description:`Application data content (${Ci} bytes)`,fields:[{bits:`0-${Ci*8-1}`,name:"Application Data",value:`${Ci} bytes`,binary:`${Ci} bytes (${Ci*8} bits)`}]})}}}catch{Cr.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return Cr},wt=or=>or==null?"text-white/50":or>=10?"text-green-400":or>=5?"text-cyan-400":or>=0?"text-yellow-400":"text-red-400",Dt=(or,Cr=8)=>{if(or==null)return{level:0,className:"signal-none"};const Si={7:-7.5,8:-10,9:-12.5,10:-15,11:-17.5,12:-20}[Cr]||-10;let Ci,ri;return or>=Si+10?(Ci=4,ri="signal-excellent"):or>=Si+5?(Ci=3,ri="signal-good"):or>=Si?(Ci=2,ri="signal-fair"):(Ci=1,ri="signal-poor"),{level:Ci,className:ri}},Zt=or=>{if(!or)return[];try{const Cr=JSON.parse(or);return Array.isArray(Cr)?Cr:[]}catch{return[]}},Mr=or=>or>=1e3?`${(or/1e3).toFixed(2)}s`:`${Math.round(or)}ms`,ze=or=>{or.key==="Escape"&&c("close")},ni=or=>{or.target===or.currentTarget&&c("close")};return(or,Cr)=>(jr(),Cd(y8,{to:"body"},[nl(R2,{name:"modal",appear:""},{default:$1(()=>[or.isOpen&&or.packet?(jr(),Kr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:ni,onKeydown:ze,tabindex:"0"},[Cr[46]||(Cr[46]=Ee("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),Ee("div",Rue,[Ee("div",Fue,[Ee("div",Nue,[Ee("div",null,[Cr[2]||(Cr[2]=Ee("h2",{class:"text-2xl font-bold text-white mb-1"},"Packet Details",-1)),Ee("p",jue,ki(ue(or.packet.type))+" - "+ki(xe(or.packet.route)),1)]),Ee("button",{onClick:Cr[0]||(Cr[0]=gi=>c("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10 hover:bg-white/20 transition-colors duration-200 text-white/70 hover:text-white"},Cr[3]||(Cr[3]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",Uue,[Ee("div",$ue,[Cr[10]||(Cr[10]=Ee("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Ee("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),il(" Basic Information ")],-1)),Ee("div",Hue,[Ee("div",Vue,[Ee("div",Wue,[Ee("div",que,[Cr[4]||(Cr[4]=Ee("span",{class:"text-white/70 text-sm"},"Timestamp",-1)),Ee("span",Gue,ki(S(or.packet.timestamp)),1)]),Ee("div",Zue,[Cr[5]||(Cr[5]=Ee("span",{class:"text-white/70 text-sm"},"Packet Hash",-1)),Ee("span",Kue,ki(or.packet.packet_hash),1)]),or.packet.header?(jr(),Kr("div",Yue,[Cr[6]||(Cr[6]=Ee("span",{class:"text-white/70 text-sm"},"Header",-1)),Ee("span",Xue,ki(or.packet.header),1)])):Sa("",!0)]),Ee("div",Jue,[Ee("div",Que,[Cr[7]||(Cr[7]=Ee("span",{class:"text-white/70 text-sm"},"Type",-1)),Ee("span",ece,ki(or.packet.type)+" ("+ki(ue(or.packet.type))+")",1)]),Ee("div",tce,[Cr[8]||(Cr[8]=Ee("span",{class:"text-white/70 text-sm"},"Route",-1)),Ee("span",rce,ki(or.packet.route)+" ("+ki(xe(or.packet.route))+")",1)]),Ee("div",ice,[Cr[9]||(Cr[9]=Ee("span",{class:"text-white/70 text-sm"},"Status",-1)),Ee("span",{class:Ga(["font-semibold",$(or.packet)])},ki(Z(or.packet)),3)])])])])]),Ee("div",nce,[Cr[20]||(Cr[20]=Ee("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Ee("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),il(" Payload Data ")],-1)),Ee("div",ace,[Ee("div",oce,[Ee("div",sce,[Cr[11]||(Cr[11]=Ee("span",{class:"text-white/70 text-sm"},"Payload Length",-1)),Ee("span",lce,ki(or.packet.payload_length||or.packet.length)+" bytes",1)]),or.packet.payload?(jr(),Kr("div",uce,[Cr[18]||(Cr[18]=Ee("div",{class:"text-white/70 text-sm mb-3"},"Payload Analysis",-1)),Ee("div",cce,[Cr[12]||(Cr[12]=Ee("div",{class:"text-white/70 text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),Ee("div",hce,[Ee("pre",fce,ki(Se(or.packet.payload)),1)])]),(jr(!0),Kr(js,null,au(bt(or.packet).filter(gi=>!gi.name.includes("Parse Error")),(gi,Si)=>(jr(),Kr("div",{key:Si,class:"mb-4"},[Ee("div",dce,[Ee("h4",pce,ki(gi.name),1),Ee("span",mce,"Bytes "+ki(gi.byteRange),1)]),Ee("div",gce,[Ee("div",vce,ki(gi.hexData),1)]),Ee("div",yce,[Cr[17]||(Cr[17]=Ee("div",{class:"hidden md:grid grid-cols-4 gap-3 p-3 bg-white/10 text-white/70 text-xs font-semibold uppercase tracking-wide"},[Ee("div",{class:"min-w-0"},"Bits"),Ee("div",{class:"min-w-0"},"Field"),Ee("div",{class:"min-w-0"},"Value"),Ee("div",{class:"min-w-0"},"Binary")],-1)),(jr(!0),Kr(js,null,au(gi.fields,(Ci,ri)=>(jr(),Kr("div",{key:ri,class:"hidden md:grid grid-cols-4 gap-3 p-3 border-b border-white/5 last:border-b-0 hover:bg-white/5 transition-colors"},[Ee("div",_ce,ki(Ci.bits),1),Ee("div",xce,ki(Ci.name),1),Ee("div",bce,[Ee("span",{class:"block",title:Ci.value},ki(Ci.value),9,wce)]),Ee("div",kce,[Ee("span",{class:"block",title:Ci.binary},ki(Ci.binary),9,Tce)])]))),128)),(jr(!0),Kr(js,null,au(gi.fields,(Ci,ri)=>(jr(),Kr("div",{key:`mobile-${ri}`,class:"md:hidden p-3 border-b border-white/5 last:border-b-0 space-y-2"},[Ee("div",Sce,[Ee("div",null,[Cr[13]||(Cr[13]=Ee("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Bits:",-1)),Ee("div",Cce,ki(Ci.bits),1)]),Ee("div",null,[Cr[14]||(Cr[14]=Ee("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Field:",-1)),Ee("div",Ace,ki(Ci.name),1)])]),Ee("div",null,[Cr[15]||(Cr[15]=Ee("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Value:",-1)),Ee("div",{class:"text-white text-sm font-semibold break-all",title:Ci.value},ki(Ci.value),9,Mce)]),Ee("div",null,[Cr[16]||(Cr[16]=Ee("span",{class:"text-white/70 text-xs uppercase tracking-wide"},"Binary:",-1)),Ee("div",{class:"text-orange-400 text-xs font-mono break-all",title:Ci.binary},ki(Ci.binary),9,Ece)])]))),128))]),gi.description?(jr(),Kr("div",Lce,ki(gi.description),1)):Sa("",!0)]))),128))])):(jr(),Kr("div",Pce,Cr[19]||(Cr[19]=[Ee("span",{class:"text-white/70 text-sm"},"Payload:",-1),Ee("span",{class:"text-white/50 ml-2"},"None",-1)])))])])]),Ee("div",Ice,[Cr[28]||(Cr[28]=Ee("h3",{class:"text-lg font-semibold text-white mb-4 flex items-center"},[Ee("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),il(" Path Information ")],-1)),Ee("div",Dce,[Ee("div",zce,[Ee("div",Oce,[Ee("div",Bce,[Cr[21]||(Cr[21]=Ee("span",{class:"text-white/70 text-sm"},"Source Hash",-1)),Ee("span",{class:Ga(["text-white font-mono text-xs",r.localHash&&or.packet.src_hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},ki(or.packet.src_hash||"Unknown"),3)]),Ee("div",Rce,[Cr[22]||(Cr[22]=Ee("span",{class:"text-white/70 text-sm"},"Destination Hash",-1)),Ee("span",{class:Ga(["text-white font-mono text-xs",r.localHash&&or.packet.dst_hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},ki(or.packet.dst_hash||"Broadcast"),3)])]),pt(or.packet.original_path).length>0?(jr(),Kr("div",Fce,[Cr[24]||(Cr[24]=Ee("div",{class:"text-white/70 text-sm mb-2"},"Original Path",-1)),Ee("div",Nce,[Ee("div",jce,[(jr(!0),Kr(js,null,au(pt(or.packet.original_path),(gi,Si)=>(jr(),Kr("div",{key:Si,class:"flex items-center"},[Ee("div",Uce,[Ee("div",$ce,[Ee("div",Hce,ki(gi.length<=2?gi.toUpperCase():gi.slice(0,2).toUpperCase()),1)]),Ee("div",Vce," Node: "+ki(gi),1)]),Si0?(jr(),Kr("div",qce,[Ee("div",Gce,[Cr[26]||(Cr[26]=il(" Forwarded Path ",-1)),JSON.stringify(pt(or.packet.original_path))!==JSON.stringify(pt(or.packet.forwarded_path))?(jr(),Kr("svg",Zce,Cr[25]||(Cr[25]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Sa("",!0),JSON.stringify(pt(or.packet.original_path))!==JSON.stringify(pt(or.packet.forwarded_path))?(jr(),Kr("span",Kce,"(Modified)")):Sa("",!0)]),Ee("div",Yce,[Ee("div",Xce,[(jr(!0),Kr(js,null,au(pt(or.packet.forwarded_path),(gi,Si)=>(jr(),Kr("div",{key:Si,class:"flex items-center"},[Ee("div",Jce,[Ee("div",{class:Ga(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-400/40 rounded-lg transform transition-all hover:scale-105",r.localHash&&gi===r.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-400/60"])},[Ee("div",{class:Ga(["font-mono text-xs font-semibold",r.localHash&&gi===r.localHash?"text-yellow-200":"text-white/90"])},ki(gi.slice(0,2).toUpperCase()),3),r.localHash&&gi===r.localHash?(jr(),Kr("div",Qce)):Sa("",!0)],2),Ee("div",ehe,ki(gi),1)]),SiEe("div",{key:gi,class:Ga(["w-2 h-6 rounded-sm transition-all duration-300",gi<=Dt(or.packet.snr).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[Dt(or.packet.snr).className]:"bg-white/10"])},null,2)),64))]),Ee("span",dhe,ki(Dt(or.packet.snr).className.replace("signal-","")),1)])])):(jr(),Kr("div",phe,Cr[35]||(Cr[35]=[Ee("div",{class:"text-white/70 text-sm mb-2"},"Signal Quality",-1),Ee("div",{class:"text-white/50 text-sm italic"},"N/A (TX Packet)",-1)]))),or.packet.is_trace&&or.packet.path_snr_details&&or.packet.path_snr_details.length>0?(jr(),Kr("div",mhe,[Ee("div",ghe,"Path SNR Details ("+ki(or.packet.path_snr_details.length)+" hops)",1),Ee("div",vhe,[(jr(!0),Kr(js,null,au(or.packet.path_snr_details,(gi,Si)=>(jr(),Kr("div",{key:Si,class:"flex items-center justify-between p-2 glass-card bg-black/20 rounded-[8px]"},[Ee("div",yhe,[Ee("span",_he,ki(Si+1)+".",1),Ee("span",{class:Ga(["font-mono text-xs text-white",r.localHash&&gi.hash===r.localHash?"bg-cyan-400/20 text-cyan-300 px-1 rounded":""])},ki(gi.hash),3)]),Ee("span",{class:Ga(["text-sm font-bold",wt(gi.snr_db)])},ki(gi.snr_db.toFixed(1))+"dB ",3)]))),128))])])):Sa("",!0),or.packet.transmitted&&or.packet.lbt_attempts!==void 0?(jr(),Kr("div",xhe,[Cr[40]||(Cr[40]=Ee("div",{class:"text-white/70 text-sm mb-3 flex items-center"},[Ee("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),il(" Listen Before Talk (LBT) Metrics ")],-1)),Ee("div",bhe,[Ee("div",whe,[Cr[36]||(Cr[36]=Ee("div",{class:"text-white/70 text-xs mb-1"},"CAD Attempts",-1)),Ee("div",khe,ki(or.packet.lbt_attempts),1)]),Ee("div",The,[Cr[37]||(Cr[37]=Ee("div",{class:"text-white/70 text-xs mb-1"},"Total LBT Delay",-1)),Ee("div",She,ki(Mr(Zt(or.packet.lbt_backoff_delays_ms).reduce((gi,Si)=>gi+Si,0))),1),Ee("div",Che,ki(Zt(or.packet.lbt_backoff_delays_ms).length)+" backoffs ",1)]),Ee("div",Ahe,[Cr[38]||(Cr[38]=Ee("div",{class:"text-white/70 text-xs mb-1"},"Channel Status",-1)),Ee("div",{class:Ga(["text-lg font-bold",or.packet.lbt_channel_busy?"text-yellow-400":"text-green-400"])},ki(or.packet.lbt_channel_busy?"BUSY":"CLEAR"),3),Ee("div",Mhe,ki(or.packet.lbt_channel_busy?"Waited for clear":"Immediate TX"),1)])]),Zt(or.packet.lbt_backoff_delays_ms).length>0?(jr(),Kr("div",Ehe,[Cr[39]||(Cr[39]=Ee("div",{class:"text-white/70 text-xs mb-3 font-semibold"},"Backoff Pattern (Exponential with Jitter)",-1)),Ee("div",Lhe,[(jr(!0),Kr(js,null,au(Zt(or.packet.lbt_backoff_delays_ms),(gi,Si)=>(jr(),Kr("div",{key:Si,class:"flex items-center gap-3"},[Ee("div",Phe,[Ee("span",Ihe,"Attempt "+ki(Si+1),1)]),Ee("div",Dhe,[Ee("div",zhe,[Ee("div",{class:Ga(["h-full rounded-lg transition-all duration-300",[Si===0?"bg-gradient-to-r from-cyan-500/50 to-cyan-600/50":Si===1?"bg-gradient-to-r from-yellow-500/50 to-yellow-600/50":Si===2?"bg-gradient-to-r from-orange-500/50 to-orange-600/50":"bg-gradient-to-r from-red-500/50 to-red-600/50"]]),style:om({width:`${Math.min(100,gi/Math.max(...Zt(or.packet.lbt_backoff_delays_ms))*100)}%`})},[Ee("div",Ohe,[Ee("span",Bhe,ki(Mr(gi)),1)])],6)])]),Ee("div",Rhe,[Ee("span",Fhe,ki(Math.round(gi/Zt(or.packet.lbt_backoff_delays_ms).reduce((Ci,ri)=>Ci+ri,0)*100))+"% ",1)])]))),128))])])):Sa("",!0)])):Sa("",!0),Ee("div",Nhe,[Ee("div",jhe,[Ee("div",Uhe,[Cr[41]||(Cr[41]=Ee("span",{class:"text-white/70 text-sm"},"TX Delay",-1)),Ee("span",$he,ki(Number(or.packet.tx_delay_ms)>0?Number(or.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),Ee("div",Hhe,[Cr[42]||(Cr[42]=Ee("span",{class:"text-white/70 text-sm"},"Transmitted",-1)),Ee("span",{class:Ga(or.packet.transmitted?"text-green-400":"text-red-400")},ki(or.packet.transmitted?"Yes":"No"),3)])]),Ee("div",Vhe,[Ee("div",Whe,[Cr[43]||(Cr[43]=Ee("span",{class:"text-white/70 text-sm"},"Is Duplicate",-1)),Ee("span",{class:Ga(or.packet.is_duplicate?"text-amber-400":"text-white/60")},ki(or.packet.is_duplicate?"Yes":"No"),3)]),or.packet.drop_reason?(jr(),Kr("div",qhe,[Cr[44]||(Cr[44]=Ee("span",{class:"text-white/70 text-sm"},"Drop Reason",-1)),Ee("span",Ghe,ki(or.packet.drop_reason),1)])):Sa("",!0)])])])])]),Ee("div",Zhe,[Ee("button",{onClick:Cr[1]||(Cr[1]=gi=>c("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-white transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):Sa("",!0)]),_:1})]))}}),Yhe=kh(Khe,[["__scopeId","data-v-57e9f282"]]),n$="pymc_pref_";function D1(t,e){try{const r=localStorage.getItem(n$+t);return r===null?e:JSON.parse(r)}catch(r){return console.warn(`Failed to get preference ${t}:`,r),e}}function z1(t,e){try{localStorage.setItem(n$+t,JSON.stringify(e))}catch(r){console.warn(`Failed to set preference ${t}:`,r)}}const Xhe={class:"glass-card rounded-[20px] p-6"},Jhe={class:"flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container"},Qhe={class:"flex items-center gap-2 header-info relative"},efe={class:"text-dark-text text-sm packet-count"},tfe=["title"],rfe={class:"hidden sm:inline"},ife={key:1,class:"text-accent-red text-sm error-indicator"},nfe={class:"flex items-center gap-3 lg:flex filter-controls"},afe={class:"flex flex-col"},ofe=["value"],sfe={class:"flex flex-col"},lfe=["value"],ufe={class:"flex flex-col"},cfe={class:"flex flex-col reset-container"},hfe=["disabled"],ffe={class:"space-y-4 overflow-hidden"},dfe=["onClick"],pfe={class:"hidden lg:grid grid-cols-12 gap-2 items-center"},mfe={class:"col-span-1 text-white text-sm"},gfe={class:"col-span-1 flex items-center gap-2"},vfe={class:"flex flex-col"},yfe={class:"text-white text-xs"},_fe=["title"],xfe={class:"col-span-2"},bfe={class:"col-span-1 text-white text-xs"},wfe={class:"col-span-2"},kfe={class:"space-y-1"},Tfe={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},Sfe={class:"col-span-1 text-white text-xs"},Cfe={class:"col-span-1 text-white text-xs"},Afe={class:"col-span-1 text-white text-xs"},Mfe={class:"col-span-1 text-white text-xs"},Efe={key:0,class:"flex items-center gap-1"},Lfe={class:"col-span-1"},Pfe={key:0,class:"text-accent-red text-[8px] italic truncate"},Ife={class:"lg:hidden space-y-2"},Dfe={class:"flex items-center justify-between"},zfe={class:"flex items-center gap-2"},Ofe={class:"flex flex-col"},Bfe={class:"text-white text-sm font-medium"},Rfe=["title"],Ffe={class:"flex items-center gap-2 text-right"},Nfe={class:"text-white/70 text-xs"},jfe={class:"flex items-center justify-between"},Ufe={class:"flex items-center gap-2"},$fe={class:"inline-block px-2 py-0.5 rounded bg-[#588187] text-accent-cyan text-xs"},Hfe={class:"flex items-center gap-2"},Vfe={class:"flex items-center gap-1"},Wfe={key:0,class:"flex gap-0.5"},qfe={class:"text-white text-xs"},Gfe={class:"flex items-center justify-between text-white/60 text-xs"},Zfe={class:"flex items-center gap-3"},Kfe={class:"flex items-center gap-2"},Yfe={key:0,class:"flex items-center gap-1"},Xfe={key:0,class:"text-accent-red text-xs italic"},Jfe={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-dark-border pagination-container"},Qfe={class:"flex items-center gap-4 pagination-info"},ede={class:"text-dark-text text-sm"},tde={key:0,class:"flex items-center gap-2 load-more-section"},rde=["disabled"],ide={class:"text-dark-text text-xs load-more-count"},nde={class:"flex items-center gap-2 pagination-controls"},ade=["disabled"],ode={class:"flex items-center gap-1 page-numbers"},sde={key:1,class:"text-dark-text text-sm px-2 ellipsis"},lde=["onClick"],ude={key:2,class:"text-dark-text text-sm px-2 ellipsis"},cde=["disabled"],hde={key:1,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},fde={class:"flex items-center gap-4"},dde={class:"text-dark-text text-sm"},pde={class:"text-dark-text text-xs"},mde={key:2,class:"flex justify-center mt-6 pt-4 border-t border-dark-border"},D3=10,ux=1e3,gde=Bu({name:"PacketTable",__name:"PacketTable",setup(t){const e=a4(),r=fn(1),c=fn(null),S=fn(100),$=fn(!1),Z=fn(!1);let ue=null;Af(()=>e.isLoading,qn=>{qn?(ue&&(clearTimeout(ue),ue=null),Z.value=!0):ue=window.setTimeout(()=>{Z.value=!1,ue=null},600)});const xe=fn(null),Se=fn(!1),Ne=qn=>{xe.value=qn,Se.value=!0},it=()=>{Se.value=!1,xe.value=null},pt=fn(D1("packetTable_selectedType","all")),bt=fn(D1("packetTable_selectedRoute","all")),wt=fn(!1),Dt=fn(null),Zt=["all","0","1","2","3","4","5","6","7","8","9","10","11"],Mr=["all","1","2"];Af(pt,qn=>{z1("packetTable_selectedType",qn),r.value=1}),Af(bt,qn=>{z1("packetTable_selectedRoute",qn),r.value=1}),Af(wt,()=>{r.value=1});const ze=Io(()=>{let qn=e.recentPackets;if(pt.value!=="all"){const ln=parseInt(pt.value);qn=qn.filter(nn=>nn.type===ln)}if(bt.value!=="all"){const ln=parseInt(bt.value);qn=qn.filter(nn=>nn.route===ln)}return wt.value&&Dt.value!==null&&(qn=qn.filter(ln=>ln.timestamp>=Dt.value)),qn}),ni=Io(()=>{const qn=(r.value-1)*D3,ln=qn+D3;return ze.value.slice(qn,ln)}),or=Io(()=>Math.ceil(ze.value.length/D3)),Cr=Io(()=>r.value===or.value),gi=Io(()=>e.recentPackets.length>=S.value&&S.valueCr.value&&gi.value&&!$.value),Ci=qn=>new Date(qn*1e3).toLocaleTimeString(void 0,{hour12:!0}),ri=qn=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTI_PART",11:"CONTROL"})[qn]||`TYPE_${qn}`,on=qn=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[qn]||`Route ${qn}`,yi=qn=>qn.transmitted?"text-accent-green":"text-primary",gr=qn=>qn.drop_reason?"Dropped":qn.transmitted?"Forward":"Received",fr=qn=>qn===1?"bg-[#223231] text-accent-cyan":"bg-secondary/30 text-secondary",Sr=qn=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[qn]||"bg-gray-500",ei=qn=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[qn]||"border-l-gray-500",Jr=qn=>!qn.transmitted||!qn.lbt_attempts||qn.lbt_attempts===0?"bg-green-400":qn.lbt_attempts===1?"bg-cyan-400":qn.lbt_attempts===2?"bg-yellow-400":"bg-orange-400",ti=qn=>qn>=1e3?(qn/1e3).toFixed(2)+"s":qn.toFixed(1)+"ms",Di=qn=>{if(qn.type!==4||!qn.payload)return null;try{const ln=qn.payload.replace(/\s+/g,"").toUpperCase();let nn=ln,On=0;if(ln.length/2>=100)if(ln.length>200)nn=ln.slice(200),On=0;else return null;if(nn.length>=2){const Xa=parseInt(nn.slice(0,2),16);On+=2;const zo=!!(Xa&16),xa=!!(Xa&32),$r=!!(Xa&64);if(!!!(Xa&128))return null;if(zo&&nn.length>=On+16&&(On+=16),xa&&nn.length>=On+4&&(On+=4),$r&&nn.length>=On+4&&(On+=4),nn.length>On){const go=(nn.slice(On).match(/.{2}/g)||[]).map(ko=>{const ss=parseInt(ko,16);return ss>=32&&ss<=126?String.fromCharCode(ss):"."}).join("").replace(/\.*$/,"");return go.length>0?go:null}}}catch(ln){console.error("Error parsing ADVERT node name:",ln)}return null},En=()=>{pt.value="all",bt.value="all",wt.value=!1,Dt.value=null,r.value=1},Zn=()=>{wt.value?(wt.value=!1,Dt.value=null):(wt.value=!0,Dt.value=Date.now()/1e3),r.value=1},ga=Io(()=>Dt.value?new Date(Dt.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):""),ya=async qn=>{try{const ln=qn||S.value;await e.fetchRecentPackets({limit:ln})}catch(ln){console.error("Error fetching packet data:",ln)}},ro=async()=>{if(!($.value||S.value>=ux)){$.value=!0;try{const qn=Math.min(S.value+200,ux);S.value=qn,await ya(qn)}catch(qn){console.error("Error loading more records:",qn)}finally{$.value=!1}}};return Jf(async()=>{await ya(),c.value=window.setInterval(ya,1e4)}),$g(()=>{c.value&&clearInterval(c.value),ue&&clearTimeout(ue)}),(qn,ln)=>(jr(),Kr(js,null,[Ee("div",Xhe,[Ee("div",Jhe,[Ee("div",Qhe,[ln[7]||(ln[7]=Ee("h3",{class:"text-white text-xl font-semibold"},"Recent Packets",-1)),Ee("span",efe," ("+ki(ze.value.length)+" of "+ki(Po(e).recentPackets.length)+") ",1),wt.value?(jr(),Kr("span",{key:0,class:"text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap",title:`Filter activated at ${ga.value}`},[Ee("span",rfe,"Live Mode (since "+ki(ga.value)+")",1),ln[6]||(ln[6]=Ee("span",{class:"sm:hidden"},"Live",-1))],8,tfe)):Sa("",!0),Po(e).error?(jr(),Kr("span",ife,ki(Po(e).error),1)):Sa("",!0)]),Ee("div",nfe,[Ee("div",afe,[ln[8]||(ln[8]=Ee("label",{class:"text-dark-text text-xs mb-1"},"Type",-1)),Sl(Ee("select",{"onUpdate:modelValue":ln[0]||(ln[0]=nn=>pt.value=nn),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(jr(),Kr(js,null,au(Zt,nn=>Ee("option",{key:nn,value:nn,class:"bg-[#1A1E1F] text-white"},ki(nn==="all"?"All Types":`Type ${nn} (${ri(parseInt(nn))})`),9,ofe)),64))],512),[[xg,pt.value]])]),Ee("div",sfe,[ln[9]||(ln[9]=Ee("label",{class:"text-dark-text text-xs mb-1"},"Route",-1)),Sl(Ee("select",{"onUpdate:modelValue":ln[1]||(ln[1]=nn=>bt.value=nn),class:"glass-card border border-dark-border rounded-[10px] px-3 py-2 text-white text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(jr(),Kr(js,null,au(Mr,nn=>Ee("option",{key:nn,value:nn,class:"bg-[#1A1E1F] text-white"},ki(nn==="all"?"All Routes":`Route ${nn} (${on(parseInt(nn))})`),9,lfe)),64))],512),[[xg,bt.value]])]),Ee("div",ufe,[ln[10]||(ln[10]=Ee("label",{class:"text-dark-text text-xs mb-1"},"Filter",-1)),Ee("button",{onClick:Zn,class:Ga(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":wt.value,"border-dark-border text-dark-text hover:border-primary hover:text-white hover:bg-primary/5":!wt.value}])},ki(wt.value?"New Only":"Show New"),3)]),Ee("div",cfe,[ln[11]||(ln[11]=Ee("label",{class:"text-transparent text-xs mb-1"},".",-1)),Ee("button",{onClick:En,class:Ga(["glass-card border border-dark-border hover:border-primary rounded-[10px] px-4 py-2 text-dark-text hover:text-white text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-dark-border hover:text-dark-text":pt.value==="all"&&bt.value==="all"&&!wt.value,"hover:bg-primary/10":pt.value!=="all"||bt.value!=="all"||wt.value}]),disabled:pt.value==="all"&&bt.value==="all"&&!wt.value}," Reset ",10,hfe)])])]),ln[17]||(ln[17]=Dc('',1)),Ee("div",ffe,[nl(Vae,{name:"packet-list",tag:"div",class:"space-y-4",appear:""},{default:$1(()=>[(jr(!0),Kr(js,null,au(ni.value,(nn,On)=>(jr(),Kr("div",{key:`${nn.packet_hash}_${nn.timestamp}_${On}`,class:Ga(["packet-row border-b border-dark-border/50 pb-4 hover:bg-white/5 transition-colors duration-200 cursor-pointer rounded-[10px] p-2 border-l-4",ei(nn.type)]),onClick:Ra=>Ne(nn)},[Ee("div",pfe,[Ee("div",mfe,ki(Ci(nn.timestamp)),1),Ee("div",gfe,[Ee("div",{class:Ga(["w-2 h-2 rounded-full",Sr(nn.type)])},null,2),Ee("div",vfe,[Ee("span",yfe,ki(ri(nn.type)),1),nn.type===4&&Di(nn)?(jr(),Kr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate",title:Di(nn)||void 0},ki(Di(nn)),9,_fe)):Sa("",!0)])]),Ee("div",xfe,[Ee("span",{class:Ga(["inline-block px-2 py-1 rounded text-xs font-medium",fr(nn.route)])},ki(on(nn.route)),3)]),Ee("div",bfe,ki(nn.length)+"B",1),Ee("div",wfe,[Ee("div",kfe,[Ee("span",Tfe,ki(nn.src_hash?.slice(-4)||"????")+" → "+ki(nn.dst_hash?.slice(-4)||"????"),1)])]),Ee("div",Sfe,ki(nn.rssi!=null?nn.rssi.toFixed(0):"N/A"),1),Ee("div",Cfe,ki(nn.snr!=null?nn.snr.toFixed(1)+"dB":"N/A"),1),Ee("div",Afe,ki(nn.score!=null?nn.score.toFixed(2):"N/A"),1),Ee("div",Mfe,[Number(nn.tx_delay_ms)>0?(jr(),Kr("div",Efe,[nn.transmitted?(jr(),Kr("div",{key:0,class:Ga(["w-1.5 h-1.5 rounded-full flex-shrink-0",Jr(nn)])},null,2)):Sa("",!0),Ee("span",null,ki(ti(Number(nn.tx_delay_ms))),1)])):Sa("",!0)]),Ee("div",Lfe,[Ee("div",null,[Ee("span",{class:Ga(["text-xs font-medium",yi(nn)])},ki(gr(nn)),3),nn.drop_reason?(jr(),Kr("p",Pfe,ki(nn.drop_reason),1)):Sa("",!0)])])]),Ee("div",Ife,[Ee("div",Dfe,[Ee("div",zfe,[Ee("div",{class:Ga(["w-2 h-2 rounded-full flex-shrink-0",Sr(nn.type)])},null,2),Ee("div",Ofe,[Ee("span",Bfe,ki(ri(nn.type)),1),nn.type===4&&Di(nn)?(jr(),Kr("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium leading-tight",title:Di(nn)||void 0},ki(Di(nn)),9,Rfe)):Sa("",!0)]),Ee("span",{class:Ga(["inline-block px-2 py-1 rounded text-xs font-medium ml-2",fr(nn.route)])},ki(on(nn.route)),3)]),Ee("div",Ffe,[Ee("span",Nfe,ki(Ci(nn.timestamp)),1),Ee("span",{class:Ga(["text-xs font-medium",yi(nn)])},ki(gr(nn)),3)])]),Ee("div",jfe,[Ee("div",Ufe,[Ee("span",$fe,ki(nn.src_hash?.slice(-4)||"????")+" → "+ki(nn.dst_hash?.slice(-4)||"????"),1)]),Ee("div",Hfe,[Ee("div",Vfe,[nn.snr!=null?(jr(),Kr("div",Wfe,[Ee("div",{class:Ga(["w-1 h-3 rounded-sm",nn.snr>=-10?"bg-green-400":"bg-white/20"])},null,2),Ee("div",{class:Ga(["w-1 h-4 rounded-sm",nn.snr>=-5?"bg-green-400":"bg-white/20"])},null,2),Ee("div",{class:Ga(["w-1 h-5 rounded-sm",nn.snr>=0?"bg-green-400":"bg-white/20"])},null,2),Ee("div",{class:Ga(["w-1 h-6 rounded-sm",nn.snr>=10?"bg-green-400":"bg-white/20"])},null,2)])):Sa("",!0),Ee("span",qfe,ki(nn.rssi!=null?nn.rssi.toFixed(0)+"dBm":"TX"),1)])])]),Ee("div",Gfe,[Ee("div",Zfe,[Ee("span",null,ki(nn.length)+"B",1),Ee("span",null,"SNR: "+ki(nn.snr!=null?nn.snr.toFixed(1)+"dB":"N/A"),1),Ee("span",null,"Score: "+ki(nn.score!=null?nn.score.toFixed(2):"N/A"),1)]),Ee("div",Kfe,[Number(nn.tx_delay_ms)>0?(jr(),Kr("span",Yfe,[nn.transmitted?(jr(),Kr("div",{key:0,class:Ga(["w-1.5 h-1.5 rounded-full flex-shrink-0",Jr(nn)])},null,2)):Sa("",!0),Ee("span",null,ki(ti(Number(nn.tx_delay_ms))),1)])):Sa("",!0)])]),nn.drop_reason?(jr(),Kr("div",Xfe,ki(nn.drop_reason),1)):Sa("",!0)])],10,dfe))),128))]),_:1})]),or.value>1?(jr(),Kr("div",Jfe,[Ee("div",Qfe,[Ee("span",ede," Showing "+ki((r.value-1)*D3+1)+" - "+ki(Math.min(r.value*D3,ze.value.length))+" of "+ki(ze.value.length)+" packets ",1),Si.value?(jr(),Kr("div",tde,[ln[12]||(ln[12]=Ee("span",{class:"text-dark-text text-xs"},"•",-1)),Ee("button",{onClick:ro,disabled:$.value,class:Ga(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!$.value,"text-dark-text border-dark-border cursor-not-allowed opacity-50":$.value}])},ki($.value?"Loading...":`Load ${Math.min(200,ux-S.value)} more`),11,rde),Ee("span",ide,"("+ki(S.value)+"/"+ki(ux)+" max)",1)])):Sa("",!0)]),Ee("div",nde,[Ee("button",{onClick:ln[2]||(ln[2]=nn=>r.value=r.value-1),disabled:r.value<=1,class:Ga(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":r.value<=1,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value>1}])},ln[13]||(ln[13]=[Ee("span",{class:"hidden sm:inline"},"Previous",-1),Ee("span",{class:"sm:hidden"},"‹",-1)]),10,ade),Ee("div",ode,[r.value>3?(jr(),Kr("button",{key:0,onClick:ln[3]||(ln[3]=nn=>r.value=1),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):Sa("",!0),r.value>4?(jr(),Kr("span",sde,"...")):Sa("",!0),(jr(!0),Kr(js,null,au(Array.from({length:Math.min(5,or.value)},(nn,On)=>Math.max(1,Math.min(r.value-2,or.value-4))+On).filter(nn=>nn<=or.value),nn=>(jr(),Kr("button",{key:nn,onClick:On=>r.value=nn,class:Ga(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number",{"border-primary bg-primary/10 text-primary":r.value===nn,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value!==nn}])},ki(nn),11,lde))),128)),r.valuer.value=or.value),class:"glass-card border border-dark-border hover:border-primary rounded-[8px] px-3 py-2 text-sm text-white hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},ki(or.value),1)):Sa("",!0)]),Ee("button",{onClick:ln[5]||(ln[5]=nn=>r.value=r.value+1),disabled:r.value>=or.value,class:Ga(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-dark-border text-dark-text cursor-not-allowed opacity-50":r.value>=or.value,"border-dark-border text-white hover:border-primary hover:text-primary hover:bg-primary/5":r.value(jr(),Kr("div",null,[nl(aue),Ee("div",yde,[nl(Bue),nl(_ue)]),nl(vde)]))}}),xde={class:"bg-white/5 border border-white/10 rounded-lg p-4 mb-6"},bde={class:"flex items-center gap-3"},wde={class:"flex-1 min-w-0"},kde={class:"text-white font-medium truncate"},Tde={class:"text-white/60 text-sm font-mono"},Sde={key:0,class:"text-white/50 text-xs"},Cde={key:1,class:"text-white/50 text-xs"},Ade=Bu({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup(t,{emit:e}){const r=t,c=e,S=()=>{r.neighbor&&(c("delete",r.neighbor.id),$())},$=()=>{c("close")},Z=ue=>{ue.target===ue.currentTarget&&$()};return(ue,xe)=>ue.show&&ue.neighbor?(jr(),Kr("div",{key:0,onClick:Z,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:xe[0]||(xe[0]=Xf(()=>{},["stop"]))},[Ee("div",{class:"flex items-center gap-3 mb-6"},[xe[2]||(xe[2]=Ee("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),xe[3]||(xe[3]=Ee("div",null,[Ee("h3",{class:"text-xl font-semibold text-white"},"Delete Neighbor"),Ee("p",{class:"text-white/60 text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),Ee("button",{onClick:$,class:"ml-auto text-white/60 hover:text-white transition-colors"},xe[1]||(xe[1]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",xde,[Ee("div",bde,[Ee("div",wde,[Ee("div",kde,ki(ue.neighbor?.node_name||ue.neighbor?.long_name||ue.neighbor?.short_name||"Unknown"),1),Ee("div",Tde," ID: "+ki(ue.neighbor?.node_num_hex||ue.neighbor?.node_num||ue.neighbor?.id||"N/A"),1),ue.neighbor?.contact_type?(jr(),Kr("div",Sde,ki(ue.neighbor.contact_type),1)):Sa("",!0),ue.neighbor?.hw_model?(jr(),Kr("div",Cde,ki(ue.neighbor.hw_model),1)):Sa("",!0)])])]),xe[4]||(xe[4]=Ee("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[Ee("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),Ee("span",null,"This action cannot be undone")])],-1)),Ee("div",{class:"flex gap-3"},[Ee("button",{onClick:$,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Ee("button",{onClick:S,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"}," Delete ")])])])):Sa("",!0)}}),Mde={class:"bg-gradient-to-r from-primary/20 to-accent-blue/20 border-b border-white/10 px-6 py-4"},Ede={class:"flex items-center justify-between"},Lde={class:"flex items-center gap-3"},Pde={key:0,class:"text-sm text-dark-text"},Ide={class:"p-6"},Dde={key:0,class:"text-center py-8"},zde={key:1,class:"text-center py-8"},Ode={class:"text-dark-text text-sm"},Bde={key:2,class:"space-y-4"},Rde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Fde={class:"flex items-center justify-between mb-2"},Nde={class:"flex items-baseline gap-2"},jde={class:"text-3xl font-bold text-white"},Ude={class:"grid grid-cols-2 gap-3"},$de={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Hde={class:"flex items-center gap-2 mb-2"},Vde={class:"flex gap-0.5"},Wde={class:"flex items-baseline gap-1"},qde={class:"text-xl font-bold text-white"},Gde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Zde={class:"flex items-baseline gap-1"},Kde={class:"text-xl font-bold text-white"},Yde={class:"bg-dark-bg/50 border border-white/10 rounded-[15px] p-4"},Xde={class:"relative"},Jde={class:"flex items-center gap-2 overflow-x-auto pb-2"},Qde={key:0,class:"relative flex items-center"},epe={key:0,class:"absolute left-1/2 -translate-x-1/2 animate-pulse"},tpe={class:"text-dark-text/60 text-xs mt-2 flex items-center justify-between"},rpe={key:0,class:"text-primary animate-pulse"},ipe={class:"flex items-center justify-between text-xs text-dark-text/60 pt-2"},npe=Bu({__name:"PingResultModal",props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=Ym(),$=fn(0),Z=fn(!1),ue=Io(()=>{const pt=S.stats?.config?.radio?.spreading_factor??7,bt=S.stats?.config?.radio?.bandwidth??125,wt=S.stats?.config?.radio?.coding_rate??5,Dt=Math.pow(2,pt)/bt,Zt=8+4.25*(wt-4)+20;return Dt*Zt}),xe=Io(()=>{if(!r.result)return{color:"text-gray-400",label:"Unknown"};const pt=r.result.rtt_ms,bt=ue.value,wt=r.result.path.length,Zt=2*bt*wt+500*wt;return pt{if(!r.result)return{bars:0,color:"text-gray-400"};const pt=r.result.rssi;return pt>=-50?{bars:5,color:"text-green-400"}:pt>=-60?{bars:4,color:"text-green-300"}:pt>=-70?{bars:3,color:"text-yellow-400"}:pt>=-80?{bars:2,color:"text-orange-400"}:pt>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}});Af(()=>r.result,pt=>{if(pt&&!Z.value){Z.value=!0,$.value=0;const bt=pt.path.length,Dt=1500/(bt*2);let Zt=0;const Mr=bt*2-2,ze=()=>{Zt<=Mr?($.value=Zt/Mr,Zt++,setTimeout(ze,Dt)):(Z.value=!1,$.value=1)};setTimeout(ze,100)}},{immediate:!0});const Ne=Io(()=>{if(!r.result||!Z.value)return-1;const pt=r.result.path.length;if(pt<=1)return-1;const bt=$.value,wt=.5;if(bt<=wt)return bt/wt*(pt-1);{const Dt=(bt-wt)/wt;return(pt-1)*(1-Dt)}}),it=()=>{c("close")};return(pt,bt)=>(jr(),Cd(y8,{to:"body"},[nl(R2,{name:"modal"},{default:$1(()=>[pt.show?(jr(),Kr("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4",onClick:Xf(it,["self"])},[Ee("div",{class:"bg-dark-card border border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden",onClick:bt[0]||(bt[0]=Xf(()=>{},["stop"]))},[Ee("div",Mde,[Ee("div",Ede,[Ee("div",Lde,[bt[2]||(bt[2]=Ee("div",{class:"p-2 bg-primary/20 rounded-lg"},[Ee("svg",{class:"w-5 h-5 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})])],-1)),Ee("div",null,[bt[1]||(bt[1]=Ee("h2",{class:"text-xl font-bold text-white"},"Ping Result",-1)),pt.nodeName?(jr(),Kr("p",Pde,ki(pt.nodeName),1)):Sa("",!0)])]),Ee("button",{onClick:it,class:"p-2 hover:bg-white/10 rounded-lg transition-colors text-white/60 hover:text-white"},bt[3]||(bt[3]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),Ee("div",Ide,[pt.loading?(jr(),Kr("div",Dde,bt[4]||(bt[4]=[Ee("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"},null,-1),Ee("p",{class:"text-dark-text"},"Sending ping...",-1),Ee("p",{class:"text-dark-text/60 text-sm mt-1"},"Waiting for response...",-1)]))):pt.error?(jr(),Kr("div",zde,[bt[5]||(bt[5]=Ee("div",{class:"p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center"},[Ee("svg",{class:"w-8 h-8 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})])],-1)),bt[6]||(bt[6]=Ee("h3",{class:"text-accent-red font-semibold mb-2"},"Ping Failed",-1)),Ee("p",Ode,ki(pt.error),1)])):pt.result?(jr(),Kr("div",Bde,[Ee("div",Rde,[Ee("div",Fde,[bt[7]||(bt[7]=Ee("span",{class:"text-dark-text text-sm"},"Round-Trip Time",-1)),Ee("span",{class:Ga(["text-xs font-medium px-2 py-1 rounded-full",xe.value.color,"bg-current/10"])},ki(xe.value.label),3)]),Ee("div",Nde,[Ee("span",jde,ki(pt.result.rtt_ms.toFixed(2)),1),bt[8]||(bt[8]=Ee("span",{class:"text-dark-text"},"ms",-1))])]),Ee("div",Ude,[Ee("div",$de,[Ee("div",Hde,[bt[9]||(bt[9]=Ee("span",{class:"text-dark-text text-sm"},"RSSI",-1)),Ee("div",Vde,[(jr(),Kr(js,null,au(5,wt=>Ee("div",{key:wt,class:Ga(["w-1 h-3 rounded-sm",wt<=Se.value.bars?Se.value.color:"bg-white/10"])},null,2)),64))])]),Ee("div",Wde,[Ee("span",qde,ki(pt.result.rssi),1),bt[10]||(bt[10]=Ee("span",{class:"text-dark-text text-xs"},"dBm",-1))])]),Ee("div",Gde,[bt[12]||(bt[12]=Ee("div",{class:"text-dark-text text-sm mb-2"},"SNR",-1)),Ee("div",Zde,[Ee("span",Kde,ki(pt.result.snr_db),1),bt[11]||(bt[11]=Ee("span",{class:"text-dark-text text-xs"},"dB",-1))])])]),Ee("div",Yde,[bt[15]||(bt[15]=Ee("div",{class:"text-dark-text text-sm mb-3"},"Network Path",-1)),Ee("div",Xde,[Ee("div",Jde,[(jr(!0),Kr(js,null,au(pt.result.path,(wt,Dt)=>(jr(),Kr("div",{key:Dt,class:"flex items-center gap-2 flex-shrink-0 relative"},[Ee("div",{class:Ga(["bg-primary/20 text-primary border border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300",Z.value&&Math.floor(Ne.value)===Dt?"ring-2 ring-primary/50 scale-105":""])},ki(wt),3),Dt[Z.value&&Ne.value>=Dt&&Ne.value"u"||!L||!L.Mixin)){de=wi(de)?de:[de];for(var $e=0;$e0?Math.floor(de):Math.ceil(de)};Di.prototype={clone:function(){return new Di(this.x,this.y)},add:function(de){return this.clone()._add(Qn(de))},_add:function(de){return this.x+=de.x,this.y+=de.y,this},subtract:function(de){return this.clone()._subtract(Qn(de))},_subtract:function(de){return this.x-=de.x,this.y-=de.y,this},divideBy:function(de){return this.clone()._divideBy(de)},_divideBy:function(de){return this.x/=de,this.y/=de,this},multiplyBy:function(de){return this.clone()._multiplyBy(de)},_multiplyBy:function(de){return this.x*=de,this.y*=de,this},scaleBy:function(de){return new Di(this.x*de.x,this.y*de.y)},unscaleBy:function(de){return new Di(this.x/de.x,this.y/de.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=qn(this.x),this.y=qn(this.y),this},distanceTo:function(de){de=Qn(de);var $e=de.x-this.x,yt=de.y-this.y;return Math.sqrt($e*$e+yt*yt)},equals:function(de){return de=Qn(de),de.x===this.x&&de.y===this.y},contains:function(de){return de=Qn(de),Math.abs(de.x)<=Math.abs(this.x)&&Math.abs(de.y)<=Math.abs(this.y)},toString:function(){return"Point("+vt(this.x)+", "+vt(this.y)+")"}};function Qn(de,$e,yt){return de instanceof Di?de:wi(de)?new Di(de[0],de[1]):de==null?de:typeof de=="object"&&"x"in de&&"y"in de?new Di(de.x,de.y):new Di(de,$e,yt)}function ka(de,$e){if(de)for(var yt=$e?[de,$e]:de,nr=0,jr=yt.length;nr=this.min.x&&yt.x<=this.max.x&&$e.y>=this.min.y&&yt.y<=this.max.y},intersects:function(de){de=Ta(de);var $e=this.min,yt=this.max,nr=de.min,jr=de.max,$i=jr.x>=$e.x&&nr.x<=yt.x,ra=jr.y>=$e.y&&nr.y<=yt.y;return $i&&ra},overlaps:function(de){de=Ta(de);var $e=this.min,yt=this.max,nr=de.min,jr=de.max,$i=jr.x>$e.x&&nr.x$e.y&&nr.y=$e.lat&&jr.lat<=yt.lat&&nr.lng>=$e.lng&&jr.lng<=yt.lng},intersects:function(de){de=Yn(de);var $e=this._southWest,yt=this._northEast,nr=de.getSouthWest(),jr=de.getNorthEast(),$i=jr.lat>=$e.lat&&nr.lat<=yt.lat,ra=jr.lng>=$e.lng&&nr.lng<=yt.lng;return $i&&ra},overlaps:function(de){de=Yn(de);var $e=this._southWest,yt=this._northEast,nr=de.getSouthWest(),jr=de.getNorthEast(),$i=jr.lat>$e.lat&&nr.lat$e.lng&&nr.lng1,XS=function(){var de=!1;try{var $e=Object.defineProperty({},"passive",{get:function(){de=!0}});window.addEventListener("testPassiveEventSupport",Xe,$e),window.removeEventListener("testPassiveEventSupport",Xe,$e)}catch{}return de}(),JS=function(){return!!document.createElement("canvas").getContext}(),Q2=!!(document.createElementNS&&oo("svg").createSVGRect),QS=!!Q2&&function(){var de=document.createElement("div");return de.innerHTML="",(de.firstChild&&de.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),e8=!Q2&&function(){try{var de=document.createElement("div");de.innerHTML='';var $e=de.firstChild;return $e.style.behavior="url(#default#VML)",$e&&typeof $e.adj=="object"}catch{return!1}}(),g4=navigator.platform.indexOf("Mac")===0,ew=navigator.platform.indexOf("Linux")===0;function q0(de){return navigator.userAgent.toLowerCase().indexOf(de)>=0}var Fl={ie:ss,ielt9:ys,edge:ns,webkit:Qo,android:Rl,android23:Ws,androidStock:Su,opera:uc,chrome:Th,gecko:Gc,safari:Bp,phantom:wp,opera12:W0,win:um,ie3d:Vg,webkit3d:q1,gecko3d:Rp,any3d:cm,mobile:Wg,mobileWebkit:Zx,mobileWebkit3d:qS,msPointer:d4,pointer:p4,touch:GS,touchNative:m4,mobileOpera:ZS,mobileGecko:KS,retina:YS,passiveEvents:XS,canvas:JS,svg:Q2,vml:e8,inlineSvg:QS,mac:g4,linux:ew},oh=Fl.msPointer?"MSPointerDown":"pointerdown",Wd=Fl.msPointer?"MSPointerMove":"pointermove",tw=Fl.msPointer?"MSPointerUp":"pointerup",rc=Fl.msPointer?"MSPointerCancel":"pointercancel",v_={touchstart:oh,touchmove:Wd,touchend:tw,touchcancel:rc},v4={touchstart:i8,touchmove:Ym,touchend:Ym,touchcancel:Ym},G1={},Kx=!1;function y_(de,$e,yt){return $e==="touchstart"&&rw(),v4[$e]?(yt=v4[$e].bind(this,yt),de.addEventListener(v_[$e],yt,!1),yt):(console.warn("wrong event specified:",$e),Xe)}function t8(de,$e,yt){if(!v_[$e]){console.warn("wrong event specified:",$e);return}de.removeEventListener(v_[$e],yt,!1)}function as(de){G1[de.pointerId]=de}function r8(de){G1[de.pointerId]&&(G1[de.pointerId]=de)}function __(de){delete G1[de.pointerId]}function rw(){Kx||(document.addEventListener(oh,as,!0),document.addEventListener(Wd,r8,!0),document.addEventListener(tw,__,!0),document.addEventListener(rc,__,!0),Kx=!0)}function Ym(de,$e){if($e.pointerType!==($e.MSPOINTER_TYPE_MOUSE||"mouse")){$e.touches=[];for(var yt in G1)$e.touches.push(G1[yt]);$e.changedTouches=[$e],de($e)}}function i8(de,$e){$e.MSPOINTER_TYPE_TOUCH&&$e.pointerType===$e.MSPOINTER_TYPE_TOUCH&&Cc($e),Ym(de,$e)}function n8(de){var $e={},yt,nr;for(nr in de)yt=de[nr],$e[nr]=yt&&yt.bind?yt.bind(de):yt;return de=$e,$e.type="dblclick",$e.detail=2,$e.isTrusted=!1,$e._simulated=!0,$e}var a8=200;function o8(de,$e){de.addEventListener("dblclick",$e);var yt=0,nr;function jr($i){if($i.detail!==1){nr=$i.detail;return}if(!($i.pointerType==="mouse"||$i.sourceCapabilities&&!$i.sourceCapabilities.firesTouchEvents)){var ra=b4($i);if(!(ra.some(function(uo){return uo instanceof HTMLLabelElement&&uo.attributes.for})&&!ra.some(function(uo){return uo instanceof HTMLInputElement||uo instanceof HTMLSelectElement}))){var Xa=Date.now();Xa-yt<=a8?(nr++,nr===2&&$e(n8($i))):nr=1,yt=Xa}}}return de.addEventListener("click",jr),{dblclick:$e,simDblclick:jr}}function iw(de,$e){de.removeEventListener("dblclick",$e.dblclick),de.removeEventListener("click",$e.simDblclick)}var nw=Zg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),x_=Zg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),y4=x_==="webkitTransition"||x_==="OTransition"?x_+"End":"transitionend";function _4(de){return typeof de=="string"?document.getElementById(de):de}function b_(de,$e){var yt=de.style[$e]||de.currentStyle&&de.currentStyle[$e];if((!yt||yt==="auto")&&document.defaultView){var nr=document.defaultView.getComputedStyle(de,null);yt=nr?nr[$e]:null}return yt==="auto"?null:yt}function Nc(de,$e,yt){var nr=document.createElement(de);return nr.className=$e||"",yt&&yt.appendChild(nr),nr}function Of(de){var $e=de.parentNode;$e&&$e.removeChild(de)}function Yx(de){for(;de.firstChild;)de.removeChild(de.firstChild)}function Z1(de){var $e=de.parentNode;$e&&$e.lastChild!==de&&$e.appendChild(de)}function ji(de){var $e=de.parentNode;$e&&$e.firstChild!==de&&$e.insertBefore(de,$e.firstChild)}function aw(de,$e){if(de.classList!==void 0)return de.classList.contains($e);var yt=Gg(de);return yt.length>0&&new RegExp("(^|\\s)"+$e+"(\\s|$)").test(yt)}function Qu(de,$e){if(de.classList!==void 0)for(var yt=kt($e),nr=0,jr=yt.length;nr0?2*window.devicePixelRatio:1;function Oc(de){return Fl.edge?de.wheelDeltaY/2:de.deltaY&&de.deltaMode===0?-de.deltaY/lh:de.deltaY&&de.deltaMode===1?-de.deltaY*20:de.deltaY&&de.deltaMode===2?-de.deltaY*60:de.deltaX||de.deltaZ?0:de.wheelDelta?(de.wheelDeltaY||de.wheelDelta)/2:de.detail&&Math.abs(de.detail)<32765?-de.detail*20:de.detail?de.detail/-32765*60:0}function Hv(de,$e){var yt=$e.relatedTarget;if(!yt)return!0;try{for(;yt&&yt!==de;)yt=yt.parentNode}catch{return!1}return yt!==de}var T0={__proto__:null,on:Hu,off:Yh,stopPropagation:G0,disableScrollPropagation:Tg,disableClickPropagation:K1,preventDefault:Cc,stop:$v,getPropagationPath:b4,getMousePosition:kp,getWheelDelta:Oc,isExternalTarget:Hv,addListener:Hu,removeListener:Yh},T_=ei.extend({run:function(de,$e,yt,nr){this.stop(),this._el=de,this._inProgress=!0,this._duration=yt||.25,this._easeOutPower=1/Math.max(nr||.5,.2),this._startPos=Zc(de),this._offset=$e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=vi(this._animate,this),this._step()},_step:function(de){var $e=+new Date-this._startTime,yt=this._duration*1e3;$ethis.options.maxZoom)?this.setZoom(de):this},panInsideBounds:function(de,$e){this._enforcingBounds=!0;var yt=this.getCenter(),nr=this._limitCenter(yt,this._zoom,Yn(de));return yt.equals(nr)||this.panTo(nr,$e),this._enforcingBounds=!1,this},panInside:function(de,$e){$e=$e||{};var yt=Qn($e.paddingTopLeft||$e.padding||[0,0]),nr=Qn($e.paddingBottomRight||$e.padding||[0,0]),jr=this.project(this.getCenter()),$i=this.project(de),ra=this.getPixelBounds(),Xa=Ta([ra.min.add(yt),ra.max.subtract(nr)]),uo=Xa.getSize();if(!Xa.contains($i)){this._enforcingBounds=!0;var Mo=$i.subtract(Xa.getCenter()),Ys=Xa.extend($i).getSize().subtract(uo);jr.x+=Mo.x<0?-Ys.x:Ys.x,jr.y+=Mo.y<0?-Ys.y:Ys.y,this.panTo(this.unproject(jr),$e),this._enforcingBounds=!1}return this},invalidateSize:function(de){if(!this._loaded)return this;de=S({animate:!1,pan:!0},de===!0?{animate:!0}:de);var $e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var yt=this.getSize(),nr=$e.divideBy(2).round(),jr=yt.divideBy(2).round(),$i=nr.subtract(jr);return!$i.x&&!$i.y?this:(de.animate&&de.pan?this.panBy($i):(de.pan&&this._rawPanBy($i),this.fire("move"),de.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(Z(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:$e,newSize:yt}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(de){if(de=this._locateOptions=S({timeout:1e4,watch:!1},de),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var $e=Z(this._handleGeolocationResponse,this),yt=Z(this._handleGeolocationError,this);return de.watch?this._locationWatchId=navigator.geolocation.watchPosition($e,yt,de):navigator.geolocation.getCurrentPosition($e,yt,de),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(de){if(this._container._leaflet_id){var $e=de.code,yt=de.message||($e===1?"permission denied":$e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:$e,message:"Geolocation error: "+yt+"."})}},_handleGeolocationResponse:function(de){if(this._container._leaflet_id){var $e=de.coords.latitude,yt=de.coords.longitude,nr=new sn($e,yt),jr=nr.toBounds(de.coords.accuracy*2),$i=this._locateOptions;if($i.setView){var ra=this.getBoundsZoom(jr);this.setView(nr,$i.maxZoom?Math.min(ra,$i.maxZoom):ra)}var Xa={latlng:nr,bounds:jr,timestamp:de.timestamp};for(var uo in de.coords)typeof de.coords[uo]=="number"&&(Xa[uo]=de.coords[uo]);this.fire("locationfound",Xa)}},addHandler:function(de,$e){if(!$e)return this;var yt=this[de]=new $e(this);return this._handlers.push(yt),this.options[de]&&yt.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Of(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(vr(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var de;for(de in this._layers)this._layers[de].remove();for(de in this._panes)Of(this._panes[de]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(de,$e){var yt="leaflet-pane"+(de?" leaflet-"+de.replace("Pane","")+"-pane":""),nr=Nc("div",yt,$e||this._mapPane);return de&&(this._panes[de]=nr),nr},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var de=this.getPixelBounds(),$e=this.unproject(de.getBottomLeft()),yt=this.unproject(de.getTopRight());return new so($e,yt)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(de,$e,yt){de=Yn(de),yt=Qn(yt||[0,0]);var nr=this.getZoom()||0,jr=this.getMinZoom(),$i=this.getMaxZoom(),ra=de.getNorthWest(),Xa=de.getSouthEast(),uo=this.getSize().subtract(yt),Mo=Ta(this.project(Xa,nr),this.project(ra,nr)).getSize(),Ys=Fl.any3d?this.options.zoomSnap:1,El=uo.x/Mo.x,qu=uo.y/Mo.y,Zd=$e?Math.max(El,qu):Math.min(El,qu);return nr=this.getScaleZoom(Zd,nr),Ys&&(nr=Math.round(nr/(Ys/100))*(Ys/100),nr=$e?Math.ceil(nr/Ys)*Ys:Math.floor(nr/Ys)*Ys),Math.max(jr,Math.min($i,nr))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Di(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(de,$e){var yt=this._getTopLeftPoint(de,$e);return new ka(yt,yt.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(de){return this.options.crs.getProjectedBounds(de===void 0?this.getZoom():de)},getPane:function(de){return typeof de=="string"?this._panes[de]:de},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(de,$e){var yt=this.options.crs;return $e=$e===void 0?this._zoom:$e,yt.scale(de)/yt.scale($e)},getScaleZoom:function(de,$e){var yt=this.options.crs;$e=$e===void 0?this._zoom:$e;var nr=yt.zoom(de*yt.scale($e));return isNaN(nr)?1/0:nr},project:function(de,$e){return $e=$e===void 0?this._zoom:$e,this.options.crs.latLngToPoint(an(de),$e)},unproject:function(de,$e){return $e=$e===void 0?this._zoom:$e,this.options.crs.pointToLatLng(Qn(de),$e)},layerPointToLatLng:function(de){var $e=Qn(de).add(this.getPixelOrigin());return this.unproject($e)},latLngToLayerPoint:function(de){var $e=this.project(an(de))._round();return $e._subtract(this.getPixelOrigin())},wrapLatLng:function(de){return this.options.crs.wrapLatLng(an(de))},wrapLatLngBounds:function(de){return this.options.crs.wrapLatLngBounds(Yn(de))},distance:function(de,$e){return this.options.crs.distance(an(de),an($e))},containerPointToLayerPoint:function(de){return Qn(de).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(de){return Qn(de).add(this._getMapPanePos())},containerPointToLatLng:function(de){var $e=this.containerPointToLayerPoint(Qn(de));return this.layerPointToLatLng($e)},latLngToContainerPoint:function(de){return this.layerPointToContainerPoint(this.latLngToLayerPoint(an(de)))},mouseEventToContainerPoint:function(de){return kp(de,this._container)},mouseEventToLayerPoint:function(de){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(de))},mouseEventToLatLng:function(de){return this.layerPointToLatLng(this.mouseEventToLayerPoint(de))},_initContainer:function(de){var $e=this._container=_4(de);if($e){if($e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Hu($e,"scroll",this._onScroll,this),this._containerId=be($e)},_initLayout:function(){var de=this._container;this._fadeAnimated=this.options.fadeAnimation&&Fl.any3d,Qu(de,"leaflet-container"+(Fl.touch?" leaflet-touch":"")+(Fl.retina?" leaflet-retina":"")+(Fl.ielt9?" leaflet-oldie":"")+(Fl.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var $e=b_(de,"position");$e!=="absolute"&&$e!=="relative"&&$e!=="fixed"&&$e!=="sticky"&&(de.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var de=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),dc(this._mapPane,new Di(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Qu(de.markerPane,"leaflet-zoom-hide"),Qu(de.shadowPane,"leaflet-zoom-hide"))},_resetView:function(de,$e,yt){dc(this._mapPane,new Di(0,0));var nr=!this._loaded;this._loaded=!0,$e=this._limitZoom($e),this.fire("viewprereset");var jr=this._zoom!==$e;this._moveStart(jr,yt)._move(de,$e)._moveEnd(jr),this.fire("viewreset"),nr&&this.fire("load")},_moveStart:function(de,$e){return de&&this.fire("zoomstart"),$e||this.fire("movestart"),this},_move:function(de,$e,yt,nr){$e===void 0&&($e=this._zoom);var jr=this._zoom!==$e;return this._zoom=$e,this._lastCenter=de,this._pixelOrigin=this._getNewPixelOrigin(de),nr?yt&&yt.pinch&&this.fire("zoom",yt):((jr||yt&&yt.pinch)&&this.fire("zoom",yt),this.fire("move",yt)),this},_moveEnd:function(de){return de&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return vr(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(de){dc(this._mapPane,this._getMapPanePos().subtract(de))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(de){this._targets={},this._targets[be(this._container)]=this;var $e=de?Yh:Hu;$e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&$e(window,"resize",this._onResize,this),Fl.any3d&&this.options.transform3DLimit&&(de?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){vr(this._resizeRequest),this._resizeRequest=vi(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var de=this._getMapPanePos();Math.max(Math.abs(de.x),Math.abs(de.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(de,$e){for(var yt=[],nr,jr=$e==="mouseout"||$e==="mouseover",$i=de.target||de.srcElement,ra=!1;$i;){if(nr=this._targets[be($i)],nr&&($e==="click"||$e==="preclick")&&this._draggableMoved(nr)){ra=!0;break}if(nr&&nr.listens($e,!0)&&(jr&&!Hv($i,de)||(yt.push(nr),jr))||$i===this._container)break;$i=$i.parentNode}return!yt.length&&!ra&&!jr&&this.listens($e,!0)&&(yt=[this]),yt},_isClickDisabled:function(de){for(;de&&de!==this._container;){if(de._leaflet_disable_click)return!0;de=de.parentNode}},_handleDOMEvent:function(de){var $e=de.target||de.srcElement;if(!(!this._loaded||$e._leaflet_disable_events||de.type==="click"&&this._isClickDisabled($e))){var yt=de.type;yt==="mousedown"&&cp($e),this._fireDOMEvent(de,yt)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(de,$e,yt){if(de.type==="click"){var nr=S({},de);nr.type="preclick",this._fireDOMEvent(nr,nr.type,yt)}var jr=this._findEventTargets(de,$e);if(yt){for(var $i=[],ra=0;ra0?Math.round(de-$e)/2:Math.max(0,Math.ceil(de))-Math.max(0,Math.floor($e))},_limitZoom:function(de){var $e=this.getMinZoom(),yt=this.getMaxZoom(),nr=Fl.any3d?this.options.zoomSnap:1;return nr&&(de=Math.round(de/nr)*nr),Math.max($e,Math.min(yt,de))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Xf(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(de,$e){var yt=this._getCenterOffset(de)._trunc();return($e&&$e.animate)!==!0&&!this.getSize().contains(yt)?!1:(this.panBy(yt,$e),!0)},_createAnimProxy:function(){var de=this._proxy=Nc("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(de),this.on("zoomanim",function($e){var yt=nw,nr=this._proxy.style[yt];ku(this._proxy,this.project($e.center,$e.zoom),this.getZoomScale($e.zoom,1)),nr===this._proxy.style[yt]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Of(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var de=this.getCenter(),$e=this.getZoom();ku(this._proxy,this.project(de,$e),this.getZoomScale($e,1))},_catchTransitionEnd:function(de){this._animatingZoom&&de.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(de,$e,yt){if(this._animatingZoom)return!0;if(yt=yt||{},!this._zoomAnimated||yt.animate===!1||this._nothingToAnimate()||Math.abs($e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var nr=this.getZoomScale($e),jr=this._getCenterOffset(de)._divideBy(1-1/nr);return yt.animate!==!0&&!this.getSize().contains(jr)?!1:(vi(function(){this._moveStart(!0,yt.noMoveStart||!1)._animateZoom(de,$e,!0)},this),!0)},_animateZoom:function(de,$e,yt,nr){this._mapPane&&(yt&&(this._animatingZoom=!0,this._animateToCenter=de,this._animateToZoom=$e,Qu(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:de,zoom:$e,noUpdate:nr}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(Z(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Xf(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Zs(de,$e){return new Bc(de,$e)}var Fp=Ar.extend({options:{position:"topright"},initialize:function(de){Dt(this,de)},getPosition:function(){return this.options.position},setPosition:function(de){var $e=this._map;return $e&&$e.removeControl(this),this.options.position=de,$e&&$e.addControl(this),this},getContainer:function(){return this._container},addTo:function(de){this.remove(),this._map=de;var $e=this._container=this.onAdd(de),yt=this.getPosition(),nr=de._controlCorners[yt];return Qu($e,"leaflet-control"),yt.indexOf("bottom")!==-1?nr.insertBefore($e,nr.firstChild):nr.appendChild($e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Of(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(de){this._map&&de&&de.screenX>0&&de.screenY>0&&this._map.getContainer().focus()}}),Z0=function(de){return new Fp(de)};Bc.include({addControl:function(de){return de.addTo(this),this},removeControl:function(de){return de.remove(),this},_initControlPos:function(){var de=this._controlCorners={},$e="leaflet-",yt=this._controlContainer=Nc("div",$e+"control-container",this._container);function nr(jr,$i){var ra=$e+jr+" "+$e+$i;de[jr+$i]=Nc("div",ra,yt)}nr("top","left"),nr("top","right"),nr("bottom","left"),nr("bottom","right")},_clearControlPos:function(){for(var de in this._controlCorners)Of(this._controlCorners[de]);Of(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Y1=Fp.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(de,$e,yt,nr){return yt1,this._baseLayersList.style.display=de?"":"none"),this._separator.style.display=$e&&de?"":"none",this},_onLayerChange:function(de){this._handlingClick||this._update();var $e=this._getLayer(be(de.target)),yt=$e.overlay?de.type==="add"?"overlayadd":"overlayremove":de.type==="add"?"baselayerchange":null;yt&&this._map.fire(yt,$e)},_createRadioElement:function(de,$e){var yt='",nr=document.createElement("div");return nr.innerHTML=yt,nr.firstChild},_addItem:function(de){var $e=document.createElement("label"),yt=this._map.hasLayer(de.layer),nr;de.overlay?(nr=document.createElement("input"),nr.type="checkbox",nr.className="leaflet-control-layers-selector",nr.defaultChecked=yt):nr=this._createRadioElement("leaflet-base-layers_"+be(this),yt),this._layerControlInputs.push(nr),nr.layerId=be(de.layer),Hu(nr,"click",this._onInputClick,this);var jr=document.createElement("span");jr.innerHTML=" "+de.name;var $i=document.createElement("span");$e.appendChild($i),$i.appendChild(nr),$i.appendChild(jr);var ra=de.overlay?this._overlaysList:this._baseLayersList;return ra.appendChild($e),this._checkDisabledLayers(),$e},_onInputClick:function(){if(!this._preventClick){var de=this._layerControlInputs,$e,yt,nr=[],jr=[];this._handlingClick=!0;for(var $i=de.length-1;$i>=0;$i--)$e=de[$i],yt=this._getLayer($e.layerId).layer,$e.checked?nr.push(yt):$e.checked||jr.push(yt);for($i=0;$i=0;jr--)$e=de[jr],yt=this._getLayer($e.layerId).layer,$e.disabled=yt.options.minZoom!==void 0&&nryt.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var de=this._section;this._preventClick=!0,Hu(de,"click",Cc),this.expand();var $e=this;setTimeout(function(){Yh(de,"click",Cc),$e._preventClick=!1})}}),Xm=function(de,$e,yt){return new Y1(de,$e,yt)},Os=Fp.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(de){var $e="leaflet-control-zoom",yt=Nc("div",$e+" leaflet-bar"),nr=this.options;return this._zoomInButton=this._createButton(nr.zoomInText,nr.zoomInTitle,$e+"-in",yt,this._zoomIn),this._zoomOutButton=this._createButton(nr.zoomOutText,nr.zoomOutTitle,$e+"-out",yt,this._zoomOut),this._updateDisabled(),de.on("zoomend zoomlevelschange",this._updateDisabled,this),yt},onRemove:function(de){de.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(de){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(de.shiftKey?3:1))},_createButton:function(de,$e,yt,nr,jr){var $i=Nc("a",yt,nr);return $i.innerHTML=de,$i.href="#",$i.title=$e,$i.setAttribute("role","button"),$i.setAttribute("aria-label",$e),K1($i),Hu($i,"click",$v),Hu($i,"click",jr,this),Hu($i,"click",this._refocusOnMap,this),$i},_updateDisabled:function(){var de=this._map,$e="leaflet-disabled";Xf(this._zoomInButton,$e),Xf(this._zoomOutButton,$e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||de._zoom===de.getMinZoom())&&(Qu(this._zoomOutButton,$e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||de._zoom===de.getMaxZoom())&&(Qu(this._zoomInButton,$e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Bc.mergeOptions({zoomControl:!0}),Bc.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Os,this.addControl(this.zoomControl))});var w4=function(de){return new Os(de)},ow=Fp.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(de){var $e="leaflet-control-scale",yt=Nc("div",$e),nr=this.options;return this._addScales(nr,$e+"-line",yt),de.on(nr.updateWhenIdle?"moveend":"move",this._update,this),de.whenReady(this._update,this),yt},onRemove:function(de){de.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(de,$e,yt){de.metric&&(this._mScale=Nc("div",$e,yt)),de.imperial&&(this._iScale=Nc("div",$e,yt))},_update:function(){var de=this._map,$e=de.getSize().y/2,yt=de.distance(de.containerPointToLatLng([0,$e]),de.containerPointToLatLng([this.options.maxWidth,$e]));this._updateScales(yt)},_updateScales:function(de){this.options.metric&&de&&this._updateMetric(de),this.options.imperial&&de&&this._updateImperial(de)},_updateMetric:function(de){var $e=this._getRoundNum(de),yt=$e<1e3?$e+" m":$e/1e3+" km";this._updateScale(this._mScale,yt,$e/de)},_updateImperial:function(de){var $e=de*3.2808399,yt,nr,jr;$e>5280?(yt=$e/5280,nr=this._getRoundNum(yt),this._updateScale(this._iScale,nr+" mi",nr/yt)):(jr=this._getRoundNum($e),this._updateScale(this._iScale,jr+" ft",jr/$e))},_updateScale:function(de,$e,yt){de.style.width=Math.round(this.options.maxWidth*yt)+"px",de.innerHTML=$e},_getRoundNum:function(de){var $e=Math.pow(10,(Math.floor(de)+"").length-1),yt=de/$e;return yt=yt>=10?10:yt>=5?5:yt>=3?3:yt>=2?2:1,$e*yt}}),s8=function(de){return new ow(de)},sw='',lw=Fp.extend({options:{position:"bottomright",prefix:''+(Fl.inlineSvg?sw+" ":"")+"Leaflet"},initialize:function(de){Dt(this,de),this._attributions={}},onAdd:function(de){de.attributionControl=this,this._container=Nc("div","leaflet-control-attribution"),K1(this._container);for(var $e in de._layers)de._layers[$e].getAttribution&&this.addAttribution(de._layers[$e].getAttribution());return this._update(),de.on("layeradd",this._addAttribution,this),this._container},onRemove:function(de){de.off("layeradd",this._addAttribution,this)},_addAttribution:function(de){de.layer.getAttribution&&(this.addAttribution(de.layer.getAttribution()),de.layer.once("remove",function(){this.removeAttribution(de.layer.getAttribution())},this))},setPrefix:function(de){return this.options.prefix=de,this._update(),this},addAttribution:function(de){return de?(this._attributions[de]||(this._attributions[de]=0),this._attributions[de]++,this._update(),this):this},removeAttribution:function(de){return de?(this._attributions[de]&&(this._attributions[de]--,this._update()),this):this},_update:function(){if(this._map){var de=[];for(var $e in this._attributions)this._attributions[$e]&&de.push($e);var yt=[];this.options.prefix&&yt.push(this.options.prefix),de.length&&yt.push(de.join(", ")),this._container.innerHTML=yt.join(' ')}}});Bc.mergeOptions({attributionControl:!0}),Bc.addInitHook(function(){this.options.attributionControl&&new lw().addTo(this)});var l8=function(de){return new lw(de)};Fp.Layers=Y1,Fp.Zoom=Os,Fp.Scale=ow,Fp.Attribution=lw,Z0.layers=Xm,Z0.zoom=w4,Z0.scale=s8,Z0.attribution=l8;var Jm=Ar.extend({initialize:function(de){this._map=de},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Jm.addTo=function(de,$e){return de.addHandler($e,this),this};var Np={Events:Xr},Em=Fl.touch?"touchstart mousedown":"mousedown",Kg=ei.extend({options:{clickTolerance:3},initialize:function(de,$e,yt,nr){Dt(this,nr),this._element=de,this._dragStartTarget=$e||de,this._preventOutline=yt},enable:function(){this._enabled||(Hu(this._dragStartTarget,Em,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Kg._dragging===this&&this.finishDrag(!0),Yh(this._dragStartTarget,Em,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(de){if(this._enabled&&(this._moved=!1,!aw(this._element,"leaflet-zoom-anim"))){if(de.touches&&de.touches.length!==1){Kg._dragging===this&&this.finishDrag();return}if(!(Kg._dragging||de.shiftKey||de.which!==1&&de.button!==1&&!de.touches)&&(Kg._dragging=this,this._preventOutline&&cp(this._element),sh(),Am(),!this._moving)){this.fire("down");var $e=de.touches?de.touches[0]:de,yt=qd(this._element);this._startPoint=new Di($e.clientX,$e.clientY),this._startPos=Zc(this._element),this._parentScale=k_(yt);var nr=de.type==="mousedown";Hu(document,nr?"mousemove":"touchmove",this._onMove,this),Hu(document,nr?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(de){if(this._enabled){if(de.touches&&de.touches.length>1){this._moved=!0;return}var $e=de.touches&&de.touches.length===1?de.touches[0]:de,yt=new Di($e.clientX,$e.clientY)._subtract(this._startPoint);!yt.x&&!yt.y||Math.abs(yt.x)+Math.abs(yt.y)$i&&(ra=Xa,$i=uo);$i>yt&&($e[ra]=1,Wv(de,$e,yt,nr,ra),Wv(de,$e,yt,ra,jr))}function T4(de,$e){for(var yt=[de[0]],nr=1,jr=0,$i=de.length;nr<$i;nr++)h8(de[nr],de[jr])>$e&&(yt.push(de[nr]),jr=nr);return jr<$i-1&&yt.push(de[$i-1]),yt}var hw;function fw(de,$e,yt,nr,jr){var $i=nr?hw:Gv(de,yt),ra=Gv($e,yt),Xa,uo,Mo;for(hw=ra;;){if(!($i|ra))return[de,$e];if($i&ra)return!1;Xa=$i||ra,uo=qv(de,$e,Xa,yt,jr),Mo=Gv(uo,yt),Xa===$i?(de=uo,$i=Mo):($e=uo,ra=Mo)}}function qv(de,$e,yt,nr,jr){var $i=$e.x-de.x,ra=$e.y-de.y,Xa=nr.min,uo=nr.max,Mo,Ys;return yt&8?(Mo=de.x+$i*(uo.y-de.y)/ra,Ys=uo.y):yt&4?(Mo=de.x+$i*(Xa.y-de.y)/ra,Ys=Xa.y):yt&2?(Mo=uo.x,Ys=de.y+ra*(uo.x-de.x)/$i):yt&1&&(Mo=Xa.x,Ys=de.y+ra*(Xa.x-de.x)/$i),new Di(Mo,Ys,jr)}function Gv(de,$e){var yt=0;return de.x<$e.min.x?yt|=1:de.x>$e.max.x&&(yt|=2),de.y<$e.min.y?yt|=4:de.y>$e.max.y&&(yt|=8),yt}function h8(de,$e){var yt=$e.x-de.x,nr=$e.y-de.y;return yt*yt+nr*nr}function X1(de,$e,yt,nr){var jr=$e.x,$i=$e.y,ra=yt.x-jr,Xa=yt.y-$i,uo=ra*ra+Xa*Xa,Mo;return uo>0&&(Mo=((de.x-jr)*ra+(de.y-$i)*Xa)/uo,Mo>1?(jr=yt.x,$i=yt.y):Mo>0&&(jr+=ra*Mo,$i+=Xa*Mo)),ra=de.x-jr,Xa=de.y-$i,nr?ra*ra+Xa*Xa:new Di(jr,$i)}function fm(de){return!wi(de[0])||typeof de[0][0]!="object"&&typeof de[0][0]<"u"}function S4(de){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),fm(de)}function C4(de,$e){var yt,nr,jr,$i,ra,Xa,uo,Mo;if(!de||de.length===0)throw new Error("latlngs not passed");fm(de)||(console.warn("latlngs are not flat! Only the first ring will be used"),de=de[0]);var Ys=an([0,0]),El=Yn(de),qu=El.getNorthWest().distanceTo(El.getSouthWest())*El.getNorthEast().distanceTo(El.getNorthWest());qu<1700&&(Ys=Qx(de));var Zd=de.length,Jf=[];for(yt=0;ytnr){uo=($i-nr)/jr,Mo=[Xa.x-uo*(Xa.x-ra.x),Xa.y-uo*(Xa.y-ra.y)];break}var s0=$e.unproject(Qn(Mo));return an([s0.lat+Ys.lat,s0.lng+Ys.lng])}var hf={__proto__:null,simplify:cw,pointToSegmentDistance:k4,closestPointOnSegment:Vv,clipSegment:fw,_getEdgeIntersection:qv,_getBitCode:Gv,_sqClosestPointOnSegment:X1,isFlat:fm,_flat:S4,polylineCenter:C4},dm={project:function(de){return new Di(de.lng,de.lat)},unproject:function(de){return new sn(de.y,de.x)},bounds:new ka([-180,-90],[180,90])},J1={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ka([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(de){var $e=Math.PI/180,yt=this.R,nr=de.lat*$e,jr=this.R_MINOR/yt,$i=Math.sqrt(1-jr*jr),ra=$i*Math.sin(nr),Xa=Math.tan(Math.PI/4-nr/2)/Math.pow((1-ra)/(1+ra),$i/2);return nr=-yt*Math.log(Math.max(Xa,1e-10)),new Di(de.lng*$e*yt,nr)},unproject:function(de){for(var $e=180/Math.PI,yt=this.R,nr=this.R_MINOR/yt,jr=Math.sqrt(1-nr*nr),$i=Math.exp(-de.y/yt),ra=Math.PI/2-2*Math.atan($i),Xa=0,uo=.1,Mo;Xa<15&&Math.abs(uo)>1e-7;Xa++)Mo=jr*Math.sin(ra),Mo=Math.pow((1-Mo)/(1+Mo),jr/2),uo=Math.PI/2-2*Math.atan($i*Mo)-ra,ra+=uo;return new sn(ra*$e,de.x*$e/yt)}},dw={__proto__:null,LonLat:dm,Mercator:J1,SphericalMercator:zo},pw=S({},Ra,{code:"EPSG:3395",projection:J1,transformation:function(){var de=.5/(Math.PI*J1.R);return Ur(de,.5,-de,.5)}()}),eb=S({},Ra,{code:"EPSG:4326",projection:dm,transformation:Ur(1/180,1,-1/180,.5)}),Zv=S({},zn,{projection:dm,transformation:Ur(1,0,-1,0),scale:function(de){return Math.pow(2,de)},zoom:function(de){return Math.log(de)/Math.LN2},distance:function(de,$e){var yt=$e.lng-de.lng,nr=$e.lat-de.lat;return Math.sqrt(yt*yt+nr*nr)},infinite:!0});zn.Earth=Ra,zn.EPSG3395=pw,zn.EPSG3857=Mi,zn.EPSG900913=Xi,zn.EPSG4326=eb,zn.Simple=Zv;var K0=ei.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(de){return de.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(de){return de&&de.removeLayer(this),this},getPane:function(de){return this._map.getPane(de?this.options[de]||de:this.options.pane)},addInteractiveTarget:function(de){return this._map._targets[be(de)]=this,this},removeInteractiveTarget:function(de){return delete this._map._targets[be(de)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(de){var $e=de.target;if($e.hasLayer(this)){if(this._map=$e,this._zoomAnimated=$e._zoomAnimated,this.getEvents){var yt=this.getEvents();$e.on(yt,this),this.once("remove",function(){$e.off(yt,this)},this)}this.onAdd($e),this.fire("add"),$e.fire("layeradd",{layer:this})}}});Bc.include({addLayer:function(de){if(!de._layerAdd)throw new Error("The provided object is not a Layer.");var $e=be(de);return this._layers[$e]?this:(this._layers[$e]=de,de._mapToAdd=this,de.beforeAdd&&de.beforeAdd(this),this.whenReady(de._layerAdd,de),this)},removeLayer:function(de){var $e=be(de);return this._layers[$e]?(this._loaded&&de.onRemove(this),delete this._layers[$e],this._loaded&&(this.fire("layerremove",{layer:de}),de.fire("remove")),de._map=de._mapToAdd=null,this):this},hasLayer:function(de){return be(de)in this._layers},eachLayer:function(de,$e){for(var yt in this._layers)de.call($e,this._layers[yt]);return this},_addLayers:function(de){de=de?wi(de)?de:[de]:[];for(var $e=0,yt=de.length;$ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&$e[0]instanceof sn&&$e[0].equals($e[yt-1])&&$e.pop(),$e},_setLatLngs:function(de){pm.prototype._setLatLngs.call(this,de),fm(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return fm(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var de=this._renderer._bounds,$e=this.options.weight,yt=new Di($e,$e);if(de=new ka(de.min.subtract(yt),de.max.add(yt)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(de))){if(this.options.noClip){this._parts=this._rings;return}for(var nr=0,jr=this._rings.length,$i;nrde.y!=jr.y>de.y&&de.x<(jr.x-nr.x)*(de.y-nr.y)/(jr.y-nr.y)+nr.x&&($e=!$e);return $e||pm.prototype._containsPoint.call(this,de,!0)}});function d8(de,$e){return new ty(de,$e)}var Sg=o0.extend({initialize:function(de,$e){Dt(this,$e),this._layers={},de&&this.addData(de)},addData:function(de){var $e=wi(de)?de:de.features,yt,nr,jr;if($e){for(yt=0,nr=$e.length;yt0&&jr.push(jr[0].slice()),jr}function Cg(de,$e){return de.feature?S({},de.feature,{geometry:$e}):sb($e)}function sb(de){return de.type==="Feature"||de.type==="FeatureCollection"?de:{type:"Feature",properties:{},geometry:de}}var _w={toGeoJSON:function(de){return Cg(this,{type:"Point",coordinates:yw(this.getLatLng(),de)})}};S_.include(_w),ib.include(_w),rb.include(_w),pm.include({toGeoJSON:function(de){var $e=!fm(this._latlngs),yt=ob(this._latlngs,$e?1:0,!1,de);return Cg(this,{type:($e?"Multi":"")+"LineString",coordinates:yt})}}),ty.include({toGeoJSON:function(de){var $e=!fm(this._latlngs),yt=$e&&!fm(this._latlngs[0]),nr=ob(this._latlngs,yt?2:$e?1:0,!0,de);return $e||(nr=[nr]),Cg(this,{type:(yt?"Multi":"")+"Polygon",coordinates:nr})}}),Kv.include({toMultiPoint:function(de){var $e=[];return this.eachLayer(function(yt){$e.push(yt.toGeoJSON(de).geometry.coordinates)}),Cg(this,{type:"MultiPoint",coordinates:$e})},toGeoJSON:function(de){var $e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if($e==="MultiPoint")return this.toMultiPoint(de);var yt=$e==="GeometryCollection",nr=[];return this.eachLayer(function(jr){if(jr.toGeoJSON){var $i=jr.toGeoJSON(de);if(yt)nr.push($i.geometry);else{var ra=sb($i);ra.type==="FeatureCollection"?nr.push.apply(nr,ra.features):nr.push(ra)}}}),yt?Cg(this,{geometries:nr,type:"GeometryCollection"}):{type:"FeatureCollection",features:nr}}});function xw(de,$e){return new Sg(de,$e)}var lb=xw,Ag=K0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(de,$e,yt){this._url=de,this._bounds=Yn($e),Dt(this,yt)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Qu(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Of(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(de){return this.options.opacity=de,this._image&&this._updateOpacity(),this},setStyle:function(de){return de.opacity&&this.setOpacity(de.opacity),this},bringToFront:function(){return this._map&&Z1(this._image),this},bringToBack:function(){return this._map&&ji(this._image),this},setUrl:function(de){return this._url=de,this._image&&(this._image.src=de),this},setBounds:function(de){return this._bounds=Yn(de),this._map&&this._reset(),this},getEvents:function(){var de={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(de.zoomanim=this._animateZoom),de},setZIndex:function(de){return this.options.zIndex=de,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var de=this._url.tagName==="IMG",$e=this._image=de?this._url:Nc("img");if(Qu($e,"leaflet-image-layer"),this._zoomAnimated&&Qu($e,"leaflet-zoom-animated"),this.options.className&&Qu($e,this.options.className),$e.onselectstart=Xe,$e.onmousemove=Xe,$e.onload=Z(this.fire,this,"load"),$e.onerror=Z(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&($e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),de){this._url=$e.src;return}$e.src=this._url,$e.alt=this.options.alt},_animateZoom:function(de){var $e=this._map.getZoomScale(de.zoom),yt=this._map._latLngBoundsToNewLayerBounds(this._bounds,de.zoom,de.center).min;ku(this._image,yt,$e)},_reset:function(){var de=this._image,$e=new ka(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),yt=$e.getSize();dc(de,$e.min),de.style.width=yt.x+"px",de.style.height=yt.y+"px"},_updateOpacity:function(){hm(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var de=this.options.errorOverlayUrl;de&&this._url!==de&&(this._url=de,this._image.src=de)},getCenter:function(){return this._bounds.getCenter()}}),Mg=function(de,$e,yt){return new Ag(de,$e,yt)},Lm=Ag.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var de=this._url.tagName==="VIDEO",$e=this._image=de?this._url:Nc("video");if(Qu($e,"leaflet-image-layer"),this._zoomAnimated&&Qu($e,"leaflet-zoom-animated"),this.options.className&&Qu($e,this.options.className),$e.onselectstart=Xe,$e.onmousemove=Xe,$e.onloadeddata=Z(this.fire,this,"load"),de){for(var yt=$e.getElementsByTagName("source"),nr=[],jr=0;jr0?nr:[$e.src];return}wi(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call($e.style,"objectFit")&&($e.style.objectFit="fill"),$e.autoplay=!!this.options.autoplay,$e.loop=!!this.options.loop,$e.muted=!!this.options.muted,$e.playsInline=!!this.options.playsInline;for(var $i=0;$ijr?($e.height=jr+"px",Qu(de,$i)):Xf(de,$i),this._containerWidth=this._container.offsetWidth},_animateZoom:function(de){var $e=this._map._latLngToNewLayerPoint(this._latlng,de.zoom,de.center),yt=this._getAnchor();dc(this._container,$e.add(yt))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var de=this._map,$e=parseInt(b_(this._container,"marginBottom"),10)||0,yt=this._container.offsetHeight+$e,nr=this._containerWidth,jr=new Di(this._containerLeft,-yt-this._containerBottom);jr._add(Zc(this._container));var $i=de.layerPointToContainerPoint(jr),ra=Qn(this.options.autoPanPadding),Xa=Qn(this.options.autoPanPaddingTopLeft||ra),uo=Qn(this.options.autoPanPaddingBottomRight||ra),Mo=de.getSize(),Ys=0,El=0;$i.x+nr+uo.x>Mo.x&&(Ys=$i.x+nr-Mo.x+uo.x),$i.x-Ys-Xa.x<0&&(Ys=$i.x-Xa.x),$i.y+yt+uo.y>Mo.y&&(El=$i.y+yt-Mo.y+uo.y),$i.y-El-Xa.y<0&&(El=$i.y-Xa.y),(Ys||El)&&(this.options.keepInView&&(this._autopanning=!0),de.fire("autopanstart").panBy([Ys,El]))}},_getAnchor:function(){return Qn(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Mf=function(de,$e){return new Yv(de,$e)};Bc.mergeOptions({closePopupOnClick:!0}),Bc.include({openPopup:function(de,$e,yt){return this._initOverlay(Yv,de,$e,yt).openOn(this),this},closePopup:function(de){return de=arguments.length?de:this._popup,de&&de.close(),this}}),K0.include({bindPopup:function(de,$e){return this._popup=this._initOverlay(Yv,this._popup,de,$e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(de){return this._popup&&(this instanceof o0||(this._popup._source=this),this._popup._prepareOpen(de||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(de){return this._popup&&this._popup.setContent(de),this},getPopup:function(){return this._popup},_openPopup:function(de){if(!(!this._popup||!this._map)){$v(de);var $e=de.layer||de.target;if(this._popup._source===$e&&!($e instanceof Xg)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(de.latlng);return}this._popup._source=$e,this.openPopup(de.latlng)}},_movePopup:function(de){this._popup.setLatLng(de.latlng)},_onKeyPress:function(de){de.originalEvent.keyCode===13&&this._openPopup(de)}});var C_=Qm.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(de){Qm.prototype.onAdd.call(this,de),this.setOpacity(this.options.opacity),de.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(de){Qm.prototype.onRemove.call(this,de),de.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var de=Qm.prototype.getEvents.call(this);return this.options.permanent||(de.preclick=this.close),de},_initLayout:function(){var de="leaflet-tooltip",$e=de+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Nc("div",$e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+be(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(de){var $e,yt,nr=this._map,jr=this._container,$i=nr.latLngToContainerPoint(nr.getCenter()),ra=nr.layerPointToContainerPoint(de),Xa=this.options.direction,uo=jr.offsetWidth,Mo=jr.offsetHeight,Ys=Qn(this.options.offset),El=this._getAnchor();Xa==="top"?($e=uo/2,yt=Mo):Xa==="bottom"?($e=uo/2,yt=0):Xa==="center"?($e=uo/2,yt=Mo/2):Xa==="right"?($e=0,yt=Mo/2):Xa==="left"?($e=uo,yt=Mo/2):ra.x<$i.x?(Xa="right",$e=0,yt=Mo/2):(Xa="left",$e=uo+(Ys.x+El.x)*2,yt=Mo/2),de=de.subtract(Qn($e,yt,!0)).add(Ys).add(El),Xf(jr,"leaflet-tooltip-right"),Xf(jr,"leaflet-tooltip-left"),Xf(jr,"leaflet-tooltip-top"),Xf(jr,"leaflet-tooltip-bottom"),Qu(jr,"leaflet-tooltip-"+Xa),dc(jr,de)},_updatePosition:function(){var de=this._map.latLngToLayerPoint(this._latlng);this._setPosition(de)},setOpacity:function(de){this.options.opacity=de,this._container&&hm(this._container,de)},_animateZoom:function(de){var $e=this._map._latLngToNewLayerPoint(this._latlng,de.zoom,de.center);this._setPosition($e)},_getAnchor:function(){return Qn(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),P4=function(de,$e){return new C_(de,$e)};Bc.include({openTooltip:function(de,$e,yt){return this._initOverlay(C_,de,$e,yt).openOn(this),this},closeTooltip:function(de){return de.close(),this}}),K0.include({bindTooltip:function(de,$e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(C_,this._tooltip,de,$e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(de){if(!(!de&&this._tooltipHandlersAdded)){var $e=de?"off":"on",yt={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?yt.add=this._openTooltip:(yt.mouseover=this._openTooltip,yt.mouseout=this.closeTooltip,yt.click=this._openTooltip,this._map?this._addFocusListeners():yt.add=this._addFocusListeners),this._tooltip.options.sticky&&(yt.mousemove=this._moveTooltip),this[$e](yt),this._tooltipHandlersAdded=!de}},openTooltip:function(de){return this._tooltip&&(this instanceof o0||(this._tooltip._source=this),this._tooltip._prepareOpen(de)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(de){return this._tooltip&&this._tooltip.setContent(de),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(de){var $e=typeof de.getElement=="function"&&de.getElement();$e&&(Hu($e,"focus",function(){this._tooltip._source=de,this.openTooltip()},this),Hu($e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(de){var $e=typeof de.getElement=="function"&&de.getElement();$e&&$e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(de){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var $e=this;this._map.once("moveend",function(){$e._openOnceFlag=!1,$e._openTooltip(de)});return}this._tooltip._source=de.layer||de.target,this.openTooltip(this._tooltip.options.sticky?de.latlng:void 0)}},_moveTooltip:function(de){var $e=de.latlng,yt,nr;this._tooltip.options.sticky&&de.originalEvent&&(yt=this._map.mouseEventToContainerPoint(de.originalEvent),nr=this._map.containerPointToLayerPoint(yt),$e=this._map.layerPointToLatLng(nr)),this._tooltip.setLatLng($e)}});var I4=Yg.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(de){var $e=de&&de.tagName==="DIV"?de:document.createElement("div"),yt=this.options;if(yt.html instanceof Element?(Yx($e),$e.appendChild(yt.html)):$e.innerHTML=yt.html!==!1?yt.html:"",yt.bgPos){var nr=Qn(yt.bgPos);$e.style.backgroundPosition=-nr.x+"px "+-nr.y+"px"}return this._setIconStyles($e,"icon"),$e},createShadow:function(){return null}});function m8(de){return new I4(de)}Yg.Default=Q1;var A_=K0.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Fl.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(de){Dt(this,de)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(de){de._addZoomLimit(this)},onRemove:function(de){this._removeAllTiles(),Of(this._container),de._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Z1(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ji(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(de){return this.options.opacity=de,this._updateOpacity(),this},setZIndex:function(de){return this.options.zIndex=de,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var de=this._clampZoom(this._map.getZoom());de!==this._tileZoom&&(this._tileZoom=de,this._updateLevels()),this._update()}return this},getEvents:function(){var de={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=Se(this._onMoveEnd,this.options.updateInterval,this)),de.move=this._onMove),this._zoomAnimated&&(de.zoomanim=this._animateZoom),de},createTile:function(){return document.createElement("div")},getTileSize:function(){var de=this.options.tileSize;return de instanceof Di?de:new Di(de,de)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(de){for(var $e=this.getPane().children,yt=-de(-1/0,1/0),nr=0,jr=$e.length,$i;nrthis.options.maxZoom||ytnr?this._retainParent(jr,$i,ra,nr):!1)},_retainChildren:function(de,$e,yt,nr){for(var jr=2*de;jr<2*de+2;jr++)for(var $i=2*$e;$i<2*$e+2;$i++){var ra=new Di(jr,$i);ra.z=yt+1;var Xa=this._tileCoordsToKey(ra),uo=this._tiles[Xa];if(uo&&uo.active){uo.retain=!0;continue}else uo&&uo.loaded&&(uo.retain=!0);yt+1this.options.maxZoom||this.options.minZoom!==void 0&&jr1){this._setView(de,yt);return}for(var El=jr.min.y;El<=jr.max.y;El++)for(var qu=jr.min.x;qu<=jr.max.x;qu++){var Zd=new Di(qu,El);if(Zd.z=this._tileZoom,!!this._isValidTile(Zd)){var Jf=this._tiles[this._tileCoordsToKey(Zd)];Jf?Jf.current=!0:ra.push(Zd)}}if(ra.sort(function(s0,Qg){return s0.distanceTo($i)-Qg.distanceTo($i)}),ra.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var gm=document.createDocumentFragment();for(qu=0;quyt.max.x)||!$e.wrapLat&&(de.yyt.max.y))return!1}if(!this.options.bounds)return!0;var nr=this._tileCoordsToBounds(de);return Yn(this.options.bounds).overlaps(nr)},_keyToBounds:function(de){return this._tileCoordsToBounds(this._keyToTileCoords(de))},_tileCoordsToNwSe:function(de){var $e=this._map,yt=this.getTileSize(),nr=de.scaleBy(yt),jr=nr.add(yt),$i=$e.unproject(nr,de.z),ra=$e.unproject(jr,de.z);return[$i,ra]},_tileCoordsToBounds:function(de){var $e=this._tileCoordsToNwSe(de),yt=new so($e[0],$e[1]);return this.options.noWrap||(yt=this._map.wrapLatLngBounds(yt)),yt},_tileCoordsToKey:function(de){return de.x+":"+de.y+":"+de.z},_keyToTileCoords:function(de){var $e=de.split(":"),yt=new Di(+$e[0],+$e[1]);return yt.z=+$e[2],yt},_removeTile:function(de){var $e=this._tiles[de];$e&&(Of($e.el),delete this._tiles[de],this.fire("tileunload",{tile:$e.el,coords:this._keyToTileCoords(de)}))},_initTile:function(de){Qu(de,"leaflet-tile");var $e=this.getTileSize();de.style.width=$e.x+"px",de.style.height=$e.y+"px",de.onselectstart=Xe,de.onmousemove=Xe,Fl.ielt9&&this.options.opacity<1&&hm(de,this.options.opacity)},_addTile:function(de,$e){var yt=this._getTilePos(de),nr=this._tileCoordsToKey(de),jr=this.createTile(this._wrapCoords(de),Z(this._tileReady,this,de));this._initTile(jr),this.createTile.length<2&&vi(Z(this._tileReady,this,de,null,jr)),dc(jr,yt),this._tiles[nr]={el:jr,coords:de,current:!0},$e.appendChild(jr),this.fire("tileloadstart",{tile:jr,coords:de})},_tileReady:function(de,$e,yt){$e&&this.fire("tileerror",{error:$e,tile:yt,coords:de});var nr=this._tileCoordsToKey(de);yt=this._tiles[nr],yt&&(yt.loaded=+new Date,this._map._fadeAnimated?(hm(yt.el,0),vr(this._fadeFrame),this._fadeFrame=vi(this._updateOpacity,this)):(yt.active=!0,this._pruneTiles()),$e||(Qu(yt.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:yt.el,coords:de})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Fl.ielt9||!this._map._fadeAnimated?vi(this._pruneTiles,this):setTimeout(Z(this._pruneTiles,this),250)))},_getTilePos:function(de){return de.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(de){var $e=new Di(this._wrapX?Re(de.x,this._wrapX):de.x,this._wrapY?Re(de.y,this._wrapY):de.y);return $e.z=de.z,$e},_pxBoundsToTileRange:function(de){var $e=this.getTileSize();return new ka(de.min.unscaleBy($e).floor(),de.max.unscaleBy($e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var de in this._tiles)if(!this._tiles[de].loaded)return!1;return!0}});function ww(de){return new A_(de)}var Y0=A_.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(de,$e){this._url=de,$e=Dt(this,$e),$e.detectRetina&&Fl.retina&&$e.maxZoom>0?($e.tileSize=Math.floor($e.tileSize/2),$e.zoomReverse?($e.zoomOffset--,$e.minZoom=Math.min($e.maxZoom,$e.minZoom+1)):($e.zoomOffset++,$e.maxZoom=Math.max($e.minZoom,$e.maxZoom-1)),$e.minZoom=Math.max(0,$e.minZoom)):$e.zoomReverse?$e.minZoom=Math.min($e.maxZoom,$e.minZoom):$e.maxZoom=Math.max($e.minZoom,$e.maxZoom),typeof $e.subdomains=="string"&&($e.subdomains=$e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(de,$e){return this._url===de&&$e===void 0&&($e=!0),this._url=de,$e||this.redraw(),this},createTile:function(de,$e){var yt=document.createElement("img");return Hu(yt,"load",Z(this._tileOnLoad,this,$e,yt)),Hu(yt,"error",Z(this._tileOnError,this,$e,yt)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(yt.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(yt.referrerPolicy=this.options.referrerPolicy),yt.alt="",yt.src=this.getTileUrl(de),yt},getTileUrl:function(de){var $e={r:Fl.retina?"@2x":"",s:this._getSubdomain(de),x:de.x,y:de.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var yt=this._globalTileRange.max.y-de.y;this.options.tms&&($e.y=yt),$e["-y"]=yt}return Fe(this._url,S($e,this.options))},_tileOnLoad:function(de,$e){Fl.ielt9?setTimeout(Z(de,this,null,$e),0):de(null,$e)},_tileOnError:function(de,$e,yt){var nr=this.options.errorTileUrl;nr&&$e.getAttribute("src")!==nr&&($e.src=nr),de(yt,$e)},_onTileRemove:function(de){de.tile.onload=null},_getZoomForUrl:function(){var de=this._tileZoom,$e=this.options.maxZoom,yt=this.options.zoomReverse,nr=this.options.zoomOffset;return yt&&(de=$e-de),de+nr},_getSubdomain:function(de){var $e=Math.abs(de.x+de.y)%this.options.subdomains.length;return this.options.subdomains[$e]},_abortLoading:function(){var de,$e;for(de in this._tiles)if(this._tiles[de].coords.z!==this._tileZoom&&($e=this._tiles[de].el,$e.onload=Xe,$e.onerror=Xe,!$e.complete)){$e.src=Ir;var yt=this._tiles[de].coords;Of($e),delete this._tiles[de],this.fire("tileabort",{tile:$e,coords:yt})}},_removeTile:function(de){var $e=this._tiles[de];if($e)return $e.el.setAttribute("src",Ir),A_.prototype._removeTile.call(this,de)},_tileReady:function(de,$e,yt){if(!(!this._map||yt&&yt.getAttribute("src")===Ir))return A_.prototype._tileReady.call(this,de,$e,yt)}});function ub(de,$e){return new Y0(de,$e)}var cb=Y0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(de,$e){this._url=de;var yt=S({},this.defaultWmsParams);for(var nr in $e)nr in this.options||(yt[nr]=$e[nr]);$e=Dt(this,$e);var jr=$e.detectRetina&&Fl.retina?2:1,$i=this.getTileSize();yt.width=$i.x*jr,yt.height=$i.y*jr,this.wmsParams=yt},onAdd:function(de){this._crs=this.options.crs||de.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var $e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[$e]=this._crs.code,Y0.prototype.onAdd.call(this,de)},getTileUrl:function(de){var $e=this._tileCoordsToNwSe(de),yt=this._crs,nr=Ta(yt.project($e[0]),yt.project($e[1])),jr=nr.min,$i=nr.max,ra=(this._wmsVersion>=1.3&&this._crs===eb?[jr.y,jr.x,$i.y,$i.x]:[jr.x,jr.y,$i.x,$i.y]).join(","),Xa=Y0.prototype.getTileUrl.call(this,de);return Xa+rr(this.wmsParams,Xa,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ra},setParams:function(de,$e){return S(this.wmsParams,de),$e||this.redraw(),this}});function D4(de,$e){return new cb(de,$e)}Y0.WMS=cb,ub.wms=D4;var Eg=K0.extend({options:{padding:.1},initialize:function(de){Dt(this,de),be(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Qu(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var de={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(de.zoomanim=this._onAnimZoom),de},_onAnimZoom:function(de){this._updateTransform(de.center,de.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(de,$e){var yt=this._map.getZoomScale($e,this._zoom),nr=this._map.getSize().multiplyBy(.5+this.options.padding),jr=this._map.project(this._center,$e),$i=nr.multiplyBy(-yt).add(jr).subtract(this._map._getNewPixelOrigin(de,$e));Fl.any3d?ku(this._container,$i,yt):dc(this._container,$i)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var de in this._layers)this._layers[de]._reset()},_onZoomEnd:function(){for(var de in this._layers)this._layers[de]._project()},_updatePaths:function(){for(var de in this._layers)this._layers[de]._update()},_update:function(){var de=this.options.padding,$e=this._map.getSize(),yt=this._map.containerPointToLayerPoint($e.multiplyBy(-de)).round();this._bounds=new ka(yt,yt.add($e.multiplyBy(1+de*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),z4=Eg.extend({options:{tolerance:0},getEvents:function(){var de=Eg.prototype.getEvents.call(this);return de.viewprereset=this._onViewPreReset,de},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Eg.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var de=this._container=document.createElement("canvas");Hu(de,"mousemove",this._onMouseMove,this),Hu(de,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Hu(de,"mouseout",this._handleMouseOut,this),de._leaflet_disable_events=!0,this._ctx=de.getContext("2d")},_destroyContainer:function(){vr(this._redrawRequest),delete this._ctx,Of(this._container),Yh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var de;this._redrawBounds=null;for(var $e in this._layers)de=this._layers[$e],de._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Eg.prototype._update.call(this);var de=this._bounds,$e=this._container,yt=de.getSize(),nr=Fl.retina?2:1;dc($e,de.min),$e.width=nr*yt.x,$e.height=nr*yt.y,$e.style.width=yt.x+"px",$e.style.height=yt.y+"px",Fl.retina&&this._ctx.scale(2,2),this._ctx.translate(-de.min.x,-de.min.y),this.fire("update")}},_reset:function(){Eg.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(de){this._updateDashArray(de),this._layers[be(de)]=de;var $e=de._order={layer:de,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=$e),this._drawLast=$e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(de){this._requestRedraw(de)},_removePath:function(de){var $e=de._order,yt=$e.next,nr=$e.prev;yt?yt.prev=nr:this._drawLast=nr,nr?nr.next=yt:this._drawFirst=yt,delete de._order,delete this._layers[be(de)],this._requestRedraw(de)},_updatePath:function(de){this._extendRedrawBounds(de),de._project(),de._update(),this._requestRedraw(de)},_updateStyle:function(de){this._updateDashArray(de),this._requestRedraw(de)},_updateDashArray:function(de){if(typeof de.options.dashArray=="string"){var $e=de.options.dashArray.split(/[, ]+/),yt=[],nr,jr;for(jr=0;jr<$e.length;jr++){if(nr=Number($e[jr]),isNaN(nr))return;yt.push(nr)}de.options._dashArray=yt}else de.options._dashArray=de.options.dashArray},_requestRedraw:function(de){this._map&&(this._extendRedrawBounds(de),this._redrawRequest=this._redrawRequest||vi(this._redraw,this))},_extendRedrawBounds:function(de){if(de._pxBounds){var $e=(de.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ka,this._redrawBounds.extend(de._pxBounds.min.subtract([$e,$e])),this._redrawBounds.extend(de._pxBounds.max.add([$e,$e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var de=this._redrawBounds;if(de){var $e=de.getSize();this._ctx.clearRect(de.min.x,de.min.y,$e.x,$e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var de,$e=this._redrawBounds;if(this._ctx.save(),$e){var yt=$e.getSize();this._ctx.beginPath(),this._ctx.rect($e.min.x,$e.min.y,yt.x,yt.y),this._ctx.clip()}this._drawing=!0;for(var nr=this._drawFirst;nr;nr=nr.next)de=nr.layer,(!$e||de._pxBounds&&de._pxBounds.intersects($e))&&de._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(de,$e){if(this._drawing){var yt,nr,jr,$i,ra=de._parts,Xa=ra.length,uo=this._ctx;if(Xa){for(uo.beginPath(),yt=0;yt')}}catch{}return function(de){return document.createElement("<"+de+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),g8={_initContainer:function(){this._container=Nc("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Eg.prototype._update.call(this),this.fire("update"))},_initPath:function(de){var $e=de._container=M_("shape");Qu($e,"leaflet-vml-shape "+(this.options.className||"")),$e.coordsize="1 1",de._path=M_("path"),$e.appendChild(de._path),this._updateStyle(de),this._layers[be(de)]=de},_addPath:function(de){var $e=de._container;this._container.appendChild($e),de.options.interactive&&de.addInteractiveTarget($e)},_removePath:function(de){var $e=de._container;Of($e),de.removeInteractiveTarget($e),delete this._layers[be(de)]},_updateStyle:function(de){var $e=de._stroke,yt=de._fill,nr=de.options,jr=de._container;jr.stroked=!!nr.stroke,jr.filled=!!nr.fill,nr.stroke?($e||($e=de._stroke=M_("stroke")),jr.appendChild($e),$e.weight=nr.weight+"px",$e.color=nr.color,$e.opacity=nr.opacity,nr.dashArray?$e.dashStyle=wi(nr.dashArray)?nr.dashArray.join(" "):nr.dashArray.replace(/( *, *)/g," "):$e.dashStyle="",$e.endcap=nr.lineCap.replace("butt","flat"),$e.joinstyle=nr.lineJoin):$e&&(jr.removeChild($e),de._stroke=null),nr.fill?(yt||(yt=de._fill=M_("fill")),jr.appendChild(yt),yt.color=nr.fillColor||nr.color,yt.opacity=nr.fillOpacity):yt&&(jr.removeChild(yt),de._fill=null)},_updateCircle:function(de){var $e=de._point.round(),yt=Math.round(de._radius),nr=Math.round(de._radiusY||yt);this._setPath(de,de._empty()?"M0 0":"AL "+$e.x+","+$e.y+" "+yt+","+nr+" 0,"+65535*360)},_setPath:function(de,$e){de._path.v=$e},_bringToFront:function(de){Z1(de._container)},_bringToBack:function(de){ji(de._container)}},Jg=Fl.vml?M_:oo,S0=Eg.extend({_initContainer:function(){this._container=Jg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Of(this._container),Yh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Eg.prototype._update.call(this);var de=this._bounds,$e=de.getSize(),yt=this._container;(!this._svgSize||!this._svgSize.equals($e))&&(this._svgSize=$e,yt.setAttribute("width",$e.x),yt.setAttribute("height",$e.y)),dc(yt,de.min),yt.setAttribute("viewBox",[de.min.x,de.min.y,$e.x,$e.y].join(" ")),this.fire("update")}},_initPath:function(de){var $e=de._path=Jg("path");de.options.className&&Qu($e,de.options.className),de.options.interactive&&Qu($e,"leaflet-interactive"),this._updateStyle(de),this._layers[be(de)]=de},_addPath:function(de){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(de._path),de.addInteractiveTarget(de._path)},_removePath:function(de){Of(de._path),de.removeInteractiveTarget(de._path),delete this._layers[be(de)]},_updatePath:function(de){de._project(),de._update()},_updateStyle:function(de){var $e=de._path,yt=de.options;$e&&(yt.stroke?($e.setAttribute("stroke",yt.color),$e.setAttribute("stroke-opacity",yt.opacity),$e.setAttribute("stroke-width",yt.weight),$e.setAttribute("stroke-linecap",yt.lineCap),$e.setAttribute("stroke-linejoin",yt.lineJoin),yt.dashArray?$e.setAttribute("stroke-dasharray",yt.dashArray):$e.removeAttribute("stroke-dasharray"),yt.dashOffset?$e.setAttribute("stroke-dashoffset",yt.dashOffset):$e.removeAttribute("stroke-dashoffset")):$e.setAttribute("stroke","none"),yt.fill?($e.setAttribute("fill",yt.fillColor||yt.color),$e.setAttribute("fill-opacity",yt.fillOpacity),$e.setAttribute("fill-rule",yt.fillRule||"evenodd")):$e.setAttribute("fill","none"))},_updatePoly:function(de,$e){this._setPath(de,go(de._parts,$e))},_updateCircle:function(de){var $e=de._point,yt=Math.max(Math.round(de._radius),1),nr=Math.max(Math.round(de._radiusY),1)||yt,jr="a"+yt+","+nr+" 0 1,0 ",$i=de._empty()?"M0 0":"M"+($e.x-yt)+","+$e.y+jr+yt*2+",0 "+jr+-yt*2+",0 ";this._setPath(de,$i)},_setPath:function(de,$e){de._path.setAttribute("d",$e)},_bringToFront:function(de){Z1(de._path)},_bringToBack:function(de){ji(de._path)}});Fl.vml&&S0.include(g8);function O4(de){return Fl.svg||Fl.vml?new S0(de):null}Bc.include({getRenderer:function(de){var $e=de.options.renderer||this._getPaneRenderer(de.options.pane)||this.options.renderer||this._renderer;return $e||($e=this._renderer=this._createRenderer()),this.hasLayer($e)||this.addLayer($e),$e},_getPaneRenderer:function(de){if(de==="overlayPane"||de===void 0)return!1;var $e=this._paneRenderers[de];return $e===void 0&&($e=this._createRenderer({pane:de}),this._paneRenderers[de]=$e),$e},_createRenderer:function(de){return this.options.preferCanvas&&kw(de)||O4(de)}});var X0=ty.extend({initialize:function(de,$e){ty.prototype.initialize.call(this,this._boundsToLatLngs(de),$e)},setBounds:function(de){return this.setLatLngs(this._boundsToLatLngs(de))},_boundsToLatLngs:function(de){return de=Yn(de),[de.getSouthWest(),de.getNorthWest(),de.getNorthEast(),de.getSouthEast()]}});function Pm(de,$e){return new X0(de,$e)}S0.create=Jg,S0.pointsToPath=go,Sg.geometryToLayer=nb,Sg.coordsToLatLng=vw,Sg.coordsToLatLngs=ab,Sg.latLngToCoords=yw,Sg.latLngsToCoords=ob,Sg.getFeature=Cg,Sg.asFeature=sb,Bc.mergeOptions({boxZoom:!0});var ry=Jm.extend({initialize:function(de){this._map=de,this._container=de._container,this._pane=de._panes.overlayPane,this._resetStateTimeout=0,de.on("unload",this._destroy,this)},addHooks:function(){Hu(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Yh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Of(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(de){if(!de.shiftKey||de.which!==1&&de.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Am(),sh(),this._startPoint=this._map.mouseEventToContainerPoint(de),Hu(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(de){this._moved||(this._moved=!0,this._box=Nc("div","leaflet-zoom-box",this._container),Qu(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(de);var $e=new ka(this._point,this._startPoint),yt=$e.getSize();dc(this._box,$e.min),this._box.style.width=yt.x+"px",this._box.style.height=yt.y+"px"},_finish:function(){this._moved&&(Of(this._box),Xf(this._container,"leaflet-crosshair")),Nv(),k0(),Yh(document,{contextmenu:$v,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(de){if(!(de.which!==1&&de.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(Z(this._resetState,this),0);var $e=new so(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds($e).fire("boxzoomend",{boxZoomBounds:$e})}},_onKeyDown:function(de){de.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Bc.addInitHook("addHandler","boxZoom",ry),Bc.mergeOptions({doubleClickZoom:!0});var mm=Jm.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(de){var $e=this._map,yt=$e.getZoom(),nr=$e.options.zoomDelta,jr=de.originalEvent.shiftKey?yt-nr:yt+nr;$e.options.doubleClickZoom==="center"?$e.setZoom(jr):$e.setZoomAround(de.containerPoint,jr)}});Bc.addInitHook("addHandler","doubleClickZoom",mm),Bc.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Im=Jm.extend({addHooks:function(){if(!this._draggable){var de=this._map;this._draggable=new Kg(de._mapPane,de._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),de.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),de.on("zoomend",this._onZoomEnd,this),de.whenReady(this._onZoomEnd,this))}Qu(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Xf(this._map._container,"leaflet-grab"),Xf(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var de=this._map;if(de._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var $e=Yn(this._map.options.maxBounds);this._offsetLimit=Ta(this._map.latLngToContainerPoint($e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint($e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;de.fire("movestart").fire("dragstart"),de.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(de){if(this._map.options.inertia){var $e=this._lastTime=+new Date,yt=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(yt),this._times.push($e),this._prunePositions($e)}this._map.fire("move",de).fire("drag",de)},_prunePositions:function(de){for(;this._positions.length>1&&de-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var de=this._map.getSize().divideBy(2),$e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=$e.subtract(de).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(de,$e){return de-(de-$e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var de=this._draggable._newPos.subtract(this._draggable._startPos),$e=this._offsetLimit;de.x<$e.min.x&&(de.x=this._viscousLimit(de.x,$e.min.x)),de.y<$e.min.y&&(de.y=this._viscousLimit(de.y,$e.min.y)),de.x>$e.max.x&&(de.x=this._viscousLimit(de.x,$e.max.x)),de.y>$e.max.y&&(de.y=this._viscousLimit(de.y,$e.max.y)),this._draggable._newPos=this._draggable._startPos.add(de)}},_onPreDragWrap:function(){var de=this._worldWidth,$e=Math.round(de/2),yt=this._initialWorldOffset,nr=this._draggable._newPos.x,jr=(nr-$e+yt)%de+$e-yt,$i=(nr+$e+yt)%de-$e-yt,ra=Math.abs(jr+yt)0?$i:-$i))-$e;this._delta=0,this._startTime=null,ra&&(de.options.scrollWheelZoom==="center"?de.setZoom($e+ra):de.setZoomAround(this._lastMousePos,$e+ra))}});Bc.addInitHook("addHandler","scrollWheelZoom",Xv);var R4=600;Bc.mergeOptions({tapHold:Fl.touchNative&&Fl.safari&&Fl.mobile,tapTolerance:15});var F4=Jm.extend({addHooks:function(){Hu(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Yh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(de){if(clearTimeout(this._holdTimeout),de.touches.length===1){var $e=de.touches[0];this._startPos=this._newPos=new Di($e.clientX,$e.clientY),this._holdTimeout=setTimeout(Z(function(){this._cancel(),this._isTapValid()&&(Hu(document,"touchend",Cc),Hu(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",$e))},this),R4),Hu(document,"touchend touchcancel contextmenu",this._cancel,this),Hu(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function de(){Yh(document,"touchend",Cc),Yh(document,"touchend touchcancel",de)},_cancel:function(){clearTimeout(this._holdTimeout),Yh(document,"touchend touchcancel contextmenu",this._cancel,this),Yh(document,"touchmove",this._onMove,this)},_onMove:function(de){var $e=de.touches[0];this._newPos=new Di($e.clientX,$e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(de,$e){var yt=new MouseEvent(de,{bubbles:!0,cancelable:!0,view:window,screenX:$e.screenX,screenY:$e.screenY,clientX:$e.clientX,clientY:$e.clientY});yt._simulated=!0,$e.target.dispatchEvent(yt)}});Bc.addInitHook("addHandler","tapHold",F4),Bc.mergeOptions({touchZoom:Fl.touch,bounceAtZoomLimits:!0});var Dm=Jm.extend({addHooks:function(){Qu(this._map._container,"leaflet-touch-zoom"),Hu(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Xf(this._map._container,"leaflet-touch-zoom"),Yh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(de){var $e=this._map;if(!(!de.touches||de.touches.length!==2||$e._animatingZoom||this._zooming)){var yt=$e.mouseEventToContainerPoint(de.touches[0]),nr=$e.mouseEventToContainerPoint(de.touches[1]);this._centerPoint=$e.getSize()._divideBy(2),this._startLatLng=$e.containerPointToLatLng(this._centerPoint),$e.options.touchZoom!=="center"&&(this._pinchStartLatLng=$e.containerPointToLatLng(yt.add(nr)._divideBy(2))),this._startDist=yt.distanceTo(nr),this._startZoom=$e.getZoom(),this._moved=!1,this._zooming=!0,$e._stop(),Hu(document,"touchmove",this._onTouchMove,this),Hu(document,"touchend touchcancel",this._onTouchEnd,this),Cc(de)}},_onTouchMove:function(de){if(!(!de.touches||de.touches.length!==2||!this._zooming)){var $e=this._map,yt=$e.mouseEventToContainerPoint(de.touches[0]),nr=$e.mouseEventToContainerPoint(de.touches[1]),jr=yt.distanceTo(nr)/this._startDist;if(this._zoom=$e.getScaleZoom(jr,this._startZoom),!$e.options.bounceAtZoomLimits&&(this._zoom<$e.getMinZoom()&&jr<1||this._zoom>$e.getMaxZoom()&&jr>1)&&(this._zoom=$e._limitZoom(this._zoom)),$e.options.touchZoom==="center"){if(this._center=this._startLatLng,jr===1)return}else{var $i=yt._add(nr)._divideBy(2)._subtract(this._centerPoint);if(jr===1&&$i.x===0&&$i.y===0)return;this._center=$e.unproject($e.project(this._pinchStartLatLng,this._zoom).subtract($i),this._zoom)}this._moved||($e._moveStart(!0,!1),this._moved=!0),vr(this._animRequest);var ra=Z($e._move,$e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=vi(ra,this,!0),Cc(de)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,vr(this._animRequest),Yh(document,"touchmove",this._onTouchMove,this),Yh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Bc.addInitHook("addHandler","touchZoom",Dm),Bc.BoxZoom=ry,Bc.DoubleClickZoom=mm,Bc.Drag=Im,Bc.Keyboard=B4,Bc.ScrollWheelZoom=Xv,Bc.TapHold=F4,Bc.TouchZoom=Dm,r.Bounds=ka,r.Browser=Fl,r.CRS=zn,r.Canvas=z4,r.Circle=ib,r.CircleMarker=rb,r.Class=Ar,r.Control=Fp,r.DivIcon=I4,r.DivOverlay=Qm,r.DomEvent=T0,r.DomUtil=zc,r.Draggable=Kg,r.Evented=ei,r.FeatureGroup=o0,r.GeoJSON=Sg,r.GridLayer=A_,r.Handler=Jm,r.Icon=Yg,r.ImageOverlay=Ag,r.LatLng=sn,r.LatLngBounds=so,r.Layer=K0,r.LayerGroup=Kv,r.LineUtil=hf,r.Map=Bc,r.Marker=S_,r.Mixin=Np,r.Path=Xg,r.Point=Di,r.PolyUtil=u8,r.Polygon=ty,r.Polyline=pm,r.Popup=Yv,r.PosAnimation=T_,r.Projection=dw,r.Rectangle=X0,r.Renderer=Eg,r.SVG=S0,r.SVGOverlay=bw,r.TileLayer=Y0,r.Tooltip=C_,r.Transformation=_a,r.Util=dr,r.VideoOverlay=Lm,r.bind=Z,r.bounds=Ta,r.canvas=kw,r.circle=ey,r.circleMarker=M4,r.control=Z0,r.divIcon=m8,r.extend=S,r.featureGroup=A4,r.geoJSON=xw,r.geoJson=lb,r.gridLayer=ww,r.icon=mw,r.imageOverlay=Mg,r.latLng=an,r.latLngBounds=Yn,r.layerGroup=tb,r.map=Zs,r.marker=f8,r.point=Qn,r.polygon=d8,r.polyline=E4,r.popup=Mf,r.rectangle=Pm,r.setOptions=Dt,r.stamp=be,r.svg=O4,r.svgOverlay=p8,r.tileLayer=ub,r.tooltip=P4,r.transformation=Ur,r.version=c,r.videoOverlay=ff;var zm=window.L;r.noConflict=function(){return window.L=zm,this},window.L=r})}(e5,e5.exports)),e5.exports}var ope=ape();const ug=r$(ope),RB=Object.freeze(Object.defineProperty({__proto__:null,default:ug},Symbol.toStringTag,{value:"Module"})),FB=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],C7=1,I3=8;class IE{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,c]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const S=c>>4;if(S!==C7)throw new Error(`Got v${S} data when expected v${C7}.`);const H=FB[c&15];if(!H)throw new Error("Unrecognized array type.");const[Z]=new Uint16Array(e,2,1),[ue]=new Uint32Array(e,4,1);return new IE(ue,Z,H,e)}constructor(e,r=64,c=Float64Array,S){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=c,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const H=FB.indexOf(this.ArrayType),Z=e*2*this.ArrayType.BYTES_PER_ELEMENT,ue=e*this.IndexArrayType.BYTES_PER_ELEMENT,be=(8-ue%8)%8;if(H<0)throw new Error(`Unexpected typed array class: ${c}.`);S&&S instanceof ArrayBuffer?(this.data=S,this.ids=new this.IndexArrayType(this.data,I3,e),this.coords=new this.ArrayType(this.data,I3+ue+be,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(I3+Z+ue+be),this.ids=new this.IndexArrayType(this.data,I3,e),this.coords=new this.ArrayType(this.data,I3+ue+be,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(C7<<4)+H]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const c=this._pos>>1;return this.ids[c]=c,this.coords[this._pos++]=e,this.coords[this._pos++]=r,c}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return KM(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,c,S){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:H,coords:Z,nodeSize:ue}=this,be=[0,H.length-1,0],Se=[];for(;be.length;){const Re=be.pop()||0,Xe=be.pop()||0,vt=be.pop()||0;if(Xe-vt<=ue){for(let rr=vt;rr<=Xe;rr++){const Er=Z[2*rr],Fe=Z[2*rr+1];Er>=e&&Er<=c&&Fe>=r&&Fe<=S&&Se.push(H[rr])}continue}const bt=vt+Xe>>1,kt=Z[2*bt],Dt=Z[2*bt+1];kt>=e&&kt<=c&&Dt>=r&&Dt<=S&&Se.push(H[bt]),(Re===0?e<=kt:r<=Dt)&&(be.push(vt),be.push(bt-1),be.push(1-Re)),(Re===0?c>=kt:S>=Dt)&&(be.push(bt+1),be.push(Xe),be.push(1-Re))}return Se}within(e,r,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:S,coords:H,nodeSize:Z}=this,ue=[0,S.length-1,0],be=[],Se=c*c;for(;ue.length;){const Re=ue.pop()||0,Xe=ue.pop()||0,vt=ue.pop()||0;if(Xe-vt<=Z){for(let rr=vt;rr<=Xe;rr++)NB(H[2*rr],H[2*rr+1],e,r)<=Se&&be.push(S[rr]);continue}const bt=vt+Xe>>1,kt=H[2*bt],Dt=H[2*bt+1];NB(kt,Dt,e,r)<=Se&&be.push(S[bt]),(Re===0?e-c<=kt:r-c<=Dt)&&(ue.push(vt),ue.push(bt-1),ue.push(1-Re)),(Re===0?e+c>=kt:r+c>=Dt)&&(ue.push(bt+1),ue.push(Xe),ue.push(1-Re))}return be}}function KM(t,e,r,c,S,H){if(S-c<=r)return;const Z=c+S>>1;i$(t,e,Z,c,S,H),KM(t,e,r,c,Z-1,1-H),KM(t,e,r,Z+1,S,1-H)}function i$(t,e,r,c,S,H){for(;S>c;){if(S-c>600){const Se=S-c+1,Re=r-c+1,Xe=Math.log(Se),vt=.5*Math.exp(2*Xe/3),bt=.5*Math.sqrt(Xe*vt*(Se-vt)/Se)*(Re-Se/2<0?-1:1),kt=Math.max(c,Math.floor(r-Re*vt/Se+bt)),Dt=Math.min(S,Math.floor(r+(Se-Re)*vt/Se+bt));i$(t,e,r,kt,Dt,H)}const Z=e[2*r+H];let ue=c,be=S;for(D3(t,e,c,r),e[2*S+H]>Z&&D3(t,e,c,S);ueZ;)be--}e[2*c+H]===Z?D3(t,e,c,be):(be++,D3(t,e,be,S)),be<=r&&(c=be+1),r<=be&&(S=be-1)}}function D3(t,e,r,c){A7(t,r,c),A7(e,2*r,2*c),A7(e,2*r+1,2*c+1)}function A7(t,e,r){const c=t[e];t[e]=t[r],t[r]=c}function NB(t,e,r,c){const S=t-r,H=e-c;return S*S+H*H}const spe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},jB=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),ox=2,Qy=3,M7=4,Wy=5,n$=6;class lpe{constructor(e){this.options=Object.assign(Object.create(spe),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:r,minZoom:c,maxZoom:S}=this.options;r&&console.time("total time");const H=`prepare ${e.length} points`;r&&console.time(H),this.points=e;const Z=[];for(let be=0;be=c;be--){const Se=+Date.now();ue=this.trees[be]=this._createTree(this._cluster(ue,be)),r&&console.log("z%d: %d clusters in %dms",be,ue.numItems,+Date.now()-Se)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let c=((e[0]+180)%360+360)%360-180;const S=Math.max(-90,Math.min(90,e[1]));let H=e[2]===180?180:((e[2]+180)%360+360)%360-180;const Z=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)c=-180,H=180;else if(c>H){const Xe=this.getClusters([c,S,180,Z],r),vt=this.getClusters([-180,S,H,Z],r);return Xe.concat(vt)}const ue=this.trees[this._limitZoom(r)],be=ue.range(Dk(c),zk(Z),Dk(H),zk(S)),Se=ue.data,Re=[];for(const Xe of be){const vt=this.stride*Xe;Re.push(Se[vt+Wy]>1?UB(Se,vt,this.clusterProps):this.points[Se[vt+Qy]])}return Re}getChildren(e){const r=this._getOriginId(e),c=this._getOriginZoom(e),S="No cluster with the specified id.",H=this.trees[c];if(!H)throw new Error(S);const Z=H.data;if(r*this.stride>=Z.length)throw new Error(S);const ue=this.options.radius/(this.options.extent*Math.pow(2,c-1)),be=Z[r*this.stride],Se=Z[r*this.stride+1],Re=H.within(be,Se,ue),Xe=[];for(const vt of Re){const bt=vt*this.stride;Z[bt+M7]===e&&Xe.push(Z[bt+Wy]>1?UB(Z,bt,this.clusterProps):this.points[Z[bt+Qy]])}if(Xe.length===0)throw new Error(S);return Xe}getLeaves(e,r,c){r=r||10,c=c||0;const S=[];return this._appendLeaves(S,e,r,c,0),S}getTile(e,r,c){const S=this.trees[this._limitZoom(e)],H=Math.pow(2,e),{extent:Z,radius:ue}=this.options,be=ue/Z,Se=(c-be)/H,Re=(c+1+be)/H,Xe={features:[]};return this._addTileFeatures(S.range((r-be)/H,Se,(r+1+be)/H,Re),S.data,r,c,H,Xe),r===0&&this._addTileFeatures(S.range(1-be/H,Se,1,Re),S.data,H,c,H,Xe),r===H-1&&this._addTileFeatures(S.range(0,Se,be/H,Re),S.data,-1,c,H,Xe),Xe.features.length?Xe:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){const c=this.getChildren(e);if(r++,c.length!==1)break;e=c[0].properties.cluster_id}return r}_appendLeaves(e,r,c,S,H){const Z=this.getChildren(r);for(const ue of Z){const be=ue.properties;if(be&&be.cluster?H+be.point_count<=S?H+=be.point_count:H=this._appendLeaves(e,be.cluster_id,c,S,H):H1;let Re,Xe,vt;if(Se)Re=a$(r,be,this.clusterProps),Xe=r[be],vt=r[be+1];else{const Dt=this.points[r[be+Qy]];Re=Dt.properties;const[rr,Er]=Dt.geometry.coordinates;Xe=Dk(rr),vt=zk(Er)}const bt={type:1,geometry:[[Math.round(this.options.extent*(Xe*H-c)),Math.round(this.options.extent*(vt*H-S))]],tags:Re};let kt;Se||this.options.generateId?kt=r[be+Qy]:kt=this.points[r[be+Qy]].id,kt!==void 0&&(bt.id=kt),Z.features.push(bt)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){const{radius:c,extent:S,reduce:H,minPoints:Z}=this.options,ue=c/(S*Math.pow(2,r)),be=e.data,Se=[],Re=this.stride;for(let Xe=0;Xer&&(rr+=be[Fe+Wy])}if(rr>Dt&&rr>=Z){let Er=vt*Dt,Fe=bt*Dt,wi,ur=-1;const Ir=((Xe/Re|0)<<5)+(r+1)+this.points.length;for(const Ti of kt){const _i=Ti*Re;if(be[_i+ox]<=r)continue;be[_i+ox]=r;const Ci=be[_i+Wy];Er+=be[_i]*Ci,Fe+=be[_i+1]*Ci,be[_i+M7]=Ir,H&&(wi||(wi=this._map(be,Xe,!0),ur=this.clusterProps.length,this.clusterProps.push(wi)),H(wi,this._map(be,_i)))}be[Xe+M7]=Ir,Se.push(Er/rr,Fe/rr,1/0,Ir,-1,rr),H&&Se.push(ur)}else{for(let Er=0;Er1)for(const Er of kt){const Fe=Er*Re;if(!(be[Fe+ox]<=r)){be[Fe+ox]=r;for(let wi=0;wi>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,c){if(e[r+Wy]>1){const Z=this.clusterProps[e[r+n$]];return c?Object.assign({},Z):Z}const S=this.points[e[r+Qy]].properties,H=this.options.map(S);return c&&H===S?Object.assign({},H):H}}function UB(t,e,r){return{type:"Feature",id:t[e+Qy],properties:a$(t,e,r),geometry:{type:"Point",coordinates:[upe(t[e]),cpe(t[e+1])]}}}function a$(t,e,r){const c=t[e+Wy],S=c>=1e4?`${Math.round(c/1e3)}k`:c>=1e3?`${Math.round(c/100)/10}k`:c,H=t[e+n$],Z=H===-1?{}:Object.assign({},r[H]);return Object.assign(Z,{cluster:!0,cluster_id:t[e+Qy],point_count:c,point_count_abbreviated:S})}function Dk(t){return t/360+.5}function zk(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function upe(t){return(t-.5)*360}function cpe(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}const hpe={class:"map-container"},fpe={key:0,class:"flex items-center justify-center h-96 bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px]"},dpe={class:"hidden sm:inline"},ppe={key:3,class:"map-legend"},mpe={class:"legend-footer"},gpe={key:4,class:"map-attribution"},vpe=Uu({__name:"NetworkMap",props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:["update:showLegend"],setup(t,{expose:e,emit:r}){typeof window<"u"&&!window.chrome&&(window.chrome={runtime:{}});const c=t,S=r,H=()=>{S("update:showLegend",!c.showLegend)},Z=vn();let ue=null;const be=vn(new Map);let Se=null;const Re=vn(new Map),Xe=vn([]),vt=vn(!0),bt=vn(60),kt=vn(14),Dt=Do(()=>c.baseLatitude!==null&&c.baseLongitude!==null&&typeof c.baseLatitude=="number"&&typeof c.baseLongitude=="number"&&c.baseLatitude!==0&&c.baseLongitude!==0&&Math.abs(c.baseLatitude)<=90&&Math.abs(c.baseLongitude)<=180),rr=vi=>new Date(vi*1e3).toLocaleString(),Er=vi=>vi?`${vi} dBm`:"N/A",Fe=vi=>vi?`${vi} dB`:"N/A",wi=vi=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[vi||0]||"Unknown",ur=(vi,vr,dr,Ar)=>{const Xr=(dr-vi)*Math.PI/180,ei=(Ar-vr)*Math.PI/180,Di=Math.sin(Xr/2)*Math.sin(Xr/2)+Math.cos(vi*Math.PI/180)*Math.cos(dr*Math.PI/180)*Math.sin(ei/2)*Math.sin(ei/2);return 6371*(2*Math.atan2(Math.sqrt(Di),Math.sqrt(1-Di)))},Ir=()=>{ue&&(Xe.value.forEach(vi=>{ue&&vi.remove()}),Xe.value.length=0,ue.remove(),ue=null),be.value.clear(),Re.value.clear(),Se=null},Ti=vi=>{const vr=new Map;return vi.filter(dr=>dr.latitude!==null&&dr.longitude!==null).map(dr=>{let Ar=dr.latitude,ti=dr.longitude;const Xr=`${Ar.toFixed(6)}_${ti.toFixed(6)}`,ei=vr.get(Xr)||0;if(vr.set(Xr,ei+1),ei>0){const qn=ei*60*(Math.PI/180);Ar+=Math.sin(qn)*.001*(ei*.5),ti+=Math.cos(qn)*.001*(ei*.5)}return{type:"Feature",properties:{advert:{...dr,jittered_latitude:Ar,jittered_longitude:ti}},geometry:{type:"Point",coordinates:[ti,Ar]}}})},_i=vi=>{Se=new lpe({radius:bt.value,maxZoom:kt.value,minPoints:2}),Se.load(vi)},Ci=async()=>{if(!Z.value||!Dt.value){console.warn("Cannot initialize map: missing container or coordinates");return}Ir(),await x0();const vi=c.baseLatitude,vr=c.baseLongitude;try{ue=ug.map(Z.value,{center:[vi,vr],zoom:10,zoomControl:!0,scrollWheelZoom:!0,doubleClickZoom:!0,boxZoom:!0,keyboard:!0,attributionControl:!1});try{const Qn=ug.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),ka=ug.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});Qn.addTo(ue),ka.addTo(ue)}catch(Qn){console.warn("Error loading tiles:",Qn)}const dr=(Qn,ka=!1)=>{const Ta=ka?16:12;return ug.divIcon({className:"custom-div-icon",html:`
`,iconSize:[Ta+4,Ta+4],iconAnchor:[(Ta+4)/2,(Ta+4)/2]})},Ar=Qn=>{const ka=Qn<10?30:Qn<100?40:50;return ug.divIcon({className:"custom-cluster-icon",html:` + */var ope=r5.exports,FB;function spe(){return FB||(FB=1,function(t,e){(function(r,c){c(e)})(ope,function(r){var c="1.9.4";function S(de){var $e,yt,nr,Ur;for(yt=1,nr=arguments.length;yt"u"||!L||!L.Mixin)){de=ni(de)?de:[de];for(var $e=0;$e0?Math.floor(de):Math.ceil(de)};Di.prototype={clone:function(){return new Di(this.x,this.y)},add:function(de){return this.clone()._add(Zn(de))},_add:function(de){return this.x+=de.x,this.y+=de.y,this},subtract:function(de){return this.clone()._subtract(Zn(de))},_subtract:function(de){return this.x-=de.x,this.y-=de.y,this},divideBy:function(de){return this.clone()._divideBy(de)},_divideBy:function(de){return this.x/=de,this.y/=de,this},multiplyBy:function(de){return this.clone()._multiplyBy(de)},_multiplyBy:function(de){return this.x*=de,this.y*=de,this},scaleBy:function(de){return new Di(this.x*de.x,this.y*de.y)},unscaleBy:function(de){return new Di(this.x/de.x,this.y/de.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=En(this.x),this.y=En(this.y),this},distanceTo:function(de){de=Zn(de);var $e=de.x-this.x,yt=de.y-this.y;return Math.sqrt($e*$e+yt*yt)},equals:function(de){return de=Zn(de),de.x===this.x&&de.y===this.y},contains:function(de){return de=Zn(de),Math.abs(de.x)<=Math.abs(this.x)&&Math.abs(de.y)<=Math.abs(this.y)},toString:function(){return"Point("+pt(this.x)+", "+pt(this.y)+")"}};function Zn(de,$e,yt){return de instanceof Di?de:ni(de)?new Di(de[0],de[1]):de==null?de:typeof de=="object"&&"x"in de&&"y"in de?new Di(de.x,de.y):new Di(de,$e,yt)}function ga(de,$e){if(de)for(var yt=$e?[de,$e]:de,nr=0,Ur=yt.length;nr=this.min.x&&yt.x<=this.max.x&&$e.y>=this.min.y&&yt.y<=this.max.y},intersects:function(de){de=ya(de);var $e=this.min,yt=this.max,nr=de.min,Ur=de.max,$i=Ur.x>=$e.x&&nr.x<=yt.x,ra=Ur.y>=$e.y&&nr.y<=yt.y;return $i&&ra},overlaps:function(de){de=ya(de);var $e=this.min,yt=this.max,nr=de.min,Ur=de.max,$i=Ur.x>$e.x&&nr.x$e.y&&nr.y=$e.lat&&Ur.lat<=yt.lat&&nr.lng>=$e.lng&&Ur.lng<=yt.lng},intersects:function(de){de=qn(de);var $e=this._southWest,yt=this._northEast,nr=de.getSouthWest(),Ur=de.getNorthEast(),$i=Ur.lat>=$e.lat&&nr.lat<=yt.lat,ra=Ur.lng>=$e.lng&&nr.lng<=yt.lng;return $i&&ra},overlaps:function(de){de=qn(de);var $e=this._southWest,yt=this._northEast,nr=de.getSouthWest(),Ur=de.getNorthEast(),$i=Ur.lat>$e.lat&&nr.lat$e.lng&&nr.lng1,Q8=function(){var de=!1;try{var $e=Object.defineProperty({},"passive",{get:function(){de=!0}});window.addEventListener("testPassiveEventSupport",it,$e),window.removeEventListener("testPassiveEventSupport",it,$e)}catch{}return de}(),eS=function(){return!!document.createElement("canvas").getContext}(),tw=!!(document.createElementNS&&so("svg").createSVGRect),tS=!!tw&&function(){var de=document.createElement("div");return de.innerHTML="",(de.firstChild&&de.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),rS=!tw&&function(){try{var de=document.createElement("div");de.innerHTML='';var $e=de.firstChild;return $e.style.behavior="url(#default#VML)",$e&&typeof $e.adj=="object"}catch{return!1}}(),y4=navigator.platform.indexOf("Mac")===0,rw=navigator.platform.indexOf("Linux")===0;function q0(de){return navigator.userAgent.toLowerCase().indexOf(de)>=0}var Fl={ie:ss,ielt9:ys,edge:ns,webkit:Qo,android:Rl,android23:Ws,androidStock:Su,opera:uc,chrome:Th,gecko:Gc,safari:Rp,phantom:kp,opera12:W0,win:um,ie3d:Vg,webkit3d:Z1,gecko3d:Fp,any3d:cm,mobile:Wg,mobileWebkit:Kx,mobileWebkit3d:Z8,msPointer:m4,pointer:g4,touch:K8,touchNative:v4,mobileOpera:Y8,mobileGecko:X8,retina:J8,passiveEvents:Q8,canvas:eS,svg:tw,vml:rS,inlineSvg:tS,mac:y4,linux:rw},oh=Fl.msPointer?"MSPointerDown":"pointerdown",qd=Fl.msPointer?"MSPointerMove":"pointermove",iw=Fl.msPointer?"MSPointerUp":"pointerup",rc=Fl.msPointer?"MSPointerCancel":"pointercancel",b_={touchstart:oh,touchmove:qd,touchend:iw,touchcancel:rc},_4={touchstart:aS,touchmove:Xm,touchend:Xm,touchcancel:Xm},K1={},Yx=!1;function w_(de,$e,yt){return $e==="touchstart"&&nw(),_4[$e]?(yt=_4[$e].bind(this,yt),de.addEventListener(b_[$e],yt,!1),yt):(console.warn("wrong event specified:",$e),it)}function iS(de,$e,yt){if(!b_[$e]){console.warn("wrong event specified:",$e);return}de.removeEventListener(b_[$e],yt,!1)}function as(de){K1[de.pointerId]=de}function nS(de){K1[de.pointerId]&&(K1[de.pointerId]=de)}function k_(de){delete K1[de.pointerId]}function nw(){Yx||(document.addEventListener(oh,as,!0),document.addEventListener(qd,nS,!0),document.addEventListener(iw,k_,!0),document.addEventListener(rc,k_,!0),Yx=!0)}function Xm(de,$e){if($e.pointerType!==($e.MSPOINTER_TYPE_MOUSE||"mouse")){$e.touches=[];for(var yt in K1)$e.touches.push(K1[yt]);$e.changedTouches=[$e],de($e)}}function aS(de,$e){$e.MSPOINTER_TYPE_TOUCH&&$e.pointerType===$e.MSPOINTER_TYPE_TOUCH&&Cc($e),Xm(de,$e)}function oS(de){var $e={},yt,nr;for(nr in de)yt=de[nr],$e[nr]=yt&&yt.bind?yt.bind(de):yt;return de=$e,$e.type="dblclick",$e.detail=2,$e.isTrusted=!1,$e._simulated=!0,$e}var sS=200;function lS(de,$e){de.addEventListener("dblclick",$e);var yt=0,nr;function Ur($i){if($i.detail!==1){nr=$i.detail;return}if(!($i.pointerType==="mouse"||$i.sourceCapabilities&&!$i.sourceCapabilities.firesTouchEvents)){var ra=k4($i);if(!(ra.some(function(uo){return uo instanceof HTMLLabelElement&&uo.attributes.for})&&!ra.some(function(uo){return uo instanceof HTMLInputElement||uo instanceof HTMLSelectElement}))){var Ja=Date.now();Ja-yt<=sS?(nr++,nr===2&&$e(oS($i))):nr=1,yt=Ja}}}return de.addEventListener("click",Ur),{dblclick:$e,simDblclick:Ur}}function aw(de,$e){de.removeEventListener("dblclick",$e.dblclick),de.removeEventListener("click",$e.simDblclick)}var ow=Zg(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),T_=Zg(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),x4=T_==="webkitTransition"||T_==="OTransition"?T_+"End":"transitionend";function b4(de){return typeof de=="string"?document.getElementById(de):de}function S_(de,$e){var yt=de.style[$e]||de.currentStyle&&de.currentStyle[$e];if((!yt||yt==="auto")&&document.defaultView){var nr=document.defaultView.getComputedStyle(de,null);yt=nr?nr[$e]:null}return yt==="auto"?null:yt}function jc(de,$e,yt){var nr=document.createElement(de);return nr.className=$e||"",yt&&yt.appendChild(nr),nr}function Bf(de){var $e=de.parentNode;$e&&$e.removeChild(de)}function Xx(de){for(;de.firstChild;)de.removeChild(de.firstChild)}function Y1(de){var $e=de.parentNode;$e&&$e.lastChild!==de&&$e.appendChild(de)}function ji(de){var $e=de.parentNode;$e&&$e.firstChild!==de&&$e.insertBefore(de,$e.firstChild)}function sw(de,$e){if(de.classList!==void 0)return de.classList.contains($e);var yt=Gg(de);return yt.length>0&&new RegExp("(^|\\s)"+$e+"(\\s|$)").test(yt)}function Qu(de,$e){if(de.classList!==void 0)for(var yt=wt($e),nr=0,Ur=yt.length;nr0?2*window.devicePixelRatio:1;function Bc(de){return Fl.edge?de.wheelDeltaY/2:de.deltaY&&de.deltaMode===0?-de.deltaY/lh:de.deltaY&&de.deltaMode===1?-de.deltaY*20:de.deltaY&&de.deltaMode===2?-de.deltaY*60:de.deltaX||de.deltaZ?0:de.wheelDelta?(de.wheelDeltaY||de.wheelDelta)/2:de.detail&&Math.abs(de.detail)<32765?-de.detail*20:de.detail?de.detail/-32765*60:0}function $v(de,$e){var yt=$e.relatedTarget;if(!yt)return!0;try{for(;yt&&yt!==de;)yt=yt.parentNode}catch{return!1}return yt!==de}var T0={__proto__:null,on:Hu,off:Yh,stopPropagation:G0,disableScrollPropagation:Tg,disableClickPropagation:X1,preventDefault:Cc,stop:Uv,getPropagationPath:k4,getMousePosition:Tp,getWheelDelta:Bc,isExternalTarget:$v,addListener:Hu,removeListener:Yh},M_=ti.extend({run:function(de,$e,yt,nr){this.stop(),this._el=de,this._inProgress=!0,this._duration=yt||.25,this._easeOutPower=1/Math.max(nr||.5,.2),this._startPos=Zc(de),this._offset=$e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=yi(this._animate,this),this._step()},_step:function(de){var $e=+new Date-this._startTime,yt=this._duration*1e3;$ethis.options.maxZoom)?this.setZoom(de):this},panInsideBounds:function(de,$e){this._enforcingBounds=!0;var yt=this.getCenter(),nr=this._limitCenter(yt,this._zoom,qn(de));return yt.equals(nr)||this.panTo(nr,$e),this._enforcingBounds=!1,this},panInside:function(de,$e){$e=$e||{};var yt=Zn($e.paddingTopLeft||$e.padding||[0,0]),nr=Zn($e.paddingBottomRight||$e.padding||[0,0]),Ur=this.project(this.getCenter()),$i=this.project(de),ra=this.getPixelBounds(),Ja=ya([ra.min.add(yt),ra.max.subtract(nr)]),uo=Ja.getSize();if(!Ja.contains($i)){this._enforcingBounds=!0;var Mo=$i.subtract(Ja.getCenter()),Ys=Ja.extend($i).getSize().subtract(uo);Ur.x+=Mo.x<0?-Ys.x:Ys.x,Ur.y+=Mo.y<0?-Ys.y:Ys.y,this.panTo(this.unproject(Ur),$e),this._enforcingBounds=!1}return this},invalidateSize:function(de){if(!this._loaded)return this;de=S({animate:!1,pan:!0},de===!0?{animate:!0}:de);var $e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var yt=this.getSize(),nr=$e.divideBy(2).round(),Ur=yt.divideBy(2).round(),$i=nr.subtract(Ur);return!$i.x&&!$i.y?this:(de.animate&&de.pan?this.panBy($i):(de.pan&&this._rawPanBy($i),this.fire("move"),de.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(Z(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:$e,newSize:yt}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(de){if(de=this._locateOptions=S({timeout:1e4,watch:!1},de),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var $e=Z(this._handleGeolocationResponse,this),yt=Z(this._handleGeolocationError,this);return de.watch?this._locationWatchId=navigator.geolocation.watchPosition($e,yt,de):navigator.geolocation.getCurrentPosition($e,yt,de),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(de){if(this._container._leaflet_id){var $e=de.code,yt=de.message||($e===1?"permission denied":$e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:$e,message:"Geolocation error: "+yt+"."})}},_handleGeolocationResponse:function(de){if(this._container._leaflet_id){var $e=de.coords.latitude,yt=de.coords.longitude,nr=new ln($e,yt),Ur=nr.toBounds(de.coords.accuracy*2),$i=this._locateOptions;if($i.setView){var ra=this.getBoundsZoom(Ur);this.setView(nr,$i.maxZoom?Math.min(ra,$i.maxZoom):ra)}var Ja={latlng:nr,bounds:Ur,timestamp:de.timestamp};for(var uo in de.coords)typeof de.coords[uo]=="number"&&(Ja[uo]=de.coords[uo]);this.fire("locationfound",Ja)}},addHandler:function(de,$e){if(!$e)return this;var yt=this[de]=new $e(this);return this._handlers.push(yt),this.options[de]&&yt.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Bf(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(gr(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var de;for(de in this._layers)this._layers[de].remove();for(de in this._panes)Bf(this._panes[de]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(de,$e){var yt="leaflet-pane"+(de?" leaflet-"+de.replace("Pane","")+"-pane":""),nr=jc("div",yt,$e||this._mapPane);return de&&(this._panes[de]=nr),nr},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var de=this.getPixelBounds(),$e=this.unproject(de.getBottomLeft()),yt=this.unproject(de.getTopRight());return new ro($e,yt)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(de,$e,yt){de=qn(de),yt=Zn(yt||[0,0]);var nr=this.getZoom()||0,Ur=this.getMinZoom(),$i=this.getMaxZoom(),ra=de.getNorthWest(),Ja=de.getSouthEast(),uo=this.getSize().subtract(yt),Mo=ya(this.project(Ja,nr),this.project(ra,nr)).getSize(),Ys=Fl.any3d?this.options.zoomSnap:1,El=uo.x/Mo.x,qu=uo.y/Mo.y,Kd=$e?Math.max(El,qu):Math.min(El,qu);return nr=this.getScaleZoom(Kd,nr),Ys&&(nr=Math.round(nr/(Ys/100))*(Ys/100),nr=$e?Math.ceil(nr/Ys)*Ys:Math.floor(nr/Ys)*Ys),Math.max(Ur,Math.min($i,nr))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Di(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(de,$e){var yt=this._getTopLeftPoint(de,$e);return new ga(yt,yt.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(de){return this.options.crs.getProjectedBounds(de===void 0?this.getZoom():de)},getPane:function(de){return typeof de=="string"?this._panes[de]:de},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(de,$e){var yt=this.options.crs;return $e=$e===void 0?this._zoom:$e,yt.scale(de)/yt.scale($e)},getScaleZoom:function(de,$e){var yt=this.options.crs;$e=$e===void 0?this._zoom:$e;var nr=yt.zoom(de*yt.scale($e));return isNaN(nr)?1/0:nr},project:function(de,$e){return $e=$e===void 0?this._zoom:$e,this.options.crs.latLngToPoint(nn(de),$e)},unproject:function(de,$e){return $e=$e===void 0?this._zoom:$e,this.options.crs.pointToLatLng(Zn(de),$e)},layerPointToLatLng:function(de){var $e=Zn(de).add(this.getPixelOrigin());return this.unproject($e)},latLngToLayerPoint:function(de){var $e=this.project(nn(de))._round();return $e._subtract(this.getPixelOrigin())},wrapLatLng:function(de){return this.options.crs.wrapLatLng(nn(de))},wrapLatLngBounds:function(de){return this.options.crs.wrapLatLngBounds(qn(de))},distance:function(de,$e){return this.options.crs.distance(nn(de),nn($e))},containerPointToLayerPoint:function(de){return Zn(de).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(de){return Zn(de).add(this._getMapPanePos())},containerPointToLatLng:function(de){var $e=this.containerPointToLayerPoint(Zn(de));return this.layerPointToLatLng($e)},latLngToContainerPoint:function(de){return this.layerPointToContainerPoint(this.latLngToLayerPoint(nn(de)))},mouseEventToContainerPoint:function(de){return Tp(de,this._container)},mouseEventToLayerPoint:function(de){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(de))},mouseEventToLatLng:function(de){return this.layerPointToLatLng(this.mouseEventToLayerPoint(de))},_initContainer:function(de){var $e=this._container=b4(de);if($e){if($e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Hu($e,"scroll",this._onScroll,this),this._containerId=xe($e)},_initLayout:function(){var de=this._container;this._fadeAnimated=this.options.fadeAnimation&&Fl.any3d,Qu(de,"leaflet-container"+(Fl.touch?" leaflet-touch":"")+(Fl.retina?" leaflet-retina":"")+(Fl.ielt9?" leaflet-oldie":"")+(Fl.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var $e=S_(de,"position");$e!=="absolute"&&$e!=="relative"&&$e!=="fixed"&&$e!=="sticky"&&(de.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var de=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),dc(this._mapPane,new Di(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Qu(de.markerPane,"leaflet-zoom-hide"),Qu(de.shadowPane,"leaflet-zoom-hide"))},_resetView:function(de,$e,yt){dc(this._mapPane,new Di(0,0));var nr=!this._loaded;this._loaded=!0,$e=this._limitZoom($e),this.fire("viewprereset");var Ur=this._zoom!==$e;this._moveStart(Ur,yt)._move(de,$e)._moveEnd(Ur),this.fire("viewreset"),nr&&this.fire("load")},_moveStart:function(de,$e){return de&&this.fire("zoomstart"),$e||this.fire("movestart"),this},_move:function(de,$e,yt,nr){$e===void 0&&($e=this._zoom);var Ur=this._zoom!==$e;return this._zoom=$e,this._lastCenter=de,this._pixelOrigin=this._getNewPixelOrigin(de),nr?yt&&yt.pinch&&this.fire("zoom",yt):((Ur||yt&&yt.pinch)&&this.fire("zoom",yt),this.fire("move",yt)),this},_moveEnd:function(de){return de&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return gr(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(de){dc(this._mapPane,this._getMapPanePos().subtract(de))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(de){this._targets={},this._targets[xe(this._container)]=this;var $e=de?Yh:Hu;$e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&$e(window,"resize",this._onResize,this),Fl.any3d&&this.options.transform3DLimit&&(de?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){gr(this._resizeRequest),this._resizeRequest=yi(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var de=this._getMapPanePos();Math.max(Math.abs(de.x),Math.abs(de.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(de,$e){for(var yt=[],nr,Ur=$e==="mouseout"||$e==="mouseover",$i=de.target||de.srcElement,ra=!1;$i;){if(nr=this._targets[xe($i)],nr&&($e==="click"||$e==="preclick")&&this._draggableMoved(nr)){ra=!0;break}if(nr&&nr.listens($e,!0)&&(Ur&&!$v($i,de)||(yt.push(nr),Ur))||$i===this._container)break;$i=$i.parentNode}return!yt.length&&!ra&&!Ur&&this.listens($e,!0)&&(yt=[this]),yt},_isClickDisabled:function(de){for(;de&&de!==this._container;){if(de._leaflet_disable_click)return!0;de=de.parentNode}},_handleDOMEvent:function(de){var $e=de.target||de.srcElement;if(!(!this._loaded||$e._leaflet_disable_events||de.type==="click"&&this._isClickDisabled($e))){var yt=de.type;yt==="mousedown"&&hp($e),this._fireDOMEvent(de,yt)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(de,$e,yt){if(de.type==="click"){var nr=S({},de);nr.type="preclick",this._fireDOMEvent(nr,nr.type,yt)}var Ur=this._findEventTargets(de,$e);if(yt){for(var $i=[],ra=0;ra0?Math.round(de-$e)/2:Math.max(0,Math.ceil(de))-Math.max(0,Math.floor($e))},_limitZoom:function(de){var $e=this.getMinZoom(),yt=this.getMaxZoom(),nr=Fl.any3d?this.options.zoomSnap:1;return nr&&(de=Math.round(de/nr)*nr),Math.max($e,Math.min(yt,de))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Qf(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(de,$e){var yt=this._getCenterOffset(de)._trunc();return($e&&$e.animate)!==!0&&!this.getSize().contains(yt)?!1:(this.panBy(yt,$e),!0)},_createAnimProxy:function(){var de=this._proxy=jc("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(de),this.on("zoomanim",function($e){var yt=ow,nr=this._proxy.style[yt];ku(this._proxy,this.project($e.center,$e.zoom),this.getZoomScale($e.zoom,1)),nr===this._proxy.style[yt]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Bf(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var de=this.getCenter(),$e=this.getZoom();ku(this._proxy,this.project(de,$e),this.getZoomScale($e,1))},_catchTransitionEnd:function(de){this._animatingZoom&&de.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(de,$e,yt){if(this._animatingZoom)return!0;if(yt=yt||{},!this._zoomAnimated||yt.animate===!1||this._nothingToAnimate()||Math.abs($e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var nr=this.getZoomScale($e),Ur=this._getCenterOffset(de)._divideBy(1-1/nr);return yt.animate!==!0&&!this.getSize().contains(Ur)?!1:(yi(function(){this._moveStart(!0,yt.noMoveStart||!1)._animateZoom(de,$e,!0)},this),!0)},_animateZoom:function(de,$e,yt,nr){this._mapPane&&(yt&&(this._animatingZoom=!0,this._animateToCenter=de,this._animateToZoom=$e,Qu(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:de,zoom:$e,noUpdate:nr}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(Z(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Qf(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Zs(de,$e){return new Rc(de,$e)}var Np=Sr.extend({options:{position:"topright"},initialize:function(de){Dt(this,de)},getPosition:function(){return this.options.position},setPosition:function(de){var $e=this._map;return $e&&$e.removeControl(this),this.options.position=de,$e&&$e.addControl(this),this},getContainer:function(){return this._container},addTo:function(de){this.remove(),this._map=de;var $e=this._container=this.onAdd(de),yt=this.getPosition(),nr=de._controlCorners[yt];return Qu($e,"leaflet-control"),yt.indexOf("bottom")!==-1?nr.insertBefore($e,nr.firstChild):nr.appendChild($e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Bf(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(de){this._map&&de&&de.screenX>0&&de.screenY>0&&this._map.getContainer().focus()}}),Z0=function(de){return new Np(de)};Rc.include({addControl:function(de){return de.addTo(this),this},removeControl:function(de){return de.remove(),this},_initControlPos:function(){var de=this._controlCorners={},$e="leaflet-",yt=this._controlContainer=jc("div",$e+"control-container",this._container);function nr(Ur,$i){var ra=$e+Ur+" "+$e+$i;de[Ur+$i]=jc("div",ra,yt)}nr("top","left"),nr("top","right"),nr("bottom","left"),nr("bottom","right")},_clearControlPos:function(){for(var de in this._controlCorners)Bf(this._controlCorners[de]);Bf(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var J1=Np.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(de,$e,yt,nr){return yt1,this._baseLayersList.style.display=de?"":"none"),this._separator.style.display=$e&&de?"":"none",this},_onLayerChange:function(de){this._handlingClick||this._update();var $e=this._getLayer(xe(de.target)),yt=$e.overlay?de.type==="add"?"overlayadd":"overlayremove":de.type==="add"?"baselayerchange":null;yt&&this._map.fire(yt,$e)},_createRadioElement:function(de,$e){var yt='",nr=document.createElement("div");return nr.innerHTML=yt,nr.firstChild},_addItem:function(de){var $e=document.createElement("label"),yt=this._map.hasLayer(de.layer),nr;de.overlay?(nr=document.createElement("input"),nr.type="checkbox",nr.className="leaflet-control-layers-selector",nr.defaultChecked=yt):nr=this._createRadioElement("leaflet-base-layers_"+xe(this),yt),this._layerControlInputs.push(nr),nr.layerId=xe(de.layer),Hu(nr,"click",this._onInputClick,this);var Ur=document.createElement("span");Ur.innerHTML=" "+de.name;var $i=document.createElement("span");$e.appendChild($i),$i.appendChild(nr),$i.appendChild(Ur);var ra=de.overlay?this._overlaysList:this._baseLayersList;return ra.appendChild($e),this._checkDisabledLayers(),$e},_onInputClick:function(){if(!this._preventClick){var de=this._layerControlInputs,$e,yt,nr=[],Ur=[];this._handlingClick=!0;for(var $i=de.length-1;$i>=0;$i--)$e=de[$i],yt=this._getLayer($e.layerId).layer,$e.checked?nr.push(yt):$e.checked||Ur.push(yt);for($i=0;$i=0;Ur--)$e=de[Ur],yt=this._getLayer($e.layerId).layer,$e.disabled=yt.options.minZoom!==void 0&&nryt.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var de=this._section;this._preventClick=!0,Hu(de,"click",Cc),this.expand();var $e=this;setTimeout(function(){Yh(de,"click",Cc),$e._preventClick=!1})}}),Jm=function(de,$e,yt){return new J1(de,$e,yt)},Os=Np.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(de){var $e="leaflet-control-zoom",yt=jc("div",$e+" leaflet-bar"),nr=this.options;return this._zoomInButton=this._createButton(nr.zoomInText,nr.zoomInTitle,$e+"-in",yt,this._zoomIn),this._zoomOutButton=this._createButton(nr.zoomOutText,nr.zoomOutTitle,$e+"-out",yt,this._zoomOut),this._updateDisabled(),de.on("zoomend zoomlevelschange",this._updateDisabled,this),yt},onRemove:function(de){de.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(de){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(de.shiftKey?3:1))},_createButton:function(de,$e,yt,nr,Ur){var $i=jc("a",yt,nr);return $i.innerHTML=de,$i.href="#",$i.title=$e,$i.setAttribute("role","button"),$i.setAttribute("aria-label",$e),X1($i),Hu($i,"click",Uv),Hu($i,"click",Ur,this),Hu($i,"click",this._refocusOnMap,this),$i},_updateDisabled:function(){var de=this._map,$e="leaflet-disabled";Qf(this._zoomInButton,$e),Qf(this._zoomOutButton,$e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||de._zoom===de.getMinZoom())&&(Qu(this._zoomOutButton,$e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||de._zoom===de.getMaxZoom())&&(Qu(this._zoomInButton,$e),this._zoomInButton.setAttribute("aria-disabled","true"))}});Rc.mergeOptions({zoomControl:!0}),Rc.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Os,this.addControl(this.zoomControl))});var T4=function(de){return new Os(de)},lw=Np.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(de){var $e="leaflet-control-scale",yt=jc("div",$e),nr=this.options;return this._addScales(nr,$e+"-line",yt),de.on(nr.updateWhenIdle?"moveend":"move",this._update,this),de.whenReady(this._update,this),yt},onRemove:function(de){de.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(de,$e,yt){de.metric&&(this._mScale=jc("div",$e,yt)),de.imperial&&(this._iScale=jc("div",$e,yt))},_update:function(){var de=this._map,$e=de.getSize().y/2,yt=de.distance(de.containerPointToLatLng([0,$e]),de.containerPointToLatLng([this.options.maxWidth,$e]));this._updateScales(yt)},_updateScales:function(de){this.options.metric&&de&&this._updateMetric(de),this.options.imperial&&de&&this._updateImperial(de)},_updateMetric:function(de){var $e=this._getRoundNum(de),yt=$e<1e3?$e+" m":$e/1e3+" km";this._updateScale(this._mScale,yt,$e/de)},_updateImperial:function(de){var $e=de*3.2808399,yt,nr,Ur;$e>5280?(yt=$e/5280,nr=this._getRoundNum(yt),this._updateScale(this._iScale,nr+" mi",nr/yt)):(Ur=this._getRoundNum($e),this._updateScale(this._iScale,Ur+" ft",Ur/$e))},_updateScale:function(de,$e,yt){de.style.width=Math.round(this.options.maxWidth*yt)+"px",de.innerHTML=$e},_getRoundNum:function(de){var $e=Math.pow(10,(Math.floor(de)+"").length-1),yt=de/$e;return yt=yt>=10?10:yt>=5?5:yt>=3?3:yt>=2?2:1,$e*yt}}),uS=function(de){return new lw(de)},uw='',cw=Np.extend({options:{position:"bottomright",prefix:''+(Fl.inlineSvg?uw+" ":"")+"Leaflet"},initialize:function(de){Dt(this,de),this._attributions={}},onAdd:function(de){de.attributionControl=this,this._container=jc("div","leaflet-control-attribution"),X1(this._container);for(var $e in de._layers)de._layers[$e].getAttribution&&this.addAttribution(de._layers[$e].getAttribution());return this._update(),de.on("layeradd",this._addAttribution,this),this._container},onRemove:function(de){de.off("layeradd",this._addAttribution,this)},_addAttribution:function(de){de.layer.getAttribution&&(this.addAttribution(de.layer.getAttribution()),de.layer.once("remove",function(){this.removeAttribution(de.layer.getAttribution())},this))},setPrefix:function(de){return this.options.prefix=de,this._update(),this},addAttribution:function(de){return de?(this._attributions[de]||(this._attributions[de]=0),this._attributions[de]++,this._update(),this):this},removeAttribution:function(de){return de?(this._attributions[de]&&(this._attributions[de]--,this._update()),this):this},_update:function(){if(this._map){var de=[];for(var $e in this._attributions)this._attributions[$e]&&de.push($e);var yt=[];this.options.prefix&&yt.push(this.options.prefix),de.length&&yt.push(de.join(", ")),this._container.innerHTML=yt.join(' ')}}});Rc.mergeOptions({attributionControl:!0}),Rc.addInitHook(function(){this.options.attributionControl&&new cw().addTo(this)});var cS=function(de){return new cw(de)};Np.Layers=J1,Np.Zoom=Os,Np.Scale=lw,Np.Attribution=cw,Z0.layers=Jm,Z0.zoom=T4,Z0.scale=uS,Z0.attribution=cS;var Qm=Sr.extend({initialize:function(de){this._map=de},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qm.addTo=function(de,$e){return de.addHandler($e,this),this};var jp={Events:Jr},Em=Fl.touch?"touchstart mousedown":"mousedown",Kg=ti.extend({options:{clickTolerance:3},initialize:function(de,$e,yt,nr){Dt(this,nr),this._element=de,this._dragStartTarget=$e||de,this._preventOutline=yt},enable:function(){this._enabled||(Hu(this._dragStartTarget,Em,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Kg._dragging===this&&this.finishDrag(!0),Yh(this._dragStartTarget,Em,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(de){if(this._enabled&&(this._moved=!1,!sw(this._element,"leaflet-zoom-anim"))){if(de.touches&&de.touches.length!==1){Kg._dragging===this&&this.finishDrag();return}if(!(Kg._dragging||de.shiftKey||de.which!==1&&de.button!==1&&!de.touches)&&(Kg._dragging=this,this._preventOutline&&hp(this._element),sh(),Am(),!this._moving)){this.fire("down");var $e=de.touches?de.touches[0]:de,yt=Gd(this._element);this._startPoint=new Di($e.clientX,$e.clientY),this._startPos=Zc(this._element),this._parentScale=A_(yt);var nr=de.type==="mousedown";Hu(document,nr?"mousemove":"touchmove",this._onMove,this),Hu(document,nr?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(de){if(this._enabled){if(de.touches&&de.touches.length>1){this._moved=!0;return}var $e=de.touches&&de.touches.length===1?de.touches[0]:de,yt=new Di($e.clientX,$e.clientY)._subtract(this._startPoint);!yt.x&&!yt.y||Math.abs(yt.x)+Math.abs(yt.y)$i&&(ra=Ja,$i=uo);$i>yt&&($e[ra]=1,Vv(de,$e,yt,nr,ra),Vv(de,$e,yt,ra,Ur))}function C4(de,$e){for(var yt=[de[0]],nr=1,Ur=0,$i=de.length;nr<$i;nr++)dS(de[nr],de[Ur])>$e&&(yt.push(de[nr]),Ur=nr);return Ur<$i-1&&yt.push(de[$i-1]),yt}var dw;function pw(de,$e,yt,nr,Ur){var $i=nr?dw:qv(de,yt),ra=qv($e,yt),Ja,uo,Mo;for(dw=ra;;){if(!($i|ra))return[de,$e];if($i&ra)return!1;Ja=$i||ra,uo=Wv(de,$e,Ja,yt,Ur),Mo=qv(uo,yt),Ja===$i?(de=uo,$i=Mo):($e=uo,ra=Mo)}}function Wv(de,$e,yt,nr,Ur){var $i=$e.x-de.x,ra=$e.y-de.y,Ja=nr.min,uo=nr.max,Mo,Ys;return yt&8?(Mo=de.x+$i*(uo.y-de.y)/ra,Ys=uo.y):yt&4?(Mo=de.x+$i*(Ja.y-de.y)/ra,Ys=Ja.y):yt&2?(Mo=uo.x,Ys=de.y+ra*(uo.x-de.x)/$i):yt&1&&(Mo=Ja.x,Ys=de.y+ra*(Ja.x-de.x)/$i),new Di(Mo,Ys,Ur)}function qv(de,$e){var yt=0;return de.x<$e.min.x?yt|=1:de.x>$e.max.x&&(yt|=2),de.y<$e.min.y?yt|=4:de.y>$e.max.y&&(yt|=8),yt}function dS(de,$e){var yt=$e.x-de.x,nr=$e.y-de.y;return yt*yt+nr*nr}function Q1(de,$e,yt,nr){var Ur=$e.x,$i=$e.y,ra=yt.x-Ur,Ja=yt.y-$i,uo=ra*ra+Ja*Ja,Mo;return uo>0&&(Mo=((de.x-Ur)*ra+(de.y-$i)*Ja)/uo,Mo>1?(Ur=yt.x,$i=yt.y):Mo>0&&(Ur+=ra*Mo,$i+=Ja*Mo)),ra=de.x-Ur,Ja=de.y-$i,nr?ra*ra+Ja*Ja:new Di(Ur,$i)}function fm(de){return!ni(de[0])||typeof de[0][0]!="object"&&typeof de[0][0]<"u"}function A4(de){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),fm(de)}function M4(de,$e){var yt,nr,Ur,$i,ra,Ja,uo,Mo;if(!de||de.length===0)throw new Error("latlngs not passed");fm(de)||(console.warn("latlngs are not flat! Only the first ring will be used"),de=de[0]);var Ys=nn([0,0]),El=qn(de),qu=El.getNorthWest().distanceTo(El.getSouthWest())*El.getNorthEast().distanceTo(El.getNorthWest());qu<1700&&(Ys=eb(de));var Kd=de.length,ed=[];for(yt=0;ytnr){uo=($i-nr)/Ur,Mo=[Ja.x-uo*(Ja.x-ra.x),Ja.y-uo*(Ja.y-ra.y)];break}var l0=$e.unproject(Zn(Mo));return nn([l0.lat+Ys.lat,l0.lng+Ys.lng])}var hf={__proto__:null,simplify:fw,pointToSegmentDistance:S4,closestPointOnSegment:Hv,clipSegment:pw,_getEdgeIntersection:Wv,_getBitCode:qv,_sqClosestPointOnSegment:Q1,isFlat:fm,_flat:A4,polylineCenter:M4},dm={project:function(de){return new Di(de.lng,de.lat)},unproject:function(de){return new ln(de.y,de.x)},bounds:new ga([-180,-90],[180,90])},ey={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ga([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(de){var $e=Math.PI/180,yt=this.R,nr=de.lat*$e,Ur=this.R_MINOR/yt,$i=Math.sqrt(1-Ur*Ur),ra=$i*Math.sin(nr),Ja=Math.tan(Math.PI/4-nr/2)/Math.pow((1-ra)/(1+ra),$i/2);return nr=-yt*Math.log(Math.max(Ja,1e-10)),new Di(de.lng*$e*yt,nr)},unproject:function(de){for(var $e=180/Math.PI,yt=this.R,nr=this.R_MINOR/yt,Ur=Math.sqrt(1-nr*nr),$i=Math.exp(-de.y/yt),ra=Math.PI/2-2*Math.atan($i),Ja=0,uo=.1,Mo;Ja<15&&Math.abs(uo)>1e-7;Ja++)Mo=Ur*Math.sin(ra),Mo=Math.pow((1-Mo)/(1+Mo),Ur/2),uo=Math.PI/2-2*Math.atan($i*Mo)-ra,ra+=uo;return new ln(ra*$e,de.x*$e/yt)}},mw={__proto__:null,LonLat:dm,Mercator:ey,SphericalMercator:zo},gw=S({},Ra,{code:"EPSG:3395",projection:ey,transformation:function(){var de=.5/(Math.PI*ey.R);return $r(de,.5,-de,.5)}()}),tb=S({},Ra,{code:"EPSG:4326",projection:dm,transformation:$r(1/180,1,-1/180,.5)}),Gv=S({},On,{projection:dm,transformation:$r(1,0,-1,0),scale:function(de){return Math.pow(2,de)},zoom:function(de){return Math.log(de)/Math.LN2},distance:function(de,$e){var yt=$e.lng-de.lng,nr=$e.lat-de.lat;return Math.sqrt(yt*yt+nr*nr)},infinite:!0});On.Earth=Ra,On.EPSG3395=gw,On.EPSG3857=Mi,On.EPSG900913=Xi,On.EPSG4326=tb,On.Simple=Gv;var K0=ti.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(de){return de.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(de){return de&&de.removeLayer(this),this},getPane:function(de){return this._map.getPane(de?this.options[de]||de:this.options.pane)},addInteractiveTarget:function(de){return this._map._targets[xe(de)]=this,this},removeInteractiveTarget:function(de){return delete this._map._targets[xe(de)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(de){var $e=de.target;if($e.hasLayer(this)){if(this._map=$e,this._zoomAnimated=$e._zoomAnimated,this.getEvents){var yt=this.getEvents();$e.on(yt,this),this.once("remove",function(){$e.off(yt,this)},this)}this.onAdd($e),this.fire("add"),$e.fire("layeradd",{layer:this})}}});Rc.include({addLayer:function(de){if(!de._layerAdd)throw new Error("The provided object is not a Layer.");var $e=xe(de);return this._layers[$e]?this:(this._layers[$e]=de,de._mapToAdd=this,de.beforeAdd&&de.beforeAdd(this),this.whenReady(de._layerAdd,de),this)},removeLayer:function(de){var $e=xe(de);return this._layers[$e]?(this._loaded&&de.onRemove(this),delete this._layers[$e],this._loaded&&(this.fire("layerremove",{layer:de}),de.fire("remove")),de._map=de._mapToAdd=null,this):this},hasLayer:function(de){return xe(de)in this._layers},eachLayer:function(de,$e){for(var yt in this._layers)de.call($e,this._layers[yt]);return this},_addLayers:function(de){de=de?ni(de)?de:[de]:[];for(var $e=0,yt=de.length;$ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&$e[0]instanceof ln&&$e[0].equals($e[yt-1])&&$e.pop(),$e},_setLatLngs:function(de){pm.prototype._setLatLngs.call(this,de),fm(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return fm(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var de=this._renderer._bounds,$e=this.options.weight,yt=new Di($e,$e);if(de=new ga(de.min.subtract(yt),de.max.add(yt)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(de))){if(this.options.noClip){this._parts=this._rings;return}for(var nr=0,Ur=this._rings.length,$i;nrde.y!=Ur.y>de.y&&de.x<(Ur.x-nr.x)*(de.y-nr.y)/(Ur.y-nr.y)+nr.x&&($e=!$e);return $e||pm.prototype._containsPoint.call(this,de,!0)}});function mS(de,$e){return new iy(de,$e)}var Sg=s0.extend({initialize:function(de,$e){Dt(this,$e),this._layers={},de&&this.addData(de)},addData:function(de){var $e=ni(de)?de:de.features,yt,nr,Ur;if($e){for(yt=0,nr=$e.length;yt0&&Ur.push(Ur[0].slice()),Ur}function Cg(de,$e){return de.feature?S({},de.feature,{geometry:$e}):lb($e)}function lb(de){return de.type==="Feature"||de.type==="FeatureCollection"?de:{type:"Feature",properties:{},geometry:de}}var bw={toGeoJSON:function(de){return Cg(this,{type:"Point",coordinates:xw(this.getLatLng(),de)})}};E_.include(bw),nb.include(bw),ib.include(bw),pm.include({toGeoJSON:function(de){var $e=!fm(this._latlngs),yt=sb(this._latlngs,$e?1:0,!1,de);return Cg(this,{type:($e?"Multi":"")+"LineString",coordinates:yt})}}),iy.include({toGeoJSON:function(de){var $e=!fm(this._latlngs),yt=$e&&!fm(this._latlngs[0]),nr=sb(this._latlngs,yt?2:$e?1:0,!0,de);return $e||(nr=[nr]),Cg(this,{type:(yt?"Multi":"")+"Polygon",coordinates:nr})}}),Zv.include({toMultiPoint:function(de){var $e=[];return this.eachLayer(function(yt){$e.push(yt.toGeoJSON(de).geometry.coordinates)}),Cg(this,{type:"MultiPoint",coordinates:$e})},toGeoJSON:function(de){var $e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if($e==="MultiPoint")return this.toMultiPoint(de);var yt=$e==="GeometryCollection",nr=[];return this.eachLayer(function(Ur){if(Ur.toGeoJSON){var $i=Ur.toGeoJSON(de);if(yt)nr.push($i.geometry);else{var ra=lb($i);ra.type==="FeatureCollection"?nr.push.apply(nr,ra.features):nr.push(ra)}}}),yt?Cg(this,{geometries:nr,type:"GeometryCollection"}):{type:"FeatureCollection",features:nr}}});function ww(de,$e){return new Sg(de,$e)}var ub=ww,Ag=K0.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(de,$e,yt){this._url=de,this._bounds=qn($e),Dt(this,yt)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Qu(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Bf(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(de){return this.options.opacity=de,this._image&&this._updateOpacity(),this},setStyle:function(de){return de.opacity&&this.setOpacity(de.opacity),this},bringToFront:function(){return this._map&&Y1(this._image),this},bringToBack:function(){return this._map&&ji(this._image),this},setUrl:function(de){return this._url=de,this._image&&(this._image.src=de),this},setBounds:function(de){return this._bounds=qn(de),this._map&&this._reset(),this},getEvents:function(){var de={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(de.zoomanim=this._animateZoom),de},setZIndex:function(de){return this.options.zIndex=de,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var de=this._url.tagName==="IMG",$e=this._image=de?this._url:jc("img");if(Qu($e,"leaflet-image-layer"),this._zoomAnimated&&Qu($e,"leaflet-zoom-animated"),this.options.className&&Qu($e,this.options.className),$e.onselectstart=it,$e.onmousemove=it,$e.onload=Z(this.fire,this,"load"),$e.onerror=Z(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&($e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),de){this._url=$e.src;return}$e.src=this._url,$e.alt=this.options.alt},_animateZoom:function(de){var $e=this._map.getZoomScale(de.zoom),yt=this._map._latLngBoundsToNewLayerBounds(this._bounds,de.zoom,de.center).min;ku(this._image,yt,$e)},_reset:function(){var de=this._image,$e=new ga(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),yt=$e.getSize();dc(de,$e.min),de.style.width=yt.x+"px",de.style.height=yt.y+"px"},_updateOpacity:function(){hm(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var de=this.options.errorOverlayUrl;de&&this._url!==de&&(this._url=de,this._image.src=de)},getCenter:function(){return this._bounds.getCenter()}}),Mg=function(de,$e,yt){return new Ag(de,$e,yt)},Lm=Ag.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var de=this._url.tagName==="VIDEO",$e=this._image=de?this._url:jc("video");if(Qu($e,"leaflet-image-layer"),this._zoomAnimated&&Qu($e,"leaflet-zoom-animated"),this.options.className&&Qu($e,this.options.className),$e.onselectstart=it,$e.onmousemove=it,$e.onloadeddata=Z(this.fire,this,"load"),de){for(var yt=$e.getElementsByTagName("source"),nr=[],Ur=0;Ur0?nr:[$e.src];return}ni(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call($e.style,"objectFit")&&($e.style.objectFit="fill"),$e.autoplay=!!this.options.autoplay,$e.loop=!!this.options.loop,$e.muted=!!this.options.muted,$e.playsInline=!!this.options.playsInline;for(var $i=0;$iUr?($e.height=Ur+"px",Qu(de,$i)):Qf(de,$i),this._containerWidth=this._container.offsetWidth},_animateZoom:function(de){var $e=this._map._latLngToNewLayerPoint(this._latlng,de.zoom,de.center),yt=this._getAnchor();dc(this._container,$e.add(yt))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var de=this._map,$e=parseInt(S_(this._container,"marginBottom"),10)||0,yt=this._container.offsetHeight+$e,nr=this._containerWidth,Ur=new Di(this._containerLeft,-yt-this._containerBottom);Ur._add(Zc(this._container));var $i=de.layerPointToContainerPoint(Ur),ra=Zn(this.options.autoPanPadding),Ja=Zn(this.options.autoPanPaddingTopLeft||ra),uo=Zn(this.options.autoPanPaddingBottomRight||ra),Mo=de.getSize(),Ys=0,El=0;$i.x+nr+uo.x>Mo.x&&(Ys=$i.x+nr-Mo.x+uo.x),$i.x-Ys-Ja.x<0&&(Ys=$i.x-Ja.x),$i.y+yt+uo.y>Mo.y&&(El=$i.y+yt-Mo.y+uo.y),$i.y-El-Ja.y<0&&(El=$i.y-Ja.y),(Ys||El)&&(this.options.keepInView&&(this._autopanning=!0),de.fire("autopanstart").panBy([Ys,El]))}},_getAnchor:function(){return Zn(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ef=function(de,$e){return new Kv(de,$e)};Rc.mergeOptions({closePopupOnClick:!0}),Rc.include({openPopup:function(de,$e,yt){return this._initOverlay(Kv,de,$e,yt).openOn(this),this},closePopup:function(de){return de=arguments.length?de:this._popup,de&&de.close(),this}}),K0.include({bindPopup:function(de,$e){return this._popup=this._initOverlay(Kv,this._popup,de,$e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(de){return this._popup&&(this instanceof s0||(this._popup._source=this),this._popup._prepareOpen(de||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(de){return this._popup&&this._popup.setContent(de),this},getPopup:function(){return this._popup},_openPopup:function(de){if(!(!this._popup||!this._map)){Uv(de);var $e=de.layer||de.target;if(this._popup._source===$e&&!($e instanceof Xg)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(de.latlng);return}this._popup._source=$e,this.openPopup(de.latlng)}},_movePopup:function(de){this._popup.setLatLng(de.latlng)},_onKeyPress:function(de){de.originalEvent.keyCode===13&&this._openPopup(de)}});var L_=eg.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(de){eg.prototype.onAdd.call(this,de),this.setOpacity(this.options.opacity),de.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(de){eg.prototype.onRemove.call(this,de),de.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var de=eg.prototype.getEvents.call(this);return this.options.permanent||(de.preclick=this.close),de},_initLayout:function(){var de="leaflet-tooltip",$e=de+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=jc("div",$e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+xe(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(de){var $e,yt,nr=this._map,Ur=this._container,$i=nr.latLngToContainerPoint(nr.getCenter()),ra=nr.layerPointToContainerPoint(de),Ja=this.options.direction,uo=Ur.offsetWidth,Mo=Ur.offsetHeight,Ys=Zn(this.options.offset),El=this._getAnchor();Ja==="top"?($e=uo/2,yt=Mo):Ja==="bottom"?($e=uo/2,yt=0):Ja==="center"?($e=uo/2,yt=Mo/2):Ja==="right"?($e=0,yt=Mo/2):Ja==="left"?($e=uo,yt=Mo/2):ra.x<$i.x?(Ja="right",$e=0,yt=Mo/2):(Ja="left",$e=uo+(Ys.x+El.x)*2,yt=Mo/2),de=de.subtract(Zn($e,yt,!0)).add(Ys).add(El),Qf(Ur,"leaflet-tooltip-right"),Qf(Ur,"leaflet-tooltip-left"),Qf(Ur,"leaflet-tooltip-top"),Qf(Ur,"leaflet-tooltip-bottom"),Qu(Ur,"leaflet-tooltip-"+Ja),dc(Ur,de)},_updatePosition:function(){var de=this._map.latLngToLayerPoint(this._latlng);this._setPosition(de)},setOpacity:function(de){this.options.opacity=de,this._container&&hm(this._container,de)},_animateZoom:function(de){var $e=this._map._latLngToNewLayerPoint(this._latlng,de.zoom,de.center);this._setPosition($e)},_getAnchor:function(){return Zn(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),D4=function(de,$e){return new L_(de,$e)};Rc.include({openTooltip:function(de,$e,yt){return this._initOverlay(L_,de,$e,yt).openOn(this),this},closeTooltip:function(de){return de.close(),this}}),K0.include({bindTooltip:function(de,$e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(L_,this._tooltip,de,$e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(de){if(!(!de&&this._tooltipHandlersAdded)){var $e=de?"off":"on",yt={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?yt.add=this._openTooltip:(yt.mouseover=this._openTooltip,yt.mouseout=this.closeTooltip,yt.click=this._openTooltip,this._map?this._addFocusListeners():yt.add=this._addFocusListeners),this._tooltip.options.sticky&&(yt.mousemove=this._moveTooltip),this[$e](yt),this._tooltipHandlersAdded=!de}},openTooltip:function(de){return this._tooltip&&(this instanceof s0||(this._tooltip._source=this),this._tooltip._prepareOpen(de)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(de){return this._tooltip&&this._tooltip.setContent(de),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(de){var $e=typeof de.getElement=="function"&&de.getElement();$e&&(Hu($e,"focus",function(){this._tooltip._source=de,this.openTooltip()},this),Hu($e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(de){var $e=typeof de.getElement=="function"&&de.getElement();$e&&$e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(de){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var $e=this;this._map.once("moveend",function(){$e._openOnceFlag=!1,$e._openTooltip(de)});return}this._tooltip._source=de.layer||de.target,this.openTooltip(this._tooltip.options.sticky?de.latlng:void 0)}},_moveTooltip:function(de){var $e=de.latlng,yt,nr;this._tooltip.options.sticky&&de.originalEvent&&(yt=this._map.mouseEventToContainerPoint(de.originalEvent),nr=this._map.containerPointToLayerPoint(yt),$e=this._map.layerPointToLatLng(nr)),this._tooltip.setLatLng($e)}});var z4=Yg.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(de){var $e=de&&de.tagName==="DIV"?de:document.createElement("div"),yt=this.options;if(yt.html instanceof Element?(Xx($e),$e.appendChild(yt.html)):$e.innerHTML=yt.html!==!1?yt.html:"",yt.bgPos){var nr=Zn(yt.bgPos);$e.style.backgroundPosition=-nr.x+"px "+-nr.y+"px"}return this._setIconStyles($e,"icon"),$e},createShadow:function(){return null}});function vS(de){return new z4(de)}Yg.Default=ty;var P_=K0.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Fl.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(de){Dt(this,de)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(de){de._addZoomLimit(this)},onRemove:function(de){this._removeAllTiles(),Bf(this._container),de._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Y1(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ji(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(de){return this.options.opacity=de,this._updateOpacity(),this},setZIndex:function(de){return this.options.zIndex=de,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var de=this._clampZoom(this._map.getZoom());de!==this._tileZoom&&(this._tileZoom=de,this._updateLevels()),this._update()}return this},getEvents:function(){var de={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=Se(this._onMoveEnd,this.options.updateInterval,this)),de.move=this._onMove),this._zoomAnimated&&(de.zoomanim=this._animateZoom),de},createTile:function(){return document.createElement("div")},getTileSize:function(){var de=this.options.tileSize;return de instanceof Di?de:new Di(de,de)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(de){for(var $e=this.getPane().children,yt=-de(-1/0,1/0),nr=0,Ur=$e.length,$i;nrthis.options.maxZoom||ytnr?this._retainParent(Ur,$i,ra,nr):!1)},_retainChildren:function(de,$e,yt,nr){for(var Ur=2*de;Ur<2*de+2;Ur++)for(var $i=2*$e;$i<2*$e+2;$i++){var ra=new Di(Ur,$i);ra.z=yt+1;var Ja=this._tileCoordsToKey(ra),uo=this._tiles[Ja];if(uo&&uo.active){uo.retain=!0;continue}else uo&&uo.loaded&&(uo.retain=!0);yt+1this.options.maxZoom||this.options.minZoom!==void 0&&Ur1){this._setView(de,yt);return}for(var El=Ur.min.y;El<=Ur.max.y;El++)for(var qu=Ur.min.x;qu<=Ur.max.x;qu++){var Kd=new Di(qu,El);if(Kd.z=this._tileZoom,!!this._isValidTile(Kd)){var ed=this._tiles[this._tileCoordsToKey(Kd)];ed?ed.current=!0:ra.push(Kd)}}if(ra.sort(function(l0,Qg){return l0.distanceTo($i)-Qg.distanceTo($i)}),ra.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var gm=document.createDocumentFragment();for(qu=0;quyt.max.x)||!$e.wrapLat&&(de.yyt.max.y))return!1}if(!this.options.bounds)return!0;var nr=this._tileCoordsToBounds(de);return qn(this.options.bounds).overlaps(nr)},_keyToBounds:function(de){return this._tileCoordsToBounds(this._keyToTileCoords(de))},_tileCoordsToNwSe:function(de){var $e=this._map,yt=this.getTileSize(),nr=de.scaleBy(yt),Ur=nr.add(yt),$i=$e.unproject(nr,de.z),ra=$e.unproject(Ur,de.z);return[$i,ra]},_tileCoordsToBounds:function(de){var $e=this._tileCoordsToNwSe(de),yt=new ro($e[0],$e[1]);return this.options.noWrap||(yt=this._map.wrapLatLngBounds(yt)),yt},_tileCoordsToKey:function(de){return de.x+":"+de.y+":"+de.z},_keyToTileCoords:function(de){var $e=de.split(":"),yt=new Di(+$e[0],+$e[1]);return yt.z=+$e[2],yt},_removeTile:function(de){var $e=this._tiles[de];$e&&(Bf($e.el),delete this._tiles[de],this.fire("tileunload",{tile:$e.el,coords:this._keyToTileCoords(de)}))},_initTile:function(de){Qu(de,"leaflet-tile");var $e=this.getTileSize();de.style.width=$e.x+"px",de.style.height=$e.y+"px",de.onselectstart=it,de.onmousemove=it,Fl.ielt9&&this.options.opacity<1&&hm(de,this.options.opacity)},_addTile:function(de,$e){var yt=this._getTilePos(de),nr=this._tileCoordsToKey(de),Ur=this.createTile(this._wrapCoords(de),Z(this._tileReady,this,de));this._initTile(Ur),this.createTile.length<2&&yi(Z(this._tileReady,this,de,null,Ur)),dc(Ur,yt),this._tiles[nr]={el:Ur,coords:de,current:!0},$e.appendChild(Ur),this.fire("tileloadstart",{tile:Ur,coords:de})},_tileReady:function(de,$e,yt){$e&&this.fire("tileerror",{error:$e,tile:yt,coords:de});var nr=this._tileCoordsToKey(de);yt=this._tiles[nr],yt&&(yt.loaded=+new Date,this._map._fadeAnimated?(hm(yt.el,0),gr(this._fadeFrame),this._fadeFrame=yi(this._updateOpacity,this)):(yt.active=!0,this._pruneTiles()),$e||(Qu(yt.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:yt.el,coords:de})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Fl.ielt9||!this._map._fadeAnimated?yi(this._pruneTiles,this):setTimeout(Z(this._pruneTiles,this),250)))},_getTilePos:function(de){return de.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(de){var $e=new Di(this._wrapX?Ne(de.x,this._wrapX):de.x,this._wrapY?Ne(de.y,this._wrapY):de.y);return $e.z=de.z,$e},_pxBoundsToTileRange:function(de){var $e=this.getTileSize();return new ga(de.min.unscaleBy($e).floor(),de.max.unscaleBy($e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var de in this._tiles)if(!this._tiles[de].loaded)return!1;return!0}});function Tw(de){return new P_(de)}var Y0=P_.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(de,$e){this._url=de,$e=Dt(this,$e),$e.detectRetina&&Fl.retina&&$e.maxZoom>0?($e.tileSize=Math.floor($e.tileSize/2),$e.zoomReverse?($e.zoomOffset--,$e.minZoom=Math.min($e.maxZoom,$e.minZoom+1)):($e.zoomOffset++,$e.maxZoom=Math.max($e.minZoom,$e.maxZoom-1)),$e.minZoom=Math.max(0,$e.minZoom)):$e.zoomReverse?$e.minZoom=Math.min($e.maxZoom,$e.minZoom):$e.maxZoom=Math.max($e.minZoom,$e.maxZoom),typeof $e.subdomains=="string"&&($e.subdomains=$e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(de,$e){return this._url===de&&$e===void 0&&($e=!0),this._url=de,$e||this.redraw(),this},createTile:function(de,$e){var yt=document.createElement("img");return Hu(yt,"load",Z(this._tileOnLoad,this,$e,yt)),Hu(yt,"error",Z(this._tileOnError,this,$e,yt)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(yt.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(yt.referrerPolicy=this.options.referrerPolicy),yt.alt="",yt.src=this.getTileUrl(de),yt},getTileUrl:function(de){var $e={r:Fl.retina?"@2x":"",s:this._getSubdomain(de),x:de.x,y:de.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var yt=this._globalTileRange.max.y-de.y;this.options.tms&&($e.y=yt),$e["-y"]=yt}return ze(this._url,S($e,this.options))},_tileOnLoad:function(de,$e){Fl.ielt9?setTimeout(Z(de,this,null,$e),0):de(null,$e)},_tileOnError:function(de,$e,yt){var nr=this.options.errorTileUrl;nr&&$e.getAttribute("src")!==nr&&($e.src=nr),de(yt,$e)},_onTileRemove:function(de){de.tile.onload=null},_getZoomForUrl:function(){var de=this._tileZoom,$e=this.options.maxZoom,yt=this.options.zoomReverse,nr=this.options.zoomOffset;return yt&&(de=$e-de),de+nr},_getSubdomain:function(de){var $e=Math.abs(de.x+de.y)%this.options.subdomains.length;return this.options.subdomains[$e]},_abortLoading:function(){var de,$e;for(de in this._tiles)if(this._tiles[de].coords.z!==this._tileZoom&&($e=this._tiles[de].el,$e.onload=it,$e.onerror=it,!$e.complete)){$e.src=Cr;var yt=this._tiles[de].coords;Bf($e),delete this._tiles[de],this.fire("tileabort",{tile:$e,coords:yt})}},_removeTile:function(de){var $e=this._tiles[de];if($e)return $e.el.setAttribute("src",Cr),P_.prototype._removeTile.call(this,de)},_tileReady:function(de,$e,yt){if(!(!this._map||yt&&yt.getAttribute("src")===Cr))return P_.prototype._tileReady.call(this,de,$e,yt)}});function cb(de,$e){return new Y0(de,$e)}var hb=Y0.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(de,$e){this._url=de;var yt=S({},this.defaultWmsParams);for(var nr in $e)nr in this.options||(yt[nr]=$e[nr]);$e=Dt(this,$e);var Ur=$e.detectRetina&&Fl.retina?2:1,$i=this.getTileSize();yt.width=$i.x*Ur,yt.height=$i.y*Ur,this.wmsParams=yt},onAdd:function(de){this._crs=this.options.crs||de.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var $e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[$e]=this._crs.code,Y0.prototype.onAdd.call(this,de)},getTileUrl:function(de){var $e=this._tileCoordsToNwSe(de),yt=this._crs,nr=ya(yt.project($e[0]),yt.project($e[1])),Ur=nr.min,$i=nr.max,ra=(this._wmsVersion>=1.3&&this._crs===tb?[Ur.y,Ur.x,$i.y,$i.x]:[Ur.x,Ur.y,$i.x,$i.y]).join(","),Ja=Y0.prototype.getTileUrl.call(this,de);return Ja+Zt(this.wmsParams,Ja,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ra},setParams:function(de,$e){return S(this.wmsParams,de),$e||this.redraw(),this}});function O4(de,$e){return new hb(de,$e)}Y0.WMS=hb,cb.wms=O4;var Eg=K0.extend({options:{padding:.1},initialize:function(de){Dt(this,de),xe(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Qu(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var de={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(de.zoomanim=this._onAnimZoom),de},_onAnimZoom:function(de){this._updateTransform(de.center,de.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(de,$e){var yt=this._map.getZoomScale($e,this._zoom),nr=this._map.getSize().multiplyBy(.5+this.options.padding),Ur=this._map.project(this._center,$e),$i=nr.multiplyBy(-yt).add(Ur).subtract(this._map._getNewPixelOrigin(de,$e));Fl.any3d?ku(this._container,$i,yt):dc(this._container,$i)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var de in this._layers)this._layers[de]._reset()},_onZoomEnd:function(){for(var de in this._layers)this._layers[de]._project()},_updatePaths:function(){for(var de in this._layers)this._layers[de]._update()},_update:function(){var de=this.options.padding,$e=this._map.getSize(),yt=this._map.containerPointToLayerPoint($e.multiplyBy(-de)).round();this._bounds=new ga(yt,yt.add($e.multiplyBy(1+de*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),B4=Eg.extend({options:{tolerance:0},getEvents:function(){var de=Eg.prototype.getEvents.call(this);return de.viewprereset=this._onViewPreReset,de},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Eg.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var de=this._container=document.createElement("canvas");Hu(de,"mousemove",this._onMouseMove,this),Hu(de,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Hu(de,"mouseout",this._handleMouseOut,this),de._leaflet_disable_events=!0,this._ctx=de.getContext("2d")},_destroyContainer:function(){gr(this._redrawRequest),delete this._ctx,Bf(this._container),Yh(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var de;this._redrawBounds=null;for(var $e in this._layers)de=this._layers[$e],de._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Eg.prototype._update.call(this);var de=this._bounds,$e=this._container,yt=de.getSize(),nr=Fl.retina?2:1;dc($e,de.min),$e.width=nr*yt.x,$e.height=nr*yt.y,$e.style.width=yt.x+"px",$e.style.height=yt.y+"px",Fl.retina&&this._ctx.scale(2,2),this._ctx.translate(-de.min.x,-de.min.y),this.fire("update")}},_reset:function(){Eg.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(de){this._updateDashArray(de),this._layers[xe(de)]=de;var $e=de._order={layer:de,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=$e),this._drawLast=$e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(de){this._requestRedraw(de)},_removePath:function(de){var $e=de._order,yt=$e.next,nr=$e.prev;yt?yt.prev=nr:this._drawLast=nr,nr?nr.next=yt:this._drawFirst=yt,delete de._order,delete this._layers[xe(de)],this._requestRedraw(de)},_updatePath:function(de){this._extendRedrawBounds(de),de._project(),de._update(),this._requestRedraw(de)},_updateStyle:function(de){this._updateDashArray(de),this._requestRedraw(de)},_updateDashArray:function(de){if(typeof de.options.dashArray=="string"){var $e=de.options.dashArray.split(/[, ]+/),yt=[],nr,Ur;for(Ur=0;Ur<$e.length;Ur++){if(nr=Number($e[Ur]),isNaN(nr))return;yt.push(nr)}de.options._dashArray=yt}else de.options._dashArray=de.options.dashArray},_requestRedraw:function(de){this._map&&(this._extendRedrawBounds(de),this._redrawRequest=this._redrawRequest||yi(this._redraw,this))},_extendRedrawBounds:function(de){if(de._pxBounds){var $e=(de.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ga,this._redrawBounds.extend(de._pxBounds.min.subtract([$e,$e])),this._redrawBounds.extend(de._pxBounds.max.add([$e,$e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var de=this._redrawBounds;if(de){var $e=de.getSize();this._ctx.clearRect(de.min.x,de.min.y,$e.x,$e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var de,$e=this._redrawBounds;if(this._ctx.save(),$e){var yt=$e.getSize();this._ctx.beginPath(),this._ctx.rect($e.min.x,$e.min.y,yt.x,yt.y),this._ctx.clip()}this._drawing=!0;for(var nr=this._drawFirst;nr;nr=nr.next)de=nr.layer,(!$e||de._pxBounds&&de._pxBounds.intersects($e))&&de._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(de,$e){if(this._drawing){var yt,nr,Ur,$i,ra=de._parts,Ja=ra.length,uo=this._ctx;if(Ja){for(uo.beginPath(),yt=0;yt')}}catch{}return function(de){return document.createElement("<"+de+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),yS={_initContainer:function(){this._container=jc("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Eg.prototype._update.call(this),this.fire("update"))},_initPath:function(de){var $e=de._container=I_("shape");Qu($e,"leaflet-vml-shape "+(this.options.className||"")),$e.coordsize="1 1",de._path=I_("path"),$e.appendChild(de._path),this._updateStyle(de),this._layers[xe(de)]=de},_addPath:function(de){var $e=de._container;this._container.appendChild($e),de.options.interactive&&de.addInteractiveTarget($e)},_removePath:function(de){var $e=de._container;Bf($e),de.removeInteractiveTarget($e),delete this._layers[xe(de)]},_updateStyle:function(de){var $e=de._stroke,yt=de._fill,nr=de.options,Ur=de._container;Ur.stroked=!!nr.stroke,Ur.filled=!!nr.fill,nr.stroke?($e||($e=de._stroke=I_("stroke")),Ur.appendChild($e),$e.weight=nr.weight+"px",$e.color=nr.color,$e.opacity=nr.opacity,nr.dashArray?$e.dashStyle=ni(nr.dashArray)?nr.dashArray.join(" "):nr.dashArray.replace(/( *, *)/g," "):$e.dashStyle="",$e.endcap=nr.lineCap.replace("butt","flat"),$e.joinstyle=nr.lineJoin):$e&&(Ur.removeChild($e),de._stroke=null),nr.fill?(yt||(yt=de._fill=I_("fill")),Ur.appendChild(yt),yt.color=nr.fillColor||nr.color,yt.opacity=nr.fillOpacity):yt&&(Ur.removeChild(yt),de._fill=null)},_updateCircle:function(de){var $e=de._point.round(),yt=Math.round(de._radius),nr=Math.round(de._radiusY||yt);this._setPath(de,de._empty()?"M0 0":"AL "+$e.x+","+$e.y+" "+yt+","+nr+" 0,"+65535*360)},_setPath:function(de,$e){de._path.v=$e},_bringToFront:function(de){Y1(de._container)},_bringToBack:function(de){ji(de._container)}},Jg=Fl.vml?I_:so,S0=Eg.extend({_initContainer:function(){this._container=Jg("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jg("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Bf(this._container),Yh(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Eg.prototype._update.call(this);var de=this._bounds,$e=de.getSize(),yt=this._container;(!this._svgSize||!this._svgSize.equals($e))&&(this._svgSize=$e,yt.setAttribute("width",$e.x),yt.setAttribute("height",$e.y)),dc(yt,de.min),yt.setAttribute("viewBox",[de.min.x,de.min.y,$e.x,$e.y].join(" ")),this.fire("update")}},_initPath:function(de){var $e=de._path=Jg("path");de.options.className&&Qu($e,de.options.className),de.options.interactive&&Qu($e,"leaflet-interactive"),this._updateStyle(de),this._layers[xe(de)]=de},_addPath:function(de){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(de._path),de.addInteractiveTarget(de._path)},_removePath:function(de){Bf(de._path),de.removeInteractiveTarget(de._path),delete this._layers[xe(de)]},_updatePath:function(de){de._project(),de._update()},_updateStyle:function(de){var $e=de._path,yt=de.options;$e&&(yt.stroke?($e.setAttribute("stroke",yt.color),$e.setAttribute("stroke-opacity",yt.opacity),$e.setAttribute("stroke-width",yt.weight),$e.setAttribute("stroke-linecap",yt.lineCap),$e.setAttribute("stroke-linejoin",yt.lineJoin),yt.dashArray?$e.setAttribute("stroke-dasharray",yt.dashArray):$e.removeAttribute("stroke-dasharray"),yt.dashOffset?$e.setAttribute("stroke-dashoffset",yt.dashOffset):$e.removeAttribute("stroke-dashoffset")):$e.setAttribute("stroke","none"),yt.fill?($e.setAttribute("fill",yt.fillColor||yt.color),$e.setAttribute("fill-opacity",yt.fillOpacity),$e.setAttribute("fill-rule",yt.fillRule||"evenodd")):$e.setAttribute("fill","none"))},_updatePoly:function(de,$e){this._setPath(de,go(de._parts,$e))},_updateCircle:function(de){var $e=de._point,yt=Math.max(Math.round(de._radius),1),nr=Math.max(Math.round(de._radiusY),1)||yt,Ur="a"+yt+","+nr+" 0 1,0 ",$i=de._empty()?"M0 0":"M"+($e.x-yt)+","+$e.y+Ur+yt*2+",0 "+Ur+-yt*2+",0 ";this._setPath(de,$i)},_setPath:function(de,$e){de._path.setAttribute("d",$e)},_bringToFront:function(de){Y1(de._path)},_bringToBack:function(de){ji(de._path)}});Fl.vml&&S0.include(yS);function R4(de){return Fl.svg||Fl.vml?new S0(de):null}Rc.include({getRenderer:function(de){var $e=de.options.renderer||this._getPaneRenderer(de.options.pane)||this.options.renderer||this._renderer;return $e||($e=this._renderer=this._createRenderer()),this.hasLayer($e)||this.addLayer($e),$e},_getPaneRenderer:function(de){if(de==="overlayPane"||de===void 0)return!1;var $e=this._paneRenderers[de];return $e===void 0&&($e=this._createRenderer({pane:de}),this._paneRenderers[de]=$e),$e},_createRenderer:function(de){return this.options.preferCanvas&&Sw(de)||R4(de)}});var X0=iy.extend({initialize:function(de,$e){iy.prototype.initialize.call(this,this._boundsToLatLngs(de),$e)},setBounds:function(de){return this.setLatLngs(this._boundsToLatLngs(de))},_boundsToLatLngs:function(de){return de=qn(de),[de.getSouthWest(),de.getNorthWest(),de.getNorthEast(),de.getSouthEast()]}});function Pm(de,$e){return new X0(de,$e)}S0.create=Jg,S0.pointsToPath=go,Sg.geometryToLayer=ab,Sg.coordsToLatLng=_w,Sg.coordsToLatLngs=ob,Sg.latLngToCoords=xw,Sg.latLngsToCoords=sb,Sg.getFeature=Cg,Sg.asFeature=lb,Rc.mergeOptions({boxZoom:!0});var ny=Qm.extend({initialize:function(de){this._map=de,this._container=de._container,this._pane=de._panes.overlayPane,this._resetStateTimeout=0,de.on("unload",this._destroy,this)},addHooks:function(){Hu(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Yh(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Bf(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(de){if(!de.shiftKey||de.which!==1&&de.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Am(),sh(),this._startPoint=this._map.mouseEventToContainerPoint(de),Hu(document,{contextmenu:Uv,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(de){this._moved||(this._moved=!0,this._box=jc("div","leaflet-zoom-box",this._container),Qu(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(de);var $e=new ga(this._point,this._startPoint),yt=$e.getSize();dc(this._box,$e.min),this._box.style.width=yt.x+"px",this._box.style.height=yt.y+"px"},_finish:function(){this._moved&&(Bf(this._box),Qf(this._container,"leaflet-crosshair")),Fv(),k0(),Yh(document,{contextmenu:Uv,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(de){if(!(de.which!==1&&de.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(Z(this._resetState,this),0);var $e=new ro(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds($e).fire("boxzoomend",{boxZoomBounds:$e})}},_onKeyDown:function(de){de.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Rc.addInitHook("addHandler","boxZoom",ny),Rc.mergeOptions({doubleClickZoom:!0});var mm=Qm.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(de){var $e=this._map,yt=$e.getZoom(),nr=$e.options.zoomDelta,Ur=de.originalEvent.shiftKey?yt-nr:yt+nr;$e.options.doubleClickZoom==="center"?$e.setZoom(Ur):$e.setZoomAround(de.containerPoint,Ur)}});Rc.addInitHook("addHandler","doubleClickZoom",mm),Rc.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Im=Qm.extend({addHooks:function(){if(!this._draggable){var de=this._map;this._draggable=new Kg(de._mapPane,de._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),de.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),de.on("zoomend",this._onZoomEnd,this),de.whenReady(this._onZoomEnd,this))}Qu(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Qf(this._map._container,"leaflet-grab"),Qf(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var de=this._map;if(de._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var $e=qn(this._map.options.maxBounds);this._offsetLimit=ya(this._map.latLngToContainerPoint($e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint($e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;de.fire("movestart").fire("dragstart"),de.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(de){if(this._map.options.inertia){var $e=this._lastTime=+new Date,yt=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(yt),this._times.push($e),this._prunePositions($e)}this._map.fire("move",de).fire("drag",de)},_prunePositions:function(de){for(;this._positions.length>1&&de-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var de=this._map.getSize().divideBy(2),$e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=$e.subtract(de).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(de,$e){return de-(de-$e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var de=this._draggable._newPos.subtract(this._draggable._startPos),$e=this._offsetLimit;de.x<$e.min.x&&(de.x=this._viscousLimit(de.x,$e.min.x)),de.y<$e.min.y&&(de.y=this._viscousLimit(de.y,$e.min.y)),de.x>$e.max.x&&(de.x=this._viscousLimit(de.x,$e.max.x)),de.y>$e.max.y&&(de.y=this._viscousLimit(de.y,$e.max.y)),this._draggable._newPos=this._draggable._startPos.add(de)}},_onPreDragWrap:function(){var de=this._worldWidth,$e=Math.round(de/2),yt=this._initialWorldOffset,nr=this._draggable._newPos.x,Ur=(nr-$e+yt)%de+$e-yt,$i=(nr+$e+yt)%de-$e-yt,ra=Math.abs(Ur+yt)0?$i:-$i))-$e;this._delta=0,this._startTime=null,ra&&(de.options.scrollWheelZoom==="center"?de.setZoom($e+ra):de.setZoomAround(this._lastMousePos,$e+ra))}});Rc.addInitHook("addHandler","scrollWheelZoom",Yv);var N4=600;Rc.mergeOptions({tapHold:Fl.touchNative&&Fl.safari&&Fl.mobile,tapTolerance:15});var j4=Qm.extend({addHooks:function(){Hu(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Yh(this._map._container,"touchstart",this._onDown,this)},_onDown:function(de){if(clearTimeout(this._holdTimeout),de.touches.length===1){var $e=de.touches[0];this._startPos=this._newPos=new Di($e.clientX,$e.clientY),this._holdTimeout=setTimeout(Z(function(){this._cancel(),this._isTapValid()&&(Hu(document,"touchend",Cc),Hu(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",$e))},this),N4),Hu(document,"touchend touchcancel contextmenu",this._cancel,this),Hu(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function de(){Yh(document,"touchend",Cc),Yh(document,"touchend touchcancel",de)},_cancel:function(){clearTimeout(this._holdTimeout),Yh(document,"touchend touchcancel contextmenu",this._cancel,this),Yh(document,"touchmove",this._onMove,this)},_onMove:function(de){var $e=de.touches[0];this._newPos=new Di($e.clientX,$e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(de,$e){var yt=new MouseEvent(de,{bubbles:!0,cancelable:!0,view:window,screenX:$e.screenX,screenY:$e.screenY,clientX:$e.clientX,clientY:$e.clientY});yt._simulated=!0,$e.target.dispatchEvent(yt)}});Rc.addInitHook("addHandler","tapHold",j4),Rc.mergeOptions({touchZoom:Fl.touch,bounceAtZoomLimits:!0});var Dm=Qm.extend({addHooks:function(){Qu(this._map._container,"leaflet-touch-zoom"),Hu(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Qf(this._map._container,"leaflet-touch-zoom"),Yh(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(de){var $e=this._map;if(!(!de.touches||de.touches.length!==2||$e._animatingZoom||this._zooming)){var yt=$e.mouseEventToContainerPoint(de.touches[0]),nr=$e.mouseEventToContainerPoint(de.touches[1]);this._centerPoint=$e.getSize()._divideBy(2),this._startLatLng=$e.containerPointToLatLng(this._centerPoint),$e.options.touchZoom!=="center"&&(this._pinchStartLatLng=$e.containerPointToLatLng(yt.add(nr)._divideBy(2))),this._startDist=yt.distanceTo(nr),this._startZoom=$e.getZoom(),this._moved=!1,this._zooming=!0,$e._stop(),Hu(document,"touchmove",this._onTouchMove,this),Hu(document,"touchend touchcancel",this._onTouchEnd,this),Cc(de)}},_onTouchMove:function(de){if(!(!de.touches||de.touches.length!==2||!this._zooming)){var $e=this._map,yt=$e.mouseEventToContainerPoint(de.touches[0]),nr=$e.mouseEventToContainerPoint(de.touches[1]),Ur=yt.distanceTo(nr)/this._startDist;if(this._zoom=$e.getScaleZoom(Ur,this._startZoom),!$e.options.bounceAtZoomLimits&&(this._zoom<$e.getMinZoom()&&Ur<1||this._zoom>$e.getMaxZoom()&&Ur>1)&&(this._zoom=$e._limitZoom(this._zoom)),$e.options.touchZoom==="center"){if(this._center=this._startLatLng,Ur===1)return}else{var $i=yt._add(nr)._divideBy(2)._subtract(this._centerPoint);if(Ur===1&&$i.x===0&&$i.y===0)return;this._center=$e.unproject($e.project(this._pinchStartLatLng,this._zoom).subtract($i),this._zoom)}this._moved||($e._moveStart(!0,!1),this._moved=!0),gr(this._animRequest);var ra=Z($e._move,$e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=yi(ra,this,!0),Cc(de)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,gr(this._animRequest),Yh(document,"touchmove",this._onTouchMove,this),Yh(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Rc.addInitHook("addHandler","touchZoom",Dm),Rc.BoxZoom=ny,Rc.DoubleClickZoom=mm,Rc.Drag=Im,Rc.Keyboard=F4,Rc.ScrollWheelZoom=Yv,Rc.TapHold=j4,Rc.TouchZoom=Dm,r.Bounds=ga,r.Browser=Fl,r.CRS=On,r.Canvas=B4,r.Circle=nb,r.CircleMarker=ib,r.Class=Sr,r.Control=Np,r.DivIcon=z4,r.DivOverlay=eg,r.DomEvent=T0,r.DomUtil=Oc,r.Draggable=Kg,r.Evented=ti,r.FeatureGroup=s0,r.GeoJSON=Sg,r.GridLayer=P_,r.Handler=Qm,r.Icon=Yg,r.ImageOverlay=Ag,r.LatLng=ln,r.LatLngBounds=ro,r.Layer=K0,r.LayerGroup=Zv,r.LineUtil=hf,r.Map=Rc,r.Marker=E_,r.Mixin=jp,r.Path=Xg,r.Point=Di,r.PolyUtil=hS,r.Polygon=iy,r.Polyline=pm,r.Popup=Kv,r.PosAnimation=M_,r.Projection=mw,r.Rectangle=X0,r.Renderer=Eg,r.SVG=S0,r.SVGOverlay=kw,r.TileLayer=Y0,r.Tooltip=L_,r.Transformation=xa,r.Util=fr,r.VideoOverlay=Lm,r.bind=Z,r.bounds=ya,r.canvas=Sw,r.circle=ry,r.circleMarker=L4,r.control=Z0,r.divIcon=vS,r.extend=S,r.featureGroup=E4,r.geoJSON=ww,r.geoJson=ub,r.gridLayer=Tw,r.icon=vw,r.imageOverlay=Mg,r.latLng=nn,r.latLngBounds=qn,r.layerGroup=rb,r.map=Zs,r.marker=pS,r.point=Zn,r.polygon=mS,r.polyline=P4,r.popup=Ef,r.rectangle=Pm,r.setOptions=Dt,r.stamp=xe,r.svg=R4,r.svgOverlay=gS,r.tileLayer=cb,r.tooltip=D4,r.transformation=$r,r.version=c,r.videoOverlay=ff;var zm=window.L;r.noConflict=function(){return window.L=zm,this},window.L=r})}(r5,r5.exports)),r5.exports}var lpe=spe();const cg=a$(lpe),NB=Object.freeze(Object.defineProperty({__proto__:null,default:cg},Symbol.toStringTag,{value:"Module"})),jB=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],M7=1,z3=8;class zE{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,c]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");const S=c>>4;if(S!==M7)throw new Error(`Got v${S} data when expected v${M7}.`);const $=jB[c&15];if(!$)throw new Error("Unrecognized array type.");const[Z]=new Uint16Array(e,2,1),[ue]=new Uint32Array(e,4,1);return new zE(ue,Z,$,e)}constructor(e,r=64,c=Float64Array,S){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=c,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const $=jB.indexOf(this.ArrayType),Z=e*2*this.ArrayType.BYTES_PER_ELEMENT,ue=e*this.IndexArrayType.BYTES_PER_ELEMENT,xe=(8-ue%8)%8;if($<0)throw new Error(`Unexpected typed array class: ${c}.`);S&&S instanceof ArrayBuffer?(this.data=S,this.ids=new this.IndexArrayType(this.data,z3,e),this.coords=new this.ArrayType(this.data,z3+ue+xe,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(z3+Z+ue+xe),this.ids=new this.IndexArrayType(this.data,z3,e),this.coords=new this.ArrayType(this.data,z3+ue+xe,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(M7<<4)+$]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){const c=this._pos>>1;return this.ids[c]=c,this.coords[this._pos++]=e,this.coords[this._pos++]=r,c}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return XM(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,c,S){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:$,coords:Z,nodeSize:ue}=this,xe=[0,$.length-1,0],Se=[];for(;xe.length;){const Ne=xe.pop()||0,it=xe.pop()||0,pt=xe.pop()||0;if(it-pt<=ue){for(let Zt=pt;Zt<=it;Zt++){const Mr=Z[2*Zt],ze=Z[2*Zt+1];Mr>=e&&Mr<=c&&ze>=r&&ze<=S&&Se.push($[Zt])}continue}const bt=pt+it>>1,wt=Z[2*bt],Dt=Z[2*bt+1];wt>=e&&wt<=c&&Dt>=r&&Dt<=S&&Se.push($[bt]),(Ne===0?e<=wt:r<=Dt)&&(xe.push(pt),xe.push(bt-1),xe.push(1-Ne)),(Ne===0?c>=wt:S>=Dt)&&(xe.push(bt+1),xe.push(it),xe.push(1-Ne))}return Se}within(e,r,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:S,coords:$,nodeSize:Z}=this,ue=[0,S.length-1,0],xe=[],Se=c*c;for(;ue.length;){const Ne=ue.pop()||0,it=ue.pop()||0,pt=ue.pop()||0;if(it-pt<=Z){for(let Zt=pt;Zt<=it;Zt++)UB($[2*Zt],$[2*Zt+1],e,r)<=Se&&xe.push(S[Zt]);continue}const bt=pt+it>>1,wt=$[2*bt],Dt=$[2*bt+1];UB(wt,Dt,e,r)<=Se&&xe.push(S[bt]),(Ne===0?e-c<=wt:r-c<=Dt)&&(ue.push(pt),ue.push(bt-1),ue.push(1-Ne)),(Ne===0?e+c>=wt:r+c>=Dt)&&(ue.push(bt+1),ue.push(it),ue.push(1-Ne))}return xe}}function XM(t,e,r,c,S,$){if(S-c<=r)return;const Z=c+S>>1;o$(t,e,Z,c,S,$),XM(t,e,r,c,Z-1,1-$),XM(t,e,r,Z+1,S,1-$)}function o$(t,e,r,c,S,$){for(;S>c;){if(S-c>600){const Se=S-c+1,Ne=r-c+1,it=Math.log(Se),pt=.5*Math.exp(2*it/3),bt=.5*Math.sqrt(it*pt*(Se-pt)/Se)*(Ne-Se/2<0?-1:1),wt=Math.max(c,Math.floor(r-Ne*pt/Se+bt)),Dt=Math.min(S,Math.floor(r+(Se-Ne)*pt/Se+bt));o$(t,e,r,wt,Dt,$)}const Z=e[2*r+$];let ue=c,xe=S;for(O3(t,e,c,r),e[2*S+$]>Z&&O3(t,e,c,S);ueZ;)xe--}e[2*c+$]===Z?O3(t,e,c,xe):(xe++,O3(t,e,xe,S)),xe<=r&&(c=xe+1),r<=xe&&(S=xe-1)}}function O3(t,e,r,c){E7(t,r,c),E7(e,2*r,2*c),E7(e,2*r+1,2*c+1)}function E7(t,e,r){const c=t[e];t[e]=t[r],t[r]=c}function UB(t,e,r,c){const S=t-r,$=e-c;return S*S+$*$}const upe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},$B=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),cx=2,r_=3,L7=4,Zy=5,s$=6;class cpe{constructor(e){this.options=Object.assign(Object.create(upe),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:r,minZoom:c,maxZoom:S}=this.options;r&&console.time("total time");const $=`prepare ${e.length} points`;r&&console.time($),this.points=e;const Z=[];for(let xe=0;xe=c;xe--){const Se=+Date.now();ue=this.trees[xe]=this._createTree(this._cluster(ue,xe)),r&&console.log("z%d: %d clusters in %dms",xe,ue.numItems,+Date.now()-Se)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let c=((e[0]+180)%360+360)%360-180;const S=Math.max(-90,Math.min(90,e[1]));let $=e[2]===180?180:((e[2]+180)%360+360)%360-180;const Z=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)c=-180,$=180;else if(c>$){const it=this.getClusters([c,S,180,Z],r),pt=this.getClusters([-180,S,$,Z],r);return it.concat(pt)}const ue=this.trees[this._limitZoom(r)],xe=ue.range(Ok(c),Bk(Z),Ok($),Bk(S)),Se=ue.data,Ne=[];for(const it of xe){const pt=this.stride*it;Ne.push(Se[pt+Zy]>1?HB(Se,pt,this.clusterProps):this.points[Se[pt+r_]])}return Ne}getChildren(e){const r=this._getOriginId(e),c=this._getOriginZoom(e),S="No cluster with the specified id.",$=this.trees[c];if(!$)throw new Error(S);const Z=$.data;if(r*this.stride>=Z.length)throw new Error(S);const ue=this.options.radius/(this.options.extent*Math.pow(2,c-1)),xe=Z[r*this.stride],Se=Z[r*this.stride+1],Ne=$.within(xe,Se,ue),it=[];for(const pt of Ne){const bt=pt*this.stride;Z[bt+L7]===e&&it.push(Z[bt+Zy]>1?HB(Z,bt,this.clusterProps):this.points[Z[bt+r_]])}if(it.length===0)throw new Error(S);return it}getLeaves(e,r,c){r=r||10,c=c||0;const S=[];return this._appendLeaves(S,e,r,c,0),S}getTile(e,r,c){const S=this.trees[this._limitZoom(e)],$=Math.pow(2,e),{extent:Z,radius:ue}=this.options,xe=ue/Z,Se=(c-xe)/$,Ne=(c+1+xe)/$,it={features:[]};return this._addTileFeatures(S.range((r-xe)/$,Se,(r+1+xe)/$,Ne),S.data,r,c,$,it),r===0&&this._addTileFeatures(S.range(1-xe/$,Se,1,Ne),S.data,$,c,$,it),r===$-1&&this._addTileFeatures(S.range(0,Se,xe/$,Ne),S.data,-1,c,$,it),it.features.length?it:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){const c=this.getChildren(e);if(r++,c.length!==1)break;e=c[0].properties.cluster_id}return r}_appendLeaves(e,r,c,S,$){const Z=this.getChildren(r);for(const ue of Z){const xe=ue.properties;if(xe&&xe.cluster?$+xe.point_count<=S?$+=xe.point_count:$=this._appendLeaves(e,xe.cluster_id,c,S,$):$1;let Ne,it,pt;if(Se)Ne=l$(r,xe,this.clusterProps),it=r[xe],pt=r[xe+1];else{const Dt=this.points[r[xe+r_]];Ne=Dt.properties;const[Zt,Mr]=Dt.geometry.coordinates;it=Ok(Zt),pt=Bk(Mr)}const bt={type:1,geometry:[[Math.round(this.options.extent*(it*$-c)),Math.round(this.options.extent*(pt*$-S))]],tags:Ne};let wt;Se||this.options.generateId?wt=r[xe+r_]:wt=this.points[r[xe+r_]].id,wt!==void 0&&(bt.id=wt),Z.features.push(bt)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){const{radius:c,extent:S,reduce:$,minPoints:Z}=this.options,ue=c/(S*Math.pow(2,r)),xe=e.data,Se=[],Ne=this.stride;for(let it=0;itr&&(Zt+=xe[ze+Zy])}if(Zt>Dt&&Zt>=Z){let Mr=pt*Dt,ze=bt*Dt,ni,or=-1;const Cr=((it/Ne|0)<<5)+(r+1)+this.points.length;for(const gi of wt){const Si=gi*Ne;if(xe[Si+cx]<=r)continue;xe[Si+cx]=r;const Ci=xe[Si+Zy];Mr+=xe[Si]*Ci,ze+=xe[Si+1]*Ci,xe[Si+L7]=Cr,$&&(ni||(ni=this._map(xe,it,!0),or=this.clusterProps.length,this.clusterProps.push(ni)),$(ni,this._map(xe,Si)))}xe[it+L7]=Cr,Se.push(Mr/Zt,ze/Zt,1/0,Cr,-1,Zt),$&&Se.push(or)}else{for(let Mr=0;Mr1)for(const Mr of wt){const ze=Mr*Ne;if(!(xe[ze+cx]<=r)){xe[ze+cx]=r;for(let ni=0;ni>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,c){if(e[r+Zy]>1){const Z=this.clusterProps[e[r+s$]];return c?Object.assign({},Z):Z}const S=this.points[e[r+r_]].properties,$=this.options.map(S);return c&&$===S?Object.assign({},$):$}}function HB(t,e,r){return{type:"Feature",id:t[e+r_],properties:l$(t,e,r),geometry:{type:"Point",coordinates:[hpe(t[e]),fpe(t[e+1])]}}}function l$(t,e,r){const c=t[e+Zy],S=c>=1e4?`${Math.round(c/1e3)}k`:c>=1e3?`${Math.round(c/100)/10}k`:c,$=t[e+s$],Z=$===-1?{}:Object.assign({},r[$]);return Object.assign(Z,{cluster:!0,cluster_id:t[e+r_],point_count:c,point_count_abbreviated:S})}function Ok(t){return t/360+.5}function Bk(t){const e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function hpe(t){return(t-.5)*360}function fpe(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}const dpe={class:"map-container"},ppe={key:0,class:"flex items-center justify-center h-96 bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px]"},mpe={class:"hidden sm:inline"},gpe={key:3,class:"map-legend"},vpe={class:"legend-footer"},ype={key:4,class:"map-attribution"},_pe=Bu({__name:"NetworkMap",props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:["update:showLegend"],setup(t,{expose:e,emit:r}){typeof window<"u"&&!window.chrome&&(window.chrome={runtime:{}});const c=t,S=r,$=()=>{S("update:showLegend",!c.showLegend)},Z=fn();let ue=null;const xe=fn(new Map);let Se=null;const Ne=fn(new Map),it=fn([]),pt=fn(!0),bt=fn(60),wt=fn(14),Dt=Io(()=>c.baseLatitude!==null&&c.baseLongitude!==null&&typeof c.baseLatitude=="number"&&typeof c.baseLongitude=="number"&&c.baseLatitude!==0&&c.baseLongitude!==0&&Math.abs(c.baseLatitude)<=90&&Math.abs(c.baseLongitude)<=180),Zt=yi=>new Date(yi*1e3).toLocaleString(),Mr=yi=>yi?`${yi} dBm`:"N/A",ze=yi=>yi?`${yi} dB`:"N/A",ni=yi=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[yi||0]||"Unknown",or=(yi,gr,fr,Sr)=>{const Jr=(fr-yi)*Math.PI/180,ti=(Sr-gr)*Math.PI/180,Di=Math.sin(Jr/2)*Math.sin(Jr/2)+Math.cos(yi*Math.PI/180)*Math.cos(fr*Math.PI/180)*Math.sin(ti/2)*Math.sin(ti/2);return 6371*(2*Math.atan2(Math.sqrt(Di),Math.sqrt(1-Di)))},Cr=()=>{ue&&(it.value.forEach(yi=>{ue&&yi.remove()}),it.value.length=0,ue.remove(),ue=null),xe.value.clear(),Ne.value.clear(),Se=null},gi=yi=>{const gr=new Map;return yi.filter(fr=>fr.latitude!==null&&fr.longitude!==null).map(fr=>{let Sr=fr.latitude,ei=fr.longitude;const Jr=`${Sr.toFixed(6)}_${ei.toFixed(6)}`,ti=gr.get(Jr)||0;if(gr.set(Jr,ti+1),ti>0){const En=ti*60*(Math.PI/180);Sr+=Math.sin(En)*.001*(ti*.5),ei+=Math.cos(En)*.001*(ti*.5)}return{type:"Feature",properties:{advert:{...fr,jittered_latitude:Sr,jittered_longitude:ei}},geometry:{type:"Point",coordinates:[ei,Sr]}}})},Si=yi=>{Se=new cpe({radius:bt.value,maxZoom:wt.value,minPoints:2}),Se.load(yi)},Ci=async()=>{if(!Z.value||!Dt.value){console.warn("Cannot initialize map: missing container or coordinates");return}Cr(),await b0();const yi=c.baseLatitude,gr=c.baseLongitude;try{ue=cg.map(Z.value,{center:[yi,gr],zoom:10,zoomControl:!0,scrollWheelZoom:!0,doubleClickZoom:!0,boxZoom:!0,keyboard:!0,attributionControl:!1});try{const Zn=cg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),ga=cg.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});Zn.addTo(ue),ga.addTo(ue)}catch(Zn){console.warn("Error loading tiles:",Zn)}const fr=(Zn,ga=!1)=>{const ya=ga?16:12;return cg.divIcon({className:"custom-div-icon",html:`
`,iconSize:[ya+4,ya+4],iconAnchor:[(ya+4)/2,(ya+4)/2]})},Sr=Zn=>{const ga=Zn<10?30:Zn<100?40:50;return cg.divIcon({className:"custom-cluster-icon",html:`
- ${Qn} + ${Zn}
- `,iconSize:[ka,ka],iconAnchor:[ka/2,ka/2]})},ti=dr("#ef4444",!0);ug.marker([vi,vr],{icon:ti}).addTo(ue).bindPopup(` + `,iconSize:[ga,ga],iconAnchor:[ga/2,ga/2]})},ei=fr("#ef4444",!0);cg.marker([yi,gr],{icon:ei}).addTo(ue).bindPopup(`
Base Station
Base Station
- ${vi.toFixed(6)}, ${vr.toFixed(6)} + ${yi.toFixed(6)}, ${gr.toFixed(6)}
- `);const Xr={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},ei=(Qn,ka,Ta,so,Yn=0)=>{if(!ue)return;const sn=Qn.jittered_latitude||Qn.latitude,an=Qn.jittered_longitude||Qn.longitude;if(sn===null||an===null)return;const zn=Qn.route_type||0;let Ra=so,Ya=3,zo=.7,_a;zn===2?(Ra="#A5E5B6",Ya=4,zo=.9):zn===1?(Ra="#FFC246",_a="10, 5",zo=.8):zn===3?(Ra="#059669",Ya=5,zo=.95):zn===0?(Ra="#ea580c",_a="12, 6",zo=.8):(Ra="#9CA3AF",_a="2, 5",zo=.6);const Ur=[ka,Ta],Mi=[sn,an],Xi=ug.polyline([Ur,Mi],{color:Ra,weight:Ya,opacity:0,dashArray:_a,className:"connection-line"}).addTo(ue),oo=ug.polyline([Ur,Ur],{color:Ra,weight:Ya,opacity:0,dashArray:_a,className:"connection-line animated-line"}).addTo(ue);setTimeout(()=>{let go=0;const ko=30;oo.setStyle({opacity:zo+.2});const ss=()=>{go++;const ys=go/ko,ns=Ur[0]+(Mi[0]-Ur[0])*ys,Qo=Ur[1]+(Mi[1]-Ur[1])*ys;oo.setLatLngs([Ur,[ns,Qo]]),go{ue&&oo&&oo.remove(),Xi.setStyle({opacity:zo}),Xi.on("mouseover",()=>{Xi.setStyle({weight:Ya+2,opacity:Math.min(zo+.3,1)})}),Xi.on("mouseout",()=>{Xi.setStyle({weight:Ya,opacity:zo})});const Rl=ur(ka,Ta,sn,an);Xi.bindPopup(` + `);const Jr={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},ti=(Zn,ga,ya,ro,qn=0)=>{if(!ue)return;const ln=Zn.jittered_latitude||Zn.latitude,nn=Zn.jittered_longitude||Zn.longitude;if(ln===null||nn===null)return;const On=Zn.route_type||0;let Ra=ro,Xa=3,zo=.7,xa;On===2?(Ra="#A5E5B6",Xa=4,zo=.9):On===1?(Ra="#FFC246",xa="10, 5",zo=.8):On===3?(Ra="#059669",Xa=5,zo=.95):On===0?(Ra="#ea580c",xa="12, 6",zo=.8):(Ra="#9CA3AF",xa="2, 5",zo=.6);const $r=[ga,ya],Mi=[ln,nn],Xi=cg.polyline([$r,Mi],{color:Ra,weight:Xa,opacity:0,dashArray:xa,className:"connection-line"}).addTo(ue),so=cg.polyline([$r,$r],{color:Ra,weight:Xa,opacity:0,dashArray:xa,className:"connection-line animated-line"}).addTo(ue);setTimeout(()=>{let go=0;const ko=30;so.setStyle({opacity:zo+.2});const ss=()=>{go++;const ys=go/ko,ns=$r[0]+(Mi[0]-$r[0])*ys,Qo=$r[1]+(Mi[1]-$r[1])*ys;so.setLatLngs([$r,[ns,Qo]]),go{ue&&so&&so.remove(),Xi.setStyle({opacity:zo}),Xi.on("mouseover",()=>{Xi.setStyle({weight:Xa+2,opacity:Math.min(zo+.3,1)})}),Xi.on("mouseout",()=>{Xi.setStyle({weight:Xa,opacity:zo})});const Rl=or(ga,ya,ln,nn);Xi.bindPopup(`
- Connection to ${Qn.node_name||"Unknown Node"}
+ Connection to ${Zn.node_name||"Unknown Node"}
Distance: ${Rl.toFixed(2)} km
- Route: ${wi(Qn.route_type)}
- Signal: ${Er(Qn.rssi)} / ${Fe(Qn.snr)} + Route: ${ni(Zn.route_type)}
+ Signal: ${Mr(Zn.rssi)} / ${ze(Zn.snr)}
- `),Xe.value.push(Xi)},200)};ss()},Yn)},Di=()=>{if(!ue||!Se)return;const Qn=ue.getBounds(),ka=Math.floor(ue.getZoom());Re.value.forEach(so=>{ue&&so.remove()}),Re.value.clear(),Xe.value.forEach(so=>{ue&&so.remove()}),Xe.value.length=0,Se.getClusters([Qn.getWest(),Qn.getSouth(),Qn.getEast(),Qn.getNorth()],ka).forEach(so=>{const[Yn,sn]=so.geometry.coordinates,an=so.properties;if(an.cluster){const zn=ug.marker([sn,Yn],{icon:Ar(an.point_count||0)}).addTo(ue);zn.on("click",()=>{if(ue&&Se){const Mi=Se.getClusterExpansionZoom(an.cluster_id);ue.setView([sn,Yn],Mi)}});const Ya=Se.getLeaves(an.cluster_id,1/0).map(Mi=>`
+ `),it.value.push(Xi)},200)};ss()},qn)},Di=()=>{if(!ue||!Se)return;const Zn=ue.getBounds(),ga=Math.floor(ue.getZoom());Ne.value.forEach(ro=>{ue&&ro.remove()}),Ne.value.clear(),it.value.forEach(ro=>{ue&&ro.remove()}),it.value.length=0,Se.getClusters([Zn.getWest(),Zn.getSouth(),Zn.getEast(),Zn.getNorth()],ga).forEach(ro=>{const[qn,ln]=ro.geometry.coordinates,nn=ro.properties;if(nn.cluster){const On=cg.marker([ln,qn],{icon:Sr(nn.point_count||0)}).addTo(ue);On.on("click",()=>{if(ue&&Se){const Mi=Se.getClusterExpansionZoom(nn.cluster_id);ue.setView([ln,qn],Mi)}});const Xa=Se.getLeaves(nn.cluster_id,1/0).map(Mi=>`
• ${Mi.properties.advert.node_name||"Unknown Node"} (${Mi.properties.advert.contact_type}) -
`).join("");zn.bindPopup(` +
`).join("");On.bindPopup(`
- Cluster: ${an.point_count} nodes
+ Cluster: ${nn.point_count} nodes
- ${Ya} + ${Xa}
Click to zoom in and separate nodes
- `),Re.value.set(`cluster-${an.cluster_id}`,zn);const zo=ur(vi,vr,sn,Yn),_a=Math.min(Math.floor(zo*5),200),Ur={node_name:`Cluster of ${an.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:sn,jittered_longitude:Yn,latitude:sn,longitude:Yn};ei(Ur,vi,vr,"#AAE8E8",_a)}else{const zn=an.advert,Ra=Xr[zn.contact_type]||Xr.Unknown,Ya=dr(Ra),zo=sn,_a=Yn,Ur=ur(vi,vr,zo,_a),Mi=ug.marker([zo,_a],{icon:Ya}).addTo(ue).bindPopup(` + `),Ne.value.set(`cluster-${nn.cluster_id}`,On);const zo=or(yi,gr,ln,qn),xa=Math.min(Math.floor(zo*5),200),$r={node_name:`Cluster of ${nn.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:ln,jittered_longitude:qn,latitude:ln,longitude:qn};ti($r,yi,gr,"#AAE8E8",xa)}else{const On=nn.advert,Ra=Jr[On.contact_type]||Jr.Unknown,Xa=fr(Ra),zo=ln,xa=qn,$r=or(yi,gr,zo,xa),Mi=cg.marker([zo,xa],{icon:Xa}).addTo(ue).bindPopup(`
- ${zn.node_name||"Unknown Node"}
- Type: ${zn.contact_type}
- Distance: ${Ur.toFixed(2)} km
- Signal: ${Er(zn.rssi)} / ${Fe(zn.snr)}
- Route: ${wi(zn.route_type)}
- Last Seen: ${rr(zn.last_seen)} - ${zn.jittered_latitude?'
Position adjusted to separate overlapping nodes':""} + ${On.node_name||"Unknown Node"}
+ Type: ${On.contact_type}
+ Distance: ${$r.toFixed(2)} km
+ Signal: ${Mr(On.rssi)} / ${ze(On.snr)}
+ Route: ${ni(On.route_type)}
+ Last Seen: ${Zt(On.last_seen)} + ${On.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);be.value.set(zn.pubkey,Mi),Re.value.set(`node-${zn.pubkey}`,Mi);const Xi=Math.min(Math.floor(Ur*5),200),oo={...zn,jittered_latitude:zo,jittered_longitude:_a};ei(oo,vi,vr,Ra,Xi)}})},qn=(Qn,ka)=>{let Ta=0;Ti(c.adverts).forEach(Yn=>{const sn=Yn.properties.advert;if(sn.latitude!==null&&sn.longitude!==null){const an=Xr[sn.contact_type]||Xr.Unknown,zn=dr(an),Ra=sn.jittered_latitude||sn.latitude,Ya=sn.jittered_longitude||sn.longitude,zo=ug.marker([Ra,Ya],{icon:zn}).addTo(ue).bindPopup(` + `);xe.value.set(On.pubkey,Mi),Ne.value.set(`node-${On.pubkey}`,Mi);const Xi=Math.min(Math.floor($r*5),200),so={...On,jittered_latitude:zo,jittered_longitude:xa};ti(so,yi,gr,Ra,Xi)}})},En=(Zn,ga)=>{let ya=0;gi(c.adverts).forEach(qn=>{const ln=qn.properties.advert;if(ln.latitude!==null&&ln.longitude!==null){const nn=Jr[ln.contact_type]||Jr.Unknown,On=fr(nn),Ra=ln.jittered_latitude||ln.latitude,Xa=ln.jittered_longitude||ln.longitude,zo=cg.marker([Ra,Xa],{icon:On}).addTo(ue).bindPopup(`
- ${sn.node_name||"Unknown Node"}
- Type: ${sn.contact_type}
- Distance: ${ur(Qn,ka,Ra,Ya).toFixed(2)} km
- Signal: ${Er(sn.rssi)} / ${Fe(sn.snr)}
- Route: ${wi(sn.route_type)}
- Last Seen: ${rr(sn.last_seen)} - ${sn.jittered_latitude?'
Position adjusted to separate overlapping nodes':""} + ${ln.node_name||"Unknown Node"}
+ Type: ${ln.contact_type}
+ Distance: ${or(Zn,ga,Ra,Xa).toFixed(2)} km
+ Signal: ${Mr(ln.rssi)} / ${ze(ln.snr)}
+ Route: ${ni(ln.route_type)}
+ Last Seen: ${Zt(ln.last_seen)} + ${ln.jittered_latitude?'
Position adjusted to separate overlapping nodes':""}
- `);be.value.set(sn.pubkey,zo);const _a=zo.getElement();_a&&(_a.style.opacity="0",_a.style.transition="opacity 0.5s ease-out"),ei(sn,Qn,ka,an,Ta),setTimeout(()=>{_a&&(_a.style.opacity="1")},Ta+1e3),Ta+=100}})};if(vt.value&&c.adverts.length>0)try{const Qn=Ti(c.adverts);_i(Qn);const ka=Math.min(14,ue.getZoom());ue.setZoom(ka),setTimeout(()=>{try{Di()}catch(Ta){console.warn("Error updating clusters:",Ta),qn(vi,vr)}},100),ue.on("moveend",()=>{try{Di()}catch(Ta){console.warn("Error updating clusters on move:",Ta)}}),ue.on("zoomend",()=>{try{Di()}catch(Ta){console.warn("Error updating clusters on zoom:",Ta)}})}catch(Qn){console.warn("Error initializing clustering:",Qn),qn(vi,vr)}else qn(vi,vr);setTimeout(()=>{ue&&ue.invalidateSize()},1e3)}catch(dr){console.error("Error initializing map:",dr)}};return e({highlightNode:vi=>{const vr=be.value.get(vi);if(vr){const dr=vr.getElement();if(dr){const Ar=dr.querySelector("div");Ar&&Ar.classList.add("marker-highlight")}}},unhighlightNode:vi=>{const vr=be.value.get(vi);if(vr){const dr=vr.getElement();if(dr){const Ar=dr.querySelector("div");Ar&&Ar.classList.remove("marker-highlight")}}},initializeOpenStreetMap:Ci}),w0(()=>c.adverts,()=>{ue&&Dt.value&&setTimeout(()=>{Ci()},100)},{immediate:!1}),ud(()=>{Dt.value&&c.adverts.length>0&&setTimeout(()=>{Ci()},300)}),Dv(()=>{Ir()}),(vi,vr)=>(Wr(),Qr("div",hpe,[Dt.value?(Wr(),Qr("div",{key:1,ref_key:"mapContainer",ref:Z,class:"leaflet-map-container h-96 w-full bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden",style:{"min-height":"384px",position:"relative"}},null,512)):(Wr(),Qr("div",fpe,vr[0]||(vr[0]=[qc('

No valid coordinates available

Configure base station location to view map

',1)]))),Dt.value&&vi.adverts.length>0?(Wr(),Qr("button",{key:2,onClick:H,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[vr[1]||(vr[1]=Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),Le("span",dpe,Si(vi.showLegend?"Hide":"Show"),1)])):Ma("",!0),Dt.value&&vi.adverts.length>0&&vi.showLegend?(Wr(),Qr("div",ppe,[vr[2]||(vr[2]=qc('
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
',2)),Le("div",mpe,Si(vi.adverts.length)+" node"+Si(vi.adverts.length!==1?"s":"")+" visible ",1)])):Ma("",!0),Dt.value?(Wr(),Qr("div",gpe," © OpenStreetMap contributors © CARTO ")):Ma("",!0)]))}}),ype=kh(vpe,[["__scopeId","data-v-9c7dd490"]]),_pe={class:"relative","data-menu-container":""},$B=Uu({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(t,{emit:e}){const r=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Dt=>{if(r.activeMenu&&r.activeMenu!==Dt)try{r.activeMenu.closeMenu()}catch(rr){console.warn("Error closing previous menu:",rr)}r.activeMenu=Dt}};window.__neighborMenuManager=r;const c=t,S=e,H=vn(!1),Z=vn(),ue=vn({top:0,left:0}),be=()=>{H.value=!1,document.removeEventListener("click",vt,!0),document.removeEventListener("keydown",bt),r.activeMenu===Se&&(r.activeMenu=null)},Se={closeMenu:be},Re=()=>{be(),S("ping",c.neighbor)},Xe=()=>{be(),S("delete",c.neighbor)},vt=Dt=>{Dt.target.closest("[data-menu-container]")||be()},bt=Dt=>{Dt.key==="Escape"&&be()},kt=async()=>{if(!H.value&&Z.value){r.setActiveMenu(Se);const Dt=Z.value.getBoundingClientRect(),rr=window.innerWidth,Er=144,Fe=rr<1024,wi=Dt.left+Er>rr-16;let ur=Dt.left;Fe&&wi&&(ur=Dt.right-Er),ur=Math.max(8,ur),ue.value={top:Dt.bottom+4,left:ur},H.value=!0,await x0(),document.addEventListener("click",vt,!0),document.addEventListener("keydown",bt)}else be()};return Dv(()=>{be()}),(Dt,rr)=>(Wr(),Qr("div",_pe,[Le("button",{ref_key:"buttonRef",ref:Z,onClick:kt,class:eo(["p-1 rounded hover:bg-white/10 transition-colors text-white/60 hover:text-white/80",{"bg-white/10 text-white/80":H.value}]),"data-menu-container":""},rr[0]||(rr[0]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(Wr(),Sd(gS,{to:"body"},[H.value?(Wr(),Qr("div",{key:0,class:"fixed w-36 bg-dark-card/90 backdrop-blur-lg border border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:om({top:ue.value.top+"px",left:ue.value.left+"px"}),"data-menu-container":""},[Le("div",{class:"py-2"},[Le("button",{onClick:Re,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-white hover:bg-primary/10 transition-colors border-b border-white/10"},rr[1]||(rr[1]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})],-1),Le("span",{class:"font-medium"},"Ping",-1)])),Le("button",{onClick:Xe,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},rr[2]||(rr[2]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),Le("span",{class:"font-medium"},"Delete",-1)]))])],4)):Ma("",!0)]))]))}}),xpe={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},bpe={class:"flex items-center justify-between mb-4"},wpe={class:"flex items-center gap-3"},kpe={class:"text-white text-lg font-semibold"},Tpe={class:"bg-white/10 text-white text-xs px-2 py-1 rounded-full"},Spe={key:0,class:"text-white/60"},Cpe={key:0,class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 p-1"},Ape={class:"hidden lg:block overflow-x-auto"},Mpe={class:"w-full"},Epe={class:"bg-dark-bg/50"},Lpe={class:"bg-dark-bg/30"},Ppe=["onMouseenter","onMouseleave"],Ipe=["onClick","title"],Dpe={key:0,class:"ml-1 text-xs"},zpe={key:0,class:"flex items-center gap-3"},Ope={class:"text-white/70"},Bpe={class:"flex gap-1"},Rpe=["onClick"],Fpe=["onClick"],Npe={key:1,class:"text-dark-text"},jpe={class:"flex items-center gap-2"},Upe={class:"flex items-end gap-0.5"},$pe={class:"flex items-center gap-2"},Hpe=["title"],Vpe=["title"],Wpe={class:"lg:hidden space-y-3"},qpe=["onClick"],Gpe={class:"flex items-center justify-between mb-3"},Zpe={class:"flex items-center gap-3"},Kpe={class:"text-white font-medium text-base"},Ype={class:"flex items-center gap-2"},Xpe={class:"grid grid-cols-1 gap-3"},Jpe={class:"grid grid-cols-2 gap-4"},Qpe=["onClick","title"],e0e={key:0,class:"ml-1 text-xs"},t0e={class:"flex items-center gap-2 justify-end"},r0e={class:"flex items-end gap-0.5"},i0e={class:"grid grid-cols-2 gap-4"},n0e={class:"flex items-center gap-2"},a0e=["title"],o0e={class:"text-white text-sm block text-right"},s0e={key:0,class:"border-t border-white/10 pt-3"},l0e={class:"flex items-center justify-between"},u0e={class:"text-white/70 text-sm font-mono"},c0e={class:"flex gap-2"},h0e=["onClick"],f0e=["onClick"],d0e={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},p0e={class:"text-center"},m0e={class:"text-white text-sm font-medium"},g0e={class:"text-center"},v0e={class:"text-white text-sm font-medium"},y0e={class:"text-center"},_0e=["title"],x0e=Uu({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(t,{emit:e}){const r=vn(null),c=t,S=e,H=ii=>new Date(ii*1e3).toLocaleString(),Z=ii=>`${ii.slice(0,4)}...${ii.slice(-4)}`,ue=ii=>{switch(ii){case 2:return{text:"Direct",bgColor:"bg-green-500/20",borderColor:"border-green-400/30",textColor:"text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-600/20",borderColor:"border-green-500/30",textColor:"text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-500/20",borderColor:"border-yellow-400/30",textColor:"text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-500/20",borderColor:"border-orange-400/30",textColor:"text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},be=ii=>ii?`${ii} dBm`:"N/A",Se=ii=>ii?`${ii} dB`:"N/A",Re=(ii,Ji,vi,vr)=>{const Ar=(vi-ii)*Math.PI/180,ti=(vr-Ji)*Math.PI/180,Xr=Math.sin(Ar/2)*Math.sin(Ar/2)+Math.cos(ii*Math.PI/180)*Math.cos(vi*Math.PI/180)*Math.sin(ti/2)*Math.sin(ti/2);return 6371*(2*Math.atan2(Math.sqrt(Xr),Math.sqrt(1-Xr)))},Xe=ii=>c.baseLatitude===null||c.baseLongitude===null||ii.latitude===null||ii.longitude===null?"N/A":`${Re(c.baseLatitude,c.baseLongitude,ii.latitude,ii.longitude).toFixed(1)} km`,vt=async ii=>{try{return await navigator.clipboard.writeText(ii),!0}catch{const Ji=document.createElement("textarea");return Ji.value=ii,document.body.appendChild(Ji),Ji.select(),document.execCommand("copy"),document.body.removeChild(Ji),!0}},bt=ii=>{const Ji=Date.now(),vi=ii*1e3,vr=Ji-vi,dr=Math.floor(vr/1e3),Ar=Math.floor(dr/60),ti=Math.floor(Ar/60),Xr=Math.floor(ti/24);return dr<60?`${dr}s ago`:Ar<60?`${Ar}m ago`:ti<24?`${ti}h ago`:`${Xr}d ago`},kt=ii=>{const Ji=Date.now(),vi=ii*1e3,vr=Ji-vi,dr=Math.floor(vr/(1e3*60*60));return dr<1?{color:"text-green-400"}:dr<26?{color:"text-yellow-400"}:{color:"text-red-400"}},Dt=async(ii,Ji)=>{const vi=`${ii.toFixed(6)}, ${Ji.toFixed(6)}`;await vt(vi)},rr=(ii,Ji)=>{const vi=`https://www.google.com/maps?q=${ii},${Ji}`;window.open(vi,"_blank")},Er=async ii=>{await vt(ii),r.value=ii,setTimeout(()=>{r.value=null},2e3)},Fe=ii=>ii?ii>=-50?{bars:5,color:"text-green-400"}:ii>=-60?{bars:4,color:"text-green-300"}:ii>=-70?{bars:3,color:"text-yellow-400"}:ii>=-80?{bars:2,color:"text-orange-400"}:ii>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}:{bars:0,color:"text-gray-400"},wi=()=>c.isCompactView?"py-2 px-2":"py-4 px-3",ur=()=>{S("toggle-view")},Ir=ii=>{S("highlight-node",ii)},Ti=ii=>{S("unhighlight-node",ii)},_i=ii=>{S("menu-ping",ii)},Ci=ii=>{S("menu-delete",ii)};return(ii,Ji)=>(Wr(),Qr("div",xpe,[Le("div",bpe,[Le("div",wpe,[Le("div",{class:"w-3 h-3 rounded-full border border-white/20",style:om({backgroundColor:ii.color})},null,4),Le("h3",kpe,Si(ii.contactType),1),Le("span",Tpe,[ul(Si(ii.adverts.length)+" ",1),ii.originalCount>0&&ii.adverts.length(Wr(),Qr("tr",{key:vi.id,class:"hover:bg-white/5 transition-colors",onMouseenter:vr=>Ir(vi.pubkey),onMouseleave:vr=>Ti(vi.pubkey)},[Le("td",{class:eo(wi())},[il($B,{neighbor:vi,onPing:_i,onDelete:Ci},null,8,["neighbor"])],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},Si(vi.node_name||"Unknown"),3),Le("td",{class:eo(`${wi()} text-white text-sm font-mono`)},[Le("button",{onClick:vr=>Er(vi.pubkey),class:eo(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",r.value===vi.pubkey?"text-green-400 decoration-green-400/60":""]),title:r.value===vi.pubkey?"Copied!":"Click to copy full public key"},[ul(Si(Z(vi.pubkey))+" ",1),r.value===vi.pubkey?(Wr(),Qr("span",Dpe,"✓")):Ma("",!0)],10,Ipe)],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},[vi.latitude!==null&&vi.longitude!==null?(Wr(),Qr("div",zpe,[Le("span",Ope,Si(vi.latitude.toFixed(4))+", "+Si(vi.longitude.toFixed(4)),1),Le("div",Bpe,[Le("button",{onClick:vr=>Dt(vi.latitude,vi.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},Ji[2]||(Ji[2]=[Le("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Le("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Rpe),Le("button",{onClick:vr=>rr(vi.latitude,vi.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},Ji[3]||(Ji[3]=[Le("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Le("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Fpe)])])):(Wr(),Qr("span",Npe,"Unknown"))],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},Si(Xe(vi)),3),Le("td",{class:eo(`${wi()} text-white text-sm`)},[Le("span",{class:eo(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",ue(vi.route_type).bgColor,ue(vi.route_type).borderColor,ue(vi.route_type).textColor])},Si(ue(vi.route_type).text),3)],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},[Le("span",{class:eo(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",vi.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},Si(vi.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},[Le("div",jpe,[Le("div",Upe,[(Wr(),Qr(js,null,au(5,vr=>Le("div",{key:vr,class:eo(["w-1 transition-colors",vr<=Fe(vi.rssi).bars?Fe(vi.rssi).color:"text-gray-600"]),style:om({height:`${4+vr*2}px`})},Ji[4]||(Ji[4]=[Le("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Le("span",{class:eo(Fe(vi.rssi).color)},Si(be(vi.rssi)),3)])],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},Si(Se(vi.snr)),3),Le("td",{class:eo(`${wi()} text-white text-sm`)},[Le("div",$pe,[Le("div",{class:eo(["w-2 h-2 rounded-full",kt(vi.last_seen).color==="text-green-400"?"bg-green-400":"",kt(vi.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",kt(vi.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Le("span",{class:eo([kt(vi.last_seen).color,"cursor-help"]),title:H(vi.last_seen)},Si(bt(vi.last_seen)),11,Hpe)])],2),Le("td",{class:eo(`${wi()} text-white text-sm`)},[Le("span",{title:H(vi.first_seen),class:"cursor-help"},Si(bt(vi.first_seen)),9,Vpe)],2),Le("td",{class:eo(`${wi()} text-white text-sm text-center`)},Si(vi.advert_count),3)],40,Ppe))),128))])])]),Le("div",Wpe,[(Wr(!0),Qr(js,null,au(ii.adverts,vi=>(Wr(),Qr("div",{key:vi.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:vr=>Ir(vi.pubkey)},[Le("div",Gpe,[Le("div",Zpe,[Le("h4",Kpe,Si(vi.node_name||"Unknown Node"),1),Le("div",Ype,[Le("span",{class:eo(["inline-block px-2 py-1 rounded-full text-xs border",ue(vi.route_type).bgColor,ue(vi.route_type).borderColor,ue(vi.route_type).textColor])},Si(ue(vi.route_type).text),3),Le("span",{class:eo(["inline-block px-2 py-1 rounded-full text-xs border",vi.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},Si(vi.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),il($B,{neighbor:vi,onPing:_i,onDelete:Ci},null,8,["neighbor"])]),Le("div",Xpe,[Le("div",Jpe,[Le("div",null,[Ji[5]||(Ji[5]=Le("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),Le("button",{onClick:vr=>Er(vi.pubkey),class:eo(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",r.value===vi.pubkey?"text-green-400 decoration-green-400/60":""]),title:r.value===vi.pubkey?"Copied!":"Click to copy full public key"},[ul(Si(Z(vi.pubkey))+" ",1),r.value===vi.pubkey?(Wr(),Qr("span",e0e,"✓")):Ma("",!0)],10,Qpe)]),Le("div",null,[Ji[7]||(Ji[7]=Le("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),Le("div",t0e,[Le("div",r0e,[(Wr(),Qr(js,null,au(5,vr=>Le("div",{key:vr,class:eo(["w-1.5 transition-colors",vr<=Fe(vi.rssi).bars?Fe(vi.rssi).color:"text-gray-600"]),style:om({height:`${6+vr*2}px`})},Ji[6]||(Ji[6]=[Le("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Le("span",{class:eo(`${Fe(vi.rssi).color} text-sm font-medium`)},Si(be(vi.rssi)),3)])])]),Le("div",i0e,[Le("div",null,[Ji[8]||(Ji[8]=Le("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),Le("div",n0e,[Le("div",{class:eo(["w-2 h-2 rounded-full",kt(vi.last_seen).color==="text-green-400"?"bg-green-400":"",kt(vi.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",kt(vi.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Le("span",{class:eo(`${kt(vi.last_seen).color} text-sm`),title:H(vi.last_seen)},Si(bt(vi.last_seen)),11,a0e)])]),Le("div",null,[Ji[9]||(Ji[9]=Le("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),Le("span",o0e,Si(Xe(vi)),1)])]),vi.latitude!==null&&vi.longitude!==null?(Wr(),Qr("div",s0e,[Ji[12]||(Ji[12]=Le("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),Le("div",l0e,[Le("span",u0e,Si(vi.latitude.toFixed(4))+", "+Si(vi.longitude.toFixed(4)),1),Le("div",c0e,[Le("button",{onClick:vr=>Dt(vi.latitude,vi.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},Ji[10]||(Ji[10]=[Le("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Le("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,h0e),Le("button",{onClick:vr=>rr(vi.latitude,vi.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},Ji[11]||(Ji[11]=[Le("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Le("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,f0e)])])])):Ma("",!0),Le("div",d0e,[Le("div",p0e,[Ji[13]||(Ji[13]=Le("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),Le("span",m0e,Si(Se(vi.snr)),1)]),Le("div",g0e,[Ji[14]||(Ji[14]=Le("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),Le("span",v0e,Si(vi.advert_count),1)]),Le("div",y0e,[Ji[15]||(Ji[15]=Le("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),Le("span",{class:"text-white text-sm",title:H(vi.first_seen)},Si(bt(vi.first_seen)),9,_0e)])])])],8,qpe))),128))])]))}}),b0e={class:"space-y-6"},w0e={key:0,class:"flex items-center justify-center py-12"},k0e={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},T0e={class:"flex items-center gap-3"},S0e={class:"text-accent-red/80 text-sm"},C0e={key:0,class:""},A0e={class:"flex items-center justify-between"},M0e={class:"flex items-center gap-3"},E0e={class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 mb p-1"},L0e={class:"flex items-center gap-2"},P0e={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},I0e={class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 mt-4 space-y-4"},D0e={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},z0e={key:1,class:"text-center py-12"},O0e={key:2,class:"text-center py-12"},B0e=Uu({name:"NeighborsView",__name:"Neighbors",setup(t){const e=kg(),r={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},c={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},S=vn({}),H=vn(!0),Z=vn(null),ue=vn(!1),be=vn(typeof window<"u"?window.innerWidth>=1024:!0),Se=vn(!1),Re=vn({zeroHop:"all",routeType:"all",searchText:""}),Xe=vn(!1),vt=vn(!1),bt=vn(!1),kt=vn(null),Dt=vn(null),rr=vn(null),Er=vn(null),Fe=Do(()=>{if(!Er.value)return null;const ka=Er.value;return{id:ka.id,pubkey:ka.pubkey,node_name:ka.node_name,contact_type:ka.contact_type,latitude:ka.latitude,longitude:ka.longitude,rssi:ka.rssi,snr:ka.snr,route_type:ka.route_type,last_seen:ka.last_seen,first_seen:ka.first_seen,advert_count:ka.advert_count,timestamp:ka.timestamp,is_repeater:ka.is_repeater,is_new_neighbor:ka.is_new_neighbor,zero_hop:ka.zero_hop}}),wi=Do(()=>e.stats?.config?.repeater?.latitude),ur=Do(()=>e.stats?.config?.repeater?.longitude),Ir=ka=>ka.filter(Ta=>{if(Re.value.zeroHop!=="all"){const so=Ta.zero_hop;if(Re.value.zeroHop==="true"&&!so||Re.value.zeroHop==="false"&&so)return!1}if(Re.value.routeType!=="all"){const so=Ta.route_type;if(Re.value.routeType==="direct"&&so!==2||Re.value.routeType==="transport_direct"&&so!==3||Re.value.routeType==="flood"&&so!==1||Re.value.routeType==="transport_flood"&&so!==0)return!1}if(Re.value.searchText){const so=Re.value.searchText.toLowerCase(),Yn=Ta.node_name?.toLowerCase()||"",sn=Ta.pubkey.toLowerCase();if(!Yn.includes(so)&&!sn.includes(so))return!1}return!0}),Ti=()=>{Re.value={zeroHop:"all",routeType:"all",searchText:""}},_i=Do(()=>Re.value.zeroHop!=="all"||Re.value.routeType!=="all"||Re.value.searchText!==""),Ci=Do(()=>{const ka={};for(const[Ta,so]of Object.entries(S.value))ka[Ta]=Ir(so);return ka}),ii=Do(()=>Object.entries(r).filter(([ka])=>Ci.value[ka]?.length>0).sort(([ka],[Ta])=>parseInt(ka)-parseInt(Ta))),Ji=Do(()=>Object.values(S.value).flat().filter(ka=>{const Ta=ka.latitude,so=ka.longitude;return Ta!=null&&Ta!==0&&so!==null&&so!==void 0&&so!==0&&typeof Ta=="number"&&typeof so=="number"&&!isNaN(Ta)&&!isNaN(so)})),vi=async ka=>{try{const Ta=await zs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(ka)}&hours=168`);return Ta.success&&Array.isArray(Ta.data)?Ta.data:[]}catch(Ta){return console.error(`Error fetching adverts for contact type ${ka}:`,Ta),[]}},vr=async()=>{H.value=!0,Z.value=null;try{S.value={};for(const[ka,Ta]of Object.entries(r)){const so=await vi(Ta);so.length>0&&(S.value[ka]=so)}}catch(ka){console.error("Error loading adverts:",ka),Z.value=ka instanceof Error?ka.message:"Failed to load neighbor data"}finally{H.value=!1}},dr=vn(),Ar=ka=>{dr.value?.highlightNode(ka)},ti=ka=>{dr.value?.unhighlightNode(ka)},Xr=async ka=>{const Ta=ka;kt.value=null,Dt.value=null,bt.value=!0,rr.value=Ta.node_name||"Unknown Node",vt.value=!0;try{const Yn=`0x${parseInt(Ta.pubkey.substring(0,2),16).toString(16).padStart(2,"0")}`;console.log(`Pinging neighbor ${Ta.node_name||"Unknown"} (${Yn})...`);const sn=await zs.pingNeighbor(Yn,10);sn.success&&sn.data?(kt.value=sn.data,console.log("Ping successful:",sn.data)):(Dt.value=sn.error||"Unknown error occurred",console.error("Failed to ping neighbor:",sn.error))}catch(so){console.error("Error pinging neighbor:",so),Dt.value=so instanceof Error?so.message:"Unknown error occurred"}finally{bt.value=!1}},ei=()=>{vt.value=!1,kt.value=null,Dt.value=null,rr.value=null},Di=ka=>{Er.value=ka,Xe.value=!0},qn=()=>{Xe.value=!1,Er.value=null},Qn=async ka=>{try{await zs.deleteAdvert(ka),await vr(),qn()}catch(Ta){console.error("Error deleting neighbor:",Ta)}};return ud(async()=>{await vr()}),(ka,Ta)=>(Wr(),Qr("div",b0e,[H.value?(Wr(),Qr("div",w0e,Ta[7]||(Ta[7]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Le("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):Z.value?(Wr(),Qr("div",k0e,[Le("div",T0e,[Ta[9]||(Ta[9]=Le("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Le("div",null,[Ta[8]||(Ta[8]=Le("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Le("p",S0e,Si(Z.value),1)])])])):(Wr(),Qr(js,{key:2},[il(ype,{ref_key:"networkMapRef",ref:dr,adverts:Ji.value,"base-latitude":wi.value,"base-longitude":ur.value,"show-legend":be.value,"onUpdate:showLegend":Ta[0]||(Ta[0]=so=>be.value=so)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(S.value).length>0?(Wr(),Qr("div",C0e,[Le("div",A0e,[Ta[14]||(Ta[14]=Le("span",{class:"text-white text-lg font-semibold"},null,-1)),Le("div",M0e,[Le("div",E0e,[Le("button",{onClick:Ta[1]||(Ta[1]=so=>ue.value=!1),class:eo(["p-2 rounded-md transition-colors",ue.value?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},Ta[10]||(Ta[10]=[Le("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),Le("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),Le("button",{onClick:Ta[2]||(Ta[2]=so=>ue.value=!0),class:eo(["p-2 rounded-md transition-colors",ue.value?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},Ta[11]||(Ta[11]=[Le("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Le("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Le("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),Le("div",L0e,[Le("button",{onClick:Ta[3]||(Ta[3]=so=>Se.value=!Se.value),class:eo(["px-3 py-1.5 text-xs rounded-lg transition-colors border",_i.value?"bg-primary/20 text-primary border-primary/30":"bg-white/10 text-white border-white/20 hover:bg-white/20"])},[Ta[12]||(Ta[12]=Le("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),Ta[13]||(Ta[13]=ul(" Filters ",-1)),_i.value?(Wr(),Qr("span",P0e," Active ")):Ma("",!0)],2),_i.value?(Wr(),Qr("button",{key:0,onClick:Ti,class:"px-3 py-1.5 text-xs rounded-lg bg-white/10 text-white border border-white/20 hover:bg-white/20 transition-colors"}," Clear Filters ")):Ma("",!0)])])]),Sl(Le("div",I0e,[Le("div",D0e,[Le("div",null,[Ta[16]||(Ta[16]=Le("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Zero Hop",-1)),Sl(Le("select",{"onUpdate:modelValue":Ta[4]||(Ta[4]=so=>Re.value.zeroHop=so),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Ta[15]||(Ta[15]=[Le("option",{value:"all"},"All Nodes",-1),Le("option",{value:"true"},"Zero Hop Only",-1),Le("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[_g,Re.value.zeroHop]])]),Le("div",null,[Ta[18]||(Ta[18]=Le("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Route Type",-1)),Sl(Le("select",{"onUpdate:modelValue":Ta[5]||(Ta[5]=so=>Re.value.routeType=so),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},Ta[17]||(Ta[17]=[qc('',5)]),512),[[_g,Re.value.routeType]])]),Le("div",null,[Ta[19]||(Ta[19]=Le("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Search",-1)),Sl(Le("input",{"onUpdate:modelValue":Ta[6]||(Ta[6]=so=>Re.value.searchText=so),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none placeholder-white/40"},null,512),[[sc,Re.value.searchText]])])])],512),[[dx,Se.value]])])):Ma("",!0),(Wr(!0),Qr(js,null,au(ii.value,([so,Yn])=>(Wr(),Qr("div",{key:so,class:"space-y-6"},[il(x0e,{"contact-type":Yn,"contact-type-key":so,adverts:Ci.value[so],"original-count":S.value[so]?.length||0,color:c[parseInt(so)],"base-latitude":wi.value,"base-longitude":ur.value,"is-compact-view":ue.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:Ar,onUnhighlightNode:ti,onMenuPing:Xr,onMenuDelete:Di},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),ii.value.length===0&&Object.keys(S.value).length===0?(Wr(),Qr("div",z0e,[Ta[20]||(Ta[20]=qc('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),Le("button",{onClick:vr,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):ii.value.length===0&&_i.value?(Wr(),Qr("div",O0e,[Ta[21]||(Ta[21]=qc('

No neighbors match your filters

Try adjusting your filter criteria to see more results.

',3)),Le("button",{onClick:Ti,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):Ma("",!0)],64)),il(Sde,{show:Xe.value,neighbor:Fe.value,onClose:qn,onDelete:Qn},null,8,["show","neighbor"]),il(ipe,{show:vt.value,"node-name":rr.value,result:kt.value,error:Dt.value,loading:bt.value,onClose:ei},null,8,["show","node-name","result","error","loading"])]))}});/*! + `);xe.value.set(ln.pubkey,zo);const xa=zo.getElement();xa&&(xa.style.opacity="0",xa.style.transition="opacity 0.5s ease-out"),ti(ln,Zn,ga,nn,ya),setTimeout(()=>{xa&&(xa.style.opacity="1")},ya+1e3),ya+=100}})};if(pt.value&&c.adverts.length>0)try{const Zn=gi(c.adverts);Si(Zn);const ga=Math.min(14,ue.getZoom());ue.setZoom(ga),setTimeout(()=>{try{Di()}catch(ya){console.warn("Error updating clusters:",ya),En(yi,gr)}},100),ue.on("moveend",()=>{try{Di()}catch(ya){console.warn("Error updating clusters on move:",ya)}}),ue.on("zoomend",()=>{try{Di()}catch(ya){console.warn("Error updating clusters on zoom:",ya)}})}catch(Zn){console.warn("Error initializing clustering:",Zn),En(yi,gr)}else En(yi,gr);setTimeout(()=>{ue&&ue.invalidateSize()},1e3)}catch(fr){console.error("Error initializing map:",fr)}};return e({highlightNode:yi=>{const gr=xe.value.get(yi);if(gr){const fr=gr.getElement();if(fr){const Sr=fr.querySelector("div");Sr&&Sr.classList.add("marker-highlight")}}},unhighlightNode:yi=>{const gr=xe.value.get(yi);if(gr){const fr=gr.getElement();if(fr){const Sr=fr.querySelector("div");Sr&&Sr.classList.remove("marker-highlight")}}},initializeOpenStreetMap:Ci}),Af(()=>c.adverts,()=>{ue&&Dt.value&&setTimeout(()=>{Ci()},100)},{immediate:!1}),Jf(()=>{Dt.value&&c.adverts.length>0&&setTimeout(()=>{Ci()},300)}),Iv(()=>{Cr()}),(yi,gr)=>(jr(),Kr("div",dpe,[Dt.value?(jr(),Kr("div",{key:1,ref_key:"mapContainer",ref:Z,class:"leaflet-map-container h-96 w-full bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden",style:{"min-height":"384px",position:"relative"}},null,512)):(jr(),Kr("div",ppe,gr[0]||(gr[0]=[Dc('

No valid coordinates available

Configure base station location to view map

',1)]))),Dt.value&&yi.adverts.length>0?(jr(),Kr("button",{key:2,onClick:$,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[gr[1]||(gr[1]=Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),Ee("span",mpe,ki(yi.showLegend?"Hide":"Show"),1)])):Sa("",!0),Dt.value&&yi.adverts.length>0&&yi.showLegend?(jr(),Kr("div",gpe,[gr[2]||(gr[2]=Dc('
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
',2)),Ee("div",vpe,ki(yi.adverts.length)+" node"+ki(yi.adverts.length!==1?"s":"")+" visible ",1)])):Sa("",!0),Dt.value?(jr(),Kr("div",ype," © OpenStreetMap contributors © CARTO ")):Sa("",!0)]))}}),xpe=kh(_pe,[["__scopeId","data-v-9c7dd490"]]),bpe={class:"relative","data-menu-container":""},VB=Bu({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete"],setup(t,{emit:e}){const r=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:Dt=>{if(r.activeMenu&&r.activeMenu!==Dt)try{r.activeMenu.closeMenu()}catch(Zt){console.warn("Error closing previous menu:",Zt)}r.activeMenu=Dt}};window.__neighborMenuManager=r;const c=t,S=e,$=fn(!1),Z=fn(),ue=fn({top:0,left:0}),xe=()=>{$.value=!1,document.removeEventListener("click",pt,!0),document.removeEventListener("keydown",bt),r.activeMenu===Se&&(r.activeMenu=null)},Se={closeMenu:xe},Ne=()=>{xe(),S("ping",c.neighbor)},it=()=>{xe(),S("delete",c.neighbor)},pt=Dt=>{Dt.target.closest("[data-menu-container]")||xe()},bt=Dt=>{Dt.key==="Escape"&&xe()},wt=async()=>{if(!$.value&&Z.value){r.setActiveMenu(Se);const Dt=Z.value.getBoundingClientRect(),Zt=window.innerWidth,Mr=144,ze=Zt<1024,ni=Dt.left+Mr>Zt-16;let or=Dt.left;ze&&ni&&(or=Dt.right-Mr),or=Math.max(8,or),ue.value={top:Dt.bottom+4,left:or},$.value=!0,await b0(),document.addEventListener("click",pt,!0),document.addEventListener("keydown",bt)}else xe()};return Iv(()=>{xe()}),(Dt,Zt)=>(jr(),Kr("div",bpe,[Ee("button",{ref_key:"buttonRef",ref:Z,onClick:wt,class:Ga(["p-1 rounded hover:bg-white/10 transition-colors text-white/60 hover:text-white/80",{"bg-white/10 text-white/80":$.value}]),"data-menu-container":""},Zt[0]||(Zt[0]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(jr(),Cd(y8,{to:"body"},[$.value?(jr(),Kr("div",{key:0,class:"fixed w-36 bg-dark-card/90 backdrop-blur-lg border border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:om({top:ue.value.top+"px",left:ue.value.left+"px"}),"data-menu-container":""},[Ee("div",{class:"py-2"},[Ee("button",{onClick:Ne,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-white hover:bg-primary/10 transition-colors border-b border-white/10"},Zt[1]||(Zt[1]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})],-1),Ee("span",{class:"font-medium"},"Ping",-1)])),Ee("button",{onClick:it,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},Zt[2]||(Zt[2]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),Ee("span",{class:"font-medium"},"Delete",-1)]))])],4)):Sa("",!0)]))]))}}),wpe={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},kpe={class:"flex items-center justify-between mb-4"},Tpe={class:"flex items-center gap-3"},Spe={class:"text-white text-lg font-semibold"},Cpe={class:"bg-white/10 text-white text-xs px-2 py-1 rounded-full"},Ape={key:0,class:"text-white/60"},Mpe={key:0,class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 p-1"},Epe={class:"hidden lg:block overflow-x-auto"},Lpe={class:"w-full"},Ppe={class:"bg-dark-bg/50"},Ipe={class:"bg-dark-bg/30"},Dpe=["onMouseenter","onMouseleave"],zpe=["onClick","title"],Ope={key:0,class:"ml-1 text-xs"},Bpe={key:0,class:"flex items-center gap-3"},Rpe={class:"text-white/70"},Fpe={class:"flex gap-1"},Npe=["onClick"],jpe=["onClick"],Upe={key:1,class:"text-dark-text"},$pe={class:"flex items-center gap-2"},Hpe={class:"flex items-end gap-0.5"},Vpe={class:"flex items-center gap-2"},Wpe=["title"],qpe=["title"],Gpe={class:"lg:hidden space-y-3"},Zpe=["onClick"],Kpe={class:"flex items-center justify-between mb-3"},Ype={class:"flex items-center gap-3"},Xpe={class:"text-white font-medium text-base"},Jpe={class:"flex items-center gap-2"},Qpe={class:"grid grid-cols-1 gap-3"},e0e={class:"grid grid-cols-2 gap-4"},t0e=["onClick","title"],r0e={key:0,class:"ml-1 text-xs"},i0e={class:"flex items-center gap-2 justify-end"},n0e={class:"flex items-end gap-0.5"},a0e={class:"grid grid-cols-2 gap-4"},o0e={class:"flex items-center gap-2"},s0e=["title"],l0e={class:"text-white text-sm block text-right"},u0e={key:0,class:"border-t border-white/10 pt-3"},c0e={class:"flex items-center justify-between"},h0e={class:"text-white/70 text-sm font-mono"},f0e={class:"flex gap-2"},d0e=["onClick"],p0e=["onClick"],m0e={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},g0e={class:"text-center"},v0e={class:"text-white text-sm font-medium"},y0e={class:"text-center"},_0e={class:"text-white text-sm font-medium"},x0e={class:"text-center"},b0e=["title"],w0e=Bu({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","toggle-view"],setup(t,{emit:e}){const r=fn(null),c=t,S=e,$=ri=>new Date(ri*1e3).toLocaleString(),Z=ri=>`${ri.slice(0,4)}...${ri.slice(-4)}`,ue=ri=>{switch(ri){case 2:return{text:"Direct",bgColor:"bg-green-500/20",borderColor:"border-green-400/30",textColor:"text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-600/20",borderColor:"border-green-500/30",textColor:"text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-500/20",borderColor:"border-yellow-400/30",textColor:"text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-500/20",borderColor:"border-orange-400/30",textColor:"text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},xe=ri=>ri?`${ri} dBm`:"N/A",Se=ri=>ri?`${ri} dB`:"N/A",Ne=(ri,on,yi,gr)=>{const Sr=(yi-ri)*Math.PI/180,ei=(gr-on)*Math.PI/180,Jr=Math.sin(Sr/2)*Math.sin(Sr/2)+Math.cos(ri*Math.PI/180)*Math.cos(yi*Math.PI/180)*Math.sin(ei/2)*Math.sin(ei/2);return 6371*(2*Math.atan2(Math.sqrt(Jr),Math.sqrt(1-Jr)))},it=ri=>c.baseLatitude===null||c.baseLongitude===null||ri.latitude===null||ri.longitude===null?"N/A":`${Ne(c.baseLatitude,c.baseLongitude,ri.latitude,ri.longitude).toFixed(1)} km`,pt=async ri=>{try{return await navigator.clipboard.writeText(ri),!0}catch{const on=document.createElement("textarea");return on.value=ri,document.body.appendChild(on),on.select(),document.execCommand("copy"),document.body.removeChild(on),!0}},bt=ri=>{const on=Date.now(),yi=ri*1e3,gr=on-yi,fr=Math.floor(gr/1e3),Sr=Math.floor(fr/60),ei=Math.floor(Sr/60),Jr=Math.floor(ei/24);return fr<60?`${fr}s ago`:Sr<60?`${Sr}m ago`:ei<24?`${ei}h ago`:`${Jr}d ago`},wt=ri=>{const on=Date.now(),yi=ri*1e3,gr=on-yi,fr=Math.floor(gr/(1e3*60*60));return fr<1?{color:"text-green-400"}:fr<26?{color:"text-yellow-400"}:{color:"text-red-400"}},Dt=async(ri,on)=>{const yi=`${ri.toFixed(6)}, ${on.toFixed(6)}`;await pt(yi)},Zt=(ri,on)=>{const yi=`https://www.google.com/maps?q=${ri},${on}`;window.open(yi,"_blank")},Mr=async ri=>{await pt(ri),r.value=ri,setTimeout(()=>{r.value=null},2e3)},ze=ri=>ri?ri>=-50?{bars:5,color:"text-green-400"}:ri>=-60?{bars:4,color:"text-green-300"}:ri>=-70?{bars:3,color:"text-yellow-400"}:ri>=-80?{bars:2,color:"text-orange-400"}:ri>=-90?{bars:1,color:"text-red-400"}:{bars:0,color:"text-red-500"}:{bars:0,color:"text-gray-400"},ni=()=>c.isCompactView?"py-2 px-2":"py-4 px-3",or=()=>{S("toggle-view")},Cr=ri=>{S("highlight-node",ri)},gi=ri=>{S("unhighlight-node",ri)},Si=ri=>{S("menu-ping",ri)},Ci=ri=>{S("menu-delete",ri)};return(ri,on)=>(jr(),Kr("div",wpe,[Ee("div",kpe,[Ee("div",Tpe,[Ee("div",{class:"w-3 h-3 rounded-full border border-white/20",style:om({backgroundColor:ri.color})},null,4),Ee("h3",Spe,ki(ri.contactType),1),Ee("span",Cpe,[il(ki(ri.adverts.length)+" ",1),ri.originalCount>0&&ri.adverts.length(jr(),Kr("tr",{key:yi.id,class:"hover:bg-white/5 transition-colors",onMouseenter:gr=>Cr(yi.pubkey),onMouseleave:gr=>gi(yi.pubkey)},[Ee("td",{class:Ga(ni())},[nl(VB,{neighbor:yi,onPing:Si,onDelete:Ci},null,8,["neighbor"])],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},ki(yi.node_name||"Unknown"),3),Ee("td",{class:Ga(`${ni()} text-white text-sm font-mono`)},[Ee("button",{onClick:gr=>Mr(yi.pubkey),class:Ga(["text-white hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60",r.value===yi.pubkey?"text-green-400 decoration-green-400/60":""]),title:r.value===yi.pubkey?"Copied!":"Click to copy full public key"},[il(ki(Z(yi.pubkey))+" ",1),r.value===yi.pubkey?(jr(),Kr("span",Ope,"✓")):Sa("",!0)],10,zpe)],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[yi.latitude!==null&&yi.longitude!==null?(jr(),Kr("div",Bpe,[Ee("span",Rpe,ki(yi.latitude.toFixed(4))+", "+ki(yi.longitude.toFixed(4)),1),Ee("div",Fpe,[Ee("button",{onClick:gr=>Dt(yi.latitude,yi.longitude),class:"text-white/60 hover:text-white transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},on[2]||(on[2]=[Ee("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Ee("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Npe),Ee("button",{onClick:gr=>Zt(yi.latitude,yi.longitude),class:"text-white/60 hover:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},on[3]||(on[3]=[Ee("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Ee("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,jpe)])])):(jr(),Kr("span",Upe,"Unknown"))],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},ki(it(yi)),3),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[Ee("span",{class:Ga(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",ue(yi.route_type).bgColor,ue(yi.route_type).borderColor,ue(yi.route_type).textColor])},ki(ue(yi.route_type).text),3)],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[Ee("span",{class:Ga(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",yi.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},ki(yi.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[Ee("div",$pe,[Ee("div",Hpe,[(jr(),Kr(js,null,au(5,gr=>Ee("div",{key:gr,class:Ga(["w-1 transition-colors",gr<=ze(yi.rssi).bars?ze(yi.rssi).color:"text-gray-600"]),style:om({height:`${4+gr*2}px`})},on[4]||(on[4]=[Ee("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Ee("span",{class:Ga(ze(yi.rssi).color)},ki(xe(yi.rssi)),3)])],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},ki(Se(yi.snr)),3),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[Ee("div",Vpe,[Ee("div",{class:Ga(["w-2 h-2 rounded-full",wt(yi.last_seen).color==="text-green-400"?"bg-green-400":"",wt(yi.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",wt(yi.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Ee("span",{class:Ga([wt(yi.last_seen).color,"cursor-help"]),title:$(yi.last_seen)},ki(bt(yi.last_seen)),11,Wpe)])],2),Ee("td",{class:Ga(`${ni()} text-white text-sm`)},[Ee("span",{title:$(yi.first_seen),class:"cursor-help"},ki(bt(yi.first_seen)),9,qpe)],2),Ee("td",{class:Ga(`${ni()} text-white text-sm text-center`)},ki(yi.advert_count),3)],40,Dpe))),128))])])]),Ee("div",Gpe,[(jr(!0),Kr(js,null,au(ri.adverts,yi=>(jr(),Kr("div",{key:yi.id,class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 hover:bg-white/5 transition-colors",onClick:gr=>Cr(yi.pubkey)},[Ee("div",Kpe,[Ee("div",Ype,[Ee("h4",Xpe,ki(yi.node_name||"Unknown Node"),1),Ee("div",Jpe,[Ee("span",{class:Ga(["inline-block px-2 py-1 rounded-full text-xs border",ue(yi.route_type).bgColor,ue(yi.route_type).borderColor,ue(yi.route_type).textColor])},ki(ue(yi.route_type).text),3),Ee("span",{class:Ga(["inline-block px-2 py-1 rounded-full text-xs border",yi.zero_hop?"bg-green-500/20 border-green-400/30 text-green-400":"bg-orange-500/20 border-orange-400/30 text-orange-400"])},ki(yi.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),nl(VB,{neighbor:yi,onPing:Si,onDelete:Ci},null,8,["neighbor"])]),Ee("div",Qpe,[Ee("div",e0e,[Ee("div",null,[on[5]||(on[5]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Public Key",-1)),Ee("button",{onClick:gr=>Mr(yi.pubkey),class:Ga(["text-white hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-white/30 hover:decoration-primary-light/60 break-all",r.value===yi.pubkey?"text-green-400 decoration-green-400/60":""]),title:r.value===yi.pubkey?"Copied!":"Click to copy full public key"},[il(ki(Z(yi.pubkey))+" ",1),r.value===yi.pubkey?(jr(),Kr("span",r0e,"✓")):Sa("",!0)],10,t0e)]),Ee("div",null,[on[7]||(on[7]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Signal",-1)),Ee("div",i0e,[Ee("div",n0e,[(jr(),Kr(js,null,au(5,gr=>Ee("div",{key:gr,class:Ga(["w-1.5 transition-colors",gr<=ze(yi.rssi).bars?ze(yi.rssi).color:"text-gray-600"]),style:om({height:`${6+gr*2}px`})},on[6]||(on[6]=[Ee("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),Ee("span",{class:Ga(`${ze(yi.rssi).color} text-sm font-medium`)},ki(xe(yi.rssi)),3)])])]),Ee("div",a0e,[Ee("div",null,[on[8]||(on[8]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Last Seen",-1)),Ee("div",o0e,[Ee("div",{class:Ga(["w-2 h-2 rounded-full",wt(yi.last_seen).color==="text-green-400"?"bg-green-400":"",wt(yi.last_seen).color==="text-yellow-400"?"bg-yellow-400":"",wt(yi.last_seen).color==="text-red-400"?"bg-red-400":""])},null,2),Ee("span",{class:Ga(`${wt(yi.last_seen).color} text-sm`),title:$(yi.last_seen)},ki(bt(yi.last_seen)),11,s0e)])]),Ee("div",null,[on[9]||(on[9]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Distance",-1)),Ee("span",l0e,ki(it(yi)),1)])]),yi.latitude!==null&&yi.longitude!==null?(jr(),Kr("div",u0e,[on[12]||(on[12]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Location",-1)),Ee("div",c0e,[Ee("span",h0e,ki(yi.latitude.toFixed(4))+", "+ki(yi.longitude.toFixed(4)),1),Ee("div",f0e,[Ee("button",{onClick:gr=>Dt(yi.latitude,yi.longitude),class:"text-white/60 hover:text-white transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Copy coordinates"},on[10]||(on[10]=[Ee("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),Ee("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,d0e),Ee("button",{onClick:gr=>Zt(yi.latitude,yi.longitude),class:"text-white/60 hover:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},on[11]||(on[11]=[Ee("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),Ee("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,p0e)])])])):Sa("",!0),Ee("div",m0e,[Ee("div",g0e,[on[13]||(on[13]=Ee("div",{class:"text-dark-text text-xs mb-1"},"SNR",-1)),Ee("span",v0e,ki(Se(yi.snr)),1)]),Ee("div",y0e,[on[14]||(on[14]=Ee("div",{class:"text-dark-text text-xs mb-1"},"Adverts",-1)),Ee("span",_0e,ki(yi.advert_count),1)]),Ee("div",x0e,[on[15]||(on[15]=Ee("div",{class:"text-dark-text text-xs mb-1"},"First Seen",-1)),Ee("span",{class:"text-white text-sm",title:$(yi.first_seen)},ki(bt(yi.first_seen)),9,b0e)])])])],8,Zpe))),128))])]))}}),k0e={class:"space-y-6"},T0e={key:0,class:"flex items-center justify-center py-12"},S0e={key:1,class:"bg-accent-red/10 border border-accent-red/20 rounded-[15px] p-6"},C0e={class:"flex items-center gap-3"},A0e={class:"text-accent-red/80 text-sm"},M0e={key:0,class:""},E0e={class:"flex items-center justify-between"},L0e={class:"flex items-center gap-3"},P0e={class:"hidden lg:flex bg-dark-card/30 backdrop-blur rounded-lg border border-white/10 mb p-1"},I0e={class:"flex items-center gap-2"},D0e={key:0,class:"ml-1 bg-accent-blue/20 text-accent-blue border border-accent-blue/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},z0e={class:"bg-dark-bg/30 border border-white/10 rounded-lg p-4 mt-4 space-y-4"},O0e={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},B0e={key:1,class:"text-center py-12"},R0e={key:2,class:"text-center py-12"},F0e=Bu({name:"NeighborsView",__name:"Neighbors",setup(t){const e=Ym(),r={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},c={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},S=fn({}),$=fn(!0),Z=fn(null),ue=fn(D1("neighbors_compactView",!1)),xe=fn(D1("neighbors_showMapLegend",typeof window<"u"?window.innerWidth>=1024:!0)),Se=fn(D1("neighbors_showFilters",!1)),Ne=fn(D1("neighbors_filters",{zeroHop:"all",routeType:"all",searchText:""}));Af(ue,ga=>z1("neighbors_compactView",ga)),Af(xe,ga=>z1("neighbors_showMapLegend",ga)),Af(Se,ga=>z1("neighbors_showFilters",ga)),Af(Ne,ga=>z1("neighbors_filters",ga),{deep:!0});const it=fn(!1),pt=fn(!1),bt=fn(!1),wt=fn(null),Dt=fn(null),Zt=fn(null),Mr=fn(null),ze=Io(()=>{if(!Mr.value)return null;const ga=Mr.value;return{id:ga.id,pubkey:ga.pubkey,node_name:ga.node_name,contact_type:ga.contact_type,latitude:ga.latitude,longitude:ga.longitude,rssi:ga.rssi,snr:ga.snr,route_type:ga.route_type,last_seen:ga.last_seen,first_seen:ga.first_seen,advert_count:ga.advert_count,timestamp:ga.timestamp,is_repeater:ga.is_repeater,is_new_neighbor:ga.is_new_neighbor,zero_hop:ga.zero_hop}}),ni=Io(()=>e.stats?.config?.repeater?.latitude),or=Io(()=>e.stats?.config?.repeater?.longitude),Cr=ga=>ga.filter(ya=>{if(Ne.value.zeroHop!=="all"){const ro=ya.zero_hop;if(Ne.value.zeroHop==="true"&&!ro||Ne.value.zeroHop==="false"&&ro)return!1}if(Ne.value.routeType!=="all"){const ro=ya.route_type;if(Ne.value.routeType==="direct"&&ro!==2||Ne.value.routeType==="transport_direct"&&ro!==3||Ne.value.routeType==="flood"&&ro!==1||Ne.value.routeType==="transport_flood"&&ro!==0)return!1}if(Ne.value.searchText){const ro=Ne.value.searchText.toLowerCase(),qn=ya.node_name?.toLowerCase()||"",ln=ya.pubkey.toLowerCase();if(!qn.includes(ro)&&!ln.includes(ro))return!1}return!0}),gi=()=>{Ne.value={zeroHop:"all",routeType:"all",searchText:""}},Si=Io(()=>Ne.value.zeroHop!=="all"||Ne.value.routeType!=="all"||Ne.value.searchText!==""),Ci=Io(()=>{const ga={};for(const[ya,ro]of Object.entries(S.value))ga[ya]=Cr(ro);return ga}),ri=Io(()=>Object.entries(r).filter(([ga])=>Ci.value[ga]?.length>0).sort(([ga],[ya])=>parseInt(ga)-parseInt(ya))),on=Io(()=>Object.values(S.value).flat().filter(ga=>{const ya=ga.latitude,ro=ga.longitude;return ya!=null&&ya!==0&&ro!==null&&ro!==void 0&&ro!==0&&typeof ya=="number"&&typeof ro=="number"&&!isNaN(ya)&&!isNaN(ro)})),yi=async ga=>{try{const ya=await bs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(ga)}&hours=168`);return ya.success&&Array.isArray(ya.data)?ya.data:[]}catch(ya){return console.error(`Error fetching adverts for contact type ${ga}:`,ya),[]}},gr=async()=>{$.value=!0,Z.value=null;try{S.value={};for(const[ga,ya]of Object.entries(r)){const ro=await yi(ya);ro.length>0&&(S.value[ga]=ro)}}catch(ga){console.error("Error loading adverts:",ga),Z.value=ga instanceof Error?ga.message:"Failed to load neighbor data"}finally{$.value=!1}},fr=fn(),Sr=ga=>{fr.value?.highlightNode(ga)},ei=ga=>{fr.value?.unhighlightNode(ga)},Jr=async ga=>{const ya=ga;wt.value=null,Dt.value=null,bt.value=!0,Zt.value=ya.node_name||"Unknown Node",pt.value=!0;try{const qn=`0x${parseInt(ya.pubkey.substring(0,2),16).toString(16).padStart(2,"0")}`;console.log(`Pinging neighbor ${ya.node_name||"Unknown"} (${qn})...`);const ln=await bs.pingNeighbor(qn,10);ln.success&&ln.data?(wt.value=ln.data,console.log("Ping successful:",ln.data)):(Dt.value=ln.error||"Unknown error occurred",console.error("Failed to ping neighbor:",ln.error))}catch(ro){console.error("Error pinging neighbor:",ro),Dt.value=ro instanceof Error?ro.message:"Unknown error occurred"}finally{bt.value=!1}},ti=()=>{pt.value=!1,wt.value=null,Dt.value=null,Zt.value=null},Di=ga=>{Mr.value=ga,it.value=!0},En=()=>{it.value=!1,Mr.value=null},Zn=async ga=>{try{await bs.deleteAdvert(ga),await gr(),En()}catch(ya){console.error("Error deleting neighbor:",ya)}};return Jf(async()=>{await gr()}),(ga,ya)=>(jr(),Kr("div",k0e,[$.value?(jr(),Kr("div",T0e,ya[7]||(ya[7]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),Ee("p",{class:"text-dark-text"},"Loading neighbor data...")],-1)]))):Z.value?(jr(),Kr("div",S0e,[Ee("div",C0e,[ya[9]||(ya[9]=Ee("svg",{class:"w-5 h-5 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Ee("div",null,[ya[8]||(ya[8]=Ee("h3",{class:"text-accent-red font-medium"},"Error Loading Neighbors",-1)),Ee("p",A0e,ki(Z.value),1)])])])):(jr(),Kr(js,{key:2},[nl(xpe,{ref_key:"networkMapRef",ref:fr,adverts:on.value,"base-latitude":ni.value,"base-longitude":or.value,"show-legend":xe.value,"onUpdate:showLegend":ya[0]||(ya[0]=ro=>xe.value=ro)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(S.value).length>0?(jr(),Kr("div",M0e,[Ee("div",E0e,[ya[14]||(ya[14]=Ee("span",{class:"text-white text-lg font-semibold"},null,-1)),Ee("div",L0e,[Ee("div",P0e,[Ee("button",{onClick:ya[1]||(ya[1]=ro=>ue.value=!1),class:Ga(["p-2 rounded-md transition-colors",ue.value?"text-white/60 hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},ya[10]||(ya[10]=[Ee("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),Ee("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),Ee("button",{onClick:ya[2]||(ya[2]=ro=>ue.value=!0),class:Ga(["p-2 rounded-md transition-colors",ue.value?"bg-primary/20 text-primary border border-primary/30":"text-white/60 hover:text-primary hover:bg-primary/10"]),title:"Compact view"},ya[11]||(ya[11]=[Ee("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Ee("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Ee("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),Ee("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),Ee("div",I0e,[Ee("button",{onClick:ya[3]||(ya[3]=ro=>Se.value=!Se.value),class:Ga(["px-3 py-1.5 text-xs rounded-lg transition-colors border",Si.value?"bg-primary/20 text-primary border-primary/30":"bg-white/10 text-white border-white/20 hover:bg-white/20"])},[ya[12]||(ya[12]=Ee("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),ya[13]||(ya[13]=il(" Filters ",-1)),Si.value?(jr(),Kr("span",D0e," Active ")):Sa("",!0)],2),Si.value?(jr(),Kr("button",{key:0,onClick:gi,class:"px-3 py-1.5 text-xs rounded-lg bg-white/10 text-white border border-white/20 hover:bg-white/20 transition-colors"}," Clear Filters ")):Sa("",!0)])])]),Sl(Ee("div",z0e,[Ee("div",O0e,[Ee("div",null,[ya[16]||(ya[16]=Ee("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Zero Hop",-1)),Sl(Ee("select",{"onUpdate:modelValue":ya[4]||(ya[4]=ro=>Ne.value.zeroHop=ro),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},ya[15]||(ya[15]=[Ee("option",{value:"all"},"All Nodes",-1),Ee("option",{value:"true"},"Zero Hop Only",-1),Ee("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[xg,Ne.value.zeroHop]])]),Ee("div",null,[ya[18]||(ya[18]=Ee("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Route Type",-1)),Sl(Ee("select",{"onUpdate:modelValue":ya[5]||(ya[5]=ro=>Ne.value.routeType=ro),class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none"},ya[17]||(ya[17]=[Dc('',5)]),512),[[xg,Ne.value.routeType]])]),Ee("div",null,[ya[19]||(ya[19]=Ee("label",{class:"block text-xs font-medium text-dark-text mb-1"},"Search",-1)),Sl(Ee("input",{"onUpdate:modelValue":ya[6]||(ya[6]=ro=>Ne.value.searchText=ro),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-dark-card/50 border border-white/20 rounded-lg px-3 py-2 text-white text-sm focus:border-primary/50 focus:outline-none placeholder-white/40"},null,512),[[sc,Ne.value.searchText]])])])],512),[[qy,Se.value]])])):Sa("",!0),(jr(!0),Kr(js,null,au(ri.value,([ro,qn])=>(jr(),Kr("div",{key:ro,class:"space-y-6"},[nl(w0e,{"contact-type":qn,"contact-type-key":ro,adverts:Ci.value[ro],"original-count":S.value[ro]?.length||0,color:c[parseInt(ro)],"base-latitude":ni.value,"base-longitude":or.value,"is-compact-view":ue.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:Sr,onUnhighlightNode:ei,onMenuPing:Jr,onMenuDelete:Di},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),ri.value.length===0&&Object.keys(S.value).length===0?(jr(),Kr("div",B0e,[ya[20]||(ya[20]=Dc('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),Ee("button",{onClick:gr,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):ri.value.length===0&&Si.value?(jr(),Kr("div",R0e,[ya[21]||(ya[21]=Dc('

No neighbors match your filters

Try adjusting your filter criteria to see more results.

',3)),Ee("button",{onClick:gi,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):Sa("",!0)],64)),nl(Ade,{show:it.value,neighbor:ze.value,onClose:En,onDelete:Zn},null,8,["show","neighbor"]),nl(ape,{show:pt.value,"node-name":Zt.value,result:wt.value,error:Dt.value,loading:bt.value,onClose:ti},null,8,["show","node-name","result","error","loading"])]))}});/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela * Released under the MIT License - */function n4(t){return t+.5|0}const i_=(t,e,r)=>Math.max(Math.min(t,r),e);function t5(t){return i_(n4(t*2.55),0,255)}function c_(t){return i_(n4(t*255),0,255)}function L1(t){return i_(n4(t/2.55)/100,0,1)}function HB(t){return i_(n4(t*100),0,100)}const sg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},YM=[..."0123456789ABCDEF"],R0e=t=>YM[t&15],F0e=t=>YM[(t&240)>>4]+YM[t&15],Ok=t=>(t&240)>>4===(t&15),N0e=t=>Ok(t.r)&&Ok(t.g)&&Ok(t.b)&&Ok(t.a);function j0e(t){var e=t.length,r;return t[0]==="#"&&(e===4||e===5?r={r:255&sg[t[1]]*17,g:255&sg[t[2]]*17,b:255&sg[t[3]]*17,a:e===5?sg[t[4]]*17:255}:(e===7||e===9)&&(r={r:sg[t[1]]<<4|sg[t[2]],g:sg[t[3]]<<4|sg[t[4]],b:sg[t[5]]<<4|sg[t[6]],a:e===9?sg[t[7]]<<4|sg[t[8]]:255})),r}const U0e=(t,e)=>t<255?e(t):"";function $0e(t){var e=N0e(t)?R0e:F0e;return t?"#"+e(t.r)+e(t.g)+e(t.b)+U0e(t.a,e):void 0}const H0e=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function o$(t,e,r){const c=e*Math.min(r,1-r),S=(H,Z=(H+t/30)%12)=>r-c*Math.max(Math.min(Z-3,9-Z,1),-1);return[S(0),S(8),S(4)]}function V0e(t,e,r){const c=(S,H=(S+t/60)%6)=>r-r*e*Math.max(Math.min(H,4-H,1),0);return[c(5),c(3),c(1)]}function W0e(t,e,r){const c=o$(t,1,.5);let S;for(e+r>1&&(S=1/(e+r),e*=S,r*=S),S=0;S<3;S++)c[S]*=1-e-r,c[S]+=e;return c}function q0e(t,e,r,c,S){return t===S?(e-r)/c+(e.5?Re/(2-H-Z):Re/(H+Z),be=q0e(r,c,S,Re,H),be=be*60+.5),[be|0,Se||0,ue]}function zE(t,e,r,c){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,r,c)).map(c_)}function OE(t,e,r){return zE(o$,t,e,r)}function G0e(t,e,r){return zE(W0e,t,e,r)}function Z0e(t,e,r){return zE(V0e,t,e,r)}function s$(t){return(t%360+360)%360}function K0e(t){const e=H0e.exec(t);let r=255,c;if(!e)return;e[5]!==c&&(r=e[6]?t5(+e[5]):c_(+e[5]));const S=s$(+e[2]),H=+e[3]/100,Z=+e[4]/100;return e[1]==="hwb"?c=G0e(S,H,Z):e[1]==="hsv"?c=Z0e(S,H,Z):c=OE(S,H,Z),{r:c[0],g:c[1],b:c[2],a:r}}function Y0e(t,e){var r=DE(t);r[0]=s$(r[0]+e),r=OE(r),t.r=r[0],t.g=r[1],t.b=r[2]}function X0e(t){if(!t)return;const e=DE(t),r=e[0],c=HB(e[1]),S=HB(e[2]);return t.a<255?`hsla(${r}, ${c}%, ${S}%, ${L1(t.a)})`:`hsl(${r}, ${c}%, ${S}%)`}const VB={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},WB={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function J0e(){const t={},e=Object.keys(WB),r=Object.keys(VB);let c,S,H,Z,ue;for(c=0;c>16&255,H>>8&255,H&255]}return t}let Bk;function Q0e(t){Bk||(Bk=J0e(),Bk.transparent=[0,0,0,0]);const e=Bk[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const eme=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function tme(t){const e=eme.exec(t);let r=255,c,S,H;if(e){if(e[7]!==c){const Z=+e[7];r=e[8]?t5(Z):i_(Z*255,0,255)}return c=+e[1],S=+e[3],H=+e[5],c=255&(e[2]?t5(c):i_(c,0,255)),S=255&(e[4]?t5(S):i_(S,0,255)),H=255&(e[6]?t5(H):i_(H,0,255)),{r:c,g:S,b:H,a:r}}}function rme(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${L1(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const E7=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,d2=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ime(t,e,r){const c=d2(L1(t.r)),S=d2(L1(t.g)),H=d2(L1(t.b));return{r:c_(E7(c+r*(d2(L1(e.r))-c))),g:c_(E7(S+r*(d2(L1(e.g))-S))),b:c_(E7(H+r*(d2(L1(e.b))-H))),a:t.a+r*(e.a-t.a)}}function Rk(t,e,r){if(t){let c=DE(t);c[e]=Math.max(0,Math.min(c[e]+c[e]*r,e===0?360:1)),c=OE(c),t.r=c[0],t.g=c[1],t.b=c[2]}}function l$(t,e){return t&&Object.assign(e||{},t)}function qB(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=c_(t[3]))):(e=l$(t,{r:0,g:0,b:0,a:1}),e.a=c_(e.a)),e}function nme(t){return t.charAt(0)==="r"?tme(t):K0e(t)}class R5{constructor(e){if(e instanceof R5)return e;const r=typeof e;let c;r==="object"?c=qB(e):r==="string"&&(c=j0e(e)||Q0e(e)||nme(e)),this._rgb=c,this._valid=!!c}get valid(){return this._valid}get rgb(){var e=l$(this._rgb);return e&&(e.a=L1(e.a)),e}set rgb(e){this._rgb=qB(e)}rgbString(){return this._valid?rme(this._rgb):void 0}hexString(){return this._valid?$0e(this._rgb):void 0}hslString(){return this._valid?X0e(this._rgb):void 0}mix(e,r){if(e){const c=this.rgb,S=e.rgb;let H;const Z=r===H?.5:r,ue=2*Z-1,be=c.a-S.a,Se=((ue*be===-1?ue:(ue+be)/(1+ue*be))+1)/2;H=1-Se,c.r=255&Se*c.r+H*S.r+.5,c.g=255&Se*c.g+H*S.g+.5,c.b=255&Se*c.b+H*S.b+.5,c.a=Z*c.a+(1-Z)*S.a,this.rgb=c}return this}interpolate(e,r){return e&&(this._rgb=ime(this._rgb,e._rgb,r)),this}clone(){return new R5(this.rgb)}alpha(e){return this._rgb.a=c_(e),this}clearer(e){const r=this._rgb;return r.a*=1-e,this}greyscale(){const e=this._rgb,r=n4(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=r,this}opaquer(e){const r=this._rgb;return r.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Rk(this._rgb,2,e),this}darken(e){return Rk(this._rgb,2,-e),this}saturate(e){return Rk(this._rgb,1,e),this}desaturate(e){return Rk(this._rgb,1,-e),this}rotate(e){return Y0e(this._rgb,e),this}}/*! + */function o4(t){return t+.5|0}const o_=(t,e,r)=>Math.max(Math.min(t,r),e);function i5(t){return o_(o4(t*2.55),0,255)}function d_(t){return o_(o4(t*255),0,255)}function E1(t){return o_(o4(t/2.55)/100,0,1)}function WB(t){return o_(o4(t*100),0,100)}const lg={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},JM=[..."0123456789ABCDEF"],N0e=t=>JM[t&15],j0e=t=>JM[(t&240)>>4]+JM[t&15],Rk=t=>(t&240)>>4===(t&15),U0e=t=>Rk(t.r)&&Rk(t.g)&&Rk(t.b)&&Rk(t.a);function $0e(t){var e=t.length,r;return t[0]==="#"&&(e===4||e===5?r={r:255&lg[t[1]]*17,g:255&lg[t[2]]*17,b:255&lg[t[3]]*17,a:e===5?lg[t[4]]*17:255}:(e===7||e===9)&&(r={r:lg[t[1]]<<4|lg[t[2]],g:lg[t[3]]<<4|lg[t[4]],b:lg[t[5]]<<4|lg[t[6]],a:e===9?lg[t[7]]<<4|lg[t[8]]:255})),r}const H0e=(t,e)=>t<255?e(t):"";function V0e(t){var e=U0e(t)?N0e:j0e;return t?"#"+e(t.r)+e(t.g)+e(t.b)+H0e(t.a,e):void 0}const W0e=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function u$(t,e,r){const c=e*Math.min(r,1-r),S=($,Z=($+t/30)%12)=>r-c*Math.max(Math.min(Z-3,9-Z,1),-1);return[S(0),S(8),S(4)]}function q0e(t,e,r){const c=(S,$=(S+t/60)%6)=>r-r*e*Math.max(Math.min($,4-$,1),0);return[c(5),c(3),c(1)]}function G0e(t,e,r){const c=u$(t,1,.5);let S;for(e+r>1&&(S=1/(e+r),e*=S,r*=S),S=0;S<3;S++)c[S]*=1-e-r,c[S]+=e;return c}function Z0e(t,e,r,c,S){return t===S?(e-r)/c+(e.5?Ne/(2-$-Z):Ne/($+Z),xe=Z0e(r,c,S,Ne,$),xe=xe*60+.5),[xe|0,Se||0,ue]}function BE(t,e,r,c){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,r,c)).map(d_)}function RE(t,e,r){return BE(u$,t,e,r)}function K0e(t,e,r){return BE(G0e,t,e,r)}function Y0e(t,e,r){return BE(q0e,t,e,r)}function c$(t){return(t%360+360)%360}function X0e(t){const e=W0e.exec(t);let r=255,c;if(!e)return;e[5]!==c&&(r=e[6]?i5(+e[5]):d_(+e[5]));const S=c$(+e[2]),$=+e[3]/100,Z=+e[4]/100;return e[1]==="hwb"?c=K0e(S,$,Z):e[1]==="hsv"?c=Y0e(S,$,Z):c=RE(S,$,Z),{r:c[0],g:c[1],b:c[2],a:r}}function J0e(t,e){var r=OE(t);r[0]=c$(r[0]+e),r=RE(r),t.r=r[0],t.g=r[1],t.b=r[2]}function Q0e(t){if(!t)return;const e=OE(t),r=e[0],c=WB(e[1]),S=WB(e[2]);return t.a<255?`hsla(${r}, ${c}%, ${S}%, ${E1(t.a)})`:`hsl(${r}, ${c}%, ${S}%)`}const qB={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},GB={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function eme(){const t={},e=Object.keys(GB),r=Object.keys(qB);let c,S,$,Z,ue;for(c=0;c>16&255,$>>8&255,$&255]}return t}let Fk;function tme(t){Fk||(Fk=eme(),Fk.transparent=[0,0,0,0]);const e=Fk[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const rme=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ime(t){const e=rme.exec(t);let r=255,c,S,$;if(e){if(e[7]!==c){const Z=+e[7];r=e[8]?i5(Z):o_(Z*255,0,255)}return c=+e[1],S=+e[3],$=+e[5],c=255&(e[2]?i5(c):o_(c,0,255)),S=255&(e[4]?i5(S):o_(S,0,255)),$=255&(e[6]?i5($):o_($,0,255)),{r:c,g:S,b:$,a:r}}}function nme(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${E1(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const P7=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,p2=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function ame(t,e,r){const c=p2(E1(t.r)),S=p2(E1(t.g)),$=p2(E1(t.b));return{r:d_(P7(c+r*(p2(E1(e.r))-c))),g:d_(P7(S+r*(p2(E1(e.g))-S))),b:d_(P7($+r*(p2(E1(e.b))-$))),a:t.a+r*(e.a-t.a)}}function Nk(t,e,r){if(t){let c=OE(t);c[e]=Math.max(0,Math.min(c[e]+c[e]*r,e===0?360:1)),c=RE(c),t.r=c[0],t.g=c[1],t.b=c[2]}}function h$(t,e){return t&&Object.assign(e||{},t)}function ZB(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=d_(t[3]))):(e=h$(t,{r:0,g:0,b:0,a:1}),e.a=d_(e.a)),e}function ome(t){return t.charAt(0)==="r"?ime(t):X0e(t)}class N5{constructor(e){if(e instanceof N5)return e;const r=typeof e;let c;r==="object"?c=ZB(e):r==="string"&&(c=$0e(e)||tme(e)||ome(e)),this._rgb=c,this._valid=!!c}get valid(){return this._valid}get rgb(){var e=h$(this._rgb);return e&&(e.a=E1(e.a)),e}set rgb(e){this._rgb=ZB(e)}rgbString(){return this._valid?nme(this._rgb):void 0}hexString(){return this._valid?V0e(this._rgb):void 0}hslString(){return this._valid?Q0e(this._rgb):void 0}mix(e,r){if(e){const c=this.rgb,S=e.rgb;let $;const Z=r===$?.5:r,ue=2*Z-1,xe=c.a-S.a,Se=((ue*xe===-1?ue:(ue+xe)/(1+ue*xe))+1)/2;$=1-Se,c.r=255&Se*c.r+$*S.r+.5,c.g=255&Se*c.g+$*S.g+.5,c.b=255&Se*c.b+$*S.b+.5,c.a=Z*c.a+(1-Z)*S.a,this.rgb=c}return this}interpolate(e,r){return e&&(this._rgb=ame(this._rgb,e._rgb,r)),this}clone(){return new N5(this.rgb)}alpha(e){return this._rgb.a=d_(e),this}clearer(e){const r=this._rgb;return r.a*=1-e,this}greyscale(){const e=this._rgb,r=o4(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=r,this}opaquer(e){const r=this._rgb;return r.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Nk(this._rgb,2,e),this}darken(e){return Nk(this._rgb,2,-e),this}saturate(e){return Nk(this._rgb,1,e),this}desaturate(e){return Nk(this._rgb,1,-e),this}rotate(e){return J0e(this._rgb,e),this}}/*! * Chart.js v4.5.1 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License - */function v1(){}const ame=(()=>{let t=0;return()=>t++})();function Kh(t){return t==null}function bp(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Fc(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function H0(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function pv(t,e){return H0(t)?t:e}function _c(t,e){return typeof t>"u"?e:t}const ome=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,u$=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Zf(t,e,r){if(t&&typeof t.call=="function")return t.apply(r,e)}function uf(t,e,r,c){let S,H,Z;if(bp(t))for(H=t.length,S=0;St,x:t=>t.x,y:t=>t.y};function ume(t){const e=t.split("."),r=[];let c="";for(const S of e)c+=S,c.endsWith("\\")?c=c.slice(0,-1)+".":(r.push(c),c="");return r}function cme(t){const e=ume(t);return r=>{for(const c of e){if(c==="")break;r=r&&r[c]}return r}}function Nx(t,e){return(GB[e]||(GB[e]=cme(e)))(t)}function BE(t){return t.charAt(0).toUpperCase()+t.slice(1)}const N5=t=>typeof t<"u",p_=t=>typeof t=="function",ZB=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0};function hme(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const cf=Math.PI,Cd=2*cf,fme=Cd+cf,HT=Number.POSITIVE_INFINITY,dme=cf/180,Dp=cf/2,sx=cf/4,KB=cf*2/3,h$=Math.log10,Lv=Math.sign;function x5(t,e,r){return Math.abs(t-e)S-H).pop(),e}function mme(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function j5(t){return!mme(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function gme(t,e){const r=Math.round(t);return r-e<=t&&r+e>=t}function vme(t,e,r){let c,S,H;for(c=0,S=t.length;cbe&&Se=Math.min(e,r)-c&&t<=Math.max(e,r)+c}function RE(t,e,r){r=r||(Z=>t[Z]1;)H=S+c>>1,r(H)?S=H:c=H;return{lo:S,hi:c}}const Tx=(t,e,r,c)=>RE(t,r,c?S=>{const H=t[S][e];return Ht[S][e]RE(t,r,c=>t[c][e]>=r);function wme(t,e,r){let c=0,S=t.length;for(;cc&&t[S-1]>r;)S--;return c>0||S{const c="_onData"+BE(r),S=t[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value(...H){const Z=S.apply(this,H);return t._chartjs.listeners.forEach(ue=>{typeof ue[c]=="function"&&ue[c](...H)}),Z}})})}function JB(t,e){const r=t._chartjs;if(!r)return;const c=r.listeners,S=c.indexOf(e);S!==-1&&c.splice(S,1),!(c.length>0)&&(d$.forEach(H=>{delete t[H]}),delete t._chartjs)}function p$(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const m$=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function g$(t,e){let r=[],c=!1;return function(...S){r=S,c||(c=!0,m$.call(window,()=>{c=!1,t.apply(e,r)}))}}function Tme(t,e){let r;return function(...c){return e?(clearTimeout(r),r=setTimeout(t,e,c)):t.apply(this,c),e}}const FE=t=>t==="start"?"left":t==="end"?"right":"center",z0=(t,e,r)=>t==="start"?e:t==="end"?r:(e+r)/2,Sme=(t,e,r,c)=>t===(c?"left":"right")?r:t==="center"?(e+r)/2:e;function Cme(t,e,r){const c=e.length;let S=0,H=c;if(t._sorted){const{iScale:Z,vScale:ue,_parsed:be}=t,Se=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,Re=Z.axis,{min:Xe,max:vt,minDefined:bt,maxDefined:kt}=Z.getUserBounds();if(bt){if(S=Math.min(Tx(be,Re,Xe).lo,r?c:Tx(e,Re,Z.getPixelForValue(Xe)).lo),Se){const Dt=be.slice(0,S+1).reverse().findIndex(rr=>!Kh(rr[ue.axis]));S-=Math.max(0,Dt)}S=U0(S,0,c-1)}if(kt){let Dt=Math.max(Tx(be,Z.axis,vt,!0).hi+1,r?0:Tx(e,Re,Z.getPixelForValue(vt),!0).hi+1);if(Se){const rr=be.slice(Dt-1).findIndex(Er=>!Kh(Er[ue.axis]));Dt+=Math.max(0,rr)}H=U0(Dt,S,c)-S}else H=c-S}return{start:S,count:H}}function Ame(t){const{xScale:e,yScale:r,_scaleRanges:c}=t,S={xmin:e.min,xmax:e.max,ymin:r.min,ymax:r.max};if(!c)return t._scaleRanges=S,!0;const H=c.xmin!==e.min||c.xmax!==e.max||c.ymin!==r.min||c.ymax!==r.max;return Object.assign(c,S),H}const Fk=t=>t===0||t===1,QB=(t,e,r)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Cd/r)),eR=(t,e,r)=>Math.pow(2,-10*t)*Math.sin((t-e)*Cd/r)+1,b5={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Dp)+1,easeOutSine:t=>Math.sin(t*Dp),easeInOutSine:t=>-.5*(Math.cos(cf*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Fk(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Fk(t)?t:QB(t,.075,.3),easeOutElastic:t=>Fk(t)?t:eR(t,.075,.3),easeInOutElastic(t){return Fk(t)?t:t<.5?.5*QB(t*2,.1125,.45):.5+.5*eR(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-b5.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?b5.easeInBounce(t*2)*.5:b5.easeOutBounce(t*2-1)*.5+.5};function NE(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function tR(t){return NE(t)?t:new R5(t)}function L7(t){return NE(t)?t:new R5(t).saturate(.5).darken(.1).hexString()}const Mme=["x","y","borderWidth","radius","tension"],Eme=["color","borderColor","backgroundColor"];function Lme(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Eme},numbers:{type:"number",properties:Mme}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Pme(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rR=new Map;function Ime(t,e){e=e||{};const r=t+JSON.stringify(e);let c=rR.get(r);return c||(c=new Intl.NumberFormat(t,e),rR.set(r,c)),c}function jE(t,e,r){return Ime(e,r).format(t)}const Dme={values(t){return bp(t)?t:""+t},numeric(t,e,r){if(t===0)return"0";const c=this.chart.options.locale;let S,H=t;if(r.length>1){const Se=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(Se<1e-4||Se>1e15)&&(S="scientific"),H=zme(t,r)}const Z=h$(Math.abs(H)),ue=isNaN(Z)?1:Math.max(Math.min(-1*Math.floor(Z),20),0),be={notation:S,minimumFractionDigits:ue,maximumFractionDigits:ue};return Object.assign(be,this.options.ticks.format),jE(t,c,be)}};function zme(t,e){let r=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(r)>=1&&t!==Math.floor(t)&&(r=t-Math.floor(t)),r}var v$={formatters:Dme};function Ome(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,r)=>r.lineWidth,tickColor:(e,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:v$.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const jx=Object.create(null),JM=Object.create(null);function w5(t,e){if(!e)return t;const r=e.split(".");for(let c=0,S=r.length;cc.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(c,S)=>L7(S.backgroundColor),this.hoverBorderColor=(c,S)=>L7(S.borderColor),this.hoverColor=(c,S)=>L7(S.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(r)}set(e,r){return P7(this,e,r)}get(e){return w5(this,e)}describe(e,r){return P7(JM,e,r)}override(e,r){return P7(jx,e,r)}route(e,r,c,S){const H=w5(this,e),Z=w5(this,c),ue="_"+r;Object.defineProperties(H,{[ue]:{value:H[r],writable:!0},[r]:{enumerable:!0,get(){const be=this[ue],Se=Z[S];return Fc(be)?Object.assign({},Se,be):_c(be,Se)},set(be){this[ue]=be}}})}apply(e){e.forEach(r=>r(this))}}var op=new Bme({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Lme,Pme,Ome]);function Rme(t){return!t||Kh(t.size)||Kh(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function iR(t,e,r,c,S){let H=e[S];return H||(H=e[S]=t.measureText(S).width,r.push(S)),H>c&&(c=H),c}function lx(t,e,r){const c=t.currentDevicePixelRatio,S=r!==0?Math.max(r/2,.5):0;return Math.round((e-S)*c)/c+S}function nR(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function QM(t,e,r,c){y$(t,e,r,c,null)}function y$(t,e,r,c,S){let H,Z,ue,be,Se,Re,Xe,vt;const bt=e.pointStyle,kt=e.rotation,Dt=e.radius;let rr=(kt||0)*dme;if(bt&&typeof bt=="object"&&(H=bt.toString(),H==="[object HTMLImageElement]"||H==="[object HTMLCanvasElement]")){t.save(),t.translate(r,c),t.rotate(rr),t.drawImage(bt,-bt.width/2,-bt.height/2,bt.width,bt.height),t.restore();return}if(!(isNaN(Dt)||Dt<=0)){switch(t.beginPath(),bt){default:S?t.ellipse(r,c,S/2,Dt,0,0,Cd):t.arc(r,c,Dt,0,Cd),t.closePath();break;case"triangle":Re=S?S/2:Dt,t.moveTo(r+Math.sin(rr)*Re,c-Math.cos(rr)*Dt),rr+=KB,t.lineTo(r+Math.sin(rr)*Re,c-Math.cos(rr)*Dt),rr+=KB,t.lineTo(r+Math.sin(rr)*Re,c-Math.cos(rr)*Dt),t.closePath();break;case"rectRounded":Se=Dt*.516,be=Dt-Se,Z=Math.cos(rr+sx)*be,Xe=Math.cos(rr+sx)*(S?S/2-Se:be),ue=Math.sin(rr+sx)*be,vt=Math.sin(rr+sx)*(S?S/2-Se:be),t.arc(r-Xe,c-ue,Se,rr-cf,rr-Dp),t.arc(r+vt,c-Z,Se,rr-Dp,rr),t.arc(r+Xe,c+ue,Se,rr,rr+Dp),t.arc(r-vt,c+Z,Se,rr+Dp,rr+cf),t.closePath();break;case"rect":if(!kt){be=Math.SQRT1_2*Dt,Re=S?S/2:be,t.rect(r-Re,c-be,2*Re,2*be);break}rr+=sx;case"rectRot":Xe=Math.cos(rr)*(S?S/2:Dt),Z=Math.cos(rr)*Dt,ue=Math.sin(rr)*Dt,vt=Math.sin(rr)*(S?S/2:Dt),t.moveTo(r-Xe,c-ue),t.lineTo(r+vt,c-Z),t.lineTo(r+Xe,c+ue),t.lineTo(r-vt,c+Z),t.closePath();break;case"crossRot":rr+=sx;case"cross":Xe=Math.cos(rr)*(S?S/2:Dt),Z=Math.cos(rr)*Dt,ue=Math.sin(rr)*Dt,vt=Math.sin(rr)*(S?S/2:Dt),t.moveTo(r-Xe,c-ue),t.lineTo(r+Xe,c+ue),t.moveTo(r+vt,c-Z),t.lineTo(r-vt,c+Z);break;case"star":Xe=Math.cos(rr)*(S?S/2:Dt),Z=Math.cos(rr)*Dt,ue=Math.sin(rr)*Dt,vt=Math.sin(rr)*(S?S/2:Dt),t.moveTo(r-Xe,c-ue),t.lineTo(r+Xe,c+ue),t.moveTo(r+vt,c-Z),t.lineTo(r-vt,c+Z),rr+=sx,Xe=Math.cos(rr)*(S?S/2:Dt),Z=Math.cos(rr)*Dt,ue=Math.sin(rr)*Dt,vt=Math.sin(rr)*(S?S/2:Dt),t.moveTo(r-Xe,c-ue),t.lineTo(r+Xe,c+ue),t.moveTo(r+vt,c-Z),t.lineTo(r-vt,c+Z);break;case"line":Z=S?S/2:Math.cos(rr)*Dt,ue=Math.sin(rr)*Dt,t.moveTo(r-Z,c-ue),t.lineTo(r+Z,c+ue);break;case"dash":t.moveTo(r,c),t.lineTo(r+Math.cos(rr)*(S?S/2:Dt),c+Math.sin(rr)*Dt);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function $5(t,e,r){return r=r||.5,!e||t&&t.x>e.left-r&&t.xe.top-r&&t.y0&&H.strokeColor!=="";let be,Se;for(t.save(),t.font=S.string,jme(t,H),be=0;be+t||0;function UE(t,e){const r={},c=Fc(e),S=c?Object.keys(e):e,H=Fc(t)?c?Z=>_c(t[Z],t[e[Z]]):Z=>t[Z]:()=>t;for(const Z of S)r[Z]=qme(H(Z));return r}function _$(t){return UE(t,{top:"y",right:"x",bottom:"y",left:"x"})}function P2(t){return UE(t,["topLeft","topRight","bottomLeft","bottomRight"])}function wg(t){const e=_$(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $0(t,e){t=t||{},e=e||op.font;let r=_c(t.size,e.size);typeof r=="string"&&(r=parseInt(r,10));let c=_c(t.style,e.style);c&&!(""+c).match(Vme)&&(console.warn('Invalid font style specified: "'+c+'"'),c=void 0);const S={family:_c(t.family,e.family),lineHeight:Wme(_c(t.lineHeight,e.lineHeight),r),size:r,style:c,weight:_c(t.weight,e.weight),string:""};return S.string=Rme(S),S}function Nk(t,e,r,c){let S,H,Z;for(S=0,H=t.length;Sr&&ue===0?0:ue+be;return{min:Z(c,-Math.abs(H)),max:Z(S,H)}}function Vx(t,e){return Object.assign(Object.create(t),e)}function $E(t,e=[""],r,c,S=()=>t[0]){const H=r||t;typeof c>"u"&&(c=k$("_fallback",t));const Z={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:H,_fallback:c,_getTarget:S,override:ue=>$E([ue,...t],e,H,c)};return new Proxy(Z,{deleteProperty(ue,be){return delete ue[be],delete ue._keys,delete t[0][be],!0},get(ue,be){return b$(ue,be,()=>tge(be,e,t,ue))},getOwnPropertyDescriptor(ue,be){return Reflect.getOwnPropertyDescriptor(ue._scopes[0],be)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(ue,be){return oR(ue).includes(be)},ownKeys(ue){return oR(ue)},set(ue,be,Se){const Re=ue._storage||(ue._storage=S());return ue[be]=Re[be]=Se,delete ue._keys,!0}})}function j2(t,e,r,c){const S={_cacheable:!1,_proxy:t,_context:e,_subProxy:r,_stack:new Set,_descriptors:x$(t,c),setContext:H=>j2(t,H,r,c),override:H=>j2(t.override(H),e,r,c)};return new Proxy(S,{deleteProperty(H,Z){return delete H[Z],delete t[Z],!0},get(H,Z,ue){return b$(H,Z,()=>Kme(H,Z,ue))},getOwnPropertyDescriptor(H,Z){return H._descriptors.allKeys?Reflect.has(t,Z)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,Z)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(H,Z){return Reflect.has(t,Z)},ownKeys(){return Reflect.ownKeys(t)},set(H,Z,ue){return t[Z]=ue,delete H[Z],!0}})}function x$(t,e={scriptable:!0,indexable:!0}){const{_scriptable:r=e.scriptable,_indexable:c=e.indexable,_allKeys:S=e.allKeys}=t;return{allKeys:S,scriptable:r,indexable:c,isScriptable:p_(r)?r:()=>r,isIndexable:p_(c)?c:()=>c}}const Zme=(t,e)=>t?t+BE(e):e,HE=(t,e)=>Fc(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function b$(t,e,r){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const c=r();return t[e]=c,c}function Kme(t,e,r){const{_proxy:c,_context:S,_subProxy:H,_descriptors:Z}=t;let ue=c[e];return p_(ue)&&Z.isScriptable(e)&&(ue=Yme(e,ue,t,r)),bp(ue)&&ue.length&&(ue=Xme(e,ue,t,Z.isIndexable)),HE(e,ue)&&(ue=j2(ue,S,H&&H[e],Z)),ue}function Yme(t,e,r,c){const{_proxy:S,_context:H,_subProxy:Z,_stack:ue}=r;if(ue.has(t))throw new Error("Recursion detected: "+Array.from(ue).join("->")+"->"+t);ue.add(t);let be=e(H,Z||c);return ue.delete(t),HE(t,be)&&(be=VE(S._scopes,S,t,be)),be}function Xme(t,e,r,c){const{_proxy:S,_context:H,_subProxy:Z,_descriptors:ue}=r;if(typeof H.index<"u"&&c(t))return e[H.index%e.length];if(Fc(e[0])){const be=e,Se=S._scopes.filter(Re=>Re!==be);e=[];for(const Re of be){const Xe=VE(Se,S,t,Re);e.push(j2(Xe,H,Z&&Z[t],ue))}}return e}function w$(t,e,r){return p_(t)?t(e,r):t}const Jme=(t,e)=>t===!0?e:typeof t=="string"?Nx(e,t):void 0;function Qme(t,e,r,c,S){for(const H of e){const Z=Jme(r,H);if(Z){t.add(Z);const ue=w$(Z._fallback,r,S);if(typeof ue<"u"&&ue!==r&&ue!==c)return ue}else if(Z===!1&&typeof c<"u"&&r!==c)return null}return!1}function VE(t,e,r,c){const S=e._rootScopes,H=w$(e._fallback,r,c),Z=[...t,...S],ue=new Set;ue.add(c);let be=aR(ue,Z,r,H||r,c);return be===null||typeof H<"u"&&H!==r&&(be=aR(ue,Z,H,be,c),be===null)?!1:$E(Array.from(ue),[""],S,H,()=>ege(e,r,c))}function aR(t,e,r,c,S){for(;r;)r=Qme(t,e,r,c,S);return r}function ege(t,e,r){const c=t._getTarget();e in c||(c[e]={});const S=c[e];return bp(S)&&Fc(r)?r:S||{}}function tge(t,e,r,c){let S;for(const H of e)if(S=k$(Zme(H,t),r),typeof S<"u")return HE(t,S)?VE(r,c,t,S):S}function k$(t,e){for(const r of e){if(!r)continue;const c=r[t];if(typeof c<"u")return c}}function oR(t){let e=t._keys;return e||(e=t._keys=rge(t._scopes)),e}function rge(t){const e=new Set;for(const r of t)for(const c of Object.keys(r).filter(S=>!S.startsWith("_")))e.add(c);return Array.from(e)}const ige=Number.EPSILON||1e-14,U2=(t,e)=>et==="x"?"y":"x";function nge(t,e,r,c){const S=t.skip?e:t,H=e,Z=r.skip?e:r,ue=XM(H,S),be=XM(Z,H);let Se=ue/(ue+be),Re=be/(ue+be);Se=isNaN(Se)?0:Se,Re=isNaN(Re)?0:Re;const Xe=c*Se,vt=c*Re;return{previous:{x:H.x-Xe*(Z.x-S.x),y:H.y-Xe*(Z.y-S.y)},next:{x:H.x+vt*(Z.x-S.x),y:H.y+vt*(Z.y-S.y)}}}function age(t,e,r){const c=t.length;let S,H,Z,ue,be,Se=U2(t,0);for(let Re=0;Re!Se.skip)),e.cubicInterpolationMode==="monotone")sge(t,S);else{let Se=c?t[t.length-1]:t[0];for(H=0,Z=t.length;Ht.ownerDocument.defaultView.getComputedStyle(t,null);function cge(t,e){return OS(t).getPropertyValue(e)}const hge=["top","right","bottom","left"];function Lx(t,e,r){const c={};r=r?"-"+r:"";for(let S=0;S<4;S++){const H=hge[S];c[H]=parseFloat(t[e+"-"+H+r])||0}return c.width=c.left+c.right,c.height=c.top+c.bottom,c}const fge=(t,e,r)=>(t>0||e>0)&&(!r||!r.shadowRoot);function dge(t,e){const r=t.touches,c=r&&r.length?r[0]:t,{offsetX:S,offsetY:H}=c;let Z=!1,ue,be;if(fge(S,H,t.target))ue=S,be=H;else{const Se=e.getBoundingClientRect();ue=c.clientX-Se.left,be=c.clientY-Se.top,Z=!0}return{x:ue,y:be,box:Z}}function px(t,e){if("native"in t)return t;const{canvas:r,currentDevicePixelRatio:c}=e,S=OS(r),H=S.boxSizing==="border-box",Z=Lx(S,"padding"),ue=Lx(S,"border","width"),{x:be,y:Se,box:Re}=dge(t,r),Xe=Z.left+(Re&&ue.left),vt=Z.top+(Re&&ue.top);let{width:bt,height:kt}=e;return H&&(bt-=Z.width+ue.width,kt-=Z.height+ue.height),{x:Math.round((be-Xe)/bt*r.width/c),y:Math.round((Se-vt)/kt*r.height/c)}}function pge(t,e,r){let c,S;if(e===void 0||r===void 0){const H=t&&qE(t);if(!H)e=t.clientWidth,r=t.clientHeight;else{const Z=H.getBoundingClientRect(),ue=OS(H),be=Lx(ue,"border","width"),Se=Lx(ue,"padding");e=Z.width-Se.width-be.width,r=Z.height-Se.height-be.height,c=WT(ue.maxWidth,H,"clientWidth"),S=WT(ue.maxHeight,H,"clientHeight")}}return{width:e,height:r,maxWidth:c||HT,maxHeight:S||HT}}const n_=t=>Math.round(t*10)/10;function mge(t,e,r,c){const S=OS(t),H=Lx(S,"margin"),Z=WT(S.maxWidth,t,"clientWidth")||HT,ue=WT(S.maxHeight,t,"clientHeight")||HT,be=pge(t,e,r);let{width:Se,height:Re}=be;if(S.boxSizing==="content-box"){const vt=Lx(S,"border","width"),bt=Lx(S,"padding");Se-=bt.width+vt.width,Re-=bt.height+vt.height}return Se=Math.max(0,Se-H.width),Re=Math.max(0,c?Se/c:Re-H.height),Se=n_(Math.min(Se,Z,be.maxWidth)),Re=n_(Math.min(Re,ue,be.maxHeight)),Se&&!Re&&(Re=n_(Se/2)),(e!==void 0||r!==void 0)&&c&&be.height&&Re>be.height&&(Re=be.height,Se=n_(Math.floor(Re*c))),{width:Se,height:Re}}function sR(t,e,r){const c=e||1,S=n_(t.height*c),H=n_(t.width*c);t.height=n_(t.height),t.width=n_(t.width);const Z=t.canvas;return Z.style&&(r||!Z.style.height&&!Z.style.width)&&(Z.style.height=`${t.height}px`,Z.style.width=`${t.width}px`),t.currentDevicePixelRatio!==c||Z.height!==S||Z.width!==H?(t.currentDevicePixelRatio=c,Z.height=S,Z.width=H,t.ctx.setTransform(c,0,0,c,0,0),!0):!1}const gge=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};WE()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function lR(t,e){const r=cge(t,e),c=r&&r.match(/^(\d+)(\.\d+)?px$/);return c?+c[1]:void 0}function mx(t,e,r,c){return{x:t.x+r*(e.x-t.x),y:t.y+r*(e.y-t.y)}}function vge(t,e,r,c){return{x:t.x+r*(e.x-t.x),y:c==="middle"?r<.5?t.y:e.y:c==="after"?r<1?t.y:e.y:r>0?e.y:t.y}}function yge(t,e,r,c){const S={x:t.cp2x,y:t.cp2y},H={x:e.cp1x,y:e.cp1y},Z=mx(t,S,r),ue=mx(S,H,r),be=mx(H,e,r),Se=mx(Z,ue,r),Re=mx(ue,be,r);return mx(Se,Re,r)}const _ge=function(t,e){return{x(r){return t+t+e-r},setWidth(r){e=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,c){return r-c},leftForLtr(r,c){return r-c}}},xge=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function I2(t,e,r){return t?_ge(e,r):xge()}function S$(t,e){let r,c;(e==="ltr"||e==="rtl")&&(r=t.canvas.style,c=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=c)}function C$(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function A$(t){return t==="angle"?{between:U5,compare:_me,normalize:Zm}:{between:O1,compare:(e,r)=>e-r,normalize:e=>e}}function uR({start:t,end:e,count:r,loop:c,style:S}){return{start:t%r,end:e%r,loop:c&&(e-t+1)%r===0,style:S}}function bge(t,e,r){const{property:c,start:S,end:H}=r,{between:Z,normalize:ue}=A$(c),be=e.length;let{start:Se,end:Re,loop:Xe}=t,vt,bt;if(Xe){for(Se+=be,Re+=be,vt=0,bt=be;vtbe(S,wi,Er)&&ue(S,wi)!==0,Ir=()=>ue(H,Er)===0||be(H,wi,Er),Ti=()=>Dt||ur(),_i=()=>!Dt||Ir();for(let Ci=Re,ii=Re;Ci<=Xe;++Ci)Fe=e[Ci%Z],!Fe.skip&&(Er=Se(Fe[c]),Er!==wi&&(Dt=be(Er,S,H),rr===null&&Ti()&&(rr=ue(Er,S)===0?Ci:ii),rr!==null&&_i()&&(kt.push(uR({start:rr,end:Ci,loop:vt,count:Z,style:bt})),rr=null),ii=Ci,wi=Er));return rr!==null&&kt.push(uR({start:rr,end:Xe,loop:vt,count:Z,style:bt})),kt}function E$(t,e){const r=[],c=t.segments;for(let S=0;SS&&t[H%e].skip;)H--;return H%=e,{start:S,end:H}}function kge(t,e,r,c){const S=t.length,H=[];let Z=e,ue=t[e],be;for(be=e+1;be<=r;++be){const Se=t[be%S];Se.skip||Se.stop?ue.skip||(c=!1,H.push({start:e%S,end:(be-1)%S,loop:c}),e=Z=Se.stop?be:null):(Z=be,ue.skip&&(e=be)),ue=Se}return Z!==null&&H.push({start:e%S,end:Z%S,loop:c}),H}function Tge(t,e){const r=t.points,c=t.options.spanGaps,S=r.length;if(!S)return[];const H=!!t._loop,{start:Z,end:ue}=wge(r,S,H,c);if(c===!0)return cR(t,[{start:Z,end:ue,loop:H}],r,e);const be=ue{let t=0;return()=>t++})();function Kh(t){return t==null}function wp(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Nc(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function H0(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function pv(t,e){return H0(t)?t:e}function _c(t,e){return typeof t>"u"?e:t}const lme=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,f$=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Kf(t,e,r){if(t&&typeof t.call=="function")return t.apply(r,e)}function uf(t,e,r,c){let S,$,Z;if(wp(t))for($=t.length,S=0;S<$;S++)e.call(r,t[S],S);else if(Nc(t))for(Z=Object.keys(t),$=Z.length,S=0;S<$;S++)e.call(r,t[Z[S]],Z[S])}function HT(t,e){let r,c,S,$;if(!t||!e||t.length!==e.length)return!1;for(r=0,c=t.length;rt,x:t=>t.x,y:t=>t.y};function hme(t){const e=t.split("."),r=[];let c="";for(const S of e)c+=S,c.endsWith("\\")?c=c.slice(0,-1)+".":(r.push(c),c="");return r}function fme(t){const e=hme(t);return r=>{for(const c of e){if(c==="")break;r=r&&r[c]}return r}}function jx(t,e){return(KB[e]||(KB[e]=fme(e)))(t)}function FE(t){return t.charAt(0).toUpperCase()+t.slice(1)}const U5=t=>typeof t<"u",y_=t=>typeof t=="function",YB=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0};function dme(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const cf=Math.PI,Ad=2*cf,pme=Ad+cf,WT=Number.POSITIVE_INFINITY,mme=cf/180,zp=cf/2,hx=cf/4,XB=cf*2/3,p$=Math.log10,Lv=Math.sign;function w5(t,e,r){return Math.abs(t-e)S-$).pop(),e}function vme(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function $5(t){return!vme(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function yme(t,e){const r=Math.round(t);return r-e<=t&&r+e>=t}function _me(t,e,r){let c,S,$;for(c=0,S=t.length;cxe&&Se=Math.min(e,r)-c&&t<=Math.max(e,r)+c}function NE(t,e,r){r=r||(Z=>t[Z]1;)$=S+c>>1,r($)?S=$:c=$;return{lo:S,hi:c}}const Ax=(t,e,r,c)=>NE(t,r,c?S=>{const $=t[S][e];return $t[S][e]NE(t,r,c=>t[c][e]>=r);function Tme(t,e,r){let c=0,S=t.length;for(;cc&&t[S-1]>r;)S--;return c>0||S{const c="_onData"+FE(r),S=t[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!1,value(...$){const Z=S.apply(this,$);return t._chartjs.listeners.forEach(ue=>{typeof ue[c]=="function"&&ue[c](...$)}),Z}})})}function eR(t,e){const r=t._chartjs;if(!r)return;const c=r.listeners,S=c.indexOf(e);S!==-1&&c.splice(S,1),!(c.length>0)&&(g$.forEach($=>{delete t[$]}),delete t._chartjs)}function v$(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const y$=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function _$(t,e){let r=[],c=!1;return function(...S){r=S,c||(c=!0,y$.call(window,()=>{c=!1,t.apply(e,r)}))}}function Cme(t,e){let r;return function(...c){return e?(clearTimeout(r),r=setTimeout(t,e,c)):t.apply(this,c),e}}const jE=t=>t==="start"?"left":t==="end"?"right":"center",z0=(t,e,r)=>t==="start"?e:t==="end"?r:(e+r)/2,Ame=(t,e,r,c)=>t===(c?"left":"right")?r:t==="center"?(e+r)/2:e;function Mme(t,e,r){const c=e.length;let S=0,$=c;if(t._sorted){const{iScale:Z,vScale:ue,_parsed:xe}=t,Se=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,Ne=Z.axis,{min:it,max:pt,minDefined:bt,maxDefined:wt}=Z.getUserBounds();if(bt){if(S=Math.min(Ax(xe,Ne,it).lo,r?c:Ax(e,Ne,Z.getPixelForValue(it)).lo),Se){const Dt=xe.slice(0,S+1).reverse().findIndex(Zt=>!Kh(Zt[ue.axis]));S-=Math.max(0,Dt)}S=U0(S,0,c-1)}if(wt){let Dt=Math.max(Ax(xe,Z.axis,pt,!0).hi+1,r?0:Ax(e,Ne,Z.getPixelForValue(pt),!0).hi+1);if(Se){const Zt=xe.slice(Dt-1).findIndex(Mr=>!Kh(Mr[ue.axis]));Dt+=Math.max(0,Zt)}$=U0(Dt,S,c)-S}else $=c-S}return{start:S,count:$}}function Eme(t){const{xScale:e,yScale:r,_scaleRanges:c}=t,S={xmin:e.min,xmax:e.max,ymin:r.min,ymax:r.max};if(!c)return t._scaleRanges=S,!0;const $=c.xmin!==e.min||c.xmax!==e.max||c.ymin!==r.min||c.ymax!==r.max;return Object.assign(c,S),$}const jk=t=>t===0||t===1,tR=(t,e,r)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ad/r)),rR=(t,e,r)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ad/r)+1,k5={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*zp)+1,easeOutSine:t=>Math.sin(t*zp),easeInOutSine:t=>-.5*(Math.cos(cf*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>jk(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>jk(t)?t:tR(t,.075,.3),easeOutElastic:t=>jk(t)?t:rR(t,.075,.3),easeInOutElastic(t){return jk(t)?t:t<.5?.5*tR(t*2,.1125,.45):.5+.5*rR(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-k5.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?k5.easeInBounce(t*2)*.5:k5.easeOutBounce(t*2-1)*.5+.5};function UE(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function iR(t){return UE(t)?t:new N5(t)}function I7(t){return UE(t)?t:new N5(t).saturate(.5).darken(.1).hexString()}const Lme=["x","y","borderWidth","radius","tension"],Pme=["color","borderColor","backgroundColor"];function Ime(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Pme},numbers:{type:"number",properties:Lme}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Dme(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const nR=new Map;function zme(t,e){e=e||{};const r=t+JSON.stringify(e);let c=nR.get(r);return c||(c=new Intl.NumberFormat(t,e),nR.set(r,c)),c}function $E(t,e,r){return zme(e,r).format(t)}const Ome={values(t){return wp(t)?t:""+t},numeric(t,e,r){if(t===0)return"0";const c=this.chart.options.locale;let S,$=t;if(r.length>1){const Se=Math.max(Math.abs(r[0].value),Math.abs(r[r.length-1].value));(Se<1e-4||Se>1e15)&&(S="scientific"),$=Bme(t,r)}const Z=p$(Math.abs($)),ue=isNaN(Z)?1:Math.max(Math.min(-1*Math.floor(Z),20),0),xe={notation:S,minimumFractionDigits:ue,maximumFractionDigits:ue};return Object.assign(xe,this.options.ticks.format),$E(t,c,xe)}};function Bme(t,e){let r=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(r)>=1&&t!==Math.floor(t)&&(r=t-Math.floor(t)),r}var x$={formatters:Ome};function Rme(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,r)=>r.lineWidth,tickColor:(e,r)=>r.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:x$.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ux=Object.create(null),e9=Object.create(null);function T5(t,e){if(!e)return t;const r=e.split(".");for(let c=0,S=r.length;cc.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(c,S)=>I7(S.backgroundColor),this.hoverBorderColor=(c,S)=>I7(S.borderColor),this.hoverColor=(c,S)=>I7(S.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(r)}set(e,r){return D7(this,e,r)}get(e){return T5(this,e)}describe(e,r){return D7(e9,e,r)}override(e,r){return D7(Ux,e,r)}route(e,r,c,S){const $=T5(this,e),Z=T5(this,c),ue="_"+r;Object.defineProperties($,{[ue]:{value:$[r],writable:!0},[r]:{enumerable:!0,get(){const xe=this[ue],Se=Z[S];return Nc(xe)?Object.assign({},Se,xe):_c(xe,Se)},set(xe){this[ue]=xe}}})}apply(e){e.forEach(r=>r(this))}}var sp=new Fme({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ime,Dme,Rme]);function Nme(t){return!t||Kh(t.size)||Kh(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function aR(t,e,r,c,S){let $=e[S];return $||($=e[S]=t.measureText(S).width,r.push(S)),$>c&&(c=$),c}function fx(t,e,r){const c=t.currentDevicePixelRatio,S=r!==0?Math.max(r/2,.5):0;return Math.round((e-S)*c)/c+S}function oR(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function t9(t,e,r,c){b$(t,e,r,c,null)}function b$(t,e,r,c,S){let $,Z,ue,xe,Se,Ne,it,pt;const bt=e.pointStyle,wt=e.rotation,Dt=e.radius;let Zt=(wt||0)*mme;if(bt&&typeof bt=="object"&&($=bt.toString(),$==="[object HTMLImageElement]"||$==="[object HTMLCanvasElement]")){t.save(),t.translate(r,c),t.rotate(Zt),t.drawImage(bt,-bt.width/2,-bt.height/2,bt.width,bt.height),t.restore();return}if(!(isNaN(Dt)||Dt<=0)){switch(t.beginPath(),bt){default:S?t.ellipse(r,c,S/2,Dt,0,0,Ad):t.arc(r,c,Dt,0,Ad),t.closePath();break;case"triangle":Ne=S?S/2:Dt,t.moveTo(r+Math.sin(Zt)*Ne,c-Math.cos(Zt)*Dt),Zt+=XB,t.lineTo(r+Math.sin(Zt)*Ne,c-Math.cos(Zt)*Dt),Zt+=XB,t.lineTo(r+Math.sin(Zt)*Ne,c-Math.cos(Zt)*Dt),t.closePath();break;case"rectRounded":Se=Dt*.516,xe=Dt-Se,Z=Math.cos(Zt+hx)*xe,it=Math.cos(Zt+hx)*(S?S/2-Se:xe),ue=Math.sin(Zt+hx)*xe,pt=Math.sin(Zt+hx)*(S?S/2-Se:xe),t.arc(r-it,c-ue,Se,Zt-cf,Zt-zp),t.arc(r+pt,c-Z,Se,Zt-zp,Zt),t.arc(r+it,c+ue,Se,Zt,Zt+zp),t.arc(r-pt,c+Z,Se,Zt+zp,Zt+cf),t.closePath();break;case"rect":if(!wt){xe=Math.SQRT1_2*Dt,Ne=S?S/2:xe,t.rect(r-Ne,c-xe,2*Ne,2*xe);break}Zt+=hx;case"rectRot":it=Math.cos(Zt)*(S?S/2:Dt),Z=Math.cos(Zt)*Dt,ue=Math.sin(Zt)*Dt,pt=Math.sin(Zt)*(S?S/2:Dt),t.moveTo(r-it,c-ue),t.lineTo(r+pt,c-Z),t.lineTo(r+it,c+ue),t.lineTo(r-pt,c+Z),t.closePath();break;case"crossRot":Zt+=hx;case"cross":it=Math.cos(Zt)*(S?S/2:Dt),Z=Math.cos(Zt)*Dt,ue=Math.sin(Zt)*Dt,pt=Math.sin(Zt)*(S?S/2:Dt),t.moveTo(r-it,c-ue),t.lineTo(r+it,c+ue),t.moveTo(r+pt,c-Z),t.lineTo(r-pt,c+Z);break;case"star":it=Math.cos(Zt)*(S?S/2:Dt),Z=Math.cos(Zt)*Dt,ue=Math.sin(Zt)*Dt,pt=Math.sin(Zt)*(S?S/2:Dt),t.moveTo(r-it,c-ue),t.lineTo(r+it,c+ue),t.moveTo(r+pt,c-Z),t.lineTo(r-pt,c+Z),Zt+=hx,it=Math.cos(Zt)*(S?S/2:Dt),Z=Math.cos(Zt)*Dt,ue=Math.sin(Zt)*Dt,pt=Math.sin(Zt)*(S?S/2:Dt),t.moveTo(r-it,c-ue),t.lineTo(r+it,c+ue),t.moveTo(r+pt,c-Z),t.lineTo(r-pt,c+Z);break;case"line":Z=S?S/2:Math.cos(Zt)*Dt,ue=Math.sin(Zt)*Dt,t.moveTo(r-Z,c-ue),t.lineTo(r+Z,c+ue);break;case"dash":t.moveTo(r,c),t.lineTo(r+Math.cos(Zt)*(S?S/2:Dt),c+Math.sin(Zt)*Dt);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function V5(t,e,r){return r=r||.5,!e||t&&t.x>e.left-r&&t.xe.top-r&&t.y0&&$.strokeColor!=="";let xe,Se;for(t.save(),t.font=S.string,$me(t,$),xe=0;xe+t||0;function HE(t,e){const r={},c=Nc(e),S=c?Object.keys(e):e,$=Nc(t)?c?Z=>_c(t[Z],t[e[Z]]):Z=>t[Z]:()=>t;for(const Z of S)r[Z]=Zme($(Z));return r}function w$(t){return HE(t,{top:"y",right:"x",bottom:"y",left:"x"})}function I2(t){return HE(t,["topLeft","topRight","bottomLeft","bottomRight"])}function kg(t){const e=w$(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $0(t,e){t=t||{},e=e||sp.font;let r=_c(t.size,e.size);typeof r=="string"&&(r=parseInt(r,10));let c=_c(t.style,e.style);c&&!(""+c).match(qme)&&(console.warn('Invalid font style specified: "'+c+'"'),c=void 0);const S={family:_c(t.family,e.family),lineHeight:Gme(_c(t.lineHeight,e.lineHeight),r),size:r,style:c,weight:_c(t.weight,e.weight),string:""};return S.string=Nme(S),S}function Uk(t,e,r,c){let S,$,Z;for(S=0,$=t.length;S<$;++S)if(Z=t[S],Z!==void 0&&Z!==void 0)return Z}function Kme(t,e,r){const{min:c,max:S}=t,$=f$(e,(S-c)/2),Z=(ue,xe)=>r&&ue===0?0:ue+xe;return{min:Z(c,-Math.abs($)),max:Z(S,$)}}function Wx(t,e){return Object.assign(Object.create(t),e)}function VE(t,e=[""],r,c,S=()=>t[0]){const $=r||t;typeof c>"u"&&(c=C$("_fallback",t));const Z={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:$,_fallback:c,_getTarget:S,override:ue=>VE([ue,...t],e,$,c)};return new Proxy(Z,{deleteProperty(ue,xe){return delete ue[xe],delete ue._keys,delete t[0][xe],!0},get(ue,xe){return T$(ue,xe,()=>ige(xe,e,t,ue))},getOwnPropertyDescriptor(ue,xe){return Reflect.getOwnPropertyDescriptor(ue._scopes[0],xe)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(ue,xe){return lR(ue).includes(xe)},ownKeys(ue){return lR(ue)},set(ue,xe,Se){const Ne=ue._storage||(ue._storage=S());return ue[xe]=Ne[xe]=Se,delete ue._keys,!0}})}function $2(t,e,r,c){const S={_cacheable:!1,_proxy:t,_context:e,_subProxy:r,_stack:new Set,_descriptors:k$(t,c),setContext:$=>$2(t,$,r,c),override:$=>$2(t.override($),e,r,c)};return new Proxy(S,{deleteProperty($,Z){return delete $[Z],delete t[Z],!0},get($,Z,ue){return T$($,Z,()=>Xme($,Z,ue))},getOwnPropertyDescriptor($,Z){return $._descriptors.allKeys?Reflect.has(t,Z)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,Z)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has($,Z){return Reflect.has(t,Z)},ownKeys(){return Reflect.ownKeys(t)},set($,Z,ue){return t[Z]=ue,delete $[Z],!0}})}function k$(t,e={scriptable:!0,indexable:!0}){const{_scriptable:r=e.scriptable,_indexable:c=e.indexable,_allKeys:S=e.allKeys}=t;return{allKeys:S,scriptable:r,indexable:c,isScriptable:y_(r)?r:()=>r,isIndexable:y_(c)?c:()=>c}}const Yme=(t,e)=>t?t+FE(e):e,WE=(t,e)=>Nc(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function T$(t,e,r){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const c=r();return t[e]=c,c}function Xme(t,e,r){const{_proxy:c,_context:S,_subProxy:$,_descriptors:Z}=t;let ue=c[e];return y_(ue)&&Z.isScriptable(e)&&(ue=Jme(e,ue,t,r)),wp(ue)&&ue.length&&(ue=Qme(e,ue,t,Z.isIndexable)),WE(e,ue)&&(ue=$2(ue,S,$&&$[e],Z)),ue}function Jme(t,e,r,c){const{_proxy:S,_context:$,_subProxy:Z,_stack:ue}=r;if(ue.has(t))throw new Error("Recursion detected: "+Array.from(ue).join("->")+"->"+t);ue.add(t);let xe=e($,Z||c);return ue.delete(t),WE(t,xe)&&(xe=qE(S._scopes,S,t,xe)),xe}function Qme(t,e,r,c){const{_proxy:S,_context:$,_subProxy:Z,_descriptors:ue}=r;if(typeof $.index<"u"&&c(t))return e[$.index%e.length];if(Nc(e[0])){const xe=e,Se=S._scopes.filter(Ne=>Ne!==xe);e=[];for(const Ne of xe){const it=qE(Se,S,t,Ne);e.push($2(it,$,Z&&Z[t],ue))}}return e}function S$(t,e,r){return y_(t)?t(e,r):t}const ege=(t,e)=>t===!0?e:typeof t=="string"?jx(e,t):void 0;function tge(t,e,r,c,S){for(const $ of e){const Z=ege(r,$);if(Z){t.add(Z);const ue=S$(Z._fallback,r,S);if(typeof ue<"u"&&ue!==r&&ue!==c)return ue}else if(Z===!1&&typeof c<"u"&&r!==c)return null}return!1}function qE(t,e,r,c){const S=e._rootScopes,$=S$(e._fallback,r,c),Z=[...t,...S],ue=new Set;ue.add(c);let xe=sR(ue,Z,r,$||r,c);return xe===null||typeof $<"u"&&$!==r&&(xe=sR(ue,Z,$,xe,c),xe===null)?!1:VE(Array.from(ue),[""],S,$,()=>rge(e,r,c))}function sR(t,e,r,c,S){for(;r;)r=tge(t,e,r,c,S);return r}function rge(t,e,r){const c=t._getTarget();e in c||(c[e]={});const S=c[e];return wp(S)&&Nc(r)?r:S||{}}function ige(t,e,r,c){let S;for(const $ of e)if(S=C$(Yme($,t),r),typeof S<"u")return WE(t,S)?qE(r,c,t,S):S}function C$(t,e){for(const r of e){if(!r)continue;const c=r[t];if(typeof c<"u")return c}}function lR(t){let e=t._keys;return e||(e=t._keys=nge(t._scopes)),e}function nge(t){const e=new Set;for(const r of t)for(const c of Object.keys(r).filter(S=>!S.startsWith("_")))e.add(c);return Array.from(e)}const age=Number.EPSILON||1e-14,H2=(t,e)=>et==="x"?"y":"x";function oge(t,e,r,c){const S=t.skip?e:t,$=e,Z=r.skip?e:r,ue=QM($,S),xe=QM(Z,$);let Se=ue/(ue+xe),Ne=xe/(ue+xe);Se=isNaN(Se)?0:Se,Ne=isNaN(Ne)?0:Ne;const it=c*Se,pt=c*Ne;return{previous:{x:$.x-it*(Z.x-S.x),y:$.y-it*(Z.y-S.y)},next:{x:$.x+pt*(Z.x-S.x),y:$.y+pt*(Z.y-S.y)}}}function sge(t,e,r){const c=t.length;let S,$,Z,ue,xe,Se=H2(t,0);for(let Ne=0;Ne!Se.skip)),e.cubicInterpolationMode==="monotone")uge(t,S);else{let Se=c?t[t.length-1]:t[0];for($=0,Z=t.length;$t.ownerDocument.defaultView.getComputedStyle(t,null);function fge(t,e){return R8(t).getPropertyValue(e)}const dge=["top","right","bottom","left"];function Dx(t,e,r){const c={};r=r?"-"+r:"";for(let S=0;S<4;S++){const $=dge[S];c[$]=parseFloat(t[e+"-"+$+r])||0}return c.width=c.left+c.right,c.height=c.top+c.bottom,c}const pge=(t,e,r)=>(t>0||e>0)&&(!r||!r.shadowRoot);function mge(t,e){const r=t.touches,c=r&&r.length?r[0]:t,{offsetX:S,offsetY:$}=c;let Z=!1,ue,xe;if(pge(S,$,t.target))ue=S,xe=$;else{const Se=e.getBoundingClientRect();ue=c.clientX-Se.left,xe=c.clientY-Se.top,Z=!0}return{x:ue,y:xe,box:Z}}function vx(t,e){if("native"in t)return t;const{canvas:r,currentDevicePixelRatio:c}=e,S=R8(r),$=S.boxSizing==="border-box",Z=Dx(S,"padding"),ue=Dx(S,"border","width"),{x:xe,y:Se,box:Ne}=mge(t,r),it=Z.left+(Ne&&ue.left),pt=Z.top+(Ne&&ue.top);let{width:bt,height:wt}=e;return $&&(bt-=Z.width+ue.width,wt-=Z.height+ue.height),{x:Math.round((xe-it)/bt*r.width/c),y:Math.round((Se-pt)/wt*r.height/c)}}function gge(t,e,r){let c,S;if(e===void 0||r===void 0){const $=t&&ZE(t);if(!$)e=t.clientWidth,r=t.clientHeight;else{const Z=$.getBoundingClientRect(),ue=R8($),xe=Dx(ue,"border","width"),Se=Dx(ue,"padding");e=Z.width-Se.width-xe.width,r=Z.height-Se.height-xe.height,c=GT(ue.maxWidth,$,"clientWidth"),S=GT(ue.maxHeight,$,"clientHeight")}}return{width:e,height:r,maxWidth:c||WT,maxHeight:S||WT}}const s_=t=>Math.round(t*10)/10;function vge(t,e,r,c){const S=R8(t),$=Dx(S,"margin"),Z=GT(S.maxWidth,t,"clientWidth")||WT,ue=GT(S.maxHeight,t,"clientHeight")||WT,xe=gge(t,e,r);let{width:Se,height:Ne}=xe;if(S.boxSizing==="content-box"){const pt=Dx(S,"border","width"),bt=Dx(S,"padding");Se-=bt.width+pt.width,Ne-=bt.height+pt.height}return Se=Math.max(0,Se-$.width),Ne=Math.max(0,c?Se/c:Ne-$.height),Se=s_(Math.min(Se,Z,xe.maxWidth)),Ne=s_(Math.min(Ne,ue,xe.maxHeight)),Se&&!Ne&&(Ne=s_(Se/2)),(e!==void 0||r!==void 0)&&c&&xe.height&&Ne>xe.height&&(Ne=xe.height,Se=s_(Math.floor(Ne*c))),{width:Se,height:Ne}}function uR(t,e,r){const c=e||1,S=s_(t.height*c),$=s_(t.width*c);t.height=s_(t.height),t.width=s_(t.width);const Z=t.canvas;return Z.style&&(r||!Z.style.height&&!Z.style.width)&&(Z.style.height=`${t.height}px`,Z.style.width=`${t.width}px`),t.currentDevicePixelRatio!==c||Z.height!==S||Z.width!==$?(t.currentDevicePixelRatio=c,Z.height=S,Z.width=$,t.ctx.setTransform(c,0,0,c,0,0),!0):!1}const yge=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};GE()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function cR(t,e){const r=fge(t,e),c=r&&r.match(/^(\d+)(\.\d+)?px$/);return c?+c[1]:void 0}function yx(t,e,r,c){return{x:t.x+r*(e.x-t.x),y:t.y+r*(e.y-t.y)}}function _ge(t,e,r,c){return{x:t.x+r*(e.x-t.x),y:c==="middle"?r<.5?t.y:e.y:c==="after"?r<1?t.y:e.y:r>0?e.y:t.y}}function xge(t,e,r,c){const S={x:t.cp2x,y:t.cp2y},$={x:e.cp1x,y:e.cp1y},Z=yx(t,S,r),ue=yx(S,$,r),xe=yx($,e,r),Se=yx(Z,ue,r),Ne=yx(ue,xe,r);return yx(Se,Ne,r)}const bge=function(t,e){return{x(r){return t+t+e-r},setWidth(r){e=r},textAlign(r){return r==="center"?r:r==="right"?"left":"right"},xPlus(r,c){return r-c},leftForLtr(r,c){return r-c}}},wge=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function D2(t,e,r){return t?bge(e,r):wge()}function M$(t,e){let r,c;(e==="ltr"||e==="rtl")&&(r=t.canvas.style,c=[r.getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",e,"important"),t.prevTextDirection=c)}function E$(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function L$(t){return t==="angle"?{between:H5,compare:bme,normalize:Zm}:{between:B1,compare:(e,r)=>e-r,normalize:e=>e}}function hR({start:t,end:e,count:r,loop:c,style:S}){return{start:t%r,end:e%r,loop:c&&(e-t+1)%r===0,style:S}}function kge(t,e,r){const{property:c,start:S,end:$}=r,{between:Z,normalize:ue}=L$(c),xe=e.length;let{start:Se,end:Ne,loop:it}=t,pt,bt;if(it){for(Se+=xe,Ne+=xe,pt=0,bt=xe;ptxe(S,ni,Mr)&&ue(S,ni)!==0,Cr=()=>ue($,Mr)===0||xe($,ni,Mr),gi=()=>Dt||or(),Si=()=>!Dt||Cr();for(let Ci=Ne,ri=Ne;Ci<=it;++Ci)ze=e[Ci%Z],!ze.skip&&(Mr=Se(ze[c]),Mr!==ni&&(Dt=xe(Mr,S,$),Zt===null&&gi()&&(Zt=ue(Mr,S)===0?Ci:ri),Zt!==null&&Si()&&(wt.push(hR({start:Zt,end:Ci,loop:pt,count:Z,style:bt})),Zt=null),ri=Ci,ni=Mr));return Zt!==null&&wt.push(hR({start:Zt,end:it,loop:pt,count:Z,style:bt})),wt}function I$(t,e){const r=[],c=t.segments;for(let S=0;SS&&t[$%e].skip;)$--;return $%=e,{start:S,end:$}}function Sge(t,e,r,c){const S=t.length,$=[];let Z=e,ue=t[e],xe;for(xe=e+1;xe<=r;++xe){const Se=t[xe%S];Se.skip||Se.stop?ue.skip||(c=!1,$.push({start:e%S,end:(xe-1)%S,loop:c}),e=Z=Se.stop?xe:null):(Z=xe,ue.skip&&(e=xe)),ue=Se}return Z!==null&&$.push({start:e%S,end:Z%S,loop:c}),$}function Cge(t,e){const r=t.points,c=t.options.spanGaps,S=r.length;if(!S)return[];const $=!!t._loop,{start:Z,end:ue}=Tge(r,S,$,c);if(c===!0)return fR(t,[{start:Z,end:ue,loop:$}],r,e);const xe=ueue({chart:e,initial:r.initial,numSteps:Z,currentStep:Math.min(c-r.start,Z)}))}_refresh(){this._request||(this._running=!0,this._request=m$.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let r=0;this._charts.forEach((c,S)=>{if(!c.running||!c.items.length)return;const H=c.items;let Z=H.length-1,ue=!1,be;for(;Z>=0;--Z)be=H[Z],be._active?(be._total>c.duration&&(c.duration=be._total),be.tick(e),ue=!0):(H[Z]=H[H.length-1],H.pop());ue&&(S.draw(),this._notify(S,c,e,"progress")),H.length||(c.running=!1,this._notify(S,c,e,"complete"),c.initial=!1),r+=H.length}),this._lastDate=e,r===0&&(this._running=!1)}_getAnims(e){const r=this._charts;let c=r.get(e);return c||(c={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(e,c)),c}listen(e,r,c){this._getAnims(e).listeners[r].push(c)}add(e,r){!r||!r.length||this._getAnims(e).items.push(...r)}has(e){return this._getAnims(e).items.length>0}start(e){const r=this._charts.get(e);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((c,S)=>Math.max(c,S._duration),0),this._refresh())}running(e){if(!this._running)return!1;const r=this._charts.get(e);return!(!r||!r.running||!r.items.length)}stop(e){const r=this._charts.get(e);if(!r||!r.items.length)return;const c=r.items;let S=c.length-1;for(;S>=0;--S)c[S].cancel();r.items=[],this._notify(e,r,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var k1=new Mge;const fR="transparent",Ege={boolean(t,e,r){return r>.5?e:t},color(t,e,r){const c=tR(t||fR),S=c.valid&&tR(e||fR);return S&&S.valid?S.mix(c,r).hexString():e},number(t,e,r){return t+(e-t)*r}};class Lge{constructor(e,r,c,S){const H=r[c];S=Nk([e.to,S,H,e.from]);const Z=Nk([e.from,H,S]);this._active=!0,this._fn=e.fn||Ege[e.type||typeof Z],this._easing=b5[e.easing]||b5.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=r,this._prop=c,this._from=Z,this._to=S,this._promises=void 0}active(){return this._active}update(e,r,c){if(this._active){this._notify(!1);const S=this._target[this._prop],H=c-this._start,Z=this._duration-H;this._start=c,this._duration=Math.floor(Math.max(Z,e.duration)),this._total+=H,this._loop=!!e.loop,this._to=Nk([e.to,r,S,e.from]),this._from=Nk([e.from,S,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const r=e-this._start,c=this._duration,S=this._prop,H=this._from,Z=this._loop,ue=this._to;let be;if(this._active=H!==ue&&(Z||r1?2-be:be,be=this._easing(Math.min(1,Math.max(0,be))),this._target[S]=this._fn(H,ue,be)}wait(){const e=this._promises||(this._promises=[]);return new Promise((r,c)=>{e.push({res:r,rej:c})})}_notify(e){const r=e?"res":"rej",c=this._promises||[];for(let S=0;S{const H=e[S];if(!Fc(H))return;const Z={};for(const ue of r)Z[ue]=H[ue];(bp(H.properties)&&H.properties||[S]).forEach(ue=>{(ue===S||!c.has(ue))&&c.set(ue,Z)})})}_animateOptions(e,r){const c=r.options,S=Ige(e,c);if(!S)return[];const H=this._createAnimations(S,c);return c.$shared&&Pge(e.options.$animations,c).then(()=>{e.options=c},()=>{}),H}_createAnimations(e,r){const c=this._properties,S=[],H=e.$animations||(e.$animations={}),Z=Object.keys(r),ue=Date.now();let be;for(be=Z.length-1;be>=0;--be){const Se=Z[be];if(Se.charAt(0)==="$")continue;if(Se==="options"){S.push(...this._animateOptions(e,r));continue}const Re=r[Se];let Xe=H[Se];const vt=c.get(Se);if(Xe)if(vt&&Xe.active()){Xe.update(vt,Re,ue);continue}else Xe.cancel();if(!vt||!vt.duration){e[Se]=Re;continue}H[Se]=Xe=new Lge(vt,e,Se,Re),S.push(Xe)}return S}update(e,r){if(this._properties.size===0){Object.assign(e,r);return}const c=this._createAnimations(e,r);if(c.length)return k1.add(this._chart,c),!0}}function Pge(t,e){const r=[],c=Object.keys(e);for(let S=0;S0||!r&&H<0)return S.index}return null}function gR(t,e){const{chart:r,_cachedMeta:c}=t,S=r._stacks||(r._stacks={}),{iScale:H,vScale:Z,index:ue}=c,be=H.axis,Se=Z.axis,Re=Bge(H,Z,c),Xe=e.length;let vt;for(let bt=0;btr[c].axis===e).shift()}function Nge(t,e){return Vx(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function jge(t,e,r){return Vx(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:r,index:e,mode:"default",type:"data"})}function z3(t,e){const r=t.controller.index,c=t.vScale&&t.vScale.axis;if(c){e=e||t._parsed;for(const S of e){const H=S._stacks;if(!H||H[c]===void 0||H[c][r]===void 0)return;delete H[c][r],H[c]._visualValues!==void 0&&H[c]._visualValues[r]!==void 0&&delete H[c]._visualValues[r]}}}const z7=t=>t==="reset"||t==="none",vR=(t,e)=>e?t:Object.assign({},t),Uge=(t,e,r)=>t&&!e.hidden&&e._stacked&&{keys:I$(r,!0),values:null};class BS{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,r){this.chart=e,this._ctx=e.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=I7(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&z3(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,r=this._cachedMeta,c=this.getDataset(),S=(Xe,vt,bt,kt)=>Xe==="x"?vt:Xe==="r"?kt:bt,H=r.xAxisID=_c(c.xAxisID,D7(e,"x")),Z=r.yAxisID=_c(c.yAxisID,D7(e,"y")),ue=r.rAxisID=_c(c.rAxisID,D7(e,"r")),be=r.indexAxis,Se=r.iAxisID=S(be,H,Z,ue),Re=r.vAxisID=S(be,Z,H,ue);r.xScale=this.getScaleForId(H),r.yScale=this.getScaleForId(Z),r.rScale=this.getScaleForId(ue),r.iScale=this.getScaleForId(Se),r.vScale=this.getScaleForId(Re)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const r=this._cachedMeta;return e===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&JB(this._data,this),e._stacked&&z3(e)}_dataCheck(){const e=this.getDataset(),r=e.data||(e.data=[]),c=this._data;if(Fc(r)){const S=this._cachedMeta;this._data=Oge(r,S)}else if(c!==r){if(c){JB(c,this);const S=this._cachedMeta;z3(S),S._parsed=[]}r&&Object.isExtensible(r)&&kme(r,this),this._syncList=[],this._data=r}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const r=this._cachedMeta,c=this.getDataset();let S=!1;this._dataCheck();const H=r._stacked;r._stacked=I7(r.vScale,r),r.stack!==c.stack&&(S=!0,z3(r),r.stack=c.stack),this._resyncElements(e),(S||H!==r._stacked)&&(gR(this,r._parsed),r._stacked=I7(r.vScale,r))}configure(){const e=this.chart.config,r=e.datasetScopeKeys(this._type),c=e.getOptionScopes(this.getDataset(),r,!0);this.options=e.createResolver(c,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,r){const{_cachedMeta:c,_data:S}=this,{iScale:H,_stacked:Z}=c,ue=H.axis;let be=e===0&&r===S.length?!0:c._sorted,Se=e>0&&c._parsed[e-1],Re,Xe,vt;if(this._parsing===!1)c._parsed=S,c._sorted=!0,vt=S;else{bp(S[e])?vt=this.parseArrayData(c,S,e,r):Fc(S[e])?vt=this.parseObjectData(c,S,e,r):vt=this.parsePrimitiveData(c,S,e,r);const bt=()=>Xe[ue]===null||Se&&Xe[ue]Dt||Xe=0;--vt)if(!kt()){this.updateRangeFromParsed(Se,e,bt,be);break}}return Se}getAllParsedValues(e){const r=this._cachedMeta._parsed,c=[];let S,H,Z;for(S=0,H=r.length;S=0&&ethis.getContext(c,S,r),Dt=Se.resolveNamedOptions(vt,bt,kt,Xe);return Dt.$shared&&(Dt.$shared=be,H[Z]=Object.freeze(vR(Dt,be))),Dt}_resolveAnimations(e,r,c){const S=this.chart,H=this._cachedDataOpts,Z=`animation-${r}`,ue=H[Z];if(ue)return ue;let be;if(S.options.animation!==!1){const Re=this.chart.config,Xe=Re.datasetAnimationScopeKeys(this._type,r),vt=Re.getOptionScopes(this.getDataset(),Xe);be=Re.createResolver(vt,this.getContext(e,c,r))}const Se=new P$(S,be&&be.animations);return be&&be._cacheable&&(H[Z]=Object.freeze(Se)),Se}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,r){return!r||z7(e)||this.chart._animationsDisabled}_getSharedOptions(e,r){const c=this.resolveDataElementOptions(e,r),S=this._sharedOptions,H=this.getSharedOptions(c),Z=this.includeOptions(r,H)||H!==S;return this.updateSharedOptions(H,r,c),{sharedOptions:H,includeOptions:Z}}updateElement(e,r,c,S){z7(S)?Object.assign(e,c):this._resolveAnimations(r,S).update(e,c)}updateSharedOptions(e,r,c){e&&!z7(r)&&this._resolveAnimations(void 0,r).update(e,c)}_setStyle(e,r,c,S){e.active=S;const H=this.getStyle(r,S);this._resolveAnimations(r,c,S).update(e,{options:!S&&this.getSharedOptions(H)||H})}removeHoverStyle(e,r,c){this._setStyle(e,c,"active",!1)}setHoverStyle(e,r,c){this._setStyle(e,c,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const r=this._data,c=this._cachedMeta.data;for(const[ue,be,Se]of this._syncList)this[ue](be,Se);this._syncList=[];const S=c.length,H=r.length,Z=Math.min(H,S);Z&&this.parse(0,Z),H>S?this._insertElements(S,H-S,e):H{for(Se.length+=r,ue=Se.length-1;ue>=Z;ue--)Se[ue]=Se[ue-r]};for(be(H),ue=e;ueS-H))}return t._cache.$bar}function Hge(t){const e=t.iScale,r=$ge(e,t.type);let c=e._length,S,H,Z,ue;const be=()=>{Z===32767||Z===-32768||(N5(ue)&&(c=Math.min(c,Math.abs(Z-ue)||c)),ue=Z)};for(S=0,H=r.length;S0?S[t-1]:null,ue=tMath.abs(ue)&&(be=ue,Se=Z),e[r.axis]=Se,e._custom={barStart:be,barEnd:Se,start:S,end:H,min:Z,max:ue}}function D$(t,e,r,c){return bp(t)?qge(t,e,r,c):e[r.axis]=r.parse(t,c),e}function yR(t,e,r,c){const S=t.iScale,H=t.vScale,Z=S.getLabels(),ue=S===H,be=[];let Se,Re,Xe,vt;for(Se=r,Re=r+c;Se=r?1:-1)}function Zge(t){let e,r,c,S,H;return t.horizontal?(e=t.base>t.x,r="left",c="right"):(e=t.baseRe.controller.options.grouped),H=c.options.stacked,Z=[],ue=this._cachedMeta.controller.getParsed(r),be=ue&&ue[c.axis],Se=Re=>{const Xe=Re._parsed.find(bt=>bt[c.axis]===be),vt=Xe&&Xe[Re.vScale.axis];if(Kh(vt)||isNaN(vt))return!0};for(const Re of S)if(!(r!==void 0&&Se(Re))&&((H===!1||Z.indexOf(Re.stack)===-1||H===void 0&&Re.stack===void 0)&&Z.push(Re.stack),Re.index===e))break;return Z.length||Z.push(void 0),Z}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(e).filter(c=>e[c].axis===r).shift()}_getAxis(){const e={},r=this.getFirstScaleIdForIndexAxis();for(const c of this.chart.data.datasets)e[_c(this.chart.options.indexAxis==="x"?c.xAxisID:c.yAxisID,r)]=!0;return Object.keys(e)}_getStackIndex(e,r,c){const S=this._getStacks(e,c),H=r!==void 0?S.indexOf(r):-1;return H===-1?S.length-1:H}_getRuler(){const e=this.options,r=this._cachedMeta,c=r.iScale,S=[];let H,Z;for(H=0,Z=r.data.length;HU5(wi,ue,be,!0)?1:Math.max(ur,ur*r,Ir,Ir*r),kt=(wi,ur,Ir)=>U5(wi,ue,be,!0)?-1:Math.min(ur,ur*r,Ir,Ir*r),Dt=bt(0,Se,Xe),rr=bt(Dp,Re,vt),Er=kt(cf,Se,Xe),Fe=kt(cf+Dp,Re,vt);c=(Dt-Er)/2,S=(rr-Fe)/2,H=-(Dt+Er)/2,Z=-(rr+Fe)/2}return{ratioX:c,ratioY:S,offsetX:H,offsetY:Z}}class O$ extends BS{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data,{labels:{pointStyle:c,textAlign:S,color:H,useBorderRadius:Z,borderRadius:ue}}=e.legend.options;return r.labels.length&&r.datasets.length?r.labels.map((be,Se)=>{const Xe=e.getDatasetMeta(0).controller.getStyle(Se);return{text:be,fillStyle:Xe.backgroundColor,fontColor:H,hidden:!e.getDataVisibility(Se),lineDash:Xe.borderDash,lineDashOffset:Xe.borderDashOffset,lineJoin:Xe.borderJoinStyle,lineWidth:Xe.borderWidth,strokeStyle:Xe.borderColor,textAlign:S,pointStyle:c,borderRadius:Z&&(ue||Xe.borderRadius),index:Se}}):[]}},onClick(e,r,c){c.chart.toggleDataVisibility(r.index),c.chart.update()}}}};constructor(e,r){super(e,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,r){const c=this.getDataset().data,S=this._cachedMeta;if(this._parsing===!1)S._parsed=c;else{let H=be=>+c[be];if(Fc(c[e])){const{key:be="value"}=this._parsing;H=Se=>+Nx(c[Se],be)}let Z,ue;for(Z=e,ue=e+r;Z0&&!isNaN(e)?Cd*(Math.abs(e)/r):0}getLabelAndValue(e){const r=this._cachedMeta,c=this.chart,S=c.data.labels||[],H=jE(r._parsed[e],c.options.locale);return{label:S[e]||"",value:H}}getMaxBorderWidth(e){let r=0;const c=this.chart;let S,H,Z,ue,be;if(!e){for(S=0,H=c.data.datasets.length;S0&&this.getParsed(r-1);for(let Ir=0;Ir=Fe){_i.skip=!0;continue}const Ci=this.getParsed(Ir),ii=Kh(Ci[bt]),Ji=_i[vt]=Z.getPixelForValue(Ci[vt],Ir),vi=_i[bt]=H||ii?ue.getBasePixel():ue.getPixelForValue(be?this.applyStack(ue,Ci,be):Ci[bt],Ir);_i.skip=isNaN(Ji)||isNaN(vi)||ii,_i.stop=Ir>0&&Math.abs(Ci[vt]-ur[vt])>rr,Dt&&(_i.parsed=Ci,_i.raw=Se.data[Ir]),Xe&&(_i.options=Re||this.resolveDataElementOptions(Ir,Ti.active?"active":S)),Er||this.updateElement(Ti,Ir,_i,S),ur=Ci}}getMaxOverflow(){const e=this._cachedMeta,r=e.dataset,c=r.options&&r.options.borderWidth||0,S=e.data||[];if(!S.length)return c;const H=S[0].size(this.resolveDataElementOptions(0)),Z=S[S.length-1].size(this.resolveDataElementOptions(S.length-1));return Math.max(c,H,Z)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}function ux(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class GE{static override(e){Object.assign(GE.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return ux()}parse(){return ux()}format(){return ux()}add(){return ux()}diff(){return ux()}startOf(){return ux()}endOf(){return ux()}}var R$={_date:GE};function Qge(t,e,r,c){const{controller:S,data:H,_sorted:Z}=t,ue=S._cachedMeta.iScale,be=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(ue&&e===ue.axis&&e!=="r"&&Z&&H.length){const Se=ue._reversePixels?bme:Tx;if(c){if(S._sharedOptions){const Re=H[0],Xe=typeof Re.getRange=="function"&&Re.getRange(e);if(Xe){const vt=Se(H,e,r-Xe),bt=Se(H,e,r+Xe);return{lo:vt.lo,hi:bt.hi}}}}else{const Re=Se(H,e,r);if(be){const{vScale:Xe}=S._cachedMeta,{_parsed:vt}=t,bt=vt.slice(0,Re.lo+1).reverse().findIndex(Dt=>!Kh(Dt[Xe.axis]));Re.lo-=Math.max(0,bt);const kt=vt.slice(Re.hi).findIndex(Dt=>!Kh(Dt[Xe.axis]));Re.hi+=Math.max(0,kt)}return Re}}return{lo:0,hi:H.length-1}}function RS(t,e,r,c,S){const H=t.getSortedVisibleDatasetMetas(),Z=r[e];for(let ue=0,be=H.length;ue{be[Z]&&be[Z](e[r],S)&&(H.push({element:be,datasetIndex:Se,index:Re}),ue=ue||be.inRange(e.x,e.y,S))}),c&&!ue?[]:H}var ive={modes:{index(t,e,r,c){const S=px(e,t),H=r.axis||"x",Z=r.includeInvisible||!1,ue=r.intersect?B7(t,S,H,c,Z):R7(t,S,H,!1,c,Z),be=[];return ue.length?(t.getSortedVisibleDatasetMetas().forEach(Se=>{const Re=ue[0].index,Xe=Se.data[Re];Xe&&!Xe.skip&&be.push({element:Xe,datasetIndex:Se.index,index:Re})}),be):[]},dataset(t,e,r,c){const S=px(e,t),H=r.axis||"xy",Z=r.includeInvisible||!1;let ue=r.intersect?B7(t,S,H,c,Z):R7(t,S,H,!1,c,Z);if(ue.length>0){const be=ue[0].datasetIndex,Se=t.getDatasetMeta(be).data;ue=[];for(let Re=0;Rer.pos===e)}function wR(t,e){return t.filter(r=>F$.indexOf(r.pos)===-1&&r.box.axis===e)}function B3(t,e){return t.sort((r,c)=>{const S=e?c:r,H=e?r:c;return S.weight===H.weight?S.index-H.index:S.weight-H.weight})}function nve(t){const e=[];let r,c,S,H,Z,ue;for(r=0,c=(t||[]).length;rSe.box.fullSize),!0),c=B3(O3(e,"left"),!0),S=B3(O3(e,"right")),H=B3(O3(e,"top"),!0),Z=B3(O3(e,"bottom")),ue=wR(e,"x"),be=wR(e,"y");return{fullSize:r,leftAndTop:c.concat(H),rightAndBottom:S.concat(be).concat(Z).concat(ue),chartArea:O3(e,"chartArea"),vertical:c.concat(S).concat(be),horizontal:H.concat(Z).concat(ue)}}function kR(t,e,r,c){return Math.max(t[r],e[r])+Math.max(t[c],e[c])}function N$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function lve(t,e,r,c){const{pos:S,box:H}=r,Z=t.maxPadding;if(!Fc(S)){r.size&&(t[S]-=r.size);const Xe=c[r.stack]||{size:0,count:1};Xe.size=Math.max(Xe.size,r.horizontal?H.height:H.width),r.size=Xe.size/Xe.count,t[S]+=r.size}H.getPadding&&N$(Z,H.getPadding());const ue=Math.max(0,e.outerWidth-kR(Z,t,"left","right")),be=Math.max(0,e.outerHeight-kR(Z,t,"top","bottom")),Se=ue!==t.w,Re=be!==t.h;return t.w=ue,t.h=be,r.horizontal?{same:Se,other:Re}:{same:Re,other:Se}}function uve(t){const e=t.maxPadding;function r(c){const S=Math.max(e[c]-t[c],0);return t[c]+=S,S}t.y+=r("top"),t.x+=r("left"),r("right"),r("bottom")}function cve(t,e){const r=e.maxPadding;function c(S){const H={left:0,top:0,right:0,bottom:0};return S.forEach(Z=>{H[Z]=Math.max(e[Z],r[Z])}),H}return c(t?["left","right"]:["top","bottom"])}function r5(t,e,r,c){const S=[];let H,Z,ue,be,Se,Re;for(H=0,Z=t.length,Se=0;H{typeof Dt.beforeLayout=="function"&&Dt.beforeLayout()});const Re=be.reduce((Dt,rr)=>rr.box.options&&rr.box.options.display===!1?Dt:Dt+1,0)||1,Xe=Object.freeze({outerWidth:e,outerHeight:r,padding:S,availableWidth:H,availableHeight:Z,vBoxMaxWidth:H/2/Re,hBoxMaxHeight:Z/2}),vt=Object.assign({},S);N$(vt,wg(c));const bt=Object.assign({maxPadding:vt,w:H,h:Z,x:S.left,y:S.top},S),kt=ove(be.concat(Se),Xe);r5(ue.fullSize,bt,Xe,kt),r5(be,bt,Xe,kt),r5(Se,bt,Xe,kt)&&r5(be,bt,Xe,kt),uve(bt),TR(ue.leftAndTop,bt,Xe,kt),bt.x+=bt.w,bt.y+=bt.h,TR(ue.rightAndBottom,bt,Xe,kt),t.chartArea={left:bt.left,top:bt.top,right:bt.left+bt.w,bottom:bt.top+bt.h,height:bt.h,width:bt.w},uf(ue.chartArea,Dt=>{const rr=Dt.box;Object.assign(rr,t.chartArea),rr.update(bt.w,bt.h,{left:0,top:0,right:0,bottom:0})})}};class j${acquireContext(e,r){}releaseContext(e){return!1}addEventListener(e,r,c){}removeEventListener(e,r,c){}getDevicePixelRatio(){return 1}getMaximumSize(e,r,c,S){return r=Math.max(0,r||e.width),c=c||e.height,{width:r,height:Math.max(0,S?Math.floor(r/S):c)}}isAttached(e){return!0}updateConfig(e){}}class hve extends j${acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mT="$chartjs",fve={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},SR=t=>t===null||t==="";function dve(t,e){const r=t.style,c=t.getAttribute("height"),S=t.getAttribute("width");if(t[mT]={initial:{height:c,width:S,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",SR(S)){const H=lR(t,"width");H!==void 0&&(t.width=H)}if(SR(c))if(t.style.height==="")t.height=t.width/(e||2);else{const H=lR(t,"height");H!==void 0&&(t.height=H)}return t}const U$=gge?{passive:!0}:!1;function pve(t,e,r){t&&t.addEventListener(e,r,U$)}function mve(t,e,r){t&&t.canvas&&t.canvas.removeEventListener(e,r,U$)}function gve(t,e){const r=fve[t.type]||t.type,{x:c,y:S}=px(t,e);return{type:r,chart:e,native:t,x:c!==void 0?c:null,y:S!==void 0?S:null}}function qT(t,e){for(const r of t)if(r===e||r.contains(e))return!0}function vve(t,e,r){const c=t.canvas,S=new MutationObserver(H=>{let Z=!1;for(const ue of H)Z=Z||qT(ue.addedNodes,c),Z=Z&&!qT(ue.removedNodes,c);Z&&r()});return S.observe(document,{childList:!0,subtree:!0}),S}function yve(t,e,r){const c=t.canvas,S=new MutationObserver(H=>{let Z=!1;for(const ue of H)Z=Z||qT(ue.removedNodes,c),Z=Z&&!qT(ue.addedNodes,c);Z&&r()});return S.observe(document,{childList:!0,subtree:!0}),S}const V5=new Map;let CR=0;function $$(){const t=window.devicePixelRatio;t!==CR&&(CR=t,V5.forEach((e,r)=>{r.currentDevicePixelRatio!==t&&e()}))}function _ve(t,e){V5.size||window.addEventListener("resize",$$),V5.set(t,e)}function xve(t){V5.delete(t),V5.size||window.removeEventListener("resize",$$)}function bve(t,e,r){const c=t.canvas,S=c&&qE(c);if(!S)return;const H=g$((ue,be)=>{const Se=S.clientWidth;r(ue,be),Se{const be=ue[0],Se=be.contentRect.width,Re=be.contentRect.height;Se===0&&Re===0||H(Se,Re)});return Z.observe(S),_ve(t,H),Z}function F7(t,e,r){r&&r.disconnect(),e==="resize"&&xve(t)}function wve(t,e,r){const c=t.canvas,S=g$(H=>{t.ctx!==null&&r(gve(H,t))},t);return pve(c,e,S),S}class kve extends j${acquireContext(e,r){const c=e&&e.getContext&&e.getContext("2d");return c&&c.canvas===e?(dve(e,r),c):null}releaseContext(e){const r=e.canvas;if(!r[mT])return!1;const c=r[mT].initial;["height","width"].forEach(H=>{const Z=c[H];Kh(Z)?r.removeAttribute(H):r.setAttribute(H,Z)});const S=c.style||{};return Object.keys(S).forEach(H=>{r.style[H]=S[H]}),r.width=r.width,delete r[mT],!0}addEventListener(e,r,c){this.removeEventListener(e,r);const S=e.$proxies||(e.$proxies={}),Z={attach:vve,detach:yve,resize:bve}[r]||wve;S[r]=Z(e,r,c)}removeEventListener(e,r){const c=e.$proxies||(e.$proxies={}),S=c[r];if(!S)return;({attach:F7,detach:F7,resize:F7}[r]||mve)(e,r,S),c[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,r,c,S){return mge(e,r,c,S)}isAttached(e){const r=e&&qE(e);return!!(r&&r.isConnected)}}function Tve(t){return!WE()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?hve:kve}let H1=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:r,y:c}=this.getProps(["x","y"],e);return{x:r,y:c}}hasValue(){return j5(this.x)&&j5(this.y)}getProps(e,r){const c=this.$animations;if(!r||!c)return this;const S={};return e.forEach(H=>{S[H]=c[H]&&c[H].active()?c[H]._to:this[H]}),S}};function Sve(t,e){const r=t.options.ticks,c=Cve(t),S=Math.min(r.maxTicksLimit||c,c),H=r.major.enabled?Mve(e):[],Z=H.length,ue=H[0],be=H[Z-1],Se=[];if(Z>S)return Eve(e,Se,H,Z/S),Se;const Re=Ave(H,e,S);if(Z>0){let Xe,vt;const bt=Z>1?Math.round((be-ue)/(Z-1)):null;for(Hk(e,Se,Re,Kh(bt)?0:ue-bt,ue),Xe=0,vt=Z-1;XeS)return be}return Math.max(S,1)}function Mve(t){const e=[];let r,c;for(r=0,c=t.length;rt==="left"?"right":t==="right"?"left":t,AR=(t,e,r)=>e==="top"||e==="left"?t[e]+r:t[e]-r,MR=(t,e)=>Math.min(e||t,t);function ER(t,e){const r=[],c=t.length/e,S=t.length;let H=0;for(;HZ+ue)))return be}function Dve(t,e){uf(t,r=>{const c=r.gc,S=c.length/2;let H;if(S>e){for(H=0;Hc?c:r,c=S&&r>c?r:c,{min:pv(r,pv(c,r)),max:pv(c,pv(r,c))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Zf(this.options.beforeUpdate,[this])}update(e,r,c){const{beginAtZero:S,grace:H,ticks:Z}=this.options,ue=Z.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=r,this._margins=c=Object.assign({left:0,right:0,top:0,bottom:0},c),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+c.left+c.right:this.height+c.top+c.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Gme(this,H,S),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const be=ue=H||c<=1||!this.isHorizontal()){this.labelRotation=S;return}const Re=this._getLabelSizes(),Xe=Re.widest.width,vt=Re.highest.height,bt=U0(this.chart.width-Xe,0,this.maxWidth);ue=e.offset?this.maxWidth/c:bt/(c-1),Xe+6>ue&&(ue=bt/(c-(e.offset?.5:1)),be=this.maxHeight-R3(e.grid)-r.padding-LR(e.title,this.chart.options.font),Se=Math.sqrt(Xe*Xe+vt*vt),Z=yme(Math.min(Math.asin(U0((Re.highest.height+6)/ue,-1,1)),Math.asin(U0(be/Se,-1,1))-Math.asin(U0(vt/Se,-1,1)))),Z=Math.max(S,Math.min(H,Z))),this.labelRotation=Z}afterCalculateLabelRotation(){Zf(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Zf(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:r,options:{ticks:c,title:S,grid:H}}=this,Z=this._isVisible(),ue=this.isHorizontal();if(Z){const be=LR(S,r.options.font);if(ue?(e.width=this.maxWidth,e.height=R3(H)+be):(e.height=this.maxHeight,e.width=R3(H)+be),c.display&&this.ticks.length){const{first:Se,last:Re,widest:Xe,highest:vt}=this._getLabelSizes(),bt=c.padding*2,kt=z1(this.labelRotation),Dt=Math.cos(kt),rr=Math.sin(kt);if(ue){const Er=c.mirror?0:rr*Xe.width+Dt*vt.height;e.height=Math.min(this.maxHeight,e.height+Er+bt)}else{const Er=c.mirror?0:Dt*Xe.width+rr*vt.height;e.width=Math.min(this.maxWidth,e.width+Er+bt)}this._calculatePadding(Se,Re,rr,Dt)}}this._handleMargins(),ue?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,r,c,S){const{ticks:{align:H,padding:Z},position:ue}=this.options,be=this.labelRotation!==0,Se=ue!=="top"&&this.axis==="x";if(this.isHorizontal()){const Re=this.getPixelForTick(0)-this.left,Xe=this.right-this.getPixelForTick(this.ticks.length-1);let vt=0,bt=0;be?Se?(vt=S*e.width,bt=c*r.height):(vt=c*e.height,bt=S*r.width):H==="start"?bt=r.width:H==="end"?vt=e.width:H!=="inner"&&(vt=e.width/2,bt=r.width/2),this.paddingLeft=Math.max((vt-Re+Z)*this.width/(this.width-Re),0),this.paddingRight=Math.max((bt-Xe+Z)*this.width/(this.width-Xe),0)}else{let Re=r.height/2,Xe=e.height/2;H==="start"?(Re=0,Xe=e.height):H==="end"&&(Re=r.height,Xe=0),this.paddingTop=Re+Z,this.paddingBottom=Xe+Z}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Zf(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:r}=this.options;return r==="top"||r==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let r,c;for(r=0,c=e.length;r({width:Z[ii]||0,height:ue[ii]||0});return{first:Ci(0),last:Ci(r-1),widest:Ci(Ti),highest:Ci(_i),widths:Z,heights:ue}}getLabelForValue(e){return e}getPixelForValue(e,r){return NaN}getValueForPixel(e){}getPixelForTick(e){const r=this.ticks;return e<0||e>r.length-1?null:this.getPixelForValue(r[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const r=this._startPixel+e*this._length;return xme(this._alignToPixels?lx(this.chart,r,0):r)}getDecimalForPixel(e){const r=(e-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:r}=this;return e<0&&r<0?r:e>0&&r>0?e:0}getContext(e){const r=this.ticks||[];if(e>=0&&eue*S?ue/c:be/S:be*S0}_computeGridLineItems(e){const r=this.axis,c=this.chart,S=this.options,{grid:H,position:Z,border:ue}=S,be=H.offset,Se=this.isHorizontal(),Xe=this.ticks.length+(be?1:0),vt=R3(H),bt=[],kt=ue.setContext(this.getContext()),Dt=kt.display?kt.width:0,rr=Dt/2,Er=function(Xr){return lx(c,Xr,Dt)};let Fe,wi,ur,Ir,Ti,_i,Ci,ii,Ji,vi,vr,dr;if(Z==="top")Fe=Er(this.bottom),_i=this.bottom-vt,ii=Fe-rr,vi=Er(e.top)+rr,dr=e.bottom;else if(Z==="bottom")Fe=Er(this.top),vi=e.top,dr=Er(e.bottom)-rr,_i=Fe+rr,ii=this.top+vt;else if(Z==="left")Fe=Er(this.right),Ti=this.right-vt,Ci=Fe-rr,Ji=Er(e.left)+rr,vr=e.right;else if(Z==="right")Fe=Er(this.left),Ji=e.left,vr=Er(e.right)-rr,Ti=Fe+rr,Ci=this.left+vt;else if(r==="x"){if(Z==="center")Fe=Er((e.top+e.bottom)/2+.5);else if(Fc(Z)){const Xr=Object.keys(Z)[0],ei=Z[Xr];Fe=Er(this.chart.scales[Xr].getPixelForValue(ei))}vi=e.top,dr=e.bottom,_i=Fe+rr,ii=_i+vt}else if(r==="y"){if(Z==="center")Fe=Er((e.left+e.right)/2);else if(Fc(Z)){const Xr=Object.keys(Z)[0],ei=Z[Xr];Fe=Er(this.chart.scales[Xr].getPixelForValue(ei))}Ti=Fe-rr,Ci=Ti-vt,Ji=e.left,vr=e.right}const Ar=_c(S.ticks.maxTicksLimit,Xe),ti=Math.max(1,Math.ceil(Xe/Ar));for(wi=0;wi0&&(an-=Yn/2);break}ka={left:an,top:sn,width:Yn+Ta.width,height:so+Ta.height,color:ti.backdropColor}}rr.push({label:ur,font:ii,textOffset:vr,options:{rotation:Dt,color:ei,strokeColor:Di,strokeWidth:qn,textAlign:Qn,textBaseline:dr,translation:[Ir,Ti],backdrop:ka}})}return rr}_getXAxisLabelAlignment(){const{position:e,ticks:r}=this.options;if(-z1(this.labelRotation))return e==="top"?"left":"right";let S="center";return r.align==="start"?S="left":r.align==="end"?S="right":r.align==="inner"&&(S="inner"),S}_getYAxisLabelAlignment(e){const{position:r,ticks:{crossAlign:c,mirror:S,padding:H}}=this.options,Z=this._getLabelSizes(),ue=e+H,be=Z.widest.width;let Se,Re;return r==="left"?S?(Re=this.right+H,c==="near"?Se="left":c==="center"?(Se="center",Re+=be/2):(Se="right",Re+=be)):(Re=this.right-ue,c==="near"?Se="right":c==="center"?(Se="center",Re-=be/2):(Se="left",Re=this.left)):r==="right"?S?(Re=this.left+H,c==="near"?Se="right":c==="center"?(Se="center",Re-=be/2):(Se="left",Re-=be)):(Re=this.left+ue,c==="near"?Se="left":c==="center"?(Se="center",Re+=be/2):(Se="right",Re=this.right)):Se="right",{textAlign:Se,x:Re}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:r},left:c,top:S,width:H,height:Z}=this;r&&(e.save(),e.fillStyle=r,e.fillRect(c,S,H,Z),e.restore())}getLineWidthForValue(e){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const S=this.ticks.findIndex(H=>H.value===e);return S>=0?r.setContext(this.getContext(S)).lineWidth:0}drawGrid(e){const r=this.options.grid,c=this.ctx,S=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let H,Z;const ue=(be,Se,Re)=>{!Re.width||!Re.color||(c.save(),c.lineWidth=Re.width,c.strokeStyle=Re.color,c.setLineDash(Re.borderDash||[]),c.lineDashOffset=Re.borderDashOffset,c.beginPath(),c.moveTo(be.x,be.y),c.lineTo(Se.x,Se.y),c.stroke(),c.restore())};if(r.display)for(H=0,Z=S.length;H{this.draw(H)}}]:[{z:c,draw:H=>{this.drawBackground(),this.drawGrid(H),this.drawTitle()}},{z:S,draw:()=>{this.drawBorder()}},{z:r,draw:H=>{this.drawLabels(H)}}]}getMatchingVisibleMetas(e){const r=this.chart.getSortedVisibleDatasetMetas(),c=this.axis+"AxisID",S=[];let H,Z;for(H=0,Z=r.length;H{const c=r.split("."),S=c.pop(),H=[t].concat(c).join("."),Z=e[r].split("."),ue=Z.pop(),be=Z.join(".");op.route(H,S,be,ue)})}function jve(t){return"id"in t&&"defaults"in t}class Uve{constructor(){this.controllers=new Vk(BS,"datasets",!0),this.elements=new Vk(H1,"elements"),this.plugins=new Vk(Object,"plugins"),this.scales=new Vk(G2,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,r,c){[...r].forEach(S=>{const H=c||this._getRegistryForType(S);c||H.isForType(S)||H===this.plugins&&S.id?this._exec(e,H,S):uf(S,Z=>{const ue=c||this._getRegistryForType(Z);this._exec(e,ue,Z)})})}_exec(e,r,c){const S=BE(e);Zf(c["before"+S],[],c),r[e](c),Zf(c["after"+S],[],c)}_getRegistryForType(e){for(let r=0;rH.filter(ue=>!Z.some(be=>ue.plugin.id===be.plugin.id));this._notify(S(r,c),e,"stop"),this._notify(S(c,r),e,"start")}}function Hve(t){const e={},r=[],c=Object.keys(wv.plugins.items);for(let H=0;H1&&PR(t[0].toLowerCase());if(c)return c}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function IR(t,e,r){if(r[e+"AxisID"]===t)return{axis:e}}function Yve(t,e){if(e.data&&e.data.datasets){const r=e.data.datasets.filter(c=>c.xAxisID===t||c.yAxisID===t);if(r.length)return IR(t,"x",r[0])||IR(t,"y",r[0])}return{}}function Xve(t,e){const r=jx[t.type]||{scales:{}},c=e.scales||{},S=e9(t.type,e),H=Object.create(null);return Object.keys(c).forEach(Z=>{const ue=c[Z];if(!Fc(ue))return console.error(`Invalid scale configuration for scale: ${Z}`);if(ue._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${Z}`);const be=t9(Z,ue,Yve(Z,t),op.scales[ue.type]),Se=Zve(be,S),Re=r.scales||{};H[Z]=_5(Object.create(null),[{axis:be},ue,Re[be],Re[Se]])}),t.data.datasets.forEach(Z=>{const ue=Z.type||t.type,be=Z.indexAxis||e9(ue,e),Re=(jx[ue]||{}).scales||{};Object.keys(Re).forEach(Xe=>{const vt=Gve(Xe,be),bt=Z[vt+"AxisID"]||vt;H[bt]=H[bt]||Object.create(null),_5(H[bt],[{axis:vt},c[bt],Re[Xe]])})}),Object.keys(H).forEach(Z=>{const ue=H[Z];_5(ue,[op.scales[ue.type],op.scale])}),H}function H$(t){const e=t.options||(t.options={});e.plugins=_c(e.plugins,{}),e.scales=Xve(t,e)}function V$(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Jve(t){return t=t||{},t.data=V$(t.data),H$(t),t}const DR=new Map,W$=new Set;function Wk(t,e){let r=DR.get(t);return r||(r=e(),DR.set(t,r),W$.add(r)),r}const F3=(t,e,r)=>{const c=Nx(e,r);c!==void 0&&t.add(c)};class Qve{constructor(e){this._config=Jve(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=V$(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),H$(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Wk(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,r){return Wk(`${e}.transition.${r}`,()=>[[`datasets.${e}.transitions.${r}`,`transitions.${r}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,r){return Wk(`${e}-${r}`,()=>[[`datasets.${e}.elements.${r}`,`datasets.${e}`,`elements.${r}`,""]])}pluginScopeKeys(e){const r=e.id,c=this.type;return Wk(`${c}-plugin-${r}`,()=>[[`plugins.${r}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,r){const c=this._scopeCache;let S=c.get(e);return(!S||r)&&(S=new Map,c.set(e,S)),S}getOptionScopes(e,r,c){const{options:S,type:H}=this,Z=this._cachedScopes(e,c),ue=Z.get(r);if(ue)return ue;const be=new Set;r.forEach(Re=>{e&&(be.add(e),Re.forEach(Xe=>F3(be,e,Xe))),Re.forEach(Xe=>F3(be,S,Xe)),Re.forEach(Xe=>F3(be,jx[H]||{},Xe)),Re.forEach(Xe=>F3(be,op,Xe)),Re.forEach(Xe=>F3(be,JM,Xe))});const Se=Array.from(be);return Se.length===0&&Se.push(Object.create(null)),W$.has(r)&&Z.set(r,Se),Se}chartOptionScopes(){const{options:e,type:r}=this;return[e,jx[r]||{},op.datasets[r]||{},{type:r},op,JM]}resolveNamedOptions(e,r,c,S=[""]){const H={$shared:!0},{resolver:Z,subPrefixes:ue}=zR(this._resolverCache,e,S);let be=Z;if(t1e(Z,r)){H.$shared=!1,c=p_(c)?c():c;const Se=this.createResolver(e,c,ue);be=j2(Z,c,Se)}for(const Se of r)H[Se]=be[Se];return H}createResolver(e,r,c=[""],S){const{resolver:H}=zR(this._resolverCache,e,c);return Fc(r)?j2(H,r,void 0,S):H}}function zR(t,e,r){let c=t.get(e);c||(c=new Map,t.set(e,c));const S=r.join();let H=c.get(S);return H||(H={resolver:$E(e,r),subPrefixes:r.filter(ue=>!ue.toLowerCase().includes("hover"))},c.set(S,H)),H}const e1e=t=>Fc(t)&&Object.getOwnPropertyNames(t).some(e=>p_(t[e]));function t1e(t,e){const{isScriptable:r,isIndexable:c}=x$(t);for(const S of e){const H=r(S),Z=c(S),ue=(Z||H)&&t[S];if(H&&(p_(ue)||e1e(ue))||Z&&bp(ue))return!0}return!1}var r1e="4.5.1";const i1e=["top","bottom","left","right","chartArea"];function OR(t,e){return t==="top"||t==="bottom"||i1e.indexOf(t)===-1&&e==="x"}function BR(t,e){return function(r,c){return r[t]===c[t]?r[e]-c[e]:r[t]-c[t]}}function RR(t){const e=t.chart,r=e.options.animation;e.notifyPlugins("afterRender"),Zf(r&&r.onComplete,[t],e)}function n1e(t){const e=t.chart,r=e.options.animation;Zf(r&&r.onProgress,[t],e)}function q$(t){return WE()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const gT={},FR=t=>{const e=q$(t);return Object.values(gT).filter(r=>r.canvas===e).pop()};function a1e(t,e,r){const c=Object.keys(t);for(const S of c){const H=+S;if(H>=e){const Z=t[S];delete t[S],(r>0||H>e)&&(t[H+r]=Z)}}}function o1e(t,e,r,c){return!r||t.type==="mouseout"?null:c?e:t}class a_{static defaults=op;static instances=gT;static overrides=jx;static registry=wv;static version=r1e;static getChart=FR;static register(...e){wv.add(...e),NR()}static unregister(...e){wv.remove(...e),NR()}constructor(e,r){const c=this.config=new Qve(r),S=q$(e),H=FR(S);if(H)throw new Error("Canvas is already in use. Chart with ID '"+H.id+"' must be destroyed before the canvas with ID '"+H.canvas.id+"' can be reused.");const Z=c.createResolver(c.chartOptionScopes(),this.getContext());this.platform=new(c.platform||Tve(S)),this.platform.updateConfig(c);const ue=this.platform.acquireContext(S,Z.aspectRatio),be=ue&&ue.canvas,Se=be&&be.height,Re=be&&be.width;if(this.id=ame(),this.ctx=ue,this.canvas=be,this.width=Re,this.height=Se,this._options=Z,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new $ve,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Tme(Xe=>this.update(Xe),Z.resizeDelay||0),this._dataChanges=[],gT[this.id]=this,!ue||!be){console.error("Failed to create chart: can't acquire context from the given item");return}k1.listen(this,"complete",RR),k1.listen(this,"progress",n1e),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:r},width:c,height:S,_aspectRatio:H}=this;return Kh(e)?r&&H?H:S?c/S:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return wv}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sR(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nR(this.canvas,this.ctx),this}stop(){return k1.stop(this),this}resize(e,r){k1.running(this)?this._resizeBeforeDraw={width:e,height:r}:this._resize(e,r)}_resize(e,r){const c=this.options,S=this.canvas,H=c.maintainAspectRatio&&this.aspectRatio,Z=this.platform.getMaximumSize(S,e,r,H),ue=c.devicePixelRatio||this.platform.getDevicePixelRatio(),be=this.width?"resize":"attach";this.width=Z.width,this.height=Z.height,this._aspectRatio=this.aspectRatio,sR(this,ue,!0)&&(this.notifyPlugins("resize",{size:Z}),Zf(c.onResize,[this,Z],this),this.attached&&this._doResize(be)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};uf(r,(c,S)=>{c.id=S})}buildOrUpdateScales(){const e=this.options,r=e.scales,c=this.scales,S=Object.keys(c).reduce((Z,ue)=>(Z[ue]=!1,Z),{});let H=[];r&&(H=H.concat(Object.keys(r).map(Z=>{const ue=r[Z],be=t9(Z,ue),Se=be==="r",Re=be==="x";return{options:ue,dposition:Se?"chartArea":Re?"bottom":"left",dtype:Se?"radialLinear":Re?"category":"linear"}}))),uf(H,Z=>{const ue=Z.options,be=ue.id,Se=t9(be,ue),Re=_c(ue.type,Z.dtype);(ue.position===void 0||OR(ue.position,Se)!==OR(Z.dposition))&&(ue.position=Z.dposition),S[be]=!0;let Xe=null;if(be in c&&c[be].type===Re)Xe=c[be];else{const vt=wv.getScale(Re);Xe=new vt({id:be,type:Re,ctx:this.ctx,chart:this}),c[Xe.id]=Xe}Xe.init(ue,e)}),uf(S,(Z,ue)=>{Z||delete c[ue]}),uf(c,Z=>{gg.configure(this,Z,Z.options),gg.addBox(this,Z)})}_updateMetasets(){const e=this._metasets,r=this.data.datasets.length,c=e.length;if(e.sort((S,H)=>S.index-H.index),c>r){for(let S=r;Sr.length&&delete this._stacks,e.forEach((c,S)=>{r.filter(H=>H===c._dataset).length===0&&this._destroyDatasetMeta(S)})}buildOrUpdateControllers(){const e=[],r=this.data.datasets;let c,S;for(this._removeUnreferencedMetasets(),c=0,S=r.length;c{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const r=this.config;r.update();const c=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),S=this._animationsDisabled=!c.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const H=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let Z=0;for(let Se=0,Re=this.data.datasets.length;Se{Se.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(BR("z","_idx"));const{_active:ue,_lastEvent:be}=this;be?this._eventHandler(be,!0):ue.length&&this._updateHoverStyles(ue,ue,!0),this.render()}_updateScales(){uf(this.scales,e=>{gg.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,r=new Set(Object.keys(this._listeners)),c=new Set(e.events);(!ZB(r,c)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,r=this._getUniformDataChanges()||[];for(const{method:c,start:S,count:H}of r){const Z=c==="_removeElements"?-H:H;a1e(e,S,Z)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const r=this.data.datasets.length,c=H=>new Set(e.filter(Z=>Z[0]===H).map((Z,ue)=>ue+","+Z.splice(1).join(","))),S=c(0);for(let H=1;HH.split(",")).map(H=>({method:H[1],start:+H[2],count:+H[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;gg.update(this,this.width,this.height,e);const r=this.chartArea,c=r.width<=0||r.height<=0;this._layers=[],uf(this.boxes,S=>{c&&S.position==="chartArea"||(S.configure&&S.configure(),this._layers.push(...S._layers()))},this),this._layers.forEach((S,H)=>{S._idx=H}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let r=0,c=this.data.datasets.length;r=0;--r)this._drawDataset(e[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const r=this.ctx,c={meta:e,index:e.index,cancelable:!0},S=L$(this,e);this.notifyPlugins("beforeDatasetDraw",c)!==!1&&(S&&DS(r,S),e.controller.draw(),S&&zS(r),c.cancelable=!1,this.notifyPlugins("afterDatasetDraw",c))}isPointInArea(e){return $5(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,r,c,S){const H=ive.modes[r];return typeof H=="function"?H(this,e,c,S):[]}getDatasetMeta(e){const r=this.data.datasets[e],c=this._metasets;let S=c.filter(H=>H&&H._dataset===r).pop();return S||(S={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:e,_dataset:r,_parsed:[],_sorted:!1},c.push(S)),S}getContext(){return this.$context||(this.$context=Vx(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const r=this.data.datasets[e];if(!r)return!1;const c=this.getDatasetMeta(e);return typeof c.hidden=="boolean"?!c.hidden:!r.hidden}setDatasetVisibility(e,r){const c=this.getDatasetMeta(e);c.hidden=!r}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,r,c){const S=c?"show":"hide",H=this.getDatasetMeta(e),Z=H.controller._resolveAnimations(void 0,S);N5(r)?(H.data[r].hidden=!c,this.update()):(this.setDatasetVisibility(e,c),Z.update(H,{visible:c}),this.update(ue=>ue.datasetIndex===e?S:void 0))}hide(e,r){this._updateVisibility(e,r,!1)}show(e,r){this._updateVisibility(e,r,!0)}_destroyDatasetMeta(e){const r=this._metasets[e];r&&r.controller&&r.controller._destroy(),delete this._metasets[e]}_stop(){let e,r;for(this.stop(),k1.remove(this),e=0,r=this.data.datasets.length;e{r.addEventListener(this,H,Z),e[H]=Z},S=(H,Z,ue)=>{H.offsetX=Z,H.offsetY=ue,this._eventHandler(H)};uf(this.options.events,H=>c(H,S))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,r=this.platform,c=(be,Se)=>{r.addEventListener(this,be,Se),e[be]=Se},S=(be,Se)=>{e[be]&&(r.removeEventListener(this,be,Se),delete e[be])},H=(be,Se)=>{this.canvas&&this.resize(be,Se)};let Z;const ue=()=>{S("attach",ue),this.attached=!0,this.resize(),c("resize",H),c("detach",Z)};Z=()=>{this.attached=!1,S("resize",H),this._stop(),this._resize(0,0),c("attach",ue)},r.isAttached(this.canvas)?ue():Z()}unbindEvents(){uf(this._listeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._listeners={},uf(this._responsiveListeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,r,c){const S=c?"set":"remove";let H,Z,ue,be;for(r==="dataset"&&(H=this.getDatasetMeta(e[0].datasetIndex),H.controller["_"+S+"DatasetHoverStyle"]()),ue=0,be=e.length;ue{const ue=this.getDatasetMeta(H);if(!ue)throw new Error("No dataset found at index "+H);return{datasetIndex:H,element:ue.data[Z],index:Z}});!UT(c,r)&&(this._active=c,this._lastEvent=null,this._updateHoverStyles(c,r))}notifyPlugins(e,r,c){return this._plugins.notify(this,e,r,c)}isPluginEnabled(e){return this._plugins._cache.filter(r=>r.plugin.id===e).length===1}_updateHoverStyles(e,r,c){const S=this.options.hover,H=(be,Se)=>be.filter(Re=>!Se.some(Xe=>Re.datasetIndex===Xe.datasetIndex&&Re.index===Xe.index)),Z=H(r,e),ue=c?e:H(e,r);Z.length&&this.updateHoverStyle(Z,S.mode,!1),ue.length&&S.mode&&this.updateHoverStyle(ue,S.mode,!0)}_eventHandler(e,r){const c={event:e,replay:r,cancelable:!0,inChartArea:this.isPointInArea(e)},S=Z=>(Z.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",c,S)===!1)return;const H=this._handleEvent(e,r,c.inChartArea);return c.cancelable=!1,this.notifyPlugins("afterEvent",c,S),(H||c.changed)&&this.render(),this}_handleEvent(e,r,c){const{_active:S=[],options:H}=this,Z=r,ue=this._getActiveElements(e,S,c,Z),be=hme(e),Se=o1e(e,this._lastEvent,c,be);c&&(this._lastEvent=null,Zf(H.onHover,[e,ue,this],this),be&&Zf(H.onClick,[e,ue,this],this));const Re=!UT(ue,S);return(Re||r)&&(this._active=ue,this._updateHoverStyles(ue,S,r)),this._lastEvent=Se,Re}_getActiveElements(e,r,c,S){if(e.type==="mouseout")return[];if(!c)return r;const H=this.options.hover;return this.getElementsAtEventForMode(e,H.mode,H,S)}}function NR(){return uf(a_.instances,t=>t._plugins.invalidate())}function s1e(t,e,r){const{startAngle:c,x:S,y:H,outerRadius:Z,innerRadius:ue,options:be}=e,{borderWidth:Se,borderJoinStyle:Re}=be,Xe=Math.min(Se/Z,Zm(c-r));if(t.beginPath(),t.arc(S,H,Z-Se/2,c+Xe/2,r-Xe/2),ue>0){const vt=Math.min(Se/ue,Zm(c-r));t.arc(S,H,ue+Se/2,r-vt/2,c+vt/2,!0)}else{const vt=Math.min(Se/2,Z*Zm(c-r));if(Re==="round")t.arc(S,H,vt,r-cf/2,c+cf/2,!0);else if(Re==="bevel"){const bt=2*vt*vt,kt=-bt*Math.cos(r+cf/2)+S,Dt=-bt*Math.sin(r+cf/2)+H,rr=bt*Math.cos(c+cf/2)+S,Er=bt*Math.sin(c+cf/2)+H;t.lineTo(kt,Dt),t.lineTo(rr,Er)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function l1e(t,e,r){const{startAngle:c,pixelMargin:S,x:H,y:Z,outerRadius:ue,innerRadius:be}=e;let Se=S/ue;t.beginPath(),t.arc(H,Z,ue,c-Se,r+Se),be>S?(Se=S/be,t.arc(H,Z,be,r+Se,c-Se,!0)):t.arc(H,Z,S,r+Dp,c-Dp),t.closePath(),t.clip()}function u1e(t){return UE(t,["outerStart","outerEnd","innerStart","innerEnd"])}function c1e(t,e,r,c){const S=u1e(t.options.borderRadius),H=(r-e)/2,Z=Math.min(H,c*e/2),ue=be=>{const Se=(r-Math.min(H,be))*c/2;return U0(be,0,Math.min(H,Se))};return{outerStart:ue(S.outerStart),outerEnd:ue(S.outerEnd),innerStart:U0(S.innerStart,0,Z),innerEnd:U0(S.innerEnd,0,Z)}}function p2(t,e,r,c){return{x:r+t*Math.cos(e),y:c+t*Math.sin(e)}}function GT(t,e,r,c,S,H){const{x:Z,y:ue,startAngle:be,pixelMargin:Se,innerRadius:Re}=e,Xe=Math.max(e.outerRadius+c+r-Se,0),vt=Re>0?Re+c+r+Se:0;let bt=0;const kt=S-be;if(c){const ti=Re>0?Re-c:0,Xr=Xe>0?Xe-c:0,ei=(ti+Xr)/2,Di=ei!==0?kt*ei/(ei+c):kt;bt=(kt-Di)/2}const Dt=Math.max(.001,kt*Xe-r/cf)/Xe,rr=(kt-Dt)/2,Er=be+rr+bt,Fe=S-rr-bt,{outerStart:wi,outerEnd:ur,innerStart:Ir,innerEnd:Ti}=c1e(e,vt,Xe,Fe-Er),_i=Xe-wi,Ci=Xe-ur,ii=Er+wi/_i,Ji=Fe-ur/Ci,vi=vt+Ir,vr=vt+Ti,dr=Er+Ir/vi,Ar=Fe-Ti/vr;if(t.beginPath(),H){const ti=(ii+Ji)/2;if(t.arc(Z,ue,Xe,ii,ti),t.arc(Z,ue,Xe,ti,Ji),ur>0){const qn=p2(Ci,Ji,Z,ue);t.arc(qn.x,qn.y,ur,Ji,Fe+Dp)}const Xr=p2(vr,Fe,Z,ue);if(t.lineTo(Xr.x,Xr.y),Ti>0){const qn=p2(vr,Ar,Z,ue);t.arc(qn.x,qn.y,Ti,Fe+Dp,Ar+Math.PI)}const ei=(Fe-Ti/vt+(Er+Ir/vt))/2;if(t.arc(Z,ue,vt,Fe-Ti/vt,ei,!0),t.arc(Z,ue,vt,ei,Er+Ir/vt,!0),Ir>0){const qn=p2(vi,dr,Z,ue);t.arc(qn.x,qn.y,Ir,dr+Math.PI,Er-Dp)}const Di=p2(_i,Er,Z,ue);if(t.lineTo(Di.x,Di.y),wi>0){const qn=p2(_i,ii,Z,ue);t.arc(qn.x,qn.y,wi,Er-Dp,ii)}}else{t.moveTo(Z,ue);const ti=Math.cos(ii)*Xe+Z,Xr=Math.sin(ii)*Xe+ue;t.lineTo(ti,Xr);const ei=Math.cos(Ji)*Xe+Z,Di=Math.sin(Ji)*Xe+ue;t.lineTo(ei,Di)}t.closePath()}function h1e(t,e,r,c,S){const{fullCircles:H,startAngle:Z,circumference:ue}=e;let be=e.endAngle;if(H){GT(t,e,r,c,be,S);for(let Se=0;Se=cf&&bt===0&&Re!=="miter"&&s1e(t,e,Dt),H||(GT(t,e,r,c,Dt,S),t.stroke())}class G$ extends H1{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,r,c){const S=this.getProps(["x","y"],c),{angle:H,distance:Z}=f$(S,{x:e,y:r}),{startAngle:ue,endAngle:be,innerRadius:Se,outerRadius:Re,circumference:Xe}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],c),vt=(this.options.spacing+this.options.borderWidth)/2,bt=_c(Xe,be-ue),kt=U5(H,ue,be)&&ue!==be,Dt=bt>=Cd||kt,rr=O1(Z,Se+vt,Re+vt);return Dt&&rr}getCenterPoint(e){const{x:r,y:c,startAngle:S,endAngle:H,innerRadius:Z,outerRadius:ue}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:be,spacing:Se}=this.options,Re=(S+H)/2,Xe=(Z+ue+Se+be)/2;return{x:r+Math.cos(Re)*Xe,y:c+Math.sin(Re)*Xe}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:r,circumference:c}=this,S=(r.offset||0)/4,H=(r.spacing||0)/2,Z=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=c>Cd?Math.floor(c/Cd):0,c===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const ue=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(ue)*S,Math.sin(ue)*S);const be=1-Math.sin(Math.min(cf,c||0)),Se=S*be;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,h1e(e,this,Se,H,Z),f1e(e,this,Se,H,Z),e.restore()}}function Z$(t,e,r=e){t.lineCap=_c(r.borderCapStyle,e.borderCapStyle),t.setLineDash(_c(r.borderDash,e.borderDash)),t.lineDashOffset=_c(r.borderDashOffset,e.borderDashOffset),t.lineJoin=_c(r.borderJoinStyle,e.borderJoinStyle),t.lineWidth=_c(r.borderWidth,e.borderWidth),t.strokeStyle=_c(r.borderColor,e.borderColor)}function d1e(t,e,r){t.lineTo(r.x,r.y)}function p1e(t){return t.stepped?Fme:t.tension||t.cubicInterpolationMode==="monotone"?Nme:d1e}function K$(t,e,r={}){const c=t.length,{start:S=0,end:H=c-1}=r,{start:Z,end:ue}=e,be=Math.max(S,Z),Se=Math.min(H,ue),Re=Sue&&H>ue;return{count:c,start:be,loop:e.loop,ilen:Se(Z+(Se?ue-ur:ur))%H,wi=()=>{Dt!==rr&&(t.lineTo(Re,rr),t.lineTo(Re,Dt),t.lineTo(Re,Er))};for(be&&(bt=S[Fe(0)],t.moveTo(bt.x,bt.y)),vt=0;vt<=ue;++vt){if(bt=S[Fe(vt)],bt.skip)continue;const ur=bt.x,Ir=bt.y,Ti=ur|0;Ti===kt?(Irrr&&(rr=Ir),Re=(Xe*Re+ur)/++Xe):(wi(),t.lineTo(ur,Ir),kt=Ti,Xe=0,Dt=rr=Ir),Er=Ir}wi()}function r9(t){const e=t.options,r=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!r?g1e:m1e}function v1e(t){return t.stepped?vge:t.tension||t.cubicInterpolationMode==="monotone"?yge:mx}function y1e(t,e,r,c){let S=e._path;S||(S=e._path=new Path2D,e.path(S,r,c)&&S.closePath()),Z$(t,e.options),t.stroke(S)}function _1e(t,e,r,c){const{segments:S,options:H}=e,Z=r9(e);for(const ue of S)Z$(t,H,ue.style),t.beginPath(),Z(t,e,ue,{start:r,end:r+c-1})&&t.closePath(),t.stroke()}const x1e=typeof Path2D=="function";function b1e(t,e,r,c){x1e&&!e.options.segment?y1e(t,e,r,c):_1e(t,e,r,c)}class a4 extends H1{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,r){const c=this.options;if((c.tension||c.cubicInterpolationMode==="monotone")&&!c.stepped&&!this._pointsUpdated){const S=c.spanGaps?this._loop:this._fullLoop;uge(this._points,c,e,S,r),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Tge(this,this.options.segment))}first(){const e=this.segments,r=this.points;return e.length&&r[e[0].start]}last(){const e=this.segments,r=this.points,c=e.length;return c&&r[e[c-1].end]}interpolate(e,r){const c=this.options,S=e[r],H=this.points,Z=E$(this,{property:r,start:S,end:S});if(!Z.length)return;const ue=[],be=v1e(c);let Se,Re;for(Se=0,Re=Z.length;Se{ue=FS(Z,ue,S);const be=S[Z],Se=S[ue];c!==null?(H.push({x:be.x,y:c}),H.push({x:Se.x,y:c})):r!==null&&(H.push({x:r,y:be.y}),H.push({x:r,y:Se.y}))}),H}function FS(t,e,r){for(;e>t;e--){const c=r[e];if(!isNaN(c.x)&&!isNaN(c.y))break}return e}function UR(t,e,r,c){return t&&e?c(t[r],e[r]):t?t[r]:e?e[r]:0}function Q$(t,e){let r=[],c=!1;return bp(t)?(c=!0,r=t):r=M1e(t,e),r.length?new a4({points:r,options:{tension:0},_loop:c,_fullLoop:c}):null}function $R(t){return t&&t.fill!==!1}function E1e(t,e,r){let S=t[e].fill;const H=[e];let Z;if(!r)return S;for(;S!==!1&&H.indexOf(S)===-1;){if(!H0(S))return S;if(Z=t[S],!Z)return!1;if(Z.visible)return S;H.push(S),S=Z.fill}return!1}function L1e(t,e,r){const c=z1e(t);if(Fc(c))return isNaN(c.value)?!1:c;let S=parseFloat(c);return H0(S)&&Math.floor(S)===S?P1e(c[0],e,S,r):["origin","start","end","stack","shape"].indexOf(c)>=0&&c}function P1e(t,e,r,c){return(t==="-"||t==="+")&&(r=e+r),r===e||r<0||r>=c?!1:r}function I1e(t,e){let r=null;return t==="start"?r=e.bottom:t==="end"?r=e.top:Fc(t)?r=e.getPixelForValue(t.value):e.getBasePixel&&(r=e.getBasePixel()),r}function D1e(t,e,r){let c;return t==="start"?c=r:t==="end"?c=e.options.reverse?e.min:e.max:Fc(t)?c=t.value:c=e.getBaseValue(),c}function z1e(t){const e=t.options,r=e.fill;let c=_c(r&&r.target,r);return c===void 0&&(c=!!e.backgroundColor),c===!1||c===null?!1:c===!0?"origin":c}function O1e(t){const{scale:e,index:r,line:c}=t,S=[],H=c.segments,Z=c.points,ue=B1e(e,r);ue.push(Q$({x:null,y:e.bottom},c));for(let be=0;be=0;--Z){const ue=S[Z].$filler;ue&&(ue.line.updateControlPoints(H,ue.axis),c&&ue.fill&&U7(t.ctx,ue,H))}},beforeDatasetsDraw(t,e,r){if(r.drawTime!=="beforeDatasetsDraw")return;const c=t.getSortedVisibleDatasetMetas();for(let S=c.length-1;S>=0;--S){const H=c[S].$filler;$R(H)&&U7(t.ctx,H,t.chartArea)}},beforeDatasetDraw(t,e,r){const c=e.meta.$filler;!$R(c)||r.drawTime!=="beforeDatasetDraw"||U7(t.ctx,c,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const qR=(t,e)=>{let{boxHeight:r=e,boxWidth:c=e}=t;return t.usePointStyle&&(r=Math.min(r,e),c=t.pointStyleWidth||Math.min(c,e)),{boxWidth:c,boxHeight:r,itemHeight:Math.max(e,r)}},q1e=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class GR extends H1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r,c){this.maxWidth=e,this.maxHeight=r,this._margins=c,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let r=Zf(e.generateLabels,[this.chart],this)||[];e.filter&&(r=r.filter(c=>e.filter(c,this.chart.data))),e.sort&&(r=r.sort((c,S)=>e.sort(c,S,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:e,ctx:r}=this;if(!e.display){this.width=this.height=0;return}const c=e.labels,S=$0(c.font),H=S.size,Z=this._computeTitleHeight(),{boxWidth:ue,itemHeight:be}=qR(c,H);let Se,Re;r.font=S.string,this.isHorizontal()?(Se=this.maxWidth,Re=this._fitRows(Z,H,ue,be)+10):(Re=this.maxHeight,Se=this._fitCols(Z,S,ue,be)+10),this.width=Math.min(Se,e.maxWidth||this.maxWidth),this.height=Math.min(Re,e.maxHeight||this.maxHeight)}_fitRows(e,r,c,S){const{ctx:H,maxWidth:Z,options:{labels:{padding:ue}}}=this,be=this.legendHitBoxes=[],Se=this.lineWidths=[0],Re=S+ue;let Xe=e;H.textAlign="left",H.textBaseline="middle";let vt=-1,bt=-Re;return this.legendItems.forEach((kt,Dt)=>{const rr=c+r/2+H.measureText(kt.text).width;(Dt===0||Se[Se.length-1]+rr+2*ue>Z)&&(Xe+=Re,Se[Se.length-(Dt>0?0:1)]=0,bt+=Re,vt++),be[Dt]={left:0,top:bt,row:vt,width:rr,height:S},Se[Se.length-1]+=rr+ue}),Xe}_fitCols(e,r,c,S){const{ctx:H,maxHeight:Z,options:{labels:{padding:ue}}}=this,be=this.legendHitBoxes=[],Se=this.columnSizes=[],Re=Z-e;let Xe=ue,vt=0,bt=0,kt=0,Dt=0;return this.legendItems.forEach((rr,Er)=>{const{itemWidth:Fe,itemHeight:wi}=G1e(c,r,H,rr,S);Er>0&&bt+wi+2*ue>Re&&(Xe+=vt+ue,Se.push({width:vt,height:bt}),kt+=vt+ue,Dt++,vt=bt=0),be[Er]={left:kt,top:bt,col:Dt,width:Fe,height:wi},vt=Math.max(vt,Fe),bt+=wi+ue}),Xe+=vt,Se.push({width:vt,height:bt}),Xe}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:c,labels:{padding:S},rtl:H}}=this,Z=I2(H,this.left,this.width);if(this.isHorizontal()){let ue=0,be=z0(c,this.left+S,this.right-this.lineWidths[ue]);for(const Se of r)ue!==Se.row&&(ue=Se.row,be=z0(c,this.left+S,this.right-this.lineWidths[ue])),Se.top+=this.top+e+S,Se.left=Z.leftForLtr(Z.x(be),Se.width),be+=Se.width+S}else{let ue=0,be=z0(c,this.top+e+S,this.bottom-this.columnSizes[ue].height);for(const Se of r)Se.col!==ue&&(ue=Se.col,be=z0(c,this.top+e+S,this.bottom-this.columnSizes[ue].height)),Se.top=be,Se.left+=this.left+S,Se.left=Z.leftForLtr(Z.x(Se.left),Se.width),be+=Se.height+S}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;DS(e,this),this._draw(),zS(e)}}_draw(){const{options:e,columnSizes:r,lineWidths:c,ctx:S}=this,{align:H,labels:Z}=e,ue=op.color,be=I2(e.rtl,this.left,this.width),Se=$0(Z.font),{padding:Re}=Z,Xe=Se.size,vt=Xe/2;let bt;this.drawTitle(),S.textAlign=be.textAlign("left"),S.textBaseline="middle",S.lineWidth=.5,S.font=Se.string;const{boxWidth:kt,boxHeight:Dt,itemHeight:rr}=qR(Z,Xe),Er=function(Ti,_i,Ci){if(isNaN(kt)||kt<=0||isNaN(Dt)||Dt<0)return;S.save();const ii=_c(Ci.lineWidth,1);if(S.fillStyle=_c(Ci.fillStyle,ue),S.lineCap=_c(Ci.lineCap,"butt"),S.lineDashOffset=_c(Ci.lineDashOffset,0),S.lineJoin=_c(Ci.lineJoin,"miter"),S.lineWidth=ii,S.strokeStyle=_c(Ci.strokeStyle,ue),S.setLineDash(_c(Ci.lineDash,[])),Z.usePointStyle){const Ji={radius:Dt*Math.SQRT2/2,pointStyle:Ci.pointStyle,rotation:Ci.rotation,borderWidth:ii},vi=be.xPlus(Ti,kt/2),vr=_i+vt;y$(S,Ji,vi,vr,Z.pointStyleWidth&&kt)}else{const Ji=_i+Math.max((Xe-Dt)/2,0),vi=be.leftForLtr(Ti,kt),vr=P2(Ci.borderRadius);S.beginPath(),Object.values(vr).some(dr=>dr!==0)?VT(S,{x:vi,y:Ji,w:kt,h:Dt,radius:vr}):S.rect(vi,Ji,kt,Dt),S.fill(),ii!==0&&S.stroke()}S.restore()},Fe=function(Ti,_i,Ci){H5(S,Ci.text,Ti,_i+rr/2,Se,{strikethrough:Ci.hidden,textAlign:be.textAlign(Ci.textAlign)})},wi=this.isHorizontal(),ur=this._computeTitleHeight();wi?bt={x:z0(H,this.left+Re,this.right-c[0]),y:this.top+Re+ur,line:0}:bt={x:this.left+Re,y:z0(H,this.top+ur+Re,this.bottom-r[0].height),line:0},S$(this.ctx,e.textDirection);const Ir=rr+Re;this.legendItems.forEach((Ti,_i)=>{S.strokeStyle=Ti.fontColor,S.fillStyle=Ti.fontColor;const Ci=S.measureText(Ti.text).width,ii=be.textAlign(Ti.textAlign||(Ti.textAlign=Z.textAlign)),Ji=kt+vt+Ci;let vi=bt.x,vr=bt.y;be.setWidth(this.width),wi?_i>0&&vi+Ji+Re>this.right&&(vr=bt.y+=Ir,bt.line++,vi=bt.x=z0(H,this.left+Re,this.right-c[bt.line])):_i>0&&vr+Ir>this.bottom&&(vi=bt.x=vi+r[bt.line].width+Re,bt.line++,vr=bt.y=z0(H,this.top+ur+Re,this.bottom-r[bt.line].height));const dr=be.x(vi);if(Er(dr,vr,Ti),vi=Sme(ii,vi+kt+vt,wi?vi+Ji:this.right,e.rtl),Fe(be.x(vi),vr,Ti),wi)bt.x+=Ji+Re;else if(typeof Ti.text!="string"){const Ar=Se.lineHeight;bt.y+=rH(Ti,Ar)+Re}else bt.y+=Ir}),C$(this.ctx,e.textDirection)}drawTitle(){const e=this.options,r=e.title,c=$0(r.font),S=wg(r.padding);if(!r.display)return;const H=I2(e.rtl,this.left,this.width),Z=this.ctx,ue=r.position,be=c.size/2,Se=S.top+be;let Re,Xe=this.left,vt=this.width;if(this.isHorizontal())vt=Math.max(...this.lineWidths),Re=this.top+Se,Xe=z0(e.align,Xe,this.right-vt);else{const kt=this.columnSizes.reduce((Dt,rr)=>Math.max(Dt,rr.height),0);Re=Se+z0(e.align,this.top,this.bottom-kt-e.labels.padding-this._computeTitleHeight())}const bt=z0(ue,Xe,Xe+vt);Z.textAlign=H.textAlign(FE(ue)),Z.textBaseline="middle",Z.strokeStyle=r.color,Z.fillStyle=r.color,Z.font=c.string,H5(Z,r.text,bt,Re,c)}_computeTitleHeight(){const e=this.options.title,r=$0(e.font),c=wg(e.padding);return e.display?r.lineHeight+c.height:0}_getLegendItemAt(e,r){let c,S,H;if(O1(e,this.left,this.right)&&O1(r,this.top,this.bottom)){for(H=this.legendHitBoxes,c=0;cH.length>Z.length?H:Z)),e+r.size/2+c.measureText(S).width}function K1e(t,e,r){let c=t;return typeof e.text!="string"&&(c=rH(e,r)),c}function rH(t,e){const r=t.text?t.text.length:0;return e*r}function Y1e(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var iH={id:"legend",_element:GR,start(t,e,r){const c=t.legend=new GR({ctx:t.ctx,options:r,chart:t});gg.configure(t,c,r),gg.addBox(t,c)},stop(t){gg.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,r){const c=t.legend;gg.configure(t,c,r),c.options=r},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,r){const c=e.datasetIndex,S=r.chart;S.isDatasetVisible(c)?(S.hide(c),e.hidden=!0):(S.show(c),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:r,pointStyle:c,textAlign:S,color:H,useBorderRadius:Z,borderRadius:ue}}=t.legend.options;return t._getSortedDatasetMetas().map(be=>{const Se=be.controller.getStyle(r?0:void 0),Re=wg(Se.borderWidth);return{text:e[be.index].label,fillStyle:Se.backgroundColor,fontColor:H,hidden:!be.visible,lineCap:Se.borderCapStyle,lineDash:Se.borderDash,lineDashOffset:Se.borderDashOffset,lineJoin:Se.borderJoinStyle,lineWidth:(Re.width+Re.height)/4,strokeStyle:Se.borderColor,pointStyle:c||Se.pointStyle,rotation:Se.rotation,textAlign:S||Se.textAlign,borderRadius:Z&&(ue||Se.borderRadius),datasetIndex:be.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class nH extends H1{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r){const c=this.options;if(this.left=0,this.top=0,!c.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=r;const S=bp(c.text)?c.text.length:1;this._padding=wg(c.padding);const H=S*$0(c.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=H:this.width=H}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:r,left:c,bottom:S,right:H,options:Z}=this,ue=Z.align;let be=0,Se,Re,Xe;return this.isHorizontal()?(Re=z0(ue,c,H),Xe=r+e,Se=H-c):(Z.position==="left"?(Re=c+e,Xe=z0(ue,S,r),be=cf*-.5):(Re=H-e,Xe=z0(ue,r,S),be=cf*.5),Se=S-r),{titleX:Re,titleY:Xe,maxWidth:Se,rotation:be}}draw(){const e=this.ctx,r=this.options;if(!r.display)return;const c=$0(r.font),H=c.lineHeight/2+this._padding.top,{titleX:Z,titleY:ue,maxWidth:be,rotation:Se}=this._drawArgs(H);H5(e,r.text,0,0,c,{color:r.color,maxWidth:be,rotation:Se,textAlign:FE(r.align),textBaseline:"middle",translation:[Z,ue]})}}function X1e(t,e){const r=new nH({ctx:t.ctx,options:e,chart:t});gg.configure(t,r,e),gg.addBox(t,r),t.titleBlock=r}var aH={id:"title",_element:nH,start(t,e,r){X1e(t,r)},stop(t){const e=t.titleBlock;gg.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,r){const c=t.titleBlock;gg.configure(t,c,r),c.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const i5={average(t){if(!t.length)return!1;let e,r,c=new Set,S=0,H=0;for(e=0,r=t.length;eue+be)/c.size,y:S/H}},nearest(t,e){if(!t.length)return!1;let r=e.x,c=e.y,S=Number.POSITIVE_INFINITY,H,Z,ue;for(H=0,Z=t.length;Hue({chart:e,initial:r.initial,numSteps:Z,currentStep:Math.min(c-r.start,Z)}))}_refresh(){this._request||(this._running=!0,this._request=y$.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let r=0;this._charts.forEach((c,S)=>{if(!c.running||!c.items.length)return;const $=c.items;let Z=$.length-1,ue=!1,xe;for(;Z>=0;--Z)xe=$[Z],xe._active?(xe._total>c.duration&&(c.duration=xe._total),xe.tick(e),ue=!0):($[Z]=$[$.length-1],$.pop());ue&&(S.draw(),this._notify(S,c,e,"progress")),$.length||(c.running=!1,this._notify(S,c,e,"complete"),c.initial=!1),r+=$.length}),this._lastDate=e,r===0&&(this._running=!1)}_getAnims(e){const r=this._charts;let c=r.get(e);return c||(c={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},r.set(e,c)),c}listen(e,r,c){this._getAnims(e).listeners[r].push(c)}add(e,r){!r||!r.length||this._getAnims(e).items.push(...r)}has(e){return this._getAnims(e).items.length>0}start(e){const r=this._charts.get(e);r&&(r.running=!0,r.start=Date.now(),r.duration=r.items.reduce((c,S)=>Math.max(c,S._duration),0),this._refresh())}running(e){if(!this._running)return!1;const r=this._charts.get(e);return!(!r||!r.running||!r.items.length)}stop(e){const r=this._charts.get(e);if(!r||!r.items.length)return;const c=r.items;let S=c.length-1;for(;S>=0;--S)c[S].cancel();r.items=[],this._notify(e,r,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var w1=new Lge;const pR="transparent",Pge={boolean(t,e,r){return r>.5?e:t},color(t,e,r){const c=iR(t||pR),S=c.valid&&iR(e||pR);return S&&S.valid?S.mix(c,r).hexString():e},number(t,e,r){return t+(e-t)*r}};class Ige{constructor(e,r,c,S){const $=r[c];S=Uk([e.to,S,$,e.from]);const Z=Uk([e.from,$,S]);this._active=!0,this._fn=e.fn||Pge[e.type||typeof Z],this._easing=k5[e.easing]||k5.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=r,this._prop=c,this._from=Z,this._to=S,this._promises=void 0}active(){return this._active}update(e,r,c){if(this._active){this._notify(!1);const S=this._target[this._prop],$=c-this._start,Z=this._duration-$;this._start=c,this._duration=Math.floor(Math.max(Z,e.duration)),this._total+=$,this._loop=!!e.loop,this._to=Uk([e.to,r,S,e.from]),this._from=Uk([e.from,S,r])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const r=e-this._start,c=this._duration,S=this._prop,$=this._from,Z=this._loop,ue=this._to;let xe;if(this._active=$!==ue&&(Z||r1?2-xe:xe,xe=this._easing(Math.min(1,Math.max(0,xe))),this._target[S]=this._fn($,ue,xe)}wait(){const e=this._promises||(this._promises=[]);return new Promise((r,c)=>{e.push({res:r,rej:c})})}_notify(e){const r=e?"res":"rej",c=this._promises||[];for(let S=0;S{const $=e[S];if(!Nc($))return;const Z={};for(const ue of r)Z[ue]=$[ue];(wp($.properties)&&$.properties||[S]).forEach(ue=>{(ue===S||!c.has(ue))&&c.set(ue,Z)})})}_animateOptions(e,r){const c=r.options,S=zge(e,c);if(!S)return[];const $=this._createAnimations(S,c);return c.$shared&&Dge(e.options.$animations,c).then(()=>{e.options=c},()=>{}),$}_createAnimations(e,r){const c=this._properties,S=[],$=e.$animations||(e.$animations={}),Z=Object.keys(r),ue=Date.now();let xe;for(xe=Z.length-1;xe>=0;--xe){const Se=Z[xe];if(Se.charAt(0)==="$")continue;if(Se==="options"){S.push(...this._animateOptions(e,r));continue}const Ne=r[Se];let it=$[Se];const pt=c.get(Se);if(it)if(pt&&it.active()){it.update(pt,Ne,ue);continue}else it.cancel();if(!pt||!pt.duration){e[Se]=Ne;continue}$[Se]=it=new Ige(pt,e,Se,Ne),S.push(it)}return S}update(e,r){if(this._properties.size===0){Object.assign(e,r);return}const c=this._createAnimations(e,r);if(c.length)return w1.add(this._chart,c),!0}}function Dge(t,e){const r=[],c=Object.keys(e);for(let S=0;S0||!r&&$<0)return S.index}return null}function yR(t,e){const{chart:r,_cachedMeta:c}=t,S=r._stacks||(r._stacks={}),{iScale:$,vScale:Z,index:ue}=c,xe=$.axis,Se=Z.axis,Ne=Fge($,Z,c),it=e.length;let pt;for(let bt=0;btr[c].axis===e).shift()}function Uge(t,e){return Wx(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function $ge(t,e,r){return Wx(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:r,index:e,mode:"default",type:"data"})}function B3(t,e){const r=t.controller.index,c=t.vScale&&t.vScale.axis;if(c){e=e||t._parsed;for(const S of e){const $=S._stacks;if(!$||$[c]===void 0||$[c][r]===void 0)return;delete $[c][r],$[c]._visualValues!==void 0&&$[c]._visualValues[r]!==void 0&&delete $[c]._visualValues[r]}}}const B7=t=>t==="reset"||t==="none",_R=(t,e)=>e?t:Object.assign({},t),Hge=(t,e,r)=>t&&!e.hidden&&e._stacked&&{keys:O$(r,!0),values:null};class F8{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,r){this.chart=e,this._ctx=e.ctx,this.index=r,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=z7(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&B3(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,r=this._cachedMeta,c=this.getDataset(),S=(it,pt,bt,wt)=>it==="x"?pt:it==="r"?wt:bt,$=r.xAxisID=_c(c.xAxisID,O7(e,"x")),Z=r.yAxisID=_c(c.yAxisID,O7(e,"y")),ue=r.rAxisID=_c(c.rAxisID,O7(e,"r")),xe=r.indexAxis,Se=r.iAxisID=S(xe,$,Z,ue),Ne=r.vAxisID=S(xe,Z,$,ue);r.xScale=this.getScaleForId($),r.yScale=this.getScaleForId(Z),r.rScale=this.getScaleForId(ue),r.iScale=this.getScaleForId(Se),r.vScale=this.getScaleForId(Ne)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const r=this._cachedMeta;return e===r.iScale?r.vScale:r.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&eR(this._data,this),e._stacked&&B3(e)}_dataCheck(){const e=this.getDataset(),r=e.data||(e.data=[]),c=this._data;if(Nc(r)){const S=this._cachedMeta;this._data=Rge(r,S)}else if(c!==r){if(c){eR(c,this);const S=this._cachedMeta;B3(S),S._parsed=[]}r&&Object.isExtensible(r)&&Sme(r,this),this._syncList=[],this._data=r}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const r=this._cachedMeta,c=this.getDataset();let S=!1;this._dataCheck();const $=r._stacked;r._stacked=z7(r.vScale,r),r.stack!==c.stack&&(S=!0,B3(r),r.stack=c.stack),this._resyncElements(e),(S||$!==r._stacked)&&(yR(this,r._parsed),r._stacked=z7(r.vScale,r))}configure(){const e=this.chart.config,r=e.datasetScopeKeys(this._type),c=e.getOptionScopes(this.getDataset(),r,!0);this.options=e.createResolver(c,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,r){const{_cachedMeta:c,_data:S}=this,{iScale:$,_stacked:Z}=c,ue=$.axis;let xe=e===0&&r===S.length?!0:c._sorted,Se=e>0&&c._parsed[e-1],Ne,it,pt;if(this._parsing===!1)c._parsed=S,c._sorted=!0,pt=S;else{wp(S[e])?pt=this.parseArrayData(c,S,e,r):Nc(S[e])?pt=this.parseObjectData(c,S,e,r):pt=this.parsePrimitiveData(c,S,e,r);const bt=()=>it[ue]===null||Se&&it[ue]Dt||it=0;--pt)if(!wt()){this.updateRangeFromParsed(Se,e,bt,xe);break}}return Se}getAllParsedValues(e){const r=this._cachedMeta._parsed,c=[];let S,$,Z;for(S=0,$=r.length;S<$;++S)Z=r[S][e.axis],H0(Z)&&c.push(Z);return c}getMaxOverflow(){return!1}getLabelAndValue(e){const r=this._cachedMeta,c=r.iScale,S=r.vScale,$=this.getParsed(e);return{label:c?""+c.getLabelForValue($[c.axis]):"",value:S?""+S.getLabelForValue($[S.axis]):""}}_update(e){const r=this._cachedMeta;this.update(e||"default"),r._clip=Bge(_c(this.options.clip,Oge(r.xScale,r.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,r=this.chart,c=this._cachedMeta,S=c.data||[],$=r.chartArea,Z=[],ue=this._drawStart||0,xe=this._drawCount||S.length-ue,Se=this.options.drawActiveElementsOnTop;let Ne;for(c.dataset&&c.dataset.draw(e,$,ue,xe),Ne=ue;Ne=0&&ethis.getContext(c,S,r),Dt=Se.resolveNamedOptions(pt,bt,wt,it);return Dt.$shared&&(Dt.$shared=xe,$[Z]=Object.freeze(_R(Dt,xe))),Dt}_resolveAnimations(e,r,c){const S=this.chart,$=this._cachedDataOpts,Z=`animation-${r}`,ue=$[Z];if(ue)return ue;let xe;if(S.options.animation!==!1){const Ne=this.chart.config,it=Ne.datasetAnimationScopeKeys(this._type,r),pt=Ne.getOptionScopes(this.getDataset(),it);xe=Ne.createResolver(pt,this.getContext(e,c,r))}const Se=new z$(S,xe&&xe.animations);return xe&&xe._cacheable&&($[Z]=Object.freeze(Se)),Se}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,r){return!r||B7(e)||this.chart._animationsDisabled}_getSharedOptions(e,r){const c=this.resolveDataElementOptions(e,r),S=this._sharedOptions,$=this.getSharedOptions(c),Z=this.includeOptions(r,$)||$!==S;return this.updateSharedOptions($,r,c),{sharedOptions:$,includeOptions:Z}}updateElement(e,r,c,S){B7(S)?Object.assign(e,c):this._resolveAnimations(r,S).update(e,c)}updateSharedOptions(e,r,c){e&&!B7(r)&&this._resolveAnimations(void 0,r).update(e,c)}_setStyle(e,r,c,S){e.active=S;const $=this.getStyle(r,S);this._resolveAnimations(r,c,S).update(e,{options:!S&&this.getSharedOptions($)||$})}removeHoverStyle(e,r,c){this._setStyle(e,c,"active",!1)}setHoverStyle(e,r,c){this._setStyle(e,c,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const r=this._data,c=this._cachedMeta.data;for(const[ue,xe,Se]of this._syncList)this[ue](xe,Se);this._syncList=[];const S=c.length,$=r.length,Z=Math.min($,S);Z&&this.parse(0,Z),$>S?this._insertElements(S,$-S,e):${for(Se.length+=r,ue=Se.length-1;ue>=Z;ue--)Se[ue]=Se[ue-r]};for(xe($),ue=e;ueS-$))}return t._cache.$bar}function Wge(t){const e=t.iScale,r=Vge(e,t.type);let c=e._length,S,$,Z,ue;const xe=()=>{Z===32767||Z===-32768||(U5(ue)&&(c=Math.min(c,Math.abs(Z-ue)||c)),ue=Z)};for(S=0,$=r.length;S<$;++S)Z=e.getPixelForValue(r[S]),xe();for(ue=void 0,S=0,$=e.ticks.length;S<$;++S)Z=e.getPixelForTick(S),xe();return c}function qge(t,e,r,c){const S=r.barThickness;let $,Z;return Kh(S)?($=e.min*r.categoryPercentage,Z=r.barPercentage):($=S*c,Z=1),{chunk:$/c,ratio:Z,start:e.pixels[t]-$/2}}function Gge(t,e,r,c){const S=e.pixels,$=S[t];let Z=t>0?S[t-1]:null,ue=tMath.abs(ue)&&(xe=ue,Se=Z),e[r.axis]=Se,e._custom={barStart:xe,barEnd:Se,start:S,end:$,min:Z,max:ue}}function B$(t,e,r,c){return wp(t)?Zge(t,e,r,c):e[r.axis]=r.parse(t,c),e}function xR(t,e,r,c){const S=t.iScale,$=t.vScale,Z=S.getLabels(),ue=S===$,xe=[];let Se,Ne,it,pt;for(Se=r,Ne=r+c;Se=r?1:-1)}function Yge(t){let e,r,c,S,$;return t.horizontal?(e=t.base>t.x,r="left",c="right"):(e=t.baseNe.controller.options.grouped),$=c.options.stacked,Z=[],ue=this._cachedMeta.controller.getParsed(r),xe=ue&&ue[c.axis],Se=Ne=>{const it=Ne._parsed.find(bt=>bt[c.axis]===xe),pt=it&&it[Ne.vScale.axis];if(Kh(pt)||isNaN(pt))return!0};for(const Ne of S)if(!(r!==void 0&&Se(Ne))&&(($===!1||Z.indexOf(Ne.stack)===-1||$===void 0&&Ne.stack===void 0)&&Z.push(Ne.stack),Ne.index===e))break;return Z.length||Z.push(void 0),Z}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,r=this.chart.options.indexAxis;return Object.keys(e).filter(c=>e[c].axis===r).shift()}_getAxis(){const e={},r=this.getFirstScaleIdForIndexAxis();for(const c of this.chart.data.datasets)e[_c(this.chart.options.indexAxis==="x"?c.xAxisID:c.yAxisID,r)]=!0;return Object.keys(e)}_getStackIndex(e,r,c){const S=this._getStacks(e,c),$=r!==void 0?S.indexOf(r):-1;return $===-1?S.length-1:$}_getRuler(){const e=this.options,r=this._cachedMeta,c=r.iScale,S=[];let $,Z;for($=0,Z=r.data.length;$H5(ni,ue,xe,!0)?1:Math.max(or,or*r,Cr,Cr*r),wt=(ni,or,Cr)=>H5(ni,ue,xe,!0)?-1:Math.min(or,or*r,Cr,Cr*r),Dt=bt(0,Se,it),Zt=bt(zp,Ne,pt),Mr=wt(cf,Se,it),ze=wt(cf+zp,Ne,pt);c=(Dt-Mr)/2,S=(Zt-ze)/2,$=-(Dt+Mr)/2,Z=-(Zt+ze)/2}return{ratioX:c,ratioY:S,offsetX:$,offsetY:Z}}class F$ extends F8{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const r=e.data,{labels:{pointStyle:c,textAlign:S,color:$,useBorderRadius:Z,borderRadius:ue}}=e.legend.options;return r.labels.length&&r.datasets.length?r.labels.map((xe,Se)=>{const it=e.getDatasetMeta(0).controller.getStyle(Se);return{text:xe,fillStyle:it.backgroundColor,fontColor:$,hidden:!e.getDataVisibility(Se),lineDash:it.borderDash,lineDashOffset:it.borderDashOffset,lineJoin:it.borderJoinStyle,lineWidth:it.borderWidth,strokeStyle:it.borderColor,textAlign:S,pointStyle:c,borderRadius:Z&&(ue||it.borderRadius),index:Se}}):[]}},onClick(e,r,c){c.chart.toggleDataVisibility(r.index),c.chart.update()}}}};constructor(e,r){super(e,r),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,r){const c=this.getDataset().data,S=this._cachedMeta;if(this._parsing===!1)S._parsed=c;else{let $=xe=>+c[xe];if(Nc(c[e])){const{key:xe="value"}=this._parsing;$=Se=>+jx(c[Se],xe)}let Z,ue;for(Z=e,ue=e+r;Z0&&!isNaN(e)?Ad*(Math.abs(e)/r):0}getLabelAndValue(e){const r=this._cachedMeta,c=this.chart,S=c.data.labels||[],$=$E(r._parsed[e],c.options.locale);return{label:S[e]||"",value:$}}getMaxBorderWidth(e){let r=0;const c=this.chart;let S,$,Z,ue,xe;if(!e){for(S=0,$=c.data.datasets.length;S<$;++S)if(c.isDatasetVisible(S)){Z=c.getDatasetMeta(S),e=Z.data,ue=Z.controller;break}}if(!e)return 0;for(S=0,$=e.length;S<$;++S)xe=ue.resolveDataElementOptions(S),xe.borderAlign!=="inner"&&(r=Math.max(r,xe.borderWidth||0,xe.hoverBorderWidth||0));return r}getMaxOffset(e){let r=0;for(let c=0,S=e.length;c0&&this.getParsed(r-1);for(let Cr=0;Cr=ze){Si.skip=!0;continue}const Ci=this.getParsed(Cr),ri=Kh(Ci[bt]),on=Si[pt]=Z.getPixelForValue(Ci[pt],Cr),yi=Si[bt]=$||ri?ue.getBasePixel():ue.getPixelForValue(xe?this.applyStack(ue,Ci,xe):Ci[bt],Cr);Si.skip=isNaN(on)||isNaN(yi)||ri,Si.stop=Cr>0&&Math.abs(Ci[pt]-or[pt])>Zt,Dt&&(Si.parsed=Ci,Si.raw=Se.data[Cr]),it&&(Si.options=Ne||this.resolveDataElementOptions(Cr,gi.active?"active":S)),Mr||this.updateElement(gi,Cr,Si,S),or=Ci}}getMaxOverflow(){const e=this._cachedMeta,r=e.dataset,c=r.options&&r.options.borderWidth||0,S=e.data||[];if(!S.length)return c;const $=S[0].size(this.resolveDataElementOptions(0)),Z=S[S.length-1].size(this.resolveDataElementOptions(S.length-1));return Math.max(c,$,Z)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}function dx(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class KE{static override(e){Object.assign(KE.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return dx()}parse(){return dx()}format(){return dx()}add(){return dx()}diff(){return dx()}startOf(){return dx()}endOf(){return dx()}}var j$={_date:KE};function tve(t,e,r,c){const{controller:S,data:$,_sorted:Z}=t,ue=S._cachedMeta.iScale,xe=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(ue&&e===ue.axis&&e!=="r"&&Z&&$.length){const Se=ue._reversePixels?kme:Ax;if(c){if(S._sharedOptions){const Ne=$[0],it=typeof Ne.getRange=="function"&&Ne.getRange(e);if(it){const pt=Se($,e,r-it),bt=Se($,e,r+it);return{lo:pt.lo,hi:bt.hi}}}}else{const Ne=Se($,e,r);if(xe){const{vScale:it}=S._cachedMeta,{_parsed:pt}=t,bt=pt.slice(0,Ne.lo+1).reverse().findIndex(Dt=>!Kh(Dt[it.axis]));Ne.lo-=Math.max(0,bt);const wt=pt.slice(Ne.hi).findIndex(Dt=>!Kh(Dt[it.axis]));Ne.hi+=Math.max(0,wt)}return Ne}}return{lo:0,hi:$.length-1}}function N8(t,e,r,c,S){const $=t.getSortedVisibleDatasetMetas(),Z=r[e];for(let ue=0,xe=$.length;ue{xe[Z]&&xe[Z](e[r],S)&&($.push({element:xe,datasetIndex:Se,index:Ne}),ue=ue||xe.inRange(e.x,e.y,S))}),c&&!ue?[]:$}var ave={modes:{index(t,e,r,c){const S=vx(e,t),$=r.axis||"x",Z=r.includeInvisible||!1,ue=r.intersect?F7(t,S,$,c,Z):N7(t,S,$,!1,c,Z),xe=[];return ue.length?(t.getSortedVisibleDatasetMetas().forEach(Se=>{const Ne=ue[0].index,it=Se.data[Ne];it&&!it.skip&&xe.push({element:it,datasetIndex:Se.index,index:Ne})}),xe):[]},dataset(t,e,r,c){const S=vx(e,t),$=r.axis||"xy",Z=r.includeInvisible||!1;let ue=r.intersect?F7(t,S,$,c,Z):N7(t,S,$,!1,c,Z);if(ue.length>0){const xe=ue[0].datasetIndex,Se=t.getDatasetMeta(xe).data;ue=[];for(let Ne=0;Ner.pos===e)}function TR(t,e){return t.filter(r=>U$.indexOf(r.pos)===-1&&r.box.axis===e)}function F3(t,e){return t.sort((r,c)=>{const S=e?c:r,$=e?r:c;return S.weight===$.weight?S.index-$.index:S.weight-$.weight})}function ove(t){const e=[];let r,c,S,$,Z,ue;for(r=0,c=(t||[]).length;rSe.box.fullSize),!0),c=F3(R3(e,"left"),!0),S=F3(R3(e,"right")),$=F3(R3(e,"top"),!0),Z=F3(R3(e,"bottom")),ue=TR(e,"x"),xe=TR(e,"y");return{fullSize:r,leftAndTop:c.concat($),rightAndBottom:S.concat(xe).concat(Z).concat(ue),chartArea:R3(e,"chartArea"),vertical:c.concat(S).concat(xe),horizontal:$.concat(Z).concat(ue)}}function SR(t,e,r,c){return Math.max(t[r],e[r])+Math.max(t[c],e[c])}function $$(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function cve(t,e,r,c){const{pos:S,box:$}=r,Z=t.maxPadding;if(!Nc(S)){r.size&&(t[S]-=r.size);const it=c[r.stack]||{size:0,count:1};it.size=Math.max(it.size,r.horizontal?$.height:$.width),r.size=it.size/it.count,t[S]+=r.size}$.getPadding&&$$(Z,$.getPadding());const ue=Math.max(0,e.outerWidth-SR(Z,t,"left","right")),xe=Math.max(0,e.outerHeight-SR(Z,t,"top","bottom")),Se=ue!==t.w,Ne=xe!==t.h;return t.w=ue,t.h=xe,r.horizontal?{same:Se,other:Ne}:{same:Ne,other:Se}}function hve(t){const e=t.maxPadding;function r(c){const S=Math.max(e[c]-t[c],0);return t[c]+=S,S}t.y+=r("top"),t.x+=r("left"),r("right"),r("bottom")}function fve(t,e){const r=e.maxPadding;function c(S){const $={left:0,top:0,right:0,bottom:0};return S.forEach(Z=>{$[Z]=Math.max(e[Z],r[Z])}),$}return c(t?["left","right"]:["top","bottom"])}function n5(t,e,r,c){const S=[];let $,Z,ue,xe,Se,Ne;for($=0,Z=t.length,Se=0;${typeof Dt.beforeLayout=="function"&&Dt.beforeLayout()});const Ne=xe.reduce((Dt,Zt)=>Zt.box.options&&Zt.box.options.display===!1?Dt:Dt+1,0)||1,it=Object.freeze({outerWidth:e,outerHeight:r,padding:S,availableWidth:$,availableHeight:Z,vBoxMaxWidth:$/2/Ne,hBoxMaxHeight:Z/2}),pt=Object.assign({},S);$$(pt,kg(c));const bt=Object.assign({maxPadding:pt,w:$,h:Z,x:S.left,y:S.top},S),wt=lve(xe.concat(Se),it);n5(ue.fullSize,bt,it,wt),n5(xe,bt,it,wt),n5(Se,bt,it,wt)&&n5(xe,bt,it,wt),hve(bt),CR(ue.leftAndTop,bt,it,wt),bt.x+=bt.w,bt.y+=bt.h,CR(ue.rightAndBottom,bt,it,wt),t.chartArea={left:bt.left,top:bt.top,right:bt.left+bt.w,bottom:bt.top+bt.h,height:bt.h,width:bt.w},uf(ue.chartArea,Dt=>{const Zt=Dt.box;Object.assign(Zt,t.chartArea),Zt.update(bt.w,bt.h,{left:0,top:0,right:0,bottom:0})})}};class H${acquireContext(e,r){}releaseContext(e){return!1}addEventListener(e,r,c){}removeEventListener(e,r,c){}getDevicePixelRatio(){return 1}getMaximumSize(e,r,c,S){return r=Math.max(0,r||e.width),c=c||e.height,{width:r,height:Math.max(0,S?Math.floor(r/S):c)}}isAttached(e){return!0}updateConfig(e){}}class dve extends H${acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const vT="$chartjs",pve={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},AR=t=>t===null||t==="";function mve(t,e){const r=t.style,c=t.getAttribute("height"),S=t.getAttribute("width");if(t[vT]={initial:{height:c,width:S,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",r.boxSizing=r.boxSizing||"border-box",AR(S)){const $=cR(t,"width");$!==void 0&&(t.width=$)}if(AR(c))if(t.style.height==="")t.height=t.width/(e||2);else{const $=cR(t,"height");$!==void 0&&(t.height=$)}return t}const V$=yge?{passive:!0}:!1;function gve(t,e,r){t&&t.addEventListener(e,r,V$)}function vve(t,e,r){t&&t.canvas&&t.canvas.removeEventListener(e,r,V$)}function yve(t,e){const r=pve[t.type]||t.type,{x:c,y:S}=vx(t,e);return{type:r,chart:e,native:t,x:c!==void 0?c:null,y:S!==void 0?S:null}}function ZT(t,e){for(const r of t)if(r===e||r.contains(e))return!0}function _ve(t,e,r){const c=t.canvas,S=new MutationObserver($=>{let Z=!1;for(const ue of $)Z=Z||ZT(ue.addedNodes,c),Z=Z&&!ZT(ue.removedNodes,c);Z&&r()});return S.observe(document,{childList:!0,subtree:!0}),S}function xve(t,e,r){const c=t.canvas,S=new MutationObserver($=>{let Z=!1;for(const ue of $)Z=Z||ZT(ue.removedNodes,c),Z=Z&&!ZT(ue.addedNodes,c);Z&&r()});return S.observe(document,{childList:!0,subtree:!0}),S}const q5=new Map;let MR=0;function W$(){const t=window.devicePixelRatio;t!==MR&&(MR=t,q5.forEach((e,r)=>{r.currentDevicePixelRatio!==t&&e()}))}function bve(t,e){q5.size||window.addEventListener("resize",W$),q5.set(t,e)}function wve(t){q5.delete(t),q5.size||window.removeEventListener("resize",W$)}function kve(t,e,r){const c=t.canvas,S=c&&ZE(c);if(!S)return;const $=_$((ue,xe)=>{const Se=S.clientWidth;r(ue,xe),Se{const xe=ue[0],Se=xe.contentRect.width,Ne=xe.contentRect.height;Se===0&&Ne===0||$(Se,Ne)});return Z.observe(S),bve(t,$),Z}function j7(t,e,r){r&&r.disconnect(),e==="resize"&&wve(t)}function Tve(t,e,r){const c=t.canvas,S=_$($=>{t.ctx!==null&&r(yve($,t))},t);return gve(c,e,S),S}class Sve extends H${acquireContext(e,r){const c=e&&e.getContext&&e.getContext("2d");return c&&c.canvas===e?(mve(e,r),c):null}releaseContext(e){const r=e.canvas;if(!r[vT])return!1;const c=r[vT].initial;["height","width"].forEach($=>{const Z=c[$];Kh(Z)?r.removeAttribute($):r.setAttribute($,Z)});const S=c.style||{};return Object.keys(S).forEach($=>{r.style[$]=S[$]}),r.width=r.width,delete r[vT],!0}addEventListener(e,r,c){this.removeEventListener(e,r);const S=e.$proxies||(e.$proxies={}),Z={attach:_ve,detach:xve,resize:kve}[r]||Tve;S[r]=Z(e,r,c)}removeEventListener(e,r){const c=e.$proxies||(e.$proxies={}),S=c[r];if(!S)return;({attach:j7,detach:j7,resize:j7}[r]||vve)(e,r,S),c[r]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,r,c,S){return vge(e,r,c,S)}isAttached(e){const r=e&&ZE(e);return!!(r&&r.isConnected)}}function Cve(t){return!GE()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?dve:Sve}let W1=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:r,y:c}=this.getProps(["x","y"],e);return{x:r,y:c}}hasValue(){return $5(this.x)&&$5(this.y)}getProps(e,r){const c=this.$animations;if(!r||!c)return this;const S={};return e.forEach($=>{S[$]=c[$]&&c[$].active()?c[$]._to:this[$]}),S}};function Ave(t,e){const r=t.options.ticks,c=Mve(t),S=Math.min(r.maxTicksLimit||c,c),$=r.major.enabled?Lve(e):[],Z=$.length,ue=$[0],xe=$[Z-1],Se=[];if(Z>S)return Pve(e,Se,$,Z/S),Se;const Ne=Eve($,e,S);if(Z>0){let it,pt;const bt=Z>1?Math.round((xe-ue)/(Z-1)):null;for(Wk(e,Se,Ne,Kh(bt)?0:ue-bt,ue),it=0,pt=Z-1;itS)return xe}return Math.max(S,1)}function Lve(t){const e=[];let r,c;for(r=0,c=t.length;rt==="left"?"right":t==="right"?"left":t,ER=(t,e,r)=>e==="top"||e==="left"?t[e]+r:t[e]-r,LR=(t,e)=>Math.min(e||t,t);function PR(t,e){const r=[],c=t.length/e,S=t.length;let $=0;for(;$Z+ue)))return xe}function Ove(t,e){uf(t,r=>{const c=r.gc,S=c.length/2;let $;if(S>e){for($=0;$c?c:r,c=S&&r>c?r:c,{min:pv(r,pv(c,r)),max:pv(c,pv(r,c))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Kf(this.options.beforeUpdate,[this])}update(e,r,c){const{beginAtZero:S,grace:$,ticks:Z}=this.options,ue=Z.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=r,this._margins=c=Object.assign({left:0,right:0,top:0,bottom:0},c),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+c.left+c.right:this.height+c.top+c.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Kme(this,$,S),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const xe=ue=$||c<=1||!this.isHorizontal()){this.labelRotation=S;return}const Ne=this._getLabelSizes(),it=Ne.widest.width,pt=Ne.highest.height,bt=U0(this.chart.width-it,0,this.maxWidth);ue=e.offset?this.maxWidth/c:bt/(c-1),it+6>ue&&(ue=bt/(c-(e.offset?.5:1)),xe=this.maxHeight-N3(e.grid)-r.padding-IR(e.title,this.chart.options.font),Se=Math.sqrt(it*it+pt*pt),Z=xme(Math.min(Math.asin(U0((Ne.highest.height+6)/ue,-1,1)),Math.asin(U0(xe/Se,-1,1))-Math.asin(U0(pt/Se,-1,1)))),Z=Math.max(S,Math.min($,Z))),this.labelRotation=Z}afterCalculateLabelRotation(){Kf(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Kf(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:r,options:{ticks:c,title:S,grid:$}}=this,Z=this._isVisible(),ue=this.isHorizontal();if(Z){const xe=IR(S,r.options.font);if(ue?(e.width=this.maxWidth,e.height=N3($)+xe):(e.height=this.maxHeight,e.width=N3($)+xe),c.display&&this.ticks.length){const{first:Se,last:Ne,widest:it,highest:pt}=this._getLabelSizes(),bt=c.padding*2,wt=O1(this.labelRotation),Dt=Math.cos(wt),Zt=Math.sin(wt);if(ue){const Mr=c.mirror?0:Zt*it.width+Dt*pt.height;e.height=Math.min(this.maxHeight,e.height+Mr+bt)}else{const Mr=c.mirror?0:Dt*it.width+Zt*pt.height;e.width=Math.min(this.maxWidth,e.width+Mr+bt)}this._calculatePadding(Se,Ne,Zt,Dt)}}this._handleMargins(),ue?(this.width=this._length=r.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=r.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,r,c,S){const{ticks:{align:$,padding:Z},position:ue}=this.options,xe=this.labelRotation!==0,Se=ue!=="top"&&this.axis==="x";if(this.isHorizontal()){const Ne=this.getPixelForTick(0)-this.left,it=this.right-this.getPixelForTick(this.ticks.length-1);let pt=0,bt=0;xe?Se?(pt=S*e.width,bt=c*r.height):(pt=c*e.height,bt=S*r.width):$==="start"?bt=r.width:$==="end"?pt=e.width:$!=="inner"&&(pt=e.width/2,bt=r.width/2),this.paddingLeft=Math.max((pt-Ne+Z)*this.width/(this.width-Ne),0),this.paddingRight=Math.max((bt-it+Z)*this.width/(this.width-it),0)}else{let Ne=r.height/2,it=e.height/2;$==="start"?(Ne=0,it=e.height):$==="end"&&(Ne=r.height,it=0),this.paddingTop=Ne+Z,this.paddingBottom=it+Z}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Kf(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:r}=this.options;return r==="top"||r==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let r,c;for(r=0,c=e.length;r({width:Z[ri]||0,height:ue[ri]||0});return{first:Ci(0),last:Ci(r-1),widest:Ci(gi),highest:Ci(Si),widths:Z,heights:ue}}getLabelForValue(e){return e}getPixelForValue(e,r){return NaN}getValueForPixel(e){}getPixelForTick(e){const r=this.ticks;return e<0||e>r.length-1?null:this.getPixelForValue(r[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const r=this._startPixel+e*this._length;return wme(this._alignToPixels?fx(this.chart,r,0):r)}getDecimalForPixel(e){const r=(e-this._startPixel)/this._length;return this._reversePixels?1-r:r}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:r}=this;return e<0&&r<0?r:e>0&&r>0?e:0}getContext(e){const r=this.ticks||[];if(e>=0&&eue*S?ue/c:xe/S:xe*S0}_computeGridLineItems(e){const r=this.axis,c=this.chart,S=this.options,{grid:$,position:Z,border:ue}=S,xe=$.offset,Se=this.isHorizontal(),it=this.ticks.length+(xe?1:0),pt=N3($),bt=[],wt=ue.setContext(this.getContext()),Dt=wt.display?wt.width:0,Zt=Dt/2,Mr=function(Jr){return fx(c,Jr,Dt)};let ze,ni,or,Cr,gi,Si,Ci,ri,on,yi,gr,fr;if(Z==="top")ze=Mr(this.bottom),Si=this.bottom-pt,ri=ze-Zt,yi=Mr(e.top)+Zt,fr=e.bottom;else if(Z==="bottom")ze=Mr(this.top),yi=e.top,fr=Mr(e.bottom)-Zt,Si=ze+Zt,ri=this.top+pt;else if(Z==="left")ze=Mr(this.right),gi=this.right-pt,Ci=ze-Zt,on=Mr(e.left)+Zt,gr=e.right;else if(Z==="right")ze=Mr(this.left),on=e.left,gr=Mr(e.right)-Zt,gi=ze+Zt,Ci=this.left+pt;else if(r==="x"){if(Z==="center")ze=Mr((e.top+e.bottom)/2+.5);else if(Nc(Z)){const Jr=Object.keys(Z)[0],ti=Z[Jr];ze=Mr(this.chart.scales[Jr].getPixelForValue(ti))}yi=e.top,fr=e.bottom,Si=ze+Zt,ri=Si+pt}else if(r==="y"){if(Z==="center")ze=Mr((e.left+e.right)/2);else if(Nc(Z)){const Jr=Object.keys(Z)[0],ti=Z[Jr];ze=Mr(this.chart.scales[Jr].getPixelForValue(ti))}gi=ze-Zt,Ci=gi-pt,on=e.left,gr=e.right}const Sr=_c(S.ticks.maxTicksLimit,it),ei=Math.max(1,Math.ceil(it/Sr));for(ni=0;ni0&&(nn-=qn/2);break}ga={left:nn,top:ln,width:qn+ya.width,height:ro+ya.height,color:ei.backdropColor}}Zt.push({label:or,font:ri,textOffset:gr,options:{rotation:Dt,color:ti,strokeColor:Di,strokeWidth:En,textAlign:Zn,textBaseline:fr,translation:[Cr,gi],backdrop:ga}})}return Zt}_getXAxisLabelAlignment(){const{position:e,ticks:r}=this.options;if(-O1(this.labelRotation))return e==="top"?"left":"right";let S="center";return r.align==="start"?S="left":r.align==="end"?S="right":r.align==="inner"&&(S="inner"),S}_getYAxisLabelAlignment(e){const{position:r,ticks:{crossAlign:c,mirror:S,padding:$}}=this.options,Z=this._getLabelSizes(),ue=e+$,xe=Z.widest.width;let Se,Ne;return r==="left"?S?(Ne=this.right+$,c==="near"?Se="left":c==="center"?(Se="center",Ne+=xe/2):(Se="right",Ne+=xe)):(Ne=this.right-ue,c==="near"?Se="right":c==="center"?(Se="center",Ne-=xe/2):(Se="left",Ne=this.left)):r==="right"?S?(Ne=this.left+$,c==="near"?Se="right":c==="center"?(Se="center",Ne-=xe/2):(Se="left",Ne-=xe)):(Ne=this.left+ue,c==="near"?Se="left":c==="center"?(Se="center",Ne+=xe/2):(Se="right",Ne=this.right)):Se="right",{textAlign:Se,x:Ne}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,r=this.options.position;if(r==="left"||r==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(r==="top"||r==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:r},left:c,top:S,width:$,height:Z}=this;r&&(e.save(),e.fillStyle=r,e.fillRect(c,S,$,Z),e.restore())}getLineWidthForValue(e){const r=this.options.grid;if(!this._isVisible()||!r.display)return 0;const S=this.ticks.findIndex($=>$.value===e);return S>=0?r.setContext(this.getContext(S)).lineWidth:0}drawGrid(e){const r=this.options.grid,c=this.ctx,S=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let $,Z;const ue=(xe,Se,Ne)=>{!Ne.width||!Ne.color||(c.save(),c.lineWidth=Ne.width,c.strokeStyle=Ne.color,c.setLineDash(Ne.borderDash||[]),c.lineDashOffset=Ne.borderDashOffset,c.beginPath(),c.moveTo(xe.x,xe.y),c.lineTo(Se.x,Se.y),c.stroke(),c.restore())};if(r.display)for($=0,Z=S.length;${this.draw($)}}]:[{z:c,draw:$=>{this.drawBackground(),this.drawGrid($),this.drawTitle()}},{z:S,draw:()=>{this.drawBorder()}},{z:r,draw:$=>{this.drawLabels($)}}]}getMatchingVisibleMetas(e){const r=this.chart.getSortedVisibleDatasetMetas(),c=this.axis+"AxisID",S=[];let $,Z;for($=0,Z=r.length;${const c=r.split("."),S=c.pop(),$=[t].concat(c).join("."),Z=e[r].split("."),ue=Z.pop(),xe=Z.join(".");sp.route($,S,xe,ue)})}function $ve(t){return"id"in t&&"defaults"in t}class Hve{constructor(){this.controllers=new qk(F8,"datasets",!0),this.elements=new qk(W1,"elements"),this.plugins=new qk(Object,"plugins"),this.scales=new qk(K2,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,r,c){[...r].forEach(S=>{const $=c||this._getRegistryForType(S);c||$.isForType(S)||$===this.plugins&&S.id?this._exec(e,$,S):uf(S,Z=>{const ue=c||this._getRegistryForType(Z);this._exec(e,ue,Z)})})}_exec(e,r,c){const S=FE(e);Kf(c["before"+S],[],c),r[e](c),Kf(c["after"+S],[],c)}_getRegistryForType(e){for(let r=0;r$.filter(ue=>!Z.some(xe=>ue.plugin.id===xe.plugin.id));this._notify(S(r,c),e,"stop"),this._notify(S(c,r),e,"start")}}function Wve(t){const e={},r=[],c=Object.keys(wv.plugins.items);for(let $=0;$1&&DR(t[0].toLowerCase());if(c)return c}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function zR(t,e,r){if(r[e+"AxisID"]===t)return{axis:e}}function Jve(t,e){if(e.data&&e.data.datasets){const r=e.data.datasets.filter(c=>c.xAxisID===t||c.yAxisID===t);if(r.length)return zR(t,"x",r[0])||zR(t,"y",r[0])}return{}}function Qve(t,e){const r=Ux[t.type]||{scales:{}},c=e.scales||{},S=r9(t.type,e),$=Object.create(null);return Object.keys(c).forEach(Z=>{const ue=c[Z];if(!Nc(ue))return console.error(`Invalid scale configuration for scale: ${Z}`);if(ue._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${Z}`);const xe=i9(Z,ue,Jve(Z,t),sp.scales[ue.type]),Se=Yve(xe,S),Ne=r.scales||{};$[Z]=b5(Object.create(null),[{axis:xe},ue,Ne[xe],Ne[Se]])}),t.data.datasets.forEach(Z=>{const ue=Z.type||t.type,xe=Z.indexAxis||r9(ue,e),Ne=(Ux[ue]||{}).scales||{};Object.keys(Ne).forEach(it=>{const pt=Kve(it,xe),bt=Z[pt+"AxisID"]||pt;$[bt]=$[bt]||Object.create(null),b5($[bt],[{axis:pt},c[bt],Ne[it]])})}),Object.keys($).forEach(Z=>{const ue=$[Z];b5(ue,[sp.scales[ue.type],sp.scale])}),$}function q$(t){const e=t.options||(t.options={});e.plugins=_c(e.plugins,{}),e.scales=Qve(t,e)}function G$(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function e1e(t){return t=t||{},t.data=G$(t.data),q$(t),t}const OR=new Map,Z$=new Set;function Gk(t,e){let r=OR.get(t);return r||(r=e(),OR.set(t,r),Z$.add(r)),r}const j3=(t,e,r)=>{const c=jx(e,r);c!==void 0&&t.add(c)};class t1e{constructor(e){this._config=e1e(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=G$(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),q$(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gk(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,r){return Gk(`${e}.transition.${r}`,()=>[[`datasets.${e}.transitions.${r}`,`transitions.${r}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,r){return Gk(`${e}-${r}`,()=>[[`datasets.${e}.elements.${r}`,`datasets.${e}`,`elements.${r}`,""]])}pluginScopeKeys(e){const r=e.id,c=this.type;return Gk(`${c}-plugin-${r}`,()=>[[`plugins.${r}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,r){const c=this._scopeCache;let S=c.get(e);return(!S||r)&&(S=new Map,c.set(e,S)),S}getOptionScopes(e,r,c){const{options:S,type:$}=this,Z=this._cachedScopes(e,c),ue=Z.get(r);if(ue)return ue;const xe=new Set;r.forEach(Ne=>{e&&(xe.add(e),Ne.forEach(it=>j3(xe,e,it))),Ne.forEach(it=>j3(xe,S,it)),Ne.forEach(it=>j3(xe,Ux[$]||{},it)),Ne.forEach(it=>j3(xe,sp,it)),Ne.forEach(it=>j3(xe,e9,it))});const Se=Array.from(xe);return Se.length===0&&Se.push(Object.create(null)),Z$.has(r)&&Z.set(r,Se),Se}chartOptionScopes(){const{options:e,type:r}=this;return[e,Ux[r]||{},sp.datasets[r]||{},{type:r},sp,e9]}resolveNamedOptions(e,r,c,S=[""]){const $={$shared:!0},{resolver:Z,subPrefixes:ue}=BR(this._resolverCache,e,S);let xe=Z;if(i1e(Z,r)){$.$shared=!1,c=y_(c)?c():c;const Se=this.createResolver(e,c,ue);xe=$2(Z,c,Se)}for(const Se of r)$[Se]=xe[Se];return $}createResolver(e,r,c=[""],S){const{resolver:$}=BR(this._resolverCache,e,c);return Nc(r)?$2($,r,void 0,S):$}}function BR(t,e,r){let c=t.get(e);c||(c=new Map,t.set(e,c));const S=r.join();let $=c.get(S);return $||($={resolver:VE(e,r),subPrefixes:r.filter(ue=>!ue.toLowerCase().includes("hover"))},c.set(S,$)),$}const r1e=t=>Nc(t)&&Object.getOwnPropertyNames(t).some(e=>y_(t[e]));function i1e(t,e){const{isScriptable:r,isIndexable:c}=k$(t);for(const S of e){const $=r(S),Z=c(S),ue=(Z||$)&&t[S];if($&&(y_(ue)||r1e(ue))||Z&&wp(ue))return!0}return!1}var n1e="4.5.1";const a1e=["top","bottom","left","right","chartArea"];function RR(t,e){return t==="top"||t==="bottom"||a1e.indexOf(t)===-1&&e==="x"}function FR(t,e){return function(r,c){return r[t]===c[t]?r[e]-c[e]:r[t]-c[t]}}function NR(t){const e=t.chart,r=e.options.animation;e.notifyPlugins("afterRender"),Kf(r&&r.onComplete,[t],e)}function o1e(t){const e=t.chart,r=e.options.animation;Kf(r&&r.onProgress,[t],e)}function K$(t){return GE()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const yT={},jR=t=>{const e=K$(t);return Object.values(yT).filter(r=>r.canvas===e).pop()};function s1e(t,e,r){const c=Object.keys(t);for(const S of c){const $=+S;if($>=e){const Z=t[S];delete t[S],(r>0||$>e)&&(t[$+r]=Z)}}}function l1e(t,e,r,c){return!r||t.type==="mouseout"?null:c?e:t}class l_{static defaults=sp;static instances=yT;static overrides=Ux;static registry=wv;static version=n1e;static getChart=jR;static register(...e){wv.add(...e),UR()}static unregister(...e){wv.remove(...e),UR()}constructor(e,r){const c=this.config=new t1e(r),S=K$(e),$=jR(S);if($)throw new Error("Canvas is already in use. Chart with ID '"+$.id+"' must be destroyed before the canvas with ID '"+$.canvas.id+"' can be reused.");const Z=c.createResolver(c.chartOptionScopes(),this.getContext());this.platform=new(c.platform||Cve(S)),this.platform.updateConfig(c);const ue=this.platform.acquireContext(S,Z.aspectRatio),xe=ue&&ue.canvas,Se=xe&&xe.height,Ne=xe&&xe.width;if(this.id=sme(),this.ctx=ue,this.canvas=xe,this.width=Ne,this.height=Se,this._options=Z,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Vve,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Cme(it=>this.update(it),Z.resizeDelay||0),this._dataChanges=[],yT[this.id]=this,!ue||!xe){console.error("Failed to create chart: can't acquire context from the given item");return}w1.listen(this,"complete",NR),w1.listen(this,"progress",o1e),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:r},width:c,height:S,_aspectRatio:$}=this;return Kh(e)?r&&$?$:S?c/S:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return wv}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():uR(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return oR(this.canvas,this.ctx),this}stop(){return w1.stop(this),this}resize(e,r){w1.running(this)?this._resizeBeforeDraw={width:e,height:r}:this._resize(e,r)}_resize(e,r){const c=this.options,S=this.canvas,$=c.maintainAspectRatio&&this.aspectRatio,Z=this.platform.getMaximumSize(S,e,r,$),ue=c.devicePixelRatio||this.platform.getDevicePixelRatio(),xe=this.width?"resize":"attach";this.width=Z.width,this.height=Z.height,this._aspectRatio=this.aspectRatio,uR(this,ue,!0)&&(this.notifyPlugins("resize",{size:Z}),Kf(c.onResize,[this,Z],this),this.attached&&this._doResize(xe)&&this.render())}ensureScalesHaveIDs(){const r=this.options.scales||{};uf(r,(c,S)=>{c.id=S})}buildOrUpdateScales(){const e=this.options,r=e.scales,c=this.scales,S=Object.keys(c).reduce((Z,ue)=>(Z[ue]=!1,Z),{});let $=[];r&&($=$.concat(Object.keys(r).map(Z=>{const ue=r[Z],xe=i9(Z,ue),Se=xe==="r",Ne=xe==="x";return{options:ue,dposition:Se?"chartArea":Ne?"bottom":"left",dtype:Se?"radialLinear":Ne?"category":"linear"}}))),uf($,Z=>{const ue=Z.options,xe=ue.id,Se=i9(xe,ue),Ne=_c(ue.type,Z.dtype);(ue.position===void 0||RR(ue.position,Se)!==RR(Z.dposition))&&(ue.position=Z.dposition),S[xe]=!0;let it=null;if(xe in c&&c[xe].type===Ne)it=c[xe];else{const pt=wv.getScale(Ne);it=new pt({id:xe,type:Ne,ctx:this.ctx,chart:this}),c[it.id]=it}it.init(ue,e)}),uf(S,(Z,ue)=>{Z||delete c[ue]}),uf(c,Z=>{vg.configure(this,Z,Z.options),vg.addBox(this,Z)})}_updateMetasets(){const e=this._metasets,r=this.data.datasets.length,c=e.length;if(e.sort((S,$)=>S.index-$.index),c>r){for(let S=r;Sr.length&&delete this._stacks,e.forEach((c,S)=>{r.filter($=>$===c._dataset).length===0&&this._destroyDatasetMeta(S)})}buildOrUpdateControllers(){const e=[],r=this.data.datasets;let c,S;for(this._removeUnreferencedMetasets(),c=0,S=r.length;c{this.getDatasetMeta(r).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const r=this.config;r.update();const c=this._options=r.createResolver(r.chartOptionScopes(),this.getContext()),S=this._animationsDisabled=!c.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const $=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let Z=0;for(let Se=0,Ne=this.data.datasets.length;Se{Se.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(FR("z","_idx"));const{_active:ue,_lastEvent:xe}=this;xe?this._eventHandler(xe,!0):ue.length&&this._updateHoverStyles(ue,ue,!0),this.render()}_updateScales(){uf(this.scales,e=>{vg.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,r=new Set(Object.keys(this._listeners)),c=new Set(e.events);(!YB(r,c)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,r=this._getUniformDataChanges()||[];for(const{method:c,start:S,count:$}of r){const Z=c==="_removeElements"?-$:$;s1e(e,S,Z)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const r=this.data.datasets.length,c=$=>new Set(e.filter(Z=>Z[0]===$).map((Z,ue)=>ue+","+Z.splice(1).join(","))),S=c(0);for(let $=1;$$.split(",")).map($=>({method:$[1],start:+$[2],count:+$[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vg.update(this,this.width,this.height,e);const r=this.chartArea,c=r.width<=0||r.height<=0;this._layers=[],uf(this.boxes,S=>{c&&S.position==="chartArea"||(S.configure&&S.configure(),this._layers.push(...S._layers()))},this),this._layers.forEach((S,$)=>{S._idx=$}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let r=0,c=this.data.datasets.length;r=0;--r)this._drawDataset(e[r]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const r=this.ctx,c={meta:e,index:e.index,cancelable:!0},S=D$(this,e);this.notifyPlugins("beforeDatasetDraw",c)!==!1&&(S&&O8(r,S),e.controller.draw(),S&&B8(r),c.cancelable=!1,this.notifyPlugins("afterDatasetDraw",c))}isPointInArea(e){return V5(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,r,c,S){const $=ave.modes[r];return typeof $=="function"?$(this,e,c,S):[]}getDatasetMeta(e){const r=this.data.datasets[e],c=this._metasets;let S=c.filter($=>$&&$._dataset===r).pop();return S||(S={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r&&r.order||0,index:e,_dataset:r,_parsed:[],_sorted:!1},c.push(S)),S}getContext(){return this.$context||(this.$context=Wx(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const r=this.data.datasets[e];if(!r)return!1;const c=this.getDatasetMeta(e);return typeof c.hidden=="boolean"?!c.hidden:!r.hidden}setDatasetVisibility(e,r){const c=this.getDatasetMeta(e);c.hidden=!r}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,r,c){const S=c?"show":"hide",$=this.getDatasetMeta(e),Z=$.controller._resolveAnimations(void 0,S);U5(r)?($.data[r].hidden=!c,this.update()):(this.setDatasetVisibility(e,c),Z.update($,{visible:c}),this.update(ue=>ue.datasetIndex===e?S:void 0))}hide(e,r){this._updateVisibility(e,r,!1)}show(e,r){this._updateVisibility(e,r,!0)}_destroyDatasetMeta(e){const r=this._metasets[e];r&&r.controller&&r.controller._destroy(),delete this._metasets[e]}_stop(){let e,r;for(this.stop(),w1.remove(this),e=0,r=this.data.datasets.length;e{r.addEventListener(this,$,Z),e[$]=Z},S=($,Z,ue)=>{$.offsetX=Z,$.offsetY=ue,this._eventHandler($)};uf(this.options.events,$=>c($,S))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,r=this.platform,c=(xe,Se)=>{r.addEventListener(this,xe,Se),e[xe]=Se},S=(xe,Se)=>{e[xe]&&(r.removeEventListener(this,xe,Se),delete e[xe])},$=(xe,Se)=>{this.canvas&&this.resize(xe,Se)};let Z;const ue=()=>{S("attach",ue),this.attached=!0,this.resize(),c("resize",$),c("detach",Z)};Z=()=>{this.attached=!1,S("resize",$),this._stop(),this._resize(0,0),c("attach",ue)},r.isAttached(this.canvas)?ue():Z()}unbindEvents(){uf(this._listeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._listeners={},uf(this._responsiveListeners,(e,r)=>{this.platform.removeEventListener(this,r,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,r,c){const S=c?"set":"remove";let $,Z,ue,xe;for(r==="dataset"&&($=this.getDatasetMeta(e[0].datasetIndex),$.controller["_"+S+"DatasetHoverStyle"]()),ue=0,xe=e.length;ue{const ue=this.getDatasetMeta($);if(!ue)throw new Error("No dataset found at index "+$);return{datasetIndex:$,element:ue.data[Z],index:Z}});!HT(c,r)&&(this._active=c,this._lastEvent=null,this._updateHoverStyles(c,r))}notifyPlugins(e,r,c){return this._plugins.notify(this,e,r,c)}isPluginEnabled(e){return this._plugins._cache.filter(r=>r.plugin.id===e).length===1}_updateHoverStyles(e,r,c){const S=this.options.hover,$=(xe,Se)=>xe.filter(Ne=>!Se.some(it=>Ne.datasetIndex===it.datasetIndex&&Ne.index===it.index)),Z=$(r,e),ue=c?e:$(e,r);Z.length&&this.updateHoverStyle(Z,S.mode,!1),ue.length&&S.mode&&this.updateHoverStyle(ue,S.mode,!0)}_eventHandler(e,r){const c={event:e,replay:r,cancelable:!0,inChartArea:this.isPointInArea(e)},S=Z=>(Z.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",c,S)===!1)return;const $=this._handleEvent(e,r,c.inChartArea);return c.cancelable=!1,this.notifyPlugins("afterEvent",c,S),($||c.changed)&&this.render(),this}_handleEvent(e,r,c){const{_active:S=[],options:$}=this,Z=r,ue=this._getActiveElements(e,S,c,Z),xe=dme(e),Se=l1e(e,this._lastEvent,c,xe);c&&(this._lastEvent=null,Kf($.onHover,[e,ue,this],this),xe&&Kf($.onClick,[e,ue,this],this));const Ne=!HT(ue,S);return(Ne||r)&&(this._active=ue,this._updateHoverStyles(ue,S,r)),this._lastEvent=Se,Ne}_getActiveElements(e,r,c,S){if(e.type==="mouseout")return[];if(!c)return r;const $=this.options.hover;return this.getElementsAtEventForMode(e,$.mode,$,S)}}function UR(){return uf(l_.instances,t=>t._plugins.invalidate())}function u1e(t,e,r){const{startAngle:c,x:S,y:$,outerRadius:Z,innerRadius:ue,options:xe}=e,{borderWidth:Se,borderJoinStyle:Ne}=xe,it=Math.min(Se/Z,Zm(c-r));if(t.beginPath(),t.arc(S,$,Z-Se/2,c+it/2,r-it/2),ue>0){const pt=Math.min(Se/ue,Zm(c-r));t.arc(S,$,ue+Se/2,r-pt/2,c+pt/2,!0)}else{const pt=Math.min(Se/2,Z*Zm(c-r));if(Ne==="round")t.arc(S,$,pt,r-cf/2,c+cf/2,!0);else if(Ne==="bevel"){const bt=2*pt*pt,wt=-bt*Math.cos(r+cf/2)+S,Dt=-bt*Math.sin(r+cf/2)+$,Zt=bt*Math.cos(c+cf/2)+S,Mr=bt*Math.sin(c+cf/2)+$;t.lineTo(wt,Dt),t.lineTo(Zt,Mr)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function c1e(t,e,r){const{startAngle:c,pixelMargin:S,x:$,y:Z,outerRadius:ue,innerRadius:xe}=e;let Se=S/ue;t.beginPath(),t.arc($,Z,ue,c-Se,r+Se),xe>S?(Se=S/xe,t.arc($,Z,xe,r+Se,c-Se,!0)):t.arc($,Z,S,r+zp,c-zp),t.closePath(),t.clip()}function h1e(t){return HE(t,["outerStart","outerEnd","innerStart","innerEnd"])}function f1e(t,e,r,c){const S=h1e(t.options.borderRadius),$=(r-e)/2,Z=Math.min($,c*e/2),ue=xe=>{const Se=(r-Math.min($,xe))*c/2;return U0(xe,0,Math.min($,Se))};return{outerStart:ue(S.outerStart),outerEnd:ue(S.outerEnd),innerStart:U0(S.innerStart,0,Z),innerEnd:U0(S.innerEnd,0,Z)}}function m2(t,e,r,c){return{x:r+t*Math.cos(e),y:c+t*Math.sin(e)}}function KT(t,e,r,c,S,$){const{x:Z,y:ue,startAngle:xe,pixelMargin:Se,innerRadius:Ne}=e,it=Math.max(e.outerRadius+c+r-Se,0),pt=Ne>0?Ne+c+r+Se:0;let bt=0;const wt=S-xe;if(c){const ei=Ne>0?Ne-c:0,Jr=it>0?it-c:0,ti=(ei+Jr)/2,Di=ti!==0?wt*ti/(ti+c):wt;bt=(wt-Di)/2}const Dt=Math.max(.001,wt*it-r/cf)/it,Zt=(wt-Dt)/2,Mr=xe+Zt+bt,ze=S-Zt-bt,{outerStart:ni,outerEnd:or,innerStart:Cr,innerEnd:gi}=f1e(e,pt,it,ze-Mr),Si=it-ni,Ci=it-or,ri=Mr+ni/Si,on=ze-or/Ci,yi=pt+Cr,gr=pt+gi,fr=Mr+Cr/yi,Sr=ze-gi/gr;if(t.beginPath(),$){const ei=(ri+on)/2;if(t.arc(Z,ue,it,ri,ei),t.arc(Z,ue,it,ei,on),or>0){const En=m2(Ci,on,Z,ue);t.arc(En.x,En.y,or,on,ze+zp)}const Jr=m2(gr,ze,Z,ue);if(t.lineTo(Jr.x,Jr.y),gi>0){const En=m2(gr,Sr,Z,ue);t.arc(En.x,En.y,gi,ze+zp,Sr+Math.PI)}const ti=(ze-gi/pt+(Mr+Cr/pt))/2;if(t.arc(Z,ue,pt,ze-gi/pt,ti,!0),t.arc(Z,ue,pt,ti,Mr+Cr/pt,!0),Cr>0){const En=m2(yi,fr,Z,ue);t.arc(En.x,En.y,Cr,fr+Math.PI,Mr-zp)}const Di=m2(Si,Mr,Z,ue);if(t.lineTo(Di.x,Di.y),ni>0){const En=m2(Si,ri,Z,ue);t.arc(En.x,En.y,ni,Mr-zp,ri)}}else{t.moveTo(Z,ue);const ei=Math.cos(ri)*it+Z,Jr=Math.sin(ri)*it+ue;t.lineTo(ei,Jr);const ti=Math.cos(on)*it+Z,Di=Math.sin(on)*it+ue;t.lineTo(ti,Di)}t.closePath()}function d1e(t,e,r,c,S){const{fullCircles:$,startAngle:Z,circumference:ue}=e;let xe=e.endAngle;if($){KT(t,e,r,c,xe,S);for(let Se=0;Se<$;++Se)t.fill();isNaN(ue)||(xe=Z+(ue%Ad||Ad))}return KT(t,e,r,c,xe,S),t.fill(),xe}function p1e(t,e,r,c,S){const{fullCircles:$,startAngle:Z,circumference:ue,options:xe}=e,{borderWidth:Se,borderJoinStyle:Ne,borderDash:it,borderDashOffset:pt,borderRadius:bt}=xe,wt=xe.borderAlign==="inner";if(!Se)return;t.setLineDash(it||[]),t.lineDashOffset=pt,wt?(t.lineWidth=Se*2,t.lineJoin=Ne||"round"):(t.lineWidth=Se,t.lineJoin=Ne||"bevel");let Dt=e.endAngle;if($){KT(t,e,r,c,Dt,S);for(let Zt=0;Zt<$;++Zt)t.stroke();isNaN(ue)||(Dt=Z+(ue%Ad||Ad))}wt&&c1e(t,e,Dt),xe.selfJoin&&Dt-Z>=cf&&bt===0&&Ne!=="miter"&&u1e(t,e,Dt),$||(KT(t,e,r,c,Dt,S),t.stroke())}class Y$ extends W1{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,r,c){const S=this.getProps(["x","y"],c),{angle:$,distance:Z}=m$(S,{x:e,y:r}),{startAngle:ue,endAngle:xe,innerRadius:Se,outerRadius:Ne,circumference:it}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],c),pt=(this.options.spacing+this.options.borderWidth)/2,bt=_c(it,xe-ue),wt=H5($,ue,xe)&&ue!==xe,Dt=bt>=Ad||wt,Zt=B1(Z,Se+pt,Ne+pt);return Dt&&Zt}getCenterPoint(e){const{x:r,y:c,startAngle:S,endAngle:$,innerRadius:Z,outerRadius:ue}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:xe,spacing:Se}=this.options,Ne=(S+$)/2,it=(Z+ue+Se+xe)/2;return{x:r+Math.cos(Ne)*it,y:c+Math.sin(Ne)*it}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:r,circumference:c}=this,S=(r.offset||0)/4,$=(r.spacing||0)/2,Z=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=c>Ad?Math.floor(c/Ad):0,c===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const ue=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(ue)*S,Math.sin(ue)*S);const xe=1-Math.sin(Math.min(cf,c||0)),Se=S*xe;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,d1e(e,this,Se,$,Z),p1e(e,this,Se,$,Z),e.restore()}}function X$(t,e,r=e){t.lineCap=_c(r.borderCapStyle,e.borderCapStyle),t.setLineDash(_c(r.borderDash,e.borderDash)),t.lineDashOffset=_c(r.borderDashOffset,e.borderDashOffset),t.lineJoin=_c(r.borderJoinStyle,e.borderJoinStyle),t.lineWidth=_c(r.borderWidth,e.borderWidth),t.strokeStyle=_c(r.borderColor,e.borderColor)}function m1e(t,e,r){t.lineTo(r.x,r.y)}function g1e(t){return t.stepped?jme:t.tension||t.cubicInterpolationMode==="monotone"?Ume:m1e}function J$(t,e,r={}){const c=t.length,{start:S=0,end:$=c-1}=r,{start:Z,end:ue}=e,xe=Math.max(S,Z),Se=Math.min($,ue),Ne=Sue&&$>ue;return{count:c,start:xe,loop:e.loop,ilen:Se(Z+(Se?ue-or:or))%$,ni=()=>{Dt!==Zt&&(t.lineTo(Ne,Zt),t.lineTo(Ne,Dt),t.lineTo(Ne,Mr))};for(xe&&(bt=S[ze(0)],t.moveTo(bt.x,bt.y)),pt=0;pt<=ue;++pt){if(bt=S[ze(pt)],bt.skip)continue;const or=bt.x,Cr=bt.y,gi=or|0;gi===wt?(CrZt&&(Zt=Cr),Ne=(it*Ne+or)/++it):(ni(),t.lineTo(or,Cr),wt=gi,it=0,Dt=Zt=Cr),Mr=Cr}ni()}function n9(t){const e=t.options,r=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!r?y1e:v1e}function _1e(t){return t.stepped?_ge:t.tension||t.cubicInterpolationMode==="monotone"?xge:yx}function x1e(t,e,r,c){let S=e._path;S||(S=e._path=new Path2D,e.path(S,r,c)&&S.closePath()),X$(t,e.options),t.stroke(S)}function b1e(t,e,r,c){const{segments:S,options:$}=e,Z=n9(e);for(const ue of S)X$(t,$,ue.style),t.beginPath(),Z(t,e,ue,{start:r,end:r+c-1})&&t.closePath(),t.stroke()}const w1e=typeof Path2D=="function";function k1e(t,e,r,c){w1e&&!e.options.segment?x1e(t,e,r,c):b1e(t,e,r,c)}class s4 extends W1{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,r){const c=this.options;if((c.tension||c.cubicInterpolationMode==="monotone")&&!c.stepped&&!this._pointsUpdated){const S=c.spanGaps?this._loop:this._fullLoop;hge(this._points,c,e,S,r),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Cge(this,this.options.segment))}first(){const e=this.segments,r=this.points;return e.length&&r[e[0].start]}last(){const e=this.segments,r=this.points,c=e.length;return c&&r[e[c-1].end]}interpolate(e,r){const c=this.options,S=e[r],$=this.points,Z=I$(this,{property:r,start:S,end:S});if(!Z.length)return;const ue=[],xe=_1e(c);let Se,Ne;for(Se=0,Ne=Z.length;Se{ue=j8(Z,ue,S);const xe=S[Z],Se=S[ue];c!==null?($.push({x:xe.x,y:c}),$.push({x:Se.x,y:c})):r!==null&&($.push({x:r,y:xe.y}),$.push({x:r,y:Se.y}))}),$}function j8(t,e,r){for(;e>t;e--){const c=r[e];if(!isNaN(c.x)&&!isNaN(c.y))break}return e}function HR(t,e,r,c){return t&&e?c(t[r],e[r]):t?t[r]:e?e[r]:0}function rH(t,e){let r=[],c=!1;return wp(t)?(c=!0,r=t):r=L1e(t,e),r.length?new s4({points:r,options:{tension:0},_loop:c,_fullLoop:c}):null}function VR(t){return t&&t.fill!==!1}function P1e(t,e,r){let S=t[e].fill;const $=[e];let Z;if(!r)return S;for(;S!==!1&&$.indexOf(S)===-1;){if(!H0(S))return S;if(Z=t[S],!Z)return!1;if(Z.visible)return S;$.push(S),S=Z.fill}return!1}function I1e(t,e,r){const c=B1e(t);if(Nc(c))return isNaN(c.value)?!1:c;let S=parseFloat(c);return H0(S)&&Math.floor(S)===S?D1e(c[0],e,S,r):["origin","start","end","stack","shape"].indexOf(c)>=0&&c}function D1e(t,e,r,c){return(t==="-"||t==="+")&&(r=e+r),r===e||r<0||r>=c?!1:r}function z1e(t,e){let r=null;return t==="start"?r=e.bottom:t==="end"?r=e.top:Nc(t)?r=e.getPixelForValue(t.value):e.getBasePixel&&(r=e.getBasePixel()),r}function O1e(t,e,r){let c;return t==="start"?c=r:t==="end"?c=e.options.reverse?e.min:e.max:Nc(t)?c=t.value:c=e.getBaseValue(),c}function B1e(t){const e=t.options,r=e.fill;let c=_c(r&&r.target,r);return c===void 0&&(c=!!e.backgroundColor),c===!1||c===null?!1:c===!0?"origin":c}function R1e(t){const{scale:e,index:r,line:c}=t,S=[],$=c.segments,Z=c.points,ue=F1e(e,r);ue.push(rH({x:null,y:e.bottom},c));for(let xe=0;xe<$.length;xe++){const Se=$[xe];for(let Ne=Se.start;Ne<=Se.end;Ne++)N1e(S,Z[Ne],ue)}return new s4({points:S,options:{}})}function F1e(t,e){const r=[],c=t.getMatchingVisibleMetas("line");for(let S=0;S=0;--Z){const ue=S[Z].$filler;ue&&(ue.line.updateControlPoints($,ue.axis),c&&ue.fill&&H7(t.ctx,ue,$))}},beforeDatasetsDraw(t,e,r){if(r.drawTime!=="beforeDatasetsDraw")return;const c=t.getSortedVisibleDatasetMetas();for(let S=c.length-1;S>=0;--S){const $=c[S].$filler;VR($)&&H7(t.ctx,$,t.chartArea)}},beforeDatasetDraw(t,e,r){const c=e.meta.$filler;!VR(c)||r.drawTime!=="beforeDatasetDraw"||H7(t.ctx,c,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ZR=(t,e)=>{let{boxHeight:r=e,boxWidth:c=e}=t;return t.usePointStyle&&(r=Math.min(r,e),c=t.pointStyleWidth||Math.min(c,e)),{boxWidth:c,boxHeight:r,itemHeight:Math.max(e,r)}},Z1e=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class KR extends W1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r,c){this.maxWidth=e,this.maxHeight=r,this._margins=c,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let r=Kf(e.generateLabels,[this.chart],this)||[];e.filter&&(r=r.filter(c=>e.filter(c,this.chart.data))),e.sort&&(r=r.sort((c,S)=>e.sort(c,S,this.chart.data))),this.options.reverse&&r.reverse(),this.legendItems=r}fit(){const{options:e,ctx:r}=this;if(!e.display){this.width=this.height=0;return}const c=e.labels,S=$0(c.font),$=S.size,Z=this._computeTitleHeight(),{boxWidth:ue,itemHeight:xe}=ZR(c,$);let Se,Ne;r.font=S.string,this.isHorizontal()?(Se=this.maxWidth,Ne=this._fitRows(Z,$,ue,xe)+10):(Ne=this.maxHeight,Se=this._fitCols(Z,S,ue,xe)+10),this.width=Math.min(Se,e.maxWidth||this.maxWidth),this.height=Math.min(Ne,e.maxHeight||this.maxHeight)}_fitRows(e,r,c,S){const{ctx:$,maxWidth:Z,options:{labels:{padding:ue}}}=this,xe=this.legendHitBoxes=[],Se=this.lineWidths=[0],Ne=S+ue;let it=e;$.textAlign="left",$.textBaseline="middle";let pt=-1,bt=-Ne;return this.legendItems.forEach((wt,Dt)=>{const Zt=c+r/2+$.measureText(wt.text).width;(Dt===0||Se[Se.length-1]+Zt+2*ue>Z)&&(it+=Ne,Se[Se.length-(Dt>0?0:1)]=0,bt+=Ne,pt++),xe[Dt]={left:0,top:bt,row:pt,width:Zt,height:S},Se[Se.length-1]+=Zt+ue}),it}_fitCols(e,r,c,S){const{ctx:$,maxHeight:Z,options:{labels:{padding:ue}}}=this,xe=this.legendHitBoxes=[],Se=this.columnSizes=[],Ne=Z-e;let it=ue,pt=0,bt=0,wt=0,Dt=0;return this.legendItems.forEach((Zt,Mr)=>{const{itemWidth:ze,itemHeight:ni}=K1e(c,r,$,Zt,S);Mr>0&&bt+ni+2*ue>Ne&&(it+=pt+ue,Se.push({width:pt,height:bt}),wt+=pt+ue,Dt++,pt=bt=0),xe[Mr]={left:wt,top:bt,col:Dt,width:ze,height:ni},pt=Math.max(pt,ze),bt+=ni+ue}),it+=pt,Se.push({width:pt,height:bt}),it}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:r,options:{align:c,labels:{padding:S},rtl:$}}=this,Z=D2($,this.left,this.width);if(this.isHorizontal()){let ue=0,xe=z0(c,this.left+S,this.right-this.lineWidths[ue]);for(const Se of r)ue!==Se.row&&(ue=Se.row,xe=z0(c,this.left+S,this.right-this.lineWidths[ue])),Se.top+=this.top+e+S,Se.left=Z.leftForLtr(Z.x(xe),Se.width),xe+=Se.width+S}else{let ue=0,xe=z0(c,this.top+e+S,this.bottom-this.columnSizes[ue].height);for(const Se of r)Se.col!==ue&&(ue=Se.col,xe=z0(c,this.top+e+S,this.bottom-this.columnSizes[ue].height)),Se.top=xe,Se.left+=this.left+S,Se.left=Z.leftForLtr(Z.x(Se.left),Se.width),xe+=Se.height+S}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;O8(e,this),this._draw(),B8(e)}}_draw(){const{options:e,columnSizes:r,lineWidths:c,ctx:S}=this,{align:$,labels:Z}=e,ue=sp.color,xe=D2(e.rtl,this.left,this.width),Se=$0(Z.font),{padding:Ne}=Z,it=Se.size,pt=it/2;let bt;this.drawTitle(),S.textAlign=xe.textAlign("left"),S.textBaseline="middle",S.lineWidth=.5,S.font=Se.string;const{boxWidth:wt,boxHeight:Dt,itemHeight:Zt}=ZR(Z,it),Mr=function(gi,Si,Ci){if(isNaN(wt)||wt<=0||isNaN(Dt)||Dt<0)return;S.save();const ri=_c(Ci.lineWidth,1);if(S.fillStyle=_c(Ci.fillStyle,ue),S.lineCap=_c(Ci.lineCap,"butt"),S.lineDashOffset=_c(Ci.lineDashOffset,0),S.lineJoin=_c(Ci.lineJoin,"miter"),S.lineWidth=ri,S.strokeStyle=_c(Ci.strokeStyle,ue),S.setLineDash(_c(Ci.lineDash,[])),Z.usePointStyle){const on={radius:Dt*Math.SQRT2/2,pointStyle:Ci.pointStyle,rotation:Ci.rotation,borderWidth:ri},yi=xe.xPlus(gi,wt/2),gr=Si+pt;b$(S,on,yi,gr,Z.pointStyleWidth&&wt)}else{const on=Si+Math.max((it-Dt)/2,0),yi=xe.leftForLtr(gi,wt),gr=I2(Ci.borderRadius);S.beginPath(),Object.values(gr).some(fr=>fr!==0)?qT(S,{x:yi,y:on,w:wt,h:Dt,radius:gr}):S.rect(yi,on,wt,Dt),S.fill(),ri!==0&&S.stroke()}S.restore()},ze=function(gi,Si,Ci){W5(S,Ci.text,gi,Si+Zt/2,Se,{strikethrough:Ci.hidden,textAlign:xe.textAlign(Ci.textAlign)})},ni=this.isHorizontal(),or=this._computeTitleHeight();ni?bt={x:z0($,this.left+Ne,this.right-c[0]),y:this.top+Ne+or,line:0}:bt={x:this.left+Ne,y:z0($,this.top+or+Ne,this.bottom-r[0].height),line:0},M$(this.ctx,e.textDirection);const Cr=Zt+Ne;this.legendItems.forEach((gi,Si)=>{S.strokeStyle=gi.fontColor,S.fillStyle=gi.fontColor;const Ci=S.measureText(gi.text).width,ri=xe.textAlign(gi.textAlign||(gi.textAlign=Z.textAlign)),on=wt+pt+Ci;let yi=bt.x,gr=bt.y;xe.setWidth(this.width),ni?Si>0&&yi+on+Ne>this.right&&(gr=bt.y+=Cr,bt.line++,yi=bt.x=z0($,this.left+Ne,this.right-c[bt.line])):Si>0&&gr+Cr>this.bottom&&(yi=bt.x=yi+r[bt.line].width+Ne,bt.line++,gr=bt.y=z0($,this.top+or+Ne,this.bottom-r[bt.line].height));const fr=xe.x(yi);if(Mr(fr,gr,gi),yi=Ame(ri,yi+wt+pt,ni?yi+on:this.right,e.rtl),ze(xe.x(yi),gr,gi),ni)bt.x+=on+Ne;else if(typeof gi.text!="string"){const Sr=Se.lineHeight;bt.y+=aH(gi,Sr)+Ne}else bt.y+=Cr}),E$(this.ctx,e.textDirection)}drawTitle(){const e=this.options,r=e.title,c=$0(r.font),S=kg(r.padding);if(!r.display)return;const $=D2(e.rtl,this.left,this.width),Z=this.ctx,ue=r.position,xe=c.size/2,Se=S.top+xe;let Ne,it=this.left,pt=this.width;if(this.isHorizontal())pt=Math.max(...this.lineWidths),Ne=this.top+Se,it=z0(e.align,it,this.right-pt);else{const wt=this.columnSizes.reduce((Dt,Zt)=>Math.max(Dt,Zt.height),0);Ne=Se+z0(e.align,this.top,this.bottom-wt-e.labels.padding-this._computeTitleHeight())}const bt=z0(ue,it,it+pt);Z.textAlign=$.textAlign(jE(ue)),Z.textBaseline="middle",Z.strokeStyle=r.color,Z.fillStyle=r.color,Z.font=c.string,W5(Z,r.text,bt,Ne,c)}_computeTitleHeight(){const e=this.options.title,r=$0(e.font),c=kg(e.padding);return e.display?r.lineHeight+c.height:0}_getLegendItemAt(e,r){let c,S,$;if(B1(e,this.left,this.right)&&B1(r,this.top,this.bottom)){for($=this.legendHitBoxes,c=0;c<$.length;++c)if(S=$[c],B1(e,S.left,S.left+S.width)&&B1(r,S.top,S.top+S.height))return this.legendItems[c]}return null}handleEvent(e){const r=this.options;if(!J1e(e.type,r))return;const c=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const S=this._hoveredItem,$=Z1e(S,c);S&&!$&&Kf(r.onLeave,[e,S,this],this),this._hoveredItem=c,c&&!$&&Kf(r.onHover,[e,c,this],this)}else c&&Kf(r.onClick,[e,c,this],this)}}function K1e(t,e,r,c,S){const $=Y1e(c,t,e,r),Z=X1e(S,c,e.lineHeight);return{itemWidth:$,itemHeight:Z}}function Y1e(t,e,r,c){let S=t.text;return S&&typeof S!="string"&&(S=S.reduce(($,Z)=>$.length>Z.length?$:Z)),e+r.size/2+c.measureText(S).width}function X1e(t,e,r){let c=t;return typeof e.text!="string"&&(c=aH(e,r)),c}function aH(t,e){const r=t.text?t.text.length:0;return e*r}function J1e(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var oH={id:"legend",_element:KR,start(t,e,r){const c=t.legend=new KR({ctx:t.ctx,options:r,chart:t});vg.configure(t,c,r),vg.addBox(t,c)},stop(t){vg.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,r){const c=t.legend;vg.configure(t,c,r),c.options=r},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,r){const c=e.datasetIndex,S=r.chart;S.isDatasetVisible(c)?(S.hide(c),e.hidden=!0):(S.show(c),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:r,pointStyle:c,textAlign:S,color:$,useBorderRadius:Z,borderRadius:ue}}=t.legend.options;return t._getSortedDatasetMetas().map(xe=>{const Se=xe.controller.getStyle(r?0:void 0),Ne=kg(Se.borderWidth);return{text:e[xe.index].label,fillStyle:Se.backgroundColor,fontColor:$,hidden:!xe.visible,lineCap:Se.borderCapStyle,lineDash:Se.borderDash,lineDashOffset:Se.borderDashOffset,lineJoin:Se.borderJoinStyle,lineWidth:(Ne.width+Ne.height)/4,strokeStyle:Se.borderColor,pointStyle:c||Se.pointStyle,rotation:Se.rotation,textAlign:S||Se.textAlign,borderRadius:Z&&(ue||Se.borderRadius),datasetIndex:xe.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class sH extends W1{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,r){const c=this.options;if(this.left=0,this.top=0,!c.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=r;const S=wp(c.text)?c.text.length:1;this._padding=kg(c.padding);const $=S*$0(c.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=$:this.width=$}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:r,left:c,bottom:S,right:$,options:Z}=this,ue=Z.align;let xe=0,Se,Ne,it;return this.isHorizontal()?(Ne=z0(ue,c,$),it=r+e,Se=$-c):(Z.position==="left"?(Ne=c+e,it=z0(ue,S,r),xe=cf*-.5):(Ne=$-e,it=z0(ue,r,S),xe=cf*.5),Se=S-r),{titleX:Ne,titleY:it,maxWidth:Se,rotation:xe}}draw(){const e=this.ctx,r=this.options;if(!r.display)return;const c=$0(r.font),$=c.lineHeight/2+this._padding.top,{titleX:Z,titleY:ue,maxWidth:xe,rotation:Se}=this._drawArgs($);W5(e,r.text,0,0,c,{color:r.color,maxWidth:xe,rotation:Se,textAlign:jE(r.align),textBaseline:"middle",translation:[Z,ue]})}}function Q1e(t,e){const r=new sH({ctx:t.ctx,options:e,chart:t});vg.configure(t,r,e),vg.addBox(t,r),t.titleBlock=r}var lH={id:"title",_element:sH,start(t,e,r){Q1e(t,r)},stop(t){const e=t.titleBlock;vg.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,r){const c=t.titleBlock;vg.configure(t,c,r),c.options=r},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const a5={average(t){if(!t.length)return!1;let e,r,c=new Set,S=0,$=0;for(e=0,r=t.length;eue+xe)/c.size,y:S/$}},nearest(t,e){if(!t.length)return!1;let r=e.x,c=e.y,S=Number.POSITIVE_INFINITY,$,Z,ue;for($=0,Z=t.length;$-1?t.split(` -`):t}function J1e(t,e){const{element:r,datasetIndex:c,index:S}=e,H=t.getDatasetMeta(c).controller,{label:Z,value:ue}=H.getLabelAndValue(S);return{chart:t,label:Z,parsed:H.getParsed(S),raw:t.data.datasets[c].data[S],formattedValue:ue,dataset:H.getDataset(),dataIndex:S,datasetIndex:c,element:r}}function ZR(t,e){const r=t.chart.ctx,{body:c,footer:S,title:H}=t,{boxWidth:Z,boxHeight:ue}=e,be=$0(e.bodyFont),Se=$0(e.titleFont),Re=$0(e.footerFont),Xe=H.length,vt=S.length,bt=c.length,kt=wg(e.padding);let Dt=kt.height,rr=0,Er=c.reduce((ur,Ir)=>ur+Ir.before.length+Ir.lines.length+Ir.after.length,0);if(Er+=t.beforeBody.length+t.afterBody.length,Xe&&(Dt+=Xe*Se.lineHeight+(Xe-1)*e.titleSpacing+e.titleMarginBottom),Er){const ur=e.displayColors?Math.max(ue,be.lineHeight):be.lineHeight;Dt+=bt*ur+(Er-bt)*be.lineHeight+(Er-1)*e.bodySpacing}vt&&(Dt+=e.footerMarginTop+vt*Re.lineHeight+(vt-1)*e.footerSpacing);let Fe=0;const wi=function(ur){rr=Math.max(rr,r.measureText(ur).width+Fe)};return r.save(),r.font=Se.string,uf(t.title,wi),r.font=be.string,uf(t.beforeBody.concat(t.afterBody),wi),Fe=e.displayColors?Z+2+e.boxPadding:0,uf(c,ur=>{uf(ur.before,wi),uf(ur.lines,wi),uf(ur.after,wi)}),Fe=0,r.font=Re.string,uf(t.footer,wi),r.restore(),rr+=kt.width,{width:rr,height:Dt}}function Q1e(t,e){const{y:r,height:c}=e;return rt.height-c/2?"bottom":"center"}function eye(t,e,r,c){const{x:S,width:H}=c,Z=r.caretSize+r.caretPadding;if(t==="left"&&S+H+Z>e.width||t==="right"&&S-H-Z<0)return!0}function tye(t,e,r,c){const{x:S,width:H}=r,{width:Z,chartArea:{left:ue,right:be}}=t;let Se="center";return c==="center"?Se=S<=(ue+be)/2?"left":"right":S<=H/2?Se="left":S>=Z-H/2&&(Se="right"),eye(Se,t,e,r)&&(Se="center"),Se}function KR(t,e,r){const c=r.yAlign||e.yAlign||Q1e(t,r);return{xAlign:r.xAlign||e.xAlign||tye(t,e,r,c),yAlign:c}}function rye(t,e){let{x:r,width:c}=t;return e==="right"?r-=c:e==="center"&&(r-=c/2),r}function iye(t,e,r){let{y:c,height:S}=t;return e==="top"?c+=r:e==="bottom"?c-=S+r:c-=S/2,c}function YR(t,e,r,c){const{caretSize:S,caretPadding:H,cornerRadius:Z}=t,{xAlign:ue,yAlign:be}=r,Se=S+H,{topLeft:Re,topRight:Xe,bottomLeft:vt,bottomRight:bt}=P2(Z);let kt=rye(e,ue);const Dt=iye(e,be,Se);return be==="center"?ue==="left"?kt+=Se:ue==="right"&&(kt-=Se):ue==="left"?kt-=Math.max(Re,vt)+S:ue==="right"&&(kt+=Math.max(Xe,bt)+S),{x:U0(kt,0,c.width-e.width),y:U0(Dt,0,c.height-e.height)}}function qk(t,e,r){const c=wg(r.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-c.right:t.x+c.left}function XR(t){return _v([],T1(t))}function nye(t,e,r){return Vx(t,{tooltip:e,tooltipItems:r,type:"tooltip"})}function JR(t,e){const r=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return r?t.override(r):t}const oH={beforeTitle:v1,title(t){if(t.length>0){const e=t[0],r=e.chart.data.labels,c=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(c>0&&e.dataIndex"u"?oH[e].call(r,c):S}class QR extends H1{static positioners=i5;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const r=this.chart,c=this.options.setContext(this.getContext()),S=c.enabled&&r.options.animation&&c.animations,H=new P$(this.chart,S);return S._cacheable&&(this._cachedAnimations=Object.freeze(H)),H}getContext(){return this.$context||(this.$context=nye(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,r){const{callbacks:c}=r,S=bm(c,"beforeTitle",this,e),H=bm(c,"title",this,e),Z=bm(c,"afterTitle",this,e);let ue=[];return ue=_v(ue,T1(S)),ue=_v(ue,T1(H)),ue=_v(ue,T1(Z)),ue}getBeforeBody(e,r){return XR(bm(r.callbacks,"beforeBody",this,e))}getBody(e,r){const{callbacks:c}=r,S=[];return uf(e,H=>{const Z={before:[],lines:[],after:[]},ue=JR(c,H);_v(Z.before,T1(bm(ue,"beforeLabel",this,H))),_v(Z.lines,bm(ue,"label",this,H)),_v(Z.after,T1(bm(ue,"afterLabel",this,H))),S.push(Z)}),S}getAfterBody(e,r){return XR(bm(r.callbacks,"afterBody",this,e))}getFooter(e,r){const{callbacks:c}=r,S=bm(c,"beforeFooter",this,e),H=bm(c,"footer",this,e),Z=bm(c,"afterFooter",this,e);let ue=[];return ue=_v(ue,T1(S)),ue=_v(ue,T1(H)),ue=_v(ue,T1(Z)),ue}_createItems(e){const r=this._active,c=this.chart.data,S=[],H=[],Z=[];let ue=[],be,Se;for(be=0,Se=r.length;bee.filter(Re,Xe,vt,c))),e.itemSort&&(ue=ue.sort((Re,Xe)=>e.itemSort(Re,Xe,c))),uf(ue,Re=>{const Xe=JR(e.callbacks,Re);S.push(bm(Xe,"labelColor",this,Re)),H.push(bm(Xe,"labelPointStyle",this,Re)),Z.push(bm(Xe,"labelTextColor",this,Re))}),this.labelColors=S,this.labelPointStyles=H,this.labelTextColors=Z,this.dataPoints=ue,ue}update(e,r){const c=this.options.setContext(this.getContext()),S=this._active;let H,Z=[];if(!S.length)this.opacity!==0&&(H={opacity:0});else{const ue=i5[c.position].call(this,S,this._eventPosition);Z=this._createItems(c),this.title=this.getTitle(Z,c),this.beforeBody=this.getBeforeBody(Z,c),this.body=this.getBody(Z,c),this.afterBody=this.getAfterBody(Z,c),this.footer=this.getFooter(Z,c);const be=this._size=ZR(this,c),Se=Object.assign({},ue,be),Re=KR(this.chart,c,Se),Xe=YR(c,Se,Re,this.chart);this.xAlign=Re.xAlign,this.yAlign=Re.yAlign,H={opacity:1,x:Xe.x,y:Xe.y,width:be.width,height:be.height,caretX:ue.x,caretY:ue.y}}this._tooltipItems=Z,this.$context=void 0,H&&this._resolveAnimations().update(this,H),e&&c.external&&c.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(e,r,c,S){const H=this.getCaretPosition(e,c,S);r.lineTo(H.x1,H.y1),r.lineTo(H.x2,H.y2),r.lineTo(H.x3,H.y3)}getCaretPosition(e,r,c){const{xAlign:S,yAlign:H}=this,{caretSize:Z,cornerRadius:ue}=c,{topLeft:be,topRight:Se,bottomLeft:Re,bottomRight:Xe}=P2(ue),{x:vt,y:bt}=e,{width:kt,height:Dt}=r;let rr,Er,Fe,wi,ur,Ir;return H==="center"?(ur=bt+Dt/2,S==="left"?(rr=vt,Er=rr-Z,wi=ur+Z,Ir=ur-Z):(rr=vt+kt,Er=rr+Z,wi=ur-Z,Ir=ur+Z),Fe=rr):(S==="left"?Er=vt+Math.max(be,Re)+Z:S==="right"?Er=vt+kt-Math.max(Se,Xe)-Z:Er=this.caretX,H==="top"?(wi=bt,ur=wi-Z,rr=Er-Z,Fe=Er+Z):(wi=bt+Dt,ur=wi+Z,rr=Er+Z,Fe=Er-Z),Ir=wi),{x1:rr,x2:Er,x3:Fe,y1:wi,y2:ur,y3:Ir}}drawTitle(e,r,c){const S=this.title,H=S.length;let Z,ue,be;if(H){const Se=I2(c.rtl,this.x,this.width);for(e.x=qk(this,c.titleAlign,c),r.textAlign=Se.textAlign(c.titleAlign),r.textBaseline="middle",Z=$0(c.titleFont),ue=c.titleSpacing,r.fillStyle=c.titleColor,r.font=Z.string,be=0;beFe!==0)?(e.beginPath(),e.fillStyle=H.multiKeyBackground,VT(e,{x:Dt,y:kt,w:Se,h:be,radius:Er}),e.fill(),e.stroke(),e.fillStyle=Z.backgroundColor,e.beginPath(),VT(e,{x:rr,y:kt+1,w:Se-2,h:be-2,radius:Er}),e.fill()):(e.fillStyle=H.multiKeyBackground,e.fillRect(Dt,kt,Se,be),e.strokeRect(Dt,kt,Se,be),e.fillStyle=Z.backgroundColor,e.fillRect(rr,kt+1,Se-2,be-2))}e.fillStyle=this.labelTextColors[c]}drawBody(e,r,c){const{body:S}=this,{bodySpacing:H,bodyAlign:Z,displayColors:ue,boxHeight:be,boxWidth:Se,boxPadding:Re}=c,Xe=$0(c.bodyFont);let vt=Xe.lineHeight,bt=0;const kt=I2(c.rtl,this.x,this.width),Dt=function(Ci){r.fillText(Ci,kt.x(e.x+bt),e.y+vt/2),e.y+=vt+H},rr=kt.textAlign(Z);let Er,Fe,wi,ur,Ir,Ti,_i;for(r.textAlign=Z,r.textBaseline="middle",r.font=Xe.string,e.x=qk(this,rr,c),r.fillStyle=c.bodyColor,uf(this.beforeBody,Dt),bt=ue&&rr!=="right"?Z==="center"?Se/2+Re:Se+2+Re:0,ur=0,Ti=S.length;ur0&&r.stroke()}_updateAnimationTarget(e){const r=this.chart,c=this.$animations,S=c&&c.x,H=c&&c.y;if(S||H){const Z=i5[e.position].call(this,this._active,this._eventPosition);if(!Z)return;const ue=this._size=ZR(this,e),be=Object.assign({},Z,this._size),Se=KR(r,e,be),Re=YR(e,be,Se,r);(S._to!==Re.x||H._to!==Re.y)&&(this.xAlign=Se.xAlign,this.yAlign=Se.yAlign,this.width=ue.width,this.height=ue.height,this.caretX=Z.x,this.caretY=Z.y,this._resolveAnimations().update(this,Re))}}_willRender(){return!!this.opacity}draw(e){const r=this.options.setContext(this.getContext());let c=this.opacity;if(!c)return;this._updateAnimationTarget(r);const S={width:this.width,height:this.height},H={x:this.x,y:this.y};c=Math.abs(c)<.001?0:c;const Z=wg(r.padding),ue=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&ue&&(e.save(),e.globalAlpha=c,this.drawBackground(H,e,S,r),S$(e,r.textDirection),H.y+=Z.top,this.drawTitle(H,e,r),this.drawBody(H,e,r),this.drawFooter(H,e,r),C$(e,r.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,r){const c=this._active,S=e.map(({datasetIndex:ue,index:be})=>{const Se=this.chart.getDatasetMeta(ue);if(!Se)throw new Error("Cannot find a dataset at index "+ue);return{datasetIndex:ue,element:Se.data[be],index:be}}),H=!UT(c,S),Z=this._positionChanged(S,r);(H||Z)&&(this._active=S,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,r,c=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const S=this.options,H=this._active||[],Z=this._getActiveElements(e,H,r,c),ue=this._positionChanged(Z,e),be=r||!UT(Z,H)||ue;return be&&(this._active=Z,(S.enabled||S.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,r))),be}_getActiveElements(e,r,c,S){const H=this.options;if(e.type==="mouseout")return[];if(!S)return r.filter(ue=>this.chart.data.datasets[ue.datasetIndex]&&this.chart.getDatasetMeta(ue.datasetIndex).controller.getParsed(ue.index)!==void 0);const Z=this.chart.getElementsAtEventForMode(e,H.mode,H,c);return H.reverse&&Z.reverse(),Z}_positionChanged(e,r){const{caretX:c,caretY:S,options:H}=this,Z=i5[H.position].call(this,e,r);return Z!==!1&&(c!==Z.x||S!==Z.y)}}var sH={id:"tooltip",_element:QR,positioners:i5,afterInit(t,e,r){r&&(t.tooltip=new QR({chart:t,options:r}))},beforeUpdate(t,e,r){t.tooltip&&t.tooltip.initialize(r)},reset(t,e,r){t.tooltip&&t.tooltip.initialize(r)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const r={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",r)}},afterEvent(t,e){if(t.tooltip){const r=e.replay;t.tooltip.handleEvent(e.event,r,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:oH},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aye=(t,e,r,c)=>(typeof e=="string"?(r=t.push(e)-1,c.unshift({index:r,label:e})):isNaN(e)&&(r=null),r);function oye(t,e,r,c){const S=t.indexOf(e);if(S===-1)return aye(t,e,r,c);const H=t.lastIndexOf(e);return S!==H?r:S}const sye=(t,e)=>t===null?null:U0(Math.round(t),0,e);function eF(t){const e=this.getLabels();return t>=0&&tr.length-1?null:this.getPixelForValue(r[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function lye(t,e){const r=[],{bounds:S,step:H,min:Z,max:ue,precision:be,count:Se,maxTicks:Re,maxDigits:Xe,includeBounds:vt}=t,bt=H||1,kt=Re-1,{min:Dt,max:rr}=e,Er=!Kh(Z),Fe=!Kh(ue),wi=!Kh(Se),ur=(rr-Dt)/(Xe+1);let Ir=YB((rr-Dt)/kt/bt)*bt,Ti,_i,Ci,ii;if(Ir<1e-14&&!Er&&!Fe)return[{value:Dt},{value:rr}];ii=Math.ceil(rr/Ir)-Math.floor(Dt/Ir),ii>kt&&(Ir=YB(ii*Ir/kt/bt)*bt),Kh(be)||(Ti=Math.pow(10,be),Ir=Math.ceil(Ir*Ti)/Ti),S==="ticks"?(_i=Math.floor(Dt/Ir)*Ir,Ci=Math.ceil(rr/Ir)*Ir):(_i=Dt,Ci=rr),Er&&Fe&&H&&gme((ue-Z)/H,Ir/1e3)?(ii=Math.round(Math.min((ue-Z)/Ir,Re)),Ir=(ue-Z)/ii,_i=Z,Ci=ue):wi?(_i=Er?Z:_i,Ci=Fe?ue:Ci,ii=Se-1,Ir=(Ci-_i)/ii):(ii=(Ci-_i)/Ir,x5(ii,Math.round(ii),Ir/1e3)?ii=Math.round(ii):ii=Math.ceil(ii));const Ji=Math.max(XB(Ir),XB(_i));Ti=Math.pow(10,Kh(be)?Ji:be),_i=Math.round(_i*Ti)/Ti,Ci=Math.round(Ci*Ti)/Ti;let vi=0;for(Er&&(vt&&_i!==Z?(r.push({value:Z}),_iue)break;r.push({value:vr})}return Fe&&vt&&Ci!==ue?r.length&&x5(r[r.length-1].value,ue,tF(ue,ur,t))?r[r.length-1].value=ue:r.push({value:ue}):(!Fe||Ci===ue)&&r.push({value:Ci}),r}function tF(t,e,{horizontal:r,minRotation:c}){const S=z1(c),H=(r?Math.sin(S):Math.cos(S))||.001,Z=.75*e*(""+t).length;return Math.min(e/H,Z)}class uye extends G2{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,r){return Kh(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:r,maxDefined:c}=this.getUserBounds();let{min:S,max:H}=this;const Z=be=>S=r?S:be,ue=be=>H=c?H:be;if(e){const be=Lv(S),Se=Lv(H);be<0&&Se<0?ue(0):be>0&&Se>0&&Z(0)}if(S===H){let be=H===0?1:Math.abs(H*.05);ue(H+be),e||Z(S-be)}this.min=S,this.max=H}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:r,stepSize:c}=e,S;return c?(S=Math.ceil(this.max/c)-Math.floor(this.min/c)+1,S>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${c} would result generating up to ${S} ticks. Limiting to 1000.`),S=1e3)):(S=this.computeTickLimit(),r=r||11),r&&(S=Math.min(r,S)),S}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,r=e.ticks;let c=this.getTickLimit();c=Math.max(2,c);const S={maxTicks:c,bounds:e.bounds,min:e.min,max:e.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},H=this._range||this,Z=lye(S,H);return e.bounds==="ticks"&&vme(Z,this,"value"),e.reverse?(Z.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),Z}configure(){const e=this.ticks;let r=this.min,c=this.max;if(super.configure(),this.options.offset&&e.length){const S=(c-r)/Math.max(e.length-1,1)/2;r-=S,c+=S}this._startValue=r,this._endValue=c,this._valueRange=c-r}getLabelForValue(e){return jE(e,this.chart.options.locale,this.options.ticks.format)}}class uH extends uye{static id="linear";static defaults={ticks:{callback:v$.formatters.numeric}};determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=H0(e)?e:0,this.max=H0(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),r=e?this.width:this.height,c=z1(this.options.ticks.minRotation),S=(e?Math.sin(c):Math.cos(c))||.001,H=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,H.lineHeight/S))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const NS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Tm=Object.keys(NS);function rF(t,e){return t-e}function iF(t,e){if(Kh(e))return null;const r=t._adapter,{parser:c,round:S,isoWeekday:H}=t._parseOpts;let Z=e;return typeof c=="function"&&(Z=c(Z)),H0(Z)||(Z=typeof c=="string"?r.parse(Z,c):r.parse(Z)),Z===null?null:(S&&(Z=S==="week"&&(j5(H)||H===!0)?r.startOf(Z,"isoWeek",H):r.startOf(Z,S)),+Z)}function nF(t,e,r,c){const S=Tm.length;for(let H=Tm.indexOf(t);H=Tm.indexOf(r);H--){const Z=Tm[H];if(NS[Z].common&&t._adapter.diff(S,c,Z)>=e-1)return Z}return Tm[r?Tm.indexOf(r):0]}function hye(t){for(let e=Tm.indexOf(t)+1,r=Tm.length;e=e?r[c]:r[S];t[H]=!0}}function fye(t,e,r,c){const S=t._adapter,H=+S.startOf(e[0].value,c),Z=e[e.length-1].value;let ue,be;for(ue=H;ue<=Z;ue=+S.add(ue,1,c))be=r[ue],be>=0&&(e[be].major=!0);return e}function oF(t,e,r){const c=[],S={},H=e.length;let Z,ue;for(Z=0;Z+e.value))}initOffsets(e=[]){let r=0,c=0,S,H;this.options.offset&&e.length&&(S=this.getDecimalForValue(e[0]),e.length===1?r=1-S:r=(this.getDecimalForValue(e[1])-S)/2,H=this.getDecimalForValue(e[e.length-1]),e.length===1?c=H:c=(H-this.getDecimalForValue(e[e.length-2]))/2);const Z=e.length<3?.5:.25;r=U0(r,0,Z),c=U0(c,0,Z),this._offsets={start:r,end:c,factor:1/(r+1+c)}}_generate(){const e=this._adapter,r=this.min,c=this.max,S=this.options,H=S.time,Z=H.unit||nF(H.minUnit,r,c,this._getLabelCapacity(r)),ue=_c(S.ticks.stepSize,1),be=Z==="week"?H.isoWeekday:!1,Se=j5(be)||be===!0,Re={};let Xe=r,vt,bt;if(Se&&(Xe=+e.startOf(Xe,"isoWeek",be)),Xe=+e.startOf(Xe,Se?"day":Z),e.diff(c,r,Z)>1e5*ue)throw new Error(r+" and "+c+" are too far apart with stepSize of "+ue+" "+Z);const kt=S.ticks.source==="data"&&this.getDataTimestamps();for(vt=Xe,bt=0;vt+Dt)}getLabelForValue(e){const r=this._adapter,c=this.options.time;return c.tooltipFormat?r.format(e,c.tooltipFormat):r.format(e,c.displayFormats.datetime)}format(e,r){const S=this.options.time.displayFormats,H=this._unit,Z=r||S[H];return this._adapter.format(e,Z)}_tickFormatFunction(e,r,c,S){const H=this.options,Z=H.ticks.callback;if(Z)return Zf(Z,[e,r,c],this);const ue=H.time.displayFormats,be=this._unit,Se=this._majorUnit,Re=be&&ue[be],Xe=Se&&ue[Se],vt=c[r],bt=Se&&Xe&&vt&&vt.major;return this._adapter.format(e,S||(bt?Xe:Re))}generateTickLabels(e){let r,c,S;for(r=0,c=e.length;r0?ue:1}getDataTimestamps(){let e=this._cache.data||[],r,c;if(e.length)return e;const S=this.getMatchingVisibleMetas();if(this._normalized&&S.length)return this._cache.data=S[0].controller.getAllParsedValues(this);for(r=0,c=S.length;r=t[c].pos&&e<=t[S].pos&&({lo:c,hi:S}=Tx(t,"pos",e)),{pos:H,time:ue}=t[c],{pos:Z,time:be}=t[S]):(e>=t[c].time&&e<=t[S].time&&({lo:c,hi:S}=Tx(t,"time",e)),{time:H,pos:ue}=t[c],{time:Z,pos:be}=t[S]);const Se=Z-H;return Se?ue+(be-ue)*(e-H)/Se:ue}class _Be extends ZT{static id="timeseries";static defaults=ZT.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(e);this._minPos=Gk(r,this.min),this._tableRange=Gk(r,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:r,max:c}=this,S=[],H=[];let Z,ue,be,Se,Re;for(Z=0,ue=e.length;Z=r&&Se<=c&&S.push(Se);if(S.length<2)return[{time:r,pos:0},{time:c,pos:1}];for(Z=0,ue=S.length;ZS-H)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const r=this.getDataTimestamps(),c=this.getLabelTimestamps();return r.length&&c.length?e=this.normalize(r.concat(c)):e=r.length?r:c,e=this._cache.all=e,e}getDecimalForValue(e){return(Gk(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const r=this._offsets,c=this.getDecimalForPixel(e)/r.factor-r.end;return Gk(this._table,c*this._tableRange+this._minPos,!0)}}const cH=6048e5,dye=864e5,o4=6e4,s4=36e5,pye=1e3,sF=Symbol.for("constructDateFrom");function $d(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&sF in t?t[sF](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ju(t,e){return $d(e||t,t)}function jS(t,e,r){const c=Ju(t,r?.in);return isNaN(e)?$d(r?.in||t,NaN):(e&&c.setDate(c.getDate()+e),c)}function ZE(t,e,r){const c=Ju(t,r?.in);if(isNaN(e))return $d(t,NaN);if(!e)return c;const S=c.getDate(),H=$d(t,c.getTime());H.setMonth(c.getMonth()+e+1,0);const Z=H.getDate();return S>=Z?H:(c.setFullYear(H.getFullYear(),H.getMonth(),S),c)}function KE(t,e,r){return $d(t,+Ju(t)+e)}function mye(t,e,r){return KE(t,e*s4)}let gye={};function Wx(){return gye}function zv(t,e){const r=Wx(),c=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,S=Ju(t,e?.in),H=S.getDay(),Z=(H=H.getTime()?c+1:r.getTime()>=ue.getTime()?c:c-1}function KT(t){const e=Ju(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function qx(t,...e){const r=$d.bind(null,e.find(c=>typeof c=="object"));return e.map(r)}function n9(t,e){const r=Ju(t,e?.in);return r.setHours(0,0,0,0),r}function fH(t,e,r){const[c,S]=qx(r?.in,t,e),H=n9(c),Z=n9(S),ue=+H-KT(H),be=+Z-KT(Z);return Math.round((ue-be)/dye)}function vye(t,e){const r=hH(t,e),c=$d(t,0);return c.setFullYear(r,0,4),c.setHours(0,0,0,0),$2(c)}function yye(t,e,r){const c=Ju(t,r?.in);return c.setTime(c.getTime()+e*o4),c}function _ye(t,e,r){return ZE(t,e*3,r)}function xye(t,e,r){return KE(t,e*1e3)}function bye(t,e,r){return jS(t,e*7,r)}function wye(t,e,r){return ZE(t,e*12,r)}function k5(t,e){const r=+Ju(t)-+Ju(e);return r<0?-1:r>0?1:r}function kye(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function dH(t){return!(!kye(t)&&typeof t!="number"||isNaN(+Ju(t)))}function Tye(t,e,r){const[c,S]=qx(r?.in,t,e),H=c.getFullYear()-S.getFullYear(),Z=c.getMonth()-S.getMonth();return H*12+Z}function Sye(t,e,r){const[c,S]=qx(r?.in,t,e);return c.getFullYear()-S.getFullYear()}function pH(t,e,r){const[c,S]=qx(r?.in,t,e),H=lF(c,S),Z=Math.abs(fH(c,S));c.setDate(c.getDate()-H*Z);const ue=+(lF(c,S)===-H),be=H*(Z-ue);return be===0?0:be}function lF(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function l4(t){return e=>{const c=(t?Math[t]:Math.trunc)(e);return c===0?0:c}}function Cye(t,e,r){const[c,S]=qx(r?.in,t,e),H=(+c-+S)/s4;return l4(r?.roundingMethod)(H)}function YE(t,e){return+Ju(t)-+Ju(e)}function Aye(t,e,r){const c=YE(t,e)/o4;return l4(r?.roundingMethod)(c)}function mH(t,e){const r=Ju(t,e?.in);return r.setHours(23,59,59,999),r}function gH(t,e){const r=Ju(t,e?.in),c=r.getMonth();return r.setFullYear(r.getFullYear(),c+1,0),r.setHours(23,59,59,999),r}function Mye(t,e){const r=Ju(t,e?.in);return+mH(r,e)==+gH(r,e)}function vH(t,e,r){const[c,S,H]=qx(r?.in,t,t,e),Z=k5(S,H),ue=Math.abs(Tye(S,H));if(ue<1)return 0;S.getMonth()===1&&S.getDate()>27&&S.setDate(30),S.setMonth(S.getMonth()-Z*ue);let be=k5(S,H)===-Z;Mye(c)&&ue===1&&k5(c,H)===1&&(be=!1);const Se=Z*(ue-+be);return Se===0?0:Se}function Eye(t,e,r){const c=vH(t,e,r)/3;return l4(r?.roundingMethod)(c)}function Lye(t,e,r){const c=YE(t,e)/1e3;return l4(r?.roundingMethod)(c)}function Pye(t,e,r){const c=pH(t,e,r)/7;return l4(r?.roundingMethod)(c)}function Iye(t,e,r){const[c,S]=qx(r?.in,t,e),H=k5(c,S),Z=Math.abs(Sye(c,S));c.setFullYear(1584),S.setFullYear(1584);const ue=k5(c,S)===-H,be=H*(Z-+ue);return be===0?0:be}function Dye(t,e){const r=Ju(t,e?.in),c=r.getMonth(),S=c-c%3;return r.setMonth(S,1),r.setHours(0,0,0,0),r}function zye(t,e){const r=Ju(t,e?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Oye(t,e){const r=Ju(t,e?.in),c=r.getFullYear();return r.setFullYear(c+1,0,0),r.setHours(23,59,59,999),r}function yH(t,e){const r=Ju(t,e?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Bye(t,e){const r=Ju(t,e?.in);return r.setMinutes(59,59,999),r}function Rye(t,e){const r=Wx(),c=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,S=Ju(t,e?.in),H=S.getDay(),Z=(H{let c;const S=Uye[t];return typeof S=="string"?c=S:e===1?c=S.one:c=S.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+c:c+" ago":c};function H7(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const Hye={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vye={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Wye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},qye={date:H7({formats:Hye,defaultWidth:"full"}),time:H7({formats:Vye,defaultWidth:"full"}),dateTime:H7({formats:Wye,defaultWidth:"full"})},Gye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zye=(t,e,r,c)=>Gye[t];function N3(t){return(e,r)=>{const c=r?.context?String(r.context):"standalone";let S;if(c==="formatting"&&t.formattingValues){const Z=t.defaultFormattingWidth||t.defaultWidth,ue=r?.width?String(r.width):Z;S=t.formattingValues[ue]||t.formattingValues[Z]}else{const Z=t.defaultWidth,ue=r?.width?String(r.width):t.defaultWidth;S=t.values[ue]||t.values[Z]}const H=t.argumentCallback?t.argumentCallback(e):e;return S[H]}}const Kye={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yye={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xye={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Jye={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qye={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},e_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},t_e=(t,e)=>{const r=Number(t),c=r%100;if(c>20||c<10)switch(c%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},r_e={ordinalNumber:t_e,era:N3({values:Kye,defaultWidth:"wide"}),quarter:N3({values:Yye,defaultWidth:"wide",argumentCallback:t=>t-1}),month:N3({values:Xye,defaultWidth:"wide"}),day:N3({values:Jye,defaultWidth:"wide"}),dayPeriod:N3({values:Qye,defaultWidth:"wide",formattingValues:e_e,defaultFormattingWidth:"wide"})};function j3(t){return(e,r={})=>{const c=r.width,S=c&&t.matchPatterns[c]||t.matchPatterns[t.defaultMatchWidth],H=e.match(S);if(!H)return null;const Z=H[0],ue=c&&t.parsePatterns[c]||t.parsePatterns[t.defaultParseWidth],be=Array.isArray(ue)?n_e(ue,Xe=>Xe.test(Z)):i_e(ue,Xe=>Xe.test(Z));let Se;Se=t.valueCallback?t.valueCallback(be):be,Se=r.valueCallback?r.valueCallback(Se):Se;const Re=e.slice(Z.length);return{value:Se,rest:Re}}}function i_e(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function n_e(t,e){for(let r=0;r{const c=e.match(t.matchPattern);if(!c)return null;const S=c[0],H=e.match(t.parsePattern);if(!H)return null;let Z=t.valueCallback?t.valueCallback(H[0]):H[0];Z=r.valueCallback?r.valueCallback(Z):Z;const ue=e.slice(S.length);return{value:Z,rest:ue}}}const o_e=/^(\d+)(th|st|nd|rd)?/i,s_e=/\d+/i,l_e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},u_e={any:[/^b/i,/^(a|c)/i]},c_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},h_e={any:[/1/i,/2/i,/3/i,/4/i]},f_e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},d_e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},p_e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},m_e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},g_e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},v_e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},y_e={ordinalNumber:a_e({matchPattern:o_e,parsePattern:s_e,valueCallback:t=>parseInt(t,10)}),era:j3({matchPatterns:l_e,defaultMatchWidth:"wide",parsePatterns:u_e,defaultParseWidth:"any"}),quarter:j3({matchPatterns:c_e,defaultMatchWidth:"wide",parsePatterns:h_e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:j3({matchPatterns:f_e,defaultMatchWidth:"wide",parsePatterns:d_e,defaultParseWidth:"any"}),day:j3({matchPatterns:p_e,defaultMatchWidth:"wide",parsePatterns:m_e,defaultParseWidth:"any"}),dayPeriod:j3({matchPatterns:g_e,defaultMatchWidth:"any",parsePatterns:v_e,defaultParseWidth:"any"})},_H={code:"en-US",formatDistance:$ye,formatLong:qye,formatRelative:Zye,localize:r_e,match:y_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function __e(t,e){const r=Ju(t,e?.in);return fH(r,yH(r))+1}function xH(t,e){const r=Ju(t,e?.in),c=+$2(r)-+vye(r);return Math.round(c/cH)+1}function XE(t,e){const r=Ju(t,e?.in),c=r.getFullYear(),S=Wx(),H=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??S.firstWeekContainsDate??S.locale?.options?.firstWeekContainsDate??1,Z=$d(e?.in||t,0);Z.setFullYear(c+1,0,H),Z.setHours(0,0,0,0);const ue=zv(Z,e),be=$d(e?.in||t,0);be.setFullYear(c,0,H),be.setHours(0,0,0,0);const Se=zv(be,e);return+r>=+ue?c+1:+r>=+Se?c:c-1}function x_e(t,e){const r=Wx(),c=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,S=XE(t,e),H=$d(e?.in||t,0);return H.setFullYear(S,0,c),H.setHours(0,0,0,0),zv(H,e)}function bH(t,e){const r=Ju(t,e?.in),c=+zv(r,e)-+x_e(r,e);return Math.round(c/cH)+1}function lf(t,e){const r=t<0?"-":"",c=Math.abs(t).toString().padStart(e,"0");return r+c}const Ry={y(t,e){const r=t.getFullYear(),c=r>0?r:1-r;return lf(e==="yy"?c%100:c,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):lf(r+1,2)},d(t,e){return lf(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return lf(t.getHours()%12||12,e.length)},H(t,e){return lf(t.getHours(),e.length)},m(t,e){return lf(t.getMinutes(),e.length)},s(t,e){return lf(t.getSeconds(),e.length)},S(t,e){const r=e.length,c=t.getMilliseconds(),S=Math.trunc(c*Math.pow(10,r-3));return lf(S,e.length)}},m2={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},uF={G:function(t,e,r){const c=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(c,{width:"abbreviated"});case"GGGGG":return r.era(c,{width:"narrow"});case"GGGG":default:return r.era(c,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const c=t.getFullYear(),S=c>0?c:1-c;return r.ordinalNumber(S,{unit:"year"})}return Ry.y(t,e)},Y:function(t,e,r,c){const S=XE(t,c),H=S>0?S:1-S;if(e==="YY"){const Z=H%100;return lf(Z,2)}return e==="Yo"?r.ordinalNumber(H,{unit:"year"}):lf(H,e.length)},R:function(t,e){const r=hH(t);return lf(r,e.length)},u:function(t,e){const r=t.getFullYear();return lf(r,e.length)},Q:function(t,e,r){const c=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(c);case"QQ":return lf(c,2);case"Qo":return r.ordinalNumber(c,{unit:"quarter"});case"QQQ":return r.quarter(c,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(c,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(c,{width:"wide",context:"formatting"})}},q:function(t,e,r){const c=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(c);case"qq":return lf(c,2);case"qo":return r.ordinalNumber(c,{unit:"quarter"});case"qqq":return r.quarter(c,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(c,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(c,{width:"wide",context:"standalone"})}},M:function(t,e,r){const c=t.getMonth();switch(e){case"M":case"MM":return Ry.M(t,e);case"Mo":return r.ordinalNumber(c+1,{unit:"month"});case"MMM":return r.month(c,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(c,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(c,{width:"wide",context:"formatting"})}},L:function(t,e,r){const c=t.getMonth();switch(e){case"L":return String(c+1);case"LL":return lf(c+1,2);case"Lo":return r.ordinalNumber(c+1,{unit:"month"});case"LLL":return r.month(c,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(c,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(c,{width:"wide",context:"standalone"})}},w:function(t,e,r,c){const S=bH(t,c);return e==="wo"?r.ordinalNumber(S,{unit:"week"}):lf(S,e.length)},I:function(t,e,r){const c=xH(t);return e==="Io"?r.ordinalNumber(c,{unit:"week"}):lf(c,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):Ry.d(t,e)},D:function(t,e,r){const c=__e(t);return e==="Do"?r.ordinalNumber(c,{unit:"dayOfYear"}):lf(c,e.length)},E:function(t,e,r){const c=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(c,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(c,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(c,{width:"short",context:"formatting"});case"EEEE":default:return r.day(c,{width:"wide",context:"formatting"})}},e:function(t,e,r,c){const S=t.getDay(),H=(S-c.weekStartsOn+8)%7||7;switch(e){case"e":return String(H);case"ee":return lf(H,2);case"eo":return r.ordinalNumber(H,{unit:"day"});case"eee":return r.day(S,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(S,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(S,{width:"short",context:"formatting"});case"eeee":default:return r.day(S,{width:"wide",context:"formatting"})}},c:function(t,e,r,c){const S=t.getDay(),H=(S-c.weekStartsOn+8)%7||7;switch(e){case"c":return String(H);case"cc":return lf(H,e.length);case"co":return r.ordinalNumber(H,{unit:"day"});case"ccc":return r.day(S,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(S,{width:"narrow",context:"standalone"});case"cccccc":return r.day(S,{width:"short",context:"standalone"});case"cccc":default:return r.day(S,{width:"wide",context:"standalone"})}},i:function(t,e,r){const c=t.getDay(),S=c===0?7:c;switch(e){case"i":return String(S);case"ii":return lf(S,e.length);case"io":return r.ordinalNumber(S,{unit:"day"});case"iii":return r.day(c,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(c,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(c,{width:"short",context:"formatting"});case"iiii":default:return r.day(c,{width:"wide",context:"formatting"})}},a:function(t,e,r){const S=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},b:function(t,e,r){const c=t.getHours();let S;switch(c===12?S=m2.noon:c===0?S=m2.midnight:S=c/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},B:function(t,e,r){const c=t.getHours();let S;switch(c>=17?S=m2.evening:c>=12?S=m2.afternoon:c>=4?S=m2.morning:S=m2.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let c=t.getHours()%12;return c===0&&(c=12),r.ordinalNumber(c,{unit:"hour"})}return Ry.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):Ry.H(t,e)},K:function(t,e,r){const c=t.getHours()%12;return e==="Ko"?r.ordinalNumber(c,{unit:"hour"}):lf(c,e.length)},k:function(t,e,r){let c=t.getHours();return c===0&&(c=24),e==="ko"?r.ordinalNumber(c,{unit:"hour"}):lf(c,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ry.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):Ry.s(t,e)},S:function(t,e){return Ry.S(t,e)},X:function(t,e,r){const c=t.getTimezoneOffset();if(c===0)return"Z";switch(e){case"X":return hF(c);case"XXXX":case"XX":return gx(c);case"XXXXX":case"XXX":default:return gx(c,":")}},x:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"x":return hF(c);case"xxxx":case"xx":return gx(c);case"xxxxx":case"xxx":default:return gx(c,":")}},O:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+cF(c,":");case"OOOO":default:return"GMT"+gx(c,":")}},z:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+cF(c,":");case"zzzz":default:return"GMT"+gx(c,":")}},t:function(t,e,r){const c=Math.trunc(+t/1e3);return lf(c,e.length)},T:function(t,e,r){return lf(+t,e.length)}};function cF(t,e=""){const r=t>0?"-":"+",c=Math.abs(t),S=Math.trunc(c/60),H=c%60;return H===0?r+String(S):r+String(S)+e+lf(H,2)}function hF(t,e){return t%60===0?(t>0?"-":"+")+lf(Math.abs(t)/60,2):gx(t,e)}function gx(t,e=""){const r=t>0?"-":"+",c=Math.abs(t),S=lf(Math.trunc(c/60),2),H=lf(c%60,2);return r+S+e+H}const fF=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},wH=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},b_e=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],c=r[1],S=r[2];if(!S)return fF(t,e);let H;switch(c){case"P":H=e.dateTime({width:"short"});break;case"PP":H=e.dateTime({width:"medium"});break;case"PPP":H=e.dateTime({width:"long"});break;case"PPPP":default:H=e.dateTime({width:"full"});break}return H.replace("{{date}}",fF(c,e)).replace("{{time}}",wH(S,e))},a9={p:wH,P:b_e},w_e=/^D+$/,k_e=/^Y+$/,T_e=["D","DD","YY","YYYY"];function kH(t){return w_e.test(t)}function TH(t){return k_e.test(t)}function o9(t,e,r){const c=S_e(t,e,r);if(console.warn(c),T_e.includes(t))throw new RangeError(c)}function S_e(t,e,r){const c=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${c} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const C_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,M_e=/^'([^]*?)'?$/,E_e=/''/g,L_e=/[a-zA-Z]/;function P_e(t,e,r){const c=Wx(),S=r?.locale??c.locale??_H,H=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,Z=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,ue=Ju(t,r?.in);if(!dH(ue))throw new RangeError("Invalid time value");let be=e.match(A_e).map(Re=>{const Xe=Re[0];if(Xe==="p"||Xe==="P"){const vt=a9[Xe];return vt(Re,S.formatLong)}return Re}).join("").match(C_e).map(Re=>{if(Re==="''")return{isToken:!1,value:"'"};const Xe=Re[0];if(Xe==="'")return{isToken:!1,value:I_e(Re)};if(uF[Xe])return{isToken:!0,value:Re};if(Xe.match(L_e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Xe+"`");return{isToken:!1,value:Re}});S.localize.preprocessor&&(be=S.localize.preprocessor(ue,be));const Se={firstWeekContainsDate:H,weekStartsOn:Z,locale:S};return be.map(Re=>{if(!Re.isToken)return Re.value;const Xe=Re.value;(!r?.useAdditionalWeekYearTokens&&TH(Xe)||!r?.useAdditionalDayOfYearTokens&&kH(Xe))&&o9(Xe,e,String(t));const vt=uF[Xe[0]];return vt(ue,Xe,S.localize,Se)}).join("")}function I_e(t){const e=t.match(M_e);return e?e[1].replace(E_e,"'"):t}function D_e(){return Object.assign({},Wx())}function z_e(t,e){const r=Ju(t,e?.in).getDay();return r===0?7:r}function O_e(t,e){const r=B_e(e)?new e(0):$d(e,0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}function B_e(t){return typeof t=="function"&&t.prototype?.constructor===t}const R_e=10;class SH{subPriority=0;validate(e,r){return!0}}class F_e extends SH{constructor(e,r,c,S,H){super(),this.value=e,this.validateValue=r,this.setValue=c,this.priority=S,H&&(this.subPriority=H)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,c){return this.setValue(e,r,this.value,c)}}class N_e extends SH{priority=R_e;subPriority=-1;constructor(e,r){super(),this.context=e||(c=>$d(r,c))}set(e,r){return r.timestampIsSet?e:$d(e,O_e(e,this.context))}}class Rh{run(e,r,c,S){const H=this.parse(e,r,c,S);return H?{setter:new F_e(H.value,this.validate,this.set,this.priority,this.subPriority),rest:H.rest}:null}validate(e,r,c){return!0}}class j_e extends Rh{priority=140;parse(e,r,c){switch(r){case"G":case"GG":case"GGG":return c.era(e,{width:"abbreviated"})||c.era(e,{width:"narrow"});case"GGGGG":return c.era(e,{width:"narrow"});case"GGGG":default:return c.era(e,{width:"wide"})||c.era(e,{width:"abbreviated"})||c.era(e,{width:"narrow"})}}set(e,r,c){return r.era=c,e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const sp={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Sv={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function lp(t,e){return t&&{value:e(t.value),rest:t.rest}}function Td(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function Cv(t,e){const r=e.match(t);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const c=r[1]==="+"?1:-1,S=r[2]?parseInt(r[2],10):0,H=r[3]?parseInt(r[3],10):0,Z=r[5]?parseInt(r[5],10):0;return{value:c*(S*s4+H*o4+Z*pye),rest:e.slice(r[0].length)}}function CH(t){return Td(sp.anyDigitsSigned,t)}function Hd(t,e){switch(t){case 1:return Td(sp.singleDigit,e);case 2:return Td(sp.twoDigits,e);case 3:return Td(sp.threeDigits,e);case 4:return Td(sp.fourDigits,e);default:return Td(new RegExp("^\\d{1,"+t+"}"),e)}}function YT(t,e){switch(t){case 1:return Td(sp.singleDigitSigned,e);case 2:return Td(sp.twoDigitsSigned,e);case 3:return Td(sp.threeDigitsSigned,e);case 4:return Td(sp.fourDigitsSigned,e);default:return Td(new RegExp("^-?\\d{1,"+t+"}"),e)}}function JE(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function AH(t,e){const r=e>0,c=r?e:1-e;let S;if(c<=50)S=t||100;else{const H=c+50,Z=Math.trunc(H/100)*100,ue=t>=H%100;S=t+Z-(ue?100:0)}return r?S:1-S}function MH(t){return t%400===0||t%4===0&&t%100!==0}class U_e extends Rh{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,c){const S=H=>({year:H,isTwoDigitYear:r==="yy"});switch(r){case"y":return lp(Hd(4,e),S);case"yo":return lp(c.ordinalNumber(e,{unit:"year"}),S);default:return lp(Hd(r.length,e),S)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,c){const S=e.getFullYear();if(c.isTwoDigitYear){const Z=AH(c.year,S);return e.setFullYear(Z,0,1),e.setHours(0,0,0,0),e}const H=!("era"in r)||r.era===1?c.year:1-c.year;return e.setFullYear(H,0,1),e.setHours(0,0,0,0),e}}class $_e extends Rh{priority=130;parse(e,r,c){const S=H=>({year:H,isTwoDigitYear:r==="YY"});switch(r){case"Y":return lp(Hd(4,e),S);case"Yo":return lp(c.ordinalNumber(e,{unit:"year"}),S);default:return lp(Hd(r.length,e),S)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,c,S){const H=XE(e,S);if(c.isTwoDigitYear){const ue=AH(c.year,H);return e.setFullYear(ue,0,S.firstWeekContainsDate),e.setHours(0,0,0,0),zv(e,S)}const Z=!("era"in r)||r.era===1?c.year:1-c.year;return e.setFullYear(Z,0,S.firstWeekContainsDate),e.setHours(0,0,0,0),zv(e,S)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class H_e extends Rh{priority=130;parse(e,r){return YT(r==="R"?4:r.length,e)}set(e,r,c){const S=$d(e,0);return S.setFullYear(c,0,4),S.setHours(0,0,0,0),$2(S)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class V_e extends Rh{priority=130;parse(e,r){return YT(r==="u"?4:r.length,e)}set(e,r,c){return e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class W_e extends Rh{priority=120;parse(e,r,c){switch(r){case"Q":case"QQ":return Hd(r.length,e);case"Qo":return c.ordinalNumber(e,{unit:"quarter"});case"QQQ":return c.quarter(e,{width:"abbreviated",context:"formatting"})||c.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return c.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return c.quarter(e,{width:"wide",context:"formatting"})||c.quarter(e,{width:"abbreviated",context:"formatting"})||c.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,c){return e.setMonth((c-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class q_e extends Rh{priority=120;parse(e,r,c){switch(r){case"q":case"qq":return Hd(r.length,e);case"qo":return c.ordinalNumber(e,{unit:"quarter"});case"qqq":return c.quarter(e,{width:"abbreviated",context:"standalone"})||c.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return c.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return c.quarter(e,{width:"wide",context:"standalone"})||c.quarter(e,{width:"abbreviated",context:"standalone"})||c.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,c){return e.setMonth((c-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class G_e extends Rh{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,c){const S=H=>H-1;switch(r){case"M":return lp(Td(sp.month,e),S);case"MM":return lp(Hd(2,e),S);case"Mo":return lp(c.ordinalNumber(e,{unit:"month"}),S);case"MMM":return c.month(e,{width:"abbreviated",context:"formatting"})||c.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return c.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return c.month(e,{width:"wide",context:"formatting"})||c.month(e,{width:"abbreviated",context:"formatting"})||c.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.setMonth(c,1),e.setHours(0,0,0,0),e}}class Z_e extends Rh{priority=110;parse(e,r,c){const S=H=>H-1;switch(r){case"L":return lp(Td(sp.month,e),S);case"LL":return lp(Hd(2,e),S);case"Lo":return lp(c.ordinalNumber(e,{unit:"month"}),S);case"LLL":return c.month(e,{width:"abbreviated",context:"standalone"})||c.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return c.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return c.month(e,{width:"wide",context:"standalone"})||c.month(e,{width:"abbreviated",context:"standalone"})||c.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.setMonth(c,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function K_e(t,e,r){const c=Ju(t,r?.in),S=bH(c,r)-e;return c.setDate(c.getDate()-S*7),Ju(c,r?.in)}class Y_e extends Rh{priority=100;parse(e,r,c){switch(r){case"w":return Td(sp.week,e);case"wo":return c.ordinalNumber(e,{unit:"week"});default:return Hd(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,c,S){return zv(K_e(e,c,S),S)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function X_e(t,e,r){const c=Ju(t,r?.in),S=xH(c,r)-e;return c.setDate(c.getDate()-S*7),c}class J_e extends Rh{priority=100;parse(e,r,c){switch(r){case"I":return Td(sp.week,e);case"Io":return c.ordinalNumber(e,{unit:"week"});default:return Hd(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,c){return $2(X_e(e,c))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Q_e=[31,28,31,30,31,30,31,31,30,31,30,31],exe=[31,29,31,30,31,30,31,31,30,31,30,31];class txe extends Rh{priority=90;subPriority=1;parse(e,r,c){switch(r){case"d":return Td(sp.date,e);case"do":return c.ordinalNumber(e,{unit:"date"});default:return Hd(r.length,e)}}validate(e,r){const c=e.getFullYear(),S=MH(c),H=e.getMonth();return S?r>=1&&r<=exe[H]:r>=1&&r<=Q_e[H]}set(e,r,c){return e.setDate(c),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class rxe extends Rh{priority=90;subpriority=1;parse(e,r,c){switch(r){case"D":case"DD":return Td(sp.dayOfYear,e);case"Do":return c.ordinalNumber(e,{unit:"date"});default:return Hd(r.length,e)}}validate(e,r){const c=e.getFullYear();return MH(c)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,c){return e.setMonth(0,c),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function QE(t,e,r){const c=Wx(),S=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,H=Ju(t,r?.in),Z=H.getDay(),be=(e%7+7)%7,Se=7-S,Re=e<0||e>6?e-(Z+Se)%7:(be+Se)%7-(Z+Se)%7;return jS(H,Re,r)}class ixe extends Rh{priority=90;parse(e,r,c){switch(r){case"E":case"EE":case"EEE":return c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return c.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=QE(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class nxe extends Rh{priority=90;parse(e,r,c,S){const H=Z=>{const ue=Math.floor((Z-1)/7)*7;return(Z+S.weekStartsOn+6)%7+ue};switch(r){case"e":case"ee":return lp(Hd(r.length,e),H);case"eo":return lp(c.ordinalNumber(e,{unit:"day"}),H);case"eee":return c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"eeeee":return c.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=QE(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class axe extends Rh{priority=90;parse(e,r,c,S){const H=Z=>{const ue=Math.floor((Z-1)/7)*7;return(Z+S.weekStartsOn+6)%7+ue};switch(r){case"c":case"cc":return lp(Hd(r.length,e),H);case"co":return lp(c.ordinalNumber(e,{unit:"day"}),H);case"ccc":return c.day(e,{width:"abbreviated",context:"standalone"})||c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"});case"ccccc":return c.day(e,{width:"narrow",context:"standalone"});case"cccccc":return c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return c.day(e,{width:"wide",context:"standalone"})||c.day(e,{width:"abbreviated",context:"standalone"})||c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=QE(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function oxe(t,e,r){const c=Ju(t,r?.in),S=z_e(c,r),H=e-S;return jS(c,H,r)}class sxe extends Rh{priority=90;parse(e,r,c){const S=H=>H===0?7:H;switch(r){case"i":case"ii":return Hd(r.length,e);case"io":return c.ordinalNumber(e,{unit:"day"});case"iii":return lp(c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S);case"iiiii":return lp(c.day(e,{width:"narrow",context:"formatting"}),S);case"iiiiii":return lp(c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S);case"iiii":default:return lp(c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S)}}validate(e,r){return r>=1&&r<=7}set(e,r,c){return e=oxe(e,c),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class lxe extends Rh{priority=80;parse(e,r,c){switch(r){case"a":case"aa":case"aaa":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(JE(c),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class uxe extends Rh{priority=80;parse(e,r,c){switch(r){case"b":case"bb":case"bbb":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(JE(c),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class cxe extends Rh{priority=80;parse(e,r,c){switch(r){case"B":case"BB":case"BBB":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(JE(c),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class hxe extends Rh{priority=70;parse(e,r,c){switch(r){case"h":return Td(sp.hour12h,e);case"ho":return c.ordinalNumber(e,{unit:"hour"});default:return Hd(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,c){const S=e.getHours()>=12;return S&&c<12?e.setHours(c+12,0,0,0):!S&&c===12?e.setHours(0,0,0,0):e.setHours(c,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class fxe extends Rh{priority=70;parse(e,r,c){switch(r){case"H":return Td(sp.hour23h,e);case"Ho":return c.ordinalNumber(e,{unit:"hour"});default:return Hd(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,c){return e.setHours(c,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class dxe extends Rh{priority=70;parse(e,r,c){switch(r){case"K":return Td(sp.hour11h,e);case"Ko":return c.ordinalNumber(e,{unit:"hour"});default:return Hd(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.getHours()>=12&&c<12?e.setHours(c+12,0,0,0):e.setHours(c,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class pxe extends Rh{priority=70;parse(e,r,c){switch(r){case"k":return Td(sp.hour24h,e);case"ko":return c.ordinalNumber(e,{unit:"hour"});default:return Hd(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,c){const S=c<=24?c%24:c;return e.setHours(S,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class mxe extends Rh{priority=60;parse(e,r,c){switch(r){case"m":return Td(sp.minute,e);case"mo":return c.ordinalNumber(e,{unit:"minute"});default:return Hd(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,c){return e.setMinutes(c,0,0),e}incompatibleTokens=["t","T"]}class gxe extends Rh{priority=50;parse(e,r,c){switch(r){case"s":return Td(sp.second,e);case"so":return c.ordinalNumber(e,{unit:"second"});default:return Hd(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,c){return e.setSeconds(c,0),e}incompatibleTokens=["t","T"]}class vxe extends Rh{priority=30;parse(e,r){const c=S=>Math.trunc(S*Math.pow(10,-r.length+3));return lp(Hd(r.length,e),c)}set(e,r,c){return e.setMilliseconds(c),e}incompatibleTokens=["t","T"]}class yxe extends Rh{priority=10;parse(e,r){switch(r){case"X":return Cv(Sv.basicOptionalMinutes,e);case"XX":return Cv(Sv.basic,e);case"XXXX":return Cv(Sv.basicOptionalSeconds,e);case"XXXXX":return Cv(Sv.extendedOptionalSeconds,e);case"XXX":default:return Cv(Sv.extended,e)}}set(e,r,c){return r.timestampIsSet?e:$d(e,e.getTime()-KT(e)-c)}incompatibleTokens=["t","T","x"]}class _xe extends Rh{priority=10;parse(e,r){switch(r){case"x":return Cv(Sv.basicOptionalMinutes,e);case"xx":return Cv(Sv.basic,e);case"xxxx":return Cv(Sv.basicOptionalSeconds,e);case"xxxxx":return Cv(Sv.extendedOptionalSeconds,e);case"xxx":default:return Cv(Sv.extended,e)}}set(e,r,c){return r.timestampIsSet?e:$d(e,e.getTime()-KT(e)-c)}incompatibleTokens=["t","T","X"]}class xxe extends Rh{priority=40;parse(e){return CH(e)}set(e,r,c){return[$d(e,c*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class bxe extends Rh{priority=20;parse(e){return CH(e)}set(e,r,c){return[$d(e,c),{timestampIsSet:!0}]}incompatibleTokens="*"}const wxe={G:new j_e,y:new U_e,Y:new $_e,R:new H_e,u:new V_e,Q:new W_e,q:new q_e,M:new G_e,L:new Z_e,w:new Y_e,I:new J_e,d:new txe,D:new rxe,E:new ixe,e:new nxe,c:new axe,i:new sxe,a:new lxe,b:new uxe,B:new cxe,h:new hxe,H:new fxe,K:new dxe,k:new pxe,m:new mxe,s:new gxe,S:new vxe,X:new yxe,x:new _xe,t:new xxe,T:new bxe},kxe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Txe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sxe=/^'([^]*?)'?$/,Cxe=/''/g,Axe=/\S/,Mxe=/[a-zA-Z]/;function Exe(t,e,r,c){const S=()=>$d(c?.in||r,NaN),H=D_e(),Z=c?.locale??H.locale??_H,ue=c?.firstWeekContainsDate??c?.locale?.options?.firstWeekContainsDate??H.firstWeekContainsDate??H.locale?.options?.firstWeekContainsDate??1,be=c?.weekStartsOn??c?.locale?.options?.weekStartsOn??H.weekStartsOn??H.locale?.options?.weekStartsOn??0;if(!e)return t?S():Ju(r,c?.in);const Se={firstWeekContainsDate:ue,weekStartsOn:be,locale:Z},Re=[new N_e(c?.in,r)],Xe=e.match(Txe).map(rr=>{const Er=rr[0];if(Er in a9){const Fe=a9[Er];return Fe(rr,Z.formatLong)}return rr}).join("").match(kxe),vt=[];for(let rr of Xe){!c?.useAdditionalWeekYearTokens&&TH(rr)&&o9(rr,e,t),!c?.useAdditionalDayOfYearTokens&&kH(rr)&&o9(rr,e,t);const Er=rr[0],Fe=wxe[Er];if(Fe){const{incompatibleTokens:wi}=Fe;if(Array.isArray(wi)){const Ir=vt.find(Ti=>wi.includes(Ti.token)||Ti.token===Er);if(Ir)throw new RangeError(`The format string mustn't contain \`${Ir.fullToken}\` and \`${rr}\` at the same time`)}else if(Fe.incompatibleTokens==="*"&&vt.length>0)throw new RangeError(`The format string mustn't contain \`${rr}\` and any other token at the same time`);vt.push({token:Er,fullToken:rr});const ur=Fe.run(t,rr,Z.match,Se);if(!ur)return S();Re.push(ur.setter),t=ur.rest}else{if(Er.match(Mxe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Er+"`");if(rr==="''"?rr="'":Er==="'"&&(rr=Lxe(rr)),t.indexOf(rr)===0)t=t.slice(rr.length);else return S()}}if(t.length>0&&Axe.test(t))return S();const bt=Re.map(rr=>rr.priority).sort((rr,Er)=>Er-rr).filter((rr,Er,Fe)=>Fe.indexOf(rr)===Er).map(rr=>Re.filter(Er=>Er.priority===rr).sort((Er,Fe)=>Fe.subPriority-Er.subPriority)).map(rr=>rr[0]);let kt=Ju(r,c?.in);if(isNaN(+kt))return S();const Dt={};for(const rr of bt){if(!rr.validate(kt,Se))return S();const Er=rr.set(kt,Dt,Se);Array.isArray(Er)?(kt=Er[0],Object.assign(Dt,Er[1])):kt=Er}return kt}function Lxe(t){return t.match(Sxe)[1].replace(Cxe,"'")}function Pxe(t,e){const r=Ju(t,e?.in);return r.setMinutes(0,0,0),r}function Ixe(t,e){const r=Ju(t,e?.in);return r.setSeconds(0,0),r}function Dxe(t,e){const r=Ju(t,e?.in);return r.setMilliseconds(0),r}function zxe(t,e){const r=()=>$d(e?.in,NaN),c=e?.additionalDigits??2,S=Fxe(t);let H;if(S.date){const Se=Nxe(S.date,c);H=jxe(Se.restDateString,Se.year)}if(!H||isNaN(+H))return r();const Z=+H;let ue=0,be;if(S.time&&(ue=Uxe(S.time),isNaN(ue)))return r();if(S.timezone){if(be=$xe(S.timezone),isNaN(be))return r()}else{const Se=new Date(Z+ue),Re=Ju(0,e?.in);return Re.setFullYear(Se.getUTCFullYear(),Se.getUTCMonth(),Se.getUTCDate()),Re.setHours(Se.getUTCHours(),Se.getUTCMinutes(),Se.getUTCSeconds(),Se.getUTCMilliseconds()),Re}return Ju(Z+ue+be,e?.in)}const Zk={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Oxe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Bxe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rxe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fxe(t){const e={},r=t.split(Zk.dateTimeDelimiter);let c;if(r.length>2)return e;if(/:/.test(r[0])?c=r[0]:(e.date=r[0],c=r[1],Zk.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Zk.timeZoneDelimiter)[0],c=t.substr(e.date.length,t.length))),c){const S=Zk.timezone.exec(c);S?(e.time=c.replace(S[1],""),e.timezone=S[1]):e.time=c}return e}function Nxe(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),c=t.match(r);if(!c)return{year:NaN,restDateString:""};const S=c[1]?parseInt(c[1]):null,H=c[2]?parseInt(c[2]):null;return{year:H===null?S:H*100,restDateString:t.slice((c[1]||c[2]).length)}}function jxe(t,e){if(e===null)return new Date(NaN);const r=t.match(Oxe);if(!r)return new Date(NaN);const c=!!r[4],S=U3(r[1]),H=U3(r[2])-1,Z=U3(r[3]),ue=U3(r[4]),be=U3(r[5])-1;if(c)return Gxe(e,ue,be)?Hxe(e,ue,be):new Date(NaN);{const Se=new Date(0);return!Wxe(e,H,Z)||!qxe(e,S)?new Date(NaN):(Se.setUTCFullYear(e,H,Math.max(S,Z)),Se)}}function U3(t){return t?parseInt(t):1}function Uxe(t){const e=t.match(Bxe);if(!e)return NaN;const r=V7(e[1]),c=V7(e[2]),S=V7(e[3]);return Zxe(r,c,S)?r*s4+c*o4+S*1e3:NaN}function V7(t){return t&&parseFloat(t.replace(",","."))||0}function $xe(t){if(t==="Z")return 0;const e=t.match(Rxe);if(!e)return 0;const r=e[1]==="+"?-1:1,c=parseInt(e[2]),S=e[3]&&parseInt(e[3])||0;return Kxe(c,S)?r*(c*s4+S*o4):NaN}function Hxe(t,e,r){const c=new Date(0);c.setUTCFullYear(t,0,4);const S=c.getUTCDay()||7,H=(e-1)*7+r+1-S;return c.setUTCDate(c.getUTCDate()+H),c}const Vxe=[31,null,31,30,31,30,31,31,30,31,30,31];function EH(t){return t%400===0||t%4===0&&t%100!==0}function Wxe(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(Vxe[e]||(EH(t)?29:28))}function qxe(t,e){return e>=1&&e<=(EH(t)?366:365)}function Gxe(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function Zxe(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function Kxe(t,e){return e>=0&&e<=59}/*! +`):t}function eye(t,e){const{element:r,datasetIndex:c,index:S}=e,$=t.getDatasetMeta(c).controller,{label:Z,value:ue}=$.getLabelAndValue(S);return{chart:t,label:Z,parsed:$.getParsed(S),raw:t.data.datasets[c].data[S],formattedValue:ue,dataset:$.getDataset(),dataIndex:S,datasetIndex:c,element:r}}function YR(t,e){const r=t.chart.ctx,{body:c,footer:S,title:$}=t,{boxWidth:Z,boxHeight:ue}=e,xe=$0(e.bodyFont),Se=$0(e.titleFont),Ne=$0(e.footerFont),it=$.length,pt=S.length,bt=c.length,wt=kg(e.padding);let Dt=wt.height,Zt=0,Mr=c.reduce((or,Cr)=>or+Cr.before.length+Cr.lines.length+Cr.after.length,0);if(Mr+=t.beforeBody.length+t.afterBody.length,it&&(Dt+=it*Se.lineHeight+(it-1)*e.titleSpacing+e.titleMarginBottom),Mr){const or=e.displayColors?Math.max(ue,xe.lineHeight):xe.lineHeight;Dt+=bt*or+(Mr-bt)*xe.lineHeight+(Mr-1)*e.bodySpacing}pt&&(Dt+=e.footerMarginTop+pt*Ne.lineHeight+(pt-1)*e.footerSpacing);let ze=0;const ni=function(or){Zt=Math.max(Zt,r.measureText(or).width+ze)};return r.save(),r.font=Se.string,uf(t.title,ni),r.font=xe.string,uf(t.beforeBody.concat(t.afterBody),ni),ze=e.displayColors?Z+2+e.boxPadding:0,uf(c,or=>{uf(or.before,ni),uf(or.lines,ni),uf(or.after,ni)}),ze=0,r.font=Ne.string,uf(t.footer,ni),r.restore(),Zt+=wt.width,{width:Zt,height:Dt}}function tye(t,e){const{y:r,height:c}=e;return rt.height-c/2?"bottom":"center"}function rye(t,e,r,c){const{x:S,width:$}=c,Z=r.caretSize+r.caretPadding;if(t==="left"&&S+$+Z>e.width||t==="right"&&S-$-Z<0)return!0}function iye(t,e,r,c){const{x:S,width:$}=r,{width:Z,chartArea:{left:ue,right:xe}}=t;let Se="center";return c==="center"?Se=S<=(ue+xe)/2?"left":"right":S<=$/2?Se="left":S>=Z-$/2&&(Se="right"),rye(Se,t,e,r)&&(Se="center"),Se}function XR(t,e,r){const c=r.yAlign||e.yAlign||tye(t,r);return{xAlign:r.xAlign||e.xAlign||iye(t,e,r,c),yAlign:c}}function nye(t,e){let{x:r,width:c}=t;return e==="right"?r-=c:e==="center"&&(r-=c/2),r}function aye(t,e,r){let{y:c,height:S}=t;return e==="top"?c+=r:e==="bottom"?c-=S+r:c-=S/2,c}function JR(t,e,r,c){const{caretSize:S,caretPadding:$,cornerRadius:Z}=t,{xAlign:ue,yAlign:xe}=r,Se=S+$,{topLeft:Ne,topRight:it,bottomLeft:pt,bottomRight:bt}=I2(Z);let wt=nye(e,ue);const Dt=aye(e,xe,Se);return xe==="center"?ue==="left"?wt+=Se:ue==="right"&&(wt-=Se):ue==="left"?wt-=Math.max(Ne,pt)+S:ue==="right"&&(wt+=Math.max(it,bt)+S),{x:U0(wt,0,c.width-e.width),y:U0(Dt,0,c.height-e.height)}}function Zk(t,e,r){const c=kg(r.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-c.right:t.x+c.left}function QR(t){return _v([],k1(t))}function oye(t,e,r){return Wx(t,{tooltip:e,tooltipItems:r,type:"tooltip"})}function eF(t,e){const r=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return r?t.override(r):t}const uH={beforeTitle:g1,title(t){if(t.length>0){const e=t[0],r=e.chart.data.labels,c=r?r.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(c>0&&e.dataIndex"u"?uH[e].call(r,c):S}class tF extends W1{static positioners=a5;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const r=this.chart,c=this.options.setContext(this.getContext()),S=c.enabled&&r.options.animation&&c.animations,$=new z$(this.chart,S);return S._cacheable&&(this._cachedAnimations=Object.freeze($)),$}getContext(){return this.$context||(this.$context=oye(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,r){const{callbacks:c}=r,S=bm(c,"beforeTitle",this,e),$=bm(c,"title",this,e),Z=bm(c,"afterTitle",this,e);let ue=[];return ue=_v(ue,k1(S)),ue=_v(ue,k1($)),ue=_v(ue,k1(Z)),ue}getBeforeBody(e,r){return QR(bm(r.callbacks,"beforeBody",this,e))}getBody(e,r){const{callbacks:c}=r,S=[];return uf(e,$=>{const Z={before:[],lines:[],after:[]},ue=eF(c,$);_v(Z.before,k1(bm(ue,"beforeLabel",this,$))),_v(Z.lines,bm(ue,"label",this,$)),_v(Z.after,k1(bm(ue,"afterLabel",this,$))),S.push(Z)}),S}getAfterBody(e,r){return QR(bm(r.callbacks,"afterBody",this,e))}getFooter(e,r){const{callbacks:c}=r,S=bm(c,"beforeFooter",this,e),$=bm(c,"footer",this,e),Z=bm(c,"afterFooter",this,e);let ue=[];return ue=_v(ue,k1(S)),ue=_v(ue,k1($)),ue=_v(ue,k1(Z)),ue}_createItems(e){const r=this._active,c=this.chart.data,S=[],$=[],Z=[];let ue=[],xe,Se;for(xe=0,Se=r.length;xee.filter(Ne,it,pt,c))),e.itemSort&&(ue=ue.sort((Ne,it)=>e.itemSort(Ne,it,c))),uf(ue,Ne=>{const it=eF(e.callbacks,Ne);S.push(bm(it,"labelColor",this,Ne)),$.push(bm(it,"labelPointStyle",this,Ne)),Z.push(bm(it,"labelTextColor",this,Ne))}),this.labelColors=S,this.labelPointStyles=$,this.labelTextColors=Z,this.dataPoints=ue,ue}update(e,r){const c=this.options.setContext(this.getContext()),S=this._active;let $,Z=[];if(!S.length)this.opacity!==0&&($={opacity:0});else{const ue=a5[c.position].call(this,S,this._eventPosition);Z=this._createItems(c),this.title=this.getTitle(Z,c),this.beforeBody=this.getBeforeBody(Z,c),this.body=this.getBody(Z,c),this.afterBody=this.getAfterBody(Z,c),this.footer=this.getFooter(Z,c);const xe=this._size=YR(this,c),Se=Object.assign({},ue,xe),Ne=XR(this.chart,c,Se),it=JR(c,Se,Ne,this.chart);this.xAlign=Ne.xAlign,this.yAlign=Ne.yAlign,$={opacity:1,x:it.x,y:it.y,width:xe.width,height:xe.height,caretX:ue.x,caretY:ue.y}}this._tooltipItems=Z,this.$context=void 0,$&&this._resolveAnimations().update(this,$),e&&c.external&&c.external.call(this,{chart:this.chart,tooltip:this,replay:r})}drawCaret(e,r,c,S){const $=this.getCaretPosition(e,c,S);r.lineTo($.x1,$.y1),r.lineTo($.x2,$.y2),r.lineTo($.x3,$.y3)}getCaretPosition(e,r,c){const{xAlign:S,yAlign:$}=this,{caretSize:Z,cornerRadius:ue}=c,{topLeft:xe,topRight:Se,bottomLeft:Ne,bottomRight:it}=I2(ue),{x:pt,y:bt}=e,{width:wt,height:Dt}=r;let Zt,Mr,ze,ni,or,Cr;return $==="center"?(or=bt+Dt/2,S==="left"?(Zt=pt,Mr=Zt-Z,ni=or+Z,Cr=or-Z):(Zt=pt+wt,Mr=Zt+Z,ni=or-Z,Cr=or+Z),ze=Zt):(S==="left"?Mr=pt+Math.max(xe,Ne)+Z:S==="right"?Mr=pt+wt-Math.max(Se,it)-Z:Mr=this.caretX,$==="top"?(ni=bt,or=ni-Z,Zt=Mr-Z,ze=Mr+Z):(ni=bt+Dt,or=ni+Z,Zt=Mr+Z,ze=Mr-Z),Cr=ni),{x1:Zt,x2:Mr,x3:ze,y1:ni,y2:or,y3:Cr}}drawTitle(e,r,c){const S=this.title,$=S.length;let Z,ue,xe;if($){const Se=D2(c.rtl,this.x,this.width);for(e.x=Zk(this,c.titleAlign,c),r.textAlign=Se.textAlign(c.titleAlign),r.textBaseline="middle",Z=$0(c.titleFont),ue=c.titleSpacing,r.fillStyle=c.titleColor,r.font=Z.string,xe=0;xe<$;++xe)r.fillText(S[xe],Se.x(e.x),e.y+Z.lineHeight/2),e.y+=Z.lineHeight+ue,xe+1===$&&(e.y+=c.titleMarginBottom-ue)}}_drawColorBox(e,r,c,S,$){const Z=this.labelColors[c],ue=this.labelPointStyles[c],{boxHeight:xe,boxWidth:Se}=$,Ne=$0($.bodyFont),it=Zk(this,"left",$),pt=S.x(it),bt=xeze!==0)?(e.beginPath(),e.fillStyle=$.multiKeyBackground,qT(e,{x:Dt,y:wt,w:Se,h:xe,radius:Mr}),e.fill(),e.stroke(),e.fillStyle=Z.backgroundColor,e.beginPath(),qT(e,{x:Zt,y:wt+1,w:Se-2,h:xe-2,radius:Mr}),e.fill()):(e.fillStyle=$.multiKeyBackground,e.fillRect(Dt,wt,Se,xe),e.strokeRect(Dt,wt,Se,xe),e.fillStyle=Z.backgroundColor,e.fillRect(Zt,wt+1,Se-2,xe-2))}e.fillStyle=this.labelTextColors[c]}drawBody(e,r,c){const{body:S}=this,{bodySpacing:$,bodyAlign:Z,displayColors:ue,boxHeight:xe,boxWidth:Se,boxPadding:Ne}=c,it=$0(c.bodyFont);let pt=it.lineHeight,bt=0;const wt=D2(c.rtl,this.x,this.width),Dt=function(Ci){r.fillText(Ci,wt.x(e.x+bt),e.y+pt/2),e.y+=pt+$},Zt=wt.textAlign(Z);let Mr,ze,ni,or,Cr,gi,Si;for(r.textAlign=Z,r.textBaseline="middle",r.font=it.string,e.x=Zk(this,Zt,c),r.fillStyle=c.bodyColor,uf(this.beforeBody,Dt),bt=ue&&Zt!=="right"?Z==="center"?Se/2+Ne:Se+2+Ne:0,or=0,gi=S.length;or0&&r.stroke()}_updateAnimationTarget(e){const r=this.chart,c=this.$animations,S=c&&c.x,$=c&&c.y;if(S||$){const Z=a5[e.position].call(this,this._active,this._eventPosition);if(!Z)return;const ue=this._size=YR(this,e),xe=Object.assign({},Z,this._size),Se=XR(r,e,xe),Ne=JR(e,xe,Se,r);(S._to!==Ne.x||$._to!==Ne.y)&&(this.xAlign=Se.xAlign,this.yAlign=Se.yAlign,this.width=ue.width,this.height=ue.height,this.caretX=Z.x,this.caretY=Z.y,this._resolveAnimations().update(this,Ne))}}_willRender(){return!!this.opacity}draw(e){const r=this.options.setContext(this.getContext());let c=this.opacity;if(!c)return;this._updateAnimationTarget(r);const S={width:this.width,height:this.height},$={x:this.x,y:this.y};c=Math.abs(c)<.001?0:c;const Z=kg(r.padding),ue=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;r.enabled&&ue&&(e.save(),e.globalAlpha=c,this.drawBackground($,e,S,r),M$(e,r.textDirection),$.y+=Z.top,this.drawTitle($,e,r),this.drawBody($,e,r),this.drawFooter($,e,r),E$(e,r.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,r){const c=this._active,S=e.map(({datasetIndex:ue,index:xe})=>{const Se=this.chart.getDatasetMeta(ue);if(!Se)throw new Error("Cannot find a dataset at index "+ue);return{datasetIndex:ue,element:Se.data[xe],index:xe}}),$=!HT(c,S),Z=this._positionChanged(S,r);($||Z)&&(this._active=S,this._eventPosition=r,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,r,c=!0){if(r&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const S=this.options,$=this._active||[],Z=this._getActiveElements(e,$,r,c),ue=this._positionChanged(Z,e),xe=r||!HT(Z,$)||ue;return xe&&(this._active=Z,(S.enabled||S.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,r))),xe}_getActiveElements(e,r,c,S){const $=this.options;if(e.type==="mouseout")return[];if(!S)return r.filter(ue=>this.chart.data.datasets[ue.datasetIndex]&&this.chart.getDatasetMeta(ue.datasetIndex).controller.getParsed(ue.index)!==void 0);const Z=this.chart.getElementsAtEventForMode(e,$.mode,$,c);return $.reverse&&Z.reverse(),Z}_positionChanged(e,r){const{caretX:c,caretY:S,options:$}=this,Z=a5[$.position].call(this,e,r);return Z!==!1&&(c!==Z.x||S!==Z.y)}}var cH={id:"tooltip",_element:tF,positioners:a5,afterInit(t,e,r){r&&(t.tooltip=new tF({chart:t,options:r}))},beforeUpdate(t,e,r){t.tooltip&&t.tooltip.initialize(r)},reset(t,e,r){t.tooltip&&t.tooltip.initialize(r)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const r={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...r,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",r)}},afterEvent(t,e){if(t.tooltip){const r=e.replay;t.tooltip.handleEvent(e.event,r,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:uH},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const sye=(t,e,r,c)=>(typeof e=="string"?(r=t.push(e)-1,c.unshift({index:r,label:e})):isNaN(e)&&(r=null),r);function lye(t,e,r,c){const S=t.indexOf(e);if(S===-1)return sye(t,e,r,c);const $=t.lastIndexOf(e);return S!==$?r:S}const uye=(t,e)=>t===null?null:U0(Math.round(t),0,e);function rF(t){const e=this.getLabels();return t>=0&&tr.length-1?null:this.getPixelForValue(r[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function cye(t,e){const r=[],{bounds:S,step:$,min:Z,max:ue,precision:xe,count:Se,maxTicks:Ne,maxDigits:it,includeBounds:pt}=t,bt=$||1,wt=Ne-1,{min:Dt,max:Zt}=e,Mr=!Kh(Z),ze=!Kh(ue),ni=!Kh(Se),or=(Zt-Dt)/(it+1);let Cr=JB((Zt-Dt)/wt/bt)*bt,gi,Si,Ci,ri;if(Cr<1e-14&&!Mr&&!ze)return[{value:Dt},{value:Zt}];ri=Math.ceil(Zt/Cr)-Math.floor(Dt/Cr),ri>wt&&(Cr=JB(ri*Cr/wt/bt)*bt),Kh(xe)||(gi=Math.pow(10,xe),Cr=Math.ceil(Cr*gi)/gi),S==="ticks"?(Si=Math.floor(Dt/Cr)*Cr,Ci=Math.ceil(Zt/Cr)*Cr):(Si=Dt,Ci=Zt),Mr&&ze&&$&&yme((ue-Z)/$,Cr/1e3)?(ri=Math.round(Math.min((ue-Z)/Cr,Ne)),Cr=(ue-Z)/ri,Si=Z,Ci=ue):ni?(Si=Mr?Z:Si,Ci=ze?ue:Ci,ri=Se-1,Cr=(Ci-Si)/ri):(ri=(Ci-Si)/Cr,w5(ri,Math.round(ri),Cr/1e3)?ri=Math.round(ri):ri=Math.ceil(ri));const on=Math.max(QB(Cr),QB(Si));gi=Math.pow(10,Kh(xe)?on:xe),Si=Math.round(Si*gi)/gi,Ci=Math.round(Ci*gi)/gi;let yi=0;for(Mr&&(pt&&Si!==Z?(r.push({value:Z}),Siue)break;r.push({value:gr})}return ze&&pt&&Ci!==ue?r.length&&w5(r[r.length-1].value,ue,iF(ue,or,t))?r[r.length-1].value=ue:r.push({value:ue}):(!ze||Ci===ue)&&r.push({value:Ci}),r}function iF(t,e,{horizontal:r,minRotation:c}){const S=O1(c),$=(r?Math.sin(S):Math.cos(S))||.001,Z=.75*e*(""+t).length;return Math.min(e/$,Z)}class hye extends K2{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,r){return Kh(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:r,maxDefined:c}=this.getUserBounds();let{min:S,max:$}=this;const Z=xe=>S=r?S:xe,ue=xe=>$=c?$:xe;if(e){const xe=Lv(S),Se=Lv($);xe<0&&Se<0?ue(0):xe>0&&Se>0&&Z(0)}if(S===$){let xe=$===0?1:Math.abs($*.05);ue($+xe),e||Z(S-xe)}this.min=S,this.max=$}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:r,stepSize:c}=e,S;return c?(S=Math.ceil(this.max/c)-Math.floor(this.min/c)+1,S>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${c} would result generating up to ${S} ticks. Limiting to 1000.`),S=1e3)):(S=this.computeTickLimit(),r=r||11),r&&(S=Math.min(r,S)),S}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,r=e.ticks;let c=this.getTickLimit();c=Math.max(2,c);const S={maxTicks:c,bounds:e.bounds,min:e.min,max:e.max,precision:r.precision,step:r.stepSize,count:r.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:r.minRotation||0,includeBounds:r.includeBounds!==!1},$=this._range||this,Z=cye(S,$);return e.bounds==="ticks"&&_me(Z,this,"value"),e.reverse?(Z.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),Z}configure(){const e=this.ticks;let r=this.min,c=this.max;if(super.configure(),this.options.offset&&e.length){const S=(c-r)/Math.max(e.length-1,1)/2;r-=S,c+=S}this._startValue=r,this._endValue=c,this._valueRange=c-r}getLabelForValue(e){return $E(e,this.chart.options.locale,this.options.ticks.format)}}class fH extends hye{static id="linear";static defaults={ticks:{callback:x$.formatters.numeric}};determineDataLimits(){const{min:e,max:r}=this.getMinMax(!0);this.min=H0(e)?e:0,this.max=H0(r)?r:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),r=e?this.width:this.height,c=O1(this.options.ticks.minRotation),S=(e?Math.sin(c):Math.cos(c))||.001,$=this._resolveTickFontOptions(0);return Math.ceil(r/Math.min(40,$.lineHeight/S))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const U8={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Tm=Object.keys(U8);function nF(t,e){return t-e}function aF(t,e){if(Kh(e))return null;const r=t._adapter,{parser:c,round:S,isoWeekday:$}=t._parseOpts;let Z=e;return typeof c=="function"&&(Z=c(Z)),H0(Z)||(Z=typeof c=="string"?r.parse(Z,c):r.parse(Z)),Z===null?null:(S&&(Z=S==="week"&&($5($)||$===!0)?r.startOf(Z,"isoWeek",$):r.startOf(Z,S)),+Z)}function oF(t,e,r,c){const S=Tm.length;for(let $=Tm.indexOf(t);$=Tm.indexOf(r);$--){const Z=Tm[$];if(U8[Z].common&&t._adapter.diff(S,c,Z)>=e-1)return Z}return Tm[r?Tm.indexOf(r):0]}function dye(t){for(let e=Tm.indexOf(t)+1,r=Tm.length;e=e?r[c]:r[S];t[$]=!0}}function pye(t,e,r,c){const S=t._adapter,$=+S.startOf(e[0].value,c),Z=e[e.length-1].value;let ue,xe;for(ue=$;ue<=Z;ue=+S.add(ue,1,c))xe=r[ue],xe>=0&&(e[xe].major=!0);return e}function lF(t,e,r){const c=[],S={},$=e.length;let Z,ue;for(Z=0;Z<$;++Z)ue=e[Z],S[ue]=Z,c.push({value:ue,major:!1});return $===0||!r?c:pye(t,c,S,r)}class YT extends K2{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,r={}){const c=e.time||(e.time={}),S=this._adapter=new j$._date(e.adapters.date);S.init(r),b5(c.displayFormats,S.formats()),this._parseOpts={parser:c.parser,round:c.round,isoWeekday:c.isoWeekday},super.init(e),this._normalized=r.normalized}parse(e,r){return e===void 0?null:aF(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,r=this._adapter,c=e.time.unit||"day";let{min:S,max:$,minDefined:Z,maxDefined:ue}=this.getUserBounds();function xe(Se){!Z&&!isNaN(Se.min)&&(S=Math.min(S,Se.min)),!ue&&!isNaN(Se.max)&&($=Math.max($,Se.max))}(!Z||!ue)&&(xe(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&xe(this.getMinMax(!1))),S=H0(S)&&!isNaN(S)?S:+r.startOf(Date.now(),c),$=H0($)&&!isNaN($)?$:+r.endOf(Date.now(),c)+1,this.min=Math.min(S,$-1),this.max=Math.max(S+1,$)}_getLabelBounds(){const e=this.getLabelTimestamps();let r=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;return e.length&&(r=e[0],c=e[e.length-1]),{min:r,max:c}}buildTicks(){const e=this.options,r=e.time,c=e.ticks,S=c.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&S.length&&(this.min=this._userMin||S[0],this.max=this._userMax||S[S.length-1]);const $=this.min,Z=this.max,ue=Tme(S,$,Z);return this._unit=r.unit||(c.autoSkip?oF(r.minUnit,this.min,this.max,this._getLabelCapacity($)):fye(this,ue.length,r.minUnit,this.min,this.max)),this._majorUnit=!c.major.enabled||this._unit==="year"?void 0:dye(this._unit),this.initOffsets(S),e.reverse&&ue.reverse(),lF(this,ue,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let r=0,c=0,S,$;this.options.offset&&e.length&&(S=this.getDecimalForValue(e[0]),e.length===1?r=1-S:r=(this.getDecimalForValue(e[1])-S)/2,$=this.getDecimalForValue(e[e.length-1]),e.length===1?c=$:c=($-this.getDecimalForValue(e[e.length-2]))/2);const Z=e.length<3?.5:.25;r=U0(r,0,Z),c=U0(c,0,Z),this._offsets={start:r,end:c,factor:1/(r+1+c)}}_generate(){const e=this._adapter,r=this.min,c=this.max,S=this.options,$=S.time,Z=$.unit||oF($.minUnit,r,c,this._getLabelCapacity(r)),ue=_c(S.ticks.stepSize,1),xe=Z==="week"?$.isoWeekday:!1,Se=$5(xe)||xe===!0,Ne={};let it=r,pt,bt;if(Se&&(it=+e.startOf(it,"isoWeek",xe)),it=+e.startOf(it,Se?"day":Z),e.diff(c,r,Z)>1e5*ue)throw new Error(r+" and "+c+" are too far apart with stepSize of "+ue+" "+Z);const wt=S.ticks.source==="data"&&this.getDataTimestamps();for(pt=it,bt=0;pt+Dt)}getLabelForValue(e){const r=this._adapter,c=this.options.time;return c.tooltipFormat?r.format(e,c.tooltipFormat):r.format(e,c.displayFormats.datetime)}format(e,r){const S=this.options.time.displayFormats,$=this._unit,Z=r||S[$];return this._adapter.format(e,Z)}_tickFormatFunction(e,r,c,S){const $=this.options,Z=$.ticks.callback;if(Z)return Kf(Z,[e,r,c],this);const ue=$.time.displayFormats,xe=this._unit,Se=this._majorUnit,Ne=xe&&ue[xe],it=Se&&ue[Se],pt=c[r],bt=Se&&it&&pt&&pt.major;return this._adapter.format(e,S||(bt?it:Ne))}generateTickLabels(e){let r,c,S;for(r=0,c=e.length;r0?ue:1}getDataTimestamps(){let e=this._cache.data||[],r,c;if(e.length)return e;const S=this.getMatchingVisibleMetas();if(this._normalized&&S.length)return this._cache.data=S[0].controller.getAllParsedValues(this);for(r=0,c=S.length;r=t[c].pos&&e<=t[S].pos&&({lo:c,hi:S}=Ax(t,"pos",e)),{pos:$,time:ue}=t[c],{pos:Z,time:xe}=t[S]):(e>=t[c].time&&e<=t[S].time&&({lo:c,hi:S}=Ax(t,"time",e)),{time:$,pos:ue}=t[c],{time:Z,pos:xe}=t[S]);const Se=Z-$;return Se?ue+(xe-ue)*(e-$)/Se:ue}class GBe extends YT{static id="timeseries";static defaults=YT.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),r=this._table=this.buildLookupTable(e);this._minPos=Kk(r,this.min),this._tableRange=Kk(r,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:r,max:c}=this,S=[],$=[];let Z,ue,xe,Se,Ne;for(Z=0,ue=e.length;Z=r&&Se<=c&&S.push(Se);if(S.length<2)return[{time:r,pos:0},{time:c,pos:1}];for(Z=0,ue=S.length;ZS-$)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const r=this.getDataTimestamps(),c=this.getLabelTimestamps();return r.length&&c.length?e=this.normalize(r.concat(c)):e=r.length?r:c,e=this._cache.all=e,e}getDecimalForValue(e){return(Kk(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const r=this._offsets,c=this.getDecimalForPixel(e)/r.factor-r.end;return Kk(this._table,c*this._tableRange+this._minPos,!0)}}const dH=6048e5,mye=864e5,l4=6e4,u4=36e5,gye=1e3,uF=Symbol.for("constructDateFrom");function Hd(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&uF in t?t[uF](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ju(t,e){return Hd(e||t,t)}function $8(t,e,r){const c=Ju(t,r?.in);return isNaN(e)?Hd(r?.in||t,NaN):(e&&c.setDate(c.getDate()+e),c)}function YE(t,e,r){const c=Ju(t,r?.in);if(isNaN(e))return Hd(t,NaN);if(!e)return c;const S=c.getDate(),$=Hd(t,c.getTime());$.setMonth(c.getMonth()+e+1,0);const Z=$.getDate();return S>=Z?$:(c.setFullYear($.getFullYear(),$.getMonth(),S),c)}function XE(t,e,r){return Hd(t,+Ju(t)+e)}function vye(t,e,r){return XE(t,e*u4)}let yye={};function qx(){return yye}function Dv(t,e){const r=qx(),c=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,S=Ju(t,e?.in),$=S.getDay(),Z=($=$.getTime()?c+1:r.getTime()>=ue.getTime()?c:c-1}function XT(t){const e=Ju(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function Gx(t,...e){const r=Hd.bind(null,e.find(c=>typeof c=="object"));return e.map(r)}function o9(t,e){const r=Ju(t,e?.in);return r.setHours(0,0,0,0),r}function mH(t,e,r){const[c,S]=Gx(r?.in,t,e),$=o9(c),Z=o9(S),ue=+$-XT($),xe=+Z-XT(Z);return Math.round((ue-xe)/mye)}function _ye(t,e){const r=pH(t,e),c=Hd(t,0);return c.setFullYear(r,0,4),c.setHours(0,0,0,0),V2(c)}function xye(t,e,r){const c=Ju(t,r?.in);return c.setTime(c.getTime()+e*l4),c}function bye(t,e,r){return YE(t,e*3,r)}function wye(t,e,r){return XE(t,e*1e3)}function kye(t,e,r){return $8(t,e*7,r)}function Tye(t,e,r){return YE(t,e*12,r)}function S5(t,e){const r=+Ju(t)-+Ju(e);return r<0?-1:r>0?1:r}function Sye(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function gH(t){return!(!Sye(t)&&typeof t!="number"||isNaN(+Ju(t)))}function Cye(t,e,r){const[c,S]=Gx(r?.in,t,e),$=c.getFullYear()-S.getFullYear(),Z=c.getMonth()-S.getMonth();return $*12+Z}function Aye(t,e,r){const[c,S]=Gx(r?.in,t,e);return c.getFullYear()-S.getFullYear()}function vH(t,e,r){const[c,S]=Gx(r?.in,t,e),$=cF(c,S),Z=Math.abs(mH(c,S));c.setDate(c.getDate()-$*Z);const ue=+(cF(c,S)===-$),xe=$*(Z-ue);return xe===0?0:xe}function cF(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function c4(t){return e=>{const c=(t?Math[t]:Math.trunc)(e);return c===0?0:c}}function Mye(t,e,r){const[c,S]=Gx(r?.in,t,e),$=(+c-+S)/u4;return c4(r?.roundingMethod)($)}function JE(t,e){return+Ju(t)-+Ju(e)}function Eye(t,e,r){const c=JE(t,e)/l4;return c4(r?.roundingMethod)(c)}function yH(t,e){const r=Ju(t,e?.in);return r.setHours(23,59,59,999),r}function _H(t,e){const r=Ju(t,e?.in),c=r.getMonth();return r.setFullYear(r.getFullYear(),c+1,0),r.setHours(23,59,59,999),r}function Lye(t,e){const r=Ju(t,e?.in);return+yH(r,e)==+_H(r,e)}function xH(t,e,r){const[c,S,$]=Gx(r?.in,t,t,e),Z=S5(S,$),ue=Math.abs(Cye(S,$));if(ue<1)return 0;S.getMonth()===1&&S.getDate()>27&&S.setDate(30),S.setMonth(S.getMonth()-Z*ue);let xe=S5(S,$)===-Z;Lye(c)&&ue===1&&S5(c,$)===1&&(xe=!1);const Se=Z*(ue-+xe);return Se===0?0:Se}function Pye(t,e,r){const c=xH(t,e,r)/3;return c4(r?.roundingMethod)(c)}function Iye(t,e,r){const c=JE(t,e)/1e3;return c4(r?.roundingMethod)(c)}function Dye(t,e,r){const c=vH(t,e,r)/7;return c4(r?.roundingMethod)(c)}function zye(t,e,r){const[c,S]=Gx(r?.in,t,e),$=S5(c,S),Z=Math.abs(Aye(c,S));c.setFullYear(1584),S.setFullYear(1584);const ue=S5(c,S)===-$,xe=$*(Z-+ue);return xe===0?0:xe}function Oye(t,e){const r=Ju(t,e?.in),c=r.getMonth(),S=c-c%3;return r.setMonth(S,1),r.setHours(0,0,0,0),r}function Bye(t,e){const r=Ju(t,e?.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Rye(t,e){const r=Ju(t,e?.in),c=r.getFullYear();return r.setFullYear(c+1,0,0),r.setHours(23,59,59,999),r}function bH(t,e){const r=Ju(t,e?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function Fye(t,e){const r=Ju(t,e?.in);return r.setMinutes(59,59,999),r}function Nye(t,e){const r=qx(),c=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,S=Ju(t,e?.in),$=S.getDay(),Z=(${let c;const S=Hye[t];return typeof S=="string"?c=S:e===1?c=S.one:c=S.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+c:c+" ago":c};function W7(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const Wye={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qye={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Gye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Zye={date:W7({formats:Wye,defaultWidth:"full"}),time:W7({formats:qye,defaultWidth:"full"}),dateTime:W7({formats:Gye,defaultWidth:"full"})},Kye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yye=(t,e,r,c)=>Kye[t];function U3(t){return(e,r)=>{const c=r?.context?String(r.context):"standalone";let S;if(c==="formatting"&&t.formattingValues){const Z=t.defaultFormattingWidth||t.defaultWidth,ue=r?.width?String(r.width):Z;S=t.formattingValues[ue]||t.formattingValues[Z]}else{const Z=t.defaultWidth,ue=r?.width?String(r.width):t.defaultWidth;S=t.values[ue]||t.values[Z]}const $=t.argumentCallback?t.argumentCallback(e):e;return S[$]}}const Xye={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Jye={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Qye={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},e_e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},t_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},r_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},i_e=(t,e)=>{const r=Number(t),c=r%100;if(c>20||c<10)switch(c%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},n_e={ordinalNumber:i_e,era:U3({values:Xye,defaultWidth:"wide"}),quarter:U3({values:Jye,defaultWidth:"wide",argumentCallback:t=>t-1}),month:U3({values:Qye,defaultWidth:"wide"}),day:U3({values:e_e,defaultWidth:"wide"}),dayPeriod:U3({values:t_e,defaultWidth:"wide",formattingValues:r_e,defaultFormattingWidth:"wide"})};function $3(t){return(e,r={})=>{const c=r.width,S=c&&t.matchPatterns[c]||t.matchPatterns[t.defaultMatchWidth],$=e.match(S);if(!$)return null;const Z=$[0],ue=c&&t.parsePatterns[c]||t.parsePatterns[t.defaultParseWidth],xe=Array.isArray(ue)?o_e(ue,it=>it.test(Z)):a_e(ue,it=>it.test(Z));let Se;Se=t.valueCallback?t.valueCallback(xe):xe,Se=r.valueCallback?r.valueCallback(Se):Se;const Ne=e.slice(Z.length);return{value:Se,rest:Ne}}}function a_e(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function o_e(t,e){for(let r=0;r{const c=e.match(t.matchPattern);if(!c)return null;const S=c[0],$=e.match(t.parsePattern);if(!$)return null;let Z=t.valueCallback?t.valueCallback($[0]):$[0];Z=r.valueCallback?r.valueCallback(Z):Z;const ue=e.slice(S.length);return{value:Z,rest:ue}}}const l_e=/^(\d+)(th|st|nd|rd)?/i,u_e=/\d+/i,c_e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},h_e={any:[/^b/i,/^(a|c)/i]},f_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},d_e={any:[/1/i,/2/i,/3/i,/4/i]},p_e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},m_e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},g_e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},v_e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},y_e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},__e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},x_e={ordinalNumber:s_e({matchPattern:l_e,parsePattern:u_e,valueCallback:t=>parseInt(t,10)}),era:$3({matchPatterns:c_e,defaultMatchWidth:"wide",parsePatterns:h_e,defaultParseWidth:"any"}),quarter:$3({matchPatterns:f_e,defaultMatchWidth:"wide",parsePatterns:d_e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:$3({matchPatterns:p_e,defaultMatchWidth:"wide",parsePatterns:m_e,defaultParseWidth:"any"}),day:$3({matchPatterns:g_e,defaultMatchWidth:"wide",parsePatterns:v_e,defaultParseWidth:"any"}),dayPeriod:$3({matchPatterns:y_e,defaultMatchWidth:"any",parsePatterns:__e,defaultParseWidth:"any"})},wH={code:"en-US",formatDistance:Vye,formatLong:Zye,formatRelative:Yye,localize:n_e,match:x_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function b_e(t,e){const r=Ju(t,e?.in);return mH(r,bH(r))+1}function kH(t,e){const r=Ju(t,e?.in),c=+V2(r)-+_ye(r);return Math.round(c/dH)+1}function QE(t,e){const r=Ju(t,e?.in),c=r.getFullYear(),S=qx(),$=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??S.firstWeekContainsDate??S.locale?.options?.firstWeekContainsDate??1,Z=Hd(e?.in||t,0);Z.setFullYear(c+1,0,$),Z.setHours(0,0,0,0);const ue=Dv(Z,e),xe=Hd(e?.in||t,0);xe.setFullYear(c,0,$),xe.setHours(0,0,0,0);const Se=Dv(xe,e);return+r>=+ue?c+1:+r>=+Se?c:c-1}function w_e(t,e){const r=qx(),c=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,S=QE(t,e),$=Hd(e?.in||t,0);return $.setFullYear(S,0,c),$.setHours(0,0,0,0),Dv($,e)}function TH(t,e){const r=Ju(t,e?.in),c=+Dv(r,e)-+w_e(r,e);return Math.round(c/dH)+1}function lf(t,e){const r=t<0?"-":"",c=Math.abs(t).toString().padStart(e,"0");return r+c}const Ny={y(t,e){const r=t.getFullYear(),c=r>0?r:1-r;return lf(e==="yy"?c%100:c,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):lf(r+1,2)},d(t,e){return lf(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return lf(t.getHours()%12||12,e.length)},H(t,e){return lf(t.getHours(),e.length)},m(t,e){return lf(t.getMinutes(),e.length)},s(t,e){return lf(t.getSeconds(),e.length)},S(t,e){const r=e.length,c=t.getMilliseconds(),S=Math.trunc(c*Math.pow(10,r-3));return lf(S,e.length)}},g2={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},hF={G:function(t,e,r){const c=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(c,{width:"abbreviated"});case"GGGGG":return r.era(c,{width:"narrow"});case"GGGG":default:return r.era(c,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const c=t.getFullYear(),S=c>0?c:1-c;return r.ordinalNumber(S,{unit:"year"})}return Ny.y(t,e)},Y:function(t,e,r,c){const S=QE(t,c),$=S>0?S:1-S;if(e==="YY"){const Z=$%100;return lf(Z,2)}return e==="Yo"?r.ordinalNumber($,{unit:"year"}):lf($,e.length)},R:function(t,e){const r=pH(t);return lf(r,e.length)},u:function(t,e){const r=t.getFullYear();return lf(r,e.length)},Q:function(t,e,r){const c=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(c);case"QQ":return lf(c,2);case"Qo":return r.ordinalNumber(c,{unit:"quarter"});case"QQQ":return r.quarter(c,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(c,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(c,{width:"wide",context:"formatting"})}},q:function(t,e,r){const c=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(c);case"qq":return lf(c,2);case"qo":return r.ordinalNumber(c,{unit:"quarter"});case"qqq":return r.quarter(c,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(c,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(c,{width:"wide",context:"standalone"})}},M:function(t,e,r){const c=t.getMonth();switch(e){case"M":case"MM":return Ny.M(t,e);case"Mo":return r.ordinalNumber(c+1,{unit:"month"});case"MMM":return r.month(c,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(c,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(c,{width:"wide",context:"formatting"})}},L:function(t,e,r){const c=t.getMonth();switch(e){case"L":return String(c+1);case"LL":return lf(c+1,2);case"Lo":return r.ordinalNumber(c+1,{unit:"month"});case"LLL":return r.month(c,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(c,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(c,{width:"wide",context:"standalone"})}},w:function(t,e,r,c){const S=TH(t,c);return e==="wo"?r.ordinalNumber(S,{unit:"week"}):lf(S,e.length)},I:function(t,e,r){const c=kH(t);return e==="Io"?r.ordinalNumber(c,{unit:"week"}):lf(c,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):Ny.d(t,e)},D:function(t,e,r){const c=b_e(t);return e==="Do"?r.ordinalNumber(c,{unit:"dayOfYear"}):lf(c,e.length)},E:function(t,e,r){const c=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(c,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(c,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(c,{width:"short",context:"formatting"});case"EEEE":default:return r.day(c,{width:"wide",context:"formatting"})}},e:function(t,e,r,c){const S=t.getDay(),$=(S-c.weekStartsOn+8)%7||7;switch(e){case"e":return String($);case"ee":return lf($,2);case"eo":return r.ordinalNumber($,{unit:"day"});case"eee":return r.day(S,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(S,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(S,{width:"short",context:"formatting"});case"eeee":default:return r.day(S,{width:"wide",context:"formatting"})}},c:function(t,e,r,c){const S=t.getDay(),$=(S-c.weekStartsOn+8)%7||7;switch(e){case"c":return String($);case"cc":return lf($,e.length);case"co":return r.ordinalNumber($,{unit:"day"});case"ccc":return r.day(S,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(S,{width:"narrow",context:"standalone"});case"cccccc":return r.day(S,{width:"short",context:"standalone"});case"cccc":default:return r.day(S,{width:"wide",context:"standalone"})}},i:function(t,e,r){const c=t.getDay(),S=c===0?7:c;switch(e){case"i":return String(S);case"ii":return lf(S,e.length);case"io":return r.ordinalNumber(S,{unit:"day"});case"iii":return r.day(c,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(c,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(c,{width:"short",context:"formatting"});case"iiii":default:return r.day(c,{width:"wide",context:"formatting"})}},a:function(t,e,r){const S=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},b:function(t,e,r){const c=t.getHours();let S;switch(c===12?S=g2.noon:c===0?S=g2.midnight:S=c/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},B:function(t,e,r){const c=t.getHours();let S;switch(c>=17?S=g2.evening:c>=12?S=g2.afternoon:c>=4?S=g2.morning:S=g2.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(S,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(S,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(S,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let c=t.getHours()%12;return c===0&&(c=12),r.ordinalNumber(c,{unit:"hour"})}return Ny.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):Ny.H(t,e)},K:function(t,e,r){const c=t.getHours()%12;return e==="Ko"?r.ordinalNumber(c,{unit:"hour"}):lf(c,e.length)},k:function(t,e,r){let c=t.getHours();return c===0&&(c=24),e==="ko"?r.ordinalNumber(c,{unit:"hour"}):lf(c,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ny.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):Ny.s(t,e)},S:function(t,e){return Ny.S(t,e)},X:function(t,e,r){const c=t.getTimezoneOffset();if(c===0)return"Z";switch(e){case"X":return dF(c);case"XXXX":case"XX":return _x(c);case"XXXXX":case"XXX":default:return _x(c,":")}},x:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"x":return dF(c);case"xxxx":case"xx":return _x(c);case"xxxxx":case"xxx":default:return _x(c,":")}},O:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+fF(c,":");case"OOOO":default:return"GMT"+_x(c,":")}},z:function(t,e,r){const c=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+fF(c,":");case"zzzz":default:return"GMT"+_x(c,":")}},t:function(t,e,r){const c=Math.trunc(+t/1e3);return lf(c,e.length)},T:function(t,e,r){return lf(+t,e.length)}};function fF(t,e=""){const r=t>0?"-":"+",c=Math.abs(t),S=Math.trunc(c/60),$=c%60;return $===0?r+String(S):r+String(S)+e+lf($,2)}function dF(t,e){return t%60===0?(t>0?"-":"+")+lf(Math.abs(t)/60,2):_x(t,e)}function _x(t,e=""){const r=t>0?"-":"+",c=Math.abs(t),S=lf(Math.trunc(c/60),2),$=lf(c%60,2);return r+S+e+$}const pF=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},SH=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},k_e=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],c=r[1],S=r[2];if(!S)return pF(t,e);let $;switch(c){case"P":$=e.dateTime({width:"short"});break;case"PP":$=e.dateTime({width:"medium"});break;case"PPP":$=e.dateTime({width:"long"});break;case"PPPP":default:$=e.dateTime({width:"full"});break}return $.replace("{{date}}",pF(c,e)).replace("{{time}}",SH(S,e))},s9={p:SH,P:k_e},T_e=/^D+$/,S_e=/^Y+$/,C_e=["D","DD","YY","YYYY"];function CH(t){return T_e.test(t)}function AH(t){return S_e.test(t)}function l9(t,e,r){const c=A_e(t,e,r);if(console.warn(c),C_e.includes(t))throw new RangeError(c)}function A_e(t,e,r){const c=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${c} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const M_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,E_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L_e=/^'([^]*?)'?$/,P_e=/''/g,I_e=/[a-zA-Z]/;function D_e(t,e,r){const c=qx(),S=r?.locale??c.locale??wH,$=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??c.firstWeekContainsDate??c.locale?.options?.firstWeekContainsDate??1,Z=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,ue=Ju(t,r?.in);if(!gH(ue))throw new RangeError("Invalid time value");let xe=e.match(E_e).map(Ne=>{const it=Ne[0];if(it==="p"||it==="P"){const pt=s9[it];return pt(Ne,S.formatLong)}return Ne}).join("").match(M_e).map(Ne=>{if(Ne==="''")return{isToken:!1,value:"'"};const it=Ne[0];if(it==="'")return{isToken:!1,value:z_e(Ne)};if(hF[it])return{isToken:!0,value:Ne};if(it.match(I_e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+it+"`");return{isToken:!1,value:Ne}});S.localize.preprocessor&&(xe=S.localize.preprocessor(ue,xe));const Se={firstWeekContainsDate:$,weekStartsOn:Z,locale:S};return xe.map(Ne=>{if(!Ne.isToken)return Ne.value;const it=Ne.value;(!r?.useAdditionalWeekYearTokens&&AH(it)||!r?.useAdditionalDayOfYearTokens&&CH(it))&&l9(it,e,String(t));const pt=hF[it[0]];return pt(ue,it,S.localize,Se)}).join("")}function z_e(t){const e=t.match(L_e);return e?e[1].replace(P_e,"'"):t}function O_e(){return Object.assign({},qx())}function B_e(t,e){const r=Ju(t,e?.in).getDay();return r===0?7:r}function R_e(t,e){const r=F_e(e)?new e(0):Hd(e,0);return r.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),r.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),r}function F_e(t){return typeof t=="function"&&t.prototype?.constructor===t}const N_e=10;class MH{subPriority=0;validate(e,r){return!0}}class j_e extends MH{constructor(e,r,c,S,$){super(),this.value=e,this.validateValue=r,this.setValue=c,this.priority=S,$&&(this.subPriority=$)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,c){return this.setValue(e,r,this.value,c)}}class U_e extends MH{priority=N_e;subPriority=-1;constructor(e,r){super(),this.context=e||(c=>Hd(r,c))}set(e,r){return r.timestampIsSet?e:Hd(e,R_e(e,this.context))}}class Rh{run(e,r,c,S){const $=this.parse(e,r,c,S);return $?{setter:new j_e($.value,this.validate,this.set,this.priority,this.subPriority),rest:$.rest}:null}validate(e,r,c){return!0}}class $_e extends Rh{priority=140;parse(e,r,c){switch(r){case"G":case"GG":case"GGG":return c.era(e,{width:"abbreviated"})||c.era(e,{width:"narrow"});case"GGGGG":return c.era(e,{width:"narrow"});case"GGGG":default:return c.era(e,{width:"wide"})||c.era(e,{width:"abbreviated"})||c.era(e,{width:"narrow"})}}set(e,r,c){return r.era=c,e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const lp={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Sv={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function up(t,e){return t&&{value:e(t.value),rest:t.rest}}function Sd(t,e){const r=e.match(t);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function Cv(t,e){const r=e.match(t);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const c=r[1]==="+"?1:-1,S=r[2]?parseInt(r[2],10):0,$=r[3]?parseInt(r[3],10):0,Z=r[5]?parseInt(r[5],10):0;return{value:c*(S*u4+$*l4+Z*gye),rest:e.slice(r[0].length)}}function EH(t){return Sd(lp.anyDigitsSigned,t)}function Vd(t,e){switch(t){case 1:return Sd(lp.singleDigit,e);case 2:return Sd(lp.twoDigits,e);case 3:return Sd(lp.threeDigits,e);case 4:return Sd(lp.fourDigits,e);default:return Sd(new RegExp("^\\d{1,"+t+"}"),e)}}function JT(t,e){switch(t){case 1:return Sd(lp.singleDigitSigned,e);case 2:return Sd(lp.twoDigitsSigned,e);case 3:return Sd(lp.threeDigitsSigned,e);case 4:return Sd(lp.fourDigitsSigned,e);default:return Sd(new RegExp("^-?\\d{1,"+t+"}"),e)}}function eL(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function LH(t,e){const r=e>0,c=r?e:1-e;let S;if(c<=50)S=t||100;else{const $=c+50,Z=Math.trunc($/100)*100,ue=t>=$%100;S=t+Z-(ue?100:0)}return r?S:1-S}function PH(t){return t%400===0||t%4===0&&t%100!==0}class H_e extends Rh{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,c){const S=$=>({year:$,isTwoDigitYear:r==="yy"});switch(r){case"y":return up(Vd(4,e),S);case"yo":return up(c.ordinalNumber(e,{unit:"year"}),S);default:return up(Vd(r.length,e),S)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,c){const S=e.getFullYear();if(c.isTwoDigitYear){const Z=LH(c.year,S);return e.setFullYear(Z,0,1),e.setHours(0,0,0,0),e}const $=!("era"in r)||r.era===1?c.year:1-c.year;return e.setFullYear($,0,1),e.setHours(0,0,0,0),e}}class V_e extends Rh{priority=130;parse(e,r,c){const S=$=>({year:$,isTwoDigitYear:r==="YY"});switch(r){case"Y":return up(Vd(4,e),S);case"Yo":return up(c.ordinalNumber(e,{unit:"year"}),S);default:return up(Vd(r.length,e),S)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,c,S){const $=QE(e,S);if(c.isTwoDigitYear){const ue=LH(c.year,$);return e.setFullYear(ue,0,S.firstWeekContainsDate),e.setHours(0,0,0,0),Dv(e,S)}const Z=!("era"in r)||r.era===1?c.year:1-c.year;return e.setFullYear(Z,0,S.firstWeekContainsDate),e.setHours(0,0,0,0),Dv(e,S)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class W_e extends Rh{priority=130;parse(e,r){return JT(r==="R"?4:r.length,e)}set(e,r,c){const S=Hd(e,0);return S.setFullYear(c,0,4),S.setHours(0,0,0,0),V2(S)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class q_e extends Rh{priority=130;parse(e,r){return JT(r==="u"?4:r.length,e)}set(e,r,c){return e.setFullYear(c,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class G_e extends Rh{priority=120;parse(e,r,c){switch(r){case"Q":case"QQ":return Vd(r.length,e);case"Qo":return c.ordinalNumber(e,{unit:"quarter"});case"QQQ":return c.quarter(e,{width:"abbreviated",context:"formatting"})||c.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return c.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return c.quarter(e,{width:"wide",context:"formatting"})||c.quarter(e,{width:"abbreviated",context:"formatting"})||c.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,c){return e.setMonth((c-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Z_e extends Rh{priority=120;parse(e,r,c){switch(r){case"q":case"qq":return Vd(r.length,e);case"qo":return c.ordinalNumber(e,{unit:"quarter"});case"qqq":return c.quarter(e,{width:"abbreviated",context:"standalone"})||c.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return c.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return c.quarter(e,{width:"wide",context:"standalone"})||c.quarter(e,{width:"abbreviated",context:"standalone"})||c.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,c){return e.setMonth((c-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class K_e extends Rh{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,c){const S=$=>$-1;switch(r){case"M":return up(Sd(lp.month,e),S);case"MM":return up(Vd(2,e),S);case"Mo":return up(c.ordinalNumber(e,{unit:"month"}),S);case"MMM":return c.month(e,{width:"abbreviated",context:"formatting"})||c.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return c.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return c.month(e,{width:"wide",context:"formatting"})||c.month(e,{width:"abbreviated",context:"formatting"})||c.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.setMonth(c,1),e.setHours(0,0,0,0),e}}class Y_e extends Rh{priority=110;parse(e,r,c){const S=$=>$-1;switch(r){case"L":return up(Sd(lp.month,e),S);case"LL":return up(Vd(2,e),S);case"Lo":return up(c.ordinalNumber(e,{unit:"month"}),S);case"LLL":return c.month(e,{width:"abbreviated",context:"standalone"})||c.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return c.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return c.month(e,{width:"wide",context:"standalone"})||c.month(e,{width:"abbreviated",context:"standalone"})||c.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.setMonth(c,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function X_e(t,e,r){const c=Ju(t,r?.in),S=TH(c,r)-e;return c.setDate(c.getDate()-S*7),Ju(c,r?.in)}class J_e extends Rh{priority=100;parse(e,r,c){switch(r){case"w":return Sd(lp.week,e);case"wo":return c.ordinalNumber(e,{unit:"week"});default:return Vd(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,c,S){return Dv(X_e(e,c,S),S)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Q_e(t,e,r){const c=Ju(t,r?.in),S=kH(c,r)-e;return c.setDate(c.getDate()-S*7),c}class exe extends Rh{priority=100;parse(e,r,c){switch(r){case"I":return Sd(lp.week,e);case"Io":return c.ordinalNumber(e,{unit:"week"});default:return Vd(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,c){return V2(Q_e(e,c))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const txe=[31,28,31,30,31,30,31,31,30,31,30,31],rxe=[31,29,31,30,31,30,31,31,30,31,30,31];class ixe extends Rh{priority=90;subPriority=1;parse(e,r,c){switch(r){case"d":return Sd(lp.date,e);case"do":return c.ordinalNumber(e,{unit:"date"});default:return Vd(r.length,e)}}validate(e,r){const c=e.getFullYear(),S=PH(c),$=e.getMonth();return S?r>=1&&r<=rxe[$]:r>=1&&r<=txe[$]}set(e,r,c){return e.setDate(c),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class nxe extends Rh{priority=90;subpriority=1;parse(e,r,c){switch(r){case"D":case"DD":return Sd(lp.dayOfYear,e);case"Do":return c.ordinalNumber(e,{unit:"date"});default:return Vd(r.length,e)}}validate(e,r){const c=e.getFullYear();return PH(c)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,c){return e.setMonth(0,c),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function tL(t,e,r){const c=qx(),S=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??c.weekStartsOn??c.locale?.options?.weekStartsOn??0,$=Ju(t,r?.in),Z=$.getDay(),xe=(e%7+7)%7,Se=7-S,Ne=e<0||e>6?e-(Z+Se)%7:(xe+Se)%7-(Z+Se)%7;return $8($,Ne,r)}class axe extends Rh{priority=90;parse(e,r,c){switch(r){case"E":case"EE":case"EEE":return c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return c.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=tL(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class oxe extends Rh{priority=90;parse(e,r,c,S){const $=Z=>{const ue=Math.floor((Z-1)/7)*7;return(Z+S.weekStartsOn+6)%7+ue};switch(r){case"e":case"ee":return up(Vd(r.length,e),$);case"eo":return up(c.ordinalNumber(e,{unit:"day"}),$);case"eee":return c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"eeeee":return c.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=tL(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class sxe extends Rh{priority=90;parse(e,r,c,S){const $=Z=>{const ue=Math.floor((Z-1)/7)*7;return(Z+S.weekStartsOn+6)%7+ue};switch(r){case"c":case"cc":return up(Vd(r.length,e),$);case"co":return up(c.ordinalNumber(e,{unit:"day"}),$);case"ccc":return c.day(e,{width:"abbreviated",context:"standalone"})||c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"});case"ccccc":return c.day(e,{width:"narrow",context:"standalone"});case"cccccc":return c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return c.day(e,{width:"wide",context:"standalone"})||c.day(e,{width:"abbreviated",context:"standalone"})||c.day(e,{width:"short",context:"standalone"})||c.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,c,S){return e=tL(e,c,S),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function lxe(t,e,r){const c=Ju(t,r?.in),S=B_e(c,r),$=e-S;return $8(c,$,r)}class uxe extends Rh{priority=90;parse(e,r,c){const S=$=>$===0?7:$;switch(r){case"i":case"ii":return Vd(r.length,e);case"io":return c.ordinalNumber(e,{unit:"day"});case"iii":return up(c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S);case"iiiii":return up(c.day(e,{width:"narrow",context:"formatting"}),S);case"iiiiii":return up(c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S);case"iiii":default:return up(c.day(e,{width:"wide",context:"formatting"})||c.day(e,{width:"abbreviated",context:"formatting"})||c.day(e,{width:"short",context:"formatting"})||c.day(e,{width:"narrow",context:"formatting"}),S)}}validate(e,r){return r>=1&&r<=7}set(e,r,c){return e=lxe(e,c),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class cxe extends Rh{priority=80;parse(e,r,c){switch(r){case"a":case"aa":case"aaa":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(eL(c),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class hxe extends Rh{priority=80;parse(e,r,c){switch(r){case"b":case"bb":case"bbb":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(eL(c),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class fxe extends Rh{priority=80;parse(e,r,c){switch(r){case"B":case"BB":case"BBB":return c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return c.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return c.dayPeriod(e,{width:"wide",context:"formatting"})||c.dayPeriod(e,{width:"abbreviated",context:"formatting"})||c.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,c){return e.setHours(eL(c),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class dxe extends Rh{priority=70;parse(e,r,c){switch(r){case"h":return Sd(lp.hour12h,e);case"ho":return c.ordinalNumber(e,{unit:"hour"});default:return Vd(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,c){const S=e.getHours()>=12;return S&&c<12?e.setHours(c+12,0,0,0):!S&&c===12?e.setHours(0,0,0,0):e.setHours(c,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class pxe extends Rh{priority=70;parse(e,r,c){switch(r){case"H":return Sd(lp.hour23h,e);case"Ho":return c.ordinalNumber(e,{unit:"hour"});default:return Vd(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,c){return e.setHours(c,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class mxe extends Rh{priority=70;parse(e,r,c){switch(r){case"K":return Sd(lp.hour11h,e);case"Ko":return c.ordinalNumber(e,{unit:"hour"});default:return Vd(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,c){return e.getHours()>=12&&c<12?e.setHours(c+12,0,0,0):e.setHours(c,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class gxe extends Rh{priority=70;parse(e,r,c){switch(r){case"k":return Sd(lp.hour24h,e);case"ko":return c.ordinalNumber(e,{unit:"hour"});default:return Vd(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,c){const S=c<=24?c%24:c;return e.setHours(S,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class vxe extends Rh{priority=60;parse(e,r,c){switch(r){case"m":return Sd(lp.minute,e);case"mo":return c.ordinalNumber(e,{unit:"minute"});default:return Vd(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,c){return e.setMinutes(c,0,0),e}incompatibleTokens=["t","T"]}class yxe extends Rh{priority=50;parse(e,r,c){switch(r){case"s":return Sd(lp.second,e);case"so":return c.ordinalNumber(e,{unit:"second"});default:return Vd(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,c){return e.setSeconds(c,0),e}incompatibleTokens=["t","T"]}class _xe extends Rh{priority=30;parse(e,r){const c=S=>Math.trunc(S*Math.pow(10,-r.length+3));return up(Vd(r.length,e),c)}set(e,r,c){return e.setMilliseconds(c),e}incompatibleTokens=["t","T"]}class xxe extends Rh{priority=10;parse(e,r){switch(r){case"X":return Cv(Sv.basicOptionalMinutes,e);case"XX":return Cv(Sv.basic,e);case"XXXX":return Cv(Sv.basicOptionalSeconds,e);case"XXXXX":return Cv(Sv.extendedOptionalSeconds,e);case"XXX":default:return Cv(Sv.extended,e)}}set(e,r,c){return r.timestampIsSet?e:Hd(e,e.getTime()-XT(e)-c)}incompatibleTokens=["t","T","x"]}class bxe extends Rh{priority=10;parse(e,r){switch(r){case"x":return Cv(Sv.basicOptionalMinutes,e);case"xx":return Cv(Sv.basic,e);case"xxxx":return Cv(Sv.basicOptionalSeconds,e);case"xxxxx":return Cv(Sv.extendedOptionalSeconds,e);case"xxx":default:return Cv(Sv.extended,e)}}set(e,r,c){return r.timestampIsSet?e:Hd(e,e.getTime()-XT(e)-c)}incompatibleTokens=["t","T","X"]}class wxe extends Rh{priority=40;parse(e){return EH(e)}set(e,r,c){return[Hd(e,c*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class kxe extends Rh{priority=20;parse(e){return EH(e)}set(e,r,c){return[Hd(e,c),{timestampIsSet:!0}]}incompatibleTokens="*"}const Txe={G:new $_e,y:new H_e,Y:new V_e,R:new W_e,u:new q_e,Q:new G_e,q:new Z_e,M:new K_e,L:new Y_e,w:new J_e,I:new exe,d:new ixe,D:new nxe,E:new axe,e:new oxe,c:new sxe,i:new uxe,a:new cxe,b:new hxe,B:new fxe,h:new dxe,H:new pxe,K:new mxe,k:new gxe,m:new vxe,s:new yxe,S:new _xe,X:new xxe,x:new bxe,t:new wxe,T:new kxe},Sxe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Cxe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Axe=/^'([^]*?)'?$/,Mxe=/''/g,Exe=/\S/,Lxe=/[a-zA-Z]/;function Pxe(t,e,r,c){const S=()=>Hd(c?.in||r,NaN),$=O_e(),Z=c?.locale??$.locale??wH,ue=c?.firstWeekContainsDate??c?.locale?.options?.firstWeekContainsDate??$.firstWeekContainsDate??$.locale?.options?.firstWeekContainsDate??1,xe=c?.weekStartsOn??c?.locale?.options?.weekStartsOn??$.weekStartsOn??$.locale?.options?.weekStartsOn??0;if(!e)return t?S():Ju(r,c?.in);const Se={firstWeekContainsDate:ue,weekStartsOn:xe,locale:Z},Ne=[new U_e(c?.in,r)],it=e.match(Cxe).map(Zt=>{const Mr=Zt[0];if(Mr in s9){const ze=s9[Mr];return ze(Zt,Z.formatLong)}return Zt}).join("").match(Sxe),pt=[];for(let Zt of it){!c?.useAdditionalWeekYearTokens&&AH(Zt)&&l9(Zt,e,t),!c?.useAdditionalDayOfYearTokens&&CH(Zt)&&l9(Zt,e,t);const Mr=Zt[0],ze=Txe[Mr];if(ze){const{incompatibleTokens:ni}=ze;if(Array.isArray(ni)){const Cr=pt.find(gi=>ni.includes(gi.token)||gi.token===Mr);if(Cr)throw new RangeError(`The format string mustn't contain \`${Cr.fullToken}\` and \`${Zt}\` at the same time`)}else if(ze.incompatibleTokens==="*"&&pt.length>0)throw new RangeError(`The format string mustn't contain \`${Zt}\` and any other token at the same time`);pt.push({token:Mr,fullToken:Zt});const or=ze.run(t,Zt,Z.match,Se);if(!or)return S();Ne.push(or.setter),t=or.rest}else{if(Mr.match(Lxe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Mr+"`");if(Zt==="''"?Zt="'":Mr==="'"&&(Zt=Ixe(Zt)),t.indexOf(Zt)===0)t=t.slice(Zt.length);else return S()}}if(t.length>0&&Exe.test(t))return S();const bt=Ne.map(Zt=>Zt.priority).sort((Zt,Mr)=>Mr-Zt).filter((Zt,Mr,ze)=>ze.indexOf(Zt)===Mr).map(Zt=>Ne.filter(Mr=>Mr.priority===Zt).sort((Mr,ze)=>ze.subPriority-Mr.subPriority)).map(Zt=>Zt[0]);let wt=Ju(r,c?.in);if(isNaN(+wt))return S();const Dt={};for(const Zt of bt){if(!Zt.validate(wt,Se))return S();const Mr=Zt.set(wt,Dt,Se);Array.isArray(Mr)?(wt=Mr[0],Object.assign(Dt,Mr[1])):wt=Mr}return wt}function Ixe(t){return t.match(Axe)[1].replace(Mxe,"'")}function Dxe(t,e){const r=Ju(t,e?.in);return r.setMinutes(0,0,0),r}function zxe(t,e){const r=Ju(t,e?.in);return r.setSeconds(0,0),r}function Oxe(t,e){const r=Ju(t,e?.in);return r.setMilliseconds(0),r}function Bxe(t,e){const r=()=>Hd(e?.in,NaN),c=e?.additionalDigits??2,S=jxe(t);let $;if(S.date){const Se=Uxe(S.date,c);$=$xe(Se.restDateString,Se.year)}if(!$||isNaN(+$))return r();const Z=+$;let ue=0,xe;if(S.time&&(ue=Hxe(S.time),isNaN(ue)))return r();if(S.timezone){if(xe=Vxe(S.timezone),isNaN(xe))return r()}else{const Se=new Date(Z+ue),Ne=Ju(0,e?.in);return Ne.setFullYear(Se.getUTCFullYear(),Se.getUTCMonth(),Se.getUTCDate()),Ne.setHours(Se.getUTCHours(),Se.getUTCMinutes(),Se.getUTCSeconds(),Se.getUTCMilliseconds()),Ne}return Ju(Z+ue+xe,e?.in)}const Yk={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Rxe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Fxe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nxe=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jxe(t){const e={},r=t.split(Yk.dateTimeDelimiter);let c;if(r.length>2)return e;if(/:/.test(r[0])?c=r[0]:(e.date=r[0],c=r[1],Yk.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Yk.timeZoneDelimiter)[0],c=t.substr(e.date.length,t.length))),c){const S=Yk.timezone.exec(c);S?(e.time=c.replace(S[1],""),e.timezone=S[1]):e.time=c}return e}function Uxe(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),c=t.match(r);if(!c)return{year:NaN,restDateString:""};const S=c[1]?parseInt(c[1]):null,$=c[2]?parseInt(c[2]):null;return{year:$===null?S:$*100,restDateString:t.slice((c[1]||c[2]).length)}}function $xe(t,e){if(e===null)return new Date(NaN);const r=t.match(Rxe);if(!r)return new Date(NaN);const c=!!r[4],S=H3(r[1]),$=H3(r[2])-1,Z=H3(r[3]),ue=H3(r[4]),xe=H3(r[5])-1;if(c)return Kxe(e,ue,xe)?Wxe(e,ue,xe):new Date(NaN);{const Se=new Date(0);return!Gxe(e,$,Z)||!Zxe(e,S)?new Date(NaN):(Se.setUTCFullYear(e,$,Math.max(S,Z)),Se)}}function H3(t){return t?parseInt(t):1}function Hxe(t){const e=t.match(Fxe);if(!e)return NaN;const r=q7(e[1]),c=q7(e[2]),S=q7(e[3]);return Yxe(r,c,S)?r*u4+c*l4+S*1e3:NaN}function q7(t){return t&&parseFloat(t.replace(",","."))||0}function Vxe(t){if(t==="Z")return 0;const e=t.match(Nxe);if(!e)return 0;const r=e[1]==="+"?-1:1,c=parseInt(e[2]),S=e[3]&&parseInt(e[3])||0;return Xxe(c,S)?r*(c*u4+S*l4):NaN}function Wxe(t,e,r){const c=new Date(0);c.setUTCFullYear(t,0,4);const S=c.getUTCDay()||7,$=(e-1)*7+r+1-S;return c.setUTCDate(c.getUTCDate()+$),c}const qxe=[31,null,31,30,31,30,31,31,30,31,30,31];function IH(t){return t%400===0||t%4===0&&t%100!==0}function Gxe(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(qxe[e]||(IH(t)?29:28))}function Zxe(t,e){return e>=1&&e<=(IH(t)?366:365)}function Kxe(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function Yxe(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function Xxe(t,e){return e>=0&&e<=59}/*! * chartjs-adapter-date-fns v3.0.0 * https://www.chartjs.org * (c) 2022 chartjs-adapter-date-fns Contributors * Released under the MIT license - */const Yxe={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};R$._date.override({_id:"date-fns",formats:function(){return Yxe},parse:function(t,e){if(t===null||typeof t>"u")return null;const r=typeof t;return r==="number"||t instanceof Date?t=Ju(t):r==="string"&&(typeof e=="string"?t=Exe(t,e,new Date,this.options):t=zxe(t,this.options)),dH(t)?t.getTime():null},format:function(t,e){return P_e(t,e,this.options)},add:function(t,e,r){switch(r){case"millisecond":return KE(t,e);case"second":return xye(t,e);case"minute":return yye(t,e);case"hour":return mye(t,e);case"day":return jS(t,e);case"week":return bye(t,e);case"month":return ZE(t,e);case"quarter":return _ye(t,e);case"year":return wye(t,e);default:return t}},diff:function(t,e,r){switch(r){case"millisecond":return YE(t,e);case"second":return Lye(t,e);case"minute":return Aye(t,e);case"hour":return Cye(t,e);case"day":return pH(t,e);case"week":return Pye(t,e);case"month":return vH(t,e);case"quarter":return Eye(t,e);case"year":return Iye(t,e);default:return 0}},startOf:function(t,e,r){switch(e){case"second":return Dxe(t);case"minute":return Ixe(t);case"hour":return Pxe(t);case"day":return n9(t);case"week":return zv(t);case"isoWeek":return zv(t,{weekStartsOn:+r});case"month":return zye(t);case"quarter":return Dye(t);case"year":return yH(t);default:return t}},endOf:function(t,e){switch(e){case"second":return jye(t);case"minute":return Fye(t);case"hour":return Bye(t);case"day":return mH(t);case"week":return Rye(t);case"month":return gH(t);case"quarter":return Nye(t);case"year":return Oye(t);default:return t}}});var vT={exports:{}},Xxe=vT.exports,dF;function Jxe(){return dF||(dF=1,function(t){var e={};(function(r,c){t.exports?t.exports=c():r.moduleName=c()})(typeof self<"u"?self:Xxe,()=>{var r=(()=>{var c=Object.create,S=Object.defineProperty,H=Object.defineProperties,Z=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,be=Object.getOwnPropertyNames,Se=Object.getOwnPropertySymbols,Re=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,bt=(te,Y,d)=>Y in te?S(te,Y,{enumerable:!0,configurable:!0,writable:!0,value:d}):te[Y]=d,kt=(te,Y)=>{for(var d in Y||(Y={}))Xe.call(Y,d)&&bt(te,d,Y[d]);if(Se)for(var d of Se(Y))vt.call(Y,d)&&bt(te,d,Y[d]);return te},Dt=(te,Y)=>H(te,ue(Y)),rr=(te,Y)=>{var d={};for(var y in te)Xe.call(te,y)&&Y.indexOf(y)<0&&(d[y]=te[y]);if(te!=null&&Se)for(var y of Se(te))Y.indexOf(y)<0&&vt.call(te,y)&&(d[y]=te[y]);return d},Er=(te,Y)=>()=>(te&&(Y=te(te=0)),Y),Fe=(te,Y)=>()=>(Y||te((Y={exports:{}}).exports,Y),Y.exports),wi=(te,Y)=>{for(var d in Y)S(te,d,{get:Y[d],enumerable:!0})},ur=(te,Y,d,y)=>{if(Y&&typeof Y=="object"||typeof Y=="function")for(let z of be(Y))!Xe.call(te,z)&&z!==d&&S(te,z,{get:()=>Y[z],enumerable:!(y=Z(Y,z))||y.enumerable});return te},Ir=(te,Y,d)=>(d=te!=null?c(Re(te)):{},ur(S(d,"default",{value:te,enumerable:!0}),te)),Ti=te=>ur(S({},"__esModule",{value:!0}),te),_i=Fe(te=>{te.version="3.2.0"}),Ci=Fe((te,Y)=>{(function(d,y,z){y[d]=y[d]||z(),typeof Y<"u"&&Y.exports&&(Y.exports=y[d])})("Promise",typeof window<"u"?window:te,function(){var d,y,z,P=Object.prototype.toString,i=typeof setImmediate<"u"?function(A){return setImmediate(A)}:setTimeout;try{Object.defineProperty({},"x",{}),d=function(A,f,k,w){return Object.defineProperty(A,f,{value:k,writable:!0,configurable:w!==!1})}}catch{d=function(f,k,w){return f[k]=w,f}}z=function(){var A,f,k;function w(D,E){this.fn=D,this.self=E,this.next=void 0}return{add:function(D,E){k=new w(D,E),f?f.next=k:A=k,f=k,k=void 0},drain:function(){var D=A;for(A=f=y=void 0;D;)D.fn.call(D.self),D=D.next}}}();function n(A,f){z.add(A,f),y||(y=i(z.drain))}function a(A){var f,k=typeof A;return A!=null&&(k=="object"||k=="function")&&(f=A.then),typeof f=="function"?f:!1}function l(){for(var A=0;A0&&n(l,k))}catch(w){s.call(new m(k),w)}}}function s(A){var f=this;f.triggered||(f.triggered=!0,f.def&&(f=f.def),f.msg=A,f.state=2,f.chain.length>0&&n(l,f))}function h(A,f,k,w){for(var D=0;D{(function(){var d={version:"3.8.2"},y=[].slice,z=function(Me){return y.call(Me)},P=self.document;function i(Me){return Me&&(Me.ownerDocument||Me.document||Me).documentElement}function n(Me){return Me&&(Me.ownerDocument&&Me.ownerDocument.defaultView||Me.document&&Me||Me.defaultView)}if(P)try{z(P.documentElement.childNodes)[0].nodeType}catch{z=function(Ve){for(var ft=Ve.length,Pt=new Array(ft);ft--;)Pt[ft]=Ve[ft];return Pt}}if(Date.now||(Date.now=function(){return+new Date}),P)try{P.createElement("DIV").style.setProperty("opacity",0,"")}catch{var a=this.Element.prototype,l=a.setAttribute,o=a.setAttributeNS,u=this.CSSStyleDeclaration.prototype,s=u.setProperty;a.setAttribute=function(Ve,ft){l.call(this,Ve,ft+"")},a.setAttributeNS=function(Ve,ft,Pt){o.call(this,Ve,ft,Pt+"")},u.setProperty=function(Ve,ft,Pt){s.call(this,Ve,ft+"",Pt)}}d.ascending=h;function h(Me,Ve){return MeVe?1:Me>=Ve?0:NaN}d.descending=function(Me,Ve){return VeMe?1:Ve>=Me?0:NaN},d.min=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht;if(arguments.length===1){for(;++ft=Ht){Bt=Ht;break}for(;++ftHt&&(Bt=Ht)}else{for(;++ft=Ht){Bt=Ht;break}for(;++ftHt&&(Bt=Ht)}return Bt},d.max=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht;if(arguments.length===1){for(;++ft=Ht){Bt=Ht;break}for(;++ftBt&&(Bt=Ht)}else{for(;++ft=Ht){Bt=Ht;break}for(;++ftBt&&(Bt=Ht)}return Bt},d.extent=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht,fr;if(arguments.length===1){for(;++ft=Ht){Bt=fr=Ht;break}for(;++ftHt&&(Bt=Ht),fr=Ht){Bt=fr=Ht;break}for(;++ftHt&&(Bt=Ht),fr1)return fr/(Or-1)},d.deviation=function(){var Me=d.variance.apply(this,arguments);return Me&&Math.sqrt(Me)};function x(Me){return{left:function(Ve,ft,Pt,Bt){for(arguments.length<3&&(Pt=0),arguments.length<4&&(Bt=Ve.length);Pt>>1;Me(Ve[Ht],ft)<0?Pt=Ht+1:Bt=Ht}return Pt},right:function(Ve,ft,Pt,Bt){for(arguments.length<3&&(Pt=0),arguments.length<4&&(Bt=Ve.length);Pt>>1;Me(Ve[Ht],ft)>0?Bt=Ht:Pt=Ht+1}return Pt}}}var _=x(h);d.bisectLeft=_.left,d.bisect=d.bisectRight=_.right,d.bisector=function(Me){return x(Me.length===1?function(Ve,ft){return h(Me(Ve),ft)}:Me)},d.shuffle=function(Me,Ve,ft){(Pt=arguments.length)<3&&(ft=Me.length,Pt<2&&(Ve=0));for(var Pt=ft-Ve,Bt,Ht;Pt;)Ht=Math.random()*Pt--|0,Bt=Me[Pt+Ve],Me[Pt+Ve]=Me[Ht+Ve],Me[Ht+Ve]=Bt;return Me},d.permute=function(Me,Ve){for(var ft=Ve.length,Pt=new Array(ft);ft--;)Pt[ft]=Me[Ve[ft]];return Pt},d.pairs=function(Me){for(var Ve=0,ft=Me.length-1,Pt,Bt=Me[0],Ht=new Array(ft<0?0:ft);Ve=0;)for(fr=Me[Ve],ft=fr.length;--ft>=0;)Ht[--Bt]=fr[ft];return Ht};var f=Math.abs;d.range=function(Me,Ve,ft){if(arguments.length<3&&(ft=1,arguments.length<2&&(Ve=Me,Me=0)),(Ve-Me)/ft===1/0)throw new Error("infinite range");var Pt=[],Bt=k(f(ft)),Ht=-1,fr;if(Me*=Bt,Ve*=Bt,ft*=Bt,ft<0)for(;(fr=Me+ft*++Ht)>Ve;)Pt.push(fr/Bt);else for(;(fr=Me+ft*++Ht)=Ve.length)return Bt?Bt.call(Me,Or):Pt?Or.sort(Pt):Or;for(var ci=-1,Bi=Or.length,Yi=Ve[pi++],Qi,ta,ln,On=new D,Un;++ci=Ve.length)return cr;var pi=[],ci=ft[Or++];return cr.forEach(function(Bi,Yi){pi.push({key:Bi,values:fr(Yi,Or)})}),ci?pi.sort(function(Bi,Yi){return ci(Bi.key,Yi.key)}):pi}return Me.map=function(cr,Or){return Ht(Or,cr,0)},Me.entries=function(cr){return fr(Ht(d.map,cr,0),0)},Me.key=function(cr){return Ve.push(cr),Me},Me.sortKeys=function(cr){return ft[Ve.length-1]=cr,Me},Me.sortValues=function(cr){return Pt=cr,Me},Me.rollup=function(cr){return Bt=cr,Me},Me},d.set=function(Me){var Ve=new U;if(Me)for(var ft=0,Pt=Me.length;ft=0&&(Pt=Me.slice(ft+1),Me=Me.slice(0,ft)),Me)return arguments.length<2?this[Me].on(Pt):this[Me].on(Pt,Ve);if(arguments.length===2){if(Ve==null)for(Me in this)this.hasOwnProperty(Me)&&this[Me].on(Pt,null);return this}};function ee(Me){var Ve=[],ft=new D;function Pt(){for(var Bt=Ve,Ht=-1,fr=Bt.length,cr;++Ht=0&&(ft=Me.slice(0,Ve))!=="xmlns"&&(Me=Me.slice(Ve+1)),Ce.hasOwnProperty(ft)?{space:Ce[ft],local:Me}:Me}},oe.attr=function(Me,Ve){if(arguments.length<2){if(typeof Me=="string"){var ft=this.node();return Me=d.ns.qualify(Me),Me.local?ft.getAttributeNS(Me.space,Me.local):ft.getAttribute(Me)}for(Ve in Me)this.each(Be(Ve,Me[Ve]));return this}return this.each(Be(Me,Ve))};function Be(Me,Ve){Me=d.ns.qualify(Me);function ft(){this.removeAttribute(Me)}function Pt(){this.removeAttributeNS(Me.space,Me.local)}function Bt(){this.setAttribute(Me,Ve)}function Ht(){this.setAttributeNS(Me.space,Me.local,Ve)}function fr(){var Or=Ve.apply(this,arguments);Or==null?this.removeAttribute(Me):this.setAttribute(Me,Or)}function cr(){var Or=Ve.apply(this,arguments);Or==null?this.removeAttributeNS(Me.space,Me.local):this.setAttributeNS(Me.space,Me.local,Or)}return Ve==null?Me.local?Pt:ft:typeof Ve=="function"?Me.local?cr:fr:Me.local?Ht:Bt}function Oe(Me){return Me.trim().replace(/\s+/g," ")}oe.classed=function(Me,Ve){if(arguments.length<2){if(typeof Me=="string"){var ft=this.node(),Pt=(Me=Ge(Me)).length,Bt=-1;if(Ve=ft.classList){for(;++Bt=0;)(Ht=ft[Pt])&&(Bt&&Bt!==Ht.nextSibling&&Bt.parentNode.insertBefore(Ht,Bt),Bt=Ht);return this},oe.sort=function(Me){Me=nt.apply(this,arguments);for(var Ve=-1,ft=this.length;++Ve=Ve&&(Ve=Bt+1);!(Or=fr[Ve])&&++Ve0&&(Me=Me.slice(0,Bt));var fr=gr.get(Me);fr&&(Me=fr,Ht=Kr);function cr(){var ci=this[Pt];ci&&(this.removeEventListener(Me,ci,ci.$),delete this[Pt])}function Or(){var ci=Ht(Ve,z(arguments));cr.call(this),this.addEventListener(Me,this[Pt]=ci,ci.$=ft),ci._=Ve}function pi(){var ci=new RegExp("^__on([^.]+)"+d.requote(Me)+"$"),Bi;for(var Yi in this)if(Bi=Yi.match(ci)){var Qi=this[Yi];this.removeEventListener(Bi[1],Qi,Qi.$),delete this[Yi]}}return Bt?Ve?Or:cr:Ve?q:pi}var gr=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});P&&gr.forEach(function(Me){"on"+Me in P&&gr.remove(Me)});function mr(Me,Ve){return function(ft){var Pt=d.event;d.event=ft,Ve[0]=this.__data__;try{Me.apply(this,Ve)}finally{d.event=Pt}}}function Kr(Me,Ve){var ft=mr(Me,Ve);return function(Pt){var Bt=this,Ht=Pt.relatedTarget;(!Ht||Ht!==Bt&&!(Ht.compareDocumentPosition(Bt)&8))&&ft.call(Bt,Pt)}}var ri,Mr=0;function ui(Me){var Ve=".dragsuppress-"+ ++Mr,ft="click"+Ve,Pt=d.select(n(Me)).on("touchmove"+Ve,he).on("dragstart"+Ve,he).on("selectstart"+Ve,he);if(ri==null&&(ri="onselectstart"in Me?!1:F(Me.style,"userSelect")),ri){var Bt=i(Me).style,Ht=Bt[ri];Bt[ri]="none"}return function(fr){if(Pt.on(Ve,null),ri&&(Bt[ri]=Ht),fr){var cr=function(){Pt.on(ft,null)};Pt.on(ft,function(){he(),cr()},!0),setTimeout(cr,0)}}}d.mouse=function(Me){return Ot(Me,xe())};var mi=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ot(Me,Ve){Ve.changedTouches&&(Ve=Ve.changedTouches[0]);var ft=Me.ownerSVGElement||Me;if(ft.createSVGPoint){var Pt=ft.createSVGPoint();if(mi<0){var Bt=n(Me);if(Bt.scrollX||Bt.scrollY){ft=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Ht=ft[0][0].getScreenCTM();mi=!(Ht.f||Ht.e),ft.remove()}}return mi?(Pt.x=Ve.pageX,Pt.y=Ve.pageY):(Pt.x=Ve.clientX,Pt.y=Ve.clientY),Pt=Pt.matrixTransform(Me.getScreenCTM().inverse()),[Pt.x,Pt.y]}var fr=Me.getBoundingClientRect();return[Ve.clientX-fr.left-Me.clientLeft,Ve.clientY-fr.top-Me.clientTop]}d.touch=function(Me,Ve,ft){if(arguments.length<3&&(ft=Ve,Ve=xe().changedTouches),Ve){for(var Pt=0,Bt=Ve.length,Ht;Pt1?at:Me<-1?-at:Math.asin(Me)}function hr(Me){return((Me=Math.exp(Me))-1/Me)/2}function zr(Me){return((Me=Math.exp(Me))+1/Me)/2}function Dr(Me){return((Me=Math.exp(2*Me))-1)/(Me+1)}var br=Math.SQRT2,hi=2,un=4;d.interpolateZoom=function(Me,Ve){var ft=Me[0],Pt=Me[1],Bt=Me[2],Ht=Ve[0],fr=Ve[1],cr=Ve[2],Or=Ht-ft,pi=fr-Pt,ci=Or*Or+pi*pi,Bi,Yi;if(ci0&&(Eo=Eo.transition().duration(fr)),Eo.call(aa.event)}function qo(){On&&On.domain(ln.range().map(function(Eo){return(Eo-Me.x)/Me.k}).map(ln.invert)),Zn&&Zn.domain(Un.range().map(function(Eo){return(Eo-Me.y)/Me.k}).map(Un.invert))}function Xo(Eo){cr++||Eo({type:"zoomstart"})}function ml(Eo){qo(),Eo({type:"zoom",scale:Me.k,translate:[Me.x,Me.y]})}function ts(Eo){--cr||(Eo({type:"zoomend"}),ft=null)}function ws(){var Eo=this,el=ta.of(Eo,arguments),fl=0,vu=d.select(n(Eo)).on(pi,Zl).on(ci,cu),nu=gn(d.mouse(Eo)),dh=ui(Eo);Jn.call(Eo),Xo(el);function Zl(){fl=1,yo(d.mouse(Eo),nu),ml(el)}function cu(){vu.on(pi,null).on(ci,null),dh(fl),ts(el)}}function Dl(){var Eo=this,el=ta.of(Eo,arguments),fl={},vu=0,nu,dh=".zoom-"+d.event.changedTouches[0].identifier,Zl="touchmove"+dh,cu="touchend"+dh,zh=[],St=d.select(Eo),Pr=ui(Eo);en(),Xo(el),St.on(Or,null).on(Yi,en);function Nr(){var Oi=d.touches(Eo);return nu=Me.k,Oi.forEach(function(Tn){Tn.identifier in fl&&(fl[Tn.identifier]=gn(Tn))}),Oi}function en(){var Oi=d.event.target;d.select(Oi).on(Zl,Cn).on(cu,xn),zh.push(Oi);for(var Tn=d.event.changedTouches,ua=0,ia=Tn.length;ua1){var Ka=La[0],da=La[1],Nn=Ka[0]-da[0],Ei=Ka[1]-da[1];vu=Nn*Nn+Ei*Ei}}function Cn(){var Oi=d.touches(Eo),Tn,ua,ia,La;Jn.call(Eo);for(var no=0,Ka=Oi.length;no1?1:Ve,ft=ft<0?0:ft>1?1:ft,Bt=ft<=.5?ft*(1+Ve):ft+Ve-ft*Ve,Pt=2*ft-Bt;function Ht(cr){return cr>360?cr-=360:cr<0&&(cr+=360),cr<60?Pt+(Bt-Pt)*cr/60:cr<180?Bt:cr<240?Pt+(Bt-Pt)*(240-cr)/60:Pt}function fr(cr){return Math.round(Ht(cr)*255)}return new Ha(fr(Me+120),fr(Me),fr(Me-120))}d.hcl=Zt;function Zt(Me,Ve,ft){return this instanceof Zt?(this.h=+Me,this.c=+Ve,void(this.l=+ft)):arguments.length<2?Me instanceof Zt?new Zt(Me.h,Me.c,Me.l):Me instanceof Cr?Gn(Me.l,Me.a,Me.b):Gn((Me=Gr((Me=d.rgb(Me)).r,Me.g,Me.b)).l,Me.a,Me.b):new Zt(Me,Ve,ft)}var sr=Zt.prototype=new Sn;sr.brighter=function(Me){return new Zt(this.h,this.c,Math.min(100,this.l+fi*(arguments.length?Me:1)))},sr.darker=function(Me){return new Zt(this.h,this.c,Math.max(0,this.l-fi*(arguments.length?Me:1)))},sr.rgb=function(){return _r(this.h,this.c,this.l).rgb()};function _r(Me,Ve,ft){return isNaN(Me)&&(Me=0),isNaN(Ve)&&(Ve=0),new Cr(ft,Math.cos(Me*=ht)*Ve,Math.sin(Me)*Ve)}d.lab=Cr;function Cr(Me,Ve,ft){return this instanceof Cr?(this.l=+Me,this.a=+Ve,void(this.b=+ft)):arguments.length<2?Me instanceof Cr?new Cr(Me.l,Me.a,Me.b):Me instanceof Zt?_r(Me.h,Me.c,Me.l):Gr((Me=Ha(Me)).r,Me.g,Me.b):new Cr(Me,Ve,ft)}var fi=18,qi=.95047,Ui=1,Hi=1.08883,En=Cr.prototype=new Sn;En.brighter=function(Me){return new Cr(Math.min(100,this.l+fi*(arguments.length?Me:1)),this.a,this.b)},En.darker=function(Me){return new Cr(Math.max(0,this.l-fi*(arguments.length?Me:1)),this.a,this.b)},En.rgb=function(){return Rn(this.l,this.a,this.b)};function Rn(Me,Ve,ft){var Pt=(Me+16)/116,Bt=Pt+Ve/500,Ht=Pt-ft/200;return Bt=Xn(Bt)*qi,Pt=Xn(Pt)*Ui,Ht=Xn(Ht)*Hi,new Ha(Mn(3.2404542*Bt-1.5371385*Pt-.4985314*Ht),Mn(-.969266*Bt+1.8760108*Pt+.041556*Ht),Mn(.0556434*Bt-.2040259*Pt+1.0572252*Ht))}function Gn(Me,Ve,ft){return Me>0?new Zt(Math.atan2(ft,Ve)*At,Math.sqrt(Ve*Ve+ft*ft),Me):new Zt(NaN,NaN,Me)}function Xn(Me){return Me>.206893034?Me*Me*Me:(Me-4/29)/7.787037}function sa(Me){return Me>.008856?Math.pow(Me,1/3):7.787037*Me+4/29}function Mn(Me){return Math.round(255*(Me<=.00304?12.92*Me:1.055*Math.pow(Me,1/2.4)-.055))}d.rgb=Ha;function Ha(Me,Ve,ft){return this instanceof Ha?(this.r=~~Me,this.g=~~Ve,void(this.b=~~ft)):arguments.length<2?Me instanceof Ha?new Ha(Me.r,Me.g,Me.b):ni(""+Me,Ha,na):new Ha(Me,Ve,ft)}function ro(Me){return new Ha(Me>>16,Me>>8&255,Me&255)}function Ft(Me){return ro(Me)+""}var Rt=Ha.prototype=new Sn;Rt.brighter=function(Me){Me=Math.pow(.7,arguments.length?Me:1);var Ve=this.r,ft=this.g,Pt=this.b,Bt=30;return!Ve&&!ft&&!Pt?new Ha(Bt,Bt,Bt):(Ve&&Ve>4,Pt=Pt>>4|Pt,Bt=Or&240,Bt=Bt>>4|Bt,Ht=Or&15,Ht=Ht<<4|Ht):Me.length===7&&(Pt=(Or&16711680)>>16,Bt=(Or&65280)>>8,Ht=Or&255)),Ve(Pt,Bt,Ht))}function oi(Me,Ve,ft){var Pt=Math.min(Me/=255,Ve/=255,ft/=255),Bt=Math.max(Me,Ve,ft),Ht=Bt-Pt,fr,cr,Or=(Bt+Pt)/2;return Ht?(cr=Or<.5?Ht/(Bt+Pt):Ht/(2-Bt-Pt),Me==Bt?fr=(Ve-ft)/Ht+(Ve0&&Or<1?0:fr),new fn(fr,cr,Or)}function Gr(Me,Ve,ft){Me=si(Me),Ve=si(Ve),ft=si(ft);var Pt=sa((.4124564*Me+.3575761*Ve+.1804375*ft)/qi),Bt=sa((.2126729*Me+.7151522*Ve+.072175*ft)/Ui),Ht=sa((.0193339*Me+.119192*Ve+.9503041*ft)/Hi);return Cr(116*Bt-16,500*(Pt-Bt),200*(Bt-Ht))}function si(Me){return(Me/=255)<=.04045?Me/12.92:Math.pow((Me+.055)/1.055,2.4)}function Pi(Me){var Ve=parseFloat(Me);return Me.charAt(Me.length-1)==="%"?Math.round(Ve*2.55):Ve}var yi=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});yi.forEach(function(Me,Ve){yi.set(Me,ro(Ve))});function zt(Me){return typeof Me=="function"?Me:function(){return Me}}d.functor=zt,d.xhr=xr(V);function xr(Me){return function(Ve,ft,Pt){return arguments.length===2&&typeof ft=="function"&&(Pt=ft,ft=null),Jr(Ve,ft,Me,Pt)}}function Jr(Me,Ve,ft,Pt){var Bt={},Ht=d.dispatch("beforesend","progress","load","error"),fr={},cr=new XMLHttpRequest,Or=null;self.XDomainRequest&&!("withCredentials"in cr)&&/^(http(s)?:)?\/\//.test(Me)&&(cr=new XDomainRequest),"onload"in cr?cr.onload=cr.onerror=pi:cr.onreadystatechange=function(){cr.readyState>3&&pi()};function pi(){var ci=cr.status,Bi;if(!ci&&tn(cr)||ci>=200&&ci<300||ci===304){try{Bi=ft.call(Bt,cr)}catch(Yi){Ht.error.call(Bt,Yi);return}Ht.load.call(Bt,Bi)}else Ht.error.call(Bt,cr)}return cr.onprogress=function(ci){var Bi=d.event;d.event=ci;try{Ht.progress.call(Bt,cr)}finally{d.event=Bi}},Bt.header=function(ci,Bi){return ci=(ci+"").toLowerCase(),arguments.length<2?fr[ci]:(Bi==null?delete fr[ci]:fr[ci]=Bi+"",Bt)},Bt.mimeType=function(ci){return arguments.length?(Ve=ci==null?null:ci+"",Bt):Ve},Bt.responseType=function(ci){return arguments.length?(Or=ci,Bt):Or},Bt.response=function(ci){return ft=ci,Bt},["get","post"].forEach(function(ci){Bt[ci]=function(){return Bt.send.apply(Bt,[ci].concat(z(arguments)))}}),Bt.send=function(ci,Bi,Yi){if(arguments.length===2&&typeof Bi=="function"&&(Yi=Bi,Bi=null),cr.open(ci,Me,!0),Ve!=null&&!("accept"in fr)&&(fr.accept=Ve+",*/*"),cr.setRequestHeader)for(var Qi in fr)cr.setRequestHeader(Qi,fr[Qi]);return Ve!=null&&cr.overrideMimeType&&cr.overrideMimeType(Ve),Or!=null&&(cr.responseType=Or),Yi!=null&&Bt.on("error",Yi).on("load",function(ta){Yi(null,ta)}),Ht.beforesend.call(Bt,cr),cr.send(Bi??null),Bt},Bt.abort=function(){return cr.abort(),Bt},d.rebind(Bt,Ht,"on"),Pt==null?Bt:Bt.get(Ri(Pt))}function Ri(Me){return Me.length===1?function(Ve,ft){Me(Ve==null?ft:null)}:Me}function tn(Me){var Ve=Me.responseType;return Ve&&Ve!=="text"?Me.response:Me.responseText}d.dsv=function(Me,Ve){var ft=new RegExp('["'+Me+` -]`),Pt=Me.charCodeAt(0);function Bt(pi,ci,Bi){arguments.length<3&&(Bi=ci,ci=null);var Yi=Jr(pi,Ve,ci==null?Ht:fr(ci),Bi);return Yi.row=function(Qi){return arguments.length?Yi.response((ci=Qi)==null?Ht:fr(Qi)):ci},Yi}function Ht(pi){return Bt.parse(pi.responseText)}function fr(pi){return function(ci){return Bt.parse(ci.responseText,pi)}}Bt.parse=function(pi,ci){var Bi;return Bt.parseRows(pi,function(Yi,Qi){if(Bi)return Bi(Yi,Qi-1);var ta=function(ln){for(var On={},Un=Yi.length,Zn=0;Zn=ta)return Yi;if(Zn)return Zn=!1,Bi;var Ja=ln;if(pi.charCodeAt(Ja)===34){for(var to=Ja;to++24?(isFinite(Ve)&&(clearTimeout(dn),dn=setTimeout(fo,Ve)),Wi=0):(Wi=1,Ua(fo))}d.timer.flush=function(){ho(),Vo()};function ho(){for(var Me=Date.now(),Ve=_n;Ve;)Me>=Ve.t&&Ve.c(Me-Ve.t)&&(Ve.c=null),Ve=Ve.n;return Me}function Vo(){for(var Me,Ve=_n,ft=1/0;Ve;)Ve.c?(Ve.t=0;--cr)ln.push(Bt[pi[Bi[cr]][2]]);for(cr=+Qi;cr1&&Wt(Me[ft[Pt-2]],Me[ft[Pt-1]],Me[Bt])<=0;)--Pt;ft[Pt++]=Bt}return ft.slice(0,Pt)}function ks(Me,Ve){return Me[0]-Ve[0]||Me[1]-Ve[1]}d.geom.polygon=function(Me){return re(Me,fs),Me};var fs=d.geom.polygon.prototype=[];fs.area=function(){for(var Me=-1,Ve=this.length,ft,Pt=this[Ve-1],Bt=0;++Meot)cr=cr.L;else if(fr=Ve-So(cr,ft),fr>ot){if(!cr.R){Pt=cr;break}cr=cr.R}else{Ht>-ot?(Pt=cr.P,Bt=cr):fr>-ot?(Pt=cr,Bt=cr.N):Pt=Bt=cr;break}var Or=Il(Me);if(ol.insert(Pt,Or),!(!Pt&&!Bt)){if(Pt===Bt){Nl(Pt),Bt=Il(Pt.site),ol.insert(Or,Bt),Or.edge=Bt.edge=pu(Pt.site,Or.site),pl(Pt),pl(Bt);return}if(!Bt){Or.edge=pu(Pt.site,Or.site);return}Nl(Pt),Nl(Bt);var pi=Pt.site,ci=pi.x,Bi=pi.y,Yi=Me.x-ci,Qi=Me.y-Bi,ta=Bt.site,ln=ta.x-ci,On=ta.y-Bi,Un=2*(Yi*On-Qi*ln),Zn=Yi*Yi+Qi*Qi,aa=ln*ln+On*On,gn={x:(On*Zn-Qi*aa)/Un+ci,y:(Yi*aa-ln*Zn)/Un+Bi};ls(Bt.edge,pi,ta,gn),Or.edge=pu(pi,Me,null,gn),Bt.edge=pu(Me,ta,null,gn),pl(Pt),pl(Bt)}}function $a(Me,Ve){var ft=Me.site,Pt=ft.x,Bt=ft.y,Ht=Bt-Ve;if(!Ht)return Pt;var fr=Me.P;if(!fr)return-1/0;ft=fr.site;var cr=ft.x,Or=ft.y,pi=Or-Ve;if(!pi)return cr;var ci=cr-Pt,Bi=1/Ht-1/pi,Yi=ci/pi;return Bi?(-Yi+Math.sqrt(Yi*Yi-2*Bi*(ci*ci/(-2*pi)-Or+pi/2+Bt-Ht/2)))/Bi+Pt:(Pt+cr)/2}function So(Me,Ve){var ft=Me.N;if(ft)return $a(ft,Ve);var Pt=Me.site;return Pt.y===Ve?Pt.x:1/0}function Xs(Me){this.site=Me,this.edges=[]}Xs.prototype.prepare=function(){for(var Me=this.edges,Ve=Me.length,ft;Ve--;)ft=Me[Ve].edge,(!ft.b||!ft.a)&&Me.splice(Ve,1);return Me.sort(is),Me.length};function su(Me){for(var Ve=Me[0][0],ft=Me[1][0],Pt=Me[0][1],Bt=Me[1][1],Ht,fr,cr,Or,pi=xl,ci=pi.length,Bi,Yi,Qi,ta,ln,On;ci--;)if(Bi=pi[ci],!(!Bi||!Bi.prepare()))for(Qi=Bi.edges,ta=Qi.length,Yi=0;Yiot||f(Or-fr)>ot)&&(Qi.splice(Yi,0,new Bu(bl(Bi.site,On,f(cr-Ve)ot?{x:Ve,y:f(Ht-Ve)ot?{x:f(fr-Bt)ot?{x:ft,y:f(Ht-ft)ot?{x:f(fr-Pt)=-De)){var Qi=Or*Or+pi*pi,ta=ci*ci+Bi*Bi,ln=(Bi*Qi-pi*ta)/Yi,On=(Or*ta-ci*Qi)/Yi,Bi=On+cr,Un=No.pop()||new tu;Un.arc=Me,Un.site=Bt,Un.x=ln+fr,Un.y=Bi+Math.sqrt(ln*ln+On*On),Un.cy=Bi,Me.circle=Un;for(var Zn=null,aa=Bs._;aa;)if(Un.y0)){if(ln/=Qi,Qi<0){if(ln0){if(ln>Yi)return;ln>Bi&&(Bi=ln)}if(ln=ft-cr,!(!Qi&&ln<0)){if(ln/=Qi,Qi<0){if(ln>Yi)return;ln>Bi&&(Bi=ln)}else if(Qi>0){if(ln0)){if(ln/=ta,ta<0){if(ln0){if(ln>Yi)return;ln>Bi&&(Bi=ln)}if(ln=Pt-Or,!(!ta&&ln<0)){if(ln/=ta,ta<0){if(ln>Yi)return;ln>Bi&&(Bi=ln)}else if(ta>0){if(ln0&&(Bt.a={x:cr+Bi*Qi,y:Or+Bi*ta}),Yi<1&&(Bt.b={x:cr+Yi*Qi,y:Or+Yi*ta}),Bt}}}}}}function bo(Me){for(var Ve=ds,ft=Gu(Me[0][0],Me[0][1],Me[1][0],Me[1][1]),Pt=Ve.length,Bt;Pt--;)Bt=Ve[Pt],(!Ls(Bt,Me)||!ft(Bt)||f(Bt.a.x-Bt.b.x)=Ht)return;if(ci>Yi){if(!Pt)Pt={x:ta,y:fr};else if(Pt.y>=cr)return;ft={x:ta,y:cr}}else{if(!Pt)Pt={x:ta,y:cr};else if(Pt.y1)if(ci>Yi){if(!Pt)Pt={x:(fr-Un)/On,y:fr};else if(Pt.y>=cr)return;ft={x:(cr-Un)/On,y:cr}}else{if(!Pt)Pt={x:(cr-Un)/On,y:cr};else if(Pt.y=Ht)return;ft={x:Ht,y:On*Ht+Un}}else{if(!Pt)Pt={x:Ht,y:On*Ht+Un};else if(Pt.x=ci&&Un.x<=Yi&&Un.y>=Bi&&Un.y<=Qi?[[ci,Qi],[Yi,Qi],[Yi,Bi],[ci,Bi]]:[];Zn.point=Or[ln]}),pi}function cr(Or){return Or.map(function(pi,ci){return{x:Math.round(Pt(pi,ci)/ot)*ot,y:Math.round(Bt(pi,ci)/ot)*ot,i:ci}})}return fr.links=function(Or){return pc(cr(Or)).edges.filter(function(pi){return pi.l&&pi.r}).map(function(pi){return{source:Or[pi.l.i],target:Or[pi.r.i]}})},fr.triangles=function(Or){var pi=[];return pc(cr(Or)).cells.forEach(function(ci,Bi){for(var Yi=ci.site,Qi=ci.edges.sort(is),ta=-1,ln=Qi.length,On,Un,Zn=Qi[ln-1].edge,aa=Zn.l===Yi?Zn.r:Zn.l;++taaa&&(aa=ci.x),ci.y>gn&&(gn=ci.y),Qi.push(ci.x),ta.push(ci.y);else for(ln=0;lnaa&&(aa=Ja),to>gn&&(gn=to),Qi.push(Ja),ta.push(to)}var yo=aa-Un,jo=gn-Zn;yo>jo?gn=Zn+yo:aa=Un+jo;function qo(ts,ws,Dl,ac,bu,Eo,el,fl){if(!(isNaN(Dl)||isNaN(ac)))if(ts.leaf){var vu=ts.x,nu=ts.y;if(vu!=null)if(f(vu-Dl)+f(nu-ac)<.01)Xo(ts,ws,Dl,ac,bu,Eo,el,fl);else{var dh=ts.point;ts.x=ts.y=ts.point=null,Xo(ts,dh,vu,nu,bu,Eo,el,fl),Xo(ts,ws,Dl,ac,bu,Eo,el,fl)}else ts.x=Dl,ts.y=ac,ts.point=ws}else Xo(ts,ws,Dl,ac,bu,Eo,el,fl)}function Xo(ts,ws,Dl,ac,bu,Eo,el,fl){var vu=(bu+el)*.5,nu=(Eo+fl)*.5,dh=Dl>=vu,Zl=ac>=nu,cu=Zl<<1|dh;ts.leaf=!1,ts=ts.nodes[cu]||(ts.nodes[cu]=Vl()),dh?bu=vu:el=vu,Zl?Eo=nu:fl=nu,qo(ts,ws,Dl,ac,bu,Eo,el,fl)}var ml=Vl();if(ml.add=function(ts){qo(ml,ts,+Bi(ts,++ln),+Yi(ts,ln),Un,Zn,aa,gn)},ml.visit=function(ts){Kc(ts,ml,Un,Zn,aa,gn)},ml.find=function(ts){return ed(ml,ts[0],ts[1],Un,Zn,aa,gn)},ln=-1,Ve==null){for(;++lnHt||Yi>fr||Qi=Ja,jo=ft>=to,qo=jo<<1|yo,Xo=qo+4;qoft&&(Ht=Ve.slice(ft,Ht),cr[fr]?cr[fr]+=Ht:cr[++fr]=Ht),(Pt=Pt[0])===(Bt=Bt[0])?cr[fr]?cr[fr]+=Bt:cr[++fr]=Bt:(cr[++fr]=null,Or.push({i:fr,x:bc(Pt,Bt)})),ft=gc.lastIndex;return ft=0&&!(Pt=d.interpolators[ft](Me,Ve)););return Pt}d.interpolators=[function(Me,Ve){var ft=typeof Ve;return(ft==="string"?yi.has(Ve.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Ve)?xc:vh:Ve instanceof Sn?xc:Array.isArray(Ve)?ru:ft==="object"&&isNaN(Ve)?mc:bc)(Me,Ve)}],d.interpolateArray=ru;function ru(Me,Ve){var ft=[],Pt=[],Bt=Me.length,Ht=Ve.length,fr=Math.min(Me.length,Ve.length),cr;for(cr=0;cr=0?Me.slice(0,Ve):Me,Pt=Ve>=0?Me.slice(Ve+1):"in";return ft=jc.get(ft)||Fh,Pt=Jh.get(Pt)||V,Mu(Pt(ft.apply(null,y.call(arguments,1))))};function Mu(Me){return function(Ve){return Ve<=0?0:Ve>=1?1:Me(Ve)}}function Yd(Me){return function(Ve){return 1-Me(1-Ve)}}function sl(Me){return function(Ve){return .5*(Ve<.5?Me(2*Ve):2-Me(2-2*Ve))}}function hp(Me){return Me*Me}function jl(Me){return Me*Me*Me}function os(Me){if(Me<=0)return 0;if(Me>=1)return 1;var Ve=Me*Me,ft=Ve*Me;return 4*(Me<.5?ft:3*(Me-Ve)+ft-.75)}function _f(Me){return function(Ve){return Math.pow(Ve,Me)}}function yh(Me){return 1-Math.cos(Me*at)}function hc(Me){return Math.pow(2,10*(Me-1))}function td(Me){return 1-Math.sqrt(1-Me*Me)}function Qh(Me,Ve){var ft;return arguments.length<2&&(Ve=.45),arguments.length?ft=Ve/Pe*Math.asin(1/Me):(Me=1,ft=Ve/4),function(Pt){return 1+Me*Math.pow(2,-10*Pt)*Math.sin((Pt-ft)*Pe/Ve)}}function Ef(Me){return Me||(Me=1.70158),function(Ve){return Ve*Ve*((Me+1)*Ve-Me)}}function vc(Me){return Me<1/2.75?7.5625*Me*Me:Me<2/2.75?7.5625*(Me-=1.5/2.75)*Me+.75:Me<2.5/2.75?7.5625*(Me-=2.25/2.75)*Me+.9375:7.5625*(Me-=2.625/2.75)*Me+.984375}d.interpolateHcl=Ld;function Ld(Me,Ve){Me=d.hcl(Me),Ve=d.hcl(Ve);var ft=Me.h,Pt=Me.c,Bt=Me.l,Ht=Ve.h-ft,fr=Ve.c-Pt,cr=Ve.l-Bt;return isNaN(fr)&&(fr=0,Pt=isNaN(Pt)?Ve.c:Pt),isNaN(Ht)?(Ht=0,ft=isNaN(ft)?Ve.h:ft):Ht>180?Ht-=360:Ht<-180&&(Ht+=360),function(Or){return _r(ft+Ht*Or,Pt+fr*Or,Bt+cr*Or)+""}}d.interpolateHsl=cd;function cd(Me,Ve){Me=d.hsl(Me),Ve=d.hsl(Ve);var ft=Me.h,Pt=Me.s,Bt=Me.l,Ht=Ve.h-ft,fr=Ve.s-Pt,cr=Ve.l-Bt;return isNaN(fr)&&(fr=0,Pt=isNaN(Pt)?Ve.s:Pt),isNaN(Ht)?(Ht=0,ft=isNaN(ft)?Ve.h:ft):Ht>180?Ht-=360:Ht<-180&&(Ht+=360),function(Or){return na(ft+Ht*Or,Pt+fr*Or,Bt+cr*Or)+""}}d.interpolateLab=Lf;function Lf(Me,Ve){Me=d.lab(Me),Ve=d.lab(Ve);var ft=Me.l,Pt=Me.a,Bt=Me.b,Ht=Ve.l-ft,fr=Ve.a-Pt,cr=Ve.b-Bt;return function(Or){return Rn(ft+Ht*Or,Pt+fr*Or,Bt+cr*Or)+""}}d.interpolateRound=ef;function ef(Me,Ve){return Ve-=Me,function(ft){return Math.round(Me+Ve*ft)}}d.transform=function(Me){var Ve=P.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(ft){if(ft!=null){Ve.setAttribute("transform",ft);var Pt=Ve.transform.baseVal.consolidate()}return new rd(Pt?Pt.matrix:Nh)})(Me)};function rd(Me){var Ve=[Me.a,Me.b],ft=[Me.c,Me.d],Pt=_h(Ve),Bt=id(Ve,ft),Ht=_h(hd(ft,Ve,-Bt))||0;Ve[0]*ft[1]180?Ve+=360:Ve-Me>180&&(Me+=360),Pt.push({i:ft.push(Mh(ft)+"rotate(",null,")")-2,x:bc(Me,Ve)})):Ve&&ft.push(Mh(ft)+"rotate("+Ve+")")}function nd(Me,Ve,ft,Pt){Me!==Ve?Pt.push({i:ft.push(Mh(ft)+"skewX(",null,")")-2,x:bc(Me,Ve)}):Ve&&ft.push(Mh(ft)+"skewX("+Ve+")")}function uu(Me,Ve,ft,Pt){if(Me[0]!==Ve[0]||Me[1]!==Ve[1]){var Bt=ft.push(Mh(ft)+"scale(",null,",",null,")");Pt.push({i:Bt-4,x:bc(Me[0],Ve[0])},{i:Bt-2,x:bc(Me[1],Ve[1])})}else(Ve[0]!==1||Ve[1]!==1)&&ft.push(Mh(ft)+"scale("+Ve+")")}function Nf(Me,Ve){var ft=[],Pt=[];return Me=d.transform(Me),Ve=d.transform(Ve),yc(Me.translate,Ve.translate,ft,Pt),df(Me.rotate,Ve.rotate,ft,Pt),nd(Me.skew,Ve.skew,ft,Pt),uu(Me.scale,Ve.scale,ft,Pt),Me=Ve=null,function(Bt){for(var Ht=-1,fr=Pt.length,cr;++Ht0?Ht=gn:(ft.c=null,ft.t=NaN,ft=null,Ve.end({type:"end",alpha:Ht=0})):gn>0&&(Ve.start({type:"start",alpha:Ht=gn}),ft=ea(Me.tick)),Me):Ht},Me.start=function(){var gn,Ja=Qi.length,to=ta.length,yo=Pt[0],jo=Pt[1],qo,Xo;for(gn=0;gn=0;)Ht.push(ci=pi[Or]),ci.parent=cr,ci.depth=cr.depth+1;ft&&(cr.value=0),cr.children=pi}else ft&&(cr.value=+ft.call(Pt,cr,cr.depth)||0),delete cr.children;return Eh(Bt,function(Bi){var Yi,Qi;Me&&(Yi=Bi.children)&&Yi.sort(Me),ft&&(Qi=Bi.parent)&&(Qi.value+=Bi.value)}),fr}return Pt.sort=function(Bt){return arguments.length?(Me=Bt,Pt):Me},Pt.children=function(Bt){return arguments.length?(Ve=Bt,Pt):Ve},Pt.value=function(Bt){return arguments.length?(ft=Bt,Pt):ft},Pt.revalue=function(Bt){return ft&&(xf(Bt,function(Ht){Ht.children&&(Ht.value=0)}),Eh(Bt,function(Ht){var fr;Ht.children||(Ht.value=+ft.call(Pt,Ht,Ht.depth)||0),(fr=Ht.parent)&&(fr.value+=Ht.value)})),Bt},Pt};function Eu(Me,Ve){return d.rebind(Me,Ve,"sort","children","value"),Me.nodes=Me,Me.links=Tp,Me}function xf(Me,Ve){for(var ft=[Me];(Me=ft.pop())!=null;)if(Ve(Me),(Bt=Me.children)&&(Pt=Bt.length))for(var Pt,Bt;--Pt>=0;)ft.push(Bt[Pt])}function Eh(Me,Ve){for(var ft=[Me],Pt=[];(Me=ft.pop())!=null;)if(Pt.push(Me),(fr=Me.children)&&(Ht=fr.length))for(var Bt=-1,Ht,fr;++BtBt&&(Bt=cr),Pt.push(cr)}for(fr=0;frPt&&(ft=Ve,Pt=Bt);return ft}function Uh(Me){return Me.reduce(Qc,0)}function Qc(Me,Ve){return Me+Ve[1]}d.layout.histogram=function(){var Me=!0,Ve=Number,ft=If,Pt=Pd;function Bt(Ht,fr){for(var cr=[],Or=Ht.map(Ve,this),pi=ft.call(this,Or,fr),ci=Pt.call(this,pi,Or,fr),Bi,fr=-1,Yi=Or.length,Qi=ci.length-1,ta=Me?1:1/Yi,ln;++fr0)for(fr=-1;++fr=pi[0]&&ln<=pi[1]&&(Bi=cr[d.bisect(ci,ln,1,Qi)-1],Bi.y+=ta,Bi.push(Ht[fr]));return cr}return Bt.value=function(Ht){return arguments.length?(Ve=Ht,Bt):Ve},Bt.range=function(Ht){return arguments.length?(ft=zt(Ht),Bt):ft},Bt.bins=function(Ht){return arguments.length?(Pt=typeof Ht=="number"?function(fr){return Cu(fr,Ht)}:zt(Ht),Bt):Pt},Bt.frequency=function(Ht){return arguments.length?(Me=!!Ht,Bt):Me},Bt};function Pd(Me,Ve){return Cu(Me,Math.ceil(Math.log(Ve.length)/Math.LN2+1))}function Cu(Me,Ve){for(var ft=-1,Pt=+Me[0],Bt=(Me[1]-Pt)/Ve,Ht=[];++ft<=Ve;)Ht[ft]=Bt*ft+Pt;return Ht}function If(Me){return[d.min(Me),d.max(Me)]}d.layout.pack=function(){var Me=d.layout.hierarchy().sort(nf),Ve=0,ft=[1,1],Pt;function Bt(Ht,fr){var cr=Me.call(this,Ht,fr),Or=cr[0],pi=ft[0],ci=ft[1],Bi=Pt==null?Math.sqrt:typeof Pt=="function"?Pt:function(){return Pt};if(Or.x=Or.y=0,Eh(Or,function(Qi){Qi.r=+Bi(Qi.value)}),Eh(Or,Df),Ve){var Yi=Ve*(Pt?1:Math.max(2*Or.r/pi,2*Or.r/ci))/2;Eh(Or,function(Qi){Qi.r+=Yi}),Eh(Or,Df),Eh(Or,function(Qi){Qi.r-=Yi})}return md(Or,pi/2,ci/2,Pt?1:1/Math.max(2*Or.r/pi,2*Or.r/ci)),cr}return Bt.size=function(Ht){return arguments.length?(ft=Ht,Bt):ft},Bt.radius=function(Ht){return arguments.length?(Pt=Ht==null||typeof Ht=="function"?Ht:+Ht,Bt):Pt},Bt.padding=function(Ht){return arguments.length?(Ve=+Ht,Bt):Ve},Eu(Bt,Me)};function nf(Me,Ve){return Me.value-Ve.value}function hh(Me,Ve){var ft=Me._pack_next;Me._pack_next=Ve,Ve._pack_prev=Me,Ve._pack_next=ft,ft._pack_prev=Ve}function pf(Me,Ve){Me._pack_next=Ve,Ve._pack_prev=Me}function af(Me,Ve){var ft=Ve.x-Me.x,Pt=Ve.y-Me.y,Bt=Me.r+Ve.r;return .999*Bt*Bt>ft*ft+Pt*Pt}function Df(Me){if(!(Ve=Me.children)||!(Yi=Ve.length))return;var Ve,ft=1/0,Pt=-1/0,Bt=1/0,Ht=-1/0,fr,cr,Or,pi,ci,Bi,Yi;function Qi(gn){ft=Math.min(gn.x-gn.r,ft),Pt=Math.max(gn.x+gn.r,Pt),Bt=Math.min(gn.y-gn.r,Bt),Ht=Math.max(gn.y+gn.r,Ht)}if(Ve.forEach(Qd),fr=Ve[0],fr.x=-fr.r,fr.y=0,Qi(fr),Yi>1&&(cr=Ve[1],cr.x=cr.r,cr.y=0,Qi(cr),Yi>2))for(Or=Ve[2],fh(fr,cr,Or),Qi(Or),hh(fr,Or),fr._pack_prev=Or,hh(Or,cr),cr=fr._pack_next,pi=3;piOn.x&&(On=Ja),Ja.depth>Un.depth&&(Un=Ja)});var Zn=Ve(ln,On)/2-ln.x,aa=ft[0]/(On.x+Ve(On,ln)/2+Zn),gn=ft[1]/(Un.depth||1);xf(Qi,function(Ja){Ja.x=(Ja.x+Zn)*aa,Ja.y=Ja.depth*gn})}return Yi}function Ht(ci){for(var Bi={A:null,children:[ci]},Yi=[Bi],Qi;(Qi=Yi.pop())!=null;)for(var ta=Qi.children,ln,On=0,Un=ta.length;On0&&(fu(Tf(ln,ci,Yi),ci,Ja),Un+=Ja,Zn+=Ja),aa+=ln.m,Un+=Qi.m,gn+=On.m,Zn+=ta.m;ln&&!Zu(ta)&&(ta.t=ln,ta.m+=aa-Zn),Qi&&!Ph(On)&&(On.t=Qi,On.m+=Un-gn,Yi=ci)}return Yi}function pi(ci){ci.x*=ft[0],ci.y=ci.depth*ft[1]}return Bt.separation=function(ci){return arguments.length?(Ve=ci,Bt):Ve},Bt.size=function(ci){return arguments.length?(Pt=(ft=ci)==null?pi:null,Bt):Pt?null:ft},Bt.nodeSize=function(ci){return arguments.length?(Pt=(ft=ci)==null?null:pi,Bt):Pt?ft:null},Eu(Bt,Me)};function $h(Me,Ve){return Me.parent==Ve.parent?1:2}function Ph(Me){var Ve=Me.children;return Ve.length?Ve[0]:Me.t}function Zu(Me){var Ve=Me.children,ft;return(ft=Ve.length)?Ve[ft-1]:Me.t}function fu(Me,Ve,ft){var Pt=ft/(Ve.i-Me.i);Ve.c-=Pt,Ve.s+=ft,Me.c+=Pt,Ve.z+=ft,Ve.m+=ft}function Ih(Me){for(var Ve=0,ft=0,Pt=Me.children,Bt=Pt.length,Ht;--Bt>=0;)Ht=Pt[Bt],Ht.z+=Ve,Ht.m+=Ve,Ve+=Ht.s+(ft+=Ht.c)}function Tf(Me,Ve,ft){return Me.a.parent===Ve.parent?Me.a:ft}d.layout.cluster=function(){var Me=d.layout.hierarchy().sort(null).value(null),Ve=$h,ft=[1,1],Pt=!1;function Bt(Ht,fr){var cr=Me.call(this,Ht,fr),Or=cr[0],pi,ci=0;Eh(Or,function(ln){var On=ln.children;On&&On.length?(ln.x=ad(On),ln.y=Dh(On)):(ln.x=pi?ci+=Ve(ln,pi):0,ln.y=0,pi=ln)});var Bi=wr(Or),Yi=Yr(Or),Qi=Bi.x-Ve(Bi,Yi)/2,ta=Yi.x+Ve(Yi,Bi)/2;return Eh(Or,Pt?function(ln){ln.x=(ln.x-Or.x)*ft[0],ln.y=(Or.y-ln.y)*ft[1]}:function(ln){ln.x=(ln.x-Qi)/(ta-Qi)*ft[0],ln.y=(1-(Or.y?ln.y/Or.y:1))*ft[1]}),cr}return Bt.separation=function(Ht){return arguments.length?(Ve=Ht,Bt):Ve},Bt.size=function(Ht){return arguments.length?(Pt=(ft=Ht)==null,Bt):Pt?null:ft},Bt.nodeSize=function(Ht){return arguments.length?(Pt=(ft=Ht)!=null,Bt):Pt?ft:null},Eu(Bt,Me)};function Dh(Me){return 1+d.max(Me,function(Ve){return Ve.y})}function ad(Me){return Me.reduce(function(Ve,ft){return Ve+ft.x},0)/Me.length}function wr(Me){var Ve=Me.children;return Ve&&Ve.length?wr(Ve[0]):Me}function Yr(Me){var Ve=Me.children,ft;return Ve&&(ft=Ve.length)?Yr(Ve[ft-1]):Me}d.layout.treemap=function(){var Me=d.layout.hierarchy(),Ve=Math.round,ft=[1,1],Pt=null,Bt=Ni,Ht=!1,fr,cr="squarify",Or=.5*(1+Math.sqrt(5));function pi(ln,On){for(var Un=-1,Zn=ln.length,aa,gn;++Un0;)Zn.push(gn=aa[jo-1]),Zn.area+=gn.area,cr!=="squarify"||(to=Yi(Zn,yo))<=Ja?(aa.pop(),Ja=to):(Zn.area-=Zn.pop().area,Qi(Zn,yo,Un,!1),yo=Math.min(Un.dx,Un.dy),Zn.length=Zn.area=0,Ja=1/0);Zn.length&&(Qi(Zn,yo,Un,!0),Zn.length=Zn.area=0),On.forEach(ci)}}function Bi(ln){var On=ln.children;if(On&&On.length){var Un=Bt(ln),Zn=On.slice(),aa,gn=[];for(pi(Zn,Un.dx*Un.dy/ln.value),gn.area=0;aa=Zn.pop();)gn.push(aa),gn.area+=aa.area,aa.z!=null&&(Qi(gn,aa.z?Un.dx:Un.dy,Un,!Zn.length),gn.length=gn.area=0);On.forEach(Bi)}}function Yi(ln,On){for(var Un=ln.area,Zn,aa=0,gn=1/0,Ja=-1,to=ln.length;++Jaaa&&(aa=Zn));return Un*=Un,On*=On,Un?Math.max(On*aa*Or/Un,Un/(On*gn*Or)):1/0}function Qi(ln,On,Un,Zn){var aa=-1,gn=ln.length,Ja=Un.x,to=Un.y,yo=On?Ve(ln.area/On):0,jo;if(On==Un.dx){for((Zn||yo>Un.dy)&&(yo=Un.dy);++aaUn.dx)&&(yo=Un.dx);++aa1);return Me+Ve*Pt*Math.sqrt(-2*Math.log(Ht)/Ht)}},logNormal:function(){var Me=d.random.normal.apply(d,arguments);return function(){return Math.exp(Me())}},bates:function(Me){var Ve=d.random.irwinHall(Me);return function(){return Ve()/Me}},irwinHall:function(Me){return function(){for(var Ve=0,ft=0;ft2?xa:pa,pi=Pt?fd:Xd;return Bt=Or(Me,Ve,pi,ft),Ht=Or(Ve,Me,pi,hl),cr}function cr(Or){return Bt(Or)}return cr.invert=function(Or){return Ht(Or)},cr.domain=function(Or){return arguments.length?(Me=Or.map(Number),fr()):Me},cr.range=function(Or){return arguments.length?(Ve=Or,fr()):Ve},cr.rangeRound=function(Or){return cr.range(Or).interpolate(ef)},cr.clamp=function(Or){return arguments.length?(Pt=Or,fr()):Pt},cr.interpolate=function(Or){return arguments.length?(ft=Or,fr()):ft},cr.ticks=function(Or){return hs(Me,Or)},cr.tickFormat=function(Or,pi){return d3_scale_linearTickFormat(Me,Or,pi)},cr.nice=function(Or){return fa(Me,Or),fr()},cr.copy=function(){return Va(Me,Ve,ft,Pt)},fr()}function Oa(Me,Ve){return d.rebind(Me,Ve,"range","rangeRound","interpolate","clamp")}function fa(Me,Ve){return Ea(Me,Za(vo(Me,Ve)[2])),Ea(Me,Za(vo(Me,Ve)[2])),Me}function vo(Me,Ve){Ve==null&&(Ve=10);var ft=hn(Me),Pt=ft[1]-ft[0],Bt=Math.pow(10,Math.floor(Math.log(Pt/Ve)/Math.LN10)),Ht=Ve/Pt*Bt;return Ht<=.15?Bt*=10:Ht<=.35?Bt*=5:Ht<=.75&&(Bt*=2),ft[0]=Math.ceil(ft[0]/Bt)*Bt,ft[1]=Math.floor(ft[1]/Bt)*Bt+Bt*.5,ft[2]=Bt,ft}function hs(Me,Ve){return d.range.apply(d,vo(Me,Ve))}d.scale.log=function(){return rs(d.scale.linear().domain([0,1]),10,!0,[1,10])};function rs(Me,Ve,ft,Pt){function Bt(cr){return(ft?Math.log(cr<0?0:cr):-Math.log(cr>0?0:-cr))/Math.log(Ve)}function Ht(cr){return ft?Math.pow(Ve,cr):-Math.pow(Ve,-cr)}function fr(cr){return Me(Bt(cr))}return fr.invert=function(cr){return Ht(Me.invert(cr))},fr.domain=function(cr){return arguments.length?(ft=cr[0]>=0,Me.domain((Pt=cr.map(Number)).map(Bt)),fr):Pt},fr.base=function(cr){return arguments.length?(Ve=+cr,Me.domain(Pt.map(Bt)),fr):Ve},fr.nice=function(){var cr=Ea(Pt.map(Bt),ft?Math:ps);return Me.domain(cr),Pt=cr.map(Ht),fr},fr.ticks=function(){var cr=hn(Pt),Or=[],pi=cr[0],ci=cr[1],Bi=Math.floor(Bt(pi)),Yi=Math.ceil(Bt(ci)),Qi=Ve%1?2:Ve;if(isFinite(Yi-Bi)){if(ft){for(;Bi0;ta--)Or.push(Ht(Bi)*ta);for(Bi=0;Or[Bi]ci;Yi--);Or=Or.slice(Bi,Yi)}return Or},fr.copy=function(){return rs(Me.copy(),Ve,ft,Pt)},Oa(fr,Me)}var ps={floor:function(Me){return-Math.ceil(-Me)},ceil:function(Me){return-Math.floor(-Me)}};d.scale.pow=function(){return xs(d.scale.linear(),1,[0,1])};function xs(Me,Ve,ft){var Pt=_o(Ve),Bt=_o(1/Ve);function Ht(fr){return Me(Pt(fr))}return Ht.invert=function(fr){return Bt(Me.invert(fr))},Ht.domain=function(fr){return arguments.length?(Me.domain((ft=fr.map(Number)).map(Pt)),Ht):ft},Ht.ticks=function(fr){return hs(ft,fr)},Ht.tickFormat=function(fr,cr){return d3_scale_linearTickFormat(ft,fr,cr)},Ht.nice=function(fr){return Ht.domain(fa(ft,fr))},Ht.exponent=function(fr){return arguments.length?(Pt=_o(Ve=fr),Bt=_o(1/Ve),Me.domain(ft.map(Pt)),Ht):Ve},Ht.copy=function(){return xs(Me.copy(),Ve,ft)},Oa(Ht,Me)}function _o(Me){return function(Ve){return Ve<0?-Math.pow(-Ve,Me):Math.pow(Ve,Me)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return io([],{t:"range",a:[[]]})};function io(Me,Ve){var ft,Pt,Bt;function Ht(cr){return Pt[((ft.get(cr)||(Ve.t==="range"?ft.set(cr,Me.push(cr)):NaN))-1)%Pt.length]}function fr(cr,Or){return d.range(Me.length).map(function(pi){return cr+Or*pi})}return Ht.domain=function(cr){if(!arguments.length)return Me;Me=[],ft=new D;for(var Or=-1,pi=cr.length,ci;++Or0?ft[Ht-1]:Me[0],HtYi?0:1;if(ci=He)return Or(ci,ta)+(pi?Or(pi,1-ta):"")+"Z";var ln,On,Un,Zn,aa=0,gn=0,Ja,to,yo,jo,qo,Xo,ml,ts,ws=[];if((Zn=(+fr.apply(this,arguments)||0)/2)&&(Un=Pt===xu?Math.sqrt(pi*pi+ci*ci):+Pt.apply(this,arguments),ta||(gn*=-1),ci&&(gn=Kt(Un/ci*Math.sin(Zn))),pi&&(aa=Kt(Un/pi*Math.sin(Zn)))),ci){Ja=ci*Math.cos(Bi+gn),to=ci*Math.sin(Bi+gn),yo=ci*Math.cos(Yi-gn),jo=ci*Math.sin(Yi-gn);var Dl=Math.abs(Yi-Bi-2*gn)<=ye?0:1;if(gn&&eh(Ja,to,yo,jo)===ta^Dl){var ac=(Bi+Yi)/2;Ja=ci*Math.cos(ac),to=ci*Math.sin(ac),yo=jo=null}}else Ja=to=0;if(pi){qo=pi*Math.cos(Yi-aa),Xo=pi*Math.sin(Yi-aa),ml=pi*Math.cos(Bi+aa),ts=pi*Math.sin(Bi+aa);var bu=Math.abs(Bi-Yi+2*aa)<=ye?0:1;if(aa&&eh(qo,Xo,ml,ts)===1-ta^bu){var Eo=(Bi+Yi)/2;qo=pi*Math.cos(Eo),Xo=pi*Math.sin(Eo),ml=ts=null}}else qo=Xo=0;if(Qi>ot&&(ln=Math.min(Math.abs(ci-pi)/2,+ft.apply(this,arguments)))>.001){On=pi0?0:1}function Uc(Me,Ve,ft,Pt,Bt){var Ht=Me[0]-Ve[0],fr=Me[1]-Ve[1],cr=(Bt?Pt:-Pt)/Math.sqrt(Ht*Ht+fr*fr),Or=cr*fr,pi=-cr*Ht,ci=Me[0]+Or,Bi=Me[1]+pi,Yi=Ve[0]+Or,Qi=Ve[1]+pi,ta=(ci+Yi)/2,ln=(Bi+Qi)/2,On=Yi-ci,Un=Qi-Bi,Zn=On*On+Un*Un,aa=ft-Pt,gn=ci*Qi-Yi*Bi,Ja=(Un<0?-1:1)*Math.sqrt(Math.max(0,aa*aa*Zn-gn*gn)),to=(gn*Un-On*Ja)/Zn,yo=(-gn*On-Un*Ja)/Zn,jo=(gn*Un+On*Ja)/Zn,qo=(-gn*On+Un*Ja)/Zn,Xo=to-ta,ml=yo-ln,ts=jo-ta,ws=qo-ln;return Xo*Xo+ml*ml>ts*ts+ws*ws&&(to=jo,yo=qo),[[to-Or,yo-pi],[to*ft/aa,yo*ft/aa]]}function Hh(){return!0}function th(Me){var Ve=Ao,ft=Wo,Pt=Hh,Bt=Wu,Ht=Bt.key,fr=.7;function cr(Or){var pi=[],ci=[],Bi=-1,Yi=Or.length,Qi,ta=zt(Ve),ln=zt(ft);function On(){pi.push("M",Bt(Me(ci),fr))}for(;++Bi1?Me.join("L"):Me+"Z"}function Wh(Me){return Me.join("L")+"Z"}function cs(Me){for(var Ve=0,ft=Me.length,Pt=Me[0],Bt=[Pt[0],",",Pt[1]];++Ve1&&Bt.push("H",Pt[0]),Bt.join("")}function Fs(Me){for(var Ve=0,ft=Me.length,Pt=Me[0],Bt=[Pt[0],",",Pt[1]];++Ve1){cr=Ve[1],Ht=Me[Or],Or++,Pt+="C"+(Bt[0]+fr[0])+","+(Bt[1]+fr[1])+","+(Ht[0]-cr[0])+","+(Ht[1]-cr[1])+","+Ht[0]+","+Ht[1];for(var pi=2;pi9&&(Ht=ft*3/Math.sqrt(Ht),fr[cr]=Ht*Pt,fr[cr+1]=Ht*Bt));for(cr=-1;++cr<=Or;)Ht=(Me[Math.min(Or,cr+1)][0]-Me[Math.max(0,cr-1)][0])/(6*(1+fr[cr]*fr[cr])),Ve.push([Ht||0,fr[cr]*Ht||0]);return Ve}function lt(Me){return Me.length<3?Wu(Me):Me[0]+O(Me,tt(Me))}d.svg.line.radial=function(){var Me=th(Tt);return Me.radius=Me.x,delete Me.x,Me.angle=Me.y,delete Me.y,Me};function Tt(Me){for(var Ve,ft=-1,Pt=Me.length,Bt,Ht;++ftye)+",1 "+Bi}function pi(ci,Bi,Yi,Qi){return"Q 0,0 "+Qi}return Ht.radius=function(ci){return arguments.length?(ft=zt(ci),Ht):ft},Ht.source=function(ci){return arguments.length?(Me=zt(ci),Ht):Me},Ht.target=function(ci){return arguments.length?(Ve=zt(ci),Ht):Ve},Ht.startAngle=function(ci){return arguments.length?(Pt=zt(ci),Ht):Pt},Ht.endAngle=function(ci){return arguments.length?(Bt=zt(ci),Ht):Bt},Ht};function Yt(Me){return Me.radius}d.svg.diagonal=function(){var Me=Vt,Ve=Nt,ft=Lr;function Pt(Bt,Ht){var fr=Me.call(this,Bt,Ht),cr=Ve.call(this,Bt,Ht),Or=(fr.y+cr.y)/2,pi=[fr,{x:fr.x,y:Or},{x:cr.x,y:Or},cr];return pi=pi.map(ft),"M"+pi[0]+"C"+pi[1]+" "+pi[2]+" "+pi[3]}return Pt.source=function(Bt){return arguments.length?(Me=zt(Bt),Pt):Me},Pt.target=function(Bt){return arguments.length?(Ve=zt(Bt),Pt):Ve},Pt.projection=function(Bt){return arguments.length?(ft=Bt,Pt):ft},Pt};function Lr(Me){return[Me.x,Me.y]}d.svg.diagonal.radial=function(){var Me=d.svg.diagonal(),Ve=Lr,ft=Me.projection;return Me.projection=function(Pt){return arguments.length?ft($r(Ve=Pt)):Ve},Me};function $r(Me){return function(){var Ve=Me.apply(this,arguments),ft=Ve[0],Pt=Ve[1]-at;return[ft*Math.cos(Pt),ft*Math.sin(Pt)]}}d.svg.symbol=function(){var Me=di,Ve=Zr;function ft(Pt,Bt){return(Ki.get(Me.call(this,Pt,Bt))||zi)(Ve.call(this,Pt,Bt))}return ft.type=function(Pt){return arguments.length?(Me=zt(Pt),ft):Me},ft.size=function(Pt){return arguments.length?(Ve=zt(Pt),ft):Ve},ft};function Zr(){return 64}function di(){return"circle"}function zi(Me){var Ve=Math.sqrt(Me/ye);return"M0,"+Ve+"A"+Ve+","+Ve+" 0 1,1 0,"+-Ve+"A"+Ve+","+Ve+" 0 1,1 0,"+Ve+"Z"}var Ki=d.map({circle:zi,cross:function(Me){var Ve=Math.sqrt(Me/5)/2;return"M"+-3*Ve+","+-Ve+"H"+-Ve+"V"+-3*Ve+"H"+Ve+"V"+-Ve+"H"+3*Ve+"V"+Ve+"H"+Ve+"V"+3*Ve+"H"+-Ve+"V"+Ve+"H"+-3*Ve+"Z"},diamond:function(Me){var Ve=Math.sqrt(Me/(2*kn)),ft=Ve*kn;return"M0,"+-Ve+"L"+ft+",0 0,"+Ve+" "+-ft+",0Z"},square:function(Me){var Ve=Math.sqrt(Me)/2;return"M"+-Ve+","+-Ve+"L"+Ve+","+-Ve+" "+Ve+","+Ve+" "+-Ve+","+Ve+"Z"},"triangle-down":function(Me){var Ve=Math.sqrt(Me/nn),ft=Ve*nn/2;return"M0,"+ft+"L"+Ve+","+-ft+" "+-Ve+","+-ft+"Z"},"triangle-up":function(Me){var Ve=Math.sqrt(Me/nn),ft=Ve*nn/2;return"M0,"+-ft+"L"+Ve+","+ft+" "+-Ve+","+ft+"Z"}});d.svg.symbolTypes=Ki.keys();var nn=Math.sqrt(3),kn=Math.tan(30*ht);oe.transition=function(Me){for(var Ve=Go||++xo,ft=Al(Me),Pt=[],Bt,Ht,fr=Bo||{time:Date.now(),ease:os,delay:0,duration:250},cr=-1,Or=this.length;++cr0;)Bi[--Zn].call(Me,Un);if(On>=1)return fr.event&&fr.event.end.call(Me,Me.__data__,Ve),--Ht.count?delete Ht[Pt]:delete Me[ft],1}fr||(cr=Bt.time,Or=ea(Yi,0,cr),fr=Ht[Pt]={tween:new D,time:cr,timer:Or,delay:Bt.delay,duration:Bt.duration,ease:Bt.ease,index:Ve},Bt=null,++Ht.count)}d.svg.axis=function(){var Me=d.scale.linear(),Ve=Pl,ft=6,Pt=6,Bt=3,Ht=[10],fr=null,cr;function Or(pi){pi.each(function(){var ci=d.select(this),Bi=this.__chart__||Me,Yi=this.__chart__=Me.copy(),Qi=fr??(Yi.ticks?Yi.ticks.apply(Yi,Ht):Yi.domain()),ta=cr??(Yi.tickFormat?Yi.tickFormat.apply(Yi,Ht):V),ln=ci.selectAll(".tick").data(Qi,Yi),On=ln.enter().insert("g",".domain").attr("class","tick").style("opacity",ot),Un=d.transition(ln.exit()).style("opacity",ot).remove(),Zn=d.transition(ln.order()).style("opacity",1),aa=Math.max(ft,0)+Bt,gn,Ja=Ln(Yi),to=ci.selectAll(".domain").data([0]),yo=(to.enter().append("path").attr("class","domain"),d.transition(to));On.append("line"),On.append("text");var jo=On.select("line"),qo=Zn.select("line"),Xo=ln.select("text").text(ta),ml=On.select("text"),ts=Zn.select("text"),ws=Ve==="top"||Ve==="left"?-1:1,Dl,ac,bu,Eo;if(Ve==="bottom"||Ve==="top"?(gn=Tu,Dl="x",bu="y",ac="x2",Eo="y2",Xo.attr("dy",ws<0?"0em":".71em").style("text-anchor","middle"),yo.attr("d","M"+Ja[0]+","+ws*Pt+"V0H"+Ja[1]+"V"+ws*Pt)):(gn=Js,Dl="y",bu="x",ac="y2",Eo="x2",Xo.attr("dy",".32em").style("text-anchor",ws<0?"end":"start"),yo.attr("d","M"+ws*Pt+","+Ja[0]+"H0V"+Ja[1]+"H"+ws*Pt)),jo.attr(Eo,ws*ft),ml.attr(bu,ws*aa),qo.attr(ac,0).attr(Eo,ws*ft),ts.attr(Dl,0).attr(bu,ws*aa),Yi.rangeBand){var el=Yi,fl=el.rangeBand()/2;Bi=Yi=function(vu){return el(vu)+fl}}else Bi.rangeBand?Bi=Yi:Un.call(gn,Yi,Bi);On.call(gn,Bi,Yi),Zn.call(gn,Yi,Yi)})}return Or.scale=function(pi){return arguments.length?(Me=pi,Or):Me},Or.orient=function(pi){return arguments.length?(Ve=pi in Ru?pi+"":Pl,Or):Ve},Or.ticks=function(){return arguments.length?(Ht=z(arguments),Or):Ht},Or.tickValues=function(pi){return arguments.length?(fr=pi,Or):fr},Or.tickFormat=function(pi){return arguments.length?(cr=pi,Or):cr},Or.tickSize=function(pi){var ci=arguments.length;return ci?(ft=+pi,Pt=+arguments[ci-1],Or):ft},Or.innerTickSize=function(pi){return arguments.length?(ft=+pi,Or):ft},Or.outerTickSize=function(pi){return arguments.length?(Pt=+pi,Or):Pt},Or.tickPadding=function(pi){return arguments.length?(Bt=+pi,Or):Bt},Or.tickSubdivide=function(){return arguments.length&&Or},Or};var Pl="bottom",Ru={top:1,right:1,bottom:1,left:1};function Tu(Me,Ve,ft){Me.attr("transform",function(Pt){var Bt=Ve(Pt);return"translate("+(isFinite(Bt)?Bt:ft(Pt))+",0)"})}function Js(Me,Ve,ft){Me.attr("transform",function(Pt){var Bt=Ve(Pt);return"translate(0,"+(isFinite(Bt)?Bt:ft(Pt))+")"})}d.svg.brush=function(){var Me=ve(ci,"brushstart","brush","brushend"),Ve=null,ft=null,Pt=[0,0],Bt=[0,0],Ht,fr,cr=!0,Or=!0,pi=nc[0];function ci(ln){ln.each(function(){var On=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ta).on("touchstart.brush",ta),Un=On.selectAll(".background").data([0]);Un.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),On.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Zn=On.selectAll(".resize").data(pi,V);Zn.exit().remove(),Zn.enter().append("g").attr("class",function(to){return"resize "+to}).style("cursor",function(to){return Qs[to]}).append("rect").attr("x",function(to){return/[ew]$/.test(to)?-3:null}).attr("y",function(to){return/^[ns]/.test(to)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Zn.style("display",ci.empty()?"none":null);var aa=d.transition(On),gn=d.transition(Un),Ja;Ve&&(Ja=Ln(Ve),gn.attr("x",Ja[0]).attr("width",Ja[1]-Ja[0]),Yi(aa)),ft&&(Ja=Ln(ft),gn.attr("y",Ja[0]).attr("height",Ja[1]-Ja[0]),Qi(aa)),Bi(aa)})}ci.event=function(ln){ln.each(function(){var On=Me.of(this,arguments),Un={x:Pt,y:Bt,i:Ht,j:fr},Zn=this.__chart__||Un;this.__chart__=Un,Go?d.select(this).transition().each("start.brush",function(){Ht=Zn.i,fr=Zn.j,Pt=Zn.x,Bt=Zn.y,On({type:"brushstart"})}).tween("brush:brush",function(){var aa=ru(Pt,Un.x),gn=ru(Bt,Un.y);return Ht=fr=null,function(Ja){Pt=Un.x=aa(Ja),Bt=Un.y=gn(Ja),On({type:"brush",mode:"resize"})}}).each("end.brush",function(){Ht=Un.i,fr=Un.j,On({type:"brush",mode:"resize"}),On({type:"brushend"})}):(On({type:"brushstart"}),On({type:"brush",mode:"resize"}),On({type:"brushend"}))})};function Bi(ln){ln.selectAll(".resize").attr("transform",function(On){return"translate("+Pt[+/e$/.test(On)]+","+Bt[+/^s/.test(On)]+")"})}function Yi(ln){ln.select(".extent").attr("x",Pt[0]),ln.selectAll(".extent,.n>rect,.s>rect").attr("width",Pt[1]-Pt[0])}function Qi(ln){ln.select(".extent").attr("y",Bt[0]),ln.selectAll(".extent,.e>rect,.w>rect").attr("height",Bt[1]-Bt[0])}function ta(){var ln=this,On=d.select(d.event.target),Un=Me.of(ln,arguments),Zn=d.select(ln),aa=On.datum(),gn=!/^(n|s)$/.test(aa)&&Ve,Ja=!/^(e|w)$/.test(aa)&&ft,to=On.classed("extent"),yo=ui(ln),jo,qo=d.mouse(ln),Xo,ml=d.select(n(ln)).on("keydown.brush",Dl).on("keyup.brush",ac);if(d.event.changedTouches?ml.on("touchmove.brush",bu).on("touchend.brush",el):ml.on("mousemove.brush",bu).on("mouseup.brush",el),Zn.interrupt().selectAll("*").interrupt(),to)qo[0]=Pt[0]-qo[0],qo[1]=Bt[0]-qo[1];else if(aa){var ts=+/w$/.test(aa),ws=+/^n/.test(aa);Xo=[Pt[1-ts]-qo[0],Bt[1-ws]-qo[1]],qo[0]=Pt[ts],qo[1]=Bt[ws]}else d.event.altKey&&(jo=qo.slice());Zn.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",On.style("cursor")),Un({type:"brushstart"}),bu();function Dl(){d.event.keyCode==32&&(to||(jo=null,qo[0]-=Pt[1],qo[1]-=Bt[1],to=2),he())}function ac(){d.event.keyCode==32&&to==2&&(qo[0]+=Pt[1],qo[1]+=Bt[1],to=0,he())}function bu(){var fl=d.mouse(ln),vu=!1;Xo&&(fl[0]+=Xo[0],fl[1]+=Xo[1]),to||(d.event.altKey?(jo||(jo=[(Pt[0]+Pt[1])/2,(Bt[0]+Bt[1])/2]),qo[0]=Pt[+(fl[0]{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=new Date,z=new Date;function P(Ee,nt,xt,ut){function Et(Gt){return Ee(Gt=arguments.length===0?new Date:new Date(+Gt)),Gt}return Et.floor=function(Gt){return Ee(Gt=new Date(+Gt)),Gt},Et.ceil=function(Gt){return Ee(Gt=new Date(Gt-1)),nt(Gt,1),Ee(Gt),Gt},Et.round=function(Gt){var Jt=Et(Gt),gr=Et.ceil(Gt);return Gt-Jt0))return mr;do mr.push(Kr=new Date(+Gt)),nt(Gt,gr),Ee(Gt);while(Kr=Jt)for(;Ee(Jt),!Gt(Jt);)Jt.setTime(Jt-1)},function(Jt,gr){if(Jt>=Jt)if(gr<0)for(;++gr<=0;)for(;nt(Jt,-1),!Gt(Jt););else for(;--gr>=0;)for(;nt(Jt,1),!Gt(Jt););})},xt&&(Et.count=function(Gt,Jt){return y.setTime(+Gt),z.setTime(+Jt),Ee(y),Ee(z),Math.floor(xt(y,z))},Et.every=function(Gt){return Gt=Math.floor(Gt),!isFinite(Gt)||!(Gt>0)?null:Gt>1?Et.filter(ut?function(Jt){return ut(Jt)%Gt===0}:function(Jt){return Et.count(0,Jt)%Gt===0}):Et}),Et}var i=P(function(){},function(Ee,nt){Ee.setTime(+Ee+nt)},function(Ee,nt){return nt-Ee});i.every=function(Ee){return Ee=Math.floor(Ee),!isFinite(Ee)||!(Ee>0)?null:Ee>1?P(function(nt){nt.setTime(Math.floor(nt/Ee)*Ee)},function(nt,xt){nt.setTime(+nt+xt*Ee)},function(nt,xt){return(xt-nt)/Ee}):i};var n=i.range,a=1e3,l=6e4,o=36e5,u=864e5,s=6048e5,h=P(function(Ee){Ee.setTime(Ee-Ee.getMilliseconds())},function(Ee,nt){Ee.setTime(+Ee+nt*a)},function(Ee,nt){return(nt-Ee)/a},function(Ee){return Ee.getUTCSeconds()}),m=h.range,b=P(function(Ee){Ee.setTime(Ee-Ee.getMilliseconds()-Ee.getSeconds()*a)},function(Ee,nt){Ee.setTime(+Ee+nt*l)},function(Ee,nt){return(nt-Ee)/l},function(Ee){return Ee.getMinutes()}),x=b.range,_=P(function(Ee){Ee.setTime(Ee-Ee.getMilliseconds()-Ee.getSeconds()*a-Ee.getMinutes()*l)},function(Ee,nt){Ee.setTime(+Ee+nt*o)},function(Ee,nt){return(nt-Ee)/o},function(Ee){return Ee.getHours()}),A=_.range,f=P(function(Ee){Ee.setHours(0,0,0,0)},function(Ee,nt){Ee.setDate(Ee.getDate()+nt)},function(Ee,nt){return(nt-Ee-(nt.getTimezoneOffset()-Ee.getTimezoneOffset())*l)/u},function(Ee){return Ee.getDate()-1}),k=f.range;function w(Ee){return P(function(nt){nt.setDate(nt.getDate()-(nt.getDay()+7-Ee)%7),nt.setHours(0,0,0,0)},function(nt,xt){nt.setDate(nt.getDate()+xt*7)},function(nt,xt){return(xt-nt-(xt.getTimezoneOffset()-nt.getTimezoneOffset())*l)/s})}var D=w(0),E=w(1),I=w(2),M=w(3),p=w(4),g=w(5),C=w(6),T=D.range,N=E.range,B=I.range,U=M.range,V=p.range,W=g.range,F=C.range,$=P(function(Ee){Ee.setDate(1),Ee.setHours(0,0,0,0)},function(Ee,nt){Ee.setMonth(Ee.getMonth()+nt)},function(Ee,nt){return nt.getMonth()-Ee.getMonth()+(nt.getFullYear()-Ee.getFullYear())*12},function(Ee){return Ee.getMonth()}),q=$.range,G=P(function(Ee){Ee.setMonth(0,1),Ee.setHours(0,0,0,0)},function(Ee,nt){Ee.setFullYear(Ee.getFullYear()+nt)},function(Ee,nt){return nt.getFullYear()-Ee.getFullYear()},function(Ee){return Ee.getFullYear()});G.every=function(Ee){return!isFinite(Ee=Math.floor(Ee))||!(Ee>0)?null:P(function(nt){nt.setFullYear(Math.floor(nt.getFullYear()/Ee)*Ee),nt.setMonth(0,1),nt.setHours(0,0,0,0)},function(nt,xt){nt.setFullYear(nt.getFullYear()+xt*Ee)})};var ee=G.range,he=P(function(Ee){Ee.setUTCSeconds(0,0)},function(Ee,nt){Ee.setTime(+Ee+nt*l)},function(Ee,nt){return(nt-Ee)/l},function(Ee){return Ee.getUTCMinutes()}),xe=he.range,ve=P(function(Ee){Ee.setUTCMinutes(0,0,0)},function(Ee,nt){Ee.setTime(+Ee+nt*o)},function(Ee,nt){return(nt-Ee)/o},function(Ee){return Ee.getUTCHours()}),ce=ve.range,re=P(function(Ee){Ee.setUTCHours(0,0,0,0)},function(Ee,nt){Ee.setUTCDate(Ee.getUTCDate()+nt)},function(Ee,nt){return(nt-Ee)/u},function(Ee){return Ee.getUTCDate()-1}),ge=re.range;function ne(Ee){return P(function(nt){nt.setUTCDate(nt.getUTCDate()-(nt.getUTCDay()+7-Ee)%7),nt.setUTCHours(0,0,0,0)},function(nt,xt){nt.setUTCDate(nt.getUTCDate()+xt*7)},function(nt,xt){return(xt-nt)/s})}var se=ne(0),_e=ne(1),oe=ne(2),J=ne(3),me=ne(4),fe=ne(5),Ce=ne(6),Be=se.range,Oe=_e.range,Ze=oe.range,Ge=J.range,rt=me.range,_t=fe.range,pt=Ce.range,gt=P(function(Ee){Ee.setUTCDate(1),Ee.setUTCHours(0,0,0,0)},function(Ee,nt){Ee.setUTCMonth(Ee.getUTCMonth()+nt)},function(Ee,nt){return nt.getUTCMonth()-Ee.getUTCMonth()+(nt.getUTCFullYear()-Ee.getUTCFullYear())*12},function(Ee){return Ee.getUTCMonth()}),ct=gt.range,Ae=P(function(Ee){Ee.setUTCMonth(0,1),Ee.setUTCHours(0,0,0,0)},function(Ee,nt){Ee.setUTCFullYear(Ee.getUTCFullYear()+nt)},function(Ee,nt){return nt.getUTCFullYear()-Ee.getUTCFullYear()},function(Ee){return Ee.getUTCFullYear()});Ae.every=function(Ee){return!isFinite(Ee=Math.floor(Ee))||!(Ee>0)?null:P(function(nt){nt.setUTCFullYear(Math.floor(nt.getUTCFullYear()/Ee)*Ee),nt.setUTCMonth(0,1),nt.setUTCHours(0,0,0,0)},function(nt,xt){nt.setUTCFullYear(nt.getUTCFullYear()+xt*Ee)})};var ze=Ae.range;d.timeDay=f,d.timeDays=k,d.timeFriday=g,d.timeFridays=W,d.timeHour=_,d.timeHours=A,d.timeInterval=P,d.timeMillisecond=i,d.timeMilliseconds=n,d.timeMinute=b,d.timeMinutes=x,d.timeMonday=E,d.timeMondays=N,d.timeMonth=$,d.timeMonths=q,d.timeSaturday=C,d.timeSaturdays=F,d.timeSecond=h,d.timeSeconds=m,d.timeSunday=D,d.timeSundays=T,d.timeThursday=p,d.timeThursdays=V,d.timeTuesday=I,d.timeTuesdays=B,d.timeWednesday=M,d.timeWednesdays=U,d.timeWeek=D,d.timeWeeks=T,d.timeYear=G,d.timeYears=ee,d.utcDay=re,d.utcDays=ge,d.utcFriday=fe,d.utcFridays=_t,d.utcHour=ve,d.utcHours=ce,d.utcMillisecond=i,d.utcMilliseconds=n,d.utcMinute=he,d.utcMinutes=xe,d.utcMonday=_e,d.utcMondays=Oe,d.utcMonth=gt,d.utcMonths=ct,d.utcSaturday=Ce,d.utcSaturdays=pt,d.utcSecond=h,d.utcSeconds=m,d.utcSunday=se,d.utcSundays=Be,d.utcThursday=me,d.utcThursdays=rt,d.utcTuesday=oe,d.utcTuesdays=Ze,d.utcWednesday=J,d.utcWednesdays=Ge,d.utcWeek=se,d.utcWeeks=Be,d.utcYear=Ae,d.utcYears=ze,Object.defineProperty(d,"__esModule",{value:!0})})}),vi=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,Ji()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(Je){if(0<=Je.y&&Je.y<100){var ot=new Date(-1,Je.m,Je.d,Je.H,Je.M,Je.S,Je.L);return ot.setFullYear(Je.y),ot}return new Date(Je.y,Je.m,Je.d,Je.H,Je.M,Je.S,Je.L)}function P(Je){if(0<=Je.y&&Je.y<100){var ot=new Date(Date.UTC(-1,Je.m,Je.d,Je.H,Je.M,Je.S,Je.L));return ot.setUTCFullYear(Je.y),ot}return new Date(Date.UTC(Je.y,Je.m,Je.d,Je.H,Je.M,Je.S,Je.L))}function i(Je,ot,De){return{y:Je,m:ot,d:De,H:0,M:0,S:0,L:0}}function n(Je){var ot=Je.dateTime,De=Je.date,ye=Je.time,Pe=Je.periods,He=Je.days,at=Je.shortDays,ht=Je.months,At=Je.shortMonths,Wt=m(Pe),Kt=b(Pe),hr=m(He),zr=b(He),Dr=m(at),br=b(at),hi=m(ht),un=b(ht),cn=m(At),yn=b(At),Wn={a:Rn,A:Gn,b:Xn,B:sa,c:null,d:$,e:$,f:xe,H:q,I:G,j:ee,L:he,m:ve,M:ce,p:Mn,q:Ha,Q:Jt,s:gr,S:re,u:ge,U:ne,V:se,w:_e,W:oe,x:null,X:null,y:J,Y:me,Z:fe,"%":Gt},Sn={a:ro,A:Ft,b:Rt,B:qr,c:null,d:Ce,e:Ce,f:rt,H:Be,I:Oe,j:Ze,L:Ge,m:_t,M:pt,p:ni,q:oi,Q:Jt,s:gr,S:gt,u:ct,U:Ae,V:ze,w:Ee,W:nt,x:null,X:null,y:xt,Y:ut,Z:Et,"%":Gt},fn={a:_r,A:Cr,b:fi,B:qi,c:Ui,d:p,e:p,f:U,H:C,I:C,j:g,L:B,m:M,M:T,p:sr,q:I,Q:W,s:F,S:N,u:_,U:A,V:f,w:x,W:k,x:Hi,X:En,y:D,Y:w,Z:E,"%":V};Wn.x=ga(De,Wn),Wn.X=ga(ye,Wn),Wn.c=ga(ot,Wn),Sn.x=ga(De,Sn),Sn.X=ga(ye,Sn),Sn.c=ga(ot,Sn);function ga(Gr,si){return function(Pi){var yi=[],zt=-1,xr=0,Jr=Gr.length,Ri,tn,_n;for(Pi instanceof Date||(Pi=new Date(+Pi));++zt53)return null;"w"in yi||(yi.w=1),"Z"in yi?(xr=P(i(yi.y,0,1)),Jr=xr.getUTCDay(),xr=Jr>4||Jr===0?y.utcMonday.ceil(xr):y.utcMonday(xr),xr=y.utcDay.offset(xr,(yi.V-1)*7),yi.y=xr.getUTCFullYear(),yi.m=xr.getUTCMonth(),yi.d=xr.getUTCDate()+(yi.w+6)%7):(xr=z(i(yi.y,0,1)),Jr=xr.getDay(),xr=Jr>4||Jr===0?y.timeMonday.ceil(xr):y.timeMonday(xr),xr=y.timeDay.offset(xr,(yi.V-1)*7),yi.y=xr.getFullYear(),yi.m=xr.getMonth(),yi.d=xr.getDate()+(yi.w+6)%7)}else("W"in yi||"U"in yi)&&("w"in yi||(yi.w="u"in yi?yi.u%7:"W"in yi?1:0),Jr="Z"in yi?P(i(yi.y,0,1)).getUTCDay():z(i(yi.y,0,1)).getDay(),yi.m=0,yi.d="W"in yi?(yi.w+6)%7+yi.W*7-(Jr+5)%7:yi.w+yi.U*7-(Jr+6)%7);return"Z"in yi?(yi.H+=yi.Z/100|0,yi.M+=yi.Z%100,P(yi)):z(yi)}}function Zt(Gr,si,Pi,yi){for(var zt=0,xr=si.length,Jr=Pi.length,Ri,tn;zt=Jr)return-1;if(Ri=si.charCodeAt(zt++),Ri===37){if(Ri=si.charAt(zt++),tn=fn[Ri in a?si.charAt(zt++):Ri],!tn||(yi=tn(Gr,Pi,yi))<0)return-1}else if(Ri!=Pi.charCodeAt(yi++))return-1}return yi}function sr(Gr,si,Pi){var yi=Wt.exec(si.slice(Pi));return yi?(Gr.p=Kt[yi[0].toLowerCase()],Pi+yi[0].length):-1}function _r(Gr,si,Pi){var yi=Dr.exec(si.slice(Pi));return yi?(Gr.w=br[yi[0].toLowerCase()],Pi+yi[0].length):-1}function Cr(Gr,si,Pi){var yi=hr.exec(si.slice(Pi));return yi?(Gr.w=zr[yi[0].toLowerCase()],Pi+yi[0].length):-1}function fi(Gr,si,Pi){var yi=cn.exec(si.slice(Pi));return yi?(Gr.m=yn[yi[0].toLowerCase()],Pi+yi[0].length):-1}function qi(Gr,si,Pi){var yi=hi.exec(si.slice(Pi));return yi?(Gr.m=un[yi[0].toLowerCase()],Pi+yi[0].length):-1}function Ui(Gr,si,Pi){return Zt(Gr,ot,si,Pi)}function Hi(Gr,si,Pi){return Zt(Gr,De,si,Pi)}function En(Gr,si,Pi){return Zt(Gr,ye,si,Pi)}function Rn(Gr){return at[Gr.getDay()]}function Gn(Gr){return He[Gr.getDay()]}function Xn(Gr){return At[Gr.getMonth()]}function sa(Gr){return ht[Gr.getMonth()]}function Mn(Gr){return Pe[+(Gr.getHours()>=12)]}function Ha(Gr){return 1+~~(Gr.getMonth()/3)}function ro(Gr){return at[Gr.getUTCDay()]}function Ft(Gr){return He[Gr.getUTCDay()]}function Rt(Gr){return At[Gr.getUTCMonth()]}function qr(Gr){return ht[Gr.getUTCMonth()]}function ni(Gr){return Pe[+(Gr.getUTCHours()>=12)]}function oi(Gr){return 1+~~(Gr.getUTCMonth()/3)}return{format:function(Gr){var si=ga(Gr+="",Wn);return si.toString=function(){return Gr},si},parse:function(Gr){var si=na(Gr+="",!1);return si.toString=function(){return Gr},si},utcFormat:function(Gr){var si=ga(Gr+="",Sn);return si.toString=function(){return Gr},si},utcParse:function(Gr){var si=na(Gr+="",!0);return si.toString=function(){return Gr},si}}}var a={"-":"",_:" ",0:"0"},l=/^\s*\d+/,o=/^%/,u=/[\\^$*+?|[\]().{}]/g;function s(Je,ot,De){var ye=Je<0?"-":"",Pe=(ye?-Je:Je)+"",He=Pe.length;return ye+(He68?1900:2e3),De+ye[0].length):-1}function E(Je,ot,De){var ye=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ot.slice(De,De+6));return ye?(Je.Z=ye[1]?0:-(ye[2]+(ye[3]||"00")),De+ye[0].length):-1}function I(Je,ot,De){var ye=l.exec(ot.slice(De,De+1));return ye?(Je.q=ye[0]*3-3,De+ye[0].length):-1}function M(Je,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Je.m=ye[0]-1,De+ye[0].length):-1}function p(Je,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Je.d=+ye[0],De+ye[0].length):-1}function g(Je,ot,De){var ye=l.exec(ot.slice(De,De+3));return ye?(Je.m=0,Je.d=+ye[0],De+ye[0].length):-1}function C(Je,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Je.H=+ye[0],De+ye[0].length):-1}function T(Je,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Je.M=+ye[0],De+ye[0].length):-1}function N(Je,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Je.S=+ye[0],De+ye[0].length):-1}function B(Je,ot,De){var ye=l.exec(ot.slice(De,De+3));return ye?(Je.L=+ye[0],De+ye[0].length):-1}function U(Je,ot,De){var ye=l.exec(ot.slice(De,De+6));return ye?(Je.L=Math.floor(ye[0]/1e3),De+ye[0].length):-1}function V(Je,ot,De){var ye=o.exec(ot.slice(De,De+1));return ye?De+ye[0].length:-1}function W(Je,ot,De){var ye=l.exec(ot.slice(De));return ye?(Je.Q=+ye[0],De+ye[0].length):-1}function F(Je,ot,De){var ye=l.exec(ot.slice(De));return ye?(Je.s=+ye[0],De+ye[0].length):-1}function $(Je,ot){return s(Je.getDate(),ot,2)}function q(Je,ot){return s(Je.getHours(),ot,2)}function G(Je,ot){return s(Je.getHours()%12||12,ot,2)}function ee(Je,ot){return s(1+y.timeDay.count(y.timeYear(Je),Je),ot,3)}function he(Je,ot){return s(Je.getMilliseconds(),ot,3)}function xe(Je,ot){return he(Je,ot)+"000"}function ve(Je,ot){return s(Je.getMonth()+1,ot,2)}function ce(Je,ot){return s(Je.getMinutes(),ot,2)}function re(Je,ot){return s(Je.getSeconds(),ot,2)}function ge(Je){var ot=Je.getDay();return ot===0?7:ot}function ne(Je,ot){return s(y.timeSunday.count(y.timeYear(Je)-1,Je),ot,2)}function se(Je,ot){var De=Je.getDay();return Je=De>=4||De===0?y.timeThursday(Je):y.timeThursday.ceil(Je),s(y.timeThursday.count(y.timeYear(Je),Je)+(y.timeYear(Je).getDay()===4),ot,2)}function _e(Je){return Je.getDay()}function oe(Je,ot){return s(y.timeMonday.count(y.timeYear(Je)-1,Je),ot,2)}function J(Je,ot){return s(Je.getFullYear()%100,ot,2)}function me(Je,ot){return s(Je.getFullYear()%1e4,ot,4)}function fe(Je){var ot=Je.getTimezoneOffset();return(ot>0?"-":(ot*=-1,"+"))+s(ot/60|0,"0",2)+s(ot%60,"0",2)}function Ce(Je,ot){return s(Je.getUTCDate(),ot,2)}function Be(Je,ot){return s(Je.getUTCHours(),ot,2)}function Oe(Je,ot){return s(Je.getUTCHours()%12||12,ot,2)}function Ze(Je,ot){return s(1+y.utcDay.count(y.utcYear(Je),Je),ot,3)}function Ge(Je,ot){return s(Je.getUTCMilliseconds(),ot,3)}function rt(Je,ot){return Ge(Je,ot)+"000"}function _t(Je,ot){return s(Je.getUTCMonth()+1,ot,2)}function pt(Je,ot){return s(Je.getUTCMinutes(),ot,2)}function gt(Je,ot){return s(Je.getUTCSeconds(),ot,2)}function ct(Je){var ot=Je.getUTCDay();return ot===0?7:ot}function Ae(Je,ot){return s(y.utcSunday.count(y.utcYear(Je)-1,Je),ot,2)}function ze(Je,ot){var De=Je.getUTCDay();return Je=De>=4||De===0?y.utcThursday(Je):y.utcThursday.ceil(Je),s(y.utcThursday.count(y.utcYear(Je),Je)+(y.utcYear(Je).getUTCDay()===4),ot,2)}function Ee(Je){return Je.getUTCDay()}function nt(Je,ot){return s(y.utcMonday.count(y.utcYear(Je)-1,Je),ot,2)}function xt(Je,ot){return s(Je.getUTCFullYear()%100,ot,2)}function ut(Je,ot){return s(Je.getUTCFullYear()%1e4,ot,4)}function Et(){return"+0000"}function Gt(){return"%"}function Jt(Je){return+Je}function gr(Je){return Math.floor(+Je/1e3)}var mr;Kr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Kr(Je){return mr=n(Je),d.timeFormat=mr.format,d.timeParse=mr.parse,d.utcFormat=mr.utcFormat,d.utcParse=mr.utcParse,mr}var ri="%Y-%m-%dT%H:%M:%S.%LZ";function Mr(Je){return Je.toISOString()}var ui=Date.prototype.toISOString?Mr:d.utcFormat(ri);function mi(Je){var ot=new Date(Je);return isNaN(ot)?null:ot}var Ot=+new Date("2000-01-01T00:00:00.000Z")?mi:d.utcParse(ri);d.isoFormat=ui,d.isoParse=Ot,d.timeFormatDefaultLocale=Kr,d.timeFormatLocale=n,Object.defineProperty(d,"__esModule",{value:!0})})}),vr=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=typeof globalThis<"u"?globalThis:d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(M){return Math.abs(M=Math.round(M))>=1e21?M.toLocaleString("en").replace(/,/g,""):M.toString(10)}function z(M,p){if((g=(M=p?M.toExponential(p-1):M.toExponential()).indexOf("e"))<0)return null;var g,C=M.slice(0,g);return[C.length>1?C[0]+C.slice(2):C,+M.slice(g+1)]}function P(M){return M=z(Math.abs(M)),M?M[1]:NaN}function i(M,p){return function(g,C){for(var T=g.length,N=[],B=0,U=M[0],V=0;T>0&&U>0&&(V+U+1>C&&(U=Math.max(1,C-V)),N.push(g.substring(T-=U,T+U)),!((V+=U+1)>C));)U=M[B=(B+1)%M.length];return N.reverse().join(p)}}function n(M){return function(p){return p.replace(/[0-9]/g,function(g){return M[+g]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(M){if(!(p=a.exec(M)))throw new Error("invalid format: "+M);var p;return new o({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}l.prototype=o.prototype;function o(M){this.fill=M.fill===void 0?" ":M.fill+"",this.align=M.align===void 0?">":M.align+"",this.sign=M.sign===void 0?"-":M.sign+"",this.symbol=M.symbol===void 0?"":M.symbol+"",this.zero=!!M.zero,this.width=M.width===void 0?void 0:+M.width,this.comma=!!M.comma,this.precision=M.precision===void 0?void 0:+M.precision,this.trim=!!M.trim,this.type=M.type===void 0?"":M.type+""}o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function u(M){e:for(var p=M.length,g=1,C=-1,T;g0&&(C=0);break}return C>0?M.slice(0,C)+M.slice(T+1):M}var s;function h(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],T=g[1],N=T-(s=Math.max(-8,Math.min(8,Math.floor(T/3)))*3)+1,B=C.length;return N===B?C:N>B?C+new Array(N-B+1).join("0"):N>0?C.slice(0,N)+"."+C.slice(N):"0."+new Array(1-N).join("0")+z(M,Math.max(0,p+N-1))[0]}function m(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],T=g[1];return T<0?"0."+new Array(-T).join("0")+C:C.length>T+1?C.slice(0,T+1)+"."+C.slice(T+1):C+new Array(T-C.length+2).join("0")}var b={"%":function(M,p){return(M*100).toFixed(p)},b:function(M){return Math.round(M).toString(2)},c:function(M){return M+""},d:y,e:function(M,p){return M.toExponential(p)},f:function(M,p){return M.toFixed(p)},g:function(M,p){return M.toPrecision(p)},o:function(M){return Math.round(M).toString(8)},p:function(M,p){return m(M*100,p)},r:m,s:h,X:function(M){return Math.round(M).toString(16).toUpperCase()},x:function(M){return Math.round(M).toString(16)}};function x(M){return M}var _=Array.prototype.map,A=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function f(M){var p=M.grouping===void 0||M.thousands===void 0?x:i(_.call(M.grouping,Number),M.thousands+""),g=M.currency===void 0?"":M.currency[0]+"",C=M.currency===void 0?"":M.currency[1]+"",T=M.decimal===void 0?".":M.decimal+"",N=M.numerals===void 0?x:n(_.call(M.numerals,String)),B=M.percent===void 0?"%":M.percent+"",U=M.minus===void 0?"-":M.minus+"",V=M.nan===void 0?"NaN":M.nan+"";function W($){$=l($);var q=$.fill,G=$.align,ee=$.sign,he=$.symbol,xe=$.zero,ve=$.width,ce=$.comma,re=$.precision,ge=$.trim,ne=$.type;ne==="n"?(ce=!0,ne="g"):b[ne]||(re===void 0&&(re=12),ge=!0,ne="g"),(xe||q==="0"&&G==="=")&&(xe=!0,q="0",G="=");var se=he==="$"?g:he==="#"&&/[boxX]/.test(ne)?"0"+ne.toLowerCase():"",_e=he==="$"?C:/[%p]/.test(ne)?B:"",oe=b[ne],J=/[defgprs%]/.test(ne);re=re===void 0?6:/[gprs]/.test(ne)?Math.max(1,Math.min(21,re)):Math.max(0,Math.min(20,re));function me(fe){var Ce=se,Be=_e,Oe,Ze,Ge;if(ne==="c")Be=oe(fe)+Be,fe="";else{fe=+fe;var rt=fe<0||1/fe<0;if(fe=isNaN(fe)?V:oe(Math.abs(fe),re),ge&&(fe=u(fe)),rt&&+fe==0&&ee!=="+"&&(rt=!1),Ce=(rt?ee==="("?ee:U:ee==="-"||ee==="("?"":ee)+Ce,Be=(ne==="s"?A[8+s/3]:"")+Be+(rt&&ee==="("?")":""),J){for(Oe=-1,Ze=fe.length;++OeGe||Ge>57){Be=(Ge===46?T+fe.slice(Oe+1):fe.slice(Oe))+Be,fe=fe.slice(0,Oe);break}}}ce&&!xe&&(fe=p(fe,1/0));var _t=Ce.length+fe.length+Be.length,pt=_t>1)+Ce+fe+Be+pt.slice(_t);break;default:fe=pt+Ce+fe+Be;break}return N(fe)}return me.toString=function(){return $+""},me}function F($,q){var G=W(($=l($),$.type="f",$)),ee=Math.max(-8,Math.min(8,Math.floor(P(q)/3)))*3,he=Math.pow(10,-ee),xe=A[8+ee/3];return function(ve){return G(he*ve)+xe}}return{format:W,formatPrefix:F}}var k;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(M){return k=f(M),d.format=k.format,d.formatPrefix=k.formatPrefix,k}function D(M){return Math.max(0,-P(Math.abs(M)))}function E(M,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(P(p)/3)))*3-P(Math.abs(M)))}function I(M,p){return M=Math.abs(M),p=Math.abs(p)-M,Math.max(0,P(p)-P(M))+1}d.FormatSpecifier=o,d.formatDefaultLocale=w,d.formatLocale=f,d.formatSpecifier=l,d.precisionFixed=D,d.precisionPrefix=E,d.precisionRound=I,Object.defineProperty(d,"__esModule",{value:!0})})}),dr=Fe((te,Y)=>{Y.exports=function(d){for(var y=d.length,z,P=0;P13)&&z!==32&&z!==133&&z!==160&&z!==5760&&z!==6158&&(z<8192||z>8205)&&z!==8232&&z!==8233&&z!==8239&&z!==8287&&z!==8288&&z!==12288&&z!==65279)return!1;return!0}}),Ar=Fe((te,Y)=>{var d=dr();Y.exports=function(y){var z=typeof y;if(z==="string"){var P=y;if(y=+y,y===0&&d(P))return!1}else if(z!=="number")return!1;return y-y<1}}),ti=Fe((te,Y)=>{Y.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),Xr=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=typeof globalThis<"u"?globalThis:d||self,y(d["base64-arraybuffer"]={}))})(te,function(d){for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=typeof Uint8Array>"u"?[]:new Uint8Array(256),P=0;P>2],s+=y[(l[o]&3)<<4|l[o+1]>>4],s+=y[(l[o+1]&15)<<2|l[o+2]>>6],s+=y[l[o+2]&63];return u%3===2?s=s.substring(0,s.length-1)+"=":u%3===1&&(s=s.substring(0,s.length-2)+"=="),s},n=function(a){var l=a.length*.75,o=a.length,u,s=0,h,m,b,x;a[a.length-1]==="="&&(l--,a[a.length-2]==="="&&l--);var _=new ArrayBuffer(l),A=new Uint8Array(_);for(u=0;u>4,A[s++]=(m&15)<<4|b>>2,A[s++]=(b&3)<<6|x&63;return _};d.decode=n,d.encode=i,Object.defineProperty(d,"__esModule",{value:!0})})}),ei=Fe((te,Y)=>{Y.exports=function(d){return window&&window.process&&window.process.versions?Object.prototype.toString.call(d)==="[object Object]":Object.prototype.toString.call(d)==="[object Object]"&&Object.getPrototypeOf(d).hasOwnProperty("hasOwnProperty")}}),Di=Fe(te=>{var Y=Xr().decode,d=ei(),y=Array.isArray,z=ArrayBuffer,P=DataView;function i(h){return z.isView(h)&&!(h instanceof P)}te.isTypedArray=i;function n(h){return y(h)||i(h)}te.isArrayOrTypedArray=n;function a(h){return!n(h[0])}te.isArray1D=a,te.ensureArray=function(h,m){return y(h)||(h=[]),h.length=m,h};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function o(h){return h.constructor===ArrayBuffer}te.isArrayBuffer=o,te.decodeTypedArraySpec=function(h){var m=[],b=u(h),x=b.dtype,_=l[x];if(!_)throw new Error('Error in dtype: "'+x+'"');var A=_.BYTES_PER_ELEMENT,f=b.bdata;o(f)||(f=Y(f));var k=b.shape===void 0?[f.byteLength/A]:(""+b.shape).split(",");k.reverse();var w=k.length,D,E,I=+k[0],M=A*I,p=0;if(w===1)m=new _(f);else if(w===2)for(D=+k[1],E=0;E{var d=Ar(),y=Di().isArrayOrTypedArray;Y.exports=function(s,h){if(d(h))h=String(h);else if(typeof h!="string"||h.substr(h.length-4)==="[-1]")throw"bad property string";var m=h.split("."),b,x,_,A;for(A=0;A{var d=qn(),y=/^\w*$/,z=0,P=1,i=2,n=3,a=4;Y.exports=function(l,o,u,s){u=u||"name",s=s||"value";var h,m,b,x={};o&&o.length?(b=d(l,o),m=b.get()):m=l,o=o||"";var _={};if(m)for(h=0;h2)return x[w]=x[w]|i,f.set(k,null);if(A){for(h=w;h{var d=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,y=/^[^\.\[\]]+$/;Y.exports=function(z,P){for(;P;){var i=z.match(d);if(i)z=i[1];else if(z.match(y))z="";else throw new Error("bad relativeAttr call:"+[z,P]);if(P.charAt(0)==="^")P=P.slice(1);else break}return z&&P.charAt(0)!=="["?z+"."+P:z+P}}),Ta=Fe((te,Y)=>{var d=Ar();Y.exports=function(y,z){if(y>0)return Math.log(y)/Math.LN10;var P=Math.log(Math.min(z[0],z[1]))/Math.LN10;return d(P)||(P=Math.log(Math.max(z[0],z[1]))/Math.LN10-6),P}}),so=Fe((te,Y)=>{var d=Di().isArrayOrTypedArray,y=ei();Y.exports=function z(P,i){for(var n in i){var a=i[n],l=P[n];if(l!==a)if(n.charAt(0)==="_"||typeof a=="function"){if(n in P)continue;P[n]=a}else if(d(a)&&d(l)&&y(a[0])){if(n==="customdata"||n==="ids")continue;for(var o=Math.min(a.length,l.length),u=0;u{function d(z,P){var i=z%P;return i<0?i+P:i}function y(z,P){return Math.abs(z)>P/2?z-Math.round(z/P)*P:z}Y.exports={mod:d,modHalf:y}}),sn=Fe((te,Y)=>{(function(d){var y=/^\s+/,z=/\s+$/,P=0,i=d.round,n=d.min,a=d.max,l=d.random;function o(J,me){if(J=J||"",me=me||{},J instanceof o)return J;if(!(this instanceof o))return new o(J,me);var fe=u(J);this._originalInput=J,this._r=fe.r,this._g=fe.g,this._b=fe.b,this._a=fe.a,this._roundA=i(100*this._a)/100,this._format=me.format||fe.format,this._gradientType=me.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=fe.ok,this._tc_id=P++}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),me,fe,Ce,Be,Oe,Ze;return me=J.r/255,fe=J.g/255,Ce=J.b/255,me<=.03928?Be=me/12.92:Be=d.pow((me+.055)/1.055,2.4),fe<=.03928?Oe=fe/12.92:Oe=d.pow((fe+.055)/1.055,2.4),Ce<=.03928?Ze=Ce/12.92:Ze=d.pow((Ce+.055)/1.055,2.4),.2126*Be+.7152*Oe+.0722*Ze},setAlpha:function(J){return this._a=$(J),this._roundA=i(100*this._a)/100,this},toHsv:function(){var J=b(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=b(this._r,this._g,this._b),me=i(J.h*360),fe=i(J.s*100),Ce=i(J.v*100);return this._a==1?"hsv("+me+", "+fe+"%, "+Ce+"%)":"hsva("+me+", "+fe+"%, "+Ce+"%, "+this._roundA+")"},toHsl:function(){var J=h(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=h(this._r,this._g,this._b),me=i(J.h*360),fe=i(J.s*100),Ce=i(J.l*100);return this._a==1?"hsl("+me+", "+fe+"%, "+Ce+"%)":"hsla("+me+", "+fe+"%, "+Ce+"%, "+this._roundA+")"},toHex:function(J){return _(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return A(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(q(this._r,255)*100)+"%",g:i(q(this._g,255)*100)+"%",b:i(q(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(q(this._r,255)*100)+"%, "+i(q(this._g,255)*100)+"%, "+i(q(this._b,255)*100)+"%)":"rgba("+i(q(this._r,255)*100)+"%, "+i(q(this._g,255)*100)+"%, "+i(q(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[_(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var me="#"+f(this._r,this._g,this._b,this._a),fe=me,Ce=this._gradientType?"GradientType = 1, ":"";if(J){var Be=o(J);fe="#"+f(Be._r,Be._g,Be._b,Be._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ce+"startColorstr="+me+",endColorstr="+fe+")"},toString:function(J){var me=!!J;J=J||this._format;var fe=!1,Ce=this._a<1&&this._a>=0,Be=!me&&Ce&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Be?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&(fe=this.toRgbString()),J==="prgb"&&(fe=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&(fe=this.toHexString()),J==="hex3"&&(fe=this.toHexString(!0)),J==="hex4"&&(fe=this.toHex8String(!0)),J==="hex8"&&(fe=this.toHex8String()),J==="name"&&(fe=this.toName()),J==="hsl"&&(fe=this.toHslString()),J==="hsv"&&(fe=this.toHsvString()),fe||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(J,me){var fe=J.apply(null,[this].concat([].slice.call(me)));return this._r=fe._r,this._g=fe._g,this._b=fe._b,this.setAlpha(fe._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(k,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(J,me){return J.apply(null,[this].concat([].slice.call(me)))},analogous:function(){return this._applyCombination(B,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(U,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},o.fromRatio=function(J,me){if(typeof J=="object"){var fe={};for(var Ce in J)J.hasOwnProperty(Ce)&&(Ce==="a"?fe[Ce]=J[Ce]:fe[Ce]=ce(J[Ce]));J=fe}return o(J,me)};function u(J){var me={r:0,g:0,b:0},fe=1,Ce=null,Be=null,Oe=null,Ze=!1,Ge=!1;return typeof J=="string"&&(J=_e(J)),typeof J=="object"&&(se(J.r)&&se(J.g)&&se(J.b)?(me=s(J.r,J.g,J.b),Ze=!0,Ge=String(J.r).substr(-1)==="%"?"prgb":"rgb"):se(J.h)&&se(J.s)&&se(J.v)?(Ce=ce(J.s),Be=ce(J.v),me=x(J.h,Ce,Be),Ze=!0,Ge="hsv"):se(J.h)&&se(J.s)&&se(J.l)&&(Ce=ce(J.s),Oe=ce(J.l),me=m(J.h,Ce,Oe),Ze=!0,Ge="hsl"),J.hasOwnProperty("a")&&(fe=J.a)),fe=$(fe),{ok:Ze,format:J.format||Ge,r:n(255,a(me.r,0)),g:n(255,a(me.g,0)),b:n(255,a(me.b,0)),a:fe}}function s(J,me,fe){return{r:q(J,255)*255,g:q(me,255)*255,b:q(fe,255)*255}}function h(J,me,fe){J=q(J,255),me=q(me,255),fe=q(fe,255);var Ce=a(J,me,fe),Be=n(J,me,fe),Oe,Ze,Ge=(Ce+Be)/2;if(Ce==Be)Oe=Ze=0;else{var rt=Ce-Be;switch(Ze=Ge>.5?rt/(2-Ce-Be):rt/(Ce+Be),Ce){case J:Oe=(me-fe)/rt+(me1&&(gt-=1),gt<1/6?_t+(pt-_t)*6*gt:gt<1/2?pt:gt<2/3?_t+(pt-_t)*(2/3-gt)*6:_t}if(me===0)Ce=Be=Oe=fe;else{var Ge=fe<.5?fe*(1+me):fe+me-fe*me,rt=2*fe-Ge;Ce=Ze(rt,Ge,J+1/3),Be=Ze(rt,Ge,J),Oe=Ze(rt,Ge,J-1/3)}return{r:Ce*255,g:Be*255,b:Oe*255}}function b(J,me,fe){J=q(J,255),me=q(me,255),fe=q(fe,255);var Ce=a(J,me,fe),Be=n(J,me,fe),Oe,Ze,Ge=Ce,rt=Ce-Be;if(Ze=Ce===0?0:rt/Ce,Ce==Be)Oe=0;else{switch(Ce){case J:Oe=(me-fe)/rt+(me>1)+720)%360;--me;)Ce.h=(Ce.h+Be)%360,Oe.push(o(Ce));return Oe}function U(J,me){me=me||6;for(var fe=o(J).toHsv(),Ce=fe.h,Be=fe.s,Oe=fe.v,Ze=[],Ge=1/me;me--;)Ze.push(o({h:Ce,s:Be,v:Oe})),Oe=(Oe+Ge)%1;return Ze}o.mix=function(J,me,fe){fe=fe===0?0:fe||50;var Ce=o(J).toRgb(),Be=o(me).toRgb(),Oe=fe/100,Ze={r:(Be.r-Ce.r)*Oe+Ce.r,g:(Be.g-Ce.g)*Oe+Ce.g,b:(Be.b-Ce.b)*Oe+Ce.b,a:(Be.a-Ce.a)*Oe+Ce.a};return o(Ze)},o.readability=function(J,me){var fe=o(J),Ce=o(me);return(d.max(fe.getLuminance(),Ce.getLuminance())+.05)/(d.min(fe.getLuminance(),Ce.getLuminance())+.05)},o.isReadable=function(J,me,fe){var Ce=o.readability(J,me),Be,Oe;switch(Oe=!1,Be=oe(fe),Be.level+Be.size){case"AAsmall":case"AAAlarge":Oe=Ce>=4.5;break;case"AAlarge":Oe=Ce>=3;break;case"AAAsmall":Oe=Ce>=7;break}return Oe},o.mostReadable=function(J,me,fe){var Ce=null,Be=0,Oe,Ze,Ge,rt;fe=fe||{},Ze=fe.includeFallbackColors,Ge=fe.level,rt=fe.size;for(var _t=0;_tBe&&(Be=Oe,Ce=o(me[_t]));return o.isReadable(J,Ce,{level:Ge,size:rt})||!Ze?Ce:(fe.includeFallbackColors=!1,o.mostReadable(J,["#fff","#000"],fe))};var V=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=o.hexNames=F(V);function F(J){var me={};for(var fe in J)J.hasOwnProperty(fe)&&(me[J[fe]]=fe);return me}function $(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function q(J,me){he(J)&&(J="100%");var fe=xe(J);return J=n(me,a(0,parseFloat(J))),fe&&(J=parseInt(J*me,10)/100),d.abs(J-me)<1e-6?1:J%me/parseFloat(me)}function G(J){return n(1,a(0,J))}function ee(J){return parseInt(J,16)}function he(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function xe(J){return typeof J=="string"&&J.indexOf("%")!=-1}function ve(J){return J.length==1?"0"+J:""+J}function ce(J){return J<=1&&(J=J*100+"%"),J}function re(J){return d.round(parseFloat(J)*255).toString(16)}function ge(J){return ee(J)/255}var ne=function(){var J="[-\\+]?\\d+%?",me="[-\\+]?\\d*\\.\\d+%?",fe="(?:"+me+")|(?:"+J+")",Ce="[\\s|\\(]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")\\s*\\)?",Be="[\\s|\\(]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")\\s*\\)?";return{CSS_UNIT:new RegExp(fe),rgb:new RegExp("rgb"+Ce),rgba:new RegExp("rgba"+Be),hsl:new RegExp("hsl"+Ce),hsla:new RegExp("hsla"+Be),hsv:new RegExp("hsv"+Ce),hsva:new RegExp("hsva"+Be),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function se(J){return!!ne.CSS_UNIT.exec(J)}function _e(J){J=J.replace(y,"").replace(z,"").toLowerCase();var me=!1;if(V[J])J=V[J],me=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var fe;return(fe=ne.rgb.exec(J))?{r:fe[1],g:fe[2],b:fe[3]}:(fe=ne.rgba.exec(J))?{r:fe[1],g:fe[2],b:fe[3],a:fe[4]}:(fe=ne.hsl.exec(J))?{h:fe[1],s:fe[2],l:fe[3]}:(fe=ne.hsla.exec(J))?{h:fe[1],s:fe[2],l:fe[3],a:fe[4]}:(fe=ne.hsv.exec(J))?{h:fe[1],s:fe[2],v:fe[3]}:(fe=ne.hsva.exec(J))?{h:fe[1],s:fe[2],v:fe[3],a:fe[4]}:(fe=ne.hex8.exec(J))?{r:ee(fe[1]),g:ee(fe[2]),b:ee(fe[3]),a:ge(fe[4]),format:me?"name":"hex8"}:(fe=ne.hex6.exec(J))?{r:ee(fe[1]),g:ee(fe[2]),b:ee(fe[3]),format:me?"name":"hex"}:(fe=ne.hex4.exec(J))?{r:ee(fe[1]+""+fe[1]),g:ee(fe[2]+""+fe[2]),b:ee(fe[3]+""+fe[3]),a:ge(fe[4]+""+fe[4]),format:me?"name":"hex8"}:(fe=ne.hex3.exec(J))?{r:ee(fe[1]+""+fe[1]),g:ee(fe[2]+""+fe[2]),b:ee(fe[3]+""+fe[3]),format:me?"name":"hex"}:!1}function oe(J){var me,fe;return J=J||{level:"AA",size:"small"},me=(J.level||"AA").toUpperCase(),fe=(J.size||"small").toLowerCase(),me!=="AA"&&me!=="AAA"&&(me="AA"),fe!=="small"&&fe!=="large"&&(fe="small"),{level:me,size:fe}}typeof Y<"u"&&Y.exports?Y.exports=o:window.tinycolor=o})(Math)}),an=Fe(te=>{var Y=ei(),d=Array.isArray;function y(P,i){var n,a;for(n=0;n{Y.exports=function(d){var y=d.variantValues,z=d.editType,P=d.colorEditType;P===void 0&&(P=z);var i={editType:z,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};d.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:z},size:{valType:"number",min:1,editType:z},color:{valType:"color",editType:P},weight:i,style:{editType:z,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:d.noFontVariant?void 0:{editType:z,valType:"enumerated",values:y||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:d.noFontTextcase?void 0:{editType:z,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:d.noFontLineposition?void 0:{editType:z,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:d.noFontShadow?void 0:{editType:z,valType:"string",dflt:d.autoShadowDflt?"auto":"none"},editType:z};return d.autoSize&&(n.size.dflt="auto"),d.autoColor&&(n.color.dflt="auto"),d.arrayOk&&(n.family.arrayOk=!0,n.weight.arrayOk=!0,n.style.arrayOk=!0,d.noFontVariant||(n.variant.arrayOk=!0),d.noFontTextcase||(n.textcase.arrayOk=!0),d.noFontLineposition||(n.lineposition.arrayOk=!0),d.noFontShadow||(n.shadow.arrayOk=!0),n.size.arrayOk=!0,n.color.arrayOk=!0),n}}),Ra=Fe((te,Y)=>{Y.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),Ya=Fe((te,Y)=>{var d=Ra(),y=zn(),z=y({editType:"none"});z.family.dflt=d.HOVERFONT,z.size.dflt=d.HOVERFONTSIZE,Y.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:z,grouptitlefont:y({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),zo=Fe((te,Y)=>{var d=zn(),y=Ya().hoverlabel,z=an().extendFlat;Y.exports={hoverlabel:{bgcolor:z({},y.bgcolor,{arrayOk:!0}),bordercolor:z({},y.bordercolor,{arrayOk:!0}),font:d({arrayOk:!0,editType:"none"}),align:z({},y.align,{arrayOk:!0}),namelength:z({},y.namelength,{arrayOk:!0}),showarrow:z({},y.showarrow),editType:"none"}}}),_a=Fe((te,Y)=>{var d=zn(),y=zo();Y.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:d({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:y.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),Ur=Fe((te,Y)=>{var d=sn(),y={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},z=y.RdBu;function P(a,l){if(l||(l=z),!a)return l;function o(){try{a=y[a]||JSON.parse(a)}catch{a=l}}return typeof a=="string"&&(o(),typeof a=="string"&&o()),i(a)?a:l}function i(a){var l=0;if(!Array.isArray(a)||a.length<2||!a[0]||!a[a.length-1]||+a[0][0]!=0||+a[a.length-1][0]!=1)return!1;for(var o=0;o{te.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te.defaultLine="#444",te.lightLine="#eee",te.background="#fff",te.borderLine="#BEC8D9",te.lightFraction=1e3/11}),Xi=Fe((te,Y)=>{var d=sn(),y=Ar(),z=Di().isTypedArray,P=Y.exports={},i=Mi();P.defaults=i.defaults;var n=P.defaultLine=i.defaultLine;P.lightLine=i.lightLine;var a=P.background=i.background;P.tinyRGB=function(o){var u=o.toRgb();return"rgb("+Math.round(u.r)+", "+Math.round(u.g)+", "+Math.round(u.b)+")"},P.rgb=function(o){return P.tinyRGB(d(o))},P.opacity=function(o){return o?d(o).getAlpha():0},P.addOpacity=function(o,u){var s=d(o).toRgb();return"rgba("+Math.round(s.r)+", "+Math.round(s.g)+", "+Math.round(s.b)+", "+u+")"},P.combine=function(o,u){var s=d(o).toRgb();if(s.a===1)return d(o).toRgbString();var h=d(u||a).toRgb(),m=h.a===1?h:{r:255*(1-h.a)+h.r*h.a,g:255*(1-h.a)+h.g*h.a,b:255*(1-h.a)+h.b*h.a},b={r:m.r*(1-s.a)+s.r*s.a,g:m.g*(1-s.a)+s.g*s.a,b:m.b*(1-s.a)+s.b*s.a};return d(b).toRgbString()},P.interpolate=function(o,u,s){var h=d(o).toRgb(),m=d(u).toRgb(),b={r:s*h.r+(1-s)*m.r,g:s*h.g+(1-s)*m.g,b:s*h.b+(1-s)*m.b};return d(b).toRgbString()},P.contrast=function(o,u,s){var h=d(o);h.getAlpha()!==1&&(h=d(P.combine(o,a)));var m=h.isDark()?u?h.lighten(u):a:s?h.darken(s):n;return m.toString()},P.stroke=function(o,u){var s=d(u);o.style({stroke:P.tinyRGB(s),"stroke-opacity":s.getAlpha()})},P.fill=function(o,u){var s=d(u);o.style({fill:P.tinyRGB(s),"fill-opacity":s.getAlpha()})},P.clean=function(o){if(!(!o||typeof o!="object")){var u=Object.keys(o),s,h,m,b;for(s=0;s=0)))return o;if(b===3)h[b]>1&&(h[b]=1);else if(h[b]>=1)return o}var x=Math.round(h[0]*255)+", "+Math.round(h[1]*255)+", "+Math.round(h[2]*255);return m?"rgba("+x+", "+h[3]+")":"rgb("+x+")"}}),oo=Fe((te,Y)=>{Y.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),go=Fe(te=>{te.counter=function(Y,d,y,z){var P=(d||"")+(y?"":"$"),i=z===!1?"":"^";return Y==="xy"?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+P):new RegExp(i+Y+"([2-9]|[1-9][0-9]+)?"+P)}}),ko=Fe(te=>{var Y=Ar(),d=sn(),y=an().extendFlat,z=_a(),P=Ur(),i=Xi(),n=oo().DESELECTDIM,a=qn(),l=go().counter,o=Yn().modHalf,u=Di().isArrayOrTypedArray,s=Di().isTypedArraySpec,h=Di().decodeTypedArraySpec;te.valObjectMeta={data_array:{coerceFunction:function(b,x,_){x.set(u(b)?b:s(b)?h(b):_)}},enumerated:{coerceFunction:function(b,x,_,A){A.coerceNumber&&(b=+b),A.values.indexOf(b)===-1?x.set(_):x.set(b)},validateFunction:function(b,x){x.coerceNumber&&(b=+b);for(var _=x.values,A=0;A<_.length;A++){var f=String(_[A]);if(f.charAt(0)==="/"&&f.charAt(f.length-1)==="/"){var k=new RegExp(f.substr(1,f.length-2));if(k.test(b))return!0}else if(b===_[A])return!0}return!1}},boolean:{coerceFunction:function(b,x,_){b===!0||b===!1?x.set(b):x.set(_)}},number:{coerceFunction:function(b,x,_,A){s(b)&&(b=h(b)),!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},integer:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}s(b)&&(b=h(b)),b%1||!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},string:{coerceFunction:function(b,x,_,A){if(typeof b!="string"){var f=typeof b=="number";A.strict===!0||!f?x.set(_):x.set(String(b))}else A.noBlank&&!b?x.set(_):x.set(b)}},color:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),d(b).isValid()?x.set(b):x.set(_)}},colorlist:{coerceFunction:function(b,x,_){function A(f){return d(f).isValid()}!Array.isArray(b)||!b.length?x.set(_):b.every(A)?x.set(b):x.set(_)}},colorscale:{coerceFunction:function(b,x,_){x.set(P.get(b,_))}},angle:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),b==="auto"?x.set("auto"):Y(b)?x.set(o(+b,360)):x.set(_)}},subplotid:{coerceFunction:function(b,x,_,A){var f=A.regex||l(_);if(typeof b=="string"&&f.test(b)){x.set(b);return}x.set(_)},validateFunction:function(b,x){var _=x.dflt;return b===_?!0:typeof b!="string"?!1:!!l(_).test(b)}},flaglist:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}if(typeof b!="string"){x.set(_);return}for(var f=b.split("+"),k=0;k{var d={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},y={};function z(P,i){for(var n in P){var a=P[n];a.valType?i[n]=a.dflt:(i[n]||(i[n]={}),z(a,i[n]))}}z(d,y),Y.exports={configAttributes:d,dfltConfig:y}}),ys=Fe((te,Y)=>{var d=ii(),y=Ar(),z=[];Y.exports=function(P,i){if(z.indexOf(P)!==-1)return;z.push(P);var n=1e3;y(i)?n=i:i==="long"&&(n=3e3);var a=d.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var l=a.selectAll(".notifier-note").data(z);function o(u){u.duration(700).style("opacity",0).each("end",function(s){var h=z.indexOf(s);h!==-1&&z.splice(h,1),d.select(this).remove()})}l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(u){var s=d.select(this);s.append("button").classed("notifier-close",!0).html("×").on("click",function(){s.transition().call(o)});for(var h=s.append("p"),m=u.split(//g),b=0;b{var d=ss().dfltConfig,y=ys(),z=Y.exports={};z.log=function(){var P;if(d.logging>1){var i=["LOG:"];for(P=0;P1){var n=[];for(P=0;P"),"long")}},z.warn=function(){var P;if(d.logging>0){var i=["WARN:"];for(P=0;P0){var n=[];for(P=0;P"),"stick")}},z.error=function(){var P;if(d.logging>0){var i=["ERROR:"];for(P=0;P0){var n=[];for(P=0;P"),"stick")}}}),Qo=Fe((te,Y)=>{Y.exports=function(){}}),Rl=Fe((te,Y)=>{Y.exports=function(d,y){if(y instanceof RegExp){for(var z=y.toString(),P=0;P{Y.exports=d;function d(){var y=new Float32Array(16);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),ql=Fe((te,Y)=>{Y.exports=d;function d(y){var z=new Float32Array(16);return z[0]=y[0],z[1]=y[1],z[2]=y[2],z[3]=y[3],z[4]=y[4],z[5]=y[5],z[6]=y[6],z[7]=y[7],z[8]=y[8],z[9]=y[9],z[10]=y[10],z[11]=y[11],z[12]=y[12],z[13]=y[13],z[14]=y[14],z[15]=y[15],z}}),Su=Fe((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),uc=Fe((te,Y)=>{Y.exports=d;function d(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Th=Fe((te,Y)=>{Y.exports=d;function d(y,z){if(y===z){var P=z[1],i=z[2],n=z[3],a=z[6],l=z[7],o=z[11];y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=P,y[6]=z[9],y[7]=z[13],y[8]=i,y[9]=a,y[11]=z[14],y[12]=n,y[13]=l,y[14]=o}else y[0]=z[0],y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=z[1],y[5]=z[5],y[6]=z[9],y[7]=z[13],y[8]=z[2],y[9]=z[6],y[10]=z[10],y[11]=z[14],y[12]=z[3],y[13]=z[7],y[14]=z[11],y[15]=z[15];return y}}),Gc=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=z[4],o=z[5],u=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],f=z[14],k=z[15],w=P*o-i*l,D=P*u-n*l,E=P*s-a*l,I=i*u-n*o,M=i*s-a*o,p=n*s-a*u,g=h*A-m*_,C=h*f-b*_,T=h*k-x*_,N=m*f-b*A,B=m*k-x*A,U=b*k-x*f,V=w*U-D*B+E*N+I*T-M*C+p*g;return V?(V=1/V,y[0]=(o*U-u*B+s*N)*V,y[1]=(n*B-i*U-a*N)*V,y[2]=(A*p-f*M+k*I)*V,y[3]=(b*M-m*p-x*I)*V,y[4]=(u*T-l*U-s*C)*V,y[5]=(P*U-n*T+a*C)*V,y[6]=(f*E-_*p-k*D)*V,y[7]=(h*p-b*E+x*D)*V,y[8]=(l*B-o*T+s*g)*V,y[9]=(i*T-P*B-a*g)*V,y[10]=(_*M-A*E+k*w)*V,y[11]=(m*E-h*M-x*w)*V,y[12]=(o*C-l*N-u*g)*V,y[13]=(P*N-i*C+n*g)*V,y[14]=(A*D-_*I-f*w)*V,y[15]=(h*I-m*D+b*w)*V,y):null}}),Bp=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=z[4],o=z[5],u=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],f=z[14],k=z[15];return y[0]=o*(b*k-x*f)-m*(u*k-s*f)+A*(u*x-s*b),y[1]=-(i*(b*k-x*f)-m*(n*k-a*f)+A*(n*x-a*b)),y[2]=i*(u*k-s*f)-o*(n*k-a*f)+A*(n*s-a*u),y[3]=-(i*(u*x-s*b)-o*(n*x-a*b)+m*(n*s-a*u)),y[4]=-(l*(b*k-x*f)-h*(u*k-s*f)+_*(u*x-s*b)),y[5]=P*(b*k-x*f)-h*(n*k-a*f)+_*(n*x-a*b),y[6]=-(P*(u*k-s*f)-l*(n*k-a*f)+_*(n*s-a*u)),y[7]=P*(u*x-s*b)-l*(n*x-a*b)+h*(n*s-a*u),y[8]=l*(m*k-x*A)-h*(o*k-s*A)+_*(o*x-s*m),y[9]=-(P*(m*k-x*A)-h*(i*k-a*A)+_*(i*x-a*m)),y[10]=P*(o*k-s*A)-l*(i*k-a*A)+_*(i*s-a*o),y[11]=-(P*(o*x-s*m)-l*(i*x-a*m)+h*(i*s-a*o)),y[12]=-(l*(m*f-b*A)-h*(o*f-u*A)+_*(o*b-u*m)),y[13]=P*(m*f-b*A)-h*(i*f-n*A)+_*(i*b-n*m),y[14]=-(P*(o*f-u*A)-l*(i*f-n*A)+_*(i*u-n*o)),y[15]=P*(o*b-u*m)-l*(i*b-n*m)+h*(i*u-n*o),y}}),wp=Fe((te,Y)=>{Y.exports=d;function d(y){var z=y[0],P=y[1],i=y[2],n=y[3],a=y[4],l=y[5],o=y[6],u=y[7],s=y[8],h=y[9],m=y[10],b=y[11],x=y[12],_=y[13],A=y[14],f=y[15],k=z*l-P*a,w=z*o-i*a,D=z*u-n*a,E=P*o-i*l,I=P*u-n*l,M=i*u-n*o,p=s*_-h*x,g=s*A-m*x,C=s*f-b*x,T=h*A-m*_,N=h*f-b*_,B=m*f-b*A;return k*B-w*N+D*T+E*C-I*g+M*p}}),W0=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=z[0],n=z[1],a=z[2],l=z[3],o=z[4],u=z[5],s=z[6],h=z[7],m=z[8],b=z[9],x=z[10],_=z[11],A=z[12],f=z[13],k=z[14],w=z[15],D=P[0],E=P[1],I=P[2],M=P[3];return y[0]=D*i+E*o+I*m+M*A,y[1]=D*n+E*u+I*b+M*f,y[2]=D*a+E*s+I*x+M*k,y[3]=D*l+E*h+I*_+M*w,D=P[4],E=P[5],I=P[6],M=P[7],y[4]=D*i+E*o+I*m+M*A,y[5]=D*n+E*u+I*b+M*f,y[6]=D*a+E*s+I*x+M*k,y[7]=D*l+E*h+I*_+M*w,D=P[8],E=P[9],I=P[10],M=P[11],y[8]=D*i+E*o+I*m+M*A,y[9]=D*n+E*u+I*b+M*f,y[10]=D*a+E*s+I*x+M*k,y[11]=D*l+E*h+I*_+M*w,D=P[12],E=P[13],I=P[14],M=P[15],y[12]=D*i+E*o+I*m+M*A,y[13]=D*n+E*u+I*b+M*f,y[14]=D*a+E*s+I*x+M*k,y[15]=D*l+E*h+I*_+M*w,y}}),um=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=P[0],n=P[1],a=P[2],l,o,u,s,h,m,b,x,_,A,f,k;return z===y?(y[12]=z[0]*i+z[4]*n+z[8]*a+z[12],y[13]=z[1]*i+z[5]*n+z[9]*a+z[13],y[14]=z[2]*i+z[6]*n+z[10]*a+z[14],y[15]=z[3]*i+z[7]*n+z[11]*a+z[15]):(l=z[0],o=z[1],u=z[2],s=z[3],h=z[4],m=z[5],b=z[6],x=z[7],_=z[8],A=z[9],f=z[10],k=z[11],y[0]=l,y[1]=o,y[2]=u,y[3]=s,y[4]=h,y[5]=m,y[6]=b,y[7]=x,y[8]=_,y[9]=A,y[10]=f,y[11]=k,y[12]=l*i+h*n+_*a+z[12],y[13]=o*i+m*n+A*a+z[13],y[14]=u*i+b*n+f*a+z[14],y[15]=s*i+x*n+k*a+z[15]),y}}),Vg=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=P[0],n=P[1],a=P[2];return y[0]=z[0]*i,y[1]=z[1]*i,y[2]=z[2]*i,y[3]=z[3]*i,y[4]=z[4]*n,y[5]=z[5]*n,y[6]=z[6]*n,y[7]=z[7]*n,y[8]=z[8]*a,y[9]=z[9]*a,y[10]=z[10]*a,y[11]=z[11]*a,y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),q1=Fe((te,Y)=>{Y.exports=d;function d(y,z,P,i){var n=i[0],a=i[1],l=i[2],o=Math.sqrt(n*n+a*a+l*l),u,s,h,m,b,x,_,A,f,k,w,D,E,I,M,p,g,C,T,N,B,U,V,W;return Math.abs(o)<1e-6?null:(o=1/o,n*=o,a*=o,l*=o,u=Math.sin(P),s=Math.cos(P),h=1-s,m=z[0],b=z[1],x=z[2],_=z[3],A=z[4],f=z[5],k=z[6],w=z[7],D=z[8],E=z[9],I=z[10],M=z[11],p=n*n*h+s,g=a*n*h+l*u,C=l*n*h-a*u,T=n*a*h-l*u,N=a*a*h+s,B=l*a*h+n*u,U=n*l*h+a*u,V=a*l*h-n*u,W=l*l*h+s,y[0]=m*p+A*g+D*C,y[1]=b*p+f*g+E*C,y[2]=x*p+k*g+I*C,y[3]=_*p+w*g+M*C,y[4]=m*T+A*N+D*B,y[5]=b*T+f*N+E*B,y[6]=x*T+k*N+I*B,y[7]=_*T+w*N+M*B,y[8]=m*U+A*V+D*W,y[9]=b*U+f*V+E*W,y[10]=x*U+k*V+I*W,y[11]=_*U+w*V+M*W,z!==y&&(y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y)}}),Rp=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[4],l=z[5],o=z[6],u=z[7],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[4]=a*n+s*i,y[5]=l*n+h*i,y[6]=o*n+m*i,y[7]=u*n+b*i,y[8]=s*n-a*i,y[9]=h*n-l*i,y[10]=m*n-o*i,y[11]=b*n-u*i,y}}),cm=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[0],l=z[1],o=z[2],u=z[3],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*n-s*i,y[1]=l*n-h*i,y[2]=o*n-m*i,y[3]=u*n-b*i,y[8]=a*i+s*n,y[9]=l*i+h*n,y[10]=o*i+m*n,y[11]=u*i+b*n,y}}),Wg=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[0],l=z[1],o=z[2],u=z[3],s=z[4],h=z[5],m=z[6],b=z[7];return z!==y&&(y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*n+s*i,y[1]=l*n+h*i,y[2]=o*n+m*i,y[3]=u*n+b*i,y[4]=s*n-a*i,y[5]=h*n-l*i,y[6]=m*n-o*i,y[7]=b*n-u*i,y}}),Zx=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i,n,a,l=P[0],o=P[1],u=P[2],s=Math.sqrt(l*l+o*o+u*u);return Math.abs(s)<1e-6?null:(s=1/s,l*=s,o*=s,u*=s,i=Math.sin(z),n=Math.cos(z),a=1-n,y[0]=l*l*a+n,y[1]=o*l*a+u*i,y[2]=u*l*a-o*i,y[3]=0,y[4]=l*o*a-u*i,y[5]=o*o*a+n,y[6]=u*o*a+l*i,y[7]=0,y[8]=l*u*a+o*i,y[9]=o*u*a-l*i,y[10]=u*u*a+n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y)}}),qS=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){var i=z[0],n=z[1],a=z[2],l=z[3],o=i+i,u=n+n,s=a+a,h=i*o,m=i*u,b=i*s,x=n*u,_=n*s,A=a*s,f=l*o,k=l*u,w=l*s;return y[0]=1-(x+A),y[1]=m+w,y[2]=b-k,y[3]=0,y[4]=m-w,y[5]=1-(h+A),y[6]=_+f,y[7]=0,y[8]=b+k,y[9]=_-f,y[10]=1-(h+x),y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y}}),d4=Fe((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=z[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=z[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=z[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),p4=Fe((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=z[0],y[13]=z[1],y[14]=z[2],y[15]=1,y}}),m4=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=i,y[6]=P,y[7]=0,y[8]=0,y[9]=-P,y[10]=i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),GS=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=i,y[1]=0,y[2]=-P,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=P,y[9]=0,y[10]=i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),ZS=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=i,y[1]=P,y[2]=0,y[3]=0,y[4]=-P,y[5]=i,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),KS=Fe((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=P+P,o=i+i,u=n+n,s=P*l,h=i*l,m=i*o,b=n*l,x=n*o,_=n*u,A=a*l,f=a*o,k=a*u;return y[0]=1-m-_,y[1]=h+k,y[2]=b-f,y[3]=0,y[4]=h-k,y[5]=1-s-_,y[6]=x+A,y[7]=0,y[8]=b+f,y[9]=x-A,y[10]=1-s-m,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),YS=Fe((te,Y)=>{Y.exports=d;function d(y,z,P,i,n,a,l){var o=1/(P-z),u=1/(n-i),s=1/(a-l);return y[0]=a*2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a*2*u,y[6]=0,y[7]=0,y[8]=(P+z)*o,y[9]=(n+i)*u,y[10]=(l+a)*s,y[11]=-1,y[12]=0,y[13]=0,y[14]=l*a*2*s,y[15]=0,y}}),XS=Fe((te,Y)=>{Y.exports=d;function d(y,z,P,i,n){var a=1/Math.tan(z/2),l=1/(i-n);return y[0]=a/P,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=(n+i)*l,y[11]=-1,y[12]=0,y[13]=0,y[14]=2*n*i*l,y[15]=0,y}}),JS=Fe((te,Y)=>{Y.exports=d;function d(y,z,P,i){var n=Math.tan(z.upDegrees*Math.PI/180),a=Math.tan(z.downDegrees*Math.PI/180),l=Math.tan(z.leftDegrees*Math.PI/180),o=Math.tan(z.rightDegrees*Math.PI/180),u=2/(l+o),s=2/(n+a);return y[0]=u,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=s,y[6]=0,y[7]=0,y[8]=-((l-o)*u*.5),y[9]=(n-a)*s*.5,y[10]=i/(P-i),y[11]=-1,y[12]=0,y[13]=0,y[14]=i*P/(P-i),y[15]=0,y}}),Q2=Fe((te,Y)=>{Y.exports=d;function d(y,z,P,i,n,a,l){var o=1/(z-P),u=1/(i-n),s=1/(a-l);return y[0]=-2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*u,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*s,y[11]=0,y[12]=(z+P)*o,y[13]=(n+i)*u,y[14]=(l+a)*s,y[15]=1,y}}),QS=Fe((te,Y)=>{var d=uc();Y.exports=y;function y(z,P,i,n){var a,l,o,u,s,h,m,b,x,_,A=P[0],f=P[1],k=P[2],w=n[0],D=n[1],E=n[2],I=i[0],M=i[1],p=i[2];return Math.abs(A-I)<1e-6&&Math.abs(f-M)<1e-6&&Math.abs(k-p)<1e-6?d(z):(m=A-I,b=f-M,x=k-p,_=1/Math.sqrt(m*m+b*b+x*x),m*=_,b*=_,x*=_,a=D*x-E*b,l=E*m-w*x,o=w*b-D*m,_=Math.sqrt(a*a+l*l+o*o),_?(_=1/_,a*=_,l*=_,o*=_):(a=0,l=0,o=0),u=b*o-x*l,s=x*a-m*o,h=m*l-b*a,_=Math.sqrt(u*u+s*s+h*h),_?(_=1/_,u*=_,s*=_,h*=_):(u=0,s=0,h=0),z[0]=a,z[1]=u,z[2]=m,z[3]=0,z[4]=l,z[5]=s,z[6]=b,z[7]=0,z[8]=o,z[9]=h,z[10]=x,z[11]=0,z[12]=-(a*A+l*f+o*k),z[13]=-(u*A+s*f+h*k),z[14]=-(m*A+b*f+x*k),z[15]=1,z)}}),e8=Fe((te,Y)=>{Y.exports=d;function d(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")"}}),g4=Fe((te,Y)=>{Y.exports={create:Ws(),clone:ql(),copy:Su(),identity:uc(),transpose:Th(),invert:Gc(),adjoint:Bp(),determinant:wp(),multiply:W0(),translate:um(),scale:Vg(),rotate:q1(),rotateX:Rp(),rotateY:cm(),rotateZ:Wg(),fromRotation:Zx(),fromRotationTranslation:qS(),fromScaling:d4(),fromTranslation:p4(),fromXRotation:m4(),fromYRotation:GS(),fromZRotation:ZS(),fromQuat:KS(),frustum:YS(),perspective:XS(),perspectiveFromFieldOfView:JS(),ortho:Q2(),lookAt:QS(),str:e8()}}),ew=Fe(te=>{var Y=g4();te.init2dArray=function(d,y){for(var z=new Array(d),P=0;P{var d=ii(),y=ns(),z=ew(),P=g4();function i(A){var f;if(typeof A=="string"){if(f=document.getElementById(A),f===null)throw new Error("No DOM element with id '"+A+"' exists on the page.");return f}else if(A==null)throw new Error("DOM element provided is null or undefined");return A}function n(A){var f=d.select(A);return f.node()instanceof HTMLElement&&f.size()&&f.classed("js-plotly-plot")}function a(A){var f=A&&A.parentNode;f&&f.removeChild(A)}function l(A,f){o("global",A,f)}function o(A,f,k){var w="plotly.js-style-"+A,D=document.getElementById(w);if(!(D&&D.matches(".no-inline-styles"))){D||(D=document.createElement("style"),D.setAttribute("id",w),D.appendChild(document.createTextNode("")),document.head.appendChild(D));var E=D.sheet;E?E.insertRule?E.insertRule(f+"{"+k+"}",0):E.addRule?E.addRule(f,k,0):y.warn("addStyleRule failed"):y.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function u(A){var f="plotly.js-style-"+A,k=document.getElementById(f);k&&a(k)}function s(A,f,k,w,D,E){var I=w.split(":"),M=D.split(":"),p="data-btn-style-event-added";E||(E=document),E.querySelectorAll(A).forEach(function(g){g.getAttribute(p)||(g.addEventListener("mouseenter",function(){var C=this.querySelector(k);C&&(C.style[I[0]]=I[1])}),g.addEventListener("mouseleave",function(){var C=this.querySelector(k);C&&(f&&this.matches(f)?C.style[I[0]]=I[1]:C.style[M[0]]=M[1])}),g.setAttribute(p,!0))})}function h(A){var f=b(A),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return f.forEach(function(w){var D=m(w);if(D){var E=z.convertCssMatrix(D);k=P.multiply(k,k,E)}}),k}function m(A){var f=window.getComputedStyle(A,null),k=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("-moz-transform")||f.getPropertyValue("-ms-transform")||f.getPropertyValue("-o-transform")||f.getPropertyValue("transform");return k==="none"?null:k.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(w){return+w})}function b(A){for(var f=[];x(A);)f.push(A),A=A.parentNode,typeof ShadowRoot=="function"&&A instanceof ShadowRoot&&(A=A.host);return f}function x(A){return A&&(A instanceof Element||A instanceof HTMLElement)}function _(A,f){return A&&f&&A.top===f.top&&A.left===f.left&&A.right===f.right&&A.bottom===f.bottom}Y.exports={getGraphDiv:i,isPlotDiv:n,removeElement:a,addStyleRule:l,addRelatedStyleRule:o,deleteRelatedStyleRule:u,setStyleOnHover:s,getFullTransformMatrix:h,getElementTransformMatrix:m,getElementAndAncestors:b,equalDomRects:_}}),Fl=Fe((te,Y)=>{Y.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),oh=Fe((te,Y)=>{var d=an().extendFlat,y=ei(),z={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},P={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},i=z.flags.slice().concat(["fullReplot"]),n=P.flags.slice().concat("layoutReplot");Y.exports={traces:z,layout:P,traceFlags:function(){return a(i)},layoutFlags:function(){return a(n)},update:function(u,s){var h=s.editType;if(h&&h!=="none")for(var m=h.split("+"),b=0;b{te.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},te.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),tw=Fe((te,Y)=>{Y.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),rc=Fe(te=>{var{DATE_FORMAT_LINK:Y,FORMAT_LINK:d}=tw(),y=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function z({supportOther:P}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(P?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,d,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,Y,"for details on the date formatting syntax.",y].join(" ")}te.templateFormatStringDescription=z,te.hovertemplateAttrs=({editType:P="none",arrayOk:i}={},n={})=>kt({valType:"string",dflt:"",editType:P},i!==!1?{arrayOk:!0}:{}),te.texttemplateAttrs=({editType:P="calc",arrayOk:i}={},n={})=>kt({valType:"string",dflt:"",editType:P},i!==!1?{arrayOk:!0}:{}),te.shapeTexttemplateAttrs=({editType:P="arraydraw",newshape:i}={},n={})=>({valType:"string",dflt:"",editType:P}),te.templatefallbackAttrs=({editType:P="none"}={})=>({valType:"any",dflt:"-",editType:P})}),v_=Fe((te,Y)=>{function d(k,w){return w?w.d2l(k):k}function y(k,w){return w?w.l2d(k):k}function z(k){return k.x0}function P(k){return k.x1}function i(k){return k.y0}function n(k){return k.y1}function a(k){return k.x0shift||0}function l(k){return k.x1shift||0}function o(k){return k.y0shift||0}function u(k){return k.y1shift||0}function s(k,w){return d(k.x1,w)+l(k)-d(k.x0,w)-a(k)}function h(k,w,D){return d(k.y1,D)+u(k)-d(k.y0,D)-o(k)}function m(k,w){return Math.abs(s(k,w))}function b(k,w,D){return Math.abs(h(k,w,D))}function x(k,w,D){return k.type!=="line"?void 0:Math.sqrt(Math.pow(s(k,w),2)+Math.pow(h(k,w,D),2))}function _(k,w){return y((d(k.x1,w)+l(k)+d(k.x0,w)+a(k))/2,w)}function A(k,w,D){return y((d(k.y1,D)+u(k)+d(k.y0,D)+o(k))/2,D)}function f(k,w,D){return k.type!=="line"?void 0:h(k,w,D)/s(k,w)}Y.exports={x0:z,x1:P,y0:i,y1:n,slope:f,dx:s,dy:h,width:m,height:b,length:x,xcenter:_,ycenter:A}}),v4=Fe((te,Y)=>{var d=oh().overrideAll,y=_a(),z=zn(),P=Wd().dash,i=an().extendFlat,{shapeTexttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=v_();Y.exports=d({newshape:{visible:i({},y.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:i({},y.legend,{}),legendgroup:i({},y.legendgroup,{}),legendgrouptitle:{text:i({},y.legendgrouptitle.text,{}),font:z({})},legendrank:i({},y.legendrank,{}),legendwidth:i({},y.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:i({},P,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:i({},y.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:n({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:a({editType:"arraydraw"}),font:z({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),G1=Fe((te,Y)=>{var d=Wd().dash,y=an().extendFlat;Y.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:y({},d,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Kx=Fe((te,Y)=>{Y.exports=function(d){var y=d.editType;return{t:{valType:"number",dflt:0,editType:y},r:{valType:"number",dflt:0,editType:y},b:{valType:"number",dflt:0,editType:y},l:{valType:"number",dflt:0,editType:y},editType:y}}}),y_=Fe((te,Y)=>{var d=zn(),y=Fl(),z=Mi(),P=v4(),i=G1(),n=Kx(),a=an().extendFlat,l=d({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=z.defaultLine,Y.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:a(n({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:z.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:z.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:z.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:P.newshape,activeshape:P.activeshape,newselection:i.newselection,activeselection:i.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:a({},y.transition,{editType:"none"})}}),t8=Fe(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var te=document.createElement("style");te.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",te.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(te)}})()}),as=Fe(te=>{var Y=ns(),d=Qo(),y=Rl(),z=ei(),P=q0().addStyleRule,i=an(),n=_a(),a=y_(),l=i.extendFlat,o=i.extendDeepAll;te.modules={},te.allCategories={},te.allTypes=[],te.subplotsRegistry={},te.componentsRegistry={},te.layoutArrayContainers=[],te.layoutArrayRegexes=[],te.traceLayoutAttributes={},te.localeRegistry={},te.apiMethodRegistry={},te.collectableSubplotTypes=null,te.register=function(k){if(te.collectableSubplotTypes=null,k)k&&!Array.isArray(k)&&(k=[k]);else throw new Error("No argument passed to Plotly.register.");for(var w=0;w{var Y=vi().timeFormat,d=Ar(),y=ns(),z=Yn().mod,P=ti(),i=P.BADNUM,n=P.ONEDAY,a=P.ONEHOUR,l=P.ONEMIN,o=P.ONESEC,u=P.EPOCHJD,s=as(),h=vi().utcFormat,m=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=new Date().getFullYear()-70;function _(V){return V&&s.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}te.dateTick0=function(V,W){var F=A(V,!!W);if(W<2)return F;var $=te.dateTime2ms(F,V);return $+=n*(W-1),te.ms2DateTime($,0,V)};function A(V,W){return _(V)?W?s.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:s.getComponentMethod("calendars","CANONICAL_TICK")[V]:W?"2000-01-02":"2000-01-01"}te.dfltRange=function(V){return _(V)?s.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},te.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var f,k;te.dateTime2ms=function(V,W){if(te.isJSDate(V)){var F=V.getTimezoneOffset()*l,$=(V.getUTCMinutes()-V.getMinutes())*l+(V.getUTCSeconds()-V.getSeconds())*o+(V.getUTCMilliseconds()-V.getMilliseconds());if($){var q=3*l;F=F-q/2+z($-F+q/2,q)}return V=Number(V)-F,V>=f&&V<=k?V:i}if(typeof V!="string"&&typeof V!="number")return i;V=String(V);var G=_(W),ee=V.charAt(0);G&&(ee==="G"||ee==="g")&&(V=V.substr(1),W="");var he=G&&W.substr(0,7)==="chinese",xe=V.match(he?b:m);if(!xe)return i;var ve=xe[1],ce=xe[3]||"1",re=Number(xe[5]||1),ge=Number(xe[7]||0),ne=Number(xe[9]||0),se=Number(xe[11]||0);if(G){if(ve.length===2)return i;ve=Number(ve);var _e;try{var oe=s.getComponentMethod("calendars","getCal")(W);if(he){var J=ce.charAt(ce.length-1)==="i";ce=parseInt(ce,10),_e=oe.newDate(ve,oe.toMonthIndex(ve,ce,J),re)}else _e=oe.newDate(ve,Number(ce),re)}catch{return i}return _e?(_e.toJD()-u)*n+ge*a+ne*l+se*o:i}ve.length===2?ve=(Number(ve)+2e3-x)%100+x:ve=Number(ve),ce-=1;var me=new Date(Date.UTC(2e3,ce,re,ge,ne));return me.setUTCFullYear(ve),me.getUTCMonth()!==ce||me.getUTCDate()!==re?i:me.getTime()+se*o},f=te.MIN_MS=te.dateTime2ms("-9999"),k=te.MAX_MS=te.dateTime2ms("9999-12-31 23:59:59.9999"),te.isDateTime=function(V,W){return te.dateTime2ms(V,W)!==i};function w(V,W){return String(V+Math.pow(10,W)).substr(1)}var D=90*n,E=3*a,I=5*l;te.ms2DateTime=function(V,W,F){if(typeof V!="number"||!(V>=f&&V<=k))return i;W||(W=0);var $=Math.floor(z(V+.05,1)*10),q=Math.round(V-$/10),G,ee,he,xe,ve,ce;if(_(F)){var re=Math.floor(q/n)+u,ge=Math.floor(z(V,n));try{G=s.getComponentMethod("calendars","getCal")(F).fromJD(re).formatDate("yyyy-mm-dd")}catch{G=h("G%Y-%m-%d")(new Date(q))}if(G.charAt(0)==="-")for(;G.length<11;)G="-0"+G.substr(1);else for(;G.length<10;)G="0"+G;ee=W=f+n&&V<=k-n))return i;var W=Math.floor(z(V+.05,1)*10),F=new Date(Math.round(V-W/10)),$=Y("%Y-%m-%d")(F),q=F.getHours(),G=F.getMinutes(),ee=F.getSeconds(),he=F.getUTCMilliseconds()*10+W;return M($,q,G,ee,he)};function M(V,W,F,$,q){if((W||F||$||q)&&(V+=" "+w(W,2)+":"+w(F,2),($||q)&&(V+=":"+w($,2),q))){for(var G=4;q%10===0;)G-=1,q/=10;V+="."+w(q,G)}return V}te.cleanDate=function(V,W,F){if(V===i)return W;if(te.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(_(F))return y.error("JS Dates and milliseconds are incompatible with world calendars",V),W;if(V=te.ms2DateTimeLocal(+V),!V&&W!==void 0)return W}else if(!te.isDateTime(V,F))return y.error("unrecognized date",V),W;return V};var p=/%\d?f/g,g=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function T(V,W,F,$){V=V.replace(p,function(G){var ee=Math.min(+G.charAt(1)||6,6),he=(W/1e3%1+2).toFixed(ee).substr(2).replace(/0+$/,"")||"0";return he});var q=new Date(Math.floor(W+.05));if(V=V.replace(g,function(){return C[F("%q")(q)]}),_($))try{V=s.getComponentMethod("calendars","worldCalFmt")(V,W,$)}catch{return"Invalid"}return F(V)(q)}var N=[59,59.9,59.99,59.999,59.9999];function B(V,W){var F=z(V+.05,n),$=w(Math.floor(F/a),2)+":"+w(z(Math.floor(F/l),60),2);if(W!=="M"){d(W)||(W=0);var q=Math.min(z(V/o,60),N[W]),G=(100+q).toFixed(W).substr(1);W>0&&(G=G.replace(/0+$/,"").replace(/[\.]$/,"")),$+=":"+G}return $}te.formatDate=function(V,W,F,$,q,G){if(q=_(q)&&q,!W)if(F==="y")W=G.year;else if(F==="m")W=G.month;else if(F==="d")W=G.dayMonth+` + */const Jxe={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};j$._date.override({_id:"date-fns",formats:function(){return Jxe},parse:function(t,e){if(t===null||typeof t>"u")return null;const r=typeof t;return r==="number"||t instanceof Date?t=Ju(t):r==="string"&&(typeof e=="string"?t=Pxe(t,e,new Date,this.options):t=Bxe(t,this.options)),gH(t)?t.getTime():null},format:function(t,e){return D_e(t,e,this.options)},add:function(t,e,r){switch(r){case"millisecond":return XE(t,e);case"second":return wye(t,e);case"minute":return xye(t,e);case"hour":return vye(t,e);case"day":return $8(t,e);case"week":return kye(t,e);case"month":return YE(t,e);case"quarter":return bye(t,e);case"year":return Tye(t,e);default:return t}},diff:function(t,e,r){switch(r){case"millisecond":return JE(t,e);case"second":return Iye(t,e);case"minute":return Eye(t,e);case"hour":return Mye(t,e);case"day":return vH(t,e);case"week":return Dye(t,e);case"month":return xH(t,e);case"quarter":return Pye(t,e);case"year":return zye(t,e);default:return 0}},startOf:function(t,e,r){switch(e){case"second":return Oxe(t);case"minute":return zxe(t);case"hour":return Dxe(t);case"day":return o9(t);case"week":return Dv(t);case"isoWeek":return Dv(t,{weekStartsOn:+r});case"month":return Bye(t);case"quarter":return Oye(t);case"year":return bH(t);default:return t}},endOf:function(t,e){switch(e){case"second":return $ye(t);case"minute":return jye(t);case"hour":return Fye(t);case"day":return yH(t);case"week":return Nye(t);case"month":return _H(t);case"quarter":return Uye(t);case"year":return Rye(t);default:return t}}});var _T={exports:{}},Qxe=_T.exports,mF;function ebe(){return mF||(mF=1,function(t){var e={};(function(r,c){t.exports?t.exports=c():r.moduleName=c()})(typeof self<"u"?self:Qxe,()=>{var r=(()=>{var c=Object.create,S=Object.defineProperty,$=Object.defineProperties,Z=Object.getOwnPropertyDescriptor,ue=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertyNames,Se=Object.getOwnPropertySymbols,Ne=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,bt=(te,Y,d)=>Y in te?S(te,Y,{enumerable:!0,configurable:!0,writable:!0,value:d}):te[Y]=d,wt=(te,Y)=>{for(var d in Y||(Y={}))it.call(Y,d)&&bt(te,d,Y[d]);if(Se)for(var d of Se(Y))pt.call(Y,d)&&bt(te,d,Y[d]);return te},Dt=(te,Y)=>$(te,ue(Y)),Zt=(te,Y)=>{var d={};for(var y in te)it.call(te,y)&&Y.indexOf(y)<0&&(d[y]=te[y]);if(te!=null&&Se)for(var y of Se(te))Y.indexOf(y)<0&&pt.call(te,y)&&(d[y]=te[y]);return d},Mr=(te,Y)=>()=>(te&&(Y=te(te=0)),Y),ze=(te,Y)=>()=>(Y||te((Y={exports:{}}).exports,Y),Y.exports),ni=(te,Y)=>{for(var d in Y)S(te,d,{get:Y[d],enumerable:!0})},or=(te,Y,d,y)=>{if(Y&&typeof Y=="object"||typeof Y=="function")for(let z of xe(Y))!it.call(te,z)&&z!==d&&S(te,z,{get:()=>Y[z],enumerable:!(y=Z(Y,z))||y.enumerable});return te},Cr=(te,Y,d)=>(d=te!=null?c(Ne(te)):{},or(S(d,"default",{value:te,enumerable:!0}),te)),gi=te=>or(S({},"__esModule",{value:!0}),te),Si=ze(te=>{te.version="3.2.0"}),Ci=ze((te,Y)=>{(function(d,y,z){y[d]=y[d]||z(),typeof Y<"u"&&Y.exports&&(Y.exports=y[d])})("Promise",typeof window<"u"?window:te,function(){var d,y,z,P=Object.prototype.toString,i=typeof setImmediate<"u"?function(A){return setImmediate(A)}:setTimeout;try{Object.defineProperty({},"x",{}),d=function(A,f,k,w){return Object.defineProperty(A,f,{value:k,writable:!0,configurable:w!==!1})}}catch{d=function(f,k,w){return f[k]=w,f}}z=function(){var A,f,k;function w(D,E){this.fn=D,this.self=E,this.next=void 0}return{add:function(D,E){k=new w(D,E),f?f.next=k:A=k,f=k,k=void 0},drain:function(){var D=A;for(A=f=y=void 0;D;)D.fn.call(D.self),D=D.next}}}();function n(A,f){z.add(A,f),y||(y=i(z.drain))}function a(A){var f,k=typeof A;return A!=null&&(k=="object"||k=="function")&&(f=A.then),typeof f=="function"?f:!1}function l(){for(var A=0;A0&&n(l,k))}catch(w){s.call(new m(k),w)}}}function s(A){var f=this;f.triggered||(f.triggered=!0,f.def&&(f=f.def),f.msg=A,f.state=2,f.chain.length>0&&n(l,f))}function h(A,f,k,w){for(var D=0;D{(function(){var d={version:"3.8.2"},y=[].slice,z=function(Me){return y.call(Me)},P=self.document;function i(Me){return Me&&(Me.ownerDocument||Me.document||Me).documentElement}function n(Me){return Me&&(Me.ownerDocument&&Me.ownerDocument.defaultView||Me.document&&Me||Me.defaultView)}if(P)try{z(P.documentElement.childNodes)[0].nodeType}catch{z=function(Ve){for(var ft=Ve.length,Pt=new Array(ft);ft--;)Pt[ft]=Ve[ft];return Pt}}if(Date.now||(Date.now=function(){return+new Date}),P)try{P.createElement("DIV").style.setProperty("opacity",0,"")}catch{var a=this.Element.prototype,l=a.setAttribute,o=a.setAttributeNS,u=this.CSSStyleDeclaration.prototype,s=u.setProperty;a.setAttribute=function(Ve,ft){l.call(this,Ve,ft+"")},a.setAttributeNS=function(Ve,ft,Pt){o.call(this,Ve,ft,Pt+"")},u.setProperty=function(Ve,ft,Pt){s.call(this,Ve,ft+"",Pt)}}d.ascending=h;function h(Me,Ve){return MeVe?1:Me>=Ve?0:NaN}d.descending=function(Me,Ve){return VeMe?1:Ve>=Me?0:NaN},d.min=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht;if(arguments.length===1){for(;++ft=Ht){Bt=Ht;break}for(;++ftHt&&(Bt=Ht)}else{for(;++ft=Ht){Bt=Ht;break}for(;++ftHt&&(Bt=Ht)}return Bt},d.max=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht;if(arguments.length===1){for(;++ft=Ht){Bt=Ht;break}for(;++ftBt&&(Bt=Ht)}else{for(;++ft=Ht){Bt=Ht;break}for(;++ftBt&&(Bt=Ht)}return Bt},d.extent=function(Me,Ve){var ft=-1,Pt=Me.length,Bt,Ht,dr;if(arguments.length===1){for(;++ft=Ht){Bt=dr=Ht;break}for(;++ftHt&&(Bt=Ht),dr=Ht){Bt=dr=Ht;break}for(;++ftHt&&(Bt=Ht),dr1)return dr/(Or-1)},d.deviation=function(){var Me=d.variance.apply(this,arguments);return Me&&Math.sqrt(Me)};function x(Me){return{left:function(Ve,ft,Pt,Bt){for(arguments.length<3&&(Pt=0),arguments.length<4&&(Bt=Ve.length);Pt>>1;Me(Ve[Ht],ft)<0?Pt=Ht+1:Bt=Ht}return Pt},right:function(Ve,ft,Pt,Bt){for(arguments.length<3&&(Pt=0),arguments.length<4&&(Bt=Ve.length);Pt>>1;Me(Ve[Ht],ft)>0?Bt=Ht:Pt=Ht+1}return Pt}}}var _=x(h);d.bisectLeft=_.left,d.bisect=d.bisectRight=_.right,d.bisector=function(Me){return x(Me.length===1?function(Ve,ft){return h(Me(Ve),ft)}:Me)},d.shuffle=function(Me,Ve,ft){(Pt=arguments.length)<3&&(ft=Me.length,Pt<2&&(Ve=0));for(var Pt=ft-Ve,Bt,Ht;Pt;)Ht=Math.random()*Pt--|0,Bt=Me[Pt+Ve],Me[Pt+Ve]=Me[Ht+Ve],Me[Ht+Ve]=Bt;return Me},d.permute=function(Me,Ve){for(var ft=Ve.length,Pt=new Array(ft);ft--;)Pt[ft]=Me[Ve[ft]];return Pt},d.pairs=function(Me){for(var Ve=0,ft=Me.length-1,Pt,Bt=Me[0],Ht=new Array(ft<0?0:ft);Ve=0;)for(dr=Me[Ve],ft=dr.length;--ft>=0;)Ht[--Bt]=dr[ft];return Ht};var f=Math.abs;d.range=function(Me,Ve,ft){if(arguments.length<3&&(ft=1,arguments.length<2&&(Ve=Me,Me=0)),(Ve-Me)/ft===1/0)throw new Error("infinite range");var Pt=[],Bt=k(f(ft)),Ht=-1,dr;if(Me*=Bt,Ve*=Bt,ft*=Bt,ft<0)for(;(dr=Me+ft*++Ht)>Ve;)Pt.push(dr/Bt);else for(;(dr=Me+ft*++Ht)=Ve.length)return Bt?Bt.call(Me,Or):Pt?Or.sort(Pt):Or;for(var hi=-1,Bi=Or.length,Yi=Ve[mi++],Ji,ta,sn,Bn=new D,$n;++hi=Ve.length)return cr;var mi=[],hi=ft[Or++];return cr.forEach(function(Bi,Yi){mi.push({key:Bi,values:dr(Yi,Or)})}),hi?mi.sort(function(Bi,Yi){return hi(Bi.key,Yi.key)}):mi}return Me.map=function(cr,Or){return Ht(Or,cr,0)},Me.entries=function(cr){return dr(Ht(d.map,cr,0),0)},Me.key=function(cr){return Ve.push(cr),Me},Me.sortKeys=function(cr){return ft[Ve.length-1]=cr,Me},Me.sortValues=function(cr){return Pt=cr,Me},Me.rollup=function(cr){return Bt=cr,Me},Me},d.set=function(Me){var Ve=new U;if(Me)for(var ft=0,Pt=Me.length;ft=0&&(Pt=Me.slice(ft+1),Me=Me.slice(0,ft)),Me)return arguments.length<2?this[Me].on(Pt):this[Me].on(Pt,Ve);if(arguments.length===2){if(Ve==null)for(Me in this)this.hasOwnProperty(Me)&&this[Me].on(Pt,null);return this}};function ee(Me){var Ve=[],ft=new D;function Pt(){for(var Bt=Ve,Ht=-1,dr=Bt.length,cr;++Ht=0&&(ft=Me.slice(0,Ve))!=="xmlns"&&(Me=Me.slice(Ve+1)),Ce.hasOwnProperty(ft)?{space:Ce[ft],local:Me}:Me}},oe.attr=function(Me,Ve){if(arguments.length<2){if(typeof Me=="string"){var ft=this.node();return Me=d.ns.qualify(Me),Me.local?ft.getAttributeNS(Me.space,Me.local):ft.getAttribute(Me)}for(Ve in Me)this.each(Re(Ve,Me[Ve]));return this}return this.each(Re(Me,Ve))};function Re(Me,Ve){Me=d.ns.qualify(Me);function ft(){this.removeAttribute(Me)}function Pt(){this.removeAttributeNS(Me.space,Me.local)}function Bt(){this.setAttribute(Me,Ve)}function Ht(){this.setAttributeNS(Me.space,Me.local,Ve)}function dr(){var Or=Ve.apply(this,arguments);Or==null?this.removeAttribute(Me):this.setAttribute(Me,Or)}function cr(){var Or=Ve.apply(this,arguments);Or==null?this.removeAttributeNS(Me.space,Me.local):this.setAttributeNS(Me.space,Me.local,Or)}return Ve==null?Me.local?Pt:ft:typeof Ve=="function"?Me.local?cr:dr:Me.local?Ht:Bt}function Be(Me){return Me.trim().replace(/\s+/g," ")}oe.classed=function(Me,Ve){if(arguments.length<2){if(typeof Me=="string"){var ft=this.node(),Pt=(Me=Ge(Me)).length,Bt=-1;if(Ve=ft.classList){for(;++Bt=0;)(Ht=ft[Pt])&&(Bt&&Bt!==Ht.nextSibling&&Bt.parentNode.insertBefore(Ht,Bt),Bt=Ht);return this},oe.sort=function(Me){Me=nt.apply(this,arguments);for(var Ve=-1,ft=this.length;++Ve=Ve&&(Ve=Bt+1);!(Or=dr[Ve])&&++Ve0&&(Me=Me.slice(0,Bt));var dr=vr.get(Me);dr&&(Me=dr,Ht=Yr);function cr(){var hi=this[Pt];hi&&(this.removeEventListener(Me,hi,hi.$),delete this[Pt])}function Or(){var hi=Ht(Ve,z(arguments));cr.call(this),this.addEventListener(Me,this[Pt]=hi,hi.$=ft),hi._=Ve}function mi(){var hi=new RegExp("^__on([^.]+)"+d.requote(Me)+"$"),Bi;for(var Yi in this)if(Bi=Yi.match(hi)){var Ji=this[Yi];this.removeEventListener(Bi[1],Ji,Ji.$),delete this[Yi]}}return Bt?Ve?Or:cr:Ve?q:mi}var vr=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});P&&vr.forEach(function(Me){"on"+Me in P&&vr.remove(Me)});function mr(Me,Ve){return function(ft){var Pt=d.event;d.event=ft,Ve[0]=this.__data__;try{Me.apply(this,Ve)}finally{d.event=Pt}}}function Yr(Me,Ve){var ft=mr(Me,Ve);return function(Pt){var Bt=this,Ht=Pt.relatedTarget;(!Ht||Ht!==Bt&&!(Ht.compareDocumentPosition(Bt)&8))&&ft.call(Bt,Pt)}}var ii,Lr=0;function ci(Me){var Ve=".dragsuppress-"+ ++Lr,ft="click"+Ve,Pt=d.select(n(Me)).on("touchmove"+Ve,he).on("dragstart"+Ve,he).on("selectstart"+Ve,he);if(ii==null&&(ii="onselectstart"in Me?!1:F(Me.style,"userSelect")),ii){var Bt=i(Me).style,Ht=Bt[ii];Bt[ii]="none"}return function(dr){if(Pt.on(Ve,null),ii&&(Bt[ii]=Ht),dr){var cr=function(){Pt.on(ft,null)};Pt.on(ft,function(){he(),cr()},!0),setTimeout(cr,0)}}}d.mouse=function(Me){return Ot(Me,be())};var vi=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ot(Me,Ve){Ve.changedTouches&&(Ve=Ve.changedTouches[0]);var ft=Me.ownerSVGElement||Me;if(ft.createSVGPoint){var Pt=ft.createSVGPoint();if(vi<0){var Bt=n(Me);if(Bt.scrollX||Bt.scrollY){ft=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var Ht=ft[0][0].getScreenCTM();vi=!(Ht.f||Ht.e),ft.remove()}}return vi?(Pt.x=Ve.pageX,Pt.y=Ve.pageY):(Pt.x=Ve.clientX,Pt.y=Ve.clientY),Pt=Pt.matrixTransform(Me.getScreenCTM().inverse()),[Pt.x,Pt.y]}var dr=Me.getBoundingClientRect();return[Ve.clientX-dr.left-Me.clientLeft,Ve.clientY-dr.top-Me.clientTop]}d.touch=function(Me,Ve,ft){if(arguments.length<3&&(ft=Ve,Ve=be().changedTouches),Ve){for(var Pt=0,Bt=Ve.length,Ht;Pt1?at:Me<-1?-at:Math.asin(Me)}function hr(Me){return((Me=Math.exp(Me))-1/Me)/2}function zr(Me){return((Me=Math.exp(Me))+1/Me)/2}function Dr(Me){return((Me=Math.exp(2*Me))-1)/(Me+1)}var br=Math.SQRT2,fi=2,un=4;d.interpolateZoom=function(Me,Ve){var ft=Me[0],Pt=Me[1],Bt=Me[2],Ht=Ve[0],dr=Ve[1],cr=Ve[2],Or=Ht-ft,mi=dr-Pt,hi=Or*Or+mi*mi,Bi,Yi;if(hi0&&(Eo=Eo.transition().duration(dr)),Eo.call(aa.event)}function qo(){Bn&&Bn.domain(sn.range().map(function(Eo){return(Eo-Me.x)/Me.k}).map(sn.invert)),Yn&&Yn.domain($n.range().map(function(Eo){return(Eo-Me.y)/Me.k}).map($n.invert))}function Xo(Eo){cr++||Eo({type:"zoomstart"})}function ml(Eo){qo(),Eo({type:"zoom",scale:Me.k,translate:[Me.x,Me.y]})}function ts(Eo){--cr||(Eo({type:"zoomend"}),ft=null)}function ks(){var Eo=this,el=ta.of(Eo,arguments),fl=0,vu=d.select(n(Eo)).on(mi,Zl).on(hi,cu),nu=vn(d.mouse(Eo)),dh=ci(Eo);Qn.call(Eo),Xo(el);function Zl(){fl=1,yo(d.mouse(Eo),nu),ml(el)}function cu(){vu.on(mi,null).on(hi,null),dh(fl),ts(el)}}function Dl(){var Eo=this,el=ta.of(Eo,arguments),fl={},vu=0,nu,dh=".zoom-"+d.event.changedTouches[0].identifier,Zl="touchmove"+dh,cu="touchend"+dh,zh=[],St=d.select(Eo),Ir=ci(Eo);Qi(),Xo(el),St.on(Or,null).on(Yi,Qi);function Nr(){var Oi=d.touches(Eo);return nu=Me.k,Oi.forEach(function(Tn){Tn.identifier in fl&&(fl[Tn.identifier]=vn(Tn))}),Oi}function Qi(){var Oi=d.event.target;d.select(Oi).on(Zl,Cn).on(cu,xn),zh.push(Oi);for(var Tn=d.event.changedTouches,ua=0,ia=Tn.length;ua1){var Ya=La[0],da=La[1],jn=Ya[0]-da[0],Ei=Ya[1]-da[1];vu=jn*jn+Ei*Ei}}function Cn(){var Oi=d.touches(Eo),Tn,ua,ia,La;Qn.call(Eo);for(var ao=0,Ya=Oi.length;ao1?1:Ve,ft=ft<0?0:ft>1?1:ft,Bt=ft<=.5?ft*(1+Ve):ft+Ve-ft*Ve,Pt=2*ft-Bt;function Ht(cr){return cr>360?cr-=360:cr<0&&(cr+=360),cr<60?Pt+(Bt-Pt)*cr/60:cr<180?Bt:cr<240?Pt+(Bt-Pt)*(240-cr)/60:Pt}function dr(cr){return Math.round(Ht(cr)*255)}return new Ha(dr(Me+120),dr(Me),dr(Me-120))}d.hcl=Kt;function Kt(Me,Ve,ft){return this instanceof Kt?(this.h=+Me,this.c=+Ve,void(this.l=+ft)):arguments.length<2?Me instanceof Kt?new Kt(Me.h,Me.c,Me.l):Me instanceof Er?Kn(Me.l,Me.a,Me.b):Kn((Me=Gr((Me=d.rgb(Me)).r,Me.g,Me.b)).l,Me.a,Me.b):new Kt(Me,Ve,ft)}var lr=Kt.prototype=new Sn;lr.brighter=function(Me){return new Kt(this.h,this.c,Math.min(100,this.l+di*(arguments.length?Me:1)))},lr.darker=function(Me){return new Kt(this.h,this.c,Math.max(0,this.l-di*(arguments.length?Me:1)))},lr.rgb=function(){return _r(this.h,this.c,this.l).rgb()};function _r(Me,Ve,ft){return isNaN(Me)&&(Me=0),isNaN(Ve)&&(Ve=0),new Er(ft,Math.cos(Me*=ht)*Ve,Math.sin(Me)*Ve)}d.lab=Er;function Er(Me,Ve,ft){return this instanceof Er?(this.l=+Me,this.a=+Ve,void(this.b=+ft)):arguments.length<2?Me instanceof Er?new Er(Me.l,Me.a,Me.b):Me instanceof Kt?_r(Me.h,Me.c,Me.l):Gr((Me=Ha(Me)).r,Me.g,Me.b):new Er(Me,Ve,ft)}var di=18,qi=.95047,Ui=1,Hi=1.08883,Ln=Er.prototype=new Sn;Ln.brighter=function(Me){return new Er(Math.min(100,this.l+di*(arguments.length?Me:1)),this.a,this.b)},Ln.darker=function(Me){return new Er(Math.max(0,this.l-di*(arguments.length?Me:1)),this.a,this.b)},Ln.rgb=function(){return Fn(this.l,this.a,this.b)};function Fn(Me,Ve,ft){var Pt=(Me+16)/116,Bt=Pt+Ve/500,Ht=Pt-ft/200;return Bt=Jn(Bt)*qi,Pt=Jn(Pt)*Ui,Ht=Jn(Ht)*Hi,new Ha(Mn(3.2404542*Bt-1.5371385*Pt-.4985314*Ht),Mn(-.969266*Bt+1.8760108*Pt+.041556*Ht),Mn(.0556434*Bt-.2040259*Pt+1.0572252*Ht))}function Kn(Me,Ve,ft){return Me>0?new Kt(Math.atan2(ft,Ve)*At,Math.sqrt(Ve*Ve+ft*ft),Me):new Kt(NaN,NaN,Me)}function Jn(Me){return Me>.206893034?Me*Me*Me:(Me-4/29)/7.787037}function sa(Me){return Me>.008856?Math.pow(Me,1/3):7.787037*Me+4/29}function Mn(Me){return Math.round(255*(Me<=.00304?12.92*Me:1.055*Math.pow(Me,1/2.4)-.055))}d.rgb=Ha;function Ha(Me,Ve,ft){return this instanceof Ha?(this.r=~~Me,this.g=~~Ve,void(this.b=~~ft)):arguments.length<2?Me instanceof Ha?new Ha(Me.r,Me.g,Me.b):ai(""+Me,Ha,na):new Ha(Me,Ve,ft)}function io(Me){return new Ha(Me>>16,Me>>8&255,Me&255)}function Ft(Me){return io(Me)+""}var Rt=Ha.prototype=new Sn;Rt.brighter=function(Me){Me=Math.pow(.7,arguments.length?Me:1);var Ve=this.r,ft=this.g,Pt=this.b,Bt=30;return!Ve&&!ft&&!Pt?new Ha(Bt,Bt,Bt):(Ve&&Ve>4,Pt=Pt>>4|Pt,Bt=Or&240,Bt=Bt>>4|Bt,Ht=Or&15,Ht=Ht<<4|Ht):Me.length===7&&(Pt=(Or&16711680)>>16,Bt=(Or&65280)>>8,Ht=Or&255)),Ve(Pt,Bt,Ht))}function si(Me,Ve,ft){var Pt=Math.min(Me/=255,Ve/=255,ft/=255),Bt=Math.max(Me,Ve,ft),Ht=Bt-Pt,dr,cr,Or=(Bt+Pt)/2;return Ht?(cr=Or<.5?Ht/(Bt+Pt):Ht/(2-Bt-Pt),Me==Bt?dr=(Ve-ft)/Ht+(Ve0&&Or<1?0:dr),new dn(dr,cr,Or)}function Gr(Me,Ve,ft){Me=li(Me),Ve=li(Ve),ft=li(ft);var Pt=sa((.4124564*Me+.3575761*Ve+.1804375*ft)/qi),Bt=sa((.2126729*Me+.7151522*Ve+.072175*ft)/Ui),Ht=sa((.0193339*Me+.119192*Ve+.9503041*ft)/Hi);return Er(116*Bt-16,500*(Pt-Bt),200*(Bt-Ht))}function li(Me){return(Me/=255)<=.04045?Me/12.92:Math.pow((Me+.055)/1.055,2.4)}function Pi(Me){var Ve=parseFloat(Me);return Me.charAt(Me.length-1)==="%"?Math.round(Ve*2.55):Ve}var xi=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});xi.forEach(function(Me,Ve){xi.set(Me,io(Ve))});function zt(Me){return typeof Me=="function"?Me:function(){return Me}}d.functor=zt,d.xhr=xr(V);function xr(Me){return function(Ve,ft,Pt){return arguments.length===2&&typeof ft=="function"&&(Pt=ft,ft=null),Qr(Ve,ft,Me,Pt)}}function Qr(Me,Ve,ft,Pt){var Bt={},Ht=d.dispatch("beforesend","progress","load","error"),dr={},cr=new XMLHttpRequest,Or=null;self.XDomainRequest&&!("withCredentials"in cr)&&/^(http(s)?:)?\/\//.test(Me)&&(cr=new XDomainRequest),"onload"in cr?cr.onload=cr.onerror=mi:cr.onreadystatechange=function(){cr.readyState>3&&mi()};function mi(){var hi=cr.status,Bi;if(!hi&&en(cr)||hi>=200&&hi<300||hi===304){try{Bi=ft.call(Bt,cr)}catch(Yi){Ht.error.call(Bt,Yi);return}Ht.load.call(Bt,Bi)}else Ht.error.call(Bt,cr)}return cr.onprogress=function(hi){var Bi=d.event;d.event=hi;try{Ht.progress.call(Bt,cr)}finally{d.event=Bi}},Bt.header=function(hi,Bi){return hi=(hi+"").toLowerCase(),arguments.length<2?dr[hi]:(Bi==null?delete dr[hi]:dr[hi]=Bi+"",Bt)},Bt.mimeType=function(hi){return arguments.length?(Ve=hi==null?null:hi+"",Bt):Ve},Bt.responseType=function(hi){return arguments.length?(Or=hi,Bt):Or},Bt.response=function(hi){return ft=hi,Bt},["get","post"].forEach(function(hi){Bt[hi]=function(){return Bt.send.apply(Bt,[hi].concat(z(arguments)))}}),Bt.send=function(hi,Bi,Yi){if(arguments.length===2&&typeof Bi=="function"&&(Yi=Bi,Bi=null),cr.open(hi,Me,!0),Ve!=null&&!("accept"in dr)&&(dr.accept=Ve+",*/*"),cr.setRequestHeader)for(var Ji in dr)cr.setRequestHeader(Ji,dr[Ji]);return Ve!=null&&cr.overrideMimeType&&cr.overrideMimeType(Ve),Or!=null&&(cr.responseType=Or),Yi!=null&&Bt.on("error",Yi).on("load",function(ta){Yi(null,ta)}),Ht.beforesend.call(Bt,cr),cr.send(Bi??null),Bt},Bt.abort=function(){return cr.abort(),Bt},d.rebind(Bt,Ht,"on"),Pt==null?Bt:Bt.get(Ri(Pt))}function Ri(Me){return Me.length===1?function(Ve,ft){Me(Ve==null?ft:null)}:Me}function en(Me){var Ve=Me.responseType;return Ve&&Ve!=="text"?Me.response:Me.responseText}d.dsv=function(Me,Ve){var ft=new RegExp('["'+Me+` +]`),Pt=Me.charCodeAt(0);function Bt(mi,hi,Bi){arguments.length<3&&(Bi=hi,hi=null);var Yi=Qr(mi,Ve,hi==null?Ht:dr(hi),Bi);return Yi.row=function(Ji){return arguments.length?Yi.response((hi=Ji)==null?Ht:dr(Ji)):hi},Yi}function Ht(mi){return Bt.parse(mi.responseText)}function dr(mi){return function(hi){return Bt.parse(hi.responseText,mi)}}Bt.parse=function(mi,hi){var Bi;return Bt.parseRows(mi,function(Yi,Ji){if(Bi)return Bi(Yi,Ji-1);var ta=function(sn){for(var Bn={},$n=Yi.length,Yn=0;Yn<$n;++Yn)Bn[Yi[Yn]]=sn[Yn];return Bn};Bi=hi?function(sn,Bn){return hi(ta(sn),Bn)}:ta})},Bt.parseRows=function(mi,hi){var Bi={},Yi={},Ji=[],ta=mi.length,sn=0,Bn=0,$n,Yn;function aa(){if(sn>=ta)return Yi;if(Yn)return Yn=!1,Bi;var Qa=sn;if(mi.charCodeAt(Qa)===34){for(var to=Qa;to++24?(isFinite(Ve)&&(clearTimeout(pn),pn=setTimeout(fo,Ve)),Wi=0):(Wi=1,Ua(fo))}d.timer.flush=function(){ho(),Vo()};function ho(){for(var Me=Date.now(),Ve=_n;Ve;)Me>=Ve.t&&Ve.c(Me-Ve.t)&&(Ve.c=null),Ve=Ve.n;return Me}function Vo(){for(var Me,Ve=_n,ft=1/0;Ve;)Ve.c?(Ve.t=0;--cr)sn.push(Bt[mi[Bi[cr]][2]]);for(cr=+Ji;cr1&&Wt(Me[ft[Pt-2]],Me[ft[Pt-1]],Me[Bt])<=0;)--Pt;ft[Pt++]=Bt}return ft.slice(0,Pt)}function Ts(Me,Ve){return Me[0]-Ve[0]||Me[1]-Ve[1]}d.geom.polygon=function(Me){return re(Me,fs),Me};var fs=d.geom.polygon.prototype=[];fs.area=function(){for(var Me=-1,Ve=this.length,ft,Pt=this[Ve-1],Bt=0;++Meot)cr=cr.L;else if(dr=Ve-So(cr,ft),dr>ot){if(!cr.R){Pt=cr;break}cr=cr.R}else{Ht>-ot?(Pt=cr.P,Bt=cr):dr>-ot?(Pt=cr,Bt=cr.N):Pt=Bt=cr;break}var Or=Il(Me);if(sl.insert(Pt,Or),!(!Pt&&!Bt)){if(Pt===Bt){Nl(Pt),Bt=Il(Pt.site),sl.insert(Or,Bt),Or.edge=Bt.edge=pu(Pt.site,Or.site),pl(Pt),pl(Bt);return}if(!Bt){Or.edge=pu(Pt.site,Or.site);return}Nl(Pt),Nl(Bt);var mi=Pt.site,hi=mi.x,Bi=mi.y,Yi=Me.x-hi,Ji=Me.y-Bi,ta=Bt.site,sn=ta.x-hi,Bn=ta.y-Bi,$n=2*(Yi*Bn-Ji*sn),Yn=Yi*Yi+Ji*Ji,aa=sn*sn+Bn*Bn,vn={x:(Bn*Yn-Ji*aa)/$n+hi,y:(Yi*aa-sn*Yn)/$n+Bi};ls(Bt.edge,mi,ta,vn),Or.edge=pu(mi,Me,null,vn),Bt.edge=pu(Me,ta,null,vn),pl(Pt),pl(Bt)}}function $a(Me,Ve){var ft=Me.site,Pt=ft.x,Bt=ft.y,Ht=Bt-Ve;if(!Ht)return Pt;var dr=Me.P;if(!dr)return-1/0;ft=dr.site;var cr=ft.x,Or=ft.y,mi=Or-Ve;if(!mi)return cr;var hi=cr-Pt,Bi=1/Ht-1/mi,Yi=hi/mi;return Bi?(-Yi+Math.sqrt(Yi*Yi-2*Bi*(hi*hi/(-2*mi)-Or+mi/2+Bt-Ht/2)))/Bi+Pt:(Pt+cr)/2}function So(Me,Ve){var ft=Me.N;if(ft)return $a(ft,Ve);var Pt=Me.site;return Pt.y===Ve?Pt.x:1/0}function Xs(Me){this.site=Me,this.edges=[]}Xs.prototype.prepare=function(){for(var Me=this.edges,Ve=Me.length,ft;Ve--;)ft=Me[Ve].edge,(!ft.b||!ft.a)&&Me.splice(Ve,1);return Me.sort(is),Me.length};function su(Me){for(var Ve=Me[0][0],ft=Me[1][0],Pt=Me[0][1],Bt=Me[1][1],Ht,dr,cr,Or,mi=xl,hi=mi.length,Bi,Yi,Ji,ta,sn,Bn;hi--;)if(Bi=mi[hi],!(!Bi||!Bi.prepare()))for(Ji=Bi.edges,ta=Ji.length,Yi=0;Yiot||f(Or-dr)>ot)&&(Ji.splice(Yi,0,new Ru(bl(Bi.site,Bn,f(cr-Ve)ot?{x:Ve,y:f(Ht-Ve)ot?{x:f(dr-Bt)ot?{x:ft,y:f(Ht-ft)ot?{x:f(dr-Pt)=-De)){var Ji=Or*Or+mi*mi,ta=hi*hi+Bi*Bi,sn=(Bi*Ji-mi*ta)/Yi,Bn=(Or*ta-hi*Ji)/Yi,Bi=Bn+cr,$n=No.pop()||new tu;$n.arc=Me,$n.site=Bt,$n.x=sn+dr,$n.y=Bi+Math.sqrt(sn*sn+Bn*Bn),$n.cy=Bi,Me.circle=$n;for(var Yn=null,aa=Bs._;aa;)if($n.y0)){if(sn/=Ji,Ji<0){if(sn0){if(sn>Yi)return;sn>Bi&&(Bi=sn)}if(sn=ft-cr,!(!Ji&&sn<0)){if(sn/=Ji,Ji<0){if(sn>Yi)return;sn>Bi&&(Bi=sn)}else if(Ji>0){if(sn0)){if(sn/=ta,ta<0){if(sn0){if(sn>Yi)return;sn>Bi&&(Bi=sn)}if(sn=Pt-Or,!(!ta&&sn<0)){if(sn/=ta,ta<0){if(sn>Yi)return;sn>Bi&&(Bi=sn)}else if(ta>0){if(sn0&&(Bt.a={x:cr+Bi*Ji,y:Or+Bi*ta}),Yi<1&&(Bt.b={x:cr+Yi*Ji,y:Or+Yi*ta}),Bt}}}}}}function bo(Me){for(var Ve=ds,ft=Gu(Me[0][0],Me[0][1],Me[1][0],Me[1][1]),Pt=Ve.length,Bt;Pt--;)Bt=Ve[Pt],(!Ps(Bt,Me)||!ft(Bt)||f(Bt.a.x-Bt.b.x)=Ht)return;if(hi>Yi){if(!Pt)Pt={x:ta,y:dr};else if(Pt.y>=cr)return;ft={x:ta,y:cr}}else{if(!Pt)Pt={x:ta,y:cr};else if(Pt.y1)if(hi>Yi){if(!Pt)Pt={x:(dr-$n)/Bn,y:dr};else if(Pt.y>=cr)return;ft={x:(cr-$n)/Bn,y:cr}}else{if(!Pt)Pt={x:(cr-$n)/Bn,y:cr};else if(Pt.y=Ht)return;ft={x:Ht,y:Bn*Ht+$n}}else{if(!Pt)Pt={x:Ht,y:Bn*Ht+$n};else if(Pt.x=hi&&$n.x<=Yi&&$n.y>=Bi&&$n.y<=Ji?[[hi,Ji],[Yi,Ji],[Yi,Bi],[hi,Bi]]:[];Yn.point=Or[sn]}),mi}function cr(Or){return Or.map(function(mi,hi){return{x:Math.round(Pt(mi,hi)/ot)*ot,y:Math.round(Bt(mi,hi)/ot)*ot,i:hi}})}return dr.links=function(Or){return pc(cr(Or)).edges.filter(function(mi){return mi.l&&mi.r}).map(function(mi){return{source:Or[mi.l.i],target:Or[mi.r.i]}})},dr.triangles=function(Or){var mi=[];return pc(cr(Or)).cells.forEach(function(hi,Bi){for(var Yi=hi.site,Ji=hi.edges.sort(is),ta=-1,sn=Ji.length,Bn,$n,Yn=Ji[sn-1].edge,aa=Yn.l===Yi?Yn.r:Yn.l;++taaa&&(aa=hi.x),hi.y>vn&&(vn=hi.y),Ji.push(hi.x),ta.push(hi.y);else for(sn=0;snaa&&(aa=Qa),to>vn&&(vn=to),Ji.push(Qa),ta.push(to)}var yo=aa-$n,jo=vn-Yn;yo>jo?vn=Yn+yo:aa=$n+jo;function qo(ts,ks,Dl,ac,bu,Eo,el,fl){if(!(isNaN(Dl)||isNaN(ac)))if(ts.leaf){var vu=ts.x,nu=ts.y;if(vu!=null)if(f(vu-Dl)+f(nu-ac)<.01)Xo(ts,ks,Dl,ac,bu,Eo,el,fl);else{var dh=ts.point;ts.x=ts.y=ts.point=null,Xo(ts,dh,vu,nu,bu,Eo,el,fl),Xo(ts,ks,Dl,ac,bu,Eo,el,fl)}else ts.x=Dl,ts.y=ac,ts.point=ks}else Xo(ts,ks,Dl,ac,bu,Eo,el,fl)}function Xo(ts,ks,Dl,ac,bu,Eo,el,fl){var vu=(bu+el)*.5,nu=(Eo+fl)*.5,dh=Dl>=vu,Zl=ac>=nu,cu=Zl<<1|dh;ts.leaf=!1,ts=ts.nodes[cu]||(ts.nodes[cu]=Vl()),dh?bu=vu:el=vu,Zl?Eo=nu:fl=nu,qo(ts,ks,Dl,ac,bu,Eo,el,fl)}var ml=Vl();if(ml.add=function(ts){qo(ml,ts,+Bi(ts,++sn),+Yi(ts,sn),$n,Yn,aa,vn)},ml.visit=function(ts){Kc(ts,ml,$n,Yn,aa,vn)},ml.find=function(ts){return rd(ml,ts[0],ts[1],$n,Yn,aa,vn)},sn=-1,Ve==null){for(;++snHt||Yi>dr||Ji=Qa,jo=ft>=to,qo=jo<<1|yo,Xo=qo+4;qoft&&(Ht=Ve.slice(ft,Ht),cr[dr]?cr[dr]+=Ht:cr[++dr]=Ht),(Pt=Pt[0])===(Bt=Bt[0])?cr[dr]?cr[dr]+=Bt:cr[++dr]=Bt:(cr[++dr]=null,Or.push({i:dr,x:bc(Pt,Bt)})),ft=gc.lastIndex;return ft=0&&!(Pt=d.interpolators[ft](Me,Ve)););return Pt}d.interpolators=[function(Me,Ve){var ft=typeof Ve;return(ft==="string"?xi.has(Ve.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Ve)?xc:vh:Ve instanceof Sn?xc:Array.isArray(Ve)?ru:ft==="object"&&isNaN(Ve)?mc:bc)(Me,Ve)}],d.interpolateArray=ru;function ru(Me,Ve){var ft=[],Pt=[],Bt=Me.length,Ht=Ve.length,dr=Math.min(Me.length,Ve.length),cr;for(cr=0;cr=0?Me.slice(0,Ve):Me,Pt=Ve>=0?Me.slice(Ve+1):"in";return ft=Uc.get(ft)||Fh,Pt=Jh.get(Pt)||V,Mu(Pt(ft.apply(null,y.call(arguments,1))))};function Mu(Me){return function(Ve){return Ve<=0?0:Ve>=1?1:Me(Ve)}}function Xd(Me){return function(Ve){return 1-Me(1-Ve)}}function ll(Me){return function(Ve){return .5*(Ve<.5?Me(2*Ve):2-Me(2-2*Ve))}}function fp(Me){return Me*Me}function jl(Me){return Me*Me*Me}function os(Me){if(Me<=0)return 0;if(Me>=1)return 1;var Ve=Me*Me,ft=Ve*Me;return 4*(Me<.5?ft:3*(Me-Ve)+ft-.75)}function _f(Me){return function(Ve){return Math.pow(Ve,Me)}}function yh(Me){return 1-Math.cos(Me*at)}function hc(Me){return Math.pow(2,10*(Me-1))}function id(Me){return 1-Math.sqrt(1-Me*Me)}function Qh(Me,Ve){var ft;return arguments.length<2&&(Ve=.45),arguments.length?ft=Ve/Pe*Math.asin(1/Me):(Me=1,ft=Ve/4),function(Pt){return 1+Me*Math.pow(2,-10*Pt)*Math.sin((Pt-ft)*Pe/Ve)}}function Lf(Me){return Me||(Me=1.70158),function(Ve){return Ve*Ve*((Me+1)*Ve-Me)}}function vc(Me){return Me<1/2.75?7.5625*Me*Me:Me<2/2.75?7.5625*(Me-=1.5/2.75)*Me+.75:Me<2.5/2.75?7.5625*(Me-=2.25/2.75)*Me+.9375:7.5625*(Me-=2.625/2.75)*Me+.984375}d.interpolateHcl=Pd;function Pd(Me,Ve){Me=d.hcl(Me),Ve=d.hcl(Ve);var ft=Me.h,Pt=Me.c,Bt=Me.l,Ht=Ve.h-ft,dr=Ve.c-Pt,cr=Ve.l-Bt;return isNaN(dr)&&(dr=0,Pt=isNaN(Pt)?Ve.c:Pt),isNaN(Ht)?(Ht=0,ft=isNaN(ft)?Ve.h:ft):Ht>180?Ht-=360:Ht<-180&&(Ht+=360),function(Or){return _r(ft+Ht*Or,Pt+dr*Or,Bt+cr*Or)+""}}d.interpolateHsl=hd;function hd(Me,Ve){Me=d.hsl(Me),Ve=d.hsl(Ve);var ft=Me.h,Pt=Me.s,Bt=Me.l,Ht=Ve.h-ft,dr=Ve.s-Pt,cr=Ve.l-Bt;return isNaN(dr)&&(dr=0,Pt=isNaN(Pt)?Ve.s:Pt),isNaN(Ht)?(Ht=0,ft=isNaN(ft)?Ve.h:ft):Ht>180?Ht-=360:Ht<-180&&(Ht+=360),function(Or){return na(ft+Ht*Or,Pt+dr*Or,Bt+cr*Or)+""}}d.interpolateLab=Pf;function Pf(Me,Ve){Me=d.lab(Me),Ve=d.lab(Ve);var ft=Me.l,Pt=Me.a,Bt=Me.b,Ht=Ve.l-ft,dr=Ve.a-Pt,cr=Ve.b-Bt;return function(Or){return Fn(ft+Ht*Or,Pt+dr*Or,Bt+cr*Or)+""}}d.interpolateRound=ef;function ef(Me,Ve){return Ve-=Me,function(ft){return Math.round(Me+Ve*ft)}}d.transform=function(Me){var Ve=P.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(ft){if(ft!=null){Ve.setAttribute("transform",ft);var Pt=Ve.transform.baseVal.consolidate()}return new nd(Pt?Pt.matrix:Nh)})(Me)};function nd(Me){var Ve=[Me.a,Me.b],ft=[Me.c,Me.d],Pt=_h(Ve),Bt=ad(Ve,ft),Ht=_h(fd(ft,Ve,-Bt))||0;Ve[0]*ft[1]180?Ve+=360:Ve-Me>180&&(Me+=360),Pt.push({i:ft.push(Mh(ft)+"rotate(",null,")")-2,x:bc(Me,Ve)})):Ve&&ft.push(Mh(ft)+"rotate("+Ve+")")}function od(Me,Ve,ft,Pt){Me!==Ve?Pt.push({i:ft.push(Mh(ft)+"skewX(",null,")")-2,x:bc(Me,Ve)}):Ve&&ft.push(Mh(ft)+"skewX("+Ve+")")}function uu(Me,Ve,ft,Pt){if(Me[0]!==Ve[0]||Me[1]!==Ve[1]){var Bt=ft.push(Mh(ft)+"scale(",null,",",null,")");Pt.push({i:Bt-4,x:bc(Me[0],Ve[0])},{i:Bt-2,x:bc(Me[1],Ve[1])})}else(Ve[0]!==1||Ve[1]!==1)&&ft.push(Mh(ft)+"scale("+Ve+")")}function jf(Me,Ve){var ft=[],Pt=[];return Me=d.transform(Me),Ve=d.transform(Ve),yc(Me.translate,Ve.translate,ft,Pt),df(Me.rotate,Ve.rotate,ft,Pt),od(Me.skew,Ve.skew,ft,Pt),uu(Me.scale,Ve.scale,ft,Pt),Me=Ve=null,function(Bt){for(var Ht=-1,dr=Pt.length,cr;++Ht0?Ht=vn:(ft.c=null,ft.t=NaN,ft=null,Ve.end({type:"end",alpha:Ht=0})):vn>0&&(Ve.start({type:"start",alpha:Ht=vn}),ft=ea(Me.tick)),Me):Ht},Me.start=function(){var vn,Qa=Ji.length,to=ta.length,yo=Pt[0],jo=Pt[1],qo,Xo;for(vn=0;vn=0;)Ht.push(hi=mi[Or]),hi.parent=cr,hi.depth=cr.depth+1;ft&&(cr.value=0),cr.children=mi}else ft&&(cr.value=+ft.call(Pt,cr,cr.depth)||0),delete cr.children;return Eh(Bt,function(Bi){var Yi,Ji;Me&&(Yi=Bi.children)&&Yi.sort(Me),ft&&(Ji=Bi.parent)&&(Ji.value+=Bi.value)}),dr}return Pt.sort=function(Bt){return arguments.length?(Me=Bt,Pt):Me},Pt.children=function(Bt){return arguments.length?(Ve=Bt,Pt):Ve},Pt.value=function(Bt){return arguments.length?(ft=Bt,Pt):ft},Pt.revalue=function(Bt){return ft&&(xf(Bt,function(Ht){Ht.children&&(Ht.value=0)}),Eh(Bt,function(Ht){var dr;Ht.children||(Ht.value=+ft.call(Pt,Ht,Ht.depth)||0),(dr=Ht.parent)&&(dr.value+=Ht.value)})),Bt},Pt};function Eu(Me,Ve){return d.rebind(Me,Ve,"sort","children","value"),Me.nodes=Me,Me.links=Sp,Me}function xf(Me,Ve){for(var ft=[Me];(Me=ft.pop())!=null;)if(Ve(Me),(Bt=Me.children)&&(Pt=Bt.length))for(var Pt,Bt;--Pt>=0;)ft.push(Bt[Pt])}function Eh(Me,Ve){for(var ft=[Me],Pt=[];(Me=ft.pop())!=null;)if(Pt.push(Me),(dr=Me.children)&&(Ht=dr.length))for(var Bt=-1,Ht,dr;++BtBt&&(Bt=cr),Pt.push(cr)}for(dr=0;drPt&&(ft=Ve,Pt=Bt);return ft}function Uh(Me){return Me.reduce(Qc,0)}function Qc(Me,Ve){return Me+Ve[1]}d.layout.histogram=function(){var Me=!0,Ve=Number,ft=Df,Pt=Id;function Bt(Ht,dr){for(var cr=[],Or=Ht.map(Ve,this),mi=ft.call(this,Or,dr),hi=Pt.call(this,mi,Or,dr),Bi,dr=-1,Yi=Or.length,Ji=hi.length-1,ta=Me?1:1/Yi,sn;++dr0)for(dr=-1;++dr=mi[0]&&sn<=mi[1]&&(Bi=cr[d.bisect(hi,sn,1,Ji)-1],Bi.y+=ta,Bi.push(Ht[dr]));return cr}return Bt.value=function(Ht){return arguments.length?(Ve=Ht,Bt):Ve},Bt.range=function(Ht){return arguments.length?(ft=zt(Ht),Bt):ft},Bt.bins=function(Ht){return arguments.length?(Pt=typeof Ht=="number"?function(dr){return Cu(dr,Ht)}:zt(Ht),Bt):Pt},Bt.frequency=function(Ht){return arguments.length?(Me=!!Ht,Bt):Me},Bt};function Id(Me,Ve){return Cu(Me,Math.ceil(Math.log(Ve.length)/Math.LN2+1))}function Cu(Me,Ve){for(var ft=-1,Pt=+Me[0],Bt=(Me[1]-Pt)/Ve,Ht=[];++ft<=Ve;)Ht[ft]=Bt*ft+Pt;return Ht}function Df(Me){return[d.min(Me),d.max(Me)]}d.layout.pack=function(){var Me=d.layout.hierarchy().sort(nf),Ve=0,ft=[1,1],Pt;function Bt(Ht,dr){var cr=Me.call(this,Ht,dr),Or=cr[0],mi=ft[0],hi=ft[1],Bi=Pt==null?Math.sqrt:typeof Pt=="function"?Pt:function(){return Pt};if(Or.x=Or.y=0,Eh(Or,function(Ji){Ji.r=+Bi(Ji.value)}),Eh(Or,zf),Ve){var Yi=Ve*(Pt?1:Math.max(2*Or.r/mi,2*Or.r/hi))/2;Eh(Or,function(Ji){Ji.r+=Yi}),Eh(Or,zf),Eh(Or,function(Ji){Ji.r-=Yi})}return gd(Or,mi/2,hi/2,Pt?1:1/Math.max(2*Or.r/mi,2*Or.r/hi)),cr}return Bt.size=function(Ht){return arguments.length?(ft=Ht,Bt):ft},Bt.radius=function(Ht){return arguments.length?(Pt=Ht==null||typeof Ht=="function"?Ht:+Ht,Bt):Pt},Bt.padding=function(Ht){return arguments.length?(Ve=+Ht,Bt):Ve},Eu(Bt,Me)};function nf(Me,Ve){return Me.value-Ve.value}function hh(Me,Ve){var ft=Me._pack_next;Me._pack_next=Ve,Ve._pack_prev=Me,Ve._pack_next=ft,ft._pack_prev=Ve}function pf(Me,Ve){Me._pack_next=Ve,Ve._pack_prev=Me}function af(Me,Ve){var ft=Ve.x-Me.x,Pt=Ve.y-Me.y,Bt=Me.r+Ve.r;return .999*Bt*Bt>ft*ft+Pt*Pt}function zf(Me){if(!(Ve=Me.children)||!(Yi=Ve.length))return;var Ve,ft=1/0,Pt=-1/0,Bt=1/0,Ht=-1/0,dr,cr,Or,mi,hi,Bi,Yi;function Ji(vn){ft=Math.min(vn.x-vn.r,ft),Pt=Math.max(vn.x+vn.r,Pt),Bt=Math.min(vn.y-vn.r,Bt),Ht=Math.max(vn.y+vn.r,Ht)}if(Ve.forEach(ep),dr=Ve[0],dr.x=-dr.r,dr.y=0,Ji(dr),Yi>1&&(cr=Ve[1],cr.x=cr.r,cr.y=0,Ji(cr),Yi>2))for(Or=Ve[2],fh(dr,cr,Or),Ji(Or),hh(dr,Or),dr._pack_prev=Or,hh(Or,cr),cr=dr._pack_next,mi=3;miBn.x&&(Bn=Qa),Qa.depth>$n.depth&&($n=Qa)});var Yn=Ve(sn,Bn)/2-sn.x,aa=ft[0]/(Bn.x+Ve(Bn,sn)/2+Yn),vn=ft[1]/($n.depth||1);xf(Ji,function(Qa){Qa.x=(Qa.x+Yn)*aa,Qa.y=Qa.depth*vn})}return Yi}function Ht(hi){for(var Bi={A:null,children:[hi]},Yi=[Bi],Ji;(Ji=Yi.pop())!=null;)for(var ta=Ji.children,sn,Bn=0,$n=ta.length;Bn<$n;++Bn)Yi.push((ta[Bn]=sn={_:ta[Bn],parent:Ji,children:(sn=ta[Bn].children)&&sn.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:Bn}).a=sn);return Bi.children[0]}function dr(hi){var Bi=hi.children,Yi=hi.parent.children,Ji=hi.i?Yi[hi.i-1]:null;if(Bi.length){Ih(hi);var ta=(Bi[0].z+Bi[Bi.length-1].z)/2;Ji?(hi.z=Ji.z+Ve(hi._,Ji._),hi.m=hi.z-ta):hi.z=ta}else Ji&&(hi.z=Ji.z+Ve(hi._,Ji._));hi.parent.A=Or(hi,Ji,hi.parent.A||Yi[0])}function cr(hi){hi._.x=hi.z+hi.parent.m,hi.m+=hi.parent.m}function Or(hi,Bi,Yi){if(Bi){for(var Ji=hi,ta=hi,sn=Bi,Bn=Ji.parent.children[0],$n=Ji.m,Yn=ta.m,aa=sn.m,vn=Bn.m,Qa;sn=Zu(sn),Ji=Ph(Ji),sn&&Ji;)Bn=Ph(Bn),ta=Zu(ta),ta.a=hi,Qa=sn.z+aa-Ji.z-$n+Ve(sn._,Ji._),Qa>0&&(fu(Tf(sn,hi,Yi),hi,Qa),$n+=Qa,Yn+=Qa),aa+=sn.m,$n+=Ji.m,vn+=Bn.m,Yn+=ta.m;sn&&!Zu(ta)&&(ta.t=sn,ta.m+=aa-Yn),Ji&&!Ph(Bn)&&(Bn.t=Ji,Bn.m+=$n-vn,Yi=hi)}return Yi}function mi(hi){hi.x*=ft[0],hi.y=hi.depth*ft[1]}return Bt.separation=function(hi){return arguments.length?(Ve=hi,Bt):Ve},Bt.size=function(hi){return arguments.length?(Pt=(ft=hi)==null?mi:null,Bt):Pt?null:ft},Bt.nodeSize=function(hi){return arguments.length?(Pt=(ft=hi)==null?null:mi,Bt):Pt?ft:null},Eu(Bt,Me)};function $h(Me,Ve){return Me.parent==Ve.parent?1:2}function Ph(Me){var Ve=Me.children;return Ve.length?Ve[0]:Me.t}function Zu(Me){var Ve=Me.children,ft;return(ft=Ve.length)?Ve[ft-1]:Me.t}function fu(Me,Ve,ft){var Pt=ft/(Ve.i-Me.i);Ve.c-=Pt,Ve.s+=ft,Me.c+=Pt,Ve.z+=ft,Ve.m+=ft}function Ih(Me){for(var Ve=0,ft=0,Pt=Me.children,Bt=Pt.length,Ht;--Bt>=0;)Ht=Pt[Bt],Ht.z+=Ve,Ht.m+=Ve,Ve+=Ht.s+(ft+=Ht.c)}function Tf(Me,Ve,ft){return Me.a.parent===Ve.parent?Me.a:ft}d.layout.cluster=function(){var Me=d.layout.hierarchy().sort(null).value(null),Ve=$h,ft=[1,1],Pt=!1;function Bt(Ht,dr){var cr=Me.call(this,Ht,dr),Or=cr[0],mi,hi=0;Eh(Or,function(sn){var Bn=sn.children;Bn&&Bn.length?(sn.x=sd(Bn),sn.y=Dh(Bn)):(sn.x=mi?hi+=Ve(sn,mi):0,sn.y=0,mi=sn)});var Bi=wr(Or),Yi=Xr(Or),Ji=Bi.x-Ve(Bi,Yi)/2,ta=Yi.x+Ve(Yi,Bi)/2;return Eh(Or,Pt?function(sn){sn.x=(sn.x-Or.x)*ft[0],sn.y=(Or.y-sn.y)*ft[1]}:function(sn){sn.x=(sn.x-Ji)/(ta-Ji)*ft[0],sn.y=(1-(Or.y?sn.y/Or.y:1))*ft[1]}),cr}return Bt.separation=function(Ht){return arguments.length?(Ve=Ht,Bt):Ve},Bt.size=function(Ht){return arguments.length?(Pt=(ft=Ht)==null,Bt):Pt?null:ft},Bt.nodeSize=function(Ht){return arguments.length?(Pt=(ft=Ht)!=null,Bt):Pt?ft:null},Eu(Bt,Me)};function Dh(Me){return 1+d.max(Me,function(Ve){return Ve.y})}function sd(Me){return Me.reduce(function(Ve,ft){return Ve+ft.x},0)/Me.length}function wr(Me){var Ve=Me.children;return Ve&&Ve.length?wr(Ve[0]):Me}function Xr(Me){var Ve=Me.children,ft;return Ve&&(ft=Ve.length)?Xr(Ve[ft-1]):Me}d.layout.treemap=function(){var Me=d.layout.hierarchy(),Ve=Math.round,ft=[1,1],Pt=null,Bt=Ni,Ht=!1,dr,cr="squarify",Or=.5*(1+Math.sqrt(5));function mi(sn,Bn){for(var $n=-1,Yn=sn.length,aa,vn;++$n0;)Yn.push(vn=aa[jo-1]),Yn.area+=vn.area,cr!=="squarify"||(to=Yi(Yn,yo))<=Qa?(aa.pop(),Qa=to):(Yn.area-=Yn.pop().area,Ji(Yn,yo,$n,!1),yo=Math.min($n.dx,$n.dy),Yn.length=Yn.area=0,Qa=1/0);Yn.length&&(Ji(Yn,yo,$n,!0),Yn.length=Yn.area=0),Bn.forEach(hi)}}function Bi(sn){var Bn=sn.children;if(Bn&&Bn.length){var $n=Bt(sn),Yn=Bn.slice(),aa,vn=[];for(mi(Yn,$n.dx*$n.dy/sn.value),vn.area=0;aa=Yn.pop();)vn.push(aa),vn.area+=aa.area,aa.z!=null&&(Ji(vn,aa.z?$n.dx:$n.dy,$n,!Yn.length),vn.length=vn.area=0);Bn.forEach(Bi)}}function Yi(sn,Bn){for(var $n=sn.area,Yn,aa=0,vn=1/0,Qa=-1,to=sn.length;++Qaaa&&(aa=Yn));return $n*=$n,Bn*=Bn,$n?Math.max(Bn*aa*Or/$n,$n/(Bn*vn*Or)):1/0}function Ji(sn,Bn,$n,Yn){var aa=-1,vn=sn.length,Qa=$n.x,to=$n.y,yo=Bn?Ve(sn.area/Bn):0,jo;if(Bn==$n.dx){for((Yn||yo>$n.dy)&&(yo=$n.dy);++aa$n.dx)&&(yo=$n.dx);++aa1);return Me+Ve*Pt*Math.sqrt(-2*Math.log(Ht)/Ht)}},logNormal:function(){var Me=d.random.normal.apply(d,arguments);return function(){return Math.exp(Me())}},bates:function(Me){var Ve=d.random.irwinHall(Me);return function(){return Ve()/Me}},irwinHall:function(Me){return function(){for(var Ve=0,ft=0;ft2?wa:pa,mi=Pt?dd:Jd;return Bt=Or(Me,Ve,mi,ft),Ht=Or(Ve,Me,mi,hl),cr}function cr(Or){return Bt(Or)}return cr.invert=function(Or){return Ht(Or)},cr.domain=function(Or){return arguments.length?(Me=Or.map(Number),dr()):Me},cr.range=function(Or){return arguments.length?(Ve=Or,dr()):Ve},cr.rangeRound=function(Or){return cr.range(Or).interpolate(ef)},cr.clamp=function(Or){return arguments.length?(Pt=Or,dr()):Pt},cr.interpolate=function(Or){return arguments.length?(ft=Or,dr()):ft},cr.ticks=function(Or){return hs(Me,Or)},cr.tickFormat=function(Or,mi){return d3_scale_linearTickFormat(Me,Or,mi)},cr.nice=function(Or){return fa(Me,Or),dr()},cr.copy=function(){return Va(Me,Ve,ft,Pt)},dr()}function Oa(Me,Ve){return d.rebind(Me,Ve,"range","rangeRound","interpolate","clamp")}function fa(Me,Ve){return Ea(Me,Ka(vo(Me,Ve)[2])),Ea(Me,Ka(vo(Me,Ve)[2])),Me}function vo(Me,Ve){Ve==null&&(Ve=10);var ft=hn(Me),Pt=ft[1]-ft[0],Bt=Math.pow(10,Math.floor(Math.log(Pt/Ve)/Math.LN10)),Ht=Ve/Pt*Bt;return Ht<=.15?Bt*=10:Ht<=.35?Bt*=5:Ht<=.75&&(Bt*=2),ft[0]=Math.ceil(ft[0]/Bt)*Bt,ft[1]=Math.floor(ft[1]/Bt)*Bt+Bt*.5,ft[2]=Bt,ft}function hs(Me,Ve){return d.range.apply(d,vo(Me,Ve))}d.scale.log=function(){return rs(d.scale.linear().domain([0,1]),10,!0,[1,10])};function rs(Me,Ve,ft,Pt){function Bt(cr){return(ft?Math.log(cr<0?0:cr):-Math.log(cr>0?0:-cr))/Math.log(Ve)}function Ht(cr){return ft?Math.pow(Ve,cr):-Math.pow(Ve,-cr)}function dr(cr){return Me(Bt(cr))}return dr.invert=function(cr){return Ht(Me.invert(cr))},dr.domain=function(cr){return arguments.length?(ft=cr[0]>=0,Me.domain((Pt=cr.map(Number)).map(Bt)),dr):Pt},dr.base=function(cr){return arguments.length?(Ve=+cr,Me.domain(Pt.map(Bt)),dr):Ve},dr.nice=function(){var cr=Ea(Pt.map(Bt),ft?Math:ps);return Me.domain(cr),Pt=cr.map(Ht),dr},dr.ticks=function(){var cr=hn(Pt),Or=[],mi=cr[0],hi=cr[1],Bi=Math.floor(Bt(mi)),Yi=Math.ceil(Bt(hi)),Ji=Ve%1?2:Ve;if(isFinite(Yi-Bi)){if(ft){for(;Bi0;ta--)Or.push(Ht(Bi)*ta);for(Bi=0;Or[Bi]hi;Yi--);Or=Or.slice(Bi,Yi)}return Or},dr.copy=function(){return rs(Me.copy(),Ve,ft,Pt)},Oa(dr,Me)}var ps={floor:function(Me){return-Math.ceil(-Me)},ceil:function(Me){return-Math.floor(-Me)}};d.scale.pow=function(){return xs(d.scale.linear(),1,[0,1])};function xs(Me,Ve,ft){var Pt=_o(Ve),Bt=_o(1/Ve);function Ht(dr){return Me(Pt(dr))}return Ht.invert=function(dr){return Bt(Me.invert(dr))},Ht.domain=function(dr){return arguments.length?(Me.domain((ft=dr.map(Number)).map(Pt)),Ht):ft},Ht.ticks=function(dr){return hs(ft,dr)},Ht.tickFormat=function(dr,cr){return d3_scale_linearTickFormat(ft,dr,cr)},Ht.nice=function(dr){return Ht.domain(fa(ft,dr))},Ht.exponent=function(dr){return arguments.length?(Pt=_o(Ve=dr),Bt=_o(1/Ve),Me.domain(ft.map(Pt)),Ht):Ve},Ht.copy=function(){return xs(Me.copy(),Ve,ft)},Oa(Ht,Me)}function _o(Me){return function(Ve){return Ve<0?-Math.pow(-Ve,Me):Math.pow(Ve,Me)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return no([],{t:"range",a:[[]]})};function no(Me,Ve){var ft,Pt,Bt;function Ht(cr){return Pt[((ft.get(cr)||(Ve.t==="range"?ft.set(cr,Me.push(cr)):NaN))-1)%Pt.length]}function dr(cr,Or){return d.range(Me.length).map(function(mi){return cr+Or*mi})}return Ht.domain=function(cr){if(!arguments.length)return Me;Me=[],ft=new D;for(var Or=-1,mi=cr.length,hi;++Or0?ft[Ht-1]:Me[0],HtYi?0:1;if(hi=He)return Or(hi,ta)+(mi?Or(mi,1-ta):"")+"Z";var sn,Bn,$n,Yn,aa=0,vn=0,Qa,to,yo,jo,qo,Xo,ml,ts,ks=[];if((Yn=(+dr.apply(this,arguments)||0)/2)&&($n=Pt===xu?Math.sqrt(mi*mi+hi*hi):+Pt.apply(this,arguments),ta||(vn*=-1),hi&&(vn=Yt($n/hi*Math.sin(Yn))),mi&&(aa=Yt($n/mi*Math.sin(Yn)))),hi){Qa=hi*Math.cos(Bi+vn),to=hi*Math.sin(Bi+vn),yo=hi*Math.cos(Yi-vn),jo=hi*Math.sin(Yi-vn);var Dl=Math.abs(Yi-Bi-2*vn)<=ye?0:1;if(vn&&eh(Qa,to,yo,jo)===ta^Dl){var ac=(Bi+Yi)/2;Qa=hi*Math.cos(ac),to=hi*Math.sin(ac),yo=jo=null}}else Qa=to=0;if(mi){qo=mi*Math.cos(Yi-aa),Xo=mi*Math.sin(Yi-aa),ml=mi*Math.cos(Bi+aa),ts=mi*Math.sin(Bi+aa);var bu=Math.abs(Bi-Yi+2*aa)<=ye?0:1;if(aa&&eh(qo,Xo,ml,ts)===1-ta^bu){var Eo=(Bi+Yi)/2;qo=mi*Math.cos(Eo),Xo=mi*Math.sin(Eo),ml=ts=null}}else qo=Xo=0;if(Ji>ot&&(sn=Math.min(Math.abs(hi-mi)/2,+ft.apply(this,arguments)))>.001){Bn=mi0?0:1}function $c(Me,Ve,ft,Pt,Bt){var Ht=Me[0]-Ve[0],dr=Me[1]-Ve[1],cr=(Bt?Pt:-Pt)/Math.sqrt(Ht*Ht+dr*dr),Or=cr*dr,mi=-cr*Ht,hi=Me[0]+Or,Bi=Me[1]+mi,Yi=Ve[0]+Or,Ji=Ve[1]+mi,ta=(hi+Yi)/2,sn=(Bi+Ji)/2,Bn=Yi-hi,$n=Ji-Bi,Yn=Bn*Bn+$n*$n,aa=ft-Pt,vn=hi*Ji-Yi*Bi,Qa=($n<0?-1:1)*Math.sqrt(Math.max(0,aa*aa*Yn-vn*vn)),to=(vn*$n-Bn*Qa)/Yn,yo=(-vn*Bn-$n*Qa)/Yn,jo=(vn*$n+Bn*Qa)/Yn,qo=(-vn*Bn+$n*Qa)/Yn,Xo=to-ta,ml=yo-sn,ts=jo-ta,ks=qo-sn;return Xo*Xo+ml*ml>ts*ts+ks*ks&&(to=jo,yo=qo),[[to-Or,yo-mi],[to*ft/aa,yo*ft/aa]]}function Hh(){return!0}function th(Me){var Ve=Ao,ft=Wo,Pt=Hh,Bt=Wu,Ht=Bt.key,dr=.7;function cr(Or){var mi=[],hi=[],Bi=-1,Yi=Or.length,Ji,ta=zt(Ve),sn=zt(ft);function Bn(){mi.push("M",Bt(Me(hi),dr))}for(;++Bi1?Me.join("L"):Me+"Z"}function Wh(Me){return Me.join("L")+"Z"}function cs(Me){for(var Ve=0,ft=Me.length,Pt=Me[0],Bt=[Pt[0],",",Pt[1]];++Ve1&&Bt.push("H",Pt[0]),Bt.join("")}function Fs(Me){for(var Ve=0,ft=Me.length,Pt=Me[0],Bt=[Pt[0],",",Pt[1]];++Ve1){cr=Ve[1],Ht=Me[Or],Or++,Pt+="C"+(Bt[0]+dr[0])+","+(Bt[1]+dr[1])+","+(Ht[0]-cr[0])+","+(Ht[1]-cr[1])+","+Ht[0]+","+Ht[1];for(var mi=2;mi9&&(Ht=ft*3/Math.sqrt(Ht),dr[cr]=Ht*Pt,dr[cr+1]=Ht*Bt));for(cr=-1;++cr<=Or;)Ht=(Me[Math.min(Or,cr+1)][0]-Me[Math.max(0,cr-1)][0])/(6*(1+dr[cr]*dr[cr])),Ve.push([Ht||0,dr[cr]*Ht||0]);return Ve}function lt(Me){return Me.length<3?Wu(Me):Me[0]+O(Me,et(Me))}d.svg.line.radial=function(){var Me=th(Tt);return Me.radius=Me.x,delete Me.x,Me.angle=Me.y,delete Me.y,Me};function Tt(Me){for(var Ve,ft=-1,Pt=Me.length,Bt,Ht;++ftye)+",1 "+Bi}function mi(hi,Bi,Yi,Ji){return"Q 0,0 "+Ji}return Ht.radius=function(hi){return arguments.length?(ft=zt(hi),Ht):ft},Ht.source=function(hi){return arguments.length?(Me=zt(hi),Ht):Me},Ht.target=function(hi){return arguments.length?(Ve=zt(hi),Ht):Ve},Ht.startAngle=function(hi){return arguments.length?(Pt=zt(hi),Ht):Pt},Ht.endAngle=function(hi){return arguments.length?(Bt=zt(hi),Ht):Bt},Ht};function Xt(Me){return Me.radius}d.svg.diagonal=function(){var Me=Vt,Ve=Nt,ft=Pr;function Pt(Bt,Ht){var dr=Me.call(this,Bt,Ht),cr=Ve.call(this,Bt,Ht),Or=(dr.y+cr.y)/2,mi=[dr,{x:dr.x,y:Or},{x:cr.x,y:Or},cr];return mi=mi.map(ft),"M"+mi[0]+"C"+mi[1]+" "+mi[2]+" "+mi[3]}return Pt.source=function(Bt){return arguments.length?(Me=zt(Bt),Pt):Me},Pt.target=function(Bt){return arguments.length?(Ve=zt(Bt),Pt):Ve},Pt.projection=function(Bt){return arguments.length?(ft=Bt,Pt):ft},Pt};function Pr(Me){return[Me.x,Me.y]}d.svg.diagonal.radial=function(){var Me=d.svg.diagonal(),Ve=Pr,ft=Me.projection;return Me.projection=function(Pt){return arguments.length?ft(Hr(Ve=Pt)):Ve},Me};function Hr(Me){return function(){var Ve=Me.apply(this,arguments),ft=Ve[0],Pt=Ve[1]-at;return[ft*Math.cos(Pt),ft*Math.sin(Pt)]}}d.svg.symbol=function(){var Me=pi,Ve=Zr;function ft(Pt,Bt){return(Ki.get(Me.call(this,Pt,Bt))||zi)(Ve.call(this,Pt,Bt))}return ft.type=function(Pt){return arguments.length?(Me=zt(Pt),ft):Me},ft.size=function(Pt){return arguments.length?(Ve=zt(Pt),ft):Ve},ft};function Zr(){return 64}function pi(){return"circle"}function zi(Me){var Ve=Math.sqrt(Me/ye);return"M0,"+Ve+"A"+Ve+","+Ve+" 0 1,1 0,"+-Ve+"A"+Ve+","+Ve+" 0 1,1 0,"+Ve+"Z"}var Ki=d.map({circle:zi,cross:function(Me){var Ve=Math.sqrt(Me/5)/2;return"M"+-3*Ve+","+-Ve+"H"+-Ve+"V"+-3*Ve+"H"+Ve+"V"+-Ve+"H"+3*Ve+"V"+Ve+"H"+Ve+"V"+3*Ve+"H"+-Ve+"V"+Ve+"H"+-3*Ve+"Z"},diamond:function(Me){var Ve=Math.sqrt(Me/(2*kn)),ft=Ve*kn;return"M0,"+-Ve+"L"+ft+",0 0,"+Ve+" "+-ft+",0Z"},square:function(Me){var Ve=Math.sqrt(Me)/2;return"M"+-Ve+","+-Ve+"L"+Ve+","+-Ve+" "+Ve+","+Ve+" "+-Ve+","+Ve+"Z"},"triangle-down":function(Me){var Ve=Math.sqrt(Me/rn),ft=Ve*rn/2;return"M0,"+ft+"L"+Ve+","+-ft+" "+-Ve+","+-ft+"Z"},"triangle-up":function(Me){var Ve=Math.sqrt(Me/rn),ft=Ve*rn/2;return"M0,"+-ft+"L"+Ve+","+ft+" "+-Ve+","+ft+"Z"}});d.svg.symbolTypes=Ki.keys();var rn=Math.sqrt(3),kn=Math.tan(30*ht);oe.transition=function(Me){for(var Ve=Go||++xo,ft=Al(Me),Pt=[],Bt,Ht,dr=Bo||{time:Date.now(),ease:os,delay:0,duration:250},cr=-1,Or=this.length;++cr0;)Bi[--Yn].call(Me,$n);if(Bn>=1)return dr.event&&dr.event.end.call(Me,Me.__data__,Ve),--Ht.count?delete Ht[Pt]:delete Me[ft],1}dr||(cr=Bt.time,Or=ea(Yi,0,cr),dr=Ht[Pt]={tween:new D,time:cr,timer:Or,delay:Bt.delay,duration:Bt.duration,ease:Bt.ease,index:Ve},Bt=null,++Ht.count)}d.svg.axis=function(){var Me=d.scale.linear(),Ve=Pl,ft=6,Pt=6,Bt=3,Ht=[10],dr=null,cr;function Or(mi){mi.each(function(){var hi=d.select(this),Bi=this.__chart__||Me,Yi=this.__chart__=Me.copy(),Ji=dr??(Yi.ticks?Yi.ticks.apply(Yi,Ht):Yi.domain()),ta=cr??(Yi.tickFormat?Yi.tickFormat.apply(Yi,Ht):V),sn=hi.selectAll(".tick").data(Ji,Yi),Bn=sn.enter().insert("g",".domain").attr("class","tick").style("opacity",ot),$n=d.transition(sn.exit()).style("opacity",ot).remove(),Yn=d.transition(sn.order()).style("opacity",1),aa=Math.max(ft,0)+Bt,vn,Qa=Pn(Yi),to=hi.selectAll(".domain").data([0]),yo=(to.enter().append("path").attr("class","domain"),d.transition(to));Bn.append("line"),Bn.append("text");var jo=Bn.select("line"),qo=Yn.select("line"),Xo=sn.select("text").text(ta),ml=Bn.select("text"),ts=Yn.select("text"),ks=Ve==="top"||Ve==="left"?-1:1,Dl,ac,bu,Eo;if(Ve==="bottom"||Ve==="top"?(vn=Tu,Dl="x",bu="y",ac="x2",Eo="y2",Xo.attr("dy",ks<0?"0em":".71em").style("text-anchor","middle"),yo.attr("d","M"+Qa[0]+","+ks*Pt+"V0H"+Qa[1]+"V"+ks*Pt)):(vn=Js,Dl="y",bu="x",ac="y2",Eo="x2",Xo.attr("dy",".32em").style("text-anchor",ks<0?"end":"start"),yo.attr("d","M"+ks*Pt+","+Qa[0]+"H0V"+Qa[1]+"H"+ks*Pt)),jo.attr(Eo,ks*ft),ml.attr(bu,ks*aa),qo.attr(ac,0).attr(Eo,ks*ft),ts.attr(Dl,0).attr(bu,ks*aa),Yi.rangeBand){var el=Yi,fl=el.rangeBand()/2;Bi=Yi=function(vu){return el(vu)+fl}}else Bi.rangeBand?Bi=Yi:$n.call(vn,Yi,Bi);Bn.call(vn,Bi,Yi),Yn.call(vn,Yi,Yi)})}return Or.scale=function(mi){return arguments.length?(Me=mi,Or):Me},Or.orient=function(mi){return arguments.length?(Ve=mi in Fu?mi+"":Pl,Or):Ve},Or.ticks=function(){return arguments.length?(Ht=z(arguments),Or):Ht},Or.tickValues=function(mi){return arguments.length?(dr=mi,Or):dr},Or.tickFormat=function(mi){return arguments.length?(cr=mi,Or):cr},Or.tickSize=function(mi){var hi=arguments.length;return hi?(ft=+mi,Pt=+arguments[hi-1],Or):ft},Or.innerTickSize=function(mi){return arguments.length?(ft=+mi,Or):ft},Or.outerTickSize=function(mi){return arguments.length?(Pt=+mi,Or):Pt},Or.tickPadding=function(mi){return arguments.length?(Bt=+mi,Or):Bt},Or.tickSubdivide=function(){return arguments.length&&Or},Or};var Pl="bottom",Fu={top:1,right:1,bottom:1,left:1};function Tu(Me,Ve,ft){Me.attr("transform",function(Pt){var Bt=Ve(Pt);return"translate("+(isFinite(Bt)?Bt:ft(Pt))+",0)"})}function Js(Me,Ve,ft){Me.attr("transform",function(Pt){var Bt=Ve(Pt);return"translate(0,"+(isFinite(Bt)?Bt:ft(Pt))+")"})}d.svg.brush=function(){var Me=ve(hi,"brushstart","brush","brushend"),Ve=null,ft=null,Pt=[0,0],Bt=[0,0],Ht,dr,cr=!0,Or=!0,mi=nc[0];function hi(sn){sn.each(function(){var Bn=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ta).on("touchstart.brush",ta),$n=Bn.selectAll(".background").data([0]);$n.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Bn.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Yn=Bn.selectAll(".resize").data(mi,V);Yn.exit().remove(),Yn.enter().append("g").attr("class",function(to){return"resize "+to}).style("cursor",function(to){return Qs[to]}).append("rect").attr("x",function(to){return/[ew]$/.test(to)?-3:null}).attr("y",function(to){return/^[ns]/.test(to)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Yn.style("display",hi.empty()?"none":null);var aa=d.transition(Bn),vn=d.transition($n),Qa;Ve&&(Qa=Pn(Ve),vn.attr("x",Qa[0]).attr("width",Qa[1]-Qa[0]),Yi(aa)),ft&&(Qa=Pn(ft),vn.attr("y",Qa[0]).attr("height",Qa[1]-Qa[0]),Ji(aa)),Bi(aa)})}hi.event=function(sn){sn.each(function(){var Bn=Me.of(this,arguments),$n={x:Pt,y:Bt,i:Ht,j:dr},Yn=this.__chart__||$n;this.__chart__=$n,Go?d.select(this).transition().each("start.brush",function(){Ht=Yn.i,dr=Yn.j,Pt=Yn.x,Bt=Yn.y,Bn({type:"brushstart"})}).tween("brush:brush",function(){var aa=ru(Pt,$n.x),vn=ru(Bt,$n.y);return Ht=dr=null,function(Qa){Pt=$n.x=aa(Qa),Bt=$n.y=vn(Qa),Bn({type:"brush",mode:"resize"})}}).each("end.brush",function(){Ht=$n.i,dr=$n.j,Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"})}):(Bn({type:"brushstart"}),Bn({type:"brush",mode:"resize"}),Bn({type:"brushend"}))})};function Bi(sn){sn.selectAll(".resize").attr("transform",function(Bn){return"translate("+Pt[+/e$/.test(Bn)]+","+Bt[+/^s/.test(Bn)]+")"})}function Yi(sn){sn.select(".extent").attr("x",Pt[0]),sn.selectAll(".extent,.n>rect,.s>rect").attr("width",Pt[1]-Pt[0])}function Ji(sn){sn.select(".extent").attr("y",Bt[0]),sn.selectAll(".extent,.e>rect,.w>rect").attr("height",Bt[1]-Bt[0])}function ta(){var sn=this,Bn=d.select(d.event.target),$n=Me.of(sn,arguments),Yn=d.select(sn),aa=Bn.datum(),vn=!/^(n|s)$/.test(aa)&&Ve,Qa=!/^(e|w)$/.test(aa)&&ft,to=Bn.classed("extent"),yo=ci(sn),jo,qo=d.mouse(sn),Xo,ml=d.select(n(sn)).on("keydown.brush",Dl).on("keyup.brush",ac);if(d.event.changedTouches?ml.on("touchmove.brush",bu).on("touchend.brush",el):ml.on("mousemove.brush",bu).on("mouseup.brush",el),Yn.interrupt().selectAll("*").interrupt(),to)qo[0]=Pt[0]-qo[0],qo[1]=Bt[0]-qo[1];else if(aa){var ts=+/w$/.test(aa),ks=+/^n/.test(aa);Xo=[Pt[1-ts]-qo[0],Bt[1-ks]-qo[1]],qo[0]=Pt[ts],qo[1]=Bt[ks]}else d.event.altKey&&(jo=qo.slice());Yn.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Bn.style("cursor")),$n({type:"brushstart"}),bu();function Dl(){d.event.keyCode==32&&(to||(jo=null,qo[0]-=Pt[1],qo[1]-=Bt[1],to=2),he())}function ac(){d.event.keyCode==32&&to==2&&(qo[0]+=Pt[1],qo[1]+=Bt[1],to=0,he())}function bu(){var fl=d.mouse(sn),vu=!1;Xo&&(fl[0]+=Xo[0],fl[1]+=Xo[1]),to||(d.event.altKey?(jo||(jo=[(Pt[0]+Pt[1])/2,(Bt[0]+Bt[1])/2]),qo[0]=Pt[+(fl[0]{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=new Date,z=new Date;function P(Le,nt,xt,ut){function Et(Gt){return Le(Gt=arguments.length===0?new Date:new Date(+Gt)),Gt}return Et.floor=function(Gt){return Le(Gt=new Date(+Gt)),Gt},Et.ceil=function(Gt){return Le(Gt=new Date(Gt-1)),nt(Gt,1),Le(Gt),Gt},Et.round=function(Gt){var Qt=Et(Gt),vr=Et.ceil(Gt);return Gt-Qt0))return mr;do mr.push(Yr=new Date(+Gt)),nt(Gt,vr),Le(Gt);while(Yr=Qt)for(;Le(Qt),!Gt(Qt);)Qt.setTime(Qt-1)},function(Qt,vr){if(Qt>=Qt)if(vr<0)for(;++vr<=0;)for(;nt(Qt,-1),!Gt(Qt););else for(;--vr>=0;)for(;nt(Qt,1),!Gt(Qt););})},xt&&(Et.count=function(Gt,Qt){return y.setTime(+Gt),z.setTime(+Qt),Le(y),Le(z),Math.floor(xt(y,z))},Et.every=function(Gt){return Gt=Math.floor(Gt),!isFinite(Gt)||!(Gt>0)?null:Gt>1?Et.filter(ut?function(Qt){return ut(Qt)%Gt===0}:function(Qt){return Et.count(0,Qt)%Gt===0}):Et}),Et}var i=P(function(){},function(Le,nt){Le.setTime(+Le+nt)},function(Le,nt){return nt-Le});i.every=function(Le){return Le=Math.floor(Le),!isFinite(Le)||!(Le>0)?null:Le>1?P(function(nt){nt.setTime(Math.floor(nt/Le)*Le)},function(nt,xt){nt.setTime(+nt+xt*Le)},function(nt,xt){return(xt-nt)/Le}):i};var n=i.range,a=1e3,l=6e4,o=36e5,u=864e5,s=6048e5,h=P(function(Le){Le.setTime(Le-Le.getMilliseconds())},function(Le,nt){Le.setTime(+Le+nt*a)},function(Le,nt){return(nt-Le)/a},function(Le){return Le.getUTCSeconds()}),m=h.range,b=P(function(Le){Le.setTime(Le-Le.getMilliseconds()-Le.getSeconds()*a)},function(Le,nt){Le.setTime(+Le+nt*l)},function(Le,nt){return(nt-Le)/l},function(Le){return Le.getMinutes()}),x=b.range,_=P(function(Le){Le.setTime(Le-Le.getMilliseconds()-Le.getSeconds()*a-Le.getMinutes()*l)},function(Le,nt){Le.setTime(+Le+nt*o)},function(Le,nt){return(nt-Le)/o},function(Le){return Le.getHours()}),A=_.range,f=P(function(Le){Le.setHours(0,0,0,0)},function(Le,nt){Le.setDate(Le.getDate()+nt)},function(Le,nt){return(nt-Le-(nt.getTimezoneOffset()-Le.getTimezoneOffset())*l)/u},function(Le){return Le.getDate()-1}),k=f.range;function w(Le){return P(function(nt){nt.setDate(nt.getDate()-(nt.getDay()+7-Le)%7),nt.setHours(0,0,0,0)},function(nt,xt){nt.setDate(nt.getDate()+xt*7)},function(nt,xt){return(xt-nt-(xt.getTimezoneOffset()-nt.getTimezoneOffset())*l)/s})}var D=w(0),E=w(1),I=w(2),M=w(3),p=w(4),g=w(5),C=w(6),T=D.range,N=E.range,B=I.range,U=M.range,V=p.range,W=g.range,F=C.range,H=P(function(Le){Le.setDate(1),Le.setHours(0,0,0,0)},function(Le,nt){Le.setMonth(Le.getMonth()+nt)},function(Le,nt){return nt.getMonth()-Le.getMonth()+(nt.getFullYear()-Le.getFullYear())*12},function(Le){return Le.getMonth()}),q=H.range,G=P(function(Le){Le.setMonth(0,1),Le.setHours(0,0,0,0)},function(Le,nt){Le.setFullYear(Le.getFullYear()+nt)},function(Le,nt){return nt.getFullYear()-Le.getFullYear()},function(Le){return Le.getFullYear()});G.every=function(Le){return!isFinite(Le=Math.floor(Le))||!(Le>0)?null:P(function(nt){nt.setFullYear(Math.floor(nt.getFullYear()/Le)*Le),nt.setMonth(0,1),nt.setHours(0,0,0,0)},function(nt,xt){nt.setFullYear(nt.getFullYear()+xt*Le)})};var ee=G.range,he=P(function(Le){Le.setUTCSeconds(0,0)},function(Le,nt){Le.setTime(+Le+nt*l)},function(Le,nt){return(nt-Le)/l},function(Le){return Le.getUTCMinutes()}),be=he.range,ve=P(function(Le){Le.setUTCMinutes(0,0,0)},function(Le,nt){Le.setTime(+Le+nt*o)},function(Le,nt){return(nt-Le)/o},function(Le){return Le.getUTCHours()}),ce=ve.range,re=P(function(Le){Le.setUTCHours(0,0,0,0)},function(Le,nt){Le.setUTCDate(Le.getUTCDate()+nt)},function(Le,nt){return(nt-Le)/u},function(Le){return Le.getUTCDate()-1}),ge=re.range;function ne(Le){return P(function(nt){nt.setUTCDate(nt.getUTCDate()-(nt.getUTCDay()+7-Le)%7),nt.setUTCHours(0,0,0,0)},function(nt,xt){nt.setUTCDate(nt.getUTCDate()+xt*7)},function(nt,xt){return(xt-nt)/s})}var se=ne(0),_e=ne(1),oe=ne(2),J=ne(3),me=ne(4),fe=ne(5),Ce=ne(6),Re=se.range,Be=_e.range,Ze=oe.range,Ge=J.range,tt=me.range,_t=fe.range,mt=Ce.range,vt=P(function(Le){Le.setUTCDate(1),Le.setUTCHours(0,0,0,0)},function(Le,nt){Le.setUTCMonth(Le.getUTCMonth()+nt)},function(Le,nt){return nt.getUTCMonth()-Le.getUTCMonth()+(nt.getUTCFullYear()-Le.getUTCFullYear())*12},function(Le){return Le.getUTCMonth()}),ct=vt.range,Ae=P(function(Le){Le.setUTCMonth(0,1),Le.setUTCHours(0,0,0,0)},function(Le,nt){Le.setUTCFullYear(Le.getUTCFullYear()+nt)},function(Le,nt){return nt.getUTCFullYear()-Le.getUTCFullYear()},function(Le){return Le.getUTCFullYear()});Ae.every=function(Le){return!isFinite(Le=Math.floor(Le))||!(Le>0)?null:P(function(nt){nt.setUTCFullYear(Math.floor(nt.getUTCFullYear()/Le)*Le),nt.setUTCMonth(0,1),nt.setUTCHours(0,0,0,0)},function(nt,xt){nt.setUTCFullYear(nt.getUTCFullYear()+xt*Le)})};var Oe=Ae.range;d.timeDay=f,d.timeDays=k,d.timeFriday=g,d.timeFridays=W,d.timeHour=_,d.timeHours=A,d.timeInterval=P,d.timeMillisecond=i,d.timeMilliseconds=n,d.timeMinute=b,d.timeMinutes=x,d.timeMonday=E,d.timeMondays=N,d.timeMonth=H,d.timeMonths=q,d.timeSaturday=C,d.timeSaturdays=F,d.timeSecond=h,d.timeSeconds=m,d.timeSunday=D,d.timeSundays=T,d.timeThursday=p,d.timeThursdays=V,d.timeTuesday=I,d.timeTuesdays=B,d.timeWednesday=M,d.timeWednesdays=U,d.timeWeek=D,d.timeWeeks=T,d.timeYear=G,d.timeYears=ee,d.utcDay=re,d.utcDays=ge,d.utcFriday=fe,d.utcFridays=_t,d.utcHour=ve,d.utcHours=ce,d.utcMillisecond=i,d.utcMilliseconds=n,d.utcMinute=he,d.utcMinutes=be,d.utcMonday=_e,d.utcMondays=Be,d.utcMonth=vt,d.utcMonths=ct,d.utcSaturday=Ce,d.utcSaturdays=mt,d.utcSecond=h,d.utcSeconds=m,d.utcSunday=se,d.utcSundays=Re,d.utcThursday=me,d.utcThursdays=tt,d.utcTuesday=oe,d.utcTuesdays=Ze,d.utcWednesday=J,d.utcWednesdays=Ge,d.utcWeek=se,d.utcWeeks=Re,d.utcYear=Ae,d.utcYears=Oe,Object.defineProperty(d,"__esModule",{value:!0})})}),yi=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,on()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(Xe){if(0<=Xe.y&&Xe.y<100){var ot=new Date(-1,Xe.m,Xe.d,Xe.H,Xe.M,Xe.S,Xe.L);return ot.setFullYear(Xe.y),ot}return new Date(Xe.y,Xe.m,Xe.d,Xe.H,Xe.M,Xe.S,Xe.L)}function P(Xe){if(0<=Xe.y&&Xe.y<100){var ot=new Date(Date.UTC(-1,Xe.m,Xe.d,Xe.H,Xe.M,Xe.S,Xe.L));return ot.setUTCFullYear(Xe.y),ot}return new Date(Date.UTC(Xe.y,Xe.m,Xe.d,Xe.H,Xe.M,Xe.S,Xe.L))}function i(Xe,ot,De){return{y:Xe,m:ot,d:De,H:0,M:0,S:0,L:0}}function n(Xe){var ot=Xe.dateTime,De=Xe.date,ye=Xe.time,Pe=Xe.periods,He=Xe.days,at=Xe.shortDays,ht=Xe.months,At=Xe.shortMonths,Wt=m(Pe),Yt=b(Pe),hr=m(He),zr=b(He),Dr=m(at),br=b(at),fi=m(ht),un=b(ht),cn=m(At),yn=b(At),Gn={a:Fn,A:Kn,b:Jn,B:sa,c:null,d:H,e:H,f:be,H:q,I:G,j:ee,L:he,m:ve,M:ce,p:Mn,q:Ha,Q:Qt,s:vr,S:re,u:ge,U:ne,V:se,w:_e,W:oe,x:null,X:null,y:J,Y:me,Z:fe,"%":Gt},Sn={a:io,A:Ft,b:Rt,B:qr,c:null,d:Ce,e:Ce,f:tt,H:Re,I:Be,j:Ze,L:Ge,m:_t,M:mt,p:ai,q:si,Q:Qt,s:vr,S:vt,u:ct,U:Ae,V:Oe,w:Le,W:nt,x:null,X:null,y:xt,Y:ut,Z:Et,"%":Gt},dn={a:_r,A:Er,b:di,B:qi,c:Ui,d:p,e:p,f:U,H:C,I:C,j:g,L:B,m:M,M:T,p:lr,q:I,Q:W,s:F,S:N,u:_,U:A,V:f,w:x,W:k,x:Hi,X:Ln,y:D,Y:w,Z:E,"%":V};Gn.x=va(De,Gn),Gn.X=va(ye,Gn),Gn.c=va(ot,Gn),Sn.x=va(De,Sn),Sn.X=va(ye,Sn),Sn.c=va(ot,Sn);function va(Gr,li){return function(Pi){var xi=[],zt=-1,xr=0,Qr=Gr.length,Ri,en,_n;for(Pi instanceof Date||(Pi=new Date(+Pi));++zt53)return null;"w"in xi||(xi.w=1),"Z"in xi?(xr=P(i(xi.y,0,1)),Qr=xr.getUTCDay(),xr=Qr>4||Qr===0?y.utcMonday.ceil(xr):y.utcMonday(xr),xr=y.utcDay.offset(xr,(xi.V-1)*7),xi.y=xr.getUTCFullYear(),xi.m=xr.getUTCMonth(),xi.d=xr.getUTCDate()+(xi.w+6)%7):(xr=z(i(xi.y,0,1)),Qr=xr.getDay(),xr=Qr>4||Qr===0?y.timeMonday.ceil(xr):y.timeMonday(xr),xr=y.timeDay.offset(xr,(xi.V-1)*7),xi.y=xr.getFullYear(),xi.m=xr.getMonth(),xi.d=xr.getDate()+(xi.w+6)%7)}else("W"in xi||"U"in xi)&&("w"in xi||(xi.w="u"in xi?xi.u%7:"W"in xi?1:0),Qr="Z"in xi?P(i(xi.y,0,1)).getUTCDay():z(i(xi.y,0,1)).getDay(),xi.m=0,xi.d="W"in xi?(xi.w+6)%7+xi.W*7-(Qr+5)%7:xi.w+xi.U*7-(Qr+6)%7);return"Z"in xi?(xi.H+=xi.Z/100|0,xi.M+=xi.Z%100,P(xi)):z(xi)}}function Kt(Gr,li,Pi,xi){for(var zt=0,xr=li.length,Qr=Pi.length,Ri,en;zt=Qr)return-1;if(Ri=li.charCodeAt(zt++),Ri===37){if(Ri=li.charAt(zt++),en=dn[Ri in a?li.charAt(zt++):Ri],!en||(xi=en(Gr,Pi,xi))<0)return-1}else if(Ri!=Pi.charCodeAt(xi++))return-1}return xi}function lr(Gr,li,Pi){var xi=Wt.exec(li.slice(Pi));return xi?(Gr.p=Yt[xi[0].toLowerCase()],Pi+xi[0].length):-1}function _r(Gr,li,Pi){var xi=Dr.exec(li.slice(Pi));return xi?(Gr.w=br[xi[0].toLowerCase()],Pi+xi[0].length):-1}function Er(Gr,li,Pi){var xi=hr.exec(li.slice(Pi));return xi?(Gr.w=zr[xi[0].toLowerCase()],Pi+xi[0].length):-1}function di(Gr,li,Pi){var xi=cn.exec(li.slice(Pi));return xi?(Gr.m=yn[xi[0].toLowerCase()],Pi+xi[0].length):-1}function qi(Gr,li,Pi){var xi=fi.exec(li.slice(Pi));return xi?(Gr.m=un[xi[0].toLowerCase()],Pi+xi[0].length):-1}function Ui(Gr,li,Pi){return Kt(Gr,ot,li,Pi)}function Hi(Gr,li,Pi){return Kt(Gr,De,li,Pi)}function Ln(Gr,li,Pi){return Kt(Gr,ye,li,Pi)}function Fn(Gr){return at[Gr.getDay()]}function Kn(Gr){return He[Gr.getDay()]}function Jn(Gr){return At[Gr.getMonth()]}function sa(Gr){return ht[Gr.getMonth()]}function Mn(Gr){return Pe[+(Gr.getHours()>=12)]}function Ha(Gr){return 1+~~(Gr.getMonth()/3)}function io(Gr){return at[Gr.getUTCDay()]}function Ft(Gr){return He[Gr.getUTCDay()]}function Rt(Gr){return At[Gr.getUTCMonth()]}function qr(Gr){return ht[Gr.getUTCMonth()]}function ai(Gr){return Pe[+(Gr.getUTCHours()>=12)]}function si(Gr){return 1+~~(Gr.getUTCMonth()/3)}return{format:function(Gr){var li=va(Gr+="",Gn);return li.toString=function(){return Gr},li},parse:function(Gr){var li=na(Gr+="",!1);return li.toString=function(){return Gr},li},utcFormat:function(Gr){var li=va(Gr+="",Sn);return li.toString=function(){return Gr},li},utcParse:function(Gr){var li=na(Gr+="",!0);return li.toString=function(){return Gr},li}}}var a={"-":"",_:" ",0:"0"},l=/^\s*\d+/,o=/^%/,u=/[\\^$*+?|[\]().{}]/g;function s(Xe,ot,De){var ye=Xe<0?"-":"",Pe=(ye?-Xe:Xe)+"",He=Pe.length;return ye+(He68?1900:2e3),De+ye[0].length):-1}function E(Xe,ot,De){var ye=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ot.slice(De,De+6));return ye?(Xe.Z=ye[1]?0:-(ye[2]+(ye[3]||"00")),De+ye[0].length):-1}function I(Xe,ot,De){var ye=l.exec(ot.slice(De,De+1));return ye?(Xe.q=ye[0]*3-3,De+ye[0].length):-1}function M(Xe,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Xe.m=ye[0]-1,De+ye[0].length):-1}function p(Xe,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Xe.d=+ye[0],De+ye[0].length):-1}function g(Xe,ot,De){var ye=l.exec(ot.slice(De,De+3));return ye?(Xe.m=0,Xe.d=+ye[0],De+ye[0].length):-1}function C(Xe,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Xe.H=+ye[0],De+ye[0].length):-1}function T(Xe,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Xe.M=+ye[0],De+ye[0].length):-1}function N(Xe,ot,De){var ye=l.exec(ot.slice(De,De+2));return ye?(Xe.S=+ye[0],De+ye[0].length):-1}function B(Xe,ot,De){var ye=l.exec(ot.slice(De,De+3));return ye?(Xe.L=+ye[0],De+ye[0].length):-1}function U(Xe,ot,De){var ye=l.exec(ot.slice(De,De+6));return ye?(Xe.L=Math.floor(ye[0]/1e3),De+ye[0].length):-1}function V(Xe,ot,De){var ye=o.exec(ot.slice(De,De+1));return ye?De+ye[0].length:-1}function W(Xe,ot,De){var ye=l.exec(ot.slice(De));return ye?(Xe.Q=+ye[0],De+ye[0].length):-1}function F(Xe,ot,De){var ye=l.exec(ot.slice(De));return ye?(Xe.s=+ye[0],De+ye[0].length):-1}function H(Xe,ot){return s(Xe.getDate(),ot,2)}function q(Xe,ot){return s(Xe.getHours(),ot,2)}function G(Xe,ot){return s(Xe.getHours()%12||12,ot,2)}function ee(Xe,ot){return s(1+y.timeDay.count(y.timeYear(Xe),Xe),ot,3)}function he(Xe,ot){return s(Xe.getMilliseconds(),ot,3)}function be(Xe,ot){return he(Xe,ot)+"000"}function ve(Xe,ot){return s(Xe.getMonth()+1,ot,2)}function ce(Xe,ot){return s(Xe.getMinutes(),ot,2)}function re(Xe,ot){return s(Xe.getSeconds(),ot,2)}function ge(Xe){var ot=Xe.getDay();return ot===0?7:ot}function ne(Xe,ot){return s(y.timeSunday.count(y.timeYear(Xe)-1,Xe),ot,2)}function se(Xe,ot){var De=Xe.getDay();return Xe=De>=4||De===0?y.timeThursday(Xe):y.timeThursday.ceil(Xe),s(y.timeThursday.count(y.timeYear(Xe),Xe)+(y.timeYear(Xe).getDay()===4),ot,2)}function _e(Xe){return Xe.getDay()}function oe(Xe,ot){return s(y.timeMonday.count(y.timeYear(Xe)-1,Xe),ot,2)}function J(Xe,ot){return s(Xe.getFullYear()%100,ot,2)}function me(Xe,ot){return s(Xe.getFullYear()%1e4,ot,4)}function fe(Xe){var ot=Xe.getTimezoneOffset();return(ot>0?"-":(ot*=-1,"+"))+s(ot/60|0,"0",2)+s(ot%60,"0",2)}function Ce(Xe,ot){return s(Xe.getUTCDate(),ot,2)}function Re(Xe,ot){return s(Xe.getUTCHours(),ot,2)}function Be(Xe,ot){return s(Xe.getUTCHours()%12||12,ot,2)}function Ze(Xe,ot){return s(1+y.utcDay.count(y.utcYear(Xe),Xe),ot,3)}function Ge(Xe,ot){return s(Xe.getUTCMilliseconds(),ot,3)}function tt(Xe,ot){return Ge(Xe,ot)+"000"}function _t(Xe,ot){return s(Xe.getUTCMonth()+1,ot,2)}function mt(Xe,ot){return s(Xe.getUTCMinutes(),ot,2)}function vt(Xe,ot){return s(Xe.getUTCSeconds(),ot,2)}function ct(Xe){var ot=Xe.getUTCDay();return ot===0?7:ot}function Ae(Xe,ot){return s(y.utcSunday.count(y.utcYear(Xe)-1,Xe),ot,2)}function Oe(Xe,ot){var De=Xe.getUTCDay();return Xe=De>=4||De===0?y.utcThursday(Xe):y.utcThursday.ceil(Xe),s(y.utcThursday.count(y.utcYear(Xe),Xe)+(y.utcYear(Xe).getUTCDay()===4),ot,2)}function Le(Xe){return Xe.getUTCDay()}function nt(Xe,ot){return s(y.utcMonday.count(y.utcYear(Xe)-1,Xe),ot,2)}function xt(Xe,ot){return s(Xe.getUTCFullYear()%100,ot,2)}function ut(Xe,ot){return s(Xe.getUTCFullYear()%1e4,ot,4)}function Et(){return"+0000"}function Gt(){return"%"}function Qt(Xe){return+Xe}function vr(Xe){return Math.floor(+Xe/1e3)}var mr;Yr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Yr(Xe){return mr=n(Xe),d.timeFormat=mr.format,d.timeParse=mr.parse,d.utcFormat=mr.utcFormat,d.utcParse=mr.utcParse,mr}var ii="%Y-%m-%dT%H:%M:%S.%LZ";function Lr(Xe){return Xe.toISOString()}var ci=Date.prototype.toISOString?Lr:d.utcFormat(ii);function vi(Xe){var ot=new Date(Xe);return isNaN(ot)?null:ot}var Ot=+new Date("2000-01-01T00:00:00.000Z")?vi:d.utcParse(ii);d.isoFormat=ci,d.isoParse=Ot,d.timeFormatDefaultLocale=Yr,d.timeFormatLocale=n,Object.defineProperty(d,"__esModule",{value:!0})})}),gr=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=typeof globalThis<"u"?globalThis:d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(M){return Math.abs(M=Math.round(M))>=1e21?M.toLocaleString("en").replace(/,/g,""):M.toString(10)}function z(M,p){if((g=(M=p?M.toExponential(p-1):M.toExponential()).indexOf("e"))<0)return null;var g,C=M.slice(0,g);return[C.length>1?C[0]+C.slice(2):C,+M.slice(g+1)]}function P(M){return M=z(Math.abs(M)),M?M[1]:NaN}function i(M,p){return function(g,C){for(var T=g.length,N=[],B=0,U=M[0],V=0;T>0&&U>0&&(V+U+1>C&&(U=Math.max(1,C-V)),N.push(g.substring(T-=U,T+U)),!((V+=U+1)>C));)U=M[B=(B+1)%M.length];return N.reverse().join(p)}}function n(M){return function(p){return p.replace(/[0-9]/g,function(g){return M[+g]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(M){if(!(p=a.exec(M)))throw new Error("invalid format: "+M);var p;return new o({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}l.prototype=o.prototype;function o(M){this.fill=M.fill===void 0?" ":M.fill+"",this.align=M.align===void 0?">":M.align+"",this.sign=M.sign===void 0?"-":M.sign+"",this.symbol=M.symbol===void 0?"":M.symbol+"",this.zero=!!M.zero,this.width=M.width===void 0?void 0:+M.width,this.comma=!!M.comma,this.precision=M.precision===void 0?void 0:+M.precision,this.trim=!!M.trim,this.type=M.type===void 0?"":M.type+""}o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function u(M){e:for(var p=M.length,g=1,C=-1,T;g0&&(C=0);break}return C>0?M.slice(0,C)+M.slice(T+1):M}var s;function h(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],T=g[1],N=T-(s=Math.max(-8,Math.min(8,Math.floor(T/3)))*3)+1,B=C.length;return N===B?C:N>B?C+new Array(N-B+1).join("0"):N>0?C.slice(0,N)+"."+C.slice(N):"0."+new Array(1-N).join("0")+z(M,Math.max(0,p+N-1))[0]}function m(M,p){var g=z(M,p);if(!g)return M+"";var C=g[0],T=g[1];return T<0?"0."+new Array(-T).join("0")+C:C.length>T+1?C.slice(0,T+1)+"."+C.slice(T+1):C+new Array(T-C.length+2).join("0")}var b={"%":function(M,p){return(M*100).toFixed(p)},b:function(M){return Math.round(M).toString(2)},c:function(M){return M+""},d:y,e:function(M,p){return M.toExponential(p)},f:function(M,p){return M.toFixed(p)},g:function(M,p){return M.toPrecision(p)},o:function(M){return Math.round(M).toString(8)},p:function(M,p){return m(M*100,p)},r:m,s:h,X:function(M){return Math.round(M).toString(16).toUpperCase()},x:function(M){return Math.round(M).toString(16)}};function x(M){return M}var _=Array.prototype.map,A=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function f(M){var p=M.grouping===void 0||M.thousands===void 0?x:i(_.call(M.grouping,Number),M.thousands+""),g=M.currency===void 0?"":M.currency[0]+"",C=M.currency===void 0?"":M.currency[1]+"",T=M.decimal===void 0?".":M.decimal+"",N=M.numerals===void 0?x:n(_.call(M.numerals,String)),B=M.percent===void 0?"%":M.percent+"",U=M.minus===void 0?"-":M.minus+"",V=M.nan===void 0?"NaN":M.nan+"";function W(H){H=l(H);var q=H.fill,G=H.align,ee=H.sign,he=H.symbol,be=H.zero,ve=H.width,ce=H.comma,re=H.precision,ge=H.trim,ne=H.type;ne==="n"?(ce=!0,ne="g"):b[ne]||(re===void 0&&(re=12),ge=!0,ne="g"),(be||q==="0"&&G==="=")&&(be=!0,q="0",G="=");var se=he==="$"?g:he==="#"&&/[boxX]/.test(ne)?"0"+ne.toLowerCase():"",_e=he==="$"?C:/[%p]/.test(ne)?B:"",oe=b[ne],J=/[defgprs%]/.test(ne);re=re===void 0?6:/[gprs]/.test(ne)?Math.max(1,Math.min(21,re)):Math.max(0,Math.min(20,re));function me(fe){var Ce=se,Re=_e,Be,Ze,Ge;if(ne==="c")Re=oe(fe)+Re,fe="";else{fe=+fe;var tt=fe<0||1/fe<0;if(fe=isNaN(fe)?V:oe(Math.abs(fe),re),ge&&(fe=u(fe)),tt&&+fe==0&&ee!=="+"&&(tt=!1),Ce=(tt?ee==="("?ee:U:ee==="-"||ee==="("?"":ee)+Ce,Re=(ne==="s"?A[8+s/3]:"")+Re+(tt&&ee==="("?")":""),J){for(Be=-1,Ze=fe.length;++BeGe||Ge>57){Re=(Ge===46?T+fe.slice(Be+1):fe.slice(Be))+Re,fe=fe.slice(0,Be);break}}}ce&&!be&&(fe=p(fe,1/0));var _t=Ce.length+fe.length+Re.length,mt=_t>1)+Ce+fe+Re+mt.slice(_t);break;default:fe=mt+Ce+fe+Re;break}return N(fe)}return me.toString=function(){return H+""},me}function F(H,q){var G=W((H=l(H),H.type="f",H)),ee=Math.max(-8,Math.min(8,Math.floor(P(q)/3)))*3,he=Math.pow(10,-ee),be=A[8+ee/3];return function(ve){return G(he*ve)+be}}return{format:W,formatPrefix:F}}var k;w({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function w(M){return k=f(M),d.format=k.format,d.formatPrefix=k.formatPrefix,k}function D(M){return Math.max(0,-P(Math.abs(M)))}function E(M,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(P(p)/3)))*3-P(Math.abs(M)))}function I(M,p){return M=Math.abs(M),p=Math.abs(p)-M,Math.max(0,P(p)-P(M))+1}d.FormatSpecifier=o,d.formatDefaultLocale=w,d.formatLocale=f,d.formatSpecifier=l,d.precisionFixed=D,d.precisionPrefix=E,d.precisionRound=I,Object.defineProperty(d,"__esModule",{value:!0})})}),fr=ze((te,Y)=>{Y.exports=function(d){for(var y=d.length,z,P=0;P13)&&z!==32&&z!==133&&z!==160&&z!==5760&&z!==6158&&(z<8192||z>8205)&&z!==8232&&z!==8233&&z!==8239&&z!==8287&&z!==8288&&z!==12288&&z!==65279)return!1;return!0}}),Sr=ze((te,Y)=>{var d=fr();Y.exports=function(y){var z=typeof y;if(z==="string"){var P=y;if(y=+y,y===0&&d(P))return!1}else if(z!=="number")return!1;return y-y<1}}),ei=ze((te,Y)=>{Y.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}),Jr=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=typeof globalThis<"u"?globalThis:d||self,y(d["base64-arraybuffer"]={}))})(te,function(d){for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z=typeof Uint8Array>"u"?[]:new Uint8Array(256),P=0;P>2],s+=y[(l[o]&3)<<4|l[o+1]>>4],s+=y[(l[o+1]&15)<<2|l[o+2]>>6],s+=y[l[o+2]&63];return u%3===2?s=s.substring(0,s.length-1)+"=":u%3===1&&(s=s.substring(0,s.length-2)+"=="),s},n=function(a){var l=a.length*.75,o=a.length,u,s=0,h,m,b,x;a[a.length-1]==="="&&(l--,a[a.length-2]==="="&&l--);var _=new ArrayBuffer(l),A=new Uint8Array(_);for(u=0;u>4,A[s++]=(m&15)<<4|b>>2,A[s++]=(b&3)<<6|x&63;return _};d.decode=n,d.encode=i,Object.defineProperty(d,"__esModule",{value:!0})})}),ti=ze((te,Y)=>{Y.exports=function(d){return window&&window.process&&window.process.versions?Object.prototype.toString.call(d)==="[object Object]":Object.prototype.toString.call(d)==="[object Object]"&&Object.getPrototypeOf(d).hasOwnProperty("hasOwnProperty")}}),Di=ze(te=>{var Y=Jr().decode,d=ti(),y=Array.isArray,z=ArrayBuffer,P=DataView;function i(h){return z.isView(h)&&!(h instanceof P)}te.isTypedArray=i;function n(h){return y(h)||i(h)}te.isArrayOrTypedArray=n;function a(h){return!n(h[0])}te.isArray1D=a,te.ensureArray=function(h,m){return y(h)||(h=[]),h.length=m,h};var l={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8;function o(h){return h.constructor===ArrayBuffer}te.isArrayBuffer=o,te.decodeTypedArraySpec=function(h){var m=[],b=u(h),x=b.dtype,_=l[x];if(!_)throw new Error('Error in dtype: "'+x+'"');var A=_.BYTES_PER_ELEMENT,f=b.bdata;o(f)||(f=Y(f));var k=b.shape===void 0?[f.byteLength/A]:(""+b.shape).split(",");k.reverse();var w=k.length,D,E,I=+k[0],M=A*I,p=0;if(w===1)m=new _(f);else if(w===2)for(D=+k[1],E=0;E{var d=Sr(),y=Di().isArrayOrTypedArray;Y.exports=function(s,h){if(d(h))h=String(h);else if(typeof h!="string"||h.substr(h.length-4)==="[-1]")throw"bad property string";var m=h.split("."),b,x,_,A;for(A=0;A{var d=En(),y=/^\w*$/,z=0,P=1,i=2,n=3,a=4;Y.exports=function(l,o,u,s){u=u||"name",s=s||"value";var h,m,b,x={};o&&o.length?(b=d(l,o),m=b.get()):m=l,o=o||"";var _={};if(m)for(h=0;h2)return x[w]=x[w]|i,f.set(k,null);if(A){for(h=w;h{var d=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,y=/^[^\.\[\]]+$/;Y.exports=function(z,P){for(;P;){var i=z.match(d);if(i)z=i[1];else if(z.match(y))z="";else throw new Error("bad relativeAttr call:"+[z,P]);if(P.charAt(0)==="^")P=P.slice(1);else break}return z&&P.charAt(0)!=="["?z+"."+P:z+P}}),ya=ze((te,Y)=>{var d=Sr();Y.exports=function(y,z){if(y>0)return Math.log(y)/Math.LN10;var P=Math.log(Math.min(z[0],z[1]))/Math.LN10;return d(P)||(P=Math.log(Math.max(z[0],z[1]))/Math.LN10-6),P}}),ro=ze((te,Y)=>{var d=Di().isArrayOrTypedArray,y=ti();Y.exports=function z(P,i){for(var n in i){var a=i[n],l=P[n];if(l!==a)if(n.charAt(0)==="_"||typeof a=="function"){if(n in P)continue;P[n]=a}else if(d(a)&&d(l)&&y(a[0])){if(n==="customdata"||n==="ids")continue;for(var o=Math.min(a.length,l.length),u=0;u{function d(z,P){var i=z%P;return i<0?i+P:i}function y(z,P){return Math.abs(z)>P/2?z-Math.round(z/P)*P:z}Y.exports={mod:d,modHalf:y}}),ln=ze((te,Y)=>{(function(d){var y=/^\s+/,z=/\s+$/,P=0,i=d.round,n=d.min,a=d.max,l=d.random;function o(J,me){if(J=J||"",me=me||{},J instanceof o)return J;if(!(this instanceof o))return new o(J,me);var fe=u(J);this._originalInput=J,this._r=fe.r,this._g=fe.g,this._b=fe.b,this._a=fe.a,this._roundA=i(100*this._a)/100,this._format=me.format||fe.format,this._gradientType=me.gradientType,this._r<1&&(this._r=i(this._r)),this._g<1&&(this._g=i(this._g)),this._b<1&&(this._b=i(this._b)),this._ok=fe.ok,this._tc_id=P++}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var J=this.toRgb();return(J.r*299+J.g*587+J.b*114)/1e3},getLuminance:function(){var J=this.toRgb(),me,fe,Ce,Re,Be,Ze;return me=J.r/255,fe=J.g/255,Ce=J.b/255,me<=.03928?Re=me/12.92:Re=d.pow((me+.055)/1.055,2.4),fe<=.03928?Be=fe/12.92:Be=d.pow((fe+.055)/1.055,2.4),Ce<=.03928?Ze=Ce/12.92:Ze=d.pow((Ce+.055)/1.055,2.4),.2126*Re+.7152*Be+.0722*Ze},setAlpha:function(J){return this._a=H(J),this._roundA=i(100*this._a)/100,this},toHsv:function(){var J=b(this._r,this._g,this._b);return{h:J.h*360,s:J.s,v:J.v,a:this._a}},toHsvString:function(){var J=b(this._r,this._g,this._b),me=i(J.h*360),fe=i(J.s*100),Ce=i(J.v*100);return this._a==1?"hsv("+me+", "+fe+"%, "+Ce+"%)":"hsva("+me+", "+fe+"%, "+Ce+"%, "+this._roundA+")"},toHsl:function(){var J=h(this._r,this._g,this._b);return{h:J.h*360,s:J.s,l:J.l,a:this._a}},toHslString:function(){var J=h(this._r,this._g,this._b),me=i(J.h*360),fe=i(J.s*100),Ce=i(J.l*100);return this._a==1?"hsl("+me+", "+fe+"%, "+Ce+"%)":"hsla("+me+", "+fe+"%, "+Ce+"%, "+this._roundA+")"},toHex:function(J){return _(this._r,this._g,this._b,J)},toHexString:function(J){return"#"+this.toHex(J)},toHex8:function(J){return A(this._r,this._g,this._b,this._a,J)},toHex8String:function(J){return"#"+this.toHex8(J)},toRgb:function(){return{r:i(this._r),g:i(this._g),b:i(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+i(this._r)+", "+i(this._g)+", "+i(this._b)+")":"rgba("+i(this._r)+", "+i(this._g)+", "+i(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:i(q(this._r,255)*100)+"%",g:i(q(this._g,255)*100)+"%",b:i(q(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+i(q(this._r,255)*100)+"%, "+i(q(this._g,255)*100)+"%, "+i(q(this._b,255)*100)+"%)":"rgba("+i(q(this._r,255)*100)+"%, "+i(q(this._g,255)*100)+"%, "+i(q(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:W[_(this._r,this._g,this._b,!0)]||!1},toFilter:function(J){var me="#"+f(this._r,this._g,this._b,this._a),fe=me,Ce=this._gradientType?"GradientType = 1, ":"";if(J){var Re=o(J);fe="#"+f(Re._r,Re._g,Re._b,Re._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ce+"startColorstr="+me+",endColorstr="+fe+")"},toString:function(J){var me=!!J;J=J||this._format;var fe=!1,Ce=this._a<1&&this._a>=0,Re=!me&&Ce&&(J==="hex"||J==="hex6"||J==="hex3"||J==="hex4"||J==="hex8"||J==="name");return Re?J==="name"&&this._a===0?this.toName():this.toRgbString():(J==="rgb"&&(fe=this.toRgbString()),J==="prgb"&&(fe=this.toPercentageRgbString()),(J==="hex"||J==="hex6")&&(fe=this.toHexString()),J==="hex3"&&(fe=this.toHexString(!0)),J==="hex4"&&(fe=this.toHex8String(!0)),J==="hex8"&&(fe=this.toHex8String()),J==="name"&&(fe=this.toName()),J==="hsl"&&(fe=this.toHslString()),J==="hsv"&&(fe=this.toHsvString()),fe||this.toHexString())},clone:function(){return o(this.toString())},_applyModification:function(J,me){var fe=J.apply(null,[this].concat([].slice.call(me)));return this._r=fe._r,this._g=fe._g,this._b=fe._b,this.setAlpha(fe._a),this},lighten:function(){return this._applyModification(E,arguments)},brighten:function(){return this._applyModification(I,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(k,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(D,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(J,me){return J.apply(null,[this].concat([].slice.call(me)))},analogous:function(){return this._applyCombination(B,arguments)},complement:function(){return this._applyCombination(g,arguments)},monochromatic:function(){return this._applyCombination(U,arguments)},splitcomplement:function(){return this._applyCombination(N,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(T,arguments)}},o.fromRatio=function(J,me){if(typeof J=="object"){var fe={};for(var Ce in J)J.hasOwnProperty(Ce)&&(Ce==="a"?fe[Ce]=J[Ce]:fe[Ce]=ce(J[Ce]));J=fe}return o(J,me)};function u(J){var me={r:0,g:0,b:0},fe=1,Ce=null,Re=null,Be=null,Ze=!1,Ge=!1;return typeof J=="string"&&(J=_e(J)),typeof J=="object"&&(se(J.r)&&se(J.g)&&se(J.b)?(me=s(J.r,J.g,J.b),Ze=!0,Ge=String(J.r).substr(-1)==="%"?"prgb":"rgb"):se(J.h)&&se(J.s)&&se(J.v)?(Ce=ce(J.s),Re=ce(J.v),me=x(J.h,Ce,Re),Ze=!0,Ge="hsv"):se(J.h)&&se(J.s)&&se(J.l)&&(Ce=ce(J.s),Be=ce(J.l),me=m(J.h,Ce,Be),Ze=!0,Ge="hsl"),J.hasOwnProperty("a")&&(fe=J.a)),fe=H(fe),{ok:Ze,format:J.format||Ge,r:n(255,a(me.r,0)),g:n(255,a(me.g,0)),b:n(255,a(me.b,0)),a:fe}}function s(J,me,fe){return{r:q(J,255)*255,g:q(me,255)*255,b:q(fe,255)*255}}function h(J,me,fe){J=q(J,255),me=q(me,255),fe=q(fe,255);var Ce=a(J,me,fe),Re=n(J,me,fe),Be,Ze,Ge=(Ce+Re)/2;if(Ce==Re)Be=Ze=0;else{var tt=Ce-Re;switch(Ze=Ge>.5?tt/(2-Ce-Re):tt/(Ce+Re),Ce){case J:Be=(me-fe)/tt+(me1&&(vt-=1),vt<1/6?_t+(mt-_t)*6*vt:vt<1/2?mt:vt<2/3?_t+(mt-_t)*(2/3-vt)*6:_t}if(me===0)Ce=Re=Be=fe;else{var Ge=fe<.5?fe*(1+me):fe+me-fe*me,tt=2*fe-Ge;Ce=Ze(tt,Ge,J+1/3),Re=Ze(tt,Ge,J),Be=Ze(tt,Ge,J-1/3)}return{r:Ce*255,g:Re*255,b:Be*255}}function b(J,me,fe){J=q(J,255),me=q(me,255),fe=q(fe,255);var Ce=a(J,me,fe),Re=n(J,me,fe),Be,Ze,Ge=Ce,tt=Ce-Re;if(Ze=Ce===0?0:tt/Ce,Ce==Re)Be=0;else{switch(Ce){case J:Be=(me-fe)/tt+(me>1)+720)%360;--me;)Ce.h=(Ce.h+Re)%360,Be.push(o(Ce));return Be}function U(J,me){me=me||6;for(var fe=o(J).toHsv(),Ce=fe.h,Re=fe.s,Be=fe.v,Ze=[],Ge=1/me;me--;)Ze.push(o({h:Ce,s:Re,v:Be})),Be=(Be+Ge)%1;return Ze}o.mix=function(J,me,fe){fe=fe===0?0:fe||50;var Ce=o(J).toRgb(),Re=o(me).toRgb(),Be=fe/100,Ze={r:(Re.r-Ce.r)*Be+Ce.r,g:(Re.g-Ce.g)*Be+Ce.g,b:(Re.b-Ce.b)*Be+Ce.b,a:(Re.a-Ce.a)*Be+Ce.a};return o(Ze)},o.readability=function(J,me){var fe=o(J),Ce=o(me);return(d.max(fe.getLuminance(),Ce.getLuminance())+.05)/(d.min(fe.getLuminance(),Ce.getLuminance())+.05)},o.isReadable=function(J,me,fe){var Ce=o.readability(J,me),Re,Be;switch(Be=!1,Re=oe(fe),Re.level+Re.size){case"AAsmall":case"AAAlarge":Be=Ce>=4.5;break;case"AAlarge":Be=Ce>=3;break;case"AAAsmall":Be=Ce>=7;break}return Be},o.mostReadable=function(J,me,fe){var Ce=null,Re=0,Be,Ze,Ge,tt;fe=fe||{},Ze=fe.includeFallbackColors,Ge=fe.level,tt=fe.size;for(var _t=0;_tRe&&(Re=Be,Ce=o(me[_t]));return o.isReadable(J,Ce,{level:Ge,size:tt})||!Ze?Ce:(fe.includeFallbackColors=!1,o.mostReadable(J,["#fff","#000"],fe))};var V=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},W=o.hexNames=F(V);function F(J){var me={};for(var fe in J)J.hasOwnProperty(fe)&&(me[J[fe]]=fe);return me}function H(J){return J=parseFloat(J),(isNaN(J)||J<0||J>1)&&(J=1),J}function q(J,me){he(J)&&(J="100%");var fe=be(J);return J=n(me,a(0,parseFloat(J))),fe&&(J=parseInt(J*me,10)/100),d.abs(J-me)<1e-6?1:J%me/parseFloat(me)}function G(J){return n(1,a(0,J))}function ee(J){return parseInt(J,16)}function he(J){return typeof J=="string"&&J.indexOf(".")!=-1&&parseFloat(J)===1}function be(J){return typeof J=="string"&&J.indexOf("%")!=-1}function ve(J){return J.length==1?"0"+J:""+J}function ce(J){return J<=1&&(J=J*100+"%"),J}function re(J){return d.round(parseFloat(J)*255).toString(16)}function ge(J){return ee(J)/255}var ne=function(){var J="[-\\+]?\\d+%?",me="[-\\+]?\\d*\\.\\d+%?",fe="(?:"+me+")|(?:"+J+")",Ce="[\\s|\\(]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")\\s*\\)?",Re="[\\s|\\(]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")[,|\\s]+("+fe+")\\s*\\)?";return{CSS_UNIT:new RegExp(fe),rgb:new RegExp("rgb"+Ce),rgba:new RegExp("rgba"+Re),hsl:new RegExp("hsl"+Ce),hsla:new RegExp("hsla"+Re),hsv:new RegExp("hsv"+Ce),hsva:new RegExp("hsva"+Re),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function se(J){return!!ne.CSS_UNIT.exec(J)}function _e(J){J=J.replace(y,"").replace(z,"").toLowerCase();var me=!1;if(V[J])J=V[J],me=!0;else if(J=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var fe;return(fe=ne.rgb.exec(J))?{r:fe[1],g:fe[2],b:fe[3]}:(fe=ne.rgba.exec(J))?{r:fe[1],g:fe[2],b:fe[3],a:fe[4]}:(fe=ne.hsl.exec(J))?{h:fe[1],s:fe[2],l:fe[3]}:(fe=ne.hsla.exec(J))?{h:fe[1],s:fe[2],l:fe[3],a:fe[4]}:(fe=ne.hsv.exec(J))?{h:fe[1],s:fe[2],v:fe[3]}:(fe=ne.hsva.exec(J))?{h:fe[1],s:fe[2],v:fe[3],a:fe[4]}:(fe=ne.hex8.exec(J))?{r:ee(fe[1]),g:ee(fe[2]),b:ee(fe[3]),a:ge(fe[4]),format:me?"name":"hex8"}:(fe=ne.hex6.exec(J))?{r:ee(fe[1]),g:ee(fe[2]),b:ee(fe[3]),format:me?"name":"hex"}:(fe=ne.hex4.exec(J))?{r:ee(fe[1]+""+fe[1]),g:ee(fe[2]+""+fe[2]),b:ee(fe[3]+""+fe[3]),a:ge(fe[4]+""+fe[4]),format:me?"name":"hex8"}:(fe=ne.hex3.exec(J))?{r:ee(fe[1]+""+fe[1]),g:ee(fe[2]+""+fe[2]),b:ee(fe[3]+""+fe[3]),format:me?"name":"hex"}:!1}function oe(J){var me,fe;return J=J||{level:"AA",size:"small"},me=(J.level||"AA").toUpperCase(),fe=(J.size||"small").toLowerCase(),me!=="AA"&&me!=="AAA"&&(me="AA"),fe!=="small"&&fe!=="large"&&(fe="small"),{level:me,size:fe}}typeof Y<"u"&&Y.exports?Y.exports=o:window.tinycolor=o})(Math)}),nn=ze(te=>{var Y=ti(),d=Array.isArray;function y(P,i){var n,a;for(n=0;n{Y.exports=function(d){var y=d.variantValues,z=d.editType,P=d.colorEditType;P===void 0&&(P=z);var i={editType:z,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};d.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var n={family:{valType:"string",noBlank:!0,strict:!0,editType:z},size:{valType:"number",min:1,editType:z},color:{valType:"color",editType:P},weight:i,style:{editType:z,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:d.noFontVariant?void 0:{editType:z,valType:"enumerated",values:y||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:d.noFontTextcase?void 0:{editType:z,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:d.noFontLineposition?void 0:{editType:z,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:d.noFontShadow?void 0:{editType:z,valType:"string",dflt:d.autoShadowDflt?"auto":"none"},editType:z};return d.autoSize&&(n.size.dflt="auto"),d.autoColor&&(n.color.dflt="auto"),d.arrayOk&&(n.family.arrayOk=!0,n.weight.arrayOk=!0,n.style.arrayOk=!0,d.noFontVariant||(n.variant.arrayOk=!0),d.noFontTextcase||(n.textcase.arrayOk=!0),d.noFontLineposition||(n.lineposition.arrayOk=!0),d.noFontShadow||(n.shadow.arrayOk=!0),n.size.arrayOk=!0,n.color.arrayOk=!0),n}}),Ra=ze((te,Y)=>{Y.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}),Xa=ze((te,Y)=>{var d=Ra(),y=On(),z=y({editType:"none"});z.family.dflt=d.HOVERFONT,z.size.dflt=d.HOVERFONTSIZE,Y.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:z,grouptitlefont:y({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}}),zo=ze((te,Y)=>{var d=On(),y=Xa().hoverlabel,z=nn().extendFlat;Y.exports={hoverlabel:{bgcolor:z({},y.bgcolor,{arrayOk:!0}),bordercolor:z({},y.bordercolor,{arrayOk:!0}),font:d({arrayOk:!0,editType:"none"}),align:z({},y.align,{arrayOk:!0}),namelength:z({},y.namelength,{arrayOk:!0}),showarrow:z({},y.showarrow),editType:"none"}}}),xa=ze((te,Y)=>{var d=On(),y=zo();Y.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:d({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:y.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}),$r=ze((te,Y)=>{var d=ln(),y={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},z=y.RdBu;function P(a,l){if(l||(l=z),!a)return l;function o(){try{a=y[a]||JSON.parse(a)}catch{a=l}}return typeof a=="string"&&(o(),typeof a=="string"&&o()),i(a)?a:l}function i(a){var l=0;if(!Array.isArray(a)||a.length<2||!a[0]||!a[a.length-1]||+a[0][0]!=0||+a[a.length-1][0]!=1)return!1;for(var o=0;o{te.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],te.defaultLine="#444",te.lightLine="#eee",te.background="#fff",te.borderLine="#BEC8D9",te.lightFraction=1e3/11}),Xi=ze((te,Y)=>{var d=ln(),y=Sr(),z=Di().isTypedArray,P=Y.exports={},i=Mi();P.defaults=i.defaults;var n=P.defaultLine=i.defaultLine;P.lightLine=i.lightLine;var a=P.background=i.background;P.tinyRGB=function(o){var u=o.toRgb();return"rgb("+Math.round(u.r)+", "+Math.round(u.g)+", "+Math.round(u.b)+")"},P.rgb=function(o){return P.tinyRGB(d(o))},P.opacity=function(o){return o?d(o).getAlpha():0},P.addOpacity=function(o,u){var s=d(o).toRgb();return"rgba("+Math.round(s.r)+", "+Math.round(s.g)+", "+Math.round(s.b)+", "+u+")"},P.combine=function(o,u){var s=d(o).toRgb();if(s.a===1)return d(o).toRgbString();var h=d(u||a).toRgb(),m=h.a===1?h:{r:255*(1-h.a)+h.r*h.a,g:255*(1-h.a)+h.g*h.a,b:255*(1-h.a)+h.b*h.a},b={r:m.r*(1-s.a)+s.r*s.a,g:m.g*(1-s.a)+s.g*s.a,b:m.b*(1-s.a)+s.b*s.a};return d(b).toRgbString()},P.interpolate=function(o,u,s){var h=d(o).toRgb(),m=d(u).toRgb(),b={r:s*h.r+(1-s)*m.r,g:s*h.g+(1-s)*m.g,b:s*h.b+(1-s)*m.b};return d(b).toRgbString()},P.contrast=function(o,u,s){var h=d(o);h.getAlpha()!==1&&(h=d(P.combine(o,a)));var m=h.isDark()?u?h.lighten(u):a:s?h.darken(s):n;return m.toString()},P.stroke=function(o,u){var s=d(u);o.style({stroke:P.tinyRGB(s),"stroke-opacity":s.getAlpha()})},P.fill=function(o,u){var s=d(u);o.style({fill:P.tinyRGB(s),"fill-opacity":s.getAlpha()})},P.clean=function(o){if(!(!o||typeof o!="object")){var u=Object.keys(o),s,h,m,b;for(s=0;s=0)))return o;if(b===3)h[b]>1&&(h[b]=1);else if(h[b]>=1)return o}var x=Math.round(h[0]*255)+", "+Math.round(h[1]*255)+", "+Math.round(h[2]*255);return m?"rgba("+x+", "+h[3]+")":"rgb("+x+")"}}),so=ze((te,Y)=>{Y.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}),go=ze(te=>{te.counter=function(Y,d,y,z){var P=(d||"")+(y?"":"$"),i=z===!1?"":"^";return Y==="xy"?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+P):new RegExp(i+Y+"([2-9]|[1-9][0-9]+)?"+P)}}),ko=ze(te=>{var Y=Sr(),d=ln(),y=nn().extendFlat,z=xa(),P=$r(),i=Xi(),n=so().DESELECTDIM,a=En(),l=go().counter,o=qn().modHalf,u=Di().isArrayOrTypedArray,s=Di().isTypedArraySpec,h=Di().decodeTypedArraySpec;te.valObjectMeta={data_array:{coerceFunction:function(b,x,_){x.set(u(b)?b:s(b)?h(b):_)}},enumerated:{coerceFunction:function(b,x,_,A){A.coerceNumber&&(b=+b),A.values.indexOf(b)===-1?x.set(_):x.set(b)},validateFunction:function(b,x){x.coerceNumber&&(b=+b);for(var _=x.values,A=0;A<_.length;A++){var f=String(_[A]);if(f.charAt(0)==="/"&&f.charAt(f.length-1)==="/"){var k=new RegExp(f.substr(1,f.length-2));if(k.test(b))return!0}else if(b===_[A])return!0}return!1}},boolean:{coerceFunction:function(b,x,_){b===!0||b===!1?x.set(b):x.set(_)}},number:{coerceFunction:function(b,x,_,A){s(b)&&(b=h(b)),!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},integer:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}s(b)&&(b=h(b)),b%1||!Y(b)||A.min!==void 0&&bA.max?x.set(_):x.set(+b)}},string:{coerceFunction:function(b,x,_,A){if(typeof b!="string"){var f=typeof b=="number";A.strict===!0||!f?x.set(_):x.set(String(b))}else A.noBlank&&!b?x.set(_):x.set(b)}},color:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),d(b).isValid()?x.set(b):x.set(_)}},colorlist:{coerceFunction:function(b,x,_){function A(f){return d(f).isValid()}!Array.isArray(b)||!b.length?x.set(_):b.every(A)?x.set(b):x.set(_)}},colorscale:{coerceFunction:function(b,x,_){x.set(P.get(b,_))}},angle:{coerceFunction:function(b,x,_){s(b)&&(b=h(b)),b==="auto"?x.set("auto"):Y(b)?x.set(o(+b,360)):x.set(_)}},subplotid:{coerceFunction:function(b,x,_,A){var f=A.regex||l(_);if(typeof b=="string"&&f.test(b)){x.set(b);return}x.set(_)},validateFunction:function(b,x){var _=x.dflt;return b===_?!0:typeof b!="string"?!1:!!l(_).test(b)}},flaglist:{coerceFunction:function(b,x,_,A){if((A.extras||[]).indexOf(b)!==-1){x.set(b);return}if(typeof b!="string"){x.set(_);return}for(var f=b.split("+"),k=0;k{var d={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},y={};function z(P,i){for(var n in P){var a=P[n];a.valType?i[n]=a.dflt:(i[n]||(i[n]={}),z(a,i[n]))}}z(d,y),Y.exports={configAttributes:d,dfltConfig:y}}),ys=ze((te,Y)=>{var d=ri(),y=Sr(),z=[];Y.exports=function(P,i){if(z.indexOf(P)!==-1)return;z.push(P);var n=1e3;y(i)?n=i:i==="long"&&(n=3e3);var a=d.select("body").selectAll(".plotly-notifier").data([0]);a.enter().append("div").classed("plotly-notifier",!0);var l=a.selectAll(".notifier-note").data(z);function o(u){u.duration(700).style("opacity",0).each("end",function(s){var h=z.indexOf(s);h!==-1&&z.splice(h,1),d.select(this).remove()})}l.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(u){var s=d.select(this);s.append("button").classed("notifier-close",!0).html("×").on("click",function(){s.transition().call(o)});for(var h=s.append("p"),m=u.split(//g),b=0;b{var d=ss().dfltConfig,y=ys(),z=Y.exports={};z.log=function(){var P;if(d.logging>1){var i=["LOG:"];for(P=0;P1){var n=[];for(P=0;P"),"long")}},z.warn=function(){var P;if(d.logging>0){var i=["WARN:"];for(P=0;P0){var n=[];for(P=0;P"),"stick")}},z.error=function(){var P;if(d.logging>0){var i=["ERROR:"];for(P=0;P0){var n=[];for(P=0;P"),"stick")}}}),Qo=ze((te,Y)=>{Y.exports=function(){}}),Rl=ze((te,Y)=>{Y.exports=function(d,y){if(y instanceof RegExp){for(var z=y.toString(),P=0;P{Y.exports=d;function d(){var y=new Float32Array(16);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),ql=ze((te,Y)=>{Y.exports=d;function d(y){var z=new Float32Array(16);return z[0]=y[0],z[1]=y[1],z[2]=y[2],z[3]=y[3],z[4]=y[4],z[5]=y[5],z[6]=y[6],z[7]=y[7],z[8]=y[8],z[9]=y[9],z[10]=y[10],z[11]=y[11],z[12]=y[12],z[13]=y[13],z[14]=y[14],z[15]=y[15],z}}),Su=ze((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),uc=ze((te,Y)=>{Y.exports=d;function d(y){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Th=ze((te,Y)=>{Y.exports=d;function d(y,z){if(y===z){var P=z[1],i=z[2],n=z[3],a=z[6],l=z[7],o=z[11];y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=P,y[6]=z[9],y[7]=z[13],y[8]=i,y[9]=a,y[11]=z[14],y[12]=n,y[13]=l,y[14]=o}else y[0]=z[0],y[1]=z[4],y[2]=z[8],y[3]=z[12],y[4]=z[1],y[5]=z[5],y[6]=z[9],y[7]=z[13],y[8]=z[2],y[9]=z[6],y[10]=z[10],y[11]=z[14],y[12]=z[3],y[13]=z[7],y[14]=z[11],y[15]=z[15];return y}}),Gc=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=z[4],o=z[5],u=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],f=z[14],k=z[15],w=P*o-i*l,D=P*u-n*l,E=P*s-a*l,I=i*u-n*o,M=i*s-a*o,p=n*s-a*u,g=h*A-m*_,C=h*f-b*_,T=h*k-x*_,N=m*f-b*A,B=m*k-x*A,U=b*k-x*f,V=w*U-D*B+E*N+I*T-M*C+p*g;return V?(V=1/V,y[0]=(o*U-u*B+s*N)*V,y[1]=(n*B-i*U-a*N)*V,y[2]=(A*p-f*M+k*I)*V,y[3]=(b*M-m*p-x*I)*V,y[4]=(u*T-l*U-s*C)*V,y[5]=(P*U-n*T+a*C)*V,y[6]=(f*E-_*p-k*D)*V,y[7]=(h*p-b*E+x*D)*V,y[8]=(l*B-o*T+s*g)*V,y[9]=(i*T-P*B-a*g)*V,y[10]=(_*M-A*E+k*w)*V,y[11]=(m*E-h*M-x*w)*V,y[12]=(o*C-l*N-u*g)*V,y[13]=(P*N-i*C+n*g)*V,y[14]=(A*D-_*I-f*w)*V,y[15]=(h*I-m*D+b*w)*V,y):null}}),Rp=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=z[4],o=z[5],u=z[6],s=z[7],h=z[8],m=z[9],b=z[10],x=z[11],_=z[12],A=z[13],f=z[14],k=z[15];return y[0]=o*(b*k-x*f)-m*(u*k-s*f)+A*(u*x-s*b),y[1]=-(i*(b*k-x*f)-m*(n*k-a*f)+A*(n*x-a*b)),y[2]=i*(u*k-s*f)-o*(n*k-a*f)+A*(n*s-a*u),y[3]=-(i*(u*x-s*b)-o*(n*x-a*b)+m*(n*s-a*u)),y[4]=-(l*(b*k-x*f)-h*(u*k-s*f)+_*(u*x-s*b)),y[5]=P*(b*k-x*f)-h*(n*k-a*f)+_*(n*x-a*b),y[6]=-(P*(u*k-s*f)-l*(n*k-a*f)+_*(n*s-a*u)),y[7]=P*(u*x-s*b)-l*(n*x-a*b)+h*(n*s-a*u),y[8]=l*(m*k-x*A)-h*(o*k-s*A)+_*(o*x-s*m),y[9]=-(P*(m*k-x*A)-h*(i*k-a*A)+_*(i*x-a*m)),y[10]=P*(o*k-s*A)-l*(i*k-a*A)+_*(i*s-a*o),y[11]=-(P*(o*x-s*m)-l*(i*x-a*m)+h*(i*s-a*o)),y[12]=-(l*(m*f-b*A)-h*(o*f-u*A)+_*(o*b-u*m)),y[13]=P*(m*f-b*A)-h*(i*f-n*A)+_*(i*b-n*m),y[14]=-(P*(o*f-u*A)-l*(i*f-n*A)+_*(i*u-n*o)),y[15]=P*(o*b-u*m)-l*(i*b-n*m)+h*(i*u-n*o),y}}),kp=ze((te,Y)=>{Y.exports=d;function d(y){var z=y[0],P=y[1],i=y[2],n=y[3],a=y[4],l=y[5],o=y[6],u=y[7],s=y[8],h=y[9],m=y[10],b=y[11],x=y[12],_=y[13],A=y[14],f=y[15],k=z*l-P*a,w=z*o-i*a,D=z*u-n*a,E=P*o-i*l,I=P*u-n*l,M=i*u-n*o,p=s*_-h*x,g=s*A-m*x,C=s*f-b*x,T=h*A-m*_,N=h*f-b*_,B=m*f-b*A;return k*B-w*N+D*T+E*C-I*g+M*p}}),W0=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=z[0],n=z[1],a=z[2],l=z[3],o=z[4],u=z[5],s=z[6],h=z[7],m=z[8],b=z[9],x=z[10],_=z[11],A=z[12],f=z[13],k=z[14],w=z[15],D=P[0],E=P[1],I=P[2],M=P[3];return y[0]=D*i+E*o+I*m+M*A,y[1]=D*n+E*u+I*b+M*f,y[2]=D*a+E*s+I*x+M*k,y[3]=D*l+E*h+I*_+M*w,D=P[4],E=P[5],I=P[6],M=P[7],y[4]=D*i+E*o+I*m+M*A,y[5]=D*n+E*u+I*b+M*f,y[6]=D*a+E*s+I*x+M*k,y[7]=D*l+E*h+I*_+M*w,D=P[8],E=P[9],I=P[10],M=P[11],y[8]=D*i+E*o+I*m+M*A,y[9]=D*n+E*u+I*b+M*f,y[10]=D*a+E*s+I*x+M*k,y[11]=D*l+E*h+I*_+M*w,D=P[12],E=P[13],I=P[14],M=P[15],y[12]=D*i+E*o+I*m+M*A,y[13]=D*n+E*u+I*b+M*f,y[14]=D*a+E*s+I*x+M*k,y[15]=D*l+E*h+I*_+M*w,y}}),um=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=P[0],n=P[1],a=P[2],l,o,u,s,h,m,b,x,_,A,f,k;return z===y?(y[12]=z[0]*i+z[4]*n+z[8]*a+z[12],y[13]=z[1]*i+z[5]*n+z[9]*a+z[13],y[14]=z[2]*i+z[6]*n+z[10]*a+z[14],y[15]=z[3]*i+z[7]*n+z[11]*a+z[15]):(l=z[0],o=z[1],u=z[2],s=z[3],h=z[4],m=z[5],b=z[6],x=z[7],_=z[8],A=z[9],f=z[10],k=z[11],y[0]=l,y[1]=o,y[2]=u,y[3]=s,y[4]=h,y[5]=m,y[6]=b,y[7]=x,y[8]=_,y[9]=A,y[10]=f,y[11]=k,y[12]=l*i+h*n+_*a+z[12],y[13]=o*i+m*n+A*a+z[13],y[14]=u*i+b*n+f*a+z[14],y[15]=s*i+x*n+k*a+z[15]),y}}),Vg=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=P[0],n=P[1],a=P[2];return y[0]=z[0]*i,y[1]=z[1]*i,y[2]=z[2]*i,y[3]=z[3]*i,y[4]=z[4]*n,y[5]=z[5]*n,y[6]=z[6]*n,y[7]=z[7]*n,y[8]=z[8]*a,y[9]=z[9]*a,y[10]=z[10]*a,y[11]=z[11]*a,y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15],y}}),Z1=ze((te,Y)=>{Y.exports=d;function d(y,z,P,i){var n=i[0],a=i[1],l=i[2],o=Math.sqrt(n*n+a*a+l*l),u,s,h,m,b,x,_,A,f,k,w,D,E,I,M,p,g,C,T,N,B,U,V,W;return Math.abs(o)<1e-6?null:(o=1/o,n*=o,a*=o,l*=o,u=Math.sin(P),s=Math.cos(P),h=1-s,m=z[0],b=z[1],x=z[2],_=z[3],A=z[4],f=z[5],k=z[6],w=z[7],D=z[8],E=z[9],I=z[10],M=z[11],p=n*n*h+s,g=a*n*h+l*u,C=l*n*h-a*u,T=n*a*h-l*u,N=a*a*h+s,B=l*a*h+n*u,U=n*l*h+a*u,V=a*l*h-n*u,W=l*l*h+s,y[0]=m*p+A*g+D*C,y[1]=b*p+f*g+E*C,y[2]=x*p+k*g+I*C,y[3]=_*p+w*g+M*C,y[4]=m*T+A*N+D*B,y[5]=b*T+f*N+E*B,y[6]=x*T+k*N+I*B,y[7]=_*T+w*N+M*B,y[8]=m*U+A*V+D*W,y[9]=b*U+f*V+E*W,y[10]=x*U+k*V+I*W,y[11]=_*U+w*V+M*W,z!==y&&(y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y)}}),Fp=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[4],l=z[5],o=z[6],u=z[7],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[0]=z[0],y[1]=z[1],y[2]=z[2],y[3]=z[3],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[4]=a*n+s*i,y[5]=l*n+h*i,y[6]=o*n+m*i,y[7]=u*n+b*i,y[8]=s*n-a*i,y[9]=h*n-l*i,y[10]=m*n-o*i,y[11]=b*n-u*i,y}}),cm=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[0],l=z[1],o=z[2],u=z[3],s=z[8],h=z[9],m=z[10],b=z[11];return z!==y&&(y[4]=z[4],y[5]=z[5],y[6]=z[6],y[7]=z[7],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*n-s*i,y[1]=l*n-h*i,y[2]=o*n-m*i,y[3]=u*n-b*i,y[8]=a*i+s*n,y[9]=l*i+h*n,y[10]=o*i+m*n,y[11]=u*i+b*n,y}}),Wg=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=Math.sin(P),n=Math.cos(P),a=z[0],l=z[1],o=z[2],u=z[3],s=z[4],h=z[5],m=z[6],b=z[7];return z!==y&&(y[8]=z[8],y[9]=z[9],y[10]=z[10],y[11]=z[11],y[12]=z[12],y[13]=z[13],y[14]=z[14],y[15]=z[15]),y[0]=a*n+s*i,y[1]=l*n+h*i,y[2]=o*n+m*i,y[3]=u*n+b*i,y[4]=s*n-a*i,y[5]=h*n-l*i,y[6]=m*n-o*i,y[7]=b*n-u*i,y}}),Kx=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i,n,a,l=P[0],o=P[1],u=P[2],s=Math.sqrt(l*l+o*o+u*u);return Math.abs(s)<1e-6?null:(s=1/s,l*=s,o*=s,u*=s,i=Math.sin(z),n=Math.cos(z),a=1-n,y[0]=l*l*a+n,y[1]=o*l*a+u*i,y[2]=u*l*a-o*i,y[3]=0,y[4]=l*o*a-u*i,y[5]=o*o*a+n,y[6]=u*o*a+l*i,y[7]=0,y[8]=l*u*a+o*i,y[9]=o*u*a-l*i,y[10]=u*u*a+n,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y)}}),Z8=ze((te,Y)=>{Y.exports=d;function d(y,z,P){var i=z[0],n=z[1],a=z[2],l=z[3],o=i+i,u=n+n,s=a+a,h=i*o,m=i*u,b=i*s,x=n*u,_=n*s,A=a*s,f=l*o,k=l*u,w=l*s;return y[0]=1-(x+A),y[1]=m+w,y[2]=b-k,y[3]=0,y[4]=m-w,y[5]=1-(h+A),y[6]=_+f,y[7]=0,y[8]=b+k,y[9]=_-f,y[10]=1-(h+x),y[11]=0,y[12]=P[0],y[13]=P[1],y[14]=P[2],y[15]=1,y}}),m4=ze((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=z[0],y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=z[1],y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=z[2],y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),g4=ze((te,Y)=>{Y.exports=d;function d(y,z){return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=z[0],y[13]=z[1],y[14]=z[2],y[15]=1,y}}),v4=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=i,y[6]=P,y[7]=0,y[8]=0,y[9]=-P,y[10]=i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),K8=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=i,y[1]=0,y[2]=-P,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=P,y[9]=0,y[10]=i,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),Y8=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=Math.sin(z),i=Math.cos(z);return y[0]=i,y[1]=P,y[2]=0,y[3]=0,y[4]=-P,y[5]=i,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),X8=ze((te,Y)=>{Y.exports=d;function d(y,z){var P=z[0],i=z[1],n=z[2],a=z[3],l=P+P,o=i+i,u=n+n,s=P*l,h=i*l,m=i*o,b=n*l,x=n*o,_=n*u,A=a*l,f=a*o,k=a*u;return y[0]=1-m-_,y[1]=h+k,y[2]=b-f,y[3]=0,y[4]=h-k,y[5]=1-s-_,y[6]=x+A,y[7]=0,y[8]=b+f,y[9]=x-A,y[10]=1-s-m,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,y}}),J8=ze((te,Y)=>{Y.exports=d;function d(y,z,P,i,n,a,l){var o=1/(P-z),u=1/(n-i),s=1/(a-l);return y[0]=a*2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a*2*u,y[6]=0,y[7]=0,y[8]=(P+z)*o,y[9]=(n+i)*u,y[10]=(l+a)*s,y[11]=-1,y[12]=0,y[13]=0,y[14]=l*a*2*s,y[15]=0,y}}),Q8=ze((te,Y)=>{Y.exports=d;function d(y,z,P,i,n){var a=1/Math.tan(z/2),l=1/(i-n);return y[0]=a/P,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=a,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=(n+i)*l,y[11]=-1,y[12]=0,y[13]=0,y[14]=2*n*i*l,y[15]=0,y}}),eS=ze((te,Y)=>{Y.exports=d;function d(y,z,P,i){var n=Math.tan(z.upDegrees*Math.PI/180),a=Math.tan(z.downDegrees*Math.PI/180),l=Math.tan(z.leftDegrees*Math.PI/180),o=Math.tan(z.rightDegrees*Math.PI/180),u=2/(l+o),s=2/(n+a);return y[0]=u,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=s,y[6]=0,y[7]=0,y[8]=-((l-o)*u*.5),y[9]=(n-a)*s*.5,y[10]=i/(P-i),y[11]=-1,y[12]=0,y[13]=0,y[14]=i*P/(P-i),y[15]=0,y}}),tw=ze((te,Y)=>{Y.exports=d;function d(y,z,P,i,n,a,l){var o=1/(z-P),u=1/(i-n),s=1/(a-l);return y[0]=-2*o,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=-2*u,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=2*s,y[11]=0,y[12]=(z+P)*o,y[13]=(n+i)*u,y[14]=(l+a)*s,y[15]=1,y}}),tS=ze((te,Y)=>{var d=uc();Y.exports=y;function y(z,P,i,n){var a,l,o,u,s,h,m,b,x,_,A=P[0],f=P[1],k=P[2],w=n[0],D=n[1],E=n[2],I=i[0],M=i[1],p=i[2];return Math.abs(A-I)<1e-6&&Math.abs(f-M)<1e-6&&Math.abs(k-p)<1e-6?d(z):(m=A-I,b=f-M,x=k-p,_=1/Math.sqrt(m*m+b*b+x*x),m*=_,b*=_,x*=_,a=D*x-E*b,l=E*m-w*x,o=w*b-D*m,_=Math.sqrt(a*a+l*l+o*o),_?(_=1/_,a*=_,l*=_,o*=_):(a=0,l=0,o=0),u=b*o-x*l,s=x*a-m*o,h=m*l-b*a,_=Math.sqrt(u*u+s*s+h*h),_?(_=1/_,u*=_,s*=_,h*=_):(u=0,s=0,h=0),z[0]=a,z[1]=u,z[2]=m,z[3]=0,z[4]=l,z[5]=s,z[6]=b,z[7]=0,z[8]=o,z[9]=h,z[10]=x,z[11]=0,z[12]=-(a*A+l*f+o*k),z[13]=-(u*A+s*f+h*k),z[14]=-(m*A+b*f+x*k),z[15]=1,z)}}),rS=ze((te,Y)=>{Y.exports=d;function d(y){return"mat4("+y[0]+", "+y[1]+", "+y[2]+", "+y[3]+", "+y[4]+", "+y[5]+", "+y[6]+", "+y[7]+", "+y[8]+", "+y[9]+", "+y[10]+", "+y[11]+", "+y[12]+", "+y[13]+", "+y[14]+", "+y[15]+")"}}),y4=ze((te,Y)=>{Y.exports={create:Ws(),clone:ql(),copy:Su(),identity:uc(),transpose:Th(),invert:Gc(),adjoint:Rp(),determinant:kp(),multiply:W0(),translate:um(),scale:Vg(),rotate:Z1(),rotateX:Fp(),rotateY:cm(),rotateZ:Wg(),fromRotation:Kx(),fromRotationTranslation:Z8(),fromScaling:m4(),fromTranslation:g4(),fromXRotation:v4(),fromYRotation:K8(),fromZRotation:Y8(),fromQuat:X8(),frustum:J8(),perspective:Q8(),perspectiveFromFieldOfView:eS(),ortho:tw(),lookAt:tS(),str:rS()}}),rw=ze(te=>{var Y=y4();te.init2dArray=function(d,y){for(var z=new Array(d),P=0;P{var d=ri(),y=ns(),z=rw(),P=y4();function i(A){var f;if(typeof A=="string"){if(f=document.getElementById(A),f===null)throw new Error("No DOM element with id '"+A+"' exists on the page.");return f}else if(A==null)throw new Error("DOM element provided is null or undefined");return A}function n(A){var f=d.select(A);return f.node()instanceof HTMLElement&&f.size()&&f.classed("js-plotly-plot")}function a(A){var f=A&&A.parentNode;f&&f.removeChild(A)}function l(A,f){o("global",A,f)}function o(A,f,k){var w="plotly.js-style-"+A,D=document.getElementById(w);if(!(D&&D.matches(".no-inline-styles"))){D||(D=document.createElement("style"),D.setAttribute("id",w),D.appendChild(document.createTextNode("")),document.head.appendChild(D));var E=D.sheet;E?E.insertRule?E.insertRule(f+"{"+k+"}",0):E.addRule?E.addRule(f,k,0):y.warn("addStyleRule failed"):y.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function u(A){var f="plotly.js-style-"+A,k=document.getElementById(f);k&&a(k)}function s(A,f,k,w,D,E){var I=w.split(":"),M=D.split(":"),p="data-btn-style-event-added";E||(E=document),E.querySelectorAll(A).forEach(function(g){g.getAttribute(p)||(g.addEventListener("mouseenter",function(){var C=this.querySelector(k);C&&(C.style[I[0]]=I[1])}),g.addEventListener("mouseleave",function(){var C=this.querySelector(k);C&&(f&&this.matches(f)?C.style[I[0]]=I[1]:C.style[M[0]]=M[1])}),g.setAttribute(p,!0))})}function h(A){var f=b(A),k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return f.forEach(function(w){var D=m(w);if(D){var E=z.convertCssMatrix(D);k=P.multiply(k,k,E)}}),k}function m(A){var f=window.getComputedStyle(A,null),k=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("-moz-transform")||f.getPropertyValue("-ms-transform")||f.getPropertyValue("-o-transform")||f.getPropertyValue("transform");return k==="none"?null:k.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(w){return+w})}function b(A){for(var f=[];x(A);)f.push(A),A=A.parentNode,typeof ShadowRoot=="function"&&A instanceof ShadowRoot&&(A=A.host);return f}function x(A){return A&&(A instanceof Element||A instanceof HTMLElement)}function _(A,f){return A&&f&&A.top===f.top&&A.left===f.left&&A.right===f.right&&A.bottom===f.bottom}Y.exports={getGraphDiv:i,isPlotDiv:n,removeElement:a,addStyleRule:l,addRelatedStyleRule:o,deleteRelatedStyleRule:u,setStyleOnHover:s,getFullTransformMatrix:h,getElementTransformMatrix:m,getElementAndAncestors:b,equalDomRects:_}}),Fl=ze((te,Y)=>{Y.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}),oh=ze((te,Y)=>{var d=nn().extendFlat,y=ti(),z={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},P={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},i=z.flags.slice().concat(["fullReplot"]),n=P.flags.slice().concat("layoutReplot");Y.exports={traces:z,layout:P,traceFlags:function(){return a(i)},layoutFlags:function(){return a(n)},update:function(u,s){var h=s.editType;if(h&&h!=="none")for(var m=h.split("+"),b=0;b{te.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},te.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}}),iw=ze((te,Y)=>{Y.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}}),rc=ze(te=>{var{DATE_FORMAT_LINK:Y,FORMAT_LINK:d}=iw(),y=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function z({supportOther:P}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(P?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,d,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,Y,"for details on the date formatting syntax.",y].join(" ")}te.templateFormatStringDescription=z,te.hovertemplateAttrs=({editType:P="none",arrayOk:i}={},n={})=>wt({valType:"string",dflt:"",editType:P},i!==!1?{arrayOk:!0}:{}),te.texttemplateAttrs=({editType:P="calc",arrayOk:i}={},n={})=>wt({valType:"string",dflt:"",editType:P},i!==!1?{arrayOk:!0}:{}),te.shapeTexttemplateAttrs=({editType:P="arraydraw",newshape:i}={},n={})=>({valType:"string",dflt:"",editType:P}),te.templatefallbackAttrs=({editType:P="none"}={})=>({valType:"any",dflt:"-",editType:P})}),b_=ze((te,Y)=>{function d(k,w){return w?w.d2l(k):k}function y(k,w){return w?w.l2d(k):k}function z(k){return k.x0}function P(k){return k.x1}function i(k){return k.y0}function n(k){return k.y1}function a(k){return k.x0shift||0}function l(k){return k.x1shift||0}function o(k){return k.y0shift||0}function u(k){return k.y1shift||0}function s(k,w){return d(k.x1,w)+l(k)-d(k.x0,w)-a(k)}function h(k,w,D){return d(k.y1,D)+u(k)-d(k.y0,D)-o(k)}function m(k,w){return Math.abs(s(k,w))}function b(k,w,D){return Math.abs(h(k,w,D))}function x(k,w,D){return k.type!=="line"?void 0:Math.sqrt(Math.pow(s(k,w),2)+Math.pow(h(k,w,D),2))}function _(k,w){return y((d(k.x1,w)+l(k)+d(k.x0,w)+a(k))/2,w)}function A(k,w,D){return y((d(k.y1,D)+u(k)+d(k.y0,D)+o(k))/2,D)}function f(k,w,D){return k.type!=="line"?void 0:h(k,w,D)/s(k,w)}Y.exports={x0:z,x1:P,y0:i,y1:n,slope:f,dx:s,dy:h,width:m,height:b,length:x,xcenter:_,ycenter:A}}),_4=ze((te,Y)=>{var d=oh().overrideAll,y=xa(),z=On(),P=qd().dash,i=nn().extendFlat,{shapeTexttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=b_();Y.exports=d({newshape:{visible:i({},y.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:i({},y.legend,{}),legendgroup:i({},y.legendgroup,{}),legendgrouptitle:{text:i({},y.legendgrouptitle.text,{}),font:z({})},legendrank:i({},y.legendrank,{}),legendwidth:i({},y.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:i({},P,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:i({},y.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:n({newshape:!0},{keys:Object.keys(l)}),texttemplatefallback:a({editType:"arraydraw"}),font:z({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}),K1=ze((te,Y)=>{var d=qd().dash,y=nn().extendFlat;Y.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:y({},d,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}}),Yx=ze((te,Y)=>{Y.exports=function(d){var y=d.editType;return{t:{valType:"number",dflt:0,editType:y},r:{valType:"number",dflt:0,editType:y},b:{valType:"number",dflt:0,editType:y},l:{valType:"number",dflt:0,editType:y},editType:y}}}),w_=ze((te,Y)=>{var d=On(),y=Fl(),z=Mi(),P=_4(),i=K1(),n=Yx(),a=nn().extendFlat,l=d({editType:"calc"});l.family.dflt='"Open Sans", verdana, arial, sans-serif',l.size.dflt=12,l.color.dflt=z.defaultLine,Y.exports={font:l,title:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:d({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:a(n({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:z.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:z.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:z.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:P.newshape,activeshape:P.activeshape,newselection:i.newselection,activeselection:i.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:a({},y.transition,{editType:"none"})}}),iS=ze(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var te=document.createElement("style");te.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",te.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(te)}})()}),as=ze(te=>{var Y=ns(),d=Qo(),y=Rl(),z=ti(),P=q0().addStyleRule,i=nn(),n=xa(),a=w_(),l=i.extendFlat,o=i.extendDeepAll;te.modules={},te.allCategories={},te.allTypes=[],te.subplotsRegistry={},te.componentsRegistry={},te.layoutArrayContainers=[],te.layoutArrayRegexes=[],te.traceLayoutAttributes={},te.localeRegistry={},te.apiMethodRegistry={},te.collectableSubplotTypes=null,te.register=function(k){if(te.collectableSubplotTypes=null,k)k&&!Array.isArray(k)&&(k=[k]);else throw new Error("No argument passed to Plotly.register.");for(var w=0;w{var Y=yi().timeFormat,d=Sr(),y=ns(),z=qn().mod,P=ei(),i=P.BADNUM,n=P.ONEDAY,a=P.ONEHOUR,l=P.ONEMIN,o=P.ONESEC,u=P.EPOCHJD,s=as(),h=yi().utcFormat,m=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,b=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,x=new Date().getFullYear()-70;function _(V){return V&&s.componentsRegistry.calendars&&typeof V=="string"&&V!=="gregorian"}te.dateTick0=function(V,W){var F=A(V,!!W);if(W<2)return F;var H=te.dateTime2ms(F,V);return H+=n*(W-1),te.ms2DateTime(H,0,V)};function A(V,W){return _(V)?W?s.getComponentMethod("calendars","CANONICAL_SUNDAY")[V]:s.getComponentMethod("calendars","CANONICAL_TICK")[V]:W?"2000-01-02":"2000-01-01"}te.dfltRange=function(V){return _(V)?s.getComponentMethod("calendars","DFLTRANGE")[V]:["2000-01-01","2001-01-01"]},te.isJSDate=function(V){return typeof V=="object"&&V!==null&&typeof V.getTime=="function"};var f,k;te.dateTime2ms=function(V,W){if(te.isJSDate(V)){var F=V.getTimezoneOffset()*l,H=(V.getUTCMinutes()-V.getMinutes())*l+(V.getUTCSeconds()-V.getSeconds())*o+(V.getUTCMilliseconds()-V.getMilliseconds());if(H){var q=3*l;F=F-q/2+z(H-F+q/2,q)}return V=Number(V)-F,V>=f&&V<=k?V:i}if(typeof V!="string"&&typeof V!="number")return i;V=String(V);var G=_(W),ee=V.charAt(0);G&&(ee==="G"||ee==="g")&&(V=V.substr(1),W="");var he=G&&W.substr(0,7)==="chinese",be=V.match(he?b:m);if(!be)return i;var ve=be[1],ce=be[3]||"1",re=Number(be[5]||1),ge=Number(be[7]||0),ne=Number(be[9]||0),se=Number(be[11]||0);if(G){if(ve.length===2)return i;ve=Number(ve);var _e;try{var oe=s.getComponentMethod("calendars","getCal")(W);if(he){var J=ce.charAt(ce.length-1)==="i";ce=parseInt(ce,10),_e=oe.newDate(ve,oe.toMonthIndex(ve,ce,J),re)}else _e=oe.newDate(ve,Number(ce),re)}catch{return i}return _e?(_e.toJD()-u)*n+ge*a+ne*l+se*o:i}ve.length===2?ve=(Number(ve)+2e3-x)%100+x:ve=Number(ve),ce-=1;var me=new Date(Date.UTC(2e3,ce,re,ge,ne));return me.setUTCFullYear(ve),me.getUTCMonth()!==ce||me.getUTCDate()!==re?i:me.getTime()+se*o},f=te.MIN_MS=te.dateTime2ms("-9999"),k=te.MAX_MS=te.dateTime2ms("9999-12-31 23:59:59.9999"),te.isDateTime=function(V,W){return te.dateTime2ms(V,W)!==i};function w(V,W){return String(V+Math.pow(10,W)).substr(1)}var D=90*n,E=3*a,I=5*l;te.ms2DateTime=function(V,W,F){if(typeof V!="number"||!(V>=f&&V<=k))return i;W||(W=0);var H=Math.floor(z(V+.05,1)*10),q=Math.round(V-H/10),G,ee,he,be,ve,ce;if(_(F)){var re=Math.floor(q/n)+u,ge=Math.floor(z(V,n));try{G=s.getComponentMethod("calendars","getCal")(F).fromJD(re).formatDate("yyyy-mm-dd")}catch{G=h("G%Y-%m-%d")(new Date(q))}if(G.charAt(0)==="-")for(;G.length<11;)G="-0"+G.substr(1);else for(;G.length<10;)G="0"+G;ee=W=f+n&&V<=k-n))return i;var W=Math.floor(z(V+.05,1)*10),F=new Date(Math.round(V-W/10)),H=Y("%Y-%m-%d")(F),q=F.getHours(),G=F.getMinutes(),ee=F.getSeconds(),he=F.getUTCMilliseconds()*10+W;return M(H,q,G,ee,he)};function M(V,W,F,H,q){if((W||F||H||q)&&(V+=" "+w(W,2)+":"+w(F,2),(H||q)&&(V+=":"+w(H,2),q))){for(var G=4;q%10===0;)G-=1,q/=10;V+="."+w(q,G)}return V}te.cleanDate=function(V,W,F){if(V===i)return W;if(te.isJSDate(V)||typeof V=="number"&&isFinite(V)){if(_(F))return y.error("JS Dates and milliseconds are incompatible with world calendars",V),W;if(V=te.ms2DateTimeLocal(+V),!V&&W!==void 0)return W}else if(!te.isDateTime(V,F))return y.error("unrecognized date",V),W;return V};var p=/%\d?f/g,g=/%h/g,C={1:"1",2:"1",3:"2",4:"2"};function T(V,W,F,H){V=V.replace(p,function(G){var ee=Math.min(+G.charAt(1)||6,6),he=(W/1e3%1+2).toFixed(ee).substr(2).replace(/0+$/,"")||"0";return he});var q=new Date(Math.floor(W+.05));if(V=V.replace(g,function(){return C[F("%q")(q)]}),_(H))try{V=s.getComponentMethod("calendars","worldCalFmt")(V,W,H)}catch{return"Invalid"}return F(V)(q)}var N=[59,59.9,59.99,59.999,59.9999];function B(V,W){var F=z(V+.05,n),H=w(Math.floor(F/a),2)+":"+w(z(Math.floor(F/l),60),2);if(W!=="M"){d(W)||(W=0);var q=Math.min(z(V/o,60),N[W]),G=(100+q).toFixed(W).substr(1);W>0&&(G=G.replace(/0+$/,"").replace(/[\.]$/,"")),H+=":"+G}return H}te.formatDate=function(V,W,F,H,q,G){if(q=_(q)&&q,!W)if(F==="y")W=G.year;else if(F==="m")W=G.month;else if(F==="d")W=G.dayMonth+` `+G.year;else return B(V,F)+` -`+T(G.dayMonthYear,V,$,q);return T(W,V,$,q)};var U=3*n;te.incrementMonth=function(V,W,F){F=_(F)&&F;var $=z(V,n);if(V=Math.round(V-$),F)try{var q=Math.round(V/n)+u,G=s.getComponentMethod("calendars","getCal")(F),ee=G.fromJD(q);return W%12?G.add(ee,W,"m"):G.add(ee,W/12,"y"),(ee.toJD()-u)*n+$}catch{y.error("invalid ms "+V+" in calendar "+F)}var he=new Date(V+U);return he.setUTCMonth(he.getUTCMonth()+W)+$-U},te.findExactDates=function(V,W){for(var F=0,$=0,q=0,G=0,ee,he,xe=_(W)&&s.getComponentMethod("calendars","getCal")(W),ve=0;ve{Y.exports=function(d){return d}}),rw=Fe(te=>{var Y=Ar(),d=ns(),y=__(),z=ti().BADNUM,P=1e-9;te.findBin=function(o,u,s){if(Y(u.start))return s?Math.ceil((o-u.start)/u.size-P)-1:Math.floor((o-u.start)/u.size+P);var h=0,m=u.length,b=0,x=m>1?(u[m-1]-u[0])/(m-1):1,_,A;for(x>=0?A=s?i:n:A=s?l:a,o+=x*P*(s?-1:1)*(x>=0?1:-1);h90&&d.log("Long binary search..."),h-1};function i(o,u){return ou}function l(o,u){return o>=u}te.sorterAsc=function(o,u){return o-u},te.sorterDes=function(o,u){return u-o},te.distinctVals=function(o){var u=o.slice();u.sort(te.sorterAsc);var s;for(s=u.length-1;s>-1&&u[s]===z;s--);for(var h=u[s]-u[0]||1,m=h/(s||1)/1e4,b=[],x,_=0;_<=s;_++){var A=u[_],f=A-x;x===void 0?(b.push(A),x=A):f>m&&(h=Math.min(h,f),b.push(A),x=A)}return{vals:b,minDiff:h}},te.roundUp=function(o,u,s){for(var h=0,m=u.length-1,b,x=0,_=s?0:1,A=s?1:0,f=s?Math.ceil:Math.floor;h0&&(h=1),s&&h)return o.sort(u)}return h?o:o.reverse()},te.findIndexOfMin=function(o,u){u=u||y;for(var s=1/0,h,m=0;m{Y.exports=function(d){return Object.keys(d).sort()}}),i8=Fe(te=>{var Y=Ar(),d=Di().isArrayOrTypedArray;te.aggNums=function(y,z,P,i){var n,a;if((!i||i>P.length)&&(i=P.length),Y(z)||(z=!1),d(P[0])){for(a=new Array(i),n=0;ny.length-1)return y[y.length-1];var P=z%1;return P*y[Math.ceil(z)]+(1-P)*y[Math.floor(z)]}}),n8=Fe((te,Y)=>{var d=Yn(),y=d.mod,z=d.modHalf,P=Math.PI,i=2*P;function n(A){return A/180*P}function a(A){return A/P*180}function l(A){return Math.abs(A[1]-A[0])>i-1e-14}function o(A,f){return z(f-A,i)}function u(A,f){return Math.abs(o(A,f))}function s(A,f){if(l(f))return!0;var k,w;f[0]w&&(w+=i);var D=y(A,i),E=D+i;return D>=k&&D<=w||E>=k&&E<=w}function h(A,f,k,w){if(!s(f,w))return!1;var D,E;return k[0]=D&&A<=E}function m(A,f,k,w,D,E,I){D=D||0,E=E||0;var M=l([k,w]),p,g,C,T,N;M?(p=0,g=P,C=i):k{te.isLeftAnchor=function(Y){return Y.xanchor==="left"||Y.xanchor==="auto"&&Y.x<=1/3},te.isCenterAnchor=function(Y){return Y.xanchor==="center"||Y.xanchor==="auto"&&Y.x>1/3&&Y.x<2/3},te.isRightAnchor=function(Y){return Y.xanchor==="right"||Y.xanchor==="auto"&&Y.x>=2/3},te.isTopAnchor=function(Y){return Y.yanchor==="top"||Y.yanchor==="auto"&&Y.y>=2/3},te.isMiddleAnchor=function(Y){return Y.yanchor==="middle"||Y.yanchor==="auto"&&Y.y>1/3&&Y.y<2/3},te.isBottomAnchor=function(Y){return Y.yanchor==="bottom"||Y.yanchor==="auto"&&Y.y<=1/3}}),o8=Fe(te=>{var Y=Yn().mod;te.segmentsIntersect=d;function d(n,a,l,o,u,s,h,m){var b=l-n,x=u-n,_=h-u,A=o-a,f=s-a,k=m-s,w=b*k-_*A;if(w===0)return null;var D=(x*k-_*f)/w,E=(x*A-b*f)/w;return E<0||E>1||D<0||D>1?null:{x:n+b*D,y:a+A*D}}te.segmentDistance=function(n,a,l,o,u,s,h,m){if(d(n,a,l,o,u,s,h,m))return 0;var b=l-n,x=o-a,_=h-u,A=m-s,f=b*b+x*x,k=_*_+A*A,w=Math.min(y(b,x,f,u-n,s-a),y(b,x,f,h-n,m-a),y(_,A,k,n-u,a-s),y(_,A,k,l-u,o-s));return Math.sqrt(w)};function y(n,a,l,o,u){var s=o*n+u*a;if(s<0)return o*o+u*u;if(s>l){var h=o-n,m=u-a;return h*h+m*m}else{var b=o*a-u*n;return b*b/l}}var z,P,i;te.getTextLocation=function(n,a,l,o){if((n!==P||o!==i)&&(z={},P=n,i=o),z[l])return z[l];var u=n.getPointAtLength(Y(l-o/2,a)),s=n.getPointAtLength(Y(l+o/2,a)),h=Math.atan((s.y-u.y)/(s.x-u.x)),m=n.getPointAtLength(Y(l,a)),b=(m.x*4+u.x+s.x)/6,x=(m.y*4+u.y+s.y)/6,_={x:b,y:x,theta:h};return z[l]=_,_},te.clearLocationCache=function(){P=null},te.getVisibleSegment=function(n,a,l){var o=a.left,u=a.right,s=a.top,h=a.bottom,m=0,b=n.getTotalLength(),x=b,_,A;function f(w){var D=n.getPointAtLength(w);w===0?_=D:w===b&&(A=D);var E=D.xu?D.x-u:0,I=D.yh?D.y-h:0;return Math.sqrt(E*E+I*I)}for(var k=f(m);k;){if(m+=k+l,m>x)return;k=f(m)}for(k=f(x);k;){if(x-=k+l,m>x)return;k=f(x)}return{min:m,max:x,len:x-m,total:b,isClosed:m===0&&x===b&&Math.abs(_.x-A.x)<.1&&Math.abs(_.y-A.y)<.1}},te.findPointOnPath=function(n,a,l,o){o=o||{};for(var u=o.pathLength||n.getTotalLength(),s=o.tolerance||.001,h=o.iterationLimit||30,m=n.getPointAtLength(0)[l]>n.getPointAtLength(u)[l]?-1:1,b=0,x=0,_=u,A,f,k;b0?_=A:x=A,b++}return f}}),iw=Fe(te=>{var Y={};te.throttle=function(y,z,P){var i=Y[y],n=Date.now();if(!i){for(var a in Y)Y[a].tsi.ts+z){l();return}i.timer=setTimeout(function(){l(),i.timer=null},z)},te.done=function(y){var z=Y[y];return!z||!z.timer?Promise.resolve():new Promise(function(P){var i=z.onDone;z.onDone=function(){i&&i(),P(),z.onDone=null}})},te.clear=function(y){if(y)d(Y[y]),delete Y[y];else for(var z in Y)te.clear(z)};function d(y){y&&y.timer!==null&&(clearTimeout(y.timer),y.timer=null)}}),nw=Fe((te,Y)=>{Y.exports=function(d){d._responsiveChartHandler&&(window.removeEventListener("resize",d._responsiveChartHandler),delete d._responsiveChartHandler)}}),x_=Fe((te,Y)=>{Y.exports=P,Y.exports.isMobile=P,Y.exports.default=P;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,y=/CrOS/,z=/android|ipad|playbook|silk/i;function P(i){i||(i={});let n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;let a=d.test(n)&&!y.test(n)||!!i.tablet&&z.test(n);return!a&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(a=!0),a}}),y4=Fe((te,Y)=>{var d=Ar(),y=x_();Y.exports=function(P){var i;if(P&&P.hasOwnProperty("userAgent")?i=P.userAgent:i=z(),typeof i!="string")return!0;var n=y({ua:{headers:{"user-agent":i}},tablet:!0,featureDetect:!1});if(!n)for(var a=i.split(" "),l=1;l-1;u--){var s=a[u];if(s.substr(0,8)==="Version/"){var h=s.substr(8).split(".")[0];if(d(h)&&(h=+h),h>=13)return!0}}}return n};function z(){var P;return typeof navigator<"u"&&(P=navigator.userAgent),P&&P.headers&&typeof P.headers["user-agent"]=="string"&&(P=P.headers["user-agent"]),P}}),_4=Fe((te,Y)=>{var d=ii();Y.exports=function(y,z,P){var i=y.selectAll("g."+P.replace(/\s/g,".")).data(z,function(a){return a[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",P),i.order();var n=y.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(a){a[0][n]=d.select(this)}),i}}),b_=Fe((te,Y)=>{var d=as();Y.exports=function(y,z){for(var P=y._context.locale,i=0;i<2;i++){for(var n=y._context.locales,a=0;a<2;a++){var l=(n[P]||{}).dictionary;if(l){var o=l[z];if(o)return o}n=d.localeRegistry}var u=P.split("-")[0];if(u===P)break;P=u}return z}}),Nc=Fe((te,Y)=>{Y.exports=function(d){for(var y={},z=[],P=0,i=0;i{Y.exports=function(P){for(var i=z(P)?y:d,n=[],a=0;a{Y.exports=function(d,y){if(!y)return d;var z=1/Math.abs(y),P=z>1?(z*d+z*y)/z:d+y,i=String(P).length;if(i>16){var n=String(y).length,a=String(d).length;if(i>=a+n){var l=parseFloat(P).toPrecision(12);l.indexOf("e+")===-1&&(P=+l)}}return P}}),Z1=Fe((te,Y)=>{var d=Ar(),y=ti().BADNUM,z=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;Y.exports=function(P){return typeof P=="string"&&(P=P.replace(z,"")),d(P)?Number(P):y}}),ji=Fe((te,Y)=>{var d=ii(),y=vi().utcFormat,z=vr().format,P=Ar(),i=ti(),n=i.FP_SAFE,a=-n,l=i.BADNUM,o=Y.exports={};o.adjustFormat=function(oe){return!oe||/^\d[.]\df/.test(oe)||/[.]\d%/.test(oe)?oe:oe==="0.f"?"~f":/^\d%/.test(oe)?"~%":/^\ds/.test(oe)?"~s":!/^[~,.0$]/.test(oe)&&/[&fps]/.test(oe)?"~"+oe:oe};var u={};o.warnBadFormat=function(oe){var J=String(oe);u[J]||(u[J]=1,o.warn('encountered bad format: "'+J+'"'))},o.noFormat=function(oe){return String(oe)},o.numberFormat=function(oe){var J;try{J=z(o.adjustFormat(oe))}catch{return o.warnBadFormat(oe),o.noFormat}return J},o.nestedProperty=qn(),o.keyedContainer=Qn(),o.relativeAttr=ka(),o.isPlainObject=ei(),o.toLogRange=Ta(),o.relinkPrivateKeys=so();var s=Di();o.isArrayBuffer=s.isArrayBuffer,o.isTypedArray=s.isTypedArray,o.isArrayOrTypedArray=s.isArrayOrTypedArray,o.isArray1D=s.isArray1D,o.ensureArray=s.ensureArray,o.concat=s.concat,o.maxRowLength=s.maxRowLength,o.minRowLength=s.minRowLength;var h=Yn();o.mod=h.mod,o.modHalf=h.modHalf;var m=ko();o.valObjectMeta=m.valObjectMeta,o.coerce=m.coerce,o.coerce2=m.coerce2,o.coerceFont=m.coerceFont,o.coercePattern=m.coercePattern,o.coerceHoverinfo=m.coerceHoverinfo,o.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,o.validate=m.validate;var b=r8();o.dateTime2ms=b.dateTime2ms,o.isDateTime=b.isDateTime,o.ms2DateTime=b.ms2DateTime,o.ms2DateTimeLocal=b.ms2DateTimeLocal,o.cleanDate=b.cleanDate,o.isJSDate=b.isJSDate,o.formatDate=b.formatDate,o.incrementMonth=b.incrementMonth,o.dateTick0=b.dateTick0,o.dfltRange=b.dfltRange,o.findExactDates=b.findExactDates,o.MIN_MS=b.MIN_MS,o.MAX_MS=b.MAX_MS;var x=rw();o.findBin=x.findBin,o.sorterAsc=x.sorterAsc,o.sorterDes=x.sorterDes,o.distinctVals=x.distinctVals,o.roundUp=x.roundUp,o.sort=x.sort,o.findIndexOfMin=x.findIndexOfMin,o.sortObjectKeys=Ym();var _=i8();o.aggNums=_.aggNums,o.len=_.len,o.mean=_.mean,o.geometricMean=_.geometricMean,o.median=_.median,o.midRange=_.midRange,o.variance=_.variance,o.stdev=_.stdev,o.interp=_.interp;var A=ew();o.init2dArray=A.init2dArray,o.transposeRagged=A.transposeRagged,o.dot=A.dot,o.translationMatrix=A.translationMatrix,o.rotationMatrix=A.rotationMatrix,o.rotationXYMatrix=A.rotationXYMatrix,o.apply3DTransform=A.apply3DTransform,o.apply2DTransform=A.apply2DTransform,o.apply2DTransform2=A.apply2DTransform2,o.convertCssMatrix=A.convertCssMatrix,o.inverseTransformMatrix=A.inverseTransformMatrix;var f=n8();o.deg2rad=f.deg2rad,o.rad2deg=f.rad2deg,o.angleDelta=f.angleDelta,o.angleDist=f.angleDist,o.isFullCircle=f.isFullCircle,o.isAngleInsideSector=f.isAngleInsideSector,o.isPtInsideSector=f.isPtInsideSector,o.pathArc=f.pathArc,o.pathSector=f.pathSector,o.pathAnnulus=f.pathAnnulus;var k=a8();o.isLeftAnchor=k.isLeftAnchor,o.isCenterAnchor=k.isCenterAnchor,o.isRightAnchor=k.isRightAnchor,o.isTopAnchor=k.isTopAnchor,o.isMiddleAnchor=k.isMiddleAnchor,o.isBottomAnchor=k.isBottomAnchor;var w=o8();o.segmentsIntersect=w.segmentsIntersect,o.segmentDistance=w.segmentDistance,o.getTextLocation=w.getTextLocation,o.clearLocationCache=w.clearLocationCache,o.getVisibleSegment=w.getVisibleSegment,o.findPointOnPath=w.findPointOnPath;var D=an();o.extendFlat=D.extendFlat,o.extendDeep=D.extendDeep,o.extendDeepAll=D.extendDeepAll,o.extendDeepNoArrays=D.extendDeepNoArrays;var E=ns();o.log=E.log,o.warn=E.warn,o.error=E.error;var I=go();o.counterRegex=I.counter;var M=iw();o.throttle=M.throttle,o.throttleDone=M.done,o.clearThrottle=M.clear;var p=q0();o.getGraphDiv=p.getGraphDiv,o.isPlotDiv=p.isPlotDiv,o.removeElement=p.removeElement,o.addStyleRule=p.addStyleRule,o.addRelatedStyleRule=p.addRelatedStyleRule,o.deleteRelatedStyleRule=p.deleteRelatedStyleRule,o.setStyleOnHover=p.setStyleOnHover,o.getFullTransformMatrix=p.getFullTransformMatrix,o.getElementTransformMatrix=p.getElementTransformMatrix,o.getElementAndAncestors=p.getElementAndAncestors,o.equalDomRects=p.equalDomRects,o.clearResponsive=nw(),o.preserveDrawingBuffer=y4(),o.makeTraceGroups=_4(),o._=b_(),o.notifier=ys(),o.filterUnique=Nc(),o.filterVisible=Of(),o.pushUnique=Rl(),o.increment=Yx(),o.cleanNumber=Z1(),o.ensureNumber=function(oe){return P(oe)?(oe=Number(oe),oe>n||oe=J?!1:P(oe)&&oe>=0&&oe%1===0},o.noop=Qo(),o.identity=__(),o.repeat=function(oe,J){for(var me=new Array(J),fe=0;feme?Math.max(me,Math.min(J,oe)):Math.max(J,Math.min(me,oe))},o.bBoxIntersect=function(oe,J,me){return me=me||0,oe.left<=J.right+me&&J.left<=oe.right+me&&oe.top<=J.bottom+me&&J.top<=oe.bottom+me},o.simpleMap=function(oe,J,me,fe,Ce){for(var Be=oe.length,Oe=new Array(Be),Ze=0;Ze=Math.pow(2,me)?Ce>10?(o.warn("randstr failed uniqueness"),Oe):oe(J,me,fe,(Ce||0)+1):Oe},o.OptionControl=function(oe,J){oe||(oe={}),J||(J="opt");var me={};return me.optionList=[],me._newoption=function(fe){fe[J]=oe,me[fe.name]=fe,me.optionList.push(fe)},me["_"+J]=oe,me},o.smooth=function(oe,J){if(J=Math.round(J)||0,J<2)return oe;var me=oe.length,fe=2*me,Ce=2*J-1,Be=new Array(Ce),Oe=new Array(me),Ze,Ge,rt,_t;for(Ze=0;Ze=fe&&(rt-=fe*Math.floor(rt/fe)),rt<0?rt=-1-rt:rt>=me&&(rt=fe-1-rt),_t+=oe[rt]*Be[Ge];Oe[Ze]=_t}return Oe},o.syncOrAsync=function(oe,J,me){var fe,Ce;function Be(){return o.syncOrAsync(oe,J,me)}for(;oe.length;)if(Ce=oe.splice(0,1)[0],fe=Ce(J),fe&&fe.then)return fe.then(Be);return me&&me(J)},o.stripTrailingSlash=function(oe){return oe.substr(-1)==="/"?oe.substr(0,oe.length-1):oe},o.noneOrAll=function(oe,J,me){if(oe){var fe=!1,Ce=!0,Be,Oe;for(Be=0;Be0?Ce:0})},o.fillArray=function(oe,J,me,fe){if(fe=fe||o.identity,o.isArrayOrTypedArray(oe))for(var Ce=0;CeB.test(window.navigator.userAgent);var U=/Firefox\/(\d+)\.\d+/;o.getFirefoxVersion=function(){var oe=U.exec(window.navigator.userAgent);if(oe&&oe.length===2){var J=parseInt(oe[1]);if(!isNaN(J))return J}return null},o.isD3Selection=function(oe){return oe instanceof d.selection},o.ensureSingle=function(oe,J,me,fe){var Ce=oe.select(J+(me?"."+me:""));if(Ce.size())return Ce;var Be=oe.append(J);return me&&Be.classed(me,!0),fe&&Be.call(fe),Be},o.ensureSingleById=function(oe,J,me,fe){var Ce=oe.select(J+"#"+me);if(Ce.size())return Ce;var Be=oe.append(J).attr("id",me);return fe&&Be.call(fe),Be},o.objectFromPath=function(oe,J){for(var me=oe.split("."),fe,Ce=fe={},Be=0;Be1?Ce+Oe[1]:"";if(Be&&(Oe.length>1||Ze.length>4||me))for(;fe.test(Ze);)Ze=Ze.replace(fe,"$1"+Be+"$2");return Ze+Ge},o.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var $=/^\w*$/;o.templateString=function(oe,J){var me={};return oe.replace(o.TEMPLATE_STRING_REGEX,function(fe,Ce){var Be;return $.test(Ce)?Be=J[Ce]:(me[Ce]=me[Ce]||o.nestedProperty(J,Ce).get,Be=me[Ce](!0)),Be!==void 0?Be:""})};var q={max:10,count:0,name:"hovertemplate"};o.hovertemplateString=oe=>ce(Dt(kt({},oe),{opts:q}));var G={max:10,count:0,name:"texttemplate"};o.texttemplateString=oe=>ce(Dt(kt({},oe),{opts:G}));var ee=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function he(oe){var J=oe.match(ee);return J?{key:J[1],op:J[2],number:Number(J[3])}:{key:oe,op:null,number:null}}var xe={max:10,count:0,name:"texttemplate",parseMultDiv:!0};o.texttemplateStringForShapes=oe=>ce(Dt(kt({},oe),{opts:xe}));var ve=/^[:|\|]/;function ce({data:oe=[],locale:J,fallback:me,labels:fe={},opts:Ce,template:Be}){return Be.replace(o.TEMPLATE_STRING_REGEX,(Oe,Ze,Ge)=>{let rt=["xother","yother"].includes(Ze),_t=["_xother","_yother"].includes(Ze),pt=["_xother_","_yother_"].includes(Ze),gt=["xother_","yother_"].includes(Ze),ct=rt||_t||gt||pt;(_t||pt)&&(Ze=Ze.substring(1)),(gt||pt)&&(Ze=Ze.substring(0,Ze.length-1));let Ae=null,ze=null;if(Ce.parseMultDiv){var Ee=he(Ze);Ze=Ee.key,Ae=Ee.op,ze=Ee.number}let nt;if(ct){if(fe[Ze]===void 0)return"";nt=fe[Ze]}else for(let Gt of oe)if(Gt){if(Gt.hasOwnProperty(Ze)){nt=Gt[Ze];break}if($.test(Ze)||(nt=o.nestedProperty(Gt,Ze).get(!0)),nt!==void 0)break}if(nt===void 0){let{count:Gt,max:Jt,name:gr}=Ce,mr=me===!1?Oe:me;return Gt=re&&Oe<=ge,rt=Ze>=re&&Ze<=ge;if(Ge&&(fe=10*fe+Oe-re),rt&&(Ce=10*Ce+Ze-re),!Ge||!rt){if(fe!==Ce)return fe-Ce;if(Oe!==Ze)return Oe-Ze}}return Ce-fe};var ne=2e9;o.seedPseudoRandom=function(){ne=2e9},o.pseudoRandom=function(){var oe=ne;return ne=(69069*ne+1)%4294967296,Math.abs(ne-oe)<429496729?o.pseudoRandom():ne/4294967296},o.fillText=function(oe,J,me){var fe=Array.isArray(me)?function(Oe){me.push(Oe)}:function(Oe){me.text=Oe},Ce=o.extractOption(oe,J,"htx","hovertext");if(o.isValidTextValue(Ce))return fe(Ce);var Be=o.extractOption(oe,J,"tx","text");if(o.isValidTextValue(Be))return fe(Be)},o.isValidTextValue=function(oe){return oe||oe===0},o.formatPercent=function(oe,J){J=J||0;for(var me=(Math.round(100*oe*Math.pow(10,J))*Math.pow(.1,J)).toFixed(J)+"%",fe=0;fe1&&(rt=1):rt=0,o.strTranslate(Ce-rt*(me+Oe),Be-rt*(fe+Ze))+o.strScale(rt)+(Ge?"rotate("+Ge+(J?"":" "+me+" "+fe)+")":"")},o.setTransormAndDisplay=function(oe,J){oe.attr("transform",o.getTextTransform(J)),oe.style("display",J.scale?null:"none")},o.ensureUniformFontSize=function(oe,J){var me=o.extendFlat({},J);return me.size=Math.max(J.size,oe._fullLayout.uniformtext.minsize||0),me},o.join2=function(oe,J,me){var fe=oe.length;return fe>1?oe.slice(0,-1).join(J)+me+oe[fe-1]:oe.join(J)},o.bigFont=function(oe){return Math.round(1.2*oe)};var se=o.getFirefoxVersion(),_e=se!==null&&se<86;o.getPositionFromD3Event=function(){return _e?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}),aw=Fe(()=>{var te=ji(),Y={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(y in Y)d=y.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),te.addStyleRule(d,Y[y]);var d,y}),Qu=Fe((te,Y)=>{Y.exports=!0}),Xf=Fe((te,Y)=>{var d=Qu(),y;typeof window.matchMedia=="function"?y=!window.matchMedia("(hover: none)").matches:y=d,Y.exports=y}),qg=Fe((te,Y)=>{var d=typeof Reflect=="object"?Reflect:null,y=d&&typeof d.apply=="function"?d.apply:function(D,E,I){return Function.prototype.apply.call(D,E,I)},z;d&&typeof d.ownKeys=="function"?z=d.ownKeys:Object.getOwnPropertySymbols?z=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:z=function(D){return Object.getOwnPropertyNames(D)};function P(D){console&&console.warn&&console.warn(D)}var i=Number.isNaN||function(D){return D!==D};function n(){n.init.call(this)}Y.exports=n,Y.exports.once=f,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var a=10;function l(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");a=D}}),n.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},n.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function o(D){return D._maxListeners===void 0?n.defaultMaxListeners:D._maxListeners}n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(D){for(var E=[],I=1;I0&&(g=E[0]),g instanceof Error)throw g;var C=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw C.context=g,C}var T=p[D];if(T===void 0)return!1;if(typeof T=="function")y(T,this,E);else for(var N=T.length,B=x(T,N),I=0;I0&&C.length>p&&!C.warned){C.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=D,T.type=E,T.count=C.length,P(T)}return D}n.prototype.addListener=function(D,E){return u(this,D,E,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(D,E){return u(this,D,E,!0)};function s(){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 h(D,E,I){var M={fired:!1,wrapFn:void 0,target:D,type:E,listener:I},p=s.bind(M);return p.listener=I,M.wrapFn=p,p}n.prototype.once=function(D,E){return l(E),this.on(D,h(this,D,E)),this},n.prototype.prependOnceListener=function(D,E){return l(E),this.prependListener(D,h(this,D,E)),this},n.prototype.removeListener=function(D,E){var I,M,p,g,C;if(l(E),M=this._events,M===void 0)return this;if(I=M[D],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete M[D],M.removeListener&&this.emit("removeListener",D,I.listener||E));else if(typeof I!="function"){for(p=-1,g=I.length-1;g>=0;g--)if(I[g]===E||I[g].listener===E){C=I[g].listener,p=g;break}if(p<0)return this;p===0?I.shift():_(I,p),I.length===1&&(M[D]=I[0]),M.removeListener!==void 0&&this.emit("removeListener",D,C||E)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(D){var E,I,M;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[D]),this;if(arguments.length===0){var p=Object.keys(I),g;for(M=0;M=0;M--)this.removeListener(D,E[M]);return this};function m(D,E,I){var M=D._events;if(M===void 0)return[];var p=M[E];return p===void 0?[]:typeof p=="function"?I?[p.listener||p]:[p]:I?A(p):x(p,p.length)}n.prototype.listeners=function(D){return m(this,D,!0)},n.prototype.rawListeners=function(D){return m(this,D,!1)},n.listenerCount=function(D,E){return typeof D.listenerCount=="function"?D.listenerCount(E):b.call(D,E)},n.prototype.listenerCount=b;function b(D){var E=this._events;if(E!==void 0){var I=E[D];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function x(D,E){for(var I=new Array(E),M=0;M{var d=qg().EventEmitter,y={init:function(z){if(z._ev instanceof d)return z;var P=new d,i=new d;return z._ev=P,z._internalEv=i,z.on=P.on.bind(P),z.once=P.once.bind(P),z.removeListener=P.removeListener.bind(P),z.removeAllListeners=P.removeAllListeners.bind(P),z._internalOn=i.on.bind(i),z._internalOnce=i.once.bind(i),z._removeInternalListener=i.removeListener.bind(i),z._removeAllInternalListeners=i.removeAllListeners.bind(i),z.emit=function(n,a){P.emit(n,a),i.emit(n,a)},typeof z.addEventListener=="function"&&z.addEventListener("wheel",()=>{},{passive:!0}),z},triggerHandler:function(z,P,i){var n,a=z._ev;if(!a)return;var l=a._events[P];if(!l)return;function o(s){if(s.listener){if(a.removeListener(P,s.listener),!s.fired)return s.fired=!0,s.listener.apply(a,[i])}else return s.apply(a,[i])}l=Array.isArray(l)?l:[l];var u;for(u=0;u{var d=ji(),y=ss().dfltConfig;function z(i,n){for(var a=[],l,o=0;oy.queueLength&&(i.undoQueue.queue.shift(),i.undoQueue.index--)},P.startSequence=function(i){i.undoQueue=i.undoQueue||{index:0,queue:[],sequence:!1},i.undoQueue.sequence=!0,i.undoQueue.beginSequence=!0},P.stopSequence=function(i){i.undoQueue=i.undoQueue||{index:0,queue:[],sequence:!1},i.undoQueue.sequence=!1,i.undoQueue.beginSequence=!1},P.undo=function(i){var n,a;if(!(i.undoQueue===void 0||isNaN(i.undoQueue.index)||i.undoQueue.index<=0)){for(i.undoQueue.index--,n=i.undoQueue.queue[i.undoQueue.index],i.undoQueue.inSequence=!0,a=0;a=i.undoQueue.queue.length)){for(n=i.undoQueue.queue[i.undoQueue.index],i.undoQueue.inSequence=!0,a=0;a{Y.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),Zg=Fe(te=>{var Y=as(),d=ji(),y=_a(),z=y_(),P=x4(),i=Fl(),n=ss().configAttributes,a=oh(),l=d.extendDeepAll,o=d.isPlainObject,u=d.isArrayOrTypedArray,s=d.nestedProperty,h=d.valObjectMeta,m="_isSubplotObj",b="_isLinkedToArray",x="_arrayAttrRegexps",_="_deprecated",A=[m,b,x,_];te.IS_SUBPLOT_OBJ=m,te.IS_LINKED_TO_ARRAY=b,te.DEPRECATED=_,te.UNDERSCORE_ATTRS=A,te.get=function(){var B={};return Y.allTypes.forEach(function(U){B[U]=D(U)}),{defs:{valObjects:h,metaKeys:A.concat(["description","role","editType","impliedEdits"]),editType:{traces:a.traces,layout:a.layout},impliedEdits:{}},traces:B,layout:E(),frames:I(),animation:M(i),config:M(n)}},te.crawl=function(B,U,V,W){var F=V||0;W=W||"",Object.keys(B).forEach(function($){var q=B[$];if(A.indexOf($)===-1){var G=(W?W+".":"")+$;U(q,$,B,F,G),!te.isValObject(q)&&o(q)&&$!=="impliedEdits"&&te.crawl(q,U,F+1,G)}})},te.isValObject=function(B){return B&&B.valType!==void 0},te.findArrayAttributes=function(B){var U=[],V=[],W=[],F,$;function q(ee,he,xe,ve){V=V.slice(0,ve).concat([he]),W=W.slice(0,ve).concat([ee&&ee._isLinkedToArray]);var ce=ee&&(ee.valType==="data_array"||ee.arrayOk===!0)&&!(V[ve-1]==="colorbar"&&(he==="ticktext"||he==="tickvals"));ce&&G(F,0,"")}function G(ee,he,xe){var ve=ee[V[he]],ce=xe+V[he];if(he===V.length-1)u(ve)&&U.push($+ce);else if(W[he]){if(Array.isArray(ve))for(var re=0;re=$.length)return!1;if(B.dimensions===2){if(V++,U.length===V)return B;var q=U[V];if(!w(q))return!1;B=$[F][q]}else B=$[F]}else B=$}}return B}function w(B){return B===Math.round(B)&&B>=0}function D(B){var U,V;U=Y.modules[B]._module,V=U.basePlotModule;var W={};W.type=null;var F=l({},y),$=l({},U.attributes);te.crawl($,function(ee,he,xe,ve,ce){s(F,ce).set(void 0),ee===void 0&&s($,ce).set(void 0)}),l(W,F),Y.traceIs(B,"noOpacity")&&delete W.opacity,Y.traceIs(B,"showLegend")||(delete W.showlegend,delete W.legendgroup),Y.traceIs(B,"noHover")&&(delete W.hoverinfo,delete W.hoverlabel),U.selectPoints||delete W.selectedpoints,l(W,$),V.attributes&&l(W,V.attributes),W.type=B;var q={meta:U.meta||{},categories:U.categories||{},animatable:!!U.animatable,type:B,attributes:M(W)};if(U.layoutAttributes){var G={};l(G,U.layoutAttributes),q.layoutAttributes=M(G)}return U.animatable||te.crawl(q,function(ee){te.isValObject(ee)&&"anim"in ee&&delete ee.anim}),q}function E(){var B={},U,V;l(B,z);for(U in Y.subplotsRegistry)if(V=Y.subplotsRegistry[U],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var W=0;W{var Y=ji(),d=_a(),y="templateitemname",z={name:{valType:"string",editType:"none"}};z[y]={valType:"string",editType:"calc"},te.templatedArray=function(n,a){return a._isLinkedToArray=n,a.name=z.name,a[y]=z[y],a},te.traceTemplater=function(n){var a={},l,o;for(l in n)o=n[l],Array.isArray(o)&&o.length&&(a[l]=0);function u(s){l=Y.coerce(s,{},d,"type");var h={type:l,_template:null};if(l in a){o=n[l];var m=a[l]%o.length;a[l]++,h._template=o[m]}return h}return{newTrace:u}},te.newContainer=function(n,a,l){var o=n._template,u=o&&(o[a]||l&&o[l]);Y.isPlainObject(u)||(u=null);var s=n[a]={_template:u};return s},te.arrayTemplater=function(n,a,l){var o=n._template,u=o&&o[i(a)],s=o&&o[a];(!Array.isArray(s)||!s.length)&&(s=[]);var h={};function m(x){var _={name:x.name,_input:x},A=_[y]=x[y];if(!P(A))return _._template=u,_;for(var f=0;f=o&&(l._input||{})._templateitemname;s&&(u=o);var h=a+"["+u+"]",m;function b(){m={},s&&(m[h]={},m[h][y]=s)}b();function x(k,w){m[k]=w}function _(k,w){s?Y.nestedProperty(m[h],k).set(w):m[h+"."+k]=w}function A(){var k=m;return b(),k}function f(k,w){k&&_(k,w);var D=A();for(var E in D)Y.nestedProperty(n,E).set(D[E])}return{modifyBase:x,modifyItem:_,getUpdateObj:A,applyUpdate:f}}}),dc=Fe((te,Y)=>{var d=go().counter;Y.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),Zc=Fe(te=>{var Y=as(),d=dc();te.id2name=function(z){if(!(typeof z!="string"||!z.match(d.AX_ID_PATTERN))){var P=z.split(" ")[0].substr(1);return P==="1"&&(P=""),z.charAt(0)+"axis"+P}},te.name2id=function(z){if(z.match(d.AX_NAME_PATTERN)){var P=z.substr(5);return P==="1"&&(P=""),z.charAt(0)+P}},te.cleanId=function(z,P,i){var n=/( domain)$/.test(z);if(!(typeof z!="string"||!z.match(d.AX_ID_PATTERN))&&!(P&&z.charAt(0)!==P)&&!(n&&!i)){var a=z.split(" ")[0].substr(1).replace(/^0+/,"");return a==="1"&&(a=""),z.charAt(0)+a+(n&&i?" domain":"")}},te.list=function(z,P,i){var n=z._fullLayout;if(!n)return[];var a=te.listIds(z,P),l=new Array(a.length),o;for(o=0;on?1:-1:+(z.substr(1)||1)-+(P.substr(1)||1)},te.ref2id=function(z){return/^[xyz]/.test(z)?z.split(" ")[0]:!1};function y(z,P){if(P&&P.length){for(var i=0;i{function d(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".outline-controllers").remove()}function y(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".select-outline").remove(),z._fullLayout._outlining=!1}Y.exports={clearOutlineControllers:d,clearOutline:y}}),Nv=Fe((te,Y)=>{Y.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Md=Fe(te=>{var Y=as();dc().SUBPLOT_PATTERN,te.getSubplotCalcData=function(d,y,z){var P=Y.subplotsRegistry[y];if(!P)return[];for(var i=P.attr,n=[],a=0;a{var Y=as(),d=ji();te.manageCommandObserver=function(a,l,o,u){var s={},h=!0;l&&l._commandObserver&&(s=l._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var m=te.hasSimpleAPICommandBindings(a,o,s.lookupTable);if(l&&l._commandObserver){if(m)return s;if(l._commandObserver.remove)return l._commandObserver.remove(),l._commandObserver=null,s}if(m){y(a,m,s.cache),s.check=function(){if(h){var _=y(a,m,s.cache);return _.changed&&u&&s.lookupTable[_.value]!==void 0&&(s.disable(),Promise.resolve(u({value:_.value,type:m.type,prop:m.prop,traces:m.traces,index:s.lookupTable[_.value]})).then(s.enable,s.enable)),_.changed}};for(var b=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0?".":"")+s;d.isPlainObject(h)?n(h,l,m,u+1):l(m,s,h)}})}}),sh=Fe((te,Y)=>{var d=ii(),y=vi().timeFormatLocale,z=vr().formatLocale,P=Ar(),i=Xr(),n=as(),a=Zg(),l=ku(),o=ji(),u=Xi(),s=ti().BADNUM,h=Zc(),m=Am().clearOutline,b=Nv(),x=Fl(),_=x4(),A=Md().getModuleCalcData,f=o.relinkPrivateKeys,k=o._,w=Y.exports={};o.extendFlat(w,n),w.attributes=_a(),w.attributes.type.values=w.allTypes,w.fontAttrs=zn(),w.layoutAttributes=y_();var D=w_();w.executeAPICommand=D.executeAPICommand,w.computeAPICommandBindings=D.computeAPICommandBindings,w.manageCommandObserver=D.manageCommandObserver,w.hasSimpleAPICommandBindings=D.hasSimpleAPICommandBindings,w.redrawText=function(re){return re=o.getGraphDiv(re),new Promise(function(ge){setTimeout(function(){re._fullLayout&&(n.getComponentMethod("annotations","draw")(re),n.getComponentMethod("legend","draw")(re),n.getComponentMethod("colorbar","draw")(re),ge(w.previousPromises(re)))},300)})},w.resize=function(re){re=o.getGraphDiv(re);var ge,ne=new Promise(function(se,_e){(!re||o.isHidden(re))&&_e(new Error("Resize must be passed a displayed plot div element.")),re._redrawTimer&&clearTimeout(re._redrawTimer),re._resolveResize&&(ge=re._resolveResize),re._resolveResize=se,re._redrawTimer=setTimeout(function(){if(!re.layout||re.layout.width&&re.layout.height||o.isHidden(re)){se(re);return}delete re.layout.width,delete re.layout.height;var oe=re.changed;re.autoplay=!0,n.call("relayout",re,{autosize:!0}).then(function(){re.changed=oe,re._resolveResize===se&&(delete re._resolveResize,se(re))})},100)});return ge&&ge(ne),ne},w.previousPromises=function(re){if((re._promises||[]).length)return Promise.all(re._promises).then(function(){re._promises=[]})},w.addLinks=function(re){if(!(!re._context.showLink&&!re._context.showSources)){var ge=re._fullLayout,ne=o.ensureSingle(ge._paper,"text","js-plot-link-container",function(fe){fe.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.defaultLine,"pointer-events":"all"}).each(function(){var Ce=d.select(this);Ce.append("tspan").classed("js-link-to-tool",!0),Ce.append("tspan").classed("js-link-spacer",!0),Ce.append("tspan").classed("js-sourcelinks",!0)})}),se=ne.node(),_e={y:ge._paper.attr("height")-9};document.body.contains(se)&&se.getComputedTextLength()>=ge.width-20?(_e["text-anchor"]="start",_e.x=5):(_e["text-anchor"]="end",_e.x=ge._paper.attr("width")-7),ne.attr(_e);var oe=ne.select(".js-link-to-tool"),J=ne.select(".js-link-spacer"),me=ne.select(".js-sourcelinks");re._context.showSources&&re._context.showSources(re),re._context.showLink&&E(re,oe),J.text(oe.text()&&me.text()?" - ":"")}};function E(re,ge){ge.text("");var ne=ge.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(re._context.linkText+" »");if(re._context.sendData)ne.on("click",function(){w.sendDataToCloud(re)});else{var se=window.location.pathname.split("/"),_e=window.location.search;ne.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+se[2].split(".")[0]+"/"+se[1]+_e})}}w.sendDataToCloud=function(re){var ge=(window.PLOTLYENV||{}).BASE_URL||re._context.plotlyServerURL;if(ge){re.emit("plotly_beforeexport");var ne=d.select(re).append("div").attr("id","hiddenform").style("display","none"),se=ne.append("form").attr({action:ge+"/external",method:"post",target:"_blank"}),_e=se.append("input").attr({type:"text",name:"data"});return _e.node().value=w.graphJson(re,!1,"keepdata"),se.node().submit(),ne.remove(),re.emit("plotly_afterexport"),!1}};var I=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(re,ge){var ne=ge&&ge.skipUpdateCalc,se=re._fullLayout||{};if(se._skipDefaults){delete se._skipDefaults;return}var _e=re._fullLayout={},oe=re.layout||{},J=re._fullData||[],me=re._fullData=[],fe=re.data||[],Ce=re.calcdata||[],Be=re._context||{},Oe;re._transitionData||w.createTransitionData(re),_e._dfltTitle={plot:k(re,"Click to enter Plot title"),subtitle:k(re,"Click to enter Plot subtitle"),x:k(re,"Click to enter X axis title"),y:k(re,"Click to enter Y axis title"),colorbar:k(re,"Click to enter Colorscale title"),annotation:k(re,"new text")},_e._traceWord=k(re,"trace");var Ze=C(re,I);if(_e._mapboxAccessToken=Be.mapboxAccessToken,se._initialAutoSizeIsDone){var Ge=se.width,rt=se.height;w.supplyLayoutGlobalDefaults(oe,_e,Ze),oe.width||(_e.width=Ge),oe.height||(_e.height=rt),w.sanitizeMargins(_e)}else{w.supplyLayoutGlobalDefaults(oe,_e,Ze);var _t=!oe.width||!oe.height,pt=_e.autosize,gt=Be.autosizable,ct=_t&&(pt||gt);ct?w.plotAutoSize(re,oe,_e):_t&&w.sanitizeMargins(_e),!pt&&_t&&(oe.width=_e.width,oe.height=_e.height)}_e._d3locale=T(Ze,_e.separators),_e._extraFormat=C(re,M),_e._initialAutoSizeIsDone=!0,_e._dataLength=fe.length,_e._modules=[],_e._visibleModules=[],_e._basePlotModules=[];var Ae=_e._subplots=g(),ze=_e._splomAxes={x:{},y:{}},Ee=_e._splomSubplots={};_e._splomGridDflt={},_e._scatterStackOpts={},_e._firstScatter={},_e._alignmentOpts={},_e._colorAxes={},_e._requestRangeslider={},_e._traceUids=p(J,fe),w.supplyDataDefaults(fe,me,oe,_e);var nt=Object.keys(ze.x),xt=Object.keys(ze.y);if(nt.length>1&&xt.length>1){for(n.getComponentMethod("grid","sizeDefaults")(oe,_e),Oe=0;Oe15&&xt.length>15&&_e.shapes.length===0&&_e.images.length===0,w.linkSubplots(me,_e,J,se),w.cleanPlot(me,_e,J,se);var gr=!!(se._has&&se._has("cartesian")),mr=!!(_e._has&&_e._has("cartesian")),Kr=gr,ri=mr;Kr&&!ri?se._bgLayer.remove():ri&&!Kr&&(_e._shouldCreateBgLayer=!0),se._zoomlayer&&!re._dragging&&m({_fullLayout:se}),N(me,_e),f(_e,se),n.getComponentMethod("colorscale","crossTraceDefaults")(me,_e),_e._preGUI||(_e._preGUI={}),_e._tracePreGUI||(_e._tracePreGUI={});var Mr=_e._tracePreGUI,ui={},mi;for(mi in Mr)ui[mi]="old";for(Oe=0;Oe0){var Ce=1-2*_e;oe=Math.round(Ce*oe),J=Math.round(Ce*J)}}var Be=w.layoutAttributes.width.min,Oe=w.layoutAttributes.height.min;oe1,Ge=!ge.height&&Math.abs(ne.height-J)>1;(Ge||Ze)&&(Ze&&(ne.width=oe),Ge&&(ne.height=J)),re._initialAutoSize||(re._initialAutoSize={width:oe,height:J}),w.sanitizeMargins(ne)},w.supplyLayoutModuleDefaults=function(re,ge,ne,se){var _e=n.componentsRegistry,oe=ge._basePlotModules,J,me,fe,Ce=n.subplotsRegistry.cartesian;for(J in _e)fe=_e[J],fe.includeBasePlot&&fe.includeBasePlot(re,ge);oe.length||oe.push(Ce),ge._has("cartesian")&&(n.getComponentMethod("grid","contentDefaults")(re,ge),Ce.finalizeSubplots(re,ge));for(var Be in ge._subplots)ge._subplots[Be].sort(o.subplotSort);for(me=0;me1&&(ne.l/=pt,ne.r/=pt)}if(Ze){var gt=(ne.t+ne.b)/Ze;gt>1&&(ne.t/=gt,ne.b/=gt)}var ct=ne.xl!==void 0?ne.xl:ne.x,Ae=ne.xr!==void 0?ne.xr:ne.x,ze=ne.yt!==void 0?ne.yt:ne.y,Ee=ne.yb!==void 0?ne.yb:ne.y;Ge[ge]={l:{val:ct,size:ne.l+_t},r:{val:Ae,size:ne.r+_t},b:{val:Ee,size:ne.b+_t},t:{val:ze,size:ne.t+_t}},rt[ge]=1}if(!se._replotting)return w.doAutoMargin(re)}};function $(re){if("_redrawFromAutoMarginCount"in re._fullLayout)return!1;var ge=h.list(re,"",!0);for(var ne in ge)if(ge[ne].autoshift||ge[ne].shift)return!0;return!1}w.doAutoMargin=function(re){var ge=re._fullLayout,ne=ge.width,se=ge.height;ge._size||(ge._size={}),V(ge);var _e=ge._size,oe=ge.margin,J={t:0,b:0,l:0,r:0},me=o.extendFlat({},_e),fe=oe.l,Ce=oe.r,Be=oe.t,Oe=oe.b,Ze=ge._pushmargin,Ge=ge._pushmarginIds,rt=ge.minreducedwidth,_t=ge.minreducedheight;if(oe.autoexpand!==!1){for(var pt in Ze)Ge[pt]||delete Ze[pt];var gt=re._fullLayout._reservedMargin;for(var ct in gt)for(var Ae in gt[ct]){var ze=gt[ct][Ae];J[Ae]=Math.max(J[Ae],ze)}Ze.base={l:{val:0,size:fe},r:{val:1,size:Ce},t:{val:1,size:Be},b:{val:0,size:Oe}};for(var Ee in J){var nt=0;for(var xt in Ze)xt!=="base"&&P(Ze[xt][Ee].size)&&(nt=Ze[xt][Ee].size>nt?Ze[xt][Ee].size:nt);var ut=Math.max(0,oe[Ee]-nt);J[Ee]=Math.max(0,J[Ee]-ut)}for(var Et in Ze){var Gt=Ze[Et].l||{},Jt=Ze[Et].b||{},gr=Gt.val,mr=Gt.size,Kr=Jt.val,ri=Jt.size,Mr=ne-J.r-J.l,ui=se-J.t-J.b;for(var mi in Ze){if(P(mr)&&Ze[mi].r){var Ot=Ze[mi].r.val,Je=Ze[mi].r.size;if(Ot>gr){var ot=(mr*Ot+(Je-Mr)*gr)/(Ot-gr),De=(Je*(1-gr)+(mr-Mr)*(1-Ot))/(Ot-gr);ot+De>fe+Ce&&(fe=ot,Ce=De)}}if(P(ri)&&Ze[mi].t){var ye=Ze[mi].t.val,Pe=Ze[mi].t.size;if(ye>Kr){var He=(ri*ye+(Pe-ui)*Kr)/(ye-Kr),at=(Pe*(1-Kr)+(ri-ui)*(1-ye))/(ye-Kr);He+at>Oe+Be&&(Oe=He,Be=at)}}}}}var ht=o.constrain(ne-oe.l-oe.r,W,rt),At=o.constrain(se-oe.t-oe.b,F,_t),Wt=Math.max(0,ne-ht),Kt=Math.max(0,se-At);if(Wt){var hr=(fe+Ce)/Wt;hr>1&&(fe/=hr,Ce/=hr)}if(Kt){var zr=(Oe+Be)/Kt;zr>1&&(Oe/=zr,Be/=zr)}if(_e.l=Math.round(fe)+J.l,_e.r=Math.round(Ce)+J.r,_e.t=Math.round(Be)+J.t,_e.b=Math.round(Oe)+J.b,_e.p=Math.round(oe.pad),_e.w=Math.round(ne)-_e.l-_e.r,_e.h=Math.round(se)-_e.t-_e.b,!ge._replotting&&(w.didMarginChange(me,_e)||$(re))){"_redrawFromAutoMarginCount"in ge?ge._redrawFromAutoMarginCount++:ge._redrawFromAutoMarginCount=1;var Dr=3*(1+Object.keys(Ge).length);if(ge._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(re,ge,ne,se,_e,oe){(_e&&ge&&!re._fullData||_e&&!ge&&!re._fullLayout)&&w.supplyDefaults(re);var J=_e?re._fullData:re.data,me=_e?re._fullLayout:re.layout,fe=(re._transitionData||{})._frames;function Ce(Ze,Ge){if(typeof Ze=="function")return Ge?"_function_":null;if(o.isPlainObject(Ze)){var rt={},_t;return Object.keys(Ze).sort().forEach(function(Ae){if(["_","["].indexOf(Ae.charAt(0))===-1){if(typeof Ze[Ae]=="function"){Ge&&(rt[Ae]="_function");return}if(ne==="keepdata"){if(Ae.substr(Ae.length-3)==="src")return}else if(ne==="keepstream"){if(_t=Ze[Ae+"src"],typeof _t=="string"&&_t.indexOf(":")>0&&!o.isPlainObject(Ze.stream))return}else if(ne!=="keepall"&&(_t=Ze[Ae+"src"],typeof _t=="string"&&_t.indexOf(":")>0))return;rt[Ae]=Ce(Ze[Ae],Ge)}}),rt}var pt=Array.isArray(Ze),gt=o.isTypedArray(Ze);if((pt||gt)&&Ze.dtype&&Ze.shape){var ct=Ze.bdata;return Ce({dtype:Ze.dtype,shape:Ze.shape,bdata:o.isArrayBuffer(ct)?i.encode(ct):ct},Ge)}return pt?Ze.map(function(Ae){return Ce(Ae,Ge)}):gt?o.simpleMap(Ze,o.identity):o.isJSDate(Ze)?o.ms2DateTimeLocal(+Ze):Ze}var Be={data:(J||[]).map(function(Ze){var Ge=Ce(Ze);return ge&&delete Ge.fit,Ge})};if(!ge&&(Be.layout=Ce(me),_e)){var Oe=me._size;Be.layout.computed={margin:{b:Oe.b,l:Oe.l,r:Oe.r,t:Oe.t}}}return fe&&(Be.frames=Ce(fe)),oe&&(Be.config=Ce(re._context,!0)),se==="object"?Be:JSON.stringify(Be)},w.modifyFrames=function(re,ge){var ne,se,_e,oe=re._transitionData._frames,J=re._transitionData._frameHash;for(ne=0;ne0&&(re._transitioningWithDuration=!0),re._transitionData._interruptCallbacks.push(function(){se=!0}),ne.redraw&&re._transitionData._interruptCallbacks.push(function(){return n.call("redraw",re)}),re._transitionData._interruptCallbacks.push(function(){re.emit("plotly_transitioninterrupted",[])});var Ze=0,Ge=0;function rt(){return Ze++,function(){Ge++,!se&&Ge===Ze&&me(Oe)}}ne.runFn(rt),setTimeout(rt())})}function me(Oe){if(re._transitionData)return oe(re._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ne.redraw)return n.call("redraw",re)}).then(function(){re._transitioning=!1,re._transitioningWithDuration=!1,re.emit("plotly_transitioned",[])}).then(Oe)}function fe(){if(re._transitionData)return re._transitioning=!1,_e(re._transitionData._interruptCallbacks)}var Ce=[w.previousPromises,fe,ne.prepareFn,w.rehover,w.reselect,J],Be=o.syncOrAsync(Ce,re);return(!Be||!Be.then)&&(Be=Promise.resolve()),Be.then(function(){return re})}w.doCalcdata=function(re,ge){var ne=h.list(re),se=re._fullData,_e=re._fullLayout,oe,J,me,fe,Ce=new Array(se.length),Be=(re.calcdata||[]).slice();for(re.calcdata=Ce,_e._numBoxes=0,_e._numViolins=0,_e._violinScaleGroupStats={},re._hmpixcount=0,re._hmlumcount=0,_e._piecolormap={},_e._sunburstcolormap={},_e._treemapcolormap={},_e._iciclecolormap={},_e._funnelareacolormap={},me=0;me=0;fe--)if(Ee[fe].enabled){oe._indexToPoints=Ee[fe]._indexToPoints;break}J&&J.calc&&(ze=J.calc(re,oe))}(!Array.isArray(ze)||!ze[0])&&(ze=[{x:s,y:s}]),ze[0].t||(ze[0].t={}),ze[0].trace=oe,Ce[ct]=ze}}for(ve(ne,se,_e),me=0;me{te.xmlns="http://www.w3.org/2000/xmlns/",te.svg="http://www.w3.org/2000/svg",te.xlink="http://www.w3.org/1999/xlink",te.svgAttrs={xmlns:te.svg,"xmlns:xlink":te.xlink}}),Bf=Fe((te,Y)=>{Y.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),cc=Fe(te=>{var Y=ii(),d=ji(),y=d.strTranslate,z=k0(),P=Bf().LINE_SPACING,i=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;te.convertToTspans=function(F,$,q){var G=F.text(),ee=!F.attr("data-notex")&&$&&$._context.typesetMath&&typeof MathJax<"u"&&G.match(i),he=Y.select(F.node().parentNode);if(he.empty())return;var xe=F.attr("class")?F.attr("class").split(" ")[0]:"text";xe+="-math",he.selectAll("svg."+xe).remove(),he.selectAll("g."+xe+"-group").remove(),F.style("display",null).attr({"data-unformatted":G,"data-math":"N"});function ve(){he.empty()||(xe=F.attr("class")+"-math",he.select("svg."+xe).remove()),F.text("").style("white-space","pre");var ce=B(F.node(),G);ce&&F.style("pointer-events","all"),te.positionText(F),q&&q.call(F)}return ee?($&&$._promises||[]).push(new Promise(function(ce){F.style("display","none");var re=parseInt(F.node().style.fontSize,10),ge={fontSize:re};u(ee[2],ge,function(ne,se,_e){he.selectAll("svg."+xe).remove(),he.selectAll("g."+xe+"-group").remove();var oe=ne&&ne.select("svg");if(!oe||!oe.node()){ve(),ce();return}var J=he.append("g").classed(xe+"-group",!0).attr({"pointer-events":"none","data-unformatted":G,"data-math":"Y"});J.node().appendChild(oe.node()),se&&se.node()&&oe.node().insertBefore(se.node().cloneNode(!0),oe.node().firstChild);var me=_e.width,fe=_e.height;oe.attr({class:xe,height:fe,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var Ce=F.node().style.fill||"black",Be=oe.select("g");Be.attr({fill:Ce,stroke:Ce});var Oe=Be.node().getBoundingClientRect(),Ze=Oe.width,Ge=Oe.height;(Ze>me||Ge>fe)&&(oe.style("overflow","hidden"),Oe=oe.node().getBoundingClientRect(),Ze=Oe.width,Ge=Oe.height);var rt=+F.attr("x"),_t=+F.attr("y"),pt=re||F.node().getBoundingClientRect().height,gt=-pt/4;if(xe[0]==="y")J.attr({transform:"rotate("+[-90,rt,_t]+")"+y(-Ze/2,gt-Ge/2)});else if(xe[0]==="l")_t=gt-Ge/2;else if(xe[0]==="a"&&xe.indexOf("atitle")!==0)rt=0,_t=gt;else{var ct=F.attr("text-anchor");rt=rt-Ze*(ct==="middle"?.5:ct==="end"?1:0),_t=_t+gt-Ge/2}oe.attr({x:rt,y:_t}),q&&q.call(F,J),ce(J)})})):ve(),F};var n=/(<|<|<)/g,a=/(>|>|>)/g;function l(F){return F.replace(n,"\\lt ").replace(a,"\\gt ")}var o=[["$","$"],["\\(","\\)"]];function u(F,$,q){var G=parseInt((MathJax.version||"").split(".")[0]);if(G!==2&&G!==3){d.warn("No MathJax version:",MathJax.version);return}var ee,he,xe,ve,ce=function(){return he=d.extendDeepAll({},MathJax.Hub.config),xe=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:o},displayAlign:"left"})},re=function(){he=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=o},ge=function(){if(ee=MathJax.Hub.config.menuSettings.renderer,ee!=="SVG")return MathJax.Hub.setRenderer("SVG")},ne=function(){ee=MathJax.config.startup.output,ee!=="svg"&&(MathJax.config.startup.output="svg")},se=function(){var Ce="math-output-"+d.randstr({},64);ve=Y.select("body").append("div").attr({id:Ce}).style({visibility:"hidden",position:"absolute","font-size":$.fontSize+"px"}).text(l(F));var Be=ve.node();return G===2?MathJax.Hub.Typeset(Be):MathJax.typeset([Be])},_e=function(){var Ce=ve.select(G===2?".MathJax_SVG":".MathJax"),Be=!Ce.empty()&&ve.select("svg").node();if(!Be)d.log("There was an error in the tex syntax.",F),q();else{var Oe=Be.getBoundingClientRect(),Ze;G===2?Ze=Y.select("body").select("#MathJax_SVG_glyphs"):Ze=Ce.select("defs"),q(Ce,Ze,Oe)}ve.remove()},oe=function(){if(ee!=="SVG")return MathJax.Hub.setRenderer(ee)},J=function(){ee!=="svg"&&(MathJax.config.startup.output=ee)},me=function(){return xe!==void 0&&(MathJax.Hub.processSectionDelay=xe),MathJax.Hub.Config(he)},fe=function(){MathJax.config=he};G===2?MathJax.Hub.Queue(ce,ge,se,_e,oe,me):G===3&&(re(),ne(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){se(),_e(),J(),fe()}))}var s={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},m={sub:"-0.21em",sup:"0.42em"},b="​",x=["http:","https:","mailto:","",void 0,":"],_=te.NEWLINES=/(\r\n?|\n)/g,A=/(<[^<>]*>)/,f=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;te.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,D=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,I=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(F,$){if(!F)return null;var q=F.match($),G=q&&(q[3]||q[4]);return G&&T(G)}var p=/(^|;)\s*color:/;te.plainText=function(F,$){$=$||{};for(var q=$.len!==void 0&&$.len!==-1?$.len:1/0,G=$.allowedTags!==void 0?$.allowedTags:["br"],ee="...",he=ee.length,xe=F.split(A),ve=[],ce="",re=0,ge=0;gehe?ve.push(ne.substr(0,J-he)+ee):ve.push(ne.substr(0,J));break}ce=""}}return ve.join("")};var g={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function T(F){return F.replace(C,function($,q){var G;return q.charAt(0)==="#"?G=N(q.charAt(1)==="x"?parseInt(q.substr(2),16):parseInt(q.substr(1),10)):G=g[q],G||$})}te.convertEntities=T;function N(F){if(!(F>1114111)){var $=String.fromCodePoint;if($)return $(F);var q=String.fromCharCode;return F<=65535?q(F):q((F>>10)+55232,F%1024+56320)}}function B(F,$){$=$.replace(_," ");var q=!1,G=[],ee,he=-1;function xe(){he++;var Ge=document.createElementNS(z.svg,"tspan");Y.select(Ge).attr({class:"line",dy:he*P+"em"}),F.appendChild(Ge),ee=Ge;var rt=G;if(G=[{node:Ge}],rt.length>1)for(var _t=1;_t.",$);return}var rt=G.pop();Ge!==rt.type&&d.log("Start tag <"+rt.type+"> doesnt match end tag <"+Ge+">. Pretending it did match.",$),ee=G[G.length-1].node}var ge=k.test($);ge?xe():(ee=F,G=[{node:F}]);for(var ne=$.split(A),se=0;se{var d=ii(),y=sn(),z=Ar(),P=ji(),i=Xi(),n=Ur().isValid;function a(_,A,f){var k=A?P.nestedProperty(_,A).get()||{}:_,w=k[f||"color"];w&&w._inputArray&&(w=w._inputArray);var D=!1;if(P.isArrayOrTypedArray(w)){for(var E=0;E=0;k--,w++){var D=_[k];f[w]=[1-D[0],D[1]]}return f}function m(_,A){A=A||{};for(var f=_.domain,k=_.range,w=k.length,D=new Array(w),E=0;E{var d=tw(),y=d.FORMAT_LINK,z=d.DATE_FORMAT_LINK;function P(a,l){return{valType:"string",dflt:"",editType:"none",description:(l?i:n)("hover text",a)+["By default the values are formatted using "+(l?"generic number format":"`"+a+"axis.hoverformat`")+"."].join(" ")}}function i(a,l){return["Sets the "+a+" formatting rule"+(l?"for `"+l+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+y+"."].join(" ")}function n(a,l){return i(a,l)+[" And for dates see: "+z+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}Y.exports={axisHoverFormat:P,descriptionOnlyNumbers:i,descriptionWithDates:n}}),qd=Fe((te,Y)=>{var d=zn(),y=Mi(),z=Wd().dash,P=an().extendFlat,i=ku().templatedArray;rc().templateFormatStringDescription;var n=Sh().descriptionWithDates,a=ti().ONEDAY,l=dc(),o=l.HOUR_PATTERN,u=l.WEEKDAY_PATTERN,s={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},h=P({},s,{values:s.values.slice().concat(["sync"])});function m(p){return{valType:"integer",min:0,dflt:p?5:0,editType:"ticks"}}var b={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},x={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},_={valType:"data_array",editType:"ticks"},A={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function f(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=5),g}function k(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var w={valType:"color",dflt:y.defaultLine,editType:"ticks"},D={valType:"color",dflt:y.lightLine,editType:"ticks"};function E(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var I=P({},z,{editType:"ticks"}),M={valType:"boolean",editType:"ticks"};Y.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:y.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:d({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},rangebreaks:i("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[u,o,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:a},editType:"calc"}),tickmode:h,nticks:m(),tick0:b,dtick:x,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:_,ticktext:{valType:"data_array",editType:"ticks"},ticks:A,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:f(),tickwidth:k(),tickcolor:w,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:P({},z,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:d({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:n("tick label")},tickformatstops:i("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:n("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:M,gridcolor:D,gridwidth:E(),griddash:I,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},minor:{tickmode:s,nticks:m("minor"),tick0:b,dtick:x,tickvals:_,ticks:A,ticklen:f("minor"),tickwidth:k("minor"),tickcolor:w,gridcolor:D,gridwidth:E("minor"),griddash:I,showgrid:M,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),k_=Fe((te,Y)=>{var d=qd(),y=zn(),z=an().extendFlat,P=oh().overrideAll;Y.exports=P({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:d.linecolor,outlinewidth:d.linewidth,bordercolor:d.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:z({},d.ticks,{dflt:""}),ticklabeloverflow:z({},d.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,ticklabelstep:d.ticklabelstep,showticklabels:d.showticklabels,labelalias:d.labelalias,tickfont:y({}),tickangle:d.tickangle,tickformat:d.tickformat,tickformatstops:d.tickformatstops,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,separatethousands:d.separatethousands,exponentformat:d.exponentformat,minexponent:d.minexponent,showexponent:d.showexponent,title:{text:{valType:"string"},font:y({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),zc=Fe((te,Y)=>{var d=k_(),y=go().counter,z=Ym(),P=Ur().scales;z(P);function i(n){return"`"+n+"`"}Y.exports=function(n,a){n=n||"",a=a||{};var l=a.cLetter||"c";"onlyIfNumerical"in a&&a.onlyIfNumerical;var o="noScale"in a?a.noScale:n==="marker.line",u="showScaleDflt"in a?a.showScaleDflt:l==="z",s=typeof a.colorscaleDflt=="string"?P[a.colorscaleDflt]:null,h=a.editTypeOverride||"",m=n?n+".":"",b;"colorAttr"in a?(b=a.colorAttr,a.colorAttr):(b={z:"z",c:"color"}[l],""+i(m+b));var x=l+"auto",_=l+"min",A=l+"max",f=l+"mid",k={};k[_]=k[A]=void 0;var w={};w[x]=!1;var D={};return b==="color"&&(D.color={valType:"color",arrayOk:!0,editType:h||"style"},a.anim&&(D.color.anim=!0)),D[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:k},D[_]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[A]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[f]={valType:"number",dflt:null,editType:"calc",impliedEdits:k},D.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},D.autocolorscale={valType:"boolean",dflt:a.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},D.reversescale={valType:"boolean",dflt:!1,editType:"plot"},o||(D.showscale={valType:"boolean",dflt:u,editType:"calc"},D.colorbar=d),a.noColorAxis||(D.coloraxis={valType:"subplotid",regex:y("coloraxis"),dflt:null,editType:"calc"}),D}}),Hu=Fe((te,Y)=>{var d=an().extendFlat,y=zc(),z=Ur().scales;Y.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:z.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:z.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:z.RdBu,editType:"calc"}},coloraxis:d({_isSubplotObj:!0,editType:"calc"},y("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),Mm=Fe((te,Y)=>{var d=ji();Y.exports=function(y){return d.isPlainObject(y.colorbar)}}),Yh=Fe(te=>{var Y=Ar(),d=ji(),y=ti(),z=y.ONEDAY,P=y.ONEWEEK;te.dtick=function(i,n){var a=n==="log",l=n==="date",o=n==="category",u=l?z:1;if(!i)return u;if(Y(i))return i=Number(i),i<=0?u:o?Math.max(1,Math.round(i)):l?Math.max(.1,i):i;if(typeof i!="string"||!(l||a))return u;var s=i.charAt(0),h=i.substr(1);return h=Y(h)?Number(h):0,h<=0||!(l&&s==="M"&&h===Math.round(h)||a&&s==="L"||a&&s==="D"&&(h===1||h===2))?u:i},te.tick0=function(i,n,a,l){if(n==="date")return d.cleanDate(i,d.dateTick0(a,l%P===0?1:0));if(!(l==="D1"||l==="D2"))return Y(i)?Number(i):0}}),jv=Fe((te,Y)=>{var d=Yh(),y=ji().isArrayOrTypedArray,z=Di().isTypedArraySpec,P=Di().decodeTypedArraySpec;Y.exports=function(i,n,a,l,o){o||(o={});var u=o.isMinor,s=u?i.minor||{}:i,h=u?n.minor:n,m=u?"minor.":"";function b(E){var I=s[E];return z(I)&&(I=P(I)),I!==void 0?I:(h._template||{})[E]}var x=b("tick0"),_=b("dtick"),A=b("tickvals"),f=y(A)?"array":_?"linear":"auto",k=a(m+"tickmode",f);if(k==="auto"||k==="sync")a(m+"nticks");else if(k==="linear"){var w=h.dtick=d.dtick(_,l);h.tick0=d.tick0(x,l,n.calendar,w)}else if(l!=="multicategory"){var D=a(m+"tickvals");D===void 0?h.tickmode="auto":u||a("ticktext")}}}),Uv=Fe((te,Y)=>{var d=ji(),y=qd();Y.exports=function(z,P,i,n){var a=n.isMinor,l=a?z.minor||{}:z,o=a?P.minor:P,u=a?y.minor:y,s=a?"minor.":"",h=d.coerce2(l,o,u,"ticklen",a?(P.ticklen||5)*.6:void 0),m=d.coerce2(l,o,u,"tickwidth",a?P.tickwidth||1:void 0),b=d.coerce2(l,o,u,"tickcolor",(a?P.tickcolor:void 0)||o.color),x=i(s+"ticks",!a&&n.outerTicks||h||m||b?"outside":"");x||(delete o.ticklen,delete o.tickwidth,delete o.tickcolor)}}),Xx=Fe((te,Y)=>{Y.exports=function(d){var y=["showexponent","showtickprefix","showticksuffix"],z=y.filter(function(i){return d[i]!==void 0}),P=function(i){return d[i]===d[z[0]]};if(z.every(P)||z.length===1)return d[z[0]]}}),Gd=Fe((te,Y)=>{var d=ji(),y=ku();Y.exports=function(z,P,i){var n=i.name,a=i.inclusionAttr||"visible",l=P[n],o=d.isArrayOrTypedArray(z[n])?z[n]:[],u=P[n]=[],s=y.arrayTemplater(P,n,a),h,m;for(h=0;h{var d=ji(),y=Xi().contrast,z=qd(),P=Xx(),i=Gd();Y.exports=function(a,l,o,u,s){s||(s={});var h=o("labelalias");d.isPlainObject(h)||delete l.labelalias;var m=P(a),b=o("showticklabels");if(b){s.noTicklabelshift||o("ticklabelshift"),s.noTicklabelstandoff||o("ticklabelstandoff");var x=s.font||{},_=l.color,A=l.ticklabelposition||"",f=A.indexOf("inside")!==-1?y(s.bgColor):_&&_!==z.color.dflt?_:x.color;if(d.coerceFont(o,"tickfont",x,{overrideDflt:{color:f}}),!s.noTicklabelstep&&u!=="multicategory"&&u!=="log"&&o("ticklabelstep"),!s.noAng){var k=o("tickangle");!s.noAutotickangles&&k==="auto"&&o("autotickangles")}if(u!=="category"){var w=o("tickformat");i(a,l,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:n}),l.tickformatstops.length||delete l.tickformatstops,!s.noExp&&!w&&u!=="date"&&(o("showexponent",m),o("exponentformat"),o("minexponent"),o("separatethousands"))}!s.noMinorloglabels&&u==="log"&&o("minorloglabels")}};function n(a,l){function o(s,h){return d.coerce(a,l,z.tickformatstops,s,h)}var u=o("enabled");u&&(o("dtickrange"),o("value"))}}),Tg=Fe((te,Y)=>{var d=Xx();Y.exports=function(y,z,P,i,n){n||(n={});var a=n.tickSuffixDflt,l=d(y),o=P("tickprefix");o&&P("showtickprefix",l);var u=P("ticksuffix",a);u&&P("showticksuffix",l)}}),K1=Fe((te,Y)=>{var d=ji(),y=ku(),z=jv(),P=Uv(),i=G0(),n=Tg(),a=k_();Y.exports=function(l,o,u){var s=y.newContainer(o,"colorbar"),h=l.colorbar||{};function m(F,$){return d.coerce(h,s,a,F,$)}var b=u.margin||{t:0,b:0,l:0,r:0},x=u.width-b.l-b.r,_=u.height-b.t-b.b,A=m("orientation"),f=A==="v",k=m("thicknessmode");m("thickness",k==="fraction"?30/(f?x:_):30);var w=m("lenmode");m("len",w==="fraction"?1:f?_:x);var D=m("yref"),E=m("xref"),I=D==="paper",M=E==="paper",p,g,C,T="left";f?(C="middle",T=M?"left":"right",p=M?1.02:1,g=.5):(C=I?"bottom":"top",T="center",p=.5,g=I?1.02:1),d.coerce(h,s,{x:{valType:"number",min:M?-2:0,max:M?3:1,dflt:p}},"x"),d.coerce(h,s,{y:{valType:"number",min:I?-2:0,max:I?3:1,dflt:g}},"y"),m("xanchor",T),m("xpad"),m("yanchor",C),m("ypad"),d.noneOrAll(h,s,["x","y"]),m("outlinecolor"),m("outlinewidth"),m("bordercolor"),m("borderwidth"),m("bgcolor");var N=d.coerce(h,s,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:f?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");m("ticklabeloverflow",N.indexOf("inside")!==-1?"hide past domain":"hide past div"),z(h,s,m,"linear");var B=u.font,U={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:B};N.indexOf("inside")!==-1&&(U.bgColor="black"),n(h,s,m,"linear",U),i(h,s,m,"linear",U),P(h,s,m,"linear",U),m("title.text",u._dfltTitle.colorbar);var V=s.showticklabels?s.tickfont:B,W=d.extendFlat({},B,{family:V.family,size:d.bigFont(V.size)});d.coerceFont(m,"title.font",W),m("title.side",f?"top":"right")}}),Cc=Fe((te,Y)=>{var d=Ar(),y=ji(),z=Mm(),P=K1(),i=Ur().isValid,n=as().traceIs;function a(l,o){var u=o.slice(0,o.length-1);return o?y.nestedProperty(l,u).get()||{}:l}Y.exports=function l(o,u,s,h,m){var b=m.prefix,x=m.cLetter,_="_module"in u,A=a(o,b),f=a(u,b),k=a(u._template||{},b)||{},w=function(){return delete o.coloraxis,delete u.coloraxis,l(o,u,s,h,m)};if(_){var D=s._colorAxes||{},E=h(b+"coloraxis");if(E){var I=n(u,"contour")&&y.nestedProperty(u,"contours.coloring").get()||"heatmap",M=D[E];M?(M[2].push(w),M[0]!==I&&(M[0]=!1,y.warn(["Ignoring coloraxis:",E,"setting","as it is linked to incompatible colorscales."].join(" ")))):D[E]=[I,u,[w]];return}}var p=A[x+"min"],g=A[x+"max"],C=d(p)&&d(g)&&p{var d=ji(),y=ku(),z=Hu(),P=Cc();Y.exports=function(i,n){function a(x,_){return d.coerce(i,n,z,x,_)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var l=n._colorAxes,o,u;function s(x,_){return d.coerce(o,u,z.coloraxis,x,_)}for(var h in l){var m=l[h];if(m[0])o=i[h]||{},u=y.newContainer(n,h,"coloraxis"),u._name=h,P(o,u,n,s,{prefix:"",cLetter:"c"});else{for(var b=0;b{var d=ji(),y=cp().hasColorscale,z=cp().extractOpts;Y.exports=function(P,i){function n(m,b){var x=m["_"+b];x!==void 0&&(m[b]=x)}function a(m,b){var x=b.container?d.nestedProperty(m,b.container).get():m;if(x)if(x.coloraxis)x._colorAx=i[x.coloraxis];else{var _=z(x),A=_.auto;(A||_.min===void 0)&&n(x,b.min),(A||_.max===void 0)&&n(x,b.max),_.autocolorscale&&n(x,"colorscale")}}for(var l=0;l{var d=Ar(),y=ji(),z=cp().extractOpts;Y.exports=function(P,i,n){var a=P._fullLayout,l=n.vals,o=n.containerStr,u=o?y.nestedProperty(i,o).get():i,s=z(u),h=s.auto!==!1,m=s.min,b=s.max,x=s.mid,_=function(){return y.aggNums(Math.min,null,l)},A=function(){return y.aggNums(Math.max,null,l)};if(m===void 0?m=_():h&&(u._colorAx&&d(m)?m=Math.min(m,_()):m=_()),b===void 0?b=A():h&&(u._colorAx&&d(b)?b=Math.max(b,A()):b=A()),h&&x!==void 0&&(b-x>x-m?m=x-(b-x):b-x=0?f=a.colorscale.sequential:f=a.colorscale.sequentialminus,s._sync("colorscale",f)}}}),lh=Fe((te,Y)=>{var d=Ur(),y=cp();Y.exports={moduleType:"component",name:"colorscale",attributes:zc(),layoutAttributes:Hu(),supplyLayoutDefaults:$v(),handleDefaults:Cc(),crossTraceDefaults:b4(),calc:kp(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:y.hasColorscale,extractOpts:y.extractOpts,extractScale:y.extractScale,flipScale:y.flipScale,makeColorScaleFunc:y.makeColorScaleFunc,makeColorScaleFuncFromTrace:y.makeColorScaleFuncFromTrace}}),Oc=Fe((te,Y)=>{var d=ji(),y=Di().isTypedArraySpec;Y.exports={hasLines:function(z){return z.visible&&z.mode&&z.mode.indexOf("lines")!==-1},hasMarkers:function(z){return z.visible&&(z.mode&&z.mode.indexOf("markers")!==-1||z.type==="splom")},hasText:function(z){return z.visible&&z.mode&&z.mode.indexOf("text")!==-1},isBubble:function(z){var P=z.marker;return d.isPlainObject(P)&&(d.isArrayOrTypedArray(P.size)||y(P.size))}}}),Hv=Fe((te,Y)=>{var d=Ar();Y.exports=function(y,z){z||(z=2);var P=y.marker,i=P.sizeref||1,n=P.sizemin||0,a=P.sizemode==="area"?function(l){return Math.sqrt(l/i)}:function(l){return l/i};return function(l){var o=a(l/z);return d(o)&&o>0?Math.max(o,n):0}}}),T0=Fe(te=>{var Y=ji();te.getSubplot=function(n){return n.subplot||n.xaxis+n.yaxis||n.geo},te.isTraceInSubplots=function(n,a){if(n.type==="splom"){for(var l=n.xaxes||[],o=n.yaxes||[],u=0;u=0&&l.index{Y.exports=z;var d={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function z(n){var a=[];return n.replace(y,function(l,o,u){var s=o.toLowerCase();for(u=i(u),s=="m"&&u.length>2&&(a.push([o].concat(u.splice(0,2))),s="l",o=o=="m"?"l":"L");;){if(u.length==d[s])return u.unshift(o),a.push(u);if(u.length{var d=T_(),y=function(x,_){return _?Math.round(x*(_=Math.pow(10,_)))/_:Math.round(x)},z="M0,0Z",P=Math.sqrt(2),i=Math.sqrt(3),n=Math.PI,a=Math.cos,l=Math.sin;Y.exports={circle:{n:0,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k="M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z";return A?b(_,A,k):k}},square:{n:1,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")}},diamond:{n:2,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"Z")}},cross:{n:3,f:function(x,_,A){if(o(_))return z;var f=y(x*.4,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+f+"H"+f+"V"+k+"H-"+f+"V"+f+"H-"+k+"V-"+f+"H-"+f+"V-"+k+"H"+f+"V-"+f+"H"+k+"Z")}},x:{n:4,f:function(x,_,A){if(o(_))return z;var f=y(x*.8/P,2),k="l"+f+","+f,w="l"+f+",-"+f,D="l-"+f+",-"+f,E="l-"+f+","+f;return b(_,A,"M0,"+f+k+w+D+w+D+E+D+E+k+E+k+"Z")}},"triangle-up":{n:5,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+f+","+k+"H"+f+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+f+",-"+k+"H"+f+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M"+k+",-"+f+"V"+f+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+k+",-"+f+"V"+f+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+k+",-"+f+"H"+f+"V"+k+"Z")}},"triangle-se":{n:10,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+f+",-"+k+"V"+f+"H-"+k+"Z")}},"triangle-sw":{n:11,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+f+"H-"+f+"V-"+k+"Z")}},"triangle-nw":{n:12,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+f+","+k+"V-"+f+"H"+k+"Z")}},pentagon:{n:13,f:function(x,_,A){if(o(_))return z;var f=y(x*.951,2),k=y(x*.588,2),w=y(-x,2),D=y(x*-.309,2),E=y(x*.809,2);return b(_,A,"M"+f+","+D+"L"+k+","+E+"H-"+k+"L-"+f+","+D+"L0,"+w+"Z")}},hexagon:{n:14,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/2,2),w=y(x*i/2,2);return b(_,A,"M"+w+",-"+k+"V"+k+"L0,"+f+"L-"+w+","+k+"V-"+k+"L0,-"+f+"Z")}},hexagon2:{n:15,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/2,2),w=y(x*i/2,2);return b(_,A,"M-"+k+","+w+"H"+k+"L"+f+",0L"+k+",-"+w+"H-"+k+"L-"+f+",0Z")}},octagon:{n:16,f:function(x,_,A){if(o(_))return z;var f=y(x*.924,2),k=y(x*.383,2);return b(_,A,"M-"+k+",-"+f+"H"+k+"L"+f+",-"+k+"V"+k+"L"+k+","+f+"H-"+k+"L-"+f+","+k+"V-"+k+"Z")}},star:{n:17,f:function(x,_,A){if(o(_))return z;var f=x*1.4,k=y(f*.225,2),w=y(f*.951,2),D=y(f*.363,2),E=y(f*.588,2),I=y(-f,2),M=y(f*-.309,2),p=y(f*.118,2),g=y(f*.809,2),C=y(f*.382,2);return b(_,A,"M"+k+","+M+"H"+w+"L"+D+","+p+"L"+E+","+g+"L0,"+C+"L-"+E+","+g+"L-"+D+","+p+"L-"+w+","+M+"H-"+k+"L0,"+I+"Z")}},hexagram:{n:18,f:function(x,_,A){if(o(_))return z;var f=y(x*.66,2),k=y(x*.38,2),w=y(x*.76,2);return b(_,A,"M-"+w+",0l-"+k+",-"+f+"h"+w+"l"+k+",-"+f+"l"+k+","+f+"h"+w+"l-"+k+","+f+"l"+k+","+f+"h-"+w+"l-"+k+","+f+"l-"+k+",-"+f+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(x,_,A){if(o(_))return z;var f=y(x*i*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M-"+f+","+k+E+f+","+k+E+"0,-"+w+E+"-"+f+","+k+"Z")}},"star-triangle-down":{n:20,f:function(x,_,A){if(o(_))return z;var f=y(x*i*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M"+f+",-"+k+E+"-"+f+",-"+k+E+"0,"+w+E+f+",-"+k+"Z")}},"star-square":{n:21,f:function(x,_,A){if(o(_))return z;var f=y(x*1.1,2),k=y(x*2,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+f+",-"+f+w+"-"+f+","+f+w+f+","+f+w+f+",-"+f+w+"-"+f+",-"+f+"Z")}},"star-diamond":{n:22,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2),k=y(x*1.9,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+f+",0"+w+"0,"+f+w+f+",0"+w+"0,-"+f+w+"-"+f+",0Z")}},"diamond-tall":{n:23,f:function(x,_,A){if(o(_))return z;var f=y(x*.7,2),k=y(x*1.4,2);return b(_,A,"M0,"+k+"L"+f+",0L0,-"+k+"L-"+f+",0Z")}},"diamond-wide":{n:24,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2),k=y(x*.7,2);return b(_,A,"M0,"+k+"L"+f+",0L0,-"+k+"L-"+f+",0Z")}},hourglass:{n:25,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"H-"+f+"L"+f+",-"+f+"H-"+f+"Z")},noDot:!0},bowtie:{n:26,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"V-"+f+"L-"+f+","+f+"V-"+f+"Z")},noDot:!0},"circle-cross":{n:27,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/P,2);return b(_,A,"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k+"M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f+"M"+f+",-"+f+"L-"+f+","+f+"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"ZM0,-"+f+"V"+f+"M-"+f+",0H"+f)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2),k=y(x*.65,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"ZM-"+k+",-"+k+"L"+k+","+k+"M-"+k+","+k+"L"+k+",-"+k)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f+"M"+f+",-"+f+"L-"+f+","+f)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*.85,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(x,_,A){if(o(_))return z;var f=y(x/2,2),k=y(x,2);return b(_,A,"M"+f+","+k+"V-"+k+"M"+(f-k)+",-"+k+"V"+k+"M"+k+","+f+"H-"+k+"M-"+k+","+(f-k)+"H"+k)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+f+","+w+"L0,0M"+f+","+w+"L0,0M0,-"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+f+",-"+w+"L0,0M"+f+",-"+w+"L0,0M0,"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M"+w+","+f+"L0,0M"+w+",-"+f+"L0,0M-"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+w+","+f+"L0,0M-"+w+",-"+f+"L0,0M"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M"+f+",0H-"+f)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M0,"+f+"V-"+f)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+",-"+f+"L-"+f+","+f)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+f+","+k+"H"+f+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+f+",-"+k+"H"+f+"Z")},noDot:!0},"arrow-left":{n:47,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L"+f+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-right":{n:48,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L-"+f+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M-"+f+",0H"+f+"M0,0L-"+f+","+k+"H"+f+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M-"+f+",0H"+f+"M0,0L-"+f+",-"+k+"H"+f+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L"+f+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L-"+f+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(x,_,A){if(o(_))return z;var f=n/2.5,k=2*x*a(f),w=2*x*l(f);return b(_,A,"M0,0L"+-k+","+w+"L"+k+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(x,_,A){if(o(_))return z;var f=n/4,k=2*x*a(f),w=2*x*l(f);return b(_,A,"M0,0L"+-k+","+w+"A "+2*x+","+2*x+" 0 0 1 "+k+","+w+"Z")},backoff:.4,noDot:!0}};function o(x){return x===null}var u,s,h,m;function b(x,_,A){if((!x||x%360===0)&&!_)return A;if(h===x&&m===_&&u===A)return s;h=x,m=_,u=A;function f(U,V){var W=a(U),F=l(U),$=V[0],q=V[1]+(_||0);return[$*W-q*F,$*F+q*W]}for(var k=x/180*n,w=0,D=0,E=d(A),I="",M=0;M{var d=ii(),y=ji(),z=y.numberFormat,P=Ar(),i=sn(),n=as(),a=Xi(),l=lh(),o=y.strTranslate,u=cc(),s=k0(),h=Bf(),m=h.LINE_SPACING,b=oo().DESELECTDIM,x=Oc(),_=Hv(),A=T0().appendArrayPointValue,f=Y.exports={};f.font=function(Ae,ze){var Ee=ze.variant,nt=ze.style,xt=ze.weight,ut=ze.color,Et=ze.size,Gt=ze.family,Jt=ze.shadow,gr=ze.lineposition,mr=ze.textcase;Gt&&Ae.style("font-family",Gt),Et+1&&Ae.style("font-size",Et+"px"),ut&&Ae.call(a.fill,ut),xt&&Ae.style("font-weight",xt),nt&&Ae.style("font-style",nt),Ee&&Ae.style("font-variant",Ee),mr&&Ae.style("text-transform",k(D(mr))),Jt&&Ae.style("text-shadow",Jt==="auto"?u.makeTextShadow(a.contrast(ut)):k(Jt)),gr&&Ae.style("text-decoration-line",k(E(gr)))};function k(Ae){return Ae==="none"?void 0:Ae}var w={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function D(Ae){return w[Ae]}function E(Ae){return Ae.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}f.setPosition=function(Ae,ze,Ee){Ae.attr("x",ze).attr("y",Ee)},f.setSize=function(Ae,ze,Ee){Ae.attr("width",ze).attr("height",Ee)},f.setRect=function(Ae,ze,Ee,nt,xt){Ae.call(f.setPosition,ze,Ee).call(f.setSize,nt,xt)},f.translatePoint=function(Ae,ze,Ee,nt){var xt=Ee.c2p(Ae.x),ut=nt.c2p(Ae.y);if(P(xt)&&P(ut)&&ze.node())ze.node().nodeName==="text"?ze.attr("x",xt).attr("y",ut):ze.attr("transform",o(xt,ut));else return!1;return!0},f.translatePoints=function(Ae,ze,Ee){Ae.each(function(nt){var xt=d.select(this);f.translatePoint(nt,xt,ze,Ee)})},f.hideOutsideRangePoint=function(Ae,ze,Ee,nt,xt,ut){ze.attr("display",Ee.isPtWithinRange(Ae,xt)&&nt.isPtWithinRange(Ae,ut)?null:"none")},f.hideOutsideRangePoints=function(Ae,ze){if(ze._hasClipOnAxisFalse){var Ee=ze.xaxis,nt=ze.yaxis;Ae.each(function(xt){var ut=xt[0].trace,Et=ut.xcalendar,Gt=ut.ycalendar,Jt=n.traceIs(ut,"bar-like")?".bartext":".point,.textpoint";Ae.selectAll(Jt).each(function(gr){f.hideOutsideRangePoint(gr,d.select(this),Ee,nt,Et,Gt)})})}},f.crispRound=function(Ae,ze,Ee){return!ze||!P(ze)?Ee||0:Ae._context.staticPlot?ze:ze<1?1:Math.round(ze)},f.singleLineStyle=function(Ae,ze,Ee,nt,xt){ze.style("fill","none");var ut=(((Ae||[])[0]||{}).trace||{}).line||{},Et=Ee||ut.width||0,Gt=xt||ut.dash||"";a.stroke(ze,nt||ut.color),f.dashLine(ze,Gt,Et)},f.lineGroupStyle=function(Ae,ze,Ee,nt){Ae.style("fill","none").each(function(xt){var ut=(((xt||[])[0]||{}).trace||{}).line||{},Et=ze||ut.width||0,Gt=nt||ut.dash||"";d.select(this).call(a.stroke,Ee||ut.color).call(f.dashLine,Gt,Et)})},f.dashLine=function(Ae,ze,Ee){Ee=+Ee||0,ze=f.dashStyle(ze,Ee),Ae.style({"stroke-dasharray":ze,"stroke-width":Ee+"px"})},f.dashStyle=function(Ae,ze){ze=+ze||1;var Ee=Math.max(ze,3);return Ae==="solid"?Ae="":Ae==="dot"?Ae=Ee+"px,"+Ee+"px":Ae==="dash"?Ae=3*Ee+"px,"+3*Ee+"px":Ae==="longdash"?Ae=5*Ee+"px,"+5*Ee+"px":Ae==="dashdot"?Ae=3*Ee+"px,"+Ee+"px,"+Ee+"px,"+Ee+"px":Ae==="longdashdot"&&(Ae=5*Ee+"px,"+2*Ee+"px,"+Ee+"px,"+2*Ee+"px"),Ae};function I(Ae,ze,Ee,nt){var xt=ze.fillpattern,ut=ze.fillgradient,Et=f.getPatternAttr,Gt=xt&&(Et(xt.shape,0,"")||Et(xt.path,0,""));if(Gt){var Jt=Et(xt.bgcolor,0,null),gr=Et(xt.fgcolor,0,null),mr=xt.fgopacity,Kr=Et(xt.size,0,8),ri=Et(xt.solidity,0,.3),Mr=ze.uid;f.pattern(Ae,"point",Ee,Mr,Gt,Kr,ri,void 0,xt.fillmode,Jt,gr,mr)}else if(ut&&ut.type!=="none"){var ui=ut.type,mi="scatterfill-"+ze.uid;if(nt&&(mi="legendfill-"+ze.uid),!nt&&(ut.start!==void 0||ut.stop!==void 0)){var Ot,Je;ui==="horizontal"?(Ot={x:ut.start,y:0},Je={x:ut.stop,y:0}):ui==="vertical"&&(Ot={x:0,y:ut.start},Je={x:0,y:ut.stop}),Ot.x=ze._xA.c2p(Ot.x===void 0?ze._extremes.x.min[0].val:Ot.x,!0),Ot.y=ze._yA.c2p(Ot.y===void 0?ze._extremes.y.min[0].val:Ot.y,!0),Je.x=ze._xA.c2p(Je.x===void 0?ze._extremes.x.max[0].val:Je.x,!0),Je.y=ze._yA.c2p(Je.y===void 0?ze._extremes.y.max[0].val:Je.y,!0),Ae.call(B,Ee,mi,"linear",ut.colorscale,"fill",Ot,Je,!0,!1)}else ui==="horizontal"&&(ui=ui+"reversed"),Ae.call(f.gradient,Ee,mi,ui,ut.colorscale,"fill")}else ze.fillcolor&&Ae.call(a.fill,ze.fillcolor)}f.singleFillStyle=function(Ae,ze){var Ee=d.select(Ae.node()),nt=Ee.data(),xt=((nt[0]||[])[0]||{}).trace||{};I(Ae,xt,ze,!1)},f.fillGroupStyle=function(Ae,ze,Ee){Ae.style("stroke-width",0).each(function(nt){var xt=d.select(this);nt[0].trace&&I(xt,nt[0].trace,ze,Ee)})};var M=Bc();f.symbolNames=[],f.symbolFuncs=[],f.symbolBackOffs=[],f.symbolNeedLines={},f.symbolNoDot={},f.symbolNoFill={},f.symbolList=[],Object.keys(M).forEach(function(Ae){var ze=M[Ae],Ee=ze.n;f.symbolList.push(Ee,String(Ee),Ae,Ee+100,String(Ee+100),Ae+"-open"),f.symbolNames[Ee]=Ae,f.symbolFuncs[Ee]=ze.f,f.symbolBackOffs[Ee]=ze.backoff||0,ze.needLine&&(f.symbolNeedLines[Ee]=!0),ze.noDot?f.symbolNoDot[Ee]=!0:f.symbolList.push(Ee+200,String(Ee+200),Ae+"-dot",Ee+300,String(Ee+300),Ae+"-open-dot"),ze.noFill&&(f.symbolNoFill[Ee]=!0)});var p=f.symbolNames.length,g="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";f.symbolNumber=function(Ae){if(P(Ae))Ae=+Ae;else if(typeof Ae=="string"){var ze=0;Ae.indexOf("-open")>0&&(ze=100,Ae=Ae.replace("-open","")),Ae.indexOf("-dot")>0&&(ze+=200,Ae=Ae.replace("-dot","")),Ae=f.symbolNames.indexOf(Ae),Ae>=0&&(Ae+=ze)}return Ae%100>=p||Ae>=400?0:Math.floor(Math.max(Ae,0))};function C(Ae,ze,Ee,nt){var xt=Ae%100;return f.symbolFuncs[xt](ze,Ee,nt)+(Ae>=200?g:"")}var T=z("~f"),N={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};f.gradient=function(Ae,ze,Ee,nt,xt,ut){var Et=N[nt];return B(Ae,ze,Ee,Et.type,xt,ut,Et.start,Et.stop,!1,Et.reversed)};function B(Ae,ze,Ee,nt,xt,ut,Et,Gt,Jt,gr){var mr=xt.length,Kr;nt==="linear"?Kr={node:"linearGradient",attrs:{x1:Et.x,y1:Et.y,x2:Gt.x,y2:Gt.y,gradientUnits:Jt?"userSpaceOnUse":"objectBoundingBox"},reversed:gr}:nt==="radial"&&(Kr={node:"radialGradient",reversed:gr});for(var ri=new Array(mr),Mr=0;Mr=0&&Ae.i===void 0&&(Ae.i=ut.i),ze.style("opacity",nt.selectedOpacityFn?nt.selectedOpacityFn(Ae):Ae.mo===void 0?Et.opacity:Ae.mo),nt.ms2mrc){var Jt;Ae.ms==="various"||Et.size==="various"?Jt=3:Jt=nt.ms2mrc(Ae.ms),Ae.mrc=Jt,nt.selectedSizeFn&&(Jt=Ae.mrc=nt.selectedSizeFn(Ae));var gr=f.symbolNumber(Ae.mx||Et.symbol)||0;Ae.om=gr%200>=100;var mr=ct(Ae,Ee),Kr=me(Ae,Ee);ze.attr("d",C(gr,Jt,mr,Kr))}var ri=!1,Mr,ui,mi;if(Ae.so)mi=Gt.outlierwidth,ui=Gt.outliercolor,Mr=Et.outliercolor;else{var Ot=(Gt||{}).width;mi=(Ae.mlw+1||Ot+1||(Ae.trace?(Ae.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Ae?ui=Ae.mlcc=nt.lineScale(Ae.mlc):y.isArrayOrTypedArray(Gt.color)?ui=a.defaultLine:ui=Gt.color,y.isArrayOrTypedArray(Et.color)&&(Mr=a.defaultLine,ri=!0),"mc"in Ae?Mr=Ae.mcc=nt.markerScale(Ae.mc):Mr=Et.color||Et.colors||"rgba(0,0,0,0)",nt.selectedColorFn&&(Mr=nt.selectedColorFn(Ae))}if(Ae.om)ze.call(a.stroke,Mr).style({"stroke-width":(mi||1)+"px",fill:"none"});else{ze.style("stroke-width",(Ae.isBlank?0:mi)+"px");var Je=Et.gradient,ot=Ae.mgt;ot?ri=!0:ot=Je&&Je.type,y.isArrayOrTypedArray(ot)&&(ot=ot[0],N[ot]||(ot=0));var De=Et.pattern,ye=f.getPatternAttr,Pe=De&&(ye(De.shape,Ae.i,"")||ye(De.path,Ae.i,""));if(ot&&ot!=="none"){var He=Ae.mgc;He?ri=!0:He=Je.color;var at=Ee.uid;ri&&(at+="-"+Ae.i),f.gradient(ze,xt,at,ot,[[0,He],[1,Mr]],"fill")}else if(Pe){var ht=!1,At=De.fgcolor;!At&&ut&&ut.color&&(At=ut.color,ht=!0);var Wt=ye(At,Ae.i,ut&&ut.color||null),Kt=ye(De.bgcolor,Ae.i,null),hr=De.fgopacity,zr=ye(De.size,Ae.i,8),Dr=ye(De.solidity,Ae.i,.3);ht=ht||Ae.mcc||y.isArrayOrTypedArray(De.shape)||y.isArrayOrTypedArray(De.path)||y.isArrayOrTypedArray(De.bgcolor)||y.isArrayOrTypedArray(De.fgcolor)||y.isArrayOrTypedArray(De.size)||y.isArrayOrTypedArray(De.solidity);var br=Ee.uid;ht&&(br+="-"+Ae.i),f.pattern(ze,"point",xt,br,Pe,zr,Dr,Ae.mcc,De.fillmode,Kt,Wt,hr)}else y.isArrayOrTypedArray(Mr)?a.fill(ze,Mr[Ae.i]):a.fill(ze,Mr);mi&&a.stroke(ze,ui)}},f.makePointStyleFns=function(Ae){var ze={},Ee=Ae.marker;return ze.markerScale=f.tryColorscale(Ee,""),ze.lineScale=f.tryColorscale(Ee,"line"),n.traceIs(Ae,"symbols")&&(ze.ms2mrc=x.isBubble(Ae)?_(Ae):function(){return(Ee.size||6)/2}),Ae.selectedpoints&&y.extendFlat(ze,f.makeSelectedPointStyleFns(Ae)),ze},f.makeSelectedPointStyleFns=function(Ae){var ze={},Ee=Ae.selected||{},nt=Ae.unselected||{},xt=Ae.marker||{},ut=Ee.marker||{},Et=nt.marker||{},Gt=xt.opacity,Jt=ut.opacity,gr=Et.opacity,mr=Jt!==void 0,Kr=gr!==void 0;(y.isArrayOrTypedArray(Gt)||mr||Kr)&&(ze.selectedOpacityFn=function(ye){var Pe=ye.mo===void 0?xt.opacity:ye.mo;return ye.selected?mr?Jt:Pe:Kr?gr:b*Pe});var ri=xt.color,Mr=ut.color,ui=Et.color;(Mr||ui)&&(ze.selectedColorFn=function(ye){var Pe=ye.mcc||ri;return ye.selected?Mr||Pe:ui||Pe});var mi=xt.size,Ot=ut.size,Je=Et.size,ot=Ot!==void 0,De=Je!==void 0;return n.traceIs(Ae,"symbols")&&(ot||De)&&(ze.selectedSizeFn=function(ye){var Pe=ye.mrc||mi/2;return ye.selected?ot?Ot/2:Pe:De?Je/2:Pe}),ze},f.makeSelectedTextStyleFns=function(Ae){var ze={},Ee=Ae.selected||{},nt=Ae.unselected||{},xt=Ae.textfont||{},ut=Ee.textfont||{},Et=nt.textfont||{},Gt=xt.color,Jt=ut.color,gr=Et.color;return ze.selectedTextColorFn=function(mr){var Kr=mr.tc||Gt;return mr.selected?Jt||Kr:gr||(Jt?Kr:a.addOpacity(Kr,b))},ze},f.selectedPointStyle=function(Ae,ze){if(!(!Ae.size()||!ze.selectedpoints)){var Ee=f.makeSelectedPointStyleFns(ze),nt=ze.marker||{},xt=[];Ee.selectedOpacityFn&&xt.push(function(ut,Et){ut.style("opacity",Ee.selectedOpacityFn(Et))}),Ee.selectedColorFn&&xt.push(function(ut,Et){a.fill(ut,Ee.selectedColorFn(Et))}),Ee.selectedSizeFn&&xt.push(function(ut,Et){var Gt=Et.mx||nt.symbol||0,Jt=Ee.selectedSizeFn(Et);ut.attr("d",C(f.symbolNumber(Gt),Jt,ct(Et,ze),me(Et,ze))),Et.mrc2=Jt}),xt.length&&Ae.each(function(ut){for(var Et=d.select(this),Gt=0;Gt0?Ee:0}f.textPointStyle=function(Ae,ze,Ee){if(Ae.size()){var nt;if(ze.selectedpoints){var xt=f.makeSelectedTextStyleFns(ze);nt=xt.selectedTextColorFn}var ut=ze.texttemplate,Et=Ee._fullLayout;Ae.each(function(Gt){var Jt=d.select(this),gr=ut?y.extractOption(Gt,ze,"txt","texttemplate"):y.extractOption(Gt,ze,"tx","text");if(!gr&&gr!==0){Jt.remove();return}if(ut){var mr=ze._module.formatLabels,Kr=mr?mr(Gt,ze,Et):{},ri={};A(ri,ze,Gt.i),gr=y.texttemplateString({data:[ri,Gt,ze._meta],fallback:ze.texttemplatefallback,labels:Kr,locale:Et._d3locale,template:gr})}var Mr=Gt.tp||ze.textposition,ui=W(Gt,ze),mi=nt?nt(Gt):Gt.tc||ze.textfont.color;Jt.call(f.font,{family:Gt.tf||ze.textfont.family,weight:Gt.tw||ze.textfont.weight,style:Gt.ty||ze.textfont.style,variant:Gt.tv||ze.textfont.variant,textcase:Gt.tC||ze.textfont.textcase,lineposition:Gt.tE||ze.textfont.lineposition,shadow:Gt.tS||ze.textfont.shadow,size:ui,color:mi}).text(gr).call(u.convertToTspans,Ee).call(V,Mr,ui,Gt.mrc)})}},f.selectedTextStyle=function(Ae,ze){if(!(!Ae.size()||!ze.selectedpoints)){var Ee=f.makeSelectedTextStyleFns(ze);Ae.each(function(nt){var xt=d.select(this),ut=Ee.selectedTextColorFn(nt),Et=nt.tp||ze.textposition,Gt=W(nt,ze);a.fill(xt,ut);var Jt=n.traceIs(ze,"bar-like");V(xt,Et,Gt,nt.mrc2||nt.mrc,Jt)})}};var F=.5;f.smoothopen=function(Ae,ze){if(Ae.length<3)return"M"+Ae.join("L");var Ee="M"+Ae[0],nt=[],xt;for(xt=1;xt=Jt||ye>=mr&&ye<=Jt)&&(Pe<=Kr&&Pe>=gr||Pe>=Kr&&Pe<=gr)&&(Ae=[ye,Pe])}return Ae}f.applyBackoff=re,f.makeTester=function(){var Ae=y.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(Ee){Ee.attr(s.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ze=y.ensureSingle(Ae,"path","js-reference-point",function(Ee){Ee.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});f.tester=Ae,f.testref=ze},f.savedBBoxes={};var ge=0,ne=1e4;f.bBox=function(Ae,ze,Ee){Ee||(Ee=se(Ae));var nt;if(Ee){if(nt=f.savedBBoxes[Ee],nt)return y.extendFlat({},nt)}else if(Ae.childNodes.length===1){var xt=Ae.childNodes[0];if(Ee=se(xt),Ee){var ut=+xt.getAttribute("x")||0,Et=+xt.getAttribute("y")||0,Gt=xt.getAttribute("transform");if(!Gt){var Jt=f.bBox(xt,!1,Ee);return ut&&(Jt.left+=ut,Jt.right+=ut),Et&&(Jt.top+=Et,Jt.bottom+=Et),Jt}if(Ee+="~"+ut+"~"+Et+"~"+Gt,nt=f.savedBBoxes[Ee],nt)return y.extendFlat({},nt)}}var gr,mr;ze?gr=Ae:(mr=f.tester.node(),gr=Ae.cloneNode(!0),mr.appendChild(gr)),d.select(gr).attr("transform",null).call(u.positionText,0,0);var Kr=gr.getBoundingClientRect(),ri=f.testref.node().getBoundingClientRect();ze||mr.removeChild(gr);var Mr={height:Kr.height,width:Kr.width,left:Kr.left-ri.left,top:Kr.top-ri.top,right:Kr.right-ri.left,bottom:Kr.bottom-ri.top};return ge>=ne&&(f.savedBBoxes={},ge=0),Ee&&(f.savedBBoxes[Ee]=Mr),ge++,y.extendFlat({},Mr)};function se(Ae){var ze=Ae.getAttribute("data-unformatted");if(ze!==null)return ze+Ae.getAttribute("data-math")+Ae.getAttribute("text-anchor")+Ae.getAttribute("style")}f.setClipUrl=function(Ae,ze,Ee){Ae.attr("clip-path",_e(ze,Ee))};function _e(Ae,ze){if(!Ae)return null;var Ee=ze._context,nt=Ee._exportedPlot?"":Ee._baseUrl||"";return nt?"url('"+nt+"#"+Ae+"')":"url(#"+Ae+")"}f.getTranslate=function(Ae){var ze=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Ee=Ae.attr?"attr":"getAttribute",nt=Ae[Ee]("transform")||"",xt=nt.replace(ze,function(ut,Et,Gt){return[Et,Gt].join(" ")}).split(" ");return{x:+xt[0]||0,y:+xt[1]||0}},f.setTranslate=function(Ae,ze,Ee){var nt=/(\btranslate\(.*?\);?)/,xt=Ae.attr?"attr":"getAttribute",ut=Ae.attr?"attr":"setAttribute",Et=Ae[xt]("transform")||"";return ze=ze||0,Ee=Ee||0,Et=Et.replace(nt,"").trim(),Et+=o(ze,Ee),Et=Et.trim(),Ae[ut]("transform",Et),Et},f.getScale=function(Ae){var ze=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Ee=Ae.attr?"attr":"getAttribute",nt=Ae[Ee]("transform")||"",xt=nt.replace(ze,function(ut,Et,Gt){return[Et,Gt].join(" ")}).split(" ");return{x:+xt[0]||1,y:+xt[1]||1}},f.setScale=function(Ae,ze,Ee){var nt=/(\bscale\(.*?\);?)/,xt=Ae.attr?"attr":"getAttribute",ut=Ae.attr?"attr":"setAttribute",Et=Ae[xt]("transform")||"";return ze=ze||1,Ee=Ee||1,Et=Et.replace(nt,"").trim(),Et+="scale("+ze+","+Ee+")",Et=Et.trim(),Ae[ut]("transform",Et),Et};var oe=/\s*sc.*/;f.setPointGroupScale=function(Ae,ze,Ee){if(ze=ze||1,Ee=Ee||1,!!Ae){var nt=ze===1&&Ee===1?"":"scale("+ze+","+Ee+")";Ae.each(function(){var xt=(this.getAttribute("transform")||"").replace(oe,"");xt+=nt,xt=xt.trim(),this.setAttribute("transform",xt)})}};var J=/translate\([^)]*\)\s*$/;f.setTextPointsScale=function(Ae,ze,Ee){Ae&&Ae.each(function(){var nt,xt=d.select(this),ut=xt.select("text");if(ut.node()){var Et=parseFloat(ut.attr("x")||0),Gt=parseFloat(ut.attr("y")||0),Jt=(xt.attr("transform")||"").match(J);ze===1&&Ee===1?nt=[]:nt=[o(Et,Gt),"scale("+ze+","+Ee+")",o(-Et,-Gt)],Jt&&nt.push(Jt),xt.attr("transform",nt.join(""))}})};function me(Ae,ze){var Ee;return Ae&&(Ee=Ae.mf),Ee===void 0&&(Ee=ze.marker&&ze.marker.standoff||0),!ze._geo&&!ze._xA?-Ee:Ee}f.getMarkerStandoff=me;var fe=Math.atan2,Ce=Math.cos,Be=Math.sin;function Oe(Ae,ze){var Ee=ze[0],nt=ze[1];return[Ee*Ce(Ae)-nt*Be(Ae),Ee*Be(Ae)+nt*Ce(Ae)]}var Ze,Ge,rt,_t,pt,gt;function ct(Ae,ze){var Ee=Ae.ma;Ee===void 0&&(Ee=ze.marker.angle,(!Ee||y.isArrayOrTypedArray(Ee))&&(Ee=0));var nt,xt,ut=ze.marker.angleref;if(ut==="previous"||ut==="north"){if(ze._geo){var Et=ze._geo.project(Ae.lonlat);nt=Et[0],xt=Et[1]}else{var Gt=ze._xA,Jt=ze._yA;if(Gt&&Jt)nt=Gt.c2p(Ae.x),xt=Jt.c2p(Ae.y);else return 90}if(ze._geo){var gr=Ae.lonlat[0],mr=Ae.lonlat[1],Kr=ze._geo.project([gr,mr+1e-5]),ri=ze._geo.project([gr+1e-5,mr]),Mr=fe(ri[1]-xt,ri[0]-nt),ui=fe(Kr[1]-xt,Kr[0]-nt),mi;if(ut==="north")mi=Ee/180*Math.PI;else if(ut==="previous"){var Ot=gr/180*Math.PI,Je=mr/180*Math.PI,ot=Ze/180*Math.PI,De=Ge/180*Math.PI,ye=ot-Ot,Pe=Ce(De)*Be(ye),He=Be(De)*Ce(Je)-Ce(De)*Be(Je)*Ce(ye);mi=-fe(Pe,He)-Math.PI,Ze=gr,Ge=mr}var at=Oe(Mr,[Ce(mi),0]),ht=Oe(ui,[Be(mi),0]);Ee=fe(at[1]+ht[1],at[0]+ht[0])/Math.PI*180,ut==="previous"&&!(gt===ze.uid&&Ae.i===pt+1)&&(Ee=null)}if(ut==="previous"&&!ze._geo)if(gt===ze.uid&&Ae.i===pt+1&&P(nt)&&P(xt)){var At=nt-rt,Wt=xt-_t,Kt=ze.line&&ze.line.shape||"",hr=Kt.slice(Kt.length-1);hr==="h"&&(Wt=0),hr==="v"&&(At=0),Ee+=fe(Wt,At)/Math.PI*180+90}else Ee=null}return rt=nt,_t=xt,pt=Ae.i,gt=ze.uid,Ee}f.getMarkerAngle=ct}),Fp=Fe((te,Y)=>{var d=ii(),y=Ar(),z=sh(),P=as(),i=ji(),n=i.strTranslate,a=Zs(),l=Xi(),o=cc(),u=oo(),s=Bf().OPPOSITE_SIDE,h=/ [XY][0-9]* /,m=1.6,b=1.6;function x(_,A,f){var k=_._fullLayout,w=f.propContainer,D=f.propName,E=f.placeholder,I=f.traceIndex,M=f.avoid||{},p=f.attributes,g=f.transform,C=f.containerGroup,T=1,N=w.title,B=(N&&N.text?N.text:"").trim(),U=!1,V=N&&N.font?N.font:{},W=V.family,F=V.size,$=V.color,q=V.weight,G=V.style,ee=V.variant,he=V.textcase,xe=V.lineposition,ve=V.shadow,ce=f.subtitlePropName,re=!!ce,ge=f.subtitlePlaceholder,ne=(w.title||{}).subtitle||{text:"",font:{}},se=(ne.text||"").trim(),_e=!1,oe=1,J=ne.font,me=J.family,fe=J.size,Ce=J.color,Be=J.weight,Oe=J.style,Ze=J.variant,Ge=J.textcase,rt=J.lineposition,_t=J.shadow,pt;D==="title.text"?pt="titleText":D.indexOf("axis")!==-1?pt="axisTitleText":D.indexOf("colorbar")!==-1&&(pt="colorbarTitleText");var gt=_._context.edits[pt];function ct(ri,Mr){return ri===void 0||Mr===void 0?!1:ri.replace(h," % ")===Mr.replace(h," % ")}B===""?T=0:ct(B,E)&&(gt||(B=""),T=.2,U=!0),re&&(se===""?oe=0:ct(se,ge)&&(gt||(se=""),oe=.2,_e=!0)),f._meta?B=i.templateString(B,f._meta):k._meta&&(B=i.templateString(B,k._meta));var Ae=B||se||gt,ze;C||(C=i.ensureSingle(k._infolayer,"g","g-"+A),ze=k._hColorbarMoveTitle);var Ee=C.selectAll("text."+A).data(Ae?[0]:[]);Ee.enter().append("text"),Ee.text(B).attr("class",A),Ee.exit().remove();var nt=null,xt=A+"-subtitle",ut=se||gt;if(re&&(nt=C.selectAll("text."+xt).data(ut?[0]:[]),nt.enter().append("text"),nt.text(se).attr("class",xt),nt.exit().remove()),!Ae)return C;function Et(ri,Mr){i.syncOrAsync([Gt,Jt],{title:ri,subtitle:Mr})}function Gt(ri){var Mr=ri.title,ui=ri.subtitle,mi;!g&&ze&&(g={}),g?(mi="",g.rotate&&(mi+="rotate("+[g.rotate,p.x,p.y]+")"),(g.offset||ze)&&(mi+=n(0,(g.offset||0)-(ze||0)))):mi=null,Mr.attr("transform",mi);function Ot(He){if(He){var at=d.select(He.node().parentNode).select("."+xt);if(!at.empty()){var ht=He.node().getBBox();if(ht.height){var At=ht.y+ht.height+m*fe;at.attr("y",At)}}}}if(Mr.style("opacity",T*l.opacity($)).call(a.font,{color:l.rgb($),size:d.round(F,2),family:W,weight:q,style:G,variant:ee,textcase:he,shadow:ve,lineposition:xe}).attr(p).call(o.convertToTspans,_,Ot),ui&&!ui.empty()){var Je=C.select("."+A+"-math-group"),ot=Mr.node().getBBox(),De=Je.node()?Je.node().getBBox():void 0,ye=De?De.y+De.height+m*fe:ot.y+ot.height+b*fe,Pe=i.extendFlat({},p,{y:ye});ui.attr("transform",mi),ui.style("opacity",oe*l.opacity(Ce)).call(a.font,{color:l.rgb(Ce),size:d.round(fe,2),family:me,weight:Be,style:Oe,variant:Ze,textcase:Ge,shadow:_t,lineposition:rt}).attr(Pe).call(o.convertToTspans,_)}return z.previousPromises(_)}function Jt(ri){var Mr=ri.title,ui=d.select(Mr.node().parentNode);if(M&&M.selection&&M.side&&B){ui.attr("transform",null);var mi=s[M.side],Ot=M.side==="left"||M.side==="top"?-1:1,Je=y(M.pad)?M.pad:2,ot=a.bBox(ui.node()),De={t:0,b:0,l:0,r:0},ye=_._fullLayout._reservedMargin;for(var Pe in ye)for(var He in ye[Pe]){var at=ye[Pe][He];De[He]=Math.max(De[He],at)}var ht={left:De.l,top:De.t,right:k.width-De.r,bottom:k.height-De.b},At=M.maxShift||Ot*(ht[M.side]-ot[M.side]),Wt=0;if(At<0)Wt=At;else{var Kt=M.offsetLeft||0,hr=M.offsetTop||0;ot.left-=Kt,ot.right-=Kt,ot.top-=hr,ot.bottom-=hr,M.selection.each(function(){var Dr=a.bBox(this);i.bBoxIntersect(ot,Dr,Je)&&(Wt=Math.max(Wt,Ot*(Dr[M.side]-ot[mi])+Je))}),Wt=Math.min(At,Wt),w._titleScoot=Math.abs(Wt)}if(Wt>0||At<0){var zr={left:[-Wt,0],right:[Wt,0],top:[0,-Wt],bottom:[0,Wt]}[M.side];ui.attr("transform",n(zr[0],zr[1]))}}}Ee.call(Et,nt);function gr(ri,Mr){ri.text(Mr).on("mouseover.opacity",function(){d.select(this).transition().duration(u.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(u.HIDE_PLACEHOLDER).style("opacity",0)})}if(gt&&(B?Ee.on(".opacity",null):(gr(Ee,E),U=!0),Ee.call(o.makeEditable,{gd:_}).on("edit",function(ri){I!==void 0?P.call("_guiRestyle",_,D,ri,I):P.call("_guiRelayout",_,D,ri)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Et)}).on("input",function(ri){this.text(ri||" ").call(o.positionText,p.x,p.y)}),re)){if(re&&!B){var mr=Ee.node().getBBox(),Kr=mr.y+mr.height+b*fe;nt.attr("y",Kr)}se?nt.on(".opacity",null):(gr(nt,ge),_e=!0),nt.call(o.makeEditable,{gd:_}).on("edit",function(ri){P.call("_guiRelayout",_,"title.subtitle.text",ri)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Et)}).on("input",function(ri){this.text(ri||" ").call(o.positionText,nt.attr("x"),nt.attr("y"))})}return Ee.classed("js-placeholder",U),nt&&!nt.empty()&&nt.classed("js-placeholder",_e),C}Y.exports={draw:x,SUBTITLE_PADDING_EM:b,SUBTITLE_PADDING_MATHJAX_EM:m}}),Z0=Fe((te,Y)=>{var d=ii(),y=vi().utcFormat,z=ji(),P=z.numberFormat,i=Ar(),n=z.cleanNumber,a=z.ms2DateTime,l=z.dateTime2ms,o=z.ensureNumber,u=z.isArrayOrTypedArray,s=ti(),h=s.FP_SAFE,m=s.BADNUM,b=s.LOG_CLIP,x=s.ONEWEEK,_=s.ONEDAY,A=s.ONEHOUR,f=s.ONEMIN,k=s.ONESEC,w=Zc(),D=dc(),E=D.HOUR_PATTERN,I=D.WEEKDAY_PATTERN;function M(g){return Math.pow(10,g)}function p(g){return g!=null}Y.exports=function(g,C){C=C||{};var T=g._id||"x",N=T.charAt(0);function B(ne,se){if(ne>0)return Math.log(ne)/Math.LN10;if(ne<=0&&se&&g.range&&g.range.length===2){var _e=g.range[0],oe=g.range[1];return .5*(_e+oe-2*b*Math.abs(_e-oe))}else return m}function U(ne,se,_e,oe){if((oe||{}).msUTC&&i(ne))return+ne;var J=l(ne,_e||g.calendar);if(J===m)if(i(ne)){ne=+ne;var me=Math.floor(z.mod(ne+.05,1)*10),fe=Math.round(ne-me/10);J=l(new Date(fe))+me/10}else return m;return J}function V(ne,se,_e){return a(ne,se,_e||g.calendar)}function W(ne){return g._categories[Math.round(ne)]}function F(ne){if(p(ne)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[ne]!==void 0)return g._categoriesMap[ne];g._categories.push(typeof ne=="number"?String(ne):ne);var se=g._categories.length-1;return g._categoriesMap[ne]=se,se}return m}function $(ne,se){for(var _e=new Array(se),oe=0;oeg.range[1]&&(_e=!_e);for(var oe=_e?-1:1,J=oe*ne,me=0,fe=0;feBe)me=fe+1;else{me=J<(Ce+Be)/2?fe:fe+1;break}}var Oe=g._B[me]||0;return isFinite(Oe)?he(ne,g._m2,Oe):0},ce=function(ne){var se=g._rangebreaks.length;if(!se)return xe(ne,g._m,g._b);for(var _e=0,oe=0;oeg._rangebreaks[oe].pmax&&(_e=oe+1);return xe(ne,g._m2,g._B[_e])}}g.c2l=g.type==="log"?B:o,g.l2c=g.type==="log"?M:o,g.l2p=ve,g.p2l=ce,g.c2p=g.type==="log"?function(ne,se){return ve(B(ne,se))}:ve,g.p2c=g.type==="log"?function(ne){return M(ce(ne))}:ce,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=n,g.c2d=g.c2r=g.l2d=g.l2r=o,g.d2p=g.r2p=function(ne){return g.l2p(n(ne))},g.p2d=g.p2r=ce,g.cleanPos=o):g.type==="log"?(g.d2r=g.d2l=function(ne,se){return B(n(ne),se)},g.r2d=g.r2c=function(ne){return M(n(ne))},g.d2c=g.r2l=n,g.c2d=g.l2r=o,g.c2r=B,g.l2d=M,g.d2p=function(ne,se){return g.l2p(g.d2r(ne,se))},g.p2d=function(ne){return M(ce(ne))},g.r2p=function(ne){return g.l2p(n(ne))},g.p2r=ce,g.cleanPos=o):g.type==="date"?(g.d2r=g.r2d=z.identity,g.d2c=g.r2c=g.d2l=g.r2l=U,g.c2d=g.c2r=g.l2d=g.l2r=V,g.d2p=g.r2p=function(ne,se,_e){return g.l2p(U(ne,0,_e))},g.p2d=g.p2r=function(ne,se,_e){return V(ce(ne),se,_e)},g.cleanPos=function(ne){return z.cleanDate(ne,m,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=F,g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(ne){var se=ee(ne);return se!==void 0?se:g.fraction2r(.5)},g.l2r=g.c2r=o,g.r2l=ee,g.d2p=function(ne){return g.l2p(g.r2c(ne))},g.p2d=function(ne){return W(ce(ne))},g.r2p=g.d2p,g.p2r=ce,g.cleanPos=function(ne){return typeof ne=="string"&&ne!==""?ne:o(ne)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(ne){var se=G(ne);return se!==void 0?se:g.fraction2r(.5)},g.r2c_just_indices=q,g.l2r=g.c2r=o,g.r2l=G,g.d2p=function(ne){return g.l2p(g.r2c(ne))},g.p2d=function(ne){return W(ce(ne))},g.r2p=g.d2p,g.p2r=ce,g.cleanPos=function(ne){return Array.isArray(ne)||typeof ne=="string"&&ne!==""?ne:o(ne)},g.setupMultiCategory=function(ne){var se=g._traceIndices,_e,oe,J=g._matchGroup;if(J&&g._categories.length===0){for(var me in J)if(me!==T){var fe=C[w.id2name(me)];se=se.concat(fe._traceIndices)}}var Ce=[[0,{}],[0,{}]],Be=[];for(_e=0;_efe[1]&&(oe[me?0:1]=_e),oe[0]===oe[1]){var Ce=g.l2r(se),Be=g.l2r(_e);if(se!==void 0){var Oe=Ce+1;_e!==void 0&&(Oe=Math.min(Oe,Be)),oe[me?1:0]=Oe}if(_e!==void 0){var Ze=Be+1;se!==void 0&&(Ze=Math.max(Ze,Ce)),oe[me?0:1]=Ze}}}},g.cleanRange=function(ne,se){g._cleanRange(ne,se),g.limitRange(ne)},g._cleanRange=function(ne,se){se||(se={}),ne||(ne="range");var _e=z.nestedProperty(g,ne).get(),oe,J;if(g.type==="date"?J=z.dfltRange(g.calendar):N==="y"?J=D.DFLTRANGEY:g._name==="realaxis"?J=[0,1]:J=se.dfltRange||D.DFLTRANGEX,J=J.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(J[0]=0),!_e||_e.length!==2){z.nestedProperty(g,ne).set(J);return}var me=_e[0]===null,fe=_e[1]===null;for(g.type==="date"&&!g.autorange&&(_e[0]=z.cleanDate(_e[0],m,g.calendar),_e[1]=z.cleanDate(_e[1],m,g.calendar)),oe=0;oe<2;oe++)if(g.type==="date"){if(!z.isDateTime(_e[oe],g.calendar)){g[ne]=J;break}if(g.r2l(_e[0])===g.r2l(_e[1])){var Ce=z.constrain(g.r2l(_e[0]),z.MIN_MS+1e3,z.MAX_MS-1e3);_e[0]=g.l2r(Ce-1e3),_e[1]=g.l2r(Ce+1e3);break}}else{if(!i(_e[oe]))if(!(me||fe)&&i(_e[1-oe]))_e[oe]=_e[1-oe]*(oe?10:.1);else{g[ne]=J;break}if(_e[oe]<-h?_e[oe]=-h:_e[oe]>h&&(_e[oe]=h),_e[0]===_e[1]){var Be=Math.max(1,Math.abs(_e[0]*1e-6));_e[0]-=Be,_e[1]+=Be}}},g.setScale=function(ne){var se=C._size;if(g.overlaying){var _e=w.getFromId({_fullLayout:C},g.overlaying);g.domain=_e.domain}var oe=ne&&g._r?"_r":"range",J=g.calendar;g.cleanRange(oe);var me=g.r2l(g[oe][0],J),fe=g.r2l(g[oe][1],J),Ce=N==="y";if(Ce?(g._offset=se.t+(1-g.domain[1])*se.h,g._length=se.h*(g.domain[1]-g.domain[0]),g._m=g._length/(me-fe),g._b=-g._m*fe):(g._offset=se.l+g.domain[0]*se.w,g._length=se.w*(g.domain[1]-g.domain[0]),g._m=g._length/(fe-me),g._b=-g._m*me),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Be,Oe;if(g._rangebreaks=g.locateBreaks(Math.min(me,fe),Math.max(me,fe)),g._rangebreaks.length){for(Be=0;Befe&&(Ze=!Ze),Ze&&g._rangebreaks.reverse();var Ge=Ze?-1:1;for(g._m2=Ge*g._length/(Math.abs(fe-me)-g._lBreaks),g._B.push(-g._m2*(Ce?fe:me)),Be=0;BeJ&&(J+=7,meJ&&(J+=24,me=oe&&me=oe&&ne=ut.min&&(zeut.max&&(ut.max=Ee),nt=!1)}nt&&fe.push({min:ze,max:Ee})}};for(_e=0;_e{var d=Ar(),y=ji(),z=ti().BADNUM,P=y.isArrayOrTypedArray,i=y.isDateTime,n=y.cleanNumber,a=Math.round;Y.exports=function(b,x,_){var A=b,f=_.noMultiCategory;if(P(A)&&!A.length)return"-";if(!f&&m(A))return"multicategory";if(f&&Array.isArray(A[0])){for(var k=[],w=0;wk*2}function s(b){return Math.max(1,(b-1)/1e3)}function h(b,x){for(var _=b.length,A=s(_),f=0,k=0,w={},D=0;D<_;D+=A){var E=a(D),I=b[E],M=String(I);if(!w[M]){w[M]=1;var p=typeof I;p==="boolean"?k++:(x?n(I)!==z:p==="number")?f++:p==="string"&&k++}}return k>f*2}function m(b){return P(b[0])&&P(b[1])}}),Xm=Fe((te,Y)=>{var d=ii(),y=Ar(),z=ji(),P=ti().FP_SAFE,i=as(),n=Zs(),a=Zc(),l=a.getFromId,o=a.isLinked;Y.exports={applyAutorangeOptions:C,getAutoRange:u,makePadFn:h,doAutoRange:_,findExtremes:A,concatExtremes:x};function u(T,N){var B,U,V=[],W=T._fullLayout,F=h(W,N,0),$=h(W,N,1),q=x(T,N),G=q.min,ee=q.max;if(G.length===0||ee.length===0)return z.simpleMap(N.range,N.r2l);var he=G[0].val,xe=ee[0].val;for(B=1;B0&&(Oe=_e-F(me)-$(fe),Oe>oe?Ze/Oe>J&&(Ce=me,Be=fe,J=Ze/Oe):Ze/_e>J&&(Ce={val:me.val,nopad:1},Be={val:fe.val,nopad:1},J=Ze/_e));function Ge(ct,Ae){return Math.max(ct,$(Ae))}if(he===xe){var rt=he-1,_t=he+1;if(ne)if(he===0)V=[0,1];else{var pt=(he>0?ee:G).reduce(Ge,0),gt=he/(1-Math.min(.5,pt/_e));V=he>0?[0,gt]:[gt,0]}else se?V=[Math.max(0,rt),Math.max(1,_t)]:V=[rt,_t]}else ne?(Ce.val>=0&&(Ce={val:0,nopad:1}),Be.val<=0&&(Be={val:0,nopad:1})):se&&(Ce.val-J*F(Ce)<0&&(Ce={val:0,nopad:1}),Be.val<=0&&(Be={val:1,nopad:1})),J=(Be.val-Ce.val-s(N,me.val,fe.val))/(_e-F(Ce)-$(Be)),V=[Ce.val-J*F(Ce),Be.val+J*$(Be)];return V=C(V,N),N.limitRange&&N.limitRange(),ce&&V.reverse(),z.simpleMap(V,N.l2r||Number)}function s(T,N,B){var U=0;if(T.rangebreaks)for(var V=T.locateBreaks(N,B),W=0;W0?B.ppadplus:B.ppadminus)||B.ppad||0),me=oe((T._m>0?B.ppadminus:B.ppadplus)||B.ppad||0),fe=oe(B.vpadplus||B.vpad),Ce=oe(B.vpadminus||B.vpad);if(!G){if(se=1/0,_e=-1/0,q)for(he=0;he0&&(se=xe),xe>_e&&xe-P&&(se=xe),xe>_e&&xe=Ze;he--)Oe(he);return{min:U,max:V,opts:B}}function f(T,N,B,U){w(T,N,B,U,E)}function k(T,N,B,U){w(T,N,B,U,I)}function w(T,N,B,U,V){for(var W=U.tozero,F=U.extrapad,$=!0,q=0;q=B&&(G.extrapad||!F)){$=!1;break}else V(N,G.val)&&G.pad<=B&&(F||!G.extrapad)&&(T.splice(q,1),q--)}if($){var ee=W&&N===0;T.push({val:N,pad:ee?0:B,extrapad:ee?!1:F})}}function D(T){return y(T)&&Math.abs(T)=N}function M(T,N){var B=N.autorangeoptions;return B&&B.minallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.minallowed:B&&B.clipmin!==void 0&&g(N,B.clipmin,B.clipmax)?Math.max(T,N.d2l(B.clipmin)):T}function p(T,N){var B=N.autorangeoptions;return B&&B.maxallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.maxallowed:B&&B.clipmax!==void 0&&g(N,B.clipmin,B.clipmax)?Math.min(T,N.d2l(B.clipmax)):T}function g(T,N,B){return N!==void 0&&B!==void 0?(N=T.d2l(N),B=T.d2l(B),N=q&&(W=q,B=q),F<=q&&(F=q,U=q)}}return B=M(B,N),U=p(U,N),[B,U]}}),Os=Fe((te,Y)=>{var d=ii(),y=Ar(),z=sh(),P=as(),i=ji(),n=i.strTranslate,a=cc(),l=Fp(),o=Xi(),u=Zs(),s=qd(),h=Yh(),m=ti(),b=m.ONEMAXYEAR,x=m.ONEAVGYEAR,_=m.ONEMINYEAR,A=m.ONEMAXQUARTER,f=m.ONEAVGQUARTER,k=m.ONEMINQUARTER,w=m.ONEMAXMONTH,D=m.ONEAVGMONTH,E=m.ONEMINMONTH,I=m.ONEWEEK,M=m.ONEDAY,p=M/2,g=m.ONEHOUR,C=m.ONEMIN,T=m.ONESEC,N=m.ONEMILLI,B=m.ONEMICROSEC,U=m.MINUS_SIGN,V=m.BADNUM,W={K:"zeroline"},F={K:"gridline",L:"path"},$={K:"minor-gridline",L:"path"},q={K:"tick",L:"path"},G={K:"tick",L:"text"},ee={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},he=Bf(),xe=he.MID_SHIFT,ve=he.CAP_SHIFT,ce=he.LINE_SPACING,re=he.OPPOSITE_SIDE,ge=3,ne=Y.exports={};ne.setConvert=Z0();var se=Y1(),_e=Zc(),oe=_e.idSort,J=_e.isLinked;ne.id2name=_e.id2name,ne.name2id=_e.name2id,ne.cleanId=_e.cleanId,ne.list=_e.list,ne.listIds=_e.listIds,ne.getFromId=_e.getFromId,ne.getFromTrace=_e.getFromTrace;var me=Xm();ne.getAutoRange=me.getAutoRange,ne.findExtremes=me.findExtremes;var fe=1e-4;function Ce(Ft){var Rt=(Ft[1]-Ft[0])*fe;return[Ft[0]-Rt,Ft[1]+Rt]}ne.coerceRef=function(Ft,Rt,qr,ni,oi,Gr){var si=ni.charAt(ni.length-1),Pi=qr._fullLayout._subplots[si+"axis"],yi=ni+"ref",zt={};return oi||(oi=Pi[0]||(typeof Gr=="string"?Gr:Gr[0])),Gr||(Gr=oi),Pi=Pi.concat(Pi.map(function(xr){return xr+" domain"})),zt[yi]={valType:"enumerated",values:Pi.concat(Gr?typeof Gr=="string"?[Gr]:Gr:[]),dflt:oi},i.coerce(Ft,Rt,zt,yi)},ne.getRefType=function(Ft){return Ft===void 0?Ft:Ft==="paper"?"paper":Ft==="pixel"?"pixel":/( domain)$/.test(Ft)?"domain":"range"},ne.coercePosition=function(Ft,Rt,qr,ni,oi,Gr){var si,Pi,yi=ne.getRefType(ni);if(yi!=="range")si=i.ensureNumber,Pi=qr(oi,Gr);else{var zt=ne.getFromId(Rt,ni);Gr=zt.fraction2r(Gr),Pi=qr(oi,Gr),si=zt.cleanPos}Ft[oi]=si(Pi)},ne.cleanPosition=function(Ft,Rt,qr){var ni=qr==="paper"||qr==="pixel"?i.ensureNumber:ne.getFromId(Rt,qr).cleanPos;return ni(Ft)},ne.redrawComponents=function(Ft,Rt){Rt=Rt||ne.listIds(Ft);var qr=Ft._fullLayout;function ni(oi,Gr,si,Pi){for(var yi=P.getComponentMethod(oi,Gr),zt={},xr=0;xr2e-6||((qr-Ft._forceTick0)/Ft._minDtick%1+1.000001)%1>2e-6)&&(Ft._minDtick=0))},ne.saveRangeInitial=function(Ft,Rt){for(var qr=ne.list(Ft,"",!0),ni=!1,oi=0;oiJr*.3||zt(ni)||zt(oi))){var Ri=qr.dtick/2;Ft+=Ft+Risi){var Pi=Number(qr.substr(1));Gr.exactYears>si&&Pi%12===0?Ft=ne.tickIncrement(Ft,"M6","reverse")+M*1.5:Gr.exactMonths>si?Ft=ne.tickIncrement(Ft,"M1","reverse")+M*15.5:Ft-=p;var yi=ne.tickIncrement(Ft,qr);if(yi<=ni)return yi}return Ft}ne.prepMinorTicks=function(Ft,Rt,qr){if(!Rt.minor.dtick){delete Ft.dtick;var ni=Rt.dtick&&y(Rt._tmin),oi;if(ni){var Gr=ne.tickIncrement(Rt._tmin,Rt.dtick,!0);oi=[Rt._tmin,Gr*.99+Rt._tmin*.01]}else{var si=i.simpleMap(Rt.range,Rt.r2l);oi=[si[0],.8*si[0]+.2*si[1]]}if(Ft.range=i.simpleMap(oi,Rt.l2r),Ft._isMinor=!0,ne.prepTicks(Ft,qr),ni){var Pi=y(Rt.dtick),yi=y(Ft.dtick),zt=Pi?Rt.dtick:+Rt.dtick.substring(1),xr=yi?Ft.dtick:+Ft.dtick.substring(1);Pi&&yi?_t(zt,xr)?zt===2*I&&xr===2*M&&(Ft.dtick=I):zt===2*I&&xr===3*M?Ft.dtick=I:zt===I&&!(Rt._input.minor||{}).nticks?Ft.dtick=M:pt(zt/xr,2.5)?Ft.dtick=zt/2:Ft.dtick=zt:String(Rt.dtick).charAt(0)==="M"?yi?Ft.dtick="M1":_t(zt,xr)?zt>=12&&xr===2&&(Ft.dtick="M3"):Ft.dtick=Rt.dtick:String(Ft.dtick).charAt(0)==="L"?String(Rt.dtick).charAt(0)==="L"?_t(zt,xr)||(Ft.dtick=pt(zt/xr,2.5)?Rt.dtick/2:Rt.dtick):Ft.dtick="D1":Ft.dtick==="D2"&&+Rt.dtick>1&&(Ft.dtick=1)}Ft.range=Rt.range}Rt.minor._tick0Init===void 0&&(Ft.tick0=Rt.tick0)};function _t(Ft,Rt){return Math.abs((Ft/Rt+.5)%1-.5)<.001}function pt(Ft,Rt){return Math.abs(Ft/Rt-1)<.001}ne.prepTicks=function(Ft,Rt){var qr=i.simpleMap(Ft.range,Ft.r2l,void 0,void 0,Rt);if(Ft.tickmode==="auto"||!Ft.dtick){var ni=Ft.nticks,oi;ni||(Ft.type==="category"||Ft.type==="multicategory"?(oi=Ft.tickfont?i.bigFont(Ft.tickfont.size||12):15,ni=Ft._length/oi):(oi=Ft._id.charAt(0)==="y"?40:80,ni=i.constrain(Ft._length/oi,4,9)+1),Ft._name==="radialaxis"&&(ni*=2)),Ft.minor&&Ft.minor.tickmode!=="array"||Ft.tickmode==="array"&&(ni*=100),Ft._roughDTick=Math.abs(qr[1]-qr[0])/ni,ne.autoTicks(Ft,Ft._roughDTick),Ft._minDtick>0&&Ft.dtick0?(Gr=ni-1,si=ni):(Gr=ni,si=ni);var Pi=Ft[Gr].value,yi=Ft[si].value,zt=Math.abs(yi-Pi),xr=qr||zt,Jr=0;xr>=_?zt>=_&&zt<=b?Jr=zt:Jr=x:qr===f&&xr>=k?zt>=k&&zt<=A?Jr=zt:Jr=f:xr>=E?zt>=E&&zt<=w?Jr=zt:Jr=D:qr===I&&xr>=I?Jr=I:xr>=M?Jr=M:qr===p&&xr>=p?Jr=p:qr===g&&xr>=g&&(Jr=g);var Ri;Jr>=zt&&(Jr=zt,Ri=!0);var tn=oi+Jr;if(Rt.rangebreaks&&Jr>0){for(var _n=84,Zi=0,Wi=0;Wi<_n;Wi++){var dn=(Wi+.5)/_n;Rt.maskBreaks(oi*(1-dn)+dn*tn)!==V&&Zi++}Jr*=Zi/_n,Jr||(Ft[ni].drop=!0),Ri&&zt>I&&(Jr=zt)}(Jr>0||ni===0)&&(Ft[ni].periodX=oi+Jr/2)}}ne.calcTicks=function(Ft,Rt){for(var qr=Ft.type,ni=Ft.calendar,oi=Ft.ticklabelstep,Gr=Ft.ticklabelmode==="period",si=Ft.range[0]>Ft.range[1],Pi=!Ft.ticklabelindex||i.isArrayOrTypedArray(Ft.ticklabelindex)?Ft.ticklabelindex:[Ft.ticklabelindex],yi=i.simpleMap(Ft.range,Ft.r2l,void 0,void 0,Rt),zt=yi[1]=(Ua?0:1);ea--){var fo=!ea;ea?(Ft._dtickInit=Ft.dtick,Ft._tick0Init=Ft.tick0):(Ft.minor._dtickInit=Ft.minor.dtick,Ft.minor._tick0Init=Ft.minor.tick0);var ho=ea?Ft:i.extendFlat({},Ft,Ft.minor);if(fo?ne.prepMinorTicks(ho,Ft,Rt):ne.prepTicks(ho,Rt),ho.tickmode==="array"){ea?(Zi=[],tn=nt(Ft,!fo)):(Wi=[],_n=nt(Ft,!fo));continue}if(ho.tickmode==="sync"){Zi=[],tn=Ee(Ft);continue}var Vo=Ce(yi),Ao=Vo[0],Wo=Vo[1],Wa=y(ho.dtick),ks=qr==="log"&&!(Wa||ho.dtick.charAt(0)==="L"),fs=ne.tickFirst(ho,Rt);if(ea){if(Ft._tmin=fs,fs=Wo:es<=Wo;es=ne.tickIncrement(es,xl,zt,ni)){if(ea&&rl++,ho.rangebreaks&&!zt){if(es=Jr)break}if(Zi.length>Ri||es===_l)break;_l=es;var ol={value:es};ea?(ks&&es!==(es|0)&&(ol.simpleLabel=!0),oi>1&&rl%oi&&(ol.skipLabel=!0),Zi.push(ol)):(ol.minor=!0,Wi.push(ol))}}if(!Wi||Wi.length<2)Pi=!1;else{var Gl=(Wi[1].value-Wi[0].value)*(si?-1:1);ro(Gl,Ft.tickformat)||(Pi=!1)}if(!Pi)dn=Zi;else{var ms=Zi.concat(Wi);Gr&&Zi.length&&(ms=ms.slice(1)),ms=ms.sort(function(bl,ls){return bl.value-ls.value}).filter(function(bl,ls,Bu){return ls===0||bl.value!==Bu[ls-1].value});var Bs=ms.map(function(bl,ls){return bl.minor===void 0&&!bl.skipLabel?ls:null}).filter(function(bl){return bl!==null});Bs.forEach(function(bl){Pi.map(function(ls){var Bu=bl+ls;Bu>=0&&Bu-1;Xs--){if(Zi[Xs].drop){Zi.splice(Xs,1);continue}Zi[Xs].value=Gn(Zi[Xs].value,Ft);var pl=Ft.c2p(Zi[Xs].value);(su?tu>pl-is:tuJr||icJr&&(Bu.periodX=Jr),icoi&&Rix)Rt/=x,ni=oi(10),Ft.dtick="M"+12*Kr(Rt,ni,xt);else if(Gr>D)Rt/=D,Ft.dtick="M"+Kr(Rt,1,ut);else if(Gr>M){if(Ft.dtick=Kr(Rt,M,Ft._hasDayOfWeekBreaks?[1,2,7,14]:Gt),!qr){var si=ne.getTickFormat(Ft),Pi=Ft.ticklabelmode==="period";Pi&&(Ft._rawTick0=Ft.tick0),/%[uVW]/.test(si)?Ft.tick0=i.dateTick0(Ft.calendar,2):Ft.tick0=i.dateTick0(Ft.calendar,1),Pi&&(Ft._dowTick0=Ft.tick0)}}else Gr>g?Ft.dtick=Kr(Rt,g,ut):Gr>C?Ft.dtick=Kr(Rt,C,Et):Gr>T?Ft.dtick=Kr(Rt,T,Et):(ni=oi(10),Ft.dtick=Kr(Rt,ni,xt))}else if(Ft.type==="log"){Ft.tick0=0;var yi=i.simpleMap(Ft.range,Ft.r2l);if(Ft._isMinor&&(Rt*=1.5),Rt>.7)Ft.dtick=Math.ceil(Rt);else if(Math.abs(yi[1]-yi[0])<1){var zt=1.5*Math.abs((yi[1]-yi[0])/Rt);Rt=Math.abs(Math.pow(10,yi[1])-Math.pow(10,yi[0]))/zt,ni=oi(10),Ft.dtick="L"+Kr(Rt,ni,xt)}else Ft.dtick=Rt>.3?"D2":"D1"}else Ft.type==="category"||Ft.type==="multicategory"?(Ft.tick0=0,Ft.dtick=Math.ceil(Math.max(Rt,1))):Rn(Ft)?(Ft.tick0=0,ni=1,Ft.dtick=Kr(Rt,ni,mr)):(Ft.tick0=0,ni=oi(10),Ft.dtick=Kr(Rt,ni,xt));if(Ft.dtick===0&&(Ft.dtick=1),!y(Ft.dtick)&&typeof Ft.dtick!="string"){var xr=Ft.dtick;throw Ft.dtick=1,"ax.dtick error: "+String(xr)}};function ri(Ft){var Rt=Ft.dtick;if(Ft._tickexponent=0,!y(Rt)&&typeof Rt!="string"&&(Rt=1),(Ft.type==="category"||Ft.type==="multicategory")&&(Ft._tickround=null),Ft.type==="date"){var qr=Ft.r2l(Ft.tick0),ni=Ft.l2r(qr).replace(/(^-|i)/g,""),oi=ni.length;if(String(Rt).charAt(0)==="M")oi>10||ni.substr(5)!=="01-01"?Ft._tickround="d":Ft._tickround=+Rt.substr(1)%12===0?"y":"m";else if(Rt>=M&&oi<=10||Rt>=M*15)Ft._tickround="d";else if(Rt>=C&&oi<=16||Rt>=g)Ft._tickround="M";else if(Rt>=T&&oi<=19||Rt>=C)Ft._tickround="S";else{var Gr=Ft.l2r(qr+Rt).replace(/^-/,"").length;Ft._tickround=Math.max(oi,Gr)-20,Ft._tickround<0&&(Ft._tickround=4)}}else if(y(Rt)||Rt.charAt(0)==="L"){var si=Ft.range.map(Ft.r2d||Number);y(Rt)||(Rt=Number(Rt.substr(1))),Ft._tickround=2-Math.floor(Math.log(Rt)/Math.LN10+.01);var Pi=Math.max(Math.abs(si[0]),Math.abs(si[1])),yi=Math.floor(Math.log(Pi)/Math.LN10+.01),zt=Ft.minexponent===void 0?3:Ft.minexponent;Math.abs(yi)>zt&&(at(Ft.exponentformat)&&Ft.exponentformat!=="SI extended"&&!ht(yi)||at(Ft.exponentformat)&&Ft.exponentformat==="SI extended"&&!At(yi)?Ft._tickexponent=3*Math.round((yi-1)/3):Ft._tickexponent=yi)}else Ft._tickround=null}ne.tickIncrement=function(Ft,Rt,qr,ni){var oi=qr?-1:1;if(y(Rt))return i.increment(Ft,oi*Rt);var Gr=Rt.charAt(0),si=oi*Number(Rt.substr(1));if(Gr==="M")return i.incrementMonth(Ft,si,ni);if(Gr==="L")return Math.log(Math.pow(10,Ft)+si)/Math.LN10;if(Gr==="D"){var Pi=Rt==="D2"?gr:Jt,yi=Ft+oi*.01,zt=i.roundUp(i.mod(yi,1),Pi,qr);return Math.floor(yi)+Math.log(d.round(Math.pow(10,zt),1))/Math.LN10}throw"unrecognized dtick "+String(Rt)},ne.tickFirst=function(Ft,Rt){var qr=Ft.r2l||Number,ni=i.simpleMap(Ft.range,qr,void 0,void 0,Rt),oi=ni[1]=0&&dn<=Ft._length?Wi:null};if(Gr&&i.isArrayOrTypedArray(Ft.ticktext)){var Jr=i.simpleMap(Ft.range,Ft.r2l),Ri=(Math.abs(Jr[1]-Jr[0])-(Ft._lBreaks||0))/1e4;for(zt=0;zt"+Pi;else{var zt=Xn(Ft),xr=Ft._trueSide||Ft.side;(!zt&&xr==="top"||zt&&xr==="bottom")&&(si+="
")}Rt.text=si}function mi(Ft,Rt,qr,ni,oi){var Gr=Ft.dtick,si=Rt.x,Pi=Ft.tickformat,yi=typeof Gr=="string"&&Gr.charAt(0);if(oi==="never"&&(oi=""),ni&&yi!=="L"&&(Gr="L3",yi="L"),Pi||yi==="L")Rt.text=Kt(Math.pow(10,si),Ft,oi,ni);else if(y(Gr)||yi==="D"&&(Ft.minorloglabels==="complete"||i.mod(si+.01,1)<.1)){Ft.minorloglabels==="complete"&&!(i.mod(si+.01,1)<.1)&&(Rt.fontSize*=.75);var zt=Math.pow(10,si).toExponential(0),xr=zt.split("e"),Jr=+xr[1],Ri=Math.abs(Jr),tn=Ft.exponentformat;tn==="power"||at(tn)&&tn!=="SI extended"&&ht(Jr)||at(tn)&&tn==="SI extended"&&At(Jr)?(Rt.text=xr[0],Ri>0&&(Rt.text+="x10"),Rt.text==="1x10"&&(Rt.text="10"),Jr!==0&&Jr!==1&&(Rt.text+=""+(Jr>0?"":U)+Ri+""),Rt.fontSize*=1.25):(tn==="e"||tn==="E")&&Ri>2?Rt.text=xr[0]+tn+(Jr>0?"+":U)+Ri:(Rt.text=Kt(Math.pow(10,si),Ft,"","fakehover"),Gr==="D1"&&Ft._id.charAt(0)==="y"&&(Rt.dy-=Rt.fontSize/6))}else if(yi==="D")Rt.text=Ft.minorloglabels==="none"?"":String(Math.round(Math.pow(10,i.mod(si,1)))),Rt.fontSize*=.75;else throw"unrecognized dtick "+String(Gr);if(Ft.dtick==="D1"){var _n=String(Rt.text).charAt(0);(_n==="0"||_n==="1")&&(Ft._id.charAt(0)==="y"?Rt.dx-=Rt.fontSize/4:(Rt.dy+=Rt.fontSize/2,Rt.dx+=(Ft.range[1]>Ft.range[0]?1:-1)*Rt.fontSize*(si<0?.5:.25)))}}function Ot(Ft,Rt){var qr=Ft._categories[Math.round(Rt.x)];qr===void 0&&(qr=""),Rt.text=String(qr)}function Je(Ft,Rt,qr){var ni=Math.round(Rt.x),oi=Ft._categories[ni]||[],Gr=oi[1]===void 0?"":String(oi[1]),si=oi[0]===void 0?"":String(oi[0]);qr?Rt.text=si+" - "+Gr:(Rt.text=Gr,Rt.text2=si)}function ot(Ft,Rt,qr,ni,oi){oi==="never"?oi="":Ft.showexponent==="all"&&Math.abs(Rt.x/Ft.dtick)<1e-6&&(oi="hide"),Rt.text=Kt(Rt.x,Ft,oi,ni)}function De(Ft,Rt,qr,ni,oi){if(Ft.thetaunit==="radians"&&!qr){var Gr=Rt.x/180;if(Gr===0)Rt.text="0";else{var si=ye(Gr);if(si[1]>=100)Rt.text=Kt(i.deg2rad(Rt.x),Ft,oi,ni);else{var Pi=Rt.x<0;si[1]===1?si[0]===1?Rt.text="π":Rt.text=si[0]+"π":Rt.text=["",si[0],"","⁄","",si[1],"","π"].join(""),Pi&&(Rt.text=U+Rt.text)}}}else Rt.text=Kt(Rt.x,Ft,oi,ni)}function ye(Ft){function Rt(Pi,yi){return Math.abs(Pi-yi)<=1e-6}function qr(Pi,yi){return Rt(yi,0)?Pi:qr(yi,Pi%yi)}function ni(Pi){for(var yi=1;!Rt(Math.round(Pi*yi)/yi,Pi);)yi*=10;return yi}var oi=ni(Ft),Gr=Ft*oi,si=Math.abs(qr(Gr,oi));return[Math.round(Gr/si),Math.round(oi/si)]}var Pe=["f","p","n","μ","m","","k","M","G","T"],He=["q","r","y","z","a",...Pe,"P","E","Z","Y","R","Q"],at=Ft=>["SI","SI extended","B"].includes(Ft);function ht(Ft){return Ft>14||Ft<-15}function At(Ft){return Ft>32||Ft<-30}function Wt(Ft,Rt){return at(Rt)?!!(Rt==="SI extended"&&At(Ft)||Rt!=="SI extended"&&ht(Ft)):!1}function Kt(Ft,Rt,qr,ni){var oi=Ft<0,Gr=Rt._tickround,si=qr||Rt.exponentformat||"B",Pi=Rt._tickexponent,yi=ne.getTickFormat(Rt),zt=Rt.separatethousands;if(ni){var xr={exponentformat:si,minexponent:Rt.minexponent,dtick:Rt.showexponent==="none"?Rt.dtick:y(Ft)&&Math.abs(Ft)||1,range:Rt.showexponent==="none"?Rt.range.map(Rt.r2d):[0,Ft||1]};ri(xr),Gr=(Number(xr._tickround)||0)+4,Pi=xr._tickexponent,Rt.hoverformat&&(yi=Rt.hoverformat)}if(yi)return Rt._numFormat(yi)(Ft).replace(/-/g,U);var Jr=Math.pow(10,-Gr)/2;if(si==="none"&&(Pi=0),Ft=Math.abs(Ft),Ft"+_n+"":si==="B"&&Pi===9?Ft+="B":at(si)&&(Ft+=si==="SI extended"?He[Pi/3+10]:Pe[Pi/3+5])}return oi?U+Ft:Ft}ne.getTickFormat=function(Ft){var Rt;function qr(yi){return typeof yi!="string"?yi:Number(yi.replace("M",""))*D}function ni(yi,zt){var xr=["L","D"];if(typeof yi==typeof zt){if(typeof yi=="number")return yi-zt;var Jr=xr.indexOf(yi.charAt(0)),Ri=xr.indexOf(zt.charAt(0));return Jr===Ri?Number(yi.replace(/(L|D)/g,""))-Number(zt.replace(/(L|D)/g,"")):Jr-Ri}else return typeof yi=="number"?1:-1}function oi(yi,zt,xr){var Jr=xr||function(_n){return _n},Ri=zt[0],tn=zt[1];return(!Ri&&typeof Ri!="number"||Jr(Ri)<=Jr(yi))&&(!tn&&typeof tn!="number"||Jr(tn)>=Jr(yi))}function Gr(yi,zt){var xr=zt[0]===null,Jr=zt[1]===null,Ri=ni(yi,zt[0])>=0,tn=ni(yi,zt[1])<=0;return(xr||Ri)&&(Jr||tn)}var si,Pi;if(Ft.tickformatstops&&Ft.tickformatstops.length>0)switch(Ft.type){case"date":case"linear":{for(Rt=0;Rt=0&&oi.unshift(oi.splice(xr,1).shift())}});var Pi={false:{left:0,right:0}};return i.syncOrAsync(oi.map(function(yi){return function(){if(yi){var zt=ne.getFromId(Ft,yi);qr||(qr={}),qr.axShifts=Pi,qr.overlayingShiftedAx=si;var xr=ne.drawOne(Ft,zt,qr);return zt._shiftPusher&&Mn(zt,zt._fullDepth||0,Pi,!0),zt._r=zt.range.slice(),zt._rl=i.simpleMap(zt._r,zt.r2l),xr}}}))},ne.drawOne=function(Ft,Rt,qr){qr=qr||{};var ni=qr.axShifts||{},oi=qr.overlayingShiftedAx||[],Gr,si,Pi;Rt.setScale();var yi=Ft._fullLayout,zt=Rt._id,xr=zt.charAt(0),Jr=ne.counterLetter(zt),Ri=yi._plots[Rt._mainSubplot],tn=Rt.zerolinelayer==="above traces";if(!Ri)return;if(Rt._shiftPusher=Rt.autoshift||oi.indexOf(Rt._id)!==-1||oi.indexOf(Rt.overlaying)!==-1,Rt._shiftPusher&Rt.anchor==="free"){var _n=Rt.linewidth/2||0;Rt.ticks==="inside"&&(_n+=Rt.ticklen),Mn(Rt,_n,ni,!0),Mn(Rt,Rt.shift||0,ni,!1)}(qr.skipTitle!==!0||Rt._shift===void 0)&&(Rt._shift=Ha(Rt,ni));var Zi=Ri[xr+"axislayer"],Wi=Rt._mainLinePosition,dn=Wi+=Rt._shift,Ua=Rt._mainMirrorPosition,ea=Rt._vals=ne.calcTicks(Rt),fo=[Rt.mirror,dn,Ua].join("_");for(Gr=0;Gr0?Ll.bottom-Bu:0,ic))));var pc=0,Ah=0;if(Rt._shiftPusher&&(pc=Math.max(ic,Ll.height>0?bl==="l"?Bu-Ll.left:Ll.right-Bu:0),Rt.title.text!==yi._dfltTitle[xr]&&(Ah=(Rt._titleStandoff||0)+(Rt._titleScoot||0),bl==="l"&&(Ah+=Sn(Rt))),Rt._fullDepth=Math.max(pc,Ah)),Rt.automargin){Hl={x:0,y:0,r:0,l:0,t:0,b:0};var uh=[0,1],gh=typeof Rt._shift=="number"?Rt._shift:0;if(xr==="x"){if(bl==="b"?Hl[bl]=Rt._depth:(Hl[bl]=Rt._depth=Math.max(Ll.width>0?Bu-Ll.top:0,ic),uh.reverse()),Ll.width>0){var Qf=Ll.right-(Rt._offset+Rt._length);Qf>0&&(Hl.xr=1,Hl.r=Qf);var Ff=Rt._offset-Ll.left;Ff>0&&(Hl.xl=0,Hl.l=Ff)}}else if(bl==="l"?(Rt._depth=Math.max(Ll.height>0?Bu-Ll.left:0,ic),Hl[bl]=Rt._depth-gh):(Rt._depth=Math.max(Ll.height>0?Ll.right-Bu:0,ic),Hl[bl]=Rt._depth+gh,uh.reverse()),Ll.height>0){var Vl=Ll.bottom-(Rt._offset+Rt._length);Vl>0&&(Hl.yb=0,Hl.b=Vl);var Kc=Rt._offset-Ll.top;Kc>0&&(Hl.yt=1,Hl.t=Kc)}Hl[Jr]=Rt.anchor==="free"?Rt.position:Rt._anchorAxis.domain[uh[0]],Rt.title.text!==yi._dfltTitle[xr]&&(Hl[bl]+=Sn(Rt)+(Rt.title.standoff||0)),Rt.mirror&&Rt.anchor!=="free"&&(lu={x:0,y:0,r:0,l:0,t:0,b:0},lu[ls]=Rt.linewidth,Rt.mirror&&Rt.mirror!==!0&&(lu[ls]+=ic),Rt.mirror===!0||Rt.mirror==="ticks"?lu[Jr]=Rt._anchorAxis.domain[uh[1]]:(Rt.mirror==="all"||Rt.mirror==="allticks")&&(lu[Jr]=[Rt._counterDomainMin,Rt._counterDomainMax][uh[1]]))}pu&&(hu=P.getComponentMethod("rangeslider","autoMarginOpts")(Ft,Rt)),typeof Rt.automargin=="string"&&(hr(Hl,Rt.automargin),hr(lu,Rt.automargin)),z.autoMargin(Ft,_r(Rt),Hl),z.autoMargin(Ft,Cr(Rt),lu),z.autoMargin(Ft,fi(Rt),hu)}),i.syncOrAsync(Ls)}};function hr(Ft,Rt){if(Ft){var qr=Object.keys(ee).reduce(function(ni,oi){return Rt.indexOf(oi)!==-1&&ee[oi].forEach(function(Gr){ni[Gr]=1}),ni},{});Object.keys(Ft).forEach(function(ni){qr[ni]||(ni.length===1?Ft[ni]=0:delete Ft[ni])})}}function zr(Ft,Rt){var qr=[],ni,oi=function(Gr,si){var Pi=Gr.xbnd[si];Pi!==null&&qr.push(i.extendFlat({},Gr,{x:Pi}))};if(Rt.length){for(ni=0;niFt.range[1],Pi=Ft.ticklabelposition&&Ft.ticklabelposition.indexOf("inside")!==-1,yi=!Pi;if(qr){var zt=si?-1:1;qr=qr*zt}if(ni){var xr=Ft.side,Jr=Pi&&(xr==="top"||xr==="left")||yi&&(xr==="bottom"||xr==="right")?1:-1;ni=ni*Jr}return Ft._id.charAt(0)==="x"?function(Ri){return n(oi+Ft._offset+Ft.l2p(un(Ri))+qr,Gr+ni)}:function(Ri){return n(Gr+ni,oi+Ft._offset+Ft.l2p(un(Ri))+qr)}};function un(Ft){return Ft.periodX!==void 0?Ft.periodX:Ft.x}function cn(Ft){var Rt=Ft.ticklabelposition||"",qr=Ft.tickson||"",ni=function(_n){return Rt.indexOf(_n)!==-1},oi=ni("top"),Gr=ni("left"),si=ni("right"),Pi=ni("bottom"),yi=ni("inside"),zt=qr!=="boundaries"&&(Pi||Gr||oi||si);if(!zt&&!yi)return[0,0];var xr=Ft.side,Jr=zt?(Ft.tickwidth||0)/2:0,Ri=ge,tn=Ft.tickfont?Ft.tickfont.size:12;return(Pi||oi)&&(Jr+=tn*ve,Ri+=(Ft.linewidth||0)/2),(Gr||si)&&(Jr+=(Ft.linewidth||0)/2,Ri+=ge),yi&&xr==="top"&&(Ri-=tn*(1-ve)),(Gr||oi)&&(Jr=-Jr),(xr==="bottom"||xr==="right")&&(Ri=-Ri),[zt?Jr:0,yi?Ri:0]}ne.makeTickPath=function(Ft,Rt,qr,ni){ni||(ni={});var oi=ni.minor;if(oi&&!Ft.minor)return"";var Gr=ni.len!==void 0?ni.len:oi?Ft.minor.ticklen:Ft.ticklen,si=Ft._id.charAt(0),Pi=(Ft.linewidth||1)/2;return si==="x"?"M0,"+(Rt+Pi*qr)+"v"+Gr*qr:"M"+(Rt+Pi*qr)+",0h"+Gr*qr},ne.makeLabelFns=function(Ft,Rt,qr){var ni=Ft.ticklabelposition||"",oi=Ft.tickson||"",Gr=function(es){return ni.indexOf(es)!==-1},si=Gr("top"),Pi=Gr("left"),yi=Gr("right"),zt=Gr("bottom"),xr=oi!=="boundaries"&&(zt||Pi||si||yi),Jr=Gr("inside"),Ri=ni==="inside"&&Ft.ticks==="inside"||!Jr&&Ft.ticks==="outside"&&oi!=="boundaries",tn=0,_n=0,Zi=Ri?Ft.ticklen:0;if(Jr?Zi*=-1:xr&&(Zi=0),Ri&&(tn+=Zi,qr)){var Wi=i.deg2rad(qr);tn=Zi*Math.cos(Wi)+1,_n=Zi*Math.sin(Wi)}Ft.showticklabels&&(Ri||Ft.showline)&&(tn+=.2*Ft.tickfont.size),tn+=(Ft.linewidth||1)/2*(Jr?-1:1);var dn={labelStandoff:tn,labelShift:_n},Ua,ea,fo,ho,Vo=0,Ao=Ft.side,Wo=Ft._id.charAt(0),Wa=Ft.tickangle,ks;if(Wo==="x")ks=!Jr&&Ao==="bottom"||Jr&&Ao==="top",ho=ks?1:-1,Jr&&(ho*=-1),Ua=_n*ho,ea=Rt+tn*ho,fo=ks?1:-.2,Math.abs(Wa)===90&&(Jr?fo+=xe:Wa===-90&&Ao==="bottom"?fo=ve:Wa===90&&Ao==="top"?fo=xe:fo=.5,Vo=xe/2*(Wa/90)),dn.xFn=function(es){return es.dx+Ua+Vo*es.fontSize},dn.yFn=function(es){return es.dy+ea+es.fontSize*fo},dn.anchorFn=function(es,rl){if(xr){if(Pi)return"end";if(yi)return"start"}return!y(rl)||rl===0||rl===180?"middle":rl*ho<0!==Jr?"end":"start"},dn.heightFn=function(es,rl,ds){return rl<-60||rl>60?-.5*ds:Ft.side==="top"!==Jr?-ds:0};else if(Wo==="y"){if(ks=!Jr&&Ao==="left"||Jr&&Ao==="right",ho=ks?1:-1,Jr&&(ho*=-1),Ua=tn,ea=_n*ho,fo=0,!Jr&&Math.abs(Wa)===90&&(Wa===-90&&Ao==="left"||Wa===90&&Ao==="right"?fo=ve:fo=.5),Jr){var fs=y(Wa)?+Wa:0;if(fs!==0){var _l=i.deg2rad(fs);Vo=Math.abs(Math.sin(_l))*ve*ho,fo=0}}dn.xFn=function(es){return es.dx+Rt-(Ua+es.fontSize*fo)*ho+Vo*es.fontSize},dn.yFn=function(es){return es.dy+ea+es.fontSize*xe},dn.anchorFn=function(es,rl){return y(rl)&&Math.abs(rl)===90?"middle":ks?"end":"start"},dn.heightFn=function(es,rl,ds){return Ft.side==="right"&&(rl*=-1),rl<-30?-ds:rl<30?-.5*ds:0}}return dn};function yn(Ft){return[Ft.text,Ft.x,Ft.axInfo,Ft.font,Ft.fontSize,Ft.fontColor].join("_")}ne.drawTicks=function(Ft,Rt,qr){qr=qr||{};var ni=Rt._id+"tick",oi=[].concat(Rt.minor&&Rt.minor.ticks?qr.vals.filter(function(si){return si.minor&&!si.noTick}):[]).concat(Rt.ticks?qr.vals.filter(function(si){return!si.minor&&!si.noTick}):[]),Gr=qr.layer.selectAll("path."+ni).data(oi,yn);Gr.exit().remove(),Gr.enter().append("path").classed(ni,1).classed("ticks",1).classed("crisp",qr.crisp!==!1).each(function(si){return o.stroke(d.select(this),si.minor?Rt.minor.tickcolor:Rt.tickcolor)}).style("stroke-width",function(si){return u.crispRound(Ft,si.minor?Rt.minor.tickwidth:Rt.tickwidth,1)+"px"}).attr("d",qr.path).style("display",null),sa(Rt,[q]),Gr.attr("transform",qr.transFn)},ne.drawGrid=function(Ft,Rt,qr){if(qr=qr||{},Rt.tickmode!=="sync"){var ni=Rt._id+"grid",oi=Rt.minor&&Rt.minor.showgrid,Gr=oi?qr.vals.filter(function(dn){return dn.minor}):[],si=Rt.showgrid?qr.vals.filter(function(dn){return!dn.minor}):[],Pi=qr.counterAxis;if(Pi&&ne.shouldShowZeroLine(Ft,Rt,Pi))for(var yi=Rt.tickmode==="array",zt=0;zt=0;_n--){var Zi=_n?Ri:tn;if(Zi){var Wi=Zi.selectAll("path."+ni).data(_n?si:Gr,yn);Wi.exit().remove(),Wi.enter().append("path").classed(ni,1).classed("crisp",qr.crisp!==!1),Wi.attr("transform",qr.transFn).attr("d",qr.path).each(function(dn){return o.stroke(d.select(this),dn.minor?Rt.minor.gridcolor:Rt.gridcolor||"#ddd")}).style("stroke-dasharray",function(dn){return u.dashStyle(dn.minor?Rt.minor.griddash:Rt.griddash,dn.minor?Rt.minor.gridwidth:Rt.gridwidth)}).style("stroke-width",function(dn){return(dn.minor?Jr:Rt._gw)+"px"}).style("display",null),typeof qr.path=="function"&&Wi.attr("d",qr.path)}}sa(Rt,[F,$])}},ne.drawZeroLine=function(Ft,Rt,qr){qr=qr||qr;var ni=Rt._id+"zl",oi=ne.shouldShowZeroLine(Ft,Rt,qr.counterAxis),Gr=qr.layer.selectAll("path."+ni).data(oi?[{x:0,id:Rt._id}]:[]);Gr.exit().remove(),Gr.enter().append("path").classed(ni,1).classed("zl",1).classed("crisp",qr.crisp!==!1).each(function(){qr.layer.selectAll("path").sort(function(si,Pi){return oe(si.id,Pi.id)})}),Gr.attr("transform",qr.transFn).attr("d",qr.path).call(o.stroke,Rt.zerolinecolor||o.defaultLine).style("stroke-width",u.crispRound(Ft,Rt.zerolinewidth,Rt._gw||1)+"px").style("display",null),sa(Rt,[W])},ne.drawLabels=function(Ft,Rt,qr){qr=qr||{};var ni=Ft._fullLayout,oi=Rt._id,Gr=Rt.zerolinelayer==="above traces",si=qr.cls||oi+"tick",Pi=qr.vals.filter(function(ms){return ms.text}),yi=qr.labelFns,zt=qr.secondary?0:Rt.tickangle,xr=(Rt._prevTickAngles||{})[si],Jr=qr.layer.selectAll("g."+si).data(Rt.showticklabels?Pi:[],yn),Ri=[];Jr.enter().append("g").classed(si,1).append("text").attr("text-anchor","middle").each(function(ms){var Bs=d.select(this),No=Ft._promises.length;Bs.call(a.positionText,yi.xFn(ms),yi.yFn(ms)).call(u.font,{family:ms.font,size:ms.fontSize,color:ms.fontColor,weight:ms.fontWeight,style:ms.fontStyle,variant:ms.fontVariant,textcase:ms.fontTextcase,lineposition:ms.fontLineposition,shadow:ms.fontShadow}).text(ms.text).call(a.convertToTspans,Ft),Ft._promises[No]?Ri.push(Ft._promises.pop().then(function(){tn(Bs,zt)})):tn(Bs,zt)}),sa(Rt,[G]),Jr.exit().remove(),qr.repositionOnUpdate&&Jr.each(function(ms){d.select(this).select("text").call(a.positionText,yi.xFn(ms),yi.yFn(ms))});function tn(ms,Bs){ms.each(function(No){var Es=d.select(this),Il=Es.select(".text-math-group"),Jl=yi.anchorFn(No,Bs),ou=qr.transFn.call(Es.node(),No)+(y(Bs)&&+Bs!=0?" rotate("+Bs+","+yi.xFn(No)+","+(yi.yFn(No)-No.fontSize/2)+")":""),Gs=a.lineCount(Es),$a=ce*No.fontSize,So=yi.heightFn(No,y(Bs)?+Bs:0,(Gs-1)*$a);if(So&&(ou+=n(0,So)),Il.empty()){var Xs=Es.select("text");Xs.attr({transform:ou,"text-anchor":Jl}),Xs.style("display",null),Rt._adjustTickLabelsOverflow&&Rt._adjustTickLabelsOverflow()}else{var su=u.bBox(Il.node()).width,is=su*{end:-.5,start:.5}[Jl];Il.attr("transform",ou+n(is,0))}})}Rt._adjustTickLabelsOverflow=function(){var ms=Rt.ticklabeloverflow;if(!(!ms||ms==="allow")){var Bs=ms.indexOf("hide")!==-1,No=Rt._id.charAt(0)==="x",Es=0,Il=No?Ft._fullLayout.width:Ft._fullLayout.height;if(ms.indexOf("domain")!==-1){var Jl=i.simpleMap(Rt.range,Rt.r2l);Es=Rt.l2p(Jl[0])+Rt._offset,Il=Rt.l2p(Jl[1])+Rt._offset}var ou=Math.min(Es,Il),Gs=Math.max(Es,Il),$a=Rt.side,So=1/0,Xs=-1/0;Jr.each(function(pl){var Nl=d.select(this),Gu=Nl.select(".text-math-group");if(Gu.empty()){var bo=u.bBox(Nl.node()),Ls=0;No?(bo.right>Gs||bo.leftGs||bo.top+(Rt.tickangle?0:pl.fontSize/4)Rt["_visibleLabelMin_"+Jl._id]?Nl.style("display","none"):Gs.K==="tick"&&!ou&&Nl.node().style.display!=="none"&&Nl.style("display",null)})})})})},tn(Jr,xr+1?xr:zt);function _n(){return Ri.length&&Promise.all(Ri)}var Zi=null;function Wi(){if(tn(Jr,zt),Pi.length&&Rt.autotickangles&&(Rt.type!=="log"||String(Rt.dtick).charAt(0)!=="D")){Zi=Rt.autotickangles[0];var ms=0,Bs=[],No,Es=1;Jr.each(function(Hl){ms=Math.max(ms,Hl.fontSize);var lu=Rt.l2p(Hl.x),hu=sr(this),pc=u.bBox(hu.node());Es=Math.max(Es,a.lineCount(hu)),Bs.push({top:0,bottom:10,height:10,left:lu-pc.width/2,right:lu+pc.width/2+2,width:pc.width+2})});var Il=(Rt.tickson==="boundaries"||Rt.showdividers)&&!qr.secondary,Jl=Pi.length,ou=Math.abs((Pi[Jl-1].x-Pi[0].x)*Rt._m)/(Jl-1),Gs=Il?ou/2:ou,$a=Il?Rt.ticklen:ms*1.25*Es,So=Math.sqrt(Math.pow(Gs,2)+Math.pow($a,2)),Xs=Gs/So,su=Rt.autotickangles.map(function(Hl){return Hl*Math.PI/180}),is=su.find(function(Hl){return Math.abs(Math.cos(Hl))<=Xs});is===void 0&&(is=su.reduce(function(Hl,lu){return Math.abs(Math.cos(Hl))xl*ds&&(_l=ds,Wa[Wo]=ks[Wo]=es[Wo])}var ol=Math.abs(_l-fs);ol-ho>0?(ol-=ho,ho*=1+ho/ol):ho=0,Rt._id.charAt(0)!=="y"&&(ho=-ho),Wa[Ao]=ea.p2r(ea.r2p(ks[Ao])+Vo*ho),ea.autorange==="min"||ea.autorange==="max reversed"?(Wa[0]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0):(ea.autorange==="max"||ea.autorange==="min reversed")&&(Wa[1]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0),ni._insideTickLabelsUpdaterange[ea._name+".range"]=Wa}var Gl=i.syncOrAsync(dn);return Gl&&Gl.then&&Ft._promises.push(Gl),Gl};function Wn(Ft,Rt,qr){var ni=Rt._id+"divider",oi=qr.vals,Gr=qr.layer.selectAll("path."+ni).data(oi,yn);Gr.exit().remove(),Gr.enter().insert("path",":first-child").classed(ni,1).classed("crisp",1).call(o.stroke,Rt.dividercolor).style("stroke-width",u.crispRound(Ft,Rt.dividerwidth,1)+"px"),Gr.attr("transform",qr.transFn).attr("d",qr.path)}ne.getPxPosition=function(Ft,Rt){var qr=Ft._fullLayout._size,ni=Rt._id.charAt(0),oi=Rt.side,Gr;if(Rt.anchor!=="free"?Gr=Rt._anchorAxis:ni==="x"?Gr={_offset:qr.t+(1-(Rt.position||0))*qr.h,_length:0}:ni==="y"&&(Gr={_offset:qr.l+(Rt.position||0)*qr.w+Rt._shift,_length:0}),oi==="top"||oi==="left")return Gr._offset;if(oi==="bottom"||oi==="right")return Gr._offset+Gr._length};function Sn(Ft){var Rt=Ft.title.font.size,qr=(Ft.title.text.match(a.BR_TAG_ALL)||[]).length;return Ft.title.hasOwnProperty("standoff")?Rt*(ve+qr*ce):qr?Rt*(qr+1)*ce:Rt}function fn(Ft,Rt){var qr=Ft._fullLayout,ni=Rt._id,oi=ni.charAt(0),Gr=Rt.title.font.size,si,Pi=(Rt.title.text.match(a.BR_TAG_ALL)||[]).length;if(Rt.title.hasOwnProperty("standoff"))Rt.side==="bottom"||Rt.side==="right"?si=Rt._depth+Rt.title.standoff+Gr*ve:(Rt.side==="top"||Rt.side==="left")&&(si=Rt._depth+Rt.title.standoff+Gr*(xe+Pi*ce));else{var yi=Xn(Rt);if(Rt.type==="multicategory")si=Rt._depth;else{var zt=1.5*Gr;yi&&(zt=.5*Gr,Rt.ticks==="outside"&&(zt+=Rt.ticklen)),si=10+zt+(Rt.linewidth?Rt.linewidth-1:0)}yi||(oi==="x"?si+=Rt.side==="top"?Gr*(Rt.showticklabels?1:0):Gr*(Rt.showticklabels?1.5:.5):si+=Rt.side==="right"?Gr*(Rt.showticklabels?1:.5):Gr*(Rt.showticklabels?.5:0))}var xr=ne.getPxPosition(Ft,Rt),Jr,Ri,tn;oi==="x"?(Ri=Rt._offset+Rt._length/2,tn=Rt.side==="top"?xr-si:xr+si):(tn=Rt._offset+Rt._length/2,Ri=Rt.side==="right"?xr+si:xr-si,Jr={rotate:"-90",offset:0});var _n;if(Rt.type!=="multicategory"){var Zi=Rt._selections[Rt._id+"tick"];if(_n={selection:Zi,side:Rt.side},Zi&&Zi.node()&&Zi.node().parentNode){var Wi=u.getTranslate(Zi.node().parentNode);_n.offsetLeft=Wi.x,_n.offsetTop=Wi.y}Rt.title.hasOwnProperty("standoff")&&(_n.pad=0)}return Rt._titleStandoff=si,l.draw(Ft,ni+"title",{propContainer:Rt,propName:Rt._name+".title.text",placeholder:qr._dfltTitle[oi],avoid:_n,transform:Jr,attributes:{x:Ri,y:tn,"text-anchor":"middle"}})}ne.shouldShowZeroLine=function(Ft,Rt,qr){var ni=i.simpleMap(Rt.range,Rt.r2l);return ni[0]*ni[1]<=0&&Rt.zeroline&&(Rt.type==="linear"||Rt.type==="-")&&!(Rt.rangebreaks&&Rt.maskBreaks(0)===V)&&(ga(Rt,0)||!na(Ft,Rt,qr,ni)||Zt(Ft,Rt))},ne.clipEnds=function(Ft,Rt){return Rt.filter(function(qr){return ga(Ft,qr.x)})};function ga(Ft,Rt){var qr=Ft.l2p(Rt);return qr>1&&qr1)for(oi=1;oi=oi.min&&Ft=B:/%L/.test(Rt)?Ft>=N:/%[SX]/.test(Rt)?Ft>=T:/%M/.test(Rt)?Ft>=C:/%[HI]/.test(Rt)?Ft>=g:/%p/.test(Rt)?Ft>=p:/%[Aadejuwx]/.test(Rt)?Ft>=M:/%[UVW]/.test(Rt)?Ft>=I:/%[Bbm]/.test(Rt)?Ft>=E:/%[q]/.test(Rt)?Ft>=k:/%[Yy]/.test(Rt)?Ft>=_:!0}}),w4=Fe((te,Y)=>{Y.exports=function(d,y,z){var P,i;if(z){var n=y==="reversed"||y==="min reversed"||y==="max reversed";P=z[n?1:0],i=z[n?0:1]}var a=d("autorangeoptions.minallowed",i===null?P:void 0),l=d("autorangeoptions.maxallowed",P===null?i:void 0);a===void 0&&d("autorangeoptions.clipmin"),l===void 0&&d("autorangeoptions.clipmax"),d("autorangeoptions.include")}}),ow=Fe((te,Y)=>{var d=w4();Y.exports=function(y,z,P,i){var n=z._template||{},a=z.type||n.type||"-";P("minallowed"),P("maxallowed");var l=P("range");if(!l){var o;!i.noInsiderange&&a!=="log"&&(o=P("insiderange"),o&&(o[0]===null||o[1]===null)&&(z.insiderange=!1,o=void 0),o&&(l=P("range",o)))}var u=z.getAutorangeDflt(l,i),s=P("autorange",u),h;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(s==="reversed"||s===!0)||l[0]!==null&&(s==="min"||s==="max reversed")||l[1]!==null&&(s==="max"||s==="min reversed"))&&(l=void 0,delete z.range,z.autorange=!0,h=!0),h||(u=z.getAutorangeDflt(l,i),s=P("autorange",u)),s&&(d(P,s,l),(a==="linear"||a==="-")&&P("rangemode")),z.cleanRange()}}),s8=Fe((te,Y)=>{var d={left:0,top:0};Y.exports=y;function y(P,i,n){i=i||P.currentTarget||P.srcElement,Array.isArray(n)||(n=[0,0]);var a=P.clientX||0,l=P.clientY||0,o=z(i);return n[0]=a-o.left,n[1]=l-o.top,n}function z(P){return P===window||P===document||P===document.body?d:P.getBoundingClientRect()}}),sw=Fe((te,Y)=>{var d=Qu();function y(){var z=!1;try{var P=Object.defineProperty({},"passive",{get:function(){z=!0}});window.addEventListener("test",null,P),window.removeEventListener("test",null,P)}catch{z=!1}return z}Y.exports=d&&y()}),lw=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){var n=(d-z)/(P-z),a=n+y/(P-z),l=(n+a)/2;return i==="left"||i==="bottom"?n:i==="center"||i==="middle"?l:i==="right"||i==="top"?a:n<2/3-l?n:a>4/3-l?a:l}}),l8=Fe((te,Y)=>{var d=ji(),y=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];Y.exports=function(z,P,i,n){return i==="left"?z=0:i==="center"?z=1:i==="right"?z=2:z=d.constrain(Math.floor(z*3),0,2),n==="bottom"?P=0:n==="middle"?P=1:n==="top"?P=2:P=d.constrain(Math.floor(P*3),0,2),y[P][z]}}),Jm=Fe((te,Y)=>{var d=Gg(),y=iw(),z=q0().getGraphDiv,P=Ra(),i=Y.exports={};i.wrapped=function(n,a,l){n=z(n),n._fullLayout&&y.clear(n._fullLayout._uid+P.HOVERID),i.raw(n,a,l)},i.raw=function(n,a){var l=n._fullLayout,o=n._hoverdata;a||(a={}),!(a.target&&!n._dragged&&d.triggerHandler(n,"plotly_beforehover",a)===!1)&&(l._hoverlayer.selectAll("g").remove(),l._hoverlayer.selectAll("line").remove(),l._hoverlayer.selectAll("circle").remove(),n._hoverdata=void 0,a.target&&o&&n.emit("plotly_unhover",{event:a,points:o}))}}),Np=Fe((te,Y)=>{var d=s8(),y=Xf(),z=sw(),P=ji().removeElement,i=dc(),n=Y.exports={};n.align=lw(),n.getCursor=l8();var a=Jm();n.unhover=a.wrapped,n.unhoverRaw=a.raw,n.init=function(u){var s=u.gd,h=1,m=s._context.doubleClickDelay,b=u.element,x,_,A,f,k,w,D,E;s._mouseDownTime||(s._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=p,z?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=p,b.addEventListener("touchstart",p,{passive:!1})):b.ontouchstart=p;function I(T,N,B){return Math.abs(T)"u"&&typeof T.clientY>"u"&&(T.clientX=x,T.clientY=_),A=new Date().getTime(),A-s._mouseDownTimem&&(h=Math.max(h-1,1)),s._dragged)u.doneFn&&u.doneFn();else{var N;w.target===D?N=w:(N={target:D,srcElement:D,toElement:D},Object.keys(w).concat(Object.keys(w.__proto__)).forEach(B=>{var U=w[B];!N[B]&&typeof U!="function"&&(N[B]=U)})),u.clickFn&&u.clickFn(h,N),E||D.dispatchEvent(new MouseEvent("click",T))}s._dragging=!1,s._dragged=!1}};function l(){var u=document.createElement("div");u.className="dragcover";var s=u.style;return s.position="fixed",s.left=0,s.right=0,s.top=0,s.bottom=0,s.zIndex=999999999,s.background="none",document.body.appendChild(u),u}n.coverSlip=l;function o(u){return d(u.changedTouches?u.changedTouches[0]:u,document.body)}}),Em=Fe((te,Y)=>{Y.exports=function(d,y){(d.attr("class")||"").split(" ").forEach(function(z){z.indexOf("cursor-")===0&&d.classed(z,!1)}),y&&d.classed("cursor-"+y,!0)}}),Kg=Fe((te,Y)=>{var d=Em(),y="data-savedcursor",z="!!";Y.exports=function(P,i){var n=P.attr(y);if(i){if(!n){for(var a=(P.attr("class")||"").split(" "),l=0;l{var d=zn(),y=Mi();Y.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:d({editType:"legend"}),grouptitlefont:d({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:d({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),Jx=Fe(te=>{te.isGrouped=function(Y){return(Y.traceorder||"").indexOf("grouped")!==-1},te.isVertical=function(Y){return Y.orientation!=="h"},te.isReversed=function(Y){return(Y.traceorder||"").indexOf("reversed")!==-1}}),Qx=Fe((te,Y)=>{var d=as(),y=ji(),z=ku(),P=_a(),i=uw(),n=y_(),a=Jx();function l(o,u,s,h){var m=u[o]||{},b=z.newContainer(s,o);function x(ce,re){return y.coerce(m,b,i,ce,re)}var _=y.coerceFont(x,"font",s.font);x("bgcolor",s.paper_bgcolor),x("bordercolor");var A=x("visible");if(A){for(var f,k=function(ce,re){var ge=f._input,ne=f;return y.coerce(ge,ne,P,ce,re)},w=s.font||{},D=y.coerceFont(x,"grouptitlefont",w,{overrideDflt:{size:Math.round(w.size*1.1)}}),E=0,I=!1,M="normal",p=(s.shapes||[]).filter(function(ce){return ce.showlegend}),g=h.concat(p).filter(function(ce){return o===(ce.legend||"legend")}),C=0;C(o==="legend"?1:0));if(N===!1&&(s[o]=void 0),!(N===!1&&!m.uirevision)&&(x("uirevision",s.uirevision),N!==!1)){x("borderwidth");var B=x("orientation"),U=x("yref"),V=x("xref"),W=B==="h",F=U==="paper",$=V==="paper",q,G,ee,he="left";W?(q=0,d.getComponentMethod("rangeslider","isVisible")(u.xaxis)?F?(G=1.1,ee="bottom"):(G=1,ee="top"):F?(G=-.1,ee="top"):(G=0,ee="bottom")):(G=1,ee="auto",$?q=1.02:(q=1,he="right")),y.coerce(m,b,{x:{valType:"number",editType:"legend",min:$?-2:0,max:$?3:1,dflt:q}},"x"),y.coerce(m,b,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:G}},"y"),x("traceorder",M),a.isGrouped(s[o])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",he),x("yanchor",ee),x("maxheight"),x("valign"),y.noneOrAll(m,b,["x","y"]);var xe=x("title.text");if(xe){x("title.side",W?"left":"top");var ve=y.extendFlat({},_,{size:y.bigFont(_.size)});y.coerceFont(x,"title.font",ve)}}}}Y.exports=function(o,u,s){var h,m=s.slice(),b=u.shapes;if(b)for(h=0;h{var d=as(),y=ji(),z=y.pushUnique,P=!0;Y.exports=function(i,n,a){var l=n._fullLayout;if(n._dragged||n._editing)return;var o=l.legend.itemclick,u=l.legend.itemdoubleclick,s=l.legend.groupclick;a===1&&o==="toggle"&&u==="toggleothers"&&P&&n.data&&n._context.showTips&&y.notifier(y._(n,"Double-click on legend to isolate one trace"),"long"),P=!1;var h;if(a===1?h=o:a===2&&(h=u),!h)return;var m=s==="togglegroup",b=l.hiddenlabels?l.hiddenlabels.slice():[],x=i.data()[0][0];if(x.groupTitle&&x.noClick)return;var _=n._fullData,A=(l.shapes||[]).filter(function(ct){return ct.showlegend}),f=_.concat(A),k=x.trace;k._isShape&&(k=k._fullInput);var w=k.legendgroup,D,E,I,M,p,g,C={},T=[],N=[],B=[];function U(ct,Ae){var ze=T.indexOf(ct),Ee=C.visible;return Ee||(Ee=C.visible=[]),T.indexOf(ct)===-1&&(T.push(ct),ze=T.length-1),Ee[ze]=Ae,ze}var V=(l.shapes||[]).map(function(ct){return ct._input}),W=!1;function F(ct,Ae){V[ct].visible=Ae,W=!0}function $(ct,Ae){if(!(x.groupTitle&&!m)){var ze=ct._fullInput||ct,Ee=ze._isShape,nt=ze.index;nt===void 0&&(nt=ze._index);var xt=ze.visible===!1?!1:Ae;Ee?F(nt,xt):U(nt,xt)}}var q=k.legend,G=k._fullInput,ee=G&&G._isShape;if(!ee&&d.traceIs(k,"pie-like")){var he=x.label,xe=b.indexOf(he);if(h==="toggle")xe===-1?b.push(he):b.splice(xe,1);else if(h==="toggleothers"){var ve=xe!==-1,ce=[];for(D=0;D{Y.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),k4=Fe((te,Y)=>{var d=as(),y=Jx();Y.exports=function(z,P,i){var n=P._inHover,a=y.isGrouped(P),l=y.isReversed(P),o={},u=[],s=!1,h={},m=0,b=0,x,_;function A($,q,G){if(P.visible!==!1&&!(i&&$!==P._id))if(q===""||!y.isGrouped(P)){var ee="~~i"+m;u.push(ee),o[ee]=[G],m++}else u.indexOf(q)===-1?(u.push(q),s=!0,o[q]=[G]):o[q].push(G)}for(x=0;xT&&(C=T)}p[x][0]._groupMinRank=C,p[x][0]._preGroupSort=x}var N=function($,q){return $[0]._groupMinRank-q[0]._groupMinRank||$[0]._preGroupSort-q[0]._preGroupSort},B=function($,q){return $.trace.legendrank-q.trace.legendrank||$._preSort-q._preSort};for(p.forEach(function($,q){$[0]._preGroupSort=q}),p.sort(N),x=0;x{var Y=ji();function d(y){return y.indexOf("e")!==-1?y.replace(/[.]?0+e/,"e"):y.indexOf(".")!==-1?y.replace(/[.]?0+$/,""):y}te.formatPiePercent=function(y,z){var P=d((y*100).toPrecision(3));return Y.numSeparate(P,z)+"%"},te.formatPieValue=function(y,z){var P=d(y.toPrecision(10));return Y.numSeparate(P,z)},te.getFirstFilled=function(y,z){if(Y.isArrayOrTypedArray(y))for(var P=0;P{var d=Zs(),y=Xi();Y.exports=function(z,P,i,n){var a=i.marker.pattern;a&&a.shape?d.pointStyle(z,i,n,P):y.fill(z,P.color)}}),Wv=Fe((te,Y)=>{var d=Xi(),y=Vv().castOption,z=c8();Y.exports=function(P,i,n,a){var l=n.marker.line,o=y(l.color,i.pts)||d.defaultLine,u=y(l.width,i.pts)||0;P.call(z,i,n,a).style("stroke-width",u).call(d.stroke,o)}}),T4=Fe((te,Y)=>{var d=ii(),y=as(),z=ji(),P=z.strTranslate,i=Zs(),n=Xi(),a=cp().extractOpts,l=Oc(),o=Wv(),u=Vv().castOption,s=cw(),h=12,m=5,b=2,x=10,_=5;Y.exports=function(w,D,E){var I=D._fullLayout;E||(E=I.legend);var M=E.itemsizing==="constant",p=E.itemwidth,g=(p+s.itemGap*2)/2,C=P(g,0),T=function(ce,re,ge,ne){var se;if(ce+1)se=ce;else if(re&&re.width>0)se=re.width;else return 0;return M?ne:Math.min(se,ge)};w.each(function(ce){var re=d.select(this),ge=z.ensureSingle(re,"g","layers");ge.style("opacity",ce[0].trace.opacity);var ne=E.indentation,se=E.valign,_e=ce[0].lineHeight,oe=ce[0].height;if(se==="middle"&&ne===0||!_e||!oe)ge.attr("transform",null);else{var J={top:1,bottom:-1}[se],me=J*(.5*(_e-oe+3))||0,fe=E.indentation;ge.attr("transform",P(fe,me))}var Ce=ge.selectAll("g.legendfill").data([ce]);Ce.enter().append("g").classed("legendfill",!0);var Be=ge.selectAll("g.legendlines").data([ce]);Be.enter().append("g").classed("legendlines",!0);var Oe=ge.selectAll("g.legendsymbols").data([ce]);Oe.enter().append("g").classed("legendsymbols",!0),Oe.selectAll("g.legendpoints").data([ce]).enter().append("g").classed("legendpoints",!0)}).each(ve).each(U).each(W).each(V).each($).each(he).each(ee).each(N).each(B).each(q).each(G);function N(ce){var re=f(ce),ge=re.showFill,ne=re.showLine,se=re.showGradientLine,_e=re.showGradientFill,oe=re.anyFill,J=re.anyLine,me=ce[0],fe=me.trace,Ce,Be,Oe=a(fe),Ze=Oe.colorscale,Ge=Oe.reversescale,rt=function(Ee){if(Ee.size())if(ge)i.fillGroupStyle(Ee,D,!0);else{var nt="legendfill-"+fe.uid;i.gradient(Ee,D,nt,A(Ge),Ze,"fill")}},_t=function(Ee){if(Ee.size()){var nt="legendline-"+fe.uid;i.lineGroupStyle(Ee),i.gradient(Ee,D,nt,A(Ge),Ze,"stroke")}},pt=l.hasMarkers(fe)||!oe?"M5,0":J?"M5,-2":"M5,-3",gt=d.select(this),ct=gt.select(".legendfill").selectAll("path").data(ge||_e?[ce]:[]);if(ct.enter().append("path").classed("js-fill",!0),ct.exit().remove(),ct.attr("d",pt+"h"+p+"v6h-"+p+"z").call(rt),ne||se){var Ae=T(void 0,fe.line,x,m);Be=z.minExtend(fe,{line:{width:Ae}}),Ce=[z.minExtend(me,{trace:Be})]}var ze=gt.select(".legendlines").selectAll("path").data(ne||se?[Ce]:[]);ze.enter().append("path").classed("js-line",!0),ze.exit().remove(),ze.attr("d",pt+(se?"l"+p+",0.0001":"h"+p)).call(ne?i.lineGroupStyle:_t)}function B(ce){var re=f(ce),ge=re.anyFill,ne=re.anyLine,se=re.showLine,_e=re.showMarker,oe=ce[0],J=oe.trace,me=!_e&&!ne&&!ge&&l.hasText(J),fe,Ce;function Be(ct,Ae,ze,Ee){var nt=z.nestedProperty(J,ct).get(),xt=z.isArrayOrTypedArray(nt)&&Ae?Ae(nt):nt;if(M&&xt&&Ee!==void 0&&(xt=Ee),ze){if(xtze[1])return ze[1]}return xt}function Oe(ct){return oe._distinct&&oe.index&&ct[oe.index]?ct[oe.index]:ct[0]}if(_e||me||se){var Ze={},Ge={};if(_e){Ze.mc=Be("marker.color",Oe),Ze.mx=Be("marker.symbol",Oe),Ze.mo=Be("marker.opacity",z.mean,[.2,1]),Ze.mlc=Be("marker.line.color",Oe),Ze.mlw=Be("marker.line.width",z.mean,[0,5],b),Ge.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var rt=Be("marker.size",z.mean,[2,16],h);Ze.ms=rt,Ge.marker.size=rt}se&&(Ge.line={width:Be("line.width",Oe,[0,10],m)}),me&&(Ze.tx="Aa",Ze.tp=Be("textposition",Oe),Ze.ts=10,Ze.tc=Be("textfont.color",Oe),Ze.tf=Be("textfont.family",Oe),Ze.tw=Be("textfont.weight",Oe),Ze.ty=Be("textfont.style",Oe),Ze.tv=Be("textfont.variant",Oe),Ze.tC=Be("textfont.textcase",Oe),Ze.tE=Be("textfont.lineposition",Oe),Ze.tS=Be("textfont.shadow",Oe)),fe=[z.minExtend(oe,Ze)],Ce=z.minExtend(J,Ge),Ce.selectedpoints=null,Ce.texttemplate=null}var _t=d.select(this).select("g.legendpoints"),pt=_t.selectAll("path.scatterpts").data(_e?fe:[]);pt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",C),pt.exit().remove(),pt.call(i.pointStyle,Ce,D),_e&&(fe[0].mrc=3);var gt=_t.selectAll("g.pointtext").data(me?fe:[]);gt.enter().append("g").classed("pointtext",!0).append("text").attr("transform",C),gt.exit().remove(),gt.selectAll("text").call(i.textPointStyle,Ce,D)}function U(ce){var re=ce[0].trace,ge=re.type==="waterfall";if(ce[0]._distinct&&ge){var ne=ce[0].trace[ce[0].dir].marker;return ce[0].mc=ne.color,ce[0].mlw=ne.line.width,ce[0].mlc=ne.line.color,F(ce,this,"waterfall")}var se=[];re.visible&&ge&&(se=ce[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var _e=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(se);_e.enter().append("path").classed("legendwaterfall",!0).attr("transform",C).style("stroke-miterlimit",1),_e.exit().remove(),_e.each(function(oe){var J=d.select(this),me=re[oe[0]].marker,fe=T(void 0,me.line,_,b);J.attr("d",oe[1]).style("stroke-width",fe+"px").call(n.fill,me.color),fe&&J.call(n.stroke,me.line.color)})}function V(ce){F(ce,this)}function W(ce){F(ce,this,"funnel")}function F(ce,re,ge){var ne=ce[0].trace,se=ne.marker||{},_e=se.line||{},oe=se.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",J=ge?ne.visible&&ne.type===ge:y.traceIs(ne,"bar"),me=d.select(re).select("g.legendpoints").selectAll("path.legend"+ge).data(J?[ce]:[]);me.enter().append("path").classed("legend"+ge,!0).attr("d",oe).attr("transform",C),me.exit().remove(),me.each(function(fe){var Ce=d.select(this),Be=fe[0],Oe=T(Be.mlw,se.line,_,b);Ce.style("stroke-width",Oe+"px");var Ze=Be.mcc;if(!E._inHover&&"mc"in Be){var Ge=a(se),rt=Ge.mid;rt===void 0&&(rt=(Ge.max+Ge.min)/2),Ze=i.tryColorscale(se,"")(rt)}var _t=Ze||Be.mc||se.color,pt=se.pattern,gt=i.getPatternAttr,ct=pt&&(gt(pt.shape,0,"")||gt(pt.path,0,""));if(ct){var Ae=gt(pt.bgcolor,0,null),ze=gt(pt.fgcolor,0,null),Ee=pt.fgopacity,nt=k(pt.size,8,10),xt=k(pt.solidity,.5,1),ut="legend-"+ne.uid;Ce.call(i.pattern,"legend",D,ut,ct,nt,xt,Ze,pt.fillmode,Ae,ze,Ee)}else Ce.call(n.fill,_t);Oe&&n.stroke(Ce,Be.mlc||_e.color)})}function $(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(re.visible&&y.traceIs(re,"box-violin")?[ce]:[]);ge.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),ge.exit().remove(),ge.each(function(){var ne=d.select(this);if((re.boxpoints==="all"||re.points==="all")&&n.opacity(re.fillcolor)===0&&n.opacity((re.line||{}).color)===0){var se=z.minExtend(re,{marker:{size:M?h:z.constrain(re.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ge.call(i.pointStyle,se,D)}else{var _e=T(void 0,re.line,_,b);ne.style("stroke-width",_e+"px").call(n.fill,re.fillcolor),_e&&n.stroke(ne,re.line.color)}})}function q(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(re.visible&&re.type==="candlestick"?[ce,ce]:[]);ge.enter().append("path").classed("legendcandle",!0).attr("d",function(ne,se){return se?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",C).style("stroke-miterlimit",1),ge.exit().remove(),ge.each(function(ne,se){var _e=d.select(this),oe=re[se?"increasing":"decreasing"],J=T(void 0,oe.line,_,b);_e.style("stroke-width",J+"px").call(n.fill,oe.fillcolor),J&&n.stroke(_e,oe.line.color)})}function G(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(re.visible&&re.type==="ohlc"?[ce,ce]:[]);ge.enter().append("path").classed("legendohlc",!0).attr("d",function(ne,se){return se?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",C).style("stroke-miterlimit",1),ge.exit().remove(),ge.each(function(ne,se){var _e=d.select(this),oe=re[se?"increasing":"decreasing"],J=T(void 0,oe.line,_,b);_e.style("fill","none").call(i.dashLine,oe.line.dash,J),J&&n.stroke(_e,oe.line.color)})}function ee(ce){xe(ce,this,"pie")}function he(ce){xe(ce,this,"funnelarea")}function xe(ce,re,ge){var ne=ce[0],se=ne.trace,_e=ge?se.visible&&se.type===ge:y.traceIs(se,ge),oe=d.select(re).select("g.legendpoints").selectAll("path.legend"+ge).data(_e?[ce]:[]);if(oe.enter().append("path").classed("legend"+ge,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),oe.exit().remove(),oe.size()){var J=se.marker||{},me=T(u(J.line.width,ne.pts),J.line,_,b),fe="pieLike",Ce=z.minExtend(se,{marker:{line:{width:me}}},fe),Be=z.minExtend(ne,{trace:Ce},fe);o(oe,Be,Ce,D)}}function ve(ce){var re=ce[0].trace,ge,ne=[];if(re.visible)switch(re.type){case"histogram2d":case"heatmap":ne=[["M-15,-2V4H15V-2Z"]],ge=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":ne=[["M-6,-6V6H6V-6Z"]],ge=!0;break;case"densitymapbox":case"densitymap":ne=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ge="radial";break;case"cone":ne=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ge=!1;break;case"streamtube":ne=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ge=!1;break;case"surface":ne=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ge=!0;break;case"mesh3d":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ge=!1;break;case"volume":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ge=!0;break;case"isosurface":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ge=!1;break}var se=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(ne);se.enter().append("path").classed("legend3dandfriends",!0).attr("transform",C).style("stroke-miterlimit",1),se.exit().remove(),se.each(function(_e,oe){var J=d.select(this),me=a(re),fe=me.colorscale,Ce=me.reversescale,Be=function(rt){if(rt.size()){var _t="legendfill-"+re.uid;i.gradient(rt,D,_t,A(Ce,ge==="radial"),fe,"fill")}},Oe;if(fe){if(!ge){var Ze=fe.length;Oe=oe===0?fe[Ce?Ze-1:0][1]:oe===1?fe[Ce?0:Ze-1][1]:fe[Math.floor((Ze-1)/2)][1]}}else{var Ge=re.vertexcolor||re.facecolor||re.color;Oe=z.isArrayOrTypedArray(Ge)?Ge[oe]||Ge[0]:Ge}J.attr("d",_e[0]),Oe?J.call(n.fill,Oe):J.call(Be)})}};function A(w,D){var E=D?"radial":"horizontal";return E+(w?"":"reversed")}function f(w){var D=w[0].trace,E=D.contours,I=l.hasLines(D),M=l.hasMarkers(D),p=D.visible&&D.fill&&D.fill!=="none",g=!1,C=!1;if(E){var T=E.coloring;T==="lines"?g=!0:I=T==="none"||T==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(T==="fill"||T==="heatmap")&&(C=!0)}return{showMarker:M,showLine:I,showFill:p,showGradientLine:g,showGradientFill:C,anyLine:I||g,anyFill:p||C}}function k(w,D,E){return w&&z.isArrayOrTypedArray(w)?D:w>E?E:w}}),hw=Fe((te,Y)=>{var d=ii(),y=ji(),z=sh(),P=as(),i=Gg(),n=Np(),a=Zs(),l=Xi(),o=cc(),u=u8(),s=cw(),h=Bf(),m=h.LINE_SPACING,b=h.FROM_TL,x=h.FROM_BR,_=k4(),A=T4(),f=Jx(),k=1,w=/^legend[0-9]*$/;Y.exports=function(q,G){if(G)E(q,G);else{var ee=q._fullLayout,he=ee._legends,xe=ee._infolayer.selectAll('[class^="legend"]');xe.each(function(){var ge=d.select(this),ne=ge.attr("class"),se=ne.split(" ")[0];se.match(w)&&he.indexOf(se)===-1&&ge.remove()});for(var ve=0;ve1)}var me=he.hiddenlabels||[];if(!re&&(!he.showlegend||!ge.length))return ce.selectAll("."+xe).remove(),he._topdefs.select("#"+ve).remove(),z.autoMargin(q,xe);var fe=y.ensureSingle(ce,"g",xe,function(gt){re||gt.attr("pointer-events","all")}),Ce=y.ensureSingleById(he._topdefs,"clipPath",ve,function(gt){gt.append("rect")}),Be=y.ensureSingle(fe,"rect","bg",function(gt){gt.attr("shape-rendering","crispEdges")});Be.call(l.stroke,ee.bordercolor).call(l.fill,ee.bgcolor).style("stroke-width",ee.borderwidth+"px");var Oe=y.ensureSingle(fe,"g","scrollbox"),Ze=ee.title;ee._titleWidth=0,ee._titleHeight=0;var Ge;Ze.text?(Ge=y.ensureSingle(Oe,"text",xe+"titletext"),Ge.attr("text-anchor","start").call(a.font,Ze.font).text(Ze.text),T(Ge,Oe,q,ee,k)):Oe.selectAll("."+xe+"titletext").remove();var rt=y.ensureSingle(fe,"rect","scrollbar",function(gt){gt.attr(s.scrollBarEnterAttrs).call(l.fill,s.scrollBarColor)}),_t=Oe.selectAll("g.groups").data(ge);_t.enter().append("g").attr("class","groups"),_t.exit().remove();var pt=_t.selectAll("g.traces").data(y.identity);pt.enter().append("g").attr("class","traces"),pt.exit().remove(),pt.style("opacity",function(gt){var ct=gt[0].trace;return P.traceIs(ct,"pie-like")?me.indexOf(gt[0].label)!==-1?.5:1:ct.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,q,ee)}).call(A,q,ee).each(function(){re||d.select(this).call(C,q,xe)}),y.syncOrAsync([z.previousPromises,function(){return U(q,_t,pt,ee)},function(){var gt=he._size,ct=ee.borderwidth,Ae=ee.xref==="paper",ze=ee.yref==="paper";if(Ze.text&&D(Ge,ee,ct),!re){var Ee,nt;Ae?Ee=gt.l+gt.w*ee.x-b[W(ee)]*ee._width:Ee=he.width*ee.x-b[W(ee)]*ee._width,ze?nt=gt.t+gt.h*(1-ee.y)-b[F(ee)]*ee._effHeight:nt=he.height*(1-ee.y)-b[F(ee)]*ee._effHeight;var xt=V(q,xe,Ee,nt);if(xt)return;if(he.margin.autoexpand){var ut=Ee,Et=nt;Ee=Ae?y.constrain(Ee,0,he.width-ee._width):ut,nt=ze?y.constrain(nt,0,he.height-ee._effHeight):Et,Ee!==ut&&y.log("Constrain "+xe+".x to make legend fit inside graph"),nt!==Et&&y.log("Constrain "+xe+".y to make legend fit inside graph")}a.setTranslate(fe,Ee,nt)}if(rt.on(".drag",null),fe.on("wheel",null),re||ee._height<=ee._maxHeight||q._context.staticPlot){var Gt=ee._effHeight;re&&(Gt=ee._height),Be.attr({width:ee._width-ct,height:Gt-ct,x:ct/2,y:ct/2}),a.setTranslate(Oe,0,0),Ce.select("rect").attr({width:ee._width-2*ct,height:Gt-2*ct,x:ct,y:ct}),a.setClipUrl(Oe,ve,q),a.setRect(rt,0,0,0,0),delete ee._scrollY}else{var Jt=Math.max(s.scrollBarMinHeight,ee._effHeight*ee._effHeight/ee._height),gr=ee._effHeight-Jt-2*s.scrollBarMargin,mr=ee._height-ee._effHeight,Kr=gr/mr,ri=Math.min(ee._scrollY||0,mr);Be.attr({width:ee._width-2*ct+s.scrollBarWidth+s.scrollBarMargin,height:ee._effHeight-ct,x:ct/2,y:ct/2}),Ce.select("rect").attr({width:ee._width-2*ct+s.scrollBarWidth+s.scrollBarMargin,height:ee._effHeight-2*ct,x:ct,y:ct+ri}),a.setClipUrl(Oe,ve,q),ye(ri,Jt,Kr),fe.on("wheel",function(){ri=y.constrain(ee._scrollY+d.event.deltaY/mr*gr,0,mr),ye(ri,Jt,Kr),ri!==0&&ri!==mr&&d.event.preventDefault()});var Mr,ui,mi,Ot=function(At,Wt,Kt){var hr=(Kt-Wt)/Kr+At;return y.constrain(hr,0,mr)},Je=function(At,Wt,Kt){var hr=(Wt-Kt)/Kr+At;return y.constrain(hr,0,mr)},ot=d.behavior.drag().on("dragstart",function(){var At=d.event.sourceEvent;At.type==="touchstart"?Mr=At.changedTouches[0].clientY:Mr=At.clientY,mi=ri}).on("drag",function(){var At=d.event.sourceEvent;At.buttons===2||At.ctrlKey||(At.type==="touchmove"?ui=At.changedTouches[0].clientY:ui=At.clientY,ri=Ot(mi,Mr,ui),ye(ri,Jt,Kr))});rt.call(ot);var De=d.behavior.drag().on("dragstart",function(){var At=d.event.sourceEvent;At.type==="touchstart"&&(Mr=At.changedTouches[0].clientY,mi=ri)}).on("drag",function(){var At=d.event.sourceEvent;At.type==="touchmove"&&(ui=At.changedTouches[0].clientY,ri=Je(mi,Mr,ui),ye(ri,Jt,Kr))});Oe.call(De)}function ye(At,Wt,Kt){ee._scrollY=q._fullLayout[xe]._scrollY=At,a.setTranslate(Oe,0,-At),a.setRect(rt,ee._width,s.scrollBarMargin+At*Kt,s.scrollBarWidth,Wt),Ce.select("rect").attr("y",ct+At)}if(q._context.edits.legendPosition){var Pe,He,at,ht;fe.classed("cursor-move",!0),n.init({element:fe.node(),gd:q,prepFn:function(At){if(At.target!==rt.node()){var Wt=a.getTranslate(fe);at=Wt.x,ht=Wt.y}},moveFn:function(At,Wt){if(at!==void 0&&ht!==void 0){var Kt=at+At,hr=ht+Wt;a.setTranslate(fe,Kt,hr),Pe=n.align(Kt,ee._width,gt.l,gt.l+gt.w,ee.xanchor),He=n.align(hr+ee._height,-ee._height,gt.t+gt.h,gt.t,ee.yanchor)}},doneFn:function(){if(Pe!==void 0&&He!==void 0){var At={};At[xe+".x"]=Pe,At[xe+".y"]=He,P.call("_guiRelayout",q,At)}},clickFn:function(At,Wt){var Kt=ce.selectAll("g.traces").filter(function(){var hr=this.getBoundingClientRect();return Wt.clientX>=hr.left&&Wt.clientX<=hr.right&&Wt.clientY>=hr.top&&Wt.clientY<=hr.bottom});Kt.size()>0&&M(q,fe,Kt,At,Wt)}})}}],q)}}function I(q,G,ee){var he=q[0],xe=he.width,ve=G.entrywidthmode,ce=he.trace.legendwidth||G.entrywidth;return ve==="fraction"?G._maxWidth*ce:ee+(ce||xe)}function M(q,G,ee,he,xe){var ve=ee.data()[0][0].trace,ce={event:xe,node:ee.node(),curveNumber:ve.index,expandedIndex:ve.index,data:q.data,layout:q.layout,frames:q._transitionData._frames,config:q._context,fullData:q._fullData,fullLayout:q._fullLayout};ve._group&&(ce.group=ve._group),P.traceIs(ve,"pie-like")&&(ce.label=ee.datum()[0].label);var re=i.triggerHandler(q,"plotly_legendclick",ce);if(he===1){if(re===!1)return;G._clickTimeout=setTimeout(function(){q._fullLayout&&u(ee,q,he)},q._context.doubleClickDelay)}else if(he===2){G._clickTimeout&&clearTimeout(G._clickTimeout),q._legendMouseDownTime=0;var ge=i.triggerHandler(q,"plotly_legenddoubleclick",ce);ge!==!1&&re!==!1&&u(ee,q,he)}}function p(q,G,ee){var he=$(ee),xe=q.data()[0][0],ve=xe.trace,ce=P.traceIs(ve,"pie-like"),re=!ee._inHover&&G._context.edits.legendText&&!ce,ge=ee._maxNameLength,ne,se;xe.groupTitle?(ne=xe.groupTitle.text,se=xe.groupTitle.font):(se=ee.font,ee.entries?ne=xe.text:(ne=ce?xe.label:ve.name,ve._meta&&(ne=y.templateString(ne,ve._meta))));var _e=y.ensureSingle(q,"text",he+"text");_e.attr("text-anchor","start").call(a.font,se).text(re?g(ne,ge):ne);var oe=ee.indentation+ee.itemwidth+s.itemGap*2;o.positionText(_e,oe,0),re?_e.call(o.makeEditable,{gd:G,text:ne}).call(T,q,G,ee).on("edit",function(J){this.text(g(J,ge)).call(T,q,G,ee);var me=xe.trace._fullInput||{},fe={};return fe.name=J,me._isShape?P.call("_guiRelayout",G,"shapes["+ve.index+"].name",fe.name):P.call("_guiRestyle",G,fe,ve.index)}):T(_e,q,G,ee)}function g(q,G){var ee=Math.max(4,G);if(q&&q.trim().length>=ee/2)return q;q=q||"";for(var he=ee-q.length;he>0;he--)q+=" ";return q}function C(q,G,ee){var he=G._context.doubleClickDelay,xe,ve=1,ce=y.ensureSingle(q,"rect",ee+"toggle",function(re){G._context.staticPlot||re.style("cursor","pointer").attr("pointer-events","all"),re.call(l.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(ce.on("mousedown",function(){xe=new Date().getTime(),xe-G._legendMouseDownTimehe&&(ve=Math.max(ve-1,1)),M(G,re,q,ve,d.event)}}))}function T(q,G,ee,he,xe){he._inHover&&q.attr("data-notex",!0),o.convertToTspans(q,ee,function(){N(G,ee,he,xe)})}function N(q,G,ee,he){var xe=q.data()[0][0];if(!ee._inHover&&xe&&!xe.trace.showlegend){q.remove();return}var ve=q.select("g[class*=math-group]"),ce=ve.node(),re=$(ee);ee||(ee=G._fullLayout[re]);var ge=ee.borderwidth,ne;he===k?ne=ee.title.font:xe.groupTitle?ne=xe.groupTitle.font:ne=ee.font;var se=ne.size*m,_e,oe;if(ce){var J=a.bBox(ce);_e=J.height,oe=J.width,he===k?a.setTranslate(ve,ge,ge+_e*.75):a.setTranslate(ve,0,_e*.25)}else{var me="."+re+(he===k?"title":"")+"text",fe=q.select(me),Ce=o.lineCount(fe),Be=fe.node();if(_e=se*Ce,oe=Be?a.bBox(Be).width:0,he===k)ee.title.side==="left"&&(oe+=s.itemGap*2),o.positionText(fe,ge+s.titlePad,ge+se);else{var Oe=s.itemGap*2+ee.indentation+ee.itemwidth;xe.groupTitle&&(Oe=s.itemGap,oe-=ee.indentation+ee.itemwidth),o.positionText(fe,Oe,-se*((Ce-1)/2-.3))}}he===k?(ee._titleWidth=oe,ee._titleHeight=_e):(xe.lineHeight=se,xe.height=Math.max(_e,16)+3,xe.width=oe)}function B(q){var G=0,ee=0,he=q.title.side;return he&&(he.indexOf("left")!==-1&&(G=q._titleWidth),he.indexOf("top")!==-1&&(ee=q._titleHeight)),[G,ee]}function U(q,G,ee,he){var xe=q._fullLayout,ve=$(he);he||(he=xe[ve]);var ce=xe._size,re=f.isVertical(he),ge=f.isGrouped(he),ne=he.entrywidthmode==="fraction",se=he.borderwidth,_e=2*se,oe=s.itemGap,J=he.indentation+he.itemwidth+oe*2,me=2*(se+oe),fe=F(he),Ce=he.y<0||he.y===0&&fe==="top",Be=he.y>1||he.y===1&&fe==="bottom",Oe=he.tracegroupgap,Ze={};let{orientation:Ge,yref:rt}=he,{maxheight:_t}=he,pt=Ce||Be||Ge!=="v"||rt!=="paper";_t||(_t=pt?.5:1);let gt=pt?xe.height:ce.h;he._maxHeight=Math.max(_t>1?_t:_t*gt,30);var ct=0;he._width=0,he._height=0;var Ae=B(he);if(re)ee.each(function(ye){var Pe=ye[0].height;a.setTranslate(this,se+Ae[0],se+Ae[1]+he._height+Pe/2+oe),he._height+=Pe,he._width=Math.max(he._width,ye[0].width)}),ct=J+he._width,he._width+=oe+J+_e,he._height+=me,ge&&(G.each(function(ye,Pe){a.setTranslate(this,0,Pe*he.tracegroupgap)}),he._height+=(he._lgroupsLength-1)*he.tracegroupgap);else{var ze=W(he),Ee=he.x<0||he.x===0&&ze==="right",nt=he.x>1||he.x===1&&ze==="left",xt=Be||Ce,ut=xe.width/2;he._maxWidth=Math.max(Ee?xt&&ze==="left"?ce.l+ce.w:ut:nt?xt&&ze==="right"?ce.r+ce.w:ut:ce.w,2*J);var Et=0,Gt=0;ee.each(function(ye){var Pe=I(ye,he,J);Et=Math.max(Et,Pe),Gt+=Pe}),ct=null;var Jt=0;if(ge){var gr=0,mr=0,Kr=0;G.each(function(){var ye=0,Pe=0;d.select(this).selectAll("g.traces").each(function(at){var ht=I(at,he,J),At=at[0].height;a.setTranslate(this,Ae[0],Ae[1]+se+oe+At/2+Pe),Pe+=At,ye=Math.max(ye,ht),Ze[at[0].trace.legendgroup]=ye});var He=ye+oe;mr>0&&He+se+mr>he._maxWidth?(Jt=Math.max(Jt,mr),mr=0,Kr+=gr+Oe,gr=Pe):gr=Math.max(gr,Pe),a.setTranslate(this,mr,Kr),mr+=He}),he._width=Math.max(Jt,mr)+se,he._height=Kr+gr+me}else{var ri=ee.size(),Mr=Gt+_e+(ri-1)*oe=he._maxWidth&&(Jt=Math.max(Jt,Je),mi=0,Ot+=ui,he._height+=ui,ui=0),a.setTranslate(this,Ae[0]+se+mi,Ae[1]+se+Ot+Pe/2+oe),Je=mi+He+oe,mi+=at,ui=Math.max(ui,Pe)}),Mr?(he._width=mi+_e,he._height=ui+me):(he._width=Math.max(Jt,Je)+_e,he._height+=ui+me)}}he._width=Math.ceil(Math.max(he._width+Ae[0],he._titleWidth+2*(se+s.titlePad))),he._height=Math.ceil(Math.max(he._height+Ae[1],he._titleHeight+2*(se+s.itemGap))),he._effHeight=Math.min(he._height,he._maxHeight);var ot=q._context.edits,De=ot.legendText||ot.legendPosition;ee.each(function(ye){var Pe=d.select(this).select("."+ve+"toggle"),He=ye[0].height,at=ye[0].trace.legendgroup,ht=I(ye,he,J);ge&&at!==""&&(ht=Ze[at]);var At=De?J:ct||ht;!re&&!ne&&(At+=oe/2),a.setRect(Pe,0,-He/2,At,He)})}function V(q,G,ee,he){var xe=q._fullLayout,ve=xe[G],ce=W(ve),re=F(ve),ge=ve.xref==="paper",ne=ve.yref==="paper";q._fullLayout._reservedMargin[G]={};var se=ve.y<.5?"b":"t",_e=ve.x<.5?"l":"r",oe={r:xe.width-ee,l:ee+ve._width,b:xe.height-he,t:he+ve._effHeight};if(ge&&ne)return z.autoMargin(q,G,{x:ve.x,y:ve.y,l:ve._width*b[ce],r:ve._width*x[ce],b:ve._effHeight*x[re],t:ve._effHeight*b[re]});ge?q._fullLayout._reservedMargin[G][se]=oe[se]:ne||ve.orientation==="v"?q._fullLayout._reservedMargin[G][_e]=oe[_e]:q._fullLayout._reservedMargin[G][se]=oe[se]}function W(q){return y.isRightAnchor(q)?"right":y.isCenterAnchor(q)?"center":"left"}function F(q){return y.isBottomAnchor(q)?"bottom":y.isMiddleAnchor(q)?"middle":"top"}function $(q){return q._id||"legend"}}),fw=Fe(te=>{var Y=ii(),d=Ar(),y=sn(),z=ji(),P=z.pushUnique,i=z.strTranslate,n=z.strRotate,a=Gg(),l=cc(),o=Kg(),u=Zs(),s=Xi(),h=Np(),m=Os(),b=dc().zindexSeparator,x=as(),_=T0(),A=Ra(),f=Qx(),k=hw(),w=A.YANGLE,D=Math.PI*w/180,E=1/Math.sin(D),I=Math.cos(D),M=Math.sin(D),p=A.HOVERARROWSIZE,g=A.HOVERTEXTPAD,C={box:!0,ohlc:!0,violin:!0,candlestick:!0},T={scatter:!0,scattergl:!0,splom:!0};function N(J,me){return J.distance-me.distance}te.hover=function(J,me,fe,Ce){J=z.getGraphDiv(J);var Be=me.target;z.throttle(J._fullLayout._uid+A.HOVERID,A.HOVERMINTIME,function(){B(J,me,fe,Ce,Be)})},te.loneHover=function(J,me){var fe=!0;Array.isArray(J)||(fe=!1,J=[J]);var Ce=me.gd,Be=se(Ce),Oe=_e(Ce),Ze=J.map(function(Ee){var nt=Ee._x0||Ee.x0||Ee.x||0,xt=Ee._x1||Ee.x1||Ee.x||0,ut=Ee._y0||Ee.y0||Ee.y||0,Et=Ee._y1||Ee.y1||Ee.y||0,Gt=Ee.eventData;if(Gt){var Jt=Math.min(nt,xt),gr=Math.max(nt,xt),mr=Math.min(ut,Et),Kr=Math.max(ut,Et),ri=Ee.trace;if(x.traceIs(ri,"gl3d")){var Mr=Ce._fullLayout[ri.scene]._scene.container,ui=Mr.offsetLeft,mi=Mr.offsetTop;Jt+=ui,gr+=ui,mr+=mi,Kr+=mi}Gt.bbox={x0:Jt+Oe,x1:gr+Oe,y0:mr+Be,y1:Kr+Be},me.inOut_bbox&&me.inOut_bbox.push(Gt.bbox)}else Gt=!1;return{color:Ee.color||s.defaultLine,x0:Ee.x0||Ee.x||0,x1:Ee.x1||Ee.x||0,y0:Ee.y0||Ee.y||0,y1:Ee.y1||Ee.y||0,xLabel:Ee.xLabel,yLabel:Ee.yLabel,zLabel:Ee.zLabel,text:Ee.text,name:Ee.name,idealAlign:Ee.idealAlign,borderColor:Ee.borderColor,fontFamily:Ee.fontFamily,fontSize:Ee.fontSize,fontColor:Ee.fontColor,fontWeight:Ee.fontWeight,fontStyle:Ee.fontStyle,fontVariant:Ee.fontVariant,nameLength:Ee.nameLength,textAlign:Ee.textAlign,trace:Ee.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ee.hovertemplate||!1,hovertemplateLabels:Ee.hovertemplateLabels||!1,eventData:Gt}}),Ge=!1,rt=W(Ze,{gd:Ce,hovermode:"closest",rotateLabels:Ge,bgColor:me.bgColor||s.background,container:Y.select(me.container),outerContainer:me.outerContainer||me.container}),_t=rt.hoverLabels,pt=5,gt=0,ct=0;_t.sort(function(Ee,nt){return Ee.y0-nt.y0}).each(function(Ee,nt){var xt=Ee.y0-Ee.by/2;xt-ptmr[0]._length||Sn<0||Sn>Kr[0]._length)return h.unhoverRaw(J,me)}if(me.pointerX=Wn+mr[0]._offset,me.pointerY=Sn+Kr[0]._offset,"xval"in me?De=_.flat(Oe,me.xval):De=_.p2c(mr,Wn),"yval"in me?ye=_.flat(Oe,me.yval):ye=_.p2c(Kr,Sn),!d(De[0])||!d(ye[0]))return z.warn("Fx.hover failed",me,J),h.unhoverRaw(J,me)}var na=1/0;function Zt(Wa,ks){for(He=0;Hebr&&(Je.splice(0,br),na=Je[0].distance),gt&&Ot!==0&&Je.length===0){Dr.distance=Ot,Dr.index=!1;var ds=ht._module.hoverPoints(Dr,hr,zr,"closest",{hoverLayer:Ge._hoverlayer});if(ds&&(ds=ds.filter(function(No){return No.spikeDistance<=Ot})),ds&&ds.length){var xl,ol=ds.filter(function(No){return No.xa.showspikes&&No.xa.spikesnap!=="hovered data"});if(ol.length){var Gl=ol[0];d(Gl.x0)&&d(Gl.y0)&&(xl=_r(Gl),(!hi.vLinePoint||hi.vLinePoint.spikeDistance>xl.spikeDistance)&&(hi.vLinePoint=xl))}var ms=ds.filter(function(No){return No.ya.showspikes&&No.ya.spikesnap!=="hovered data"});if(ms.length){var Bs=ms[0];d(Bs.x0)&&d(Bs.y0)&&(xl=_r(Bs),(!hi.hLinePoint||hi.hLinePoint.spikeDistance>xl.spikeDistance)&&(hi.hLinePoint=xl))}}}}}Zt();function sr(Wa,ks,fs){for(var _l=null,es=1/0,rl,ds=0;dsWa.trace.index===Mn.trace.index):Je=[Mn];var Ha=Je.length,ro=ne("x",Mn,Ge),Ft=ne("y",Mn,Ge);Zt(ro,Ft);var Rt=[],qr={},ni=0,oi=function(Wa){var ks=C[Wa.trace.type]?U(Wa):Wa.trace.index;if(!qr[ks])ni++,qr[ks]=ni,Rt.push(Wa);else{var fs=qr[ks]-1,_l=Rt[fs];fs>0&&Math.abs(Wa.distance)Ha-1;Gr--)oi(Je[Gr]);Je=Rt,qi()}var si=J._hoverdata,Pi=[],yi=se(J),zt=_e(J);for(let Wa of Je){var xr=_.makeEventData(Wa,Wa.trace,Wa.cd);if(Wa.hovertemplate!==!1){var Jr=!1;Wa.cd[Wa.index]&&Wa.cd[Wa.index].ht&&(Jr=Wa.cd[Wa.index].ht),Wa.hovertemplate=Jr||Wa.trace.hovertemplate||!1}if(Wa.xa&&Wa.ya){var Ri=Wa.x0+Wa.xa._offset,tn=Wa.x1+Wa.xa._offset,_n=Wa.y0+Wa.ya._offset,Zi=Wa.y1+Wa.ya._offset,Wi=Math.min(Ri,tn),dn=Math.max(Ri,tn),Ua=Math.min(_n,Zi),ea=Math.max(_n,Zi);xr.bbox={x0:Wi+zt,x1:dn+zt,y0:Ua+yi,y1:ea+yi}}Wa.eventData=[xr],Pi.push(xr)}J._hoverdata=Pi;var fo=ct==="y"&&(ot.length>1||Je.length>1)||ct==="closest"&&un&&Je.length>1,ho=s.combine(Ge.plot_bgcolor||s.background,Ge.paper_bgcolor),Vo=W(Je,{gd:J,hovermode:ct,rotateLabels:fo,bgColor:ho,container:Ge._hoverlayer,outerContainer:Ge._paper.node(),commonLabelOpts:Ge.hoverlabel,hoverdistance:Ge.hoverdistance}),Ao=Vo.hoverLabels;if(_.isUnifiedHover(ct)||($(Ao,fo,Ge,Vo.commonLabelBoundingBox),ee(Ao,fo,Ge._invScaleX,Ge._invScaleY)),Be&&Be.tagName){var Wo=x.getComponentMethod("annotations","hasClickToShow")(J,Pi);o(Y.select(Be),Wo?"pointer":"")}!Be||Ce||!ve(J,me,si)||(si&&J.emit("plotly_unhover",{event:me,points:si}),J.emit("plotly_hover",{event:me,points:J._hoverdata,xaxes:mr,yaxes:Kr,xvals:De,yvals:ye}))}function U(J){return[J.trace.index,J.index,J.x0,J.y0,J.name,J.attr,J.xa?J.xa._id:"",J.ya?J.ya._id:""].join(",")}var V=/([\s\S]*)<\/extra>/;function W(J,me){var fe=me.gd,Ce=fe._fullLayout,Be=me.hovermode,Oe=me.rotateLabels,Ze=me.bgColor,Ge=me.container,rt=me.outerContainer,_t=me.commonLabelOpts||{};if(J.length===0)return[[]];var pt=me.fontFamily||A.HOVERFONT,gt=me.fontSize||A.HOVERFONTSIZE,ct=me.fontWeight||Ce.font.weight,Ae=me.fontStyle||Ce.font.style,ze=me.fontVariant||Ce.font.variant,Ee=me.fontTextcase||Ce.font.textcase,nt=me.fontLineposition||Ce.font.lineposition,xt=me.fontShadow||Ce.font.shadow,ut=J[0],Et=ut.xa,Gt=ut.ya,Jt=Be.charAt(0),gr=Jt+"Label",mr=ut[gr];if(mr===void 0&&Et.type==="multicategory")for(var Kr=0;KrCe.width-zt&&(xr=Ce.width-zt),Ha.attr("d","M"+(si-xr)+",0L"+(si-xr+p)+","+yi+p+"H"+zt+"v"+yi+(g*2+Gr.height)+"H"+-zt+"V"+yi+p+"H"+(si-xr-p)+"Z"),si=xr,He.minX=si-zt,He.maxX=si+zt,Et.side==="top"?(He.minY=Pi-(g*2+Gr.height),He.maxY=Pi-g):(He.minY=Pi+g,He.maxY=Pi+(g*2+Gr.height))}else{var Jr,Ri,tn;Gt.side==="right"?(Jr="start",Ri=1,tn="",si=Et._offset+Et._length):(Jr="end",Ri=-1,tn="-",si=Et._offset),Pi=Gt._offset+(ut.y0+ut.y1)/2,ro.attr("text-anchor",Jr),Ha.attr("d","M0,0L"+tn+p+","+p+"V"+(g+Gr.height/2)+"h"+tn+(g*2+Gr.width)+"V-"+(g+Gr.height/2)+"H"+tn+p+"V-"+p+"Z"),He.minY=Pi-(g+Gr.height/2),He.maxY=Pi+(g+Gr.height/2),Gt.side==="right"?(He.minX=si+p,He.maxX=si+p+(g*2+Gr.width)):(He.minX=si-p-(g*2+Gr.width),He.maxX=si-p);var _n=Gr.height/2,Zi=Mr-Gr.top-_n,Wi="clip"+Ce._uid+"commonlabel"+Gt._id,dn;if(siHa.hoverinfo!=="none");if(Mn.length===0)return[];var at=Ce.hoverlabel,ht=at.font,At=Mn[0],Wt=((Be==="x unified"?At.xa:At.ya).unifiedhovertitle||{}).text,Kt=Wt?z.hovertemplateString({data:Be==="x unified"?[{xa:At.xa,x:At.xVal}]:[{ya:At.ya,y:At.yVal}],fallback:At.trace.hovertemplatefallback,locale:Ce._d3locale,template:Wt}):mr,hr={showlegend:!0,legend:{title:{text:Kt,font:ht},font:ht,bgcolor:at.bgcolor,bordercolor:at.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Ce.legend?Ce.legend.traceorder:void 0,orientation:"v"}},zr={font:ht};f(hr,zr,fe._fullData);var Dr=zr.legend;Dr.entries=[];for(var br=0;br=0?Gn=Ui:Hi+ga=0?Gn=Hi:En+ga=0?Xn=fi:qi+na=0?Xn=qi:Rn+na=0,(Mn.idealAlign==="top"||!fo)&&ho?(tn-=Zi/2,Mn.anchor="end"):fo?(tn+=Zi/2,Mn.anchor="start"):Mn.anchor="middle",Mn.crossPos=tn;else{if(Mn.pos=tn,fo=Ri+_n/2+ea<=ui,ho=Ri-_n/2-ea>=0,(Mn.idealAlign==="left"||!fo)&&ho)Ri-=_n/2,Mn.anchor="end";else if(fo)Ri+=_n/2,Mn.anchor="start";else{Mn.anchor="middle";var Vo=ea/2,Ao=Ri+Vo-ui,Wo=Ri-Vo;Ao>0&&(Ri-=Ao),Wo<0&&(Ri+=-Wo)}Mn.crossPos=Ri}Pi.attr("text-anchor",Mn.anchor),zt&&yi.attr("text-anchor",Mn.anchor),Ha.attr("transform",i(Ri,tn)+(Oe?n(w):""))}),{hoverLabels:sa,commonLabelBoundingBox:He}}function F(J,me,fe,Ce,Be,Oe){var Ze="",Ge="";J.nameOverride!==void 0&&(J.name=J.nameOverride),J.name&&(J.trace._meta&&(J.name=z.templateString(J.name,J.trace._meta)),Ze=re(J.name,J.nameLength));var rt=fe.charAt(0),_t=rt==="x"?"y":"x";J.zLabel!==void 0?(J.xLabel!==void 0&&(Ge+="x: "+J.xLabel+"
"),J.yLabel!==void 0&&(Ge+="y: "+J.yLabel+"
"),J.trace.type!=="choropleth"&&J.trace.type!=="choroplethmapbox"&&J.trace.type!=="choroplethmap"&&(Ge+=(Ge?"z: ":"")+J.zLabel)):me&&J[rt+"Label"]===Be?Ge=J[_t+"Label"]||"":J.xLabel===void 0?J.yLabel!==void 0&&J.trace.type!=="scattercarpet"&&(Ge=J.yLabel):J.yLabel===void 0?Ge=J.xLabel:Ge="("+J.xLabel+", "+J.yLabel+")",(J.text||J.text===0)&&!Array.isArray(J.text)&&(Ge+=(Ge?"
":"")+J.text),J.extraText!==void 0&&(Ge+=(Ge?"
":"")+J.extraText),Oe&&Ge===""&&!J.hovertemplate&&(Ze===""&&Oe.remove(),Ge=Ze);let{hovertemplate:pt=!1}=J;if(pt){let gt=J.hovertemplateLabels||J;J[rt+"Label"]!==Be&&(gt[rt+"other"]=gt[rt+"Val"],gt[rt+"otherLabel"]=gt[rt+"Label"]),Ge=z.hovertemplateString({data:[J.eventData[0]||{},J.trace._meta],fallback:J.trace.hovertemplatefallback,labels:gt,locale:Ce._d3locale,template:pt}),Ge=Ge.replace(V,(ct,Ae)=>(Ze=re(Ae,J.nameLength),""))}return[Ge,Ze]}function $(J,me,fe,Ce){var Be=me?"xa":"ya",Oe=me?"ya":"xa",Ze=0,Ge=1,rt=J.size(),_t=new Array(rt),pt=0,gt=Ce.minX,ct=Ce.maxX,Ae=Ce.minY,ze=Ce.maxY,Ee=function(De){return De*fe._invScaleX},nt=function(De){return De*fe._invScaleY};J.each(function(De){var ye=De[Be],Pe=De[Oe],He=ye._id.charAt(0)==="x",at=ye.range;pt===0&&at&&at[0]>at[1]!==He&&(Ge=-1);var ht=0,At=He?fe.width:fe.height;if(fe.hovermode==="x"||fe.hovermode==="y"){var Wt=q(De,me),Kt=De.anchor,hr=Kt==="end"?-1:1,zr,Dr;if(Kt==="middle")zr=De.crossPos+(He?nt(Wt.y-De.by/2):Ee(De.bx/2+De.tx2width/2)),Dr=zr+(He?nt(De.by):Ee(De.bx));else if(He)zr=De.crossPos+nt(p+Wt.y)-nt(De.by/2-p),Dr=zr+nt(De.by);else{var br=Ee(hr*p+Wt.x),hi=br+Ee(hr*De.bx);zr=De.crossPos+Math.min(br,hi),Dr=De.crossPos+Math.max(br,hi)}He?Ae!==void 0&&ze!==void 0&&Math.min(Dr,ze)-Math.max(zr,Ae)>1&&(Pe.side==="left"?(ht=Pe._mainLinePosition,At=fe.width):At=Pe._mainLinePosition):gt!==void 0&&ct!==void 0&&Math.min(Dr,ct)-Math.max(zr,gt)>1&&(Pe.side==="top"?(ht=Pe._mainLinePosition,At=fe.height):At=Pe._mainLinePosition)}_t[pt++]=[{datum:De,traceIndex:De.trace.index,dp:0,pos:De.pos,posref:De.posref,size:De.by*(He?E:1)/2,pmin:ht,pmax:At}]}),_t.sort(function(De,ye){return De[0].posref-ye[0].posref||Ge*(ye[0].traceIndex-De[0].traceIndex)});var xt,ut,Et,Gt,Jt,gr,mr;function Kr(De){var ye=De[0],Pe=De[De.length-1];if(ut=ye.pmin-ye.pos-ye.dp+ye.size,Et=Pe.pos+Pe.dp+Pe.size-ye.pmax,ut>.01){for(Jt=De.length-1;Jt>=0;Jt--)De[Jt].dp+=ut;xt=!1}if(!(Et<.01)){if(ut<-.01){for(Jt=De.length-1;Jt>=0;Jt--)De[Jt].dp-=Et;xt=!1}if(xt){var He=0;for(Gt=0;Gtye.pmax&&He++;for(Gt=De.length-1;Gt>=0&&!(He<=0);Gt--)gr=De[Gt],gr.pos>ye.pmax-1&&(gr.del=!0,He--);for(Gt=0;Gt=0;Jt--)De[Jt].dp-=Et;for(Gt=De.length-1;Gt>=0&&!(He<=0);Gt--)gr=De[Gt],gr.pos+gr.dp+gr.size>ye.pmax&&(gr.del=!0,He--)}}}for(;!xt&&Ze<=rt;){for(Ze++,xt=!0,Gt=0;Gt<_t.length-1;){var ri=_t[Gt],Mr=_t[Gt+1],ui=ri[ri.length-1],mi=Mr[0];if(ut=ui.pos+ui.dp+ui.size-mi.pos-mi.dp+mi.size,ut>.01){for(Jt=Mr.length-1;Jt>=0;Jt--)Mr[Jt].dp+=ut;for(ri.push.apply(ri,Mr),_t.splice(Gt+1,1),mr=0,Jt=ri.length-1;Jt>=0;Jt--)mr+=ri[Jt].dp;for(Et=mr/ri.length,Jt=ri.length-1;Jt>=0;Jt--)ri[Jt].dp-=Et;xt=!1}else Gt++}_t.forEach(Kr)}for(Gt=_t.length-1;Gt>=0;Gt--){var Ot=_t[Gt];for(Jt=Ot.length-1;Jt>=0;Jt--){var Je=Ot[Jt],ot=Je.datum;ot.offset=Je.dp,ot.del=Je.del}}}function q(J,me){var fe=0,Ce=J.offset;return me&&(Ce*=-M,fe=J.offset*I),{x:fe,y:Ce}}function G(J){var me={start:1,end:-1,middle:0}[J.anchor],fe=me*(p+g),Ce=fe+me*(J.txwidth+g),Be=J.anchor==="middle";return Be&&(fe-=J.tx2width/2,Ce+=J.txwidth/2+g),{alignShift:me,textShiftX:fe,text2ShiftX:Ce}}function ee(J,me,fe,Ce){var Be=function(Ze){return Ze*fe},Oe=function(Ze){return Ze*Ce};J.each(function(Ze){var Ge=Y.select(this);if(Ze.del)return Ge.remove();var rt=Ge.select("text.nums"),_t=Ze.anchor,pt=_t==="end"?-1:1,gt=G(Ze),ct=q(Ze,me),Ae=ct.x,ze=ct.y,Ee=_t==="middle",nt="hoverlabel"in Ze.trace?Ze.trace.hoverlabel.showarrow:!0,xt;Ee?xt="M-"+Be(Ze.bx/2+Ze.tx2width/2)+","+Oe(ze-Ze.by/2)+"h"+Be(Ze.bx)+"v"+Oe(Ze.by)+"h-"+Be(Ze.bx)+"Z":nt?xt="M0,0L"+Be(pt*p+Ae)+","+Oe(p+ze)+"v"+Oe(Ze.by/2-p)+"h"+Be(pt*Ze.bx)+"v-"+Oe(Ze.by)+"H"+Be(pt*p+Ae)+"V"+Oe(ze-p)+"Z":xt="M"+Be(pt*p+Ae)+","+Oe(ze-Ze.by/2)+"h"+Be(pt*Ze.bx)+"v"+Oe(Ze.by)+"h"+Be(-pt*Ze.bx)+"Z",Ge.select("path").attr("d",xt);var ut=Ae+gt.textShiftX,Et=ze+Ze.ty0-Ze.by/2+g,Gt=Ze.textAlign||"auto";Gt!=="auto"&&(Gt==="left"&&_t!=="start"?(rt.attr("text-anchor","start"),ut=Ee?-Ze.bx/2-Ze.tx2width/2+g:-Ze.bx-g):Gt==="right"&&_t!=="end"&&(rt.attr("text-anchor","end"),ut=Ee?Ze.bx/2-Ze.tx2width/2-g:Ze.bx+g)),rt.call(l.positionText,Be(ut),Oe(Et)),Ze.tx2width&&(Ge.select("text.name").call(l.positionText,Be(gt.text2ShiftX+gt.alignShift*g+Ae),Oe(ze+Ze.ty0-Ze.by/2+g)),Ge.select("rect").call(u.setRect,Be(gt.text2ShiftX+(gt.alignShift-1)*Ze.tx2width/2+Ae),Oe(ze-Ze.by/2-1),Be(Ze.tx2width),Oe(Ze.by+2)))})}function he(J,me){var fe=J.index,Ce=J.trace||{},Be=J.cd[0],Oe=J.cd[fe]||{};function Ze(ct){return ct||d(ct)&&ct===0}var Ge=Array.isArray(fe)?function(ct,Ae){var ze=z.castOption(Be,fe,ct);return Ze(ze)?ze:z.extractOption({},Ce,"",Ae)}:function(ct,Ae){return z.extractOption(Oe,Ce,ct,Ae)};function rt(ct,Ae,ze){var Ee=Ge(Ae,ze);Ze(Ee)&&(J[ct]=Ee)}if(rt("hoverinfo","hi","hoverinfo"),rt("bgcolor","hbg","hoverlabel.bgcolor"),rt("borderColor","hbc","hoverlabel.bordercolor"),rt("fontFamily","htf","hoverlabel.font.family"),rt("fontSize","hts","hoverlabel.font.size"),rt("fontColor","htc","hoverlabel.font.color"),rt("fontWeight","htw","hoverlabel.font.weight"),rt("fontStyle","hty","hoverlabel.font.style"),rt("fontVariant","htv","hoverlabel.font.variant"),rt("nameLength","hnl","hoverlabel.namelength"),rt("textAlign","hta","hoverlabel.align"),J.posref=me==="y"||me==="closest"&&Ce.orientation==="h"?J.xa._offset+(J.x0+J.x1)/2:J.ya._offset+(J.y0+J.y1)/2,J.x0=z.constrain(J.x0,0,J.xa._length),J.x1=z.constrain(J.x1,0,J.xa._length),J.y0=z.constrain(J.y0,0,J.ya._length),J.y1=z.constrain(J.y1,0,J.ya._length),J.xLabelVal!==void 0&&(J.xLabel="xLabel"in J?J.xLabel:m.hoverLabelText(J.xa,J.xLabelVal,Ce.xhoverformat),J.xVal=J.xa.c2d(J.xLabelVal)),J.yLabelVal!==void 0&&(J.yLabel="yLabel"in J?J.yLabel:m.hoverLabelText(J.ya,J.yLabelVal,Ce.yhoverformat),J.yVal=J.ya.c2d(J.yLabelVal)),J.zLabelVal!==void 0&&J.zLabel===void 0&&(J.zLabel=String(J.zLabelVal)),!isNaN(J.xerr)&&!(J.xa.type==="log"&&J.xerr<=0)){var _t=m.tickText(J.xa,J.xa.c2l(J.xerr),"hover").text;J.xerrneg!==void 0?J.xLabel+=" +"+_t+" / -"+m.tickText(J.xa,J.xa.c2l(J.xerrneg),"hover").text:J.xLabel+=" ± "+_t,me==="x"&&(J.distance+=1)}if(!isNaN(J.yerr)&&!(J.ya.type==="log"&&J.yerr<=0)){var pt=m.tickText(J.ya,J.ya.c2l(J.yerr),"hover").text;J.yerrneg!==void 0?J.yLabel+=" +"+pt+" / -"+m.tickText(J.ya,J.ya.c2l(J.yerrneg),"hover").text:J.yLabel+=" ± "+pt,me==="y"&&(J.distance+=1)}var gt=J.hoverinfo||J.trace.hoverinfo;return gt&>!=="all"&&(gt=Array.isArray(gt)?gt:gt.split("+"),gt.indexOf("x")===-1&&(J.xLabel=void 0),gt.indexOf("y")===-1&&(J.yLabel=void 0),gt.indexOf("z")===-1&&(J.zLabel=void 0),gt.indexOf("text")===-1&&(J.text=void 0),gt.indexOf("name")===-1&&(J.name=void 0)),J}function xe(J,me,fe){var Ce=fe.container,Be=fe.fullLayout,Oe=Be._size,Ze=fe.event,Ge=!!me.hLinePoint,rt=!!me.vLinePoint,_t,pt;if(Ce.selectAll(".spikeline").remove(),!!(rt||Ge)){var gt=s.combine(Be.plot_bgcolor,Be.paper_bgcolor);if(Ge){var ct=me.hLinePoint,Ae,ze;_t=ct&&ct.xa,pt=ct&&ct.ya;var Ee=pt.spikesnap;Ee==="cursor"?(Ae=Ze.pointerX,ze=Ze.pointerY):(Ae=_t._offset+ct.x,ze=pt._offset+ct.y);var nt=y.readability(ct.color,gt)<1.5?s.contrast(gt):ct.color,xt=pt.spikemode,ut=pt.spikethickness,Et=pt.spikecolor||nt,Gt=m.getPxPosition(J,pt),Jt,gr;if(xt.indexOf("toaxis")!==-1||xt.indexOf("across")!==-1){if(xt.indexOf("toaxis")!==-1&&(Jt=Gt,gr=Ae),xt.indexOf("across")!==-1){var mr=pt._counterDomainMin,Kr=pt._counterDomainMax;pt.anchor==="free"&&(mr=Math.min(mr,pt.position),Kr=Math.max(Kr,pt.position)),Jt=Oe.l+mr*Oe.w,gr=Oe.l+Kr*Oe.w}Ce.insert("line",":first-child").attr({x1:Jt,x2:gr,y1:ze,y2:ze,"stroke-width":ut,stroke:Et,"stroke-dasharray":u.dashStyle(pt.spikedash,ut)}).classed("spikeline",!0).classed("crisp",!0),Ce.insert("line",":first-child").attr({x1:Jt,x2:gr,y1:ze,y2:ze,"stroke-width":ut+2,stroke:gt}).classed("spikeline",!0).classed("crisp",!0)}xt.indexOf("marker")!==-1&&Ce.insert("circle",":first-child").attr({cx:Gt+(pt.side!=="right"?ut:-ut),cy:ze,r:ut,fill:Et}).classed("spikeline",!0)}if(rt){var ri=me.vLinePoint,Mr,ui;_t=ri&&ri.xa,pt=ri&&ri.ya;var mi=_t.spikesnap;mi==="cursor"?(Mr=Ze.pointerX,ui=Ze.pointerY):(Mr=_t._offset+ri.x,ui=pt._offset+ri.y);var Ot=y.readability(ri.color,gt)<1.5?s.contrast(gt):ri.color,Je=_t.spikemode,ot=_t.spikethickness,De=_t.spikecolor||Ot,ye=m.getPxPosition(J,_t),Pe,He;if(Je.indexOf("toaxis")!==-1||Je.indexOf("across")!==-1){if(Je.indexOf("toaxis")!==-1&&(Pe=ye,He=ui),Je.indexOf("across")!==-1){var at=_t._counterDomainMin,ht=_t._counterDomainMax;_t.anchor==="free"&&(at=Math.min(at,_t.position),ht=Math.max(ht,_t.position)),Pe=Oe.t+(1-ht)*Oe.h,He=Oe.t+(1-at)*Oe.h}Ce.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:Pe,y2:He,"stroke-width":ot,stroke:De,"stroke-dasharray":u.dashStyle(_t.spikedash,ot)}).classed("spikeline",!0).classed("crisp",!0),Ce.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:Pe,y2:He,"stroke-width":ot+2,stroke:gt}).classed("spikeline",!0).classed("crisp",!0)}Je.indexOf("marker")!==-1&&Ce.insert("circle",":first-child").attr({cx:Mr,cy:ye-(_t.side!=="top"?ot:-ot),r:ot,fill:De}).classed("spikeline",!0)}}}function ve(J,me,fe){if(!fe||fe.length!==J._hoverdata.length)return!0;for(var Ce=fe.length-1;Ce>=0;Ce--){var Be=fe[Ce],Oe=J._hoverdata[Ce];if(Be.curveNumber!==Oe.curveNumber||String(Be.pointNumber)!==String(Oe.pointNumber)||String(Be.pointNumbers)!==String(Oe.pointNumbers)||Be.binNumber!==Oe.binNumber)return!0}return!1}function ce(J,me){return!0}function re(J,me){return l.plainText(J||"",{len:me,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ge(J,me){for(var fe=me.charAt(0),Ce=[],Be=[],Oe=[],Ze=0;ZeJ.offsetTop+J.clientTop,_e=J=>J.offsetLeft+J.clientLeft;function oe(J,me){var fe=J._fullLayout,Ce=me.getBoundingClientRect(),Be=Ce.left,Oe=Ce.top,Ze=Be+Ce.width,Ge=Oe+Ce.height,rt=z.apply3DTransform(fe._invTransform)(Be,Oe),_t=z.apply3DTransform(fe._invTransform)(Ze,Ge),pt=rt[0],gt=rt[1],ct=_t[0],Ae=_t[1];return{x:pt,y:gt,width:ct-pt,height:Ae-gt,top:Math.min(gt,Ae),left:Math.min(pt,ct),right:Math.max(pt,ct),bottom:Math.max(gt,Ae)}}}),qv=Fe((te,Y)=>{var d=ji(),y=Xi(),z=T0().isUnifiedHover;Y.exports=function(P,i,n,a){a=a||{};var l=i.legend;function o(u){a.font[u]||(a.font[u]=l?i.legend.font[u]:i.font[u])}i&&z(i.hovermode)&&(a.font||(a.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),l?(a.bgcolor||(a.bgcolor=y.combine(i.legend.bgcolor,i.paper_bgcolor)),a.bordercolor||(a.bordercolor=i.legend.bordercolor)):a.bgcolor||(a.bgcolor=i.paper_bgcolor)),n("hoverlabel.bgcolor",a.bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),n("hoverlabel.showarrow",a.showarrow),d.coerceFont(n,"hoverlabel.font",a.font),n("hoverlabel.align",a.align)}}),Gv=Fe((te,Y)=>{var d=ji(),y=qv(),z=Ya();Y.exports=function(P,i){function n(a,l){return d.coerce(P,i,z,a,l)}y(P,i,n)}}),h8=Fe((te,Y)=>{var d=ji(),y=zo(),z=qv();Y.exports=function(P,i,n,a){function l(u,s){return d.coerce(P,i,y,u,s)}var o=d.extendFlat({},a.hoverlabel);i.hovertemplate&&(o.namelength=-1),z(P,i,l,o)}}),X1=Fe((te,Y)=>{var d=ji(),y=Ya();Y.exports=function(z,P){function i(n,a){return P[n]!==void 0?P[n]:d.coerce(z,P,y,n,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}),fm=Fe((te,Y)=>{var d=ji(),y=Ya(),z=X1(),P=qv();Y.exports=function(i,n){function a(b,x){return d.coerce(i,n,y,b,x)}var l=z(i,n);l&&(a("hoverdistance"),a("spikedistance"));var o=a("dragmode");o==="select"&&a("selectdirection");var u=n._has("mapbox"),s=n._has("map"),h=n._has("geo"),m=n._basePlotModules.length;n.dragmode==="zoom"&&((u||s||h)&&m===1||(u||s)&&h&&m===2)&&(n.dragmode="pan"),P(i,n,a),d.coerceFont(a,"hoverlabel.grouptitlefont",n.hoverlabel.font)}}),S4=Fe((te,Y)=>{var d=ji(),y=as();Y.exports=function(P){var i=P.calcdata,n=P._fullLayout;function a(h){return function(m){return d.coerceHoverinfo({hoverinfo:m},{_module:h._module},n)}}for(var l=0;l{var d=as(),y=fw().hover;Y.exports=function(z,P,i){var n=d.getComponentMethod("annotations","onClick")(z,z._hoverdata);i!==void 0&&y(z,P,i,!0);function a(){z.emit("plotly_click",{points:z._hoverdata,event:P})}z._hoverdata&&P&&P.target&&(n&&n.then?n.then(a):a(),P.stopImmediatePropagation&&P.stopImmediatePropagation())}}),hf=Fe((te,Y)=>{var d=ii(),y=ji(),z=Np(),P=T0(),i=Ya(),n=fw();Y.exports={moduleType:"component",name:"fx",constants:Ra(),schema:{layout:i},attributes:zo(),layoutAttributes:i,supplyLayoutGlobalDefaults:Gv(),supplyDefaults:h8(),supplyLayoutDefaults:fm(),calc:S4(),getDistanceFunction:P.getDistanceFunction,getClosest:P.getClosest,inbox:P.inbox,quadrature:P.quadrature,appendArrayPointValue:P.appendArrayPointValue,castHoverOption:l,castHoverinfo:o,hover:n.hover,unhover:z.unhover,loneHover:n.loneHover,loneUnhover:a,click:C4()};function a(u){var s=y.isD3Selection(u)?u:d.select(u);s.selectAll("g.hovertext").remove(),s.selectAll(".spikeline").remove()}function l(u,s,h){return y.castOption(u,s,"hoverlabel."+h)}function o(u,s,h){function m(b){return y.coerceHoverinfo({hoverinfo:b},{_module:u._module},s)}return y.castOption(u,h,"hoverinfo",m)}}),dm=Fe(te=>{te.selectMode=function(Y){return Y==="lasso"||Y==="select"},te.drawMode=function(Y){return Y==="drawclosedpath"||Y==="drawopenpath"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},te.openMode=function(Y){return Y==="drawline"||Y==="drawopenpath"},te.rectMode=function(Y){return Y==="select"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},te.freeMode=function(Y){return Y==="lasso"||Y==="drawclosedpath"||Y==="drawopenpath"},te.selectingOrDrawing=function(Y){return te.freeMode(Y)||te.rectMode(Y)}}),J1=Fe((te,Y)=>{Y.exports=function(d){var y=d._fullLayout;y._glcanvas&&y._glcanvas.size()&&y._glcanvas.each(function(z){z.regl&&z.regl.clear({color:!0,depth:!0})})}}),dw=Fe((te,Y)=>{Y.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}),pw=Fe((te,Y)=>{var d=32;Y.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),eb=Fe((te,Y)=>{var d=ji().strTranslate;function y(n,a){switch(n.type){case"log":return n.p2d(a);case"date":return n.p2r(a,0,n.calendar);default:return n.p2r(a)}}function z(n,a){switch(n.type){case"log":return n.d2p(a);case"date":return n.r2p(a,0,n.calendar);default:return n.r2p(a)}}function P(n){var a=n._id.charAt(0)==="y"?1:0;return function(l){return y(n,l[a])}}function i(n){return d(n.xaxis._offset,n.yaxis._offset)}Y.exports={p2r:y,r2p:z,axValue:P,getTransform:i}}),Zv=Fe(te=>{var Y=T_(),d=pw(),y=d.CIRCLE_SIDES,z=d.SQRT2,P=eb(),i=P.p2r,n=P.r2p,a=[0,3,4,5,6,1,2],l=[0,3,4,1,2];te.writePaths=function(s){var h=s.length;if(!h)return"M0,0Z";for(var m="",b=0;b0&&k{var d=Zc(),y=dm(),z=y.drawMode,P=y.openMode,i=pw(),n=i.i000,a=i.i090,l=i.i180,o=i.i270,u=i.cos45,s=i.sin45,h=eb(),m=h.p2r,b=h.r2p,x=Am(),_=x.clearOutline,A=Zv(),f=A.readPaths,k=A.writePaths,w=A.ellipseOver,D=A.fixDatesForPaths;function E(M,p){if(M.length){var g=M[0][0];if(g){var C=p.gd,T=p.isActiveShape,N=p.dragmode,B=(C.layout||{}).shapes||[];if(!z(N)&&T!==void 0){var U=C._fullLayout._activeShapeIndex;if(U{var d=dm(),y=d.selectMode,z=Am(),P=z.clearOutline,i=Zv(),n=i.readPaths,a=i.writePaths,l=i.fixDatesForPaths;Y.exports=function(o,u){if(o.length){var s=o[0][0];if(s){var h=s.getAttribute("d"),m=u.gd,b=m._fullLayout.newselection,x=u.plotinfo,_=x.xaxis,A=x.yaxis,f=u.isActiveSelection,k=u.dragmode,w=(m.layout||{}).selections||[];if(!y(k)&&f!==void 0){var D=m._fullLayout._activeSelectionIndex;if(D{Y.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),o0=Fe(te=>{var Y=tb(),d=ji(),y=Os();te.rangeToShapePosition=function(i){return i.type==="log"?i.r2d:function(n){return n}},te.shapePositionToRange=function(i){return i.type==="log"?i.d2r:function(n){return n}},te.decodeDate=function(i){return function(n){return n.replace&&(n=n.replace("_"," ")),i(n)}},te.encodeDate=function(i){return function(n){return i(n).replace(" ","_")}},te.extractPathCoords=function(i,n,a){var l=[],o=i.match(Y.segmentRE);return o.forEach(function(u){var s=n[u.charAt(0)].drawn;if(s!==void 0){var h=u.substr(1).match(Y.paramRE);if(!(!h||h.lengthf&&(w="X"),w});return b>f&&(k=k.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+m)),x+k})}function P(i,n){n=n||0;var a=0;return n&&i&&(i.type==="category"||i.type==="multicategory")&&(a=(i.r2p(1)-i.r2p(0))*n),a}}),A4=Fe((te,Y)=>{var d=ji(),y=Os(),z=cc(),P=Zs(),i=Zv().readPaths,n=o0(),a=n.getPathString,l=v_(),o=Bf().FROM_TL;Y.exports=function(h,m,b,x){if(x.selectAll(".shape-label").remove(),!!(b.label.text||b.label.texttemplate)){var _;if(b.label.texttemplate){var A={};if(b.type!=="path"){var f=y.getFromId(h,b.xref),k=y.getFromId(h,b.yref);for(var w in l){var D=l[w](b,f,k);D!==void 0&&(A[w]=D)}}_=d.texttemplateStringForShapes({data:[A],fallback:b.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:b.label.texttemplate})}else _=b.label.text;var E={"data-index":m},I=b.label.font,M={"data-notex":1},p=x.append("g").attr(E).classed("shape-label",!0),g=p.append("text").attr(M).classed("shape-label-text",!0).text(_),C,T,N,B;if(b.path){var U=a(h,b),V=i(U,h);C=1/0,N=1/0,T=-1/0,B=-1/0;for(var W=0;W=h?_=m-x:_=x-m,-180/Math.PI*Math.atan2(_,A)}function s(h,m,b,x,_,A,f){var k=_.label.textposition,w=_.label.textangle,D=_.label.padding,E=_.type,I=Math.PI/180*A,M=Math.sin(I),p=Math.cos(I),g=_.label.xanchor,C=_.label.yanchor,T,N,B,U;if(E==="line"){k==="start"?(T=h,N=m):k==="end"?(T=b,N=x):(T=(h+b)/2,N=(m+x)/2),g==="auto"&&(k==="start"?w==="auto"?b>h?g="left":bh?g="right":bh?g="right":bh?g="left":b{var d=ji(),y=d.strTranslate,z=Np(),P=dm(),i=P.drawMode,n=P.selectMode,a=as(),l=Xi(),o=pw(),u=o.i000,s=o.i090,h=o.i180,m=o.i270,b=Am(),x=b.clearOutlineControllers,_=Zv(),A=_.pointsOnRectangle,f=_.pointsOnEllipse,k=_.writePaths,w=K0().newShapes,D=K0().createShapeObj,E=Kv(),I=A4();Y.exports=function C(T,N,B,U){U||(U=0);var V=B.gd;function W(){C(T,N,B,U++),(f(T[0])||B.hasText)&&F({redrawing:!0})}function F(gt){var ct={};B.isActiveShape!==void 0&&(B.isActiveShape=!1,ct=w(N,B)),B.isActiveSelection!==void 0&&(B.isActiveSelection=!1,ct=E(N,B),V._fullLayout._reselect=!0),Object.keys(ct).length&&a.call((gt||{}).redrawing?"relayout":"_guiRelayout",V,ct)}var $=V._fullLayout,q=$._zoomlayer,G=B.dragmode,ee=i(G),he=n(G);(ee||he)&&(V._fullLayout._outlining=!0),x(V),N.attr("d",k(T));var xe,ve,ce,re,ge;if(!U&&(B.isActiveShape||B.isActiveSelection)){ge=M([],T);var ne=q.append("g").attr("class","outline-controllers");Be(ne),pt()}if(ee&&B.hasText){var se=q.select(".label-temp"),_e=D(N,B,B.dragmode);I(V,"label-temp",_e,se)}function oe(gt){ce=+gt.srcElement.getAttribute("data-i"),re=+gt.srcElement.getAttribute("data-j"),xe[ce][re].moveFn=J}function J(gt,ct){if(T.length){var Ae=ge[ce][re][1],ze=ge[ce][re][2],Ee=T[ce],nt=Ee.length;if(A(Ee)){var xt=gt,ut=ct;if(B.isActiveSelection){var Et=p(Ee,re);Et[1]===Ee[re][1]?ut=0:xt=0}for(var Gt=0;Gt1&&!(gt.length===2&>[1][0]==="Z")&&(re===0&&(gt[0][0]="M"),T[ce]=gt,W(),F())}}function Ce(gt,ct){if(gt===2){ce=+ct.srcElement.getAttribute("data-i"),re=+ct.srcElement.getAttribute("data-j");var Ae=T[ce];!A(Ae)&&!f(Ae)&&fe()}}function Be(gt){xe=[];for(var ct=0;ct{var d=ii(),y=as(),z=ji(),P=Os(),i=Zv().readPaths,n=Yg(),a=A4(),l=Am().clearOutlineControllers,o=Xi(),u=Zs(),s=ku().arrayEditor,h=Np(),m=Em(),b=tb(),x=o0(),_=x.getPathString;Y.exports={draw:A,drawOne:w,eraseActiveShape:g,drawLabel:a};function A(C){var T=C._fullLayout;T._shapeUpperLayer.selectAll("path").remove(),T._shapeLowerLayer.selectAll("path").remove(),T._shapeUpperLayer.selectAll("text").remove(),T._shapeLowerLayer.selectAll("text").remove();for(var N in T._plots){var B=T._plots[N].shapelayer;B&&(B.selectAll("path").remove(),B.selectAll("text").remove())}for(var U=0;UW&&at>F&&!ye.shiftKey?h.getCursor(ht/He,1-At/at):"move";m(T,Wt),Jt=Wt.split("-")[0]}}function ri(ye){f(C)||($&&(ge=Ee(N.xanchor)),q&&(ne=nt(N.yanchor)),N.type==="path"?Oe=N.path:(xe=$?N.x0:Ee(N.x0),ve=q?N.y0:nt(N.y0),ce=$?N.x1:Ee(N.x1),re=q?N.y1:nt(N.y1)),xere?(se=ve,me="y0",_e=re,fe="y1"):(se=re,me="y1",_e=ve,fe="y0"),Kr(ye),Je(U,N),De(T,N,C),Gt.moveFn=Jt==="move"?mi:Ot,Gt.altKey=ye.altKey)}function Mr(){f(C)||(m(T),ot(U),D(T,C,N),y.call("_guiRelayout",C,V.getUpdateObj()))}function ui(){f(C)||ot(U)}function mi(ye,Pe){if(N.type==="path"){var He=function(At){return At},at=He,ht=He;$?he("xanchor",N.xanchor=xt(ge+ye)):(at=function(At){return xt(Ee(At)+ye)},Ge&&Ge.type==="date"&&(at=x.encodeDate(at))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(ht=function(At){return ut(nt(At)+Pe)},_t&&_t.type==="date"&&(ht=x.encodeDate(ht))),he("path",N.path=I(Oe,at,ht))}else $?he("xanchor",N.xanchor=xt(ge+ye)):(he("x0",N.x0=xt(xe+ye)),he("x1",N.x1=xt(ce+ye))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(he("y0",N.y0=ut(ve+Pe)),he("y1",N.y1=ut(re+Pe)));T.attr("d",_(C,N)),Je(U,N),a(C,B,N,Ze)}function Ot(ye,Pe){if(ee){var He=function(fn){return fn},at=He,ht=He;$?he("xanchor",N.xanchor=xt(ge+ye)):(at=function(fn){return xt(Ee(fn)+ye)},Ge&&Ge.type==="date"&&(at=x.encodeDate(at))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(ht=function(fn){return ut(nt(fn)+Pe)},_t&&_t.type==="date"&&(ht=x.encodeDate(ht))),he("path",N.path=I(Oe,at,ht))}else if(G){if(Jt==="resize-over-start-point"){var At=xe+ye,Wt=q?ve-Pe:ve+Pe;he("x0",N.x0=$?At:xt(At)),he("y0",N.y0=q?Wt:ut(Wt))}else if(Jt==="resize-over-end-point"){var Kt=ce+ye,hr=q?re-Pe:re+Pe;he("x1",N.x1=$?Kt:xt(Kt)),he("y1",N.y1=q?hr:ut(hr))}}else{var zr=function(fn){return Jt.indexOf(fn)!==-1},Dr=zr("n"),br=zr("s"),hi=zr("w"),un=zr("e"),cn=Dr?se+Pe:se,yn=br?_e+Pe:_e,Wn=hi?oe+ye:oe,Sn=un?J+ye:J;q&&(Dr&&(cn=se-Pe),br&&(yn=_e-Pe)),(!q&&yn-cn>F||q&&cn-yn>F)&&(he(me,N[me]=q?cn:ut(cn)),he(fe,N[fe]=q?yn:ut(yn))),Sn-Wn>W&&(he(Ce,N[Ce]=$?Wn:xt(Wn)),he(Be,N[Be]=$?Sn:xt(Sn)))}T.attr("d",_(C,N)),Je(U,N),a(C,B,N,Ze)}function Je(ye,Pe){($||q)&&He();function He(){var at=Pe.type!=="path",ht=ye.selectAll(".visual-cue").data([0]),At=1;ht.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":At}).classed("visual-cue",!0);var Wt=Ee($?Pe.xanchor:z.midRange(at?[Pe.x0,Pe.x1]:x.extractPathCoords(Pe.path,b.paramIsX))),Kt=nt(q?Pe.yanchor:z.midRange(at?[Pe.y0,Pe.y1]:x.extractPathCoords(Pe.path,b.paramIsY)));if(Wt=x.roundPositionForSharpStrokeRendering(Wt,At),Kt=x.roundPositionForSharpStrokeRendering(Kt,At),$&&q){var hr="M"+(Wt-1-At)+","+(Kt-1-At)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";ht.attr("d",hr)}else if($){var zr="M"+(Wt-1-At)+","+(Kt-9-At)+"v18 h2 v-18 Z";ht.attr("d",zr)}else{var Dr="M"+(Wt-9-At)+","+(Kt-1-At)+"h18 v2 h-18 Z";ht.attr("d",Dr)}}}function ot(ye){ye.selectAll(".visual-cue").remove()}function De(ye,Pe,He){var at=Pe.xref,ht=Pe.yref,At=P.getFromId(He,at),Wt=P.getFromId(He,ht),Kt="";at!=="paper"&&!At.autorange&&(Kt+=at),ht!=="paper"&&!Wt.autorange&&(Kt+=ht),u.setClipUrl(ye,Kt?"clip"+He._fullLayout._uid+Kt:null,He)}}function I(C,T,N){return C.replace(b.segmentRE,function(B){var U=0,V=B.charAt(0),W=b.paramIsX[V],F=b.paramIsY[V],$=b.numParams[V],q=B.substr(1).replace(b.paramRE,function(G){return U>=$||(W[U]?G=T(G):F[U]&&(G=N(G)),U++),G});return V+q})}function M(C,T){if(k(C)){var N=T.node(),B=+N.getAttribute("data-index");if(B>=0){if(B===C._fullLayout._activeShapeIndex){p(C);return}C._fullLayout._activeShapeIndex=B,C._fullLayout._deactivateShape=p,A(C)}}}function p(C){if(k(C)){var T=C._fullLayout._activeShapeIndex;T>=0&&(l(C),delete C._fullLayout._activeShapeIndex,A(C))}}function g(C){if(k(C)){l(C);var T=C._fullLayout._activeShapeIndex,N=(C.layout||{}).shapes||[];if(T{var d=as(),y=sh(),z=Zc(),P=dw(),i=mw().eraseActiveShape,n=ji(),a=n._,l=Y.exports={};l.toImage={name:"toImage",title:function(E){var I=E._context.toImageButtonOptions||{},M=I.format||"png";return M==="png"?a(E,"Download plot as a PNG"):a(E,"Download plot")},icon:P.camera,click:function(E){var I=E._context.toImageButtonOptions,M={format:I.format||"png"};n.notifier(a(E,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(p){p in I&&(M[p]=I[p])}),d.call("downloadImage",E,M).then(function(p){n.notifier(a(E,"Snapshot succeeded")+" - "+p,"long")}).catch(function(){n.notifier(a(E,"Sorry, there was a problem downloading your snapshot!"),"long")})}},l.sendDataToCloud={name:"sendDataToCloud",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.disk,click:function(E){y.sendDataToCloud(E)}},l.editInChartStudio={name:"editInChartStudio",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.pencil,click:function(E){y.sendDataToCloud(E)}},l.zoom2d={name:"zoom2d",_cat:"zoom",title:function(E){return a(E,"Zoom")},attr:"dragmode",val:"zoom",icon:P.zoombox,click:o},l.pan2d={name:"pan2d",_cat:"pan",title:function(E){return a(E,"Pan")},attr:"dragmode",val:"pan",icon:P.pan,click:o},l.select2d={name:"select2d",_cat:"select",title:function(E){return a(E,"Box Select")},attr:"dragmode",val:"select",icon:P.selectbox,click:o},l.lasso2d={name:"lasso2d",_cat:"lasso",title:function(E){return a(E,"Lasso Select")},attr:"dragmode",val:"lasso",icon:P.lasso,click:o},l.drawclosedpath={name:"drawclosedpath",title:function(E){return a(E,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:P.drawclosedpath,click:o},l.drawopenpath={name:"drawopenpath",title:function(E){return a(E,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:P.drawopenpath,click:o},l.drawline={name:"drawline",title:function(E){return a(E,"Draw line")},attr:"dragmode",val:"drawline",icon:P.drawline,click:o},l.drawrect={name:"drawrect",title:function(E){return a(E,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:P.drawrect,click:o},l.drawcircle={name:"drawcircle",title:function(E){return a(E,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:P.drawcircle,click:o},l.eraseshape={name:"eraseshape",title:function(E){return a(E,"Erase active shape")},icon:P.eraseshape,click:i},l.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(E){return a(E,"Zoom in")},attr:"zoom",val:"in",icon:P.zoom_plus,click:o},l.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(E){return a(E,"Zoom out")},attr:"zoom",val:"out",icon:P.zoom_minus,click:o},l.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(E){return a(E,"Autoscale")},attr:"zoom",val:"auto",icon:P.autoscale,click:o},l.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(E){return a(E,"Reset axes")},attr:"zoom",val:"reset",icon:P.home,click:o},l.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(E){return a(E,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:P.tooltip_basic,gravity:"ne",click:o},l.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(E){return a(E,"Compare data on hover")},attr:"hovermode",val:function(E){return E._fullLayout._isHoriz?"y":"x"},icon:P.tooltip_compare,gravity:"ne",click:o};function o(E,I){var M=I.currentTarget,p=M.getAttribute("data-attr"),g=M.getAttribute("data-val")||!0,C=E._fullLayout,T={},N=z.list(E,null,!0),B=C._cartesianSpikesEnabled,U,V;if(p==="zoom"){var W=g==="in"?.5:2,F=(1+W)/2,$=(1-W)/2,q,G;for(V=0;V{var d=Q1(),y=Object.keys(d),z=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],P=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(z),i=[],n=function(a){if(P.indexOf(a._cat||a.name)===-1){var l=a.name,o=(a._cat||a.name).toLowerCase();i.indexOf(l)===-1&&i.push(l),i.indexOf(o)===-1&&i.push(o)}};y.forEach(function(a){n(d[a])}),i.sort(),Y.exports={DRAW_MODES:z,backButtons:P,foreButtons:i}}),S_=Fe((te,Y)=>{gw(),Y.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),f8=Fe((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=S_();Y.exports=function(i,n){var a=i.modebar||{},l=z.newContainer(n,"modebar");function o(s,h){return d.coerce(a,l,P,s,h)}o("orientation"),o("bgcolor",y.addOpacity(n.paper_bgcolor,.5));var u=y.contrast(y.rgb(n.modebar.bgcolor));o("color",y.addOpacity(u,.3)),o("activecolor",y.addOpacity(u,.7)),o("uirevision",n.uirevision),o("add"),o("remove")}}),Xg=Fe((te,Y)=>{var d=ii(),y=Ar(),z=ji(),P=dw(),i=_i().version,n=new DOMParser;function a(s){this.container=s.container,this.element=document.createElement("div"),this.update(s.graphInfo,s.buttons),this.container.appendChild(this.element)}var l=a.prototype;l.update=function(s,h){this.graphInfo=s;var m=this.graphInfo._context,b=this.graphInfo._fullLayout,x="modebar-"+b._uid;this.element.setAttribute("id",x),this.element.setAttribute("role","toolbar"),this._uid=x,this.element.className="modebar modebar--custom",m.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),b.modebar.orientation==="v"&&(this.element.className+=" vertical",h=h.reverse());var _=b.modebar,A="#"+x+" .modebar-group";document.querySelectorAll(A).forEach(function(E){E.style.backgroundColor=_.bgcolor});var f=!this.hasButtons(h),k=this.hasLogo!==m.displaylogo,w=this.locale!==m.locale;if(this.locale=m.locale,(f||k||w)&&(this.removeAllButtons(),this.updateButtons(h),m.watermark||m.displaylogo)){var D=this.getLogo();m.watermark&&(D.className=D.className+" watermark"),b.modebar.orientation==="v"?this.element.insertBefore(D,this.element.childNodes[0]):this.element.appendChild(D),this.hasLogo=!0}this.updateActiveButton(),z.setStyleOnHover("#"+x+" .modebar-btn",".active",".icon path","fill: "+_.activecolor,"fill: "+_.color,this.element)},l.updateButtons=function(s){var h=this;this.buttons=s,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(m){var b=h.createGroup();m.forEach(function(x){var _=x.name;if(!_)throw new Error("must provide button 'name' in button config");if(h.buttonsNames.indexOf(_)!==-1)throw new Error("button name '"+_+"' is taken");h.buttonsNames.push(_);var A=h.createButton(x);h.buttonElements.push(A),b.appendChild(A)}),h.element.appendChild(b)})},l.createGroup=function(){var s=document.createElement("div");s.className="modebar-group";var h=this.graphInfo._fullLayout.modebar;return s.style.backgroundColor=h.bgcolor,s},l.createButton=function(s){var h=this,m=document.createElement("button");m.setAttribute("type","button"),m.setAttribute("rel","tooltip"),m.className="modebar-btn";var b=s.title;b===void 0?b=s.name:typeof b=="function"&&(b=b(this.graphInfo)),(b||b===0)&&(m.setAttribute("data-title",b),m.setAttribute("aria-label",b)),s.attr!==void 0&&m.setAttribute("data-attr",s.attr);var x=s.val;x!==void 0&&(typeof x=="function"&&(x=x(this.graphInfo)),m.setAttribute("data-val",x));var _=s.click;if(typeof _!="function")throw new Error("must provide button 'click' function in button config");m.addEventListener("click",function(f){s.click(h.graphInfo,f),h.updateActiveButton(f.currentTarget)}),m.setAttribute("data-toggle",s.toggle||!1),s.toggle&&d.select(m).classed("active",!0);var A=s.icon;return typeof A=="function"?m.appendChild(A()):m.appendChild(this.createIcon(A||P.question)),m.setAttribute("data-gravity",s.gravity||"n"),m},l.createIcon=function(s){var h=y(s.height)?Number(s.height):s.ascent-s.descent,m="http://www.w3.org/2000/svg",b;if(s.path){b=document.createElementNS(m,"svg"),b.setAttribute("viewBox",[0,0,s.width,h].join(" ")),b.setAttribute("class","icon");var x=document.createElementNS(m,"path");x.setAttribute("d",s.path),s.transform?x.setAttribute("transform",s.transform):s.ascent!==void 0&&x.setAttribute("transform","matrix(1 0 0 -1 0 "+s.ascent+")"),b.appendChild(x)}if(s.svg){var _=n.parseFromString(s.svg,"application/xml");b=_.childNodes[0]}return b.setAttribute("height","1em"),b.setAttribute("width","1em"),b},l.updateActiveButton=function(s){var h=this.graphInfo._fullLayout,m=s!==void 0?s.getAttribute("data-attr"):null;this.buttonElements.forEach(function(b){var x=b.getAttribute("data-val")||!0,_=b.getAttribute("data-attr"),A=b.getAttribute("data-toggle")==="true",f=d.select(b),k=function(E,I){var M=h.modebar,p=E.querySelector(".icon path");p&&(I||E.matches(":hover")?p.style.fill=M.activecolor:p.style.fill=M.color)};if(A){if(_===m){var w=!f.classed("active");f.classed("active",w),k(b,w)}}else{var D=_===null?_:z.nestedProperty(h,_).get();f.classed("active",D===x),k(b,D===x)}})},l.hasButtons=function(s){var h=this.buttons;if(!h||s.length!==h.length)return!1;for(var m=0;m{var d=Zc(),y=Oc(),z=as(),P=T0().isUnifiedHover,i=Xg(),n=Q1(),a=gw().DRAW_MODES,l=ji().extendDeep;Y.exports=function(x){var _=x._fullLayout,A=x._context,f=_._modeBar;if(!A.displayModeBar&&!A.watermark){f&&(f.destroy(),delete _._modeBar);return}if(!Array.isArray(A.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(A.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var k=A.modeBarButtons,w;Array.isArray(k)&&k.length?w=b(k):!A.displayModeBar&&A.watermark?w=[]:w=o(x),f?f.update(x,w):_._modeBar=i(x,w)};function o(x){var _=x._fullLayout,A=x._fullData,f=x._context;function k(J,me){if(typeof me=="string"){if(me.toLowerCase()===J.toLowerCase())return!0}else{var fe=me.name,Ce=me._cat||me.name;if(fe===J||Ce===J.toLowerCase())return!0}return!1}var w=_.modebar.add;typeof w=="string"&&(w=[w]);var D=_.modebar.remove;typeof D=="string"&&(D=[D]);var E=f.modeBarButtonsToAdd.concat(w.filter(function(J){for(var me=0;me1?(ve=["toggleHover"],ce=["resetViews"]):g?(xe=["zoomInGeo","zoomOutGeo"],ve=["hoverClosestGeo"],ce=["resetGeo"]):p?(ve=["hoverClosest3d"],ce=["resetCameraDefault3d","resetCameraLastSave3d"]):B?(xe=["zoomInMapbox","zoomOutMapbox"],ve=["toggleHover"],ce=["resetViewMapbox"]):U?(xe=["zoomInMap","zoomOutMap"],ve=["toggleHover"],ce=["resetViewMap"]):C?ve=["hoverClosestPie"]:F?(ve=["hoverClosestCartesian","hoverCompareCartesian"],ce=["resetViewSankey"]):ve=["toggleHover"],M&&ve.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(h(A)||q)&&(ve=[]),M&&!$&&(xe=["zoomIn2d","zoomOut2d","autoScale2d"],ce[0]!=="resetViews"&&(ce=["resetScale2d"])),p?re=["zoom3d","pan3d","orbitRotation","tableRotation"]:M&&!$||N?re=["zoom2d","pan2d"]:B||U||g?re=["pan2d"]:V&&(re=["zoom2d"]),s(A)&&re.push("select2d","lasso2d");var ge=[],ne=function(J){ge.indexOf(J)===-1&&ve.indexOf(J)!==-1&&ge.push(J)};if(Array.isArray(E)){for(var se=[],_e=0;_e{Y.exports={moduleType:"component",name:"modebar",layoutAttributes:S_(),supplyLayoutDefaults:f8(),manage:rb()}}),ib=Fe((te,Y)=>{var d=Bf().FROM_BL;Y.exports=function(y,z,P){P===void 0&&(P=d[y.constraintoward||"center"]);var i=[y.r2l(y.range[0]),y.r2l(y.range[1])],n=i[0]+(i[1]-i[0])*P;y.range=y._input.range=[y.l2r(n+(i[0]-n)*z),y.l2r(n+(i[1]-n)*z)],y.setScale()}}),ey=Fe(te=>{var Y=ji(),d=Xm(),y=Zc().id2name,z=qd(),P=ib(),i=Z0(),n=ti().ALMOST_EQUAL,a=Bf().FROM_BL;te.handleDefaults=function(x,_,A){var f=A.axIds,k=A.axHasImage,w=_._axisConstraintGroups=[],D=_._axisMatchGroups=[],E,I,M,p,g,C,T,N;for(E=0;Ew?A.substr(w):f.substr(k))+D}function m(x,_){for(var A=_._size,f=A.h/A.w,k={},w=Object.keys(x),D=0;Dn*T&&!V)){for(k=0;kce&&mexe&&(xe=me);var Ce=(xe-he)/(2*ve);p/=Ce,he=E.l2r(he),xe=E.l2r(xe),E.range=E._input.range=q{var Y=ii(),d=as(),y=sh(),z=ji(),P=cc(),i=J1(),n=Xi(),a=Zs(),l=Fp(),o=M4(),u=Os(),s=Bf(),h=ey(),m=h.enforce,b=h.clean,x=Xm().doAutoRange,_="start",A="middle",f="end",k=dc().zindexSeparator;te.layoutStyles=function(F){return z.syncOrAsync([y.doAutoMargin,D],F)};function w(F,$,q){for(var G=0;G=F[1]||ee[1]<=F[0])&&he[0]<$[1]&&he[1]>$[0])return!0}return!1}function D(F){var $=F._fullLayout,q=$._size,G=q.p,ee=u.list(F,"",!0),he,xe,ve,ce,re,ge;if($._paperdiv.style({width:F._context.responsive&&$.autosize&&!F._context._hasZeroWidth&&!F.layout.width?"100%":$.width+"px",height:F._context.responsive&&$.autosize&&!F._context._hasZeroHeight&&!F.layout.height?"100%":$.height+"px"}).selectAll(".main-svg").call(a.setSize,$.width,$.height),F._context.setBackground(F,$.paper_bgcolor),te.drawMainTitle(F),o.manage(F),!$._has("cartesian"))return y.previousPromises(F);function ne(De,ye,Pe){var He=De._lw/2;if(De._id.charAt(0)==="x"){if(ye){if(Pe==="top")return ye._offset-G-He}else return q.t+q.h*(1-(De.position||0))+He%1;return ye._offset+ye._length+G+He}if(ye){if(Pe==="right")return ye._offset+ye._length+G+He}else return q.l+q.w*(De.position||0)+He%1;return ye._offset-G-He}for(he=0;he0){T(F,he,re,ce),ve.attr({x:xe,y:he,"text-anchor":G,dy:U($.yanchor)}).call(P.positionText,xe,he);var ge=($.text.match(P.BR_TAG_ALL)||[]).length;if(ge){var ne=s.LINE_SPACING*ge+s.MID_SHIFT;$.y===0&&(ne=-ne),ve.selectAll(".line").each(function(){var me=+this.getAttribute("dy").slice(0,-2)-ne+"em";this.setAttribute("dy",me)})}var se=Y.select(F).selectAll(".gtitle-subtitle");if(se.node()){var _e=ve.node().getBBox(),oe=_e.y+_e.height,J=oe+l.SUBTITLE_PADDING_EM*$.subtitle.font.size;se.attr({x:xe,y:J,"text-anchor":G,dy:U($.yanchor)}).call(P.positionText,xe,J)}}}};function p(F,$,q,G,ee){var he=$.yref==="paper"?F._fullLayout._size.h:F._fullLayout.height,xe=z.isTopAnchor($)?G:G-ee,ve=q==="b"?he-xe:xe;return z.isTopAnchor($)&&q==="t"||z.isBottomAnchor($)&&q==="b"?!1:ve.5?"t":"b",xe=F._fullLayout.margin[he],ve=0;return $.yref==="paper"?ve=q+$.pad.t+$.pad.b:$.yref==="container"&&(ve=g(he,G,ee,F._fullLayout.height,q)+$.pad.t+$.pad.b),ve>xe?ve:0}function T(F,$,q,G){var ee="title.automargin",he=F._fullLayout.title,xe=he.y>.5?"t":"b",ve={x:he.x,y:he.y,t:0,b:0},ce={};he.yref==="paper"&&p(F,he,xe,$,G)?ve[xe]=q:he.yref==="container"&&(ce[xe]=q,F._fullLayout._reservedMargin[ee]=ce),y.allowAutoMargin(F,ee),y.autoMargin(F,ee,ve)}function N(F,$){var q=F.title,G=F._size,ee=0;switch($===_?ee=q.pad.l:$===f&&(ee=-q.pad.r),q.xref){case"paper":return G.l+G.w*q.x+ee;case"container":default:return F.width*q.x+ee}}function B(F,$){var q=F.title,G=F._size,ee=0;if($==="0em"||!$?ee=-q.pad.b:$===s.CAP_SHIFT+"em"&&(ee=q.pad.t),q.y==="auto")return G.t/2;switch(q.yref){case"paper":return G.t+G.h-G.h*q.y+ee;case"container":default:return F.height-F.height*q.y+ee}}function U(F){return F==="top"?s.CAP_SHIFT+.3+"em":F==="bottom"?"-0.3em":s.MID_SHIFT+"em"}function V(F){var $=F.title,q=A;return z.isRightAnchor($)?q=f:z.isLeftAnchor($)&&(q=_),q}function W(F){var $=F.title,q="0em";return z.isTopAnchor($)?q=s.CAP_SHIFT+"em":z.isMiddleAnchor($)&&(q=s.MID_SHIFT+"em"),q}te.doTraceStyle=function(F){var $=F.calcdata,q=[],G;for(G=0;G<$.length;G++){var ee=$[G],he=ee[0]||{},xe=he.trace||{},ve=xe._module||{},ce=ve.arraysToCalcdata;ce&&ce(ee,xe);var re=ve.editStyle;re&&q.push({fn:re,cd0:he})}if(q.length){for(G=0;G{var d=Zv().readPaths,y=Yg(),z=Am().clearOutlineControllers,P=Xi(),i=Zs(),n=ku().arrayEditor,a=o0(),l=a.getPathString;Y.exports={draw:o,drawOne:s,activateLastSelection:b};function o(_){var A=_._fullLayout;z(_),A._selectionLayer.selectAll("path").remove();for(var f in A._plots){var k=A._plots[f].selectionLayer;k&&k.selectAll("path").remove()}for(var w=0;w=0;V--){var W=E.append("path").attr(M).style("opacity",V?.1:p).call(P.stroke,C).call(P.fill,g).call(i.dashLine,V?"solid":N,V?4+T:T);if(h(W,_,k),B){var F=n(_.layout,"selections",k);W.style({cursor:"move"});var $={element:W.node(),plotinfo:w,gd:_,editHelpers:F,isActiveSelection:!0},q=d(I,_);y(q,W,$)}else W.style("pointer-events",V?"all":"none");U[V]=W}var G=U[0],ee=U[1];ee.node().addEventListener("click",function(){return m(_,G)})}}function h(_,A,f){var k=f.xref+f.yref;i.setClipUrl(_,"clip"+A._fullLayout._uid+k,A)}function m(_,A){if(u(_)){var f=A.node(),k=+f.getAttribute("data-index");if(k>=0){if(k===_._fullLayout._activeSelectionIndex){x(_);return}_._fullLayout._activeSelectionIndex=k,_._fullLayout._deactivateSelection=x,o(_)}}}function b(_){if(u(_)){var A=_._fullLayout.selections.length-1;_._fullLayout._activeSelectionIndex=A,_._fullLayout._deactivateSelection=x,o(_)}}function x(_){if(u(_)){var A=_._fullLayout._activeSelectionIndex;A>=0&&(z(_),delete _._fullLayout._activeSelectionIndex,o(_))}}}),ty=Fe((te,Y)=>{function d(){var y,z=0,P=!1;function i(n,a){return y.list.push({type:n,data:a?JSON.parse(JSON.stringify(a)):void 0}),y}return y={list:[],segmentId:function(){return z++},checkIntersection:function(n,a){return i("check",{seg1:n,seg2:a})},segmentChop:function(n,a){return i("div_seg",{seg:n,pt:a}),i("chop",{seg:n,pt:a})},statusRemove:function(n){return i("pop_seg",{seg:n})},segmentUpdate:function(n){return i("seg_update",{seg:n})},segmentNew:function(n,a){return i("new_seg",{seg:n,primary:a})},segmentRemove:function(n){return i("rem_seg",{seg:n})},tempStatus:function(n,a,l){return i("temp_status",{seg:n,above:a,below:l})},rewind:function(n){return i("rewind",{seg:n})},status:function(n,a,l){return i("status",{seg:n,above:a,below:l})},vert:function(n){return n===P?y:(P=n,i("vert",{x:n}))},log:function(n){return typeof n!="string"&&(n=JSON.stringify(n,!1," ")),i("log",{txt:n})},reset:function(){return i("reset")},selected:function(n){return i("selected",{segs:n})},chainStart:function(n){return i("chain_start",{seg:n})},chainRemoveHead:function(n,a){return i("chain_rem_head",{index:n,pt:a})},chainRemoveTail:function(n,a){return i("chain_rem_tail",{index:n,pt:a})},chainNew:function(n,a){return i("chain_new",{pt1:n,pt2:a})},chainMatch:function(n){return i("chain_match",{index:n})},chainClose:function(n){return i("chain_close",{index:n})},chainAddHead:function(n,a){return i("chain_add_head",{index:n,pt:a})},chainAddTail:function(n,a){return i("chain_add_tail",{index:n,pt:a})},chainConnect:function(n,a){return i("chain_con",{index1:n,index2:a})},chainReverse:function(n){return i("chain_rev",{index:n})},chainJoin:function(n,a){return i("chain_join",{index1:n,index2:a})},done:function(){return i("done")}},y}Y.exports=d}),d8=Fe((te,Y)=>{function d(y){typeof y!="number"&&(y=1e-10);var z={epsilon:function(P){return typeof P=="number"&&(y=P),y},pointAboveOrOnLine:function(P,i,n){var a=i[0],l=i[1],o=n[0],u=n[1],s=P[0],h=P[1];return(o-a)*(h-l)-(u-l)*(s-a)>=-y},pointBetween:function(P,i,n){var a=P[1]-i[1],l=n[0]-i[0],o=P[0]-i[0],u=n[1]-i[1],s=o*l+a*u;if(s-y)},pointsSameX:function(P,i){return Math.abs(P[0]-i[0])y!=o-a>y&&(l-h)*(a-m)/(o-m)+h-n>y&&(u=!u),l=h,o=m}return u}};return z}Y.exports=d}),Sg=Fe((te,Y)=>{var d={create:function(){var y={root:{root:!0,next:null},exists:function(z){return!(z===null||z===y.root)},isEmpty:function(){return y.root.next===null},getHead:function(){return y.root.next},insertBefore:function(z,P){for(var i=y.root,n=y.root.next;n!==null;){if(P(n)){z.prev=n.prev,z.next=n,n.prev.next=z,n.prev=z;return}i=n,n=n.next}i.next=z,z.prev=i,z.next=null},findTransition:function(z){for(var P=y.root,i=y.root.next;i!==null&&!z(i);)P=i,i=i.next;return{before:P===y.root?null:P,after:i,insert:function(n){return n.prev=P,n.next=i,P.next=n,i!==null&&(i.prev=n),n}}}};return y},node:function(y){return y.prev=null,y.next=null,y.remove=function(){y.prev.next=y.next,y.next&&(y.next.prev=y.prev),y.prev=null,y.next=null},y}};Y.exports=d}),nb=Fe((te,Y)=>{var d=Sg();function y(z,P,i){function n(A,f){return{id:i?i.segmentId():-1,start:A,end:f,myFill:{above:null,below:null},otherFill:null}}function a(A,f,k){return{id:i?i.segmentId():-1,start:A,end:f,myFill:{above:k.myFill.above,below:k.myFill.below},otherFill:null}}var l=d.create();function o(A,f,k,w,D,E){var I=P.pointsCompare(f,D);return I!==0?I:P.pointsSame(k,E)?0:A!==w?A?1:-1:P.pointAboveOrOnLine(k,w?D:E,w?E:D)?1:-1}function u(A,f){l.insertBefore(A,function(k){var w=o(A.isStart,A.pt,f,k.isStart,k.pt,k.other.pt);return w<0})}function s(A,f){var k=d.node({isStart:!0,pt:A.start,seg:A,primary:f,other:null,status:null});return u(k,A.end),k}function h(A,f,k){var w=d.node({isStart:!1,pt:f.end,seg:f,primary:k,other:A,status:null});A.other=w,u(w,A.pt)}function m(A,f){var k=s(A,f);return h(k,A,f),k}function b(A,f){i&&i.segmentChop(A.seg,f),A.other.remove(),A.seg.end=f,A.other.pt=f,u(A.other,A.pt)}function x(A,f){var k=a(f,A.seg.end,A.seg);return b(A,f),m(k,A.primary)}function _(A,f){var k=d.create();function w(W,F){var $=W.seg.start,q=W.seg.end,G=F.seg.start,ee=F.seg.end;return P.pointsCollinear($,G,ee)?P.pointsCollinear(q,G,ee)||P.pointAboveOrOnLine(q,G,ee)?1:-1:P.pointAboveOrOnLine($,G,ee)?1:-1}function D(W){return k.findTransition(function(F){var $=w(W,F.ev);return $>0})}function E(W,F){var $=W.seg,q=F.seg,G=$.start,ee=$.end,he=q.start,xe=q.end;i&&i.checkIntersection($,q);var ve=P.linesIntersect(G,ee,he,xe);if(ve===!1){if(!P.pointsCollinear(G,ee,he)||P.pointsSame(G,xe)||P.pointsSame(ee,he))return!1;var ce=P.pointsSame(G,he),re=P.pointsSame(ee,xe);if(ce&&re)return F;var ge=!ce&&P.pointBetween(G,he,xe),ne=!re&&P.pointBetween(ee,he,xe);if(ce)return ne?x(F,ee):x(W,xe),F;ge&&(re||(ne?x(F,ee):x(W,xe)),x(F,G))}else ve.alongA===0&&(ve.alongB===-1?x(W,he):ve.alongB===0?x(W,ve.pt):ve.alongB===1&&x(W,xe)),ve.alongB===0&&(ve.alongA===-1?x(F,G):ve.alongA===0?x(F,ve.pt):ve.alongA===1&&x(F,ee));return!1}for(var I=[];!l.isEmpty();){var M=l.getHead();if(i&&i.vert(M.pt[0]),M.isStart){let W=function(){if(g){var F=E(M,g);if(F)return F}return C?E(M,C):!1};i&&i.segmentNew(M.seg,M.primary);var p=D(M),g=p.before?p.before.ev:null,C=p.after?p.after.ev:null;i&&i.tempStatus(M.seg,g?g.seg:!1,C?C.seg:!1);var T=W();if(T){if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,N&&(T.seg.myFill.above=!T.seg.myFill.above)}else T.seg.otherFill=M.seg.myFill;i&&i.segmentUpdate(T.seg),M.other.remove(),M.remove()}if(l.getHead()!==M){i&&i.rewind(M.seg);continue}if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,C?M.seg.myFill.below=C.seg.myFill.above:M.seg.myFill.below=A,N?M.seg.myFill.above=!M.seg.myFill.below:M.seg.myFill.above=M.seg.myFill.below}else if(M.seg.otherFill===null){var B;C?M.primary===C.primary?B=C.seg.otherFill.above:B=C.seg.myFill.above:B=M.primary?f:A,M.seg.otherFill={above:B,below:B}}i&&i.status(M.seg,g?g.seg:!1,C?C.seg:!1),M.other.status=p.insert(d.node({ev:M}))}else{var U=M.status;if(U===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(k.exists(U.prev)&&k.exists(U.next)&&E(U.prev.ev,U.next.ev),i&&i.statusRemove(U.ev.seg),U.remove(),!M.primary){var V=M.seg.myFill;M.seg.myFill=M.seg.otherFill,M.seg.otherFill=V}I.push(M.seg)}l.getHead().remove()}return i&&i.done(),I}return z?{addRegion:function(A){for(var f,k=A[A.length-1],w=0;w{function d(y,z,P){var i=[],n=[];return y.forEach(function(a){var l=a.start,o=a.end;if(z.pointsSame(l,o)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}P&&P.chainStart(a);var u={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},h=u;function m(B,U,V){return h.index=B,h.matches_head=U,h.matches_pt1=V,h===u?(h=s,!1):(h=null,!0)}for(var b=0;b{function d(z,P,i){var n=[];return z.forEach(function(a){var l=(a.myFill.above?8:0)+(a.myFill.below?4:0)+(a.otherFill&&a.otherFill.above?2:0)+(a.otherFill&&a.otherFill.below?1:0);P[l]!==0&&n.push({id:i?i.segmentId():-1,start:a.start,end:a.end,myFill:{above:P[l]===1,below:P[l]===2},otherFill:null})}),i&&i.selected(n),n}var y={union:function(z,P){return d(z,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],P)},intersect:function(z,P){return d(z,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],P)},difference:function(z,P){return d(z,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],P)},differenceRev:function(z,P){return d(z,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],P)},xor:function(z,P){return d(z,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],P)}};Y.exports=y}),ab=Fe((te,Y)=>{var d={toPolygon:function(y,z){function P(a){if(a.length<=0)return y.segments({inverted:!1,regions:[]});function l(s){var h=s.slice(0,s.length-1);return y.segments({inverted:!1,regions:[h]})}for(var o=l(a[0]),u=1;u{var d=ty(),y=d8(),z=nb(),P=L4(),i=vw(),n=ab(),a=!1,l=y(),o;o={buildLog:function(s){return s===!0?a=d():s===!1&&(a=!1),a===!1?!1:a.list},epsilon:function(s){return l.epsilon(s)},segments:function(s){var h=z(!0,l,a);return s.regions.forEach(h.addRegion),{segments:h.calculate(s.inverted),inverted:s.inverted}},combine:function(s,h){var m=z(!1,l,a);return{combined:m.calculate(s.segments,s.inverted,h.segments,h.inverted),inverted1:s.inverted,inverted2:h.inverted}},selectUnion:function(s){return{segments:i.union(s.combined,a),inverted:s.inverted1||s.inverted2}},selectIntersect:function(s){return{segments:i.intersect(s.combined,a),inverted:s.inverted1&&s.inverted2}},selectDifference:function(s){return{segments:i.difference(s.combined,a),inverted:s.inverted1&&!s.inverted2}},selectDifferenceRev:function(s){return{segments:i.differenceRev(s.combined,a),inverted:!s.inverted1&&s.inverted2}},selectXor:function(s){return{segments:i.xor(s.combined,a),inverted:s.inverted1!==s.inverted2}},polygon:function(s){return{regions:P(s.segments,l,a),inverted:s.inverted}},polygonFromGeoJSON:function(s){return n.toPolygon(o,s)},polygonToGeoJSON:function(s){return n.fromPolygon(o,l,s)},union:function(s,h){return u(s,h,o.selectUnion)},intersect:function(s,h){return u(s,h,o.selectIntersect)},difference:function(s,h){return u(s,h,o.selectDifference)},differenceRev:function(s,h){return u(s,h,o.selectDifferenceRev)},xor:function(s,h){return u(s,h,o.selectXor)}};function u(s,h,m){var b=o.segments(s),x=o.segments(h),_=o.combine(b,x),A=m(_);return o.polygon(A)}typeof window=="object"&&(window.PolyBool=o),Y.exports=o}),ob=Fe((te,Y)=>{Y.exports=function(d,y,z,P){var i=d[0],n=d[1],a=!1;z===void 0&&(z=0),P===void 0&&(P=y.length);for(var l=P-z,o=0,u=l-1;on!=b>n&&i<(m-s)*(n-h)/(b-h)+s;x&&(a=!a)}return a}}),Cg=Fe((te,Y)=>{var d=ew().dot,y=ti().BADNUM,z=Y.exports={};z.tester=function(P){var i=P.slice(),n=i[0][0],a=n,l=i[0][1],o=l,u;for((i[i.length-1][0]!==i[0][0]||i[i.length-1][1]!==i[0][1])&&i.push(i[0]),u=1;ua||w===y||wo||f&&h(A))}function b(A,f){var k=A[0],w=A[1];if(k===y||ka||w===y||wo)return!1;var D=i.length,E=i[0][0],I=i[0][1],M=0,p,g,C,T,N;for(p=1;pMath.max(g,E)||w>Math.max(C,I)))if(wu||Math.abs(d(b,h))>a)return!0;return!1},z.filter=function(P,i){var n=[P[0]],a=0,l=0;function o(s){P.push(s);var h=n.length,m=a;n.splice(l+1);for(var b=m+1;b1){var u=P.pop();o(u)}return{addPt:o,raw:P,filtered:n}}}),sb=Fe((te,Y)=>{Y.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),_w=Fe((te,Y)=>{var d=yw(),y=ob(),z=as(),P=Zs().dashStyle,i=Xi(),n=hf(),a=T0().makeEventData,l=dm(),o=l.freeMode,u=l.rectMode,s=l.drawMode,h=l.openMode,m=l.selectMode,b=o0(),x=tb(),_=Yg(),A=Am().clearOutline,f=Zv(),k=f.handleEllipse,w=f.readPaths,D=K0().newShapes,E=Kv(),I=E4().activateLastSelection,M=ji(),p=M.sorterAsc,g=Cg(),C=iw(),T=Zc().getFromId,N=J1(),B=pm().redrawReglTraces,U=sb(),V=U.MINSELECT,W=g.filter,F=g.tester,$=eb(),q=$.p2r,G=$.axValue,ee=$.getTransform;function he(Je){return Je.subplot!==void 0}function xe(Je,ot,De,ye,Pe){var He=!he(ye),at=o(Pe),ht=u(Pe),At=h(Pe),Wt=s(Pe),Kt=m(Pe),hr=Pe==="drawline",zr=Pe==="drawcircle",Dr=hr||zr,br=ye.gd,hi=br._fullLayout,un=Kt&&hi.newselection.mode==="immediate"&&He,cn=hi._zoomlayer,yn=ye.element.getBoundingClientRect(),Wn=ye.plotinfo,Sn=ee(Wn),fn=ot-yn.left,ga=De-yn.top;hi._calcInverseTransform(br);var na=M.apply3DTransform(hi._invTransform)(fn,ga);fn=na[0],ga=na[1];var Zt=hi._invScaleX,sr=hi._invScaleY,_r=fn,Cr=ga,fi="M"+fn+","+ga,qi=ye.xaxes[0],Ui=ye.yaxes[0],Hi=qi._length,En=Ui._length,Rn=Je.altKey&&!(s(Pe)&&At),Gn,Xn,sa,Mn,Ha,ro,Ft;se(Je,br,ye),at&&(Gn=W([[fn,ga]],U.BENDPX));var Rt=cn.selectAll("path.select-outline-"+Wn.id).data([1]),qr=Wt?hi.newshape:hi.newselection;Wt&&(ye.hasText=qr.label.text||qr.label.texttemplate);var ni=Wt&&!At?qr.fillcolor:"rgba(0,0,0,0)",oi=qr.line.color||(He?i.contrast(br._fullLayout.plot_bgcolor):"#7f7f7f");Rt.enter().append("path").attr("class","select-outline select-outline-"+Wn.id).style({opacity:Wt?qr.opacity/2:1,"stroke-dasharray":P(qr.line.dash,qr.line.width),"stroke-width":qr.line.width+"px","shape-rendering":"crispEdges"}).call(i.stroke,oi).call(i.fill,ni).attr("fill-rule","evenodd").classed("cursor-move",!!Wt).attr("transform",Sn).attr("d",fi+"Z");var Gr=cn.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform",Sn).attr("d","M0,0Z");if(Wt&&ye.hasText){var si=cn.select(".label-temp");si.empty()&&(si=cn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Pi=hi._uid+U.SELECTID,yi=[],zt=fe(br,ye.xaxes,ye.yaxes,ye.subplot);un&&!Je.shiftKey&&(ye._clearSubplotSelections=function(){if(He){var Jr=qi._id,Ri=Ui._id;ut(br,Jr,Ri,zt);for(var tn=(br.layout||{}).selections||[],_n=[],Zi=!1,Wi=0;Wi=0){br._fullLayout._deactivateShape(br);return}if(!Wt){var tn=hi.clickmode;C.done(Pi).then(function(){if(C.clear(Pi),Jr===2){for(Rt.remove(),Ha=0;Ha-1&&ve(Ri,br,ye.xaxes,ye.yaxes,ye.subplot,ye,Rt),tn==="event"&&mi(br,void 0);n.click(br,Ri,Wn.id)}).catch(M.error)}},ye.doneFn=function(){Gr.remove(),C.done(Pi).then(function(){C.clear(Pi),!un&&Mn&&ye.selectionDefs&&(Mn.subtract=Rn,ye.selectionDefs.push(Mn),ye.mergedPolygons.length=0,[].push.apply(ye.mergedPolygons,sa)),(un||Wt)&&J(ye,un),ye.doneFnCompleted&&ye.doneFnCompleted(yi),Kt&&mi(br,Ft)}).catch(M.error)}}function ve(Je,ot,De,ye,Pe,He,at){var ht=ot._hoverdata,At=ot._fullLayout,Wt=At.clickmode,Kt=Wt.indexOf("event")>-1,hr=[],zr,Dr,br,hi,un,cn,yn,Wn,Sn,fn;if(Be(ht)){se(Je,ot,He),zr=fe(ot,De,ye,Pe);var ga=Oe(ht,zr),na=ga.pointNumbers.length>0;if(na?Ge(zr,ga):rt(zr)&&(yn=Ze(ga))){for(at&&at.remove(),fn=0;fn=0}function oe(Je){return Je._fullLayout._activeSelectionIndex>=0}function J(Je,ot){var De=Je.dragmode,ye=Je.plotinfo,Pe=Je.gd;_e(Pe)&&Pe._fullLayout._deactivateShape(Pe),oe(Pe)&&Pe._fullLayout._deactivateSelection(Pe);var He=Pe._fullLayout,at=He._zoomlayer,ht=s(De),At=m(De);if(ht||At){var Wt=at.selectAll(".select-outline-"+ye.id);if(Wt&&Pe._fullLayout._outlining){var Kt;ht&&(Kt=D(Wt,Je)),Kt&&z.call("_guiRelayout",Pe,{shapes:Kt});var hr;At&&!he(Je)&&(hr=E(Wt,Je)),hr&&(Pe._fullLayout._noEmitSelectedAtStart=!0,z.call("_guiRelayout",Pe,{selections:hr}).then(function(){ot&&I(Pe)})),Pe._fullLayout._outlining=!1}}ye.selection={},ye.selection.selectionDefs=Je.selectionDefs=[],ye.selection.mergedPolygons=Je.mergedPolygons=[]}function me(Je){return Je._id}function fe(Je,ot,De,ye){if(!Je.calcdata)return[];var Pe=[],He=ot.map(me),at=De.map(me),ht,At,Wt;for(Wt=0;Wt0,He=Pe?ye[0]:De;return ot.selectedpoints?ot.selectedpoints.indexOf(He)>-1:!1}function Ge(Je,ot){var De=[],ye,Pe,He,at;for(at=0;at0&&De.push(ye);if(De.length===1&&(He=De[0]===ot.searchInfo,He&&(Pe=ot.searchInfo.cd[0].trace,Pe.selectedpoints.length===ot.pointNumbers.length))){for(at=0;at1||(ot+=ye.selectedpoints.length,ot>1)))return!1;return ot===1}function _t(Je,ot,De){var ye;for(ye=0;ye-1&&ot;if(!at&&ot){var Jr=Gt(Je,!0);if(Jr.length){var Ri=Jr[0].xref,tn=Jr[0].yref;if(Ri&&tn){var _n=mr(Jr),Zi=ri([T(Je,Ri,"x"),T(Je,tn,"y")]);Zi(yi,_n)}}Je._fullLayout._noEmitSelectedAtStart?Je._fullLayout._noEmitSelectedAtStart=!1:xr&&mi(Je,yi),zr._reselect=!1}if(!at&&zr._deselect){var Wi=zr._deselect;ht=Wi.xref,At=Wi.yref,xt(ht,At,Kt)||ut(Je,ht,At,ye),xr&&(yi.points.length?mi(Je,yi):Ot(Je)),zr._deselect=!1}return{eventData:yi,selectionTesters:De}}function nt(Je){var ot=Je.calcdata;if(ot)for(var De=0;De{Y.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),lb=Fe((te,Y)=>{Y.exports={axisRefDescription:function(d,y,z){return["If set to a",d,"axis id (e.g. *"+d+"* or","*"+d+"2*), the `"+d+"` position refers to a",d,"coordinate. If set to *paper*, the `"+d+"`","position refers to the distance from the",y,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",y,"("+z+"). If set to a",d,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",y,"of the domain of that axis: e.g.,","*"+d+"2 domain* refers to the domain of the second",d," axis and a",d,"position of 0.5 refers to the","point between the",y,"and the",z,"of the domain of the","second",d,"axis."].join(" ")}}}),Ag=Fe((te,Y)=>{var d=xw(),y=zn(),z=dc(),P=ku().templatedArray;lb(),Y.exports=P("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:d.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:d.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",z.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",z.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:y({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),Mg=Fe((te,Y)=>{Y.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Lm=Fe((te,Y)=>{Y.exports=function(d){return{valType:"color",editType:"style",anim:!0}}}),ff=Fe((te,Y)=>{var d=Sh().axisHoverFormat,{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=zc(),n=zn(),a=Wd().dash,l=Wd().pattern,o=Zs(),u=Mg(),s=an().extendFlat,h=Lm();function m(_){return{valType:"any",dflt:0,editType:"calc"}}function b(_){return{valType:"any",editType:"calc"}}function x(_){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:m(),yperiod:m(),xperiod0:b(),yperiod0:b(),xperiodalignment:x(),yperiodalignment:x(),xhoverformat:d("x"),yhoverformat:d("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:z(),texttemplatefallback:P({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:y({},{keys:u.eventDataKeys}),hovertemplatefallback:P(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:s({},a,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:h(!0),fillgradient:s({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:s({symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:s({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},i("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},i("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:n({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),bw=Fe((te,Y)=>{var d=Ag(),y=ff().line,z=Wd().dash,P=an().extendFlat,i=oh().overrideAll,n=ku().templatedArray;lb(),Y.exports=i(n("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:P({},d.xref,{}),yref:P({},d.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:y.color,width:P({},y.width,{min:1,dflt:1}),dash:P({},z,{dflt:"dot"})}}),"arraydraw","from-root")}),p8=Fe((te,Y)=>{var d=ji(),y=Os(),z=Gd(),P=bw(),i=o0();Y.exports=function(a,l){z(a,l,{name:"selections",handleItemDefaults:n});for(var o=l.selections,u=0;u{Y.exports=function(d,y,z){z("newselection.mode");var P=z("newselection.line.width");P&&(z("newselection.line.color"),z("newselection.line.dash")),z("activeselection.fillcolor"),z("activeselection.opacity")}}),Yv=Fe((te,Y)=>{var d=as(),y=ji(),z=Zc();Y.exports=function(P){return function(i,n){var a=i[P];if(Array.isArray(a))for(var l=d.subplotsRegistry.cartesian,o=l.idRegex,u=n._subplots,s=u.xaxis,h=u.yaxis,m=u.cartesian,b=n._has("cartesian"),x=0;x{var d=E4(),y=_w();Y.exports={moduleType:"component",name:"selections",layoutAttributes:bw(),supplyLayoutDefaults:p8(),supplyDrawNewSelectionDefaults:Qm(),includeBasePlot:Yv()("selections"),draw:d.draw,drawOne:d.drawOne,reselect:y.reselect,prepSelect:y.prepSelect,clearOutline:y.clearOutline,clearSelectionsCache:y.clearSelectionsCache,selectOnClick:y.selectOnClick}}),C_=Fe((te,Y)=>{var d=ii(),y=ji(),z=y.numberFormat,P=sn(),i=sw(),n=as(),a=y.strTranslate,l=cc(),o=Xi(),u=Zs(),s=hf(),h=Os(),m=Em(),b=Np(),x=dm(),_=x.selectingOrDrawing,A=x.freeMode,f=Bf().FROM_TL,k=J1(),w=pm().redrawReglTraces,D=sh(),E=Zc().getFromId,I=Mf().prepSelect,M=Mf().clearOutline,p=Mf().selectOnClick,g=ib(),C=dc(),T=C.MINDRAG,N=C.MINZOOM,B=!0;function U(Ce,Be,Oe,Ze,Ge,rt,_t,pt){var gt=Ce._fullLayout._zoomlayer,ct=_t+pt==="nsew",Ae=(_t+pt).length===1,ze,Ee,nt,xt,ut,Et,Gt,Jt,gr,mr,Kr,ri,Mr,ui,mi,Ot,Je,ot,De,ye,Pe,He,at;Oe+=Be.yaxis._shift;function ht(){if(ze=Be.xaxis,Ee=Be.yaxis,gr=ze._length,mr=Ee._length,Gt=ze._offset,Jt=Ee._offset,nt={},nt[ze._id]=ze,xt={},xt[Ee._id]=Ee,_t&&pt)for(var Rt=Be.overlays,qr=0;qr=0){ni._fullLayout._deactivateShape(ni);return}var oi=ni._fullLayout.clickmode;if(ge(ni),Rt===2&&!Ae&&Xn(),ct)oi.indexOf("select")>-1&&p(qr,ni,ut,Et,Be.id,Kt),oi.indexOf("event")>-1&&s.click(ni,qr,Be.id);else if(Rt===1&&Ae){var Gr=_t?Ee:ze,si=_t==="s"||pt==="w"?0:1,Pi=Gr._name+".range["+si+"]",yi=$(Gr,si),zt="left",xr="middle";if(Gr.fixedrange)return;_t?(xr=_t==="n"?"top":"bottom",Gr.side==="right"&&(zt="right")):pt==="e"&&(zt="right"),ni._context.showAxisRangeEntryBoxes&&d.select(Wt).call(l.makeEditable,{gd:ni,immediate:!0,background:ni._fullLayout.paper_bgcolor,text:String(yi),fill:Gr.tickfont?Gr.tickfont.color:"#444",horizontalAlign:zt,verticalAlign:xr}).on("edit",function(Jr){var Ri=Gr.d2r(Jr);Ri!==void 0&&n.call("_guiRelayout",ni,Pi,Ri)})}}b.init(Kt);var Dr,br,hi,un,cn,yn,Wn,Sn,fn,ga;function na(Rt,qr,ni){var oi=Wt.getBoundingClientRect();Dr=qr-oi.left,br=ni-oi.top,Ce._fullLayout._calcInverseTransform(Ce);var Gr=y.apply3DTransform(Ce._fullLayout._invTransform)(Dr,br);Dr=Gr[0],br=Gr[1],hi={l:Dr,r:Dr,w:0,t:br,b:br,h:0},un=Ce._hmpixcount?Ce._hmlumcount/Ce._hmpixcount:P(Ce._fullLayout.plot_bgcolor).getLuminance(),cn="M0,0H"+gr+"V"+mr+"H0V0",yn=!1,Wn="xy",ga=!1,Sn=xe(gt,un,Gt,Jt,cn),fn=ve(gt,Gt,Jt)}function Zt(Rt,qr){if(Ce._transitioningWithDuration)return!1;var ni=Math.max(0,Math.min(gr,He*Rt+Dr)),oi=Math.max(0,Math.min(mr,at*qr+br)),Gr=Math.abs(ni-Dr),si=Math.abs(oi-br);hi.l=Math.min(Dr,ni),hi.r=Math.max(Dr,ni),hi.t=Math.min(br,oi),hi.b=Math.max(br,oi);function Pi(){Wn="",hi.r=hi.l,hi.t=hi.b,fn.attr("d","M0,0Z")}if(Kr.isSubplotConstrained)Gr>N||si>N?(Wn="xy",Gr/gr>si/mr?(si=Gr*mr/gr,br>oi?hi.t=br-si:hi.b=br+si):(Gr=si*gr/mr,Dr>ni?hi.l=Dr-Gr:hi.r=Dr+Gr),fn.attr("d",oe(hi))):Pi();else if(ri.isSubplotConstrained)if(Gr>N||si>N){Wn="xy";var yi=Math.min(hi.l/gr,(mr-hi.b)/mr),zt=Math.max(hi.r/gr,(mr-hi.t)/mr);hi.l=yi*gr,hi.r=zt*gr,hi.b=(1-yi)*mr,hi.t=(1-zt)*mr,fn.attr("d",oe(hi))}else Pi();else!ui||si0){var Jr;if(ri.isSubplotConstrained||!Mr&&ui.length===1){for(Jr=0;Jr1&&(Pi.maxallowed!==void 0&&Ot===(Pi.range[0]1&&(yi.maxallowed!==void 0&&Je===(yi.range[0]=0?Math.min(Ce,.9):1/(1/Math.max(Ce,-.3)+3.222))}function he(Ce,Be,Oe){return Ce?Ce==="nsew"?Oe?"":Be==="pan"?"move":"crosshair":Ce.toLowerCase()+"-resize":"pointer"}function xe(Ce,Be,Oe,Ze,Ge){return Ce.append("path").attr("class","zoombox").style({fill:Be>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",a(Oe,Ze)).attr("d",Ge+"Z")}function ve(Ce,Be,Oe){return Ce.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1,opacity:0}).attr("transform",a(Be,Oe)).attr("d","M0,0Z")}function ce(Ce,Be,Oe,Ze,Ge,rt){Ce.attr("d",Ze+"M"+Oe.l+","+Oe.t+"v"+Oe.h+"h"+Oe.w+"v-"+Oe.h+"h-"+Oe.w+"Z"),re(Ce,Be,Ge,rt)}function re(Ce,Be,Oe,Ze){Oe||(Ce.transition().style("fill",Ze>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Be.transition().style("opacity",1).duration(200))}function ge(Ce){d.select(Ce).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ne(Ce){B&&Ce.data&&Ce._context.showTips&&(y.notifier(y._(Ce,"Double-click to zoom back out"),"long"),B=!1)}function se(Ce,Be){return"M"+(Ce.l-.5)+","+(Be-N-.5)+"h-3v"+(2*N+1)+"h3ZM"+(Ce.r+.5)+","+(Be-N-.5)+"h3v"+(2*N+1)+"h-3Z"}function _e(Ce,Be){return"M"+(Be-N-.5)+","+(Ce.t-.5)+"v-3h"+(2*N+1)+"v3ZM"+(Be-N-.5)+","+(Ce.b+.5)+"v3h"+(2*N+1)+"v-3Z"}function oe(Ce){var Be=Math.floor(Math.min(Ce.b-Ce.t,Ce.r-Ce.l,N)/2);return"M"+(Ce.l-3.5)+","+(Ce.t-.5+Be)+"h3v"+-Be+"h"+Be+"v-3h-"+(Be+3)+"ZM"+(Ce.r+3.5)+","+(Ce.t-.5+Be)+"h-3v"+-Be+"h"+-Be+"v-3h"+(Be+3)+"ZM"+(Ce.r+3.5)+","+(Ce.b+.5-Be)+"h-3v"+Be+"h"+-Be+"v3h"+(Be+3)+"ZM"+(Ce.l-3.5)+","+(Ce.b+.5-Be)+"h3v"+Be+"h"+Be+"v3h-"+(Be+3)+"Z"}function J(Ce,Be,Oe,Ze,Ge){for(var rt=!1,_t={},pt={},gt,ct,Ae,ze,Ee=(Ge||{}).xaHash,nt=(Ge||{}).yaHash,xt=0;xt{var Y=ii(),d=hf(),y=Np(),z=Em(),P=C_().makeDragBox,i=dc().DRAGGERSIZE;te.initInteractions=function(n){var a=n._fullLayout;if(n._context.staticPlot){Y.select(n).selectAll(".drag").remove();return}if(!(!a._has("cartesian")&&!a._has("splom"))){var l=Object.keys(a._plots||{}).sort(function(u,s){if((a._plots[u].mainplot&&!0)===(a._plots[s].mainplot&&!0)){var h=u.split("y"),m=s.split("y");return h[0]===m[0]?Number(h[1]||1)-Number(m[1]||1):Number(h[0]||1)-Number(m[0]||1)}return a._plots[u].mainplot?1:-1});l.forEach(function(u){var s=a._plots[u],h=s.xaxis,m=s.yaxis;if(!s.mainplot){var b=P(n,s,h._offset,m._offset,h._length,m._length,"ns","ew");b.onmousemove=function(A){n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===u&&n._fullLayout._plots[u]&&d.hover(n,A,u)},d.hover(n,A,u),n._fullLayout._lasthover=b,n._fullLayout._hoversubplot=u},b.onmouseout=function(A){n._dragging||(n._fullLayout._hoversubplot=null,y.unhover(n,A))},n._context.showAxisDragHandles&&(P(n,s,h._offset-i,m._offset-i,i,i,"n","w"),P(n,s,h._offset+h._length,m._offset-i,i,i,"n","e"),P(n,s,h._offset-i,m._offset+m._length,i,i,"s","w"),P(n,s,h._offset+h._length,m._offset+m._length,i,i,"s","e"))}if(n._context.showAxisDragHandles){if(u===h._mainSubplot){var x=h._mainLinePosition;h.side==="top"&&(x-=i),P(n,s,h._offset+h._length*.1,x,h._length*.8,i,"","ew"),P(n,s,h._offset,x,h._length*.1,i,"","w"),P(n,s,h._offset+h._length*.9,x,h._length*.1,i,"","e")}if(u===m._mainSubplot){var _=m._mainLinePosition;m.side!=="right"&&(_-=i),P(n,s,_,m._offset+m._length*.1,i,m._length*.8,"ns",""),P(n,s,_,m._offset+m._length*.9,i,m._length*.1,"s",""),P(n,s,_,m._offset,i,m._length*.1,"n","")}}});var o=a._hoverlayer.node();o.onmousemove=function(u){u.target=n._fullLayout._lasthover,d.hover(n,u,a._hoversubplot)},o.onclick=function(u){u.target=n._fullLayout._lasthover,d.click(n,u)},o.onmousedown=function(u){n._fullLayout._lasthover.onmousedown(u)},te.updateFx(n)}},te.updateFx=function(n){var a=n._fullLayout,l=a.dragmode==="pan"?"move":"crosshair";z(a._draggers,l)}}),I4=Fe((te,Y)=>{var d=as();Y.exports=function(y){for(var z=d.layoutArrayContainers,P=d.layoutArrayRegexes,i=y.split("[")[0],n,a,l=0;l{var Y=ei(),d=Qo(),y=ns(),z=rw().sorterAsc,P=as();te.containerArrayMatch=I4();var i=te.isAddVal=function(a){return a==="add"||Y(a)},n=te.isRemoveVal=function(a){return a===null||a==="remove"};te.applyContainerArrayChanges=function(a,l,o,u,s){var h=l.astr,m=P.getComponentMethod(h,"supplyLayoutDefaults"),b=P.getComponentMethod(h,"draw"),x=P.getComponentMethod(h,"drawOne"),_=u.replot||u.recalc||m===d||b===d,A=a.layout,f=a._fullLayout;if(o[""]){Object.keys(o).length>1&&y.warn("Full array edits are incompatible with other edits",h);var k=o[""][""];if(n(k))l.set(null);else if(Array.isArray(k))l.set(k);else return y.warn("Unrecognized full array edit value",h,k),!0;return _?!1:(m(A,f),b(a),!0)}var w=Object.keys(o).map(Number).sort(z),D=l.get(),E=D||[],I=s(f,h).get(),M=[],p=-1,g=E.length,C,T,N,B,U,V,W,F;for(C=0;CE.length-(W?0:1)){y.warn("index out of range",h,N);continue}if(V!==void 0)U.length>1&&y.warn("Insertion & removal are incompatible with edits to the same index.",h,N),n(V)?M.push(N):W?(V==="add"&&(V={}),E.splice(N,0,V),I&&I.splice(N,0,{})):y.warn("Unrecognized full object edit value",h,N,V),p===-1&&(p=N);else for(T=0;T=0;C--)E.splice(M[C],1),I&&I.splice(M[C],1);if(E.length?D||l.set(E):l.set(null),_)return!1;if(m(A,f),x!==d){var $;if(p===-1)$=w;else{for(g=Math.max(E.length,g),$=[],C=0;C=p));C++)$.push(N);for(C=p;C{var Y=Ar(),d=as(),y=ji(),z=sh(),P=Zc(),i=Xi(),n=P.cleanId,a=P.getFromTrace,l=d.traceIs,o=["x","y","z"];te.clearPromiseQueue=function(f){Array.isArray(f._promises)&&f._promises.length>0&&y.log("Clearing previous rejected promises from queue."),f._promises=[]},te.cleanLayout=function(f){var k;f||(f={}),f.xaxis1&&(f.xaxis||(f.xaxis=f.xaxis1),delete f.xaxis1),f.yaxis1&&(f.yaxis||(f.yaxis=f.yaxis1),delete f.yaxis1),f.scene1&&(f.scene||(f.scene=f.scene1),delete f.scene1);var w=(z.subplotsRegistry.cartesian||{}).attrRegex;(z.subplotsRegistry.polar||{}).attrRegex,(z.subplotsRegistry.ternary||{}).attrRegex,(z.subplotsRegistry.gl3d||{}).attrRegex;var D=Object.keys(f);for(k=0;k3?(B.x=1.02,B.xanchor="left"):B.x<-2&&(B.x=-.02,B.xanchor="right"),B.y>3?(B.y=1.02,B.yanchor="bottom"):B.y<-2&&(B.y=-.02,B.yanchor="top")),f.dragmode==="rotate"&&(f.dragmode="orbit"),i.clean(f),f.template&&f.template.layout&&te.cleanLayout(f.template.layout),f};function u(f,k){var w=f[k],D=k.charAt(0);w&&w!=="paper"&&(f[k]=n(w,D,!0))}te.cleanData=function(f){for(var k=0;k0)return f.substr(0,k)}te.hasParent=function(f,k){for(var w=_(k);w;){if(w in f)return!0;w=_(w)}return!1},te.clearAxisTypes=function(f,k,w){for(var D=0;D{let w=(...D)=>D.every(E=>y.isPlainObject(E))||D.every(E=>Array.isArray(E));if([f,k].every(D=>Array.isArray(D))){if(f.length!==k.length)return!1;for(let D=0;Dy.isPlainObject(D))){if(Object.keys(f).length!==Object.keys(k).length)return!1;for(let D in f){if(D.startsWith("_"))continue;let E=f[D],I=k[D];if(E!==I&&!(w(E,I)&&A(E,I)))return!1}return!0}return!1};te.collectionsAreEqual=A}),ww=Fe(te=>{var Y=ii(),d=Ar(),y=Xf(),z=ji(),P=z.nestedProperty,i=Gg(),n=hm(),a=as(),l=Zg(),o=sh(),u=Os(),s=ow(),h=qd(),m=Zs(),b=Xi(),x=P4().initInteractions,_=k0(),A=Mf().clearOutline,f=ss().dfltConfig,k=m8(),w=A_(),D=pm(),E=oh(),I=dc().AX_NAME_PATTERN,M=0,p=5;function g(De,ye,Pe,He){var at;if(De=z.getGraphDiv(De),i.init(De),z.isPlainObject(ye)){var ht=ye;ye=ht.data,Pe=ht.layout,He=ht.config,at=ht.frames}var At=i.triggerHandler(De,"plotly_beforeplot",[ye,Pe,He]);if(At===!1)return Promise.reject();!ye&&!Pe&&!z.isPlotDiv(De)&&z.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",De);function Wt(){if(at)return te.addFrames(De,at)}U(De,He),Pe||(Pe={}),Y.select(De).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(De._promises)||(De._promises=[]);var Kt=(De.data||[]).length===0&&Array.isArray(ye);Array.isArray(ye)&&(w.cleanData(ye),Kt?De.data=ye:De.data.push.apply(De.data,ye),De.empty=!1),(!De.layout||Kt)&&(De.layout=w.cleanLayout(Pe)),o.supplyDefaults(De);var hr=De._fullLayout,zr=hr._has("cartesian");hr._replotting=!0,(Kt||hr._shouldCreateBgLayer)&&(ot(De),hr._shouldCreateBgLayer&&delete hr._shouldCreateBgLayer),m.initGradients(De),m.initPatterns(De),Kt&&u.saveShowSpikeInitial(De);var Dr=!De.calcdata||De.calcdata.length!==(De._fullData||[]).length;Dr&&o.doCalcdata(De);for(var br=0;br=De.data.length||at<-De.data.length)throw new Error(Pe+" must be valid indices for gd.data.");if(ye.indexOf(at,He+1)>-1||at>=0&&ye.indexOf(-De.data.length+at)>-1||at<0&&ye.indexOf(De.data.length+at)>-1)throw new Error("each index in "+Pe+" must be unique.")}}function q(De,ye,Pe){if(!Array.isArray(De.data))throw new Error("gd.data must be an array.");if(typeof ye>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ye)||(ye=[ye]),$(De,ye,"currentIndices"),typeof Pe<"u"&&!Array.isArray(Pe)&&(Pe=[Pe]),typeof Pe<"u"&&$(De,Pe,"newIndices"),typeof Pe<"u"&&ye.length!==Pe.length)throw new Error("current and new indices must be of equal length.")}function G(De,ye,Pe){var He,at;if(!Array.isArray(De.data))throw new Error("gd.data must be an array.");if(typeof ye>"u")throw new Error("traces must be defined.");for(Array.isArray(ye)||(ye=[ye]),He=0;He"u")throw new Error("indices must be an integer or array of integers");$(De,Pe,"indices");for(var ht in ye){if(!Array.isArray(ye[ht])||ye[ht].length!==Pe.length)throw new Error("attribute "+ht+" must be an array of length equal to indices array length");if(at&&(!(ht in He)||!Array.isArray(He[ht])||He[ht].length!==ye[ht].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function he(De,ye,Pe,He){var at=z.isPlainObject(He),ht=[],At,Wt,Kt,hr,zr;Array.isArray(Pe)||(Pe=[Pe]),Pe=F(Pe,De.data.length-1);for(var Dr in ye)for(var br=0;br=0&&zr=0&&zr"u")return hr=te.redraw(De),n.add(De,at,At,ht,Wt),hr;Array.isArray(Pe)||(Pe=[Pe]);try{q(De,He,Pe)}catch(zr){throw De.data.splice(De.data.length-ye.length,ye.length),zr}return n.startSequence(De),n.add(De,at,At,ht,Wt),hr=te.moveTraces(De,He,Pe),n.stopSequence(De),hr}function ne(De,ye){De=z.getGraphDiv(De);var Pe=[],He=te.addTraces,at=ne,ht=[De,Pe,ye],At=[De,ye],Wt,Kt;if(typeof ye>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ye)||(ye=[ye]),$(De,ye,"indices"),ye=F(ye,De.data.length-1),ye.sort(z.sorterDes),Wt=0;Wt"u")for(Pe=[],hr=0;hr0&&typeof _r.parts[qi]!="string";)qi--;var Ui=_r.parts[qi],Hi=_r.parts[qi-1]+"."+Ui,En=_r.parts.slice(0,qi).join("."),Rn=P(De.layout,En).get(),Gn=P(He,En).get(),Xn=_r.get();if(Cr!==void 0){Wn[sr]=Cr,Sn[sr]=Ui==="reverse"?Cr:oe(Xn);var sa=l.getLayoutValObject(He,_r.parts);if(sa&&sa.impliedEdits&&Cr!==null)for(var Mn in sa.impliedEdits)fn(z.relativeAttr(sr,Mn),sa.impliedEdits[Mn]);if(["width","height"].indexOf(sr)!==-1)if(Cr){fn("autosize",null);var Ha=sr==="height"?"width":"height";fn(Ha,He[Ha])}else He[sr]=De._initialAutoSize[sr];else if(sr==="autosize")fn("width",Cr?null:He.width),fn("height",Cr?null:He.height);else if(Hi.match(Ge))Zt(Hi),P(He,En+"._inputRange").set(null);else if(Hi.match(rt)){Zt(Hi),P(He,En+"._inputRange").set(null);var ro=P(He,En).get();ro._inputDomain&&(ro._input.domain=ro._inputDomain.slice())}else Hi.match(_t)&&P(He,En+"._inputDomain").set(null);if(Ui==="type"){na=Rn;var Ft=Gn.type==="linear"&&Cr==="log",Rt=Gn.type==="log"&&Cr==="linear";if(Ft||Rt){if(!na||!na.range)fn(En+".autorange",!0);else if(Gn.autorange)Ft&&(na.range=na.range[1]>na.range[0]?[1,2]:[2,1]);else{var qr=na.range[0],ni=na.range[1];Ft?(qr<=0&&ni<=0&&fn(En+".autorange",!0),qr<=0?qr=ni/1e6:ni<=0&&(ni=qr/1e6),fn(En+".range[0]",Math.log(qr)/Math.LN10),fn(En+".range[1]",Math.log(ni)/Math.LN10)):(fn(En+".range[0]",Math.pow(10,qr)),fn(En+".range[1]",Math.pow(10,ni)))}Array.isArray(He._subplots.polar)&&He._subplots.polar.length&&He[_r.parts[0]]&&_r.parts[1]==="radialaxis"&&delete He[_r.parts[0]]._subplot.viewInitial["radialaxis.range"],a.getComponentMethod("annotations","convertCoords")(De,Gn,Cr,fn),a.getComponentMethod("images","convertCoords")(De,Gn,Cr,fn)}else fn(En+".autorange",!0),fn(En+".range",null);P(He,En+"._inputRange").set(null)}else if(Ui.match(I)){var oi=P(He,sr).get(),Gr=(Cr||{}).type;(!Gr||Gr==="-")&&(Gr="linear"),a.getComponentMethod("annotations","convertCoords")(De,oi,Gr,fn),a.getComponentMethod("images","convertCoords")(De,oi,Gr,fn)}var si=k.containerArrayMatch(sr);if(si){zr=si.array,Dr=si.index;var Pi=si.property,yi=sa||{editType:"calc"};Dr!==""&&Pi===""&&(k.isAddVal(Cr)?Sn[sr]=null:k.isRemoveVal(Cr)?Sn[sr]=(P(Pe,zr).get()||[])[Dr]:z.warn("unrecognized full object value",ye)),E.update(yn,yi),hr[zr]||(hr[zr]={});var zt=hr[zr][Dr];zt||(zt=hr[zr][Dr]={}),zt[Pi]=Cr,delete ye[sr]}else Ui==="reverse"?(Rn.range?Rn.range.reverse():(fn(En+".autorange",!0),Rn.range=[1,0]),Gn.autorange?yn.calc=!0:yn.plot=!0):(sr==="dragmode"&&(Cr===!1&&Xn!==!1||Cr!==!1&&Xn===!1)||He._has("scatter-like")&&He._has("regl")&&sr==="dragmode"&&(Cr==="lasso"||Cr==="select")&&!(Xn==="lasso"||Xn==="select")?yn.plot=!0:sa?E.update(yn,sa):yn.calc=!0,_r.set(Cr))}}for(zr in hr){var xr=k.applyContainerArrayChanges(De,ht(Pe,zr),hr[zr],yn,ht);xr||(yn.plot=!0)}for(var Jr in ga){na=u.getFromId(De,Jr);var Ri=na&&na._constraintGroup;if(Ri){yn.calc=!0;for(var tn in Ri)ga[tn]||(u.getFromId(De,tn)._constraintShrinkable=!0)}}(gt(De)||ye.height||ye.width)&&(yn.plot=!0);var _n=He.shapes;for(Dr=0;Dr<_n.length;Dr++)if(_n[Dr].showlegend){yn.calc=!0;break}return(yn.plot||yn.calc)&&(yn.layoutReplot=!0),{flags:yn,rangesAltered:ga,undoit:Sn,redoit:Wn,eventData:Kt}}function gt(De){var ye=De._fullLayout,Pe=ye.width,He=ye.height;return De.layout.autosize&&o.plotAutoSize(De,De.layout,ye),ye.width!==Pe||ye.height!==He}function ct(De,ye,Pe,He){De=z.getGraphDiv(De),w.clearPromiseQueue(De),z.isPlainObject(ye)||(ye={}),z.isPlainObject(Pe)||(Pe={}),Object.keys(ye).length&&(De.changed=!0),Object.keys(Pe).length&&(De.changed=!0);var at=w.coerceTraceIndices(De,He),ht=Ce(De,z.extendFlat({},ye),at),At=ht.flags,Wt=pt(De,z.extendFlat({},Pe)),Kt=Wt.flags;(At.calc||Kt.calc)&&(De.calcdata=void 0),At.clearAxisTypes&&w.clearAxisTypes(De,at,Pe);var hr=[];Kt.layoutReplot?hr.push(D.layoutReplot):At.fullReplot?hr.push(te._doPlot):(hr.push(o.previousPromises),Oe(De,Kt,Wt)||o.supplyDefaults(De),At.style&&hr.push(D.doTraceStyle),(At.colorbars||Kt.colorbars)&&hr.push(D.doColorBars),Kt.legend&&hr.push(D.doLegend),Kt.layoutstyle&&hr.push(D.layoutStyles),Kt.axrange&&Ze(hr,Wt.rangesAltered),Kt.ticks&&hr.push(D.doTicksRelayout),Kt.modebar&&hr.push(D.doModeBar),Kt.camera&&hr.push(D.doCamera),hr.push(C)),hr.push(o.rehover,o.redrag,o.reselect),n.add(De,ct,[De,ht.undoit,Wt.undoit,ht.traces],ct,[De,ht.redoit,Wt.redoit,ht.traces]);var zr=z.syncOrAsync(hr,De);return(!zr||!zr.then)&&(zr=Promise.resolve(De)),zr.then(function(){return De.emit("plotly_update",{data:ht.eventData,layout:Wt.eventData}),De})}function Ae(De){return function(ye){ye._fullLayout._guiEditing=!0;var Pe=De.apply(null,arguments);return ye._fullLayout._guiEditing=!1,Pe}}var ze=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Ee=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function nt(De,ye){for(var Pe=0;Pe1;)if(He.pop(),Pe=P(ye,He.join(".")+".uirevision").get(),Pe!==void 0)return Pe;return ye.uirevision}function ut(De,ye){for(var Pe=0;Pe[En,De._ev.listeners(En)]);ht=te.newPlot(De,ye,Pe,He).then(()=>{for(let[En,Rn]of Hi)Rn.forEach(Gn=>De.on(En,Gn));return te.react(De,ye,Pe,He)})}else{De.data=ye||[],w.cleanData(De.data),De.layout=Pe||{},w.cleanLayout(De.layout),Jt(De.data,De.layout,Wt,Kt),o.supplyDefaults(De,{skipUpdateCalc:!0});var Dr=De._fullData,br=De._fullLayout,hi=br.datarevision===void 0,un=br.transition,cn=Kr(De,Kt,br,hi,un),yn=cn.newDataRevision,Wn=mr(De,Wt,Dr,hi,un,yn);if(gt(De)&&(cn.layoutReplot=!0),Wn.calc||cn.calc){De.calcdata=void 0;for(var Sn=Object.getOwnPropertyNames(br),fn=0;fn(zr||De.emit("plotly_react",{config:He,data:ye,layout:Pe}),De))}function mr(De,ye,Pe,He,at,ht){var At=ye.length===Pe.length;if(!at&&!At)return{fullReplot:!0,calc:!0};var Wt=E.traceFlags();Wt.arrays={},Wt.nChanges=0,Wt.nChangesAnim=0;var Kt,hr;function zr(hi){var un=l.getTraceValObject(hr,hi);return!hr._module.animatable&&un.anim&&(un.anim=!1),un}var Dr={getValObject:zr,flags:Wt,immutable:He,transition:at,newDataRevision:ht,gd:De},br={};for(Kt=0;Kt=at.length?at[0]:at[hr]:at}function Wt(hr){return Array.isArray(ht)?hr>=ht.length?ht[0]:ht[hr]:ht}function Kt(hr,zr){var Dr=0;return function(){if(hr&&++Dr===zr)return hr()}}return new Promise(function(hr,zr){function Dr(){if(He._frameQueue.length!==0){for(;He._frameQueue.length;){var Ui=He._frameQueue.pop();Ui.onInterrupt&&Ui.onInterrupt()}De.emit("plotly_animationinterrupted",[])}}function br(Ui){if(Ui.length!==0){for(var Hi=0;HiHe._timeToNext&&un()};Ui()}var yn=0;function Wn(Ui){return Array.isArray(at)?yn>=at.length?Ui.transitionOpts=at[yn]:Ui.transitionOpts=at[0]:Ui.transitionOpts=at,yn++,Ui}var Sn,fn,ga=[],na=ye==null,Zt=Array.isArray(ye),sr=!na&&!Zt&&z.isPlainObject(ye);if(sr)ga.push({type:"object",data:Wn(z.extendFlat({},ye))});else if(na||["string","number"].indexOf(typeof ye)!==-1)for(Sn=0;Sn0&&fifi)&&qi.push(fn);ga=qi}}ga.length>0?br(ga):(De.emit("plotly_animated"),hr())})}function ui(De,ye,Pe){if(De=z.getGraphDiv(De),ye==null)return Promise.resolve();if(!z.isPlotDiv(De))throw new Error("This element is not a Plotly plot: "+De+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var He,at,ht,At,Wt=De._transitionData._frames,Kt=De._transitionData._frameHash;if(!Array.isArray(ye))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ye);var hr=Wt.length+ye.length*2,zr=[],Dr={};for(He=ye.length-1;He>=0;He--)if(z.isPlainObject(ye[He])){var br=ye[He].name,hi=(Kt[br]||Dr[br]||{}).name,un=ye[He].name,cn=Kt[hi]||Dr[hi];hi&&un&&typeof un=="number"&&cn&&M_r.index?-1:sr.index<_r.index?1:0});var yn=[],Wn=[],Sn=Wt.length;for(He=zr.length-1;He>=0;He--){if(at=zr[He].frame,typeof at.name=="number"&&z.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!at.name)for(;Kt[at.name="frame "+De._transitionData._counter++];);if(Kt[at.name]){for(ht=0;ht=0;Pe--)He=ye[Pe],ht.push({type:"delete",index:He}),At.unshift({type:"insert",index:He,value:at[He]});var Wt=o.modifyFrames,Kt=o.modifyFrames,hr=[De,At],zr=[De,ht];return n&&n.add(De,Wt,hr,Kt,zr),o.modifyFrames(De,ht)}function Ot(De){De=z.getGraphDiv(De);var ye=De._fullLayout||{},Pe=De._fullData||[];return o.cleanPlot([],{},Pe,ye),o.purge(De),i.purge(De),ye._container&&ye._container.remove(),delete De._context,De}function Je(De){var ye=De._fullLayout,Pe=De.getBoundingClientRect();if(!z.equalDomRects(Pe,ye._lastBBox)){var He=ye._invTransform=z.inverseTransformMatrix(z.getFullTransformMatrix(De));ye._invScaleX=Math.sqrt(He[0][0]*He[0][0]+He[0][1]*He[0][1]+He[0][2]*He[0][2]),ye._invScaleY=Math.sqrt(He[1][0]*He[1][0]+He[1][1]*He[1][1]+He[1][2]*He[1][2]),ye._lastBBox=Pe}}function ot(De){var ye=Y.select(De),Pe=De._fullLayout;if(Pe._calcInverseTransform=Je,Pe._calcInverseTransform(De),Pe._container=ye.selectAll(".plot-container").data([0]),Pe._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Pe._paperdiv=Pe._container.selectAll(".svg-container").data([0]),Pe._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Pe._glcontainer=Pe._paperdiv.selectAll(".gl-container").data([{}]),Pe._glcontainer.enter().append("div").classed("gl-container",!0),Pe._paperdiv.selectAll(".main-svg").remove(),Pe._paperdiv.select(".modebar-container").remove(),Pe._paper=Pe._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Pe._toppaper=Pe._paperdiv.append("svg").classed("main-svg",!0),Pe._modebardiv=Pe._paperdiv.append("div"),delete Pe._modeBar,Pe._hoverpaper=Pe._paperdiv.append("svg").classed("main-svg",!0),!Pe._uid){var He={};Y.selectAll("defs").each(function(){this.id&&(He[this.id.split("-")[1]]=1)}),Pe._uid=z.randstr(He)}Pe._paperdiv.selectAll(".main-svg").attr(_.svgAttrs),Pe._defs=Pe._paper.append("defs").attr("id","defs-"+Pe._uid),Pe._clips=Pe._defs.append("g").classed("clips",!0),Pe._topdefs=Pe._toppaper.append("defs").attr("id","topdefs-"+Pe._uid),Pe._topclips=Pe._topdefs.append("g").classed("clips",!0),Pe._bgLayer=Pe._paper.append("g").classed("bglayer",!0),Pe._draggers=Pe._paper.append("g").classed("draglayer",!0);var at=Pe._paper.append("g").classed("layer-below",!0);Pe._imageLowerLayer=at.append("g").classed("imagelayer",!0),Pe._shapeLowerLayer=at.append("g").classed("shapelayer",!0),Pe._cartesianlayer=Pe._paper.append("g").classed("cartesianlayer",!0),Pe._polarlayer=Pe._paper.append("g").classed("polarlayer",!0),Pe._smithlayer=Pe._paper.append("g").classed("smithlayer",!0),Pe._ternarylayer=Pe._paper.append("g").classed("ternarylayer",!0),Pe._geolayer=Pe._paper.append("g").classed("geolayer",!0),Pe._funnelarealayer=Pe._paper.append("g").classed("funnelarealayer",!0),Pe._pielayer=Pe._paper.append("g").classed("pielayer",!0),Pe._iciclelayer=Pe._paper.append("g").classed("iciclelayer",!0),Pe._treemaplayer=Pe._paper.append("g").classed("treemaplayer",!0),Pe._sunburstlayer=Pe._paper.append("g").classed("sunburstlayer",!0),Pe._indicatorlayer=Pe._toppaper.append("g").classed("indicatorlayer",!0),Pe._glimages=Pe._paper.append("g").classed("glimages",!0);var ht=Pe._toppaper.append("g").classed("layer-above",!0);Pe._imageUpperLayer=ht.append("g").classed("imagelayer",!0),Pe._shapeUpperLayer=ht.append("g").classed("shapelayer",!0),Pe._selectionLayer=Pe._toppaper.append("g").classed("selectionlayer",!0),Pe._infolayer=Pe._toppaper.append("g").classed("infolayer",!0),Pe._menulayer=Pe._toppaper.append("g").classed("menulayer",!0),Pe._zoomlayer=Pe._toppaper.append("g").classed("zoomlayer",!0),Pe._hoverlayer=Pe._hoverpaper.append("g").classed("hoverlayer",!0),Pe._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),De.emit("plotly_framework")}te.animate=Mr,te.addFrames=ui,te.deleteFrames=mi,te.addTraces=ge,te.deleteTraces=ne,te.extendTraces=ce,te.moveTraces=se,te.prependTraces=re,te.newPlot=W,te._doPlot=g,te.purge=Ot,te.react=gr,te.redraw=V,te.relayout=Be,te.restyle=_e,te.setPlotConfig=T,te.update=ct,te._guiRelayout=Ae(Be),te._guiRestyle=Ae(_e),te._guiUpdate=Ae(ct),te._storeDirectGUIEdit=fe}),Y0=Fe(te=>{var Y=as();te.getDelay=function(z){return z._has&&(z._has("gl3d")||z._has("mapbox")||z._has("map"))?500:0},te.getRedrawFunc=function(z){return function(){Y.getComponentMethod("colorbar","draw")(z)}},te.encodeSVG=function(z){return"data:image/svg+xml,"+encodeURIComponent(z)},te.encodeJSON=function(z){return"data:application/json,"+encodeURIComponent(z)};var d=window.URL||window.webkitURL;te.createObjectURL=function(z){return d.createObjectURL(z)},te.revokeObjectURL=function(z){return d.revokeObjectURL(z)},te.createBlob=function(z,P){if(P==="svg")return new window.Blob([z],{type:"image/svg+xml;charset=utf-8"});if(P==="full-json")return new window.Blob([z],{type:"application/json;charset=utf-8"});var i=y(window.atob(z));return new window.Blob([i],{type:"image/"+P})},te.octetStream=function(z){document.location.href="data:application/octet-stream"+z};function y(z){for(var P=z.length,i=new ArrayBuffer(P),n=new Uint8Array(i),a=0;a{var d=ii();ji();var y=Zs(),z=Xi();k0();var P=/"/g,i="TOBESTRIPPED",n=new RegExp('("'+i+")|("+i+'")',"g");function a(o){var u=d.select("body").append("div").style({display:"none"}).html(""),s=o.replace(/(&[^;]*;)/gi,function(h){return h==="<"?"<":h==="&rt;"?">":h.indexOf("<")!==-1||h.indexOf(">")!==-1?"":u.html(h).text()});return u.remove(),s}function l(o){return o.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}Y.exports=function(o,u,s){var h=o._fullLayout,m=h._paper,b=h._toppaper,x=h.width,_=h.height,A;m.insert("rect",":first-child").call(y.setRect,0,0,x,_).call(z.fill,h.paper_bgcolor);var f=h._basePlotModules||[];for(A=0;A{var d=ji(),y=qg().EventEmitter,z=Y0();function P(i){var n=i.emitter||new y,a=new Promise(function(l,o){var u=window.Image,s=i.svg,h=i.format||"png",m=i.canvas,b=i.scale||1,x=i.width||300,_=i.height||150,A=b*x,f=b*_,k=m.getContext("2d",{willReadFrequently:!0}),w=new u,D,E;h==="svg"||d.isSafari()?E=z.encodeSVG(s):(D=z.createBlob(s,"svg"),E=z.createObjectURL(D)),m.width=A,m.height=f,w.onload=function(){var I;switch(D=null,z.revokeObjectURL(E),h!=="svg"&&k.drawImage(w,0,0,A,f),h){case"jpeg":I=m.toDataURL("image/jpeg");break;case"png":I=m.toDataURL("image/png");break;case"webp":I=m.toDataURL("image/webp");break;case"svg":I=E;break;default:var M="Image format is not jpeg, png, svg or webp.";if(o(new Error(M)),!i.promise)return n.emit("error",M)}l(I),i.promise||n.emit("success",I)},w.onerror=function(I){if(D=null,z.revokeObjectURL(E),o(I),!i.promise)return n.emit("error",I)},w.src=E});return i.promise?a:n}Y.exports=P}),D4=Fe((te,Y)=>{var d=Ar(),y=ww(),z=sh(),P=ji(),i=Y0(),n=ub(),a=cb(),l=_i().version,o={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function u(s,h){h=h||{};var m,b,x,_;P.isPlainObject(s)?(m=s.data||[],b=s.layout||{},x=s.config||{},_={}):(s=P.getGraphDiv(s),m=P.extendDeep([],s.data),b=P.extendDeep({},s.layout),x=s._context,_=s._fullLayout||{});function A(W){return!(W in h)||P.validate(h[W],o[W])}if(!A("width")&&h.width!==null||!A("height")&&h.height!==null)throw new Error("Height and width should be pixel values.");if(!A("format"))throw new Error("Export format is not "+P.join2(o.format.values,", "," or ")+".");var f={};function k(W,F){return P.coerce(h,f,o,W,F)}var w=k("format"),D=k("width"),E=k("height"),I=k("scale"),M=k("setBackground"),p=k("imageDataOnly"),g=document.createElement("div");g.style.position="absolute",g.style.left="-5000px",document.body.appendChild(g);var C=P.extendFlat({},b);D?C.width=D:h.width===null&&d(_.width)&&(C.width=_.width),E?C.height=E:h.height===null&&d(_.height)&&(C.height=_.height);var T=P.extendFlat({},x,{_exportedPlot:!0,staticPlot:!0,setBackground:M}),N=i.getRedrawFunc(g);function B(){return new Promise(function(W){setTimeout(W,i.getDelay(g._fullLayout))})}function U(){return new Promise(function(W,F){var $=n(g,w,I),q=g._fullLayout.width,G=g._fullLayout.height;function ee(){y.purge(g),document.body.removeChild(g)}if(w==="full-json"){var he=z.graphJson(g,!1,"keepdata","object",!0,!0);return he.version=l,he=JSON.stringify(he),ee(),W(p?he:i.encodeJSON(he))}if(ee(),w==="svg")return W(p?$:i.encodeSVG($));var xe=document.createElement("canvas");xe.id=P.randstr(),a({format:w,width:q,height:G,scale:I,canvas:xe,svg:$,promise:!0}).then(W).catch(F)})}function V(W){return p?W.replace(i.IMAGE_URL_PREFIX,""):W}return new Promise(function(W,F){y.newPlot(g,m,C,T).then(N).then(B).then(U).then(function($){W(V($))}).catch(function($){F($)})})}Y.exports=u}),Eg=Fe((te,Y)=>{var d=ji(),y=sh(),z=Zg(),P=ss().dfltConfig,i=d.isPlainObject,n=Array.isArray,a=d.isArrayOrTypedArray;Y.exports=function(f,k){f===void 0&&(f=[]),k===void 0&&(k={});var w=z.get(),D=[],E={_context:d.extendFlat({},P)},I,M;n(f)?(E.data=d.extendDeep([],f),I=f):(E.data=[],I=[],D.push(h("array","data"))),i(k)?(E.layout=d.extendDeep({},k),M=k):(E.layout={},M={},arguments.length>1&&D.push(h("object","layout"))),y.supplyDefaults(E);for(var p=E._fullData,g=I.length,C=0;CN.length&&D.push(h("unused",E,C.concat(N.length)));var $=N.length,q=Array.isArray(F);q&&($=Math.min($,F.length));var G,ee,he,xe,ve;if(B.dimensions===2)for(ee=0;ee<$;ee++)if(n(T[ee])){T[ee].length>N[ee].length&&D.push(h("unused",E,C.concat(ee,N[ee].length)));var ce=N[ee].length;for(G=0;G<(q?Math.min(ce,F[ee].length):ce);G++)he=q?F[ee][G]:F,xe=T[ee][G],ve=N[ee][G],d.validate(xe,he)?ve!==xe&&ve!==+xe&&D.push(h("dynamic",E,C.concat(ee,G),xe,ve)):D.push(h("value",E,C.concat(ee,G),xe))}else D.push(h("array",E,C.concat(ee),T[ee]));else for(ee=0;ee<$;ee++)he=q?F[ee]:F,xe=T[ee],ve=N[ee],d.validate(xe,he)?ve!==xe&&ve!==+xe&&D.push(h("dynamic",E,C.concat(ee),xe,ve)):D.push(h("value",E,C.concat(ee),xe))}else if(B.items&&!V&&n(T)){var re=F[Object.keys(F)[0]],ge=[],ne,se;for(ne=0;ne{var d=ji(),y=Y0();function z(P,i,n){var a=document.createElement("a"),l="download"in a,o=new Promise(function(u,s){var h,m;if(l)return h=y.createBlob(P,n),m=y.createObjectURL(h),a.href=m,a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a),y.revokeObjectURL(m),h=null,u(i);if(d.isSafari()){var b=n==="svg"?",":";base64,";return y.octetStream(b+encodeURIComponent(P)),u(i)}s(new Error("download error"))});return o}Y.exports=z}),kw=Fe((te,Y)=>{var d=ji(),y=D4(),z=z4();Y0();function P(i,n){var a;return d.isPlainObject(i)||(a=d.getGraphDiv(i)),n=n||{},n.format=n.format||"png",n.width=n.width||null,n.height=n.height||null,n.imageDataOnly=!0,new Promise(function(l,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var u=y(i,n),s=n.filename||i.fn||"newplot";s+="."+n.format.replace("-","."),u.then(function(h){return a&&(a._snapshotInProgress=!1),z(h,s,n.format)}).then(function(h){l(h)}).catch(function(h){a&&(a._snapshotInProgress=!1),o(h)})})}Y.exports=P}),M_=Fe(te=>{var Y=ji(),d=Y.isPlainObject,y=Zg(),z=sh(),P=_a(),i=ku(),n=ss().dfltConfig;te.makeTemplate=function(x){x=Y.isPlainObject(x)?x:Y.getGraphDiv(x),x=Y.extendDeep({_context:n},{data:x.data,layout:x.layout}),z.supplyDefaults(x);var _=x.data||[],A=x.layout||{};A._basePlotModules=x._fullLayout._basePlotModules,A._modules=x._fullLayout._modules;var f={data:{},layout:{}};_.forEach(function(T){var N={};o(T,N,s.bind(null,T));var B=Y.coerce(T,{},P,"type"),U=f.data[B];U||(U=f.data[B]=[]),U.push(N)}),o(A,f.layout,u.bind(null,A)),delete f.layout.template;var k=A.template;if(d(k)){var w=k.layout,D,E,I,M,p,g;d(w)&&a(w,f.layout);var C=k.data;if(d(C)){for(E in f.data)if(I=C[E],Array.isArray(I)){for(p=f.data[E],g=p.length,M=I.length,D=0;DV?D.push({code:"unused",traceType:T,templateCount:U,dataCount:V}):V>U&&D.push({code:"reused",traceType:T,templateCount:U,dataCount:V})}}function W(F,$){for(var q in F)if(q.charAt(0)!=="_"){var G=F[q],ee=h(F,q,$);d(G)?(Array.isArray(F)&&G._template===!1&&G.templateitemname&&D.push({code:"missing",path:ee,templateitemname:G.templateitemname}),W(G,ee)):Array.isArray(G)&&m(G)&&W(G,ee)}}if(W({data:I,layout:E},""),D.length)return D.map(b)};function m(x){for(var _=0;_{var Y=ww();te._doPlot=Y._doPlot,te.newPlot=Y.newPlot,te.restyle=Y.restyle,te.relayout=Y.relayout,te.redraw=Y.redraw,te.update=Y.update,te._guiRestyle=Y._guiRestyle,te._guiRelayout=Y._guiRelayout,te._guiUpdate=Y._guiUpdate,te._storeDirectGUIEdit=Y._storeDirectGUIEdit,te.react=Y.react,te.extendTraces=Y.extendTraces,te.prependTraces=Y.prependTraces,te.addTraces=Y.addTraces,te.deleteTraces=Y.deleteTraces,te.moveTraces=Y.moveTraces,te.purge=Y.purge,te.addFrames=Y.addFrames,te.deleteFrames=Y.deleteFrames,te.animate=Y.animate,te.setPlotConfig=Y.setPlotConfig;var d=q0().getGraphDiv,y=mw().eraseActiveShape;te.deleteActiveShape=function(P){return y(d(P))},te.toImage=D4(),te.validate=Eg(),te.downloadImage=kw();var z=M_();te.makeTemplate=z.makeTemplate,te.validateTemplate=z.validateTemplate}),Jg=Fe((te,Y)=>{var d=ji(),y=as();Y.exports=function(z,P,i,n){var a=n("x"),l=n("y"),o,u=y.getComponentMethod("calendars","handleTraceDefaults");if(u(z,P,["x","y"],i),a){var s=d.minRowLength(a);l?o=Math.min(s,d.minRowLength(l)):(o=s,n("y0"),n("dy"))}else{if(!l)return 0;o=d.minRowLength(l),n("x0"),n("dx")}return P._length=o,o}}),S0=Fe((te,Y)=>{var d=ji().dateTick0,y=ti(),z=y.ONEWEEK;function P(i,n){return i%z===0?d(n,1):d(n,0)}Y.exports=function(i,n,a,l,o){if(o||(o={x:!0,y:!0}),o.x){var u=l("xperiod");u&&(l("xperiod0",P(u,n.xcalendar)),l("xperiodalignment"))}if(o.y){var s=l("yperiod");s&&(l("yperiod0",P(s,n.ycalendar)),l("yperiodalignment"))}}}),O4=Fe((te,Y)=>{var d=["orientation","groupnorm","stackgaps"];Y.exports=function(y,z,P,i){var n=P._scatterStackOpts,a=i("stackgroup");if(a){var l=z.xaxis+z.yaxis,o=n[l];o||(o=n[l]={});var u=o[a],s=!1;u?u.traces.push(z):(u=o[a]={traceIndices:[],traces:[z]},s=!0);for(var h={orientation:z.x&&!z.y?"h":"v"},m=0;m{var d=Xi(),y=cp().hasColorscale,z=Cc(),P=Oc();Y.exports=function(i,n,a,l,o,u){var s=P.isBubble(i),h=(i.line||{}).color,m;if(u=u||{},h&&(a=h),o("marker.symbol"),o("marker.opacity",s?.7:1),o("marker.size"),u.noAngle||(o("marker.angle"),u.noAngleRef||o("marker.angleref"),u.noStandOff||o("marker.standoff")),o("marker.color",a),y(i,"marker")&&z(i,n,l,o,{prefix:"marker.",cLetter:"c"}),u.noSelect||(o("selected.marker.color"),o("unselected.marker.color"),o("selected.marker.size"),o("unselected.marker.size")),u.noLine||(h&&!Array.isArray(h)&&n.marker.color!==h?m=h:s?m=d.background:m=d.defaultLine,o("marker.line.color",m),y(i,"marker.line")&&z(i,n,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width",s?1:0)),s&&(o("marker.sizeref"),o("marker.sizemin"),o("marker.sizemode")),u.gradient){var b=o("marker.gradient.type");b!=="none"&&o("marker.gradient.color")}}}),Pm=Fe((te,Y)=>{var d=ji().isArrayOrTypedArray,y=cp().hasColorscale,z=Cc();Y.exports=function(P,i,n,a,l,o){o||(o={});var u=(P.marker||{}).color;if(u&&u._inputArray&&(u=u._inputArray),l("line.color",n),y(P,"line"))z(P,i,a,l,{prefix:"line.",cLetter:"c"});else{var s=(d(u)?!1:u)||n;l("line.color",s)}l("line.width"),o.noDash||l("line.dash"),o.backoff&&l("line.backoff")}}),ry=Fe((te,Y)=>{Y.exports=function(d,y,z){var P=z("line.shape");P==="spline"&&z("line.smoothing")}}),mm=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z,P,i,n){n=n||{},i("textposition"),d.coerceFont(i,"textfont",n.font||P.font,n),n.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}),Im=Fe((te,Y)=>{var d=Xi(),y=ji().isArrayOrTypedArray;function z(P){for(var i=d.interpolate(P[0][1],P[1][1],.5),n=2;n{var d=ji(),y=as(),z=ff(),P=Mg(),i=Oc(),n=Jg(),a=S0(),l=O4(),o=X0(),u=Pm(),s=ry(),h=mm(),m=Im(),b=ji().coercePattern;Y.exports=function(x,_,A,f){function k(C,T){return d.coerce(x,_,z,C,T)}var w=n(x,_,f,k);if(w||(_.visible=!1),!!_.visible){a(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("zorder");var D=l(x,_,f,k);f.scattermode==="group"&&_.orientation===void 0&&k("orientation","v");var E=!D&&w{var d=ey().getAxisGroup;Y.exports=function(y,z,P,i,n){var a=z.orientation,l=z[{v:"x",h:"y"}[a]+"axis"],o=d(P,l)+a,u=P._alignmentOpts||{},s=i("alignmentgroup"),h=u[o];h||(h=u[o]={});var m=h[s];m?m.traces.push(z):m=h[s]={traces:[z],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var b=i("offsetgroup")||"",x=m.offsetGroups,_=x[b];z._offsetIndex=0,(n!=="group"||b)&&(_||(_=x[b]={offsetIndex:Object.keys(x).length}),z._offsetIndex=_.offsetIndex)}}),R4=Fe((te,Y)=>{var d=ji(),y=Xv(),z=ff();Y.exports=function(P,i){var n,a,l,o=i.scattermode;function u(x){return d.coerce(a._input,a,z,x)}if(i.scattermode==="group")for(l=0;l=0;m--){var b=P[m];if(b.type==="scatter"&&b.xaxis===s.xaxis&&b.yaxis===s.yaxis){b.opacity=void 0;break}}}}}}),F4=Fe((te,Y)=>{var d=ji(),y=Nv();Y.exports=function(z,P){function i(a,l){return d.coerce(z,P,y,a,l)}var n=P.barmode==="group";P.scattermode==="group"&&i("scattergap",n?P.bargap:.2)}}),Dm=Fe((te,Y)=>{var d=Ar(),y=ji(),z=y.dateTime2ms,P=y.incrementMonth,i=ti(),n=i.ONEAVGMONTH;Y.exports=function(a,l,o,u){if(l.type!=="date")return{vals:u};var s=a[o+"periodalignment"];if(!s)return{vals:u};var h=a[o+"period"],m;if(d(h)){if(h=+h,h<=0)return{vals:u}}else if(typeof h=="string"&&h.charAt(0)==="M"){var b=+h.substring(1);if(b>0&&Math.round(b)===b)m=b;else return{vals:u}}for(var x=l.calendar,_=s==="start",A=s==="end",f=a[o+"period0"],k=z(f,x)||0,w=[],D=[],E=[],I=u.length,M=0;Mp;)T=P(T,-m,x);for(;T<=p;)T=P(T,m,x);C=P(T,-m,x)}else{for(g=Math.round((p-k)/h),T=k+g*h;T>p;)T-=h;for(;T<=p;)T+=h;C=T-h}w[M]=_?C:A?T:(C+T)/2,D[M]=C,E[M]=T}return{vals:w,starts:D,ends:E}}}),zm=Fe((te,Y)=>{var d=cp().hasColorscale,y=kp(),z=Oc();Y.exports=function(P,i){z.hasLines(i)&&d(i,"line")&&y(P,i,{vals:i.line.color,containerStr:"line",cLetter:"c"}),z.hasMarkers(i)&&(d(i,"marker")&&y(P,i,{vals:i.marker.color,containerStr:"marker",cLetter:"c"}),d(i,"marker.line")&&y(P,i,{vals:i.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),de=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=ji();Y.exports=function(y,z){d.isArrayOrTypedArray(z.selectedpoints)&&d.tagSelected(y,z)}}),yt=Fe((te,Y)=>{var d=Ar(),y=ji(),z=Os(),P=Dm(),i=ti().BADNUM,n=Oc(),a=zm(),l=de(),o=$e();function u(_,A){var f=_._fullLayout,k=A._xA=z.getFromId(_,A.xaxis||"x","x"),w=A._yA=z.getFromId(_,A.yaxis||"y","y"),D=k.makeCalcdata(A,"x"),E=w.makeCalcdata(A,"y"),I=P(A,k,"x",D),M=P(A,w,"y",E),p=I.vals,g=M.vals,C=A._length,T=new Array(C),N=A.ids,B=x(A,f,k,w),U=!1,V,W,F,$,q,G;m(f,A);var ee="x",he="y",xe;if(B)y.pushUnique(B.traceIndices,A.index),V=B.orientation==="v",V?(he="s",xe="x"):(ee="s",xe="y"),q=B.stackgaps==="interpolate";else{var ve=h(A,C);s(_,A,k,w,p,g,ve)}var ce=!!A.xperiodalignment,re=!!A.yperiodalignment;for(W=0;WW&&T[$].gap;)$--;for(G=T[$].s,F=T.length-1;F>$;F--)T[F].s=G;for(;W<$;)if(W++,T[W].gap){for(F=W+1;T[F].gap;)F++;for(var _e=T[W-1][xe],oe=T[W-1].s,J=(T[F].s-oe)/(T[F][xe]-_e);W{Y.exports=y;var d=ji().distinctVals;function y(z,P){this.traces=z,this.sepNegVal=P.sepNegVal,this.overlapNoMerge=P.overlapNoMerge;for(var i=1/0,n=P.posAxis._id.charAt(0),a=[],l=0;l{var d=Ar(),y=ji().isArrayOrTypedArray,z=ti().BADNUM,P=as(),i=Os(),n=ey().getAxisGroup,a=nr();function l(T,N){for(var B=N.xaxis,U=N.yaxis,V=T._fullLayout,W=T._fullData,F=T.calcdata,$=[],q=[],G=0;Gq+F||!d($))}for(var ee=0;ee{var d=yt(),y=jr().setGroupPositions;function z(n,a){for(var l=a.xaxis,o=a.yaxis,u=n._fullLayout,s=n._fullData,h=n.calcdata,m=[],b=[],x=0;xB[x]&&x{var d=Zs(),y=ti(),z=y.BADNUM,P=y.LOG_CLIP,i=P+.5,n=P-.5,a=ji(),l=a.segmentsIntersect,o=a.constrain,u=Mg();Y.exports=function(s,h){var m=h.trace||{},b=h.xaxis,x=h.yaxis,_=b.type==="log",A=x.type==="log",f=b._length,k=x._length,w=h.backoff,D=m.marker,E=h.connectGaps,I=h.baseTolerance,M=h.shape,p=M==="linear",g=m.fill&&m.fill!=="none",C=[],T=u.minTolerance,N=s.length,B=new Array(N),U=0,V,W,F,$,q,G,ee,he,xe,ve,ce,re,ge,ne,se,_e;function oe(At){var Wt=s[At];if(!Wt)return!1;var Kt=h.linearized?b.l2p(Wt.x):b.c2p(Wt.x),hr=h.linearized?x.l2p(Wt.y):x.c2p(Wt.y);if(Kt===z){if(_&&(Kt=b.c2p(Wt.x,!0)),Kt===z)return!1;A&&hr===z&&(Kt*=Math.abs(b._m*k*(b._m>0?i:n)/(x._m*f*(x._m>0?i:n)))),Kt*=1e3}if(hr===z){if(A&&(hr=x.c2p(Wt.y,!0)),hr===z)return!1;hr*=1e3}return[Kt,hr]}function J(At,Wt,Kt,hr){var zr=Kt-At,Dr=hr-Wt,br=.5-At,hi=.5-Wt,un=zr*zr+Dr*Dr,cn=zr*br+Dr*hi;if(cn>0&&cn1||Math.abs(br.y-Kt[0][1])>1)&&(br=[br.x,br.y],hr&&Be(br,At)Ge||At[1]_t)return[o(At[0],Ze,Ge),o(At[1],rt,_t)]}function Et(At,Wt){if(At[0]===Wt[0]&&(At[0]===Ze||At[0]===Ge)||At[1]===Wt[1]&&(At[1]===rt||At[1]===_t))return!0}function Gt(At,Wt){var Kt=[],hr=ut(At),zr=ut(Wt);return hr&&zr&&Et(hr,zr)||(hr&&Kt.push(hr),zr&&Kt.push(zr)),Kt}function Jt(At,Wt,Kt){return function(hr,zr){var Dr=ut(hr),br=ut(zr),hi=[];if(Dr&&br&&Et(Dr,br))return hi;Dr&&hi.push(Dr),br&&hi.push(br);var un=2*a.constrain((hr[At]+zr[At])/2,Wt,Kt)-((Dr||hr)[At]+(br||zr)[At]);if(un){var cn;Dr&&br?cn=un>0==Dr[At]>br[At]?Dr:br:cn=Dr||br,cn[At]+=un}return hi}}var gr;M==="linear"||M==="spline"?gr=xt:M==="hv"||M==="vh"?gr=Gt:M==="hvh"?gr=Jt(0,Ze,Ge):M==="vhv"&&(gr=Jt(1,rt,_t));function mr(At,Wt){var Kt=Wt[0]-At[0],hr=(Wt[1]-At[1])/Kt,zr=(At[1]*Wt[0]-Wt[1]*At[0])/Kt;return zr>0?[hr>0?Ze:Ge,_t]:[hr>0?Ge:Ze,rt]}function Kr(At){var Wt=At[0],Kt=At[1],hr=Wt===B[U-1][0],zr=Kt===B[U-1][1];if(!(hr&&zr))if(U>1){var Dr=Wt===B[U-2][0],br=Kt===B[U-2][1];hr&&(Wt===Ze||Wt===Ge)&&Dr?br?U--:B[U-1]=At:zr&&(Kt===rt||Kt===_t)&&br?Dr?U--:B[U-1]=At:B[U++]=At}else B[U++]=At}function ri(At){B[U-1][0]!==At[0]&&B[U-1][1]!==At[1]&&Kr([Ae,ze]),Kr(At),Ee=null,Ae=ze=0}var Mr=a.isArrayOrTypedArray(D);function ui(At){if(At&&w&&(At.i=V,At.d=s,At.trace=m,At.marker=Mr?D[At.i]:D,At.backoff=w),me=At[0]/f,fe=At[1]/k,gt=At[0]Ge?Ge:0,ct=At[1]_t?_t:0,gt||ct){if(!U)B[U++]=[gt||At[0],ct||At[1]];else if(Ee){var Wt=gr(Ee,At);Wt.length>1&&(ri(Wt[0]),B[U++]=Wt[1])}else nt=gr(B[U-1],At)[0],B[U++]=nt;var Kt=B[U-1];gt&&ct&&(Kt[0]!==gt||Kt[1]!==ct)?(Ee&&(Ae!==gt&&ze!==ct?Kr(Ae&&ze?mr(Ee,At):[Ae||gt,ze||ct]):Ae&&ze&&Kr([Ae,ze])),Kr([gt,ct])):Ae-gt&&ze-ct&&Kr([gt||Ae,ct||ze]),Ee=At,Ae=gt,ze=ct}else Ee&&ri(gr(Ee,At)[0]),B[U++]=At}for(V=0;VCe(G,mi))break;F=G,ge=xe[0]*he[0]+xe[1]*he[1],ge>ce?(ce=ge,$=G,ee=!1):ge=s.length||!G)break;ui(G),W=G}}Ee&&Kr([Ae||Ee[0],ze||Ee[1]]),C.push(B.slice(0,U))}var Ot=M.slice(M.length-1);if(w&&Ot!=="h"&&Ot!=="v"){for(var Je=!1,ot=-1,De=[],ye=0;ye{var d={tonextx:1,tonexty:1,tonext:1};Y.exports=function(y,z,P){var i,n,a,l,o,u={},s=!1,h=-1,m=0,b=-1;for(n=0;n=0?o=b:(o=b=m,m++),o{var d=ii(),y=as(),z=ji(),P=z.ensureSingle,i=z.identity,n=Zs(),a=Oc(),l=ra(),o=Xa(),u=Cg().tester;Y.exports=function(b,x,_,A,f,k){var w,D,E=!f,I=!!f&&f.duration>0,M=o(b,x,_);if(w=A.selectAll("g.trace").data(M,function(g){return g[0].trace.uid}),w.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),w.order(),s(b,w,x),I){k&&(D=k());var p=d.transition().duration(f.duration).ease(f.easing).each("end",function(){D&&D()}).each("interrupt",function(){D&&D()});p.each(function(){A.selectAll("g.trace").each(function(g,C){h(b,C,x,g,M,this,f)})})}else w.each(function(g,C){h(b,C,x,g,M,this,f)});E&&w.exit().remove(),A.selectAll("path:not([d])").remove()};function s(b,x,_){x.each(function(A){var f=P(d.select(this),"g","fills");n.setClipUrl(f,_.layerClipId,b);var k=A[0].trace,w=[];k._ownfill&&w.push("_ownFill"),k._nexttrace&&w.push("_nextFill");var D=f.selectAll("g").data(w,i);D.enter().append("g"),D.exit().each(function(E){k[E]=null}).remove(),D.order().each(function(E){k[E]=P(d.select(this),"path","js-fill")})})}function h(b,x,_,A,f,k,w){var D=b._context.staticPlot,E;m(b,x,_,A,f);var I=!!w&&w.duration>0;function M(ri){return I?ri.transition():ri}var p=_.xaxis,g=_.yaxis,C=A[0].trace,T=C.line,N=d.select(k),B=P(N,"g","errorbars"),U=P(N,"g","lines"),V=P(N,"g","points"),W=P(N,"g","text");if(y.getComponentMethod("errorbars","plot")(b,B,_,w),C.visible!==!0)return;M(N).style("opacity",C.opacity);var F,$,q=C.fill.charAt(C.fill.length-1);q!=="x"&&q!=="y"&&(q="");var G,ee;q==="y"?(G=1,ee=g.c2p(0,!0)):q==="x"&&(G=0,ee=p.c2p(0,!0)),A[0][_.isRangePlot?"nodeRangePlot3":"node3"]=N;var he="",xe=[],ve=C._prevtrace,ce=null,re=null;ve&&(he=ve._prevRevpath||"",$=ve._nextFill,xe=ve._ownPolygons,ce=ve._fillsegments,re=ve._fillElement);var ge,ne,se="",_e="",oe,J,me,fe,Ce,Be,Oe=[];C._polygons=[];var Ze=[],Ge=[],rt=z.noop;if(F=C._ownFill,a.hasLines(C)||C.fill!=="none"){$&&$.datum(A),["hv","vh","hvh","vhv"].indexOf(T.shape)!==-1?(oe=n.steps(T.shape),J=n.steps(T.shape.split("").reverse().join(""))):T.shape==="spline"?oe=J=function(ri){var Mr=ri[ri.length-1];return ri.length>1&&ri[0][0]===Mr[0]&&ri[0][1]===Mr[1]?n.smoothclosed(ri.slice(1),T.smoothing):n.smoothopen(ri,T.smoothing)}:oe=J=function(ri){return"M"+ri.join("L")},me=function(ri){return J(ri.reverse())},Ge=l(A,{xaxis:p,yaxis:g,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:C.fill}),Ze=new Array(Ge.length);var _t=0;for(E=0;E=D[0]&&N.x<=D[1]&&N.y>=E[0]&&N.y<=E[1]}),g=Math.ceil(p.length/M),C=0;f.forEach(function(N,B){var U=N[0].trace;a.hasMarkers(U)&&U.marker.maxdisplayed>0&&B{Y.exports={container:"marker",min:"cmin",max:"cmax"}}),Ys=Fe((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n={_fullLayout:P},a=d.getFromTrace(n,z,"x"),l=d.getFromTrace(n,z,"y"),o=y.orig_x;o===void 0&&(o=y.x);var u=y.orig_y;return u===void 0&&(u=y.y),i.xLabel=d.tickText(a,a.c2l(o),!0).text,i.yLabel=d.tickText(l,l.c2l(u),!0).text,i}}),El=Fe((te,Y)=>{var d=ii(),y=Zs(),z=as();function P(l){var o=d.select(l).selectAll("g.trace.scatter");o.style("opacity",function(u){return u[0].trace.opacity}),o.selectAll("g.points").each(function(u){var s=d.select(this),h=u.trace||u[0].trace;i(s,h,l)}),o.selectAll("g.text").each(function(u){var s=d.select(this),h=u.trace||u[0].trace;n(s,h,l)}),o.selectAll("g.trace path.js-line").call(y.lineGroupStyle),o.selectAll("g.trace path.js-fill").call(y.fillGroupStyle,l,!1),z.getComponentMethod("errorbars","style")(o)}function i(l,o,u){y.pointStyle(l.selectAll("path.point"),o,u)}function n(l,o,u){y.textPointStyle(l.selectAll("text"),o,u)}function a(l,o,u){var s=o[0].trace;s.selectedpoints?(y.selectedPointStyle(u.selectAll("path.point"),s),y.selectedTextStyle(u.selectAll("text"),s)):(i(u,s,l),n(u,s,l))}Y.exports={style:P,stylePoints:i,styleText:n,styleOnSelect:a}}),qu=Fe((te,Y)=>{var d=Xi(),y=Oc();Y.exports=function(z,P){var i,n;if(z.mode==="lines")return i=z.line.color,i&&d.opacity(i)?i:z.fillcolor;if(z.mode==="none")return z.fill?z.fillcolor:"";var a=P.mcc||(z.marker||{}).color,l=P.mlcc||((z.marker||{}).line||{}).color;return n=a&&d.opacity(a)?a:l&&d.opacity(l)&&(P.mlw||((z.marker||{}).line||{}).width)?l:"",n?d.opacity(n)<.3?d.addOpacity(n,.3):n:(i=(z.line||{}).color,i&&d.opacity(i)&&y.hasLines(z)&&z.line.width?i:z.fillcolor)}}),Zd=Fe((te,Y)=>{var d=ji(),y=hf(),z=as(),P=qu(),i=Xi(),n=d.fillText;Y.exports=function(a,l,o,u){var s=a.cd,h=s[0].trace,m=a.xa,b=a.ya,x=m.c2p(l),_=b.c2p(o),A=[x,_],f=h.hoveron||"",k=h.mode.indexOf("markers")!==-1?3:.5,w=!!h.xperiodalignment,D=!!h.yperiodalignment;if(f.indexOf("points")!==-1){var E=function(he){if(w){var xe=m.c2p(he.xStart),ve=m.c2p(he.xEnd);return x>=Math.min(xe,ve)&&x<=Math.max(xe,ve)?0:1/0}var ce=Math.max(3,he.mrc||0),re=1-1/ce,ge=Math.abs(m.c2p(he.x)-x);return ge=Math.min(xe,ve)&&_<=Math.max(xe,ve)?0:1/0}var ce=Math.max(3,he.mrc||0),re=1-1/ce,ge=Math.abs(b.c2p(he.y)-_);return gese!=Oe>=se&&(fe=J[oe-1][0],Ce=J[oe][0],Oe-Be&&(me=fe+(Ce-fe)*(se-Be)/(Oe-Be),ce=Math.min(ce,me),re=Math.max(re,me)));return ce=Math.max(ce,0),re=Math.min(re,m._length),{x0:ce,x1:re,y0:se,y1:se}}if(f.indexOf("fills")!==-1&&h._fillElement){var q=F(h._fillElement)&&!F(h._fillExclusionElement);if(q){var G=$(h._polygons);G===null&&(G={x0:A[0],x1:A[0],y0:A[1],y1:A[1]});var ee=i.defaultLine;return i.opacity(h.fillcolor)?ee=h.fillcolor:i.opacity((h.line||{}).color)&&(ee=h.line.color),d.extendFlat(a,{distance:a.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:ee,hovertemplate:!1}),delete a.index,h.text&&!d.isArrayOrTypedArray(h.text)?a.text=String(h.text):a.text=h.name,[a]}}}}),Jf=Fe((te,Y)=>{var d=Oc();Y.exports=function(y,z){var P=y.cd,i=y.xaxis,n=y.yaxis,a=[],l=P[0].trace,o,u,s,h,m=!d.hasMarkers(l)&&!d.hasText(l);if(m)return[];if(z===!1)for(o=0;o{Y.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),s0=Fe((te,Y)=>{var d=as().traceIs,y=Y1();Y.exports=function(a,l,o,u){o("autotypenumbers",u.autotypenumbersDflt);var s=o("type",(u.splomStash||{}).type);s==="-"&&(z(l,u.data),l.type==="-"?l.type="linear":a.type=l.type)};function z(a,l){if(a.type==="-"){var o=a._id,u=o.charAt(0),s;o.indexOf("scene")!==-1&&(o=u);var h=P(l,o,u);if(h){if(h.type==="histogram"&&u==={v:"y",h:"x"}[h.orientation||"v"]){a.type="linear";return}var m=u+"calendar",b=h[m],x={noMultiCategory:!d(h,"cartesian")||d(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&u==={h:"x",v:"y"}[h.orientation||"v"]&&(x.noMultiCategory=!0),x.autotypenumbers=a.autotypenumbers,n(h,u)){var _=i(h),A=[];for(s=0;s0&&(s["_"+o+"axes"]||{})[l]||(s[o+"axis"]||o)===l&&(n(s,o)||(s[o]||[]).length||s[o+"0"]))return s}}function i(a){return{v:"x",h:"y"}[a.orientation||"v"]}function n(a,l){var o=i(a),u=d(a,"box-violin"),s=d(a._fullInput||{},"candlestick");return u&&!s&&l===o&&a[o]===void 0&&a[o+"0"]===void 0}}),Qg=Fe((te,Y)=>{var d=Di().isTypedArraySpec;function y(z,P){var i=P.dataAttr||z._id.charAt(0),n={},a,l,o;if(P.axData)a=P.axData;else for(a=[],l=0;l0||d(a),o;l&&(o="array");var u=i("categoryorder",o),s;u==="array"&&(s=i("categoryarray")),!l&&u==="array"&&(u=P.categoryorder="trace"),u==="trace"?P._initialCategories=[]:u==="array"?P._initialCategories=s.slice():(s=y(P,n).sort(),u==="category ascending"?P._initialCategories=s:u==="category descending"&&(P._initialCategories=s.reverse()))}}}),hb=Fe((te,Y)=>{var d=sn().mix,y=Mi(),z=ji();Y.exports=function(P,i,n,a){a=a||{};var l=a.dfltColor;function o(g,C){return z.coerce2(P,i,a.attributes,g,C)}var u=o("linecolor",l),s=o("linewidth"),h=n("showline",a.showLine||!!u||!!s);h||(delete i.linecolor,delete i.linewidth);var m=d(l,a.bgColor,a.blend||y.lightFraction).toRgbString(),b=o("gridcolor",m),x=o("gridwidth"),_=o("griddash"),A=n("showgrid",a.showGrid||!!b||!!x||!!_);if(A||(delete i.gridcolor,delete i.gridwidth,delete i.griddash),a.hasMinor){var f=d(i.gridcolor,a.bgColor,67).toRgbString(),k=o("minor.gridcolor",f),w=o("minor.gridwidth",i.gridwidth||1),D=o("minor.griddash",i.griddash||"solid"),E=n("minor.showgrid",!!k||!!w||!!D);E||(delete i.minor.gridcolor,delete i.minor.gridwidth,delete i.minor.griddash)}if(!a.noZeroLine){o("zerolinelayer");var I=o("zerolinecolor",l),M=o("zerolinewidth"),p=n("zeroline",a.showGrid||!!I||!!M);p||(delete i.zerolinelayer,delete i.zerolinecolor,delete i.zerolinewidth)}}}),fb=Fe((te,Y)=>{var d=Ar(),y=as(),z=ji(),P=ku(),i=Gd(),n=qd(),a=jv(),l=Uv(),o=G0(),u=Tg(),s=Qg(),h=hb(),m=ow(),b=Z0(),x=dc().WEEKDAY_PATTERN,_=dc().HOUR_PATTERN;Y.exports=function(w,D,E,I,M){var p=I.letter,g=I.font||{},C=I.splomStash||{},T=E("visible",!I.visibleDflt),N=D._template||{},B=D.type||N.type||"-",U;if(B==="date"){var V=y.getComponentMethod("calendars","handleDefaults");V(w,D,"calendar",I.calendar),I.noTicklabelmode||(U=E("ticklabelmode"))}!I.noTicklabelindex&&(B==="date"||B==="linear")&&E("ticklabelindex");var W="";(!I.noTicklabelposition||B==="multicategory")&&(W=z.coerce(w,D,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:U==="period"?["outside","inside"]:p==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),I.noTicklabeloverflow||E("ticklabeloverflow",W.indexOf("inside")!==-1?"hide past domain":B==="category"||B==="multicategory"?"allow":"hide past div"),b(D,M),m(w,D,E,I),s(w,D,E,I),I.noHover||(B!=="category"&&E("hoverformat"),I.noUnifiedhovertitle||E("unifiedhovertitle.text"));var F=E("color"),$=F!==n.color.dflt?F:g.color,q=C.label||M._dfltTitle[p];if(u(w,D,E,B,I),!T)return D;E("title.text",q),z.coerceFont(E,"title.font",g,{overrideDflt:{size:z.bigFont(g.size),color:$}}),a(w,D,E,B);var G=I.hasMinor;if(G&&(P.newContainer(D,"minor"),a(w,D,E,B,{isMinor:!0})),o(w,D,E,B,I),l(w,D,E,I),G){var ee=I.isMinor;I.isMinor=!0,l(w,D,E,I),I.isMinor=ee}h(w,D,E,{dfltColor:F,bgColor:I.bgColor,showGrid:I.showGrid,hasMinor:G,attributes:n}),G&&!D.minor.ticks&&!D.minor.showgrid&&delete D.minor,(D.showline||D.ticks)&&E("mirror");var he=B==="multicategory";if(!I.noTickson&&(B==="category"||he)&&(D.ticks||D.showgrid)&&(he?(E("tickson","boundaries"),delete D.ticklabelposition):E("tickson")),he){var xe=E("showdividers");xe&&(E("dividercolor"),E("dividerwidth"))}if(B==="date")if(i(w,D,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:A}),!D.rangebreaks.length)delete D.rangebreaks;else{for(var ve=0;ve=2){var g="",C,T;if(p.length===2){for(C=0;C<2;C++)if(T=k(p[C]),T){g=x;break}}var N=I("pattern",g);if(N===x)for(C=0;C<2;C++)T=k(p[C]),T&&(D.bounds[C]=p[C]=T-1);if(N)for(C=0;C<2;C++)switch(T=p[C],N){case x:if(!d(T)){D.enabled=!1;return}if(T=+T,T!==Math.floor(T)||T<0||T>=7){D.enabled=!1;return}D.bounds[C]=p[C]=T;break;case _:if(!d(T)){D.enabled=!1;return}if(T=+T,T<0||T>24){D.enabled=!1;return}D.bounds[C]=p[C]=T;break}if(E.autorange===!1){var B=E.range;if(B[0]B[1]){D.enabled=!1;return}}else if(p[0]>B[0]&&p[1]{var d=Ar(),y=ji();Y.exports=function(z,P,i,n){var a=n.counterAxes||[],l=n.overlayableAxes||[],o=n.letter,u=n.grid,s=n.overlayingDomain,h,m,b,x,_,A;u&&(m=u._domains[o][u._axisMap[P._id]],h=u._anchors[P._id],m&&(b=u[o+"side"].split(" ")[0],x=u.domain[o][b==="right"||b==="top"?1:0])),m=m||[0,1],h=h||(d(z.position)?"free":a[0]||"free"),b=b||(o==="x"?"bottom":"left"),x=x||0,_=0,A=!1;var f=y.coerce(z,P,{anchor:{valType:"enumerated",values:["free"].concat(a),dflt:h}},"anchor"),k=y.coerce(z,P,{side:{valType:"enumerated",values:o==="x"?["bottom","top"]:["left","right"],dflt:b}},"side");if(f==="free"){if(o==="y"){var w=i("autoshift");w&&(x=k==="left"?s[0]:s[1],A=P.automargin?P.automargin:!0,_=k==="left"?-3:3),i("shift",_)}i("position",x)}i("automargin",A);var D=!1;if(l.length&&(D=y.coerce(z,P,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!D){var E=i("domain",m);E[0]>E[1]-1/4096&&(P.domain=m),y.noneOrAll(z.domain,P.domain,m),P.tickmode==="sync"&&(P.tickmode="auto")}return i("layer"),P}}),N4=Fe((te,Y)=>{var d=ji(),y=Xi(),z=T0().isUnifiedHover,P=X1(),i=ku(),n=y_(),a=qd(),l=s0(),o=fb(),u=ey(),s=Tw(),h=Zc(),m=h.id2name,b=h.name2id,x=dc().AX_ID_PATTERN,_=as(),A=_.traceIs,f=_.getComponentMethod;function k(w,D,E){Array.isArray(w[D])?w[D].push(E):w[D]=[E]}Y.exports=function(w,D,E){var I=D.autotypenumbers,M={},p={},g={},C={},T={},N={},B={},U={},V={},W={},F,$;for(F=0;F{var d=ii(),y=as(),z=ji(),P=Zs(),i=Os();Y.exports=function(n,a,l,o){var u=n._fullLayout;if(a.length===0){i.redrawComponents(n);return}function s(D){var E=D.xaxis,I=D.yaxis;u._defs.select("#"+D.clipId+"> rect").call(P.setTranslate,0,0).call(P.setScale,1,1),D.plot.call(P.setTranslate,E._offset,I._offset).call(P.setScale,1,1);var M=D.plot.selectAll(".scatterlayer .trace");M.selectAll(".point").call(P.setPointGroupScale,1,1),M.selectAll(".textpoint").call(P.setTextPointsScale,1,1),M.call(P.hideOutsideRangePoints,D)}function h(D,E){var I=D.plotinfo,M=I.xaxis,p=I.yaxis,g=M._length,C=p._length,T=!!D.xr1,N=!!D.yr1,B=[];if(T){var U=z.simpleMap(D.xr0,M.r2l),V=z.simpleMap(D.xr1,M.r2l),W=U[1]-U[0],F=V[1]-V[0];B[0]=(U[0]*(1-E)+E*V[0]-U[0])/(U[1]-U[0])*g,B[2]=g*(1-E+E*F/W),M.range[0]=M.l2r(U[0]*(1-E)+E*V[0]),M.range[1]=M.l2r(U[1]*(1-E)+E*V[1])}else B[0]=0,B[2]=g;if(N){var $=z.simpleMap(D.yr0,p.r2l),q=z.simpleMap(D.yr1,p.r2l),G=$[1]-$[0],ee=q[1]-q[0];B[1]=($[1]*(1-E)+E*q[1]-$[1])/($[0]-$[1])*C,B[3]=C*(1-E+E*ee/G),p.range[0]=M.l2r($[0]*(1-E)+E*q[0]),p.range[1]=p.l2r($[1]*(1-E)+E*q[1])}else B[1]=0,B[3]=C;i.drawOne(n,M,{skipTitle:!0}),i.drawOne(n,p,{skipTitle:!0}),i.redrawComponents(n,[M._id,p._id]);var he=T?g/B[2]:1,xe=N?C/B[3]:1,ve=T?B[0]:0,ce=N?B[1]:0,re=T?B[0]/B[2]*g:0,ge=N?B[1]/B[3]*C:0,ne=M._offset-re,se=p._offset-ge;I.clipRect.call(P.setTranslate,ve,ce).call(P.setScale,1/he,1/xe),I.plot.call(P.setTranslate,ne,se).call(P.setScale,he,xe),P.setPointGroupScale(I.zoomScalePts,1/he,1/xe),P.setTextPointsScale(I.zoomScaleTxt,1/he,1/xe)}var m;o&&(m=o());function b(){for(var D={},E=0;El.duration?(b(),f=window.cancelAnimationFrame(w)):f=window.requestAnimationFrame(w)}return _=Date.now(),f=window.requestAnimationFrame(w),Promise.resolve()}}),Rf=Fe(te=>{var Y=ii(),d=as(),y=ji(),z=sh(),P=Zs(),i=Md().getModuleCalcData,n=Zc(),a=dc(),l=k0(),o=y.ensureSingle;function u(A,f,k){return y.ensureSingle(A,f,k,function(w){w.datum(k)})}var s=a.zindexSeparator;te.name="cartesian",te.attr=["xaxis","yaxis"],te.idRoot=["x","y"],te.idRegex=a.idRegex,te.attrRegex=a.attrRegex,te.attributes=gm(),te.layoutAttributes=qd(),te.supplyLayoutDefaults=N4(),te.transitionAxes=v8(),te.finalizeSubplots=function(A,f){var k=f._subplots,w=k.xaxis,D=k.yaxis,E=k.cartesian,I=E,M={},p={},g,C,T;for(g=0;g0){var B=N.id;if(B.indexOf(s)!==-1)continue;B+=s+(g+1),N=y.extendFlat({},N,{id:B,plot:D._cartesianlayer.selectAll(".subplot").select("."+B)})}for(var U=[],V,W=0;W1&&(ee+=s+G),q.push(M+ee),I=0;I1,T=f.mainplotinfo;if(!f.mainplot||C)if(g)f.xlines=o(w,"path","xlines-above"),f.ylines=o(w,"path","ylines-above"),f.xaxislayer=o(w,"g","xaxislayer-above"),f.yaxislayer=o(w,"g","yaxislayer-above");else{if(!I){var N=o(w,"g","layer-subplot");f.shapelayer=o(N,"g","shapelayer"),f.imagelayer=o(N,"g","imagelayer"),T&&C?(f.minorGridlayer=T.minorGridlayer,f.gridlayer=T.gridlayer,f.zerolinelayer=T.zerolinelayer):(f.minorGridlayer=o(w,"g","minor-gridlayer"),f.gridlayer=o(w,"g","gridlayer"),f.zerolinelayer=o(w,"g","zerolinelayer"));var B=o(w,"g","layer-between");f.shapelayerBetween=o(B,"g","shapelayer"),f.imagelayerBetween=o(B,"g","imagelayer"),o(w,"path","xlines-below"),o(w,"path","ylines-below"),f.overlinesBelow=o(w,"g","overlines-below"),o(w,"g","xaxislayer-below"),o(w,"g","yaxislayer-below"),f.overaxesBelow=o(w,"g","overaxes-below")}f.overplot=o(w,"g","overplot"),f.plot=o(f.overplot,"g",D),T&&C?f.zerolinelayerAbove=T.zerolinelayerAbove:f.zerolinelayerAbove=o(w,"g","zerolinelayer-above"),I||(f.xlines=o(w,"path","xlines-above"),f.ylines=o(w,"path","ylines-above"),f.overlinesAbove=o(w,"g","overlines-above"),o(w,"g","xaxislayer-above"),o(w,"g","yaxislayer-above"),f.overaxesAbove=o(w,"g","overaxes-above"),f.xlines=w.select(".xlines-"+M),f.ylines=w.select(".ylines-"+p),f.xaxislayer=w.select(".xaxislayer-"+M),f.yaxislayer=w.select(".yaxislayer-"+p))}else{var U=T.plotgroup,V=D+"-x",W=D+"-y";f.minorGridlayer=T.minorGridlayer,f.gridlayer=T.gridlayer,f.zerolinelayer=T.zerolinelayer,f.zerolinelayerAbove=T.zerolinelayerAbove,o(T.overlinesBelow,"path",V),o(T.overlinesBelow,"path",W),o(T.overaxesBelow,"g",V),o(T.overaxesBelow,"g",W),f.plot=o(T.overplot,"g",D),o(T.overlinesAbove,"path",V),o(T.overlinesAbove,"path",W),o(T.overaxesAbove,"g",V),o(T.overaxesAbove,"g",W),f.xlines=U.select(".overlines-"+M).select("."+V),f.ylines=U.select(".overlines-"+p).select("."+W),f.xaxislayer=U.select(".overaxes-"+M).select("."+V),f.yaxislayer=U.select(".overaxes-"+p).select("."+W)}I||(g||(u(f.minorGridlayer,"g",f.xaxis._id),u(f.minorGridlayer,"g",f.yaxis._id),f.minorGridlayer.selectAll("g").map(function(F){return F[0]}).sort(n.idSort),u(f.gridlayer,"g",f.xaxis._id),u(f.gridlayer,"g",f.yaxis._id),f.gridlayer.selectAll("g").map(function(F){return F[0]}).sort(n.idSort)),f.xlines.style("fill","none").classed("crisp",!0),f.ylines.style("fill","none").classed("crisp",!0))}function x(A,f){if(A){var k={};A.each(function(p){var g=p[0],C=Y.select(this);C.remove(),_(g,f),k[g]=!0});for(var w in f._plots)for(var D=f._plots[w],E=D.overlays||[],I=0;I{var d=Oc();Y.exports={hasLines:d.hasLines,hasMarkers:d.hasMarkers,hasText:d.hasText,isBubble:d.isBubble,attributes:ff(),layoutAttributes:Nv(),supplyDefaults:B4(),crossTraceDefaults:R4(),supplyLayoutDefaults:F4(),calc:yt().calc,crossTraceCalc:$i(),arraysToCalcdata:de(),plot:uo(),colorbar:Mo(),formatLabels:Ys(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Zd(),selectPoints:Jf(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Rf(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),db=Fe((te,Y)=>{var d=ii(),y=Xi(),z=xw(),P=ji(),i=P.strScale,n=P.strRotate,a=P.strTranslate;Y.exports=function(l,o,u){var s=l.node(),h=z[u.arrowhead||0],m=z[u.startarrowhead||0],b=(u.arrowwidth||1)*(u.arrowsize||1),x=(u.arrowwidth||1)*(u.startarrowsize||1),_=o.indexOf("start")>=0,A=o.indexOf("end")>=0,f=h.backoff*b+u.standoff,k=m.backoff*x+u.startstandoff,w,D,E,I;if(s.nodeName==="line"){w={x:+l.attr("x1"),y:+l.attr("y1")},D={x:+l.attr("x2"),y:+l.attr("y2")};var M=w.x-D.x,p=w.y-D.y;if(E=Math.atan2(p,M),I=E+Math.PI,f&&k&&f+k>Math.sqrt(M*M+p*p)){G();return}if(f){if(f*f>M*M+p*p){G();return}var g=f*Math.cos(E),C=f*Math.sin(E);D.x+=g,D.y+=C,l.attr({x2:D.x,y2:D.y})}if(k){if(k*k>M*M+p*p){G();return}var T=k*Math.cos(E),N=k*Math.sin(E);w.x-=T,w.y-=N,l.attr({x1:w.x,y1:w.y})}}else if(s.nodeName==="path"){var B=s.getTotalLength(),U="";if(B{var d=ii(),y=as(),z=sh(),P=ji(),i=P.strTranslate,n=Os(),a=Xi(),l=Zs(),o=hf(),u=cc(),s=Em(),h=Np(),m=ku().arrayEditor,b=db();Y.exports={draw:x,drawOne:_,drawRaw:f};function x(k){var w=k._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var D=0;D2/3?fn="right":fn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[fn]}for(var xt=!1,ut=["x","y"],Et=0;Et1)&&(gr===Jt?(ht=mr.r2fraction(w["a"+Gt]),(ht<0||ht>1)&&(xt=!0)):xt=!0),ot=mr._offset+mr.r2p(w[Gt]),Pe=.5}else{var At=at==="domain";Gt==="x"?(ye=w[Gt],ot=At?mr._offset+mr._length*ye:ot=g.l+g.w*ye):(ye=1-w[Gt],ot=At?mr._offset+mr._length*ye:ot=g.t+g.h*ye),Pe=w.showarrow?.5:ye}if(w.showarrow){Je.head=ot;var Wt=w["a"+Gt];if(He=ri*nt(.5,w.xanchor)-Mr*nt(.5,w.yanchor),gr===Jt){var Kt=n.getRefType(gr);Kt==="domain"?(Gt==="y"&&(Wt=1-Wt),Je.tail=mr._offset+mr._length*Wt):Kt==="paper"?Gt==="y"?(Wt=1-Wt,Je.tail=g.t+g.h*Wt):Je.tail=g.l+g.w*Wt:Je.tail=mr._offset+mr.r2p(Wt),De=He}else Je.tail=ot+Wt,De=He+Wt;Je.text=Je.tail+He;var hr=p[Gt==="x"?"width":"height"];if(Jt==="paper"&&(Je.head=P.constrain(Je.head,1,hr-1)),gr==="pixel"){var zr=-Math.max(Je.tail-3,Je.text),Dr=Math.min(Je.tail+3,Je.text)-hr;zr>0?(Je.tail+=zr,Je.text+=zr):Dr>0&&(Je.tail-=Dr,Je.text-=Dr)}Je.tail+=Ot,Je.head+=Ot}else He=ui*nt(Pe,mi),De=He,Je.text=ot+He;Je.text+=Ot,He+=Ot,De+=Ot,w["_"+Gt+"padplus"]=ui/2+De,w["_"+Gt+"padminus"]=ui/2-De,w["_"+Gt+"size"]=ui,w["_"+Gt+"shift"]=He}if(xt){ce.remove();return}var br=0,hi=0;if(w.align!=="left"&&(br=(ct-pt)*(w.align==="center"?.5:1)),w.valign!=="top"&&(hi=(Ae-gt)*(w.valign==="middle"?.5:1)),rt)Ge.select("svg").attr({x:ne+br-1,y:ne+hi}).call(l.setClipUrl,_e?F:null,k);else{var un=ne+hi-_t.top,cn=ne+br-_t.left;fe.call(u.positionText,cn,un).call(l.setClipUrl,_e?F:null,k)}oe.select("rect").call(l.setRect,ne,ne,ct,Ae),se.call(l.setRect,re/2,re/2,ze-re,Ee-re),ce.call(l.setTranslate,Math.round($.x.text-ze/2),Math.round($.y.text-Ee/2)),ee.attr({transform:"rotate("+q+","+$.x.text+","+$.y.text+")"});var yn=function(Sn,fn){G.selectAll(".annotation-arrow-g").remove();var ga=$.x.head,na=$.y.head,Zt=$.x.tail+Sn,sr=$.y.tail+fn,_r=$.x.text+Sn,Cr=$.y.text+fn,fi=P.rotationXYMatrix(q,_r,Cr),qi=P.apply2DTransform(fi),Ui=P.apply2DTransform2(fi),Hi=+se.attr("width"),En=+se.attr("height"),Rn=_r-.5*Hi,Gn=Rn+Hi,Xn=Cr-.5*En,sa=Xn+En,Mn=[[Rn,Xn,Rn,sa],[Rn,sa,Gn,sa],[Gn,sa,Gn,Xn],[Gn,Xn,Rn,Xn]].map(Ui);if(!Mn.reduce(function(zt,xr){return zt^!!P.segmentsIntersect(ga,na,ga+1e6,na+1e6,xr[0],xr[1],xr[2],xr[3])},!1)){Mn.forEach(function(zt){var xr=P.segmentsIntersect(Zt,sr,ga,na,zt[0],zt[1],zt[2],zt[3]);xr&&(Zt=xr.x,sr=xr.y)});var Ha=w.arrowwidth,ro=w.arrowcolor,Ft=w.arrowside,Rt=G.append("g").style({opacity:a.opacity(ro)}).classed("annotation-arrow-g",!0),qr=Rt.append("path").attr("d","M"+Zt+","+sr+"L"+ga+","+na).style("stroke-width",Ha+"px").call(a.stroke,a.rgb(ro));if(b(qr,Ft,w),C.annotationPosition&&qr.node().parentNode&&!E){var ni=ga,oi=na;if(w.standoff){var Gr=Math.sqrt(Math.pow(ga-Zt,2)+Math.pow(na-sr,2));ni+=w.standoff*(Zt-ga)/Gr,oi+=w.standoff*(sr-na)/Gr}var si=Rt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Zt-ni)+","+(sr-oi),transform:i(ni,oi)}).style("stroke-width",Ha+6+"px").call(a.stroke,"rgba(0,0,0,0)").call(a.fill,"rgba(0,0,0,0)"),Pi,yi;h.init({element:si.node(),gd:k,prepFn:function(){var zt=l.getTranslate(ce);Pi=zt.x,yi=zt.y,I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0)},moveFn:function(zt,xr){var Jr=qi(Pi,yi),Ri=Jr[0]+zt,tn=Jr[1]+xr;ce.call(l.setTranslate,Ri,tn),V("x",A(I,zt,"x",g,w)),V("y",A(M,xr,"y",g,w)),w.axref===w.xref&&V("ax",A(I,zt,"ax",g,w)),w.ayref===w.yref&&V("ay",A(M,xr,"ay",g,w)),Rt.attr("transform",i(zt,xr)),ee.attr({transform:"rotate("+q+","+Ri+","+tn+")"})},doneFn:function(){y.call("_guiRelayout",k,W());var zt=document.querySelector(".js-notes-box-panel");zt&&zt.redraw(zt.selectedObj)}})}}};if(w.showarrow&&yn(0,0),he){var Wn;h.init({element:ce.node(),gd:k,prepFn:function(){Wn=ee.attr("transform")},moveFn:function(Sn,fn){var ga="pointer";if(w.showarrow)w.axref===w.xref?V("ax",A(I,Sn,"ax",g,w)):V("ax",w.ax+Sn),w.ayref===w.yref?V("ay",A(M,fn,"ay",g.w,w)):V("ay",w.ay+fn),yn(Sn,fn);else{if(E)return;var na,Zt;if(I)na=A(I,Sn,"x",g,w);else{var sr=w._xsize/g.w,_r=w.x+(w._xshift-w.xshift)/g.w-sr/2;na=h.align(_r+Sn/g.w,sr,0,1,w.xanchor)}if(M)Zt=A(M,fn,"y",g,w);else{var Cr=w._ysize/g.h,fi=w.y-(w._yshift+w.yshift)/g.h-Cr/2;Zt=h.align(fi-fn/g.h,Cr,0,1,w.yanchor)}V("x",na),V("y",Zt),(!I||!M)&&(ga=h.getCursor(I?.5:na,M?.5:Zt,w.xanchor,w.yanchor))}ee.attr({transform:i(Sn,fn)+Wn}),s(ce,ga)},clickFn:function(Sn,fn){w.captureevents&&k.emit("plotly_clickannotation",ve(fn))},doneFn:function(){s(ce),y.call("_guiRelayout",k,W());var Sn=document.querySelector(".js-notes-box-panel");Sn&&Sn.redraw(Sn.selectedObj)}})}}C.annotationText?fe.call(u.makeEditable,{delegate:ce,gd:k}).call(Ce).on("edit",function(Oe){w.text=Oe,this.call(Ce),V("text",Oe),I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0),y.call("_guiRelayout",k,W())}):fe.call(Ce)}}),y8=Fe((te,Y)=>{var d=ji(),y=as(),z=ku().arrayEditor;Y.exports={hasClickToShow:P,onClick:i};function P(l,o){var u=n(l,o);return u.on.length>0||u.explicitOff.length>0}function i(l,o){var u=n(l,o),s=u.on,h=u.off.concat(u.explicitOff),m={},b=l._fullLayout.annotations,x,_;if(s.length||h.length){for(x=0;x{var d=ji(),y=Xi();Y.exports=function(z,P,i,n){n("opacity");var a=n("bgcolor"),l=n("bordercolor"),o=y.opacity(l);n("borderpad");var u=n("borderwidth"),s=n("showarrow");n("text",s?" ":i._dfltTitle.annotation),n("textangle"),d.coerceFont(n,"font",i.font),n("width"),n("align");var h=n("height");if(h&&n("valign"),s){var m=n("arrowside"),b,x;m.indexOf("end")!==-1&&(b=n("arrowhead"),x=n("arrowsize")),m.indexOf("start")!==-1&&(n("startarrowhead",b),n("startarrowsize",x)),n("arrowcolor",o?P.bordercolor:y.defaultLine),n("arrowwidth",(o&&u||1)*2),n("standoff"),n("startstandoff")}var _=n("hovertext"),A=i.hoverlabel||{};if(_){var f=n("hoverlabel.bgcolor",A.bgcolor||(y.opacity(a)?y.rgb(a):y.defaultLine)),k=n("hoverlabel.bordercolor",A.bordercolor||y.contrast(f)),w=d.extendFlat({},A.font);w.color||(w.color=k),d.coerceFont(n,"hoverlabel.font",w)}n("captureevents",!!_)}}),Cw=Fe((te,Y)=>{var d=ji(),y=Os(),z=Gd(),P=j4(),i=Ag();Y.exports=function(a,l){z(a,l,{name:"annotations",handleItemDefaults:n})};function n(a,l,o){function u(g,C){return d.coerce(a,l,i,g,C)}var s=u("visible"),h=u("clicktoshow");if(s||h){P(a,l,o,u);for(var m=l.showarrow,b=["x","y"],x=[-10,-30],_={_fullLayout:o},A=0;A<2;A++){var f=b[A],k=y.coerceRef(a,l,_,f,"","paper");if(k!=="paper"){var w=y.getFromId(_,k);w._annIndices.push(l._index)}if(y.coercePosition(l,_,u,k,f,.5),m){var D="a"+f,E=y.coerceRef(a,l,_,D,"pixel",["pixel","paper"]);E!=="pixel"&&E!==k&&(E=l[D]="pixel");var I=E==="pixel"?x[A]:.4;y.coercePosition(l,_,u,E,D,I)}u(f+"anchor"),u(f+"shift")}if(d.noneOrAll(a,l,["x","y"]),m&&d.noneOrAll(a,l,["ax","ay"]),h){var M=u("xclick"),p=u("yclick");l._xclick=M===void 0?l.x:y.cleanPosition(M,_,l.xref),l._yclick=p===void 0?l.y:y.cleanPosition(p,_,l.yref)}}}}),U4=Fe((te,Y)=>{var d=ji(),y=Os(),z=Sw().draw;Y.exports=function(n){var a=n._fullLayout,l=d.filterVisible(a.annotations);if(l.length&&n._fullData.length)return d.syncOrAsync([z,P],n)};function P(n){var a=n._fullLayout;d.filterVisible(a.annotations).forEach(function(l){var o=y.getFromId(n,l.xref),u=y.getFromId(n,l.yref),s=y.getRefType(l.xref),h=y.getRefType(l.yref);l._extremes={},s==="range"&&i(l,o),h==="range"&&i(l,u)})}function i(n,a){var l=a._id,o=l.charAt(0),u=n[o],s=n["a"+o],h=n[o+"ref"],m=n["a"+o+"ref"],b=n["_"+o+"padplus"],x=n["_"+o+"padminus"],_={x:1,y:-1}[o]*n[o+"shift"],A=3*n.arrowsize*n.arrowwidth||0,f=A+_,k=A-_,w=3*n.startarrowsize*n.arrowwidth||0,D=w+_,E=w-_,I;if(m===h){var M=y.findExtremes(a,[a.r2c(u)],{ppadplus:f,ppadminus:k}),p=y.findExtremes(a,[a.r2c(s)],{ppadplus:Math.max(b,D),ppadminus:Math.max(x,E)});I={min:[M.min[0],p.min[0]],max:[M.max[0],p.max[0]]}}else D=s?D+s:D,E=s?E-s:E,I=y.findExtremes(a,[a.r2c(u)],{ppadplus:Math.max(b,f,D),ppadminus:Math.max(x,k,E)});n._extremes[l]=I}}),_8=Fe((te,Y)=>{var d=Ar(),y=Ta();Y.exports=function(z,P,i,n){P=P||{};var a=i==="log"&&P.type==="linear",l=i==="linear"&&P.type==="log";if(!(a||l))return;var o=z._fullLayout.annotations,u=P._id.charAt(0),s,h;function m(x){var _=s[x],A=null;a?A=y(_,P.range):A=Math.pow(10,_),d(A)||(A=null),n(h+x,A)}for(var b=0;b{var d=Sw(),y=y8();Y.exports={moduleType:"component",name:"annotations",layoutAttributes:Ag(),supplyLayoutDefaults:Cw(),includeBasePlot:Yv()("annotations"),calcAutorange:U4(),draw:d.draw,drawOne:d.drawOne,drawRaw:d.drawRaw,hasClickToShow:y.hasClickToShow,onClick:y.onClick,convertCoords:_8()}}),x8=Fe((te,Y)=>{var d=Ag(),y=oh().overrideAll,z=ku().templatedArray;Y.exports=y(z("annotation",{visible:d.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:d.xanchor,xshift:d.xshift,yanchor:d.yanchor,yshift:d.yshift,text:d.text,textangle:d.textangle,font:d.font,width:d.width,height:d.height,opacity:d.opacity,align:d.align,valign:d.valign,bgcolor:d.bgcolor,bordercolor:d.bordercolor,borderpad:d.borderpad,borderwidth:d.borderwidth,showarrow:d.showarrow,arrowcolor:d.arrowcolor,arrowhead:d.arrowhead,startarrowhead:d.startarrowhead,arrowside:d.arrowside,arrowsize:d.arrowsize,startarrowsize:d.startarrowsize,arrowwidth:d.arrowwidth,standoff:d.standoff,startstandoff:d.startstandoff,hovertext:d.hovertext,hoverlabel:d.hoverlabel,captureevents:d.captureevents}),"calc","from-root")}),EW=Fe((te,Y)=>{var d=ji(),y=Os(),z=Gd(),P=j4(),i=x8();Y.exports=function(a,l,o){z(a,l,{name:"annotations",handleItemDefaults:n,fullLayout:o.fullLayout})};function n(a,l,o,u){function s(b,x){return d.coerce(a,l,i,b,x)}function h(b){var x=b+"axis",_={_fullLayout:{}};return _._fullLayout[x]=o[x],y.coercePosition(l,_,s,b,b,.5)}var m=s("visible");m&&(P(a,l,u.fullLayout,s),h("x"),h("y"),h("z"),d.noneOrAll(a,l,["x","y","z"]),l.xref="x",l.yref="y",l.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),l.showarrow&&(l.axref="pixel",l.ayref="pixel",s("ax",-10),s("ay",-30),d.noneOrAll(a,l,["ax","ay"])))}}),LW=Fe((te,Y)=>{var d=ji(),y=Os();Y.exports=function(P){for(var i=P.fullSceneLayout,n=i.annotations,a=0;a{function d(z,P){var i=[0,0,0,0],n,a;for(n=0;n<4;++n)for(a=0;a<4;++a)i[a]+=z[4*n+a]*P[n];return i}function y(z,P){var i=d(z.projection,d(z.view,d(z.model,[P[0],P[1],P[2],1])));return i}Y.exports=y}),PW=Fe((te,Y)=>{var d=Sw().drawRaw,y=yL(),z=["x","y","z"];Y.exports=function(P){for(var i=P.fullSceneLayout,n=P.dataScale,a=i.annotations,l=0;l1){u=!0;break}}u?P.fullLayout._infolayer.select(".annotation-"+P.id+'[data-index="'+l+'"]').remove():(o._pdata=y(P.glplot.cameraParams,[i.xaxis.r2l(o.x)*n[0],i.yaxis.r2l(o.y)*n[1],i.zaxis.r2l(o.z)*n[2]]),d(P.graphDiv,o,l,P.id,o._xa,o._ya))}}}),IW=Fe((te,Y)=>{var d=as(),y=ji();Y.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:x8()}}},layoutAttributes:x8(),handleDefaults:EW(),includeBasePlot:z,convert:LW(),draw:PW()};function z(P,i){var n=d.subplotsRegistry.gl3d;if(n)for(var a=n.attrRegex,l=Object.keys(P),o=0;o{var d=Ag(),y=zn(),z=ff().line,P=Wd().dash,i=an().extendFlat,n=ku().templatedArray;lb();var a=_a(),{shapeTexttemplateAttrs:l,templatefallbackAttrs:o}=rc(),u=v_();Y.exports=n("shape",{visible:i({},a.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:i({},a.legend,{editType:"calc+arraydraw"}),legendgroup:i({},a.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:i({},a.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:y({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:i({},a.legendrank,{editType:"calc+arraydraw"}),legendwidth:i({},a.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:i({},d.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:i({},d.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:i({},z.color,{editType:"arraydraw"}),width:i({},z.width,{editType:"calc+arraydraw"}),dash:i({},P,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:l({},{keys:Object.keys(u)}),texttemplatefallback:o({editType:"arraydraw"}),font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),DW=Fe((te,Y)=>{var d=ji(),y=Os(),z=Gd(),P=_L(),i=o0();Y.exports=function(l,o){z(l,o,{name:"shapes",handleItemDefaults:a})};function n(l,o){return l?"bottom":o.indexOf("top")!==-1?"top":o.indexOf("bottom")!==-1?"bottom":"middle"}function a(l,o,u){function s(re,ge){return d.coerce(l,o,P,re,ge)}o._isShape=!0;var h=s("visible");if(h){var m=s("showlegend");m&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),d.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var b=s("path"),x=b?"path":"rect",_=s("type",x),A=_!=="path";A&&delete o.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule");var f=s("line.width");f&&(s("line.color"),s("line.dash"));for(var k=s("xsizemode"),w=s("ysizemode"),D=["x","y"],E=0;E<2;E++){var I=D[E],M=I+"anchor",p=I==="x"?k:w,g={_fullLayout:u},C,T,N,B=y.coerceRef(l,o,g,I,void 0,"paper"),U=y.getRefType(B);if(U==="range"?(C=y.getFromId(g,B),C._shapeIndices.push(o._index),N=i.rangeToShapePosition(C),T=i.shapePositionToRange(C),(C.type==="category"||C.type==="multicategory")&&(s(I+"0shift"),s(I+"1shift"))):T=N=d.identity,A){var V=.25,W=.75,F=I+"0",$=I+"1",q=l[F],G=l[$];l[F]=T(l[F],!0),l[$]=T(l[$],!0),p==="pixel"?(s(F,0),s($,10)):(y.coercePosition(o,g,s,B,F,V),y.coercePosition(o,g,s,B,$,W)),o[F]=N(o[F]),o[$]=N(o[$]),l[F]=q,l[$]=G}if(p==="pixel"){var ee=l[M];l[M]=T(l[M],!0),y.coercePosition(o,g,s,B,M,.25),o[M]=N(o[M]),l[M]=ee}}A&&d.noneOrAll(l,o,["x0","x1","y0","y1"]);var he=_==="line",xe,ve;if(A&&(xe=s("label.texttemplate"),s("label.texttemplatefallback")),xe||(ve=s("label.text")),ve||xe){s("label.textangle");var ce=s("label.textposition",he?"middle":"middle center");s("label.xanchor"),s("label.yanchor",n(he,ce)),s("label.padding"),d.coerceFont(s,"label.font",u.font)}}}}),zW=Fe((te,Y)=>{var d=Xi(),y=ji();function z(P,i){return P?"bottom":i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle"}Y.exports=function(P,i,n){n("newshape.visible"),n("newshape.name"),n("newshape.showlegend"),n("newshape.legend"),n("newshape.legendwidth"),n("newshape.legendgroup"),n("newshape.legendgrouptitle.text"),y.coerceFont(n,"newshape.legendgrouptitle.font"),n("newshape.legendrank"),n("newshape.drawdirection"),n("newshape.layer"),n("newshape.fillcolor"),n("newshape.fillrule"),n("newshape.opacity");var a=n("newshape.line.width");if(a){var l=(P||{}).plot_bgcolor||"#FFF";n("newshape.line.color",d.contrast(l)),n("newshape.line.dash")}var o=P.dragmode==="drawline",u=n("newshape.label.text"),s=n("newshape.label.texttemplate");if(n("newshape.label.texttemplatefallback"),u||s){n("newshape.label.textangle");var h=n("newshape.label.textposition",o?"middle":"middle center");n("newshape.label.xanchor"),n("newshape.label.yanchor",z(o,h)),n("newshape.label.padding"),y.coerceFont(n,"newshape.label.font",i.font)}n("activeshape.fillcolor"),n("activeshape.opacity")}}),OW=Fe((te,Y)=>{var d=ji(),y=Os(),z=tb(),P=o0();Y.exports=function(o){var u=o._fullLayout,s=d.filterVisible(u.shapes);if(!(!s.length||!o._fullData.length))for(var h=0;h0?f+x:x;return{ppad:x,ppadplus:_?w:D,ppadminus:_?D:w}}else return{ppad:x}}function l(o,u,s){var h=o._id.charAt(0)==="x"?"x":"y",m=o.type==="category"||o.type==="multicategory",b,x,_=0,A=0,f=m?o.r2c:o.d2c,k=u[h+"sizemode"]==="scaled";if(k?(b=u[h+"0"],x=u[h+"1"],m&&(_=u[h+"0shift"],A=u[h+"1shift"])):(b=u[h+"anchor"],x=u[h+"anchor"]),b!==void 0)return[f(b)+_,f(x)+A];if(u.path){var w=1/0,D=-1/0,E=u.path.match(z.segmentRE),I,M,p,g,C;for(o.type==="date"&&(f=P.decodeDate(f)),I=0;ID&&(D=C)));if(D>=w)return[w,D]}}}),BW=Fe((te,Y)=>{var d=mw();Y.exports={moduleType:"component",name:"shapes",layoutAttributes:_L(),supplyLayoutDefaults:DW(),supplyDrawNewShapeDefaults:zW(),includeBasePlot:Yv()("shapes"),calcAutorange:OW(),draw:d.draw,drawOne:d.drawOne}}),xL=Fe((te,Y)=>{var d=dc(),y=ku().templatedArray;lb(),Y.exports=y("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),RW=Fe((te,Y)=>{var d=ji(),y=Os(),z=Gd(),P=xL(),i="images";Y.exports=function(a,l){var o={name:i,handleItemDefaults:n};z(a,l,o)};function n(a,l,o){function u(k,w){return d.coerce(a,l,P,k,w)}var s=u("source"),h=u("visible",!!s);if(!h)return l;u("layer"),u("xanchor"),u("yanchor"),u("sizex"),u("sizey"),u("sizing"),u("opacity");for(var m={_fullLayout:o},b=["x","y"],x=0;x<2;x++){var _=b[x],A=y.coerceRef(a,l,m,_,"paper",void 0);if(A!=="paper"){var f=y.getFromId(m,A);f._imgIndices.push(l._index)}y.coercePosition(l,m,u,A,_,0)}return l}}),FW=Fe((te,Y)=>{var d=ii(),y=Zs(),z=Os(),P=Zc(),i=k0();Y.exports=function(n){var a=n._fullLayout,l=[],o={},u=[],s,h;for(h=0;h{var d=Ar(),y=Ta();Y.exports=function(z,P,i,n){P=P||{};var a=i==="log"&&P.type==="linear",l=i==="linear"&&P.type==="log";if(a||l){for(var o=z._fullLayout.images,u=P._id.charAt(0),s,h,m=0;m{Y.exports={moduleType:"component",name:"images",layoutAttributes:xL(),supplyLayoutDefaults:RW(),includeBasePlot:Yv()("images"),draw:FW(),convertCoords:NW()}}),b8=Fe((te,Y)=>{Y.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),bL=Fe((te,Y)=>{var d=zn(),y=Mi(),z=an().extendFlat,P=oh().overrideAll,i=Kx(),n=ku().templatedArray,a=n("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});Y.exports=P(n("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:a,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:z(i({editType:"arraydraw"}),{}),font:d({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:y.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),UW=Fe((te,Y)=>{var d=ji(),y=Gd(),z=bL(),P=b8(),i=P.name,n=z.buttons;Y.exports=function(o,u){var s={name:i,handleItemDefaults:a};y(o,u,s)};function a(o,u,s){function h(x,_){return d.coerce(o,u,z,x,_)}var m=y(o,u,{name:"buttons",handleItemDefaults:l}),b=h("visible",m.length>0);b&&(h("active"),h("direction"),h("type"),h("showactive"),h("x"),h("y"),d.noneOrAll(o,u,["x","y"]),h("xanchor"),h("yanchor"),h("pad.t"),h("pad.r"),h("pad.b"),h("pad.l"),d.coerceFont(h,"font",s.font),h("bgcolor",s.paper_bgcolor),h("bordercolor"),h("borderwidth"))}function l(o,u){function s(m,b){return d.coerce(o,u,n,m,b)}var h=s("visible",o.method==="skip"||Array.isArray(o.args));h&&(s("method"),s("args"),s("args2"),s("label"),s("execute"))}}),$W=Fe((te,Y)=>{Y.exports=i;var d=ii(),y=Xi(),z=Zs(),P=ji();function i(n,a,l){this.gd=n,this.container=a,this.id=l,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}i.barWidth=2,i.barLength=20,i.barRadius=2,i.barPad=1,i.barColor="#808BA4",i.prototype.enable=function(n,a,l){var o=this.gd._fullLayout,u=o.width,s=o.height;this.position=n;var h=this.position.l,m=this.position.w,b=this.position.t,x=this.position.h,_=this.position.direction,A=_==="down",f=_==="left",k=_==="right",w=_==="up",D=m,E=x,I,M,p,g;!A&&!f&&!k&&!w&&(this.position.direction="down",A=!0);var C=A||w;C?(I=h,M=I+D,A?(p=b,g=Math.min(p+E,s),E=g-p):(g=b+E,p=Math.max(g-E,0),E=g-p)):(p=b,g=p+E,f?(M=h+D,I=Math.max(M-D,0),D=M-I):(I=h,M=Math.min(I+D,u),D=M-I)),this._box={l:I,t:p,w:D,h:E};var T=m>D,N=i.barLength+2*i.barPad,B=i.barWidth+2*i.barPad,U=h,V=b+x;V+B>s&&(V=s-B);var W=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);W.exit().on(".drag",null).remove(),W.enter().append("rect").classed("scrollbar-horizontal",!0).call(y.fill,i.barColor),T?(this.hbar=W.attr({rx:i.barRadius,ry:i.barRadius,x:U,y:V,width:N,height:B}),this._hbarXMin=U+N/2,this._hbarTranslateMax=D-N):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=x>E,$=i.barWidth+2*i.barPad,q=i.barLength+2*i.barPad,G=h+m,ee=b;G+$>u&&(G=u-$);var he=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);he.exit().on(".drag",null).remove(),he.enter().append("rect").classed("scrollbar-vertical",!0).call(y.fill,i.barColor),F?(this.vbar=he.attr({rx:i.barRadius,ry:i.barRadius,x:G,y:ee,width:$,height:q}),this._vbarYMin=ee+q/2,this._vbarTranslateMax=E-q):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var xe=this.id,ve=I-.5,ce=F?M+$+.5:M+.5,re=p-.5,ge=T?g+B+.5:g+.5,ne=o._topdefs.selectAll("#"+xe).data(T||F?[0]:[]);if(ne.exit().remove(),ne.enter().append("clipPath").attr("id",xe).append("rect"),T||F?(this._clipRect=ne.select("rect").attr({x:Math.floor(ve),y:Math.floor(re),width:Math.ceil(ce)-Math.floor(ve),height:Math.ceil(ge)-Math.floor(re)}),this.container.call(z.setClipUrl,xe,this.gd),this.bg.attr({x:h,y:b,width:m,height:x})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),T||F){var se=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(se);var _e=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(_e),F&&this.vbar.on(".drag",null).call(_e)}this.setTranslate(a,l)},i.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},i.prototype._onBoxDrag=function(){var n=this.translateX,a=this.translateY;this.hbar&&(n-=d.event.dx),this.vbar&&(a-=d.event.dy),this.setTranslate(n,a)},i.prototype._onBoxWheel=function(){var n=this.translateX,a=this.translateY;this.hbar&&(n+=d.event.deltaY),this.vbar&&(a+=d.event.deltaY),this.setTranslate(n,a)},i.prototype._onBarDrag=function(){var n=this.translateX,a=this.translateY;if(this.hbar){var l=n+this._hbarXMin,o=l+this._hbarTranslateMax,u=P.constrain(d.event.x,l,o),s=(u-l)/(o-l),h=this.position.w-this._box.w;n=s*h}if(this.vbar){var m=a+this._vbarYMin,b=m+this._vbarTranslateMax,x=P.constrain(d.event.y,m,b),_=(x-m)/(b-m),A=this.position.h-this._box.h;a=_*A}this.setTranslate(n,a)},i.prototype.setTranslate=function(n,a){var l=this.position.w-this._box.w,o=this.position.h-this._box.h;if(n=P.constrain(n||0,0,l),a=P.constrain(a||0,0,o),this.translateX=n,this.translateY=a,this.container.call(z.setTranslate,this._box.l-this.position.l-n,this._box.t-this.position.t-a),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+n-.5),y:Math.floor(this.position.t+a-.5)}),this.hbar){var u=n/l;this.hbar.call(z.setTranslate,n+u*this._hbarTranslateMax,a)}if(this.vbar){var s=a/o;this.vbar.call(z.setTranslate,n,a+s*this._vbarTranslateMax)}}}),HW=Fe((te,Y)=>{var d=ii(),y=sh(),z=Xi(),P=Zs(),i=ji(),n=cc(),a=ku().arrayEditor,l=Bf().LINE_SPACING,o=b8(),u=$W();Y.exports=function(N){var B=N._fullLayout,U=i.filterVisible(B[o.name]);function V(xe){y.autoMargin(N,g(xe))}var W=B._menulayer.selectAll("g."+o.containerClassName).data(U.length>0?[0]:[]);if(W.enter().append("g").classed(o.containerClassName,!0).style("cursor","pointer"),W.exit().each(function(){d.select(this).selectAll("g."+o.headerGroupClassName).each(V)}).remove(),U.length!==0){var F=W.selectAll("g."+o.headerGroupClassName).data(U,s);F.enter().append("g").classed(o.headerGroupClassName,!0);for(var $=i.ensureSingle(W,"g",o.dropdownButtonGroupClassName,function(xe){xe.style("pointer-events","all")}),q=0;q{var d=b8();Y.exports={moduleType:"component",name:d.name,layoutAttributes:bL(),supplyLayoutDefaults:UW(),draw:HW()}}),$4=Fe((te,Y)=>{Y.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),wL=Fe((te,Y)=>{var d=zn(),y=Kx(),z=an().extendDeepAll,P=oh().overrideAll,i=Fl(),n=ku().templatedArray,a=$4(),l=n("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});Y.exports=P(n("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:l,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:z(y({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:i.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:d({})},font:d({}),activebgcolor:{valType:"color",dflt:a.gripBgActiveColor},bgcolor:{valType:"color",dflt:a.railBgColor},bordercolor:{valType:"color",dflt:a.railBorderColor},borderwidth:{valType:"number",min:0,dflt:a.railBorderWidth},ticklen:{valType:"number",min:0,dflt:a.tickLength},tickcolor:{valType:"color",dflt:a.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:a.minorTickLength}}),"arraydraw","from-root")}),WW=Fe((te,Y)=>{var d=ji(),y=Gd(),z=wL(),P=$4(),i=P.name,n=z.steps;Y.exports=function(o,u){y(o,u,{name:i,handleItemDefaults:a})};function a(o,u,s){function h(w,D){return d.coerce(o,u,z,w,D)}for(var m=y(o,u,{name:"steps",handleItemDefaults:l}),b=0,x=0;x{var d=ii(),y=sh(),z=Xi(),P=Zs(),i=ji(),n=i.strTranslate,a=cc(),l=ku().arrayEditor,o=$4(),u=Bf(),s=u.LINE_SPACING,h=u.FROM_TL,m=u.FROM_BR;Y.exports=function(W){var F=W._context.staticPlot,$=W._fullLayout,q=x($,W),G=$._infolayer.selectAll("g."+o.containerClassName).data(q.length>0?[0]:[]);G.enter().append("g").classed(o.containerClassName,!0).style("cursor",F?null:"ew-resize");function ee(ce){ce._commandObserver&&(ce._commandObserver.remove(),delete ce._commandObserver),y.autoMargin(W,b(ce))}if(G.exit().each(function(){d.select(this).selectAll("g."+o.groupClassName).each(ee)}).remove(),q.length!==0){var he=G.selectAll("g."+o.groupClassName).data(q,_);he.enter().append("g").classed(o.groupClassName,!0),he.exit().each(ee).remove();for(var xe=0;xe0&&(xe=xe.transition().duration(F.transition.duration).ease(F.transition.easing)),xe.attr("transform",n(he-o.gripWidth*.5,F._dims.currentValueTotalHeight))}}function N(W,F){var $=W._dims;return $.inputAreaStart+o.stepInset+($.inputAreaLength-2*o.stepInset)*Math.min(1,Math.max(0,F))}function B(W,F){var $=W._dims;return Math.min(1,Math.max(0,(F-o.stepInset-$.inputAreaStart)/($.inputAreaLength-2*o.stepInset-2*$.inputAreaStart)))}function U(W,F,$){var q=$._dims,G=i.ensureSingle(W,"rect",o.railTouchRectClass,function(ee){ee.call(p,F,W,$).style("pointer-events","all")});G.attr({width:q.inputAreaLength,height:Math.max(q.inputAreaWidth,o.tickOffset+$.ticklen+q.labelHeight)}).call(z.fill,$.bgcolor).attr("opacity",0),P.setTranslate(G,0,q.currentValueTotalHeight)}function V(W,F){var $=F._dims,q=$.inputAreaLength-o.railInset*2,G=i.ensureSingle(W,"rect",o.railRectClass);G.attr({width:q,height:o.railWidth,rx:o.railRadius,ry:o.railRadius,"shape-rendering":"crispEdges"}).call(z.stroke,F.bordercolor).call(z.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px"),P.setTranslate(G,o.railInset,($.inputAreaWidth-o.railWidth)*.5+$.currentValueTotalHeight)}}),GW=Fe((te,Y)=>{var d=$4();Y.exports={moduleType:"component",name:d.name,layoutAttributes:wL(),supplyLayoutDefaults:WW(),draw:qW()}}),w8=Fe((te,Y)=>{var d=Mi();Y.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),kL=Fe((te,Y)=>{Y.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),k8=Fe((te,Y)=>{Y.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),ZW=Fe(te=>{var Y=Zc(),d=cc(),y=k8(),z=Bf().LINE_SPACING,P=y.name;function i(n){var a=n&&n[P];return a&&a.visible}te.isVisible=i,te.makeData=function(n){for(var a=Y.list({_fullLayout:n},"x",!0),l=n.margin,o=[],u=0;u{var d=ji(),y=ku(),z=Zc(),P=w8(),i=kL();Y.exports=function(n,a,l){var o=n[l],u=a[l];if(!(o.rangeslider||a._requestRangeslider[u._id]))return;d.isPlainObject(o.rangeslider)||(o.rangeslider={});var s=o.rangeslider,h=y.newContainer(u,"rangeslider");function m(g,C){return d.coerce(s,h,P,g,C)}var b,x;function _(g,C){return d.coerce(b,x,i,g,C)}var A=m("visible");if(A){m("bgcolor",a.plot_bgcolor),m("bordercolor"),m("borderwidth"),m("thickness"),m("autorange",!u.isValidRange(s.range)),m("range");var f=a._subplots;if(f)for(var k=f.cartesian.filter(function(g){return g.substr(0,g.indexOf("y"))===z.name2id(l)}).map(function(g){return g.substr(g.indexOf("y"),g.length)}),w=d.simpleMap(k,z.id2name),D=0;D{var d=Zc().list,y=Xm().getAutoRange,z=k8();Y.exports=function(P){for(var i=d(P,"x",!0),n=0;n{var d=ii(),y=as(),z=sh(),P=ji(),i=P.strTranslate,n=Zs(),a=Xi(),l=Fp(),o=Rf(),u=Zc(),s=Np(),h=Em(),m=k8();Y.exports=function(p){for(var g=p._fullLayout,C=g._rangeSliderData,T=0;T=pt.max)rt=Ce[_t+1];else if(Ge=pt.pmax)rt=Ce[_t+1];else if(Ge0?p.touches[0].clientX:0}function x(p,g,C,T){if(g._context.staticPlot)return;var N=p.select("rect."+m.slideBoxClassName).node(),B=p.select("rect."+m.grabAreaMinClassName).node(),U=p.select("rect."+m.grabAreaMaxClassName).node();function V(){var W=d.event,F=W.target,$=b(W),q=$-p.node().getBoundingClientRect().left,G=T.d2p(C._rl[0]),ee=T.d2p(C._rl[1]),he=s.coverSlip();this.addEventListener("touchmove",xe),this.addEventListener("touchend",ve),he.addEventListener("mousemove",xe),he.addEventListener("mouseup",ve);function xe(ce){var re=b(ce),ge=+re-$,ne,se,_e;switch(F){case N:if(_e="ew-resize",G+ge>C._length||ee+ge<0)return;ne=G+ge,se=ee+ge;break;case B:if(_e="col-resize",G+ge>C._length)return;ne=G+ge,se=ee;break;case U:if(_e="col-resize",ee+ge<0)return;ne=G,se=ee+ge;break;default:_e="ew-resize",ne=q,se=q+ge;break}if(se{var d=ji(),y=w8(),z=kL(),P=ZW();Y.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:d.extendFlat({},y,{yaxis:z})}}},layoutAttributes:w8(),handleDefaults:KW(),calcAutorange:YW(),draw:XW(),isVisible:P.isVisible,makeData:P.makeData,autoMarginOpts:P.autoMarginOpts}}),T8=Fe((te,Y)=>{var d=zn(),y=Mi(),z=ku().templatedArray,P=z("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});Y.exports={visible:{valType:"boolean",editType:"plot"},buttons:P,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:d({editType:"plot"}),bgcolor:{valType:"color",dflt:y.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),TL=Fe((te,Y)=>{Y.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),QW=Fe((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=Gd(),i=T8(),n=TL();Y.exports=function(o,u,s,h,m){var b=o.rangeselector||{},x=z.newContainer(u,"rangeselector");function _(D,E){return d.coerce(b,x,i,D,E)}var A=P(b,x,{name:"buttons",handleItemDefaults:a,calendar:m}),f=_("visible",A.length>0);if(f){var k=l(u,s,h);_("x",k[0]),_("y",k[1]),d.noneOrAll(o,u,["x","y"]),_("xanchor"),_("yanchor"),d.coerceFont(_,"font",s.font);var w=_("bgcolor");_("activecolor",y.contrast(w,n.lightAmount,n.darkAmount)),_("bordercolor"),_("borderwidth")}};function a(o,u,s,h){var m=h.calendar;function b(A,f){return d.coerce(o,u,i.buttons,A,f)}var x=b("visible");if(x){var _=b("step");_!=="all"&&(m&&m!=="gregorian"&&(_==="month"||_==="year")?u.stepmode="backward":b("stepmode"),b("count")),b("label")}}function l(o,u,s){for(var h=s.filter(function(_){return u[_].anchor===o._id}),m=0,b=0;b{var d=Ji(),y=ji().titleCase;Y.exports=function(P,i){var n=P._name,a={};if(i.step==="all")a[n+".autorange"]=!0;else{var l=z(P,i);a[n+".range[0]"]=l[0],a[n+".range[1]"]=l[1]}return a};function z(P,i){var n=P.range,a=new Date(P.r2l(n[1])),l=i.step,o=d["utc"+y(l)],u=i.count,s;switch(i.stepmode){case"backward":s=P.l2r(+o.offset(a,-u));break;case"todate":var h=o.offset(a,-u);s=P.l2r(+o.ceil(h));break}var m=n[1];return[s,m]}}),tq=Fe((te,Y)=>{var d=ii(),y=as(),z=sh(),P=Xi(),i=Zs(),n=ji(),a=n.strTranslate,l=cc(),o=Zc(),u=Bf(),s=u.LINE_SPACING,h=u.FROM_TL,m=u.FROM_BR,b=TL(),x=eq();Y.exports=function(M){var p=M._fullLayout,g=p._infolayer.selectAll(".rangeselector").data(_(M),A);g.enter().append("g").classed("rangeselector",!0),g.exit().remove(),g.style({cursor:"pointer","pointer-events":"all"}),g.each(function(C){var T=d.select(this),N=C,B=N.rangeselector,U=T.selectAll("g.button").data(n.filterVisible(B.buttons));U.enter().append("g").classed("button",!0),U.exit().remove(),U.each(function(V){var W=d.select(this),F=x(N,V);V._isActive=f(N,V,F),W.call(k,B,V),W.call(D,B,V,M),W.on("click",function(){M._dragged||y.call("_guiRelayout",M,F)}),W.on("mouseover",function(){V._isHovered=!0,W.call(k,B,V)}),W.on("mouseout",function(){V._isHovered=!1,W.call(k,B,V)})}),I(M,U,B,N._name,T)})};function _(M){for(var p=o.list(M,"x",!0),g=[],C=0;C{Y.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:T8()}}},layoutAttributes:T8(),handleDefaults:QW(),draw:tq()}}),Xh=Fe(te=>{var Y=an().extendFlat;te.attributes=function(d,y){d=d||{},y=y||{};var z={valType:"info_array",editType:d.editType,items:[{valType:"number",min:0,max:1,editType:d.editType},{valType:"number",min:0,max:1,editType:d.editType}],dflt:[0,1]};d.name&&d.name+"",d.trace,y.description&&""+y.description;var P={x:Y({},z,{}),y:Y({},z,{}),editType:d.editType};return d.noGridCell||(P.row={valType:"integer",min:0,dflt:0,editType:d.editType},P.column={valType:"integer",min:0,dflt:0,editType:d.editType}),P},te.defaults=function(d,y,z,P){var i=P&&P.x||[0,1],n=P&&P.y||[0,1],a=y.grid;if(a){var l=z("domain.column");l!==void 0&&(l{var d=ji(),y=go().counter,z=Xh().attributes,P=dc().idRegex,i=ku(),n={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[y("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:z({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function a(h,m,b){var x=m[b+"axes"],_=Object.keys((h._splomAxes||{})[b]||{});if(Array.isArray(x))return x;if(_.length)return _}function l(h,m){var b=h.grid||{},x=a(m,b,"x"),_=a(m,b,"y");if(!h.grid&&!x&&!_)return;var A=Array.isArray(b.subplots)&&Array.isArray(b.subplots[0]),f=Array.isArray(x),k=Array.isArray(_),w=f&&x!==b.xaxes&&k&&_!==b.yaxes,D,E;A?(D=b.subplots.length,E=b.subplots[0].length):(k&&(D=_.length),f&&(E=x.length));var I=i.newContainer(m,"grid");function M(F,$){return d.coerce(b,I,n,F,$)}var p=M("rows",D),g=M("columns",E);if(!(p*g>1)){delete m.grid;return}if(!A&&!f&&!k){var C=M("pattern")==="independent";C&&(A=!0)}I._hasSubplotGrid=A;var T=M("roworder"),N=T==="top to bottom",B=A?.2:.1,U=A?.3:.1,V,W;w&&m._splomGridDflt&&(V=m._splomGridDflt.xside,W=m._splomGridDflt.yside),I._domains={x:o("x",M,B,V,g),y:o("y",M,U,W,p,N)}}function o(h,m,b,x,_,A){var f=m(h+"gap",b),k=m("domain."+h);m(h+"side",x);for(var w=new Array(_),D=k[0],E=(k[1]-D)/(_-f),I=E*(1-f),M=0;M<_;M++){var p=D+E*M;w[A?_-1-M:M]=[p,p+I]}return w}function u(h,m){var b=m.grid;if(!(!b||!b._domains)){var x=h.grid||{},_=m._subplots,A=b._hasSubplotGrid,f=b.rows,k=b.columns,w=b.pattern==="independent",D,E,I,M,p,g,C,T=b._axisMap={};if(A){var N=x.subplots||[];g=b.subplots=new Array(f);var B=1;for(D=0;D{Y.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),iq=Fe((te,Y)=>{var d=Ar(),y=as(),z=ji(),P=ku(),i=CL();Y.exports=function(n,a,l,o){var u="error_"+o.axis,s=P.newContainer(a,u),h=n[u]||{};function m(w,D){return z.coerce(h,s,i,w,D)}var b=h.array!==void 0||h.value!==void 0||h.type==="sqrt",x=m("visible",b);if(x!==!1){var _=m("type","array"in h?"data":"percent"),A=!0;_!=="sqrt"&&(A=m("symmetric",!((_==="data"?"arrayminus":"valueminus")in h))),_==="data"?(m("array"),m("traceref"),A||(m("arrayminus"),m("tracerefminus"))):(_==="percent"||_==="constant")&&(m("value"),A||m("valueminus"));var f="copy_"+o.inherit+"style";if(o.inherit){var k=a["error_"+o.inherit];(k||{}).visible&&m(f,!(h.color||d(h.thickness)||d(h.width)))}(!o.inherit||!s[f])&&(m("color",l),m("thickness"),m("width",y.traceIs(a,"gl3d")?0:4))}}}),AL=Fe((te,Y)=>{Y.exports=function(y){var z=y.type,P=y.symmetric;if(z==="data"){var i=y.array||[];if(P)return function(o,u){var s=+i[u];return[s,s]};var n=y.arrayminus||[];return function(o,u){var s=+i[u],h=+n[u];return!isNaN(s)||!isNaN(h)?[h||0,s||0]:[NaN,NaN]}}else{var a=d(z,y.value),l=d(z,y.valueminus);return P||y.valueminus===void 0?function(o){var u=a(o);return[u,u]}:function(o){return[l(o),a(o)]}}};function d(y,z){if(y==="percent")return function(P){return Math.abs(P*z/100)};if(y==="constant")return function(){return Math.abs(z)};if(y==="sqrt")return function(P){return Math.sqrt(Math.abs(P))}}}),nq=Fe((te,Y)=>{var d=Ar(),y=as(),z=Os(),P=ji(),i=AL();Y.exports=function(a){for(var l=a.calcdata,o=0;o{var d=ii(),y=Ar(),z=Zs(),P=Oc();Y.exports=function(n,a,l,o){var u,s=l.xaxis,h=l.yaxis,m=o&&o.duration>0,b=n._context.staticPlot;a.each(function(x){var _=x[0].trace,A=_.error_x||{},f=_.error_y||{},k;_.ids&&(k=function(I){return I.id});var w=P.hasMarkers(_)&&_.marker.maxdisplayed>0;!f.visible&&!A.visible&&(x=[]);var D=d.select(this).selectAll("g.errorbar").data(x,k);if(D.exit().remove(),!!x.length){A.visible||D.selectAll("path.xerror").remove(),f.visible||D.selectAll("path.yerror").remove(),D.style("opacity",1);var E=D.enter().append("g").classed("errorbar",!0);m&&E.style("opacity",0).transition().duration(o.duration).style("opacity",1),z.setClipUrl(D,l.layerClipId,n),D.each(function(I){var M=d.select(this),p=i(I,s,h);if(!(w&&!I.vis)){var g,C=M.select("path.yerror");if(f.visible&&y(p.x)&&y(p.yh)&&y(p.ys)){var T=f.width;g="M"+(p.x-T)+","+p.yh+"h"+2*T+"m-"+T+",0V"+p.ys,p.noYS||(g+="m-"+T+",0h"+2*T),u=!C.size(),u?C=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("yerror",!0):m&&(C=C.transition().duration(o.duration).ease(o.easing)),C.attr("d",g)}else C.remove();var N=M.select("path.xerror");if(A.visible&&y(p.y)&&y(p.xh)&&y(p.xs)){var B=(A.copy_ystyle?f:A).width;g="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(g+="m0,-"+B+"v"+2*B),u=!N.size(),u?N=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("xerror",!0):m&&(N=N.transition().duration(o.duration).ease(o.easing)),N.attr("d",g)}else N.remove()}})}})};function i(n,a,l){var o={x:a.c2p(n.x),y:l.c2p(n.y)};return n.yh!==void 0&&(o.yh=l.c2p(n.yh),o.ys=l.c2p(n.ys),y(o.ys)||(o.noYS=!0,o.ys=l.c2p(n.ys,!0))),n.xh!==void 0&&(o.xh=a.c2p(n.xh),o.xs=a.c2p(n.xs),y(o.xs)||(o.noXS=!0,o.xs=a.c2p(n.xs,!0))),o}}),oq=Fe((te,Y)=>{var d=ii(),y=Xi();Y.exports=function(z){z.each(function(P){var i=P[0].trace,n=i.error_y||{},a=i.error_x||{},l=d.select(this);l.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(y.stroke,n.color),a.copy_ystyle&&(a=n),l.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(y.stroke,a.color)})}}),sq=Fe((te,Y)=>{var d=ji(),y=oh().overrideAll,z=CL(),P={error_x:d.extendFlat({},z),error_y:d.extendFlat({},z)};delete P.error_x.copy_zstyle,delete P.error_y.copy_zstyle,delete P.error_y.copy_ystyle;var i={error_x:d.extendFlat({},z),error_y:d.extendFlat({},z),error_z:d.extendFlat({},z)};delete i.error_x.copy_ystyle,delete i.error_y.copy_ystyle,delete i.error_z.copy_ystyle,delete i.error_z.copy_zstyle,Y.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:P,bar:P,histogram:P,scatter3d:y(i,"calc","nested"),scattergl:y(P,"calc","nested")}},supplyDefaults:iq(),calc:nq(),makeComputeError:AL(),plot:aq(),style:oq(),hoverInfo:n};function n(a,l,o){(l.error_y||{}).visible&&(o.yerr=a.yh-a.y,l.error_y.symmetric||(o.yerrneg=a.y-a.ys)),(l.error_x||{}).visible&&(o.xerr=a.xh-a.x,l.error_x.symmetric||(o.xerrneg=a.x-a.xs))}}),lq=Fe((te,Y)=>{Y.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),uq=Fe((te,Y)=>{var d=ii(),y=sn(),z=sh(),P=as(),i=Os(),n=Np(),a=ji(),l=a.strTranslate,o=an().extendFlat,u=Em(),s=Zs(),h=Xi(),m=Fp(),b=cc(),x=cp().flipScale,_=fb(),A=Tw(),f=qd(),k=Bf(),w=k.LINE_SPACING,D=k.FROM_TL,E=k.FROM_BR,I=lq().cn;function M(B){var U=B._fullLayout,V=U._infolayer.selectAll("g."+I.colorbar).data(p(B),function(W){return W._id});V.enter().append("g").attr("class",function(W){return W._id}).classed(I.colorbar,!0),V.each(function(W){var F=d.select(this);a.ensureSingle(F,"rect",I.cbbg),a.ensureSingle(F,"g",I.cbfills),a.ensureSingle(F,"g",I.cblines),a.ensureSingle(F,"g",I.cbaxis,function(q){q.classed(I.crisp,!0)}),a.ensureSingle(F,"g",I.cbtitleunshift,function(q){q.append("g").classed(I.cbtitle,!0)}),a.ensureSingle(F,"rect",I.cboutline);var $=g(F,W,B);$&&$.then&&(B._promises||[]).push($),B._context.edits.colorbarPosition&&C(F,W,B)}),V.exit().each(function(W){z.autoMargin(B,W._id)}).remove(),V.order()}function p(B){var U=B._fullLayout,V=B.calcdata,W=[],F,$,q,G;function ee(J){return o(J,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function he(){typeof G.calc=="function"?G.calc(B,q,F):(F._fillgradient=$.reversescale?x($.colorscale):$.colorscale,F._zrange=[$[G.min],$[G.max]])}for(var xe=0;xe1){var Je=Math.pow(10,Math.floor(Math.log(Ot)/Math.LN10));ui*=Je*a.roundUp(Ot/Je,[2,5,10]),(Math.abs(_t.start)/_t.size+1e-6)%1<2e-6&&(ri.tick0=0)}ri.dtick=ui}ri.domain=W?[mr+ge/me.h,mr+nt-ge/me.h]:[mr+re/me.w,mr+nt-re/me.w],ri.setScale(),B.attr("transform",l(Math.round(me.l),Math.round(me.t)));var ot=B.select("."+I.cbtitleunshift).attr("transform",l(-Math.round(me.l),-Math.round(me.t))),De=ri.ticklabelposition,ye=ri.title.font.size,Pe=B.select("."+I.cbaxis),He,at=0,ht=0;function At(Dr,br){var hi={propContainer:ri,propName:U._propPrefix+"title.text",traceIndex:U._traceIndex,_meta:U._meta,placeholder:J._dfltTitle.colorbar,containerGroup:B.select("."+I.cbtitle)},un=Dr.charAt(0)==="h"?Dr.substr(1):"h"+Dr;B.selectAll("."+un+",."+un+"-math-group").remove(),m.draw(V,Dr,o(hi,br||{}))}function Wt(){if(W&&Mr||!W&&!Mr){var Dr,br;Oe==="top"&&(Dr=re+me.l+xt*ne,br=ge+me.t+ut*(1-mr-nt)+3+ye*.75),Oe==="bottom"&&(Dr=re+me.l+xt*ne,br=ge+me.t+ut*(1-mr)-3-ye*.25),Oe==="right"&&(br=ge+me.t+ut*se+3+ye*.75,Dr=re+me.l+xt*mr),At(ri._id+"title",{attributes:{x:Dr,y:br,"text-anchor":W?"start":"middle"}})}}function Kt(){if(W&&!Mr||!W&&Mr){var Dr=ri.position||0,br=ri._offset+ri._length/2,hi,un;if(Oe==="right")un=br,hi=me.l+xt*Dr+10+ye*(ri.showticklabels?1:.5);else if(hi=br,Oe==="bottom"&&(un=me.t+ut*Dr+10+(De.indexOf("inside")===-1?ri.tickfont.size:0)+(ri.ticks!=="inside"&&U.ticklen||0)),Oe==="top"){var cn=Be.text.split("
").length;un=me.t+ut*Dr+10-Ae-w*ye*cn}At((W?"h":"v")+ri._id+"title",{avoid:{selection:d.select(V).selectAll("g."+ri._id+"tick"),side:Oe,offsetTop:W?0:me.t,offsetLeft:W?me.l:0,maxShift:W?J.width:J.height},attributes:{x:hi,y:un,"text-anchor":"middle"},transform:{rotate:W?-90:0,offset:0}})}}function hr(){if(!W&&!Mr||W&&Mr){var Dr=B.select("."+I.cbtitle),br=Dr.select("text"),hi=[-ee/2,ee/2],un=Dr.select(".h"+ri._id+"title-math-group").node(),cn=15.6;br.node()&&(cn=parseInt(br.node().style.fontSize,10)*w);var yn;if(un?(yn=s.bBox(un),ht=yn.width,at=yn.height,at>cn&&(hi[1]-=(at-cn)/2)):br.node()&&!br.classed(I.jsPlaceholder)&&(yn=s.bBox(br.node()),ht=yn.width,at=yn.height),W){if(at){if(at+=5,Oe==="top")ri.domain[1]-=at/me.h,hi[1]*=-1;else{ri.domain[0]+=at/me.h;var Wn=b.lineCount(br);hi[1]+=(1-Wn)*cn}Dr.attr("transform",l(hi[0],hi[1])),ri.setScale()}}else ht&&(Oe==="right"&&(ri.domain[0]+=(ht+ye/2)/me.w),Dr.attr("transform",l(hi[0],hi[1])),ri.setScale())}B.selectAll("."+I.cbfills+",."+I.cblines).attr("transform",W?l(0,Math.round(me.h*(1-ri.domain[1]))):l(Math.round(me.w*ri.domain[0]),0)),Pe.attr("transform",W?l(0,Math.round(-me.t)):l(Math.round(-me.l),0));var Sn=B.select("."+I.cbfills).selectAll("rect."+I.cbfill).attr("style","").data(gt);Sn.enter().append("rect").classed(I.cbfill,!0).attr("style",""),Sn.exit().remove();var fn=Ze.map(ri.c2p).map(Math.round).sort(function(_r,Cr){return _r-Cr});Sn.each(function(_r,Cr){var fi=[Cr===0?Ze[0]:(gt[Cr]+gt[Cr-1])/2,Cr===gt.length-1?Ze[1]:(gt[Cr]+gt[Cr+1])/2].map(ri.c2p).map(Math.round);W&&(fi[1]=a.constrain(fi[1]+(fi[1]>fi[0])?1:-1,fn[0],fn[1]));var qi=d.select(this).attr(W?"x":"y",Et).attr(W?"y":"x",d.min(fi)).attr(W?"width":"height",Math.max(Ae,2)).attr(W?"height":"width",Math.max(d.max(fi)-d.min(fi),2));if(U._fillgradient)s.gradient(qi,V,U._id,W?"vertical":"horizontalreversed",U._fillgradient,"fill");else{var Ui=rt(_r).replace("e-","");qi.attr("fill",y(Ui).toHexString())}});var ga=B.select("."+I.cblines).selectAll("path."+I.cbline).data(Ce.color&&Ce.width?ct:[]);ga.enter().append("path").classed(I.cbline,!0),ga.exit().remove(),ga.each(function(_r){var Cr=Et,fi=Math.round(ri.c2p(_r))+Ce.width/2%1;d.select(this).attr("d","M"+(W?Cr+","+fi:fi+","+Cr)+(W?"h":"v")+Ae).call(s.lineGroupStyle,Ce.width,Ge(_r),Ce.dash)}),Pe.selectAll("g."+ri._id+"tick,path").remove();var na=Et+Ae+(ee||0)/2-(U.ticks==="outside"?1:0),Zt=i.calcTicks(ri),sr=i.getTickSigns(ri)[2];return i.drawTicks(V,ri,{vals:ri.ticks==="inside"?i.clipEnds(ri,Zt):Zt,layer:Pe,path:i.makeTickPath(ri,na,sr),transFn:i.makeTransTickFn(ri)}),i.drawLabels(V,ri,{vals:Zt,layer:Pe,transFn:i.makeTransTickLabelFn(ri),labelFns:i.makeLabelFns(ri,na)})}function zr(){var Dr,br=Ae+ee/2;De.indexOf("inside")===-1&&(Dr=s.bBox(Pe.node()),br+=W?Dr.width:Dr.height),He=ot.select("text");var hi=0,un=W&&Oe==="top",cn=!W&&Oe==="right",yn=0;if(He.node()&&!He.classed(I.jsPlaceholder)){var Wn,Sn=ot.select(".h"+ri._id+"title-math-group").node();Sn&&(W&&Mr||!W&&!Mr)?(Dr=s.bBox(Sn),hi=Dr.width,Wn=Dr.height):(Dr=s.bBox(ot.node()),hi=Dr.right-me.l-(W?Et:Kr),Wn=Dr.bottom-me.t-(W?Kr:Et),!W&&Oe==="top"&&(br+=Dr.height,yn=Dr.height)),cn&&(He.attr("transform",l(hi/2+ye/2,0)),hi*=2),br=Math.max(br,W?hi:Wn)}var fn=(W?re:ge)*2+br+he+ee/2,ga=0;!W&&Be.text&&ce==="bottom"&&se<=0&&(ga=fn/2,fn+=ga,yn+=ga),J._hColorbarMoveTitle=ga,J._hColorbarMoveCBTitle=yn;var na=he+ee,Zt=(W?Et:Kr)-na/2-(W?re:0),sr=(W?Kr:Et)-(W?Ee:ge+yn-ga);B.select("."+I.cbbg).attr("x",Zt).attr("y",sr).attr(W?"width":"height",Math.max(fn-ga,2)).attr(W?"height":"width",Math.max(Ee+na,2)).call(h.fill,xe).call(h.stroke,U.bordercolor).style("stroke-width",he);var _r=cn?Math.max(hi-10,0):0;B.selectAll("."+I.cboutline).attr("x",(W?Et:Kr+re)+_r).attr("y",(W?Kr+ge-Ee:Et)+(un?at:0)).attr(W?"width":"height",Math.max(Ae,2)).attr(W?"height":"width",Math.max(Ee-(W?2*ge+at:2*re+_r),2)).call(h.stroke,U.outlinecolor).style({fill:"none","stroke-width":ee});var Cr=W?Gt*fn:0,fi=W?0:(1-Jt)*fn-yn;if(Cr=oe?me.l-Cr:-Cr,fi=_e?me.t-fi:-fi,B.attr("transform",l(Cr,fi)),!W&&(he||y(xe).getAlpha()&&!y.equals(J.paper_bgcolor,xe))){var qi=Pe.selectAll("text"),Ui=qi[0].length,Hi=B.select("."+I.cbbg).node(),En=s.bBox(Hi),Rn=s.getTranslate(B),Gn=2;qi.each(function(oi,Gr){var si=0,Pi=Ui-1;if(Gr===si||Gr===Pi){var yi=s.bBox(this),zt=s.getTranslate(this),xr;if(Gr===Pi){var Jr=yi.right+zt.x,Ri=En.right+Rn.x+Kr-he-Gn+ne;xr=Ri-Jr,xr>0&&(xr=0)}else if(Gr===si){var tn=yi.left+zt.x,_n=En.left+Rn.x+Kr+he+Gn;xr=_n-tn,xr<0&&(xr=0)}xr&&(Ui<3?this.setAttribute("transform","translate("+xr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Xn={},sa=D[ve],Mn=E[ve],Ha=D[ce],ro=E[ce],Ft=fn-Ae;W?($==="pixels"?(Xn.y=se,Xn.t=Ee*Ha,Xn.b=Ee*ro):(Xn.t=Xn.b=0,Xn.yt=se+F*Ha,Xn.yb=se-F*ro),G==="pixels"?(Xn.x=ne,Xn.l=fn*sa,Xn.r=fn*Mn):(Xn.l=Ft*sa,Xn.r=Ft*Mn,Xn.xl=ne-q*sa,Xn.xr=ne+q*Mn)):($==="pixels"?(Xn.x=ne,Xn.l=Ee*sa,Xn.r=Ee*Mn):(Xn.l=Xn.r=0,Xn.xl=ne+F*sa,Xn.xr=ne-F*Mn),G==="pixels"?(Xn.y=1-se,Xn.t=fn*Ha,Xn.b=fn*ro):(Xn.t=Ft*Ha,Xn.b=Ft*ro,Xn.yt=se-q*Ha,Xn.yb=se+q*ro));var Rt=U.y<.5?"b":"t",qr=U.x<.5?"l":"r";V._fullLayout._reservedMargin[U._id]={};var ni={r:J.width-Zt-Cr,l:Zt+Xn.r,b:J.height-sr-fi,t:sr+Xn.b};oe&&_e?z.autoMargin(V,U._id,Xn):oe?V._fullLayout._reservedMargin[U._id][Rt]=ni[Rt]:_e||W?V._fullLayout._reservedMargin[U._id][qr]=ni[qr]:V._fullLayout._reservedMargin[U._id][Rt]=ni[Rt]}return a.syncOrAsync([z.previousPromises,Wt,hr,Kt,z.previousPromises,zr],V)}function C(B,U,V){var W=U.orientation==="v",F=V._fullLayout,$=F._size,q,G,ee;n.init({element:B.node(),gd:V,prepFn:function(){q=B.attr("transform"),u(B)},moveFn:function(he,xe){B.attr("transform",q+l(he,xe)),G=n.align((W?U._uFrac:U._vFrac)+he/$.w,W?U._thickFrac:U._lenFrac,0,1,U.xanchor),ee=n.align((W?U._vFrac:1-U._uFrac)-xe/$.h,W?U._lenFrac:U._thickFrac,0,1,U.yanchor);var ve=n.getCursor(G,ee,U.xanchor,U.yanchor);u(B,ve)},doneFn:function(){if(u(B),G!==void 0&&ee!==void 0){var he={};he[U._propPrefix+"x"]=G,he[U._propPrefix+"y"]=ee,U._traceIndex!==void 0?P.call("_guiRestyle",V,he,U._traceIndex):P.call("_guiRelayout",V,he)}}})}function T(B,U,V){var W=U._levels,F=[],$=[],q,G,ee=W.end+W.size/100,he=W.size,xe=1.001*V[0]-.001*V[1],ve=1.001*V[1]-.001*V[0];for(G=0;G<1e5&&(q=W.start+G*he,!(he>0?q>=ee:q<=ee));G++)q>xe&&q0?q>=ee:q<=ee));G++)q>V[0]&&q{Y.exports={moduleType:"component",name:"colorbar",attributes:k_(),supplyDefaults:K1(),draw:uq().draw,hasColorbar:Mm()}}),hq=Fe((te,Y)=>{Y.exports={moduleType:"component",name:"legend",layoutAttributes:uw(),supplyLayoutDefaults:Qx(),draw:hw(),style:T4()}}),fq=Fe((te,Y)=>{Y.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),dq=Fe((te,Y)=>{Y.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),ML=Fe((te,Y)=>{var d=as(),y=ji(),z=y.extendFlat,P=y.extendDeep;function i(a){var l;switch(a){case"themes__thumb":l={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":l={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:l={}}return l}function n(a){var l=["xaxis","yaxis","zaxis"];return l.indexOf(a.slice(0,5))>-1}Y.exports=function(a,l){var o,u=a.data,s=a.layout,h=P([],u),m=P({},s,i(l.tileClass)),b=a._context||{};if(l.width&&(m.width=l.width),l.height&&(m.height=l.height),l.tileClass==="thumbnail"||l.tileClass==="themes__thumb"){m.annotations=[];var x=Object.keys(m);for(o=0;o{var d=qg().EventEmitter,y=as(),z=ji(),P=Y0(),i=ML(),n=ub(),a=cb();function l(o,u){var s=new d,h=i(o,{format:"png"}),m=h.gd;m.style.position="absolute",m.style.left="-5000px",document.body.appendChild(m);function b(){var _=P.getDelay(m._fullLayout);setTimeout(function(){var A=n(m),f=document.createElement("canvas");f.id=z.randstr(),s=a({format:u.format,width:m._fullLayout.width,height:m._fullLayout.height,canvas:f,emitter:s,svg:A}),s.clean=function(){m&&document.body.removeChild(m)}},_)}var x=P.getRedrawFunc(m);return y.call("_doPlot",m,h.data,h.layout,h.config).then(x).then(b).catch(function(_){s.emit("error",_)}),s}Y.exports=l}),mq=Fe((te,Y)=>{var d=Y0(),y={getDelay:d.getDelay,getRedrawFunc:d.getRedrawFunc,clone:ML(),toSVG:ub(),svgToImg:cb(),toImage:pq(),downloadImage:kw()};Y.exports=y}),gq=Fe(te=>{te.version=_i().version,Ci(),aw();var Y=as(),d=te.register=Y.register,y=g8(),z=Object.keys(y);for(i=0;i{Y.exports=gq()}),pb=Fe((te,Y)=>{Y.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),Jv=Fe((te,Y)=>{var d=ff(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=zc(),a=zn(),l=pb(),o=Wd().pattern,u=an().extendFlat,s=a({editType:"calc",arrayOk:!0,colorEditType:"style"}),h=d.marker,m=h.line,b=u({},m.width,{dflt:0}),x=u({width:b,editType:"calc"},n("marker.line")),_=u({line:x,editType:"calc"},n("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:o,cornerradius:{valType:"any",editType:"calc"}});Y.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),text:d.text,texttemplate:P({editType:"plot"},{keys:l.eventDataKeys}),texttemplatefallback:i({editType:"plot"}),hovertext:d.hovertext,hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:i(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:u({},s,{}),insidetextfont:u({},s,{}),outsidetextfont:u({},s,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:u({},d.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:_,offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:{marker:{opacity:d.selected.marker.opacity,color:d.selected.marker.color,editType:"style"},textfont:d.selected.textfont,editType:"style"},unselected:{marker:{opacity:d.unselected.marker.opacity,color:d.unselected.marker.color,editType:"style"},textfont:d.unselected.textfont,editType:"style"},zorder:d.zorder}}),S8=Fe((te,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),C8=Fe((te,Y)=>{var d=Xi(),y=cp().hasColorscale,z=Cc(),P=ji().coercePattern;Y.exports=function(i,n,a,l,o){var u=a("marker.color",l),s=y(i,"marker");s&&z(i,n,o,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",d.defaultLine),y(i,"marker.line")&&z(i,n,o,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),P(a,"marker.pattern",u,s),a("selected.marker.color"),a("unselected.marker.color")}}),eg=Fe((te,Y)=>{var d=Ar(),y=ji(),z=Xi(),P=as(),i=Jg(),n=S0(),a=C8(),l=Xv(),o=Jv(),u=y.coerceFont;function s(x,_,A,f){function k(M,p){return y.coerce(x,_,o,M,p)}var w=i(x,_,f,k);if(!w){_.visible=!1;return}n(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("zorder"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");b(x,_,f,k,D,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a(x,_,k,A,f);var E=(_.marker.line||{}).color,I=P.getComponentMethod("errorbars","supplyDefaults");I(x,_,E||z.defaultLine,{axis:"y"}),I(x,_,E||z.defaultLine,{axis:"x",inherit:"y"}),y.coerceSelectionMarkerOpacity(_,k)}function h(x,_){var A,f;function k(E,I){return y.coerce(f._input,f,o,E,I)}for(var w=0;w=0)return x}else if(typeof x=="string"&&(x=x.trim(),x.slice(-1)==="%"&&d(x.slice(0,-1))&&(x=+x.slice(0,-1),x>=0)))return x+"%"}function b(x,_,A,f,k,w){w=w||{};var D=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,I=w.moduleHasConstrain!==!1,M=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,g=w.moduleHasInsideanchor!==!1,C=!!w.hasPathbar,T=Array.isArray(k)||k==="auto",N=T||k==="inside",B=T||k==="outside";if(N||B){var U=u(f,"textfont",A.font),V=y.extendFlat({},U),W=x.textfont&&x.textfont.color,F=!W;if(F&&delete V.color,u(f,"insidetextfont",V),C){var $=y.extendFlat({},U);F&&delete $.color,u(f,"pathbar.textfont",$)}B&&u(f,"outsidetextfont",U),D&&f("selected.textfont.color"),E&&f("unselected.textfont.color"),I&&f("constraintext"),M&&f("cliponaxis"),p&&f("textangle"),f("texttemplate"),f("texttemplatefallback")}N&&g&&f("insidetextanchor")}Y.exports={supplyDefaults:s,crossTraceDefaults:h,handleText:b,validateCornerradius:m}}),EL=Fe((te,Y)=>{var d=as(),y=Os(),z=ji(),P=S8(),i=eg().validateCornerradius;Y.exports=function(n,a,l){function o(D,E){return z.coerce(n,a,P,D,E)}for(var u=!1,s=!1,h=!1,m={},b=o("barmode"),x=b==="group",_=0;_0&&!m[f]&&(h=!0),m[f]=!0),A.visible&&A.type==="histogram"){var k=y.getFromId({_fullLayout:a},A[A.orientation==="v"?"xaxis":"yaxis"]);k.type!=="category"&&(s=!0)}}if(!u){delete a.barmode;return}b!=="overlay"&&o("barnorm"),o("bargap",s&&!h?0:.2),o("bargroupgap");var w=o("barcornerradius");a.barcornerradius=i(w)}}),H4=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=Os(),y=Dm(),z=cp().hasColorscale,P=kp(),i=H4(),n=$e();Y.exports=function(a,l){var o=d.getFromId(a,l.xaxis||"x"),u=d.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A={msUTC:!!(l.base||l.base===0)};l.orientation==="h"?(s=o.makeCalcdata(l,"x",A),m=u.makeCalcdata(l,"y"),b=y(l,u,"y",m),x=!!l.yperiodalignment,_="y"):(s=u.makeCalcdata(l,"y",A),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;for(var f=Math.min(h.length,s.length),k=new Array(f),w=0;w{var d=ii(),y=ji();function z(a,l,o){var u=a._fullLayout,s=u["_"+o+"Text_minsize"];if(s){var h=u.uniformtext.mode==="hide",m;switch(o){case"funnelarea":case"pie":case"sunburst":m="g.slice";break;case"treemap":case"icicle":m="g.slice, g.pathbar";break;default:m="g.points > g.point"}l.selectAll(m).each(function(b){var x=b.transform;if(x){x.scale=h&&x.hide?0:s/x.fontSize;var _=d.select(this).select("text");y.setTransormAndDisplay(_,x)}})}}function P(a,l,o){if(o.uniformtext.mode){var u=n(a),s=o.uniformtext.minsize,h=l.scale*l.fontSize;l.hide=h{var Y=Ar(),d=sn(),y=ji().isArrayOrTypedArray;te.coerceString=function(z,P,i){if(typeof P=="string"){if(P||!z.noBlank)return P}else if((typeof P=="number"||P===!0)&&!z.strict)return String(P);return i!==void 0?i:z.dflt},te.coerceNumber=function(z,P,i){if(Y(P)){P=+P;var n=z.min,a=z.max,l=n!==void 0&&Pa;if(!l)return P}return i!==void 0?i:z.dflt},te.coerceColor=function(z,P,i){return d(P).isValid()?P:i!==void 0?i:z.dflt},te.coerceEnumerated=function(z,P,i){return z.coerceNumber&&(P=+P),z.values.indexOf(P)!==-1?P:i!==void 0?i:z.dflt},te.getValue=function(z,P){var i;return y(z)?P{var d=ii(),y=Xi(),z=Zs(),P=ji(),i=as(),n=C0().resizeText,a=Jv(),l=a.textfont,o=a.insidetextfont,u=a.outsidetextfont,s=A8();function h(M){var p=d.select(M).selectAll('g[class^="barlayer"]').selectAll("g.trace");n(M,p,"bar");var g=p.size(),C=M._fullLayout;p.style("opacity",function(T){return T[0].trace.opacity}).each(function(T){(C.barmode==="stack"&&g>1||C.bargap===0&&C.bargroupgap===0&&!T[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(T){var N=d.select(this),B=T[0].trace;m(N,B,M)}),i.getComponentMethod("errorbars","style")(p)}function m(M,p,g){z.pointStyle(M.selectAll("path"),p,g),b(M,p,g)}function b(M,p,g){M.selectAll("text").each(function(C){var T=d.select(this),N=P.ensureUniformFontSize(g,f(T,C,p,g));z.font(T,N)})}function x(M,p,g){var C=p[0].trace;C.selectedpoints?_(g,C,M):(m(g,C,M),i.getComponentMethod("errorbars","style")(g))}function _(M,p,g){z.selectedPointStyle(M.selectAll("path"),p),A(M.selectAll("text"),p,g)}function A(M,p,g){M.each(function(C){var T=d.select(this),N;if(C.selected){N=P.ensureUniformFontSize(g,f(T,C,p,g));var B=p.selected.textfont&&p.selected.textfont.color;B&&(N.color=B),z.font(T,N)}else z.selectedTextStyle(T,p)})}function f(M,p,g,C){var T=C._fullLayout.font,N=g.textfont;if(M.classed("bartext-inside")){var B=I(p,g);N=w(g,p.i,T,B)}else M.classed("bartext-outside")&&(N=D(g,p.i,T));return N}function k(M,p,g){return E(l,M.textfont,p,g)}function w(M,p,g,C){var T=k(M,p,g),N=M._input.textfont===void 0||M._input.textfont.color===void 0||Array.isArray(M.textfont.color)&&M.textfont.color[p]===void 0;return N&&(T={color:y.contrast(C),family:T.family,size:T.size,weight:T.weight,style:T.style,variant:T.variant,textcase:T.textcase,lineposition:T.lineposition,shadow:T.shadow}),E(o,M.insidetextfont,p,T)}function D(M,p,g){var C=k(M,p,g);return E(u,M.outsidetextfont,p,C)}function E(M,p,g,C){p=p||{};var T=s.getValue(p.family,g),N=s.getValue(p.size,g),B=s.getValue(p.color,g),U=s.getValue(p.weight,g),V=s.getValue(p.style,g),W=s.getValue(p.variant,g),F=s.getValue(p.textcase,g),$=s.getValue(p.lineposition,g),q=s.getValue(p.shadow,g);return{family:s.coerceString(M.family,T,C.family),size:s.coerceNumber(M.size,N,C.size),color:s.coerceColor(M.color,B,C.color),weight:s.coerceString(M.weight,U,C.weight),style:s.coerceString(M.style,V,C.style),variant:s.coerceString(M.variant,W,C.variant),textcase:s.coerceString(M.variant,F,C.textcase),lineposition:s.coerceString(M.variant,$,C.lineposition),shadow:s.coerceString(M.variant,q,C.shadow)}}function I(M,p){return p.type==="waterfall"?p[M.dir].marker.color:M.mcc||M.mc||p.marker.color}Y.exports={style:h,styleTextPoints:b,styleOnSelect:x,getInsideTextFont:w,getOutsideTextFont:D,getBarColor:I,resizeText:n}}),mb=Fe((te,Y)=>{var d=ii(),y=Ar(),z=ji(),P=cc(),i=Xi(),n=Zs(),a=as(),l=Os().tickText,o=C0(),u=o.recordMinTextSize,s=o.clearMinTextSize,h=Lg(),m=A8(),b=pb(),x=Jv(),_=x.text,A=x.textposition,f=T0().appendArrayPointValue,k=b.TEXTPAD;function w(he){return he.id}function D(he){if(he.ids)return w}function E(he){return(he>0)-(he<0)}function I(he,xe){return he0}function C(he,xe,ve,ce,re,ge){var ne=xe.xaxis,se=xe.yaxis,_e=he._fullLayout,oe=he._context.staticPlot;re||(re={mode:_e.barmode,norm:_e.barmode,gap:_e.bargap,groupgap:_e.bargroupgap},s("bar",_e));var J=z.makeTraceGroups(ce,ve,"trace bars").each(function(me){var fe=d.select(this),Ce=me[0].trace,Be=me[0].t,Oe=Ce.type==="waterfall",Ze=Ce.type==="funnel",Ge=Ce.type==="histogram",rt=Ce.type==="bar",_t=rt||Ze,pt=0;Oe&&Ce.connector.visible&&Ce.connector.mode==="between"&&(pt=Ce.connector.line.width/2);var gt=Ce.orientation==="h",ct=g(re),Ae=z.ensureSingle(fe,"g","points"),ze=D(Ce),Ee=Ae.selectAll("g.point").data(z.identity,ze);Ee.enter().append("g").classed("point",!0),Ee.exit().remove(),Ee.each(function(xt,ut){var Et=d.select(this),Gt=M(xt,ne,se,gt),Jt=Gt[0][0],gr=Gt[0][1],mr=Gt[1][0],Kr=Gt[1][1],ri=(gt?gr-Jt:Kr-mr)===0;ri&&_t&&m.getLineWidth(Ce,xt)&&(ri=!1),ri||(ri=!y(Jt)||!y(gr)||!y(mr)||!y(Kr)),xt.isBlank=ri,ri&&(gt?gr=Jt:Kr=mr),pt&&!ri&&(gt?(Jt-=I(Jt,gr)*pt,gr+=I(Jt,gr)*pt):(mr-=I(mr,Kr)*pt,Kr+=I(mr,Kr)*pt));var Mr,ui;if(Ce.type==="waterfall"){if(!ri){var mi=Ce[xt.dir].marker;Mr=mi.line.width,ui=mi.color}}else Mr=m.getLineWidth(Ce,xt),ui=xt.mc||Ce.marker.color;function Ot(na){var Zt=d.round(Mr/2%1,2);return re.gap===0&&re.groupgap===0?d.round(Math.round(na)-Zt,2):na}function Je(na,Zt,sr){return sr&&na===Zt?na:Math.abs(na-Zt)>=2?Ot(na):na>Zt?Math.ceil(na):Math.floor(na)}var ot=i.opacity(ui),De=ot<1||Mr>.01?Ot:Je;he._context.staticPlot||(Jt=De(Jt,gr,gt),gr=De(gr,Jt,gt),mr=De(mr,Kr,!gt),Kr=De(Kr,mr,!gt));var ye=gt?ne.c2p:se.c2p,Pe;xt.s0>0?Pe=xt._sMax:xt.s0<0?Pe=xt._sMin:Pe=xt.s1>0?xt._sMax:xt._sMin;function He(na,Zt){if(!na)return 0;var sr=Math.abs(gt?Kr-mr:gr-Jt),_r=Math.abs(gt?gr-Jt:Kr-mr),Cr=De(Math.abs(ye(Pe,!0)-ye(0,!0))),fi=xt.hasB?Math.min(sr/2,_r/2):Math.min(sr/2,Cr),qi;if(Zt==="%"){var Ui=Math.min(50,na);qi=sr*(Ui/100)}else qi=na;return De(Math.max(Math.min(qi,fi),0))}var at=rt||Ge?He(Be.cornerradiusvalue,Be.cornerradiusform):0,ht,At,Wt="M"+Jt+","+mr+"V"+Kr+"H"+gr+"V"+mr+"Z",Kt=0;if(at&&xt.s){var hr=E(xt.s0)===0||E(xt.s)===E(xt.s0)?xt.s1:xt.s0;if(Kt=De(xt.hasB?0:Math.abs(ye(Pe,!0)-ye(hr,!0))),Kt0?Math.sqrt(Kt*(2*at-Kt)):0,cn=zr>0?Math.max:Math.min;ht="M"+Jt+","+mr+"V"+(Kr-hi*Dr)+"H"+cn(gr-(at-Kt)*zr,Jt)+"A "+at+","+at+" 0 0 "+br+" "+gr+","+(Kr-at*Dr-un)+"V"+(mr+at*Dr+un)+"A "+at+","+at+" 0 0 "+br+" "+cn(gr-(at-Kt)*zr,Jt)+","+(mr+hi*Dr)+"Z"}else if(xt.hasB)ht="M"+(Jt+at*zr)+","+mr+"A "+at+","+at+" 0 0 "+br+" "+Jt+","+(mr+at*Dr)+"V"+(Kr-at*Dr)+"A "+at+","+at+" 0 0 "+br+" "+(Jt+at*zr)+","+Kr+"H"+(gr-at*zr)+"A "+at+","+at+" 0 0 "+br+" "+gr+","+(Kr-at*Dr)+"V"+(mr+at*Dr)+"A "+at+","+at+" 0 0 "+br+" "+(gr-at*zr)+","+mr+"Z";else{At=Math.abs(Kr-mr)+Kt;var yn=At0?Math.sqrt(Kt*(2*at-Kt)):0,Sn=Dr>0?Math.max:Math.min;ht="M"+(Jt+yn*zr)+","+mr+"V"+Sn(Kr-(at-Kt)*Dr,mr)+"A "+at+","+at+" 0 0 "+br+" "+(Jt+at*zr-Wn)+","+Kr+"H"+(gr-at*zr+Wn)+"A "+at+","+at+" 0 0 "+br+" "+(gr-yn*zr)+","+Sn(Kr-(at-Kt)*Dr,mr)+"V"+mr+"Z"}}else ht=Wt}else ht=Wt;var fn=p(z.ensureSingle(Et,"path"),_e,re,ge);if(fn.style("vector-effect",oe?"none":"non-scaling-stroke").attr("d",isNaN((gr-Jt)*(Kr-mr))||ri&&he._context.staticPlot?"M0,0Z":ht).call(n.setClipUrl,xe.layerClipId,he),!_e.uniformtext.mode&&ct){var ga=n.makePointStyleFns(Ce);n.singlePointStyle(xt,fn,Ce,ga,he)}T(he,xe,Et,me,ut,Jt,gr,mr,Kr,at,Kt,re,ge),xe.layerClipId&&n.hideOutsideRangePoint(xt,Et.select("text"),ne,se,Ce.xcalendar,Ce.ycalendar)});var nt=Ce.cliponaxis===!1;n.setClipUrl(fe,nt?null:xe.layerClipId,he)});a.getComponentMethod("errorbars","plot")(he,J,xe,re)}function T(he,xe,ve,ce,re,ge,ne,se,_e,oe,J,me,fe){var Ce=xe.xaxis,Be=xe.yaxis,Oe=he._fullLayout,Ze;function Ge(At,Wt,Kt){var hr=z.ensureSingle(At,"text").text(Wt).attr({class:"bartext bartext-"+Ze,"text-anchor":"middle","data-notex":1}).call(n.font,Kt).call(P.convertToTspans,he);return hr}var rt=ce[0].trace,_t=rt.orientation==="h",pt=$(Oe,ce,re,Ce,Be);Ze=q(rt,re);var gt=me.mode==="stack"||me.mode==="relative",ct=ce[re],Ae=!gt||ct._outmost,ze=ct.hasB,Ee=oe&&oe-J>k;if(!pt||Ze==="none"||(ct.isBlank||ge===ne||se===_e)&&(Ze==="auto"||Ze==="inside")){ve.select("text").remove();return}var nt=Oe.font,xt=h.getBarColor(ce[re],rt),ut=h.getInsideTextFont(rt,re,nt,xt),Et=h.getOutsideTextFont(rt,re,nt),Gt=rt.insidetextanchor||"end",Jt=ve.datum();_t?Ce.type==="log"&&Jt.s0<=0&&(Ce.range[0]0&&Ot>0,De;Ee?ze?De=N(Kr-2*oe,ri,mi,Ot,_t)||N(Kr,ri-2*oe,mi,Ot,_t):_t?De=N(Kr-(oe-J),ri,mi,Ot,_t)||N(Kr,ri-2*(oe-J),mi,Ot,_t):De=N(Kr,ri-(oe-J),mi,Ot,_t)||N(Kr-2*(oe-J),ri,mi,Ot,_t):De=N(Kr,ri,mi,Ot,_t),ot&&De?Ze="inside":(Ze="outside",Mr.remove(),Mr=null)}else Ze="inside";if(!Mr){Je=z.ensureUniformFontSize(he,Ze==="outside"?Et:ut),Mr=Ge(ve,pt,Je);var ye=Mr.attr("transform");if(Mr.attr("transform",""),ui=n.bBox(Mr.node()),mi=ui.width,Ot=ui.height,Mr.attr("transform",ye),mi<=0||Ot<=0){Mr.remove();return}}var Pe=rt.textangle,He,at;Ze==="outside"?(at=rt.constraintext==="both"||rt.constraintext==="outside",He=F(ge,ne,se,_e,ui,{isHorizontal:_t,constrained:at,angle:Pe})):(at=rt.constraintext==="both"||rt.constraintext==="inside",He=V(ge,ne,se,_e,ui,{isHorizontal:_t,constrained:at,angle:Pe,anchor:Gt,hasB:ze,r:oe,overhead:J})),He.fontSize=Je.size,u(rt.type==="histogram"?"bar":rt.type,He,Oe),ct.transform=He;var ht=p(Mr,Oe,me,fe);z.setTransormAndDisplay(ht,He)}function N(he,xe,ve,ce,re){if(he<0||xe<0)return!1;var ge=ve<=he&&ce<=xe,ne=ve<=xe&&ce<=he,se=re?he>=ve*(xe/ce):xe>=ce*(he/ve);return ge||ne||se}function B(he){return he==="auto"?0:he}function U(he,xe){var ve=Math.PI/180*xe,ce=Math.abs(Math.sin(ve)),re=Math.abs(Math.cos(ve));return{x:he.width*re+he.height*ce,y:he.width*ce+he.height*re}}function V(he,xe,ve,ce,re,ge){var ne=!!ge.isHorizontal,se=!!ge.constrained,_e=ge.angle||0,oe=ge.anchor,J=oe==="end",me=oe==="start",fe=ge.leftToRight||0,Ce=(fe+1)/2,Be=1-Ce,Oe=ge.hasB,Ze=ge.r,Ge=ge.overhead,rt=re.width,_t=re.height,pt=Math.abs(xe-he),gt=Math.abs(ce-ve),ct=pt>2*k&>>2*k?k:0;pt-=2*ct,gt-=2*ct;var Ae=B(_e);_e==="auto"&&!(rt<=pt&&_t<=gt)&&(rt>pt||_t>gt)&&(!(rt>gt||_t>pt)||rt<_t!=ptk){var xt=W(he,xe,ve,ce,ze,Ze,Ge,ne,Oe);Ee=xt.scale,nt=xt.pad}else Ee=1,se&&(Ee=Math.min(1,pt/ze.x,gt/ze.y)),nt=0;var ut=re.left*Be+re.right*Ce,Et=(re.top+re.bottom)/2,Gt=(he+k)*Be+(xe-k)*Ce,Jt=(ve+ce)/2,gr=0,mr=0;if(me||J){var Kr=(ne?ze.x:ze.y)/2;Ze&&(J||Oe)&&(ct+=nt);var ri=ne?I(he,xe):I(ve,ce);ne?me?(Gt=he+ri*ct,gr=-ri*Kr):(Gt=xe-ri*ct,gr=ri*Kr):me?(Jt=ve+ri*ct,mr=-ri*Kr):(Jt=ce-ri*ct,mr=ri*Kr)}return{textX:ut,textY:Et,targetX:Gt,targetY:Jt,anchorX:gr,anchorY:mr,scale:Ee,rotate:Ae}}function W(he,xe,ve,ce,re,ge,ne,se,_e){var oe=Math.max(0,Math.abs(xe-he)-2*k),J=Math.max(0,Math.abs(ce-ve)-2*k),me=ge-k,fe=ne?me-Math.sqrt(me*me-(me-ne)*(me-ne)):me,Ce=_e?me*2:se?me-ne:2*fe,Be=_e?me*2:se?2*fe:me-ne,Oe,Ze,Ge,rt,_t;return re.y/re.x>=J/(oe-Ce)?rt=J/re.y:re.y/re.x<=(J-Be)/oe?rt=oe/re.x:!_e&&se?(Oe=re.x*re.x+re.y*re.y/4,Ze=-2*re.x*(oe-me)-re.y*(J/2-me),Ge=(oe-me)*(oe-me)+(J/2-me)*(J/2-me)-me*me,rt=(-Ze+Math.sqrt(Ze*Ze-4*Oe*Ge))/(2*Oe)):_e?(Oe=(re.x*re.x+re.y*re.y)/4,Ze=-re.x*(oe/2-me)-re.y*(J/2-me),Ge=(oe/2-me)*(oe/2-me)+(J/2-me)*(J/2-me)-me*me,rt=(-Ze+Math.sqrt(Ze*Ze-4*Oe*Ge))/(2*Oe)):(Oe=re.x*re.x/4+re.y*re.y,Ze=-re.x*(oe/2-me)-2*re.y*(J-me),Ge=(oe/2-me)*(oe/2-me)+(J-me)*(J-me)-me*me,rt=(-Ze+Math.sqrt(Ze*Ze-4*Oe*Ge))/(2*Oe)),rt=Math.min(1,rt),se?_t=Math.max(0,me-Math.sqrt(Math.max(0,me*me-(me-(J-re.y*rt)/2)*(me-(J-re.y*rt)/2)))-ne):_t=Math.max(0,me-Math.sqrt(Math.max(0,me*me-(me-(oe-re.x*rt)/2)*(me-(oe-re.x*rt)/2)))-ne),{scale:rt,pad:_t}}function F(he,xe,ve,ce,re,ge){var ne=!!ge.isHorizontal,se=!!ge.constrained,_e=ge.angle||0,oe=re.width,J=re.height,me=Math.abs(xe-he),fe=Math.abs(ce-ve),Ce;ne?Ce=fe>2*k?k:0:Ce=me>2*k?k:0;var Be=1;se&&(Be=ne?Math.min(1,fe/J):Math.min(1,me/oe));var Oe=B(_e),Ze=U(re,Oe),Ge=(ne?Ze.x:Ze.y)/2,rt=(re.left+re.right)/2,_t=(re.top+re.bottom)/2,pt=(he+xe)/2,gt=(ve+ce)/2,ct=0,Ae=0,ze=ne?I(xe,he):I(ve,ce);return ne?(pt=xe-ze*Ce,ct=ze*Ge):(gt=ce+ze*Ce,Ae=-ze*Ge),{textX:rt,textY:_t,targetX:pt,targetY:gt,anchorX:ct,anchorY:Ae,scale:Be,rotate:Oe}}function $(he,xe,ve,ce,re){var ge=xe[0].trace,ne=ge.texttemplate,se;return ne?se=G(he,xe,ve,ce,re):ge.textinfo?se=ee(xe,ve,ce,re):se=m.getValue(ge.text,ve),m.coerceString(_,se)}function q(he,xe){var ve=m.getValue(he.textposition,xe);return m.coerceEnumerated(A,ve)}function G(he,xe,ve,ce,re){var ge=xe[0].trace,ne=z.castOption(ge,ve,"texttemplate");if(!ne)return"";var se=ge.type==="histogram",_e=ge.type==="waterfall",oe=ge.type==="funnel",J=ge.orientation==="h",me,fe,Ce,Be;J?(me="y",fe=re,Ce="x",Be=ce):(me="x",fe=ce,Ce="y",Be=re);function Oe(ct){return l(fe,fe.c2l(ct),!0).text}function Ze(ct){return l(Be,Be.c2l(ct),!0).text}var Ge=xe[ve],rt={};rt.label=Ge.p,rt.labelLabel=rt[me+"Label"]=Oe(Ge.p);var _t=z.castOption(ge,Ge.i,"text");(_t===0||_t)&&(rt.text=_t),rt.value=Ge.s,rt.valueLabel=rt[Ce+"Label"]=Ze(Ge.s);var pt={};f(pt,ge,Ge.i),(se||pt.x===void 0)&&(pt.x=J?rt.value:rt.label),(se||pt.y===void 0)&&(pt.y=J?rt.label:rt.value),(se||pt.xLabel===void 0)&&(pt.xLabel=J?rt.valueLabel:rt.labelLabel),(se||pt.yLabel===void 0)&&(pt.yLabel=J?rt.labelLabel:rt.valueLabel),_e&&(rt.delta=+Ge.rawS||Ge.s,rt.deltaLabel=Ze(rt.delta),rt.final=Ge.v,rt.finalLabel=Ze(rt.final),rt.initial=rt.final-rt.delta,rt.initialLabel=Ze(rt.initial)),oe&&(rt.value=Ge.s,rt.valueLabel=Ze(rt.value),rt.percentInitial=Ge.begR,rt.percentInitialLabel=z.formatPercent(Ge.begR),rt.percentPrevious=Ge.difR,rt.percentPreviousLabel=z.formatPercent(Ge.difR),rt.percentTotal=Ge.sumR,rt.percenTotalLabel=z.formatPercent(Ge.sumR));var gt=z.castOption(ge,Ge.i,"customdata");return gt&&(rt.customdata=gt),z.texttemplateString({data:[pt,rt,ge._meta],fallback:ge.texttemplatefallback,labels:rt,locale:he._d3locale,template:ne})}function ee(he,xe,ve,ce){var re=he[0].trace,ge=re.orientation==="h",ne=re.type==="waterfall",se=re.type==="funnel";function _e(gt){var ct=ge?ce:ve;return l(ct,gt,!0).text}function oe(gt){var ct=ge?ve:ce;return l(ct,+gt,!0).text}var J=re.textinfo,me=he[xe],fe=J.split("+"),Ce=[],Be,Oe=function(gt){return fe.indexOf(gt)!==-1};if(Oe("label")&&Ce.push(_e(he[xe].p)),Oe("text")&&(Be=z.castOption(re,me.i,"text"),(Be===0||Be)&&Ce.push(Be)),ne){var Ze=+me.rawS||me.s,Ge=me.v,rt=Ge-Ze;Oe("initial")&&Ce.push(oe(rt)),Oe("delta")&&Ce.push(oe(Ze)),Oe("final")&&Ce.push(oe(Ge))}if(se){Oe("value")&&Ce.push(oe(me.s));var _t=0;Oe("percent initial")&&_t++,Oe("percent previous")&&_t++,Oe("percent total")&&_t++;var pt=_t>1;Oe("percent initial")&&(Be=z.formatPercent(me.begR),pt&&(Be+=" of initial"),Ce.push(Be)),Oe("percent previous")&&(Be=z.formatPercent(me.difR),pt&&(Be+=" of previous"),Ce.push(Be)),Oe("percent total")&&(Be=z.formatPercent(me.sumR),pt&&(Be+=" of total"),Ce.push(Be))}return Ce.join("
")}Y.exports={plot:C,toMoveInsideBar:V}}),Aw=Fe((te,Y)=>{var d=hf(),y=as(),z=Xi(),P=ji().fillText,i=A8().getLineWidth,n=Os().hoverLabelText,a=ti().BADNUM;function l(s,h,m,b,x){var _=o(s,h,m,b,x);if(_){var A=_.cd,f=A[0].trace,k=A[_.index];return _.color=u(f,k),y.getComponentMethod("errorbars","hoverInfo")(k,f,_),[_]}}function o(s,h,m,b,x){var _=s.cd,A=_[0].trace,f=_[0].t,k=b==="closest",w=A.type==="waterfall",D=s.maxHoverDistance,E=s.maxSpikeDistance,I,M,p,g,C,T,N;A.orientation==="h"?(I=m,M=h,p="y",g="x",C=ce,T=he):(I=h,M=m,p="x",g="y",T=ce,C=he);var B=A[p+"period"],U=k||B;function V(Be){return F(Be,-1)}function W(Be){return F(Be,1)}function F(Be,Oe){var Ze=Be.w;return Be[p]+Oe*Ze/2}function $(Be){return Be[p+"End"]-Be[p+"Start"]}var q=k?V:B?function(Be){return Be.p-$(Be)/2}:function(Be){return Math.min(V(Be),Be.p-f.bardelta/2)},G=k?W:B?function(Be){return Be.p+$(Be)/2}:function(Be){return Math.max(W(Be),Be.p+f.bardelta/2)};function ee(Be,Oe,Ze){return x.finiteRange&&(Ze=0),d.inbox(Be-I,Oe-I,Ze+Math.min(1,Math.abs(Oe-Be)/N)-1)}function he(Be){return ee(q(Be),G(Be),D)}function xe(Be){return ee(V(Be),W(Be),E)}function ve(Be){var Oe=Be[g];if(w){var Ze=Math.abs(Be.rawS)||0;M>0?Oe+=Ze:M<0&&(Oe-=Ze)}return Oe}function ce(Be){var Oe=M,Ze=Be.b,Ge=ve(Be);return d.inbox(Ze-Oe,Ge-Oe,D+(Ge-Oe)/(Ge-Ze)-1)}function re(Be){var Oe=M,Ze=Be.b,Ge=ve(Be);return d.inbox(Ze-Oe,Ge-Oe,E+(Ge-Oe)/(Ge-Ze)-1)}var ge=s[p+"a"],ne=s[g+"a"];N=Math.abs(ge.r2c(ge.range[1])-ge.r2c(ge.range[0]));function se(Be){return(C(Be)+T(Be))/2}var _e=d.getDistanceFunction(b,C,T,se);if(d.getClosest(_,_e,s),s.index!==!1&&_[s.index].p!==a){U||(q=function(Be){return Math.min(V(Be),Be.p-f.bargroupwidth/2)},G=function(Be){return Math.max(W(Be),Be.p+f.bargroupwidth/2)});var oe=s.index,J=_[oe],me=A.base?J.b+J.s:J.s;s[g+"0"]=s[g+"1"]=ne.c2p(J[g],!0),s[g+"LabelVal"]=me;var fe=f.extents[f.extents.round(J.p)];s[p+"0"]=ge.c2p(k?q(J):fe[0],!0),s[p+"1"]=ge.c2p(k?G(J):fe[1],!0);var Ce=J.orig_p!==void 0;return s[p+"LabelVal"]=Ce?J.orig_p:J.p,s.labelLabel=n(ge,s[p+"LabelVal"],A[p+"hoverformat"]),s.valueLabel=n(ne,s[g+"LabelVal"],A[g+"hoverformat"]),s.baseLabel=n(ne,J.b,A[g+"hoverformat"]),s.spikeDistance=(re(J)+xe(J))/2,s[p+"Spike"]=ge.c2p(J.p,!0),P(J,A,s),s.hovertemplate=A.hovertemplate,s}}function u(s,h){var m=h.mcc||s.marker.color,b=h.mlcc||s.marker.line.color,x=i(s,h);if(z.opacity(m))return m;if(z.opacity(b)&&x)return b}Y.exports={hoverPoints:l,hoverOnBars:o,getTraceColor:u}}),_q=Fe((te,Y)=>{Y.exports=function(d,y,z){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),z.orientation==="h"?(d.label=d.y,d.value=d.x):(d.label=d.x,d.value=d.y),d}}),Mw=Fe((te,Y)=>{Y.exports=function(y,z){var P=y.cd,i=y.xaxis,n=y.yaxis,a=P[0].trace,l=a.type==="funnel",o=a.orientation==="h",u=[],s;if(z===!1)for(s=0;s{Y.exports={attributes:Jv(),layoutAttributes:S8(),supplyDefaults:eg().supplyDefaults,crossTraceDefaults:eg().crossTraceDefaults,supplyLayoutDefaults:EL(),calc:yq(),crossTraceCalc:jr().crossTraceCalc,colorbar:Mo(),arraysToCalcdata:H4(),plot:mb().plot,style:Lg().style,styleOnSelect:Lg().styleOnSelect,hoverPoints:Aw().hoverPoints,eventData:_q(),selectPoints:Mw(),moduleType:"trace",name:"bar",basePlotModule:Rf(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),bq=Fe((te,Y)=>{Y.exports=xq()}),V4=Fe((te,Y)=>{var d=Lm(),y=ff(),z=Jv(),P=Mi(),i=Sh().axisHoverFormat,{hovertemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=an().extendFlat,o=y.marker,u=o.line;Y.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:y.xperiod,yperiod:y.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:y.xperiodalignment,yperiodalignment:y.yperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},o.angle,{arrayOk:!1,editType:"calc"}),size:l({},o.size,{arrayOk:!1,editType:"calc"}),color:l({},o.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:P.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:d(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:z.offsetgroup,alignmentgroup:z.alignmentgroup,selected:{marker:y.selected.marker,editType:"style"},unselected:{marker:y.unselected.marker,editType:"style"},text:l({},y.text,{}),hovertext:l({},y.hovertext,{}),hovertemplate:n({}),hovertemplatefallback:a(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:y.zorder}}),W4=Fe((te,Y)=>{Y.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),q4=Fe((te,Y)=>{var d=ji(),y=as(),z=Xi(),P=S0(),i=Xv(),n=Y1(),a=V4();function l(h,m,b,x){function _(g,C){return d.coerce(h,m,a,g,C)}if(o(h,m,_,x),m.visible!==!1){P(h,m,x,_),_("xhoverformat"),_("yhoverformat");var A=m._hasPreCompStats;A&&(_("lowerfence"),_("upperfence")),_("line.color",(h.marker||{}).color||b),_("line.width"),_("fillcolor",z.addOpacity(m.line.color,.5));var f=!1;if(A){var k=_("mean"),w=_("sd");k&&k.length&&(f=!0,w&&w.length&&(f="sd"))}_("whiskerwidth");var D=_("sizemode"),E;D==="quartiles"&&(E=_("boxmean",f)),_("showwhiskers",D==="quartiles"),(D==="sd"||E==="sd")&&_("sdmultiple"),_("width"),_("quartilemethod");var I=!1;if(A){var M=_("notchspan");M&&M.length&&(I=!0)}else d.validate(h.notchwidth,a.notchwidth)&&(I=!0);var p=_("notched",I);p&&_("notchwidth"),u(h,m,_,{prefix:"box"}),_("zorder")}}function o(h,m,b,x){function _(ee){var he=0;return ee&&ee.length&&(he+=1,d.isArrayOrTypedArray(ee[0])&&ee[0].length&&(he+=1)),he}function A(ee){return d.validate(h[ee],a[ee])}var f=b("y"),k=b("x"),w;if(m.type==="box"){var D=b("q1"),E=b("median"),I=b("q3");m._hasPreCompStats=D&&D.length&&E&&E.length&&I&&I.length,w=Math.min(d.minRowLength(D),d.minRowLength(E),d.minRowLength(I))}var M=_(f),p=_(k),g=M&&d.minRowLength(f),C=p&&d.minRowLength(k),T=x.calendar,N={autotypenumbers:x.autotypenumbers},B,U;if(m._hasPreCompStats)switch(String(p)+String(M)){case"00":var V=A("x0")||A("dx"),W=A("y0")||A("dy");W&&!V?B="h":B="v",U=w;break;case"10":B="v",U=Math.min(w,C);break;case"20":B="h",U=Math.min(w,k.length);break;case"01":B="h",U=Math.min(w,g);break;case"02":B="v",U=Math.min(w,f.length);break;case"12":B="v",U=Math.min(w,C,f.length);break;case"21":B="h",U=Math.min(w,k.length,g);break;case"11":U=0;break;case"22":var F=!1,$;for($=0;$0?(B="v",p>0?U=Math.min(C,g):U=Math.min(g)):p>0?(B="h",U=Math.min(C)):U=0;if(!U){m.visible=!1;return}m._length=U;var q=b("orientation",B);m._hasPreCompStats?q==="v"&&p===0?(b("x0",0),b("dx",1)):q==="h"&&M===0&&(b("y0",0),b("dy",1)):q==="v"&&p===0?b("x0"):q==="h"&&M===0&&b("y0");var G=y.getComponentMethod("calendars","handleTraceDefaults");G(h,m,["x","y"],x)}function u(h,m,b,x){var _=x.prefix,A=d.coerce2(h,m,a,"marker.outliercolor"),f=b("marker.line.outliercolor"),k="outliers";m._hasPreCompStats?k="all":(A||f)&&(k="suspectedoutliers");var w=b(_+"points",k);w?(b("jitter",w==="all"?.3:0),b("pointpos",w==="all"?-1.5:0),b("marker.symbol"),b("marker.opacity"),b("marker.size"),b("marker.angle"),b("marker.color",m.line.color),b("marker.line.color"),b("marker.line.width"),w==="suspectedoutliers"&&(b("marker.line.outliercolor",m.marker.color),b("marker.line.outlierwidth")),b("selected.marker.color"),b("unselected.marker.color"),b("selected.marker.size"),b("unselected.marker.size"),b("text"),b("hovertext")):delete m.marker;var D=b("hoveron");(D==="all"||D.indexOf("points")!==-1)&&(b("hovertemplate"),b("hovertemplatefallback")),d.coerceSelectionMarkerOpacity(m,b)}function s(h,m){var b,x;function _(w){return d.coerce(x._input,x,a,w)}for(var A=0;A{var d=as(),y=ji(),z=W4();function P(n,a,l,o,u){for(var s=u+"Layout",h=!1,m=0;m{var d=Ar(),y=Os(),z=Dm(),P=ji(),i=ti().BADNUM,n=P._;Y.exports=function(w,D){var E=w._fullLayout,I=y.getFromId(w,D.xaxis||"x"),M=y.getFromId(w,D.yaxis||"y"),p=[],g=D.type==="violin"?"_numViolins":"_numBoxes",C,T,N,B,U,V,W;D.orientation==="h"?(N=I,B="x",U=M,V="y",W=!!D.yperiodalignment):(N=M,B="y",U=I,V="x",W=!!D.xperiodalignment);var F=a(D,V,U,E[g]),$=F[0],q=F[1],G=P.distinctVals($,U),ee=G.vals,he=G.minDiff/2,xe,ve,ce,re,ge,ne,se=(D.boxpoints||D.points)==="all"?P.identity:function(Kr){return Kr.vxe.uf};if(D._hasPreCompStats){var _e=D[B],oe=function(Kr){return N.d2c((D[Kr]||[])[C])},J=1/0,me=-1/0;for(C=0;C=xe.q1&&xe.q3>=xe.med){var Ce=oe("lowerfence");xe.lf=Ce!==i&&Ce<=xe.q1?Ce:x(xe,ce,re);var Be=oe("upperfence");xe.uf=Be!==i&&Be>=xe.q3?Be:_(xe,ce,re);var Oe=oe("mean");xe.mean=Oe!==i?Oe:re?P.mean(ce,re):(xe.q1+xe.q3)/2;var Ze=oe("sd");xe.sd=Oe!==i&&Ze>=0?Ze:re?P.stdev(ce,re,xe.mean):xe.q3-xe.q1,xe.lo=A(xe),xe.uo=f(xe);var Ge=oe("notchspan");Ge=Ge!==i&&Ge>0?Ge:k(xe,re),xe.ln=xe.med-Ge,xe.un=xe.med+Ge;var rt=xe.lf,_t=xe.uf;D.boxpoints&&ce.length&&(rt=Math.min(rt,ce[0]),_t=Math.max(_t,ce[re-1])),D.notched&&(rt=Math.min(rt,xe.ln),_t=Math.max(_t,xe.un)),xe.min=rt,xe.max=_t}else{P.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+xe.q1,"median = "+xe.med,"q3 = "+xe.q3].join(` -`));var pt;xe.med!==i?pt=xe.med:xe.q1!==i?xe.q3!==i?pt=(xe.q1+xe.q3)/2:pt=xe.q1:xe.q3!==i?pt=xe.q3:pt=0,xe.med=pt,xe.q1=xe.q3=pt,xe.lf=xe.uf=pt,xe.mean=xe.sd=pt,xe.ln=xe.un=pt,xe.min=xe.max=pt}J=Math.min(J,xe.min),me=Math.max(me,xe.max),xe.pts2=ve.filter(se),p.push(xe)}}D._extremes[N._id]=y.findExtremes(N,[J,me],{padded:!0})}else{var gt=N.makeCalcdata(D,B),ct=l(ee,he),Ae=ee.length,ze=o(Ae);for(C=0;C=0&&Ee0){if(xe={},xe.pos=xe[V]=ee[C],ve=xe.pts=ze[C].sort(m),ce=xe[B]=ve.map(b),re=ce.length,xe.min=ce[0],xe.max=ce[re-1],xe.mean=P.mean(ce,re),xe.sd=P.stdev(ce,re,xe.mean)*D.sdmultiple,xe.med=P.interp(ce,.5),re%2&&(Et||Gt)){var Jt,gr;Et?(Jt=ce.slice(0,re/2),gr=ce.slice(re/2+1)):Gt&&(Jt=ce.slice(0,re/2+1),gr=ce.slice(re/2)),xe.q1=P.interp(Jt,.5),xe.q3=P.interp(gr,.5)}else xe.q1=P.interp(ce,.25),xe.q3=P.interp(ce,.75);xe.lf=x(xe,ce,re),xe.uf=_(xe,ce,re),xe.lo=A(xe),xe.uo=f(xe);var mr=k(xe,re);xe.ln=xe.med-mr,xe.un=xe.med+mr,nt=Math.min(nt,xe.ln),xt=Math.max(xt,xe.un),xe.pts2=ve.filter(se),p.push(xe)}D.notched&&P.isTypedArray(gt)&&(gt=Array.from(gt)),D._extremes[N._id]=y.findExtremes(N,D.notched?gt.concat([nt,xt]):gt,{padded:!0})}return h(p,D),p.length>0?(p[0].t={num:E[g],dPos:he,posLetter:V,valLetter:B,labels:{med:n(w,"median:"),min:n(w,"min:"),q1:n(w,"q1:"),q3:n(w,"q3:"),max:n(w,"max:"),mean:D.boxmean==="sd"||D.sizemode==="sd"?n(w,"mean ± σ:").replace("σ",D.sdmultiple===1?"σ":D.sdmultiple+"σ"):n(w,"mean:"),lf:n(w,"lower fence:"),uf:n(w,"upper fence:")}},E[g]++,p):[{t:{empty:!0}}]};function a(w,D,E,I){var M=D in w,p=D+"0"in w,g="d"+D in w;if(M||p&&g){var C=E.makeCalcdata(w,D),T=z(w,E,D,C).vals;return[T,C]}var N;p?N=w[D+"0"]:"name"in w&&(E.type==="category"||d(w.name)&&["linear","log"].indexOf(E.type)!==-1||P.isDateTime(w.name)&&E.type==="date")?N=w.name:N=I;for(var B=E.type==="multicategory"?E.r2c_just_indices(N):E.d2c(N,0,w[D+"calendar"]),U=w._length,V=new Array(U),W=0;W{var d=Os(),y=ji(),z=ey().getAxisGroup,P=["v","h"];function i(a,l){for(var o=a.calcdata,u=l.xaxis,s=l.yaxis,h=0;h1,p=1-h[a+"gap"],g=1-h[a+"groupgap"];for(x=0;x0;if(B==="positive"?(ve=U*(N?1:.5),ge=re,ce=ge=W):B==="negative"?(ve=ge=W,ce=U*(N?1:.5),ne=re):(ve=ce=U,ge=ne=re),fe){var Ce=C.pointpos,Be=C.jitter,Oe=C.marker.size/2,Ze=0;Ce+Be>=0&&(Ze=re*(Ce+Be),Ze>ve?(me=!0,oe=Oe,se=Ze):Ze>ge&&(oe=Oe,se=ve)),Ze<=ve&&(se=ve);var Ge=0;Ce-Be<=0&&(Ge=-re*(Ce-Be),Ge>ce?(me=!0,J=Oe,_e=Ge):Ge>ne&&(J=Oe,_e=ce)),Ge<=ce&&(_e=ce)}else se=ve,_e=ce;var rt=new Array(A.length);for(_=0;_{var d=ii(),y=ji(),z=Zs(),P=5,i=.01;function n(u,s,h,m){var b=u._context.staticPlot,x=s.xaxis,_=s.yaxis;y.makeTraceGroups(m,h,"trace boxes").each(function(A){var f=d.select(this),k=A[0],w=k.t,D=k.trace;if(w.wdPos=w.bdPos*D.whiskerwidth,D.visible!==!0||w.empty){f.remove();return}var E,I;D.orientation==="h"?(E=_,I=x):(E=x,I=_),a(f,{pos:E,val:I},D,w,b),l(f,{x,y:_},D,w),o(f,{pos:E,val:I},D,w)})}function a(u,s,h,m,b){var x=h.orientation==="h",_=s.val,A=s.pos,f=!!A.rangebreaks,k=m.bPos,w=m.wdPos||0,D=m.bPosPxOffset||0,E=h.whiskerwidth||0,I=h.showwhiskers!==!1,M=h.notched||!1,p=M?1-2*h.notchwidth:1,g,C;Array.isArray(m.bdPos)?(g=m.bdPos[0],C=m.bdPos[1]):(g=m.bdPos,C=m.bdPos);var T=u.selectAll("path.box").data(h.type!=="violin"||h.box.visible?y.identity:[]);T.enter().append("path").style("vector-effect",b?"none":"non-scaling-stroke").attr("class","box"),T.exit().remove(),T.each(function(N){if(N.empty)return d.select(this).attr("d","M0,0Z");var B=A.c2l(N.pos+k,!0),U=A.l2p(B-g)+D,V=A.l2p(B+C)+D,W=f?(U+V)/2:A.l2p(B)+D,F=h.whiskerwidth,$=f?U*F+(1-F)*W:A.l2p(B-w)+D,q=f?V*F+(1-F)*W:A.l2p(B+w)+D,G=A.l2p(B-g*p)+D,ee=A.l2p(B+C*p)+D,he=h.sizemode==="sd",xe=_.c2p(he?N.mean-N.sd:N.q1,!0),ve=he?_.c2p(N.mean+N.sd,!0):_.c2p(N.q3,!0),ce=y.constrain(he?_.c2p(N.mean,!0):_.c2p(N.med,!0),Math.min(xe,ve)+1,Math.max(xe,ve)-1),re=N.lf===void 0||h.boxpoints===!1||he,ge=_.c2p(re?N.min:N.lf,!0),ne=_.c2p(re?N.max:N.uf,!0),se=_.c2p(N.ln,!0),_e=_.c2p(N.un,!0);x?d.select(this).attr("d","M"+ce+","+G+"V"+ee+"M"+xe+","+U+"V"+V+(M?"H"+se+"L"+ce+","+ee+"L"+_e+","+V:"")+"H"+ve+"V"+U+(M?"H"+_e+"L"+ce+","+G+"L"+se+","+U:"")+"Z"+(I?"M"+xe+","+W+"H"+ge+"M"+ve+","+W+"H"+ne+(E===0?"":"M"+ge+","+$+"V"+q+"M"+ne+","+$+"V"+q):"")):d.select(this).attr("d","M"+G+","+ce+"H"+ee+"M"+U+","+xe+"H"+V+(M?"V"+se+"L"+ee+","+ce+"L"+V+","+_e:"")+"V"+ve+"H"+U+(M?"V"+_e+"L"+G+","+ce+"L"+U+","+se:"")+"Z"+(I?"M"+W+","+xe+"V"+ge+"M"+W+","+ve+"V"+ne+(E===0?"":"M"+$+","+ge+"H"+q+"M"+$+","+ne+"H"+q):""))})}function l(u,s,h,m){var b=s.x,x=s.y,_=m.bdPos,A=m.bPos,f=h.boxpoints||h.points;y.seedPseudoRandom();var k=function(E){return E.forEach(function(I){I.t=m,I.trace=h}),E},w=u.selectAll("g.points").data(f?k:[]);w.enter().append("g").attr("class","points"),w.exit().remove();var D=w.selectAll("path").data(function(E){var I,M=E.pts2,p=Math.max((E.max-E.min)/10,E.q3-E.q1),g=p*1e-9,C=p*i,T=[],N=0,B;if(h.jitter){if(p===0)for(N=1,T=new Array(M.length),I=0;IE.lo&&(q.so=!0)}return M});D.enter().append("path").classed("point",!0),D.exit().remove(),D.call(z.translatePoints,b,x)}function o(u,s,h,m){var b=s.val,x=s.pos,_=!!x.rangebreaks,A=m.bPos,f=m.bPosPxOffset||0,k=h.boxmean||(h.meanline||{}).visible,w,D;Array.isArray(m.bdPos)?(w=m.bdPos[0],D=m.bdPos[1]):(w=m.bdPos,D=m.bdPos);var E=u.selectAll("path.mean").data(h.type==="box"&&h.boxmean||h.type==="violin"&&h.box.visible&&h.meanline.visible?y.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(I){var M=x.c2l(I.pos+A,!0),p=x.l2p(M-w)+f,g=x.l2p(M+D)+f,C=_?(p+g)/2:x.l2p(M)+f,T=b.c2p(I.mean,!0),N=b.c2p(I.mean-I.sd,!0),B=b.c2p(I.mean+I.sd,!0);h.orientation==="h"?d.select(this).attr("d","M"+T+","+p+"V"+g+(k==="sd"?"m0,0L"+N+","+C+"L"+T+","+p+"L"+B+","+C+"Z":"")):d.select(this).attr("d","M"+p+","+T+"H"+g+(k==="sd"?"m0,0L"+C+","+N+"L"+p+","+T+"L"+C+","+B+"Z":""))})}Y.exports={plot:n,plotBoxAndWhiskers:a,plotPoints:l,plotBoxMean:o}}),P8=Fe((te,Y)=>{var d=ii(),y=Xi(),z=Zs();function P(n,a,l){var o=l||d.select(n).selectAll("g.trace.boxes");o.style("opacity",function(u){return u[0].trace.opacity}),o.each(function(u){var s=d.select(this),h=u[0].trace,m=h.line.width;function b(A,f,k,w){A.style("stroke-width",f+"px").call(y.stroke,k).call(y.fill,w)}var x=s.selectAll("path.box");if(h.type==="candlestick")x.each(function(A){if(!A.empty){var f=d.select(this),k=h[A.dir];b(f,k.line.width,k.line.color,k.fillcolor),f.style("opacity",h.selectedpoints&&!A.selected?.3:1)}});else{b(x,m,h.line.color,h.fillcolor),s.selectAll("path.mean").style({"stroke-width":m,"stroke-dasharray":2*m+"px,"+m+"px"}).call(y.stroke,h.line.color);var _=s.selectAll("path.point");z.pointStyle(_,h,n)}})}function i(n,a,l){var o=a[0].trace,u=l.selectAll("path.point");o.selectedpoints?z.selectedPointStyle(u,o):z.pointStyle(u,o,n)}Y.exports={style:P,styleOnSelect:i}}),PL=Fe((te,Y)=>{var d=Os(),y=ji(),z=hf(),P=Xi(),i=y.fillText;function n(o,u,s,h){var m=o.cd,b=m[0].trace,x=b.hoveron,_=[],A;return x.indexOf("boxes")!==-1&&(_=_.concat(a(o,u,s,h))),x.indexOf("points")!==-1&&(A=l(o,u,s)),h==="closest"?A?[A]:_:(A&&_.push(A),_)}function a(o,u,s,h){var m=o.cd,b=o.xa,x=o.ya,_=m[0].trace,A=m[0].t,f=_.type==="violin",k,w,D,E,I,M,p,g,C,T,N,B=A.bdPos,U,V,W=A.wHover,F=function(Ge){return D.c2l(Ge.pos)+A.bPos-D.c2l(M)};f&&_.side!=="both"?(_.side==="positive"&&(C=function(Ge){var rt=F(Ge);return z.inbox(rt,rt+W,T)},U=B,V=0),_.side==="negative"&&(C=function(Ge){var rt=F(Ge);return z.inbox(rt-W,rt,T)},U=0,V=B)):(C=function(Ge){var rt=F(Ge);return z.inbox(rt-W,rt+W,T)},U=V=B);var $;f?$=function(Ge){return z.inbox(Ge.span[0]-I,Ge.span[1]-I,T)}:$=function(Ge){return z.inbox(Ge.min-I,Ge.max-I,T)},_.orientation==="h"?(I=u,M=s,p=$,g=C,k="y",D=x,w="x",E=b):(I=s,M=u,p=C,g=$,k="x",D=b,w="y",E=x);var q=Math.min(1,B/Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0])));T=o.maxHoverDistance-q,N=o.maxSpikeDistance-q;function G(Ge){return(p(Ge)+g(Ge))/2}var ee=z.getDistanceFunction(h,p,g,G);if(z.getClosest(m,ee,o),o.index===!1)return[];var he=m[o.index],xe=_.line.color,ve=(_.marker||{}).color;P.opacity(xe)&&_.line.width?o.color=xe:P.opacity(ve)&&_.boxpoints?o.color=ve:o.color=_.fillcolor,o[k+"0"]=D.c2p(he.pos+A.bPos-V,!0),o[k+"1"]=D.c2p(he.pos+A.bPos+U,!0),o[k+"LabelVal"]=he.orig_p!==void 0?he.orig_p:he.pos;var ce=k+"Spike";o.spikeDistance=G(he)*N/T,o[ce]=D.c2p(he.pos,!0);var re=_.boxmean||_.sizemode==="sd"||(_.meanline||{}).visible,ge=_.boxpoints||_.points,ne=ge&&re?["max","uf","q3","med","mean","q1","lf","min"]:ge&&!re?["max","uf","q3","med","q1","lf","min"]:!ge&&re?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],se=E.range[1]{Y.exports=function(d,y){return y.hoverOnBox&&(d.hoverOnBox=y.hoverOnBox),"xVal"in y&&(d.x=y.xVal),"yVal"in y&&(d.y=y.yVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),IL=Fe((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l;if(y===!1)for(a=0;a{Y.exports={attributes:V4(),layoutAttributes:W4(),supplyDefaults:q4().supplyDefaults,crossTraceDefaults:q4().crossTraceDefaults,supplyLayoutDefaults:M8().supplyLayoutDefaults,calc:LL(),crossTraceCalc:E8().crossTraceCalc,plot:L8().plot,style:P8().style,styleOnSelect:P8().styleOnSelect,hoverPoints:PL().hoverPoints,eventData:wq(),selectPoints:IL(),moduleType:"trace",name:"box",basePlotModule:Rf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),Tq=Fe((te,Y)=>{Y.exports=kq()}),Ew=Fe((te,Y)=>{var d=zc(),{extendFlat:y}=an(),z=_a(),{axisHoverFormat:P}=Sh(),i=zn(),{hovertemplateAttrs:n,templatefallbackAttrs:a,texttemplateAttrs:l}=rc(),o=ff();Y.exports=y({z:{valType:"data_array",editType:"calc"},x:y({},o.x,{impliedEdits:{xtype:"array"}}),x0:y({},o.x0,{impliedEdits:{xtype:"scaled"}}),dx:y({},o.dx,{impliedEdits:{xtype:"scaled"}}),y:y({},o.y,{impliedEdits:{ytype:"array"}}),y0:y({},o.y0,{impliedEdits:{ytype:"scaled"}}),dy:y({},o.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:y({},o.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:y({},o.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:y({},o.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:y({},o.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:y({},o.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:y({},o.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:n(),hovertemplatefallback:a(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:a({editType:"plot"}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:y({},z.showlegend,{dflt:!1}),zorder:o.zorder},d("",{cLetter:"z",autoColorDflt:!1}))}),I8=Fe((te,Y)=>{var d=Ar(),y=ji(),z=as();Y.exports=function(n,a,l,o,u,s){var h=l("z");u=u||"x",s=s||"y";var m,b;if(h===void 0||!h.length)return 0;if(y.isArray1D(h)){m=l(u),b=l(s);var x=y.minRowLength(m),_=y.minRowLength(b);if(x===0||_===0)return 0;a._length=Math.min(x,_,h.length)}else{if(m=P(u,l),b=P(s,l),!i(h))return 0;l("transpose"),a._length=null}var A=z.getComponentMethod("calendars","handleTraceDefaults");return A(n,a,[u,s],o),!0};function P(n,a){var l=a(n),o=l?a(n+"type","array"):"scaled";return o==="scaled"&&(a(n+"0"),a("d"+n)),l}function i(n){for(var a=!0,l=!1,o=!1,u,s=0;s0&&(l=!0);for(var h=0;h{var d=ji();Y.exports=function(y,z){y("texttemplate"),y("texttemplatefallback");var P=d.extendFlat({},z.font,{color:"auto",size:"auto"});d.coerceFont(y,"textfont",P)}}),DL=Fe((te,Y)=>{Y.exports=function(d,y,z){var P=z("zsmooth");P===!1&&(z("xgap"),z("ygap")),z("zhoverformat")}}),Sq=Fe((te,Y)=>{var d=ji(),y=I8(),z=G4(),P=S0(),i=DL(),n=Cc(),a=Ew();Y.exports=function(l,o,u,s){function h(b,x){return d.coerce(l,o,a,b,x)}var m=y(l,o,h,s);if(!m){o.visible=!1;return}P(l,o,s,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),z(h,s),i(l,o,h,s),h("hoverongaps"),h("connectgaps",d.isArray1D(o.z)&&o.zsmooth!==!1),n(l,o,s,h,{prefix:"",cLetter:"z"}),h("zorder")}}),zL=Fe((te,Y)=>{var d=Ar();Y.exports={count:function(y,z,P){return P[y]++,1},sum:function(y,z,P,i){var n=i[z];return d(n)?(n=Number(n),P[y]+=n,n):0},avg:function(y,z,P,i,n){var a=i[z];return d(a)&&(a=Number(a),P[y]+=a,n[y]++),0},min:function(y,z,P,i){var n=i[z];if(d(n))if(n=Number(n),d(P[y])){if(P[y]>n){var a=n-P[y];return P[y]=n,a}}else return P[y]=n,n;return 0},max:function(y,z,P,i){var n=i[z];if(d(n))if(n=Number(n),d(P[y])){if(P[y]{Y.exports={percent:function(d,y){for(var z=d.length,P=100/y,i=0;i{Y.exports=function(d,y){for(var z=d.length,P=0,i=0;i{var d=ti(),y=d.ONEAVGYEAR,z=d.ONEAVGMONTH,P=d.ONEDAY,i=d.ONEHOUR,n=d.ONEMIN,a=d.ONESEC,l=Os().tickIncrement;Y.exports=function(m,b,x,_,A){var f=-1.1*b,k=-.1*b,w=m-k,D=x[0],E=x[1],I=Math.min(o(D+k,D+w,_,A),o(E+k,E+w,_,A)),M=Math.min(o(D+f,D+k,_,A),o(E+f,E+k,_,A)),p,g;if(I>M&&MP){var C=p===y?1:6,T=p===y?"M12":"M1";return function(N,B){var U=_.c2d(N,y,A),V=U.indexOf("-",C);V>0&&(U=U.substr(0,V));var W=_.d2c(U,0,A);if(Wa?m>P?m>y*1.1?y:m>z*1.1?z:P:m>i?i:m>n?n:a:Math.pow(10,Math.floor(Math.log(m)/Math.LN10))}function s(m,b,x,_,A,f){if(_&&m>P){var k=h(b,A,f),w=h(x,A,f),D=m===y?0:1;return k[D]!==w[D]}return Math.floor(x/m)-Math.floor(b/m)>.1}function h(m,b,x){var _=b.c2d(m,y,x).split("-");return _[0]===""&&(_.unshift(),_[0]="-"+_[0]),_}}),FL=Fe((te,Y)=>{var d=Ar(),y=ji(),z=as(),P=Os(),{hasColorscale:i}=cp(),n=kp(),a=H4(),l=zL(),o=OL(),u=BL(),s=RL();function h(A,f){var k=[],w=[],D=f.orientation==="h",E=P.getFromId(A,D?f.yaxis:f.xaxis),I=D?"y":"x",M={x:"y",y:"x"}[I],p=f[I+"calendar"],g=f.cumulative,C,T=m(A,f,E,I),N=T[0],B=T[1],U=typeof N.size=="string",V=[],W=U?V:N,F=[],$=[],q=[],G=0,ee=f.histnorm,he=f.histfunc,xe=ee.indexOf("density")!==-1,ve,ce,re;g.enabled&&xe&&(ee=ee.replace(/ ?density$/,""),xe=!1);var ge=he==="max"||he==="min",ne=ge?null:0,se=l.count,_e=o[ee],oe=!1,J=function(nt){return E.r2c(nt,0,p)},me;for(y.isArrayOrTypedArray(f[M])&&he!=="count"&&(me=f[M],oe=he==="avg",se=l[he]),C=J(N.start),ce=J(N.end)+(C-P.tickIncrement(C,N.size,!1,p))/1e6;C=0&&re=Ae;C--)if(w[C]){ze=C;break}for(C=Ae;C<=ze;C++)if(d(k[C])&&d(w[C])){var Ee={p:k[C],s:w[C],b:0};g.enabled||(Ee.pts=q[C],Oe?Ee.ph0=Ee.ph1=q[C].length?B[q[C][0]]:k[C]:(f._computePh=!0,Ee.ph0=pt(V[C]),Ee.ph1=pt(V[C+1],!0))),ct.push(Ee)}return ct.length===1&&(ct[0].width1=P.tickIncrement(ct[0].p,N.size,!1,p)-ct[0].p),i(f,"marker")&&n(A,f,{vals:f.marker.color,containerStr:"marker",cLetter:"c"}),i(f,"marker.line")&&n(A,f,{vals:f.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(ct,f),y.isArrayOrTypedArray(f.selectedpoints)&&y.tagSelected(ct,f,rt),ct}function m(A,f,k,w,D){var E=w+"bins",I=A._fullLayout,M=f["_"+w+"bingroup"],p=I._histogramBinOpts[M],g=I.barmode==="overlay",C,T,N,B,U,V,W,F=function(_t){return k.r2c(_t,0,B)},$=function(_t){return k.c2r(_t,0,B)},q=k.type==="date"?function(_t){return _t||_t===0?y.cleanDate(_t,null,B):null}:function(_t){return d(_t)?Number(_t):null};function G(_t,pt,gt){pt[_t+"Found"]?(pt[_t]=q(pt[_t]),pt[_t]===null&&(pt[_t]=gt[_t])):(V[_t]=pt[_t]=gt[_t],y.nestedProperty(T[0],E+"."+_t).set(gt[_t]))}if(f["_"+w+"autoBinFinished"])delete f["_"+w+"autoBinFinished"];else{T=p.traces;var ee=[],he=!0,xe=!1,ve=!1;for(C=0;C"u"){if(D)return[re,U,!0];re=b(A,f,k,w,E)}W=N.cumulative||{},W.enabled&&W.currentbin!=="include"&&(W.direction==="decreasing"?re.start=$(P.tickIncrement(F(re.start),re.size,!0,B)):re.end=$(P.tickIncrement(F(re.end),re.size,!1,B))),p.size=re.size,p.sizeFound||(V.size=re.size,y.nestedProperty(T[0],E+".size").set(re.size)),G("start",p,re),G("end",p,re)}U=f["_"+w+"pos0"],delete f["_"+w+"pos0"];var ne=f._input[E]||{},se=y.extendFlat({},p),_e=p.start,oe=k.r2l(ne.start),J=oe!==void 0;if((p.startFound||J)&&oe!==k.r2l(_e)){var me=J?oe:y.aggNums(Math.min,null,U),fe={type:k.type==="category"||k.type==="multicategory"?"linear":k.type,r2l:k.r2l,dtick:p.size,tick0:_e,calendar:B,range:[me,P.tickIncrement(me,p.size,!1,B)].map(k.l2r)},Ce=P.tickFirst(fe);Ce>k.r2l(me)&&(Ce=P.tickIncrement(Ce,p.size,!0,B)),se.start=k.l2r(Ce),J||y.nestedProperty(f,E+".start").set(se.start)}var Be=p.end,Oe=k.r2l(ne.end),Ze=Oe!==void 0;if((p.endFound||Ze)&&Oe!==k.r2l(Be)){var Ge=Ze?Oe:y.aggNums(Math.max,null,U);se.end=k.l2r(Ge),Ze||y.nestedProperty(f,E+".start").set(se.end)}var rt="autobin"+w;return f._input[rt]===!1&&(f._input[E]=y.extendFlat({},f[E]||{}),delete f._input[rt],delete f[rt]),[se,U]}function b(A,f,k,w,D){var E=A._fullLayout,I=x(A,f),M=!1,p=1/0,g=[f],C,T,N;for(C=0;C=0;w--)M(w);else if(f==="increasing"){for(w=1;w=0;w--)A[w]+=A[w+1];k==="exclude"&&(A.push(0),A.shift())}}Y.exports={calc:h,calcAllAutoBins:m}}),Cq=Fe((te,Y)=>{var d=ji(),y=Os(),z=zL(),P=OL(),i=BL(),n=RL(),a=FL().calcAllAutoBins;Y.exports=function(s,h){var m=y.getFromId(s,h.xaxis),b=y.getFromId(s,h.yaxis),x=h.xcalendar,_=h.ycalendar,A=function(Ot){return m.r2c(Ot,0,x)},f=function(Ot){return b.r2c(Ot,0,_)},k=function(Ot){return m.c2r(Ot,0,x)},w=function(Ot){return b.c2r(Ot,0,_)},D,E,I,M,p=a(s,h,m,"x"),g=p[0],C=p[1],T=a(s,h,b,"y"),N=T[0],B=T[1],U=h._length;C.length>U&&C.splice(U,C.length-U),B.length>U&&B.splice(U,B.length-U);var V=[],W=[],F=[],$=typeof g.size=="string",q=typeof N.size=="string",G=[],ee=[],he=$?G:g,xe=q?ee:N,ve=0,ce=[],re=[],ge=h.histnorm,ne=h.histfunc,se=ge.indexOf("density")!==-1,_e=ne==="max"||ne==="min",oe=_e?null:0,J=z.count,me=P[ge],fe=!1,Ce=[],Be=[],Oe="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Oe&&ne!=="count"&&(fe=ne==="avg",J=z[ne]);var Ze=g.size,Ge=A(g.start),rt=A(g.end)+(Ge-y.tickIncrement(Ge,Ze,!1,x))/1e6;for(D=Ge;D=0&&I<_t&&M>=0&&M{var d=ji(),y=ti().BADNUM,z=Dm();Y.exports=function(P,i,n,a,l,o){var u=P._length,s=i.makeCalcdata(P,a),h=n.makeCalcdata(P,l);s=z(P,i,a,s).vals,h=z(P,n,l,h).vals;var m=P.text,b=m!==void 0&&d.isArray1D(m),x=P.hovertext,_=x!==void 0&&d.isArray1D(x),A,f,k=d.distinctVals(s),w=k.vals,D=d.distinctVals(h),E=D.vals,I=[],M,p,g=E.length,C=w.length;for(A=0;A{var d=Ar(),y=ji(),z=ti().BADNUM;Y.exports=function(P,i,n,a){var l,o,u,s,h,m;function b(w){if(d(w))return+w}if(i&&i.transpose){for(l=0,h=0;h{var d=ji(),y=.01,z=[[-1,0],[1,0],[0,-1],[0,1]];function P(n){return .5-.25*Math.min(1,n*.5)}Y.exports=function(n,a){var l=1,o;for(i(n,a),o=0;oy;o++)l=i(n,a,P(l));return l>y&&d.log("interp2d didn't converge quickly",l),n};function i(n,a,l){var o=0,u,s,h,m,b,x,_,A,f,k,w,D,E;for(m=0;mD&&(o=Math.max(o,Math.abs(n[s][h]-w)/(E-D))))}return o}}),B8=Fe((te,Y)=>{var d=ji().maxRowLength;Y.exports=function(y){var z=[],P={},i=[],n=y[0],a=[],l=[0,0,0],o=d(y),u,s,h,m,b,x,_,A;for(s=0;s=0;b--)m=i[b],s=m[0],h=m[1],x=((P[[s-1,h]]||l)[2]+(P[[s+1,h]]||l)[2]+(P[[s,h-1]]||l)[2]+(P[[s,h+1]]||l)[2])/20,x&&(_[m]=[s,h,x],i.splice(b,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(m in _)P[m]=_[m],z.push(_[m])}return z.sort(function(f,k){return k[2]-f[2]})}}),NL=Fe((te,Y)=>{var d=as(),y=ji().isArrayOrTypedArray;Y.exports=function(z,P,i,n,a,l){var o=[],u=d.traceIs(z,"contour"),s=d.traceIs(z,"histogram"),h,m,b,x=y(P)&&P.length>1;if(x&&!s&&l.type!=="category"){var _=P.length;if(_<=a){if(u)o=Array.from(P).slice(0,a);else if(a===1)l.type==="log"?o=[.5*P[0],2*P[0]]:o=[P[0]-.5,P[0]+.5];else if(l.type==="log"){for(o=[Math.pow(P[0],1.5)/Math.pow(P[1],.5)],b=1;b<_;b++)o.push(Math.sqrt(P[b-1]*P[b]));o.push(Math.pow(P[_-1],1.5)/Math.pow(P[_-2],.5))}else{for(o=[1.5*P[0]-.5*P[1]],b=1;b<_;b++)o.push((P[b-1]+P[b])*.5);o.push(1.5*P[_-1]-.5*P[_-2])}if(_{var d=as(),y=ji(),z=Os(),P=Dm(),i=Cq(),n=kp(),a=D8(),l=z8(),o=O8(),u=B8(),s=NL(),h=ti().BADNUM;Y.exports=function(x,_){var A=z.getFromId(x,_.xaxis||"x"),f=z.getFromId(x,_.yaxis||"y"),k=d.traceIs(_,"contour"),w=d.traceIs(_,"histogram"),D=k?"best":_.zsmooth,E,I,M,p,g,C,T,N,B,U,V;if(A._minDtick=0,f._minDtick=0,w)V=i(x,_),p=V.orig_x,E=V.x,I=V.x0,M=V.dx,N=V.orig_y,g=V.y,C=V.y0,T=V.dy,B=V.z;else{var W=_.z;y.isArray1D(W)?(a(_,A,f,"x","y",["z"]),E=_._x,g=_._y,W=_._z):(p=_.x?A.makeCalcdata(_,"x"):[],N=_.y?f.makeCalcdata(_,"y"):[],E=P(_,A,"x",p).vals,g=P(_,f,"y",N).vals,_._x=E,_._y=g),I=_.x0,M=_.dx,C=_.y0,T=_.dy,B=l(W,_,A,f)}(A.rangebreaks||f.rangebreaks)&&(B=b(E,g,B),w||(E=m(E),g=m(g),_._x=E,_._y=g)),!w&&(k||_.connectgaps)&&(_._emptypoints=u(B),o(B,_._emptypoints));function F(re){D=_._input.zsmooth=_.zsmooth=!1,y.warn('cannot use zsmooth: "fast": '+re)}function $(re){if(re.length>1){var ge=(re[re.length-1]-re[0])/(re.length-1),ne=Math.abs(ge/100);for(U=0;Une)return!1}return!0}_._islinear=!1,A.type==="log"||f.type==="log"?D==="fast"&&F("log axis found"):$(E)?$(g)?_._islinear=!0:D==="fast"&&F("y scale is not linear"):D==="fast"&&F("x scale is not linear");var q=y.maxRowLength(B),G=_.xtype==="scaled"?"":E,ee=s(_,G,I,M,q,A),he=_.ytype==="scaled"?"":g,xe=s(_,he,C,T,B.length,f);_._extremes[A._id]=z.findExtremes(A,ee),_._extremes[f._id]=z.findExtremes(f,xe);var ve={x:ee,y:xe,z:B,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&p&&(ve.orig_x=p),_.yperiodalignment&&N&&(ve.orig_y=N),G&&G.length===ee.length-1&&(ve.xCenter=G),he&&he.length===xe.length-1&&(ve.yCenter=he),w&&(ve.xRanges=V.xRanges,ve.yRanges=V.yRanges,ve.pts=V.pts),k||n(x,_,{vals:B,cLetter:"z"}),k&&_.contours&&_.contours.coloring==="heatmap"){var ce={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};ve.xfill=s(ce,G,I,M,q,A),ve.yfill=s(ce,he,C,T,B.length,f)}return[ve]};function m(x){for(var _=[],A=x.length,f=0;f{te.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],te.STYLE=te.CSS_DECLARATIONS.map(function(Y){return Y.join(": ")+"; "}).join("")}),jL=Fe((te,Y)=>{var d=F8(),y=Zs(),z=ji(),P=null;function i(){if(P!==null)return P;P=!1;var n=z.isSafari()||z.isMacWKWebView()||z.isIOS();if(window.navigator.userAgent&&!n){var a=Array.from(d.CSS_DECLARATIONS).reverse(),l=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof l=="function")P=a.some(function(h){return l.apply(null,h)});else{var o=y.tester.append("image").attr("style",d.STYLE),u=window.getComputedStyle(o.node()),s=u.imageRendering;P=a.some(function(h){var m=h[1];return s===m||s===m.toLowerCase()}),o.remove()}}return P}Y.exports=i}),N8=Fe((te,Y)=>{var d=ii(),y=sn(),z=as(),P=Zs(),i=Os(),n=ji(),a=cc(),l=Ys(),o=Xi(),u=lh().extractOpts,s=lh().makeColorScaleFuncFromTrace,h=k0(),m=Bf(),b=m.LINE_SPACING,x=jL(),_=F8().STYLE,A="heatmap-label";function f(I){return I.selectAll("g."+A)}function k(I){f(I).remove()}Y.exports=function(I,M,p,g){var C=M.xaxis,T=M.yaxis;n.makeTraceGroups(g,p,"hm").each(function(N){var B=d.select(this),U=N[0],V=U.trace,W=V.xgap||0,F=V.ygap||0,$=U.z,q=U.x,G=U.y,ee=U.xCenter,he=U.yCenter,xe=z.traceIs(V,"contour"),ve=xe?"best":V.zsmooth,ce=$.length,re=n.maxRowLength($),ge=!1,ne=!1,se,_e,oe,J,me,fe,Ce,Be;for(fe=0;se===void 0&&fe0;)_e=C.c2p(q[fe]),fe--;for(_e0;)me=T.c2p(G[fe]),fe--;me=C._length||_e<=0||J>=T._length||me<=0;if(_t){var pt=B.selectAll("image").data([]);pt.exit().remove(),k(B);return}var gt,ct;Oe==="fast"?(gt=re,ct=ce):(gt=Ge,ct=rt);var Ae=document.createElement("canvas");Ae.width=gt,Ae.height=ct;var ze=Ae.getContext("2d",{willReadFrequently:!0}),Ee=s(V,{noNumericCheck:!0,returnArray:!0}),nt,xt;Oe==="fast"?(nt=ge?function(dn){return re-1-dn}:n.identity,xt=ne?function(dn){return ce-1-dn}:n.identity):(nt=function(dn){return n.constrain(Math.round(C.c2p(q[dn])-se),0,Ge)},xt=function(dn){return n.constrain(Math.round(T.c2p(G[dn])-J),0,rt)});var ut=xt(0),Et=[ut,ut],Gt=ge?0:1,Jt=ne?0:1,gr=0,mr=0,Kr=0,ri=0,Mr,ui,mi,Ot,Je;function ot(dn,Ua){if(dn!==void 0){var ea=Ee(dn);return ea[0]=Math.round(ea[0]),ea[1]=Math.round(ea[1]),ea[2]=Math.round(ea[2]),gr+=Ua,mr+=ea[0]*Ua,Kr+=ea[1]*Ua,ri+=ea[2]*Ua,ea}return[0,0,0,0]}function De(dn,Ua,ea,fo){var ho=dn[ea.bin0];if(ho===void 0)return ot(void 0,1);var Vo=dn[ea.bin1],Ao=Ua[ea.bin0],Wo=Ua[ea.bin1],Wa=Vo-ho||0,ks=Ao-ho||0,fs;return Vo===void 0?Wo===void 0?fs=0:Ao===void 0?fs=2*(Wo-ho):fs=(2*Wo-Ao-ho)*2/3:Wo===void 0?Ao===void 0?fs=0:fs=(2*ho-Vo-Ao)*2/3:Ao===void 0?fs=(2*Wo-Vo-ho)*2/3:fs=Wo+ho-Vo-Ao,ot(ho+ea.frac*Wa+fo.frac*(ks+ea.frac*fs))}if(Oe!=="default"){var ye=0,Pe;try{Pe=new Uint8Array(gt*ct*4)}catch{Pe=new Array(gt*ct*4)}if(Oe==="smooth"){var He=ee||q,at=he||G,ht=new Array(He.length),At=new Array(at.length),Wt=new Array(Ge),Kt=ee?D:w,hr=he?D:w,zr,Dr,br;for(fe=0;feRn||Rn>T._length))for(Ce=qi;CeXn||Xn>C._length)){var sa=l({x:Gn,y:En},V,I._fullLayout);sa.x=Gn,sa.y=En;var Mn=U.z[fe][Ce];Mn===void 0?(sa.z="",sa.zLabel=""):(sa.z=Mn,sa.zLabel=i.tickText(Zt,Mn,"hover").text);var Ha=U.text&&U.text[fe]&&U.text[fe][Ce];(Ha===void 0||Ha===!1)&&(Ha=""),sa.text=Ha;var ro=n.texttemplateString({data:[sa,V._meta],fallback:V.texttemplatefallback,labels:sa,locale:I._fullLayout._d3locale,template:ga});if(ro){var Ft=ro.split("
"),Rt=Ft.length,qr=0;for(Be=0;Be{Y.exports={min:"zmin",max:"zmax"}}),j8=Fe((te,Y)=>{var d=ii();Y.exports=function(y){d.select(y).selectAll(".hm image").style("opacity",function(z){return z.trace.opacity})}}),U8=Fe((te,Y)=>{var d=hf(),y=ji(),z=y.isArrayOrTypedArray,P=Os(),i=lh().extractOpts;Y.exports=function(n,a,l,o,u){u||(u={});var s=u.isContour,h=n.cd[0],m=h.trace,b=n.xa,x=n.ya,_=h.x,A=h.y,f=h.z,k=h.xCenter,w=h.yCenter,D=h.zmask,E=m.zhoverformat,I=_,M=A,p,g,C,T;if(n.index!==!1){try{C=Math.round(n.index[1]),T=Math.round(n.index[0])}catch{y.error("Error hovering on heatmap, pointNumber must be [row,col], found:",n.index);return}if(C<0||C>=f[0].length||T<0||T>f.length)return}else{if(d.inbox(a-_[0],a-_[_.length-1],0)>0||d.inbox(l-A[0],l-A[A.length-1],0)>0)return;if(s){var N;for(I=[2*_[0]-_[1]],N=1;N<_.length;N++)I.push((_[N]+_[N-1])/2);for(I.push([2*_[_.length-1]-_[_.length-2]]),M=[2*A[0]-A[1]],N=1;N{Y.exports={attributes:Ew(),supplyDefaults:Sq(),calc:R8(),plot:N8(),colorbar:E_(),style:j8(),hoverPoints:U8(),moduleType:"trace",name:"heatmap",basePlotModule:Rf(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),Mq=Fe((te,Y)=>{Y.exports=Aq()}),UL=Fe((te,Y)=>{Y.exports=function(d,y){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),Eq=Fe((te,Y)=>{Y.exports={eventDataKeys:["binNumber"]}}),$8=Fe((te,Y)=>{var d=Jv(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=zn(),a=UL(),l=Eq(),o=an().extendFlat;Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:y("x"),yhoverformat:y("y"),text:o({},d.text,{}),hovertext:o({},d.hovertext,{}),orientation:d.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:a("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:a("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:i(),texttemplate:P({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:i({editType:"plot"}),textposition:o({},d.textposition,{arrayOk:!1}),textfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:d.insidetextanchor,textangle:d.textangle,cliponaxis:d.cliponaxis,constraintext:d.constraintext,marker:d.marker,offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:d.selected,unselected:d.unselected,zorder:d.zorder}}),Lq=Fe((te,Y)=>{var d=as(),y=ji(),z=Xi(),P=eg().handleText,i=C8(),n=$8();Y.exports=function(a,l,o,u){function s(M,p){return y.coerce(a,l,n,M,p)}var h=s("x"),m=s("y"),b=s("cumulative.enabled");b&&(s("cumulative.direction"),s("cumulative.currentbin")),s("text");var x=s("textposition");P(a,l,u,s,x,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("xhoverformat"),s("yhoverformat");var _=s("orientation",m&&!h?"h":"v"),A=_==="v"?"x":"y",f=_==="v"?"y":"x",k=h&&m?Math.min(y.minRowLength(h)&&y.minRowLength(m)):y.minRowLength(l[A]||[]);if(!k){l.visible=!1;return}l._length=k;var w=d.getComponentMethod("calendars","handleTraceDefaults");w(a,l,["x","y"],u);var D=l[f];D&&s("histfunc"),s("histnorm"),s("autobin"+A),i(a,l,s,o,u),y.coerceSelectionMarkerOpacity(l,s);var E=(l.marker.line||{}).color,I=d.getComponentMethod("errorbars","supplyDefaults");I(a,l,E||z.defaultLine,{axis:"y"}),I(a,l,E||z.defaultLine,{axis:"x",inherit:"y"}),s("zorder")}}),H8=Fe((te,Y)=>{var d=ji(),y=Zc(),z=as().traceIs,P=Xv(),i=eg().validateCornerradius,n=d.nestedProperty,a=ey().getAxisGroup,l=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],o=["x","y"];Y.exports=function(u,s){var h=s._histogramBinOpts={},m=[],b={},x=[],_,A,f,k,w,D,E;function I(xe,ve){return d.coerce(_._input,_,_._module.attributes,xe,ve)}function M(xe){return xe.orientation==="v"?"x":"y"}function p(xe,ve){var ce=y.getFromTrace({_fullLayout:s},xe,ve);return ce.type}function g(xe,ve,ce){var re=xe.uid+"__"+ce;ve||(ve=re);var ge=p(xe,ce),ne=xe[ce+"calendar"]||"",se=h[ve],_e=!0;se&&(ge===se.axType&&ne===se.calendar?(_e=!1,se.traces.push(xe),se.dirs.push(ce)):(ve=re,ge!==se.axType&&d.warn(["Attempted to group the bins of trace",xe.index,"set on a","type:"+ge,"axis","with bins on","type:"+se.axType,"axis."].join(" ")),ne!==se.calendar&&d.warn(["Attempted to group the bins of trace",xe.index,"set with a",ne,"calendar","with bins",se.calendar?"on a "+se.calendar+" calendar":"w/o a set calendar"].join(" ")))),_e&&(h[ve]={traces:[xe],dirs:[ce],axType:ge,calendar:xe[ce+"calendar"]||""}),xe["_"+ce+"bingroup"]=ve}for(w=0;w{var d=Aw().hoverPoints,y=Os().hoverLabelText;Y.exports=function(z,P,i,n,a){var l=d(z,P,i,n,a);if(l){z=l[0];var o=z.cd[z.index],u=z.cd[0].trace;if(!u.cumulative.enabled){var s=u.orientation==="h"?"y":"x";z[s+"Label"]=y(z[s+"a"],[o.ph0,o.ph1],u[s+"hoverformat"])}return l}}}),$L=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){if(d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"zLabelVal"in y&&(d.z=y.zLabelVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),!(z.cumulative||{}).enabled){var n=Array.isArray(i)?P[0].pts[i[0]][i[1]]:P[i].pts;d.pointNumbers=n,d.binNumber=d.pointNumber,delete d.pointNumber,delete d.pointIndex;var a;if(z._indexToPoints){a=[];for(var l=0;l{Y.exports={attributes:$8(),layoutAttributes:S8(),supplyDefaults:Lq(),crossTraceDefaults:H8(),supplyLayoutDefaults:EL(),calc:FL().calc,crossTraceCalc:jr().crossTraceCalc,plot:mb().plot,layerName:"barlayer",style:Lg().style,styleOnSelect:Lg().styleOnSelect,colorbar:Mo(),hoverPoints:Pq(),selectPoints:Mw(),eventData:$L(),moduleType:"trace",name:"histogram",basePlotModule:Rf(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Dq=Fe((te,Y)=>{Y.exports=Iq()}),V8=Fe((te,Y)=>{var d=$8(),y=UL(),z=Ew(),P=_a(),i=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:a,templatefallbackAttrs:l}=rc(),o=zc(),u=an().extendFlat;Y.exports=u({x:d.x,y:d.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:y("x"),nbinsy:d.nbinsy,ybins:y("y"),autobinx:d.autobinx,autobiny:d.autobiny,bingroup:u({},d.bingroup,{}),xbingroup:u({},d.bingroup,{}),ybingroup:u({},d.bingroup,{}),xgap:z.xgap,ygap:z.ygap,zsmooth:z.zsmooth,xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z",1),hovertemplate:n({},{keys:["z"]}),hovertemplatefallback:l(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:l({editType:"plot"}),textfont:z.textfont,showlegend:u({},P.showlegend,{dflt:!1})},o("",{cLetter:"z",autoColorDflt:!1}))}),HL=Fe((te,Y)=>{var d=as(),y=ji();Y.exports=function(z,P,i,n){var a=i("x"),l=i("y"),o=y.minRowLength(a),u=y.minRowLength(l);if(!o||!u){P.visible=!1;return}P._length=Math.min(o,u);var s=d.getComponentMethod("calendars","handleTraceDefaults");s(z,P,["x","y"],n);var h=i("z")||i("marker.color");h&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")}}),zq=Fe((te,Y)=>{var d=ji(),y=HL(),z=DL(),P=Cc(),i=G4(),n=V8();Y.exports=function(a,l,o,u){function s(h,m){return d.coerce(a,l,n,h,m)}y(a,l,s,u),l.visible!==!1&&(z(a,l,s,u),P(a,l,u,s,{prefix:"",cLetter:"z"}),s("hovertemplate"),s("hovertemplatefallback"),i(s,u),s("xhoverformat"),s("yhoverformat"))}}),Oq=Fe((te,Y)=>{var d=U8(),y=Os().hoverLabelText;Y.exports=function(z,P,i,n,a){var l=d(z,P,i,n,a);if(l){z=l[0];var o=z.index,u=o[0],s=o[1],h=z.cd[0],m=h.trace,b=h.xRanges[s],x=h.yRanges[u];return z.xLabel=y(z.xa,[b[0],b[1]],m.xhoverformat),z.yLabel=y(z.ya,[x[0],x[1]],m.yhoverformat),l}}}),Bq=Fe((te,Y)=>{Y.exports={attributes:V8(),supplyDefaults:zq(),crossTraceDefaults:H8(),calc:R8(),plot:N8(),layerName:"heatmaplayer",colorbar:E_(),style:j8(),hoverPoints:Oq(),eventData:$L(),moduleType:"trace",name:"histogram2d",basePlotModule:Rf(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),Rq=Fe((te,Y)=>{Y.exports=Bq()}),W8=Fe((te,Y)=>{Y.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Z4=Fe((te,Y)=>{var d=Ew(),y=ff(),z=Sh(),P=z.axisHoverFormat,i=z.descriptionOnlyNumbers,n=zc(),a=Wd().dash,l=zn(),o=an().extendFlat,u=W8(),s=u.COMPARISON_OPS2,h=u.INTERVAL_OPS,m=y.line;Y.exports=o({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:o({},d.texttemplate,{}),texttemplatefallback:d.texttemplatefallback,textfont:o({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:o({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:i("contour label")},operation:{valType:"enumerated",values:[].concat(s).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:o({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:a,smoothing:o({},m.smoothing,{}),editType:"plot"},zorder:y.zorder},n("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),VL=Fe((te,Y)=>{var d=V8(),y=Z4(),z=zc(),P=Sh().axisHoverFormat,i=an().extendFlat;Y.exports=i({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:y.autocontour,ncontours:y.ncontours,contours:y.contours,line:{color:y.line.color,width:i({},y.line.width,{dflt:.5}),dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:y.texttemplate,texttemplatefallback:y.texttemplatefallback,textfont:y.textfont},z("",{cLetter:"z",editTypeOverride:"calc"}))}),q8=Fe((te,Y)=>{Y.exports=function(d,y,z,P){var i=P("contours.start"),n=P("contours.end"),a=i===!1||n===!1,l=z("contours.size"),o;a?o=y.autocontour=!0:o=z("autocontour",!1),(o||!l)&&z("ncontours")}}),WL=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z,P,i){i||(i={});var n=y("contours.showlabels");if(n){var a=z.font;d.coerceFont(y,"contours.labelfont",a,{overrideDflt:{color:P}}),y("contours.labelformat")}i.hasHover!==!1&&y("zhoverformat")}}),G8=Fe((te,Y)=>{var d=Cc(),y=WL();Y.exports=function(z,P,i,n,a){var l=i("contours.coloring"),o,u="";l==="fill"&&(o=i("contours.showlines")),o!==!1&&(l!=="lines"&&(u=i("line.color","#000")),i("line.width",.5),i("line.dash")),l!=="none"&&(z.showlegend!==!0&&(P.showlegend=!1),P._dfltShowLegend=!1,d(z,P,n,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),y(i,n,u,a)}}),Fq=Fe((te,Y)=>{var d=ji(),y=HL(),z=q8(),P=G8(),i=G4(),n=VL();Y.exports=function(a,l,o,u){function s(m,b){return d.coerce(a,l,n,m,b)}function h(m){return d.coerce2(a,l,n,m)}y(a,l,s,u),l.visible!==!1&&(z(a,l,s,h),P(a,l,s,u),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),l.contours&&l.contours.coloring==="heatmap"&&i(s,u))}}),qL=Fe((te,Y)=>{var d=Os(),y=ji();Y.exports=function(P,i){var n=P.contours;if(P.autocontour){var a=P.zmin,l=P.zmax;(P.zauto||a===void 0)&&(a=y.aggNums(Math.min,null,i)),(P.zauto||l===void 0)&&(l=y.aggNums(Math.max,null,i));var o=z(a,l,P.ncontours);n.size=o.dtick,n.start=d.tickFirst(o),o.range.reverse(),n.end=d.tickFirst(o),n.start===a&&(n.start+=n.size),n.end===l&&(n.end-=n.size),n.start>n.end&&(n.start=n.end=(n.start+n.end)/2),P._input.contours||(P._input.contours={}),y.extendFlat(P._input.contours,{start:n.start,end:n.end,size:n.size}),P._input.autocontour=!0}else if(n.type!=="constraint"){var u=n.start,s=n.end,h=P._input.contours;if(u>s&&(n.start=h.start=s,s=n.end=h.end=u,u=n.start),!(n.size>0)){var m;u===s?m=1:m=z(u,s,P.ncontours).dtick,h.size=n.size=m}}};function z(P,i,n){var a={type:"linear",range:[P,i]};return d.autoTicks(a,(i-P)/(n||15)),a}}),K4=Fe((te,Y)=>{Y.exports=function(d){return d.end+d.size/1e6}}),GL=Fe((te,Y)=>{var d=lh(),y=R8(),z=qL(),P=K4();Y.exports=function(i,n){var a=y(i,n),l=a[0].z;z(n,l);var o=n.contours,u=d.extractOpts(n),s;if(o.coloring==="heatmap"&&u.auto&&n.autocontour===!1){var h=o.start,m=P(o),b=o.size||1,x=Math.floor((m-h)/b)+1;isFinite(b)||(b=1,x=1);var _=h-b/2,A=_+x*b;s=[_,A]}else s=l;return d.calc(i,n,{vals:s,cLetter:"z"}),a}}),Y4=Fe((te,Y)=>{Y.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),ZL=Fe((te,Y)=>{var d=Y4();Y.exports=function(z){var P=z[0].z,i=P.length,n=P[0].length,a=i===2||n===2,l,o,u,s,h,m,b,x,_;for(o=0;oz?0:1)+(P[0][1]>z?0:2)+(P[1][1]>z?0:4)+(P[1][0]>z?0:8);if(i===5||i===10){var n=(P[0][0]+P[0][1]+P[1][0]+P[1][1])/4;return z>n?i===5?713:1114:i===5?104:208}return i===15?0:i}}),KL=Fe((te,Y)=>{var d=ji(),y=Y4();Y.exports=function(l,o,u){var s,h,m,b,x;for(o=o||.01,u=u||.01,m=0;m20?(b=y.CHOOSESADDLE[b][(x[0]||x[1])<0?0:1],l.crossings[m]=y.SADDLEREMAINDER[b]):delete l.crossings[m],x=y.NEWDELTA[b],!x){d.log("Found bad marching index:",b,o,l.level);break}_.push(a(l,o,x)),o[0]+=x[0],o[1]+=x[1],m=o.join(","),z(_[_.length-1],_[_.length-2],s,h)&&_.pop();var E=x[0]&&(o[0]<0||o[0]>f-2)||x[1]&&(o[1]<0||o[1]>A-2),I=o[0]===k[0]&&o[1]===k[1]&&x[0]===w[0]&&x[1]===w[1];if(I||u&&E)break;b=l.crossings[m]}D===1e4&&d.log("Infinite loop in contour?");var M=z(_[0],_[_.length-1],s,h),p=0,g=.2*l.smoothing,C=[],T=0,N,B,U,V,W,F,$,q,G,ee,he;for(D=1;D<_.length;D++)$=P(_[D],_[D-1]),p+=$,C.push($);var xe=p/C.length*g;function ve(ge){return _[ge%_.length]}for(D=_.length-2;D>=T;D--)if(N=C[D],N=T&&N+C[B]q&&G--,l.edgepaths[G]=he.concat(_,ee));break}re||(l.edgepaths[q]=_.concat(ee))}for(q=0;q20&&o?l===208||l===1114?s=u[0]===0?1:-1:h=u[1]===0?1:-1:y.BOTTOMSTART.indexOf(l)!==-1?h=1:y.LEFTSTART.indexOf(l)!==-1?s=1:y.TOPSTART.indexOf(l)!==-1?h=-1:s=-1,[s,h]}function a(l,o,u){var s=o[0]+Math.max(u[0],0),h=o[1]+Math.max(u[1],0),m=l.z[h][s],b=l.xaxis,x=l.yaxis;if(u[1]){var _=(l.level-m)/(l.z[h][s+1]-m),A=(_!==1?(1-_)*b.c2l(l.x[s]):0)+(_!==0?_*b.c2l(l.x[s+1]):0);return[b.c2p(b.l2c(A),!0),x.c2p(l.y[h],!0),s+_,h]}else{var f=(l.level-m)/(l.z[h+1][s]-m),k=(f!==1?(1-f)*x.c2l(l.y[h]):0)+(f!==0?f*x.c2l(l.y[h+1]):0);return[b.c2p(l.x[s],!0),x.c2p(x.l2c(k),!0),s,h+f]}}}),Nq=Fe((te,Y)=>{var d=W8(),y=Ar();Y.exports={"[]":P("[]"),"][":P("]["),">":i(">"),"<":i("<"),"=":i("=")};function z(n,a){var l=Array.isArray(a),o;function u(s){return y(s)?+s:null}return d.COMPARISON_OPS2.indexOf(n)!==-1?o=u(l?a[0]:a):d.INTERVAL_OPS.indexOf(n)!==-1?o=l?[u(a[0]),u(a[1])]:[u(a),u(a)]:d.SET_OPS.indexOf(n)!==-1&&(o=l?a.map(u):[u(a)]),o}function P(n){return function(a){a=z(n,a);var l=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);return{start:l,end:o,size:o-l}}}function i(n){return function(a){return a=z(n,a),{start:a,end:1/0,size:1/0}}}}),YL=Fe((te,Y)=>{var d=ji(),y=Nq(),z=K4();Y.exports=function(P,i,n){for(var a=P.type==="constraint"?y[P._operation](P.value):P,l=a.size,o=[],u=z(a),s=n.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:n.a,y:n.b}:{xaxis:i.xaxis,yaxis:i.yaxis,x:n.x,y:n.y},m=a.start;m1e3){d.warn("Too many contours, clipping at 1000",P);break}return o}}),XL=Fe((te,Y)=>{var d=ji();Y.exports=function(z,P){var i,n,a,l=function(s){return s.reverse()},o=function(s){return s};switch(P){case"=":case"<":return z;case">":for(z.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),n=z[0],i=0;i{Y.exports=function(d,y){var z=d[0],P=z.z,i;switch(y.type){case"levels":var n=Math.min(P[0][0],P[0][1]);for(i=0;ia.level||a.starts.length&&n===a.level)}break;case"constraint":if(z.prefixBoundary=!1,z.edgepaths.length)return;var l=z.x.length,o=z.y.length,u=-1/0,s=1/0;for(i=0;i":h>u&&(z.prefixBoundary=!0);break;case"<":(hu||z.starts.length&&b===s)&&(z.prefixBoundary=!0);break;case"][":m=Math.min(h[0],h[1]),b=Math.max(h[0],h[1]),mu&&(z.prefixBoundary=!0);break}break}}}),Z8=Fe(te=>{var Y=ii(),d=ji(),y=Zs(),z=lh(),P=cc(),i=Os(),n=Z0(),a=N8(),l=ZL(),o=KL(),u=YL(),s=XL(),h=JL(),m=Y4(),b=m.LABELOPTIMIZER;te.plot=function(E,I,M,p){var g=I.xaxis,C=I.yaxis;d.makeTraceGroups(p,M,"contour").each(function(T){var N=Y.select(this),B=T[0],U=B.trace,V=B.x,W=B.y,F=U.contours,$=u(F,I,B),q=d.ensureSingle(N,"g","heatmapcoloring"),G=[];F.coloring==="heatmap"&&(G=[T]),a(E,I,G,q),l($),o($);var ee=g.c2p(V[0],!0),he=g.c2p(V[V.length-1],!0),xe=C.c2p(W[0],!0),ve=C.c2p(W[W.length-1],!0),ce=[[ee,ve],[he,ve],[he,xe],[ee,xe]],re=$;F.type==="constraint"&&(re=s($,F._operation)),x(N,ce,F),_(N,re,ce,F),f(N,$,E,B,F),w(N,I,E,B,ce)})};function x(E,I,M){var p=d.ensureSingle(E,"g","contourbg"),g=p.selectAll("path").data(M.coloring==="fill"?[0]:[]);g.enter().append("path"),g.exit().remove(),g.attr("d","M"+I.join("L")+"Z").style("stroke","none")}function _(E,I,M,p){var g=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",C="M"+M.join("L")+"Z";g&&h(I,p);var T=d.ensureSingle(E,"g","contourfill"),N=T.selectAll("path").data(g?I:[]);N.enter().append("path"),N.exit().remove(),N.each(function(B){var U=(B.prefixBoundary?C:"")+A(B,M);U?Y.select(this).attr("d",U).style("stroke","none"):Y.select(this).remove()})}function A(E,I){var M="",p=0,g=E.edgepaths.map(function(he,xe){return xe}),C=!0,T,N,B,U,V,W;function F(he){return Math.abs(he[1]-I[0][1])<.01}function $(he){return Math.abs(he[1]-I[2][1])<.01}function q(he){return Math.abs(he[0]-I[0][0])<.01}function G(he){return Math.abs(he[0]-I[2][0])<.01}for(;g.length;){for(W=y.smoothopen(E.edgepaths[p],E.smoothing),M+=C?W:W.replace(/^M/,"L"),g.splice(g.indexOf(p),1),T=E.edgepaths[p][E.edgepaths[p].length-1],U=-1,B=0;B<4;B++){if(!T){d.log("Missing end?",p,E);break}for(F(T)&&!G(T)?N=I[1]:q(T)?N=I[0]:$(T)?N=I[3]:G(T)&&(N=I[2]),V=0;V=0&&(N=ee,U=V):Math.abs(T[1]-N[1])<.01?Math.abs(T[1]-ee[1])<.01&&(ee[0]-T[0])*(N[0]-ee[0])>=0&&(N=ee,U=V):d.log("endpt to newendpt is not vert. or horz.",T,N,ee)}if(T=N,U>=0)break;M+="L"+N}if(U===E.edgepaths.length){d.log("unclosed perimeter path");break}p=U,C=g.indexOf(p)===-1,C&&(p=g[0],M+="Z")}for(p=0;pb.MAXCOST*2)break;F&&(N/=2),T=U-N/2,B=T+N*1.5}if(W<=b.MAXCOST)return V};function k(E,I,M,p){var g=I.width/2,C=I.height/2,T=E.x,N=E.y,B=E.theta,U=Math.cos(B)*g,V=Math.sin(B)*g,W=(T>p.center?p.right-T:T-p.left)/(U+Math.abs(Math.sin(B)*C)),F=(N>p.middle?p.bottom-N:N-p.top)/(Math.abs(V)+Math.cos(B)*C);if(W<1||F<1)return 1/0;var $=b.EDGECOST*(1/(W-1)+1/(F-1));$+=b.ANGLECOST*B*B;for(var q=T-U,G=N-V,ee=T+U,he=N+V,xe=0;xe{var d=ii(),y=lh(),z=K4();Y.exports=function(P){var i=P.contours,n=i.start,a=z(i),l=i.size||1,o=Math.floor((a-n)/l)+1,u=i.coloring==="lines"?0:1,s=y.extractOpts(P);isFinite(l)||(l=1,o=1);var h=s.reversescale?y.flipScale(s.colorscale):s.colorscale,m=h.length,b=new Array(m),x=new Array(m),_,A,f=s.min,k=s.max;if(i.coloring==="heatmap"){for(A=0;A=k)&&(n<=f&&(n=f),a>=k&&(a=k),o=Math.floor((a-n)/l)+1,u=0),A=0;Af&&(b.unshift(f),x.unshift(x[0])),b[b.length-1]{var d=ii(),y=Zs(),z=j8(),P=QL();Y.exports=function(i){var n=d.select(i).selectAll("g.contour");n.style("opacity",function(a){return a[0].trace.opacity}),n.each(function(a){var l=d.select(this),o=a[0].trace,u=o.contours,s=o.line,h=u.size||1,m=u.start,b=u.type==="constraint",x=!b&&u.coloring==="lines",_=!b&&u.coloring==="fill",A=x||_?P(o):null;l.selectAll("g.contourlevel").each(function(w){d.select(this).selectAll("path").call(y.lineGroupStyle,s.width,x?A(w.level):s.color,s.dash)});var f=u.labelfont;if(l.selectAll("g.contourlabels text").each(function(w){y.font(d.select(this),{weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow,family:f.family,size:f.size,color:f.color||(x?A(w.level):s.color)})}),b)l.selectAll("g.contourfill path").style("fill",o.fillcolor);else if(_){var k;l.selectAll("g.contourfill path").style("fill",function(w){return k===void 0&&(k=w.level),A(w.level+.5*h)}),k===void 0&&(k=m),l.selectAll("g.contourbg path").style("fill",A(k-.5*h))}}),z(i)}}),Y8=Fe((te,Y)=>{var d=lh(),y=QL(),z=K4();function P(i,n,a){var l=n.contours,o=n.line,u=l.size||1,s=l.coloring,h=y(n,{isColorbar:!0});if(s==="heatmap"){var m=d.extractOpts(n);a._fillgradient=m.reversescale?d.flipScale(m.colorscale):m.colorscale,a._zrange=[m.min,m.max]}else s==="fill"&&(a._fillcolor=h);a._line={color:s==="lines"?h:o.color,width:l.showlines!==!1?o.width:0,dash:o.dash},a._levels={start:l.start,end:z(l),size:u}}Y.exports={min:"zmin",max:"zmax",calc:P}}),eP=Fe((te,Y)=>{var d=Xi(),y=U8();Y.exports=function(z,P,i,n,a){a||(a={}),a.isContour=!0;var l=y(z,P,i,n,a);return l&&l.forEach(function(o){var u=o.trace;u.contours.type==="constraint"&&(u.fillcolor&&d.opacity(u.fillcolor)?o.color=d.addOpacity(u.fillcolor,1):u.contours.showlines&&d.opacity(u.line.color)&&(o.color=d.addOpacity(u.line.color,1)))}),l}}),jq=Fe((te,Y)=>{Y.exports={attributes:VL(),supplyDefaults:Fq(),crossTraceDefaults:H8(),calc:GL(),plot:Z8().plot,layerName:"contourlayer",style:K8(),colorbar:Y8(),hoverPoints:eP(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Rf(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),Uq=Fe((te,Y)=>{Y.exports=jq()}),tP=Fe((te,Y)=>{var d=Ar(),y=WL(),z=Xi(),P=z.addOpacity,i=z.opacity,n=W8(),a=ji().isArrayOrTypedArray,l=n.CONSTRAINT_REDUCTION,o=n.COMPARISON_OPS2;Y.exports=function(s,h,m,b,x,_){var A=h.contours,f,k,w,D=m("contours.operation");if(A._operation=l[D],u(m,A),D==="="?f=A.showlines=!0:(f=m("contours.showlines"),w=m("fillcolor",P((s.line||{}).color||x,.5))),f){var E=w&&i(w)?P(h.fillcolor,1):x;k=m("line.color",E),m("line.width",2),m("line.dash")}m("line.smoothing"),y(m,b,k,_)};function u(s,h){var m;o.indexOf(h.operation)===-1?(s("contours.value",[0,1]),a(h.value)?h.value.length>2?h.value=h.value.slice(2):h.length===0?h.value=[0,1]:h.length<2?(m=parseFloat(h.value[0]),h.value=[m,m+1]):h.value=[parseFloat(h.value[0]),parseFloat(h.value[1])]:d(h.value)&&(m=parseFloat(h.value),h.value=[m,m+1])):(s("contours.value",0),d(h.value)||(a(h.value)?h.value=parseFloat(h.value[0]):h.value=0))}}),$q=Fe((te,Y)=>{var d=ji(),y=I8(),z=S0(),P=tP(),i=q8(),n=G8(),a=G4(),l=Z4();Y.exports=function(o,u,s,h){function m(A,f){return d.coerce(o,u,l,A,f)}function b(A){return d.coerce2(o,u,l,A)}var x=y(o,u,m,h);if(!x){u.visible=!1;return}z(o,u,h,m),m("xhoverformat"),m("yhoverformat"),m("text"),m("hovertext"),m("hoverongaps"),m("hovertemplate"),m("hovertemplatefallback");var _=m("contours.type")==="constraint";m("connectgaps",d.isArray1D(u.z)),_?P(o,u,m,h,s):(i(o,u,m,b),n(o,u,m,h)),u.contours&&u.contours.coloring==="heatmap"&&a(m,h),m("zorder")}}),Hq=Fe((te,Y)=>{Y.exports={attributes:Z4(),supplyDefaults:$q(),calc:GL(),plot:Z8().plot,style:K8(),colorbar:Y8(),hoverPoints:eP(),moduleType:"trace",name:"contour",basePlotModule:Rf(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),Vq=Fe((te,Y)=>{Y.exports=Hq()}),rP=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=ff(),n=_a(),a=zc(),l=Wd().dash,o=an().extendFlat,u=i.marker,s=i.line,h=u.line;Y.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},i.mode,{dflt:"markers"}),text:o({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},i.hovertext,{}),line:{color:s.color,width:s.width,dash:l,backoff:s.backoff,shape:o({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:o({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:P(),marker:o({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:o({width:h.width,editType:"calc"},a("marker.line")),gradient:u.gradient,editType:"calc"},a("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:o({},n.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:d(),hovertemplatefallback:z()}}),Wq=Fe((te,Y)=>{var d=ji(),y=Mg(),z=Oc(),P=X0(),i=Pm(),n=ry(),a=mm(),l=Im(),o=rP();Y.exports=function(u,s,h,m){function b(D,E){return d.coerce(u,s,o,D,E)}var x=b("a"),_=b("b"),A=b("c"),f;if(x?(f=x.length,_?(f=Math.min(f,_.length),A&&(f=Math.min(f,A.length))):A?f=Math.min(f,A.length):f=0):_&&A&&(f=Math.min(_.length,A.length)),!f){s.visible=!1;return}s._length=f,b("sum"),b("text"),b("hovertext"),s.hoveron!=="fills"&&(b("hovertemplate"),b("hovertemplatefallback"));var k=f{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot;return i.aLabel=d.tickText(n.aaxis,y.a,!0).text,i.bLabel=d.tickText(n.baxis,y.b,!0).text,i.cLabel=d.tickText(n.caxis,y.c,!0).text,i}}),Gq=Fe((te,Y)=>{var d=Ar(),y=zm(),z=de(),P=$e(),i=yt().calcMarkerSize,n=["a","b","c"],a={a:["b","c"],b:["a","c"],c:["a","b"]};Y.exports=function(l,o){var u=l._fullLayout[o.subplot],s=u.sum,h=o.sum||s,m={a:o.a,b:o.b,c:o.c},b=o.ids,x,_,A,f,k,w;for(x=0;x{var d=uo();Y.exports=function(y,z,P){var i=z.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var n=z.xaxis,a=z.yaxis,l={xaxis:n,yaxis:a,plot:i,layerClipId:z._hasClipOnAxisFalse?z.clipIdRelative:null},o=z.layers.frontplot.select("g.scatterlayer"),u=0;u{var d=Zd();Y.exports=function(y,z,P,i){var n=d(y,z,P,i);if(!n||n[0].index===!1)return;var a=n[0];if(a.index===void 0){var l=1-a.y0/y.ya._length,o=y.xa._length,u=o*l/2,s=o-u;return a.x0=Math.max(Math.min(a.x0,s),u),a.x1=Math.max(Math.min(a.x1,s),u),n}var h=a.cd[a.index],m=a.trace,b=a.subplot;a.a=h.a,a.b=h.b,a.c=h.c,a.xLabelVal=void 0,a.yLabelVal=void 0;var x={};x[m.subplot]={_subplot:b};var _=m._module.formatLabels(h,m,x);a.aLabel=_.aLabel,a.bLabel=_.bLabel,a.cLabel=_.cLabel;var A=h.hi||m.hoverinfo,f=[];function k(D,E){f.push(D._hovertitle+": "+E)}if(!m.hovertemplate){var w=A.split("+");w.indexOf("all")!==-1&&(w=["a","b","c"]),w.indexOf("a")!==-1&&k(b.aaxis,a.aLabel),w.indexOf("b")!==-1&&k(b.baxis,a.bLabel),w.indexOf("c")!==-1&&k(b.caxis,a.cLabel)}return a.extraText=f.join("
"),a.hovertemplate=m.hovertemplate,n}}),Yq=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){if(y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),P[i]){var n=P[i];d.a=n.a,d.b=n.b,d.c=n.c}else d.a=y.a,d.b=y.b,d.c=y.c;return d}}),Xq=Fe((te,Y)=>{var d=ii(),y=sn(),z=as(),P=ji(),i=P.strTranslate,n=P._,a=Xi(),l=Zs(),o=Z0(),u=an().extendFlat,s=sh(),h=Os(),m=Np(),b=hf(),x=dm(),_=x.freeMode,A=x.rectMode,f=Fp(),k=Mf().prepSelect,w=Mf().selectOnClick,D=Mf().clearOutline,E=Mf().clearSelectionsCache,I=dc();function M($,q){this.id=$.id,this.graphDiv=$.graphDiv,this.init(q),this.makeFramework(q),this.updateFx(q),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}Y.exports=M;var p=M.prototype;p.init=function($){this.container=$._ternarylayer,this.defs=$._defs,this.layoutId=$._uid,this.traceHash={},this.layers={}},p.plot=function($,q){var G=this,ee=q[G.id],he=q._size;G._hasClipOnAxisFalse=!1;for(var xe=0;xe<$.length;xe++){var ve=$[xe][0].trace;if(ve.cliponaxis===!1){G._hasClipOnAxisFalse=!0;break}}G.updateLayers(ee),G.adjustLayout(ee,he),s.generalUpdatePerTraceModule(G.graphDiv,G,$,ee),G.layers.plotbg.select("path").call(a.fill,ee.bgcolor)},p.makeFramework=function($){var q=this,G=q.graphDiv,ee=$[q.id],he=q.clipId="clip"+q.layoutId+q.id,xe=q.clipIdRelative="clip-relative"+q.layoutId+q.id;q.clipDef=P.ensureSingleById($._clips,"clipPath",he,function(ve){ve.append("path").attr("d","M0,0Z")}),q.clipDefRelative=P.ensureSingleById($._clips,"clipPath",xe,function(ve){ve.append("path").attr("d","M0,0Z")}),q.plotContainer=P.ensureSingle(q.container,"g",q.id),q.updateLayers(ee),l.setClipUrl(q.layers.backplot,he,G),l.setClipUrl(q.layers.grids,he,G)},p.updateFx=function($){$._ternarylayer.selectAll("g.toplevel").style("cursor",$.dragmode==="pan"?"move":"crosshair")},p.updateLayers=function($){var q=this,G=q.layers,ee=["draglayer","plotbg","backplot","grids"];$.aaxis.layer==="below traces"&&ee.push("aaxis","aline"),$.baxis.layer==="below traces"&&ee.push("baxis","bline"),$.caxis.layer==="below traces"&&ee.push("caxis","cline"),ee.push("frontplot"),$.aaxis.layer==="above traces"&&ee.push("aaxis","aline"),$.baxis.layer==="above traces"&&ee.push("baxis","bline"),$.caxis.layer==="above traces"&&ee.push("caxis","cline");var he=q.plotContainer.selectAll("g.toplevel").data(ee,String),xe=["agrid","bgrid","cgrid"];he.enter().append("g").attr("class",function(ve){return"toplevel "+ve}).each(function(ve){var ce=d.select(this);G[ve]=ce,ve==="frontplot"?ce.append("g").classed("scatterlayer",!0):ve==="backplot"?ce.append("g").classed("maplayer",!0):ve==="plotbg"?ce.append("path").attr("d","M0,0Z"):ve==="aline"||ve==="bline"||ve==="cline"?ce.append("path"):ve==="grids"&&xe.forEach(function(re){G[re]=ce.append("g").classed("grid "+re,!0)})}),he.order()};var g=Math.sqrt(4/3);p.adjustLayout=function($,q){var G=this,ee=$.domain,he=(ee.x[0]+ee.x[1])/2,xe=(ee.y[0]+ee.y[1])/2,ve=ee.x[1]-ee.x[0],ce=ee.y[1]-ee.y[0],re=ve*q.w,ge=ce*q.h,ne=$.sum,se=$.aaxis.min,_e=$.baxis.min,oe=$.caxis.min,J,me,fe,Ce,Be,Oe;re>g*ge?(Ce=ge,fe=Ce*g):(fe=re,Ce=fe/g),Be=ve*fe/re,Oe=ce*Ce/ge,J=q.l+q.w*he-fe/2,me=q.t+q.h*(1-xe)-Ce/2,G.x0=J,G.y0=me,G.w=fe,G.h=Ce,G.sum=ne,G.xaxis={type:"linear",range:[se+2*oe-ne,ne-se-2*_e],domain:[he-Be/2,he+Be/2],_id:"x"},o(G.xaxis,G.graphDiv._fullLayout),G.xaxis.setScale(),G.xaxis.isPtWithinRange=function(nt){return nt.a>=G.aaxis.range[0]&&nt.a<=G.aaxis.range[1]&&nt.b>=G.baxis.range[1]&&nt.b<=G.baxis.range[0]&&nt.c>=G.caxis.range[1]&&nt.c<=G.caxis.range[0]},G.yaxis={type:"linear",range:[se,ne-_e-oe],domain:[xe-Oe/2,xe+Oe/2],_id:"y"},o(G.yaxis,G.graphDiv._fullLayout),G.yaxis.setScale(),G.yaxis.isPtWithinRange=function(){return!0};var Ze=G.yaxis.domain[0],Ge=G.aaxis=u({},$.aaxis,{range:[se,ne-_e-oe],side:"left",tickangle:(+$.aaxis.tickangle||0)-30,domain:[Ze,Ze+Oe*g],anchor:"free",position:0,_id:"y",_length:fe});o(Ge,G.graphDiv._fullLayout),Ge.setScale();var rt=G.baxis=u({},$.baxis,{range:[ne-se-oe,_e],side:"bottom",domain:G.xaxis.domain,anchor:"free",position:0,_id:"x",_length:fe});o(rt,G.graphDiv._fullLayout),rt.setScale();var _t=G.caxis=u({},$.caxis,{range:[ne-se-_e,oe],side:"right",tickangle:(+$.caxis.tickangle||0)+30,domain:[Ze,Ze+Oe*g],anchor:"free",position:0,_id:"y",_length:fe});o(_t,G.graphDiv._fullLayout),_t.setScale();var pt="M"+J+","+(me+Ce)+"h"+fe+"l-"+fe/2+",-"+Ce+"Z";G.clipDef.select("path").attr("d",pt),G.layers.plotbg.select("path").attr("d",pt);var gt="M0,"+Ce+"h"+fe+"l-"+fe/2+",-"+Ce+"Z";G.clipDefRelative.select("path").attr("d",gt);var ct=i(J,me);G.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ct),G.clipDefRelative.select("path").attr("transform",null);var Ae=i(J-rt._offset,me+Ce);G.layers.baxis.attr("transform",Ae),G.layers.bgrid.attr("transform",Ae);var ze=i(J+fe/2,me)+"rotate(30)"+i(0,-Ge._offset);G.layers.aaxis.attr("transform",ze),G.layers.agrid.attr("transform",ze);var Ee=i(J+fe/2,me)+"rotate(-30)"+i(0,-_t._offset);G.layers.caxis.attr("transform",Ee),G.layers.cgrid.attr("transform",Ee),G.drawAxes(!0),G.layers.aline.select("path").attr("d",Ge.showline?"M"+J+","+(me+Ce)+"l"+fe/2+",-"+Ce:"M0,0").call(a.stroke,Ge.linecolor||"#000").style("stroke-width",(Ge.linewidth||0)+"px"),G.layers.bline.select("path").attr("d",rt.showline?"M"+J+","+(me+Ce)+"h"+fe:"M0,0").call(a.stroke,rt.linecolor||"#000").style("stroke-width",(rt.linewidth||0)+"px"),G.layers.cline.select("path").attr("d",_t.showline?"M"+(J+fe/2)+","+me+"l"+fe/2+","+Ce:"M0,0").call(a.stroke,_t.linecolor||"#000").style("stroke-width",(_t.linewidth||0)+"px"),G.graphDiv._context.staticPlot||G.initInteractions(),l.setClipUrl(G.layers.frontplot,G._hasClipOnAxisFalse?null:G.clipId,G.graphDiv)},p.drawAxes=function($){var q=this,G=q.graphDiv,ee=q.id.substr(7)+"title",he=q.layers,xe=q.aaxis,ve=q.baxis,ce=q.caxis;if(q.drawAx(xe),q.drawAx(ve),q.drawAx(ce),$){var re=Math.max(xe.showticklabels?xe.tickfont.size/2:0,(ce.showticklabels?ce.tickfont.size*.75:0)+(ce.ticks==="outside"?ce.ticklen*.87:0)),ge=(ve.showticklabels?ve.tickfont.size:0)+(ve.ticks==="outside"?ve.ticklen:0)+3;he["a-title"]=f.draw(G,"a"+ee,{propContainer:xe,propName:q.id+".aaxis.title.text",placeholder:n(G,"Click to enter Component A title"),attributes:{x:q.x0+q.w/2,y:q.y0-xe.title.font.size/3-re,"text-anchor":"middle"}}),he["b-title"]=f.draw(G,"b"+ee,{propContainer:ve,propName:q.id+".baxis.title.text",placeholder:n(G,"Click to enter Component B title"),attributes:{x:q.x0-ge,y:q.y0+q.h+ve.title.font.size*.83+ge,"text-anchor":"middle"}}),he["c-title"]=f.draw(G,"c"+ee,{propContainer:ce,propName:q.id+".caxis.title.text",placeholder:n(G,"Click to enter Component C title"),attributes:{x:q.x0+q.w+ge,y:q.y0+q.h+ce.title.font.size*.83+ge,"text-anchor":"middle"}})}},p.drawAx=function($){var q=this,G=q.graphDiv,ee=$._name,he=ee.charAt(0),xe=$._id,ve=q.layers[ee],ce=30,re=he+"tickLayout",ge=C($);q[re]!==ge&&(ve.selectAll("."+xe+"tick").remove(),q[re]=ge),$.setScale();var ne=h.calcTicks($),se=h.clipEnds($,ne),_e=h.makeTransTickFn($),oe=h.getTickSigns($)[2],J=P.deg2rad(ce),me=oe*($.linewidth||1)/2,fe=oe*$.ticklen,Ce=q.w,Be=q.h,Oe=he==="b"?"M0,"+me+"l"+Math.sin(J)*fe+","+Math.cos(J)*fe:"M"+me+",0l"+Math.cos(J)*fe+","+-Math.sin(J)*fe,Ze={a:"M0,0l"+Be+",-"+Ce/2,b:"M0,0l-"+Ce/2+",-"+Be,c:"M0,0l-"+Be+","+Ce/2}[he];h.drawTicks(G,$,{vals:$.ticks==="inside"?se:ne,layer:ve,path:Oe,transFn:_e,crisp:!1}),h.drawGrid(G,$,{vals:se,layer:q.layers[he+"grid"],path:Ze,transFn:_e,crisp:!1}),h.drawLabels(G,$,{vals:ne,layer:ve,transFn:_e,labelFns:h.makeLabelFns($,0,ce)})};function C($){return $.ticks+String($.ticklen)+String($.showticklabels)}var T=I.MINZOOM/2+.87,N="m-0.87,.5h"+T+"v3h-"+(T+5.2)+"l"+(T/2+2.6)+",-"+(T*.87+4.5)+"l2.6,1.5l-"+T/2+","+T*.87+"Z",B="m0.87,.5h-"+T+"v3h"+(T+5.2)+"l-"+(T/2+2.6)+",-"+(T*.87+4.5)+"l-2.6,1.5l"+T/2+","+T*.87+"Z",U="m0,1l"+T/2+","+T*.87+"l2.6,-1.5l-"+(T/2+2.6)+",-"+(T*.87+4.5)+"l-"+(T/2+2.6)+","+(T*.87+4.5)+"l2.6,1.5l"+T/2+",-"+T*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",W=!0;p.clearOutline=function(){E(this.dragOptions),D(this.dragOptions.gd)},p.initInteractions=function(){var $=this,q=$.layers.plotbg.select("path").node(),G=$.graphDiv,ee=G._fullLayout._zoomlayer,he,xe;this.dragOptions={element:q,gd:G,plotinfo:{id:$.id,domain:G._fullLayout[$.id].domain,xaxis:$.xaxis,yaxis:$.yaxis},subplot:$.id,prepFn:function(Ae,ze,Ee){$.dragOptions.xaxes=[$.xaxis],$.dragOptions.yaxes=[$.yaxis],he=G._fullLayout._invScaleX,xe=G._fullLayout._invScaleY;var nt=$.dragOptions.dragmode=G._fullLayout.dragmode;_(nt)?$.dragOptions.minDrag=1:$.dragOptions.minDrag=void 0,nt==="zoom"?($.dragOptions.moveFn=rt,$.dragOptions.clickFn=Ce,$.dragOptions.doneFn=_t,Be(Ae,ze,Ee)):nt==="pan"?($.dragOptions.moveFn=gt,$.dragOptions.clickFn=Ce,$.dragOptions.doneFn=ct,pt(),$.clearOutline(G)):(A(nt)||_(nt))&&k(Ae,ze,Ee,$.dragOptions,nt)}};var ve,ce,re,ge,ne,se,_e,oe,J,me;function fe(Ae){var ze={};return ze[$.id+".aaxis.min"]=Ae.a,ze[$.id+".baxis.min"]=Ae.b,ze[$.id+".caxis.min"]=Ae.c,ze}function Ce(Ae,ze){var Ee=G._fullLayout.clickmode;F(G),Ae===2&&(G.emit("plotly_doubleclick",null),z.call("_guiRelayout",G,fe({a:0,b:0,c:0}))),Ee.indexOf("select")>-1&&Ae===1&&w(ze,G,[$.xaxis],[$.yaxis],$.id,$.dragOptions),Ee.indexOf("event")>-1&&b.click(G,ze,$.id)}function Be(Ae,ze,Ee){var nt=q.getBoundingClientRect();ve=ze-nt.left,ce=Ee-nt.top,G._fullLayout._calcInverseTransform(G);var xt=G._fullLayout._invTransform,ut=P.apply3DTransform(xt)(ve,ce);ve=ut[0],ce=ut[1],re={a:$.aaxis.range[0],b:$.baxis.range[1],c:$.caxis.range[1]},ne=re,ge=$.aaxis.range[1]-re.a,se=y($.graphDiv._fullLayout[$.id].bgcolor).getLuminance(),_e="M0,"+$.h+"L"+$.w/2+", 0L"+$.w+","+$.h+"Z",oe=!1,J=ee.append("path").attr("class","zoombox").attr("transform",i($.x0,$.y0)).style({fill:se>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",_e),me=ee.append("path").attr("class","zoombox-corners").attr("transform",i($.x0,$.y0)).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),$.clearOutline(G)}function Oe(Ae,ze){return 1-ze/$.h}function Ze(Ae,ze){return 1-(Ae+($.h-ze)/Math.sqrt(3))/$.w}function Ge(Ae,ze){return(Ae-($.h-ze)/Math.sqrt(3))/$.w}function rt(Ae,ze){var Ee=ve+Ae*he,nt=ce+ze*xe,xt=Math.max(0,Math.min(1,Oe(ve,ce),Oe(Ee,nt))),ut=Math.max(0,Math.min(1,Ze(ve,ce),Ze(Ee,nt))),Et=Math.max(0,Math.min(1,Ge(ve,ce),Ge(Ee,nt))),Gt=(xt/2+Et)*$.w,Jt=(1-xt/2-ut)*$.w,gr=(Gt+Jt)/2,mr=Jt-Gt,Kr=(1-xt)*$.h,ri=Kr-mr/g;mr.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),me.transition().style("opacity",1).duration(200),oe=!0),G.emit("plotly_relayouting",fe(ne))}function _t(){F(G),ne!==re&&(z.call("_guiRelayout",G,fe(ne)),W&&G.data&&G._context.showTips&&(P.notifier(n(G,"Double-click to zoom back out"),"long"),W=!1))}function pt(){re={a:$.aaxis.range[0],b:$.baxis.range[1],c:$.caxis.range[1]},ne=re}function gt(Ae,ze){var Ee=Ae/$.xaxis._m,nt=ze/$.yaxis._m;ne={a:re.a-nt,b:re.b+(Ee+nt)/2,c:re.c-(Ee-nt)/2};var xt=[ne.a,ne.b,ne.c].sort(P.sorterAsc),ut={a:xt.indexOf(ne.a),b:xt.indexOf(ne.b),c:xt.indexOf(ne.c)};xt[0]<0&&(xt[1]+xt[0]/2<0?(xt[2]+=xt[0]+xt[1],xt[0]=xt[1]=0):(xt[2]+=xt[0]/2,xt[1]+=xt[0]/2,xt[0]=0),ne={a:xt[ut.a],b:xt[ut.b],c:xt[ut.c]},ze=(re.a-ne.a)*$.yaxis._m,Ae=(re.c-ne.c-re.b+ne.b)*$.xaxis._m);var Et=i($.x0+Ae,$.y0+ze);$.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Et);var Gt=i(-Ae,-ze);$.clipDefRelative.select("path").attr("transform",Gt),$.aaxis.range=[ne.a,$.sum-ne.b-ne.c],$.baxis.range=[$.sum-ne.a-ne.c,ne.b],$.caxis.range=[$.sum-ne.a-ne.b,ne.c],$.drawAxes(!1),$._hasClipOnAxisFalse&&$.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,$),G.emit("plotly_relayouting",fe(ne))}function ct(){z.call("_guiRelayout",G,fe(ne))}q.onmousemove=function(Ae){b.hover(G,Ae,$.id),G._fullLayout._lasthover=q,G._fullLayout._hoversubplot=$.id},q.onmouseout=function(Ae){G._dragging||m.unhover(G,Ae)},m.init(this.dragOptions)};function F($){d.select($).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),iP=Fe((te,Y)=>{var d=Mi(),y=Xh().attributes,z=qd(),P=oh().overrideAll,i=an().extendFlat,n={title:{text:z.title.text,font:z.title.font},color:z.color,tickmode:z.minor.tickmode,nticks:i({},z.nticks,{dflt:6,min:1}),tick0:z.tick0,dtick:z.dtick,tickvals:z.tickvals,ticktext:z.ticktext,ticks:z.ticks,ticklen:z.ticklen,tickwidth:z.tickwidth,tickcolor:z.tickcolor,ticklabelstep:z.ticklabelstep,showticklabels:z.showticklabels,labelalias:z.labelalias,showtickprefix:z.showtickprefix,tickprefix:z.tickprefix,showticksuffix:z.showticksuffix,ticksuffix:z.ticksuffix,showexponent:z.showexponent,exponentformat:z.exponentformat,minexponent:z.minexponent,separatethousands:z.separatethousands,tickfont:z.tickfont,tickangle:z.tickangle,tickformat:z.tickformat,tickformatstops:z.tickformatstops,hoverformat:z.hoverformat,showline:i({},z.showline,{dflt:!0}),linecolor:z.linecolor,linewidth:z.linewidth,showgrid:i({},z.showgrid,{dflt:!0}),gridcolor:z.gridcolor,gridwidth:z.gridwidth,griddash:z.griddash,layer:z.layer,min:{valType:"number",dflt:0,min:0}},a=Y.exports=P({domain:y({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:n,baxis:n,caxis:n},"plot","from-root");a.uirevision={valType:"any",editType:"none"},a.aaxis.uirevision=a.baxis.uirevision=a.caxis.uirevision={valType:"any",editType:"none"}}),L_=Fe((te,Y)=>{var d=ji(),y=ku(),z=Xh().defaults;Y.exports=function(P,i,n,a){var l=a.type,o=a.attributes,u=a.handleDefaults,s=a.partition||"x",h=i._subplots[l],m=h.length,b=m&&h[0].replace(/\d+$/,""),x,_;function A(D,E){return d.coerce(x,_,o,D,E)}for(var f=0;f{var d=Xi(),y=ku(),z=ji(),P=L_(),i=G0(),n=Tg(),a=Uv(),l=jv(),o=hb(),u=iP(),s=["aaxis","baxis","caxis"];Y.exports=function(b,x,_){P(b,x,_,{type:"ternary",attributes:u,handleDefaults:h,font:x.font,paper_bgcolor:x.paper_bgcolor})};function h(b,x,_,A){var f=_("bgcolor"),k=_("sum");A.bgColor=d.combine(f,A.paper_bgcolor);for(var w,D,E,I=0;I=k&&(M.min=0,p.min=0,g.min=0,b.aaxis&&delete b.aaxis.min,b.baxis&&delete b.baxis.min,b.caxis&&delete b.caxis.min)}function m(b,x,_,A){var f=u[x._name];function k(C,T){return z.coerce(b,x,f,C,T)}k("uirevision",A.uirevision),x.type="linear";var w=k("color"),D=w!==f.color.dflt?w:_.font.color,E=x._name,I=E.charAt(0).toUpperCase(),M="Component "+I,p=k("title.text",M);x._hovertitle=p===M?p:I,z.coerceFont(k,"title.font",_.font,{overrideDflt:{size:z.bigFont(_.font.size),color:D}}),k("min"),l(b,x,k,"linear"),n(b,x,k,"linear"),i(b,x,k,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),a(b,x,k,{outerTicks:!0});var g=k("showticklabels");g&&(z.coerceFont(k,"tickfont",_.font,{overrideDflt:{color:D}}),k("tickangle"),k("tickformat")),o(b,x,k,{dfltColor:w,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:f}),k("hoverformat"),k("layer")}}),Qq=Fe(te=>{var Y=Xq(),d=Md().getSubplotCalcData,y=ji().counterRegex,z="ternary";te.name=z;var P=te.attr="subplot";te.idRoot=z,te.idRegex=te.attrRegex=y(z);var i=te.attributes={};i[P]={valType:"subplotid",dflt:"ternary",editType:"calc"},te.layoutAttributes=iP(),te.supplyLayoutDefaults=Jq(),te.plot=function(n){for(var a=n._fullLayout,l=n.calcdata,o=a._subplots[z],u=0;u{Y.exports={attributes:rP(),supplyDefaults:Wq(),colorbar:Mo(),formatLabels:qq(),calc:Gq(),plot:Zq(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Kq(),selectPoints:Jf(),eventData:Yq(),moduleType:"trace",name:"scatterternary",basePlotModule:Qq(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),tG=Fe((te,Y)=>{Y.exports=eG()}),nP=Fe((te,Y)=>{var d=V4(),y=an().extendFlat,z=Sh().axisHoverFormat;Y.exports={y:d.y,x:d.x,x0:d.x0,y0:d.y0,xhoverformat:z("x"),yhoverformat:z("y"),name:y({},d.name,{}),orientation:y({},d.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:d.fillcolor,points:y({},d.boxpoints,{}),jitter:y({},d.jitter,{}),pointpos:y({},d.pointpos,{}),width:y({},d.width,{}),marker:d.marker,text:d.text,hovertext:d.hovertext,hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,quartilemethod:d.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:d.selected,unselected:d.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:d.zorder}}),aP=Fe((te,Y)=>{var d=W4(),y=ji().extendFlat;Y.exports={violinmode:y({},d.boxmode,{}),violingap:y({},d.boxgap,{}),violingroupgap:y({},d.boxgroupgap,{})}}),rG=Fe((te,Y)=>{var d=ji(),y=Xi(),z=q4(),P=nP();Y.exports=function(i,n,a,l){function o(p,g){return d.coerce(i,n,P,p,g)}function u(p,g){return d.coerce2(i,n,P,p,g)}if(z.handleSampleDefaults(i,n,o,l),n.visible!==!1){o("bandwidth"),o("side");var s=o("width");s||(o("scalegroup",n.name),o("scalemode"));var h=o("span"),m;Array.isArray(h)&&(m="manual"),o("spanmode",m);var b=o("line.color",(i.marker||{}).color||a),x=o("line.width"),_=o("fillcolor",y.addOpacity(n.line.color,.5));z.handlePointsDefaults(i,n,o,{prefix:""});var A=u("box.width"),f=u("box.fillcolor",_),k=u("box.line.color",b),w=u("box.line.width",x),D=o("box.visible",!!(A||f||k||w));D||(n.box={visible:!1});var E=u("meanline.color",b),I=u("meanline.width",x),M=o("meanline.visible",!!(E||I));M||(n.meanline={visible:!1}),o("quartilemethod"),o("zorder")}}}),iG=Fe((te,Y)=>{var d=ji(),y=aP(),z=M8();Y.exports=function(P,i,n){function a(l,o){return d.coerce(P,i,y,l,o)}z._supply(P,i,n,a,"violin")}}),X8=Fe(te=>{var Y=ji(),d={gaussian:function(y){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*y*y)}};te.makeKDE=function(y,z,P){var i=P.length,n=d.gaussian,a=y.bandwidth,l=1/(i*a);return function(o){for(var u=0,s=0;s{var d=ji(),y=Os(),z=LL(),P=X8(),i=ti().BADNUM;Y.exports=function(o,u){var s=z(o,u);if(s[0].t.empty)return s;for(var h=o._fullLayout,m=y.getFromId(o,u[u.orientation==="h"?"xaxis":"yaxis"]),b=1/0,x=-1/0,_=0,A=0,f=0;f{var d=E8().setPositionOffset,y=["v","h"];Y.exports=function(z,P){for(var i=z.calcdata,n=P.xaxis,a=P.yaxis,l=0;l{var d=ii(),y=ji(),z=Zs(),P=L8(),i=ra(),n=X8();Y.exports=function(a,l,o,u){var s=a._context.staticPlot,h=a._fullLayout,m=l.xaxis,b=l.yaxis;function x(_,A){var f=i(_,{xaxis:m,yaxis:b,trace:A,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return z.smoothopen(f[0],1)}y.makeTraceGroups(u,o,"trace violins").each(function(_){var A=d.select(this),f=_[0],k=f.t,w=f.trace;if(w.visible!==!0||k.empty){A.remove();return}var D=k.bPos,E=k.bdPos,I=l[k.valLetter+"axis"],M=l[k.posLetter+"axis"],p=w.side==="both",g=p||w.side==="positive",C=p||w.side==="negative",T=A.selectAll("path.violin").data(y.identity);T.enter().append("path").style("vector-effect",s?"none":"non-scaling-stroke").attr("class","violin"),T.exit().remove(),T.each(function(q){var G=d.select(this),ee=q.density,he=ee.length,xe=M.c2l(q.pos+D,!0),ve=M.l2p(xe),ce;if(w.width)ce=k.maxKDE/E;else{var re=h._violinScaleGroupStats[w.scalegroup];ce=w.scalemode==="count"?re.maxKDE/E*(re.maxCount/q.pts.length):re.maxKDE/E}var ge,ne,se,_e,oe,J,me;if(g){for(J=new Array(he),_e=0;_e{var d=ii(),y=Xi(),z=El().stylePoints;Y.exports=function(P){var i=d.select(P).selectAll("g.trace.violins");i.style("opacity",function(n){return n[0].trace.opacity}),i.each(function(n){var a=n[0].trace,l=d.select(this),o=a.box||{},u=o.line||{},s=a.meanline||{},h=s.width;l.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(y.stroke,a.line.color).call(y.fill,a.fillcolor),l.selectAll("path.box").style("stroke-width",u.width+"px").call(y.stroke,u.color).call(y.fill,o.fillcolor);var m={"stroke-width":h+"px","stroke-dasharray":2*h+"px,"+h+"px"};l.selectAll("path.mean").style(m).call(y.stroke,s.color),l.selectAll("path.meanline").style(m).call(y.stroke,s.color),z(l,a,P)})}}),lG=Fe((te,Y)=>{var d=Xi(),y=ji(),z=Os(),P=PL(),i=X8();Y.exports=function(n,a,l,o,u){u||(u={});var s=u.hoverLayer,h=n.cd,m=h[0].trace,b=m.hoveron,x=b.indexOf("violins")!==-1,_=b.indexOf("kde")!==-1,A=[],f,k;if(x||_){var w=P.hoverOnBoxes(n,a,l,o);if(_&&w.length>0){var D=n.xa,E=n.ya,I,M,p,g,C;m.orientation==="h"?(C=a,I="y",p=E,M="x",g=D):(C=l,I="x",p=D,M="y",g=E);var T=h[n.index];if(C>=T.span[0]&&C<=T.span[1]){var N=y.extendFlat({},n),B=g.c2p(C,!0),U=i.getKdeValue(T,m,C),V=i.getPositionOnKdePath(T,m,B),W=p._offset,F=p._length;N[I+"0"]=V[0],N[I+"1"]=V[1],N[M+"0"]=N[M+"1"]=B,N[M+"Label"]=M+": "+z.hoverLabelText(g,C,m[M+"hoverformat"])+", "+h[0].t.labels.kde+" "+U.toFixed(3);for(var $=0,q=0;q{Y.exports={attributes:nP(),layoutAttributes:aP(),supplyDefaults:rG(),crossTraceDefaults:q4().crossTraceDefaults,supplyLayoutDefaults:iG(),calc:nG(),crossTraceCalc:aG(),plot:oG(),style:sG(),styleOnSelect:El().styleOnSelect,hoverPoints:lG(),selectPoints:IL(),moduleType:"trace",name:"violin",basePlotModule:Rf(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),cG=Fe((te,Y)=>{Y.exports=uG()}),hG=Fe((te,Y)=>{Y.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),oP=Fe((te,Y)=>{var d=Jv(),y=ff().line,z=_a(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=hG(),o=an().extendFlat,u=Xi();Y.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:d.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:o({},d.insidetextanchor,{dflt:"middle"}),textangle:o({},d.textangle,{dflt:0}),textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:o({},d.orientation,{}),offset:o({},d.offset,{arrayOk:!1}),width:o({},d.width,{arrayOk:!1}),marker:s(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:o({},y.color,{dflt:u.defaultLine}),width:o({},y.width,{dflt:0,editType:"plot"}),dash:y.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder};function s(){var h=o({},d.marker);return delete h.pattern,delete h.cornerradius,h}}),sP=Fe((te,Y)=>{Y.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),lP=Fe((te,Y)=>{var d=ji(),y=Xv(),z=eg().handleText,P=Jg(),i=S0(),n=oP(),a=Xi();function l(s,h,m,b){function x(E,I){return d.coerce(s,h,n,E,I)}var _=P(s,h,b,x);if(!_){h.visible=!1;return}i(s,h,b,x),x("xhoverformat"),x("yhoverformat"),x("orientation",h.y&&!h.x?"v":"h"),x("offset"),x("width");var A=x("text");x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var f=x("textposition");z(s,h,b,x,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&!h.texttemplate&&x("textinfo",d.isArrayOrTypedArray(A)?"text+value":"value");var k=x("marker.color",m);x("marker.line.color",a.defaultLine),x("marker.line.width");var w=x("connector.visible");if(w){x("connector.fillcolor",o(k));var D=x("connector.line.width");D&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function o(s){var h=d.isArrayOrTypedArray(s)?"#000":s;return a.addOpacity(h,.5*a.opacity(h))}function u(s,h){var m,b;function x(A){return d.coerce(b._input,b,n,A)}for(var _=0;_{var d=ji(),y=sP();Y.exports=function(z,P,i){var n=!1;function a(u,s){return d.coerce(z,P,y,u,s)}for(var l=0;l{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=Os(),y=Dm(),z=dG(),P=$e(),i=ti().BADNUM;Y.exports=function(a,l){var o=d.getFromId(a,l.xaxis||"x"),u=d.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A,f;l.orientation==="h"?(s=o.makeCalcdata(l,"x"),m=u.makeCalcdata(l,"y"),b=y(l,u,"y",m),x=!!l.yperiodalignment,_="y"):(s=u.makeCalcdata(l,"y"),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;var k=Math.min(h.length,s.length),w=new Array(k);for(l._base=[],A=0;A{var d=jr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,i=y._fullData,n=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],u=[],s=[],h,m;for(m=0;m{var d=ii(),y=ji(),z=Zs(),P=ti().BADNUM,i=mb(),n=C0().clearMinTextSize;Y.exports=function(u,s,h,m){var b=u._fullLayout;n("funnel",b),a(u,s,h,m),l(u,s,h,m),i.plot(u,s,h,m,{mode:b.funnelmode,norm:b.funnelmode,gap:b.funnelgap,groupgap:b.funnelgroupgap})};function a(u,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=d.select(this),f=_[0].trace,k=y.ensureSingle(A,"g","regions");if(!f.connector||!f.connector.visible){k.remove();return}var w=f.orientation==="h",D=k.selectAll("g.region").data(y.identity);D.enter().append("g").classed("region",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],T="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&g[2]!==P&&C[2]!==P&&g[3]!==P&&C[3]!==P&&(w?T+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2]+"H"+g[3]+"L"+g[1]+","+C[1]+"Z":T+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3]+"V"+C[2]+"L"+g[1]+","+C[0]+"Z"),T===""&&(T="M0,0Z"),y.ensureSingle(d.select(this),"path").attr("d",T).call(z.setClipUrl,s.layerClipId,u)}})})}function l(u,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=d.select(this),f=_[0].trace,k=y.ensureSingle(A,"g","lines");if(!f.connector||!f.connector.visible||!f.connector.line.width){k.remove();return}var w=f.orientation==="h",D=k.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],T="";g[3]!==void 0&&C[3]!==void 0&&(w?(T+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2],T+="M"+g[1]+","+C[1]+"L"+g[3]+","+C[2]):(T+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3],T+="M"+g[1]+","+C[0]+"L"+g[2]+","+C[2])),T===""&&(T="M0,0Z"),y.ensureSingle(d.select(this),"path").attr("d",T).call(z.setClipUrl,s.layerClipId,u)}})})}function o(u,s,h,m){var b=[],x=[],_=m?s:h,A=m?h:s;return b[0]=_.c2p(u.s0,!0),x[0]=A.c2p(u.p0,!0),b[1]=_.c2p(u.s1,!0),x[1]=A.c2p(u.p1,!0),b[2]=_.c2p(u.nextS0,!0),x[2]=A.c2p(u.nextP0,!0),b[3]=_.c2p(u.nextS1,!0),x[3]=A.c2p(u.nextP1,!0),m?[b,x]:[x,b]}}),vG=Fe((te,Y)=>{var d=ii(),y=Zs(),z=Xi(),P=oo().DESELECTDIM,i=Lg(),n=C0().resizeText,a=i.styleTextPoints;function l(o,u,s){var h=s||d.select(o).selectAll('g[class^="funnellayer"]').selectAll("g.trace");n(o,h,"funnel"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=d.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x.marker;d.select(this).call(z.fill,_.mc||A.color).call(z.stroke,_.mlc||A.line.color).call(y.dashLine,A.line.dash,_.mlw||A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(z.fill,x.connector.fillcolor)}),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(d.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),yG=Fe((te,Y)=>{var d=Xi().opacity,y=Aw().hoverOnBars,z=ji().formatPercent;Y.exports=function(i,n,a,l,o){var u=y(i,n,a,l,o);if(u){var s=u.cd,h=s[0].trace,m=h.orientation==="h",b=u.index,x=s[b],_=m?"x":"y";u[_+"LabelVal"]=x.s,u.percentInitial=x.begR,u.percentInitialLabel=z(x.begR,1),u.percentPrevious=x.difR,u.percentPreviousLabel=z(x.difR,1),u.percentTotal=x.sumR,u.percentTotalLabel=z(x.sumR,1);var A=x.hi||h.hoverinfo,f=[];if(A&&A!=="none"&&A!=="skip"){var k=A==="all",w=A.split("+"),D=function(E){return k||w.indexOf(E)!==-1};D("percent initial")&&f.push(u.percentInitialLabel+" of initial"),D("percent previous")&&f.push(u.percentPreviousLabel+" of previous"),D("percent total")&&f.push(u.percentTotalLabel+" of total")}return u.extraText=f.join("
"),u.color=P(h,x),[u]}};function P(i,n){var a=i.marker,l=n.mc||a.color,o=n.mlc||a.line.color,u=n.mlw||a.line.width;if(d(l))return l;if(d(o)&&u)return o}}),_G=Fe((te,Y)=>{Y.exports=function(d,y){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"percentInitial"in y&&(d.percentInitial=y.percentInitial),"percentPrevious"in y&&(d.percentPrevious=y.percentPrevious),"percentTotal"in y&&(d.percentTotal=y.percentTotal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),xG=Fe((te,Y)=>{Y.exports={attributes:oP(),layoutAttributes:sP(),supplyDefaults:lP().supplyDefaults,crossTraceDefaults:lP().crossTraceDefaults,supplyLayoutDefaults:fG(),calc:pG(),crossTraceCalc:mG(),plot:gG(),style:vG().style,hoverPoints:yG(),eventData:_G(),selectPoints:Mw(),moduleType:"trace",name:"funnel",basePlotModule:Rf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),bG=Fe((te,Y)=>{Y.exports=xG()}),wG=Fe((te,Y)=>{Y.exports={eventDataKeys:["initial","delta","final"]}}),uP=Fe((te,Y)=>{var d=Jv(),y=ff().line,z=_a(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=wG(),o=an().extendFlat,u=Xi();function s(h){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}Y.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:d.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),texttemplatefallback:a({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:s(),decreasing:s(),totals:s(),connector:{line:{color:o({},y.color,{dflt:u.defaultLine}),width:o({},y.width,{editType:"plot"}),dash:y.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}),cP=Fe((te,Y)=>{Y.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Lw=Fe((te,Y)=>{Y.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),hP=Fe((te,Y)=>{var d=ji(),y=Xv(),z=eg().handleText,P=Jg(),i=S0(),n=uP(),a=Xi(),l=Lw(),o=l.INCREASING.COLOR,u=l.DECREASING.COLOR,s="#4499FF";function h(x,_,A){x(_+".marker.color",A),x(_+".marker.line.color",a.defaultLine),x(_+".marker.line.width")}function m(x,_,A,f){function k(M,p){return d.coerce(x,_,n,M,p)}var w=P(x,_,f,k);if(!w){_.visible=!1;return}i(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("measure"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");z(x,_,f,k,D,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),_.textposition!=="none"&&(k("texttemplate"),k("texttemplatefallback"),_.texttemplate||k("textinfo")),h(k,"increasing",o),h(k,"decreasing",u),h(k,"totals",s);var E=k("connector.visible");if(E){k("connector.mode");var I=k("connector.line.width");I&&(k("connector.line.color"),k("connector.line.dash"))}k("zorder")}function b(x,_){var A,f;function k(D){return d.coerce(f._input,f,n,D)}if(_.waterfallmode==="group")for(var w=0;w{var d=ji(),y=cP();Y.exports=function(z,P,i){var n=!1;function a(u,s){return d.coerce(z,P,y,u,s)}for(var l=0;l{var d=Os(),y=Dm(),z=ji().mergeArray,P=$e(),i=ti().BADNUM;function n(l){return l==="a"||l==="absolute"}function a(l){return l==="t"||l==="total"}Y.exports=function(l,o){var u=d.getFromId(l,o.xaxis||"x"),s=d.getFromId(l,o.yaxis||"y"),h,m,b,x,_,A;o.orientation==="h"?(h=u.makeCalcdata(o,"x"),b=s.makeCalcdata(o,"y"),x=y(o,s,"y",b),_=!!o.yperiodalignment,A="y"):(h=s.makeCalcdata(o,"y"),b=u.makeCalcdata(o,"x"),x=y(o,u,"x",b),_=!!o.xperiodalignment,A="x"),m=x.vals;for(var f=Math.min(m.length,h.length),k=new Array(f),w=0,D,E=!1,I=0;I{var d=jr().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,i=y._fullData,n=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],u=[],s=[],h,m;for(m=0;m{var d=ii(),y=ji(),z=Zs(),P=ti().BADNUM,i=mb(),n=C0().clearMinTextSize;Y.exports=function(o,u,s,h){var m=o._fullLayout;n("waterfall",m),i.plot(o,u,s,h,{mode:m.waterfallmode,norm:m.waterfallmode,gap:m.waterfallgap,groupgap:m.waterfallgroupgap}),a(o,u,s,h)};function a(o,u,s,h){var m=u.xaxis,b=u.yaxis;y.makeTraceGroups(h,s,"trace bars").each(function(x){var _=d.select(this),A=x[0].trace,f=y.ensureSingle(_,"g","lines");if(!A.connector||!A.connector.visible){f.remove();return}var k=A.orientation==="h",w=A.connector.mode,D=f.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=l(I,m,b,k),g=p[0],C=p[1],T="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&(w==="spanning"&&!I.isSum&&M>0&&(k?T+="M"+g[0]+","+C[1]+"V"+C[0]:T+="M"+g[1]+","+C[0]+"H"+g[0]),w!=="between"&&(I.isSum||M{var d=ii(),y=Zs(),z=Xi(),P=oo().DESELECTDIM,i=Lg(),n=C0().resizeText,a=i.styleTextPoints;function l(o,u,s){var h=s||d.select(o).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");n(o,h,"waterfall"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=d.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x[_.dir].marker;d.select(this).call(z.fill,A.color).call(z.stroke,A.line.color).call(y.dashLine,A.line.dash,A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(d.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),MG=Fe((te,Y)=>{var d=Os().hoverLabelText,y=Xi().opacity,z=Aw().hoverOnBars,P=Lw(),i={increasing:P.INCREASING.SYMBOL,decreasing:P.DECREASING.SYMBOL};Y.exports=function(a,l,o,u,s){var h=z(a,l,o,u,s);if(!h)return;var m=h.cd,b=m[0].trace,x=b.orientation==="h",_=x?"x":"y",A=x?a.xa:a.ya;function f(T){return d(A,T,b[_+"hoverformat"])}var k=h.index,w=m[k],D=w.isSum?w.b+w.s:w.rawS;h.initial=w.b+w.s-D,h.delta=D,h.final=h.initial+h.delta;var E=f(Math.abs(h.delta));h.deltaLabel=D<0?"("+E+")":E,h.finalLabel=f(h.final),h.initialLabel=f(h.initial);var I=w.hi||b.hoverinfo,M=[];if(I&&I!=="none"&&I!=="skip"){var p=I==="all",g=I.split("+"),C=function(T){return p||g.indexOf(T)!==-1};w.isSum||(C("final")&&(x?!C("x"):!C("y"))&&M.push(h.finalLabel),C("delta")&&(D<0?M.push(h.deltaLabel+" "+i.decreasing):M.push(h.deltaLabel+" "+i.increasing)),C("initial")&&M.push("Initial: "+h.initialLabel))}return M.length&&(h.extraText=M.join("
")),h.color=n(b,w),[h]};function n(a,l){var o=a[l.dir].marker,u=o.color,s=o.line.color,h=o.line.width;if(y(u))return u;if(y(s)&&h)return s}}),EG=Fe((te,Y)=>{Y.exports=function(d,y){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"initial"in y&&(d.initial=y.initial),"delta"in y&&(d.delta=y.delta),"final"in y&&(d.final=y.final),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),LG=Fe((te,Y)=>{Y.exports={attributes:uP(),layoutAttributes:cP(),supplyDefaults:hP().supplyDefaults,crossTraceDefaults:hP().crossTraceDefaults,supplyLayoutDefaults:kG(),calc:TG(),crossTraceCalc:SG(),plot:CG(),style:AG().style,hoverPoints:MG(),eventData:EG(),selectPoints:Mw(),moduleType:"trace",name:"waterfall",basePlotModule:Rf(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),PG=Fe((te,Y)=>{Y.exports=LG()}),Pw=Fe((te,Y)=>{Y.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var y=d.slice(0,3);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var y=d.slice(0,4);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%",""]}}}}),fP=Fe((te,Y)=>{var d=_a(),y=ff().zorder,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=an().extendFlat,n=Pw().colormodel,a=["rgb","rgba","rgba256","hsl","hsla"],l=[],o=[];for(s=0;s{var d=ji(),y=fP(),z=Pw(),P=Y0().IMAGE_URL_PREFIX;Y.exports=function(i,n){function a(u,s){return d.coerce(i,n,y,u,s)}a("source"),n.source&&!n.source.match(P)&&delete n.source,n._hasSource=!!n.source;var l=a("z");if(n._hasZ=!(l===void 0||!l.length||!l[0]||!l[0].length),!n._hasZ&&!n._hasSource){n.visible=!1;return}a("x0"),a("y0"),a("dx"),a("dy");var o;n._hasZ?(a("colormodel","rgb"),o=z.colormodel[n.colormodel],a("zmin",o.zminDflt||o.min),a("zmax",o.zmaxDflt||o.max)):n._hasSource&&(n.colormodel="rgba256",o=z.colormodel[n.colormodel],n.zmin=o.zminDflt,n.zmax=o.zmaxDflt),a("zsmooth"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),n._length=null,a("zorder")}}),iy=Fe((te,Y)=>{typeof Object.create=="function"?Y.exports=function(d,y){y&&(d.super_=y,d.prototype=Object.create(y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}))}:Y.exports=function(d,y){if(y){d.super_=y;var z=function(){};z.prototype=y.prototype,d.prototype=new z,d.prototype.constructor=d}}}),dP=Fe((te,Y)=>{Y.exports=qg().EventEmitter}),DG=Fe(te=>{te.byteLength=a,te.toByteArray=o,te.fromByteArray=h;var Y=[],d=[],y=typeof Uint8Array<"u"?Uint8Array:Array,z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(P=0,i=z.length;P0)throw new Error("Invalid string. Length must be a multiple of 4");var x=m.indexOf("=");x===-1&&(x=b);var _=x===b?0:4-x%4;return[x,_]}function a(m){var b=n(m),x=b[0],_=b[1];return(x+_)*3/4-_}function l(m,b,x){return(b+x)*3/4-x}function o(m){var b,x=n(m),_=x[0],A=x[1],f=new y(l(m,_,A)),k=0,w=A>0?_-4:_,D;for(D=0;D>16&255,f[k++]=b>>8&255,f[k++]=b&255;return A===2&&(b=d[m.charCodeAt(D)]<<2|d[m.charCodeAt(D+1)]>>4,f[k++]=b&255),A===1&&(b=d[m.charCodeAt(D)]<<10|d[m.charCodeAt(D+1)]<<4|d[m.charCodeAt(D+2)]>>2,f[k++]=b>>8&255,f[k++]=b&255),f}function u(m){return Y[m>>18&63]+Y[m>>12&63]+Y[m>>6&63]+Y[m&63]}function s(m,b,x){for(var _,A=[],f=b;fw?w:k+f));return _===1?(b=m[x-1],A.push(Y[b>>2]+Y[b<<4&63]+"==")):_===2&&(b=(m[x-2]<<8)+m[x-1],A.push(Y[b>>10]+Y[b>>4&63]+Y[b<<2&63]+"=")),A.join("")}}),zG=Fe(te=>{te.read=function(Y,d,y,z,P){var i,n,a=P*8-z-1,l=(1<>1,u=-7,s=y?P-1:0,h=y?-1:1,m=Y[d+s];for(s+=h,i=m&(1<<-u)-1,m>>=-u,u+=a;u>0;i=i*256+Y[d+s],s+=h,u-=8);for(n=i&(1<<-u)-1,i>>=-u,u+=z;u>0;n=n*256+Y[d+s],s+=h,u-=8);if(i===0)i=1-o;else{if(i===l)return n?NaN:(m?-1:1)*(1/0);n=n+Math.pow(2,z),i=i-o}return(m?-1:1)*n*Math.pow(2,i-z)},te.write=function(Y,d,y,z,P,i){var n,a,l,o=i*8-P-1,u=(1<>1,h=P===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=z?0:i-1,b=z?1:-1,x=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(a=isNaN(d)?1:0,n=u):(n=Math.floor(Math.log(d)/Math.LN2),d*(l=Math.pow(2,-n))<1&&(n--,l*=2),n+s>=1?d+=h/l:d+=h*Math.pow(2,1-s),d*l>=2&&(n++,l/=2),n+s>=u?(a=0,n=u):n+s>=1?(a=(d*l-1)*Math.pow(2,P),n=n+s):(a=d*Math.pow(2,s-1)*Math.pow(2,P),n=0));P>=8;Y[y+m]=a&255,m+=b,a/=256,P-=8);for(n=n<0;Y[y+m]=n&255,m+=b,n/=256,o-=8);Y[y+m-b]|=x*128}}),gb=Fe(te=>{var Y=DG(),d=zG(),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;te.Buffer=n,te.SlowBuffer=A,te.INSPECT_MAX_BYTES=50;var z=2147483647;te.kMaxLength=z,n.TYPED_ARRAY_SUPPORT=P(),!n.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 P(){try{let Ae=new Uint8Array(1),ze={foo:function(){return 42}};return Object.setPrototypeOf(ze,Uint8Array.prototype),Object.setPrototypeOf(Ae,ze),Ae.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function i(Ae){if(Ae>z)throw new RangeError('The value "'+Ae+'" is invalid for option "size"');let ze=new Uint8Array(Ae);return Object.setPrototypeOf(ze,n.prototype),ze}function n(Ae,ze,Ee){if(typeof Ae=="number"){if(typeof ze=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(Ae)}return a(Ae,ze,Ee)}n.poolSize=8192;function a(Ae,ze,Ee){if(typeof Ae=="string")return s(Ae,ze);if(ArrayBuffer.isView(Ae))return m(Ae);if(Ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae);if(rt(Ae,ArrayBuffer)||Ae&&rt(Ae.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(rt(Ae,SharedArrayBuffer)||Ae&&rt(Ae.buffer,SharedArrayBuffer)))return b(Ae,ze,Ee);if(typeof Ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let nt=Ae.valueOf&&Ae.valueOf();if(nt!=null&&nt!==Ae)return n.from(nt,ze,Ee);let xt=x(Ae);if(xt)return xt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ae[Symbol.toPrimitive]=="function")return n.from(Ae[Symbol.toPrimitive]("string"),ze,Ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}n.from=function(Ae,ze,Ee){return a(Ae,ze,Ee)},Object.setPrototypeOf(n.prototype,Uint8Array.prototype),Object.setPrototypeOf(n,Uint8Array);function l(Ae){if(typeof Ae!="number")throw new TypeError('"size" argument must be of type number');if(Ae<0)throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}function o(Ae,ze,Ee){return l(Ae),Ae<=0?i(Ae):ze!==void 0?typeof Ee=="string"?i(Ae).fill(ze,Ee):i(Ae).fill(ze):i(Ae)}n.alloc=function(Ae,ze,Ee){return o(Ae,ze,Ee)};function u(Ae){return l(Ae),i(Ae<0?0:_(Ae)|0)}n.allocUnsafe=function(Ae){return u(Ae)},n.allocUnsafeSlow=function(Ae){return u(Ae)};function s(Ae,ze){if((typeof ze!="string"||ze==="")&&(ze="utf8"),!n.isEncoding(ze))throw new TypeError("Unknown encoding: "+ze);let Ee=f(Ae,ze)|0,nt=i(Ee),xt=nt.write(Ae,ze);return xt!==Ee&&(nt=nt.slice(0,xt)),nt}function h(Ae){let ze=Ae.length<0?0:_(Ae.length)|0,Ee=i(ze);for(let nt=0;nt=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return Ae|0}function A(Ae){return+Ae!=Ae&&(Ae=0),n.alloc(+Ae)}n.isBuffer=function(Ae){return Ae!=null&&Ae._isBuffer===!0&&Ae!==n.prototype},n.compare=function(Ae,ze){if(rt(Ae,Uint8Array)&&(Ae=n.from(Ae,Ae.offset,Ae.byteLength)),rt(ze,Uint8Array)&&(ze=n.from(ze,ze.offset,ze.byteLength)),!n.isBuffer(Ae)||!n.isBuffer(ze))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ae===ze)return 0;let Ee=Ae.length,nt=ze.length;for(let xt=0,ut=Math.min(Ee,nt);xtnt.length?(n.isBuffer(ut)||(ut=n.from(ut)),ut.copy(nt,xt)):Uint8Array.prototype.set.call(nt,ut,xt);else if(n.isBuffer(ut))ut.copy(nt,xt);else throw new TypeError('"list" argument must be an Array of Buffers');xt+=ut.length}return nt};function f(Ae,ze){if(n.isBuffer(Ae))return Ae.length;if(ArrayBuffer.isView(Ae)||rt(Ae,ArrayBuffer))return Ae.byteLength;if(typeof Ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ae);let Ee=Ae.length,nt=arguments.length>2&&arguments[2]===!0;if(!nt&&Ee===0)return 0;let xt=!1;for(;;)switch(ze){case"ascii":case"latin1":case"binary":return Ee;case"utf8":case"utf-8":return Ce(Ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee*2;case"hex":return Ee>>>1;case"base64":return Ze(Ae).length;default:if(xt)return nt?-1:Ce(Ae).length;ze=(""+ze).toLowerCase(),xt=!0}}n.byteLength=f;function k(Ae,ze,Ee){let nt=!1;if((ze===void 0||ze<0)&&(ze=0),ze>this.length||((Ee===void 0||Ee>this.length)&&(Ee=this.length),Ee<=0)||(Ee>>>=0,ze>>>=0,Ee<=ze))return"";for(Ae||(Ae="utf8");;)switch(Ae){case"hex":return F(this,ze,Ee);case"utf8":case"utf-8":return N(this,ze,Ee);case"ascii":return V(this,ze,Ee);case"latin1":case"binary":return W(this,ze,Ee);case"base64":return T(this,ze,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,ze,Ee);default:if(nt)throw new TypeError("Unknown encoding: "+Ae);Ae=(Ae+"").toLowerCase(),nt=!0}}n.prototype._isBuffer=!0;function w(Ae,ze,Ee){let nt=Ae[ze];Ae[ze]=Ae[Ee],Ae[Ee]=nt}n.prototype.swap16=function(){let Ae=this.length;if(Ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ze=0;zeze&&(Ae+=" ... "),""},y&&(n.prototype[y]=n.prototype.inspect),n.prototype.compare=function(Ae,ze,Ee,nt,xt){if(rt(Ae,Uint8Array)&&(Ae=n.from(Ae,Ae.offset,Ae.byteLength)),!n.isBuffer(Ae))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ae);if(ze===void 0&&(ze=0),Ee===void 0&&(Ee=Ae?Ae.length:0),nt===void 0&&(nt=0),xt===void 0&&(xt=this.length),ze<0||Ee>Ae.length||nt<0||xt>this.length)throw new RangeError("out of range index");if(nt>=xt&&ze>=Ee)return 0;if(nt>=xt)return-1;if(ze>=Ee)return 1;if(ze>>>=0,Ee>>>=0,nt>>>=0,xt>>>=0,this===Ae)return 0;let ut=xt-nt,Et=Ee-ze,Gt=Math.min(ut,Et),Jt=this.slice(nt,xt),gr=Ae.slice(ze,Ee);for(let mr=0;mr2147483647?Ee=2147483647:Ee<-2147483648&&(Ee=-2147483648),Ee=+Ee,_t(Ee)&&(Ee=xt?0:Ae.length-1),Ee<0&&(Ee=Ae.length+Ee),Ee>=Ae.length){if(xt)return-1;Ee=Ae.length-1}else if(Ee<0)if(xt)Ee=0;else return-1;if(typeof ze=="string"&&(ze=n.from(ze,nt)),n.isBuffer(ze))return ze.length===0?-1:E(Ae,ze,Ee,nt,xt);if(typeof ze=="number")return ze=ze&255,typeof Uint8Array.prototype.indexOf=="function"?xt?Uint8Array.prototype.indexOf.call(Ae,ze,Ee):Uint8Array.prototype.lastIndexOf.call(Ae,ze,Ee):E(Ae,[ze],Ee,nt,xt);throw new TypeError("val must be string, number or Buffer")}function E(Ae,ze,Ee,nt,xt){let ut=1,Et=Ae.length,Gt=ze.length;if(nt!==void 0&&(nt=String(nt).toLowerCase(),nt==="ucs2"||nt==="ucs-2"||nt==="utf16le"||nt==="utf-16le")){if(Ae.length<2||ze.length<2)return-1;ut=2,Et/=2,Gt/=2,Ee/=2}function Jt(mr,Kr){return ut===1?mr[Kr]:mr.readUInt16BE(Kr*ut)}let gr;if(xt){let mr=-1;for(gr=Ee;grEt&&(Ee=Et-Gt),gr=Ee;gr>=0;gr--){let mr=!0;for(let Kr=0;Krxt&&(nt=xt)):nt=xt;let ut=ze.length;nt>ut/2&&(nt=ut/2);let Et;for(Et=0;Et>>0,isFinite(Ee)?(Ee=Ee>>>0,nt===void 0&&(nt="utf8")):(nt=Ee,Ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let xt=this.length-ze;if((Ee===void 0||Ee>xt)&&(Ee=xt),Ae.length>0&&(Ee<0||ze<0)||ze>this.length)throw new RangeError("Attempt to write outside buffer bounds");nt||(nt="utf8");let ut=!1;for(;;)switch(nt){case"hex":return I(this,Ae,ze,Ee);case"utf8":case"utf-8":return M(this,Ae,ze,Ee);case"ascii":case"latin1":case"binary":return p(this,Ae,ze,Ee);case"base64":return g(this,Ae,ze,Ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Ae,ze,Ee);default:if(ut)throw new TypeError("Unknown encoding: "+nt);nt=(""+nt).toLowerCase(),ut=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(Ae,ze,Ee){return ze===0&&Ee===Ae.length?Y.fromByteArray(Ae):Y.fromByteArray(Ae.slice(ze,Ee))}function N(Ae,ze,Ee){Ee=Math.min(Ae.length,Ee);let nt=[],xt=ze;for(;xt239?4:ut>223?3:ut>191?2:1;if(xt+Gt<=Ee){let Jt,gr,mr,Kr;switch(Gt){case 1:ut<128&&(Et=ut);break;case 2:Jt=Ae[xt+1],(Jt&192)===128&&(Kr=(ut&31)<<6|Jt&63,Kr>127&&(Et=Kr));break;case 3:Jt=Ae[xt+1],gr=Ae[xt+2],(Jt&192)===128&&(gr&192)===128&&(Kr=(ut&15)<<12|(Jt&63)<<6|gr&63,Kr>2047&&(Kr<55296||Kr>57343)&&(Et=Kr));break;case 4:Jt=Ae[xt+1],gr=Ae[xt+2],mr=Ae[xt+3],(Jt&192)===128&&(gr&192)===128&&(mr&192)===128&&(Kr=(ut&15)<<18|(Jt&63)<<12|(gr&63)<<6|mr&63,Kr>65535&&Kr<1114112&&(Et=Kr))}}Et===null?(Et=65533,Gt=1):Et>65535&&(Et-=65536,nt.push(Et>>>10&1023|55296),Et=56320|Et&1023),nt.push(Et),xt+=Gt}return U(nt)}var B=4096;function U(Ae){let ze=Ae.length;if(ze<=B)return String.fromCharCode.apply(String,Ae);let Ee="",nt=0;for(;ntnt)&&(Ee=nt);let xt="";for(let ut=ze;utEe&&(Ae=Ee),ze<0?(ze+=Ee,ze<0&&(ze=0)):ze>Ee&&(ze=Ee),zeEe)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(Ae,ze,Ee){Ae=Ae>>>0,ze=ze>>>0,Ee||q(Ae,ze,this.length);let nt=this[Ae],xt=1,ut=0;for(;++ut>>0,ze=ze>>>0,Ee||q(Ae,ze,this.length);let nt=this[Ae+--ze],xt=1;for(;ze>0&&(xt*=256);)nt+=this[Ae+--ze]*xt;return nt},n.prototype.readUint8=n.prototype.readUInt8=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,1,this.length),this[Ae]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,2,this.length),this[Ae]|this[Ae+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,2,this.length),this[Ae]<<8|this[Ae+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,4,this.length),(this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16)+this[Ae+3]*16777216},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,4,this.length),this[Ae]*16777216+(this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3])},n.prototype.readBigUInt64LE=gt(function(Ae){Ae=Ae>>>0,oe(Ae,"offset");let ze=this[Ae],Ee=this[Ae+7];(ze===void 0||Ee===void 0)&&J(Ae,this.length-8);let nt=ze+this[++Ae]*2**8+this[++Ae]*2**16+this[++Ae]*2**24,xt=this[++Ae]+this[++Ae]*2**8+this[++Ae]*2**16+Ee*2**24;return BigInt(nt)+(BigInt(xt)<>>0,oe(Ae,"offset");let ze=this[Ae],Ee=this[Ae+7];(ze===void 0||Ee===void 0)&&J(Ae,this.length-8);let nt=ze*2**24+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae],xt=this[++Ae]*2**24+this[++Ae]*2**16+this[++Ae]*2**8+Ee;return(BigInt(nt)<>>0,ze=ze>>>0,Ee||q(Ae,ze,this.length);let nt=this[Ae],xt=1,ut=0;for(;++ut=xt&&(nt-=Math.pow(2,8*ze)),nt},n.prototype.readIntBE=function(Ae,ze,Ee){Ae=Ae>>>0,ze=ze>>>0,Ee||q(Ae,ze,this.length);let nt=ze,xt=1,ut=this[Ae+--nt];for(;nt>0&&(xt*=256);)ut+=this[Ae+--nt]*xt;return xt*=128,ut>=xt&&(ut-=Math.pow(2,8*ze)),ut},n.prototype.readInt8=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,1,this.length),this[Ae]&128?(255-this[Ae]+1)*-1:this[Ae]},n.prototype.readInt16LE=function(Ae,ze){Ae=Ae>>>0,ze||q(Ae,2,this.length);let Ee=this[Ae]|this[Ae+1]<<8;return Ee&32768?Ee|4294901760:Ee},n.prototype.readInt16BE=function(Ae,ze){Ae=Ae>>>0,ze||q(Ae,2,this.length);let Ee=this[Ae+1]|this[Ae]<<8;return Ee&32768?Ee|4294901760:Ee},n.prototype.readInt32LE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,4,this.length),this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16|this[Ae+3]<<24},n.prototype.readInt32BE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,4,this.length),this[Ae]<<24|this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3]},n.prototype.readBigInt64LE=gt(function(Ae){Ae=Ae>>>0,oe(Ae,"offset");let ze=this[Ae],Ee=this[Ae+7];(ze===void 0||Ee===void 0)&&J(Ae,this.length-8);let nt=this[Ae+4]+this[Ae+5]*2**8+this[Ae+6]*2**16+(Ee<<24);return(BigInt(nt)<>>0,oe(Ae,"offset");let ze=this[Ae],Ee=this[Ae+7];(ze===void 0||Ee===void 0)&&J(Ae,this.length-8);let nt=(ze<<24)+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae];return(BigInt(nt)<>>0,ze||q(Ae,4,this.length),d.read(this,Ae,!0,23,4)},n.prototype.readFloatBE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,4,this.length),d.read(this,Ae,!1,23,4)},n.prototype.readDoubleLE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,8,this.length),d.read(this,Ae,!0,52,8)},n.prototype.readDoubleBE=function(Ae,ze){return Ae=Ae>>>0,ze||q(Ae,8,this.length),d.read(this,Ae,!1,52,8)};function G(Ae,ze,Ee,nt,xt,ut){if(!n.isBuffer(Ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(ze>xt||zeAe.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(Ae,ze,Ee,nt){if(Ae=+Ae,ze=ze>>>0,Ee=Ee>>>0,!nt){let Et=Math.pow(2,8*Ee)-1;G(this,Ae,ze,Ee,Et,0)}let xt=1,ut=0;for(this[ze]=Ae&255;++ut>>0,Ee=Ee>>>0,!nt){let Et=Math.pow(2,8*Ee)-1;G(this,Ae,ze,Ee,Et,0)}let xt=Ee-1,ut=1;for(this[ze+xt]=Ae&255;--xt>=0&&(ut*=256);)this[ze+xt]=Ae/ut&255;return ze+Ee},n.prototype.writeUint8=n.prototype.writeUInt8=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,1,255,0),this[ze]=Ae&255,ze+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,2,65535,0),this[ze]=Ae&255,this[ze+1]=Ae>>>8,ze+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,2,65535,0),this[ze]=Ae>>>8,this[ze+1]=Ae&255,ze+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,4,4294967295,0),this[ze+3]=Ae>>>24,this[ze+2]=Ae>>>16,this[ze+1]=Ae>>>8,this[ze]=Ae&255,ze+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,4,4294967295,0),this[ze]=Ae>>>24,this[ze+1]=Ae>>>16,this[ze+2]=Ae>>>8,this[ze+3]=Ae&255,ze+4};function ee(Ae,ze,Ee,nt,xt){_e(ze,nt,xt,Ae,Ee,7);let ut=Number(ze&BigInt(4294967295));Ae[Ee++]=ut,ut=ut>>8,Ae[Ee++]=ut,ut=ut>>8,Ae[Ee++]=ut,ut=ut>>8,Ae[Ee++]=ut;let Et=Number(ze>>BigInt(32)&BigInt(4294967295));return Ae[Ee++]=Et,Et=Et>>8,Ae[Ee++]=Et,Et=Et>>8,Ae[Ee++]=Et,Et=Et>>8,Ae[Ee++]=Et,Ee}function he(Ae,ze,Ee,nt,xt){_e(ze,nt,xt,Ae,Ee,7);let ut=Number(ze&BigInt(4294967295));Ae[Ee+7]=ut,ut=ut>>8,Ae[Ee+6]=ut,ut=ut>>8,Ae[Ee+5]=ut,ut=ut>>8,Ae[Ee+4]=ut;let Et=Number(ze>>BigInt(32)&BigInt(4294967295));return Ae[Ee+3]=Et,Et=Et>>8,Ae[Ee+2]=Et,Et=Et>>8,Ae[Ee+1]=Et,Et=Et>>8,Ae[Ee]=Et,Ee+8}n.prototype.writeBigUInt64LE=gt(function(Ae,ze=0){return ee(this,Ae,ze,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeBigUInt64BE=gt(function(Ae,ze=0){return he(this,Ae,ze,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeIntLE=function(Ae,ze,Ee,nt){if(Ae=+Ae,ze=ze>>>0,!nt){let Gt=Math.pow(2,8*Ee-1);G(this,Ae,ze,Ee,Gt-1,-Gt)}let xt=0,ut=1,Et=0;for(this[ze]=Ae&255;++xt>0)-Et&255;return ze+Ee},n.prototype.writeIntBE=function(Ae,ze,Ee,nt){if(Ae=+Ae,ze=ze>>>0,!nt){let Gt=Math.pow(2,8*Ee-1);G(this,Ae,ze,Ee,Gt-1,-Gt)}let xt=Ee-1,ut=1,Et=0;for(this[ze+xt]=Ae&255;--xt>=0&&(ut*=256);)Ae<0&&Et===0&&this[ze+xt+1]!==0&&(Et=1),this[ze+xt]=(Ae/ut>>0)-Et&255;return ze+Ee},n.prototype.writeInt8=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,1,127,-128),Ae<0&&(Ae=255+Ae+1),this[ze]=Ae&255,ze+1},n.prototype.writeInt16LE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,2,32767,-32768),this[ze]=Ae&255,this[ze+1]=Ae>>>8,ze+2},n.prototype.writeInt16BE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,2,32767,-32768),this[ze]=Ae>>>8,this[ze+1]=Ae&255,ze+2},n.prototype.writeInt32LE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,4,2147483647,-2147483648),this[ze]=Ae&255,this[ze+1]=Ae>>>8,this[ze+2]=Ae>>>16,this[ze+3]=Ae>>>24,ze+4},n.prototype.writeInt32BE=function(Ae,ze,Ee){return Ae=+Ae,ze=ze>>>0,Ee||G(this,Ae,ze,4,2147483647,-2147483648),Ae<0&&(Ae=4294967295+Ae+1),this[ze]=Ae>>>24,this[ze+1]=Ae>>>16,this[ze+2]=Ae>>>8,this[ze+3]=Ae&255,ze+4},n.prototype.writeBigInt64LE=gt(function(Ae,ze=0){return ee(this,Ae,ze,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),n.prototype.writeBigInt64BE=gt(function(Ae,ze=0){return he(this,Ae,ze,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(Ae,ze,Ee,nt,xt,ut){if(Ee+nt>Ae.length)throw new RangeError("Index out of range");if(Ee<0)throw new RangeError("Index out of range")}function ve(Ae,ze,Ee,nt,xt){return ze=+ze,Ee=Ee>>>0,xt||xe(Ae,ze,Ee,4),d.write(Ae,ze,Ee,nt,23,4),Ee+4}n.prototype.writeFloatLE=function(Ae,ze,Ee){return ve(this,Ae,ze,!0,Ee)},n.prototype.writeFloatBE=function(Ae,ze,Ee){return ve(this,Ae,ze,!1,Ee)};function ce(Ae,ze,Ee,nt,xt){return ze=+ze,Ee=Ee>>>0,xt||xe(Ae,ze,Ee,8),d.write(Ae,ze,Ee,nt,52,8),Ee+8}n.prototype.writeDoubleLE=function(Ae,ze,Ee){return ce(this,Ae,ze,!0,Ee)},n.prototype.writeDoubleBE=function(Ae,ze,Ee){return ce(this,Ae,ze,!1,Ee)},n.prototype.copy=function(Ae,ze,Ee,nt){if(!n.isBuffer(Ae))throw new TypeError("argument should be a Buffer");if(Ee||(Ee=0),!nt&&nt!==0&&(nt=this.length),ze>=Ae.length&&(ze=Ae.length),ze||(ze=0),nt>0&&nt=this.length)throw new RangeError("Index out of range");if(nt<0)throw new RangeError("sourceEnd out of bounds");nt>this.length&&(nt=this.length),Ae.length-ze>>0,Ee=Ee===void 0?this.length:Ee>>>0,Ae||(Ae=0);let xt;if(typeof Ae=="number")for(xt=ze;xt2**32?xt=ne(String(Ee)):typeof Ee=="bigint"&&(xt=String(Ee),(Ee>BigInt(2)**BigInt(32)||Ee<-(BigInt(2)**BigInt(32)))&&(xt=ne(xt)),xt+="n"),nt+=` It must be ${ze}. Received ${xt}`,nt},RangeError);function ne(Ae){let ze="",Ee=Ae.length,nt=Ae[0]==="-"?1:0;for(;Ee>=nt+4;Ee-=3)ze=`_${Ae.slice(Ee-3,Ee)}${ze}`;return`${Ae.slice(0,Ee)}${ze}`}function se(Ae,ze,Ee){oe(ze,"offset"),(Ae[ze]===void 0||Ae[ze+Ee]===void 0)&&J(ze,Ae.length-(Ee+1))}function _e(Ae,ze,Ee,nt,xt,ut){if(Ae>Ee||Ae= 0${Et} and < 2${Et} ** ${(ut+1)*8}${Et}`:Gt=`>= -(2${Et} ** ${(ut+1)*8-1}${Et}) and < 2 ** ${(ut+1)*8-1}${Et}`,new re.ERR_OUT_OF_RANGE("value",Gt,Ae)}se(nt,xt,ut)}function oe(Ae,ze){if(typeof Ae!="number")throw new re.ERR_INVALID_ARG_TYPE(ze,"number",Ae)}function J(Ae,ze,Ee){throw Math.floor(Ae)!==Ae?(oe(Ae,Ee),new re.ERR_OUT_OF_RANGE("offset","an integer",Ae)):ze<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${ze}`,Ae)}var me=/[^+/0-9A-Za-z-_]/g;function fe(Ae){if(Ae=Ae.split("=")[0],Ae=Ae.trim().replace(me,""),Ae.length<2)return"";for(;Ae.length%4!==0;)Ae=Ae+"=";return Ae}function Ce(Ae,ze){ze=ze||1/0;let Ee,nt=Ae.length,xt=null,ut=[];for(let Et=0;Et55295&&Ee<57344){if(!xt){if(Ee>56319){(ze-=3)>-1&&ut.push(239,191,189);continue}else if(Et+1===nt){(ze-=3)>-1&&ut.push(239,191,189);continue}xt=Ee;continue}if(Ee<56320){(ze-=3)>-1&&ut.push(239,191,189),xt=Ee;continue}Ee=(xt-55296<<10|Ee-56320)+65536}else xt&&(ze-=3)>-1&&ut.push(239,191,189);if(xt=null,Ee<128){if((ze-=1)<0)break;ut.push(Ee)}else if(Ee<2048){if((ze-=2)<0)break;ut.push(Ee>>6|192,Ee&63|128)}else if(Ee<65536){if((ze-=3)<0)break;ut.push(Ee>>12|224,Ee>>6&63|128,Ee&63|128)}else if(Ee<1114112){if((ze-=4)<0)break;ut.push(Ee>>18|240,Ee>>12&63|128,Ee>>6&63|128,Ee&63|128)}else throw new Error("Invalid code point")}return ut}function Be(Ae){let ze=[];for(let Ee=0;Ee>8,xt=Ee%256,ut.push(xt),ut.push(nt);return ut}function Ze(Ae){return Y.toByteArray(fe(Ae))}function Ge(Ae,ze,Ee,nt){let xt;for(xt=0;xt=ze.length||xt>=Ae.length);++xt)ze[xt+Ee]=Ae[xt];return xt}function rt(Ae,ze){return Ae instanceof ze||Ae!=null&&Ae.constructor!=null&&Ae.constructor.name!=null&&Ae.constructor.name===ze.name}function _t(Ae){return Ae!==Ae}var pt=function(){let Ae="0123456789abcdef",ze=new Array(256);for(let Ee=0;Ee<16;++Ee){let nt=Ee*16;for(let xt=0;xt<16;++xt)ze[nt+xt]=Ae[Ee]+Ae[xt]}return ze}();function gt(Ae){return typeof BigInt>"u"?ct:Ae}function ct(){throw new Error("BigInt not supported")}}),J8=Fe((te,Y)=>{Y.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var d={},y=Symbol("test"),z=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(z)!=="[object Symbol]")return!1;var P=42;d[y]=P;for(var i in d)return!1;if(typeof Object.keys=="function"&&Object.keys(d).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(d).length!==0)return!1;var n=Object.getOwnPropertySymbols(d);if(n.length!==1||n[0]!==y||!Object.prototype.propertyIsEnumerable.call(d,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(d,y);if(a.value!==P||a.enumerable!==!0)return!1}return!0}}),X4=Fe((te,Y)=>{var d=J8();Y.exports=function(){return d()&&!!Symbol.toStringTag}}),pP=Fe((te,Y)=>{Y.exports=Object}),OG=Fe((te,Y)=>{Y.exports=Error}),BG=Fe((te,Y)=>{Y.exports=EvalError}),RG=Fe((te,Y)=>{Y.exports=RangeError}),FG=Fe((te,Y)=>{Y.exports=ReferenceError}),mP=Fe((te,Y)=>{Y.exports=SyntaxError}),Iw=Fe((te,Y)=>{Y.exports=TypeError}),NG=Fe((te,Y)=>{Y.exports=URIError}),jG=Fe((te,Y)=>{Y.exports=Math.abs}),UG=Fe((te,Y)=>{Y.exports=Math.floor}),$G=Fe((te,Y)=>{Y.exports=Math.max}),HG=Fe((te,Y)=>{Y.exports=Math.min}),VG=Fe((te,Y)=>{Y.exports=Math.pow}),WG=Fe((te,Y)=>{Y.exports=Math.round}),qG=Fe((te,Y)=>{Y.exports=Number.isNaN||function(d){return d!==d}}),GG=Fe((te,Y)=>{var d=qG();Y.exports=function(y){return d(y)||y===0?y:y<0?-1:1}}),ZG=Fe((te,Y)=>{Y.exports=Object.getOwnPropertyDescriptor}),vb=Fe((te,Y)=>{var d=ZG();if(d)try{d([],"length")}catch{d=null}Y.exports=d}),J4=Fe((te,Y)=>{var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}Y.exports=d}),KG=Fe((te,Y)=>{var d=typeof Symbol<"u"&&Symbol,y=J8();Y.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:y()}}),gP=Fe((te,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),vP=Fe((te,Y)=>{var d=pP();Y.exports=d.getPrototypeOf||null}),YG=Fe((te,Y)=>{var d="Function.prototype.bind called on incompatible ",y=Object.prototype.toString,z=Math.max,P="[object Function]",i=function(l,o){for(var u=[],s=0;s{var d=YG();Y.exports=Function.prototype.bind||d}),Q8=Fe((te,Y)=>{Y.exports=Function.prototype.call}),yP=Fe((te,Y)=>{Y.exports=Function.prototype.apply}),XG=Fe((te,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),JG=Fe((te,Y)=>{var d=Dw(),y=yP(),z=Q8(),P=XG();Y.exports=P||d.call(z,y)}),QG=Fe((te,Y)=>{var d=Dw(),y=Iw(),z=Q8(),P=JG();Y.exports=function(i){if(i.length<1||typeof i[0]!="function")throw new y("a function is required");return P(d,z,i)}}),eZ=Fe((te,Y)=>{var d=QG(),y=vb(),z;try{z=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var P=!!z&&y&&y(Object.prototype,"__proto__"),i=Object,n=i.getPrototypeOf;Y.exports=P&&typeof P.get=="function"?d([P.get]):typeof n=="function"?function(a){return n(a==null?a:i(a))}:!1}),tZ=Fe((te,Y)=>{var d=gP(),y=vP(),z=eZ();Y.exports=d?function(P){return d(P)}:y?function(P){if(!P||typeof P!="object"&&typeof P!="function")throw new TypeError("getProto: not an object");return y(P)}:z?function(P){return z(P)}:null}),rZ=Fe((te,Y)=>{var d=Function.prototype.call,y=Object.prototype.hasOwnProperty,z=Dw();Y.exports=z.call(d,y)}),eC=Fe((te,Y)=>{var d,y=pP(),z=OG(),P=BG(),i=RG(),n=FG(),a=mP(),l=Iw(),o=NG(),u=jG(),s=UG(),h=$G(),m=HG(),b=VG(),x=WG(),_=GG(),A=Function,f=function(se){try{return A('"use strict"; return ('+se+").constructor;")()}catch{}},k=vb(),w=J4(),D=function(){throw new l},E=k?function(){try{return arguments.callee,D}catch{try{return k(arguments,"callee").get}catch{return D}}}():D,I=KG()(),M=tZ(),p=vP(),g=gP(),C=yP(),T=Q8(),N={},B=typeof Uint8Array>"u"||!M?d:M(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":I&&M?M([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":z,"%eval%":eval,"%EvalError%":P,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&M?M(M([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!M?d:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":y,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":i,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!M?d:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&M?M(""[Symbol.iterator]()):d,"%Symbol%":I?Symbol:d,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":C,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":u,"%Math.floor%":s,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":b,"%Math.round%":x,"%Math.sign%":_,"%Reflect.getPrototypeOf%":g};if(M)try{null.error}catch(se){V=M(M(se)),U["%Error.prototype%"]=V}var V,W=function se(_e){var oe;if(_e==="%AsyncFunction%")oe=f("async function () {}");else if(_e==="%GeneratorFunction%")oe=f("function* () {}");else if(_e==="%AsyncGeneratorFunction%")oe=f("async function* () {}");else if(_e==="%AsyncGenerator%"){var J=se("%AsyncGeneratorFunction%");J&&(oe=J.prototype)}else if(_e==="%AsyncIteratorPrototype%"){var me=se("%AsyncGenerator%");me&&M&&(oe=M(me.prototype))}return U[_e]=oe,oe},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},$=Dw(),q=rZ(),G=$.call(T,Array.prototype.concat),ee=$.call(C,Array.prototype.splice),he=$.call(T,String.prototype.replace),xe=$.call(T,String.prototype.slice),ve=$.call(T,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,ge=function(se){var _e=xe(se,0,1),oe=xe(se,-1);if(_e==="%"&&oe!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(oe==="%"&&_e!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return he(se,ce,function(me,fe,Ce,Be){J[J.length]=Ce?he(Be,re,"$1"):fe||me}),J},ne=function(se,_e){var oe=se,J;if(q(F,oe)&&(J=F[oe],oe="%"+J[0]+"%"),q(U,oe)){var me=U[oe];if(me===N&&(me=W(oe)),typeof me>"u"&&!_e)throw new l("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:J,name:oe,value:me}}throw new a("intrinsic "+se+" does not exist!")};Y.exports=function(se,_e){if(typeof se!="string"||se.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof _e!="boolean")throw new l('"allowMissing" argument must be a boolean');if(ve(/^%?[^%]*%?$/,se)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var oe=ge(se),J=oe.length>0?oe[0]:"",me=ne("%"+J+"%",_e),fe=me.name,Ce=me.value,Be=!1,Oe=me.alias;Oe&&(J=Oe[0],ee(oe,G([0,1],Oe)));for(var Ze=1,Ge=!0;Ze=oe.length){var gt=k(Ce,rt);Ge=!!gt,Ge&&"get"in gt&&!("originalValue"in gt.get)?Ce=gt.get:Ce=Ce[rt]}else Ge=q(Ce,rt),Ce=Ce[rt];Ge&&!Be&&(U[fe]=Ce)}}return Ce}}),iZ=Fe((te,Y)=>{var d=J4(),y=mP(),z=Iw(),P=vb();Y.exports=function(i,n,a){if(!i||typeof i!="object"&&typeof i!="function")throw new z("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new z("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new z("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new z("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new z("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new z("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!P&&P(i,n);if(d)d(i,n,{configurable:u===null&&h?h.configurable:!u,enumerable:l===null&&h?h.enumerable:!l,value:a,writable:o===null&&h?h.writable:!o});else if(s||!l&&!o&&!u)i[n]=a;else throw new y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),_P=Fe((te,Y)=>{var d=J4(),y=function(){return!!d};y.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},Y.exports=y}),nZ=Fe((te,Y)=>{var d=eC(),y=iZ(),z=_P()(),P=vb(),i=Iw(),n=d("%Math.floor%");Y.exports=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||n(l)!==l)throw new i("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],u=!0,s=!0;if("length"in a&&P){var h=P(a,"length");h&&!h.configurable&&(u=!1),h&&!h.writable&&(s=!1)}return(u||s||!o)&&(z?y(a,"length",l,!0,!0):y(a,"length",l)),a}}),Q4=Fe((te,Y)=>{var d=Dw(),y=eC(),z=nZ(),P=Iw(),i=y("%Function.prototype.apply%"),n=y("%Function.prototype.call%"),a=y("%Reflect.apply%",!0)||d.call(n,i),l=J4(),o=y("%Math.max%");Y.exports=function(s){if(typeof s!="function")throw new P("a function is required");var h=a(d,n,arguments);return z(h,1+o(0,s.length-(arguments.length-1)),!0)};var u=function(){return a(d,i,arguments)};l?l(Y.exports,"apply",{value:u}):Y.exports.apply=u}),zw=Fe((te,Y)=>{var d=eC(),y=Q4(),z=y(d("String.prototype.indexOf"));Y.exports=function(P,i){var n=d(P,!!i);return typeof n=="function"&&z(P,".prototype.")>-1?y(n):n}}),aZ=Fe((te,Y)=>{var d=X4()(),y=zw(),z=y("Object.prototype.toString"),P=function(a){return d&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:z(a)==="[object Arguments]"},i=function(a){return P(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&z(a)!=="[object Array]"&&z(a.callee)==="[object Function]"},n=function(){return P(arguments)}();P.isLegacyArguments=i,Y.exports=n?P:i}),oZ=Fe((te,Y)=>{var d=Object.prototype.toString,y=Function.prototype.toString,z=/^\s*(?:function)?\*/,P=X4()(),i=Object.getPrototypeOf,n=function(){if(!P)return!1;try{return Function("return function*() {}")()}catch{}},a;Y.exports=function(l){if(typeof l!="function")return!1;if(z.test(y.call(l)))return!0;if(!P){var o=d.call(l);return o==="[object GeneratorFunction]"}if(!i)return!1;if(typeof a>"u"){var u=n();a=u?i(u):!1}return i(l)===a}}),sZ=Fe((te,Y)=>{var d=Function.prototype.toString,y=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,z,P;if(typeof y=="function"&&typeof Object.defineProperty=="function")try{z=Object.defineProperty({},"length",{get:function(){throw P}}),P={},y(function(){throw 42},null,z)}catch(k){k!==P&&(y=null)}else y=null;var i=/^\s*class\b/,n=function(k){try{var w=d.call(k);return i.test(w)}catch{return!1}},a=function(k){try{return n(k)?!1:(d.call(k),!0)}catch{return!1}},l=Object.prototype.toString,o="[object Object]",u="[object Function]",s="[object GeneratorFunction]",h="[object HTMLAllCollection]",m="[object HTML document.all class]",b="[object HTMLCollection]",x=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),A=function(){return!1};typeof document=="object"&&(f=document.all,l.call(f)===l.call(document.all)&&(A=function(k){if((_||!k)&&(typeof k>"u"||typeof k=="object"))try{var w=l.call(k);return(w===h||w===m||w===b||w===o)&&k("")==null}catch{}return!1}));var f;Y.exports=y?function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;try{y(k,null,z)}catch(w){if(w!==P)return!1}return!n(k)&&a(k)}:function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;if(x)return a(k);if(n(k))return!1;var w=l.call(k);return w!==u&&w!==s&&!/^\[object HTML/.test(w)?!1:a(k)}}),xP=Fe((te,Y)=>{var d=sZ(),y=Object.prototype.toString,z=Object.prototype.hasOwnProperty,P=function(l,o,u){for(var s=0,h=l.length;s=3&&(s=u),y.call(l)==="[object Array]"?P(l,o,s):typeof l=="string"?i(l,o,s):n(l,o,s)};Y.exports=a}),bP=Fe((te,Y)=>{var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],y=typeof globalThis>"u"?window:globalThis;Y.exports=function(){for(var z=[],P=0;P{var d=xP(),y=bP(),z=Q4(),P=zw(),i=vb(),n=P("Object.prototype.toString"),a=X4()(),l=typeof globalThis>"u"?window:globalThis,o=y(),u=P("String.prototype.slice"),s=Object.getPrototypeOf,h=P("Array.prototype.indexOf",!0)||function(_,A){for(var f=0;f<_.length;f+=1)if(_[f]===A)return f;return-1},m={__proto__:null};a&&i&&s?d(o,function(_){var A=new l[_];if(Symbol.toStringTag in A){var f=s(A),k=i(f,Symbol.toStringTag);if(!k){var w=s(f);k=i(w,Symbol.toStringTag)}m["$"+_]=z(k.get)}}):d(o,function(_){var A=new l[_],f=A.slice||A.set;f&&(m["$"+_]=z(f))});var b=function(_){var A=!1;return d(m,function(f,k){if(!A)try{"$"+f(_)===k&&(A=u(k,1))}catch{}}),A},x=function(_){var A=!1;return d(m,function(f,k){if(!A)try{f(_),A=u(k,1)}catch{}}),A};Y.exports=function(_){if(!_||typeof _!="object")return!1;if(!a){var A=u(n(_),8,-1);return h(o,A)>-1?A:A!=="Object"?!1:x(_)}return i?b(_):null}}),uZ=Fe((te,Y)=>{var d=xP(),y=bP(),z=zw(),P=z("Object.prototype.toString"),i=X4()(),n=vb(),a=typeof globalThis>"u"?window:globalThis,l=y(),o=z("Array.prototype.indexOf",!0)||function(b,x){for(var _=0;_-1}return n?m(b):!1}}),wP=Fe(te=>{var Y=aZ(),d=oZ(),y=lZ(),z=uZ();function P(Oe){return Oe.call.bind(Oe)}var i=typeof BigInt<"u",n=typeof Symbol<"u",a=P(Object.prototype.toString),l=P(Number.prototype.valueOf),o=P(String.prototype.valueOf),u=P(Boolean.prototype.valueOf);i&&(s=P(BigInt.prototype.valueOf));var s;n&&(h=P(Symbol.prototype.valueOf));var h;function m(Oe,Ze){if(typeof Oe!="object")return!1;try{return Ze(Oe),!0}catch{return!1}}te.isArgumentsObject=Y,te.isGeneratorFunction=d,te.isTypedArray=z;function b(Oe){return typeof Promise<"u"&&Oe instanceof Promise||Oe!==null&&typeof Oe=="object"&&typeof Oe.then=="function"&&typeof Oe.catch=="function"}te.isPromise=b;function x(Oe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Oe):z(Oe)||ee(Oe)}te.isArrayBufferView=x;function _(Oe){return y(Oe)==="Uint8Array"}te.isUint8Array=_;function A(Oe){return y(Oe)==="Uint8ClampedArray"}te.isUint8ClampedArray=A;function f(Oe){return y(Oe)==="Uint16Array"}te.isUint16Array=f;function k(Oe){return y(Oe)==="Uint32Array"}te.isUint32Array=k;function w(Oe){return y(Oe)==="Int8Array"}te.isInt8Array=w;function D(Oe){return y(Oe)==="Int16Array"}te.isInt16Array=D;function E(Oe){return y(Oe)==="Int32Array"}te.isInt32Array=E;function I(Oe){return y(Oe)==="Float32Array"}te.isFloat32Array=I;function M(Oe){return y(Oe)==="Float64Array"}te.isFloat64Array=M;function p(Oe){return y(Oe)==="BigInt64Array"}te.isBigInt64Array=p;function g(Oe){return y(Oe)==="BigUint64Array"}te.isBigUint64Array=g;function C(Oe){return a(Oe)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function T(Oe){return typeof Map>"u"?!1:C.working?C(Oe):Oe instanceof Map}te.isMap=T;function N(Oe){return a(Oe)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function B(Oe){return typeof Set>"u"?!1:N.working?N(Oe):Oe instanceof Set}te.isSet=B;function U(Oe){return a(Oe)==="[object WeakMap]"}U.working=typeof WeakMap<"u"&&U(new WeakMap);function V(Oe){return typeof WeakMap>"u"?!1:U.working?U(Oe):Oe instanceof WeakMap}te.isWeakMap=V;function W(Oe){return a(Oe)==="[object WeakSet]"}W.working=typeof WeakSet<"u"&&W(new WeakSet);function F(Oe){return W(Oe)}te.isWeakSet=F;function $(Oe){return a(Oe)==="[object ArrayBuffer]"}$.working=typeof ArrayBuffer<"u"&&$(new ArrayBuffer);function q(Oe){return typeof ArrayBuffer>"u"?!1:$.working?$(Oe):Oe instanceof ArrayBuffer}te.isArrayBuffer=q;function G(Oe){return a(Oe)==="[object DataView]"}G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1));function ee(Oe){return typeof DataView>"u"?!1:G.working?G(Oe):Oe instanceof DataView}te.isDataView=ee;var he=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function xe(Oe){return a(Oe)==="[object SharedArrayBuffer]"}function ve(Oe){return typeof he>"u"?!1:(typeof xe.working>"u"&&(xe.working=xe(new he)),xe.working?xe(Oe):Oe instanceof he)}te.isSharedArrayBuffer=ve;function ce(Oe){return a(Oe)==="[object AsyncFunction]"}te.isAsyncFunction=ce;function re(Oe){return a(Oe)==="[object Map Iterator]"}te.isMapIterator=re;function ge(Oe){return a(Oe)==="[object Set Iterator]"}te.isSetIterator=ge;function ne(Oe){return a(Oe)==="[object Generator]"}te.isGeneratorObject=ne;function se(Oe){return a(Oe)==="[object WebAssembly.Module]"}te.isWebAssemblyCompiledModule=se;function _e(Oe){return m(Oe,l)}te.isNumberObject=_e;function oe(Oe){return m(Oe,o)}te.isStringObject=oe;function J(Oe){return m(Oe,u)}te.isBooleanObject=J;function me(Oe){return i&&m(Oe,s)}te.isBigIntObject=me;function fe(Oe){return n&&m(Oe,h)}te.isSymbolObject=fe;function Ce(Oe){return _e(Oe)||oe(Oe)||J(Oe)||me(Oe)||fe(Oe)}te.isBoxedPrimitive=Ce;function Be(Oe){return typeof Uint8Array<"u"&&(q(Oe)||ve(Oe))}te.isAnyArrayBuffer=Be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Oe){Object.defineProperty(te,Oe,{enumerable:!1,value:function(){throw new Error(Oe+" is not supported in userland")}})})}),kP=Fe((te,Y)=>{Y.exports=function(d){return d&&typeof d=="object"&&typeof d.copy=="function"&&typeof d.fill=="function"&&typeof d.readUInt8=="function"}}),TP=Fe(te=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var ee=Object.keys(G),he={},xe=0;xe=ve)return ne;switch(ne){case"%s":return String(xe[he++]);case"%d":return Number(xe[he++]);case"%j":try{return JSON.stringify(xe[he++])}catch{return"[Circular]"}default:return ne}}),re=xe[he];he"u")return function(){return te.deprecate(G,ee).apply(this,arguments)};var he=!1;function xe(){if(!he){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),he=!0}return G.apply(this,arguments)}return xe};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;te.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var ee=process.pid;y[G]=function(){var he=te.format.apply(te,arguments);console.error("%s %d: %s",G,ee,he)}}else y[G]=function(){};return y[G]};function i(G,ee){var he={seen:[],stylize:a};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),_(ee)?he.showHidden=ee:ee&&te._extend(he,ee),E(he.showHidden)&&(he.showHidden=!1),E(he.depth)&&(he.depth=2),E(he.colors)&&(he.colors=!1),E(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=n),o(he,G,he.depth)}te.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(G,ee){var he=i.styles[ee];return he?"\x1B["+i.colors[he][0]+"m"+G+"\x1B["+i.colors[he][1]+"m":G}function a(G,ee){return G}function l(G){var ee={};return G.forEach(function(he,xe){ee[he]=!0}),ee}function o(G,ee,he){if(G.customInspect&&ee&&C(ee.inspect)&&ee.inspect!==te.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var xe=ee.inspect(he,G);return w(xe)||(xe=o(G,xe,he)),xe}var ve=u(G,ee);if(ve)return ve;var ce=Object.keys(ee),re=l(ce);if(G.showHidden&&(ce=Object.getOwnPropertyNames(ee)),g(ee)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return s(ee);if(ce.length===0){if(C(ee)){var ge=ee.name?": "+ee.name:"";return G.stylize("[Function"+ge+"]","special")}if(I(ee))return G.stylize(RegExp.prototype.toString.call(ee),"regexp");if(p(ee))return G.stylize(Date.prototype.toString.call(ee),"date");if(g(ee))return s(ee)}var ne="",se=!1,_e=["{","}"];if(x(ee)&&(se=!0,_e=["[","]"]),C(ee)){var oe=ee.name?": "+ee.name:"";ne=" [Function"+oe+"]"}if(I(ee)&&(ne=" "+RegExp.prototype.toString.call(ee)),p(ee)&&(ne=" "+Date.prototype.toUTCString.call(ee)),g(ee)&&(ne=" "+s(ee)),ce.length===0&&(!se||ee.length==0))return _e[0]+ne+_e[1];if(he<0)return I(ee)?G.stylize(RegExp.prototype.toString.call(ee),"regexp"):G.stylize("[Object]","special");G.seen.push(ee);var J;return se?J=h(G,ee,he,re,ce):J=ce.map(function(me){return m(G,ee,he,re,me,se)}),G.seen.pop(),b(J,ne,_e)}function u(G,ee){if(E(ee))return G.stylize("undefined","undefined");if(w(ee)){var he="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(he,"string")}if(k(ee))return G.stylize(""+ee,"number");if(_(ee))return G.stylize(""+ee,"boolean");if(A(ee))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,ee,he,xe,ve){for(var ce=[],re=0,ge=ee.length;re{Y.exports=function(d){return d}}),nw=ze(te=>{var Y=Sr(),d=ns(),y=k_(),z=ei().BADNUM,P=1e-9;te.findBin=function(o,u,s){if(Y(u.start))return s?Math.ceil((o-u.start)/u.size-P)-1:Math.floor((o-u.start)/u.size+P);var h=0,m=u.length,b=0,x=m>1?(u[m-1]-u[0])/(m-1):1,_,A;for(x>=0?A=s?i:n:A=s?l:a,o+=x*P*(s?-1:1)*(x>=0?1:-1);h90&&d.log("Long binary search..."),h-1};function i(o,u){return ou}function l(o,u){return o>=u}te.sorterAsc=function(o,u){return o-u},te.sorterDes=function(o,u){return u-o},te.distinctVals=function(o){var u=o.slice();u.sort(te.sorterAsc);var s;for(s=u.length-1;s>-1&&u[s]===z;s--);for(var h=u[s]-u[0]||1,m=h/(s||1)/1e4,b=[],x,_=0;_<=s;_++){var A=u[_],f=A-x;x===void 0?(b.push(A),x=A):f>m&&(h=Math.min(h,f),b.push(A),x=A)}return{vals:b,minDiff:h}},te.roundUp=function(o,u,s){for(var h=0,m=u.length-1,b,x=0,_=s?0:1,A=s?1:0,f=s?Math.ceil:Math.floor;h0&&(h=1),s&&h)return o.sort(u)}return h?o:o.reverse()},te.findIndexOfMin=function(o,u){u=u||y;for(var s=1/0,h,m=0;m{Y.exports=function(d){return Object.keys(d).sort()}}),aS=ze(te=>{var Y=Sr(),d=Di().isArrayOrTypedArray;te.aggNums=function(y,z,P,i){var n,a;if((!i||i>P.length)&&(i=P.length),Y(z)||(z=!1),d(P[0])){for(a=new Array(i),n=0;ny.length-1)return y[y.length-1];var P=z%1;return P*y[Math.ceil(z)]+(1-P)*y[Math.floor(z)]}}),oS=ze((te,Y)=>{var d=qn(),y=d.mod,z=d.modHalf,P=Math.PI,i=2*P;function n(A){return A/180*P}function a(A){return A/P*180}function l(A){return Math.abs(A[1]-A[0])>i-1e-14}function o(A,f){return z(f-A,i)}function u(A,f){return Math.abs(o(A,f))}function s(A,f){if(l(f))return!0;var k,w;f[0]w&&(w+=i);var D=y(A,i),E=D+i;return D>=k&&D<=w||E>=k&&E<=w}function h(A,f,k,w){if(!s(f,w))return!1;var D,E;return k[0]=D&&A<=E}function m(A,f,k,w,D,E,I){D=D||0,E=E||0;var M=l([k,w]),p,g,C,T,N;M?(p=0,g=P,C=i):k{te.isLeftAnchor=function(Y){return Y.xanchor==="left"||Y.xanchor==="auto"&&Y.x<=1/3},te.isCenterAnchor=function(Y){return Y.xanchor==="center"||Y.xanchor==="auto"&&Y.x>1/3&&Y.x<2/3},te.isRightAnchor=function(Y){return Y.xanchor==="right"||Y.xanchor==="auto"&&Y.x>=2/3},te.isTopAnchor=function(Y){return Y.yanchor==="top"||Y.yanchor==="auto"&&Y.y>=2/3},te.isMiddleAnchor=function(Y){return Y.yanchor==="middle"||Y.yanchor==="auto"&&Y.y>1/3&&Y.y<2/3},te.isBottomAnchor=function(Y){return Y.yanchor==="bottom"||Y.yanchor==="auto"&&Y.y<=1/3}}),lS=ze(te=>{var Y=qn().mod;te.segmentsIntersect=d;function d(n,a,l,o,u,s,h,m){var b=l-n,x=u-n,_=h-u,A=o-a,f=s-a,k=m-s,w=b*k-_*A;if(w===0)return null;var D=(x*k-_*f)/w,E=(x*A-b*f)/w;return E<0||E>1||D<0||D>1?null:{x:n+b*D,y:a+A*D}}te.segmentDistance=function(n,a,l,o,u,s,h,m){if(d(n,a,l,o,u,s,h,m))return 0;var b=l-n,x=o-a,_=h-u,A=m-s,f=b*b+x*x,k=_*_+A*A,w=Math.min(y(b,x,f,u-n,s-a),y(b,x,f,h-n,m-a),y(_,A,k,n-u,a-s),y(_,A,k,l-u,o-s));return Math.sqrt(w)};function y(n,a,l,o,u){var s=o*n+u*a;if(s<0)return o*o+u*u;if(s>l){var h=o-n,m=u-a;return h*h+m*m}else{var b=o*a-u*n;return b*b/l}}var z,P,i;te.getTextLocation=function(n,a,l,o){if((n!==P||o!==i)&&(z={},P=n,i=o),z[l])return z[l];var u=n.getPointAtLength(Y(l-o/2,a)),s=n.getPointAtLength(Y(l+o/2,a)),h=Math.atan((s.y-u.y)/(s.x-u.x)),m=n.getPointAtLength(Y(l,a)),b=(m.x*4+u.x+s.x)/6,x=(m.y*4+u.y+s.y)/6,_={x:b,y:x,theta:h};return z[l]=_,_},te.clearLocationCache=function(){P=null},te.getVisibleSegment=function(n,a,l){var o=a.left,u=a.right,s=a.top,h=a.bottom,m=0,b=n.getTotalLength(),x=b,_,A;function f(w){var D=n.getPointAtLength(w);w===0?_=D:w===b&&(A=D);var E=D.xu?D.x-u:0,I=D.yh?D.y-h:0;return Math.sqrt(E*E+I*I)}for(var k=f(m);k;){if(m+=k+l,m>x)return;k=f(m)}for(k=f(x);k;){if(x-=k+l,m>x)return;k=f(x)}return{min:m,max:x,len:x-m,total:b,isClosed:m===0&&x===b&&Math.abs(_.x-A.x)<.1&&Math.abs(_.y-A.y)<.1}},te.findPointOnPath=function(n,a,l,o){o=o||{};for(var u=o.pathLength||n.getTotalLength(),s=o.tolerance||.001,h=o.iterationLimit||30,m=n.getPointAtLength(0)[l]>n.getPointAtLength(u)[l]?-1:1,b=0,x=0,_=u,A,f,k;b0?_=A:x=A,b++}return f}}),aw=ze(te=>{var Y={};te.throttle=function(y,z,P){var i=Y[y],n=Date.now();if(!i){for(var a in Y)Y[a].tsi.ts+z){l();return}i.timer=setTimeout(function(){l(),i.timer=null},z)},te.done=function(y){var z=Y[y];return!z||!z.timer?Promise.resolve():new Promise(function(P){var i=z.onDone;z.onDone=function(){i&&i(),P(),z.onDone=null}})},te.clear=function(y){if(y)d(Y[y]),delete Y[y];else for(var z in Y)te.clear(z)};function d(y){y&&y.timer!==null&&(clearTimeout(y.timer),y.timer=null)}}),ow=ze((te,Y)=>{Y.exports=function(d){d._responsiveChartHandler&&(window.removeEventListener("resize",d._responsiveChartHandler),delete d._responsiveChartHandler)}}),T_=ze((te,Y)=>{Y.exports=P,Y.exports.isMobile=P,Y.exports.default=P;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,y=/CrOS/,z=/android|ipad|playbook|silk/i;function P(i){i||(i={});let n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;let a=d.test(n)&&!y.test(n)||!!i.tablet&&z.test(n);return!a&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(a=!0),a}}),x4=ze((te,Y)=>{var d=Sr(),y=T_();Y.exports=function(P){var i;if(P&&P.hasOwnProperty("userAgent")?i=P.userAgent:i=z(),typeof i!="string")return!0;var n=y({ua:{headers:{"user-agent":i}},tablet:!0,featureDetect:!1});if(!n)for(var a=i.split(" "),l=1;l-1;u--){var s=a[u];if(s.substr(0,8)==="Version/"){var h=s.substr(8).split(".")[0];if(d(h)&&(h=+h),h>=13)return!0}}}return n};function z(){var P;return typeof navigator<"u"&&(P=navigator.userAgent),P&&P.headers&&typeof P.headers["user-agent"]=="string"&&(P=P.headers["user-agent"]),P}}),b4=ze((te,Y)=>{var d=ri();Y.exports=function(y,z,P){var i=y.selectAll("g."+P.replace(/\s/g,".")).data(z,function(a){return a[0].trace.uid});i.exit().remove(),i.enter().append("g").attr("class",P),i.order();var n=y.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each(function(a){a[0][n]=d.select(this)}),i}}),S_=ze((te,Y)=>{var d=as();Y.exports=function(y,z){for(var P=y._context.locale,i=0;i<2;i++){for(var n=y._context.locales,a=0;a<2;a++){var l=(n[P]||{}).dictionary;if(l){var o=l[z];if(o)return o}n=d.localeRegistry}var u=P.split("-")[0];if(u===P)break;P=u}return z}}),jc=ze((te,Y)=>{Y.exports=function(d){for(var y={},z=[],P=0,i=0;i{Y.exports=function(P){for(var i=z(P)?y:d,n=[],a=0;a{Y.exports=function(d,y){if(!y)return d;var z=1/Math.abs(y),P=z>1?(z*d+z*y)/z:d+y,i=String(P).length;if(i>16){var n=String(y).length,a=String(d).length;if(i>=a+n){var l=parseFloat(P).toPrecision(12);l.indexOf("e+")===-1&&(P=+l)}}return P}}),Y1=ze((te,Y)=>{var d=Sr(),y=ei().BADNUM,z=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;Y.exports=function(P){return typeof P=="string"&&(P=P.replace(z,"")),d(P)?Number(P):y}}),ji=ze((te,Y)=>{var d=ri(),y=yi().utcFormat,z=gr().format,P=Sr(),i=ei(),n=i.FP_SAFE,a=-n,l=i.BADNUM,o=Y.exports={};o.adjustFormat=function(oe){return!oe||/^\d[.]\df/.test(oe)||/[.]\d%/.test(oe)?oe:oe==="0.f"?"~f":/^\d%/.test(oe)?"~%":/^\ds/.test(oe)?"~s":!/^[~,.0$]/.test(oe)&&/[&fps]/.test(oe)?"~"+oe:oe};var u={};o.warnBadFormat=function(oe){var J=String(oe);u[J]||(u[J]=1,o.warn('encountered bad format: "'+J+'"'))},o.noFormat=function(oe){return String(oe)},o.numberFormat=function(oe){var J;try{J=z(o.adjustFormat(oe))}catch{return o.warnBadFormat(oe),o.noFormat}return J},o.nestedProperty=En(),o.keyedContainer=Zn(),o.relativeAttr=ga(),o.isPlainObject=ti(),o.toLogRange=ya(),o.relinkPrivateKeys=ro();var s=Di();o.isArrayBuffer=s.isArrayBuffer,o.isTypedArray=s.isTypedArray,o.isArrayOrTypedArray=s.isArrayOrTypedArray,o.isArray1D=s.isArray1D,o.ensureArray=s.ensureArray,o.concat=s.concat,o.maxRowLength=s.maxRowLength,o.minRowLength=s.minRowLength;var h=qn();o.mod=h.mod,o.modHalf=h.modHalf;var m=ko();o.valObjectMeta=m.valObjectMeta,o.coerce=m.coerce,o.coerce2=m.coerce2,o.coerceFont=m.coerceFont,o.coercePattern=m.coercePattern,o.coerceHoverinfo=m.coerceHoverinfo,o.coerceSelectionMarkerOpacity=m.coerceSelectionMarkerOpacity,o.validate=m.validate;var b=nS();o.dateTime2ms=b.dateTime2ms,o.isDateTime=b.isDateTime,o.ms2DateTime=b.ms2DateTime,o.ms2DateTimeLocal=b.ms2DateTimeLocal,o.cleanDate=b.cleanDate,o.isJSDate=b.isJSDate,o.formatDate=b.formatDate,o.incrementMonth=b.incrementMonth,o.dateTick0=b.dateTick0,o.dfltRange=b.dfltRange,o.findExactDates=b.findExactDates,o.MIN_MS=b.MIN_MS,o.MAX_MS=b.MAX_MS;var x=nw();o.findBin=x.findBin,o.sorterAsc=x.sorterAsc,o.sorterDes=x.sorterDes,o.distinctVals=x.distinctVals,o.roundUp=x.roundUp,o.sort=x.sort,o.findIndexOfMin=x.findIndexOfMin,o.sortObjectKeys=Xm();var _=aS();o.aggNums=_.aggNums,o.len=_.len,o.mean=_.mean,o.geometricMean=_.geometricMean,o.median=_.median,o.midRange=_.midRange,o.variance=_.variance,o.stdev=_.stdev,o.interp=_.interp;var A=rw();o.init2dArray=A.init2dArray,o.transposeRagged=A.transposeRagged,o.dot=A.dot,o.translationMatrix=A.translationMatrix,o.rotationMatrix=A.rotationMatrix,o.rotationXYMatrix=A.rotationXYMatrix,o.apply3DTransform=A.apply3DTransform,o.apply2DTransform=A.apply2DTransform,o.apply2DTransform2=A.apply2DTransform2,o.convertCssMatrix=A.convertCssMatrix,o.inverseTransformMatrix=A.inverseTransformMatrix;var f=oS();o.deg2rad=f.deg2rad,o.rad2deg=f.rad2deg,o.angleDelta=f.angleDelta,o.angleDist=f.angleDist,o.isFullCircle=f.isFullCircle,o.isAngleInsideSector=f.isAngleInsideSector,o.isPtInsideSector=f.isPtInsideSector,o.pathArc=f.pathArc,o.pathSector=f.pathSector,o.pathAnnulus=f.pathAnnulus;var k=sS();o.isLeftAnchor=k.isLeftAnchor,o.isCenterAnchor=k.isCenterAnchor,o.isRightAnchor=k.isRightAnchor,o.isTopAnchor=k.isTopAnchor,o.isMiddleAnchor=k.isMiddleAnchor,o.isBottomAnchor=k.isBottomAnchor;var w=lS();o.segmentsIntersect=w.segmentsIntersect,o.segmentDistance=w.segmentDistance,o.getTextLocation=w.getTextLocation,o.clearLocationCache=w.clearLocationCache,o.getVisibleSegment=w.getVisibleSegment,o.findPointOnPath=w.findPointOnPath;var D=nn();o.extendFlat=D.extendFlat,o.extendDeep=D.extendDeep,o.extendDeepAll=D.extendDeepAll,o.extendDeepNoArrays=D.extendDeepNoArrays;var E=ns();o.log=E.log,o.warn=E.warn,o.error=E.error;var I=go();o.counterRegex=I.counter;var M=aw();o.throttle=M.throttle,o.throttleDone=M.done,o.clearThrottle=M.clear;var p=q0();o.getGraphDiv=p.getGraphDiv,o.isPlotDiv=p.isPlotDiv,o.removeElement=p.removeElement,o.addStyleRule=p.addStyleRule,o.addRelatedStyleRule=p.addRelatedStyleRule,o.deleteRelatedStyleRule=p.deleteRelatedStyleRule,o.setStyleOnHover=p.setStyleOnHover,o.getFullTransformMatrix=p.getFullTransformMatrix,o.getElementTransformMatrix=p.getElementTransformMatrix,o.getElementAndAncestors=p.getElementAndAncestors,o.equalDomRects=p.equalDomRects,o.clearResponsive=ow(),o.preserveDrawingBuffer=x4(),o.makeTraceGroups=b4(),o._=S_(),o.notifier=ys(),o.filterUnique=jc(),o.filterVisible=Bf(),o.pushUnique=Rl(),o.increment=Xx(),o.cleanNumber=Y1(),o.ensureNumber=function(oe){return P(oe)?(oe=Number(oe),oe>n||oe=J?!1:P(oe)&&oe>=0&&oe%1===0},o.noop=Qo(),o.identity=k_(),o.repeat=function(oe,J){for(var me=new Array(J),fe=0;feme?Math.max(me,Math.min(J,oe)):Math.max(J,Math.min(me,oe))},o.bBoxIntersect=function(oe,J,me){return me=me||0,oe.left<=J.right+me&&J.left<=oe.right+me&&oe.top<=J.bottom+me&&J.top<=oe.bottom+me},o.simpleMap=function(oe,J,me,fe,Ce){for(var Re=oe.length,Be=new Array(Re),Ze=0;Ze=Math.pow(2,me)?Ce>10?(o.warn("randstr failed uniqueness"),Be):oe(J,me,fe,(Ce||0)+1):Be},o.OptionControl=function(oe,J){oe||(oe={}),J||(J="opt");var me={};return me.optionList=[],me._newoption=function(fe){fe[J]=oe,me[fe.name]=fe,me.optionList.push(fe)},me["_"+J]=oe,me},o.smooth=function(oe,J){if(J=Math.round(J)||0,J<2)return oe;var me=oe.length,fe=2*me,Ce=2*J-1,Re=new Array(Ce),Be=new Array(me),Ze,Ge,tt,_t;for(Ze=0;Ze=fe&&(tt-=fe*Math.floor(tt/fe)),tt<0?tt=-1-tt:tt>=me&&(tt=fe-1-tt),_t+=oe[tt]*Re[Ge];Be[Ze]=_t}return Be},o.syncOrAsync=function(oe,J,me){var fe,Ce;function Re(){return o.syncOrAsync(oe,J,me)}for(;oe.length;)if(Ce=oe.splice(0,1)[0],fe=Ce(J),fe&&fe.then)return fe.then(Re);return me&&me(J)},o.stripTrailingSlash=function(oe){return oe.substr(-1)==="/"?oe.substr(0,oe.length-1):oe},o.noneOrAll=function(oe,J,me){if(oe){var fe=!1,Ce=!0,Re,Be;for(Re=0;Re0?Ce:0})},o.fillArray=function(oe,J,me,fe){if(fe=fe||o.identity,o.isArrayOrTypedArray(oe))for(var Ce=0;CeB.test(window.navigator.userAgent);var U=/Firefox\/(\d+)\.\d+/;o.getFirefoxVersion=function(){var oe=U.exec(window.navigator.userAgent);if(oe&&oe.length===2){var J=parseInt(oe[1]);if(!isNaN(J))return J}return null},o.isD3Selection=function(oe){return oe instanceof d.selection},o.ensureSingle=function(oe,J,me,fe){var Ce=oe.select(J+(me?"."+me:""));if(Ce.size())return Ce;var Re=oe.append(J);return me&&Re.classed(me,!0),fe&&Re.call(fe),Re},o.ensureSingleById=function(oe,J,me,fe){var Ce=oe.select(J+"#"+me);if(Ce.size())return Ce;var Re=oe.append(J).attr("id",me);return fe&&Re.call(fe),Re},o.objectFromPath=function(oe,J){for(var me=oe.split("."),fe,Ce=fe={},Re=0;Re1?Ce+Be[1]:"";if(Re&&(Be.length>1||Ze.length>4||me))for(;fe.test(Ze);)Ze=Ze.replace(fe,"$1"+Re+"$2");return Ze+Ge},o.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var H=/^\w*$/;o.templateString=function(oe,J){var me={};return oe.replace(o.TEMPLATE_STRING_REGEX,function(fe,Ce){var Re;return H.test(Ce)?Re=J[Ce]:(me[Ce]=me[Ce]||o.nestedProperty(J,Ce).get,Re=me[Ce](!0)),Re!==void 0?Re:""})};var q={max:10,count:0,name:"hovertemplate"};o.hovertemplateString=oe=>ce(Dt(wt({},oe),{opts:q}));var G={max:10,count:0,name:"texttemplate"};o.texttemplateString=oe=>ce(Dt(wt({},oe),{opts:G}));var ee=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function he(oe){var J=oe.match(ee);return J?{key:J[1],op:J[2],number:Number(J[3])}:{key:oe,op:null,number:null}}var be={max:10,count:0,name:"texttemplate",parseMultDiv:!0};o.texttemplateStringForShapes=oe=>ce(Dt(wt({},oe),{opts:be}));var ve=/^[:|\|]/;function ce({data:oe=[],locale:J,fallback:me,labels:fe={},opts:Ce,template:Re}){return Re.replace(o.TEMPLATE_STRING_REGEX,(Be,Ze,Ge)=>{let tt=["xother","yother"].includes(Ze),_t=["_xother","_yother"].includes(Ze),mt=["_xother_","_yother_"].includes(Ze),vt=["xother_","yother_"].includes(Ze),ct=tt||_t||vt||mt;(_t||mt)&&(Ze=Ze.substring(1)),(vt||mt)&&(Ze=Ze.substring(0,Ze.length-1));let Ae=null,Oe=null;if(Ce.parseMultDiv){var Le=he(Ze);Ze=Le.key,Ae=Le.op,Oe=Le.number}let nt;if(ct){if(fe[Ze]===void 0)return"";nt=fe[Ze]}else for(let Gt of oe)if(Gt){if(Gt.hasOwnProperty(Ze)){nt=Gt[Ze];break}if(H.test(Ze)||(nt=o.nestedProperty(Gt,Ze).get(!0)),nt!==void 0)break}if(nt===void 0){let{count:Gt,max:Qt,name:vr}=Ce,mr=me===!1?Be:me;return Gt=re&&Be<=ge,tt=Ze>=re&&Ze<=ge;if(Ge&&(fe=10*fe+Be-re),tt&&(Ce=10*Ce+Ze-re),!Ge||!tt){if(fe!==Ce)return fe-Ce;if(Be!==Ze)return Be-Ze}}return Ce-fe};var ne=2e9;o.seedPseudoRandom=function(){ne=2e9},o.pseudoRandom=function(){var oe=ne;return ne=(69069*ne+1)%4294967296,Math.abs(ne-oe)<429496729?o.pseudoRandom():ne/4294967296},o.fillText=function(oe,J,me){var fe=Array.isArray(me)?function(Be){me.push(Be)}:function(Be){me.text=Be},Ce=o.extractOption(oe,J,"htx","hovertext");if(o.isValidTextValue(Ce))return fe(Ce);var Re=o.extractOption(oe,J,"tx","text");if(o.isValidTextValue(Re))return fe(Re)},o.isValidTextValue=function(oe){return oe||oe===0},o.formatPercent=function(oe,J){J=J||0;for(var me=(Math.round(100*oe*Math.pow(10,J))*Math.pow(.1,J)).toFixed(J)+"%",fe=0;fe1&&(tt=1):tt=0,o.strTranslate(Ce-tt*(me+Be),Re-tt*(fe+Ze))+o.strScale(tt)+(Ge?"rotate("+Ge+(J?"":" "+me+" "+fe)+")":"")},o.setTransormAndDisplay=function(oe,J){oe.attr("transform",o.getTextTransform(J)),oe.style("display",J.scale?null:"none")},o.ensureUniformFontSize=function(oe,J){var me=o.extendFlat({},J);return me.size=Math.max(J.size,oe._fullLayout.uniformtext.minsize||0),me},o.join2=function(oe,J,me){var fe=oe.length;return fe>1?oe.slice(0,-1).join(J)+me+oe[fe-1]:oe.join(J)},o.bigFont=function(oe){return Math.round(1.2*oe)};var se=o.getFirefoxVersion(),_e=se!==null&&se<86;o.getPositionFromD3Event=function(){return _e?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}),sw=ze(()=>{var te=ji(),Y={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(y in Y)d=y.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),te.addStyleRule(d,Y[y]);var d,y}),Qu=ze((te,Y)=>{Y.exports=!0}),Qf=ze((te,Y)=>{var d=Qu(),y;typeof window.matchMedia=="function"?y=!window.matchMedia("(hover: none)").matches:y=d,Y.exports=y}),qg=ze((te,Y)=>{var d=typeof Reflect=="object"?Reflect:null,y=d&&typeof d.apply=="function"?d.apply:function(D,E,I){return Function.prototype.apply.call(D,E,I)},z;d&&typeof d.ownKeys=="function"?z=d.ownKeys:Object.getOwnPropertySymbols?z=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:z=function(D){return Object.getOwnPropertyNames(D)};function P(D){console&&console.warn&&console.warn(D)}var i=Number.isNaN||function(D){return D!==D};function n(){n.init.call(this)}Y.exports=n,Y.exports.once=f,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var a=10;function l(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");a=D}}),n.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},n.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function o(D){return D._maxListeners===void 0?n.defaultMaxListeners:D._maxListeners}n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(D){for(var E=[],I=1;I0&&(g=E[0]),g instanceof Error)throw g;var C=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw C.context=g,C}var T=p[D];if(T===void 0)return!1;if(typeof T=="function")y(T,this,E);else for(var N=T.length,B=x(T,N),I=0;I0&&C.length>p&&!C.warned){C.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=D,T.type=E,T.count=C.length,P(T)}return D}n.prototype.addListener=function(D,E){return u(this,D,E,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(D,E){return u(this,D,E,!0)};function s(){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 h(D,E,I){var M={fired:!1,wrapFn:void 0,target:D,type:E,listener:I},p=s.bind(M);return p.listener=I,M.wrapFn=p,p}n.prototype.once=function(D,E){return l(E),this.on(D,h(this,D,E)),this},n.prototype.prependOnceListener=function(D,E){return l(E),this.prependListener(D,h(this,D,E)),this},n.prototype.removeListener=function(D,E){var I,M,p,g,C;if(l(E),M=this._events,M===void 0)return this;if(I=M[D],I===void 0)return this;if(I===E||I.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete M[D],M.removeListener&&this.emit("removeListener",D,I.listener||E));else if(typeof I!="function"){for(p=-1,g=I.length-1;g>=0;g--)if(I[g]===E||I[g].listener===E){C=I[g].listener,p=g;break}if(p<0)return this;p===0?I.shift():_(I,p),I.length===1&&(M[D]=I[0]),M.removeListener!==void 0&&this.emit("removeListener",D,C||E)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(D){var E,I,M;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[D]),this;if(arguments.length===0){var p=Object.keys(I),g;for(M=0;M=0;M--)this.removeListener(D,E[M]);return this};function m(D,E,I){var M=D._events;if(M===void 0)return[];var p=M[E];return p===void 0?[]:typeof p=="function"?I?[p.listener||p]:[p]:I?A(p):x(p,p.length)}n.prototype.listeners=function(D){return m(this,D,!0)},n.prototype.rawListeners=function(D){return m(this,D,!1)},n.listenerCount=function(D,E){return typeof D.listenerCount=="function"?D.listenerCount(E):b.call(D,E)},n.prototype.listenerCount=b;function b(D){var E=this._events;if(E!==void 0){var I=E[D];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}n.prototype.eventNames=function(){return this._eventsCount>0?z(this._events):[]};function x(D,E){for(var I=new Array(E),M=0;M{var d=qg().EventEmitter,y={init:function(z){if(z._ev instanceof d)return z;var P=new d,i=new d;return z._ev=P,z._internalEv=i,z.on=P.on.bind(P),z.once=P.once.bind(P),z.removeListener=P.removeListener.bind(P),z.removeAllListeners=P.removeAllListeners.bind(P),z._internalOn=i.on.bind(i),z._internalOnce=i.once.bind(i),z._removeInternalListener=i.removeListener.bind(i),z._removeAllInternalListeners=i.removeAllListeners.bind(i),z.emit=function(n,a){P.emit(n,a),i.emit(n,a)},typeof z.addEventListener=="function"&&z.addEventListener("wheel",()=>{},{passive:!0}),z},triggerHandler:function(z,P,i){var n,a=z._ev;if(!a)return;var l=a._events[P];if(!l)return;function o(s){if(s.listener){if(a.removeListener(P,s.listener),!s.fired)return s.fired=!0,s.listener.apply(a,[i])}else return s.apply(a,[i])}l=Array.isArray(l)?l:[l];var u;for(u=0;u{var d=ji(),y=ss().dfltConfig;function z(i,n){for(var a=[],l,o=0;oy.queueLength&&(i.undoQueue.queue.shift(),i.undoQueue.index--)},P.startSequence=function(i){i.undoQueue=i.undoQueue||{index:0,queue:[],sequence:!1},i.undoQueue.sequence=!0,i.undoQueue.beginSequence=!0},P.stopSequence=function(i){i.undoQueue=i.undoQueue||{index:0,queue:[],sequence:!1},i.undoQueue.sequence=!1,i.undoQueue.beginSequence=!1},P.undo=function(i){var n,a;if(!(i.undoQueue===void 0||isNaN(i.undoQueue.index)||i.undoQueue.index<=0)){for(i.undoQueue.index--,n=i.undoQueue.queue[i.undoQueue.index],i.undoQueue.inSequence=!0,a=0;a=i.undoQueue.queue.length)){for(n=i.undoQueue.queue[i.undoQueue.index],i.undoQueue.inSequence=!0,a=0;a{Y.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}),Zg=ze(te=>{var Y=as(),d=ji(),y=xa(),z=w_(),P=w4(),i=Fl(),n=ss().configAttributes,a=oh(),l=d.extendDeepAll,o=d.isPlainObject,u=d.isArrayOrTypedArray,s=d.nestedProperty,h=d.valObjectMeta,m="_isSubplotObj",b="_isLinkedToArray",x="_arrayAttrRegexps",_="_deprecated",A=[m,b,x,_];te.IS_SUBPLOT_OBJ=m,te.IS_LINKED_TO_ARRAY=b,te.DEPRECATED=_,te.UNDERSCORE_ATTRS=A,te.get=function(){var B={};return Y.allTypes.forEach(function(U){B[U]=D(U)}),{defs:{valObjects:h,metaKeys:A.concat(["description","role","editType","impliedEdits"]),editType:{traces:a.traces,layout:a.layout},impliedEdits:{}},traces:B,layout:E(),frames:I(),animation:M(i),config:M(n)}},te.crawl=function(B,U,V,W){var F=V||0;W=W||"",Object.keys(B).forEach(function(H){var q=B[H];if(A.indexOf(H)===-1){var G=(W?W+".":"")+H;U(q,H,B,F,G),!te.isValObject(q)&&o(q)&&H!=="impliedEdits"&&te.crawl(q,U,F+1,G)}})},te.isValObject=function(B){return B&&B.valType!==void 0},te.findArrayAttributes=function(B){var U=[],V=[],W=[],F,H;function q(ee,he,be,ve){V=V.slice(0,ve).concat([he]),W=W.slice(0,ve).concat([ee&&ee._isLinkedToArray]);var ce=ee&&(ee.valType==="data_array"||ee.arrayOk===!0)&&!(V[ve-1]==="colorbar"&&(he==="ticktext"||he==="tickvals"));ce&&G(F,0,"")}function G(ee,he,be){var ve=ee[V[he]],ce=be+V[he];if(he===V.length-1)u(ve)&&U.push(H+ce);else if(W[he]){if(Array.isArray(ve))for(var re=0;re=H.length)return!1;if(B.dimensions===2){if(V++,U.length===V)return B;var q=U[V];if(!w(q))return!1;B=H[F][q]}else B=H[F]}else B=H}}return B}function w(B){return B===Math.round(B)&&B>=0}function D(B){var U,V;U=Y.modules[B]._module,V=U.basePlotModule;var W={};W.type=null;var F=l({},y),H=l({},U.attributes);te.crawl(H,function(ee,he,be,ve,ce){s(F,ce).set(void 0),ee===void 0&&s(H,ce).set(void 0)}),l(W,F),Y.traceIs(B,"noOpacity")&&delete W.opacity,Y.traceIs(B,"showLegend")||(delete W.showlegend,delete W.legendgroup),Y.traceIs(B,"noHover")&&(delete W.hoverinfo,delete W.hoverlabel),U.selectPoints||delete W.selectedpoints,l(W,H),V.attributes&&l(W,V.attributes),W.type=B;var q={meta:U.meta||{},categories:U.categories||{},animatable:!!U.animatable,type:B,attributes:M(W)};if(U.layoutAttributes){var G={};l(G,U.layoutAttributes),q.layoutAttributes=M(G)}return U.animatable||te.crawl(q,function(ee){te.isValObject(ee)&&"anim"in ee&&delete ee.anim}),q}function E(){var B={},U,V;l(B,z);for(U in Y.subplotsRegistry)if(V=Y.subplotsRegistry[U],!!V.layoutAttributes)if(Array.isArray(V.attr))for(var W=0;W{var Y=ji(),d=xa(),y="templateitemname",z={name:{valType:"string",editType:"none"}};z[y]={valType:"string",editType:"calc"},te.templatedArray=function(n,a){return a._isLinkedToArray=n,a.name=z.name,a[y]=z[y],a},te.traceTemplater=function(n){var a={},l,o;for(l in n)o=n[l],Array.isArray(o)&&o.length&&(a[l]=0);function u(s){l=Y.coerce(s,{},d,"type");var h={type:l,_template:null};if(l in a){o=n[l];var m=a[l]%o.length;a[l]++,h._template=o[m]}return h}return{newTrace:u}},te.newContainer=function(n,a,l){var o=n._template,u=o&&(o[a]||l&&o[l]);Y.isPlainObject(u)||(u=null);var s=n[a]={_template:u};return s},te.arrayTemplater=function(n,a,l){var o=n._template,u=o&&o[i(a)],s=o&&o[a];(!Array.isArray(s)||!s.length)&&(s=[]);var h={};function m(x){var _={name:x.name,_input:x},A=_[y]=x[y];if(!P(A))return _._template=u,_;for(var f=0;f=o&&(l._input||{})._templateitemname;s&&(u=o);var h=a+"["+u+"]",m;function b(){m={},s&&(m[h]={},m[h][y]=s)}b();function x(k,w){m[k]=w}function _(k,w){s?Y.nestedProperty(m[h],k).set(w):m[h+"."+k]=w}function A(){var k=m;return b(),k}function f(k,w){k&&_(k,w);var D=A();for(var E in D)Y.nestedProperty(n,E).set(D[E])}return{modifyBase:x,modifyItem:_,getUpdateObj:A,applyUpdate:f}}}),dc=ze((te,Y)=>{var d=go().counter;Y.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}),Zc=ze(te=>{var Y=as(),d=dc();te.id2name=function(z){if(!(typeof z!="string"||!z.match(d.AX_ID_PATTERN))){var P=z.split(" ")[0].substr(1);return P==="1"&&(P=""),z.charAt(0)+"axis"+P}},te.name2id=function(z){if(z.match(d.AX_NAME_PATTERN)){var P=z.substr(5);return P==="1"&&(P=""),z.charAt(0)+P}},te.cleanId=function(z,P,i){var n=/( domain)$/.test(z);if(!(typeof z!="string"||!z.match(d.AX_ID_PATTERN))&&!(P&&z.charAt(0)!==P)&&!(n&&!i)){var a=z.split(" ")[0].substr(1).replace(/^0+/,"");return a==="1"&&(a=""),z.charAt(0)+a+(n&&i?" domain":"")}},te.list=function(z,P,i){var n=z._fullLayout;if(!n)return[];var a=te.listIds(z,P),l=new Array(a.length),o;for(o=0;on?1:-1:+(z.substr(1)||1)-+(P.substr(1)||1)},te.ref2id=function(z){return/^[xyz]/.test(z)?z.split(" ")[0]:!1};function y(z,P){if(P&&P.length){for(var i=0;i{function d(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".outline-controllers").remove()}function y(z){var P=z._fullLayout._zoomlayer;P&&P.selectAll(".select-outline").remove(),z._fullLayout._outlining=!1}Y.exports={clearOutlineControllers:d,clearOutline:y}}),Fv=ze((te,Y)=>{Y.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}),Ed=ze(te=>{var Y=as();dc().SUBPLOT_PATTERN,te.getSubplotCalcData=function(d,y,z){var P=Y.subplotsRegistry[y];if(!P)return[];for(var i=P.attr,n=[],a=0;a{var Y=as(),d=ji();te.manageCommandObserver=function(a,l,o,u){var s={},h=!0;l&&l._commandObserver&&(s=l._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var m=te.hasSimpleAPICommandBindings(a,o,s.lookupTable);if(l&&l._commandObserver){if(m)return s;if(l._commandObserver.remove)return l._commandObserver.remove(),l._commandObserver=null,s}if(m){y(a,m,s.cache),s.check=function(){if(h){var _=y(a,m,s.cache);return _.changed&&u&&s.lookupTable[_.value]!==void 0&&(s.disable(),Promise.resolve(u({value:_.value,type:m.type,prop:m.prop,traces:m.traces,index:s.lookupTable[_.value]})).then(s.enable,s.enable)),_.changed}};for(var b=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0?".":"")+s;d.isPlainObject(h)?n(h,l,m,u+1):l(m,s,h)}})}}),sh=ze((te,Y)=>{var d=ri(),y=yi().timeFormatLocale,z=gr().formatLocale,P=Sr(),i=Jr(),n=as(),a=Zg(),l=ku(),o=ji(),u=Xi(),s=ei().BADNUM,h=Zc(),m=Am().clearOutline,b=Fv(),x=Fl(),_=w4(),A=Ed().getModuleCalcData,f=o.relinkPrivateKeys,k=o._,w=Y.exports={};o.extendFlat(w,n),w.attributes=xa(),w.attributes.type.values=w.allTypes,w.fontAttrs=On(),w.layoutAttributes=w_();var D=C_();w.executeAPICommand=D.executeAPICommand,w.computeAPICommandBindings=D.computeAPICommandBindings,w.manageCommandObserver=D.manageCommandObserver,w.hasSimpleAPICommandBindings=D.hasSimpleAPICommandBindings,w.redrawText=function(re){return re=o.getGraphDiv(re),new Promise(function(ge){setTimeout(function(){re._fullLayout&&(n.getComponentMethod("annotations","draw")(re),n.getComponentMethod("legend","draw")(re),n.getComponentMethod("colorbar","draw")(re),ge(w.previousPromises(re)))},300)})},w.resize=function(re){re=o.getGraphDiv(re);var ge,ne=new Promise(function(se,_e){(!re||o.isHidden(re))&&_e(new Error("Resize must be passed a displayed plot div element.")),re._redrawTimer&&clearTimeout(re._redrawTimer),re._resolveResize&&(ge=re._resolveResize),re._resolveResize=se,re._redrawTimer=setTimeout(function(){if(!re.layout||re.layout.width&&re.layout.height||o.isHidden(re)){se(re);return}delete re.layout.width,delete re.layout.height;var oe=re.changed;re.autoplay=!0,n.call("relayout",re,{autosize:!0}).then(function(){re.changed=oe,re._resolveResize===se&&(delete re._resolveResize,se(re))})},100)});return ge&&ge(ne),ne},w.previousPromises=function(re){if((re._promises||[]).length)return Promise.all(re._promises).then(function(){re._promises=[]})},w.addLinks=function(re){if(!(!re._context.showLink&&!re._context.showSources)){var ge=re._fullLayout,ne=o.ensureSingle(ge._paper,"text","js-plot-link-container",function(fe){fe.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:u.defaultLine,"pointer-events":"all"}).each(function(){var Ce=d.select(this);Ce.append("tspan").classed("js-link-to-tool",!0),Ce.append("tspan").classed("js-link-spacer",!0),Ce.append("tspan").classed("js-sourcelinks",!0)})}),se=ne.node(),_e={y:ge._paper.attr("height")-9};document.body.contains(se)&&se.getComputedTextLength()>=ge.width-20?(_e["text-anchor"]="start",_e.x=5):(_e["text-anchor"]="end",_e.x=ge._paper.attr("width")-7),ne.attr(_e);var oe=ne.select(".js-link-to-tool"),J=ne.select(".js-link-spacer"),me=ne.select(".js-sourcelinks");re._context.showSources&&re._context.showSources(re),re._context.showLink&&E(re,oe),J.text(oe.text()&&me.text()?" - ":"")}};function E(re,ge){ge.text("");var ne=ge.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(re._context.linkText+" »");if(re._context.sendData)ne.on("click",function(){w.sendDataToCloud(re)});else{var se=window.location.pathname.split("/"),_e=window.location.search;ne.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+se[2].split(".")[0]+"/"+se[1]+_e})}}w.sendDataToCloud=function(re){var ge=(window.PLOTLYENV||{}).BASE_URL||re._context.plotlyServerURL;if(ge){re.emit("plotly_beforeexport");var ne=d.select(re).append("div").attr("id","hiddenform").style("display","none"),se=ne.append("form").attr({action:ge+"/external",method:"post",target:"_blank"}),_e=se.append("input").attr({type:"text",name:"data"});return _e.node().value=w.graphJson(re,!1,"keepdata"),se.node().submit(),ne.remove(),re.emit("plotly_afterexport"),!1}};var I=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];w.supplyDefaults=function(re,ge){var ne=ge&&ge.skipUpdateCalc,se=re._fullLayout||{};if(se._skipDefaults){delete se._skipDefaults;return}var _e=re._fullLayout={},oe=re.layout||{},J=re._fullData||[],me=re._fullData=[],fe=re.data||[],Ce=re.calcdata||[],Re=re._context||{},Be;re._transitionData||w.createTransitionData(re),_e._dfltTitle={plot:k(re,"Click to enter Plot title"),subtitle:k(re,"Click to enter Plot subtitle"),x:k(re,"Click to enter X axis title"),y:k(re,"Click to enter Y axis title"),colorbar:k(re,"Click to enter Colorscale title"),annotation:k(re,"new text")},_e._traceWord=k(re,"trace");var Ze=C(re,I);if(_e._mapboxAccessToken=Re.mapboxAccessToken,se._initialAutoSizeIsDone){var Ge=se.width,tt=se.height;w.supplyLayoutGlobalDefaults(oe,_e,Ze),oe.width||(_e.width=Ge),oe.height||(_e.height=tt),w.sanitizeMargins(_e)}else{w.supplyLayoutGlobalDefaults(oe,_e,Ze);var _t=!oe.width||!oe.height,mt=_e.autosize,vt=Re.autosizable,ct=_t&&(mt||vt);ct?w.plotAutoSize(re,oe,_e):_t&&w.sanitizeMargins(_e),!mt&&_t&&(oe.width=_e.width,oe.height=_e.height)}_e._d3locale=T(Ze,_e.separators),_e._extraFormat=C(re,M),_e._initialAutoSizeIsDone=!0,_e._dataLength=fe.length,_e._modules=[],_e._visibleModules=[],_e._basePlotModules=[];var Ae=_e._subplots=g(),Oe=_e._splomAxes={x:{},y:{}},Le=_e._splomSubplots={};_e._splomGridDflt={},_e._scatterStackOpts={},_e._firstScatter={},_e._alignmentOpts={},_e._colorAxes={},_e._requestRangeslider={},_e._traceUids=p(J,fe),w.supplyDataDefaults(fe,me,oe,_e);var nt=Object.keys(Oe.x),xt=Object.keys(Oe.y);if(nt.length>1&&xt.length>1){for(n.getComponentMethod("grid","sizeDefaults")(oe,_e),Be=0;Be15&&xt.length>15&&_e.shapes.length===0&&_e.images.length===0,w.linkSubplots(me,_e,J,se),w.cleanPlot(me,_e,J,se);var vr=!!(se._has&&se._has("cartesian")),mr=!!(_e._has&&_e._has("cartesian")),Yr=vr,ii=mr;Yr&&!ii?se._bgLayer.remove():ii&&!Yr&&(_e._shouldCreateBgLayer=!0),se._zoomlayer&&!re._dragging&&m({_fullLayout:se}),N(me,_e),f(_e,se),n.getComponentMethod("colorscale","crossTraceDefaults")(me,_e),_e._preGUI||(_e._preGUI={}),_e._tracePreGUI||(_e._tracePreGUI={});var Lr=_e._tracePreGUI,ci={},vi;for(vi in Lr)ci[vi]="old";for(Be=0;Be0){var Ce=1-2*_e;oe=Math.round(Ce*oe),J=Math.round(Ce*J)}}var Re=w.layoutAttributes.width.min,Be=w.layoutAttributes.height.min;oe1,Ge=!ge.height&&Math.abs(ne.height-J)>1;(Ge||Ze)&&(Ze&&(ne.width=oe),Ge&&(ne.height=J)),re._initialAutoSize||(re._initialAutoSize={width:oe,height:J}),w.sanitizeMargins(ne)},w.supplyLayoutModuleDefaults=function(re,ge,ne,se){var _e=n.componentsRegistry,oe=ge._basePlotModules,J,me,fe,Ce=n.subplotsRegistry.cartesian;for(J in _e)fe=_e[J],fe.includeBasePlot&&fe.includeBasePlot(re,ge);oe.length||oe.push(Ce),ge._has("cartesian")&&(n.getComponentMethod("grid","contentDefaults")(re,ge),Ce.finalizeSubplots(re,ge));for(var Re in ge._subplots)ge._subplots[Re].sort(o.subplotSort);for(me=0;me1&&(ne.l/=mt,ne.r/=mt)}if(Ze){var vt=(ne.t+ne.b)/Ze;vt>1&&(ne.t/=vt,ne.b/=vt)}var ct=ne.xl!==void 0?ne.xl:ne.x,Ae=ne.xr!==void 0?ne.xr:ne.x,Oe=ne.yt!==void 0?ne.yt:ne.y,Le=ne.yb!==void 0?ne.yb:ne.y;Ge[ge]={l:{val:ct,size:ne.l+_t},r:{val:Ae,size:ne.r+_t},b:{val:Le,size:ne.b+_t},t:{val:Oe,size:ne.t+_t}},tt[ge]=1}if(!se._replotting)return w.doAutoMargin(re)}};function H(re){if("_redrawFromAutoMarginCount"in re._fullLayout)return!1;var ge=h.list(re,"",!0);for(var ne in ge)if(ge[ne].autoshift||ge[ne].shift)return!0;return!1}w.doAutoMargin=function(re){var ge=re._fullLayout,ne=ge.width,se=ge.height;ge._size||(ge._size={}),V(ge);var _e=ge._size,oe=ge.margin,J={t:0,b:0,l:0,r:0},me=o.extendFlat({},_e),fe=oe.l,Ce=oe.r,Re=oe.t,Be=oe.b,Ze=ge._pushmargin,Ge=ge._pushmarginIds,tt=ge.minreducedwidth,_t=ge.minreducedheight;if(oe.autoexpand!==!1){for(var mt in Ze)Ge[mt]||delete Ze[mt];var vt=re._fullLayout._reservedMargin;for(var ct in vt)for(var Ae in vt[ct]){var Oe=vt[ct][Ae];J[Ae]=Math.max(J[Ae],Oe)}Ze.base={l:{val:0,size:fe},r:{val:1,size:Ce},t:{val:1,size:Re},b:{val:0,size:Be}};for(var Le in J){var nt=0;for(var xt in Ze)xt!=="base"&&P(Ze[xt][Le].size)&&(nt=Ze[xt][Le].size>nt?Ze[xt][Le].size:nt);var ut=Math.max(0,oe[Le]-nt);J[Le]=Math.max(0,J[Le]-ut)}for(var Et in Ze){var Gt=Ze[Et].l||{},Qt=Ze[Et].b||{},vr=Gt.val,mr=Gt.size,Yr=Qt.val,ii=Qt.size,Lr=ne-J.r-J.l,ci=se-J.t-J.b;for(var vi in Ze){if(P(mr)&&Ze[vi].r){var Ot=Ze[vi].r.val,Xe=Ze[vi].r.size;if(Ot>vr){var ot=(mr*Ot+(Xe-Lr)*vr)/(Ot-vr),De=(Xe*(1-vr)+(mr-Lr)*(1-Ot))/(Ot-vr);ot+De>fe+Ce&&(fe=ot,Ce=De)}}if(P(ii)&&Ze[vi].t){var ye=Ze[vi].t.val,Pe=Ze[vi].t.size;if(ye>Yr){var He=(ii*ye+(Pe-ci)*Yr)/(ye-Yr),at=(Pe*(1-Yr)+(ii-ci)*(1-ye))/(ye-Yr);He+at>Be+Re&&(Be=He,Re=at)}}}}}var ht=o.constrain(ne-oe.l-oe.r,W,tt),At=o.constrain(se-oe.t-oe.b,F,_t),Wt=Math.max(0,ne-ht),Yt=Math.max(0,se-At);if(Wt){var hr=(fe+Ce)/Wt;hr>1&&(fe/=hr,Ce/=hr)}if(Yt){var zr=(Be+Re)/Yt;zr>1&&(Be/=zr,Re/=zr)}if(_e.l=Math.round(fe)+J.l,_e.r=Math.round(Ce)+J.r,_e.t=Math.round(Re)+J.t,_e.b=Math.round(Be)+J.b,_e.p=Math.round(oe.pad),_e.w=Math.round(ne)-_e.l-_e.r,_e.h=Math.round(se)-_e.t-_e.b,!ge._replotting&&(w.didMarginChange(me,_e)||H(re))){"_redrawFromAutoMarginCount"in ge?ge._redrawFromAutoMarginCount++:ge._redrawFromAutoMarginCount=1;var Dr=3*(1+Object.keys(Ge).length);if(ge._redrawFromAutoMarginCount1)return!0}return!1},w.graphJson=function(re,ge,ne,se,_e,oe){(_e&&ge&&!re._fullData||_e&&!ge&&!re._fullLayout)&&w.supplyDefaults(re);var J=_e?re._fullData:re.data,me=_e?re._fullLayout:re.layout,fe=(re._transitionData||{})._frames;function Ce(Ze,Ge){if(typeof Ze=="function")return Ge?"_function_":null;if(o.isPlainObject(Ze)){var tt={},_t;return Object.keys(Ze).sort().forEach(function(Ae){if(["_","["].indexOf(Ae.charAt(0))===-1){if(typeof Ze[Ae]=="function"){Ge&&(tt[Ae]="_function");return}if(ne==="keepdata"){if(Ae.substr(Ae.length-3)==="src")return}else if(ne==="keepstream"){if(_t=Ze[Ae+"src"],typeof _t=="string"&&_t.indexOf(":")>0&&!o.isPlainObject(Ze.stream))return}else if(ne!=="keepall"&&(_t=Ze[Ae+"src"],typeof _t=="string"&&_t.indexOf(":")>0))return;tt[Ae]=Ce(Ze[Ae],Ge)}}),tt}var mt=Array.isArray(Ze),vt=o.isTypedArray(Ze);if((mt||vt)&&Ze.dtype&&Ze.shape){var ct=Ze.bdata;return Ce({dtype:Ze.dtype,shape:Ze.shape,bdata:o.isArrayBuffer(ct)?i.encode(ct):ct},Ge)}return mt?Ze.map(function(Ae){return Ce(Ae,Ge)}):vt?o.simpleMap(Ze,o.identity):o.isJSDate(Ze)?o.ms2DateTimeLocal(+Ze):Ze}var Re={data:(J||[]).map(function(Ze){var Ge=Ce(Ze);return ge&&delete Ge.fit,Ge})};if(!ge&&(Re.layout=Ce(me),_e)){var Be=me._size;Re.layout.computed={margin:{b:Be.b,l:Be.l,r:Be.r,t:Be.t}}}return fe&&(Re.frames=Ce(fe)),oe&&(Re.config=Ce(re._context,!0)),se==="object"?Re:JSON.stringify(Re)},w.modifyFrames=function(re,ge){var ne,se,_e,oe=re._transitionData._frames,J=re._transitionData._frameHash;for(ne=0;ne0&&(re._transitioningWithDuration=!0),re._transitionData._interruptCallbacks.push(function(){se=!0}),ne.redraw&&re._transitionData._interruptCallbacks.push(function(){return n.call("redraw",re)}),re._transitionData._interruptCallbacks.push(function(){re.emit("plotly_transitioninterrupted",[])});var Ze=0,Ge=0;function tt(){return Ze++,function(){Ge++,!se&&Ge===Ze&&me(Be)}}ne.runFn(tt),setTimeout(tt())})}function me(Be){if(re._transitionData)return oe(re._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(ne.redraw)return n.call("redraw",re)}).then(function(){re._transitioning=!1,re._transitioningWithDuration=!1,re.emit("plotly_transitioned",[])}).then(Be)}function fe(){if(re._transitionData)return re._transitioning=!1,_e(re._transitionData._interruptCallbacks)}var Ce=[w.previousPromises,fe,ne.prepareFn,w.rehover,w.reselect,J],Re=o.syncOrAsync(Ce,re);return(!Re||!Re.then)&&(Re=Promise.resolve()),Re.then(function(){return re})}w.doCalcdata=function(re,ge){var ne=h.list(re),se=re._fullData,_e=re._fullLayout,oe,J,me,fe,Ce=new Array(se.length),Re=(re.calcdata||[]).slice();for(re.calcdata=Ce,_e._numBoxes=0,_e._numViolins=0,_e._violinScaleGroupStats={},re._hmpixcount=0,re._hmlumcount=0,_e._piecolormap={},_e._sunburstcolormap={},_e._treemapcolormap={},_e._iciclecolormap={},_e._funnelareacolormap={},me=0;me=0;fe--)if(Le[fe].enabled){oe._indexToPoints=Le[fe]._indexToPoints;break}J&&J.calc&&(Oe=J.calc(re,oe))}(!Array.isArray(Oe)||!Oe[0])&&(Oe=[{x:s,y:s}]),Oe[0].t||(Oe[0].t={}),Oe[0].trace=oe,Ce[ct]=Oe}}for(ve(ne,se,_e),me=0;me{te.xmlns="http://www.w3.org/2000/xmlns/",te.svg="http://www.w3.org/2000/svg",te.xlink="http://www.w3.org/1999/xlink",te.svgAttrs={xmlns:te.svg,"xmlns:xlink":te.xlink}}),Rf=ze((te,Y)=>{Y.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}}),cc=ze(te=>{var Y=ri(),d=ji(),y=d.strTranslate,z=k0(),P=Rf().LINE_SPACING,i=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;te.convertToTspans=function(F,H,q){var G=F.text(),ee=!F.attr("data-notex")&&H&&H._context.typesetMath&&typeof MathJax<"u"&&G.match(i),he=Y.select(F.node().parentNode);if(he.empty())return;var be=F.attr("class")?F.attr("class").split(" ")[0]:"text";be+="-math",he.selectAll("svg."+be).remove(),he.selectAll("g."+be+"-group").remove(),F.style("display",null).attr({"data-unformatted":G,"data-math":"N"});function ve(){he.empty()||(be=F.attr("class")+"-math",he.select("svg."+be).remove()),F.text("").style("white-space","pre");var ce=B(F.node(),G);ce&&F.style("pointer-events","all"),te.positionText(F),q&&q.call(F)}return ee?(H&&H._promises||[]).push(new Promise(function(ce){F.style("display","none");var re=parseInt(F.node().style.fontSize,10),ge={fontSize:re};u(ee[2],ge,function(ne,se,_e){he.selectAll("svg."+be).remove(),he.selectAll("g."+be+"-group").remove();var oe=ne&&ne.select("svg");if(!oe||!oe.node()){ve(),ce();return}var J=he.append("g").classed(be+"-group",!0).attr({"pointer-events":"none","data-unformatted":G,"data-math":"Y"});J.node().appendChild(oe.node()),se&&se.node()&&oe.node().insertBefore(se.node().cloneNode(!0),oe.node().firstChild);var me=_e.width,fe=_e.height;oe.attr({class:be,height:fe,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var Ce=F.node().style.fill||"black",Re=oe.select("g");Re.attr({fill:Ce,stroke:Ce});var Be=Re.node().getBoundingClientRect(),Ze=Be.width,Ge=Be.height;(Ze>me||Ge>fe)&&(oe.style("overflow","hidden"),Be=oe.node().getBoundingClientRect(),Ze=Be.width,Ge=Be.height);var tt=+F.attr("x"),_t=+F.attr("y"),mt=re||F.node().getBoundingClientRect().height,vt=-mt/4;if(be[0]==="y")J.attr({transform:"rotate("+[-90,tt,_t]+")"+y(-Ze/2,vt-Ge/2)});else if(be[0]==="l")_t=vt-Ge/2;else if(be[0]==="a"&&be.indexOf("atitle")!==0)tt=0,_t=vt;else{var ct=F.attr("text-anchor");tt=tt-Ze*(ct==="middle"?.5:ct==="end"?1:0),_t=_t+vt-Ge/2}oe.attr({x:tt,y:_t}),q&&q.call(F,J),ce(J)})})):ve(),F};var n=/(<|<|<)/g,a=/(>|>|>)/g;function l(F){return F.replace(n,"\\lt ").replace(a,"\\gt ")}var o=[["$","$"],["\\(","\\)"]];function u(F,H,q){var G=parseInt((MathJax.version||"").split(".")[0]);if(G!==2&&G!==3){d.warn("No MathJax version:",MathJax.version);return}var ee,he,be,ve,ce=function(){return he=d.extendDeepAll({},MathJax.Hub.config),be=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:o},displayAlign:"left"})},re=function(){he=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=o},ge=function(){if(ee=MathJax.Hub.config.menuSettings.renderer,ee!=="SVG")return MathJax.Hub.setRenderer("SVG")},ne=function(){ee=MathJax.config.startup.output,ee!=="svg"&&(MathJax.config.startup.output="svg")},se=function(){var Ce="math-output-"+d.randstr({},64);ve=Y.select("body").append("div").attr({id:Ce}).style({visibility:"hidden",position:"absolute","font-size":H.fontSize+"px"}).text(l(F));var Re=ve.node();return G===2?MathJax.Hub.Typeset(Re):MathJax.typeset([Re])},_e=function(){var Ce=ve.select(G===2?".MathJax_SVG":".MathJax"),Re=!Ce.empty()&&ve.select("svg").node();if(!Re)d.log("There was an error in the tex syntax.",F),q();else{var Be=Re.getBoundingClientRect(),Ze;G===2?Ze=Y.select("body").select("#MathJax_SVG_glyphs"):Ze=Ce.select("defs"),q(Ce,Ze,Be)}ve.remove()},oe=function(){if(ee!=="SVG")return MathJax.Hub.setRenderer(ee)},J=function(){ee!=="svg"&&(MathJax.config.startup.output=ee)},me=function(){return be!==void 0&&(MathJax.Hub.processSectionDelay=be),MathJax.Hub.Config(he)},fe=function(){MathJax.config=he};G===2?MathJax.Hub.Queue(ce,ge,se,_e,oe,me):G===3&&(re(),ne(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){se(),_e(),J(),fe()}))}var s={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},m={sub:"-0.21em",sup:"0.42em"},b="​",x=["http:","https:","mailto:","",void 0,":"],_=te.NEWLINES=/(\r\n?|\n)/g,A=/(<[^<>]*>)/,f=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;te.BR_TAG_ALL=//gi;var w=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,D=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,I=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function M(F,H){if(!F)return null;var q=F.match(H),G=q&&(q[3]||q[4]);return G&&T(G)}var p=/(^|;)\s*color:/;te.plainText=function(F,H){H=H||{};for(var q=H.len!==void 0&&H.len!==-1?H.len:1/0,G=H.allowedTags!==void 0?H.allowedTags:["br"],ee="...",he=ee.length,be=F.split(A),ve=[],ce="",re=0,ge=0;gehe?ve.push(ne.substr(0,J-he)+ee):ve.push(ne.substr(0,J));break}ce=""}}return ve.join("")};var g={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},C=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function T(F){return F.replace(C,function(H,q){var G;return q.charAt(0)==="#"?G=N(q.charAt(1)==="x"?parseInt(q.substr(2),16):parseInt(q.substr(1),10)):G=g[q],G||H})}te.convertEntities=T;function N(F){if(!(F>1114111)){var H=String.fromCodePoint;if(H)return H(F);var q=String.fromCharCode;return F<=65535?q(F):q((F>>10)+55232,F%1024+56320)}}function B(F,H){H=H.replace(_," ");var q=!1,G=[],ee,he=-1;function be(){he++;var Ge=document.createElementNS(z.svg,"tspan");Y.select(Ge).attr({class:"line",dy:he*P+"em"}),F.appendChild(Ge),ee=Ge;var tt=G;if(G=[{node:Ge}],tt.length>1)for(var _t=1;_t.",H);return}var tt=G.pop();Ge!==tt.type&&d.log("Start tag <"+tt.type+"> doesnt match end tag <"+Ge+">. Pretending it did match.",H),ee=G[G.length-1].node}var ge=k.test(H);ge?be():(ee=F,G=[{node:F}]);for(var ne=H.split(A),se=0;se{var d=ri(),y=ln(),z=Sr(),P=ji(),i=Xi(),n=$r().isValid;function a(_,A,f){var k=A?P.nestedProperty(_,A).get()||{}:_,w=k[f||"color"];w&&w._inputArray&&(w=w._inputArray);var D=!1;if(P.isArrayOrTypedArray(w)){for(var E=0;E=0;k--,w++){var D=_[k];f[w]=[1-D[0],D[1]]}return f}function m(_,A){A=A||{};for(var f=_.domain,k=_.range,w=k.length,D=new Array(w),E=0;E{var d=iw(),y=d.FORMAT_LINK,z=d.DATE_FORMAT_LINK;function P(a,l){return{valType:"string",dflt:"",editType:"none",description:(l?i:n)("hover text",a)+["By default the values are formatted using "+(l?"generic number format":"`"+a+"axis.hoverformat`")+"."].join(" ")}}function i(a,l){return["Sets the "+a+" formatting rule"+(l?"for `"+l+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+y+"."].join(" ")}function n(a,l){return i(a,l)+[" And for dates see: "+z+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}Y.exports={axisHoverFormat:P,descriptionOnlyNumbers:i,descriptionWithDates:n}}),Gd=ze((te,Y)=>{var d=On(),y=Mi(),z=qd().dash,P=nn().extendFlat,i=ku().templatedArray;rc().templateFormatStringDescription;var n=Sh().descriptionWithDates,a=ei().ONEDAY,l=dc(),o=l.HOUR_PATTERN,u=l.WEEKDAY_PATTERN,s={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},h=P({},s,{values:s.values.slice().concat(["sync"])});function m(p){return{valType:"integer",min:0,dflt:p?5:0,editType:"ticks"}}var b={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},x={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},_={valType:"data_array",editType:"ticks"},A={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function f(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=5),g}function k(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var w={valType:"color",dflt:y.defaultLine,editType:"ticks"},D={valType:"color",dflt:y.lightLine,editType:"ticks"};function E(p){var g={valType:"number",min:0,editType:"ticks"};return p||(g.dflt=1),g}var I=P({},z,{editType:"ticks"}),M={valType:"boolean",editType:"ticks"};Y.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:y.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:d({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"calc"},rangebreaks:i("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[u,o,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:a},editType:"calc"}),tickmode:h,nticks:m(),tick0:b,dtick:x,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:_,ticktext:{valType:"data_array",editType:"ticks"},ticks:A,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:f(),tickwidth:k(),tickcolor:w,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:P({},z,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:d({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:n("tick label")},tickformatstops:i("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:n("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:M,gridcolor:D,gridwidth:E(),griddash:I,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:y.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",l.idRegex.x.toString(),l.idRegex.y.toString()],editType:"plot"},minor:{tickmode:s,nticks:m("minor"),tick0:b,dtick:x,tickvals:_,ticks:A,ticklen:f("minor"),tickwidth:k("minor"),tickcolor:w,gridcolor:D,gridwidth:E("minor"),griddash:I,showgrid:M,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),A_=ze((te,Y)=>{var d=Gd(),y=On(),z=nn().extendFlat,P=oh().overrideAll;Y.exports=P({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:d.linecolor,outlinewidth:d.linewidth,bordercolor:d.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:d.minor.tickmode,nticks:d.nticks,tick0:d.tick0,dtick:d.dtick,tickvals:d.tickvals,ticktext:d.ticktext,ticks:z({},d.ticks,{dflt:""}),ticklabeloverflow:z({},d.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:d.ticklen,tickwidth:d.tickwidth,tickcolor:d.tickcolor,ticklabelstep:d.ticklabelstep,showticklabels:d.showticklabels,labelalias:d.labelalias,tickfont:y({}),tickangle:d.tickangle,tickformat:d.tickformat,tickformatstops:d.tickformatstops,tickprefix:d.tickprefix,showtickprefix:d.showtickprefix,ticksuffix:d.ticksuffix,showticksuffix:d.showticksuffix,separatethousands:d.separatethousands,exponentformat:d.exponentformat,minexponent:d.minexponent,showexponent:d.showexponent,title:{text:{valType:"string"},font:y({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}),Oc=ze((te,Y)=>{var d=A_(),y=go().counter,z=Xm(),P=$r().scales;z(P);function i(n){return"`"+n+"`"}Y.exports=function(n,a){n=n||"",a=a||{};var l=a.cLetter||"c";"onlyIfNumerical"in a&&a.onlyIfNumerical;var o="noScale"in a?a.noScale:n==="marker.line",u="showScaleDflt"in a?a.showScaleDflt:l==="z",s=typeof a.colorscaleDflt=="string"?P[a.colorscaleDflt]:null,h=a.editTypeOverride||"",m=n?n+".":"",b;"colorAttr"in a?(b=a.colorAttr,a.colorAttr):(b={z:"z",c:"color"}[l],""+i(m+b));var x=l+"auto",_=l+"min",A=l+"max",f=l+"mid",k={};k[_]=k[A]=void 0;var w={};w[x]=!1;var D={};return b==="color"&&(D.color={valType:"color",arrayOk:!0,editType:h||"style"},a.anim&&(D.color.anim=!0)),D[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:k},D[_]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[A]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:w},D[f]={valType:"number",dflt:null,editType:"calc",impliedEdits:k},D.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},D.autocolorscale={valType:"boolean",dflt:a.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},D.reversescale={valType:"boolean",dflt:!1,editType:"plot"},o||(D.showscale={valType:"boolean",dflt:u,editType:"calc"},D.colorbar=d),a.noColorAxis||(D.coloraxis={valType:"subplotid",regex:y("coloraxis"),dflt:null,editType:"calc"}),D}}),Hu=ze((te,Y)=>{var d=nn().extendFlat,y=Oc(),z=$r().scales;Y.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:z.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:z.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:z.RdBu,editType:"calc"}},coloraxis:d({_isSubplotObj:!0,editType:"calc"},y("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}),Mm=ze((te,Y)=>{var d=ji();Y.exports=function(y){return d.isPlainObject(y.colorbar)}}),Yh=ze(te=>{var Y=Sr(),d=ji(),y=ei(),z=y.ONEDAY,P=y.ONEWEEK;te.dtick=function(i,n){var a=n==="log",l=n==="date",o=n==="category",u=l?z:1;if(!i)return u;if(Y(i))return i=Number(i),i<=0?u:o?Math.max(1,Math.round(i)):l?Math.max(.1,i):i;if(typeof i!="string"||!(l||a))return u;var s=i.charAt(0),h=i.substr(1);return h=Y(h)?Number(h):0,h<=0||!(l&&s==="M"&&h===Math.round(h)||a&&s==="L"||a&&s==="D"&&(h===1||h===2))?u:i},te.tick0=function(i,n,a,l){if(n==="date")return d.cleanDate(i,d.dateTick0(a,l%P===0?1:0));if(!(l==="D1"||l==="D2"))return Y(i)?Number(i):0}}),Nv=ze((te,Y)=>{var d=Yh(),y=ji().isArrayOrTypedArray,z=Di().isTypedArraySpec,P=Di().decodeTypedArraySpec;Y.exports=function(i,n,a,l,o){o||(o={});var u=o.isMinor,s=u?i.minor||{}:i,h=u?n.minor:n,m=u?"minor.":"";function b(E){var I=s[E];return z(I)&&(I=P(I)),I!==void 0?I:(h._template||{})[E]}var x=b("tick0"),_=b("dtick"),A=b("tickvals"),f=y(A)?"array":_?"linear":"auto",k=a(m+"tickmode",f);if(k==="auto"||k==="sync")a(m+"nticks");else if(k==="linear"){var w=h.dtick=d.dtick(_,l);h.tick0=d.tick0(x,l,n.calendar,w)}else if(l!=="multicategory"){var D=a(m+"tickvals");D===void 0?h.tickmode="auto":u||a("ticktext")}}}),jv=ze((te,Y)=>{var d=ji(),y=Gd();Y.exports=function(z,P,i,n){var a=n.isMinor,l=a?z.minor||{}:z,o=a?P.minor:P,u=a?y.minor:y,s=a?"minor.":"",h=d.coerce2(l,o,u,"ticklen",a?(P.ticklen||5)*.6:void 0),m=d.coerce2(l,o,u,"tickwidth",a?P.tickwidth||1:void 0),b=d.coerce2(l,o,u,"tickcolor",(a?P.tickcolor:void 0)||o.color),x=i(s+"ticks",!a&&n.outerTicks||h||m||b?"outside":"");x||(delete o.ticklen,delete o.tickwidth,delete o.tickcolor)}}),Jx=ze((te,Y)=>{Y.exports=function(d){var y=["showexponent","showtickprefix","showticksuffix"],z=y.filter(function(i){return d[i]!==void 0}),P=function(i){return d[i]===d[z[0]]};if(z.every(P)||z.length===1)return d[z[0]]}}),Zd=ze((te,Y)=>{var d=ji(),y=ku();Y.exports=function(z,P,i){var n=i.name,a=i.inclusionAttr||"visible",l=P[n],o=d.isArrayOrTypedArray(z[n])?z[n]:[],u=P[n]=[],s=y.arrayTemplater(P,n,a),h,m;for(h=0;h{var d=ji(),y=Xi().contrast,z=Gd(),P=Jx(),i=Zd();Y.exports=function(a,l,o,u,s){s||(s={});var h=o("labelalias");d.isPlainObject(h)||delete l.labelalias;var m=P(a),b=o("showticklabels");if(b){s.noTicklabelshift||o("ticklabelshift"),s.noTicklabelstandoff||o("ticklabelstandoff");var x=s.font||{},_=l.color,A=l.ticklabelposition||"",f=A.indexOf("inside")!==-1?y(s.bgColor):_&&_!==z.color.dflt?_:x.color;if(d.coerceFont(o,"tickfont",x,{overrideDflt:{color:f}}),!s.noTicklabelstep&&u!=="multicategory"&&u!=="log"&&o("ticklabelstep"),!s.noAng){var k=o("tickangle");!s.noAutotickangles&&k==="auto"&&o("autotickangles")}if(u!=="category"){var w=o("tickformat");i(a,l,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:n}),l.tickformatstops.length||delete l.tickformatstops,!s.noExp&&!w&&u!=="date"&&(o("showexponent",m),o("exponentformat"),o("minexponent"),o("separatethousands"))}!s.noMinorloglabels&&u==="log"&&o("minorloglabels")}};function n(a,l){function o(s,h){return d.coerce(a,l,z.tickformatstops,s,h)}var u=o("enabled");u&&(o("dtickrange"),o("value"))}}),Tg=ze((te,Y)=>{var d=Jx();Y.exports=function(y,z,P,i,n){n||(n={});var a=n.tickSuffixDflt,l=d(y),o=P("tickprefix");o&&P("showtickprefix",l);var u=P("ticksuffix",a);u&&P("showticksuffix",l)}}),X1=ze((te,Y)=>{var d=ji(),y=ku(),z=Nv(),P=jv(),i=G0(),n=Tg(),a=A_();Y.exports=function(l,o,u){var s=y.newContainer(o,"colorbar"),h=l.colorbar||{};function m(F,H){return d.coerce(h,s,a,F,H)}var b=u.margin||{t:0,b:0,l:0,r:0},x=u.width-b.l-b.r,_=u.height-b.t-b.b,A=m("orientation"),f=A==="v",k=m("thicknessmode");m("thickness",k==="fraction"?30/(f?x:_):30);var w=m("lenmode");m("len",w==="fraction"?1:f?_:x);var D=m("yref"),E=m("xref"),I=D==="paper",M=E==="paper",p,g,C,T="left";f?(C="middle",T=M?"left":"right",p=M?1.02:1,g=.5):(C=I?"bottom":"top",T="center",p=.5,g=I?1.02:1),d.coerce(h,s,{x:{valType:"number",min:M?-2:0,max:M?3:1,dflt:p}},"x"),d.coerce(h,s,{y:{valType:"number",min:I?-2:0,max:I?3:1,dflt:g}},"y"),m("xanchor",T),m("xpad"),m("yanchor",C),m("ypad"),d.noneOrAll(h,s,["x","y"]),m("outlinecolor"),m("outlinewidth"),m("bordercolor"),m("borderwidth"),m("bgcolor");var N=d.coerce(h,s,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:f?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");m("ticklabeloverflow",N.indexOf("inside")!==-1?"hide past domain":"hide past div"),z(h,s,m,"linear");var B=u.font,U={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:B};N.indexOf("inside")!==-1&&(U.bgColor="black"),n(h,s,m,"linear",U),i(h,s,m,"linear",U),P(h,s,m,"linear",U),m("title.text",u._dfltTitle.colorbar);var V=s.showticklabels?s.tickfont:B,W=d.extendFlat({},B,{family:V.family,size:d.bigFont(V.size)});d.coerceFont(m,"title.font",W),m("title.side",f?"top":"right")}}),Cc=ze((te,Y)=>{var d=Sr(),y=ji(),z=Mm(),P=X1(),i=$r().isValid,n=as().traceIs;function a(l,o){var u=o.slice(0,o.length-1);return o?y.nestedProperty(l,u).get()||{}:l}Y.exports=function l(o,u,s,h,m){var b=m.prefix,x=m.cLetter,_="_module"in u,A=a(o,b),f=a(u,b),k=a(u._template||{},b)||{},w=function(){return delete o.coloraxis,delete u.coloraxis,l(o,u,s,h,m)};if(_){var D=s._colorAxes||{},E=h(b+"coloraxis");if(E){var I=n(u,"contour")&&y.nestedProperty(u,"contours.coloring").get()||"heatmap",M=D[E];M?(M[2].push(w),M[0]!==I&&(M[0]=!1,y.warn(["Ignoring coloraxis:",E,"setting","as it is linked to incompatible colorscales."].join(" ")))):D[E]=[I,u,[w]];return}}var p=A[x+"min"],g=A[x+"max"],C=d(p)&&d(g)&&p{var d=ji(),y=ku(),z=Hu(),P=Cc();Y.exports=function(i,n){function a(x,_){return d.coerce(i,n,z,x,_)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var l=n._colorAxes,o,u;function s(x,_){return d.coerce(o,u,z.coloraxis,x,_)}for(var h in l){var m=l[h];if(m[0])o=i[h]||{},u=y.newContainer(n,h,"coloraxis"),u._name=h,P(o,u,n,s,{prefix:"",cLetter:"c"});else{for(var b=0;b{var d=ji(),y=hp().hasColorscale,z=hp().extractOpts;Y.exports=function(P,i){function n(m,b){var x=m["_"+b];x!==void 0&&(m[b]=x)}function a(m,b){var x=b.container?d.nestedProperty(m,b.container).get():m;if(x)if(x.coloraxis)x._colorAx=i[x.coloraxis];else{var _=z(x),A=_.auto;(A||_.min===void 0)&&n(x,b.min),(A||_.max===void 0)&&n(x,b.max),_.autocolorscale&&n(x,"colorscale")}}for(var l=0;l{var d=Sr(),y=ji(),z=hp().extractOpts;Y.exports=function(P,i,n){var a=P._fullLayout,l=n.vals,o=n.containerStr,u=o?y.nestedProperty(i,o).get():i,s=z(u),h=s.auto!==!1,m=s.min,b=s.max,x=s.mid,_=function(){return y.aggNums(Math.min,null,l)},A=function(){return y.aggNums(Math.max,null,l)};if(m===void 0?m=_():h&&(u._colorAx&&d(m)?m=Math.min(m,_()):m=_()),b===void 0?b=A():h&&(u._colorAx&&d(b)?b=Math.max(b,A()):b=A()),h&&x!==void 0&&(b-x>x-m?m=x-(b-x):b-x=0?f=a.colorscale.sequential:f=a.colorscale.sequentialminus,s._sync("colorscale",f)}}}),lh=ze((te,Y)=>{var d=$r(),y=hp();Y.exports={moduleType:"component",name:"colorscale",attributes:Oc(),layoutAttributes:Hu(),supplyLayoutDefaults:Uv(),handleDefaults:Cc(),crossTraceDefaults:k4(),calc:Tp(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:y.hasColorscale,extractOpts:y.extractOpts,extractScale:y.extractScale,flipScale:y.flipScale,makeColorScaleFunc:y.makeColorScaleFunc,makeColorScaleFuncFromTrace:y.makeColorScaleFuncFromTrace}}),Bc=ze((te,Y)=>{var d=ji(),y=Di().isTypedArraySpec;Y.exports={hasLines:function(z){return z.visible&&z.mode&&z.mode.indexOf("lines")!==-1},hasMarkers:function(z){return z.visible&&(z.mode&&z.mode.indexOf("markers")!==-1||z.type==="splom")},hasText:function(z){return z.visible&&z.mode&&z.mode.indexOf("text")!==-1},isBubble:function(z){var P=z.marker;return d.isPlainObject(P)&&(d.isArrayOrTypedArray(P.size)||y(P.size))}}}),$v=ze((te,Y)=>{var d=Sr();Y.exports=function(y,z){z||(z=2);var P=y.marker,i=P.sizeref||1,n=P.sizemin||0,a=P.sizemode==="area"?function(l){return Math.sqrt(l/i)}:function(l){return l/i};return function(l){var o=a(l/z);return d(o)&&o>0?Math.max(o,n):0}}}),T0=ze(te=>{var Y=ji();te.getSubplot=function(n){return n.subplot||n.xaxis+n.yaxis||n.geo},te.isTraceInSubplots=function(n,a){if(n.type==="splom"){for(var l=n.xaxes||[],o=n.yaxes||[],u=0;u=0&&l.index{Y.exports=z;var d={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function z(n){var a=[];return n.replace(y,function(l,o,u){var s=o.toLowerCase();for(u=i(u),s=="m"&&u.length>2&&(a.push([o].concat(u.splice(0,2))),s="l",o=o=="m"?"l":"L");;){if(u.length==d[s])return u.unshift(o),a.push(u);if(u.length{var d=M_(),y=function(x,_){return _?Math.round(x*(_=Math.pow(10,_)))/_:Math.round(x)},z="M0,0Z",P=Math.sqrt(2),i=Math.sqrt(3),n=Math.PI,a=Math.cos,l=Math.sin;Y.exports={circle:{n:0,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k="M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z";return A?b(_,A,k):k}},square:{n:1,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")}},diamond:{n:2,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"Z")}},cross:{n:3,f:function(x,_,A){if(o(_))return z;var f=y(x*.4,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+f+"H"+f+"V"+k+"H-"+f+"V"+f+"H-"+k+"V-"+f+"H-"+f+"V-"+k+"H"+f+"V-"+f+"H"+k+"Z")}},x:{n:4,f:function(x,_,A){if(o(_))return z;var f=y(x*.8/P,2),k="l"+f+","+f,w="l"+f+",-"+f,D="l-"+f+",-"+f,E="l-"+f+","+f;return b(_,A,"M0,"+f+k+w+D+w+D+E+D+E+k+E+k+"Z")}},"triangle-up":{n:5,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+f+","+k+"H"+f+"L0,-"+w+"Z")}},"triangle-down":{n:6,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+f+",-"+k+"H"+f+"L0,"+w+"Z")}},"triangle-left":{n:7,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M"+k+",-"+f+"V"+f+"L-"+w+",0Z")}},"triangle-right":{n:8,f:function(x,_,A){if(o(_))return z;var f=y(x*2/i,2),k=y(x/2,2),w=y(x,2);return b(_,A,"M-"+k+",-"+f+"V"+f+"L"+w+",0Z")}},"triangle-ne":{n:9,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+k+",-"+f+"H"+f+"V"+k+"Z")}},"triangle-se":{n:10,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+f+",-"+k+"V"+f+"H-"+k+"Z")}},"triangle-sw":{n:11,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M"+k+","+f+"H-"+f+"V-"+k+"Z")}},"triangle-nw":{n:12,f:function(x,_,A){if(o(_))return z;var f=y(x*.6,2),k=y(x*1.2,2);return b(_,A,"M-"+f+","+k+"V-"+f+"H"+k+"Z")}},pentagon:{n:13,f:function(x,_,A){if(o(_))return z;var f=y(x*.951,2),k=y(x*.588,2),w=y(-x,2),D=y(x*-.309,2),E=y(x*.809,2);return b(_,A,"M"+f+","+D+"L"+k+","+E+"H-"+k+"L-"+f+","+D+"L0,"+w+"Z")}},hexagon:{n:14,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/2,2),w=y(x*i/2,2);return b(_,A,"M"+w+",-"+k+"V"+k+"L0,"+f+"L-"+w+","+k+"V-"+k+"L0,-"+f+"Z")}},hexagon2:{n:15,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/2,2),w=y(x*i/2,2);return b(_,A,"M-"+k+","+w+"H"+k+"L"+f+",0L"+k+",-"+w+"H-"+k+"L-"+f+",0Z")}},octagon:{n:16,f:function(x,_,A){if(o(_))return z;var f=y(x*.924,2),k=y(x*.383,2);return b(_,A,"M-"+k+",-"+f+"H"+k+"L"+f+",-"+k+"V"+k+"L"+k+","+f+"H-"+k+"L-"+f+","+k+"V-"+k+"Z")}},star:{n:17,f:function(x,_,A){if(o(_))return z;var f=x*1.4,k=y(f*.225,2),w=y(f*.951,2),D=y(f*.363,2),E=y(f*.588,2),I=y(-f,2),M=y(f*-.309,2),p=y(f*.118,2),g=y(f*.809,2),C=y(f*.382,2);return b(_,A,"M"+k+","+M+"H"+w+"L"+D+","+p+"L"+E+","+g+"L0,"+C+"L-"+E+","+g+"L-"+D+","+p+"L-"+w+","+M+"H-"+k+"L0,"+I+"Z")}},hexagram:{n:18,f:function(x,_,A){if(o(_))return z;var f=y(x*.66,2),k=y(x*.38,2),w=y(x*.76,2);return b(_,A,"M-"+w+",0l-"+k+",-"+f+"h"+w+"l"+k+",-"+f+"l"+k+","+f+"h"+w+"l-"+k+","+f+"l"+k+","+f+"h-"+w+"l-"+k+","+f+"l-"+k+",-"+f+"h-"+w+"Z")}},"star-triangle-up":{n:19,f:function(x,_,A){if(o(_))return z;var f=y(x*i*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M-"+f+","+k+E+f+","+k+E+"0,-"+w+E+"-"+f+","+k+"Z")}},"star-triangle-down":{n:20,f:function(x,_,A){if(o(_))return z;var f=y(x*i*.8,2),k=y(x*.8,2),w=y(x*1.6,2),D=y(x*4,2),E="A "+D+","+D+" 0 0 1 ";return b(_,A,"M"+f+",-"+k+E+"-"+f+",-"+k+E+"0,"+w+E+f+",-"+k+"Z")}},"star-square":{n:21,f:function(x,_,A){if(o(_))return z;var f=y(x*1.1,2),k=y(x*2,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+f+",-"+f+w+"-"+f+","+f+w+f+","+f+w+f+",-"+f+w+"-"+f+",-"+f+"Z")}},"star-diamond":{n:22,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2),k=y(x*1.9,2),w="A "+k+","+k+" 0 0 1 ";return b(_,A,"M-"+f+",0"+w+"0,"+f+w+f+",0"+w+"0,-"+f+w+"-"+f+",0Z")}},"diamond-tall":{n:23,f:function(x,_,A){if(o(_))return z;var f=y(x*.7,2),k=y(x*1.4,2);return b(_,A,"M0,"+k+"L"+f+",0L0,-"+k+"L-"+f+",0Z")}},"diamond-wide":{n:24,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2),k=y(x*.7,2);return b(_,A,"M0,"+k+"L"+f+",0L0,-"+k+"L-"+f+",0Z")}},hourglass:{n:25,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"H-"+f+"L"+f+",-"+f+"H-"+f+"Z")},noDot:!0},bowtie:{n:26,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"V-"+f+"L-"+f+","+f+"V-"+f+"Z")},noDot:!0},"circle-cross":{n:27,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x/P,2);return b(_,A,"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k+"M"+f+",0A"+f+","+f+" 0 1,1 0,-"+f+"A"+f+","+f+" 0 0,1 "+f+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f+"M"+f+",-"+f+"L-"+f+","+f+"M"+f+","+f+"H-"+f+"V-"+f+"H"+f+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"ZM0,-"+f+"V"+f+"M-"+f+",0H"+f)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(x,_,A){if(o(_))return z;var f=y(x*1.3,2),k=y(x*.65,2);return b(_,A,"M"+f+",0L0,"+f+"L-"+f+",0L0,-"+f+"ZM-"+k+",-"+k+"L"+k+","+k+"M-"+k+","+k+"L"+k+",-"+k)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f+"M"+f+",-"+f+"L-"+f+","+f)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*.85,2);return b(_,A,"M0,"+f+"V-"+f+"M"+f+",0H-"+f+"M"+k+","+k+"L-"+k+",-"+k+"M"+k+",-"+k+"L-"+k+","+k)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(x,_,A){if(o(_))return z;var f=y(x/2,2),k=y(x,2);return b(_,A,"M"+f+","+k+"V-"+k+"M"+(f-k)+",-"+k+"V"+k+"M"+k+","+f+"H-"+k+"M-"+k+","+(f-k)+"H"+k)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+f+","+w+"L0,0M"+f+","+w+"L0,0M0,-"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+f+",-"+w+"L0,0M"+f+",-"+w+"L0,0M0,"+k+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M"+w+","+f+"L0,0M"+w+",-"+f+"L0,0M-"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(x,_,A){if(o(_))return z;var f=y(x*1.2,2),k=y(x*1.6,2),w=y(x*.8,2);return b(_,A,"M-"+w+","+f+"L0,0M-"+w+",-"+f+"L0,0M"+k+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M"+f+",0H-"+f)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(x,_,A){if(o(_))return z;var f=y(x*1.4,2);return b(_,A,"M0,"+f+"V-"+f)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+",-"+f+"L-"+f+","+f)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(x,_,A){if(o(_))return z;var f=y(x,2);return b(_,A,"M"+f+","+f+"L-"+f+",-"+f)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+f+","+k+"H"+f+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M0,0L-"+f+",-"+k+"H"+f+"Z")},noDot:!0},"arrow-left":{n:47,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L"+f+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-right":{n:48,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,0L-"+f+",-"+k+"V"+k+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M-"+f+",0H"+f+"M0,0L-"+f+","+k+"H"+f+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(x,_,A){if(o(_))return z;var f=y(x,2),k=y(x*2,2);return b(_,A,"M-"+f+",0H"+f+"M0,0L-"+f+",-"+k+"H"+f+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L"+f+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(x,_,A){if(o(_))return z;var f=y(x*2,2),k=y(x,2);return b(_,A,"M0,-"+k+"V"+k+"M0,0L-"+f+",-"+k+"V"+k+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(x,_,A){if(o(_))return z;var f=n/2.5,k=2*x*a(f),w=2*x*l(f);return b(_,A,"M0,0L"+-k+","+w+"L"+k+","+w+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(x,_,A){if(o(_))return z;var f=n/4,k=2*x*a(f),w=2*x*l(f);return b(_,A,"M0,0L"+-k+","+w+"A "+2*x+","+2*x+" 0 0 1 "+k+","+w+"Z")},backoff:.4,noDot:!0}};function o(x){return x===null}var u,s,h,m;function b(x,_,A){if((!x||x%360===0)&&!_)return A;if(h===x&&m===_&&u===A)return s;h=x,m=_,u=A;function f(U,V){var W=a(U),F=l(U),H=V[0],q=V[1]+(_||0);return[H*W-q*F,H*F+q*W]}for(var k=x/180*n,w=0,D=0,E=d(A),I="",M=0;M{var d=ri(),y=ji(),z=y.numberFormat,P=Sr(),i=ln(),n=as(),a=Xi(),l=lh(),o=y.strTranslate,u=cc(),s=k0(),h=Rf(),m=h.LINE_SPACING,b=so().DESELECTDIM,x=Bc(),_=$v(),A=T0().appendArrayPointValue,f=Y.exports={};f.font=function(Ae,Oe){var Le=Oe.variant,nt=Oe.style,xt=Oe.weight,ut=Oe.color,Et=Oe.size,Gt=Oe.family,Qt=Oe.shadow,vr=Oe.lineposition,mr=Oe.textcase;Gt&&Ae.style("font-family",Gt),Et+1&&Ae.style("font-size",Et+"px"),ut&&Ae.call(a.fill,ut),xt&&Ae.style("font-weight",xt),nt&&Ae.style("font-style",nt),Le&&Ae.style("font-variant",Le),mr&&Ae.style("text-transform",k(D(mr))),Qt&&Ae.style("text-shadow",Qt==="auto"?u.makeTextShadow(a.contrast(ut)):k(Qt)),vr&&Ae.style("text-decoration-line",k(E(vr)))};function k(Ae){return Ae==="none"?void 0:Ae}var w={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function D(Ae){return w[Ae]}function E(Ae){return Ae.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}f.setPosition=function(Ae,Oe,Le){Ae.attr("x",Oe).attr("y",Le)},f.setSize=function(Ae,Oe,Le){Ae.attr("width",Oe).attr("height",Le)},f.setRect=function(Ae,Oe,Le,nt,xt){Ae.call(f.setPosition,Oe,Le).call(f.setSize,nt,xt)},f.translatePoint=function(Ae,Oe,Le,nt){var xt=Le.c2p(Ae.x),ut=nt.c2p(Ae.y);if(P(xt)&&P(ut)&&Oe.node())Oe.node().nodeName==="text"?Oe.attr("x",xt).attr("y",ut):Oe.attr("transform",o(xt,ut));else return!1;return!0},f.translatePoints=function(Ae,Oe,Le){Ae.each(function(nt){var xt=d.select(this);f.translatePoint(nt,xt,Oe,Le)})},f.hideOutsideRangePoint=function(Ae,Oe,Le,nt,xt,ut){Oe.attr("display",Le.isPtWithinRange(Ae,xt)&&nt.isPtWithinRange(Ae,ut)?null:"none")},f.hideOutsideRangePoints=function(Ae,Oe){if(Oe._hasClipOnAxisFalse){var Le=Oe.xaxis,nt=Oe.yaxis;Ae.each(function(xt){var ut=xt[0].trace,Et=ut.xcalendar,Gt=ut.ycalendar,Qt=n.traceIs(ut,"bar-like")?".bartext":".point,.textpoint";Ae.selectAll(Qt).each(function(vr){f.hideOutsideRangePoint(vr,d.select(this),Le,nt,Et,Gt)})})}},f.crispRound=function(Ae,Oe,Le){return!Oe||!P(Oe)?Le||0:Ae._context.staticPlot?Oe:Oe<1?1:Math.round(Oe)},f.singleLineStyle=function(Ae,Oe,Le,nt,xt){Oe.style("fill","none");var ut=(((Ae||[])[0]||{}).trace||{}).line||{},Et=Le||ut.width||0,Gt=xt||ut.dash||"";a.stroke(Oe,nt||ut.color),f.dashLine(Oe,Gt,Et)},f.lineGroupStyle=function(Ae,Oe,Le,nt){Ae.style("fill","none").each(function(xt){var ut=(((xt||[])[0]||{}).trace||{}).line||{},Et=Oe||ut.width||0,Gt=nt||ut.dash||"";d.select(this).call(a.stroke,Le||ut.color).call(f.dashLine,Gt,Et)})},f.dashLine=function(Ae,Oe,Le){Le=+Le||0,Oe=f.dashStyle(Oe,Le),Ae.style({"stroke-dasharray":Oe,"stroke-width":Le+"px"})},f.dashStyle=function(Ae,Oe){Oe=+Oe||1;var Le=Math.max(Oe,3);return Ae==="solid"?Ae="":Ae==="dot"?Ae=Le+"px,"+Le+"px":Ae==="dash"?Ae=3*Le+"px,"+3*Le+"px":Ae==="longdash"?Ae=5*Le+"px,"+5*Le+"px":Ae==="dashdot"?Ae=3*Le+"px,"+Le+"px,"+Le+"px,"+Le+"px":Ae==="longdashdot"&&(Ae=5*Le+"px,"+2*Le+"px,"+Le+"px,"+2*Le+"px"),Ae};function I(Ae,Oe,Le,nt){var xt=Oe.fillpattern,ut=Oe.fillgradient,Et=f.getPatternAttr,Gt=xt&&(Et(xt.shape,0,"")||Et(xt.path,0,""));if(Gt){var Qt=Et(xt.bgcolor,0,null),vr=Et(xt.fgcolor,0,null),mr=xt.fgopacity,Yr=Et(xt.size,0,8),ii=Et(xt.solidity,0,.3),Lr=Oe.uid;f.pattern(Ae,"point",Le,Lr,Gt,Yr,ii,void 0,xt.fillmode,Qt,vr,mr)}else if(ut&&ut.type!=="none"){var ci=ut.type,vi="scatterfill-"+Oe.uid;if(nt&&(vi="legendfill-"+Oe.uid),!nt&&(ut.start!==void 0||ut.stop!==void 0)){var Ot,Xe;ci==="horizontal"?(Ot={x:ut.start,y:0},Xe={x:ut.stop,y:0}):ci==="vertical"&&(Ot={x:0,y:ut.start},Xe={x:0,y:ut.stop}),Ot.x=Oe._xA.c2p(Ot.x===void 0?Oe._extremes.x.min[0].val:Ot.x,!0),Ot.y=Oe._yA.c2p(Ot.y===void 0?Oe._extremes.y.min[0].val:Ot.y,!0),Xe.x=Oe._xA.c2p(Xe.x===void 0?Oe._extremes.x.max[0].val:Xe.x,!0),Xe.y=Oe._yA.c2p(Xe.y===void 0?Oe._extremes.y.max[0].val:Xe.y,!0),Ae.call(B,Le,vi,"linear",ut.colorscale,"fill",Ot,Xe,!0,!1)}else ci==="horizontal"&&(ci=ci+"reversed"),Ae.call(f.gradient,Le,vi,ci,ut.colorscale,"fill")}else Oe.fillcolor&&Ae.call(a.fill,Oe.fillcolor)}f.singleFillStyle=function(Ae,Oe){var Le=d.select(Ae.node()),nt=Le.data(),xt=((nt[0]||[])[0]||{}).trace||{};I(Ae,xt,Oe,!1)},f.fillGroupStyle=function(Ae,Oe,Le){Ae.style("stroke-width",0).each(function(nt){var xt=d.select(this);nt[0].trace&&I(xt,nt[0].trace,Oe,Le)})};var M=Rc();f.symbolNames=[],f.symbolFuncs=[],f.symbolBackOffs=[],f.symbolNeedLines={},f.symbolNoDot={},f.symbolNoFill={},f.symbolList=[],Object.keys(M).forEach(function(Ae){var Oe=M[Ae],Le=Oe.n;f.symbolList.push(Le,String(Le),Ae,Le+100,String(Le+100),Ae+"-open"),f.symbolNames[Le]=Ae,f.symbolFuncs[Le]=Oe.f,f.symbolBackOffs[Le]=Oe.backoff||0,Oe.needLine&&(f.symbolNeedLines[Le]=!0),Oe.noDot?f.symbolNoDot[Le]=!0:f.symbolList.push(Le+200,String(Le+200),Ae+"-dot",Le+300,String(Le+300),Ae+"-open-dot"),Oe.noFill&&(f.symbolNoFill[Le]=!0)});var p=f.symbolNames.length,g="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";f.symbolNumber=function(Ae){if(P(Ae))Ae=+Ae;else if(typeof Ae=="string"){var Oe=0;Ae.indexOf("-open")>0&&(Oe=100,Ae=Ae.replace("-open","")),Ae.indexOf("-dot")>0&&(Oe+=200,Ae=Ae.replace("-dot","")),Ae=f.symbolNames.indexOf(Ae),Ae>=0&&(Ae+=Oe)}return Ae%100>=p||Ae>=400?0:Math.floor(Math.max(Ae,0))};function C(Ae,Oe,Le,nt){var xt=Ae%100;return f.symbolFuncs[xt](Oe,Le,nt)+(Ae>=200?g:"")}var T=z("~f"),N={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};f.gradient=function(Ae,Oe,Le,nt,xt,ut){var Et=N[nt];return B(Ae,Oe,Le,Et.type,xt,ut,Et.start,Et.stop,!1,Et.reversed)};function B(Ae,Oe,Le,nt,xt,ut,Et,Gt,Qt,vr){var mr=xt.length,Yr;nt==="linear"?Yr={node:"linearGradient",attrs:{x1:Et.x,y1:Et.y,x2:Gt.x,y2:Gt.y,gradientUnits:Qt?"userSpaceOnUse":"objectBoundingBox"},reversed:vr}:nt==="radial"&&(Yr={node:"radialGradient",reversed:vr});for(var ii=new Array(mr),Lr=0;Lr=0&&Ae.i===void 0&&(Ae.i=ut.i),Oe.style("opacity",nt.selectedOpacityFn?nt.selectedOpacityFn(Ae):Ae.mo===void 0?Et.opacity:Ae.mo),nt.ms2mrc){var Qt;Ae.ms==="various"||Et.size==="various"?Qt=3:Qt=nt.ms2mrc(Ae.ms),Ae.mrc=Qt,nt.selectedSizeFn&&(Qt=Ae.mrc=nt.selectedSizeFn(Ae));var vr=f.symbolNumber(Ae.mx||Et.symbol)||0;Ae.om=vr%200>=100;var mr=ct(Ae,Le),Yr=me(Ae,Le);Oe.attr("d",C(vr,Qt,mr,Yr))}var ii=!1,Lr,ci,vi;if(Ae.so)vi=Gt.outlierwidth,ci=Gt.outliercolor,Lr=Et.outliercolor;else{var Ot=(Gt||{}).width;vi=(Ae.mlw+1||Ot+1||(Ae.trace?(Ae.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Ae?ci=Ae.mlcc=nt.lineScale(Ae.mlc):y.isArrayOrTypedArray(Gt.color)?ci=a.defaultLine:ci=Gt.color,y.isArrayOrTypedArray(Et.color)&&(Lr=a.defaultLine,ii=!0),"mc"in Ae?Lr=Ae.mcc=nt.markerScale(Ae.mc):Lr=Et.color||Et.colors||"rgba(0,0,0,0)",nt.selectedColorFn&&(Lr=nt.selectedColorFn(Ae))}if(Ae.om)Oe.call(a.stroke,Lr).style({"stroke-width":(vi||1)+"px",fill:"none"});else{Oe.style("stroke-width",(Ae.isBlank?0:vi)+"px");var Xe=Et.gradient,ot=Ae.mgt;ot?ii=!0:ot=Xe&&Xe.type,y.isArrayOrTypedArray(ot)&&(ot=ot[0],N[ot]||(ot=0));var De=Et.pattern,ye=f.getPatternAttr,Pe=De&&(ye(De.shape,Ae.i,"")||ye(De.path,Ae.i,""));if(ot&&ot!=="none"){var He=Ae.mgc;He?ii=!0:He=Xe.color;var at=Le.uid;ii&&(at+="-"+Ae.i),f.gradient(Oe,xt,at,ot,[[0,He],[1,Lr]],"fill")}else if(Pe){var ht=!1,At=De.fgcolor;!At&&ut&&ut.color&&(At=ut.color,ht=!0);var Wt=ye(At,Ae.i,ut&&ut.color||null),Yt=ye(De.bgcolor,Ae.i,null),hr=De.fgopacity,zr=ye(De.size,Ae.i,8),Dr=ye(De.solidity,Ae.i,.3);ht=ht||Ae.mcc||y.isArrayOrTypedArray(De.shape)||y.isArrayOrTypedArray(De.path)||y.isArrayOrTypedArray(De.bgcolor)||y.isArrayOrTypedArray(De.fgcolor)||y.isArrayOrTypedArray(De.size)||y.isArrayOrTypedArray(De.solidity);var br=Le.uid;ht&&(br+="-"+Ae.i),f.pattern(Oe,"point",xt,br,Pe,zr,Dr,Ae.mcc,De.fillmode,Yt,Wt,hr)}else y.isArrayOrTypedArray(Lr)?a.fill(Oe,Lr[Ae.i]):a.fill(Oe,Lr);vi&&a.stroke(Oe,ci)}},f.makePointStyleFns=function(Ae){var Oe={},Le=Ae.marker;return Oe.markerScale=f.tryColorscale(Le,""),Oe.lineScale=f.tryColorscale(Le,"line"),n.traceIs(Ae,"symbols")&&(Oe.ms2mrc=x.isBubble(Ae)?_(Ae):function(){return(Le.size||6)/2}),Ae.selectedpoints&&y.extendFlat(Oe,f.makeSelectedPointStyleFns(Ae)),Oe},f.makeSelectedPointStyleFns=function(Ae){var Oe={},Le=Ae.selected||{},nt=Ae.unselected||{},xt=Ae.marker||{},ut=Le.marker||{},Et=nt.marker||{},Gt=xt.opacity,Qt=ut.opacity,vr=Et.opacity,mr=Qt!==void 0,Yr=vr!==void 0;(y.isArrayOrTypedArray(Gt)||mr||Yr)&&(Oe.selectedOpacityFn=function(ye){var Pe=ye.mo===void 0?xt.opacity:ye.mo;return ye.selected?mr?Qt:Pe:Yr?vr:b*Pe});var ii=xt.color,Lr=ut.color,ci=Et.color;(Lr||ci)&&(Oe.selectedColorFn=function(ye){var Pe=ye.mcc||ii;return ye.selected?Lr||Pe:ci||Pe});var vi=xt.size,Ot=ut.size,Xe=Et.size,ot=Ot!==void 0,De=Xe!==void 0;return n.traceIs(Ae,"symbols")&&(ot||De)&&(Oe.selectedSizeFn=function(ye){var Pe=ye.mrc||vi/2;return ye.selected?ot?Ot/2:Pe:De?Xe/2:Pe}),Oe},f.makeSelectedTextStyleFns=function(Ae){var Oe={},Le=Ae.selected||{},nt=Ae.unselected||{},xt=Ae.textfont||{},ut=Le.textfont||{},Et=nt.textfont||{},Gt=xt.color,Qt=ut.color,vr=Et.color;return Oe.selectedTextColorFn=function(mr){var Yr=mr.tc||Gt;return mr.selected?Qt||Yr:vr||(Qt?Yr:a.addOpacity(Yr,b))},Oe},f.selectedPointStyle=function(Ae,Oe){if(!(!Ae.size()||!Oe.selectedpoints)){var Le=f.makeSelectedPointStyleFns(Oe),nt=Oe.marker||{},xt=[];Le.selectedOpacityFn&&xt.push(function(ut,Et){ut.style("opacity",Le.selectedOpacityFn(Et))}),Le.selectedColorFn&&xt.push(function(ut,Et){a.fill(ut,Le.selectedColorFn(Et))}),Le.selectedSizeFn&&xt.push(function(ut,Et){var Gt=Et.mx||nt.symbol||0,Qt=Le.selectedSizeFn(Et);ut.attr("d",C(f.symbolNumber(Gt),Qt,ct(Et,Oe),me(Et,Oe))),Et.mrc2=Qt}),xt.length&&Ae.each(function(ut){for(var Et=d.select(this),Gt=0;Gt0?Le:0}f.textPointStyle=function(Ae,Oe,Le){if(Ae.size()){var nt;if(Oe.selectedpoints){var xt=f.makeSelectedTextStyleFns(Oe);nt=xt.selectedTextColorFn}var ut=Oe.texttemplate,Et=Le._fullLayout;Ae.each(function(Gt){var Qt=d.select(this),vr=ut?y.extractOption(Gt,Oe,"txt","texttemplate"):y.extractOption(Gt,Oe,"tx","text");if(!vr&&vr!==0){Qt.remove();return}if(ut){var mr=Oe._module.formatLabels,Yr=mr?mr(Gt,Oe,Et):{},ii={};A(ii,Oe,Gt.i),vr=y.texttemplateString({data:[ii,Gt,Oe._meta],fallback:Oe.texttemplatefallback,labels:Yr,locale:Et._d3locale,template:vr})}var Lr=Gt.tp||Oe.textposition,ci=W(Gt,Oe),vi=nt?nt(Gt):Gt.tc||Oe.textfont.color;Qt.call(f.font,{family:Gt.tf||Oe.textfont.family,weight:Gt.tw||Oe.textfont.weight,style:Gt.ty||Oe.textfont.style,variant:Gt.tv||Oe.textfont.variant,textcase:Gt.tC||Oe.textfont.textcase,lineposition:Gt.tE||Oe.textfont.lineposition,shadow:Gt.tS||Oe.textfont.shadow,size:ci,color:vi}).text(vr).call(u.convertToTspans,Le).call(V,Lr,ci,Gt.mrc)})}},f.selectedTextStyle=function(Ae,Oe){if(!(!Ae.size()||!Oe.selectedpoints)){var Le=f.makeSelectedTextStyleFns(Oe);Ae.each(function(nt){var xt=d.select(this),ut=Le.selectedTextColorFn(nt),Et=nt.tp||Oe.textposition,Gt=W(nt,Oe);a.fill(xt,ut);var Qt=n.traceIs(Oe,"bar-like");V(xt,Et,Gt,nt.mrc2||nt.mrc,Qt)})}};var F=.5;f.smoothopen=function(Ae,Oe){if(Ae.length<3)return"M"+Ae.join("L");var Le="M"+Ae[0],nt=[],xt;for(xt=1;xt=Qt||ye>=mr&&ye<=Qt)&&(Pe<=Yr&&Pe>=vr||Pe>=Yr&&Pe<=vr)&&(Ae=[ye,Pe])}return Ae}f.applyBackoff=re,f.makeTester=function(){var Ae=y.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(Le){Le.attr(s.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),Oe=y.ensureSingle(Ae,"path","js-reference-point",function(Le){Le.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});f.tester=Ae,f.testref=Oe},f.savedBBoxes={};var ge=0,ne=1e4;f.bBox=function(Ae,Oe,Le){Le||(Le=se(Ae));var nt;if(Le){if(nt=f.savedBBoxes[Le],nt)return y.extendFlat({},nt)}else if(Ae.childNodes.length===1){var xt=Ae.childNodes[0];if(Le=se(xt),Le){var ut=+xt.getAttribute("x")||0,Et=+xt.getAttribute("y")||0,Gt=xt.getAttribute("transform");if(!Gt){var Qt=f.bBox(xt,!1,Le);return ut&&(Qt.left+=ut,Qt.right+=ut),Et&&(Qt.top+=Et,Qt.bottom+=Et),Qt}if(Le+="~"+ut+"~"+Et+"~"+Gt,nt=f.savedBBoxes[Le],nt)return y.extendFlat({},nt)}}var vr,mr;Oe?vr=Ae:(mr=f.tester.node(),vr=Ae.cloneNode(!0),mr.appendChild(vr)),d.select(vr).attr("transform",null).call(u.positionText,0,0);var Yr=vr.getBoundingClientRect(),ii=f.testref.node().getBoundingClientRect();Oe||mr.removeChild(vr);var Lr={height:Yr.height,width:Yr.width,left:Yr.left-ii.left,top:Yr.top-ii.top,right:Yr.right-ii.left,bottom:Yr.bottom-ii.top};return ge>=ne&&(f.savedBBoxes={},ge=0),Le&&(f.savedBBoxes[Le]=Lr),ge++,y.extendFlat({},Lr)};function se(Ae){var Oe=Ae.getAttribute("data-unformatted");if(Oe!==null)return Oe+Ae.getAttribute("data-math")+Ae.getAttribute("text-anchor")+Ae.getAttribute("style")}f.setClipUrl=function(Ae,Oe,Le){Ae.attr("clip-path",_e(Oe,Le))};function _e(Ae,Oe){if(!Ae)return null;var Le=Oe._context,nt=Le._exportedPlot?"":Le._baseUrl||"";return nt?"url('"+nt+"#"+Ae+"')":"url(#"+Ae+")"}f.getTranslate=function(Ae){var Oe=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Le=Ae.attr?"attr":"getAttribute",nt=Ae[Le]("transform")||"",xt=nt.replace(Oe,function(ut,Et,Gt){return[Et,Gt].join(" ")}).split(" ");return{x:+xt[0]||0,y:+xt[1]||0}},f.setTranslate=function(Ae,Oe,Le){var nt=/(\btranslate\(.*?\);?)/,xt=Ae.attr?"attr":"getAttribute",ut=Ae.attr?"attr":"setAttribute",Et=Ae[xt]("transform")||"";return Oe=Oe||0,Le=Le||0,Et=Et.replace(nt,"").trim(),Et+=o(Oe,Le),Et=Et.trim(),Ae[ut]("transform",Et),Et},f.getScale=function(Ae){var Oe=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Le=Ae.attr?"attr":"getAttribute",nt=Ae[Le]("transform")||"",xt=nt.replace(Oe,function(ut,Et,Gt){return[Et,Gt].join(" ")}).split(" ");return{x:+xt[0]||1,y:+xt[1]||1}},f.setScale=function(Ae,Oe,Le){var nt=/(\bscale\(.*?\);?)/,xt=Ae.attr?"attr":"getAttribute",ut=Ae.attr?"attr":"setAttribute",Et=Ae[xt]("transform")||"";return Oe=Oe||1,Le=Le||1,Et=Et.replace(nt,"").trim(),Et+="scale("+Oe+","+Le+")",Et=Et.trim(),Ae[ut]("transform",Et),Et};var oe=/\s*sc.*/;f.setPointGroupScale=function(Ae,Oe,Le){if(Oe=Oe||1,Le=Le||1,!!Ae){var nt=Oe===1&&Le===1?"":"scale("+Oe+","+Le+")";Ae.each(function(){var xt=(this.getAttribute("transform")||"").replace(oe,"");xt+=nt,xt=xt.trim(),this.setAttribute("transform",xt)})}};var J=/translate\([^)]*\)\s*$/;f.setTextPointsScale=function(Ae,Oe,Le){Ae&&Ae.each(function(){var nt,xt=d.select(this),ut=xt.select("text");if(ut.node()){var Et=parseFloat(ut.attr("x")||0),Gt=parseFloat(ut.attr("y")||0),Qt=(xt.attr("transform")||"").match(J);Oe===1&&Le===1?nt=[]:nt=[o(Et,Gt),"scale("+Oe+","+Le+")",o(-Et,-Gt)],Qt&&nt.push(Qt),xt.attr("transform",nt.join(""))}})};function me(Ae,Oe){var Le;return Ae&&(Le=Ae.mf),Le===void 0&&(Le=Oe.marker&&Oe.marker.standoff||0),!Oe._geo&&!Oe._xA?-Le:Le}f.getMarkerStandoff=me;var fe=Math.atan2,Ce=Math.cos,Re=Math.sin;function Be(Ae,Oe){var Le=Oe[0],nt=Oe[1];return[Le*Ce(Ae)-nt*Re(Ae),Le*Re(Ae)+nt*Ce(Ae)]}var Ze,Ge,tt,_t,mt,vt;function ct(Ae,Oe){var Le=Ae.ma;Le===void 0&&(Le=Oe.marker.angle,(!Le||y.isArrayOrTypedArray(Le))&&(Le=0));var nt,xt,ut=Oe.marker.angleref;if(ut==="previous"||ut==="north"){if(Oe._geo){var Et=Oe._geo.project(Ae.lonlat);nt=Et[0],xt=Et[1]}else{var Gt=Oe._xA,Qt=Oe._yA;if(Gt&&Qt)nt=Gt.c2p(Ae.x),xt=Qt.c2p(Ae.y);else return 90}if(Oe._geo){var vr=Ae.lonlat[0],mr=Ae.lonlat[1],Yr=Oe._geo.project([vr,mr+1e-5]),ii=Oe._geo.project([vr+1e-5,mr]),Lr=fe(ii[1]-xt,ii[0]-nt),ci=fe(Yr[1]-xt,Yr[0]-nt),vi;if(ut==="north")vi=Le/180*Math.PI;else if(ut==="previous"){var Ot=vr/180*Math.PI,Xe=mr/180*Math.PI,ot=Ze/180*Math.PI,De=Ge/180*Math.PI,ye=ot-Ot,Pe=Ce(De)*Re(ye),He=Re(De)*Ce(Xe)-Ce(De)*Re(Xe)*Ce(ye);vi=-fe(Pe,He)-Math.PI,Ze=vr,Ge=mr}var at=Be(Lr,[Ce(vi),0]),ht=Be(ci,[Re(vi),0]);Le=fe(at[1]+ht[1],at[0]+ht[0])/Math.PI*180,ut==="previous"&&!(vt===Oe.uid&&Ae.i===mt+1)&&(Le=null)}if(ut==="previous"&&!Oe._geo)if(vt===Oe.uid&&Ae.i===mt+1&&P(nt)&&P(xt)){var At=nt-tt,Wt=xt-_t,Yt=Oe.line&&Oe.line.shape||"",hr=Yt.slice(Yt.length-1);hr==="h"&&(Wt=0),hr==="v"&&(At=0),Le+=fe(Wt,At)/Math.PI*180+90}else Le=null}return tt=nt,_t=xt,mt=Ae.i,vt=Oe.uid,Le}f.getMarkerAngle=ct}),Np=ze((te,Y)=>{var d=ri(),y=Sr(),z=sh(),P=as(),i=ji(),n=i.strTranslate,a=Zs(),l=Xi(),o=cc(),u=so(),s=Rf().OPPOSITE_SIDE,h=/ [XY][0-9]* /,m=1.6,b=1.6;function x(_,A,f){var k=_._fullLayout,w=f.propContainer,D=f.propName,E=f.placeholder,I=f.traceIndex,M=f.avoid||{},p=f.attributes,g=f.transform,C=f.containerGroup,T=1,N=w.title,B=(N&&N.text?N.text:"").trim(),U=!1,V=N&&N.font?N.font:{},W=V.family,F=V.size,H=V.color,q=V.weight,G=V.style,ee=V.variant,he=V.textcase,be=V.lineposition,ve=V.shadow,ce=f.subtitlePropName,re=!!ce,ge=f.subtitlePlaceholder,ne=(w.title||{}).subtitle||{text:"",font:{}},se=(ne.text||"").trim(),_e=!1,oe=1,J=ne.font,me=J.family,fe=J.size,Ce=J.color,Re=J.weight,Be=J.style,Ze=J.variant,Ge=J.textcase,tt=J.lineposition,_t=J.shadow,mt;D==="title.text"?mt="titleText":D.indexOf("axis")!==-1?mt="axisTitleText":D.indexOf("colorbar")!==-1&&(mt="colorbarTitleText");var vt=_._context.edits[mt];function ct(ii,Lr){return ii===void 0||Lr===void 0?!1:ii.replace(h," % ")===Lr.replace(h," % ")}B===""?T=0:ct(B,E)&&(vt||(B=""),T=.2,U=!0),re&&(se===""?oe=0:ct(se,ge)&&(vt||(se=""),oe=.2,_e=!0)),f._meta?B=i.templateString(B,f._meta):k._meta&&(B=i.templateString(B,k._meta));var Ae=B||se||vt,Oe;C||(C=i.ensureSingle(k._infolayer,"g","g-"+A),Oe=k._hColorbarMoveTitle);var Le=C.selectAll("text."+A).data(Ae?[0]:[]);Le.enter().append("text"),Le.text(B).attr("class",A),Le.exit().remove();var nt=null,xt=A+"-subtitle",ut=se||vt;if(re&&(nt=C.selectAll("text."+xt).data(ut?[0]:[]),nt.enter().append("text"),nt.text(se).attr("class",xt),nt.exit().remove()),!Ae)return C;function Et(ii,Lr){i.syncOrAsync([Gt,Qt],{title:ii,subtitle:Lr})}function Gt(ii){var Lr=ii.title,ci=ii.subtitle,vi;!g&&Oe&&(g={}),g?(vi="",g.rotate&&(vi+="rotate("+[g.rotate,p.x,p.y]+")"),(g.offset||Oe)&&(vi+=n(0,(g.offset||0)-(Oe||0)))):vi=null,Lr.attr("transform",vi);function Ot(He){if(He){var at=d.select(He.node().parentNode).select("."+xt);if(!at.empty()){var ht=He.node().getBBox();if(ht.height){var At=ht.y+ht.height+m*fe;at.attr("y",At)}}}}if(Lr.style("opacity",T*l.opacity(H)).call(a.font,{color:l.rgb(H),size:d.round(F,2),family:W,weight:q,style:G,variant:ee,textcase:he,shadow:ve,lineposition:be}).attr(p).call(o.convertToTspans,_,Ot),ci&&!ci.empty()){var Xe=C.select("."+A+"-math-group"),ot=Lr.node().getBBox(),De=Xe.node()?Xe.node().getBBox():void 0,ye=De?De.y+De.height+m*fe:ot.y+ot.height+b*fe,Pe=i.extendFlat({},p,{y:ye});ci.attr("transform",vi),ci.style("opacity",oe*l.opacity(Ce)).call(a.font,{color:l.rgb(Ce),size:d.round(fe,2),family:me,weight:Re,style:Be,variant:Ze,textcase:Ge,shadow:_t,lineposition:tt}).attr(Pe).call(o.convertToTspans,_)}return z.previousPromises(_)}function Qt(ii){var Lr=ii.title,ci=d.select(Lr.node().parentNode);if(M&&M.selection&&M.side&&B){ci.attr("transform",null);var vi=s[M.side],Ot=M.side==="left"||M.side==="top"?-1:1,Xe=y(M.pad)?M.pad:2,ot=a.bBox(ci.node()),De={t:0,b:0,l:0,r:0},ye=_._fullLayout._reservedMargin;for(var Pe in ye)for(var He in ye[Pe]){var at=ye[Pe][He];De[He]=Math.max(De[He],at)}var ht={left:De.l,top:De.t,right:k.width-De.r,bottom:k.height-De.b},At=M.maxShift||Ot*(ht[M.side]-ot[M.side]),Wt=0;if(At<0)Wt=At;else{var Yt=M.offsetLeft||0,hr=M.offsetTop||0;ot.left-=Yt,ot.right-=Yt,ot.top-=hr,ot.bottom-=hr,M.selection.each(function(){var Dr=a.bBox(this);i.bBoxIntersect(ot,Dr,Xe)&&(Wt=Math.max(Wt,Ot*(Dr[M.side]-ot[vi])+Xe))}),Wt=Math.min(At,Wt),w._titleScoot=Math.abs(Wt)}if(Wt>0||At<0){var zr={left:[-Wt,0],right:[Wt,0],top:[0,-Wt],bottom:[0,Wt]}[M.side];ci.attr("transform",n(zr[0],zr[1]))}}}Le.call(Et,nt);function vr(ii,Lr){ii.text(Lr).on("mouseover.opacity",function(){d.select(this).transition().duration(u.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(u.HIDE_PLACEHOLDER).style("opacity",0)})}if(vt&&(B?Le.on(".opacity",null):(vr(Le,E),U=!0),Le.call(o.makeEditable,{gd:_}).on("edit",function(ii){I!==void 0?P.call("_guiRestyle",_,D,ii,I):P.call("_guiRelayout",_,D,ii)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Et)}).on("input",function(ii){this.text(ii||" ").call(o.positionText,p.x,p.y)}),re)){if(re&&!B){var mr=Le.node().getBBox(),Yr=mr.y+mr.height+b*fe;nt.attr("y",Yr)}se?nt.on(".opacity",null):(vr(nt,ge),_e=!0),nt.call(o.makeEditable,{gd:_}).on("edit",function(ii){P.call("_guiRelayout",_,"title.subtitle.text",ii)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Et)}).on("input",function(ii){this.text(ii||" ").call(o.positionText,nt.attr("x"),nt.attr("y"))})}return Le.classed("js-placeholder",U),nt&&!nt.empty()&&nt.classed("js-placeholder",_e),C}Y.exports={draw:x,SUBTITLE_PADDING_EM:b,SUBTITLE_PADDING_MATHJAX_EM:m}}),Z0=ze((te,Y)=>{var d=ri(),y=yi().utcFormat,z=ji(),P=z.numberFormat,i=Sr(),n=z.cleanNumber,a=z.ms2DateTime,l=z.dateTime2ms,o=z.ensureNumber,u=z.isArrayOrTypedArray,s=ei(),h=s.FP_SAFE,m=s.BADNUM,b=s.LOG_CLIP,x=s.ONEWEEK,_=s.ONEDAY,A=s.ONEHOUR,f=s.ONEMIN,k=s.ONESEC,w=Zc(),D=dc(),E=D.HOUR_PATTERN,I=D.WEEKDAY_PATTERN;function M(g){return Math.pow(10,g)}function p(g){return g!=null}Y.exports=function(g,C){C=C||{};var T=g._id||"x",N=T.charAt(0);function B(ne,se){if(ne>0)return Math.log(ne)/Math.LN10;if(ne<=0&&se&&g.range&&g.range.length===2){var _e=g.range[0],oe=g.range[1];return .5*(_e+oe-2*b*Math.abs(_e-oe))}else return m}function U(ne,se,_e,oe){if((oe||{}).msUTC&&i(ne))return+ne;var J=l(ne,_e||g.calendar);if(J===m)if(i(ne)){ne=+ne;var me=Math.floor(z.mod(ne+.05,1)*10),fe=Math.round(ne-me/10);J=l(new Date(fe))+me/10}else return m;return J}function V(ne,se,_e){return a(ne,se,_e||g.calendar)}function W(ne){return g._categories[Math.round(ne)]}function F(ne){if(p(ne)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[ne]!==void 0)return g._categoriesMap[ne];g._categories.push(typeof ne=="number"?String(ne):ne);var se=g._categories.length-1;return g._categoriesMap[ne]=se,se}return m}function H(ne,se){for(var _e=new Array(se),oe=0;oeg.range[1]&&(_e=!_e);for(var oe=_e?-1:1,J=oe*ne,me=0,fe=0;feRe)me=fe+1;else{me=J<(Ce+Re)/2?fe:fe+1;break}}var Be=g._B[me]||0;return isFinite(Be)?he(ne,g._m2,Be):0},ce=function(ne){var se=g._rangebreaks.length;if(!se)return be(ne,g._m,g._b);for(var _e=0,oe=0;oeg._rangebreaks[oe].pmax&&(_e=oe+1);return be(ne,g._m2,g._B[_e])}}g.c2l=g.type==="log"?B:o,g.l2c=g.type==="log"?M:o,g.l2p=ve,g.p2l=ce,g.c2p=g.type==="log"?function(ne,se){return ve(B(ne,se))}:ve,g.p2c=g.type==="log"?function(ne){return M(ce(ne))}:ce,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=n,g.c2d=g.c2r=g.l2d=g.l2r=o,g.d2p=g.r2p=function(ne){return g.l2p(n(ne))},g.p2d=g.p2r=ce,g.cleanPos=o):g.type==="log"?(g.d2r=g.d2l=function(ne,se){return B(n(ne),se)},g.r2d=g.r2c=function(ne){return M(n(ne))},g.d2c=g.r2l=n,g.c2d=g.l2r=o,g.c2r=B,g.l2d=M,g.d2p=function(ne,se){return g.l2p(g.d2r(ne,se))},g.p2d=function(ne){return M(ce(ne))},g.r2p=function(ne){return g.l2p(n(ne))},g.p2r=ce,g.cleanPos=o):g.type==="date"?(g.d2r=g.r2d=z.identity,g.d2c=g.r2c=g.d2l=g.r2l=U,g.c2d=g.c2r=g.l2d=g.l2r=V,g.d2p=g.r2p=function(ne,se,_e){return g.l2p(U(ne,0,_e))},g.p2d=g.p2r=function(ne,se,_e){return V(ce(ne),se,_e)},g.cleanPos=function(ne){return z.cleanDate(ne,m,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=F,g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(ne){var se=ee(ne);return se!==void 0?se:g.fraction2r(.5)},g.l2r=g.c2r=o,g.r2l=ee,g.d2p=function(ne){return g.l2p(g.r2c(ne))},g.p2d=function(ne){return W(ce(ne))},g.r2p=g.d2p,g.p2r=ce,g.cleanPos=function(ne){return typeof ne=="string"&&ne!==""?ne:o(ne)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=W,g.d2r=g.d2l_noadd=G,g.r2c=function(ne){var se=G(ne);return se!==void 0?se:g.fraction2r(.5)},g.r2c_just_indices=q,g.l2r=g.c2r=o,g.r2l=G,g.d2p=function(ne){return g.l2p(g.r2c(ne))},g.p2d=function(ne){return W(ce(ne))},g.r2p=g.d2p,g.p2r=ce,g.cleanPos=function(ne){return Array.isArray(ne)||typeof ne=="string"&&ne!==""?ne:o(ne)},g.setupMultiCategory=function(ne){var se=g._traceIndices,_e,oe,J=g._matchGroup;if(J&&g._categories.length===0){for(var me in J)if(me!==T){var fe=C[w.id2name(me)];se=se.concat(fe._traceIndices)}}var Ce=[[0,{}],[0,{}]],Re=[];for(_e=0;_efe[1]&&(oe[me?0:1]=_e),oe[0]===oe[1]){var Ce=g.l2r(se),Re=g.l2r(_e);if(se!==void 0){var Be=Ce+1;_e!==void 0&&(Be=Math.min(Be,Re)),oe[me?1:0]=Be}if(_e!==void 0){var Ze=Re+1;se!==void 0&&(Ze=Math.max(Ze,Ce)),oe[me?0:1]=Ze}}}},g.cleanRange=function(ne,se){g._cleanRange(ne,se),g.limitRange(ne)},g._cleanRange=function(ne,se){se||(se={}),ne||(ne="range");var _e=z.nestedProperty(g,ne).get(),oe,J;if(g.type==="date"?J=z.dfltRange(g.calendar):N==="y"?J=D.DFLTRANGEY:g._name==="realaxis"?J=[0,1]:J=se.dfltRange||D.DFLTRANGEX,J=J.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(J[0]=0),!_e||_e.length!==2){z.nestedProperty(g,ne).set(J);return}var me=_e[0]===null,fe=_e[1]===null;for(g.type==="date"&&!g.autorange&&(_e[0]=z.cleanDate(_e[0],m,g.calendar),_e[1]=z.cleanDate(_e[1],m,g.calendar)),oe=0;oe<2;oe++)if(g.type==="date"){if(!z.isDateTime(_e[oe],g.calendar)){g[ne]=J;break}if(g.r2l(_e[0])===g.r2l(_e[1])){var Ce=z.constrain(g.r2l(_e[0]),z.MIN_MS+1e3,z.MAX_MS-1e3);_e[0]=g.l2r(Ce-1e3),_e[1]=g.l2r(Ce+1e3);break}}else{if(!i(_e[oe]))if(!(me||fe)&&i(_e[1-oe]))_e[oe]=_e[1-oe]*(oe?10:.1);else{g[ne]=J;break}if(_e[oe]<-h?_e[oe]=-h:_e[oe]>h&&(_e[oe]=h),_e[0]===_e[1]){var Re=Math.max(1,Math.abs(_e[0]*1e-6));_e[0]-=Re,_e[1]+=Re}}},g.setScale=function(ne){var se=C._size;if(g.overlaying){var _e=w.getFromId({_fullLayout:C},g.overlaying);g.domain=_e.domain}var oe=ne&&g._r?"_r":"range",J=g.calendar;g.cleanRange(oe);var me=g.r2l(g[oe][0],J),fe=g.r2l(g[oe][1],J),Ce=N==="y";if(Ce?(g._offset=se.t+(1-g.domain[1])*se.h,g._length=se.h*(g.domain[1]-g.domain[0]),g._m=g._length/(me-fe),g._b=-g._m*fe):(g._offset=se.l+g.domain[0]*se.w,g._length=se.w*(g.domain[1]-g.domain[0]),g._m=g._length/(fe-me),g._b=-g._m*me),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Re,Be;if(g._rangebreaks=g.locateBreaks(Math.min(me,fe),Math.max(me,fe)),g._rangebreaks.length){for(Re=0;Refe&&(Ze=!Ze),Ze&&g._rangebreaks.reverse();var Ge=Ze?-1:1;for(g._m2=Ge*g._length/(Math.abs(fe-me)-g._lBreaks),g._B.push(-g._m2*(Ce?fe:me)),Re=0;ReJ&&(J+=7,meJ&&(J+=24,me=oe&&me=oe&&ne=ut.min&&(Oeut.max&&(ut.max=Le),nt=!1)}nt&&fe.push({min:Oe,max:Le})}};for(_e=0;_e{var d=Sr(),y=ji(),z=ei().BADNUM,P=y.isArrayOrTypedArray,i=y.isDateTime,n=y.cleanNumber,a=Math.round;Y.exports=function(b,x,_){var A=b,f=_.noMultiCategory;if(P(A)&&!A.length)return"-";if(!f&&m(A))return"multicategory";if(f&&Array.isArray(A[0])){for(var k=[],w=0;wk*2}function s(b){return Math.max(1,(b-1)/1e3)}function h(b,x){for(var _=b.length,A=s(_),f=0,k=0,w={},D=0;D<_;D+=A){var E=a(D),I=b[E],M=String(I);if(!w[M]){w[M]=1;var p=typeof I;p==="boolean"?k++:(x?n(I)!==z:p==="number")?f++:p==="string"&&k++}}return k>f*2}function m(b){return P(b[0])&&P(b[1])}}),Jm=ze((te,Y)=>{var d=ri(),y=Sr(),z=ji(),P=ei().FP_SAFE,i=as(),n=Zs(),a=Zc(),l=a.getFromId,o=a.isLinked;Y.exports={applyAutorangeOptions:C,getAutoRange:u,makePadFn:h,doAutoRange:_,findExtremes:A,concatExtremes:x};function u(T,N){var B,U,V=[],W=T._fullLayout,F=h(W,N,0),H=h(W,N,1),q=x(T,N),G=q.min,ee=q.max;if(G.length===0||ee.length===0)return z.simpleMap(N.range,N.r2l);var he=G[0].val,be=ee[0].val;for(B=1;B0&&(Be=_e-F(me)-H(fe),Be>oe?Ze/Be>J&&(Ce=me,Re=fe,J=Ze/Be):Ze/_e>J&&(Ce={val:me.val,nopad:1},Re={val:fe.val,nopad:1},J=Ze/_e));function Ge(ct,Ae){return Math.max(ct,H(Ae))}if(he===be){var tt=he-1,_t=he+1;if(ne)if(he===0)V=[0,1];else{var mt=(he>0?ee:G).reduce(Ge,0),vt=he/(1-Math.min(.5,mt/_e));V=he>0?[0,vt]:[vt,0]}else se?V=[Math.max(0,tt),Math.max(1,_t)]:V=[tt,_t]}else ne?(Ce.val>=0&&(Ce={val:0,nopad:1}),Re.val<=0&&(Re={val:0,nopad:1})):se&&(Ce.val-J*F(Ce)<0&&(Ce={val:0,nopad:1}),Re.val<=0&&(Re={val:1,nopad:1})),J=(Re.val-Ce.val-s(N,me.val,fe.val))/(_e-F(Ce)-H(Re)),V=[Ce.val-J*F(Ce),Re.val+J*H(Re)];return V=C(V,N),N.limitRange&&N.limitRange(),ce&&V.reverse(),z.simpleMap(V,N.l2r||Number)}function s(T,N,B){var U=0;if(T.rangebreaks)for(var V=T.locateBreaks(N,B),W=0;W0?B.ppadplus:B.ppadminus)||B.ppad||0),me=oe((T._m>0?B.ppadminus:B.ppadplus)||B.ppad||0),fe=oe(B.vpadplus||B.vpad),Ce=oe(B.vpadminus||B.vpad);if(!G){if(se=1/0,_e=-1/0,q)for(he=0;he0&&(se=be),be>_e&&be-P&&(se=be),be>_e&&be=Ze;he--)Be(he);return{min:U,max:V,opts:B}}function f(T,N,B,U){w(T,N,B,U,E)}function k(T,N,B,U){w(T,N,B,U,I)}function w(T,N,B,U,V){for(var W=U.tozero,F=U.extrapad,H=!0,q=0;q=B&&(G.extrapad||!F)){H=!1;break}else V(N,G.val)&&G.pad<=B&&(F||!G.extrapad)&&(T.splice(q,1),q--)}if(H){var ee=W&&N===0;T.push({val:N,pad:ee?0:B,extrapad:ee?!1:F})}}function D(T){return y(T)&&Math.abs(T)=N}function M(T,N){var B=N.autorangeoptions;return B&&B.minallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.minallowed:B&&B.clipmin!==void 0&&g(N,B.clipmin,B.clipmax)?Math.max(T,N.d2l(B.clipmin)):T}function p(T,N){var B=N.autorangeoptions;return B&&B.maxallowed!==void 0&&g(N,B.minallowed,B.maxallowed)?B.maxallowed:B&&B.clipmax!==void 0&&g(N,B.clipmin,B.clipmax)?Math.min(T,N.d2l(B.clipmax)):T}function g(T,N,B){return N!==void 0&&B!==void 0?(N=T.d2l(N),B=T.d2l(B),N=q&&(W=q,B=q),F<=q&&(F=q,U=q)}}return B=M(B,N),U=p(U,N),[B,U]}}),Os=ze((te,Y)=>{var d=ri(),y=Sr(),z=sh(),P=as(),i=ji(),n=i.strTranslate,a=cc(),l=Np(),o=Xi(),u=Zs(),s=Gd(),h=Yh(),m=ei(),b=m.ONEMAXYEAR,x=m.ONEAVGYEAR,_=m.ONEMINYEAR,A=m.ONEMAXQUARTER,f=m.ONEAVGQUARTER,k=m.ONEMINQUARTER,w=m.ONEMAXMONTH,D=m.ONEAVGMONTH,E=m.ONEMINMONTH,I=m.ONEWEEK,M=m.ONEDAY,p=M/2,g=m.ONEHOUR,C=m.ONEMIN,T=m.ONESEC,N=m.ONEMILLI,B=m.ONEMICROSEC,U=m.MINUS_SIGN,V=m.BADNUM,W={K:"zeroline"},F={K:"gridline",L:"path"},H={K:"minor-gridline",L:"path"},q={K:"tick",L:"path"},G={K:"tick",L:"text"},ee={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},he=Rf(),be=he.MID_SHIFT,ve=he.CAP_SHIFT,ce=he.LINE_SPACING,re=he.OPPOSITE_SIDE,ge=3,ne=Y.exports={};ne.setConvert=Z0();var se=J1(),_e=Zc(),oe=_e.idSort,J=_e.isLinked;ne.id2name=_e.id2name,ne.name2id=_e.name2id,ne.cleanId=_e.cleanId,ne.list=_e.list,ne.listIds=_e.listIds,ne.getFromId=_e.getFromId,ne.getFromTrace=_e.getFromTrace;var me=Jm();ne.getAutoRange=me.getAutoRange,ne.findExtremes=me.findExtremes;var fe=1e-4;function Ce(Ft){var Rt=(Ft[1]-Ft[0])*fe;return[Ft[0]-Rt,Ft[1]+Rt]}ne.coerceRef=function(Ft,Rt,qr,ai,si,Gr){var li=ai.charAt(ai.length-1),Pi=qr._fullLayout._subplots[li+"axis"],xi=ai+"ref",zt={};return si||(si=Pi[0]||(typeof Gr=="string"?Gr:Gr[0])),Gr||(Gr=si),Pi=Pi.concat(Pi.map(function(xr){return xr+" domain"})),zt[xi]={valType:"enumerated",values:Pi.concat(Gr?typeof Gr=="string"?[Gr]:Gr:[]),dflt:si},i.coerce(Ft,Rt,zt,xi)},ne.getRefType=function(Ft){return Ft===void 0?Ft:Ft==="paper"?"paper":Ft==="pixel"?"pixel":/( domain)$/.test(Ft)?"domain":"range"},ne.coercePosition=function(Ft,Rt,qr,ai,si,Gr){var li,Pi,xi=ne.getRefType(ai);if(xi!=="range")li=i.ensureNumber,Pi=qr(si,Gr);else{var zt=ne.getFromId(Rt,ai);Gr=zt.fraction2r(Gr),Pi=qr(si,Gr),li=zt.cleanPos}Ft[si]=li(Pi)},ne.cleanPosition=function(Ft,Rt,qr){var ai=qr==="paper"||qr==="pixel"?i.ensureNumber:ne.getFromId(Rt,qr).cleanPos;return ai(Ft)},ne.redrawComponents=function(Ft,Rt){Rt=Rt||ne.listIds(Ft);var qr=Ft._fullLayout;function ai(si,Gr,li,Pi){for(var xi=P.getComponentMethod(si,Gr),zt={},xr=0;xr2e-6||((qr-Ft._forceTick0)/Ft._minDtick%1+1.000001)%1>2e-6)&&(Ft._minDtick=0))},ne.saveRangeInitial=function(Ft,Rt){for(var qr=ne.list(Ft,"",!0),ai=!1,si=0;siQr*.3||zt(ai)||zt(si))){var Ri=qr.dtick/2;Ft+=Ft+Rili){var Pi=Number(qr.substr(1));Gr.exactYears>li&&Pi%12===0?Ft=ne.tickIncrement(Ft,"M6","reverse")+M*1.5:Gr.exactMonths>li?Ft=ne.tickIncrement(Ft,"M1","reverse")+M*15.5:Ft-=p;var xi=ne.tickIncrement(Ft,qr);if(xi<=ai)return xi}return Ft}ne.prepMinorTicks=function(Ft,Rt,qr){if(!Rt.minor.dtick){delete Ft.dtick;var ai=Rt.dtick&&y(Rt._tmin),si;if(ai){var Gr=ne.tickIncrement(Rt._tmin,Rt.dtick,!0);si=[Rt._tmin,Gr*.99+Rt._tmin*.01]}else{var li=i.simpleMap(Rt.range,Rt.r2l);si=[li[0],.8*li[0]+.2*li[1]]}if(Ft.range=i.simpleMap(si,Rt.l2r),Ft._isMinor=!0,ne.prepTicks(Ft,qr),ai){var Pi=y(Rt.dtick),xi=y(Ft.dtick),zt=Pi?Rt.dtick:+Rt.dtick.substring(1),xr=xi?Ft.dtick:+Ft.dtick.substring(1);Pi&&xi?_t(zt,xr)?zt===2*I&&xr===2*M&&(Ft.dtick=I):zt===2*I&&xr===3*M?Ft.dtick=I:zt===I&&!(Rt._input.minor||{}).nticks?Ft.dtick=M:mt(zt/xr,2.5)?Ft.dtick=zt/2:Ft.dtick=zt:String(Rt.dtick).charAt(0)==="M"?xi?Ft.dtick="M1":_t(zt,xr)?zt>=12&&xr===2&&(Ft.dtick="M3"):Ft.dtick=Rt.dtick:String(Ft.dtick).charAt(0)==="L"?String(Rt.dtick).charAt(0)==="L"?_t(zt,xr)||(Ft.dtick=mt(zt/xr,2.5)?Rt.dtick/2:Rt.dtick):Ft.dtick="D1":Ft.dtick==="D2"&&+Rt.dtick>1&&(Ft.dtick=1)}Ft.range=Rt.range}Rt.minor._tick0Init===void 0&&(Ft.tick0=Rt.tick0)};function _t(Ft,Rt){return Math.abs((Ft/Rt+.5)%1-.5)<.001}function mt(Ft,Rt){return Math.abs(Ft/Rt-1)<.001}ne.prepTicks=function(Ft,Rt){var qr=i.simpleMap(Ft.range,Ft.r2l,void 0,void 0,Rt);if(Ft.tickmode==="auto"||!Ft.dtick){var ai=Ft.nticks,si;ai||(Ft.type==="category"||Ft.type==="multicategory"?(si=Ft.tickfont?i.bigFont(Ft.tickfont.size||12):15,ai=Ft._length/si):(si=Ft._id.charAt(0)==="y"?40:80,ai=i.constrain(Ft._length/si,4,9)+1),Ft._name==="radialaxis"&&(ai*=2)),Ft.minor&&Ft.minor.tickmode!=="array"||Ft.tickmode==="array"&&(ai*=100),Ft._roughDTick=Math.abs(qr[1]-qr[0])/ai,ne.autoTicks(Ft,Ft._roughDTick),Ft._minDtick>0&&Ft.dtick0?(Gr=ai-1,li=ai):(Gr=ai,li=ai);var Pi=Ft[Gr].value,xi=Ft[li].value,zt=Math.abs(xi-Pi),xr=qr||zt,Qr=0;xr>=_?zt>=_&&zt<=b?Qr=zt:Qr=x:qr===f&&xr>=k?zt>=k&&zt<=A?Qr=zt:Qr=f:xr>=E?zt>=E&&zt<=w?Qr=zt:Qr=D:qr===I&&xr>=I?Qr=I:xr>=M?Qr=M:qr===p&&xr>=p?Qr=p:qr===g&&xr>=g&&(Qr=g);var Ri;Qr>=zt&&(Qr=zt,Ri=!0);var en=si+Qr;if(Rt.rangebreaks&&Qr>0){for(var _n=84,Zi=0,Wi=0;Wi<_n;Wi++){var pn=(Wi+.5)/_n;Rt.maskBreaks(si*(1-pn)+pn*en)!==V&&Zi++}Qr*=Zi/_n,Qr||(Ft[ai].drop=!0),Ri&&zt>I&&(Qr=zt)}(Qr>0||ai===0)&&(Ft[ai].periodX=si+Qr/2)}}ne.calcTicks=function(Ft,Rt){for(var qr=Ft.type,ai=Ft.calendar,si=Ft.ticklabelstep,Gr=Ft.ticklabelmode==="period",li=Ft.range[0]>Ft.range[1],Pi=!Ft.ticklabelindex||i.isArrayOrTypedArray(Ft.ticklabelindex)?Ft.ticklabelindex:[Ft.ticklabelindex],xi=i.simpleMap(Ft.range,Ft.r2l,void 0,void 0,Rt),zt=xi[1]=(Ua?0:1);ea--){var fo=!ea;ea?(Ft._dtickInit=Ft.dtick,Ft._tick0Init=Ft.tick0):(Ft.minor._dtickInit=Ft.minor.dtick,Ft.minor._tick0Init=Ft.minor.tick0);var ho=ea?Ft:i.extendFlat({},Ft,Ft.minor);if(fo?ne.prepMinorTicks(ho,Ft,Rt):ne.prepTicks(ho,Rt),ho.tickmode==="array"){ea?(Zi=[],en=nt(Ft,!fo)):(Wi=[],_n=nt(Ft,!fo));continue}if(ho.tickmode==="sync"){Zi=[],en=Le(Ft);continue}var Vo=Ce(xi),Ao=Vo[0],Wo=Vo[1],Wa=y(ho.dtick),Ts=qr==="log"&&!(Wa||ho.dtick.charAt(0)==="L"),fs=ne.tickFirst(ho,Rt);if(ea){if(Ft._tmin=fs,fs=Wo:es<=Wo;es=ne.tickIncrement(es,xl,zt,ai)){if(ea&&rl++,ho.rangebreaks&&!zt){if(es=Qr)break}if(Zi.length>Ri||es===_l)break;_l=es;var sl={value:es};ea?(Ts&&es!==(es|0)&&(sl.simpleLabel=!0),si>1&&rl%si&&(sl.skipLabel=!0),Zi.push(sl)):(sl.minor=!0,Wi.push(sl))}}if(!Wi||Wi.length<2)Pi=!1;else{var Gl=(Wi[1].value-Wi[0].value)*(li?-1:1);io(Gl,Ft.tickformat)||(Pi=!1)}if(!Pi)pn=Zi;else{var ms=Zi.concat(Wi);Gr&&Zi.length&&(ms=ms.slice(1)),ms=ms.sort(function(bl,ls){return bl.value-ls.value}).filter(function(bl,ls,Ru){return ls===0||bl.value!==Ru[ls-1].value});var Bs=ms.map(function(bl,ls){return bl.minor===void 0&&!bl.skipLabel?ls:null}).filter(function(bl){return bl!==null});Bs.forEach(function(bl){Pi.map(function(ls){var Ru=bl+ls;Ru>=0&&Ru-1;Xs--){if(Zi[Xs].drop){Zi.splice(Xs,1);continue}Zi[Xs].value=Kn(Zi[Xs].value,Ft);var pl=Ft.c2p(Zi[Xs].value);(su?tu>pl-is:tuQr||icQr&&(Ru.periodX=Qr),icsi&&Rix)Rt/=x,ai=si(10),Ft.dtick="M"+12*Yr(Rt,ai,xt);else if(Gr>D)Rt/=D,Ft.dtick="M"+Yr(Rt,1,ut);else if(Gr>M){if(Ft.dtick=Yr(Rt,M,Ft._hasDayOfWeekBreaks?[1,2,7,14]:Gt),!qr){var li=ne.getTickFormat(Ft),Pi=Ft.ticklabelmode==="period";Pi&&(Ft._rawTick0=Ft.tick0),/%[uVW]/.test(li)?Ft.tick0=i.dateTick0(Ft.calendar,2):Ft.tick0=i.dateTick0(Ft.calendar,1),Pi&&(Ft._dowTick0=Ft.tick0)}}else Gr>g?Ft.dtick=Yr(Rt,g,ut):Gr>C?Ft.dtick=Yr(Rt,C,Et):Gr>T?Ft.dtick=Yr(Rt,T,Et):(ai=si(10),Ft.dtick=Yr(Rt,ai,xt))}else if(Ft.type==="log"){Ft.tick0=0;var xi=i.simpleMap(Ft.range,Ft.r2l);if(Ft._isMinor&&(Rt*=1.5),Rt>.7)Ft.dtick=Math.ceil(Rt);else if(Math.abs(xi[1]-xi[0])<1){var zt=1.5*Math.abs((xi[1]-xi[0])/Rt);Rt=Math.abs(Math.pow(10,xi[1])-Math.pow(10,xi[0]))/zt,ai=si(10),Ft.dtick="L"+Yr(Rt,ai,xt)}else Ft.dtick=Rt>.3?"D2":"D1"}else Ft.type==="category"||Ft.type==="multicategory"?(Ft.tick0=0,Ft.dtick=Math.ceil(Math.max(Rt,1))):Fn(Ft)?(Ft.tick0=0,ai=1,Ft.dtick=Yr(Rt,ai,mr)):(Ft.tick0=0,ai=si(10),Ft.dtick=Yr(Rt,ai,xt));if(Ft.dtick===0&&(Ft.dtick=1),!y(Ft.dtick)&&typeof Ft.dtick!="string"){var xr=Ft.dtick;throw Ft.dtick=1,"ax.dtick error: "+String(xr)}};function ii(Ft){var Rt=Ft.dtick;if(Ft._tickexponent=0,!y(Rt)&&typeof Rt!="string"&&(Rt=1),(Ft.type==="category"||Ft.type==="multicategory")&&(Ft._tickround=null),Ft.type==="date"){var qr=Ft.r2l(Ft.tick0),ai=Ft.l2r(qr).replace(/(^-|i)/g,""),si=ai.length;if(String(Rt).charAt(0)==="M")si>10||ai.substr(5)!=="01-01"?Ft._tickround="d":Ft._tickround=+Rt.substr(1)%12===0?"y":"m";else if(Rt>=M&&si<=10||Rt>=M*15)Ft._tickround="d";else if(Rt>=C&&si<=16||Rt>=g)Ft._tickround="M";else if(Rt>=T&&si<=19||Rt>=C)Ft._tickround="S";else{var Gr=Ft.l2r(qr+Rt).replace(/^-/,"").length;Ft._tickround=Math.max(si,Gr)-20,Ft._tickround<0&&(Ft._tickround=4)}}else if(y(Rt)||Rt.charAt(0)==="L"){var li=Ft.range.map(Ft.r2d||Number);y(Rt)||(Rt=Number(Rt.substr(1))),Ft._tickround=2-Math.floor(Math.log(Rt)/Math.LN10+.01);var Pi=Math.max(Math.abs(li[0]),Math.abs(li[1])),xi=Math.floor(Math.log(Pi)/Math.LN10+.01),zt=Ft.minexponent===void 0?3:Ft.minexponent;Math.abs(xi)>zt&&(at(Ft.exponentformat)&&Ft.exponentformat!=="SI extended"&&!ht(xi)||at(Ft.exponentformat)&&Ft.exponentformat==="SI extended"&&!At(xi)?Ft._tickexponent=3*Math.round((xi-1)/3):Ft._tickexponent=xi)}else Ft._tickround=null}ne.tickIncrement=function(Ft,Rt,qr,ai){var si=qr?-1:1;if(y(Rt))return i.increment(Ft,si*Rt);var Gr=Rt.charAt(0),li=si*Number(Rt.substr(1));if(Gr==="M")return i.incrementMonth(Ft,li,ai);if(Gr==="L")return Math.log(Math.pow(10,Ft)+li)/Math.LN10;if(Gr==="D"){var Pi=Rt==="D2"?vr:Qt,xi=Ft+si*.01,zt=i.roundUp(i.mod(xi,1),Pi,qr);return Math.floor(xi)+Math.log(d.round(Math.pow(10,zt),1))/Math.LN10}throw"unrecognized dtick "+String(Rt)},ne.tickFirst=function(Ft,Rt){var qr=Ft.r2l||Number,ai=i.simpleMap(Ft.range,qr,void 0,void 0,Rt),si=ai[1]=0&&pn<=Ft._length?Wi:null};if(Gr&&i.isArrayOrTypedArray(Ft.ticktext)){var Qr=i.simpleMap(Ft.range,Ft.r2l),Ri=(Math.abs(Qr[1]-Qr[0])-(Ft._lBreaks||0))/1e4;for(zt=0;zt"+Pi;else{var zt=Jn(Ft),xr=Ft._trueSide||Ft.side;(!zt&&xr==="top"||zt&&xr==="bottom")&&(li+="
")}Rt.text=li}function vi(Ft,Rt,qr,ai,si){var Gr=Ft.dtick,li=Rt.x,Pi=Ft.tickformat,xi=typeof Gr=="string"&&Gr.charAt(0);if(si==="never"&&(si=""),ai&&xi!=="L"&&(Gr="L3",xi="L"),Pi||xi==="L")Rt.text=Yt(Math.pow(10,li),Ft,si,ai);else if(y(Gr)||xi==="D"&&(Ft.minorloglabels==="complete"||i.mod(li+.01,1)<.1)){Ft.minorloglabels==="complete"&&!(i.mod(li+.01,1)<.1)&&(Rt.fontSize*=.75);var zt=Math.pow(10,li).toExponential(0),xr=zt.split("e"),Qr=+xr[1],Ri=Math.abs(Qr),en=Ft.exponentformat;en==="power"||at(en)&&en!=="SI extended"&&ht(Qr)||at(en)&&en==="SI extended"&&At(Qr)?(Rt.text=xr[0],Ri>0&&(Rt.text+="x10"),Rt.text==="1x10"&&(Rt.text="10"),Qr!==0&&Qr!==1&&(Rt.text+=""+(Qr>0?"":U)+Ri+""),Rt.fontSize*=1.25):(en==="e"||en==="E")&&Ri>2?Rt.text=xr[0]+en+(Qr>0?"+":U)+Ri:(Rt.text=Yt(Math.pow(10,li),Ft,"","fakehover"),Gr==="D1"&&Ft._id.charAt(0)==="y"&&(Rt.dy-=Rt.fontSize/6))}else if(xi==="D")Rt.text=Ft.minorloglabels==="none"?"":String(Math.round(Math.pow(10,i.mod(li,1)))),Rt.fontSize*=.75;else throw"unrecognized dtick "+String(Gr);if(Ft.dtick==="D1"){var _n=String(Rt.text).charAt(0);(_n==="0"||_n==="1")&&(Ft._id.charAt(0)==="y"?Rt.dx-=Rt.fontSize/4:(Rt.dy+=Rt.fontSize/2,Rt.dx+=(Ft.range[1]>Ft.range[0]?1:-1)*Rt.fontSize*(li<0?.5:.25)))}}function Ot(Ft,Rt){var qr=Ft._categories[Math.round(Rt.x)];qr===void 0&&(qr=""),Rt.text=String(qr)}function Xe(Ft,Rt,qr){var ai=Math.round(Rt.x),si=Ft._categories[ai]||[],Gr=si[1]===void 0?"":String(si[1]),li=si[0]===void 0?"":String(si[0]);qr?Rt.text=li+" - "+Gr:(Rt.text=Gr,Rt.text2=li)}function ot(Ft,Rt,qr,ai,si){si==="never"?si="":Ft.showexponent==="all"&&Math.abs(Rt.x/Ft.dtick)<1e-6&&(si="hide"),Rt.text=Yt(Rt.x,Ft,si,ai)}function De(Ft,Rt,qr,ai,si){if(Ft.thetaunit==="radians"&&!qr){var Gr=Rt.x/180;if(Gr===0)Rt.text="0";else{var li=ye(Gr);if(li[1]>=100)Rt.text=Yt(i.deg2rad(Rt.x),Ft,si,ai);else{var Pi=Rt.x<0;li[1]===1?li[0]===1?Rt.text="π":Rt.text=li[0]+"π":Rt.text=["",li[0],"","⁄","",li[1],"","π"].join(""),Pi&&(Rt.text=U+Rt.text)}}}else Rt.text=Yt(Rt.x,Ft,si,ai)}function ye(Ft){function Rt(Pi,xi){return Math.abs(Pi-xi)<=1e-6}function qr(Pi,xi){return Rt(xi,0)?Pi:qr(xi,Pi%xi)}function ai(Pi){for(var xi=1;!Rt(Math.round(Pi*xi)/xi,Pi);)xi*=10;return xi}var si=ai(Ft),Gr=Ft*si,li=Math.abs(qr(Gr,si));return[Math.round(Gr/li),Math.round(si/li)]}var Pe=["f","p","n","μ","m","","k","M","G","T"],He=["q","r","y","z","a",...Pe,"P","E","Z","Y","R","Q"],at=Ft=>["SI","SI extended","B"].includes(Ft);function ht(Ft){return Ft>14||Ft<-15}function At(Ft){return Ft>32||Ft<-30}function Wt(Ft,Rt){return at(Rt)?!!(Rt==="SI extended"&&At(Ft)||Rt!=="SI extended"&&ht(Ft)):!1}function Yt(Ft,Rt,qr,ai){var si=Ft<0,Gr=Rt._tickround,li=qr||Rt.exponentformat||"B",Pi=Rt._tickexponent,xi=ne.getTickFormat(Rt),zt=Rt.separatethousands;if(ai){var xr={exponentformat:li,minexponent:Rt.minexponent,dtick:Rt.showexponent==="none"?Rt.dtick:y(Ft)&&Math.abs(Ft)||1,range:Rt.showexponent==="none"?Rt.range.map(Rt.r2d):[0,Ft||1]};ii(xr),Gr=(Number(xr._tickround)||0)+4,Pi=xr._tickexponent,Rt.hoverformat&&(xi=Rt.hoverformat)}if(xi)return Rt._numFormat(xi)(Ft).replace(/-/g,U);var Qr=Math.pow(10,-Gr)/2;if(li==="none"&&(Pi=0),Ft=Math.abs(Ft),Ft"+_n+"":li==="B"&&Pi===9?Ft+="B":at(li)&&(Ft+=li==="SI extended"?He[Pi/3+10]:Pe[Pi/3+5])}return si?U+Ft:Ft}ne.getTickFormat=function(Ft){var Rt;function qr(xi){return typeof xi!="string"?xi:Number(xi.replace("M",""))*D}function ai(xi,zt){var xr=["L","D"];if(typeof xi==typeof zt){if(typeof xi=="number")return xi-zt;var Qr=xr.indexOf(xi.charAt(0)),Ri=xr.indexOf(zt.charAt(0));return Qr===Ri?Number(xi.replace(/(L|D)/g,""))-Number(zt.replace(/(L|D)/g,"")):Qr-Ri}else return typeof xi=="number"?1:-1}function si(xi,zt,xr){var Qr=xr||function(_n){return _n},Ri=zt[0],en=zt[1];return(!Ri&&typeof Ri!="number"||Qr(Ri)<=Qr(xi))&&(!en&&typeof en!="number"||Qr(en)>=Qr(xi))}function Gr(xi,zt){var xr=zt[0]===null,Qr=zt[1]===null,Ri=ai(xi,zt[0])>=0,en=ai(xi,zt[1])<=0;return(xr||Ri)&&(Qr||en)}var li,Pi;if(Ft.tickformatstops&&Ft.tickformatstops.length>0)switch(Ft.type){case"date":case"linear":{for(Rt=0;Rt=0&&si.unshift(si.splice(xr,1).shift())}});var Pi={false:{left:0,right:0}};return i.syncOrAsync(si.map(function(xi){return function(){if(xi){var zt=ne.getFromId(Ft,xi);qr||(qr={}),qr.axShifts=Pi,qr.overlayingShiftedAx=li;var xr=ne.drawOne(Ft,zt,qr);return zt._shiftPusher&&Mn(zt,zt._fullDepth||0,Pi,!0),zt._r=zt.range.slice(),zt._rl=i.simpleMap(zt._r,zt.r2l),xr}}}))},ne.drawOne=function(Ft,Rt,qr){qr=qr||{};var ai=qr.axShifts||{},si=qr.overlayingShiftedAx||[],Gr,li,Pi;Rt.setScale();var xi=Ft._fullLayout,zt=Rt._id,xr=zt.charAt(0),Qr=ne.counterLetter(zt),Ri=xi._plots[Rt._mainSubplot],en=Rt.zerolinelayer==="above traces";if(!Ri)return;if(Rt._shiftPusher=Rt.autoshift||si.indexOf(Rt._id)!==-1||si.indexOf(Rt.overlaying)!==-1,Rt._shiftPusher&Rt.anchor==="free"){var _n=Rt.linewidth/2||0;Rt.ticks==="inside"&&(_n+=Rt.ticklen),Mn(Rt,_n,ai,!0),Mn(Rt,Rt.shift||0,ai,!1)}(qr.skipTitle!==!0||Rt._shift===void 0)&&(Rt._shift=Ha(Rt,ai));var Zi=Ri[xr+"axislayer"],Wi=Rt._mainLinePosition,pn=Wi+=Rt._shift,Ua=Rt._mainMirrorPosition,ea=Rt._vals=ne.calcTicks(Rt),fo=[Rt.mirror,pn,Ua].join("_");for(Gr=0;Gr0?Ll.bottom-Ru:0,ic))));var pc=0,Ah=0;if(Rt._shiftPusher&&(pc=Math.max(ic,Ll.height>0?bl==="l"?Ru-Ll.left:Ll.right-Ru:0),Rt.title.text!==xi._dfltTitle[xr]&&(Ah=(Rt._titleStandoff||0)+(Rt._titleScoot||0),bl==="l"&&(Ah+=Sn(Rt))),Rt._fullDepth=Math.max(pc,Ah)),Rt.automargin){Hl={x:0,y:0,r:0,l:0,t:0,b:0};var uh=[0,1],gh=typeof Rt._shift=="number"?Rt._shift:0;if(xr==="x"){if(bl==="b"?Hl[bl]=Rt._depth:(Hl[bl]=Rt._depth=Math.max(Ll.width>0?Ru-Ll.top:0,ic),uh.reverse()),Ll.width>0){var td=Ll.right-(Rt._offset+Rt._length);td>0&&(Hl.xr=1,Hl.r=td);var Nf=Rt._offset-Ll.left;Nf>0&&(Hl.xl=0,Hl.l=Nf)}}else if(bl==="l"?(Rt._depth=Math.max(Ll.height>0?Ru-Ll.left:0,ic),Hl[bl]=Rt._depth-gh):(Rt._depth=Math.max(Ll.height>0?Ll.right-Ru:0,ic),Hl[bl]=Rt._depth+gh,uh.reverse()),Ll.height>0){var Vl=Ll.bottom-(Rt._offset+Rt._length);Vl>0&&(Hl.yb=0,Hl.b=Vl);var Kc=Rt._offset-Ll.top;Kc>0&&(Hl.yt=1,Hl.t=Kc)}Hl[Qr]=Rt.anchor==="free"?Rt.position:Rt._anchorAxis.domain[uh[0]],Rt.title.text!==xi._dfltTitle[xr]&&(Hl[bl]+=Sn(Rt)+(Rt.title.standoff||0)),Rt.mirror&&Rt.anchor!=="free"&&(lu={x:0,y:0,r:0,l:0,t:0,b:0},lu[ls]=Rt.linewidth,Rt.mirror&&Rt.mirror!==!0&&(lu[ls]+=ic),Rt.mirror===!0||Rt.mirror==="ticks"?lu[Qr]=Rt._anchorAxis.domain[uh[1]]:(Rt.mirror==="all"||Rt.mirror==="allticks")&&(lu[Qr]=[Rt._counterDomainMin,Rt._counterDomainMax][uh[1]]))}pu&&(hu=P.getComponentMethod("rangeslider","autoMarginOpts")(Ft,Rt)),typeof Rt.automargin=="string"&&(hr(Hl,Rt.automargin),hr(lu,Rt.automargin)),z.autoMargin(Ft,_r(Rt),Hl),z.autoMargin(Ft,Er(Rt),lu),z.autoMargin(Ft,di(Rt),hu)}),i.syncOrAsync(Ps)}};function hr(Ft,Rt){if(Ft){var qr=Object.keys(ee).reduce(function(ai,si){return Rt.indexOf(si)!==-1&&ee[si].forEach(function(Gr){ai[Gr]=1}),ai},{});Object.keys(Ft).forEach(function(ai){qr[ai]||(ai.length===1?Ft[ai]=0:delete Ft[ai])})}}function zr(Ft,Rt){var qr=[],ai,si=function(Gr,li){var Pi=Gr.xbnd[li];Pi!==null&&qr.push(i.extendFlat({},Gr,{x:Pi}))};if(Rt.length){for(ai=0;aiFt.range[1],Pi=Ft.ticklabelposition&&Ft.ticklabelposition.indexOf("inside")!==-1,xi=!Pi;if(qr){var zt=li?-1:1;qr=qr*zt}if(ai){var xr=Ft.side,Qr=Pi&&(xr==="top"||xr==="left")||xi&&(xr==="bottom"||xr==="right")?1:-1;ai=ai*Qr}return Ft._id.charAt(0)==="x"?function(Ri){return n(si+Ft._offset+Ft.l2p(un(Ri))+qr,Gr+ai)}:function(Ri){return n(Gr+ai,si+Ft._offset+Ft.l2p(un(Ri))+qr)}};function un(Ft){return Ft.periodX!==void 0?Ft.periodX:Ft.x}function cn(Ft){var Rt=Ft.ticklabelposition||"",qr=Ft.tickson||"",ai=function(_n){return Rt.indexOf(_n)!==-1},si=ai("top"),Gr=ai("left"),li=ai("right"),Pi=ai("bottom"),xi=ai("inside"),zt=qr!=="boundaries"&&(Pi||Gr||si||li);if(!zt&&!xi)return[0,0];var xr=Ft.side,Qr=zt?(Ft.tickwidth||0)/2:0,Ri=ge,en=Ft.tickfont?Ft.tickfont.size:12;return(Pi||si)&&(Qr+=en*ve,Ri+=(Ft.linewidth||0)/2),(Gr||li)&&(Qr+=(Ft.linewidth||0)/2,Ri+=ge),xi&&xr==="top"&&(Ri-=en*(1-ve)),(Gr||si)&&(Qr=-Qr),(xr==="bottom"||xr==="right")&&(Ri=-Ri),[zt?Qr:0,xi?Ri:0]}ne.makeTickPath=function(Ft,Rt,qr,ai){ai||(ai={});var si=ai.minor;if(si&&!Ft.minor)return"";var Gr=ai.len!==void 0?ai.len:si?Ft.minor.ticklen:Ft.ticklen,li=Ft._id.charAt(0),Pi=(Ft.linewidth||1)/2;return li==="x"?"M0,"+(Rt+Pi*qr)+"v"+Gr*qr:"M"+(Rt+Pi*qr)+",0h"+Gr*qr},ne.makeLabelFns=function(Ft,Rt,qr){var ai=Ft.ticklabelposition||"",si=Ft.tickson||"",Gr=function(es){return ai.indexOf(es)!==-1},li=Gr("top"),Pi=Gr("left"),xi=Gr("right"),zt=Gr("bottom"),xr=si!=="boundaries"&&(zt||Pi||li||xi),Qr=Gr("inside"),Ri=ai==="inside"&&Ft.ticks==="inside"||!Qr&&Ft.ticks==="outside"&&si!=="boundaries",en=0,_n=0,Zi=Ri?Ft.ticklen:0;if(Qr?Zi*=-1:xr&&(Zi=0),Ri&&(en+=Zi,qr)){var Wi=i.deg2rad(qr);en=Zi*Math.cos(Wi)+1,_n=Zi*Math.sin(Wi)}Ft.showticklabels&&(Ri||Ft.showline)&&(en+=.2*Ft.tickfont.size),en+=(Ft.linewidth||1)/2*(Qr?-1:1);var pn={labelStandoff:en,labelShift:_n},Ua,ea,fo,ho,Vo=0,Ao=Ft.side,Wo=Ft._id.charAt(0),Wa=Ft.tickangle,Ts;if(Wo==="x")Ts=!Qr&&Ao==="bottom"||Qr&&Ao==="top",ho=Ts?1:-1,Qr&&(ho*=-1),Ua=_n*ho,ea=Rt+en*ho,fo=Ts?1:-.2,Math.abs(Wa)===90&&(Qr?fo+=be:Wa===-90&&Ao==="bottom"?fo=ve:Wa===90&&Ao==="top"?fo=be:fo=.5,Vo=be/2*(Wa/90)),pn.xFn=function(es){return es.dx+Ua+Vo*es.fontSize},pn.yFn=function(es){return es.dy+ea+es.fontSize*fo},pn.anchorFn=function(es,rl){if(xr){if(Pi)return"end";if(xi)return"start"}return!y(rl)||rl===0||rl===180?"middle":rl*ho<0!==Qr?"end":"start"},pn.heightFn=function(es,rl,ds){return rl<-60||rl>60?-.5*ds:Ft.side==="top"!==Qr?-ds:0};else if(Wo==="y"){if(Ts=!Qr&&Ao==="left"||Qr&&Ao==="right",ho=Ts?1:-1,Qr&&(ho*=-1),Ua=en,ea=_n*ho,fo=0,!Qr&&Math.abs(Wa)===90&&(Wa===-90&&Ao==="left"||Wa===90&&Ao==="right"?fo=ve:fo=.5),Qr){var fs=y(Wa)?+Wa:0;if(fs!==0){var _l=i.deg2rad(fs);Vo=Math.abs(Math.sin(_l))*ve*ho,fo=0}}pn.xFn=function(es){return es.dx+Rt-(Ua+es.fontSize*fo)*ho+Vo*es.fontSize},pn.yFn=function(es){return es.dy+ea+es.fontSize*be},pn.anchorFn=function(es,rl){return y(rl)&&Math.abs(rl)===90?"middle":Ts?"end":"start"},pn.heightFn=function(es,rl,ds){return Ft.side==="right"&&(rl*=-1),rl<-30?-ds:rl<30?-.5*ds:0}}return pn};function yn(Ft){return[Ft.text,Ft.x,Ft.axInfo,Ft.font,Ft.fontSize,Ft.fontColor].join("_")}ne.drawTicks=function(Ft,Rt,qr){qr=qr||{};var ai=Rt._id+"tick",si=[].concat(Rt.minor&&Rt.minor.ticks?qr.vals.filter(function(li){return li.minor&&!li.noTick}):[]).concat(Rt.ticks?qr.vals.filter(function(li){return!li.minor&&!li.noTick}):[]),Gr=qr.layer.selectAll("path."+ai).data(si,yn);Gr.exit().remove(),Gr.enter().append("path").classed(ai,1).classed("ticks",1).classed("crisp",qr.crisp!==!1).each(function(li){return o.stroke(d.select(this),li.minor?Rt.minor.tickcolor:Rt.tickcolor)}).style("stroke-width",function(li){return u.crispRound(Ft,li.minor?Rt.minor.tickwidth:Rt.tickwidth,1)+"px"}).attr("d",qr.path).style("display",null),sa(Rt,[q]),Gr.attr("transform",qr.transFn)},ne.drawGrid=function(Ft,Rt,qr){if(qr=qr||{},Rt.tickmode!=="sync"){var ai=Rt._id+"grid",si=Rt.minor&&Rt.minor.showgrid,Gr=si?qr.vals.filter(function(pn){return pn.minor}):[],li=Rt.showgrid?qr.vals.filter(function(pn){return!pn.minor}):[],Pi=qr.counterAxis;if(Pi&&ne.shouldShowZeroLine(Ft,Rt,Pi))for(var xi=Rt.tickmode==="array",zt=0;zt=0;_n--){var Zi=_n?Ri:en;if(Zi){var Wi=Zi.selectAll("path."+ai).data(_n?li:Gr,yn);Wi.exit().remove(),Wi.enter().append("path").classed(ai,1).classed("crisp",qr.crisp!==!1),Wi.attr("transform",qr.transFn).attr("d",qr.path).each(function(pn){return o.stroke(d.select(this),pn.minor?Rt.minor.gridcolor:Rt.gridcolor||"#ddd")}).style("stroke-dasharray",function(pn){return u.dashStyle(pn.minor?Rt.minor.griddash:Rt.griddash,pn.minor?Rt.minor.gridwidth:Rt.gridwidth)}).style("stroke-width",function(pn){return(pn.minor?Qr:Rt._gw)+"px"}).style("display",null),typeof qr.path=="function"&&Wi.attr("d",qr.path)}}sa(Rt,[F,H])}},ne.drawZeroLine=function(Ft,Rt,qr){qr=qr||qr;var ai=Rt._id+"zl",si=ne.shouldShowZeroLine(Ft,Rt,qr.counterAxis),Gr=qr.layer.selectAll("path."+ai).data(si?[{x:0,id:Rt._id}]:[]);Gr.exit().remove(),Gr.enter().append("path").classed(ai,1).classed("zl",1).classed("crisp",qr.crisp!==!1).each(function(){qr.layer.selectAll("path").sort(function(li,Pi){return oe(li.id,Pi.id)})}),Gr.attr("transform",qr.transFn).attr("d",qr.path).call(o.stroke,Rt.zerolinecolor||o.defaultLine).style("stroke-width",u.crispRound(Ft,Rt.zerolinewidth,Rt._gw||1)+"px").style("display",null),sa(Rt,[W])},ne.drawLabels=function(Ft,Rt,qr){qr=qr||{};var ai=Ft._fullLayout,si=Rt._id,Gr=Rt.zerolinelayer==="above traces",li=qr.cls||si+"tick",Pi=qr.vals.filter(function(ms){return ms.text}),xi=qr.labelFns,zt=qr.secondary?0:Rt.tickangle,xr=(Rt._prevTickAngles||{})[li],Qr=qr.layer.selectAll("g."+li).data(Rt.showticklabels?Pi:[],yn),Ri=[];Qr.enter().append("g").classed(li,1).append("text").attr("text-anchor","middle").each(function(ms){var Bs=d.select(this),No=Ft._promises.length;Bs.call(a.positionText,xi.xFn(ms),xi.yFn(ms)).call(u.font,{family:ms.font,size:ms.fontSize,color:ms.fontColor,weight:ms.fontWeight,style:ms.fontStyle,variant:ms.fontVariant,textcase:ms.fontTextcase,lineposition:ms.fontLineposition,shadow:ms.fontShadow}).text(ms.text).call(a.convertToTspans,Ft),Ft._promises[No]?Ri.push(Ft._promises.pop().then(function(){en(Bs,zt)})):en(Bs,zt)}),sa(Rt,[G]),Qr.exit().remove(),qr.repositionOnUpdate&&Qr.each(function(ms){d.select(this).select("text").call(a.positionText,xi.xFn(ms),xi.yFn(ms))});function en(ms,Bs){ms.each(function(No){var Ls=d.select(this),Il=Ls.select(".text-math-group"),Jl=xi.anchorFn(No,Bs),ou=qr.transFn.call(Ls.node(),No)+(y(Bs)&&+Bs!=0?" rotate("+Bs+","+xi.xFn(No)+","+(xi.yFn(No)-No.fontSize/2)+")":""),Gs=a.lineCount(Ls),$a=ce*No.fontSize,So=xi.heightFn(No,y(Bs)?+Bs:0,(Gs-1)*$a);if(So&&(ou+=n(0,So)),Il.empty()){var Xs=Ls.select("text");Xs.attr({transform:ou,"text-anchor":Jl}),Xs.style("display",null),Rt._adjustTickLabelsOverflow&&Rt._adjustTickLabelsOverflow()}else{var su=u.bBox(Il.node()).width,is=su*{end:-.5,start:.5}[Jl];Il.attr("transform",ou+n(is,0))}})}Rt._adjustTickLabelsOverflow=function(){var ms=Rt.ticklabeloverflow;if(!(!ms||ms==="allow")){var Bs=ms.indexOf("hide")!==-1,No=Rt._id.charAt(0)==="x",Ls=0,Il=No?Ft._fullLayout.width:Ft._fullLayout.height;if(ms.indexOf("domain")!==-1){var Jl=i.simpleMap(Rt.range,Rt.r2l);Ls=Rt.l2p(Jl[0])+Rt._offset,Il=Rt.l2p(Jl[1])+Rt._offset}var ou=Math.min(Ls,Il),Gs=Math.max(Ls,Il),$a=Rt.side,So=1/0,Xs=-1/0;Qr.each(function(pl){var Nl=d.select(this),Gu=Nl.select(".text-math-group");if(Gu.empty()){var bo=u.bBox(Nl.node()),Ps=0;No?(bo.right>Gs||bo.leftGs||bo.top+(Rt.tickangle?0:pl.fontSize/4)Rt["_visibleLabelMin_"+Jl._id]?Nl.style("display","none"):Gs.K==="tick"&&!ou&&Nl.node().style.display!=="none"&&Nl.style("display",null)})})})})},en(Qr,xr+1?xr:zt);function _n(){return Ri.length&&Promise.all(Ri)}var Zi=null;function Wi(){if(en(Qr,zt),Pi.length&&Rt.autotickangles&&(Rt.type!=="log"||String(Rt.dtick).charAt(0)!=="D")){Zi=Rt.autotickangles[0];var ms=0,Bs=[],No,Ls=1;Qr.each(function(Hl){ms=Math.max(ms,Hl.fontSize);var lu=Rt.l2p(Hl.x),hu=lr(this),pc=u.bBox(hu.node());Ls=Math.max(Ls,a.lineCount(hu)),Bs.push({top:0,bottom:10,height:10,left:lu-pc.width/2,right:lu+pc.width/2+2,width:pc.width+2})});var Il=(Rt.tickson==="boundaries"||Rt.showdividers)&&!qr.secondary,Jl=Pi.length,ou=Math.abs((Pi[Jl-1].x-Pi[0].x)*Rt._m)/(Jl-1),Gs=Il?ou/2:ou,$a=Il?Rt.ticklen:ms*1.25*Ls,So=Math.sqrt(Math.pow(Gs,2)+Math.pow($a,2)),Xs=Gs/So,su=Rt.autotickangles.map(function(Hl){return Hl*Math.PI/180}),is=su.find(function(Hl){return Math.abs(Math.cos(Hl))<=Xs});is===void 0&&(is=su.reduce(function(Hl,lu){return Math.abs(Math.cos(Hl))xl*ds&&(_l=ds,Wa[Wo]=Ts[Wo]=es[Wo])}var sl=Math.abs(_l-fs);sl-ho>0?(sl-=ho,ho*=1+ho/sl):ho=0,Rt._id.charAt(0)!=="y"&&(ho=-ho),Wa[Ao]=ea.p2r(ea.r2p(Ts[Ao])+Vo*ho),ea.autorange==="min"||ea.autorange==="max reversed"?(Wa[0]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0):(ea.autorange==="max"||ea.autorange==="min reversed")&&(Wa[1]=null,ea._rangeInitial0=void 0,ea._rangeInitial1=void 0),ai._insideTickLabelsUpdaterange[ea._name+".range"]=Wa}var Gl=i.syncOrAsync(pn);return Gl&&Gl.then&&Ft._promises.push(Gl),Gl};function Gn(Ft,Rt,qr){var ai=Rt._id+"divider",si=qr.vals,Gr=qr.layer.selectAll("path."+ai).data(si,yn);Gr.exit().remove(),Gr.enter().insert("path",":first-child").classed(ai,1).classed("crisp",1).call(o.stroke,Rt.dividercolor).style("stroke-width",u.crispRound(Ft,Rt.dividerwidth,1)+"px"),Gr.attr("transform",qr.transFn).attr("d",qr.path)}ne.getPxPosition=function(Ft,Rt){var qr=Ft._fullLayout._size,ai=Rt._id.charAt(0),si=Rt.side,Gr;if(Rt.anchor!=="free"?Gr=Rt._anchorAxis:ai==="x"?Gr={_offset:qr.t+(1-(Rt.position||0))*qr.h,_length:0}:ai==="y"&&(Gr={_offset:qr.l+(Rt.position||0)*qr.w+Rt._shift,_length:0}),si==="top"||si==="left")return Gr._offset;if(si==="bottom"||si==="right")return Gr._offset+Gr._length};function Sn(Ft){var Rt=Ft.title.font.size,qr=(Ft.title.text.match(a.BR_TAG_ALL)||[]).length;return Ft.title.hasOwnProperty("standoff")?Rt*(ve+qr*ce):qr?Rt*(qr+1)*ce:Rt}function dn(Ft,Rt){var qr=Ft._fullLayout,ai=Rt._id,si=ai.charAt(0),Gr=Rt.title.font.size,li,Pi=(Rt.title.text.match(a.BR_TAG_ALL)||[]).length;if(Rt.title.hasOwnProperty("standoff"))Rt.side==="bottom"||Rt.side==="right"?li=Rt._depth+Rt.title.standoff+Gr*ve:(Rt.side==="top"||Rt.side==="left")&&(li=Rt._depth+Rt.title.standoff+Gr*(be+Pi*ce));else{var xi=Jn(Rt);if(Rt.type==="multicategory")li=Rt._depth;else{var zt=1.5*Gr;xi&&(zt=.5*Gr,Rt.ticks==="outside"&&(zt+=Rt.ticklen)),li=10+zt+(Rt.linewidth?Rt.linewidth-1:0)}xi||(si==="x"?li+=Rt.side==="top"?Gr*(Rt.showticklabels?1:0):Gr*(Rt.showticklabels?1.5:.5):li+=Rt.side==="right"?Gr*(Rt.showticklabels?1:.5):Gr*(Rt.showticklabels?.5:0))}var xr=ne.getPxPosition(Ft,Rt),Qr,Ri,en;si==="x"?(Ri=Rt._offset+Rt._length/2,en=Rt.side==="top"?xr-li:xr+li):(en=Rt._offset+Rt._length/2,Ri=Rt.side==="right"?xr+li:xr-li,Qr={rotate:"-90",offset:0});var _n;if(Rt.type!=="multicategory"){var Zi=Rt._selections[Rt._id+"tick"];if(_n={selection:Zi,side:Rt.side},Zi&&Zi.node()&&Zi.node().parentNode){var Wi=u.getTranslate(Zi.node().parentNode);_n.offsetLeft=Wi.x,_n.offsetTop=Wi.y}Rt.title.hasOwnProperty("standoff")&&(_n.pad=0)}return Rt._titleStandoff=li,l.draw(Ft,ai+"title",{propContainer:Rt,propName:Rt._name+".title.text",placeholder:qr._dfltTitle[si],avoid:_n,transform:Qr,attributes:{x:Ri,y:en,"text-anchor":"middle"}})}ne.shouldShowZeroLine=function(Ft,Rt,qr){var ai=i.simpleMap(Rt.range,Rt.r2l);return ai[0]*ai[1]<=0&&Rt.zeroline&&(Rt.type==="linear"||Rt.type==="-")&&!(Rt.rangebreaks&&Rt.maskBreaks(0)===V)&&(va(Rt,0)||!na(Ft,Rt,qr,ai)||Kt(Ft,Rt))},ne.clipEnds=function(Ft,Rt){return Rt.filter(function(qr){return va(Ft,qr.x)})};function va(Ft,Rt){var qr=Ft.l2p(Rt);return qr>1&&qr1)for(si=1;si=si.min&&Ft=B:/%L/.test(Rt)?Ft>=N:/%[SX]/.test(Rt)?Ft>=T:/%M/.test(Rt)?Ft>=C:/%[HI]/.test(Rt)?Ft>=g:/%p/.test(Rt)?Ft>=p:/%[Aadejuwx]/.test(Rt)?Ft>=M:/%[UVW]/.test(Rt)?Ft>=I:/%[Bbm]/.test(Rt)?Ft>=E:/%[q]/.test(Rt)?Ft>=k:/%[Yy]/.test(Rt)?Ft>=_:!0}}),T4=ze((te,Y)=>{Y.exports=function(d,y,z){var P,i;if(z){var n=y==="reversed"||y==="min reversed"||y==="max reversed";P=z[n?1:0],i=z[n?0:1]}var a=d("autorangeoptions.minallowed",i===null?P:void 0),l=d("autorangeoptions.maxallowed",P===null?i:void 0);a===void 0&&d("autorangeoptions.clipmin"),l===void 0&&d("autorangeoptions.clipmax"),d("autorangeoptions.include")}}),lw=ze((te,Y)=>{var d=T4();Y.exports=function(y,z,P,i){var n=z._template||{},a=z.type||n.type||"-";P("minallowed"),P("maxallowed");var l=P("range");if(!l){var o;!i.noInsiderange&&a!=="log"&&(o=P("insiderange"),o&&(o[0]===null||o[1]===null)&&(z.insiderange=!1,o=void 0),o&&(l=P("range",o)))}var u=z.getAutorangeDflt(l,i),s=P("autorange",u),h;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(s==="reversed"||s===!0)||l[0]!==null&&(s==="min"||s==="max reversed")||l[1]!==null&&(s==="max"||s==="min reversed"))&&(l=void 0,delete z.range,z.autorange=!0,h=!0),h||(u=z.getAutorangeDflt(l,i),s=P("autorange",u)),s&&(d(P,s,l),(a==="linear"||a==="-")&&P("rangemode")),z.cleanRange()}}),uS=ze((te,Y)=>{var d={left:0,top:0};Y.exports=y;function y(P,i,n){i=i||P.currentTarget||P.srcElement,Array.isArray(n)||(n=[0,0]);var a=P.clientX||0,l=P.clientY||0,o=z(i);return n[0]=a-o.left,n[1]=l-o.top,n}function z(P){return P===window||P===document||P===document.body?d:P.getBoundingClientRect()}}),uw=ze((te,Y)=>{var d=Qu();function y(){var z=!1;try{var P=Object.defineProperty({},"passive",{get:function(){z=!0}});window.addEventListener("test",null,P),window.removeEventListener("test",null,P)}catch{z=!1}return z}Y.exports=d&&y()}),cw=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){var n=(d-z)/(P-z),a=n+y/(P-z),l=(n+a)/2;return i==="left"||i==="bottom"?n:i==="center"||i==="middle"?l:i==="right"||i==="top"?a:n<2/3-l?n:a>4/3-l?a:l}}),cS=ze((te,Y)=>{var d=ji(),y=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];Y.exports=function(z,P,i,n){return i==="left"?z=0:i==="center"?z=1:i==="right"?z=2:z=d.constrain(Math.floor(z*3),0,2),n==="bottom"?P=0:n==="middle"?P=1:n==="top"?P=2:P=d.constrain(Math.floor(P*3),0,2),y[P][z]}}),Qm=ze((te,Y)=>{var d=Gg(),y=aw(),z=q0().getGraphDiv,P=Ra(),i=Y.exports={};i.wrapped=function(n,a,l){n=z(n),n._fullLayout&&y.clear(n._fullLayout._uid+P.HOVERID),i.raw(n,a,l)},i.raw=function(n,a){var l=n._fullLayout,o=n._hoverdata;a||(a={}),!(a.target&&!n._dragged&&d.triggerHandler(n,"plotly_beforehover",a)===!1)&&(l._hoverlayer.selectAll("g").remove(),l._hoverlayer.selectAll("line").remove(),l._hoverlayer.selectAll("circle").remove(),n._hoverdata=void 0,a.target&&o&&n.emit("plotly_unhover",{event:a,points:o}))}}),jp=ze((te,Y)=>{var d=uS(),y=Qf(),z=uw(),P=ji().removeElement,i=dc(),n=Y.exports={};n.align=cw(),n.getCursor=cS();var a=Qm();n.unhover=a.wrapped,n.unhoverRaw=a.raw,n.init=function(u){var s=u.gd,h=1,m=s._context.doubleClickDelay,b=u.element,x,_,A,f,k,w,D,E;s._mouseDownTime||(s._mouseDownTime=0),b.style.pointerEvents="all",b.onmousedown=p,z?(b._ontouchstart&&b.removeEventListener("touchstart",b._ontouchstart),b._ontouchstart=p,b.addEventListener("touchstart",p,{passive:!1})):b.ontouchstart=p;function I(T,N,B){return Math.abs(T)"u"&&typeof T.clientY>"u"&&(T.clientX=x,T.clientY=_),A=new Date().getTime(),A-s._mouseDownTimem&&(h=Math.max(h-1,1)),s._dragged)u.doneFn&&u.doneFn();else{var N;w.target===D?N=w:(N={target:D,srcElement:D,toElement:D},Object.keys(w).concat(Object.keys(w.__proto__)).forEach(B=>{var U=w[B];!N[B]&&typeof U!="function"&&(N[B]=U)})),u.clickFn&&u.clickFn(h,N),E||D.dispatchEvent(new MouseEvent("click",T))}s._dragging=!1,s._dragged=!1}};function l(){var u=document.createElement("div");u.className="dragcover";var s=u.style;return s.position="fixed",s.left=0,s.right=0,s.top=0,s.bottom=0,s.zIndex=999999999,s.background="none",document.body.appendChild(u),u}n.coverSlip=l;function o(u){return d(u.changedTouches?u.changedTouches[0]:u,document.body)}}),Em=ze((te,Y)=>{Y.exports=function(d,y){(d.attr("class")||"").split(" ").forEach(function(z){z.indexOf("cursor-")===0&&d.classed(z,!1)}),y&&d.classed("cursor-"+y,!0)}}),Kg=ze((te,Y)=>{var d=Em(),y="data-savedcursor",z="!!";Y.exports=function(P,i){var n=P.attr(y);if(i){if(!n){for(var a=(P.attr("class")||"").split(" "),l=0;l{var d=On(),y=Mi();Y.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:d({editType:"legend"}),grouptitlefont:d({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:d({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}),Qx=ze(te=>{te.isGrouped=function(Y){return(Y.traceorder||"").indexOf("grouped")!==-1},te.isVertical=function(Y){return Y.orientation!=="h"},te.isReversed=function(Y){return(Y.traceorder||"").indexOf("reversed")!==-1}}),eb=ze((te,Y)=>{var d=as(),y=ji(),z=ku(),P=xa(),i=hw(),n=w_(),a=Qx();function l(o,u,s,h){var m=u[o]||{},b=z.newContainer(s,o);function x(ce,re){return y.coerce(m,b,i,ce,re)}var _=y.coerceFont(x,"font",s.font);x("bgcolor",s.paper_bgcolor),x("bordercolor");var A=x("visible");if(A){for(var f,k=function(ce,re){var ge=f._input,ne=f;return y.coerce(ge,ne,P,ce,re)},w=s.font||{},D=y.coerceFont(x,"grouptitlefont",w,{overrideDflt:{size:Math.round(w.size*1.1)}}),E=0,I=!1,M="normal",p=(s.shapes||[]).filter(function(ce){return ce.showlegend}),g=h.concat(p).filter(function(ce){return o===(ce.legend||"legend")}),C=0;C(o==="legend"?1:0));if(N===!1&&(s[o]=void 0),!(N===!1&&!m.uirevision)&&(x("uirevision",s.uirevision),N!==!1)){x("borderwidth");var B=x("orientation"),U=x("yref"),V=x("xref"),W=B==="h",F=U==="paper",H=V==="paper",q,G,ee,he="left";W?(q=0,d.getComponentMethod("rangeslider","isVisible")(u.xaxis)?F?(G=1.1,ee="bottom"):(G=1,ee="top"):F?(G=-.1,ee="top"):(G=0,ee="bottom")):(G=1,ee="auto",H?q=1.02:(q=1,he="right")),y.coerce(m,b,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:q}},"x"),y.coerce(m,b,{y:{valType:"number",editType:"legend",min:F?-2:0,max:F?3:1,dflt:G}},"y"),x("traceorder",M),a.isGrouped(s[o])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",he),x("yanchor",ee),x("maxheight"),x("valign"),y.noneOrAll(m,b,["x","y"]);var be=x("title.text");if(be){x("title.side",W?"left":"top");var ve=y.extendFlat({},_,{size:y.bigFont(_.size)});y.coerceFont(x,"title.font",ve)}}}}Y.exports=function(o,u,s){var h,m=s.slice(),b=u.shapes;if(b)for(h=0;h{var d=as(),y=ji(),z=y.pushUnique,P=!0;Y.exports=function(i,n,a){var l=n._fullLayout;if(n._dragged||n._editing)return;var o=l.legend.itemclick,u=l.legend.itemdoubleclick,s=l.legend.groupclick;a===1&&o==="toggle"&&u==="toggleothers"&&P&&n.data&&n._context.showTips&&y.notifier(y._(n,"Double-click on legend to isolate one trace"),"long"),P=!1;var h;if(a===1?h=o:a===2&&(h=u),!h)return;var m=s==="togglegroup",b=l.hiddenlabels?l.hiddenlabels.slice():[],x=i.data()[0][0];if(x.groupTitle&&x.noClick)return;var _=n._fullData,A=(l.shapes||[]).filter(function(ct){return ct.showlegend}),f=_.concat(A),k=x.trace;k._isShape&&(k=k._fullInput);var w=k.legendgroup,D,E,I,M,p,g,C={},T=[],N=[],B=[];function U(ct,Ae){var Oe=T.indexOf(ct),Le=C.visible;return Le||(Le=C.visible=[]),T.indexOf(ct)===-1&&(T.push(ct),Oe=T.length-1),Le[Oe]=Ae,Oe}var V=(l.shapes||[]).map(function(ct){return ct._input}),W=!1;function F(ct,Ae){V[ct].visible=Ae,W=!0}function H(ct,Ae){if(!(x.groupTitle&&!m)){var Oe=ct._fullInput||ct,Le=Oe._isShape,nt=Oe.index;nt===void 0&&(nt=Oe._index);var xt=Oe.visible===!1?!1:Ae;Le?F(nt,xt):U(nt,xt)}}var q=k.legend,G=k._fullInput,ee=G&&G._isShape;if(!ee&&d.traceIs(k,"pie-like")){var he=x.label,be=b.indexOf(he);if(h==="toggle")be===-1?b.push(he):b.splice(be,1);else if(h==="toggleothers"){var ve=be!==-1,ce=[];for(D=0;D{Y.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}),S4=ze((te,Y)=>{var d=as(),y=Qx();Y.exports=function(z,P,i){var n=P._inHover,a=y.isGrouped(P),l=y.isReversed(P),o={},u=[],s=!1,h={},m=0,b=0,x,_;function A(H,q,G){if(P.visible!==!1&&!(i&&H!==P._id))if(q===""||!y.isGrouped(P)){var ee="~~i"+m;u.push(ee),o[ee]=[G],m++}else u.indexOf(q)===-1?(u.push(q),s=!0,o[q]=[G]):o[q].push(G)}for(x=0;xT&&(C=T)}p[x][0]._groupMinRank=C,p[x][0]._preGroupSort=x}var N=function(H,q){return H[0]._groupMinRank-q[0]._groupMinRank||H[0]._preGroupSort-q[0]._preGroupSort},B=function(H,q){return H.trace.legendrank-q.trace.legendrank||H._preSort-q._preSort};for(p.forEach(function(H,q){H[0]._preGroupSort=q}),p.sort(N),x=0;x{var Y=ji();function d(y){return y.indexOf("e")!==-1?y.replace(/[.]?0+e/,"e"):y.indexOf(".")!==-1?y.replace(/[.]?0+$/,""):y}te.formatPiePercent=function(y,z){var P=d((y*100).toPrecision(3));return Y.numSeparate(P,z)+"%"},te.formatPieValue=function(y,z){var P=d(y.toPrecision(10));return Y.numSeparate(P,z)},te.getFirstFilled=function(y,z){if(Y.isArrayOrTypedArray(y))for(var P=0;P{var d=Zs(),y=Xi();Y.exports=function(z,P,i,n){var a=i.marker.pattern;a&&a.shape?d.pointStyle(z,i,n,P):y.fill(z,P.color)}}),Vv=ze((te,Y)=>{var d=Xi(),y=Hv().castOption,z=fS();Y.exports=function(P,i,n,a){var l=n.marker.line,o=y(l.color,i.pts)||d.defaultLine,u=y(l.width,i.pts)||0;P.call(z,i,n,a).style("stroke-width",u).call(d.stroke,o)}}),C4=ze((te,Y)=>{var d=ri(),y=as(),z=ji(),P=z.strTranslate,i=Zs(),n=Xi(),a=hp().extractOpts,l=Bc(),o=Vv(),u=Hv().castOption,s=fw(),h=12,m=5,b=2,x=10,_=5;Y.exports=function(w,D,E){var I=D._fullLayout;E||(E=I.legend);var M=E.itemsizing==="constant",p=E.itemwidth,g=(p+s.itemGap*2)/2,C=P(g,0),T=function(ce,re,ge,ne){var se;if(ce+1)se=ce;else if(re&&re.width>0)se=re.width;else return 0;return M?ne:Math.min(se,ge)};w.each(function(ce){var re=d.select(this),ge=z.ensureSingle(re,"g","layers");ge.style("opacity",ce[0].trace.opacity);var ne=E.indentation,se=E.valign,_e=ce[0].lineHeight,oe=ce[0].height;if(se==="middle"&&ne===0||!_e||!oe)ge.attr("transform",null);else{var J={top:1,bottom:-1}[se],me=J*(.5*(_e-oe+3))||0,fe=E.indentation;ge.attr("transform",P(fe,me))}var Ce=ge.selectAll("g.legendfill").data([ce]);Ce.enter().append("g").classed("legendfill",!0);var Re=ge.selectAll("g.legendlines").data([ce]);Re.enter().append("g").classed("legendlines",!0);var Be=ge.selectAll("g.legendsymbols").data([ce]);Be.enter().append("g").classed("legendsymbols",!0),Be.selectAll("g.legendpoints").data([ce]).enter().append("g").classed("legendpoints",!0)}).each(ve).each(U).each(W).each(V).each(H).each(he).each(ee).each(N).each(B).each(q).each(G);function N(ce){var re=f(ce),ge=re.showFill,ne=re.showLine,se=re.showGradientLine,_e=re.showGradientFill,oe=re.anyFill,J=re.anyLine,me=ce[0],fe=me.trace,Ce,Re,Be=a(fe),Ze=Be.colorscale,Ge=Be.reversescale,tt=function(Le){if(Le.size())if(ge)i.fillGroupStyle(Le,D,!0);else{var nt="legendfill-"+fe.uid;i.gradient(Le,D,nt,A(Ge),Ze,"fill")}},_t=function(Le){if(Le.size()){var nt="legendline-"+fe.uid;i.lineGroupStyle(Le),i.gradient(Le,D,nt,A(Ge),Ze,"stroke")}},mt=l.hasMarkers(fe)||!oe?"M5,0":J?"M5,-2":"M5,-3",vt=d.select(this),ct=vt.select(".legendfill").selectAll("path").data(ge||_e?[ce]:[]);if(ct.enter().append("path").classed("js-fill",!0),ct.exit().remove(),ct.attr("d",mt+"h"+p+"v6h-"+p+"z").call(tt),ne||se){var Ae=T(void 0,fe.line,x,m);Re=z.minExtend(fe,{line:{width:Ae}}),Ce=[z.minExtend(me,{trace:Re})]}var Oe=vt.select(".legendlines").selectAll("path").data(ne||se?[Ce]:[]);Oe.enter().append("path").classed("js-line",!0),Oe.exit().remove(),Oe.attr("d",mt+(se?"l"+p+",0.0001":"h"+p)).call(ne?i.lineGroupStyle:_t)}function B(ce){var re=f(ce),ge=re.anyFill,ne=re.anyLine,se=re.showLine,_e=re.showMarker,oe=ce[0],J=oe.trace,me=!_e&&!ne&&!ge&&l.hasText(J),fe,Ce;function Re(ct,Ae,Oe,Le){var nt=z.nestedProperty(J,ct).get(),xt=z.isArrayOrTypedArray(nt)&&Ae?Ae(nt):nt;if(M&&xt&&Le!==void 0&&(xt=Le),Oe){if(xtOe[1])return Oe[1]}return xt}function Be(ct){return oe._distinct&&oe.index&&ct[oe.index]?ct[oe.index]:ct[0]}if(_e||me||se){var Ze={},Ge={};if(_e){Ze.mc=Re("marker.color",Be),Ze.mx=Re("marker.symbol",Be),Ze.mo=Re("marker.opacity",z.mean,[.2,1]),Ze.mlc=Re("marker.line.color",Be),Ze.mlw=Re("marker.line.width",z.mean,[0,5],b),Ge.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var tt=Re("marker.size",z.mean,[2,16],h);Ze.ms=tt,Ge.marker.size=tt}se&&(Ge.line={width:Re("line.width",Be,[0,10],m)}),me&&(Ze.tx="Aa",Ze.tp=Re("textposition",Be),Ze.ts=10,Ze.tc=Re("textfont.color",Be),Ze.tf=Re("textfont.family",Be),Ze.tw=Re("textfont.weight",Be),Ze.ty=Re("textfont.style",Be),Ze.tv=Re("textfont.variant",Be),Ze.tC=Re("textfont.textcase",Be),Ze.tE=Re("textfont.lineposition",Be),Ze.tS=Re("textfont.shadow",Be)),fe=[z.minExtend(oe,Ze)],Ce=z.minExtend(J,Ge),Ce.selectedpoints=null,Ce.texttemplate=null}var _t=d.select(this).select("g.legendpoints"),mt=_t.selectAll("path.scatterpts").data(_e?fe:[]);mt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",C),mt.exit().remove(),mt.call(i.pointStyle,Ce,D),_e&&(fe[0].mrc=3);var vt=_t.selectAll("g.pointtext").data(me?fe:[]);vt.enter().append("g").classed("pointtext",!0).append("text").attr("transform",C),vt.exit().remove(),vt.selectAll("text").call(i.textPointStyle,Ce,D)}function U(ce){var re=ce[0].trace,ge=re.type==="waterfall";if(ce[0]._distinct&&ge){var ne=ce[0].trace[ce[0].dir].marker;return ce[0].mc=ne.color,ce[0].mlw=ne.line.width,ce[0].mlc=ne.line.color,F(ce,this,"waterfall")}var se=[];re.visible&&ge&&(se=ce[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var _e=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(se);_e.enter().append("path").classed("legendwaterfall",!0).attr("transform",C).style("stroke-miterlimit",1),_e.exit().remove(),_e.each(function(oe){var J=d.select(this),me=re[oe[0]].marker,fe=T(void 0,me.line,_,b);J.attr("d",oe[1]).style("stroke-width",fe+"px").call(n.fill,me.color),fe&&J.call(n.stroke,me.line.color)})}function V(ce){F(ce,this)}function W(ce){F(ce,this,"funnel")}function F(ce,re,ge){var ne=ce[0].trace,se=ne.marker||{},_e=se.line||{},oe=se.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",J=ge?ne.visible&&ne.type===ge:y.traceIs(ne,"bar"),me=d.select(re).select("g.legendpoints").selectAll("path.legend"+ge).data(J?[ce]:[]);me.enter().append("path").classed("legend"+ge,!0).attr("d",oe).attr("transform",C),me.exit().remove(),me.each(function(fe){var Ce=d.select(this),Re=fe[0],Be=T(Re.mlw,se.line,_,b);Ce.style("stroke-width",Be+"px");var Ze=Re.mcc;if(!E._inHover&&"mc"in Re){var Ge=a(se),tt=Ge.mid;tt===void 0&&(tt=(Ge.max+Ge.min)/2),Ze=i.tryColorscale(se,"")(tt)}var _t=Ze||Re.mc||se.color,mt=se.pattern,vt=i.getPatternAttr,ct=mt&&(vt(mt.shape,0,"")||vt(mt.path,0,""));if(ct){var Ae=vt(mt.bgcolor,0,null),Oe=vt(mt.fgcolor,0,null),Le=mt.fgopacity,nt=k(mt.size,8,10),xt=k(mt.solidity,.5,1),ut="legend-"+ne.uid;Ce.call(i.pattern,"legend",D,ut,ct,nt,xt,Ze,mt.fillmode,Ae,Oe,Le)}else Ce.call(n.fill,_t);Be&&n.stroke(Ce,Re.mlc||_e.color)})}function H(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(re.visible&&y.traceIs(re,"box-violin")?[ce]:[]);ge.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),ge.exit().remove(),ge.each(function(){var ne=d.select(this);if((re.boxpoints==="all"||re.points==="all")&&n.opacity(re.fillcolor)===0&&n.opacity((re.line||{}).color)===0){var se=z.minExtend(re,{marker:{size:M?h:z.constrain(re.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});ge.call(i.pointStyle,se,D)}else{var _e=T(void 0,re.line,_,b);ne.style("stroke-width",_e+"px").call(n.fill,re.fillcolor),_e&&n.stroke(ne,re.line.color)}})}function q(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(re.visible&&re.type==="candlestick"?[ce,ce]:[]);ge.enter().append("path").classed("legendcandle",!0).attr("d",function(ne,se){return se?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",C).style("stroke-miterlimit",1),ge.exit().remove(),ge.each(function(ne,se){var _e=d.select(this),oe=re[se?"increasing":"decreasing"],J=T(void 0,oe.line,_,b);_e.style("stroke-width",J+"px").call(n.fill,oe.fillcolor),J&&n.stroke(_e,oe.line.color)})}function G(ce){var re=ce[0].trace,ge=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(re.visible&&re.type==="ohlc"?[ce,ce]:[]);ge.enter().append("path").classed("legendohlc",!0).attr("d",function(ne,se){return se?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",C).style("stroke-miterlimit",1),ge.exit().remove(),ge.each(function(ne,se){var _e=d.select(this),oe=re[se?"increasing":"decreasing"],J=T(void 0,oe.line,_,b);_e.style("fill","none").call(i.dashLine,oe.line.dash,J),J&&n.stroke(_e,oe.line.color)})}function ee(ce){be(ce,this,"pie")}function he(ce){be(ce,this,"funnelarea")}function be(ce,re,ge){var ne=ce[0],se=ne.trace,_e=ge?se.visible&&se.type===ge:y.traceIs(se,ge),oe=d.select(re).select("g.legendpoints").selectAll("path.legend"+ge).data(_e?[ce]:[]);if(oe.enter().append("path").classed("legend"+ge,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",C),oe.exit().remove(),oe.size()){var J=se.marker||{},me=T(u(J.line.width,ne.pts),J.line,_,b),fe="pieLike",Ce=z.minExtend(se,{marker:{line:{width:me}}},fe),Re=z.minExtend(ne,{trace:Ce},fe);o(oe,Re,Ce,D)}}function ve(ce){var re=ce[0].trace,ge,ne=[];if(re.visible)switch(re.type){case"histogram2d":case"heatmap":ne=[["M-15,-2V4H15V-2Z"]],ge=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":ne=[["M-6,-6V6H6V-6Z"]],ge=!0;break;case"densitymapbox":case"densitymap":ne=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],ge="radial";break;case"cone":ne=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],ge=!1;break;case"streamtube":ne=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],ge=!1;break;case"surface":ne=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],ge=!0;break;case"mesh3d":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ge=!1;break;case"volume":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],ge=!0;break;case"isosurface":ne=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],ge=!1;break}var se=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(ne);se.enter().append("path").classed("legend3dandfriends",!0).attr("transform",C).style("stroke-miterlimit",1),se.exit().remove(),se.each(function(_e,oe){var J=d.select(this),me=a(re),fe=me.colorscale,Ce=me.reversescale,Re=function(tt){if(tt.size()){var _t="legendfill-"+re.uid;i.gradient(tt,D,_t,A(Ce,ge==="radial"),fe,"fill")}},Be;if(fe){if(!ge){var Ze=fe.length;Be=oe===0?fe[Ce?Ze-1:0][1]:oe===1?fe[Ce?0:Ze-1][1]:fe[Math.floor((Ze-1)/2)][1]}}else{var Ge=re.vertexcolor||re.facecolor||re.color;Be=z.isArrayOrTypedArray(Ge)?Ge[oe]||Ge[0]:Ge}J.attr("d",_e[0]),Be?J.call(n.fill,Be):J.call(Re)})}};function A(w,D){var E=D?"radial":"horizontal";return E+(w?"":"reversed")}function f(w){var D=w[0].trace,E=D.contours,I=l.hasLines(D),M=l.hasMarkers(D),p=D.visible&&D.fill&&D.fill!=="none",g=!1,C=!1;if(E){var T=E.coloring;T==="lines"?g=!0:I=T==="none"||T==="heatmap"||E.showlines,E.type==="constraint"?p=E._operation!=="=":(T==="fill"||T==="heatmap")&&(C=!0)}return{showMarker:M,showLine:I,showFill:p,showGradientLine:g,showGradientFill:C,anyLine:I||g,anyFill:p||C}}function k(w,D,E){return w&&z.isArrayOrTypedArray(w)?D:w>E?E:w}}),dw=ze((te,Y)=>{var d=ri(),y=ji(),z=sh(),P=as(),i=Gg(),n=jp(),a=Zs(),l=Xi(),o=cc(),u=hS(),s=fw(),h=Rf(),m=h.LINE_SPACING,b=h.FROM_TL,x=h.FROM_BR,_=S4(),A=C4(),f=Qx(),k=1,w=/^legend[0-9]*$/;Y.exports=function(q,G){if(G)E(q,G);else{var ee=q._fullLayout,he=ee._legends,be=ee._infolayer.selectAll('[class^="legend"]');be.each(function(){var ge=d.select(this),ne=ge.attr("class"),se=ne.split(" ")[0];se.match(w)&&he.indexOf(se)===-1&&ge.remove()});for(var ve=0;ve1)}var me=he.hiddenlabels||[];if(!re&&(!he.showlegend||!ge.length))return ce.selectAll("."+be).remove(),he._topdefs.select("#"+ve).remove(),z.autoMargin(q,be);var fe=y.ensureSingle(ce,"g",be,function(vt){re||vt.attr("pointer-events","all")}),Ce=y.ensureSingleById(he._topdefs,"clipPath",ve,function(vt){vt.append("rect")}),Re=y.ensureSingle(fe,"rect","bg",function(vt){vt.attr("shape-rendering","crispEdges")});Re.call(l.stroke,ee.bordercolor).call(l.fill,ee.bgcolor).style("stroke-width",ee.borderwidth+"px");var Be=y.ensureSingle(fe,"g","scrollbox"),Ze=ee.title;ee._titleWidth=0,ee._titleHeight=0;var Ge;Ze.text?(Ge=y.ensureSingle(Be,"text",be+"titletext"),Ge.attr("text-anchor","start").call(a.font,Ze.font).text(Ze.text),T(Ge,Be,q,ee,k)):Be.selectAll("."+be+"titletext").remove();var tt=y.ensureSingle(fe,"rect","scrollbar",function(vt){vt.attr(s.scrollBarEnterAttrs).call(l.fill,s.scrollBarColor)}),_t=Be.selectAll("g.groups").data(ge);_t.enter().append("g").attr("class","groups"),_t.exit().remove();var mt=_t.selectAll("g.traces").data(y.identity);mt.enter().append("g").attr("class","traces"),mt.exit().remove(),mt.style("opacity",function(vt){var ct=vt[0].trace;return P.traceIs(ct,"pie-like")?me.indexOf(vt[0].label)!==-1?.5:1:ct.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,q,ee)}).call(A,q,ee).each(function(){re||d.select(this).call(C,q,be)}),y.syncOrAsync([z.previousPromises,function(){return U(q,_t,mt,ee)},function(){var vt=he._size,ct=ee.borderwidth,Ae=ee.xref==="paper",Oe=ee.yref==="paper";if(Ze.text&&D(Ge,ee,ct),!re){var Le,nt;Ae?Le=vt.l+vt.w*ee.x-b[W(ee)]*ee._width:Le=he.width*ee.x-b[W(ee)]*ee._width,Oe?nt=vt.t+vt.h*(1-ee.y)-b[F(ee)]*ee._effHeight:nt=he.height*(1-ee.y)-b[F(ee)]*ee._effHeight;var xt=V(q,be,Le,nt);if(xt)return;if(he.margin.autoexpand){var ut=Le,Et=nt;Le=Ae?y.constrain(Le,0,he.width-ee._width):ut,nt=Oe?y.constrain(nt,0,he.height-ee._effHeight):Et,Le!==ut&&y.log("Constrain "+be+".x to make legend fit inside graph"),nt!==Et&&y.log("Constrain "+be+".y to make legend fit inside graph")}a.setTranslate(fe,Le,nt)}if(tt.on(".drag",null),fe.on("wheel",null),re||ee._height<=ee._maxHeight||q._context.staticPlot){var Gt=ee._effHeight;re&&(Gt=ee._height),Re.attr({width:ee._width-ct,height:Gt-ct,x:ct/2,y:ct/2}),a.setTranslate(Be,0,0),Ce.select("rect").attr({width:ee._width-2*ct,height:Gt-2*ct,x:ct,y:ct}),a.setClipUrl(Be,ve,q),a.setRect(tt,0,0,0,0),delete ee._scrollY}else{var Qt=Math.max(s.scrollBarMinHeight,ee._effHeight*ee._effHeight/ee._height),vr=ee._effHeight-Qt-2*s.scrollBarMargin,mr=ee._height-ee._effHeight,Yr=vr/mr,ii=Math.min(ee._scrollY||0,mr);Re.attr({width:ee._width-2*ct+s.scrollBarWidth+s.scrollBarMargin,height:ee._effHeight-ct,x:ct/2,y:ct/2}),Ce.select("rect").attr({width:ee._width-2*ct+s.scrollBarWidth+s.scrollBarMargin,height:ee._effHeight-2*ct,x:ct,y:ct+ii}),a.setClipUrl(Be,ve,q),ye(ii,Qt,Yr),fe.on("wheel",function(){ii=y.constrain(ee._scrollY+d.event.deltaY/mr*vr,0,mr),ye(ii,Qt,Yr),ii!==0&&ii!==mr&&d.event.preventDefault()});var Lr,ci,vi,Ot=function(At,Wt,Yt){var hr=(Yt-Wt)/Yr+At;return y.constrain(hr,0,mr)},Xe=function(At,Wt,Yt){var hr=(Wt-Yt)/Yr+At;return y.constrain(hr,0,mr)},ot=d.behavior.drag().on("dragstart",function(){var At=d.event.sourceEvent;At.type==="touchstart"?Lr=At.changedTouches[0].clientY:Lr=At.clientY,vi=ii}).on("drag",function(){var At=d.event.sourceEvent;At.buttons===2||At.ctrlKey||(At.type==="touchmove"?ci=At.changedTouches[0].clientY:ci=At.clientY,ii=Ot(vi,Lr,ci),ye(ii,Qt,Yr))});tt.call(ot);var De=d.behavior.drag().on("dragstart",function(){var At=d.event.sourceEvent;At.type==="touchstart"&&(Lr=At.changedTouches[0].clientY,vi=ii)}).on("drag",function(){var At=d.event.sourceEvent;At.type==="touchmove"&&(ci=At.changedTouches[0].clientY,ii=Xe(vi,Lr,ci),ye(ii,Qt,Yr))});Be.call(De)}function ye(At,Wt,Yt){ee._scrollY=q._fullLayout[be]._scrollY=At,a.setTranslate(Be,0,-At),a.setRect(tt,ee._width,s.scrollBarMargin+At*Yt,s.scrollBarWidth,Wt),Ce.select("rect").attr("y",ct+At)}if(q._context.edits.legendPosition){var Pe,He,at,ht;fe.classed("cursor-move",!0),n.init({element:fe.node(),gd:q,prepFn:function(At){if(At.target!==tt.node()){var Wt=a.getTranslate(fe);at=Wt.x,ht=Wt.y}},moveFn:function(At,Wt){if(at!==void 0&&ht!==void 0){var Yt=at+At,hr=ht+Wt;a.setTranslate(fe,Yt,hr),Pe=n.align(Yt,ee._width,vt.l,vt.l+vt.w,ee.xanchor),He=n.align(hr+ee._height,-ee._height,vt.t+vt.h,vt.t,ee.yanchor)}},doneFn:function(){if(Pe!==void 0&&He!==void 0){var At={};At[be+".x"]=Pe,At[be+".y"]=He,P.call("_guiRelayout",q,At)}},clickFn:function(At,Wt){var Yt=ce.selectAll("g.traces").filter(function(){var hr=this.getBoundingClientRect();return Wt.clientX>=hr.left&&Wt.clientX<=hr.right&&Wt.clientY>=hr.top&&Wt.clientY<=hr.bottom});Yt.size()>0&&M(q,fe,Yt,At,Wt)}})}}],q)}}function I(q,G,ee){var he=q[0],be=he.width,ve=G.entrywidthmode,ce=he.trace.legendwidth||G.entrywidth;return ve==="fraction"?G._maxWidth*ce:ee+(ce||be)}function M(q,G,ee,he,be){var ve=ee.data()[0][0].trace,ce={event:be,node:ee.node(),curveNumber:ve.index,expandedIndex:ve.index,data:q.data,layout:q.layout,frames:q._transitionData._frames,config:q._context,fullData:q._fullData,fullLayout:q._fullLayout};ve._group&&(ce.group=ve._group),P.traceIs(ve,"pie-like")&&(ce.label=ee.datum()[0].label);var re=i.triggerHandler(q,"plotly_legendclick",ce);if(he===1){if(re===!1)return;G._clickTimeout=setTimeout(function(){q._fullLayout&&u(ee,q,he)},q._context.doubleClickDelay)}else if(he===2){G._clickTimeout&&clearTimeout(G._clickTimeout),q._legendMouseDownTime=0;var ge=i.triggerHandler(q,"plotly_legenddoubleclick",ce);ge!==!1&&re!==!1&&u(ee,q,he)}}function p(q,G,ee){var he=H(ee),be=q.data()[0][0],ve=be.trace,ce=P.traceIs(ve,"pie-like"),re=!ee._inHover&&G._context.edits.legendText&&!ce,ge=ee._maxNameLength,ne,se;be.groupTitle?(ne=be.groupTitle.text,se=be.groupTitle.font):(se=ee.font,ee.entries?ne=be.text:(ne=ce?be.label:ve.name,ve._meta&&(ne=y.templateString(ne,ve._meta))));var _e=y.ensureSingle(q,"text",he+"text");_e.attr("text-anchor","start").call(a.font,se).text(re?g(ne,ge):ne);var oe=ee.indentation+ee.itemwidth+s.itemGap*2;o.positionText(_e,oe,0),re?_e.call(o.makeEditable,{gd:G,text:ne}).call(T,q,G,ee).on("edit",function(J){this.text(g(J,ge)).call(T,q,G,ee);var me=be.trace._fullInput||{},fe={};return fe.name=J,me._isShape?P.call("_guiRelayout",G,"shapes["+ve.index+"].name",fe.name):P.call("_guiRestyle",G,fe,ve.index)}):T(_e,q,G,ee)}function g(q,G){var ee=Math.max(4,G);if(q&&q.trim().length>=ee/2)return q;q=q||"";for(var he=ee-q.length;he>0;he--)q+=" ";return q}function C(q,G,ee){var he=G._context.doubleClickDelay,be,ve=1,ce=y.ensureSingle(q,"rect",ee+"toggle",function(re){G._context.staticPlot||re.style("cursor","pointer").attr("pointer-events","all"),re.call(l.fill,"rgba(0,0,0,0)")});G._context.staticPlot||(ce.on("mousedown",function(){be=new Date().getTime(),be-G._legendMouseDownTimehe&&(ve=Math.max(ve-1,1)),M(G,re,q,ve,d.event)}}))}function T(q,G,ee,he,be){he._inHover&&q.attr("data-notex",!0),o.convertToTspans(q,ee,function(){N(G,ee,he,be)})}function N(q,G,ee,he){var be=q.data()[0][0];if(!ee._inHover&&be&&!be.trace.showlegend){q.remove();return}var ve=q.select("g[class*=math-group]"),ce=ve.node(),re=H(ee);ee||(ee=G._fullLayout[re]);var ge=ee.borderwidth,ne;he===k?ne=ee.title.font:be.groupTitle?ne=be.groupTitle.font:ne=ee.font;var se=ne.size*m,_e,oe;if(ce){var J=a.bBox(ce);_e=J.height,oe=J.width,he===k?a.setTranslate(ve,ge,ge+_e*.75):a.setTranslate(ve,0,_e*.25)}else{var me="."+re+(he===k?"title":"")+"text",fe=q.select(me),Ce=o.lineCount(fe),Re=fe.node();if(_e=se*Ce,oe=Re?a.bBox(Re).width:0,he===k)ee.title.side==="left"&&(oe+=s.itemGap*2),o.positionText(fe,ge+s.titlePad,ge+se);else{var Be=s.itemGap*2+ee.indentation+ee.itemwidth;be.groupTitle&&(Be=s.itemGap,oe-=ee.indentation+ee.itemwidth),o.positionText(fe,Be,-se*((Ce-1)/2-.3))}}he===k?(ee._titleWidth=oe,ee._titleHeight=_e):(be.lineHeight=se,be.height=Math.max(_e,16)+3,be.width=oe)}function B(q){var G=0,ee=0,he=q.title.side;return he&&(he.indexOf("left")!==-1&&(G=q._titleWidth),he.indexOf("top")!==-1&&(ee=q._titleHeight)),[G,ee]}function U(q,G,ee,he){var be=q._fullLayout,ve=H(he);he||(he=be[ve]);var ce=be._size,re=f.isVertical(he),ge=f.isGrouped(he),ne=he.entrywidthmode==="fraction",se=he.borderwidth,_e=2*se,oe=s.itemGap,J=he.indentation+he.itemwidth+oe*2,me=2*(se+oe),fe=F(he),Ce=he.y<0||he.y===0&&fe==="top",Re=he.y>1||he.y===1&&fe==="bottom",Be=he.tracegroupgap,Ze={};let{orientation:Ge,yref:tt}=he,{maxheight:_t}=he,mt=Ce||Re||Ge!=="v"||tt!=="paper";_t||(_t=mt?.5:1);let vt=mt?be.height:ce.h;he._maxHeight=Math.max(_t>1?_t:_t*vt,30);var ct=0;he._width=0,he._height=0;var Ae=B(he);if(re)ee.each(function(ye){var Pe=ye[0].height;a.setTranslate(this,se+Ae[0],se+Ae[1]+he._height+Pe/2+oe),he._height+=Pe,he._width=Math.max(he._width,ye[0].width)}),ct=J+he._width,he._width+=oe+J+_e,he._height+=me,ge&&(G.each(function(ye,Pe){a.setTranslate(this,0,Pe*he.tracegroupgap)}),he._height+=(he._lgroupsLength-1)*he.tracegroupgap);else{var Oe=W(he),Le=he.x<0||he.x===0&&Oe==="right",nt=he.x>1||he.x===1&&Oe==="left",xt=Re||Ce,ut=be.width/2;he._maxWidth=Math.max(Le?xt&&Oe==="left"?ce.l+ce.w:ut:nt?xt&&Oe==="right"?ce.r+ce.w:ut:ce.w,2*J);var Et=0,Gt=0;ee.each(function(ye){var Pe=I(ye,he,J);Et=Math.max(Et,Pe),Gt+=Pe}),ct=null;var Qt=0;if(ge){var vr=0,mr=0,Yr=0;G.each(function(){var ye=0,Pe=0;d.select(this).selectAll("g.traces").each(function(at){var ht=I(at,he,J),At=at[0].height;a.setTranslate(this,Ae[0],Ae[1]+se+oe+At/2+Pe),Pe+=At,ye=Math.max(ye,ht),Ze[at[0].trace.legendgroup]=ye});var He=ye+oe;mr>0&&He+se+mr>he._maxWidth?(Qt=Math.max(Qt,mr),mr=0,Yr+=vr+Be,vr=Pe):vr=Math.max(vr,Pe),a.setTranslate(this,mr,Yr),mr+=He}),he._width=Math.max(Qt,mr)+se,he._height=Yr+vr+me}else{var ii=ee.size(),Lr=Gt+_e+(ii-1)*oe=he._maxWidth&&(Qt=Math.max(Qt,Xe),vi=0,Ot+=ci,he._height+=ci,ci=0),a.setTranslate(this,Ae[0]+se+vi,Ae[1]+se+Ot+Pe/2+oe),Xe=vi+He+oe,vi+=at,ci=Math.max(ci,Pe)}),Lr?(he._width=vi+_e,he._height=ci+me):(he._width=Math.max(Qt,Xe)+_e,he._height+=ci+me)}}he._width=Math.ceil(Math.max(he._width+Ae[0],he._titleWidth+2*(se+s.titlePad))),he._height=Math.ceil(Math.max(he._height+Ae[1],he._titleHeight+2*(se+s.itemGap))),he._effHeight=Math.min(he._height,he._maxHeight);var ot=q._context.edits,De=ot.legendText||ot.legendPosition;ee.each(function(ye){var Pe=d.select(this).select("."+ve+"toggle"),He=ye[0].height,at=ye[0].trace.legendgroup,ht=I(ye,he,J);ge&&at!==""&&(ht=Ze[at]);var At=De?J:ct||ht;!re&&!ne&&(At+=oe/2),a.setRect(Pe,0,-He/2,At,He)})}function V(q,G,ee,he){var be=q._fullLayout,ve=be[G],ce=W(ve),re=F(ve),ge=ve.xref==="paper",ne=ve.yref==="paper";q._fullLayout._reservedMargin[G]={};var se=ve.y<.5?"b":"t",_e=ve.x<.5?"l":"r",oe={r:be.width-ee,l:ee+ve._width,b:be.height-he,t:he+ve._effHeight};if(ge&&ne)return z.autoMargin(q,G,{x:ve.x,y:ve.y,l:ve._width*b[ce],r:ve._width*x[ce],b:ve._effHeight*x[re],t:ve._effHeight*b[re]});ge?q._fullLayout._reservedMargin[G][se]=oe[se]:ne||ve.orientation==="v"?q._fullLayout._reservedMargin[G][_e]=oe[_e]:q._fullLayout._reservedMargin[G][se]=oe[se]}function W(q){return y.isRightAnchor(q)?"right":y.isCenterAnchor(q)?"center":"left"}function F(q){return y.isBottomAnchor(q)?"bottom":y.isMiddleAnchor(q)?"middle":"top"}function H(q){return q._id||"legend"}}),pw=ze(te=>{var Y=ri(),d=Sr(),y=ln(),z=ji(),P=z.pushUnique,i=z.strTranslate,n=z.strRotate,a=Gg(),l=cc(),o=Kg(),u=Zs(),s=Xi(),h=jp(),m=Os(),b=dc().zindexSeparator,x=as(),_=T0(),A=Ra(),f=eb(),k=dw(),w=A.YANGLE,D=Math.PI*w/180,E=1/Math.sin(D),I=Math.cos(D),M=Math.sin(D),p=A.HOVERARROWSIZE,g=A.HOVERTEXTPAD,C={box:!0,ohlc:!0,violin:!0,candlestick:!0},T={scatter:!0,scattergl:!0,splom:!0};function N(J,me){return J.distance-me.distance}te.hover=function(J,me,fe,Ce){J=z.getGraphDiv(J);var Re=me.target;z.throttle(J._fullLayout._uid+A.HOVERID,A.HOVERMINTIME,function(){B(J,me,fe,Ce,Re)})},te.loneHover=function(J,me){var fe=!0;Array.isArray(J)||(fe=!1,J=[J]);var Ce=me.gd,Re=se(Ce),Be=_e(Ce),Ze=J.map(function(Le){var nt=Le._x0||Le.x0||Le.x||0,xt=Le._x1||Le.x1||Le.x||0,ut=Le._y0||Le.y0||Le.y||0,Et=Le._y1||Le.y1||Le.y||0,Gt=Le.eventData;if(Gt){var Qt=Math.min(nt,xt),vr=Math.max(nt,xt),mr=Math.min(ut,Et),Yr=Math.max(ut,Et),ii=Le.trace;if(x.traceIs(ii,"gl3d")){var Lr=Ce._fullLayout[ii.scene]._scene.container,ci=Lr.offsetLeft,vi=Lr.offsetTop;Qt+=ci,vr+=ci,mr+=vi,Yr+=vi}Gt.bbox={x0:Qt+Be,x1:vr+Be,y0:mr+Re,y1:Yr+Re},me.inOut_bbox&&me.inOut_bbox.push(Gt.bbox)}else Gt=!1;return{color:Le.color||s.defaultLine,x0:Le.x0||Le.x||0,x1:Le.x1||Le.x||0,y0:Le.y0||Le.y||0,y1:Le.y1||Le.y||0,xLabel:Le.xLabel,yLabel:Le.yLabel,zLabel:Le.zLabel,text:Le.text,name:Le.name,idealAlign:Le.idealAlign,borderColor:Le.borderColor,fontFamily:Le.fontFamily,fontSize:Le.fontSize,fontColor:Le.fontColor,fontWeight:Le.fontWeight,fontStyle:Le.fontStyle,fontVariant:Le.fontVariant,nameLength:Le.nameLength,textAlign:Le.textAlign,trace:Le.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Le.hovertemplate||!1,hovertemplateLabels:Le.hovertemplateLabels||!1,eventData:Gt}}),Ge=!1,tt=W(Ze,{gd:Ce,hovermode:"closest",rotateLabels:Ge,bgColor:me.bgColor||s.background,container:Y.select(me.container),outerContainer:me.outerContainer||me.container}),_t=tt.hoverLabels,mt=5,vt=0,ct=0;_t.sort(function(Le,nt){return Le.y0-nt.y0}).each(function(Le,nt){var xt=Le.y0-Le.by/2;xt-mtmr[0]._length||Sn<0||Sn>Yr[0]._length)return h.unhoverRaw(J,me)}if(me.pointerX=Gn+mr[0]._offset,me.pointerY=Sn+Yr[0]._offset,"xval"in me?De=_.flat(Be,me.xval):De=_.p2c(mr,Gn),"yval"in me?ye=_.flat(Be,me.yval):ye=_.p2c(Yr,Sn),!d(De[0])||!d(ye[0]))return z.warn("Fx.hover failed",me,J),h.unhoverRaw(J,me)}var na=1/0;function Kt(Wa,Ts){for(He=0;Hebr&&(Xe.splice(0,br),na=Xe[0].distance),vt&&Ot!==0&&Xe.length===0){Dr.distance=Ot,Dr.index=!1;var ds=ht._module.hoverPoints(Dr,hr,zr,"closest",{hoverLayer:Ge._hoverlayer});if(ds&&(ds=ds.filter(function(No){return No.spikeDistance<=Ot})),ds&&ds.length){var xl,sl=ds.filter(function(No){return No.xa.showspikes&&No.xa.spikesnap!=="hovered data"});if(sl.length){var Gl=sl[0];d(Gl.x0)&&d(Gl.y0)&&(xl=_r(Gl),(!fi.vLinePoint||fi.vLinePoint.spikeDistance>xl.spikeDistance)&&(fi.vLinePoint=xl))}var ms=ds.filter(function(No){return No.ya.showspikes&&No.ya.spikesnap!=="hovered data"});if(ms.length){var Bs=ms[0];d(Bs.x0)&&d(Bs.y0)&&(xl=_r(Bs),(!fi.hLinePoint||fi.hLinePoint.spikeDistance>xl.spikeDistance)&&(fi.hLinePoint=xl))}}}}}Kt();function lr(Wa,Ts,fs){for(var _l=null,es=1/0,rl,ds=0;dsWa.trace.index===Mn.trace.index):Xe=[Mn];var Ha=Xe.length,io=ne("x",Mn,Ge),Ft=ne("y",Mn,Ge);Kt(io,Ft);var Rt=[],qr={},ai=0,si=function(Wa){var Ts=C[Wa.trace.type]?U(Wa):Wa.trace.index;if(!qr[Ts])ai++,qr[Ts]=ai,Rt.push(Wa);else{var fs=qr[Ts]-1,_l=Rt[fs];fs>0&&Math.abs(Wa.distance)Ha-1;Gr--)si(Xe[Gr]);Xe=Rt,qi()}var li=J._hoverdata,Pi=[],xi=se(J),zt=_e(J);for(let Wa of Xe){var xr=_.makeEventData(Wa,Wa.trace,Wa.cd);if(Wa.hovertemplate!==!1){var Qr=!1;Wa.cd[Wa.index]&&Wa.cd[Wa.index].ht&&(Qr=Wa.cd[Wa.index].ht),Wa.hovertemplate=Qr||Wa.trace.hovertemplate||!1}if(Wa.xa&&Wa.ya){var Ri=Wa.x0+Wa.xa._offset,en=Wa.x1+Wa.xa._offset,_n=Wa.y0+Wa.ya._offset,Zi=Wa.y1+Wa.ya._offset,Wi=Math.min(Ri,en),pn=Math.max(Ri,en),Ua=Math.min(_n,Zi),ea=Math.max(_n,Zi);xr.bbox={x0:Wi+zt,x1:pn+zt,y0:Ua+xi,y1:ea+xi}}Wa.eventData=[xr],Pi.push(xr)}J._hoverdata=Pi;var fo=ct==="y"&&(ot.length>1||Xe.length>1)||ct==="closest"&&un&&Xe.length>1,ho=s.combine(Ge.plot_bgcolor||s.background,Ge.paper_bgcolor),Vo=W(Xe,{gd:J,hovermode:ct,rotateLabels:fo,bgColor:ho,container:Ge._hoverlayer,outerContainer:Ge._paper.node(),commonLabelOpts:Ge.hoverlabel,hoverdistance:Ge.hoverdistance}),Ao=Vo.hoverLabels;if(_.isUnifiedHover(ct)||(H(Ao,fo,Ge,Vo.commonLabelBoundingBox),ee(Ao,fo,Ge._invScaleX,Ge._invScaleY)),Re&&Re.tagName){var Wo=x.getComponentMethod("annotations","hasClickToShow")(J,Pi);o(Y.select(Re),Wo?"pointer":"")}!Re||Ce||!ve(J,me,li)||(li&&J.emit("plotly_unhover",{event:me,points:li}),J.emit("plotly_hover",{event:me,points:J._hoverdata,xaxes:mr,yaxes:Yr,xvals:De,yvals:ye}))}function U(J){return[J.trace.index,J.index,J.x0,J.y0,J.name,J.attr,J.xa?J.xa._id:"",J.ya?J.ya._id:""].join(",")}var V=/([\s\S]*)<\/extra>/;function W(J,me){var fe=me.gd,Ce=fe._fullLayout,Re=me.hovermode,Be=me.rotateLabels,Ze=me.bgColor,Ge=me.container,tt=me.outerContainer,_t=me.commonLabelOpts||{};if(J.length===0)return[[]];var mt=me.fontFamily||A.HOVERFONT,vt=me.fontSize||A.HOVERFONTSIZE,ct=me.fontWeight||Ce.font.weight,Ae=me.fontStyle||Ce.font.style,Oe=me.fontVariant||Ce.font.variant,Le=me.fontTextcase||Ce.font.textcase,nt=me.fontLineposition||Ce.font.lineposition,xt=me.fontShadow||Ce.font.shadow,ut=J[0],Et=ut.xa,Gt=ut.ya,Qt=Re.charAt(0),vr=Qt+"Label",mr=ut[vr];if(mr===void 0&&Et.type==="multicategory")for(var Yr=0;YrCe.width-zt&&(xr=Ce.width-zt),Ha.attr("d","M"+(li-xr)+",0L"+(li-xr+p)+","+xi+p+"H"+zt+"v"+xi+(g*2+Gr.height)+"H"+-zt+"V"+xi+p+"H"+(li-xr-p)+"Z"),li=xr,He.minX=li-zt,He.maxX=li+zt,Et.side==="top"?(He.minY=Pi-(g*2+Gr.height),He.maxY=Pi-g):(He.minY=Pi+g,He.maxY=Pi+(g*2+Gr.height))}else{var Qr,Ri,en;Gt.side==="right"?(Qr="start",Ri=1,en="",li=Et._offset+Et._length):(Qr="end",Ri=-1,en="-",li=Et._offset),Pi=Gt._offset+(ut.y0+ut.y1)/2,io.attr("text-anchor",Qr),Ha.attr("d","M0,0L"+en+p+","+p+"V"+(g+Gr.height/2)+"h"+en+(g*2+Gr.width)+"V-"+(g+Gr.height/2)+"H"+en+p+"V-"+p+"Z"),He.minY=Pi-(g+Gr.height/2),He.maxY=Pi+(g+Gr.height/2),Gt.side==="right"?(He.minX=li+p,He.maxX=li+p+(g*2+Gr.width)):(He.minX=li-p-(g*2+Gr.width),He.maxX=li-p);var _n=Gr.height/2,Zi=Lr-Gr.top-_n,Wi="clip"+Ce._uid+"commonlabel"+Gt._id,pn;if(liHa.hoverinfo!=="none");if(Mn.length===0)return[];var at=Ce.hoverlabel,ht=at.font,At=Mn[0],Wt=((Re==="x unified"?At.xa:At.ya).unifiedhovertitle||{}).text,Yt=Wt?z.hovertemplateString({data:Re==="x unified"?[{xa:At.xa,x:At.xVal}]:[{ya:At.ya,y:At.yVal}],fallback:At.trace.hovertemplatefallback,locale:Ce._d3locale,template:Wt}):mr,hr={showlegend:!0,legend:{title:{text:Yt,font:ht},font:ht,bgcolor:at.bgcolor,bordercolor:at.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Ce.legend?Ce.legend.traceorder:void 0,orientation:"v"}},zr={font:ht};f(hr,zr,fe._fullData);var Dr=zr.legend;Dr.entries=[];for(var br=0;br=0?Kn=Ui:Hi+va=0?Kn=Hi:Ln+va=0?Jn=di:qi+na=0?Jn=qi:Fn+na=0,(Mn.idealAlign==="top"||!fo)&&ho?(en-=Zi/2,Mn.anchor="end"):fo?(en+=Zi/2,Mn.anchor="start"):Mn.anchor="middle",Mn.crossPos=en;else{if(Mn.pos=en,fo=Ri+_n/2+ea<=ci,ho=Ri-_n/2-ea>=0,(Mn.idealAlign==="left"||!fo)&&ho)Ri-=_n/2,Mn.anchor="end";else if(fo)Ri+=_n/2,Mn.anchor="start";else{Mn.anchor="middle";var Vo=ea/2,Ao=Ri+Vo-ci,Wo=Ri-Vo;Ao>0&&(Ri-=Ao),Wo<0&&(Ri+=-Wo)}Mn.crossPos=Ri}Pi.attr("text-anchor",Mn.anchor),zt&&xi.attr("text-anchor",Mn.anchor),Ha.attr("transform",i(Ri,en)+(Be?n(w):""))}),{hoverLabels:sa,commonLabelBoundingBox:He}}function F(J,me,fe,Ce,Re,Be){var Ze="",Ge="";J.nameOverride!==void 0&&(J.name=J.nameOverride),J.name&&(J.trace._meta&&(J.name=z.templateString(J.name,J.trace._meta)),Ze=re(J.name,J.nameLength));var tt=fe.charAt(0),_t=tt==="x"?"y":"x";J.zLabel!==void 0?(J.xLabel!==void 0&&(Ge+="x: "+J.xLabel+"
"),J.yLabel!==void 0&&(Ge+="y: "+J.yLabel+"
"),J.trace.type!=="choropleth"&&J.trace.type!=="choroplethmapbox"&&J.trace.type!=="choroplethmap"&&(Ge+=(Ge?"z: ":"")+J.zLabel)):me&&J[tt+"Label"]===Re?Ge=J[_t+"Label"]||"":J.xLabel===void 0?J.yLabel!==void 0&&J.trace.type!=="scattercarpet"&&(Ge=J.yLabel):J.yLabel===void 0?Ge=J.xLabel:Ge="("+J.xLabel+", "+J.yLabel+")",(J.text||J.text===0)&&!Array.isArray(J.text)&&(Ge+=(Ge?"
":"")+J.text),J.extraText!==void 0&&(Ge+=(Ge?"
":"")+J.extraText),Be&&Ge===""&&!J.hovertemplate&&(Ze===""&&Be.remove(),Ge=Ze);let{hovertemplate:mt=!1}=J;if(mt){let vt=J.hovertemplateLabels||J;J[tt+"Label"]!==Re&&(vt[tt+"other"]=vt[tt+"Val"],vt[tt+"otherLabel"]=vt[tt+"Label"]),Ge=z.hovertemplateString({data:[J.eventData[0]||{},J.trace._meta],fallback:J.trace.hovertemplatefallback,labels:vt,locale:Ce._d3locale,template:mt}),Ge=Ge.replace(V,(ct,Ae)=>(Ze=re(Ae,J.nameLength),""))}return[Ge,Ze]}function H(J,me,fe,Ce){var Re=me?"xa":"ya",Be=me?"ya":"xa",Ze=0,Ge=1,tt=J.size(),_t=new Array(tt),mt=0,vt=Ce.minX,ct=Ce.maxX,Ae=Ce.minY,Oe=Ce.maxY,Le=function(De){return De*fe._invScaleX},nt=function(De){return De*fe._invScaleY};J.each(function(De){var ye=De[Re],Pe=De[Be],He=ye._id.charAt(0)==="x",at=ye.range;mt===0&&at&&at[0]>at[1]!==He&&(Ge=-1);var ht=0,At=He?fe.width:fe.height;if(fe.hovermode==="x"||fe.hovermode==="y"){var Wt=q(De,me),Yt=De.anchor,hr=Yt==="end"?-1:1,zr,Dr;if(Yt==="middle")zr=De.crossPos+(He?nt(Wt.y-De.by/2):Le(De.bx/2+De.tx2width/2)),Dr=zr+(He?nt(De.by):Le(De.bx));else if(He)zr=De.crossPos+nt(p+Wt.y)-nt(De.by/2-p),Dr=zr+nt(De.by);else{var br=Le(hr*p+Wt.x),fi=br+Le(hr*De.bx);zr=De.crossPos+Math.min(br,fi),Dr=De.crossPos+Math.max(br,fi)}He?Ae!==void 0&&Oe!==void 0&&Math.min(Dr,Oe)-Math.max(zr,Ae)>1&&(Pe.side==="left"?(ht=Pe._mainLinePosition,At=fe.width):At=Pe._mainLinePosition):vt!==void 0&&ct!==void 0&&Math.min(Dr,ct)-Math.max(zr,vt)>1&&(Pe.side==="top"?(ht=Pe._mainLinePosition,At=fe.height):At=Pe._mainLinePosition)}_t[mt++]=[{datum:De,traceIndex:De.trace.index,dp:0,pos:De.pos,posref:De.posref,size:De.by*(He?E:1)/2,pmin:ht,pmax:At}]}),_t.sort(function(De,ye){return De[0].posref-ye[0].posref||Ge*(ye[0].traceIndex-De[0].traceIndex)});var xt,ut,Et,Gt,Qt,vr,mr;function Yr(De){var ye=De[0],Pe=De[De.length-1];if(ut=ye.pmin-ye.pos-ye.dp+ye.size,Et=Pe.pos+Pe.dp+Pe.size-ye.pmax,ut>.01){for(Qt=De.length-1;Qt>=0;Qt--)De[Qt].dp+=ut;xt=!1}if(!(Et<.01)){if(ut<-.01){for(Qt=De.length-1;Qt>=0;Qt--)De[Qt].dp-=Et;xt=!1}if(xt){var He=0;for(Gt=0;Gtye.pmax&&He++;for(Gt=De.length-1;Gt>=0&&!(He<=0);Gt--)vr=De[Gt],vr.pos>ye.pmax-1&&(vr.del=!0,He--);for(Gt=0;Gt=0;Qt--)De[Qt].dp-=Et;for(Gt=De.length-1;Gt>=0&&!(He<=0);Gt--)vr=De[Gt],vr.pos+vr.dp+vr.size>ye.pmax&&(vr.del=!0,He--)}}}for(;!xt&&Ze<=tt;){for(Ze++,xt=!0,Gt=0;Gt<_t.length-1;){var ii=_t[Gt],Lr=_t[Gt+1],ci=ii[ii.length-1],vi=Lr[0];if(ut=ci.pos+ci.dp+ci.size-vi.pos-vi.dp+vi.size,ut>.01){for(Qt=Lr.length-1;Qt>=0;Qt--)Lr[Qt].dp+=ut;for(ii.push.apply(ii,Lr),_t.splice(Gt+1,1),mr=0,Qt=ii.length-1;Qt>=0;Qt--)mr+=ii[Qt].dp;for(Et=mr/ii.length,Qt=ii.length-1;Qt>=0;Qt--)ii[Qt].dp-=Et;xt=!1}else Gt++}_t.forEach(Yr)}for(Gt=_t.length-1;Gt>=0;Gt--){var Ot=_t[Gt];for(Qt=Ot.length-1;Qt>=0;Qt--){var Xe=Ot[Qt],ot=Xe.datum;ot.offset=Xe.dp,ot.del=Xe.del}}}function q(J,me){var fe=0,Ce=J.offset;return me&&(Ce*=-M,fe=J.offset*I),{x:fe,y:Ce}}function G(J){var me={start:1,end:-1,middle:0}[J.anchor],fe=me*(p+g),Ce=fe+me*(J.txwidth+g),Re=J.anchor==="middle";return Re&&(fe-=J.tx2width/2,Ce+=J.txwidth/2+g),{alignShift:me,textShiftX:fe,text2ShiftX:Ce}}function ee(J,me,fe,Ce){var Re=function(Ze){return Ze*fe},Be=function(Ze){return Ze*Ce};J.each(function(Ze){var Ge=Y.select(this);if(Ze.del)return Ge.remove();var tt=Ge.select("text.nums"),_t=Ze.anchor,mt=_t==="end"?-1:1,vt=G(Ze),ct=q(Ze,me),Ae=ct.x,Oe=ct.y,Le=_t==="middle",nt="hoverlabel"in Ze.trace?Ze.trace.hoverlabel.showarrow:!0,xt;Le?xt="M-"+Re(Ze.bx/2+Ze.tx2width/2)+","+Be(Oe-Ze.by/2)+"h"+Re(Ze.bx)+"v"+Be(Ze.by)+"h-"+Re(Ze.bx)+"Z":nt?xt="M0,0L"+Re(mt*p+Ae)+","+Be(p+Oe)+"v"+Be(Ze.by/2-p)+"h"+Re(mt*Ze.bx)+"v-"+Be(Ze.by)+"H"+Re(mt*p+Ae)+"V"+Be(Oe-p)+"Z":xt="M"+Re(mt*p+Ae)+","+Be(Oe-Ze.by/2)+"h"+Re(mt*Ze.bx)+"v"+Be(Ze.by)+"h"+Re(-mt*Ze.bx)+"Z",Ge.select("path").attr("d",xt);var ut=Ae+vt.textShiftX,Et=Oe+Ze.ty0-Ze.by/2+g,Gt=Ze.textAlign||"auto";Gt!=="auto"&&(Gt==="left"&&_t!=="start"?(tt.attr("text-anchor","start"),ut=Le?-Ze.bx/2-Ze.tx2width/2+g:-Ze.bx-g):Gt==="right"&&_t!=="end"&&(tt.attr("text-anchor","end"),ut=Le?Ze.bx/2-Ze.tx2width/2-g:Ze.bx+g)),tt.call(l.positionText,Re(ut),Be(Et)),Ze.tx2width&&(Ge.select("text.name").call(l.positionText,Re(vt.text2ShiftX+vt.alignShift*g+Ae),Be(Oe+Ze.ty0-Ze.by/2+g)),Ge.select("rect").call(u.setRect,Re(vt.text2ShiftX+(vt.alignShift-1)*Ze.tx2width/2+Ae),Be(Oe-Ze.by/2-1),Re(Ze.tx2width),Be(Ze.by+2)))})}function he(J,me){var fe=J.index,Ce=J.trace||{},Re=J.cd[0],Be=J.cd[fe]||{};function Ze(ct){return ct||d(ct)&&ct===0}var Ge=Array.isArray(fe)?function(ct,Ae){var Oe=z.castOption(Re,fe,ct);return Ze(Oe)?Oe:z.extractOption({},Ce,"",Ae)}:function(ct,Ae){return z.extractOption(Be,Ce,ct,Ae)};function tt(ct,Ae,Oe){var Le=Ge(Ae,Oe);Ze(Le)&&(J[ct]=Le)}if(tt("hoverinfo","hi","hoverinfo"),tt("bgcolor","hbg","hoverlabel.bgcolor"),tt("borderColor","hbc","hoverlabel.bordercolor"),tt("fontFamily","htf","hoverlabel.font.family"),tt("fontSize","hts","hoverlabel.font.size"),tt("fontColor","htc","hoverlabel.font.color"),tt("fontWeight","htw","hoverlabel.font.weight"),tt("fontStyle","hty","hoverlabel.font.style"),tt("fontVariant","htv","hoverlabel.font.variant"),tt("nameLength","hnl","hoverlabel.namelength"),tt("textAlign","hta","hoverlabel.align"),J.posref=me==="y"||me==="closest"&&Ce.orientation==="h"?J.xa._offset+(J.x0+J.x1)/2:J.ya._offset+(J.y0+J.y1)/2,J.x0=z.constrain(J.x0,0,J.xa._length),J.x1=z.constrain(J.x1,0,J.xa._length),J.y0=z.constrain(J.y0,0,J.ya._length),J.y1=z.constrain(J.y1,0,J.ya._length),J.xLabelVal!==void 0&&(J.xLabel="xLabel"in J?J.xLabel:m.hoverLabelText(J.xa,J.xLabelVal,Ce.xhoverformat),J.xVal=J.xa.c2d(J.xLabelVal)),J.yLabelVal!==void 0&&(J.yLabel="yLabel"in J?J.yLabel:m.hoverLabelText(J.ya,J.yLabelVal,Ce.yhoverformat),J.yVal=J.ya.c2d(J.yLabelVal)),J.zLabelVal!==void 0&&J.zLabel===void 0&&(J.zLabel=String(J.zLabelVal)),!isNaN(J.xerr)&&!(J.xa.type==="log"&&J.xerr<=0)){var _t=m.tickText(J.xa,J.xa.c2l(J.xerr),"hover").text;J.xerrneg!==void 0?J.xLabel+=" +"+_t+" / -"+m.tickText(J.xa,J.xa.c2l(J.xerrneg),"hover").text:J.xLabel+=" ± "+_t,me==="x"&&(J.distance+=1)}if(!isNaN(J.yerr)&&!(J.ya.type==="log"&&J.yerr<=0)){var mt=m.tickText(J.ya,J.ya.c2l(J.yerr),"hover").text;J.yerrneg!==void 0?J.yLabel+=" +"+mt+" / -"+m.tickText(J.ya,J.ya.c2l(J.yerrneg),"hover").text:J.yLabel+=" ± "+mt,me==="y"&&(J.distance+=1)}var vt=J.hoverinfo||J.trace.hoverinfo;return vt&&vt!=="all"&&(vt=Array.isArray(vt)?vt:vt.split("+"),vt.indexOf("x")===-1&&(J.xLabel=void 0),vt.indexOf("y")===-1&&(J.yLabel=void 0),vt.indexOf("z")===-1&&(J.zLabel=void 0),vt.indexOf("text")===-1&&(J.text=void 0),vt.indexOf("name")===-1&&(J.name=void 0)),J}function be(J,me,fe){var Ce=fe.container,Re=fe.fullLayout,Be=Re._size,Ze=fe.event,Ge=!!me.hLinePoint,tt=!!me.vLinePoint,_t,mt;if(Ce.selectAll(".spikeline").remove(),!!(tt||Ge)){var vt=s.combine(Re.plot_bgcolor,Re.paper_bgcolor);if(Ge){var ct=me.hLinePoint,Ae,Oe;_t=ct&&ct.xa,mt=ct&&ct.ya;var Le=mt.spikesnap;Le==="cursor"?(Ae=Ze.pointerX,Oe=Ze.pointerY):(Ae=_t._offset+ct.x,Oe=mt._offset+ct.y);var nt=y.readability(ct.color,vt)<1.5?s.contrast(vt):ct.color,xt=mt.spikemode,ut=mt.spikethickness,Et=mt.spikecolor||nt,Gt=m.getPxPosition(J,mt),Qt,vr;if(xt.indexOf("toaxis")!==-1||xt.indexOf("across")!==-1){if(xt.indexOf("toaxis")!==-1&&(Qt=Gt,vr=Ae),xt.indexOf("across")!==-1){var mr=mt._counterDomainMin,Yr=mt._counterDomainMax;mt.anchor==="free"&&(mr=Math.min(mr,mt.position),Yr=Math.max(Yr,mt.position)),Qt=Be.l+mr*Be.w,vr=Be.l+Yr*Be.w}Ce.insert("line",":first-child").attr({x1:Qt,x2:vr,y1:Oe,y2:Oe,"stroke-width":ut,stroke:Et,"stroke-dasharray":u.dashStyle(mt.spikedash,ut)}).classed("spikeline",!0).classed("crisp",!0),Ce.insert("line",":first-child").attr({x1:Qt,x2:vr,y1:Oe,y2:Oe,"stroke-width":ut+2,stroke:vt}).classed("spikeline",!0).classed("crisp",!0)}xt.indexOf("marker")!==-1&&Ce.insert("circle",":first-child").attr({cx:Gt+(mt.side!=="right"?ut:-ut),cy:Oe,r:ut,fill:Et}).classed("spikeline",!0)}if(tt){var ii=me.vLinePoint,Lr,ci;_t=ii&&ii.xa,mt=ii&&ii.ya;var vi=_t.spikesnap;vi==="cursor"?(Lr=Ze.pointerX,ci=Ze.pointerY):(Lr=_t._offset+ii.x,ci=mt._offset+ii.y);var Ot=y.readability(ii.color,vt)<1.5?s.contrast(vt):ii.color,Xe=_t.spikemode,ot=_t.spikethickness,De=_t.spikecolor||Ot,ye=m.getPxPosition(J,_t),Pe,He;if(Xe.indexOf("toaxis")!==-1||Xe.indexOf("across")!==-1){if(Xe.indexOf("toaxis")!==-1&&(Pe=ye,He=ci),Xe.indexOf("across")!==-1){var at=_t._counterDomainMin,ht=_t._counterDomainMax;_t.anchor==="free"&&(at=Math.min(at,_t.position),ht=Math.max(ht,_t.position)),Pe=Be.t+(1-ht)*Be.h,He=Be.t+(1-at)*Be.h}Ce.insert("line",":first-child").attr({x1:Lr,x2:Lr,y1:Pe,y2:He,"stroke-width":ot,stroke:De,"stroke-dasharray":u.dashStyle(_t.spikedash,ot)}).classed("spikeline",!0).classed("crisp",!0),Ce.insert("line",":first-child").attr({x1:Lr,x2:Lr,y1:Pe,y2:He,"stroke-width":ot+2,stroke:vt}).classed("spikeline",!0).classed("crisp",!0)}Xe.indexOf("marker")!==-1&&Ce.insert("circle",":first-child").attr({cx:Lr,cy:ye-(_t.side!=="top"?ot:-ot),r:ot,fill:De}).classed("spikeline",!0)}}}function ve(J,me,fe){if(!fe||fe.length!==J._hoverdata.length)return!0;for(var Ce=fe.length-1;Ce>=0;Ce--){var Re=fe[Ce],Be=J._hoverdata[Ce];if(Re.curveNumber!==Be.curveNumber||String(Re.pointNumber)!==String(Be.pointNumber)||String(Re.pointNumbers)!==String(Be.pointNumbers)||Re.binNumber!==Be.binNumber)return!0}return!1}function ce(J,me){return!0}function re(J,me){return l.plainText(J||"",{len:me,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ge(J,me){for(var fe=me.charAt(0),Ce=[],Re=[],Be=[],Ze=0;ZeJ.offsetTop+J.clientTop,_e=J=>J.offsetLeft+J.clientLeft;function oe(J,me){var fe=J._fullLayout,Ce=me.getBoundingClientRect(),Re=Ce.left,Be=Ce.top,Ze=Re+Ce.width,Ge=Be+Ce.height,tt=z.apply3DTransform(fe._invTransform)(Re,Be),_t=z.apply3DTransform(fe._invTransform)(Ze,Ge),mt=tt[0],vt=tt[1],ct=_t[0],Ae=_t[1];return{x:mt,y:vt,width:ct-mt,height:Ae-vt,top:Math.min(vt,Ae),left:Math.min(mt,ct),right:Math.max(mt,ct),bottom:Math.max(vt,Ae)}}}),Wv=ze((te,Y)=>{var d=ji(),y=Xi(),z=T0().isUnifiedHover;Y.exports=function(P,i,n,a){a=a||{};var l=i.legend;function o(u){a.font[u]||(a.font[u]=l?i.legend.font[u]:i.font[u])}i&&z(i.hovermode)&&(a.font||(a.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),l?(a.bgcolor||(a.bgcolor=y.combine(i.legend.bgcolor,i.paper_bgcolor)),a.bordercolor||(a.bordercolor=i.legend.bordercolor)):a.bgcolor||(a.bgcolor=i.paper_bgcolor)),n("hoverlabel.bgcolor",a.bgcolor),n("hoverlabel.bordercolor",a.bordercolor),n("hoverlabel.namelength",a.namelength),n("hoverlabel.showarrow",a.showarrow),d.coerceFont(n,"hoverlabel.font",a.font),n("hoverlabel.align",a.align)}}),qv=ze((te,Y)=>{var d=ji(),y=Wv(),z=Xa();Y.exports=function(P,i){function n(a,l){return d.coerce(P,i,z,a,l)}y(P,i,n)}}),dS=ze((te,Y)=>{var d=ji(),y=zo(),z=Wv();Y.exports=function(P,i,n,a){function l(u,s){return d.coerce(P,i,y,u,s)}var o=d.extendFlat({},a.hoverlabel);i.hovertemplate&&(o.namelength=-1),z(P,i,l,o)}}),Q1=ze((te,Y)=>{var d=ji(),y=Xa();Y.exports=function(z,P){function i(n,a){return P[n]!==void 0?P[n]:d.coerce(z,P,y,n,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}),fm=ze((te,Y)=>{var d=ji(),y=Xa(),z=Q1(),P=Wv();Y.exports=function(i,n){function a(b,x){return d.coerce(i,n,y,b,x)}var l=z(i,n);l&&(a("hoverdistance"),a("spikedistance"));var o=a("dragmode");o==="select"&&a("selectdirection");var u=n._has("mapbox"),s=n._has("map"),h=n._has("geo"),m=n._basePlotModules.length;n.dragmode==="zoom"&&((u||s||h)&&m===1||(u||s)&&h&&m===2)&&(n.dragmode="pan"),P(i,n,a),d.coerceFont(a,"hoverlabel.grouptitlefont",n.hoverlabel.font)}}),A4=ze((te,Y)=>{var d=ji(),y=as();Y.exports=function(P){var i=P.calcdata,n=P._fullLayout;function a(h){return function(m){return d.coerceHoverinfo({hoverinfo:m},{_module:h._module},n)}}for(var l=0;l{var d=as(),y=pw().hover;Y.exports=function(z,P,i){var n=d.getComponentMethod("annotations","onClick")(z,z._hoverdata);i!==void 0&&y(z,P,i,!0);function a(){z.emit("plotly_click",{points:z._hoverdata,event:P})}z._hoverdata&&P&&P.target&&(n&&n.then?n.then(a):a(),P.stopImmediatePropagation&&P.stopImmediatePropagation())}}),hf=ze((te,Y)=>{var d=ri(),y=ji(),z=jp(),P=T0(),i=Xa(),n=pw();Y.exports={moduleType:"component",name:"fx",constants:Ra(),schema:{layout:i},attributes:zo(),layoutAttributes:i,supplyLayoutGlobalDefaults:qv(),supplyDefaults:dS(),supplyLayoutDefaults:fm(),calc:A4(),getDistanceFunction:P.getDistanceFunction,getClosest:P.getClosest,inbox:P.inbox,quadrature:P.quadrature,appendArrayPointValue:P.appendArrayPointValue,castHoverOption:l,castHoverinfo:o,hover:n.hover,unhover:z.unhover,loneHover:n.loneHover,loneUnhover:a,click:M4()};function a(u){var s=y.isD3Selection(u)?u:d.select(u);s.selectAll("g.hovertext").remove(),s.selectAll(".spikeline").remove()}function l(u,s,h){return y.castOption(u,s,"hoverlabel."+h)}function o(u,s,h){function m(b){return y.coerceHoverinfo({hoverinfo:b},{_module:u._module},s)}return y.castOption(u,h,"hoverinfo",m)}}),dm=ze(te=>{te.selectMode=function(Y){return Y==="lasso"||Y==="select"},te.drawMode=function(Y){return Y==="drawclosedpath"||Y==="drawopenpath"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},te.openMode=function(Y){return Y==="drawline"||Y==="drawopenpath"},te.rectMode=function(Y){return Y==="select"||Y==="drawline"||Y==="drawrect"||Y==="drawcircle"},te.freeMode=function(Y){return Y==="lasso"||Y==="drawclosedpath"||Y==="drawopenpath"},te.selectingOrDrawing=function(Y){return te.freeMode(Y)||te.rectMode(Y)}}),ey=ze((te,Y)=>{Y.exports=function(d){var y=d._fullLayout;y._glcanvas&&y._glcanvas.size()&&y._glcanvas.each(function(z){z.regl&&z.regl.clear({color:!0,depth:!0})})}}),mw=ze((te,Y)=>{Y.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}),gw=ze((te,Y)=>{var d=32;Y.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}),tb=ze((te,Y)=>{var d=ji().strTranslate;function y(n,a){switch(n.type){case"log":return n.p2d(a);case"date":return n.p2r(a,0,n.calendar);default:return n.p2r(a)}}function z(n,a){switch(n.type){case"log":return n.d2p(a);case"date":return n.r2p(a,0,n.calendar);default:return n.r2p(a)}}function P(n){var a=n._id.charAt(0)==="y"?1:0;return function(l){return y(n,l[a])}}function i(n){return d(n.xaxis._offset,n.yaxis._offset)}Y.exports={p2r:y,r2p:z,axValue:P,getTransform:i}}),Gv=ze(te=>{var Y=M_(),d=gw(),y=d.CIRCLE_SIDES,z=d.SQRT2,P=tb(),i=P.p2r,n=P.r2p,a=[0,3,4,5,6,1,2],l=[0,3,4,1,2];te.writePaths=function(s){var h=s.length;if(!h)return"M0,0Z";for(var m="",b=0;b0&&k{var d=Zc(),y=dm(),z=y.drawMode,P=y.openMode,i=gw(),n=i.i000,a=i.i090,l=i.i180,o=i.i270,u=i.cos45,s=i.sin45,h=tb(),m=h.p2r,b=h.r2p,x=Am(),_=x.clearOutline,A=Gv(),f=A.readPaths,k=A.writePaths,w=A.ellipseOver,D=A.fixDatesForPaths;function E(M,p){if(M.length){var g=M[0][0];if(g){var C=p.gd,T=p.isActiveShape,N=p.dragmode,B=(C.layout||{}).shapes||[];if(!z(N)&&T!==void 0){var U=C._fullLayout._activeShapeIndex;if(U{var d=dm(),y=d.selectMode,z=Am(),P=z.clearOutline,i=Gv(),n=i.readPaths,a=i.writePaths,l=i.fixDatesForPaths;Y.exports=function(o,u){if(o.length){var s=o[0][0];if(s){var h=s.getAttribute("d"),m=u.gd,b=m._fullLayout.newselection,x=u.plotinfo,_=x.xaxis,A=x.yaxis,f=u.isActiveSelection,k=u.dragmode,w=(m.layout||{}).selections||[];if(!y(k)&&f!==void 0){var D=m._fullLayout._activeSelectionIndex;if(D{Y.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}),s0=ze(te=>{var Y=rb(),d=ji(),y=Os();te.rangeToShapePosition=function(i){return i.type==="log"?i.r2d:function(n){return n}},te.shapePositionToRange=function(i){return i.type==="log"?i.d2r:function(n){return n}},te.decodeDate=function(i){return function(n){return n.replace&&(n=n.replace("_"," ")),i(n)}},te.encodeDate=function(i){return function(n){return i(n).replace(" ","_")}},te.extractPathCoords=function(i,n,a){var l=[],o=i.match(Y.segmentRE);return o.forEach(function(u){var s=n[u.charAt(0)].drawn;if(s!==void 0){var h=u.substr(1).match(Y.paramRE);if(!(!h||h.lengthf&&(w="X"),w});return b>f&&(k=k.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+m)),x+k})}function P(i,n){n=n||0;var a=0;return n&&i&&(i.type==="category"||i.type==="multicategory")&&(a=(i.r2p(1)-i.r2p(0))*n),a}}),E4=ze((te,Y)=>{var d=ji(),y=Os(),z=cc(),P=Zs(),i=Gv().readPaths,n=s0(),a=n.getPathString,l=b_(),o=Rf().FROM_TL;Y.exports=function(h,m,b,x){if(x.selectAll(".shape-label").remove(),!!(b.label.text||b.label.texttemplate)){var _;if(b.label.texttemplate){var A={};if(b.type!=="path"){var f=y.getFromId(h,b.xref),k=y.getFromId(h,b.yref);for(var w in l){var D=l[w](b,f,k);D!==void 0&&(A[w]=D)}}_=d.texttemplateStringForShapes({data:[A],fallback:b.label.texttemplatefallback,locale:h._fullLayout._d3locale,template:b.label.texttemplate})}else _=b.label.text;var E={"data-index":m},I=b.label.font,M={"data-notex":1},p=x.append("g").attr(E).classed("shape-label",!0),g=p.append("text").attr(M).classed("shape-label-text",!0).text(_),C,T,N,B;if(b.path){var U=a(h,b),V=i(U,h);C=1/0,N=1/0,T=-1/0,B=-1/0;for(var W=0;W=h?_=m-x:_=x-m,-180/Math.PI*Math.atan2(_,A)}function s(h,m,b,x,_,A,f){var k=_.label.textposition,w=_.label.textangle,D=_.label.padding,E=_.type,I=Math.PI/180*A,M=Math.sin(I),p=Math.cos(I),g=_.label.xanchor,C=_.label.yanchor,T,N,B,U;if(E==="line"){k==="start"?(T=h,N=m):k==="end"?(T=b,N=x):(T=(h+b)/2,N=(m+x)/2),g==="auto"&&(k==="start"?w==="auto"?b>h?g="left":bh?g="right":bh?g="right":bh?g="left":b{var d=ji(),y=d.strTranslate,z=jp(),P=dm(),i=P.drawMode,n=P.selectMode,a=as(),l=Xi(),o=gw(),u=o.i000,s=o.i090,h=o.i180,m=o.i270,b=Am(),x=b.clearOutlineControllers,_=Gv(),A=_.pointsOnRectangle,f=_.pointsOnEllipse,k=_.writePaths,w=K0().newShapes,D=K0().createShapeObj,E=Zv(),I=E4();Y.exports=function C(T,N,B,U){U||(U=0);var V=B.gd;function W(){C(T,N,B,U++),(f(T[0])||B.hasText)&&F({redrawing:!0})}function F(vt){var ct={};B.isActiveShape!==void 0&&(B.isActiveShape=!1,ct=w(N,B)),B.isActiveSelection!==void 0&&(B.isActiveSelection=!1,ct=E(N,B),V._fullLayout._reselect=!0),Object.keys(ct).length&&a.call((vt||{}).redrawing?"relayout":"_guiRelayout",V,ct)}var H=V._fullLayout,q=H._zoomlayer,G=B.dragmode,ee=i(G),he=n(G);(ee||he)&&(V._fullLayout._outlining=!0),x(V),N.attr("d",k(T));var be,ve,ce,re,ge;if(!U&&(B.isActiveShape||B.isActiveSelection)){ge=M([],T);var ne=q.append("g").attr("class","outline-controllers");Re(ne),mt()}if(ee&&B.hasText){var se=q.select(".label-temp"),_e=D(N,B,B.dragmode);I(V,"label-temp",_e,se)}function oe(vt){ce=+vt.srcElement.getAttribute("data-i"),re=+vt.srcElement.getAttribute("data-j"),be[ce][re].moveFn=J}function J(vt,ct){if(T.length){var Ae=ge[ce][re][1],Oe=ge[ce][re][2],Le=T[ce],nt=Le.length;if(A(Le)){var xt=vt,ut=ct;if(B.isActiveSelection){var Et=p(Le,re);Et[1]===Le[re][1]?ut=0:xt=0}for(var Gt=0;Gt1&&!(vt.length===2&&vt[1][0]==="Z")&&(re===0&&(vt[0][0]="M"),T[ce]=vt,W(),F())}}function Ce(vt,ct){if(vt===2){ce=+ct.srcElement.getAttribute("data-i"),re=+ct.srcElement.getAttribute("data-j");var Ae=T[ce];!A(Ae)&&!f(Ae)&&fe()}}function Re(vt){be=[];for(var ct=0;ct{var d=ri(),y=as(),z=ji(),P=Os(),i=Gv().readPaths,n=Yg(),a=E4(),l=Am().clearOutlineControllers,o=Xi(),u=Zs(),s=ku().arrayEditor,h=jp(),m=Em(),b=rb(),x=s0(),_=x.getPathString;Y.exports={draw:A,drawOne:w,eraseActiveShape:g,drawLabel:a};function A(C){var T=C._fullLayout;T._shapeUpperLayer.selectAll("path").remove(),T._shapeLowerLayer.selectAll("path").remove(),T._shapeUpperLayer.selectAll("text").remove(),T._shapeLowerLayer.selectAll("text").remove();for(var N in T._plots){var B=T._plots[N].shapelayer;B&&(B.selectAll("path").remove(),B.selectAll("text").remove())}for(var U=0;UW&&at>F&&!ye.shiftKey?h.getCursor(ht/He,1-At/at):"move";m(T,Wt),Qt=Wt.split("-")[0]}}function ii(ye){f(C)||(H&&(ge=Le(N.xanchor)),q&&(ne=nt(N.yanchor)),N.type==="path"?Be=N.path:(be=H?N.x0:Le(N.x0),ve=q?N.y0:nt(N.y0),ce=H?N.x1:Le(N.x1),re=q?N.y1:nt(N.y1)),bere?(se=ve,me="y0",_e=re,fe="y1"):(se=re,me="y1",_e=ve,fe="y0"),Yr(ye),Xe(U,N),De(T,N,C),Gt.moveFn=Qt==="move"?vi:Ot,Gt.altKey=ye.altKey)}function Lr(){f(C)||(m(T),ot(U),D(T,C,N),y.call("_guiRelayout",C,V.getUpdateObj()))}function ci(){f(C)||ot(U)}function vi(ye,Pe){if(N.type==="path"){var He=function(At){return At},at=He,ht=He;H?he("xanchor",N.xanchor=xt(ge+ye)):(at=function(At){return xt(Le(At)+ye)},Ge&&Ge.type==="date"&&(at=x.encodeDate(at))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(ht=function(At){return ut(nt(At)+Pe)},_t&&_t.type==="date"&&(ht=x.encodeDate(ht))),he("path",N.path=I(Be,at,ht))}else H?he("xanchor",N.xanchor=xt(ge+ye)):(he("x0",N.x0=xt(be+ye)),he("x1",N.x1=xt(ce+ye))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(he("y0",N.y0=ut(ve+Pe)),he("y1",N.y1=ut(re+Pe)));T.attr("d",_(C,N)),Xe(U,N),a(C,B,N,Ze)}function Ot(ye,Pe){if(ee){var He=function(dn){return dn},at=He,ht=He;H?he("xanchor",N.xanchor=xt(ge+ye)):(at=function(dn){return xt(Le(dn)+ye)},Ge&&Ge.type==="date"&&(at=x.encodeDate(at))),q?he("yanchor",N.yanchor=ut(ne+Pe)):(ht=function(dn){return ut(nt(dn)+Pe)},_t&&_t.type==="date"&&(ht=x.encodeDate(ht))),he("path",N.path=I(Be,at,ht))}else if(G){if(Qt==="resize-over-start-point"){var At=be+ye,Wt=q?ve-Pe:ve+Pe;he("x0",N.x0=H?At:xt(At)),he("y0",N.y0=q?Wt:ut(Wt))}else if(Qt==="resize-over-end-point"){var Yt=ce+ye,hr=q?re-Pe:re+Pe;he("x1",N.x1=H?Yt:xt(Yt)),he("y1",N.y1=q?hr:ut(hr))}}else{var zr=function(dn){return Qt.indexOf(dn)!==-1},Dr=zr("n"),br=zr("s"),fi=zr("w"),un=zr("e"),cn=Dr?se+Pe:se,yn=br?_e+Pe:_e,Gn=fi?oe+ye:oe,Sn=un?J+ye:J;q&&(Dr&&(cn=se-Pe),br&&(yn=_e-Pe)),(!q&&yn-cn>F||q&&cn-yn>F)&&(he(me,N[me]=q?cn:ut(cn)),he(fe,N[fe]=q?yn:ut(yn))),Sn-Gn>W&&(he(Ce,N[Ce]=H?Gn:xt(Gn)),he(Re,N[Re]=H?Sn:xt(Sn)))}T.attr("d",_(C,N)),Xe(U,N),a(C,B,N,Ze)}function Xe(ye,Pe){(H||q)&&He();function He(){var at=Pe.type!=="path",ht=ye.selectAll(".visual-cue").data([0]),At=1;ht.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":At}).classed("visual-cue",!0);var Wt=Le(H?Pe.xanchor:z.midRange(at?[Pe.x0,Pe.x1]:x.extractPathCoords(Pe.path,b.paramIsX))),Yt=nt(q?Pe.yanchor:z.midRange(at?[Pe.y0,Pe.y1]:x.extractPathCoords(Pe.path,b.paramIsY)));if(Wt=x.roundPositionForSharpStrokeRendering(Wt,At),Yt=x.roundPositionForSharpStrokeRendering(Yt,At),H&&q){var hr="M"+(Wt-1-At)+","+(Yt-1-At)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";ht.attr("d",hr)}else if(H){var zr="M"+(Wt-1-At)+","+(Yt-9-At)+"v18 h2 v-18 Z";ht.attr("d",zr)}else{var Dr="M"+(Wt-9-At)+","+(Yt-1-At)+"h18 v2 h-18 Z";ht.attr("d",Dr)}}}function ot(ye){ye.selectAll(".visual-cue").remove()}function De(ye,Pe,He){var at=Pe.xref,ht=Pe.yref,At=P.getFromId(He,at),Wt=P.getFromId(He,ht),Yt="";at!=="paper"&&!At.autorange&&(Yt+=at),ht!=="paper"&&!Wt.autorange&&(Yt+=ht),u.setClipUrl(ye,Yt?"clip"+He._fullLayout._uid+Yt:null,He)}}function I(C,T,N){return C.replace(b.segmentRE,function(B){var U=0,V=B.charAt(0),W=b.paramIsX[V],F=b.paramIsY[V],H=b.numParams[V],q=B.substr(1).replace(b.paramRE,function(G){return U>=H||(W[U]?G=T(G):F[U]&&(G=N(G)),U++),G});return V+q})}function M(C,T){if(k(C)){var N=T.node(),B=+N.getAttribute("data-index");if(B>=0){if(B===C._fullLayout._activeShapeIndex){p(C);return}C._fullLayout._activeShapeIndex=B,C._fullLayout._deactivateShape=p,A(C)}}}function p(C){if(k(C)){var T=C._fullLayout._activeShapeIndex;T>=0&&(l(C),delete C._fullLayout._activeShapeIndex,A(C))}}function g(C){if(k(C)){l(C);var T=C._fullLayout._activeShapeIndex,N=(C.layout||{}).shapes||[];if(T{var d=as(),y=sh(),z=Zc(),P=mw(),i=vw().eraseActiveShape,n=ji(),a=n._,l=Y.exports={};l.toImage={name:"toImage",title:function(E){var I=E._context.toImageButtonOptions||{},M=I.format||"png";return M==="png"?a(E,"Download plot as a PNG"):a(E,"Download plot")},icon:P.camera,click:function(E){var I=E._context.toImageButtonOptions,M={format:I.format||"png"};n.notifier(a(E,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach(function(p){p in I&&(M[p]=I[p])}),d.call("downloadImage",E,M).then(function(p){n.notifier(a(E,"Snapshot succeeded")+" - "+p,"long")}).catch(function(){n.notifier(a(E,"Sorry, there was a problem downloading your snapshot!"),"long")})}},l.sendDataToCloud={name:"sendDataToCloud",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.disk,click:function(E){y.sendDataToCloud(E)}},l.editInChartStudio={name:"editInChartStudio",title:function(E){return a(E,"Edit in Chart Studio")},icon:P.pencil,click:function(E){y.sendDataToCloud(E)}},l.zoom2d={name:"zoom2d",_cat:"zoom",title:function(E){return a(E,"Zoom")},attr:"dragmode",val:"zoom",icon:P.zoombox,click:o},l.pan2d={name:"pan2d",_cat:"pan",title:function(E){return a(E,"Pan")},attr:"dragmode",val:"pan",icon:P.pan,click:o},l.select2d={name:"select2d",_cat:"select",title:function(E){return a(E,"Box Select")},attr:"dragmode",val:"select",icon:P.selectbox,click:o},l.lasso2d={name:"lasso2d",_cat:"lasso",title:function(E){return a(E,"Lasso Select")},attr:"dragmode",val:"lasso",icon:P.lasso,click:o},l.drawclosedpath={name:"drawclosedpath",title:function(E){return a(E,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:P.drawclosedpath,click:o},l.drawopenpath={name:"drawopenpath",title:function(E){return a(E,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:P.drawopenpath,click:o},l.drawline={name:"drawline",title:function(E){return a(E,"Draw line")},attr:"dragmode",val:"drawline",icon:P.drawline,click:o},l.drawrect={name:"drawrect",title:function(E){return a(E,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:P.drawrect,click:o},l.drawcircle={name:"drawcircle",title:function(E){return a(E,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:P.drawcircle,click:o},l.eraseshape={name:"eraseshape",title:function(E){return a(E,"Erase active shape")},icon:P.eraseshape,click:i},l.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(E){return a(E,"Zoom in")},attr:"zoom",val:"in",icon:P.zoom_plus,click:o},l.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(E){return a(E,"Zoom out")},attr:"zoom",val:"out",icon:P.zoom_minus,click:o},l.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(E){return a(E,"Autoscale")},attr:"zoom",val:"auto",icon:P.autoscale,click:o},l.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(E){return a(E,"Reset axes")},attr:"zoom",val:"reset",icon:P.home,click:o},l.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(E){return a(E,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:P.tooltip_basic,gravity:"ne",click:o},l.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(E){return a(E,"Compare data on hover")},attr:"hovermode",val:function(E){return E._fullLayout._isHoriz?"y":"x"},icon:P.tooltip_compare,gravity:"ne",click:o};function o(E,I){var M=I.currentTarget,p=M.getAttribute("data-attr"),g=M.getAttribute("data-val")||!0,C=E._fullLayout,T={},N=z.list(E,null,!0),B=C._cartesianSpikesEnabled,U,V;if(p==="zoom"){var W=g==="in"?.5:2,F=(1+W)/2,H=(1-W)/2,q,G;for(V=0;V{var d=ty(),y=Object.keys(d),z=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],P=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(z),i=[],n=function(a){if(P.indexOf(a._cat||a.name)===-1){var l=a.name,o=(a._cat||a.name).toLowerCase();i.indexOf(l)===-1&&i.push(l),i.indexOf(o)===-1&&i.push(o)}};y.forEach(function(a){n(d[a])}),i.sort(),Y.exports={DRAW_MODES:z,backButtons:P,foreButtons:i}}),E_=ze((te,Y)=>{yw(),Y.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}}),pS=ze((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=E_();Y.exports=function(i,n){var a=i.modebar||{},l=z.newContainer(n,"modebar");function o(s,h){return d.coerce(a,l,P,s,h)}o("orientation"),o("bgcolor",y.addOpacity(n.paper_bgcolor,.5));var u=y.contrast(y.rgb(n.modebar.bgcolor));o("color",y.addOpacity(u,.3)),o("activecolor",y.addOpacity(u,.7)),o("uirevision",n.uirevision),o("add"),o("remove")}}),Xg=ze((te,Y)=>{var d=ri(),y=Sr(),z=ji(),P=mw(),i=Si().version,n=new DOMParser;function a(s){this.container=s.container,this.element=document.createElement("div"),this.update(s.graphInfo,s.buttons),this.container.appendChild(this.element)}var l=a.prototype;l.update=function(s,h){this.graphInfo=s;var m=this.graphInfo._context,b=this.graphInfo._fullLayout,x="modebar-"+b._uid;this.element.setAttribute("id",x),this.element.setAttribute("role","toolbar"),this._uid=x,this.element.className="modebar modebar--custom",m.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),b.modebar.orientation==="v"&&(this.element.className+=" vertical",h=h.reverse());var _=b.modebar,A="#"+x+" .modebar-group";document.querySelectorAll(A).forEach(function(E){E.style.backgroundColor=_.bgcolor});var f=!this.hasButtons(h),k=this.hasLogo!==m.displaylogo,w=this.locale!==m.locale;if(this.locale=m.locale,(f||k||w)&&(this.removeAllButtons(),this.updateButtons(h),m.watermark||m.displaylogo)){var D=this.getLogo();m.watermark&&(D.className=D.className+" watermark"),b.modebar.orientation==="v"?this.element.insertBefore(D,this.element.childNodes[0]):this.element.appendChild(D),this.hasLogo=!0}this.updateActiveButton(),z.setStyleOnHover("#"+x+" .modebar-btn",".active",".icon path","fill: "+_.activecolor,"fill: "+_.color,this.element)},l.updateButtons=function(s){var h=this;this.buttons=s,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(m){var b=h.createGroup();m.forEach(function(x){var _=x.name;if(!_)throw new Error("must provide button 'name' in button config");if(h.buttonsNames.indexOf(_)!==-1)throw new Error("button name '"+_+"' is taken");h.buttonsNames.push(_);var A=h.createButton(x);h.buttonElements.push(A),b.appendChild(A)}),h.element.appendChild(b)})},l.createGroup=function(){var s=document.createElement("div");s.className="modebar-group";var h=this.graphInfo._fullLayout.modebar;return s.style.backgroundColor=h.bgcolor,s},l.createButton=function(s){var h=this,m=document.createElement("button");m.setAttribute("type","button"),m.setAttribute("rel","tooltip"),m.className="modebar-btn";var b=s.title;b===void 0?b=s.name:typeof b=="function"&&(b=b(this.graphInfo)),(b||b===0)&&(m.setAttribute("data-title",b),m.setAttribute("aria-label",b)),s.attr!==void 0&&m.setAttribute("data-attr",s.attr);var x=s.val;x!==void 0&&(typeof x=="function"&&(x=x(this.graphInfo)),m.setAttribute("data-val",x));var _=s.click;if(typeof _!="function")throw new Error("must provide button 'click' function in button config");m.addEventListener("click",function(f){s.click(h.graphInfo,f),h.updateActiveButton(f.currentTarget)}),m.setAttribute("data-toggle",s.toggle||!1),s.toggle&&d.select(m).classed("active",!0);var A=s.icon;return typeof A=="function"?m.appendChild(A()):m.appendChild(this.createIcon(A||P.question)),m.setAttribute("data-gravity",s.gravity||"n"),m},l.createIcon=function(s){var h=y(s.height)?Number(s.height):s.ascent-s.descent,m="http://www.w3.org/2000/svg",b;if(s.path){b=document.createElementNS(m,"svg"),b.setAttribute("viewBox",[0,0,s.width,h].join(" ")),b.setAttribute("class","icon");var x=document.createElementNS(m,"path");x.setAttribute("d",s.path),s.transform?x.setAttribute("transform",s.transform):s.ascent!==void 0&&x.setAttribute("transform","matrix(1 0 0 -1 0 "+s.ascent+")"),b.appendChild(x)}if(s.svg){var _=n.parseFromString(s.svg,"application/xml");b=_.childNodes[0]}return b.setAttribute("height","1em"),b.setAttribute("width","1em"),b},l.updateActiveButton=function(s){var h=this.graphInfo._fullLayout,m=s!==void 0?s.getAttribute("data-attr"):null;this.buttonElements.forEach(function(b){var x=b.getAttribute("data-val")||!0,_=b.getAttribute("data-attr"),A=b.getAttribute("data-toggle")==="true",f=d.select(b),k=function(E,I){var M=h.modebar,p=E.querySelector(".icon path");p&&(I||E.matches(":hover")?p.style.fill=M.activecolor:p.style.fill=M.color)};if(A){if(_===m){var w=!f.classed("active");f.classed("active",w),k(b,w)}}else{var D=_===null?_:z.nestedProperty(h,_).get();f.classed("active",D===x),k(b,D===x)}})},l.hasButtons=function(s){var h=this.buttons;if(!h||s.length!==h.length)return!1;for(var m=0;m{var d=Zc(),y=Bc(),z=as(),P=T0().isUnifiedHover,i=Xg(),n=ty(),a=yw().DRAW_MODES,l=ji().extendDeep;Y.exports=function(x){var _=x._fullLayout,A=x._context,f=_._modeBar;if(!A.displayModeBar&&!A.watermark){f&&(f.destroy(),delete _._modeBar);return}if(!Array.isArray(A.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(A.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var k=A.modeBarButtons,w;Array.isArray(k)&&k.length?w=b(k):!A.displayModeBar&&A.watermark?w=[]:w=o(x),f?f.update(x,w):_._modeBar=i(x,w)};function o(x){var _=x._fullLayout,A=x._fullData,f=x._context;function k(J,me){if(typeof me=="string"){if(me.toLowerCase()===J.toLowerCase())return!0}else{var fe=me.name,Ce=me._cat||me.name;if(fe===J||Ce===J.toLowerCase())return!0}return!1}var w=_.modebar.add;typeof w=="string"&&(w=[w]);var D=_.modebar.remove;typeof D=="string"&&(D=[D]);var E=f.modeBarButtonsToAdd.concat(w.filter(function(J){for(var me=0;me1?(ve=["toggleHover"],ce=["resetViews"]):g?(be=["zoomInGeo","zoomOutGeo"],ve=["hoverClosestGeo"],ce=["resetGeo"]):p?(ve=["hoverClosest3d"],ce=["resetCameraDefault3d","resetCameraLastSave3d"]):B?(be=["zoomInMapbox","zoomOutMapbox"],ve=["toggleHover"],ce=["resetViewMapbox"]):U?(be=["zoomInMap","zoomOutMap"],ve=["toggleHover"],ce=["resetViewMap"]):C?ve=["hoverClosestPie"]:F?(ve=["hoverClosestCartesian","hoverCompareCartesian"],ce=["resetViewSankey"]):ve=["toggleHover"],M&&ve.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(h(A)||q)&&(ve=[]),M&&!H&&(be=["zoomIn2d","zoomOut2d","autoScale2d"],ce[0]!=="resetViews"&&(ce=["resetScale2d"])),p?re=["zoom3d","pan3d","orbitRotation","tableRotation"]:M&&!H||N?re=["zoom2d","pan2d"]:B||U||g?re=["pan2d"]:V&&(re=["zoom2d"]),s(A)&&re.push("select2d","lasso2d");var ge=[],ne=function(J){ge.indexOf(J)===-1&&ve.indexOf(J)!==-1&&ge.push(J)};if(Array.isArray(E)){for(var se=[],_e=0;_e{Y.exports={moduleType:"component",name:"modebar",layoutAttributes:E_(),supplyLayoutDefaults:pS(),manage:ib()}}),nb=ze((te,Y)=>{var d=Rf().FROM_BL;Y.exports=function(y,z,P){P===void 0&&(P=d[y.constraintoward||"center"]);var i=[y.r2l(y.range[0]),y.r2l(y.range[1])],n=i[0]+(i[1]-i[0])*P;y.range=y._input.range=[y.l2r(n+(i[0]-n)*z),y.l2r(n+(i[1]-n)*z)],y.setScale()}}),ry=ze(te=>{var Y=ji(),d=Jm(),y=Zc().id2name,z=Gd(),P=nb(),i=Z0(),n=ei().ALMOST_EQUAL,a=Rf().FROM_BL;te.handleDefaults=function(x,_,A){var f=A.axIds,k=A.axHasImage,w=_._axisConstraintGroups=[],D=_._axisMatchGroups=[],E,I,M,p,g,C,T,N;for(E=0;Ew?A.substr(w):f.substr(k))+D}function m(x,_){for(var A=_._size,f=A.h/A.w,k={},w=Object.keys(x),D=0;Dn*T&&!V)){for(k=0;kce&&mebe&&(be=me);var Ce=(be-he)/(2*ve);p/=Ce,he=E.l2r(he),be=E.l2r(be),E.range=E._input.range=q{var Y=ri(),d=as(),y=sh(),z=ji(),P=cc(),i=ey(),n=Xi(),a=Zs(),l=Np(),o=L4(),u=Os(),s=Rf(),h=ry(),m=h.enforce,b=h.clean,x=Jm().doAutoRange,_="start",A="middle",f="end",k=dc().zindexSeparator;te.layoutStyles=function(F){return z.syncOrAsync([y.doAutoMargin,D],F)};function w(F,H,q){for(var G=0;G=F[1]||ee[1]<=F[0])&&he[0]H[0])return!0}return!1}function D(F){var H=F._fullLayout,q=H._size,G=q.p,ee=u.list(F,"",!0),he,be,ve,ce,re,ge;if(H._paperdiv.style({width:F._context.responsive&&H.autosize&&!F._context._hasZeroWidth&&!F.layout.width?"100%":H.width+"px",height:F._context.responsive&&H.autosize&&!F._context._hasZeroHeight&&!F.layout.height?"100%":H.height+"px"}).selectAll(".main-svg").call(a.setSize,H.width,H.height),F._context.setBackground(F,H.paper_bgcolor),te.drawMainTitle(F),o.manage(F),!H._has("cartesian"))return y.previousPromises(F);function ne(De,ye,Pe){var He=De._lw/2;if(De._id.charAt(0)==="x"){if(ye){if(Pe==="top")return ye._offset-G-He}else return q.t+q.h*(1-(De.position||0))+He%1;return ye._offset+ye._length+G+He}if(ye){if(Pe==="right")return ye._offset+ye._length+G+He}else return q.l+q.w*(De.position||0)+He%1;return ye._offset-G-He}for(he=0;he0){T(F,he,re,ce),ve.attr({x:be,y:he,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,be,he);var ge=(H.text.match(P.BR_TAG_ALL)||[]).length;if(ge){var ne=s.LINE_SPACING*ge+s.MID_SHIFT;H.y===0&&(ne=-ne),ve.selectAll(".line").each(function(){var me=+this.getAttribute("dy").slice(0,-2)-ne+"em";this.setAttribute("dy",me)})}var se=Y.select(F).selectAll(".gtitle-subtitle");if(se.node()){var _e=ve.node().getBBox(),oe=_e.y+_e.height,J=oe+l.SUBTITLE_PADDING_EM*H.subtitle.font.size;se.attr({x:be,y:J,"text-anchor":G,dy:U(H.yanchor)}).call(P.positionText,be,J)}}}};function p(F,H,q,G,ee){var he=H.yref==="paper"?F._fullLayout._size.h:F._fullLayout.height,be=z.isTopAnchor(H)?G:G-ee,ve=q==="b"?he-be:be;return z.isTopAnchor(H)&&q==="t"||z.isBottomAnchor(H)&&q==="b"?!1:ve.5?"t":"b",be=F._fullLayout.margin[he],ve=0;return H.yref==="paper"?ve=q+H.pad.t+H.pad.b:H.yref==="container"&&(ve=g(he,G,ee,F._fullLayout.height,q)+H.pad.t+H.pad.b),ve>be?ve:0}function T(F,H,q,G){var ee="title.automargin",he=F._fullLayout.title,be=he.y>.5?"t":"b",ve={x:he.x,y:he.y,t:0,b:0},ce={};he.yref==="paper"&&p(F,he,be,H,G)?ve[be]=q:he.yref==="container"&&(ce[be]=q,F._fullLayout._reservedMargin[ee]=ce),y.allowAutoMargin(F,ee),y.autoMargin(F,ee,ve)}function N(F,H){var q=F.title,G=F._size,ee=0;switch(H===_?ee=q.pad.l:H===f&&(ee=-q.pad.r),q.xref){case"paper":return G.l+G.w*q.x+ee;case"container":default:return F.width*q.x+ee}}function B(F,H){var q=F.title,G=F._size,ee=0;if(H==="0em"||!H?ee=-q.pad.b:H===s.CAP_SHIFT+"em"&&(ee=q.pad.t),q.y==="auto")return G.t/2;switch(q.yref){case"paper":return G.t+G.h-G.h*q.y+ee;case"container":default:return F.height-F.height*q.y+ee}}function U(F){return F==="top"?s.CAP_SHIFT+.3+"em":F==="bottom"?"-0.3em":s.MID_SHIFT+"em"}function V(F){var H=F.title,q=A;return z.isRightAnchor(H)?q=f:z.isLeftAnchor(H)&&(q=_),q}function W(F){var H=F.title,q="0em";return z.isTopAnchor(H)?q=s.CAP_SHIFT+"em":z.isMiddleAnchor(H)&&(q=s.MID_SHIFT+"em"),q}te.doTraceStyle=function(F){var H=F.calcdata,q=[],G;for(G=0;G{var d=Gv().readPaths,y=Yg(),z=Am().clearOutlineControllers,P=Xi(),i=Zs(),n=ku().arrayEditor,a=s0(),l=a.getPathString;Y.exports={draw:o,drawOne:s,activateLastSelection:b};function o(_){var A=_._fullLayout;z(_),A._selectionLayer.selectAll("path").remove();for(var f in A._plots){var k=A._plots[f].selectionLayer;k&&k.selectAll("path").remove()}for(var w=0;w=0;V--){var W=E.append("path").attr(M).style("opacity",V?.1:p).call(P.stroke,C).call(P.fill,g).call(i.dashLine,V?"solid":N,V?4+T:T);if(h(W,_,k),B){var F=n(_.layout,"selections",k);W.style({cursor:"move"});var H={element:W.node(),plotinfo:w,gd:_,editHelpers:F,isActiveSelection:!0},q=d(I,_);y(q,W,H)}else W.style("pointer-events",V?"all":"none");U[V]=W}var G=U[0],ee=U[1];ee.node().addEventListener("click",function(){return m(_,G)})}}function h(_,A,f){var k=f.xref+f.yref;i.setClipUrl(_,"clip"+A._fullLayout._uid+k,A)}function m(_,A){if(u(_)){var f=A.node(),k=+f.getAttribute("data-index");if(k>=0){if(k===_._fullLayout._activeSelectionIndex){x(_);return}_._fullLayout._activeSelectionIndex=k,_._fullLayout._deactivateSelection=x,o(_)}}}function b(_){if(u(_)){var A=_._fullLayout.selections.length-1;_._fullLayout._activeSelectionIndex=A,_._fullLayout._deactivateSelection=x,o(_)}}function x(_){if(u(_)){var A=_._fullLayout._activeSelectionIndex;A>=0&&(z(_),delete _._fullLayout._activeSelectionIndex,o(_))}}}),iy=ze((te,Y)=>{function d(){var y,z=0,P=!1;function i(n,a){return y.list.push({type:n,data:a?JSON.parse(JSON.stringify(a)):void 0}),y}return y={list:[],segmentId:function(){return z++},checkIntersection:function(n,a){return i("check",{seg1:n,seg2:a})},segmentChop:function(n,a){return i("div_seg",{seg:n,pt:a}),i("chop",{seg:n,pt:a})},statusRemove:function(n){return i("pop_seg",{seg:n})},segmentUpdate:function(n){return i("seg_update",{seg:n})},segmentNew:function(n,a){return i("new_seg",{seg:n,primary:a})},segmentRemove:function(n){return i("rem_seg",{seg:n})},tempStatus:function(n,a,l){return i("temp_status",{seg:n,above:a,below:l})},rewind:function(n){return i("rewind",{seg:n})},status:function(n,a,l){return i("status",{seg:n,above:a,below:l})},vert:function(n){return n===P?y:(P=n,i("vert",{x:n}))},log:function(n){return typeof n!="string"&&(n=JSON.stringify(n,!1," ")),i("log",{txt:n})},reset:function(){return i("reset")},selected:function(n){return i("selected",{segs:n})},chainStart:function(n){return i("chain_start",{seg:n})},chainRemoveHead:function(n,a){return i("chain_rem_head",{index:n,pt:a})},chainRemoveTail:function(n,a){return i("chain_rem_tail",{index:n,pt:a})},chainNew:function(n,a){return i("chain_new",{pt1:n,pt2:a})},chainMatch:function(n){return i("chain_match",{index:n})},chainClose:function(n){return i("chain_close",{index:n})},chainAddHead:function(n,a){return i("chain_add_head",{index:n,pt:a})},chainAddTail:function(n,a){return i("chain_add_tail",{index:n,pt:a})},chainConnect:function(n,a){return i("chain_con",{index1:n,index2:a})},chainReverse:function(n){return i("chain_rev",{index:n})},chainJoin:function(n,a){return i("chain_join",{index1:n,index2:a})},done:function(){return i("done")}},y}Y.exports=d}),mS=ze((te,Y)=>{function d(y){typeof y!="number"&&(y=1e-10);var z={epsilon:function(P){return typeof P=="number"&&(y=P),y},pointAboveOrOnLine:function(P,i,n){var a=i[0],l=i[1],o=n[0],u=n[1],s=P[0],h=P[1];return(o-a)*(h-l)-(u-l)*(s-a)>=-y},pointBetween:function(P,i,n){var a=P[1]-i[1],l=n[0]-i[0],o=P[0]-i[0],u=n[1]-i[1],s=o*l+a*u;if(s-y)},pointsSameX:function(P,i){return Math.abs(P[0]-i[0])y!=o-a>y&&(l-h)*(a-m)/(o-m)+h-n>y&&(u=!u),l=h,o=m}return u}};return z}Y.exports=d}),Sg=ze((te,Y)=>{var d={create:function(){var y={root:{root:!0,next:null},exists:function(z){return!(z===null||z===y.root)},isEmpty:function(){return y.root.next===null},getHead:function(){return y.root.next},insertBefore:function(z,P){for(var i=y.root,n=y.root.next;n!==null;){if(P(n)){z.prev=n.prev,z.next=n,n.prev.next=z,n.prev=z;return}i=n,n=n.next}i.next=z,z.prev=i,z.next=null},findTransition:function(z){for(var P=y.root,i=y.root.next;i!==null&&!z(i);)P=i,i=i.next;return{before:P===y.root?null:P,after:i,insert:function(n){return n.prev=P,n.next=i,P.next=n,i!==null&&(i.prev=n),n}}}};return y},node:function(y){return y.prev=null,y.next=null,y.remove=function(){y.prev.next=y.next,y.next&&(y.next.prev=y.prev),y.prev=null,y.next=null},y}};Y.exports=d}),ab=ze((te,Y)=>{var d=Sg();function y(z,P,i){function n(A,f){return{id:i?i.segmentId():-1,start:A,end:f,myFill:{above:null,below:null},otherFill:null}}function a(A,f,k){return{id:i?i.segmentId():-1,start:A,end:f,myFill:{above:k.myFill.above,below:k.myFill.below},otherFill:null}}var l=d.create();function o(A,f,k,w,D,E){var I=P.pointsCompare(f,D);return I!==0?I:P.pointsSame(k,E)?0:A!==w?A?1:-1:P.pointAboveOrOnLine(k,w?D:E,w?E:D)?1:-1}function u(A,f){l.insertBefore(A,function(k){var w=o(A.isStart,A.pt,f,k.isStart,k.pt,k.other.pt);return w<0})}function s(A,f){var k=d.node({isStart:!0,pt:A.start,seg:A,primary:f,other:null,status:null});return u(k,A.end),k}function h(A,f,k){var w=d.node({isStart:!1,pt:f.end,seg:f,primary:k,other:A,status:null});A.other=w,u(w,A.pt)}function m(A,f){var k=s(A,f);return h(k,A,f),k}function b(A,f){i&&i.segmentChop(A.seg,f),A.other.remove(),A.seg.end=f,A.other.pt=f,u(A.other,A.pt)}function x(A,f){var k=a(f,A.seg.end,A.seg);return b(A,f),m(k,A.primary)}function _(A,f){var k=d.create();function w(W,F){var H=W.seg.start,q=W.seg.end,G=F.seg.start,ee=F.seg.end;return P.pointsCollinear(H,G,ee)?P.pointsCollinear(q,G,ee)||P.pointAboveOrOnLine(q,G,ee)?1:-1:P.pointAboveOrOnLine(H,G,ee)?1:-1}function D(W){return k.findTransition(function(F){var H=w(W,F.ev);return H>0})}function E(W,F){var H=W.seg,q=F.seg,G=H.start,ee=H.end,he=q.start,be=q.end;i&&i.checkIntersection(H,q);var ve=P.linesIntersect(G,ee,he,be);if(ve===!1){if(!P.pointsCollinear(G,ee,he)||P.pointsSame(G,be)||P.pointsSame(ee,he))return!1;var ce=P.pointsSame(G,he),re=P.pointsSame(ee,be);if(ce&&re)return F;var ge=!ce&&P.pointBetween(G,he,be),ne=!re&&P.pointBetween(ee,he,be);if(ce)return ne?x(F,ee):x(W,be),F;ge&&(re||(ne?x(F,ee):x(W,be)),x(F,G))}else ve.alongA===0&&(ve.alongB===-1?x(W,he):ve.alongB===0?x(W,ve.pt):ve.alongB===1&&x(W,be)),ve.alongB===0&&(ve.alongA===-1?x(F,G):ve.alongA===0?x(F,ve.pt):ve.alongA===1&&x(F,ee));return!1}for(var I=[];!l.isEmpty();){var M=l.getHead();if(i&&i.vert(M.pt[0]),M.isStart){let W=function(){if(g){var F=E(M,g);if(F)return F}return C?E(M,C):!1};i&&i.segmentNew(M.seg,M.primary);var p=D(M),g=p.before?p.before.ev:null,C=p.after?p.after.ev:null;i&&i.tempStatus(M.seg,g?g.seg:!1,C?C.seg:!1);var T=W();if(T){if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,N&&(T.seg.myFill.above=!T.seg.myFill.above)}else T.seg.otherFill=M.seg.myFill;i&&i.segmentUpdate(T.seg),M.other.remove(),M.remove()}if(l.getHead()!==M){i&&i.rewind(M.seg);continue}if(z){var N;M.seg.myFill.below===null?N=!0:N=M.seg.myFill.above!==M.seg.myFill.below,C?M.seg.myFill.below=C.seg.myFill.above:M.seg.myFill.below=A,N?M.seg.myFill.above=!M.seg.myFill.below:M.seg.myFill.above=M.seg.myFill.below}else if(M.seg.otherFill===null){var B;C?M.primary===C.primary?B=C.seg.otherFill.above:B=C.seg.myFill.above:B=M.primary?f:A,M.seg.otherFill={above:B,below:B}}i&&i.status(M.seg,g?g.seg:!1,C?C.seg:!1),M.other.status=p.insert(d.node({ev:M}))}else{var U=M.status;if(U===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(k.exists(U.prev)&&k.exists(U.next)&&E(U.prev.ev,U.next.ev),i&&i.statusRemove(U.ev.seg),U.remove(),!M.primary){var V=M.seg.myFill;M.seg.myFill=M.seg.otherFill,M.seg.otherFill=V}I.push(M.seg)}l.getHead().remove()}return i&&i.done(),I}return z?{addRegion:function(A){for(var f,k=A[A.length-1],w=0;w{function d(y,z,P){var i=[],n=[];return y.forEach(function(a){var l=a.start,o=a.end;if(z.pointsSame(l,o)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}P&&P.chainStart(a);var u={index:0,matches_head:!1,matches_pt1:!1},s={index:0,matches_head:!1,matches_pt1:!1},h=u;function m(B,U,V){return h.index=B,h.matches_head=U,h.matches_pt1=V,h===u?(h=s,!1):(h=null,!0)}for(var b=0;b{function d(z,P,i){var n=[];return z.forEach(function(a){var l=(a.myFill.above?8:0)+(a.myFill.below?4:0)+(a.otherFill&&a.otherFill.above?2:0)+(a.otherFill&&a.otherFill.below?1:0);P[l]!==0&&n.push({id:i?i.segmentId():-1,start:a.start,end:a.end,myFill:{above:P[l]===1,below:P[l]===2},otherFill:null})}),i&&i.selected(n),n}var y={union:function(z,P){return d(z,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],P)},intersect:function(z,P){return d(z,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],P)},difference:function(z,P){return d(z,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],P)},differenceRev:function(z,P){return d(z,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],P)},xor:function(z,P){return d(z,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],P)}};Y.exports=y}),ob=ze((te,Y)=>{var d={toPolygon:function(y,z){function P(a){if(a.length<=0)return y.segments({inverted:!1,regions:[]});function l(s){var h=s.slice(0,s.length-1);return y.segments({inverted:!1,regions:[h]})}for(var o=l(a[0]),u=1;u{var d=iy(),y=mS(),z=ab(),P=I4(),i=_w(),n=ob(),a=!1,l=y(),o;o={buildLog:function(s){return s===!0?a=d():s===!1&&(a=!1),a===!1?!1:a.list},epsilon:function(s){return l.epsilon(s)},segments:function(s){var h=z(!0,l,a);return s.regions.forEach(h.addRegion),{segments:h.calculate(s.inverted),inverted:s.inverted}},combine:function(s,h){var m=z(!1,l,a);return{combined:m.calculate(s.segments,s.inverted,h.segments,h.inverted),inverted1:s.inverted,inverted2:h.inverted}},selectUnion:function(s){return{segments:i.union(s.combined,a),inverted:s.inverted1||s.inverted2}},selectIntersect:function(s){return{segments:i.intersect(s.combined,a),inverted:s.inverted1&&s.inverted2}},selectDifference:function(s){return{segments:i.difference(s.combined,a),inverted:s.inverted1&&!s.inverted2}},selectDifferenceRev:function(s){return{segments:i.differenceRev(s.combined,a),inverted:!s.inverted1&&s.inverted2}},selectXor:function(s){return{segments:i.xor(s.combined,a),inverted:s.inverted1!==s.inverted2}},polygon:function(s){return{regions:P(s.segments,l,a),inverted:s.inverted}},polygonFromGeoJSON:function(s){return n.toPolygon(o,s)},polygonToGeoJSON:function(s){return n.fromPolygon(o,l,s)},union:function(s,h){return u(s,h,o.selectUnion)},intersect:function(s,h){return u(s,h,o.selectIntersect)},difference:function(s,h){return u(s,h,o.selectDifference)},differenceRev:function(s,h){return u(s,h,o.selectDifferenceRev)},xor:function(s,h){return u(s,h,o.selectXor)}};function u(s,h,m){var b=o.segments(s),x=o.segments(h),_=o.combine(b,x),A=m(_);return o.polygon(A)}typeof window=="object"&&(window.PolyBool=o),Y.exports=o}),sb=ze((te,Y)=>{Y.exports=function(d,y,z,P){var i=d[0],n=d[1],a=!1;z===void 0&&(z=0),P===void 0&&(P=y.length);for(var l=P-z,o=0,u=l-1;on!=b>n&&i<(m-s)*(n-h)/(b-h)+s;x&&(a=!a)}return a}}),Cg=ze((te,Y)=>{var d=rw().dot,y=ei().BADNUM,z=Y.exports={};z.tester=function(P){var i=P.slice(),n=i[0][0],a=n,l=i[0][1],o=l,u;for((i[i.length-1][0]!==i[0][0]||i[i.length-1][1]!==i[0][1])&&i.push(i[0]),u=1;ua||w===y||wo||f&&h(A))}function b(A,f){var k=A[0],w=A[1];if(k===y||ka||w===y||wo)return!1;var D=i.length,E=i[0][0],I=i[0][1],M=0,p,g,C,T,N;for(p=1;pMath.max(g,E)||w>Math.max(C,I)))if(wu||Math.abs(d(b,h))>a)return!0;return!1},z.filter=function(P,i){var n=[P[0]],a=0,l=0;function o(s){P.push(s);var h=n.length,m=a;n.splice(l+1);for(var b=m+1;b1){var u=P.pop();o(u)}return{addPt:o,raw:P,filtered:n}}}),lb=ze((te,Y)=>{Y.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}),bw=ze((te,Y)=>{var d=xw(),y=sb(),z=as(),P=Zs().dashStyle,i=Xi(),n=hf(),a=T0().makeEventData,l=dm(),o=l.freeMode,u=l.rectMode,s=l.drawMode,h=l.openMode,m=l.selectMode,b=s0(),x=rb(),_=Yg(),A=Am().clearOutline,f=Gv(),k=f.handleEllipse,w=f.readPaths,D=K0().newShapes,E=Zv(),I=P4().activateLastSelection,M=ji(),p=M.sorterAsc,g=Cg(),C=aw(),T=Zc().getFromId,N=ey(),B=pm().redrawReglTraces,U=lb(),V=U.MINSELECT,W=g.filter,F=g.tester,H=tb(),q=H.p2r,G=H.axValue,ee=H.getTransform;function he(Xe){return Xe.subplot!==void 0}function be(Xe,ot,De,ye,Pe){var He=!he(ye),at=o(Pe),ht=u(Pe),At=h(Pe),Wt=s(Pe),Yt=m(Pe),hr=Pe==="drawline",zr=Pe==="drawcircle",Dr=hr||zr,br=ye.gd,fi=br._fullLayout,un=Yt&&fi.newselection.mode==="immediate"&&He,cn=fi._zoomlayer,yn=ye.element.getBoundingClientRect(),Gn=ye.plotinfo,Sn=ee(Gn),dn=ot-yn.left,va=De-yn.top;fi._calcInverseTransform(br);var na=M.apply3DTransform(fi._invTransform)(dn,va);dn=na[0],va=na[1];var Kt=fi._invScaleX,lr=fi._invScaleY,_r=dn,Er=va,di="M"+dn+","+va,qi=ye.xaxes[0],Ui=ye.yaxes[0],Hi=qi._length,Ln=Ui._length,Fn=Xe.altKey&&!(s(Pe)&&At),Kn,Jn,sa,Mn,Ha,io,Ft;se(Xe,br,ye),at&&(Kn=W([[dn,va]],U.BENDPX));var Rt=cn.selectAll("path.select-outline-"+Gn.id).data([1]),qr=Wt?fi.newshape:fi.newselection;Wt&&(ye.hasText=qr.label.text||qr.label.texttemplate);var ai=Wt&&!At?qr.fillcolor:"rgba(0,0,0,0)",si=qr.line.color||(He?i.contrast(br._fullLayout.plot_bgcolor):"#7f7f7f");Rt.enter().append("path").attr("class","select-outline select-outline-"+Gn.id).style({opacity:Wt?qr.opacity/2:1,"stroke-dasharray":P(qr.line.dash,qr.line.width),"stroke-width":qr.line.width+"px","shape-rendering":"crispEdges"}).call(i.stroke,si).call(i.fill,ai).attr("fill-rule","evenodd").classed("cursor-move",!!Wt).attr("transform",Sn).attr("d",di+"Z");var Gr=cn.append("path").attr("class","zoombox-corners").style({fill:i.background,stroke:i.defaultLine,"stroke-width":1}).attr("transform",Sn).attr("d","M0,0Z");if(Wt&&ye.hasText){var li=cn.select(".label-temp");li.empty()&&(li=cn.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Pi=fi._uid+U.SELECTID,xi=[],zt=fe(br,ye.xaxes,ye.yaxes,ye.subplot);un&&!Xe.shiftKey&&(ye._clearSubplotSelections=function(){if(He){var Qr=qi._id,Ri=Ui._id;ut(br,Qr,Ri,zt);for(var en=(br.layout||{}).selections||[],_n=[],Zi=!1,Wi=0;Wi=0){br._fullLayout._deactivateShape(br);return}if(!Wt){var en=fi.clickmode;C.done(Pi).then(function(){if(C.clear(Pi),Qr===2){for(Rt.remove(),Ha=0;Ha-1&&ve(Ri,br,ye.xaxes,ye.yaxes,ye.subplot,ye,Rt),en==="event"&&vi(br,void 0);n.click(br,Ri,Gn.id)}).catch(M.error)}},ye.doneFn=function(){Gr.remove(),C.done(Pi).then(function(){C.clear(Pi),!un&&Mn&&ye.selectionDefs&&(Mn.subtract=Fn,ye.selectionDefs.push(Mn),ye.mergedPolygons.length=0,[].push.apply(ye.mergedPolygons,sa)),(un||Wt)&&J(ye,un),ye.doneFnCompleted&&ye.doneFnCompleted(xi),Yt&&vi(br,Ft)}).catch(M.error)}}function ve(Xe,ot,De,ye,Pe,He,at){var ht=ot._hoverdata,At=ot._fullLayout,Wt=At.clickmode,Yt=Wt.indexOf("event")>-1,hr=[],zr,Dr,br,fi,un,cn,yn,Gn,Sn,dn;if(Re(ht)){se(Xe,ot,He),zr=fe(ot,De,ye,Pe);var va=Be(ht,zr),na=va.pointNumbers.length>0;if(na?Ge(zr,va):tt(zr)&&(yn=Ze(va))){for(at&&at.remove(),dn=0;dn=0}function oe(Xe){return Xe._fullLayout._activeSelectionIndex>=0}function J(Xe,ot){var De=Xe.dragmode,ye=Xe.plotinfo,Pe=Xe.gd;_e(Pe)&&Pe._fullLayout._deactivateShape(Pe),oe(Pe)&&Pe._fullLayout._deactivateSelection(Pe);var He=Pe._fullLayout,at=He._zoomlayer,ht=s(De),At=m(De);if(ht||At){var Wt=at.selectAll(".select-outline-"+ye.id);if(Wt&&Pe._fullLayout._outlining){var Yt;ht&&(Yt=D(Wt,Xe)),Yt&&z.call("_guiRelayout",Pe,{shapes:Yt});var hr;At&&!he(Xe)&&(hr=E(Wt,Xe)),hr&&(Pe._fullLayout._noEmitSelectedAtStart=!0,z.call("_guiRelayout",Pe,{selections:hr}).then(function(){ot&&I(Pe)})),Pe._fullLayout._outlining=!1}}ye.selection={},ye.selection.selectionDefs=Xe.selectionDefs=[],ye.selection.mergedPolygons=Xe.mergedPolygons=[]}function me(Xe){return Xe._id}function fe(Xe,ot,De,ye){if(!Xe.calcdata)return[];var Pe=[],He=ot.map(me),at=De.map(me),ht,At,Wt;for(Wt=0;Wt0,He=Pe?ye[0]:De;return ot.selectedpoints?ot.selectedpoints.indexOf(He)>-1:!1}function Ge(Xe,ot){var De=[],ye,Pe,He,at;for(at=0;at0&&De.push(ye);if(De.length===1&&(He=De[0]===ot.searchInfo,He&&(Pe=ot.searchInfo.cd[0].trace,Pe.selectedpoints.length===ot.pointNumbers.length))){for(at=0;at1||(ot+=ye.selectedpoints.length,ot>1)))return!1;return ot===1}function _t(Xe,ot,De){var ye;for(ye=0;ye-1&&ot;if(!at&&ot){var Qr=Gt(Xe,!0);if(Qr.length){var Ri=Qr[0].xref,en=Qr[0].yref;if(Ri&&en){var _n=mr(Qr),Zi=ii([T(Xe,Ri,"x"),T(Xe,en,"y")]);Zi(xi,_n)}}Xe._fullLayout._noEmitSelectedAtStart?Xe._fullLayout._noEmitSelectedAtStart=!1:xr&&vi(Xe,xi),zr._reselect=!1}if(!at&&zr._deselect){var Wi=zr._deselect;ht=Wi.xref,At=Wi.yref,xt(ht,At,Yt)||ut(Xe,ht,At,ye),xr&&(xi.points.length?vi(Xe,xi):Ot(Xe)),zr._deselect=!1}return{eventData:xi,selectionTesters:De}}function nt(Xe){var ot=Xe.calcdata;if(ot)for(var De=0;De{Y.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}),ub=ze((te,Y)=>{Y.exports={axisRefDescription:function(d,y,z){return["If set to a",d,"axis id (e.g. *"+d+"* or","*"+d+"2*), the `"+d+"` position refers to a",d,"coordinate. If set to *paper*, the `"+d+"`","position refers to the distance from the",y,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",y,"("+z+"). If set to a",d,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",y,"of the domain of that axis: e.g.,","*"+d+"2 domain* refers to the domain of the second",d," axis and a",d,"position of 0.5 refers to the","point between the",y,"and the",z,"of the domain of the","second",d,"axis."].join(" ")}}}),Ag=ze((te,Y)=>{var d=ww(),y=On(),z=dc(),P=ku().templatedArray;ub(),Y.exports=P("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:d.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:d.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",z.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",z.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",z.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:y({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}),Mg=ze((te,Y)=>{Y.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}),Lm=ze((te,Y)=>{Y.exports=function(d){return{valType:"color",editType:"style",anim:!0}}}),ff=ze((te,Y)=>{var d=Sh().axisHoverFormat,{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=Oc(),n=On(),a=qd().dash,l=qd().pattern,o=Zs(),u=Mg(),s=nn().extendFlat,h=Lm();function m(_){return{valType:"any",dflt:0,editType:"calc"}}function b(_){return{valType:"any",editType:"calc"}}function x(_){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:m(),yperiod:m(),xperiod0:b(),yperiod0:b(),xperiodalignment:x(),yperiodalignment:x(),xhoverformat:d("x"),yhoverformat:d("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:z(),texttemplatefallback:P({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:y({},{keys:u.eventDataKeys}),hovertemplatefallback:P(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:s({},a,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:h(!0),fillgradient:s({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:s({symbol:{valType:"enumerated",values:o.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:s({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},i("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},i("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:n({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}),kw=ze((te,Y)=>{var d=Ag(),y=ff().line,z=qd().dash,P=nn().extendFlat,i=oh().overrideAll,n=ku().templatedArray;ub(),Y.exports=i(n("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:P({},d.xref,{}),yref:P({},d.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:y.color,width:P({},y.width,{min:1,dflt:1}),dash:P({},z,{dflt:"dot"})}}),"arraydraw","from-root")}),gS=ze((te,Y)=>{var d=ji(),y=Os(),z=Zd(),P=kw(),i=s0();Y.exports=function(a,l){z(a,l,{name:"selections",handleItemDefaults:n});for(var o=l.selections,u=0;u{Y.exports=function(d,y,z){z("newselection.mode");var P=z("newselection.line.width");P&&(z("newselection.line.color"),z("newselection.line.dash")),z("activeselection.fillcolor"),z("activeselection.opacity")}}),Kv=ze((te,Y)=>{var d=as(),y=ji(),z=Zc();Y.exports=function(P){return function(i,n){var a=i[P];if(Array.isArray(a))for(var l=d.subplotsRegistry.cartesian,o=l.idRegex,u=n._subplots,s=u.xaxis,h=u.yaxis,m=u.cartesian,b=n._has("cartesian"),x=0;x{var d=P4(),y=bw();Y.exports={moduleType:"component",name:"selections",layoutAttributes:kw(),supplyLayoutDefaults:gS(),supplyDrawNewSelectionDefaults:eg(),includeBasePlot:Kv()("selections"),draw:d.draw,drawOne:d.drawOne,reselect:y.reselect,prepSelect:y.prepSelect,clearOutline:y.clearOutline,clearSelectionsCache:y.clearSelectionsCache,selectOnClick:y.selectOnClick}}),L_=ze((te,Y)=>{var d=ri(),y=ji(),z=y.numberFormat,P=ln(),i=uw(),n=as(),a=y.strTranslate,l=cc(),o=Xi(),u=Zs(),s=hf(),h=Os(),m=Em(),b=jp(),x=dm(),_=x.selectingOrDrawing,A=x.freeMode,f=Rf().FROM_TL,k=ey(),w=pm().redrawReglTraces,D=sh(),E=Zc().getFromId,I=Ef().prepSelect,M=Ef().clearOutline,p=Ef().selectOnClick,g=nb(),C=dc(),T=C.MINDRAG,N=C.MINZOOM,B=!0;function U(Ce,Re,Be,Ze,Ge,tt,_t,mt){var vt=Ce._fullLayout._zoomlayer,ct=_t+mt==="nsew",Ae=(_t+mt).length===1,Oe,Le,nt,xt,ut,Et,Gt,Qt,vr,mr,Yr,ii,Lr,ci,vi,Ot,Xe,ot,De,ye,Pe,He,at;Be+=Re.yaxis._shift;function ht(){if(Oe=Re.xaxis,Le=Re.yaxis,vr=Oe._length,mr=Le._length,Gt=Oe._offset,Qt=Le._offset,nt={},nt[Oe._id]=Oe,xt={},xt[Le._id]=Le,_t&&mt)for(var Rt=Re.overlays,qr=0;qr=0){ai._fullLayout._deactivateShape(ai);return}var si=ai._fullLayout.clickmode;if(ge(ai),Rt===2&&!Ae&&Jn(),ct)si.indexOf("select")>-1&&p(qr,ai,ut,Et,Re.id,Yt),si.indexOf("event")>-1&&s.click(ai,qr,Re.id);else if(Rt===1&&Ae){var Gr=_t?Le:Oe,li=_t==="s"||mt==="w"?0:1,Pi=Gr._name+".range["+li+"]",xi=H(Gr,li),zt="left",xr="middle";if(Gr.fixedrange)return;_t?(xr=_t==="n"?"top":"bottom",Gr.side==="right"&&(zt="right")):mt==="e"&&(zt="right"),ai._context.showAxisRangeEntryBoxes&&d.select(Wt).call(l.makeEditable,{gd:ai,immediate:!0,background:ai._fullLayout.paper_bgcolor,text:String(xi),fill:Gr.tickfont?Gr.tickfont.color:"#444",horizontalAlign:zt,verticalAlign:xr}).on("edit",function(Qr){var Ri=Gr.d2r(Qr);Ri!==void 0&&n.call("_guiRelayout",ai,Pi,Ri)})}}b.init(Yt);var Dr,br,fi,un,cn,yn,Gn,Sn,dn,va;function na(Rt,qr,ai){var si=Wt.getBoundingClientRect();Dr=qr-si.left,br=ai-si.top,Ce._fullLayout._calcInverseTransform(Ce);var Gr=y.apply3DTransform(Ce._fullLayout._invTransform)(Dr,br);Dr=Gr[0],br=Gr[1],fi={l:Dr,r:Dr,w:0,t:br,b:br,h:0},un=Ce._hmpixcount?Ce._hmlumcount/Ce._hmpixcount:P(Ce._fullLayout.plot_bgcolor).getLuminance(),cn="M0,0H"+vr+"V"+mr+"H0V0",yn=!1,Gn="xy",va=!1,Sn=be(vt,un,Gt,Qt,cn),dn=ve(vt,Gt,Qt)}function Kt(Rt,qr){if(Ce._transitioningWithDuration)return!1;var ai=Math.max(0,Math.min(vr,He*Rt+Dr)),si=Math.max(0,Math.min(mr,at*qr+br)),Gr=Math.abs(ai-Dr),li=Math.abs(si-br);fi.l=Math.min(Dr,ai),fi.r=Math.max(Dr,ai),fi.t=Math.min(br,si),fi.b=Math.max(br,si);function Pi(){Gn="",fi.r=fi.l,fi.t=fi.b,dn.attr("d","M0,0Z")}if(Yr.isSubplotConstrained)Gr>N||li>N?(Gn="xy",Gr/vr>li/mr?(li=Gr*mr/vr,br>si?fi.t=br-li:fi.b=br+li):(Gr=li*vr/mr,Dr>ai?fi.l=Dr-Gr:fi.r=Dr+Gr),dn.attr("d",oe(fi))):Pi();else if(ii.isSubplotConstrained)if(Gr>N||li>N){Gn="xy";var xi=Math.min(fi.l/vr,(mr-fi.b)/mr),zt=Math.max(fi.r/vr,(mr-fi.t)/mr);fi.l=xi*vr,fi.r=zt*vr,fi.b=(1-xi)*mr,fi.t=(1-zt)*mr,dn.attr("d",oe(fi))}else Pi();else!ci||li0){var Qr;if(ii.isSubplotConstrained||!Lr&&ci.length===1){for(Qr=0;Qr1&&(Pi.maxallowed!==void 0&&Ot===(Pi.range[0]1&&(xi.maxallowed!==void 0&&Xe===(xi.range[0]=0?Math.min(Ce,.9):1/(1/Math.max(Ce,-.3)+3.222))}function he(Ce,Re,Be){return Ce?Ce==="nsew"?Be?"":Re==="pan"?"move":"crosshair":Ce.toLowerCase()+"-resize":"pointer"}function be(Ce,Re,Be,Ze,Ge){return Ce.append("path").attr("class","zoombox").style({fill:Re>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",a(Be,Ze)).attr("d",Ge+"Z")}function ve(Ce,Re,Be){return Ce.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1,opacity:0}).attr("transform",a(Re,Be)).attr("d","M0,0Z")}function ce(Ce,Re,Be,Ze,Ge,tt){Ce.attr("d",Ze+"M"+Be.l+","+Be.t+"v"+Be.h+"h"+Be.w+"v-"+Be.h+"h-"+Be.w+"Z"),re(Ce,Re,Ge,tt)}function re(Ce,Re,Be,Ze){Be||(Ce.transition().style("fill",Ze>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Re.transition().style("opacity",1).duration(200))}function ge(Ce){d.select(Ce).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function ne(Ce){B&&Ce.data&&Ce._context.showTips&&(y.notifier(y._(Ce,"Double-click to zoom back out"),"long"),B=!1)}function se(Ce,Re){return"M"+(Ce.l-.5)+","+(Re-N-.5)+"h-3v"+(2*N+1)+"h3ZM"+(Ce.r+.5)+","+(Re-N-.5)+"h3v"+(2*N+1)+"h-3Z"}function _e(Ce,Re){return"M"+(Re-N-.5)+","+(Ce.t-.5)+"v-3h"+(2*N+1)+"v3ZM"+(Re-N-.5)+","+(Ce.b+.5)+"v3h"+(2*N+1)+"v-3Z"}function oe(Ce){var Re=Math.floor(Math.min(Ce.b-Ce.t,Ce.r-Ce.l,N)/2);return"M"+(Ce.l-3.5)+","+(Ce.t-.5+Re)+"h3v"+-Re+"h"+Re+"v-3h-"+(Re+3)+"ZM"+(Ce.r+3.5)+","+(Ce.t-.5+Re)+"h-3v"+-Re+"h"+-Re+"v-3h"+(Re+3)+"ZM"+(Ce.r+3.5)+","+(Ce.b+.5-Re)+"h-3v"+Re+"h"+-Re+"v3h"+(Re+3)+"ZM"+(Ce.l-3.5)+","+(Ce.b+.5-Re)+"h3v"+Re+"h"+Re+"v3h-"+(Re+3)+"Z"}function J(Ce,Re,Be,Ze,Ge){for(var tt=!1,_t={},mt={},vt,ct,Ae,Oe,Le=(Ge||{}).xaHash,nt=(Ge||{}).yaHash,xt=0;xt{var Y=ri(),d=hf(),y=jp(),z=Em(),P=L_().makeDragBox,i=dc().DRAGGERSIZE;te.initInteractions=function(n){var a=n._fullLayout;if(n._context.staticPlot){Y.select(n).selectAll(".drag").remove();return}if(!(!a._has("cartesian")&&!a._has("splom"))){var l=Object.keys(a._plots||{}).sort(function(u,s){if((a._plots[u].mainplot&&!0)===(a._plots[s].mainplot&&!0)){var h=u.split("y"),m=s.split("y");return h[0]===m[0]?Number(h[1]||1)-Number(m[1]||1):Number(h[0]||1)-Number(m[0]||1)}return a._plots[u].mainplot?1:-1});l.forEach(function(u){var s=a._plots[u],h=s.xaxis,m=s.yaxis;if(!s.mainplot){var b=P(n,s,h._offset,m._offset,h._length,m._length,"ns","ew");b.onmousemove=function(A){n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===u&&n._fullLayout._plots[u]&&d.hover(n,A,u)},d.hover(n,A,u),n._fullLayout._lasthover=b,n._fullLayout._hoversubplot=u},b.onmouseout=function(A){n._dragging||(n._fullLayout._hoversubplot=null,y.unhover(n,A))},n._context.showAxisDragHandles&&(P(n,s,h._offset-i,m._offset-i,i,i,"n","w"),P(n,s,h._offset+h._length,m._offset-i,i,i,"n","e"),P(n,s,h._offset-i,m._offset+m._length,i,i,"s","w"),P(n,s,h._offset+h._length,m._offset+m._length,i,i,"s","e"))}if(n._context.showAxisDragHandles){if(u===h._mainSubplot){var x=h._mainLinePosition;h.side==="top"&&(x-=i),P(n,s,h._offset+h._length*.1,x,h._length*.8,i,"","ew"),P(n,s,h._offset,x,h._length*.1,i,"","w"),P(n,s,h._offset+h._length*.9,x,h._length*.1,i,"","e")}if(u===m._mainSubplot){var _=m._mainLinePosition;m.side!=="right"&&(_-=i),P(n,s,_,m._offset+m._length*.1,i,m._length*.8,"ns",""),P(n,s,_,m._offset+m._length*.9,i,m._length*.1,"s",""),P(n,s,_,m._offset,i,m._length*.1,"n","")}}});var o=a._hoverlayer.node();o.onmousemove=function(u){u.target=n._fullLayout._lasthover,d.hover(n,u,a._hoversubplot)},o.onclick=function(u){u.target=n._fullLayout._lasthover,d.click(n,u)},o.onmousedown=function(u){n._fullLayout._lasthover.onmousedown(u)},te.updateFx(n)}},te.updateFx=function(n){var a=n._fullLayout,l=a.dragmode==="pan"?"move":"crosshair";z(a._draggers,l)}}),z4=ze((te,Y)=>{var d=as();Y.exports=function(y){for(var z=d.layoutArrayContainers,P=d.layoutArrayRegexes,i=y.split("[")[0],n,a,l=0;l{var Y=ti(),d=Qo(),y=ns(),z=nw().sorterAsc,P=as();te.containerArrayMatch=z4();var i=te.isAddVal=function(a){return a==="add"||Y(a)},n=te.isRemoveVal=function(a){return a===null||a==="remove"};te.applyContainerArrayChanges=function(a,l,o,u,s){var h=l.astr,m=P.getComponentMethod(h,"supplyLayoutDefaults"),b=P.getComponentMethod(h,"draw"),x=P.getComponentMethod(h,"drawOne"),_=u.replot||u.recalc||m===d||b===d,A=a.layout,f=a._fullLayout;if(o[""]){Object.keys(o).length>1&&y.warn("Full array edits are incompatible with other edits",h);var k=o[""][""];if(n(k))l.set(null);else if(Array.isArray(k))l.set(k);else return y.warn("Unrecognized full array edit value",h,k),!0;return _?!1:(m(A,f),b(a),!0)}var w=Object.keys(o).map(Number).sort(z),D=l.get(),E=D||[],I=s(f,h).get(),M=[],p=-1,g=E.length,C,T,N,B,U,V,W,F;for(C=0;CE.length-(W?0:1)){y.warn("index out of range",h,N);continue}if(V!==void 0)U.length>1&&y.warn("Insertion & removal are incompatible with edits to the same index.",h,N),n(V)?M.push(N):W?(V==="add"&&(V={}),E.splice(N,0,V),I&&I.splice(N,0,{})):y.warn("Unrecognized full object edit value",h,N,V),p===-1&&(p=N);else for(T=0;T=0;C--)E.splice(M[C],1),I&&I.splice(M[C],1);if(E.length?D||l.set(E):l.set(null),_)return!1;if(m(A,f),x!==d){var H;if(p===-1)H=w;else{for(g=Math.max(E.length,g),H=[],C=0;C=p));C++)H.push(N);for(C=p;C{var Y=Sr(),d=as(),y=ji(),z=sh(),P=Zc(),i=Xi(),n=P.cleanId,a=P.getFromTrace,l=d.traceIs,o=["x","y","z"];te.clearPromiseQueue=function(f){Array.isArray(f._promises)&&f._promises.length>0&&y.log("Clearing previous rejected promises from queue."),f._promises=[]},te.cleanLayout=function(f){var k;f||(f={}),f.xaxis1&&(f.xaxis||(f.xaxis=f.xaxis1),delete f.xaxis1),f.yaxis1&&(f.yaxis||(f.yaxis=f.yaxis1),delete f.yaxis1),f.scene1&&(f.scene||(f.scene=f.scene1),delete f.scene1);var w=(z.subplotsRegistry.cartesian||{}).attrRegex;(z.subplotsRegistry.polar||{}).attrRegex,(z.subplotsRegistry.ternary||{}).attrRegex,(z.subplotsRegistry.gl3d||{}).attrRegex;var D=Object.keys(f);for(k=0;k3?(B.x=1.02,B.xanchor="left"):B.x<-2&&(B.x=-.02,B.xanchor="right"),B.y>3?(B.y=1.02,B.yanchor="bottom"):B.y<-2&&(B.y=-.02,B.yanchor="top")),f.dragmode==="rotate"&&(f.dragmode="orbit"),i.clean(f),f.template&&f.template.layout&&te.cleanLayout(f.template.layout),f};function u(f,k){var w=f[k],D=k.charAt(0);w&&w!=="paper"&&(f[k]=n(w,D,!0))}te.cleanData=function(f){for(var k=0;k0)return f.substr(0,k)}te.hasParent=function(f,k){for(var w=_(k);w;){if(w in f)return!0;w=_(w)}return!1},te.clearAxisTypes=function(f,k,w){for(var D=0;D{let w=(...D)=>D.every(E=>y.isPlainObject(E))||D.every(E=>Array.isArray(E));if([f,k].every(D=>Array.isArray(D))){if(f.length!==k.length)return!1;for(let D=0;Dy.isPlainObject(D))){if(Object.keys(f).length!==Object.keys(k).length)return!1;for(let D in f){if(D.startsWith("_"))continue;let E=f[D],I=k[D];if(E!==I&&!(w(E,I)&&A(E,I)))return!1}return!0}return!1};te.collectionsAreEqual=A}),Tw=ze(te=>{var Y=ri(),d=Sr(),y=Qf(),z=ji(),P=z.nestedProperty,i=Gg(),n=hm(),a=as(),l=Zg(),o=sh(),u=Os(),s=lw(),h=Gd(),m=Zs(),b=Xi(),x=D4().initInteractions,_=k0(),A=Ef().clearOutline,f=ss().dfltConfig,k=vS(),w=P_(),D=pm(),E=oh(),I=dc().AX_NAME_PATTERN,M=0,p=5;function g(De,ye,Pe,He){var at;if(De=z.getGraphDiv(De),i.init(De),z.isPlainObject(ye)){var ht=ye;ye=ht.data,Pe=ht.layout,He=ht.config,at=ht.frames}var At=i.triggerHandler(De,"plotly_beforeplot",[ye,Pe,He]);if(At===!1)return Promise.reject();!ye&&!Pe&&!z.isPlotDiv(De)&&z.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",De);function Wt(){if(at)return te.addFrames(De,at)}U(De,He),Pe||(Pe={}),Y.select(De).classed("js-plotly-plot",!0),m.makeTester(),Array.isArray(De._promises)||(De._promises=[]);var Yt=(De.data||[]).length===0&&Array.isArray(ye);Array.isArray(ye)&&(w.cleanData(ye),Yt?De.data=ye:De.data.push.apply(De.data,ye),De.empty=!1),(!De.layout||Yt)&&(De.layout=w.cleanLayout(Pe)),o.supplyDefaults(De);var hr=De._fullLayout,zr=hr._has("cartesian");hr._replotting=!0,(Yt||hr._shouldCreateBgLayer)&&(ot(De),hr._shouldCreateBgLayer&&delete hr._shouldCreateBgLayer),m.initGradients(De),m.initPatterns(De),Yt&&u.saveShowSpikeInitial(De);var Dr=!De.calcdata||De.calcdata.length!==(De._fullData||[]).length;Dr&&o.doCalcdata(De);for(var br=0;br=De.data.length||at<-De.data.length)throw new Error(Pe+" must be valid indices for gd.data.");if(ye.indexOf(at,He+1)>-1||at>=0&&ye.indexOf(-De.data.length+at)>-1||at<0&&ye.indexOf(De.data.length+at)>-1)throw new Error("each index in "+Pe+" must be unique.")}}function q(De,ye,Pe){if(!Array.isArray(De.data))throw new Error("gd.data must be an array.");if(typeof ye>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ye)||(ye=[ye]),H(De,ye,"currentIndices"),typeof Pe<"u"&&!Array.isArray(Pe)&&(Pe=[Pe]),typeof Pe<"u"&&H(De,Pe,"newIndices"),typeof Pe<"u"&&ye.length!==Pe.length)throw new Error("current and new indices must be of equal length.")}function G(De,ye,Pe){var He,at;if(!Array.isArray(De.data))throw new Error("gd.data must be an array.");if(typeof ye>"u")throw new Error("traces must be defined.");for(Array.isArray(ye)||(ye=[ye]),He=0;He"u")throw new Error("indices must be an integer or array of integers");H(De,Pe,"indices");for(var ht in ye){if(!Array.isArray(ye[ht])||ye[ht].length!==Pe.length)throw new Error("attribute "+ht+" must be an array of length equal to indices array length");if(at&&(!(ht in He)||!Array.isArray(He[ht])||He[ht].length!==ye[ht].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 correspondence with the keys and number of traces in the update object")}}function he(De,ye,Pe,He){var at=z.isPlainObject(He),ht=[],At,Wt,Yt,hr,zr;Array.isArray(Pe)||(Pe=[Pe]),Pe=F(Pe,De.data.length-1);for(var Dr in ye)for(var br=0;br=0&&zr=0&&zr"u")return hr=te.redraw(De),n.add(De,at,At,ht,Wt),hr;Array.isArray(Pe)||(Pe=[Pe]);try{q(De,He,Pe)}catch(zr){throw De.data.splice(De.data.length-ye.length,ye.length),zr}return n.startSequence(De),n.add(De,at,At,ht,Wt),hr=te.moveTraces(De,He,Pe),n.stopSequence(De),hr}function ne(De,ye){De=z.getGraphDiv(De);var Pe=[],He=te.addTraces,at=ne,ht=[De,Pe,ye],At=[De,ye],Wt,Yt;if(typeof ye>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ye)||(ye=[ye]),H(De,ye,"indices"),ye=F(ye,De.data.length-1),ye.sort(z.sorterDes),Wt=0;Wt"u")for(Pe=[],hr=0;hr0&&typeof _r.parts[qi]!="string";)qi--;var Ui=_r.parts[qi],Hi=_r.parts[qi-1]+"."+Ui,Ln=_r.parts.slice(0,qi).join("."),Fn=P(De.layout,Ln).get(),Kn=P(He,Ln).get(),Jn=_r.get();if(Er!==void 0){Gn[lr]=Er,Sn[lr]=Ui==="reverse"?Er:oe(Jn);var sa=l.getLayoutValObject(He,_r.parts);if(sa&&sa.impliedEdits&&Er!==null)for(var Mn in sa.impliedEdits)dn(z.relativeAttr(lr,Mn),sa.impliedEdits[Mn]);if(["width","height"].indexOf(lr)!==-1)if(Er){dn("autosize",null);var Ha=lr==="height"?"width":"height";dn(Ha,He[Ha])}else He[lr]=De._initialAutoSize[lr];else if(lr==="autosize")dn("width",Er?null:He.width),dn("height",Er?null:He.height);else if(Hi.match(Ge))Kt(Hi),P(He,Ln+"._inputRange").set(null);else if(Hi.match(tt)){Kt(Hi),P(He,Ln+"._inputRange").set(null);var io=P(He,Ln).get();io._inputDomain&&(io._input.domain=io._inputDomain.slice())}else Hi.match(_t)&&P(He,Ln+"._inputDomain").set(null);if(Ui==="type"){na=Fn;var Ft=Kn.type==="linear"&&Er==="log",Rt=Kn.type==="log"&&Er==="linear";if(Ft||Rt){if(!na||!na.range)dn(Ln+".autorange",!0);else if(Kn.autorange)Ft&&(na.range=na.range[1]>na.range[0]?[1,2]:[2,1]);else{var qr=na.range[0],ai=na.range[1];Ft?(qr<=0&&ai<=0&&dn(Ln+".autorange",!0),qr<=0?qr=ai/1e6:ai<=0&&(ai=qr/1e6),dn(Ln+".range[0]",Math.log(qr)/Math.LN10),dn(Ln+".range[1]",Math.log(ai)/Math.LN10)):(dn(Ln+".range[0]",Math.pow(10,qr)),dn(Ln+".range[1]",Math.pow(10,ai)))}Array.isArray(He._subplots.polar)&&He._subplots.polar.length&&He[_r.parts[0]]&&_r.parts[1]==="radialaxis"&&delete He[_r.parts[0]]._subplot.viewInitial["radialaxis.range"],a.getComponentMethod("annotations","convertCoords")(De,Kn,Er,dn),a.getComponentMethod("images","convertCoords")(De,Kn,Er,dn)}else dn(Ln+".autorange",!0),dn(Ln+".range",null);P(He,Ln+"._inputRange").set(null)}else if(Ui.match(I)){var si=P(He,lr).get(),Gr=(Er||{}).type;(!Gr||Gr==="-")&&(Gr="linear"),a.getComponentMethod("annotations","convertCoords")(De,si,Gr,dn),a.getComponentMethod("images","convertCoords")(De,si,Gr,dn)}var li=k.containerArrayMatch(lr);if(li){zr=li.array,Dr=li.index;var Pi=li.property,xi=sa||{editType:"calc"};Dr!==""&&Pi===""&&(k.isAddVal(Er)?Sn[lr]=null:k.isRemoveVal(Er)?Sn[lr]=(P(Pe,zr).get()||[])[Dr]:z.warn("unrecognized full object value",ye)),E.update(yn,xi),hr[zr]||(hr[zr]={});var zt=hr[zr][Dr];zt||(zt=hr[zr][Dr]={}),zt[Pi]=Er,delete ye[lr]}else Ui==="reverse"?(Fn.range?Fn.range.reverse():(dn(Ln+".autorange",!0),Fn.range=[1,0]),Kn.autorange?yn.calc=!0:yn.plot=!0):(lr==="dragmode"&&(Er===!1&&Jn!==!1||Er!==!1&&Jn===!1)||He._has("scatter-like")&&He._has("regl")&&lr==="dragmode"&&(Er==="lasso"||Er==="select")&&!(Jn==="lasso"||Jn==="select")?yn.plot=!0:sa?E.update(yn,sa):yn.calc=!0,_r.set(Er))}}for(zr in hr){var xr=k.applyContainerArrayChanges(De,ht(Pe,zr),hr[zr],yn,ht);xr||(yn.plot=!0)}for(var Qr in va){na=u.getFromId(De,Qr);var Ri=na&&na._constraintGroup;if(Ri){yn.calc=!0;for(var en in Ri)va[en]||(u.getFromId(De,en)._constraintShrinkable=!0)}}(vt(De)||ye.height||ye.width)&&(yn.plot=!0);var _n=He.shapes;for(Dr=0;Dr<_n.length;Dr++)if(_n[Dr].showlegend){yn.calc=!0;break}return(yn.plot||yn.calc)&&(yn.layoutReplot=!0),{flags:yn,rangesAltered:va,undoit:Sn,redoit:Gn,eventData:Yt}}function vt(De){var ye=De._fullLayout,Pe=ye.width,He=ye.height;return De.layout.autosize&&o.plotAutoSize(De,De.layout,ye),ye.width!==Pe||ye.height!==He}function ct(De,ye,Pe,He){De=z.getGraphDiv(De),w.clearPromiseQueue(De),z.isPlainObject(ye)||(ye={}),z.isPlainObject(Pe)||(Pe={}),Object.keys(ye).length&&(De.changed=!0),Object.keys(Pe).length&&(De.changed=!0);var at=w.coerceTraceIndices(De,He),ht=Ce(De,z.extendFlat({},ye),at),At=ht.flags,Wt=mt(De,z.extendFlat({},Pe)),Yt=Wt.flags;(At.calc||Yt.calc)&&(De.calcdata=void 0),At.clearAxisTypes&&w.clearAxisTypes(De,at,Pe);var hr=[];Yt.layoutReplot?hr.push(D.layoutReplot):At.fullReplot?hr.push(te._doPlot):(hr.push(o.previousPromises),Be(De,Yt,Wt)||o.supplyDefaults(De),At.style&&hr.push(D.doTraceStyle),(At.colorbars||Yt.colorbars)&&hr.push(D.doColorBars),Yt.legend&&hr.push(D.doLegend),Yt.layoutstyle&&hr.push(D.layoutStyles),Yt.axrange&&Ze(hr,Wt.rangesAltered),Yt.ticks&&hr.push(D.doTicksRelayout),Yt.modebar&&hr.push(D.doModeBar),Yt.camera&&hr.push(D.doCamera),hr.push(C)),hr.push(o.rehover,o.redrag,o.reselect),n.add(De,ct,[De,ht.undoit,Wt.undoit,ht.traces],ct,[De,ht.redoit,Wt.redoit,ht.traces]);var zr=z.syncOrAsync(hr,De);return(!zr||!zr.then)&&(zr=Promise.resolve(De)),zr.then(function(){return De.emit("plotly_update",{data:ht.eventData,layout:Wt.eventData}),De})}function Ae(De){return function(ye){ye._fullLayout._guiEditing=!0;var Pe=De.apply(null,arguments);return ye._fullLayout._guiEditing=!1,Pe}}var Oe=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],Le=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function nt(De,ye){for(var Pe=0;Pe1;)if(He.pop(),Pe=P(ye,He.join(".")+".uirevision").get(),Pe!==void 0)return Pe;return ye.uirevision}function ut(De,ye){for(var Pe=0;Pe[Ln,De._ev.listeners(Ln)]);ht=te.newPlot(De,ye,Pe,He).then(()=>{for(let[Ln,Fn]of Hi)Fn.forEach(Kn=>De.on(Ln,Kn));return te.react(De,ye,Pe,He)})}else{De.data=ye||[],w.cleanData(De.data),De.layout=Pe||{},w.cleanLayout(De.layout),Qt(De.data,De.layout,Wt,Yt),o.supplyDefaults(De,{skipUpdateCalc:!0});var Dr=De._fullData,br=De._fullLayout,fi=br.datarevision===void 0,un=br.transition,cn=Yr(De,Yt,br,fi,un),yn=cn.newDataRevision,Gn=mr(De,Wt,Dr,fi,un,yn);if(vt(De)&&(cn.layoutReplot=!0),Gn.calc||cn.calc){De.calcdata=void 0;for(var Sn=Object.getOwnPropertyNames(br),dn=0;dn(zr||De.emit("plotly_react",{config:He,data:ye,layout:Pe}),De))}function mr(De,ye,Pe,He,at,ht){var At=ye.length===Pe.length;if(!at&&!At)return{fullReplot:!0,calc:!0};var Wt=E.traceFlags();Wt.arrays={},Wt.nChanges=0,Wt.nChangesAnim=0;var Yt,hr;function zr(fi){var un=l.getTraceValObject(hr,fi);return!hr._module.animatable&&un.anim&&(un.anim=!1),un}var Dr={getValObject:zr,flags:Wt,immutable:He,transition:at,newDataRevision:ht,gd:De},br={};for(Yt=0;Yt=at.length?at[0]:at[hr]:at}function Wt(hr){return Array.isArray(ht)?hr>=ht.length?ht[0]:ht[hr]:ht}function Yt(hr,zr){var Dr=0;return function(){if(hr&&++Dr===zr)return hr()}}return new Promise(function(hr,zr){function Dr(){if(He._frameQueue.length!==0){for(;He._frameQueue.length;){var Ui=He._frameQueue.pop();Ui.onInterrupt&&Ui.onInterrupt()}De.emit("plotly_animationinterrupted",[])}}function br(Ui){if(Ui.length!==0){for(var Hi=0;HiHe._timeToNext&&un()};Ui()}var yn=0;function Gn(Ui){return Array.isArray(at)?yn>=at.length?Ui.transitionOpts=at[yn]:Ui.transitionOpts=at[0]:Ui.transitionOpts=at,yn++,Ui}var Sn,dn,va=[],na=ye==null,Kt=Array.isArray(ye),lr=!na&&!Kt&&z.isPlainObject(ye);if(lr)va.push({type:"object",data:Gn(z.extendFlat({},ye))});else if(na||["string","number"].indexOf(typeof ye)!==-1)for(Sn=0;Sn0&&didi)&&qi.push(dn);va=qi}}va.length>0?br(va):(De.emit("plotly_animated"),hr())})}function ci(De,ye,Pe){if(De=z.getGraphDiv(De),ye==null)return Promise.resolve();if(!z.isPlotDiv(De))throw new Error("This element is not a Plotly plot: "+De+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var He,at,ht,At,Wt=De._transitionData._frames,Yt=De._transitionData._frameHash;if(!Array.isArray(ye))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ye);var hr=Wt.length+ye.length*2,zr=[],Dr={};for(He=ye.length-1;He>=0;He--)if(z.isPlainObject(ye[He])){var br=ye[He].name,fi=(Yt[br]||Dr[br]||{}).name,un=ye[He].name,cn=Yt[fi]||Dr[fi];fi&&un&&typeof un=="number"&&cn&&M_r.index?-1:lr.index<_r.index?1:0});var yn=[],Gn=[],Sn=Wt.length;for(He=zr.length-1;He>=0;He--){if(at=zr[He].frame,typeof at.name=="number"&&z.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!at.name)for(;Yt[at.name="frame "+De._transitionData._counter++];);if(Yt[at.name]){for(ht=0;ht=0;Pe--)He=ye[Pe],ht.push({type:"delete",index:He}),At.unshift({type:"insert",index:He,value:at[He]});var Wt=o.modifyFrames,Yt=o.modifyFrames,hr=[De,At],zr=[De,ht];return n&&n.add(De,Wt,hr,Yt,zr),o.modifyFrames(De,ht)}function Ot(De){De=z.getGraphDiv(De);var ye=De._fullLayout||{},Pe=De._fullData||[];return o.cleanPlot([],{},Pe,ye),o.purge(De),i.purge(De),ye._container&&ye._container.remove(),delete De._context,De}function Xe(De){var ye=De._fullLayout,Pe=De.getBoundingClientRect();if(!z.equalDomRects(Pe,ye._lastBBox)){var He=ye._invTransform=z.inverseTransformMatrix(z.getFullTransformMatrix(De));ye._invScaleX=Math.sqrt(He[0][0]*He[0][0]+He[0][1]*He[0][1]+He[0][2]*He[0][2]),ye._invScaleY=Math.sqrt(He[1][0]*He[1][0]+He[1][1]*He[1][1]+He[1][2]*He[1][2]),ye._lastBBox=Pe}}function ot(De){var ye=Y.select(De),Pe=De._fullLayout;if(Pe._calcInverseTransform=Xe,Pe._calcInverseTransform(De),Pe._container=ye.selectAll(".plot-container").data([0]),Pe._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Pe._paperdiv=Pe._container.selectAll(".svg-container").data([0]),Pe._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Pe._glcontainer=Pe._paperdiv.selectAll(".gl-container").data([{}]),Pe._glcontainer.enter().append("div").classed("gl-container",!0),Pe._paperdiv.selectAll(".main-svg").remove(),Pe._paperdiv.select(".modebar-container").remove(),Pe._paper=Pe._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Pe._toppaper=Pe._paperdiv.append("svg").classed("main-svg",!0),Pe._modebardiv=Pe._paperdiv.append("div"),delete Pe._modeBar,Pe._hoverpaper=Pe._paperdiv.append("svg").classed("main-svg",!0),!Pe._uid){var He={};Y.selectAll("defs").each(function(){this.id&&(He[this.id.split("-")[1]]=1)}),Pe._uid=z.randstr(He)}Pe._paperdiv.selectAll(".main-svg").attr(_.svgAttrs),Pe._defs=Pe._paper.append("defs").attr("id","defs-"+Pe._uid),Pe._clips=Pe._defs.append("g").classed("clips",!0),Pe._topdefs=Pe._toppaper.append("defs").attr("id","topdefs-"+Pe._uid),Pe._topclips=Pe._topdefs.append("g").classed("clips",!0),Pe._bgLayer=Pe._paper.append("g").classed("bglayer",!0),Pe._draggers=Pe._paper.append("g").classed("draglayer",!0);var at=Pe._paper.append("g").classed("layer-below",!0);Pe._imageLowerLayer=at.append("g").classed("imagelayer",!0),Pe._shapeLowerLayer=at.append("g").classed("shapelayer",!0),Pe._cartesianlayer=Pe._paper.append("g").classed("cartesianlayer",!0),Pe._polarlayer=Pe._paper.append("g").classed("polarlayer",!0),Pe._smithlayer=Pe._paper.append("g").classed("smithlayer",!0),Pe._ternarylayer=Pe._paper.append("g").classed("ternarylayer",!0),Pe._geolayer=Pe._paper.append("g").classed("geolayer",!0),Pe._funnelarealayer=Pe._paper.append("g").classed("funnelarealayer",!0),Pe._pielayer=Pe._paper.append("g").classed("pielayer",!0),Pe._iciclelayer=Pe._paper.append("g").classed("iciclelayer",!0),Pe._treemaplayer=Pe._paper.append("g").classed("treemaplayer",!0),Pe._sunburstlayer=Pe._paper.append("g").classed("sunburstlayer",!0),Pe._indicatorlayer=Pe._toppaper.append("g").classed("indicatorlayer",!0),Pe._glimages=Pe._paper.append("g").classed("glimages",!0);var ht=Pe._toppaper.append("g").classed("layer-above",!0);Pe._imageUpperLayer=ht.append("g").classed("imagelayer",!0),Pe._shapeUpperLayer=ht.append("g").classed("shapelayer",!0),Pe._selectionLayer=Pe._toppaper.append("g").classed("selectionlayer",!0),Pe._infolayer=Pe._toppaper.append("g").classed("infolayer",!0),Pe._menulayer=Pe._toppaper.append("g").classed("menulayer",!0),Pe._zoomlayer=Pe._toppaper.append("g").classed("zoomlayer",!0),Pe._hoverlayer=Pe._hoverpaper.append("g").classed("hoverlayer",!0),Pe._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),De.emit("plotly_framework")}te.animate=Lr,te.addFrames=ci,te.deleteFrames=vi,te.addTraces=ge,te.deleteTraces=ne,te.extendTraces=ce,te.moveTraces=se,te.prependTraces=re,te.newPlot=W,te._doPlot=g,te.purge=Ot,te.react=vr,te.redraw=V,te.relayout=Re,te.restyle=_e,te.setPlotConfig=T,te.update=ct,te._guiRelayout=Ae(Re),te._guiRestyle=Ae(_e),te._guiUpdate=Ae(ct),te._storeDirectGUIEdit=fe}),Y0=ze(te=>{var Y=as();te.getDelay=function(z){return z._has&&(z._has("gl3d")||z._has("mapbox")||z._has("map"))?500:0},te.getRedrawFunc=function(z){return function(){Y.getComponentMethod("colorbar","draw")(z)}},te.encodeSVG=function(z){return"data:image/svg+xml,"+encodeURIComponent(z)},te.encodeJSON=function(z){return"data:application/json,"+encodeURIComponent(z)};var d=window.URL||window.webkitURL;te.createObjectURL=function(z){return d.createObjectURL(z)},te.revokeObjectURL=function(z){return d.revokeObjectURL(z)},te.createBlob=function(z,P){if(P==="svg")return new window.Blob([z],{type:"image/svg+xml;charset=utf-8"});if(P==="full-json")return new window.Blob([z],{type:"application/json;charset=utf-8"});var i=y(window.atob(z));return new window.Blob([i],{type:"image/"+P})},te.octetStream=function(z){document.location.href="data:application/octet-stream"+z};function y(z){for(var P=z.length,i=new ArrayBuffer(P),n=new Uint8Array(i),a=0;a{var d=ri();ji();var y=Zs(),z=Xi();k0();var P=/"/g,i="TOBESTRIPPED",n=new RegExp('("'+i+")|("+i+'")',"g");function a(o){var u=d.select("body").append("div").style({display:"none"}).html(""),s=o.replace(/(&[^;]*;)/gi,function(h){return h==="<"?"<":h==="&rt;"?">":h.indexOf("<")!==-1||h.indexOf(">")!==-1?"":u.html(h).text()});return u.remove(),s}function l(o){return o.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}Y.exports=function(o,u,s){var h=o._fullLayout,m=h._paper,b=h._toppaper,x=h.width,_=h.height,A;m.insert("rect",":first-child").call(y.setRect,0,0,x,_).call(z.fill,h.paper_bgcolor);var f=h._basePlotModules||[];for(A=0;A{var d=ji(),y=qg().EventEmitter,z=Y0();function P(i){var n=i.emitter||new y,a=new Promise(function(l,o){var u=window.Image,s=i.svg,h=i.format||"png",m=i.canvas,b=i.scale||1,x=i.width||300,_=i.height||150,A=b*x,f=b*_,k=m.getContext("2d",{willReadFrequently:!0}),w=new u,D,E;h==="svg"||d.isSafari()?E=z.encodeSVG(s):(D=z.createBlob(s,"svg"),E=z.createObjectURL(D)),m.width=A,m.height=f,w.onload=function(){var I;switch(D=null,z.revokeObjectURL(E),h!=="svg"&&k.drawImage(w,0,0,A,f),h){case"jpeg":I=m.toDataURL("image/jpeg");break;case"png":I=m.toDataURL("image/png");break;case"webp":I=m.toDataURL("image/webp");break;case"svg":I=E;break;default:var M="Image format is not jpeg, png, svg or webp.";if(o(new Error(M)),!i.promise)return n.emit("error",M)}l(I),i.promise||n.emit("success",I)},w.onerror=function(I){if(D=null,z.revokeObjectURL(E),o(I),!i.promise)return n.emit("error",I)},w.src=E});return i.promise?a:n}Y.exports=P}),O4=ze((te,Y)=>{var d=Sr(),y=Tw(),z=sh(),P=ji(),i=Y0(),n=cb(),a=hb(),l=Si().version,o={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function u(s,h){h=h||{};var m,b,x,_;P.isPlainObject(s)?(m=s.data||[],b=s.layout||{},x=s.config||{},_={}):(s=P.getGraphDiv(s),m=P.extendDeep([],s.data),b=P.extendDeep({},s.layout),x=s._context,_=s._fullLayout||{});function A(W){return!(W in h)||P.validate(h[W],o[W])}if(!A("width")&&h.width!==null||!A("height")&&h.height!==null)throw new Error("Height and width should be pixel values.");if(!A("format"))throw new Error("Export format is not "+P.join2(o.format.values,", "," or ")+".");var f={};function k(W,F){return P.coerce(h,f,o,W,F)}var w=k("format"),D=k("width"),E=k("height"),I=k("scale"),M=k("setBackground"),p=k("imageDataOnly"),g=document.createElement("div");g.style.position="absolute",g.style.left="-5000px",document.body.appendChild(g);var C=P.extendFlat({},b);D?C.width=D:h.width===null&&d(_.width)&&(C.width=_.width),E?C.height=E:h.height===null&&d(_.height)&&(C.height=_.height);var T=P.extendFlat({},x,{_exportedPlot:!0,staticPlot:!0,setBackground:M}),N=i.getRedrawFunc(g);function B(){return new Promise(function(W){setTimeout(W,i.getDelay(g._fullLayout))})}function U(){return new Promise(function(W,F){var H=n(g,w,I),q=g._fullLayout.width,G=g._fullLayout.height;function ee(){y.purge(g),document.body.removeChild(g)}if(w==="full-json"){var he=z.graphJson(g,!1,"keepdata","object",!0,!0);return he.version=l,he=JSON.stringify(he),ee(),W(p?he:i.encodeJSON(he))}if(ee(),w==="svg")return W(p?H:i.encodeSVG(H));var be=document.createElement("canvas");be.id=P.randstr(),a({format:w,width:q,height:G,scale:I,canvas:be,svg:H,promise:!0}).then(W).catch(F)})}function V(W){return p?W.replace(i.IMAGE_URL_PREFIX,""):W}return new Promise(function(W,F){y.newPlot(g,m,C,T).then(N).then(B).then(U).then(function(H){W(V(H))}).catch(function(H){F(H)})})}Y.exports=u}),Eg=ze((te,Y)=>{var d=ji(),y=sh(),z=Zg(),P=ss().dfltConfig,i=d.isPlainObject,n=Array.isArray,a=d.isArrayOrTypedArray;Y.exports=function(f,k){f===void 0&&(f=[]),k===void 0&&(k={});var w=z.get(),D=[],E={_context:d.extendFlat({},P)},I,M;n(f)?(E.data=d.extendDeep([],f),I=f):(E.data=[],I=[],D.push(h("array","data"))),i(k)?(E.layout=d.extendDeep({},k),M=k):(E.layout={},M={},arguments.length>1&&D.push(h("object","layout"))),y.supplyDefaults(E);for(var p=E._fullData,g=I.length,C=0;CN.length&&D.push(h("unused",E,C.concat(N.length)));var H=N.length,q=Array.isArray(F);q&&(H=Math.min(H,F.length));var G,ee,he,be,ve;if(B.dimensions===2)for(ee=0;eeN[ee].length&&D.push(h("unused",E,C.concat(ee,N[ee].length)));var ce=N[ee].length;for(G=0;G<(q?Math.min(ce,F[ee].length):ce);G++)he=q?F[ee][G]:F,be=T[ee][G],ve=N[ee][G],d.validate(be,he)?ve!==be&&ve!==+be&&D.push(h("dynamic",E,C.concat(ee,G),be,ve)):D.push(h("value",E,C.concat(ee,G),be))}else D.push(h("array",E,C.concat(ee),T[ee]));else for(ee=0;ee{var d=ji(),y=Y0();function z(P,i,n){var a=document.createElement("a"),l="download"in a,o=new Promise(function(u,s){var h,m;if(l)return h=y.createBlob(P,n),m=y.createObjectURL(h),a.href=m,a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a),y.revokeObjectURL(m),h=null,u(i);if(d.isSafari()){var b=n==="svg"?",":";base64,";return y.octetStream(b+encodeURIComponent(P)),u(i)}s(new Error("download error"))});return o}Y.exports=z}),Sw=ze((te,Y)=>{var d=ji(),y=O4(),z=B4();Y0();function P(i,n){var a;return d.isPlainObject(i)||(a=d.getGraphDiv(i)),n=n||{},n.format=n.format||"png",n.width=n.width||null,n.height=n.height||null,n.imageDataOnly=!0,new Promise(function(l,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var u=y(i,n),s=n.filename||i.fn||"newplot";s+="."+n.format.replace("-","."),u.then(function(h){return a&&(a._snapshotInProgress=!1),z(h,s,n.format)}).then(function(h){l(h)}).catch(function(h){a&&(a._snapshotInProgress=!1),o(h)})})}Y.exports=P}),I_=ze(te=>{var Y=ji(),d=Y.isPlainObject,y=Zg(),z=sh(),P=xa(),i=ku(),n=ss().dfltConfig;te.makeTemplate=function(x){x=Y.isPlainObject(x)?x:Y.getGraphDiv(x),x=Y.extendDeep({_context:n},{data:x.data,layout:x.layout}),z.supplyDefaults(x);var _=x.data||[],A=x.layout||{};A._basePlotModules=x._fullLayout._basePlotModules,A._modules=x._fullLayout._modules;var f={data:{},layout:{}};_.forEach(function(T){var N={};o(T,N,s.bind(null,T));var B=Y.coerce(T,{},P,"type"),U=f.data[B];U||(U=f.data[B]=[]),U.push(N)}),o(A,f.layout,u.bind(null,A)),delete f.layout.template;var k=A.template;if(d(k)){var w=k.layout,D,E,I,M,p,g;d(w)&&a(w,f.layout);var C=k.data;if(d(C)){for(E in f.data)if(I=C[E],Array.isArray(I)){for(p=f.data[E],g=p.length,M=I.length,D=0;DV?D.push({code:"unused",traceType:T,templateCount:U,dataCount:V}):V>U&&D.push({code:"reused",traceType:T,templateCount:U,dataCount:V})}}function W(F,H){for(var q in F)if(q.charAt(0)!=="_"){var G=F[q],ee=h(F,q,H);d(G)?(Array.isArray(F)&&G._template===!1&&G.templateitemname&&D.push({code:"missing",path:ee,templateitemname:G.templateitemname}),W(G,ee)):Array.isArray(G)&&m(G)&&W(G,ee)}}if(W({data:I,layout:E},""),D.length)return D.map(b)};function m(x){for(var _=0;_{var Y=Tw();te._doPlot=Y._doPlot,te.newPlot=Y.newPlot,te.restyle=Y.restyle,te.relayout=Y.relayout,te.redraw=Y.redraw,te.update=Y.update,te._guiRestyle=Y._guiRestyle,te._guiRelayout=Y._guiRelayout,te._guiUpdate=Y._guiUpdate,te._storeDirectGUIEdit=Y._storeDirectGUIEdit,te.react=Y.react,te.extendTraces=Y.extendTraces,te.prependTraces=Y.prependTraces,te.addTraces=Y.addTraces,te.deleteTraces=Y.deleteTraces,te.moveTraces=Y.moveTraces,te.purge=Y.purge,te.addFrames=Y.addFrames,te.deleteFrames=Y.deleteFrames,te.animate=Y.animate,te.setPlotConfig=Y.setPlotConfig;var d=q0().getGraphDiv,y=vw().eraseActiveShape;te.deleteActiveShape=function(P){return y(d(P))},te.toImage=O4(),te.validate=Eg(),te.downloadImage=Sw();var z=I_();te.makeTemplate=z.makeTemplate,te.validateTemplate=z.validateTemplate}),Jg=ze((te,Y)=>{var d=ji(),y=as();Y.exports=function(z,P,i,n){var a=n("x"),l=n("y"),o,u=y.getComponentMethod("calendars","handleTraceDefaults");if(u(z,P,["x","y"],i),a){var s=d.minRowLength(a);l?o=Math.min(s,d.minRowLength(l)):(o=s,n("y0"),n("dy"))}else{if(!l)return 0;o=d.minRowLength(l),n("x0"),n("dx")}return P._length=o,o}}),S0=ze((te,Y)=>{var d=ji().dateTick0,y=ei(),z=y.ONEWEEK;function P(i,n){return i%z===0?d(n,1):d(n,0)}Y.exports=function(i,n,a,l,o){if(o||(o={x:!0,y:!0}),o.x){var u=l("xperiod");u&&(l("xperiod0",P(u,n.xcalendar)),l("xperiodalignment"))}if(o.y){var s=l("yperiod");s&&(l("yperiod0",P(s,n.ycalendar)),l("yperiodalignment"))}}}),R4=ze((te,Y)=>{var d=["orientation","groupnorm","stackgaps"];Y.exports=function(y,z,P,i){var n=P._scatterStackOpts,a=i("stackgroup");if(a){var l=z.xaxis+z.yaxis,o=n[l];o||(o=n[l]={});var u=o[a],s=!1;u?u.traces.push(z):(u=o[a]={traceIndices:[],traces:[z]},s=!0);for(var h={orientation:z.x&&!z.y?"h":"v"},m=0;m{var d=Xi(),y=hp().hasColorscale,z=Cc(),P=Bc();Y.exports=function(i,n,a,l,o,u){var s=P.isBubble(i),h=(i.line||{}).color,m;if(u=u||{},h&&(a=h),o("marker.symbol"),o("marker.opacity",s?.7:1),o("marker.size"),u.noAngle||(o("marker.angle"),u.noAngleRef||o("marker.angleref"),u.noStandOff||o("marker.standoff")),o("marker.color",a),y(i,"marker")&&z(i,n,l,o,{prefix:"marker.",cLetter:"c"}),u.noSelect||(o("selected.marker.color"),o("unselected.marker.color"),o("selected.marker.size"),o("unselected.marker.size")),u.noLine||(h&&!Array.isArray(h)&&n.marker.color!==h?m=h:s?m=d.background:m=d.defaultLine,o("marker.line.color",m),y(i,"marker.line")&&z(i,n,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width",s?1:0)),s&&(o("marker.sizeref"),o("marker.sizemin"),o("marker.sizemode")),u.gradient){var b=o("marker.gradient.type");b!=="none"&&o("marker.gradient.color")}}}),Pm=ze((te,Y)=>{var d=ji().isArrayOrTypedArray,y=hp().hasColorscale,z=Cc();Y.exports=function(P,i,n,a,l,o){o||(o={});var u=(P.marker||{}).color;if(u&&u._inputArray&&(u=u._inputArray),l("line.color",n),y(P,"line"))z(P,i,a,l,{prefix:"line.",cLetter:"c"});else{var s=(d(u)?!1:u)||n;l("line.color",s)}l("line.width"),o.noDash||l("line.dash"),o.backoff&&l("line.backoff")}}),ny=ze((te,Y)=>{Y.exports=function(d,y,z){var P=z("line.shape");P==="spline"&&z("line.smoothing")}}),mm=ze((te,Y)=>{var d=ji();Y.exports=function(y,z,P,i,n){n=n||{},i("textposition"),d.coerceFont(i,"textfont",n.font||P.font,n),n.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}),Im=ze((te,Y)=>{var d=Xi(),y=ji().isArrayOrTypedArray;function z(P){for(var i=d.interpolate(P[0][1],P[1][1],.5),n=2;n{var d=ji(),y=as(),z=ff(),P=Mg(),i=Bc(),n=Jg(),a=S0(),l=R4(),o=X0(),u=Pm(),s=ny(),h=mm(),m=Im(),b=ji().coercePattern;Y.exports=function(x,_,A,f){function k(C,T){return d.coerce(x,_,z,C,T)}var w=n(x,_,f,k);if(w||(_.visible=!1),!!_.visible){a(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("zorder");var D=l(x,_,f,k);f.scattermode==="group"&&_.orientation===void 0&&k("orientation","v");var E=!D&&w{var d=ry().getAxisGroup;Y.exports=function(y,z,P,i,n){var a=z.orientation,l=z[{v:"x",h:"y"}[a]+"axis"],o=d(P,l)+a,u=P._alignmentOpts||{},s=i("alignmentgroup"),h=u[o];h||(h=u[o]={});var m=h[s];m?m.traces.push(z):m=h[s]={traces:[z],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var b=i("offsetgroup")||"",x=m.offsetGroups,_=x[b];z._offsetIndex=0,(n!=="group"||b)&&(_||(_=x[b]={offsetIndex:Object.keys(x).length}),z._offsetIndex=_.offsetIndex)}}),N4=ze((te,Y)=>{var d=ji(),y=Yv(),z=ff();Y.exports=function(P,i){var n,a,l,o=i.scattermode;function u(x){return d.coerce(a._input,a,z,x)}if(i.scattermode==="group")for(l=0;l=0;m--){var b=P[m];if(b.type==="scatter"&&b.xaxis===s.xaxis&&b.yaxis===s.yaxis){b.opacity=void 0;break}}}}}}),j4=ze((te,Y)=>{var d=ji(),y=Fv();Y.exports=function(z,P){function i(a,l){return d.coerce(z,P,y,a,l)}var n=P.barmode==="group";P.scattermode==="group"&&i("scattergap",n?P.bargap:.2)}}),Dm=ze((te,Y)=>{var d=Sr(),y=ji(),z=y.dateTime2ms,P=y.incrementMonth,i=ei(),n=i.ONEAVGMONTH;Y.exports=function(a,l,o,u){if(l.type!=="date")return{vals:u};var s=a[o+"periodalignment"];if(!s)return{vals:u};var h=a[o+"period"],m;if(d(h)){if(h=+h,h<=0)return{vals:u}}else if(typeof h=="string"&&h.charAt(0)==="M"){var b=+h.substring(1);if(b>0&&Math.round(b)===b)m=b;else return{vals:u}}for(var x=l.calendar,_=s==="start",A=s==="end",f=a[o+"period0"],k=z(f,x)||0,w=[],D=[],E=[],I=u.length,M=0;Mp;)T=P(T,-m,x);for(;T<=p;)T=P(T,m,x);C=P(T,-m,x)}else{for(g=Math.round((p-k)/h),T=k+g*h;T>p;)T-=h;for(;T<=p;)T+=h;C=T-h}w[M]=_?C:A?T:(C+T)/2,D[M]=C,E[M]=T}return{vals:w,starts:D,ends:E}}}),zm=ze((te,Y)=>{var d=hp().hasColorscale,y=Tp(),z=Bc();Y.exports=function(P,i){z.hasLines(i)&&d(i,"line")&&y(P,i,{vals:i.line.color,containerStr:"line",cLetter:"c"}),z.hasMarkers(i)&&(d(i,"marker")&&y(P,i,{vals:i.marker.color,containerStr:"marker",cLetter:"c"}),d(i,"marker.line")&&y(P,i,{vals:i.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}),de=ze((te,Y)=>{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=ji();Y.exports=function(y,z){d.isArrayOrTypedArray(z.selectedpoints)&&d.tagSelected(y,z)}}),yt=ze((te,Y)=>{var d=Sr(),y=ji(),z=Os(),P=Dm(),i=ei().BADNUM,n=Bc(),a=zm(),l=de(),o=$e();function u(_,A){var f=_._fullLayout,k=A._xA=z.getFromId(_,A.xaxis||"x","x"),w=A._yA=z.getFromId(_,A.yaxis||"y","y"),D=k.makeCalcdata(A,"x"),E=w.makeCalcdata(A,"y"),I=P(A,k,"x",D),M=P(A,w,"y",E),p=I.vals,g=M.vals,C=A._length,T=new Array(C),N=A.ids,B=x(A,f,k,w),U=!1,V,W,F,H,q,G;m(f,A);var ee="x",he="y",be;if(B)y.pushUnique(B.traceIndices,A.index),V=B.orientation==="v",V?(he="s",be="x"):(ee="s",be="y"),q=B.stackgaps==="interpolate";else{var ve=h(A,C);s(_,A,k,w,p,g,ve)}var ce=!!A.xperiodalignment,re=!!A.yperiodalignment;for(W=0;WW&&T[H].gap;)H--;for(G=T[H].s,F=T.length-1;F>H;F--)T[F].s=G;for(;W{Y.exports=y;var d=ji().distinctVals;function y(z,P){this.traces=z,this.sepNegVal=P.sepNegVal,this.overlapNoMerge=P.overlapNoMerge;for(var i=1/0,n=P.posAxis._id.charAt(0),a=[],l=0;l{var d=Sr(),y=ji().isArrayOrTypedArray,z=ei().BADNUM,P=as(),i=Os(),n=ry().getAxisGroup,a=nr();function l(T,N){for(var B=N.xaxis,U=N.yaxis,V=T._fullLayout,W=T._fullData,F=T.calcdata,H=[],q=[],G=0;Gq+F||!d(H))}for(var ee=0;ee{var d=yt(),y=Ur().setGroupPositions;function z(n,a){for(var l=a.xaxis,o=a.yaxis,u=n._fullLayout,s=n._fullData,h=n.calcdata,m=[],b=[],x=0;xB[x]&&x{var d=Zs(),y=ei(),z=y.BADNUM,P=y.LOG_CLIP,i=P+.5,n=P-.5,a=ji(),l=a.segmentsIntersect,o=a.constrain,u=Mg();Y.exports=function(s,h){var m=h.trace||{},b=h.xaxis,x=h.yaxis,_=b.type==="log",A=x.type==="log",f=b._length,k=x._length,w=h.backoff,D=m.marker,E=h.connectGaps,I=h.baseTolerance,M=h.shape,p=M==="linear",g=m.fill&&m.fill!=="none",C=[],T=u.minTolerance,N=s.length,B=new Array(N),U=0,V,W,F,H,q,G,ee,he,be,ve,ce,re,ge,ne,se,_e;function oe(At){var Wt=s[At];if(!Wt)return!1;var Yt=h.linearized?b.l2p(Wt.x):b.c2p(Wt.x),hr=h.linearized?x.l2p(Wt.y):x.c2p(Wt.y);if(Yt===z){if(_&&(Yt=b.c2p(Wt.x,!0)),Yt===z)return!1;A&&hr===z&&(Yt*=Math.abs(b._m*k*(b._m>0?i:n)/(x._m*f*(x._m>0?i:n)))),Yt*=1e3}if(hr===z){if(A&&(hr=x.c2p(Wt.y,!0)),hr===z)return!1;hr*=1e3}return[Yt,hr]}function J(At,Wt,Yt,hr){var zr=Yt-At,Dr=hr-Wt,br=.5-At,fi=.5-Wt,un=zr*zr+Dr*Dr,cn=zr*br+Dr*fi;if(cn>0&&cn1||Math.abs(br.y-Yt[0][1])>1)&&(br=[br.x,br.y],hr&&Re(br,At)Ge||At[1]_t)return[o(At[0],Ze,Ge),o(At[1],tt,_t)]}function Et(At,Wt){if(At[0]===Wt[0]&&(At[0]===Ze||At[0]===Ge)||At[1]===Wt[1]&&(At[1]===tt||At[1]===_t))return!0}function Gt(At,Wt){var Yt=[],hr=ut(At),zr=ut(Wt);return hr&&zr&&Et(hr,zr)||(hr&&Yt.push(hr),zr&&Yt.push(zr)),Yt}function Qt(At,Wt,Yt){return function(hr,zr){var Dr=ut(hr),br=ut(zr),fi=[];if(Dr&&br&&Et(Dr,br))return fi;Dr&&fi.push(Dr),br&&fi.push(br);var un=2*a.constrain((hr[At]+zr[At])/2,Wt,Yt)-((Dr||hr)[At]+(br||zr)[At]);if(un){var cn;Dr&&br?cn=un>0==Dr[At]>br[At]?Dr:br:cn=Dr||br,cn[At]+=un}return fi}}var vr;M==="linear"||M==="spline"?vr=xt:M==="hv"||M==="vh"?vr=Gt:M==="hvh"?vr=Qt(0,Ze,Ge):M==="vhv"&&(vr=Qt(1,tt,_t));function mr(At,Wt){var Yt=Wt[0]-At[0],hr=(Wt[1]-At[1])/Yt,zr=(At[1]*Wt[0]-Wt[1]*At[0])/Yt;return zr>0?[hr>0?Ze:Ge,_t]:[hr>0?Ge:Ze,tt]}function Yr(At){var Wt=At[0],Yt=At[1],hr=Wt===B[U-1][0],zr=Yt===B[U-1][1];if(!(hr&&zr))if(U>1){var Dr=Wt===B[U-2][0],br=Yt===B[U-2][1];hr&&(Wt===Ze||Wt===Ge)&&Dr?br?U--:B[U-1]=At:zr&&(Yt===tt||Yt===_t)&&br?Dr?U--:B[U-1]=At:B[U++]=At}else B[U++]=At}function ii(At){B[U-1][0]!==At[0]&&B[U-1][1]!==At[1]&&Yr([Ae,Oe]),Yr(At),Le=null,Ae=Oe=0}var Lr=a.isArrayOrTypedArray(D);function ci(At){if(At&&w&&(At.i=V,At.d=s,At.trace=m,At.marker=Lr?D[At.i]:D,At.backoff=w),me=At[0]/f,fe=At[1]/k,vt=At[0]Ge?Ge:0,ct=At[1]_t?_t:0,vt||ct){if(!U)B[U++]=[vt||At[0],ct||At[1]];else if(Le){var Wt=vr(Le,At);Wt.length>1&&(ii(Wt[0]),B[U++]=Wt[1])}else nt=vr(B[U-1],At)[0],B[U++]=nt;var Yt=B[U-1];vt&&ct&&(Yt[0]!==vt||Yt[1]!==ct)?(Le&&(Ae!==vt&&Oe!==ct?Yr(Ae&&Oe?mr(Le,At):[Ae||vt,Oe||ct]):Ae&&Oe&&Yr([Ae,Oe])),Yr([vt,ct])):Ae-vt&&Oe-ct&&Yr([vt||Ae,ct||Oe]),Le=At,Ae=vt,Oe=ct}else Le&&ii(vr(Le,At)[0]),B[U++]=At}for(V=0;VCe(G,vi))break;F=G,ge=be[0]*he[0]+be[1]*he[1],ge>ce?(ce=ge,H=G,ee=!1):ge=s.length||!G)break;ci(G),W=G}}Le&&Yr([Ae||Le[0],Oe||Le[1]]),C.push(B.slice(0,U))}var Ot=M.slice(M.length-1);if(w&&Ot!=="h"&&Ot!=="v"){for(var Xe=!1,ot=-1,De=[],ye=0;ye{var d={tonextx:1,tonexty:1,tonext:1};Y.exports=function(y,z,P){var i,n,a,l,o,u={},s=!1,h=-1,m=0,b=-1;for(n=0;n=0?o=b:(o=b=m,m++),o{var d=ri(),y=as(),z=ji(),P=z.ensureSingle,i=z.identity,n=Zs(),a=Bc(),l=ra(),o=Ja(),u=Cg().tester;Y.exports=function(b,x,_,A,f,k){var w,D,E=!f,I=!!f&&f.duration>0,M=o(b,x,_);if(w=A.selectAll("g.trace").data(M,function(g){return g[0].trace.uid}),w.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),w.order(),s(b,w,x),I){k&&(D=k());var p=d.transition().duration(f.duration).ease(f.easing).each("end",function(){D&&D()}).each("interrupt",function(){D&&D()});p.each(function(){A.selectAll("g.trace").each(function(g,C){h(b,C,x,g,M,this,f)})})}else w.each(function(g,C){h(b,C,x,g,M,this,f)});E&&w.exit().remove(),A.selectAll("path:not([d])").remove()};function s(b,x,_){x.each(function(A){var f=P(d.select(this),"g","fills");n.setClipUrl(f,_.layerClipId,b);var k=A[0].trace,w=[];k._ownfill&&w.push("_ownFill"),k._nexttrace&&w.push("_nextFill");var D=f.selectAll("g").data(w,i);D.enter().append("g"),D.exit().each(function(E){k[E]=null}).remove(),D.order().each(function(E){k[E]=P(d.select(this),"path","js-fill")})})}function h(b,x,_,A,f,k,w){var D=b._context.staticPlot,E;m(b,x,_,A,f);var I=!!w&&w.duration>0;function M(ii){return I?ii.transition():ii}var p=_.xaxis,g=_.yaxis,C=A[0].trace,T=C.line,N=d.select(k),B=P(N,"g","errorbars"),U=P(N,"g","lines"),V=P(N,"g","points"),W=P(N,"g","text");if(y.getComponentMethod("errorbars","plot")(b,B,_,w),C.visible!==!0)return;M(N).style("opacity",C.opacity);var F,H,q=C.fill.charAt(C.fill.length-1);q!=="x"&&q!=="y"&&(q="");var G,ee;q==="y"?(G=1,ee=g.c2p(0,!0)):q==="x"&&(G=0,ee=p.c2p(0,!0)),A[0][_.isRangePlot?"nodeRangePlot3":"node3"]=N;var he="",be=[],ve=C._prevtrace,ce=null,re=null;ve&&(he=ve._prevRevpath||"",H=ve._nextFill,be=ve._ownPolygons,ce=ve._fillsegments,re=ve._fillElement);var ge,ne,se="",_e="",oe,J,me,fe,Ce,Re,Be=[];C._polygons=[];var Ze=[],Ge=[],tt=z.noop;if(F=C._ownFill,a.hasLines(C)||C.fill!=="none"){H&&H.datum(A),["hv","vh","hvh","vhv"].indexOf(T.shape)!==-1?(oe=n.steps(T.shape),J=n.steps(T.shape.split("").reverse().join(""))):T.shape==="spline"?oe=J=function(ii){var Lr=ii[ii.length-1];return ii.length>1&&ii[0][0]===Lr[0]&&ii[0][1]===Lr[1]?n.smoothclosed(ii.slice(1),T.smoothing):n.smoothopen(ii,T.smoothing)}:oe=J=function(ii){return"M"+ii.join("L")},me=function(ii){return J(ii.reverse())},Ge=l(A,{xaxis:p,yaxis:g,trace:C,connectGaps:C.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,backoff:T.backoff,simplify:T.simplify,fill:C.fill}),Ze=new Array(Ge.length);var _t=0;for(E=0;E=D[0]&&N.x<=D[1]&&N.y>=E[0]&&N.y<=E[1]}),g=Math.ceil(p.length/M),C=0;f.forEach(function(N,B){var U=N[0].trace;a.hasMarkers(U)&&U.marker.maxdisplayed>0&&B{Y.exports={container:"marker",min:"cmin",max:"cmax"}}),Ys=ze((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n={_fullLayout:P},a=d.getFromTrace(n,z,"x"),l=d.getFromTrace(n,z,"y"),o=y.orig_x;o===void 0&&(o=y.x);var u=y.orig_y;return u===void 0&&(u=y.y),i.xLabel=d.tickText(a,a.c2l(o),!0).text,i.yLabel=d.tickText(l,l.c2l(u),!0).text,i}}),El=ze((te,Y)=>{var d=ri(),y=Zs(),z=as();function P(l){var o=d.select(l).selectAll("g.trace.scatter");o.style("opacity",function(u){return u[0].trace.opacity}),o.selectAll("g.points").each(function(u){var s=d.select(this),h=u.trace||u[0].trace;i(s,h,l)}),o.selectAll("g.text").each(function(u){var s=d.select(this),h=u.trace||u[0].trace;n(s,h,l)}),o.selectAll("g.trace path.js-line").call(y.lineGroupStyle),o.selectAll("g.trace path.js-fill").call(y.fillGroupStyle,l,!1),z.getComponentMethod("errorbars","style")(o)}function i(l,o,u){y.pointStyle(l.selectAll("path.point"),o,u)}function n(l,o,u){y.textPointStyle(l.selectAll("text"),o,u)}function a(l,o,u){var s=o[0].trace;s.selectedpoints?(y.selectedPointStyle(u.selectAll("path.point"),s),y.selectedTextStyle(u.selectAll("text"),s)):(i(u,s,l),n(u,s,l))}Y.exports={style:P,stylePoints:i,styleText:n,styleOnSelect:a}}),qu=ze((te,Y)=>{var d=Xi(),y=Bc();Y.exports=function(z,P){var i,n;if(z.mode==="lines")return i=z.line.color,i&&d.opacity(i)?i:z.fillcolor;if(z.mode==="none")return z.fill?z.fillcolor:"";var a=P.mcc||(z.marker||{}).color,l=P.mlcc||((z.marker||{}).line||{}).color;return n=a&&d.opacity(a)?a:l&&d.opacity(l)&&(P.mlw||((z.marker||{}).line||{}).width)?l:"",n?d.opacity(n)<.3?d.addOpacity(n,.3):n:(i=(z.line||{}).color,i&&d.opacity(i)&&y.hasLines(z)&&z.line.width?i:z.fillcolor)}}),Kd=ze((te,Y)=>{var d=ji(),y=hf(),z=as(),P=qu(),i=Xi(),n=d.fillText;Y.exports=function(a,l,o,u){var s=a.cd,h=s[0].trace,m=a.xa,b=a.ya,x=m.c2p(l),_=b.c2p(o),A=[x,_],f=h.hoveron||"",k=h.mode.indexOf("markers")!==-1?3:.5,w=!!h.xperiodalignment,D=!!h.yperiodalignment;if(f.indexOf("points")!==-1){var E=function(he){if(w){var be=m.c2p(he.xStart),ve=m.c2p(he.xEnd);return x>=Math.min(be,ve)&&x<=Math.max(be,ve)?0:1/0}var ce=Math.max(3,he.mrc||0),re=1-1/ce,ge=Math.abs(m.c2p(he.x)-x);return ge=Math.min(be,ve)&&_<=Math.max(be,ve)?0:1/0}var ce=Math.max(3,he.mrc||0),re=1-1/ce,ge=Math.abs(b.c2p(he.y)-_);return gese!=Be>=se&&(fe=J[oe-1][0],Ce=J[oe][0],Be-Re&&(me=fe+(Ce-fe)*(se-Re)/(Be-Re),ce=Math.min(ce,me),re=Math.max(re,me)));return ce=Math.max(ce,0),re=Math.min(re,m._length),{x0:ce,x1:re,y0:se,y1:se}}if(f.indexOf("fills")!==-1&&h._fillElement){var q=F(h._fillElement)&&!F(h._fillExclusionElement);if(q){var G=H(h._polygons);G===null&&(G={x0:A[0],x1:A[0],y0:A[1],y1:A[1]});var ee=i.defaultLine;return i.opacity(h.fillcolor)?ee=h.fillcolor:i.opacity((h.line||{}).color)&&(ee=h.line.color),d.extendFlat(a,{distance:a.maxHoverDistance,x0:G.x0,x1:G.x1,y0:G.y0,y1:G.y1,color:ee,hovertemplate:!1}),delete a.index,h.text&&!d.isArrayOrTypedArray(h.text)?a.text=String(h.text):a.text=h.name,[a]}}}}),ed=ze((te,Y)=>{var d=Bc();Y.exports=function(y,z){var P=y.cd,i=y.xaxis,n=y.yaxis,a=[],l=P[0].trace,o,u,s,h,m=!d.hasMarkers(l)&&!d.hasText(l);if(m)return[];if(z===!1)for(o=0;o{Y.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}),l0=ze((te,Y)=>{var d=as().traceIs,y=J1();Y.exports=function(a,l,o,u){o("autotypenumbers",u.autotypenumbersDflt);var s=o("type",(u.splomStash||{}).type);s==="-"&&(z(l,u.data),l.type==="-"?l.type="linear":a.type=l.type)};function z(a,l){if(a.type==="-"){var o=a._id,u=o.charAt(0),s;o.indexOf("scene")!==-1&&(o=u);var h=P(l,o,u);if(h){if(h.type==="histogram"&&u==={v:"y",h:"x"}[h.orientation||"v"]){a.type="linear";return}var m=u+"calendar",b=h[m],x={noMultiCategory:!d(h,"cartesian")||d(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&u==={h:"x",v:"y"}[h.orientation||"v"]&&(x.noMultiCategory=!0),x.autotypenumbers=a.autotypenumbers,n(h,u)){var _=i(h),A=[];for(s=0;s0&&(s["_"+o+"axes"]||{})[l]||(s[o+"axis"]||o)===l&&(n(s,o)||(s[o]||[]).length||s[o+"0"]))return s}}function i(a){return{v:"x",h:"y"}[a.orientation||"v"]}function n(a,l){var o=i(a),u=d(a,"box-violin"),s=d(a._fullInput||{},"candlestick");return u&&!s&&l===o&&a[o]===void 0&&a[o+"0"]===void 0}}),Qg=ze((te,Y)=>{var d=Di().isTypedArraySpec;function y(z,P){var i=P.dataAttr||z._id.charAt(0),n={},a,l,o;if(P.axData)a=P.axData;else for(a=[],l=0;l0||d(a),o;l&&(o="array");var u=i("categoryorder",o),s;u==="array"&&(s=i("categoryarray")),!l&&u==="array"&&(u=P.categoryorder="trace"),u==="trace"?P._initialCategories=[]:u==="array"?P._initialCategories=s.slice():(s=y(P,n).sort(),u==="category ascending"?P._initialCategories=s:u==="category descending"&&(P._initialCategories=s.reverse()))}}}),fb=ze((te,Y)=>{var d=ln().mix,y=Mi(),z=ji();Y.exports=function(P,i,n,a){a=a||{};var l=a.dfltColor;function o(g,C){return z.coerce2(P,i,a.attributes,g,C)}var u=o("linecolor",l),s=o("linewidth"),h=n("showline",a.showLine||!!u||!!s);h||(delete i.linecolor,delete i.linewidth);var m=d(l,a.bgColor,a.blend||y.lightFraction).toRgbString(),b=o("gridcolor",m),x=o("gridwidth"),_=o("griddash"),A=n("showgrid",a.showGrid||!!b||!!x||!!_);if(A||(delete i.gridcolor,delete i.gridwidth,delete i.griddash),a.hasMinor){var f=d(i.gridcolor,a.bgColor,67).toRgbString(),k=o("minor.gridcolor",f),w=o("minor.gridwidth",i.gridwidth||1),D=o("minor.griddash",i.griddash||"solid"),E=n("minor.showgrid",!!k||!!w||!!D);E||(delete i.minor.gridcolor,delete i.minor.gridwidth,delete i.minor.griddash)}if(!a.noZeroLine){o("zerolinelayer");var I=o("zerolinecolor",l),M=o("zerolinewidth"),p=n("zeroline",a.showGrid||!!I||!!M);p||(delete i.zerolinelayer,delete i.zerolinecolor,delete i.zerolinewidth)}}}),db=ze((te,Y)=>{var d=Sr(),y=as(),z=ji(),P=ku(),i=Zd(),n=Gd(),a=Nv(),l=jv(),o=G0(),u=Tg(),s=Qg(),h=fb(),m=lw(),b=Z0(),x=dc().WEEKDAY_PATTERN,_=dc().HOUR_PATTERN;Y.exports=function(w,D,E,I,M){var p=I.letter,g=I.font||{},C=I.splomStash||{},T=E("visible",!I.visibleDflt),N=D._template||{},B=D.type||N.type||"-",U;if(B==="date"){var V=y.getComponentMethod("calendars","handleDefaults");V(w,D,"calendar",I.calendar),I.noTicklabelmode||(U=E("ticklabelmode"))}!I.noTicklabelindex&&(B==="date"||B==="linear")&&E("ticklabelindex");var W="";(!I.noTicklabelposition||B==="multicategory")&&(W=z.coerce(w,D,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:U==="period"?["outside","inside"]:p==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),I.noTicklabeloverflow||E("ticklabeloverflow",W.indexOf("inside")!==-1?"hide past domain":B==="category"||B==="multicategory"?"allow":"hide past div"),b(D,M),m(w,D,E,I),s(w,D,E,I),I.noHover||(B!=="category"&&E("hoverformat"),I.noUnifiedhovertitle||E("unifiedhovertitle.text"));var F=E("color"),H=F!==n.color.dflt?F:g.color,q=C.label||M._dfltTitle[p];if(u(w,D,E,B,I),!T)return D;E("title.text",q),z.coerceFont(E,"title.font",g,{overrideDflt:{size:z.bigFont(g.size),color:H}}),a(w,D,E,B);var G=I.hasMinor;if(G&&(P.newContainer(D,"minor"),a(w,D,E,B,{isMinor:!0})),o(w,D,E,B,I),l(w,D,E,I),G){var ee=I.isMinor;I.isMinor=!0,l(w,D,E,I),I.isMinor=ee}h(w,D,E,{dfltColor:F,bgColor:I.bgColor,showGrid:I.showGrid,hasMinor:G,attributes:n}),G&&!D.minor.ticks&&!D.minor.showgrid&&delete D.minor,(D.showline||D.ticks)&&E("mirror");var he=B==="multicategory";if(!I.noTickson&&(B==="category"||he)&&(D.ticks||D.showgrid)&&(he?(E("tickson","boundaries"),delete D.ticklabelposition):E("tickson")),he){var be=E("showdividers");be&&(E("dividercolor"),E("dividerwidth"))}if(B==="date")if(i(w,D,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:A}),!D.rangebreaks.length)delete D.rangebreaks;else{for(var ve=0;ve=2){var g="",C,T;if(p.length===2){for(C=0;C<2;C++)if(T=k(p[C]),T){g=x;break}}var N=I("pattern",g);if(N===x)for(C=0;C<2;C++)T=k(p[C]),T&&(D.bounds[C]=p[C]=T-1);if(N)for(C=0;C<2;C++)switch(T=p[C],N){case x:if(!d(T)){D.enabled=!1;return}if(T=+T,T!==Math.floor(T)||T<0||T>=7){D.enabled=!1;return}D.bounds[C]=p[C]=T;break;case _:if(!d(T)){D.enabled=!1;return}if(T=+T,T<0||T>24){D.enabled=!1;return}D.bounds[C]=p[C]=T;break}if(E.autorange===!1){var B=E.range;if(B[0]B[1]){D.enabled=!1;return}}else if(p[0]>B[0]&&p[1]{var d=Sr(),y=ji();Y.exports=function(z,P,i,n){var a=n.counterAxes||[],l=n.overlayableAxes||[],o=n.letter,u=n.grid,s=n.overlayingDomain,h,m,b,x,_,A;u&&(m=u._domains[o][u._axisMap[P._id]],h=u._anchors[P._id],m&&(b=u[o+"side"].split(" ")[0],x=u.domain[o][b==="right"||b==="top"?1:0])),m=m||[0,1],h=h||(d(z.position)?"free":a[0]||"free"),b=b||(o==="x"?"bottom":"left"),x=x||0,_=0,A=!1;var f=y.coerce(z,P,{anchor:{valType:"enumerated",values:["free"].concat(a),dflt:h}},"anchor"),k=y.coerce(z,P,{side:{valType:"enumerated",values:o==="x"?["bottom","top"]:["left","right"],dflt:b}},"side");if(f==="free"){if(o==="y"){var w=i("autoshift");w&&(x=k==="left"?s[0]:s[1],A=P.automargin?P.automargin:!0,_=k==="left"?-3:3),i("shift",_)}i("position",x)}i("automargin",A);var D=!1;if(l.length&&(D=y.coerce(z,P,{overlaying:{valType:"enumerated",values:[!1].concat(l),dflt:!1}},"overlaying")),!D){var E=i("domain",m);E[0]>E[1]-1/4096&&(P.domain=m),y.noneOrAll(z.domain,P.domain,m),P.tickmode==="sync"&&(P.tickmode="auto")}return i("layer"),P}}),U4=ze((te,Y)=>{var d=ji(),y=Xi(),z=T0().isUnifiedHover,P=Q1(),i=ku(),n=w_(),a=Gd(),l=l0(),o=db(),u=ry(),s=Cw(),h=Zc(),m=h.id2name,b=h.name2id,x=dc().AX_ID_PATTERN,_=as(),A=_.traceIs,f=_.getComponentMethod;function k(w,D,E){Array.isArray(w[D])?w[D].push(E):w[D]=[E]}Y.exports=function(w,D,E){var I=D.autotypenumbers,M={},p={},g={},C={},T={},N={},B={},U={},V={},W={},F,H;for(F=0;F{var d=ri(),y=as(),z=ji(),P=Zs(),i=Os();Y.exports=function(n,a,l,o){var u=n._fullLayout;if(a.length===0){i.redrawComponents(n);return}function s(D){var E=D.xaxis,I=D.yaxis;u._defs.select("#"+D.clipId+"> rect").call(P.setTranslate,0,0).call(P.setScale,1,1),D.plot.call(P.setTranslate,E._offset,I._offset).call(P.setScale,1,1);var M=D.plot.selectAll(".scatterlayer .trace");M.selectAll(".point").call(P.setPointGroupScale,1,1),M.selectAll(".textpoint").call(P.setTextPointsScale,1,1),M.call(P.hideOutsideRangePoints,D)}function h(D,E){var I=D.plotinfo,M=I.xaxis,p=I.yaxis,g=M._length,C=p._length,T=!!D.xr1,N=!!D.yr1,B=[];if(T){var U=z.simpleMap(D.xr0,M.r2l),V=z.simpleMap(D.xr1,M.r2l),W=U[1]-U[0],F=V[1]-V[0];B[0]=(U[0]*(1-E)+E*V[0]-U[0])/(U[1]-U[0])*g,B[2]=g*(1-E+E*F/W),M.range[0]=M.l2r(U[0]*(1-E)+E*V[0]),M.range[1]=M.l2r(U[1]*(1-E)+E*V[1])}else B[0]=0,B[2]=g;if(N){var H=z.simpleMap(D.yr0,p.r2l),q=z.simpleMap(D.yr1,p.r2l),G=H[1]-H[0],ee=q[1]-q[0];B[1]=(H[1]*(1-E)+E*q[1]-H[1])/(H[0]-H[1])*C,B[3]=C*(1-E+E*ee/G),p.range[0]=M.l2r(H[0]*(1-E)+E*q[0]),p.range[1]=p.l2r(H[1]*(1-E)+E*q[1])}else B[1]=0,B[3]=C;i.drawOne(n,M,{skipTitle:!0}),i.drawOne(n,p,{skipTitle:!0}),i.redrawComponents(n,[M._id,p._id]);var he=T?g/B[2]:1,be=N?C/B[3]:1,ve=T?B[0]:0,ce=N?B[1]:0,re=T?B[0]/B[2]*g:0,ge=N?B[1]/B[3]*C:0,ne=M._offset-re,se=p._offset-ge;I.clipRect.call(P.setTranslate,ve,ce).call(P.setScale,1/he,1/be),I.plot.call(P.setTranslate,ne,se).call(P.setScale,he,be),P.setPointGroupScale(I.zoomScalePts,1/he,1/be),P.setTextPointsScale(I.zoomScaleTxt,1/he,1/be)}var m;o&&(m=o());function b(){for(var D={},E=0;El.duration?(b(),f=window.cancelAnimationFrame(w)):f=window.requestAnimationFrame(w)}return _=Date.now(),f=window.requestAnimationFrame(w),Promise.resolve()}}),Ff=ze(te=>{var Y=ri(),d=as(),y=ji(),z=sh(),P=Zs(),i=Ed().getModuleCalcData,n=Zc(),a=dc(),l=k0(),o=y.ensureSingle;function u(A,f,k){return y.ensureSingle(A,f,k,function(w){w.datum(k)})}var s=a.zindexSeparator;te.name="cartesian",te.attr=["xaxis","yaxis"],te.idRoot=["x","y"],te.idRegex=a.idRegex,te.attrRegex=a.attrRegex,te.attributes=gm(),te.layoutAttributes=Gd(),te.supplyLayoutDefaults=U4(),te.transitionAxes=_S(),te.finalizeSubplots=function(A,f){var k=f._subplots,w=k.xaxis,D=k.yaxis,E=k.cartesian,I=E,M={},p={},g,C,T;for(g=0;g0){var B=N.id;if(B.indexOf(s)!==-1)continue;B+=s+(g+1),N=y.extendFlat({},N,{id:B,plot:D._cartesianlayer.selectAll(".subplot").select("."+B)})}for(var U=[],V,W=0;W1&&(ee+=s+G),q.push(M+ee),I=0;I1,T=f.mainplotinfo;if(!f.mainplot||C)if(g)f.xlines=o(w,"path","xlines-above"),f.ylines=o(w,"path","ylines-above"),f.xaxislayer=o(w,"g","xaxislayer-above"),f.yaxislayer=o(w,"g","yaxislayer-above");else{if(!I){var N=o(w,"g","layer-subplot");f.shapelayer=o(N,"g","shapelayer"),f.imagelayer=o(N,"g","imagelayer"),T&&C?(f.minorGridlayer=T.minorGridlayer,f.gridlayer=T.gridlayer,f.zerolinelayer=T.zerolinelayer):(f.minorGridlayer=o(w,"g","minor-gridlayer"),f.gridlayer=o(w,"g","gridlayer"),f.zerolinelayer=o(w,"g","zerolinelayer"));var B=o(w,"g","layer-between");f.shapelayerBetween=o(B,"g","shapelayer"),f.imagelayerBetween=o(B,"g","imagelayer"),o(w,"path","xlines-below"),o(w,"path","ylines-below"),f.overlinesBelow=o(w,"g","overlines-below"),o(w,"g","xaxislayer-below"),o(w,"g","yaxislayer-below"),f.overaxesBelow=o(w,"g","overaxes-below")}f.overplot=o(w,"g","overplot"),f.plot=o(f.overplot,"g",D),T&&C?f.zerolinelayerAbove=T.zerolinelayerAbove:f.zerolinelayerAbove=o(w,"g","zerolinelayer-above"),I||(f.xlines=o(w,"path","xlines-above"),f.ylines=o(w,"path","ylines-above"),f.overlinesAbove=o(w,"g","overlines-above"),o(w,"g","xaxislayer-above"),o(w,"g","yaxislayer-above"),f.overaxesAbove=o(w,"g","overaxes-above"),f.xlines=w.select(".xlines-"+M),f.ylines=w.select(".ylines-"+p),f.xaxislayer=w.select(".xaxislayer-"+M),f.yaxislayer=w.select(".yaxislayer-"+p))}else{var U=T.plotgroup,V=D+"-x",W=D+"-y";f.minorGridlayer=T.minorGridlayer,f.gridlayer=T.gridlayer,f.zerolinelayer=T.zerolinelayer,f.zerolinelayerAbove=T.zerolinelayerAbove,o(T.overlinesBelow,"path",V),o(T.overlinesBelow,"path",W),o(T.overaxesBelow,"g",V),o(T.overaxesBelow,"g",W),f.plot=o(T.overplot,"g",D),o(T.overlinesAbove,"path",V),o(T.overlinesAbove,"path",W),o(T.overaxesAbove,"g",V),o(T.overaxesAbove,"g",W),f.xlines=U.select(".overlines-"+M).select("."+V),f.ylines=U.select(".overlines-"+p).select("."+W),f.xaxislayer=U.select(".overaxes-"+M).select("."+V),f.yaxislayer=U.select(".overaxes-"+p).select("."+W)}I||(g||(u(f.minorGridlayer,"g",f.xaxis._id),u(f.minorGridlayer,"g",f.yaxis._id),f.minorGridlayer.selectAll("g").map(function(F){return F[0]}).sort(n.idSort),u(f.gridlayer,"g",f.xaxis._id),u(f.gridlayer,"g",f.yaxis._id),f.gridlayer.selectAll("g").map(function(F){return F[0]}).sort(n.idSort)),f.xlines.style("fill","none").classed("crisp",!0),f.ylines.style("fill","none").classed("crisp",!0))}function x(A,f){if(A){var k={};A.each(function(p){var g=p[0],C=Y.select(this);C.remove(),_(g,f),k[g]=!0});for(var w in f._plots)for(var D=f._plots[w],E=D.overlays||[],I=0;I{var d=Bc();Y.exports={hasLines:d.hasLines,hasMarkers:d.hasMarkers,hasText:d.hasText,isBubble:d.isBubble,attributes:ff(),layoutAttributes:Fv(),supplyDefaults:F4(),crossTraceDefaults:N4(),supplyLayoutDefaults:j4(),calc:yt().calc,crossTraceCalc:$i(),arraysToCalcdata:de(),plot:uo(),colorbar:Mo(),formatLabels:Ys(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Kd(),selectPoints:ed(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ff(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}),pb=ze((te,Y)=>{var d=ri(),y=Xi(),z=ww(),P=ji(),i=P.strScale,n=P.strRotate,a=P.strTranslate;Y.exports=function(l,o,u){var s=l.node(),h=z[u.arrowhead||0],m=z[u.startarrowhead||0],b=(u.arrowwidth||1)*(u.arrowsize||1),x=(u.arrowwidth||1)*(u.startarrowsize||1),_=o.indexOf("start")>=0,A=o.indexOf("end")>=0,f=h.backoff*b+u.standoff,k=m.backoff*x+u.startstandoff,w,D,E,I;if(s.nodeName==="line"){w={x:+l.attr("x1"),y:+l.attr("y1")},D={x:+l.attr("x2"),y:+l.attr("y2")};var M=w.x-D.x,p=w.y-D.y;if(E=Math.atan2(p,M),I=E+Math.PI,f&&k&&f+k>Math.sqrt(M*M+p*p)){G();return}if(f){if(f*f>M*M+p*p){G();return}var g=f*Math.cos(E),C=f*Math.sin(E);D.x+=g,D.y+=C,l.attr({x2:D.x,y2:D.y})}if(k){if(k*k>M*M+p*p){G();return}var T=k*Math.cos(E),N=k*Math.sin(E);w.x-=T,w.y-=N,l.attr({x1:w.x,y1:w.y})}}else if(s.nodeName==="path"){var B=s.getTotalLength(),U="";if(B{var d=ri(),y=as(),z=sh(),P=ji(),i=P.strTranslate,n=Os(),a=Xi(),l=Zs(),o=hf(),u=cc(),s=Em(),h=jp(),m=ku().arrayEditor,b=pb();Y.exports={draw:x,drawOne:_,drawRaw:f};function x(k){var w=k._fullLayout;w._infolayer.selectAll(".annotation").remove();for(var D=0;D2/3?dn="right":dn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[dn]}for(var xt=!1,ut=["x","y"],Et=0;Et1)&&(vr===Qt?(ht=mr.r2fraction(w["a"+Gt]),(ht<0||ht>1)&&(xt=!0)):xt=!0),ot=mr._offset+mr.r2p(w[Gt]),Pe=.5}else{var At=at==="domain";Gt==="x"?(ye=w[Gt],ot=At?mr._offset+mr._length*ye:ot=g.l+g.w*ye):(ye=1-w[Gt],ot=At?mr._offset+mr._length*ye:ot=g.t+g.h*ye),Pe=w.showarrow?.5:ye}if(w.showarrow){Xe.head=ot;var Wt=w["a"+Gt];if(He=ii*nt(.5,w.xanchor)-Lr*nt(.5,w.yanchor),vr===Qt){var Yt=n.getRefType(vr);Yt==="domain"?(Gt==="y"&&(Wt=1-Wt),Xe.tail=mr._offset+mr._length*Wt):Yt==="paper"?Gt==="y"?(Wt=1-Wt,Xe.tail=g.t+g.h*Wt):Xe.tail=g.l+g.w*Wt:Xe.tail=mr._offset+mr.r2p(Wt),De=He}else Xe.tail=ot+Wt,De=He+Wt;Xe.text=Xe.tail+He;var hr=p[Gt==="x"?"width":"height"];if(Qt==="paper"&&(Xe.head=P.constrain(Xe.head,1,hr-1)),vr==="pixel"){var zr=-Math.max(Xe.tail-3,Xe.text),Dr=Math.min(Xe.tail+3,Xe.text)-hr;zr>0?(Xe.tail+=zr,Xe.text+=zr):Dr>0&&(Xe.tail-=Dr,Xe.text-=Dr)}Xe.tail+=Ot,Xe.head+=Ot}else He=ci*nt(Pe,vi),De=He,Xe.text=ot+He;Xe.text+=Ot,He+=Ot,De+=Ot,w["_"+Gt+"padplus"]=ci/2+De,w["_"+Gt+"padminus"]=ci/2-De,w["_"+Gt+"size"]=ci,w["_"+Gt+"shift"]=He}if(xt){ce.remove();return}var br=0,fi=0;if(w.align!=="left"&&(br=(ct-mt)*(w.align==="center"?.5:1)),w.valign!=="top"&&(fi=(Ae-vt)*(w.valign==="middle"?.5:1)),tt)Ge.select("svg").attr({x:ne+br-1,y:ne+fi}).call(l.setClipUrl,_e?F:null,k);else{var un=ne+fi-_t.top,cn=ne+br-_t.left;fe.call(u.positionText,cn,un).call(l.setClipUrl,_e?F:null,k)}oe.select("rect").call(l.setRect,ne,ne,ct,Ae),se.call(l.setRect,re/2,re/2,Oe-re,Le-re),ce.call(l.setTranslate,Math.round(H.x.text-Oe/2),Math.round(H.y.text-Le/2)),ee.attr({transform:"rotate("+q+","+H.x.text+","+H.y.text+")"});var yn=function(Sn,dn){G.selectAll(".annotation-arrow-g").remove();var va=H.x.head,na=H.y.head,Kt=H.x.tail+Sn,lr=H.y.tail+dn,_r=H.x.text+Sn,Er=H.y.text+dn,di=P.rotationXYMatrix(q,_r,Er),qi=P.apply2DTransform(di),Ui=P.apply2DTransform2(di),Hi=+se.attr("width"),Ln=+se.attr("height"),Fn=_r-.5*Hi,Kn=Fn+Hi,Jn=Er-.5*Ln,sa=Jn+Ln,Mn=[[Fn,Jn,Fn,sa],[Fn,sa,Kn,sa],[Kn,sa,Kn,Jn],[Kn,Jn,Fn,Jn]].map(Ui);if(!Mn.reduce(function(zt,xr){return zt^!!P.segmentsIntersect(va,na,va+1e6,na+1e6,xr[0],xr[1],xr[2],xr[3])},!1)){Mn.forEach(function(zt){var xr=P.segmentsIntersect(Kt,lr,va,na,zt[0],zt[1],zt[2],zt[3]);xr&&(Kt=xr.x,lr=xr.y)});var Ha=w.arrowwidth,io=w.arrowcolor,Ft=w.arrowside,Rt=G.append("g").style({opacity:a.opacity(io)}).classed("annotation-arrow-g",!0),qr=Rt.append("path").attr("d","M"+Kt+","+lr+"L"+va+","+na).style("stroke-width",Ha+"px").call(a.stroke,a.rgb(io));if(b(qr,Ft,w),C.annotationPosition&&qr.node().parentNode&&!E){var ai=va,si=na;if(w.standoff){var Gr=Math.sqrt(Math.pow(va-Kt,2)+Math.pow(na-lr,2));ai+=w.standoff*(Kt-va)/Gr,si+=w.standoff*(lr-na)/Gr}var li=Rt.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Kt-ai)+","+(lr-si),transform:i(ai,si)}).style("stroke-width",Ha+6+"px").call(a.stroke,"rgba(0,0,0,0)").call(a.fill,"rgba(0,0,0,0)"),Pi,xi;h.init({element:li.node(),gd:k,prepFn:function(){var zt=l.getTranslate(ce);Pi=zt.x,xi=zt.y,I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0)},moveFn:function(zt,xr){var Qr=qi(Pi,xi),Ri=Qr[0]+zt,en=Qr[1]+xr;ce.call(l.setTranslate,Ri,en),V("x",A(I,zt,"x",g,w)),V("y",A(M,xr,"y",g,w)),w.axref===w.xref&&V("ax",A(I,zt,"ax",g,w)),w.ayref===w.yref&&V("ay",A(M,xr,"ay",g,w)),Rt.attr("transform",i(zt,xr)),ee.attr({transform:"rotate("+q+","+Ri+","+en+")"})},doneFn:function(){y.call("_guiRelayout",k,W());var zt=document.querySelector(".js-notes-box-panel");zt&&zt.redraw(zt.selectedObj)}})}}};if(w.showarrow&&yn(0,0),he){var Gn;h.init({element:ce.node(),gd:k,prepFn:function(){Gn=ee.attr("transform")},moveFn:function(Sn,dn){var va="pointer";if(w.showarrow)w.axref===w.xref?V("ax",A(I,Sn,"ax",g,w)):V("ax",w.ax+Sn),w.ayref===w.yref?V("ay",A(M,dn,"ay",g.w,w)):V("ay",w.ay+dn),yn(Sn,dn);else{if(E)return;var na,Kt;if(I)na=A(I,Sn,"x",g,w);else{var lr=w._xsize/g.w,_r=w.x+(w._xshift-w.xshift)/g.w-lr/2;na=h.align(_r+Sn/g.w,lr,0,1,w.xanchor)}if(M)Kt=A(M,dn,"y",g,w);else{var Er=w._ysize/g.h,di=w.y-(w._yshift+w.yshift)/g.h-Er/2;Kt=h.align(di-dn/g.h,Er,0,1,w.yanchor)}V("x",na),V("y",Kt),(!I||!M)&&(va=h.getCursor(I?.5:na,M?.5:Kt,w.xanchor,w.yanchor))}ee.attr({transform:i(Sn,dn)+Gn}),s(ce,va)},clickFn:function(Sn,dn){w.captureevents&&k.emit("plotly_clickannotation",ve(dn))},doneFn:function(){s(ce),y.call("_guiRelayout",k,W());var Sn=document.querySelector(".js-notes-box-panel");Sn&&Sn.redraw(Sn.selectedObj)}})}}C.annotationText?fe.call(u.makeEditable,{delegate:ce,gd:k}).call(Ce).on("edit",function(Be){w.text=Be,this.call(Ce),V("text",Be),I&&I.autorange&&U(I._name+".autorange",!0),M&&M.autorange&&U(M._name+".autorange",!0),y.call("_guiRelayout",k,W())}):fe.call(Ce)}}),xS=ze((te,Y)=>{var d=ji(),y=as(),z=ku().arrayEditor;Y.exports={hasClickToShow:P,onClick:i};function P(l,o){var u=n(l,o);return u.on.length>0||u.explicitOff.length>0}function i(l,o){var u=n(l,o),s=u.on,h=u.off.concat(u.explicitOff),m={},b=l._fullLayout.annotations,x,_;if(s.length||h.length){for(x=0;x{var d=ji(),y=Xi();Y.exports=function(z,P,i,n){n("opacity");var a=n("bgcolor"),l=n("bordercolor"),o=y.opacity(l);n("borderpad");var u=n("borderwidth"),s=n("showarrow");n("text",s?" ":i._dfltTitle.annotation),n("textangle"),d.coerceFont(n,"font",i.font),n("width"),n("align");var h=n("height");if(h&&n("valign"),s){var m=n("arrowside"),b,x;m.indexOf("end")!==-1&&(b=n("arrowhead"),x=n("arrowsize")),m.indexOf("start")!==-1&&(n("startarrowhead",b),n("startarrowsize",x)),n("arrowcolor",o?P.bordercolor:y.defaultLine),n("arrowwidth",(o&&u||1)*2),n("standoff"),n("startstandoff")}var _=n("hovertext"),A=i.hoverlabel||{};if(_){var f=n("hoverlabel.bgcolor",A.bgcolor||(y.opacity(a)?y.rgb(a):y.defaultLine)),k=n("hoverlabel.bordercolor",A.bordercolor||y.contrast(f)),w=d.extendFlat({},A.font);w.color||(w.color=k),d.coerceFont(n,"hoverlabel.font",w)}n("captureevents",!!_)}}),Mw=ze((te,Y)=>{var d=ji(),y=Os(),z=Zd(),P=$4(),i=Ag();Y.exports=function(a,l){z(a,l,{name:"annotations",handleItemDefaults:n})};function n(a,l,o){function u(g,C){return d.coerce(a,l,i,g,C)}var s=u("visible"),h=u("clicktoshow");if(s||h){P(a,l,o,u);for(var m=l.showarrow,b=["x","y"],x=[-10,-30],_={_fullLayout:o},A=0;A<2;A++){var f=b[A],k=y.coerceRef(a,l,_,f,"","paper");if(k!=="paper"){var w=y.getFromId(_,k);w._annIndices.push(l._index)}if(y.coercePosition(l,_,u,k,f,.5),m){var D="a"+f,E=y.coerceRef(a,l,_,D,"pixel",["pixel","paper"]);E!=="pixel"&&E!==k&&(E=l[D]="pixel");var I=E==="pixel"?x[A]:.4;y.coercePosition(l,_,u,E,D,I)}u(f+"anchor"),u(f+"shift")}if(d.noneOrAll(a,l,["x","y"]),m&&d.noneOrAll(a,l,["ax","ay"]),h){var M=u("xclick"),p=u("yclick");l._xclick=M===void 0?l.x:y.cleanPosition(M,_,l.xref),l._yclick=p===void 0?l.y:y.cleanPosition(p,_,l.yref)}}}}),H4=ze((te,Y)=>{var d=ji(),y=Os(),z=Aw().draw;Y.exports=function(n){var a=n._fullLayout,l=d.filterVisible(a.annotations);if(l.length&&n._fullData.length)return d.syncOrAsync([z,P],n)};function P(n){var a=n._fullLayout;d.filterVisible(a.annotations).forEach(function(l){var o=y.getFromId(n,l.xref),u=y.getFromId(n,l.yref),s=y.getRefType(l.xref),h=y.getRefType(l.yref);l._extremes={},s==="range"&&i(l,o),h==="range"&&i(l,u)})}function i(n,a){var l=a._id,o=l.charAt(0),u=n[o],s=n["a"+o],h=n[o+"ref"],m=n["a"+o+"ref"],b=n["_"+o+"padplus"],x=n["_"+o+"padminus"],_={x:1,y:-1}[o]*n[o+"shift"],A=3*n.arrowsize*n.arrowwidth||0,f=A+_,k=A-_,w=3*n.startarrowsize*n.arrowwidth||0,D=w+_,E=w-_,I;if(m===h){var M=y.findExtremes(a,[a.r2c(u)],{ppadplus:f,ppadminus:k}),p=y.findExtremes(a,[a.r2c(s)],{ppadplus:Math.max(b,D),ppadminus:Math.max(x,E)});I={min:[M.min[0],p.min[0]],max:[M.max[0],p.max[0]]}}else D=s?D+s:D,E=s?E-s:E,I=y.findExtremes(a,[a.r2c(u)],{ppadplus:Math.max(b,f,D),ppadminus:Math.max(x,k,E)});n._extremes[l]=I}}),bS=ze((te,Y)=>{var d=Sr(),y=ya();Y.exports=function(z,P,i,n){P=P||{};var a=i==="log"&&P.type==="linear",l=i==="linear"&&P.type==="log";if(!(a||l))return;var o=z._fullLayout.annotations,u=P._id.charAt(0),s,h;function m(x){var _=s[x],A=null;a?A=y(_,P.range):A=Math.pow(10,_),d(A)||(A=null),n(h+x,A)}for(var b=0;b{var d=Aw(),y=xS();Y.exports={moduleType:"component",name:"annotations",layoutAttributes:Ag(),supplyLayoutDefaults:Mw(),includeBasePlot:Kv()("annotations"),calcAutorange:H4(),draw:d.draw,drawOne:d.drawOne,drawRaw:d.drawRaw,hasClickToShow:y.hasClickToShow,onClick:y.onClick,convertCoords:bS()}}),wS=ze((te,Y)=>{var d=Ag(),y=oh().overrideAll,z=ku().templatedArray;Y.exports=y(z("annotation",{visible:d.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:d.xanchor,xshift:d.xshift,yanchor:d.yanchor,yshift:d.yshift,text:d.text,textangle:d.textangle,font:d.font,width:d.width,height:d.height,opacity:d.opacity,align:d.align,valign:d.valign,bgcolor:d.bgcolor,bordercolor:d.bordercolor,borderpad:d.borderpad,borderwidth:d.borderwidth,showarrow:d.showarrow,arrowcolor:d.arrowcolor,arrowhead:d.arrowhead,startarrowhead:d.startarrowhead,arrowside:d.arrowside,arrowsize:d.arrowsize,startarrowsize:d.startarrowsize,arrowwidth:d.arrowwidth,standoff:d.standoff,startstandoff:d.startstandoff,hovertext:d.hovertext,hoverlabel:d.hoverlabel,captureevents:d.captureevents}),"calc","from-root")}),IW=ze((te,Y)=>{var d=ji(),y=Os(),z=Zd(),P=$4(),i=wS();Y.exports=function(a,l,o){z(a,l,{name:"annotations",handleItemDefaults:n,fullLayout:o.fullLayout})};function n(a,l,o,u){function s(b,x){return d.coerce(a,l,i,b,x)}function h(b){var x=b+"axis",_={_fullLayout:{}};return _._fullLayout[x]=o[x],y.coercePosition(l,_,s,b,b,.5)}var m=s("visible");m&&(P(a,l,u.fullLayout,s),h("x"),h("y"),h("z"),d.noneOrAll(a,l,["x","y","z"]),l.xref="x",l.yref="y",l.zref="z",s("xanchor"),s("yanchor"),s("xshift"),s("yshift"),l.showarrow&&(l.axref="pixel",l.ayref="pixel",s("ax",-10),s("ay",-30),d.noneOrAll(a,l,["ax","ay"])))}}),DW=ze((te,Y)=>{var d=ji(),y=Os();Y.exports=function(P){for(var i=P.fullSceneLayout,n=i.annotations,a=0;a{function d(z,P){var i=[0,0,0,0],n,a;for(n=0;n<4;++n)for(a=0;a<4;++a)i[a]+=z[4*n+a]*P[n];return i}function y(z,P){var i=d(z.projection,d(z.view,d(z.model,[P[0],P[1],P[2],1])));return i}Y.exports=y}),zW=ze((te,Y)=>{var d=Aw().drawRaw,y=xL(),z=["x","y","z"];Y.exports=function(P){for(var i=P.fullSceneLayout,n=P.dataScale,a=i.annotations,l=0;l1){u=!0;break}}u?P.fullLayout._infolayer.select(".annotation-"+P.id+'[data-index="'+l+'"]').remove():(o._pdata=y(P.glplot.cameraParams,[i.xaxis.r2l(o.x)*n[0],i.yaxis.r2l(o.y)*n[1],i.zaxis.r2l(o.z)*n[2]]),d(P.graphDiv,o,l,P.id,o._xa,o._ya))}}}),OW=ze((te,Y)=>{var d=as(),y=ji();Y.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:wS()}}},layoutAttributes:wS(),handleDefaults:IW(),includeBasePlot:z,convert:DW(),draw:zW()};function z(P,i){var n=d.subplotsRegistry.gl3d;if(n)for(var a=n.attrRegex,l=Object.keys(P),o=0;o{var d=Ag(),y=On(),z=ff().line,P=qd().dash,i=nn().extendFlat,n=ku().templatedArray;ub();var a=xa(),{shapeTexttemplateAttrs:l,templatefallbackAttrs:o}=rc(),u=b_();Y.exports=n("shape",{visible:i({},a.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:i({},a.legend,{editType:"calc+arraydraw"}),legendgroup:i({},a.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:i({},a.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:y({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:i({},a.legendrank,{editType:"calc+arraydraw"}),legendwidth:i({},a.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:i({},d.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:i({},d.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:i({},z.color,{editType:"arraydraw"}),width:i({},z.width,{editType:"calc+arraydraw"}),dash:i({},P,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:l({},{keys:Object.keys(u)}),texttemplatefallback:o({editType:"arraydraw"}),font:y({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})}),BW=ze((te,Y)=>{var d=ji(),y=Os(),z=Zd(),P=bL(),i=s0();Y.exports=function(l,o){z(l,o,{name:"shapes",handleItemDefaults:a})};function n(l,o){return l?"bottom":o.indexOf("top")!==-1?"top":o.indexOf("bottom")!==-1?"bottom":"middle"}function a(l,o,u){function s(re,ge){return d.coerce(l,o,P,re,ge)}o._isShape=!0;var h=s("visible");if(h){var m=s("showlegend");m&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),d.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var b=s("path"),x=b?"path":"rect",_=s("type",x),A=_!=="path";A&&delete o.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule");var f=s("line.width");f&&(s("line.color"),s("line.dash"));for(var k=s("xsizemode"),w=s("ysizemode"),D=["x","y"],E=0;E<2;E++){var I=D[E],M=I+"anchor",p=I==="x"?k:w,g={_fullLayout:u},C,T,N,B=y.coerceRef(l,o,g,I,void 0,"paper"),U=y.getRefType(B);if(U==="range"?(C=y.getFromId(g,B),C._shapeIndices.push(o._index),N=i.rangeToShapePosition(C),T=i.shapePositionToRange(C),(C.type==="category"||C.type==="multicategory")&&(s(I+"0shift"),s(I+"1shift"))):T=N=d.identity,A){var V=.25,W=.75,F=I+"0",H=I+"1",q=l[F],G=l[H];l[F]=T(l[F],!0),l[H]=T(l[H],!0),p==="pixel"?(s(F,0),s(H,10)):(y.coercePosition(o,g,s,B,F,V),y.coercePosition(o,g,s,B,H,W)),o[F]=N(o[F]),o[H]=N(o[H]),l[F]=q,l[H]=G}if(p==="pixel"){var ee=l[M];l[M]=T(l[M],!0),y.coercePosition(o,g,s,B,M,.25),o[M]=N(o[M]),l[M]=ee}}A&&d.noneOrAll(l,o,["x0","x1","y0","y1"]);var he=_==="line",be,ve;if(A&&(be=s("label.texttemplate"),s("label.texttemplatefallback")),be||(ve=s("label.text")),ve||be){s("label.textangle");var ce=s("label.textposition",he?"middle":"middle center");s("label.xanchor"),s("label.yanchor",n(he,ce)),s("label.padding"),d.coerceFont(s,"label.font",u.font)}}}}),RW=ze((te,Y)=>{var d=Xi(),y=ji();function z(P,i){return P?"bottom":i.indexOf("top")!==-1?"top":i.indexOf("bottom")!==-1?"bottom":"middle"}Y.exports=function(P,i,n){n("newshape.visible"),n("newshape.name"),n("newshape.showlegend"),n("newshape.legend"),n("newshape.legendwidth"),n("newshape.legendgroup"),n("newshape.legendgrouptitle.text"),y.coerceFont(n,"newshape.legendgrouptitle.font"),n("newshape.legendrank"),n("newshape.drawdirection"),n("newshape.layer"),n("newshape.fillcolor"),n("newshape.fillrule"),n("newshape.opacity");var a=n("newshape.line.width");if(a){var l=(P||{}).plot_bgcolor||"#FFF";n("newshape.line.color",d.contrast(l)),n("newshape.line.dash")}var o=P.dragmode==="drawline",u=n("newshape.label.text"),s=n("newshape.label.texttemplate");if(n("newshape.label.texttemplatefallback"),u||s){n("newshape.label.textangle");var h=n("newshape.label.textposition",o?"middle":"middle center");n("newshape.label.xanchor"),n("newshape.label.yanchor",z(o,h)),n("newshape.label.padding"),y.coerceFont(n,"newshape.label.font",i.font)}n("activeshape.fillcolor"),n("activeshape.opacity")}}),FW=ze((te,Y)=>{var d=ji(),y=Os(),z=rb(),P=s0();Y.exports=function(o){var u=o._fullLayout,s=d.filterVisible(u.shapes);if(!(!s.length||!o._fullData.length))for(var h=0;h0?f+x:x;return{ppad:x,ppadplus:_?w:D,ppadminus:_?D:w}}else return{ppad:x}}function l(o,u,s){var h=o._id.charAt(0)==="x"?"x":"y",m=o.type==="category"||o.type==="multicategory",b,x,_=0,A=0,f=m?o.r2c:o.d2c,k=u[h+"sizemode"]==="scaled";if(k?(b=u[h+"0"],x=u[h+"1"],m&&(_=u[h+"0shift"],A=u[h+"1shift"])):(b=u[h+"anchor"],x=u[h+"anchor"]),b!==void 0)return[f(b)+_,f(x)+A];if(u.path){var w=1/0,D=-1/0,E=u.path.match(z.segmentRE),I,M,p,g,C;for(o.type==="date"&&(f=P.decodeDate(f)),I=0;ID&&(D=C)));if(D>=w)return[w,D]}}}),NW=ze((te,Y)=>{var d=vw();Y.exports={moduleType:"component",name:"shapes",layoutAttributes:bL(),supplyLayoutDefaults:BW(),supplyDrawNewShapeDefaults:RW(),includeBasePlot:Kv()("shapes"),calcAutorange:FW(),draw:d.draw,drawOne:d.drawOne}}),wL=ze((te,Y)=>{var d=dc(),y=ku().templatedArray;ub(),Y.exports=y("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}),jW=ze((te,Y)=>{var d=ji(),y=Os(),z=Zd(),P=wL(),i="images";Y.exports=function(a,l){var o={name:i,handleItemDefaults:n};z(a,l,o)};function n(a,l,o){function u(k,w){return d.coerce(a,l,P,k,w)}var s=u("source"),h=u("visible",!!s);if(!h)return l;u("layer"),u("xanchor"),u("yanchor"),u("sizex"),u("sizey"),u("sizing"),u("opacity");for(var m={_fullLayout:o},b=["x","y"],x=0;x<2;x++){var _=b[x],A=y.coerceRef(a,l,m,_,"paper",void 0);if(A!=="paper"){var f=y.getFromId(m,A);f._imgIndices.push(l._index)}y.coercePosition(l,m,u,A,_,0)}return l}}),UW=ze((te,Y)=>{var d=ri(),y=Zs(),z=Os(),P=Zc(),i=k0();Y.exports=function(n){var a=n._fullLayout,l=[],o={},u=[],s,h;for(h=0;h{var d=Sr(),y=ya();Y.exports=function(z,P,i,n){P=P||{};var a=i==="log"&&P.type==="linear",l=i==="linear"&&P.type==="log";if(a||l){for(var o=z._fullLayout.images,u=P._id.charAt(0),s,h,m=0;m{Y.exports={moduleType:"component",name:"images",layoutAttributes:wL(),supplyLayoutDefaults:jW(),includeBasePlot:Kv()("images"),draw:UW(),convertCoords:$W()}}),kS=ze((te,Y)=>{Y.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}}),kL=ze((te,Y)=>{var d=On(),y=Mi(),z=nn().extendFlat,P=oh().overrideAll,i=Yx(),n=ku().templatedArray,a=n("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});Y.exports=P(n("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:a,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:z(i({editType:"arraydraw"}),{}),font:d({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:y.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}),VW=ze((te,Y)=>{var d=ji(),y=Zd(),z=kL(),P=kS(),i=P.name,n=z.buttons;Y.exports=function(o,u){var s={name:i,handleItemDefaults:a};y(o,u,s)};function a(o,u,s){function h(x,_){return d.coerce(o,u,z,x,_)}var m=y(o,u,{name:"buttons",handleItemDefaults:l}),b=h("visible",m.length>0);b&&(h("active"),h("direction"),h("type"),h("showactive"),h("x"),h("y"),d.noneOrAll(o,u,["x","y"]),h("xanchor"),h("yanchor"),h("pad.t"),h("pad.r"),h("pad.b"),h("pad.l"),d.coerceFont(h,"font",s.font),h("bgcolor",s.paper_bgcolor),h("bordercolor"),h("borderwidth"))}function l(o,u){function s(m,b){return d.coerce(o,u,n,m,b)}var h=s("visible",o.method==="skip"||Array.isArray(o.args));h&&(s("method"),s("args"),s("args2"),s("label"),s("execute"))}}),WW=ze((te,Y)=>{Y.exports=i;var d=ri(),y=Xi(),z=Zs(),P=ji();function i(n,a,l){this.gd=n,this.container=a,this.id=l,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}i.barWidth=2,i.barLength=20,i.barRadius=2,i.barPad=1,i.barColor="#808BA4",i.prototype.enable=function(n,a,l){var o=this.gd._fullLayout,u=o.width,s=o.height;this.position=n;var h=this.position.l,m=this.position.w,b=this.position.t,x=this.position.h,_=this.position.direction,A=_==="down",f=_==="left",k=_==="right",w=_==="up",D=m,E=x,I,M,p,g;!A&&!f&&!k&&!w&&(this.position.direction="down",A=!0);var C=A||w;C?(I=h,M=I+D,A?(p=b,g=Math.min(p+E,s),E=g-p):(g=b+E,p=Math.max(g-E,0),E=g-p)):(p=b,g=p+E,f?(M=h+D,I=Math.max(M-D,0),D=M-I):(I=h,M=Math.min(I+D,u),D=M-I)),this._box={l:I,t:p,w:D,h:E};var T=m>D,N=i.barLength+2*i.barPad,B=i.barWidth+2*i.barPad,U=h,V=b+x;V+B>s&&(V=s-B);var W=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);W.exit().on(".drag",null).remove(),W.enter().append("rect").classed("scrollbar-horizontal",!0).call(y.fill,i.barColor),T?(this.hbar=W.attr({rx:i.barRadius,ry:i.barRadius,x:U,y:V,width:N,height:B}),this._hbarXMin=U+N/2,this._hbarTranslateMax=D-N):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var F=x>E,H=i.barWidth+2*i.barPad,q=i.barLength+2*i.barPad,G=h+m,ee=b;G+H>u&&(G=u-H);var he=this.container.selectAll("rect.scrollbar-vertical").data(F?[0]:[]);he.exit().on(".drag",null).remove(),he.enter().append("rect").classed("scrollbar-vertical",!0).call(y.fill,i.barColor),F?(this.vbar=he.attr({rx:i.barRadius,ry:i.barRadius,x:G,y:ee,width:H,height:q}),this._vbarYMin=ee+q/2,this._vbarTranslateMax=E-q):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var be=this.id,ve=I-.5,ce=F?M+H+.5:M+.5,re=p-.5,ge=T?g+B+.5:g+.5,ne=o._topdefs.selectAll("#"+be).data(T||F?[0]:[]);if(ne.exit().remove(),ne.enter().append("clipPath").attr("id",be).append("rect"),T||F?(this._clipRect=ne.select("rect").attr({x:Math.floor(ve),y:Math.floor(re),width:Math.ceil(ce)-Math.floor(ve),height:Math.ceil(ge)-Math.floor(re)}),this.container.call(z.setClipUrl,be,this.gd),this.bg.attr({x:h,y:b,width:m,height:x})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),T||F){var se=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(se);var _e=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(_e),F&&this.vbar.on(".drag",null).call(_e)}this.setTranslate(a,l)},i.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(z.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},i.prototype._onBoxDrag=function(){var n=this.translateX,a=this.translateY;this.hbar&&(n-=d.event.dx),this.vbar&&(a-=d.event.dy),this.setTranslate(n,a)},i.prototype._onBoxWheel=function(){var n=this.translateX,a=this.translateY;this.hbar&&(n+=d.event.deltaY),this.vbar&&(a+=d.event.deltaY),this.setTranslate(n,a)},i.prototype._onBarDrag=function(){var n=this.translateX,a=this.translateY;if(this.hbar){var l=n+this._hbarXMin,o=l+this._hbarTranslateMax,u=P.constrain(d.event.x,l,o),s=(u-l)/(o-l),h=this.position.w-this._box.w;n=s*h}if(this.vbar){var m=a+this._vbarYMin,b=m+this._vbarTranslateMax,x=P.constrain(d.event.y,m,b),_=(x-m)/(b-m),A=this.position.h-this._box.h;a=_*A}this.setTranslate(n,a)},i.prototype.setTranslate=function(n,a){var l=this.position.w-this._box.w,o=this.position.h-this._box.h;if(n=P.constrain(n||0,0,l),a=P.constrain(a||0,0,o),this.translateX=n,this.translateY=a,this.container.call(z.setTranslate,this._box.l-this.position.l-n,this._box.t-this.position.t-a),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+n-.5),y:Math.floor(this.position.t+a-.5)}),this.hbar){var u=n/l;this.hbar.call(z.setTranslate,n+u*this._hbarTranslateMax,a)}if(this.vbar){var s=a/o;this.vbar.call(z.setTranslate,n,a+s*this._vbarTranslateMax)}}}),qW=ze((te,Y)=>{var d=ri(),y=sh(),z=Xi(),P=Zs(),i=ji(),n=cc(),a=ku().arrayEditor,l=Rf().LINE_SPACING,o=kS(),u=WW();Y.exports=function(N){var B=N._fullLayout,U=i.filterVisible(B[o.name]);function V(be){y.autoMargin(N,g(be))}var W=B._menulayer.selectAll("g."+o.containerClassName).data(U.length>0?[0]:[]);if(W.enter().append("g").classed(o.containerClassName,!0).style("cursor","pointer"),W.exit().each(function(){d.select(this).selectAll("g."+o.headerGroupClassName).each(V)}).remove(),U.length!==0){var F=W.selectAll("g."+o.headerGroupClassName).data(U,s);F.enter().append("g").classed(o.headerGroupClassName,!0);for(var H=i.ensureSingle(W,"g",o.dropdownButtonGroupClassName,function(be){be.style("pointer-events","all")}),q=0;q{var d=kS();Y.exports={moduleType:"component",name:d.name,layoutAttributes:kL(),supplyLayoutDefaults:VW(),draw:qW()}}),V4=ze((te,Y)=>{Y.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}}),TL=ze((te,Y)=>{var d=On(),y=Yx(),z=nn().extendDeepAll,P=oh().overrideAll,i=Fl(),n=ku().templatedArray,a=V4(),l=n("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});Y.exports=P(n("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:l,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:z(y({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:i.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:d({})},font:d({}),activebgcolor:{valType:"color",dflt:a.gripBgActiveColor},bgcolor:{valType:"color",dflt:a.railBgColor},bordercolor:{valType:"color",dflt:a.railBorderColor},borderwidth:{valType:"number",min:0,dflt:a.railBorderWidth},ticklen:{valType:"number",min:0,dflt:a.tickLength},tickcolor:{valType:"color",dflt:a.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:a.minorTickLength}}),"arraydraw","from-root")}),ZW=ze((te,Y)=>{var d=ji(),y=Zd(),z=TL(),P=V4(),i=P.name,n=z.steps;Y.exports=function(o,u){y(o,u,{name:i,handleItemDefaults:a})};function a(o,u,s){function h(w,D){return d.coerce(o,u,z,w,D)}for(var m=y(o,u,{name:"steps",handleItemDefaults:l}),b=0,x=0;x{var d=ri(),y=sh(),z=Xi(),P=Zs(),i=ji(),n=i.strTranslate,a=cc(),l=ku().arrayEditor,o=V4(),u=Rf(),s=u.LINE_SPACING,h=u.FROM_TL,m=u.FROM_BR;Y.exports=function(W){var F=W._context.staticPlot,H=W._fullLayout,q=x(H,W),G=H._infolayer.selectAll("g."+o.containerClassName).data(q.length>0?[0]:[]);G.enter().append("g").classed(o.containerClassName,!0).style("cursor",F?null:"ew-resize");function ee(ce){ce._commandObserver&&(ce._commandObserver.remove(),delete ce._commandObserver),y.autoMargin(W,b(ce))}if(G.exit().each(function(){d.select(this).selectAll("g."+o.groupClassName).each(ee)}).remove(),q.length!==0){var he=G.selectAll("g."+o.groupClassName).data(q,_);he.enter().append("g").classed(o.groupClassName,!0),he.exit().each(ee).remove();for(var be=0;be0&&(be=be.transition().duration(F.transition.duration).ease(F.transition.easing)),be.attr("transform",n(he-o.gripWidth*.5,F._dims.currentValueTotalHeight))}}function N(W,F){var H=W._dims;return H.inputAreaStart+o.stepInset+(H.inputAreaLength-2*o.stepInset)*Math.min(1,Math.max(0,F))}function B(W,F){var H=W._dims;return Math.min(1,Math.max(0,(F-o.stepInset-H.inputAreaStart)/(H.inputAreaLength-2*o.stepInset-2*H.inputAreaStart)))}function U(W,F,H){var q=H._dims,G=i.ensureSingle(W,"rect",o.railTouchRectClass,function(ee){ee.call(p,F,W,H).style("pointer-events","all")});G.attr({width:q.inputAreaLength,height:Math.max(q.inputAreaWidth,o.tickOffset+H.ticklen+q.labelHeight)}).call(z.fill,H.bgcolor).attr("opacity",0),P.setTranslate(G,0,q.currentValueTotalHeight)}function V(W,F){var H=F._dims,q=H.inputAreaLength-o.railInset*2,G=i.ensureSingle(W,"rect",o.railRectClass);G.attr({width:q,height:o.railWidth,rx:o.railRadius,ry:o.railRadius,"shape-rendering":"crispEdges"}).call(z.stroke,F.bordercolor).call(z.fill,F.bgcolor).style("stroke-width",F.borderwidth+"px"),P.setTranslate(G,o.railInset,(H.inputAreaWidth-o.railWidth)*.5+H.currentValueTotalHeight)}}),YW=ze((te,Y)=>{var d=V4();Y.exports={moduleType:"component",name:d.name,layoutAttributes:TL(),supplyLayoutDefaults:ZW(),draw:KW()}}),TS=ze((te,Y)=>{var d=Mi();Y.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}),SL=ze((te,Y)=>{Y.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}),SS=ze((te,Y)=>{Y.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}),XW=ze(te=>{var Y=Zc(),d=cc(),y=SS(),z=Rf().LINE_SPACING,P=y.name;function i(n){var a=n&&n[P];return a&&a.visible}te.isVisible=i,te.makeData=function(n){for(var a=Y.list({_fullLayout:n},"x",!0),l=n.margin,o=[],u=0;u{var d=ji(),y=ku(),z=Zc(),P=TS(),i=SL();Y.exports=function(n,a,l){var o=n[l],u=a[l];if(!(o.rangeslider||a._requestRangeslider[u._id]))return;d.isPlainObject(o.rangeslider)||(o.rangeslider={});var s=o.rangeslider,h=y.newContainer(u,"rangeslider");function m(g,C){return d.coerce(s,h,P,g,C)}var b,x;function _(g,C){return d.coerce(b,x,i,g,C)}var A=m("visible");if(A){m("bgcolor",a.plot_bgcolor),m("bordercolor"),m("borderwidth"),m("thickness"),m("autorange",!u.isValidRange(s.range)),m("range");var f=a._subplots;if(f)for(var k=f.cartesian.filter(function(g){return g.substr(0,g.indexOf("y"))===z.name2id(l)}).map(function(g){return g.substr(g.indexOf("y"),g.length)}),w=d.simpleMap(k,z.id2name),D=0;D{var d=Zc().list,y=Jm().getAutoRange,z=SS();Y.exports=function(P){for(var i=d(P,"x",!0),n=0;n{var d=ri(),y=as(),z=sh(),P=ji(),i=P.strTranslate,n=Zs(),a=Xi(),l=Np(),o=Ff(),u=Zc(),s=jp(),h=Em(),m=SS();Y.exports=function(p){for(var g=p._fullLayout,C=g._rangeSliderData,T=0;T=mt.max)tt=Ce[_t+1];else if(Ge=mt.pmax)tt=Ce[_t+1];else if(Ge0?p.touches[0].clientX:0}function x(p,g,C,T){if(g._context.staticPlot)return;var N=p.select("rect."+m.slideBoxClassName).node(),B=p.select("rect."+m.grabAreaMinClassName).node(),U=p.select("rect."+m.grabAreaMaxClassName).node();function V(){var W=d.event,F=W.target,H=b(W),q=H-p.node().getBoundingClientRect().left,G=T.d2p(C._rl[0]),ee=T.d2p(C._rl[1]),he=s.coverSlip();this.addEventListener("touchmove",be),this.addEventListener("touchend",ve),he.addEventListener("mousemove",be),he.addEventListener("mouseup",ve);function be(ce){var re=b(ce),ge=+re-H,ne,se,_e;switch(F){case N:if(_e="ew-resize",G+ge>C._length||ee+ge<0)return;ne=G+ge,se=ee+ge;break;case B:if(_e="col-resize",G+ge>C._length)return;ne=G+ge,se=ee;break;case U:if(_e="col-resize",ee+ge<0)return;ne=G,se=ee+ge;break;default:_e="ew-resize",ne=q,se=q+ge;break}if(se{var d=ji(),y=TS(),z=SL(),P=XW();Y.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:d.extendFlat({},y,{yaxis:z})}}},layoutAttributes:TS(),handleDefaults:JW(),calcAutorange:QW(),draw:eq(),isVisible:P.isVisible,makeData:P.makeData,autoMarginOpts:P.autoMarginOpts}}),CS=ze((te,Y)=>{var d=On(),y=Mi(),z=ku().templatedArray,P=z("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});Y.exports={visible:{valType:"boolean",editType:"plot"},buttons:P,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:d({editType:"plot"}),bgcolor:{valType:"color",dflt:y.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:y.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}),CL=ze((te,Y)=>{Y.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}),rq=ze((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=Zd(),i=CS(),n=CL();Y.exports=function(o,u,s,h,m){var b=o.rangeselector||{},x=z.newContainer(u,"rangeselector");function _(D,E){return d.coerce(b,x,i,D,E)}var A=P(b,x,{name:"buttons",handleItemDefaults:a,calendar:m}),f=_("visible",A.length>0);if(f){var k=l(u,s,h);_("x",k[0]),_("y",k[1]),d.noneOrAll(o,u,["x","y"]),_("xanchor"),_("yanchor"),d.coerceFont(_,"font",s.font);var w=_("bgcolor");_("activecolor",y.contrast(w,n.lightAmount,n.darkAmount)),_("bordercolor"),_("borderwidth")}};function a(o,u,s,h){var m=h.calendar;function b(A,f){return d.coerce(o,u,i.buttons,A,f)}var x=b("visible");if(x){var _=b("step");_!=="all"&&(m&&m!=="gregorian"&&(_==="month"||_==="year")?u.stepmode="backward":b("stepmode"),b("count")),b("label")}}function l(o,u,s){for(var h=s.filter(function(_){return u[_].anchor===o._id}),m=0,b=0;b{var d=on(),y=ji().titleCase;Y.exports=function(P,i){var n=P._name,a={};if(i.step==="all")a[n+".autorange"]=!0;else{var l=z(P,i);a[n+".range[0]"]=l[0],a[n+".range[1]"]=l[1]}return a};function z(P,i){var n=P.range,a=new Date(P.r2l(n[1])),l=i.step,o=d["utc"+y(l)],u=i.count,s;switch(i.stepmode){case"backward":s=P.l2r(+o.offset(a,-u));break;case"todate":var h=o.offset(a,-u);s=P.l2r(+o.ceil(h));break}var m=n[1];return[s,m]}}),nq=ze((te,Y)=>{var d=ri(),y=as(),z=sh(),P=Xi(),i=Zs(),n=ji(),a=n.strTranslate,l=cc(),o=Zc(),u=Rf(),s=u.LINE_SPACING,h=u.FROM_TL,m=u.FROM_BR,b=CL(),x=iq();Y.exports=function(M){var p=M._fullLayout,g=p._infolayer.selectAll(".rangeselector").data(_(M),A);g.enter().append("g").classed("rangeselector",!0),g.exit().remove(),g.style({cursor:"pointer","pointer-events":"all"}),g.each(function(C){var T=d.select(this),N=C,B=N.rangeselector,U=T.selectAll("g.button").data(n.filterVisible(B.buttons));U.enter().append("g").classed("button",!0),U.exit().remove(),U.each(function(V){var W=d.select(this),F=x(N,V);V._isActive=f(N,V,F),W.call(k,B,V),W.call(D,B,V,M),W.on("click",function(){M._dragged||y.call("_guiRelayout",M,F)}),W.on("mouseover",function(){V._isHovered=!0,W.call(k,B,V)}),W.on("mouseout",function(){V._isHovered=!1,W.call(k,B,V)})}),I(M,U,B,N._name,T)})};function _(M){for(var p=o.list(M,"x",!0),g=[],C=0;C{Y.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:CS()}}},layoutAttributes:CS(),handleDefaults:rq(),draw:nq()}}),Xh=ze(te=>{var Y=nn().extendFlat;te.attributes=function(d,y){d=d||{},y=y||{};var z={valType:"info_array",editType:d.editType,items:[{valType:"number",min:0,max:1,editType:d.editType},{valType:"number",min:0,max:1,editType:d.editType}],dflt:[0,1]};d.name&&d.name+"",d.trace,y.description&&""+y.description;var P={x:Y({},z,{}),y:Y({},z,{}),editType:d.editType};return d.noGridCell||(P.row={valType:"integer",min:0,dflt:0,editType:d.editType},P.column={valType:"integer",min:0,dflt:0,editType:d.editType}),P},te.defaults=function(d,y,z,P){var i=P&&P.x||[0,1],n=P&&P.y||[0,1],a=y.grid;if(a){var l=z("domain.column");l!==void 0&&(l{var d=ji(),y=go().counter,z=Xh().attributes,P=dc().idRegex,i=ku(),n={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[y("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[P.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:z({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function a(h,m,b){var x=m[b+"axes"],_=Object.keys((h._splomAxes||{})[b]||{});if(Array.isArray(x))return x;if(_.length)return _}function l(h,m){var b=h.grid||{},x=a(m,b,"x"),_=a(m,b,"y");if(!h.grid&&!x&&!_)return;var A=Array.isArray(b.subplots)&&Array.isArray(b.subplots[0]),f=Array.isArray(x),k=Array.isArray(_),w=f&&x!==b.xaxes&&k&&_!==b.yaxes,D,E;A?(D=b.subplots.length,E=b.subplots[0].length):(k&&(D=_.length),f&&(E=x.length));var I=i.newContainer(m,"grid");function M(F,H){return d.coerce(b,I,n,F,H)}var p=M("rows",D),g=M("columns",E);if(!(p*g>1)){delete m.grid;return}if(!A&&!f&&!k){var C=M("pattern")==="independent";C&&(A=!0)}I._hasSubplotGrid=A;var T=M("roworder"),N=T==="top to bottom",B=A?.2:.1,U=A?.3:.1,V,W;w&&m._splomGridDflt&&(V=m._splomGridDflt.xside,W=m._splomGridDflt.yside),I._domains={x:o("x",M,B,V,g),y:o("y",M,U,W,p,N)}}function o(h,m,b,x,_,A){var f=m(h+"gap",b),k=m("domain."+h);m(h+"side",x);for(var w=new Array(_),D=k[0],E=(k[1]-D)/(_-f),I=E*(1-f),M=0;M<_;M++){var p=D+E*M;w[A?_-1-M:M]=[p,p+I]}return w}function u(h,m){var b=m.grid;if(!(!b||!b._domains)){var x=h.grid||{},_=m._subplots,A=b._hasSubplotGrid,f=b.rows,k=b.columns,w=b.pattern==="independent",D,E,I,M,p,g,C,T=b._axisMap={};if(A){var N=x.subplots||[];g=b.subplots=new Array(f);var B=1;for(D=0;D{Y.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}),oq=ze((te,Y)=>{var d=Sr(),y=as(),z=ji(),P=ku(),i=ML();Y.exports=function(n,a,l,o){var u="error_"+o.axis,s=P.newContainer(a,u),h=n[u]||{};function m(w,D){return z.coerce(h,s,i,w,D)}var b=h.array!==void 0||h.value!==void 0||h.type==="sqrt",x=m("visible",b);if(x!==!1){var _=m("type","array"in h?"data":"percent"),A=!0;_!=="sqrt"&&(A=m("symmetric",!((_==="data"?"arrayminus":"valueminus")in h))),_==="data"?(m("array"),m("traceref"),A||(m("arrayminus"),m("tracerefminus"))):(_==="percent"||_==="constant")&&(m("value"),A||m("valueminus"));var f="copy_"+o.inherit+"style";if(o.inherit){var k=a["error_"+o.inherit];(k||{}).visible&&m(f,!(h.color||d(h.thickness)||d(h.width)))}(!o.inherit||!s[f])&&(m("color",l),m("thickness"),m("width",y.traceIs(a,"gl3d")?0:4))}}}),EL=ze((te,Y)=>{Y.exports=function(y){var z=y.type,P=y.symmetric;if(z==="data"){var i=y.array||[];if(P)return function(o,u){var s=+i[u];return[s,s]};var n=y.arrayminus||[];return function(o,u){var s=+i[u],h=+n[u];return!isNaN(s)||!isNaN(h)?[h||0,s||0]:[NaN,NaN]}}else{var a=d(z,y.value),l=d(z,y.valueminus);return P||y.valueminus===void 0?function(o){var u=a(o);return[u,u]}:function(o){return[l(o),a(o)]}}};function d(y,z){if(y==="percent")return function(P){return Math.abs(P*z/100)};if(y==="constant")return function(){return Math.abs(z)};if(y==="sqrt")return function(P){return Math.sqrt(Math.abs(P))}}}),sq=ze((te,Y)=>{var d=Sr(),y=as(),z=Os(),P=ji(),i=EL();Y.exports=function(a){for(var l=a.calcdata,o=0;o{var d=ri(),y=Sr(),z=Zs(),P=Bc();Y.exports=function(n,a,l,o){var u,s=l.xaxis,h=l.yaxis,m=o&&o.duration>0,b=n._context.staticPlot;a.each(function(x){var _=x[0].trace,A=_.error_x||{},f=_.error_y||{},k;_.ids&&(k=function(I){return I.id});var w=P.hasMarkers(_)&&_.marker.maxdisplayed>0;!f.visible&&!A.visible&&(x=[]);var D=d.select(this).selectAll("g.errorbar").data(x,k);if(D.exit().remove(),!!x.length){A.visible||D.selectAll("path.xerror").remove(),f.visible||D.selectAll("path.yerror").remove(),D.style("opacity",1);var E=D.enter().append("g").classed("errorbar",!0);m&&E.style("opacity",0).transition().duration(o.duration).style("opacity",1),z.setClipUrl(D,l.layerClipId,n),D.each(function(I){var M=d.select(this),p=i(I,s,h);if(!(w&&!I.vis)){var g,C=M.select("path.yerror");if(f.visible&&y(p.x)&&y(p.yh)&&y(p.ys)){var T=f.width;g="M"+(p.x-T)+","+p.yh+"h"+2*T+"m-"+T+",0V"+p.ys,p.noYS||(g+="m-"+T+",0h"+2*T),u=!C.size(),u?C=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("yerror",!0):m&&(C=C.transition().duration(o.duration).ease(o.easing)),C.attr("d",g)}else C.remove();var N=M.select("path.xerror");if(A.visible&&y(p.y)&&y(p.xh)&&y(p.xs)){var B=(A.copy_ystyle?f:A).width;g="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(g+="m0,-"+B+"v"+2*B),u=!N.size(),u?N=M.append("path").style("vector-effect",b?"none":"non-scaling-stroke").classed("xerror",!0):m&&(N=N.transition().duration(o.duration).ease(o.easing)),N.attr("d",g)}else N.remove()}})}})};function i(n,a,l){var o={x:a.c2p(n.x),y:l.c2p(n.y)};return n.yh!==void 0&&(o.yh=l.c2p(n.yh),o.ys=l.c2p(n.ys),y(o.ys)||(o.noYS=!0,o.ys=l.c2p(n.ys,!0))),n.xh!==void 0&&(o.xh=a.c2p(n.xh),o.xs=a.c2p(n.xs),y(o.xs)||(o.noXS=!0,o.xs=a.c2p(n.xs,!0))),o}}),uq=ze((te,Y)=>{var d=ri(),y=Xi();Y.exports=function(z){z.each(function(P){var i=P[0].trace,n=i.error_y||{},a=i.error_x||{},l=d.select(this);l.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(y.stroke,n.color),a.copy_ystyle&&(a=n),l.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(y.stroke,a.color)})}}),cq=ze((te,Y)=>{var d=ji(),y=oh().overrideAll,z=ML(),P={error_x:d.extendFlat({},z),error_y:d.extendFlat({},z)};delete P.error_x.copy_zstyle,delete P.error_y.copy_zstyle,delete P.error_y.copy_ystyle;var i={error_x:d.extendFlat({},z),error_y:d.extendFlat({},z),error_z:d.extendFlat({},z)};delete i.error_x.copy_ystyle,delete i.error_y.copy_ystyle,delete i.error_z.copy_ystyle,delete i.error_z.copy_zstyle,Y.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:P,bar:P,histogram:P,scatter3d:y(i,"calc","nested"),scattergl:y(P,"calc","nested")}},supplyDefaults:oq(),calc:sq(),makeComputeError:EL(),plot:lq(),style:uq(),hoverInfo:n};function n(a,l,o){(l.error_y||{}).visible&&(o.yerr=a.yh-a.y,l.error_y.symmetric||(o.yerrneg=a.y-a.ys)),(l.error_x||{}).visible&&(o.xerr=a.xh-a.x,l.error_x.symmetric||(o.xerrneg=a.x-a.xs))}}),hq=ze((te,Y)=>{Y.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}),fq=ze((te,Y)=>{var d=ri(),y=ln(),z=sh(),P=as(),i=Os(),n=jp(),a=ji(),l=a.strTranslate,o=nn().extendFlat,u=Em(),s=Zs(),h=Xi(),m=Np(),b=cc(),x=hp().flipScale,_=db(),A=Cw(),f=Gd(),k=Rf(),w=k.LINE_SPACING,D=k.FROM_TL,E=k.FROM_BR,I=hq().cn;function M(B){var U=B._fullLayout,V=U._infolayer.selectAll("g."+I.colorbar).data(p(B),function(W){return W._id});V.enter().append("g").attr("class",function(W){return W._id}).classed(I.colorbar,!0),V.each(function(W){var F=d.select(this);a.ensureSingle(F,"rect",I.cbbg),a.ensureSingle(F,"g",I.cbfills),a.ensureSingle(F,"g",I.cblines),a.ensureSingle(F,"g",I.cbaxis,function(q){q.classed(I.crisp,!0)}),a.ensureSingle(F,"g",I.cbtitleunshift,function(q){q.append("g").classed(I.cbtitle,!0)}),a.ensureSingle(F,"rect",I.cboutline);var H=g(F,W,B);H&&H.then&&(B._promises||[]).push(H),B._context.edits.colorbarPosition&&C(F,W,B)}),V.exit().each(function(W){z.autoMargin(B,W._id)}).remove(),V.order()}function p(B){var U=B._fullLayout,V=B.calcdata,W=[],F,H,q,G;function ee(J){return o(J,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function he(){typeof G.calc=="function"?G.calc(B,q,F):(F._fillgradient=H.reversescale?x(H.colorscale):H.colorscale,F._zrange=[H[G.min],H[G.max]])}for(var be=0;be1){var Xe=Math.pow(10,Math.floor(Math.log(Ot)/Math.LN10));ci*=Xe*a.roundUp(Ot/Xe,[2,5,10]),(Math.abs(_t.start)/_t.size+1e-6)%1<2e-6&&(ii.tick0=0)}ii.dtick=ci}ii.domain=W?[mr+ge/me.h,mr+nt-ge/me.h]:[mr+re/me.w,mr+nt-re/me.w],ii.setScale(),B.attr("transform",l(Math.round(me.l),Math.round(me.t)));var ot=B.select("."+I.cbtitleunshift).attr("transform",l(-Math.round(me.l),-Math.round(me.t))),De=ii.ticklabelposition,ye=ii.title.font.size,Pe=B.select("."+I.cbaxis),He,at=0,ht=0;function At(Dr,br){var fi={propContainer:ii,propName:U._propPrefix+"title.text",traceIndex:U._traceIndex,_meta:U._meta,placeholder:J._dfltTitle.colorbar,containerGroup:B.select("."+I.cbtitle)},un=Dr.charAt(0)==="h"?Dr.substr(1):"h"+Dr;B.selectAll("."+un+",."+un+"-math-group").remove(),m.draw(V,Dr,o(fi,br||{}))}function Wt(){if(W&&Lr||!W&&!Lr){var Dr,br;Be==="top"&&(Dr=re+me.l+xt*ne,br=ge+me.t+ut*(1-mr-nt)+3+ye*.75),Be==="bottom"&&(Dr=re+me.l+xt*ne,br=ge+me.t+ut*(1-mr)-3-ye*.25),Be==="right"&&(br=ge+me.t+ut*se+3+ye*.75,Dr=re+me.l+xt*mr),At(ii._id+"title",{attributes:{x:Dr,y:br,"text-anchor":W?"start":"middle"}})}}function Yt(){if(W&&!Lr||!W&&Lr){var Dr=ii.position||0,br=ii._offset+ii._length/2,fi,un;if(Be==="right")un=br,fi=me.l+xt*Dr+10+ye*(ii.showticklabels?1:.5);else if(fi=br,Be==="bottom"&&(un=me.t+ut*Dr+10+(De.indexOf("inside")===-1?ii.tickfont.size:0)+(ii.ticks!=="inside"&&U.ticklen||0)),Be==="top"){var cn=Re.text.split("
").length;un=me.t+ut*Dr+10-Ae-w*ye*cn}At((W?"h":"v")+ii._id+"title",{avoid:{selection:d.select(V).selectAll("g."+ii._id+"tick"),side:Be,offsetTop:W?0:me.t,offsetLeft:W?me.l:0,maxShift:W?J.width:J.height},attributes:{x:fi,y:un,"text-anchor":"middle"},transform:{rotate:W?-90:0,offset:0}})}}function hr(){if(!W&&!Lr||W&&Lr){var Dr=B.select("."+I.cbtitle),br=Dr.select("text"),fi=[-ee/2,ee/2],un=Dr.select(".h"+ii._id+"title-math-group").node(),cn=15.6;br.node()&&(cn=parseInt(br.node().style.fontSize,10)*w);var yn;if(un?(yn=s.bBox(un),ht=yn.width,at=yn.height,at>cn&&(fi[1]-=(at-cn)/2)):br.node()&&!br.classed(I.jsPlaceholder)&&(yn=s.bBox(br.node()),ht=yn.width,at=yn.height),W){if(at){if(at+=5,Be==="top")ii.domain[1]-=at/me.h,fi[1]*=-1;else{ii.domain[0]+=at/me.h;var Gn=b.lineCount(br);fi[1]+=(1-Gn)*cn}Dr.attr("transform",l(fi[0],fi[1])),ii.setScale()}}else ht&&(Be==="right"&&(ii.domain[0]+=(ht+ye/2)/me.w),Dr.attr("transform",l(fi[0],fi[1])),ii.setScale())}B.selectAll("."+I.cbfills+",."+I.cblines).attr("transform",W?l(0,Math.round(me.h*(1-ii.domain[1]))):l(Math.round(me.w*ii.domain[0]),0)),Pe.attr("transform",W?l(0,Math.round(-me.t)):l(Math.round(-me.l),0));var Sn=B.select("."+I.cbfills).selectAll("rect."+I.cbfill).attr("style","").data(vt);Sn.enter().append("rect").classed(I.cbfill,!0).attr("style",""),Sn.exit().remove();var dn=Ze.map(ii.c2p).map(Math.round).sort(function(_r,Er){return _r-Er});Sn.each(function(_r,Er){var di=[Er===0?Ze[0]:(vt[Er]+vt[Er-1])/2,Er===vt.length-1?Ze[1]:(vt[Er]+vt[Er+1])/2].map(ii.c2p).map(Math.round);W&&(di[1]=a.constrain(di[1]+(di[1]>di[0])?1:-1,dn[0],dn[1]));var qi=d.select(this).attr(W?"x":"y",Et).attr(W?"y":"x",d.min(di)).attr(W?"width":"height",Math.max(Ae,2)).attr(W?"height":"width",Math.max(d.max(di)-d.min(di),2));if(U._fillgradient)s.gradient(qi,V,U._id,W?"vertical":"horizontalreversed",U._fillgradient,"fill");else{var Ui=tt(_r).replace("e-","");qi.attr("fill",y(Ui).toHexString())}});var va=B.select("."+I.cblines).selectAll("path."+I.cbline).data(Ce.color&&Ce.width?ct:[]);va.enter().append("path").classed(I.cbline,!0),va.exit().remove(),va.each(function(_r){var Er=Et,di=Math.round(ii.c2p(_r))+Ce.width/2%1;d.select(this).attr("d","M"+(W?Er+","+di:di+","+Er)+(W?"h":"v")+Ae).call(s.lineGroupStyle,Ce.width,Ge(_r),Ce.dash)}),Pe.selectAll("g."+ii._id+"tick,path").remove();var na=Et+Ae+(ee||0)/2-(U.ticks==="outside"?1:0),Kt=i.calcTicks(ii),lr=i.getTickSigns(ii)[2];return i.drawTicks(V,ii,{vals:ii.ticks==="inside"?i.clipEnds(ii,Kt):Kt,layer:Pe,path:i.makeTickPath(ii,na,lr),transFn:i.makeTransTickFn(ii)}),i.drawLabels(V,ii,{vals:Kt,layer:Pe,transFn:i.makeTransTickLabelFn(ii),labelFns:i.makeLabelFns(ii,na)})}function zr(){var Dr,br=Ae+ee/2;De.indexOf("inside")===-1&&(Dr=s.bBox(Pe.node()),br+=W?Dr.width:Dr.height),He=ot.select("text");var fi=0,un=W&&Be==="top",cn=!W&&Be==="right",yn=0;if(He.node()&&!He.classed(I.jsPlaceholder)){var Gn,Sn=ot.select(".h"+ii._id+"title-math-group").node();Sn&&(W&&Lr||!W&&!Lr)?(Dr=s.bBox(Sn),fi=Dr.width,Gn=Dr.height):(Dr=s.bBox(ot.node()),fi=Dr.right-me.l-(W?Et:Yr),Gn=Dr.bottom-me.t-(W?Yr:Et),!W&&Be==="top"&&(br+=Dr.height,yn=Dr.height)),cn&&(He.attr("transform",l(fi/2+ye/2,0)),fi*=2),br=Math.max(br,W?fi:Gn)}var dn=(W?re:ge)*2+br+he+ee/2,va=0;!W&&Re.text&&ce==="bottom"&&se<=0&&(va=dn/2,dn+=va,yn+=va),J._hColorbarMoveTitle=va,J._hColorbarMoveCBTitle=yn;var na=he+ee,Kt=(W?Et:Yr)-na/2-(W?re:0),lr=(W?Yr:Et)-(W?Le:ge+yn-va);B.select("."+I.cbbg).attr("x",Kt).attr("y",lr).attr(W?"width":"height",Math.max(dn-va,2)).attr(W?"height":"width",Math.max(Le+na,2)).call(h.fill,be).call(h.stroke,U.bordercolor).style("stroke-width",he);var _r=cn?Math.max(fi-10,0):0;B.selectAll("."+I.cboutline).attr("x",(W?Et:Yr+re)+_r).attr("y",(W?Yr+ge-Le:Et)+(un?at:0)).attr(W?"width":"height",Math.max(Ae,2)).attr(W?"height":"width",Math.max(Le-(W?2*ge+at:2*re+_r),2)).call(h.stroke,U.outlinecolor).style({fill:"none","stroke-width":ee});var Er=W?Gt*dn:0,di=W?0:(1-Qt)*dn-yn;if(Er=oe?me.l-Er:-Er,di=_e?me.t-di:-di,B.attr("transform",l(Er,di)),!W&&(he||y(be).getAlpha()&&!y.equals(J.paper_bgcolor,be))){var qi=Pe.selectAll("text"),Ui=qi[0].length,Hi=B.select("."+I.cbbg).node(),Ln=s.bBox(Hi),Fn=s.getTranslate(B),Kn=2;qi.each(function(si,Gr){var li=0,Pi=Ui-1;if(Gr===li||Gr===Pi){var xi=s.bBox(this),zt=s.getTranslate(this),xr;if(Gr===Pi){var Qr=xi.right+zt.x,Ri=Ln.right+Fn.x+Yr-he-Kn+ne;xr=Ri-Qr,xr>0&&(xr=0)}else if(Gr===li){var en=xi.left+zt.x,_n=Ln.left+Fn.x+Yr+he+Kn;xr=_n-en,xr<0&&(xr=0)}xr&&(Ui<3?this.setAttribute("transform","translate("+xr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Jn={},sa=D[ve],Mn=E[ve],Ha=D[ce],io=E[ce],Ft=dn-Ae;W?(H==="pixels"?(Jn.y=se,Jn.t=Le*Ha,Jn.b=Le*io):(Jn.t=Jn.b=0,Jn.yt=se+F*Ha,Jn.yb=se-F*io),G==="pixels"?(Jn.x=ne,Jn.l=dn*sa,Jn.r=dn*Mn):(Jn.l=Ft*sa,Jn.r=Ft*Mn,Jn.xl=ne-q*sa,Jn.xr=ne+q*Mn)):(H==="pixels"?(Jn.x=ne,Jn.l=Le*sa,Jn.r=Le*Mn):(Jn.l=Jn.r=0,Jn.xl=ne+F*sa,Jn.xr=ne-F*Mn),G==="pixels"?(Jn.y=1-se,Jn.t=dn*Ha,Jn.b=dn*io):(Jn.t=Ft*Ha,Jn.b=Ft*io,Jn.yt=se-q*Ha,Jn.yb=se+q*io));var Rt=U.y<.5?"b":"t",qr=U.x<.5?"l":"r";V._fullLayout._reservedMargin[U._id]={};var ai={r:J.width-Kt-Er,l:Kt+Jn.r,b:J.height-lr-di,t:lr+Jn.b};oe&&_e?z.autoMargin(V,U._id,Jn):oe?V._fullLayout._reservedMargin[U._id][Rt]=ai[Rt]:_e||W?V._fullLayout._reservedMargin[U._id][qr]=ai[qr]:V._fullLayout._reservedMargin[U._id][Rt]=ai[Rt]}return a.syncOrAsync([z.previousPromises,Wt,hr,Yt,z.previousPromises,zr],V)}function C(B,U,V){var W=U.orientation==="v",F=V._fullLayout,H=F._size,q,G,ee;n.init({element:B.node(),gd:V,prepFn:function(){q=B.attr("transform"),u(B)},moveFn:function(he,be){B.attr("transform",q+l(he,be)),G=n.align((W?U._uFrac:U._vFrac)+he/H.w,W?U._thickFrac:U._lenFrac,0,1,U.xanchor),ee=n.align((W?U._vFrac:1-U._uFrac)-be/H.h,W?U._lenFrac:U._thickFrac,0,1,U.yanchor);var ve=n.getCursor(G,ee,U.xanchor,U.yanchor);u(B,ve)},doneFn:function(){if(u(B),G!==void 0&&ee!==void 0){var he={};he[U._propPrefix+"x"]=G,he[U._propPrefix+"y"]=ee,U._traceIndex!==void 0?P.call("_guiRestyle",V,he,U._traceIndex):P.call("_guiRelayout",V,he)}}})}function T(B,U,V){var W=U._levels,F=[],H=[],q,G,ee=W.end+W.size/100,he=W.size,be=1.001*V[0]-.001*V[1],ve=1.001*V[1]-.001*V[0];for(G=0;G<1e5&&(q=W.start+G*he,!(he>0?q>=ee:q<=ee));G++)q>be&&q0?q>=ee:q<=ee));G++)q>V[0]&&q{Y.exports={moduleType:"component",name:"colorbar",attributes:A_(),supplyDefaults:X1(),draw:fq().draw,hasColorbar:Mm()}}),pq=ze((te,Y)=>{Y.exports={moduleType:"component",name:"legend",layoutAttributes:hw(),supplyLayoutDefaults:eb(),draw:dw(),style:C4()}}),mq=ze((te,Y)=>{Y.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}),gq=ze((te,Y)=>{Y.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}),LL=ze((te,Y)=>{var d=as(),y=ji(),z=y.extendFlat,P=y.extendDeep;function i(a){var l;switch(a){case"themes__thumb":l={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":l={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:l={}}return l}function n(a){var l=["xaxis","yaxis","zaxis"];return l.indexOf(a.slice(0,5))>-1}Y.exports=function(a,l){var o,u=a.data,s=a.layout,h=P([],u),m=P({},s,i(l.tileClass)),b=a._context||{};if(l.width&&(m.width=l.width),l.height&&(m.height=l.height),l.tileClass==="thumbnail"||l.tileClass==="themes__thumb"){m.annotations=[];var x=Object.keys(m);for(o=0;o{var d=qg().EventEmitter,y=as(),z=ji(),P=Y0(),i=LL(),n=cb(),a=hb();function l(o,u){var s=new d,h=i(o,{format:"png"}),m=h.gd;m.style.position="absolute",m.style.left="-5000px",document.body.appendChild(m);function b(){var _=P.getDelay(m._fullLayout);setTimeout(function(){var A=n(m),f=document.createElement("canvas");f.id=z.randstr(),s=a({format:u.format,width:m._fullLayout.width,height:m._fullLayout.height,canvas:f,emitter:s,svg:A}),s.clean=function(){m&&document.body.removeChild(m)}},_)}var x=P.getRedrawFunc(m);return y.call("_doPlot",m,h.data,h.layout,h.config).then(x).then(b).catch(function(_){s.emit("error",_)}),s}Y.exports=l}),yq=ze((te,Y)=>{var d=Y0(),y={getDelay:d.getDelay,getRedrawFunc:d.getRedrawFunc,clone:LL(),toSVG:cb(),svgToImg:hb(),toImage:vq(),downloadImage:Sw()};Y.exports=y}),_q=ze(te=>{te.version=Si().version,Ci(),sw();var Y=as(),d=te.register=Y.register,y=yS(),z=Object.keys(y);for(i=0;i{Y.exports=_q()}),mb=ze((te,Y)=>{Y.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}),Xv=ze((te,Y)=>{var d=ff(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=Oc(),a=On(),l=mb(),o=qd().pattern,u=nn().extendFlat,s=a({editType:"calc",arrayOk:!0,colorEditType:"style"}),h=d.marker,m=h.line,b=u({},m.width,{dflt:0}),x=u({width:b,editType:"calc"},n("marker.line")),_=u({line:x,editType:"calc"},n("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:o,cornerradius:{valType:"any",editType:"calc"}});Y.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),text:d.text,texttemplate:P({editType:"plot"},{keys:l.eventDataKeys}),texttemplatefallback:i({editType:"plot"}),hovertext:d.hovertext,hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:i(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:u({},s,{}),insidetextfont:u({},s,{}),outsidetextfont:u({},s,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:u({},d.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:_,offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:{marker:{opacity:d.selected.marker.opacity,color:d.selected.marker.color,editType:"style"},textfont:d.selected.textfont,editType:"style"},unselected:{marker:{opacity:d.unselected.marker.opacity,color:d.unselected.marker.color,editType:"style"},textfont:d.unselected.textfont,editType:"style"},zorder:d.zorder}}),AS=ze((te,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}}),MS=ze((te,Y)=>{var d=Xi(),y=hp().hasColorscale,z=Cc(),P=ji().coercePattern;Y.exports=function(i,n,a,l,o){var u=a("marker.color",l),s=y(i,"marker");s&&z(i,n,o,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",d.defaultLine),y(i,"marker.line")&&z(i,n,o,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),P(a,"marker.pattern",u,s),a("selected.marker.color"),a("unselected.marker.color")}}),tg=ze((te,Y)=>{var d=Sr(),y=ji(),z=Xi(),P=as(),i=Jg(),n=S0(),a=MS(),l=Yv(),o=Xv(),u=y.coerceFont;function s(x,_,A,f){function k(M,p){return y.coerce(x,_,o,M,p)}var w=i(x,_,f,k);if(!w){_.visible=!1;return}n(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("zorder"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");b(x,_,f,k,D,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),a(x,_,k,A,f);var E=(_.marker.line||{}).color,I=P.getComponentMethod("errorbars","supplyDefaults");I(x,_,E||z.defaultLine,{axis:"y"}),I(x,_,E||z.defaultLine,{axis:"x",inherit:"y"}),y.coerceSelectionMarkerOpacity(_,k)}function h(x,_){var A,f;function k(E,I){return y.coerce(f._input,f,o,E,I)}for(var w=0;w=0)return x}else if(typeof x=="string"&&(x=x.trim(),x.slice(-1)==="%"&&d(x.slice(0,-1))&&(x=+x.slice(0,-1),x>=0)))return x+"%"}function b(x,_,A,f,k,w){w=w||{};var D=w.moduleHasSelected!==!1,E=w.moduleHasUnselected!==!1,I=w.moduleHasConstrain!==!1,M=w.moduleHasCliponaxis!==!1,p=w.moduleHasTextangle!==!1,g=w.moduleHasInsideanchor!==!1,C=!!w.hasPathbar,T=Array.isArray(k)||k==="auto",N=T||k==="inside",B=T||k==="outside";if(N||B){var U=u(f,"textfont",A.font),V=y.extendFlat({},U),W=x.textfont&&x.textfont.color,F=!W;if(F&&delete V.color,u(f,"insidetextfont",V),C){var H=y.extendFlat({},U);F&&delete H.color,u(f,"pathbar.textfont",H)}B&&u(f,"outsidetextfont",U),D&&f("selected.textfont.color"),E&&f("unselected.textfont.color"),I&&f("constraintext"),M&&f("cliponaxis"),p&&f("textangle"),f("texttemplate"),f("texttemplatefallback")}N&&g&&f("insidetextanchor")}Y.exports={supplyDefaults:s,crossTraceDefaults:h,handleText:b,validateCornerradius:m}}),PL=ze((te,Y)=>{var d=as(),y=Os(),z=ji(),P=AS(),i=tg().validateCornerradius;Y.exports=function(n,a,l){function o(D,E){return z.coerce(n,a,P,D,E)}for(var u=!1,s=!1,h=!1,m={},b=o("barmode"),x=b==="group",_=0;_0&&!m[f]&&(h=!0),m[f]=!0),A.visible&&A.type==="histogram"){var k=y.getFromId({_fullLayout:a},A[A.orientation==="v"?"xaxis":"yaxis"]);k.type!=="category"&&(s=!0)}}if(!u){delete a.barmode;return}b!=="overlay"&&o("barnorm"),o("bargap",s&&!h?0:.2),o("bargroupgap");var w=o("barcornerradius");a.barcornerradius=i(w)}}),W4=ze((te,Y)=>{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=Os(),y=Dm(),z=hp().hasColorscale,P=Tp(),i=W4(),n=$e();Y.exports=function(a,l){var o=d.getFromId(a,l.xaxis||"x"),u=d.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A={msUTC:!!(l.base||l.base===0)};l.orientation==="h"?(s=o.makeCalcdata(l,"x",A),m=u.makeCalcdata(l,"y"),b=y(l,u,"y",m),x=!!l.yperiodalignment,_="y"):(s=u.makeCalcdata(l,"y",A),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;for(var f=Math.min(h.length,s.length),k=new Array(f),w=0;w{var d=ri(),y=ji();function z(a,l,o){var u=a._fullLayout,s=u["_"+o+"Text_minsize"];if(s){var h=u.uniformtext.mode==="hide",m;switch(o){case"funnelarea":case"pie":case"sunburst":m="g.slice";break;case"treemap":case"icicle":m="g.slice, g.pathbar";break;default:m="g.points > g.point"}l.selectAll(m).each(function(b){var x=b.transform;if(x){x.scale=h&&x.hide?0:s/x.fontSize;var _=d.select(this).select("text");y.setTransormAndDisplay(_,x)}})}}function P(a,l,o){if(o.uniformtext.mode){var u=n(a),s=o.uniformtext.minsize,h=l.scale*l.fontSize;l.hide=h{var Y=Sr(),d=ln(),y=ji().isArrayOrTypedArray;te.coerceString=function(z,P,i){if(typeof P=="string"){if(P||!z.noBlank)return P}else if((typeof P=="number"||P===!0)&&!z.strict)return String(P);return i!==void 0?i:z.dflt},te.coerceNumber=function(z,P,i){if(Y(P)){P=+P;var n=z.min,a=z.max,l=n!==void 0&&Pa;if(!l)return P}return i!==void 0?i:z.dflt},te.coerceColor=function(z,P,i){return d(P).isValid()?P:i!==void 0?i:z.dflt},te.coerceEnumerated=function(z,P,i){return z.coerceNumber&&(P=+P),z.values.indexOf(P)!==-1?P:i!==void 0?i:z.dflt},te.getValue=function(z,P){var i;return y(z)?P{var d=ri(),y=Xi(),z=Zs(),P=ji(),i=as(),n=C0().resizeText,a=Xv(),l=a.textfont,o=a.insidetextfont,u=a.outsidetextfont,s=ES();function h(M){var p=d.select(M).selectAll('g[class^="barlayer"]').selectAll("g.trace");n(M,p,"bar");var g=p.size(),C=M._fullLayout;p.style("opacity",function(T){return T[0].trace.opacity}).each(function(T){(C.barmode==="stack"&&g>1||C.bargap===0&&C.bargroupgap===0&&!T[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(T){var N=d.select(this),B=T[0].trace;m(N,B,M)}),i.getComponentMethod("errorbars","style")(p)}function m(M,p,g){z.pointStyle(M.selectAll("path"),p,g),b(M,p,g)}function b(M,p,g){M.selectAll("text").each(function(C){var T=d.select(this),N=P.ensureUniformFontSize(g,f(T,C,p,g));z.font(T,N)})}function x(M,p,g){var C=p[0].trace;C.selectedpoints?_(g,C,M):(m(g,C,M),i.getComponentMethod("errorbars","style")(g))}function _(M,p,g){z.selectedPointStyle(M.selectAll("path"),p),A(M.selectAll("text"),p,g)}function A(M,p,g){M.each(function(C){var T=d.select(this),N;if(C.selected){N=P.ensureUniformFontSize(g,f(T,C,p,g));var B=p.selected.textfont&&p.selected.textfont.color;B&&(N.color=B),z.font(T,N)}else z.selectedTextStyle(T,p)})}function f(M,p,g,C){var T=C._fullLayout.font,N=g.textfont;if(M.classed("bartext-inside")){var B=I(p,g);N=w(g,p.i,T,B)}else M.classed("bartext-outside")&&(N=D(g,p.i,T));return N}function k(M,p,g){return E(l,M.textfont,p,g)}function w(M,p,g,C){var T=k(M,p,g),N=M._input.textfont===void 0||M._input.textfont.color===void 0||Array.isArray(M.textfont.color)&&M.textfont.color[p]===void 0;return N&&(T={color:y.contrast(C),family:T.family,size:T.size,weight:T.weight,style:T.style,variant:T.variant,textcase:T.textcase,lineposition:T.lineposition,shadow:T.shadow}),E(o,M.insidetextfont,p,T)}function D(M,p,g){var C=k(M,p,g);return E(u,M.outsidetextfont,p,C)}function E(M,p,g,C){p=p||{};var T=s.getValue(p.family,g),N=s.getValue(p.size,g),B=s.getValue(p.color,g),U=s.getValue(p.weight,g),V=s.getValue(p.style,g),W=s.getValue(p.variant,g),F=s.getValue(p.textcase,g),H=s.getValue(p.lineposition,g),q=s.getValue(p.shadow,g);return{family:s.coerceString(M.family,T,C.family),size:s.coerceNumber(M.size,N,C.size),color:s.coerceColor(M.color,B,C.color),weight:s.coerceString(M.weight,U,C.weight),style:s.coerceString(M.style,V,C.style),variant:s.coerceString(M.variant,W,C.variant),textcase:s.coerceString(M.variant,F,C.textcase),lineposition:s.coerceString(M.variant,H,C.lineposition),shadow:s.coerceString(M.variant,q,C.shadow)}}function I(M,p){return p.type==="waterfall"?p[M.dir].marker.color:M.mcc||M.mc||p.marker.color}Y.exports={style:h,styleTextPoints:b,styleOnSelect:x,getInsideTextFont:w,getOutsideTextFont:D,getBarColor:I,resizeText:n}}),gb=ze((te,Y)=>{var d=ri(),y=Sr(),z=ji(),P=cc(),i=Xi(),n=Zs(),a=as(),l=Os().tickText,o=C0(),u=o.recordMinTextSize,s=o.clearMinTextSize,h=Lg(),m=ES(),b=mb(),x=Xv(),_=x.text,A=x.textposition,f=T0().appendArrayPointValue,k=b.TEXTPAD;function w(he){return he.id}function D(he){if(he.ids)return w}function E(he){return(he>0)-(he<0)}function I(he,be){return he0}function C(he,be,ve,ce,re,ge){var ne=be.xaxis,se=be.yaxis,_e=he._fullLayout,oe=he._context.staticPlot;re||(re={mode:_e.barmode,norm:_e.barmode,gap:_e.bargap,groupgap:_e.bargroupgap},s("bar",_e));var J=z.makeTraceGroups(ce,ve,"trace bars").each(function(me){var fe=d.select(this),Ce=me[0].trace,Re=me[0].t,Be=Ce.type==="waterfall",Ze=Ce.type==="funnel",Ge=Ce.type==="histogram",tt=Ce.type==="bar",_t=tt||Ze,mt=0;Be&&Ce.connector.visible&&Ce.connector.mode==="between"&&(mt=Ce.connector.line.width/2);var vt=Ce.orientation==="h",ct=g(re),Ae=z.ensureSingle(fe,"g","points"),Oe=D(Ce),Le=Ae.selectAll("g.point").data(z.identity,Oe);Le.enter().append("g").classed("point",!0),Le.exit().remove(),Le.each(function(xt,ut){var Et=d.select(this),Gt=M(xt,ne,se,vt),Qt=Gt[0][0],vr=Gt[0][1],mr=Gt[1][0],Yr=Gt[1][1],ii=(vt?vr-Qt:Yr-mr)===0;ii&&_t&&m.getLineWidth(Ce,xt)&&(ii=!1),ii||(ii=!y(Qt)||!y(vr)||!y(mr)||!y(Yr)),xt.isBlank=ii,ii&&(vt?vr=Qt:Yr=mr),mt&&!ii&&(vt?(Qt-=I(Qt,vr)*mt,vr+=I(Qt,vr)*mt):(mr-=I(mr,Yr)*mt,Yr+=I(mr,Yr)*mt));var Lr,ci;if(Ce.type==="waterfall"){if(!ii){var vi=Ce[xt.dir].marker;Lr=vi.line.width,ci=vi.color}}else Lr=m.getLineWidth(Ce,xt),ci=xt.mc||Ce.marker.color;function Ot(na){var Kt=d.round(Lr/2%1,2);return re.gap===0&&re.groupgap===0?d.round(Math.round(na)-Kt,2):na}function Xe(na,Kt,lr){return lr&&na===Kt?na:Math.abs(na-Kt)>=2?Ot(na):na>Kt?Math.ceil(na):Math.floor(na)}var ot=i.opacity(ci),De=ot<1||Lr>.01?Ot:Xe;he._context.staticPlot||(Qt=De(Qt,vr,vt),vr=De(vr,Qt,vt),mr=De(mr,Yr,!vt),Yr=De(Yr,mr,!vt));var ye=vt?ne.c2p:se.c2p,Pe;xt.s0>0?Pe=xt._sMax:xt.s0<0?Pe=xt._sMin:Pe=xt.s1>0?xt._sMax:xt._sMin;function He(na,Kt){if(!na)return 0;var lr=Math.abs(vt?Yr-mr:vr-Qt),_r=Math.abs(vt?vr-Qt:Yr-mr),Er=De(Math.abs(ye(Pe,!0)-ye(0,!0))),di=xt.hasB?Math.min(lr/2,_r/2):Math.min(lr/2,Er),qi;if(Kt==="%"){var Ui=Math.min(50,na);qi=lr*(Ui/100)}else qi=na;return De(Math.max(Math.min(qi,di),0))}var at=tt||Ge?He(Re.cornerradiusvalue,Re.cornerradiusform):0,ht,At,Wt="M"+Qt+","+mr+"V"+Yr+"H"+vr+"V"+mr+"Z",Yt=0;if(at&&xt.s){var hr=E(xt.s0)===0||E(xt.s)===E(xt.s0)?xt.s1:xt.s0;if(Yt=De(xt.hasB?0:Math.abs(ye(Pe,!0)-ye(hr,!0))),Yt0?Math.sqrt(Yt*(2*at-Yt)):0,cn=zr>0?Math.max:Math.min;ht="M"+Qt+","+mr+"V"+(Yr-fi*Dr)+"H"+cn(vr-(at-Yt)*zr,Qt)+"A "+at+","+at+" 0 0 "+br+" "+vr+","+(Yr-at*Dr-un)+"V"+(mr+at*Dr+un)+"A "+at+","+at+" 0 0 "+br+" "+cn(vr-(at-Yt)*zr,Qt)+","+(mr+fi*Dr)+"Z"}else if(xt.hasB)ht="M"+(Qt+at*zr)+","+mr+"A "+at+","+at+" 0 0 "+br+" "+Qt+","+(mr+at*Dr)+"V"+(Yr-at*Dr)+"A "+at+","+at+" 0 0 "+br+" "+(Qt+at*zr)+","+Yr+"H"+(vr-at*zr)+"A "+at+","+at+" 0 0 "+br+" "+vr+","+(Yr-at*Dr)+"V"+(mr+at*Dr)+"A "+at+","+at+" 0 0 "+br+" "+(vr-at*zr)+","+mr+"Z";else{At=Math.abs(Yr-mr)+Yt;var yn=At0?Math.sqrt(Yt*(2*at-Yt)):0,Sn=Dr>0?Math.max:Math.min;ht="M"+(Qt+yn*zr)+","+mr+"V"+Sn(Yr-(at-Yt)*Dr,mr)+"A "+at+","+at+" 0 0 "+br+" "+(Qt+at*zr-Gn)+","+Yr+"H"+(vr-at*zr+Gn)+"A "+at+","+at+" 0 0 "+br+" "+(vr-yn*zr)+","+Sn(Yr-(at-Yt)*Dr,mr)+"V"+mr+"Z"}}else ht=Wt}else ht=Wt;var dn=p(z.ensureSingle(Et,"path"),_e,re,ge);if(dn.style("vector-effect",oe?"none":"non-scaling-stroke").attr("d",isNaN((vr-Qt)*(Yr-mr))||ii&&he._context.staticPlot?"M0,0Z":ht).call(n.setClipUrl,be.layerClipId,he),!_e.uniformtext.mode&&ct){var va=n.makePointStyleFns(Ce);n.singlePointStyle(xt,dn,Ce,va,he)}T(he,be,Et,me,ut,Qt,vr,mr,Yr,at,Yt,re,ge),be.layerClipId&&n.hideOutsideRangePoint(xt,Et.select("text"),ne,se,Ce.xcalendar,Ce.ycalendar)});var nt=Ce.cliponaxis===!1;n.setClipUrl(fe,nt?null:be.layerClipId,he)});a.getComponentMethod("errorbars","plot")(he,J,be,re)}function T(he,be,ve,ce,re,ge,ne,se,_e,oe,J,me,fe){var Ce=be.xaxis,Re=be.yaxis,Be=he._fullLayout,Ze;function Ge(At,Wt,Yt){var hr=z.ensureSingle(At,"text").text(Wt).attr({class:"bartext bartext-"+Ze,"text-anchor":"middle","data-notex":1}).call(n.font,Yt).call(P.convertToTspans,he);return hr}var tt=ce[0].trace,_t=tt.orientation==="h",mt=H(Be,ce,re,Ce,Re);Ze=q(tt,re);var vt=me.mode==="stack"||me.mode==="relative",ct=ce[re],Ae=!vt||ct._outmost,Oe=ct.hasB,Le=oe&&oe-J>k;if(!mt||Ze==="none"||(ct.isBlank||ge===ne||se===_e)&&(Ze==="auto"||Ze==="inside")){ve.select("text").remove();return}var nt=Be.font,xt=h.getBarColor(ce[re],tt),ut=h.getInsideTextFont(tt,re,nt,xt),Et=h.getOutsideTextFont(tt,re,nt),Gt=tt.insidetextanchor||"end",Qt=ve.datum();_t?Ce.type==="log"&&Qt.s0<=0&&(Ce.range[0]0&&Ot>0,De;Le?Oe?De=N(Yr-2*oe,ii,vi,Ot,_t)||N(Yr,ii-2*oe,vi,Ot,_t):_t?De=N(Yr-(oe-J),ii,vi,Ot,_t)||N(Yr,ii-2*(oe-J),vi,Ot,_t):De=N(Yr,ii-(oe-J),vi,Ot,_t)||N(Yr-2*(oe-J),ii,vi,Ot,_t):De=N(Yr,ii,vi,Ot,_t),ot&&De?Ze="inside":(Ze="outside",Lr.remove(),Lr=null)}else Ze="inside";if(!Lr){Xe=z.ensureUniformFontSize(he,Ze==="outside"?Et:ut),Lr=Ge(ve,mt,Xe);var ye=Lr.attr("transform");if(Lr.attr("transform",""),ci=n.bBox(Lr.node()),vi=ci.width,Ot=ci.height,Lr.attr("transform",ye),vi<=0||Ot<=0){Lr.remove();return}}var Pe=tt.textangle,He,at;Ze==="outside"?(at=tt.constraintext==="both"||tt.constraintext==="outside",He=F(ge,ne,se,_e,ci,{isHorizontal:_t,constrained:at,angle:Pe})):(at=tt.constraintext==="both"||tt.constraintext==="inside",He=V(ge,ne,se,_e,ci,{isHorizontal:_t,constrained:at,angle:Pe,anchor:Gt,hasB:Oe,r:oe,overhead:J})),He.fontSize=Xe.size,u(tt.type==="histogram"?"bar":tt.type,He,Be),ct.transform=He;var ht=p(Lr,Be,me,fe);z.setTransormAndDisplay(ht,He)}function N(he,be,ve,ce,re){if(he<0||be<0)return!1;var ge=ve<=he&&ce<=be,ne=ve<=be&&ce<=he,se=re?he>=ve*(be/ce):be>=ce*(he/ve);return ge||ne||se}function B(he){return he==="auto"?0:he}function U(he,be){var ve=Math.PI/180*be,ce=Math.abs(Math.sin(ve)),re=Math.abs(Math.cos(ve));return{x:he.width*re+he.height*ce,y:he.width*ce+he.height*re}}function V(he,be,ve,ce,re,ge){var ne=!!ge.isHorizontal,se=!!ge.constrained,_e=ge.angle||0,oe=ge.anchor,J=oe==="end",me=oe==="start",fe=ge.leftToRight||0,Ce=(fe+1)/2,Re=1-Ce,Be=ge.hasB,Ze=ge.r,Ge=ge.overhead,tt=re.width,_t=re.height,mt=Math.abs(be-he),vt=Math.abs(ce-ve),ct=mt>2*k&&vt>2*k?k:0;mt-=2*ct,vt-=2*ct;var Ae=B(_e);_e==="auto"&&!(tt<=mt&&_t<=vt)&&(tt>mt||_t>vt)&&(!(tt>vt||_t>mt)||tt<_t!=mtk){var xt=W(he,be,ve,ce,Oe,Ze,Ge,ne,Be);Le=xt.scale,nt=xt.pad}else Le=1,se&&(Le=Math.min(1,mt/Oe.x,vt/Oe.y)),nt=0;var ut=re.left*Re+re.right*Ce,Et=(re.top+re.bottom)/2,Gt=(he+k)*Re+(be-k)*Ce,Qt=(ve+ce)/2,vr=0,mr=0;if(me||J){var Yr=(ne?Oe.x:Oe.y)/2;Ze&&(J||Be)&&(ct+=nt);var ii=ne?I(he,be):I(ve,ce);ne?me?(Gt=he+ii*ct,vr=-ii*Yr):(Gt=be-ii*ct,vr=ii*Yr):me?(Qt=ve+ii*ct,mr=-ii*Yr):(Qt=ce-ii*ct,mr=ii*Yr)}return{textX:ut,textY:Et,targetX:Gt,targetY:Qt,anchorX:vr,anchorY:mr,scale:Le,rotate:Ae}}function W(he,be,ve,ce,re,ge,ne,se,_e){var oe=Math.max(0,Math.abs(be-he)-2*k),J=Math.max(0,Math.abs(ce-ve)-2*k),me=ge-k,fe=ne?me-Math.sqrt(me*me-(me-ne)*(me-ne)):me,Ce=_e?me*2:se?me-ne:2*fe,Re=_e?me*2:se?2*fe:me-ne,Be,Ze,Ge,tt,_t;return re.y/re.x>=J/(oe-Ce)?tt=J/re.y:re.y/re.x<=(J-Re)/oe?tt=oe/re.x:!_e&&se?(Be=re.x*re.x+re.y*re.y/4,Ze=-2*re.x*(oe-me)-re.y*(J/2-me),Ge=(oe-me)*(oe-me)+(J/2-me)*(J/2-me)-me*me,tt=(-Ze+Math.sqrt(Ze*Ze-4*Be*Ge))/(2*Be)):_e?(Be=(re.x*re.x+re.y*re.y)/4,Ze=-re.x*(oe/2-me)-re.y*(J/2-me),Ge=(oe/2-me)*(oe/2-me)+(J/2-me)*(J/2-me)-me*me,tt=(-Ze+Math.sqrt(Ze*Ze-4*Be*Ge))/(2*Be)):(Be=re.x*re.x/4+re.y*re.y,Ze=-re.x*(oe/2-me)-2*re.y*(J-me),Ge=(oe/2-me)*(oe/2-me)+(J-me)*(J-me)-me*me,tt=(-Ze+Math.sqrt(Ze*Ze-4*Be*Ge))/(2*Be)),tt=Math.min(1,tt),se?_t=Math.max(0,me-Math.sqrt(Math.max(0,me*me-(me-(J-re.y*tt)/2)*(me-(J-re.y*tt)/2)))-ne):_t=Math.max(0,me-Math.sqrt(Math.max(0,me*me-(me-(oe-re.x*tt)/2)*(me-(oe-re.x*tt)/2)))-ne),{scale:tt,pad:_t}}function F(he,be,ve,ce,re,ge){var ne=!!ge.isHorizontal,se=!!ge.constrained,_e=ge.angle||0,oe=re.width,J=re.height,me=Math.abs(be-he),fe=Math.abs(ce-ve),Ce;ne?Ce=fe>2*k?k:0:Ce=me>2*k?k:0;var Re=1;se&&(Re=ne?Math.min(1,fe/J):Math.min(1,me/oe));var Be=B(_e),Ze=U(re,Be),Ge=(ne?Ze.x:Ze.y)/2,tt=(re.left+re.right)/2,_t=(re.top+re.bottom)/2,mt=(he+be)/2,vt=(ve+ce)/2,ct=0,Ae=0,Oe=ne?I(be,he):I(ve,ce);return ne?(mt=be-Oe*Ce,ct=Oe*Ge):(vt=ce+Oe*Ce,Ae=-Oe*Ge),{textX:tt,textY:_t,targetX:mt,targetY:vt,anchorX:ct,anchorY:Ae,scale:Re,rotate:Be}}function H(he,be,ve,ce,re){var ge=be[0].trace,ne=ge.texttemplate,se;return ne?se=G(he,be,ve,ce,re):ge.textinfo?se=ee(be,ve,ce,re):se=m.getValue(ge.text,ve),m.coerceString(_,se)}function q(he,be){var ve=m.getValue(he.textposition,be);return m.coerceEnumerated(A,ve)}function G(he,be,ve,ce,re){var ge=be[0].trace,ne=z.castOption(ge,ve,"texttemplate");if(!ne)return"";var se=ge.type==="histogram",_e=ge.type==="waterfall",oe=ge.type==="funnel",J=ge.orientation==="h",me,fe,Ce,Re;J?(me="y",fe=re,Ce="x",Re=ce):(me="x",fe=ce,Ce="y",Re=re);function Be(ct){return l(fe,fe.c2l(ct),!0).text}function Ze(ct){return l(Re,Re.c2l(ct),!0).text}var Ge=be[ve],tt={};tt.label=Ge.p,tt.labelLabel=tt[me+"Label"]=Be(Ge.p);var _t=z.castOption(ge,Ge.i,"text");(_t===0||_t)&&(tt.text=_t),tt.value=Ge.s,tt.valueLabel=tt[Ce+"Label"]=Ze(Ge.s);var mt={};f(mt,ge,Ge.i),(se||mt.x===void 0)&&(mt.x=J?tt.value:tt.label),(se||mt.y===void 0)&&(mt.y=J?tt.label:tt.value),(se||mt.xLabel===void 0)&&(mt.xLabel=J?tt.valueLabel:tt.labelLabel),(se||mt.yLabel===void 0)&&(mt.yLabel=J?tt.labelLabel:tt.valueLabel),_e&&(tt.delta=+Ge.rawS||Ge.s,tt.deltaLabel=Ze(tt.delta),tt.final=Ge.v,tt.finalLabel=Ze(tt.final),tt.initial=tt.final-tt.delta,tt.initialLabel=Ze(tt.initial)),oe&&(tt.value=Ge.s,tt.valueLabel=Ze(tt.value),tt.percentInitial=Ge.begR,tt.percentInitialLabel=z.formatPercent(Ge.begR),tt.percentPrevious=Ge.difR,tt.percentPreviousLabel=z.formatPercent(Ge.difR),tt.percentTotal=Ge.sumR,tt.percenTotalLabel=z.formatPercent(Ge.sumR));var vt=z.castOption(ge,Ge.i,"customdata");return vt&&(tt.customdata=vt),z.texttemplateString({data:[mt,tt,ge._meta],fallback:ge.texttemplatefallback,labels:tt,locale:he._d3locale,template:ne})}function ee(he,be,ve,ce){var re=he[0].trace,ge=re.orientation==="h",ne=re.type==="waterfall",se=re.type==="funnel";function _e(vt){var ct=ge?ce:ve;return l(ct,vt,!0).text}function oe(vt){var ct=ge?ve:ce;return l(ct,+vt,!0).text}var J=re.textinfo,me=he[be],fe=J.split("+"),Ce=[],Re,Be=function(vt){return fe.indexOf(vt)!==-1};if(Be("label")&&Ce.push(_e(he[be].p)),Be("text")&&(Re=z.castOption(re,me.i,"text"),(Re===0||Re)&&Ce.push(Re)),ne){var Ze=+me.rawS||me.s,Ge=me.v,tt=Ge-Ze;Be("initial")&&Ce.push(oe(tt)),Be("delta")&&Ce.push(oe(Ze)),Be("final")&&Ce.push(oe(Ge))}if(se){Be("value")&&Ce.push(oe(me.s));var _t=0;Be("percent initial")&&_t++,Be("percent previous")&&_t++,Be("percent total")&&_t++;var mt=_t>1;Be("percent initial")&&(Re=z.formatPercent(me.begR),mt&&(Re+=" of initial"),Ce.push(Re)),Be("percent previous")&&(Re=z.formatPercent(me.difR),mt&&(Re+=" of previous"),Ce.push(Re)),Be("percent total")&&(Re=z.formatPercent(me.sumR),mt&&(Re+=" of total"),Ce.push(Re))}return Ce.join("
")}Y.exports={plot:C,toMoveInsideBar:V}}),Ew=ze((te,Y)=>{var d=hf(),y=as(),z=Xi(),P=ji().fillText,i=ES().getLineWidth,n=Os().hoverLabelText,a=ei().BADNUM;function l(s,h,m,b,x){var _=o(s,h,m,b,x);if(_){var A=_.cd,f=A[0].trace,k=A[_.index];return _.color=u(f,k),y.getComponentMethod("errorbars","hoverInfo")(k,f,_),[_]}}function o(s,h,m,b,x){var _=s.cd,A=_[0].trace,f=_[0].t,k=b==="closest",w=A.type==="waterfall",D=s.maxHoverDistance,E=s.maxSpikeDistance,I,M,p,g,C,T,N;A.orientation==="h"?(I=m,M=h,p="y",g="x",C=ce,T=he):(I=h,M=m,p="x",g="y",T=ce,C=he);var B=A[p+"period"],U=k||B;function V(Re){return F(Re,-1)}function W(Re){return F(Re,1)}function F(Re,Be){var Ze=Re.w;return Re[p]+Be*Ze/2}function H(Re){return Re[p+"End"]-Re[p+"Start"]}var q=k?V:B?function(Re){return Re.p-H(Re)/2}:function(Re){return Math.min(V(Re),Re.p-f.bardelta/2)},G=k?W:B?function(Re){return Re.p+H(Re)/2}:function(Re){return Math.max(W(Re),Re.p+f.bardelta/2)};function ee(Re,Be,Ze){return x.finiteRange&&(Ze=0),d.inbox(Re-I,Be-I,Ze+Math.min(1,Math.abs(Be-Re)/N)-1)}function he(Re){return ee(q(Re),G(Re),D)}function be(Re){return ee(V(Re),W(Re),E)}function ve(Re){var Be=Re[g];if(w){var Ze=Math.abs(Re.rawS)||0;M>0?Be+=Ze:M<0&&(Be-=Ze)}return Be}function ce(Re){var Be=M,Ze=Re.b,Ge=ve(Re);return d.inbox(Ze-Be,Ge-Be,D+(Ge-Be)/(Ge-Ze)-1)}function re(Re){var Be=M,Ze=Re.b,Ge=ve(Re);return d.inbox(Ze-Be,Ge-Be,E+(Ge-Be)/(Ge-Ze)-1)}var ge=s[p+"a"],ne=s[g+"a"];N=Math.abs(ge.r2c(ge.range[1])-ge.r2c(ge.range[0]));function se(Re){return(C(Re)+T(Re))/2}var _e=d.getDistanceFunction(b,C,T,se);if(d.getClosest(_,_e,s),s.index!==!1&&_[s.index].p!==a){U||(q=function(Re){return Math.min(V(Re),Re.p-f.bargroupwidth/2)},G=function(Re){return Math.max(W(Re),Re.p+f.bargroupwidth/2)});var oe=s.index,J=_[oe],me=A.base?J.b+J.s:J.s;s[g+"0"]=s[g+"1"]=ne.c2p(J[g],!0),s[g+"LabelVal"]=me;var fe=f.extents[f.extents.round(J.p)];s[p+"0"]=ge.c2p(k?q(J):fe[0],!0),s[p+"1"]=ge.c2p(k?G(J):fe[1],!0);var Ce=J.orig_p!==void 0;return s[p+"LabelVal"]=Ce?J.orig_p:J.p,s.labelLabel=n(ge,s[p+"LabelVal"],A[p+"hoverformat"]),s.valueLabel=n(ne,s[g+"LabelVal"],A[g+"hoverformat"]),s.baseLabel=n(ne,J.b,A[g+"hoverformat"]),s.spikeDistance=(re(J)+be(J))/2,s[p+"Spike"]=ge.c2p(J.p,!0),P(J,A,s),s.hovertemplate=A.hovertemplate,s}}function u(s,h){var m=h.mcc||s.marker.color,b=h.mlcc||s.marker.line.color,x=i(s,h);if(z.opacity(m))return m;if(z.opacity(b)&&x)return b}Y.exports={hoverPoints:l,hoverOnBars:o,getTraceColor:u}}),wq=ze((te,Y)=>{Y.exports=function(d,y,z){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),z.orientation==="h"?(d.label=d.y,d.value=d.x):(d.label=d.x,d.value=d.y),d}}),Lw=ze((te,Y)=>{Y.exports=function(y,z){var P=y.cd,i=y.xaxis,n=y.yaxis,a=P[0].trace,l=a.type==="funnel",o=a.orientation==="h",u=[],s;if(z===!1)for(s=0;s{Y.exports={attributes:Xv(),layoutAttributes:AS(),supplyDefaults:tg().supplyDefaults,crossTraceDefaults:tg().crossTraceDefaults,supplyLayoutDefaults:PL(),calc:bq(),crossTraceCalc:Ur().crossTraceCalc,colorbar:Mo(),arraysToCalcdata:W4(),plot:gb().plot,style:Lg().style,styleOnSelect:Lg().styleOnSelect,hoverPoints:Ew().hoverPoints,eventData:wq(),selectPoints:Lw(),moduleType:"trace",name:"bar",basePlotModule:Ff(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}),Tq=ze((te,Y)=>{Y.exports=kq()}),q4=ze((te,Y)=>{var d=Lm(),y=ff(),z=Xv(),P=Mi(),i=Sh().axisHoverFormat,{hovertemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=nn().extendFlat,o=y.marker,u=o.line;Y.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:y.xperiod,yperiod:y.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:y.xperiodalignment,yperiodalignment:y.yperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},o.angle,{arrayOk:!1,editType:"calc"}),size:l({},o.size,{arrayOk:!1,editType:"calc"}),color:l({},o.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:P.defaultLine,editType:"style"}),width:l({},u.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:d(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:z.offsetgroup,alignmentgroup:z.alignmentgroup,selected:{marker:y.selected.marker,editType:"style"},unselected:{marker:y.unselected.marker,editType:"style"},text:l({},y.text,{}),hovertext:l({},y.hovertext,{}),hovertemplate:n({}),hovertemplatefallback:a(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:y.zorder}}),G4=ze((te,Y)=>{Y.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}),Z4=ze((te,Y)=>{var d=ji(),y=as(),z=Xi(),P=S0(),i=Yv(),n=J1(),a=q4();function l(h,m,b,x){function _(g,C){return d.coerce(h,m,a,g,C)}if(o(h,m,_,x),m.visible!==!1){P(h,m,x,_),_("xhoverformat"),_("yhoverformat");var A=m._hasPreCompStats;A&&(_("lowerfence"),_("upperfence")),_("line.color",(h.marker||{}).color||b),_("line.width"),_("fillcolor",z.addOpacity(m.line.color,.5));var f=!1;if(A){var k=_("mean"),w=_("sd");k&&k.length&&(f=!0,w&&w.length&&(f="sd"))}_("whiskerwidth");var D=_("sizemode"),E;D==="quartiles"&&(E=_("boxmean",f)),_("showwhiskers",D==="quartiles"),(D==="sd"||E==="sd")&&_("sdmultiple"),_("width"),_("quartilemethod");var I=!1;if(A){var M=_("notchspan");M&&M.length&&(I=!0)}else d.validate(h.notchwidth,a.notchwidth)&&(I=!0);var p=_("notched",I);p&&_("notchwidth"),u(h,m,_,{prefix:"box"}),_("zorder")}}function o(h,m,b,x){function _(ee){var he=0;return ee&&ee.length&&(he+=1,d.isArrayOrTypedArray(ee[0])&&ee[0].length&&(he+=1)),he}function A(ee){return d.validate(h[ee],a[ee])}var f=b("y"),k=b("x"),w;if(m.type==="box"){var D=b("q1"),E=b("median"),I=b("q3");m._hasPreCompStats=D&&D.length&&E&&E.length&&I&&I.length,w=Math.min(d.minRowLength(D),d.minRowLength(E),d.minRowLength(I))}var M=_(f),p=_(k),g=M&&d.minRowLength(f),C=p&&d.minRowLength(k),T=x.calendar,N={autotypenumbers:x.autotypenumbers},B,U;if(m._hasPreCompStats)switch(String(p)+String(M)){case"00":var V=A("x0")||A("dx"),W=A("y0")||A("dy");W&&!V?B="h":B="v",U=w;break;case"10":B="v",U=Math.min(w,C);break;case"20":B="h",U=Math.min(w,k.length);break;case"01":B="h",U=Math.min(w,g);break;case"02":B="v",U=Math.min(w,f.length);break;case"12":B="v",U=Math.min(w,C,f.length);break;case"21":B="h",U=Math.min(w,k.length,g);break;case"11":U=0;break;case"22":var F=!1,H;for(H=0;H0?(B="v",p>0?U=Math.min(C,g):U=Math.min(g)):p>0?(B="h",U=Math.min(C)):U=0;if(!U){m.visible=!1;return}m._length=U;var q=b("orientation",B);m._hasPreCompStats?q==="v"&&p===0?(b("x0",0),b("dx",1)):q==="h"&&M===0&&(b("y0",0),b("dy",1)):q==="v"&&p===0?b("x0"):q==="h"&&M===0&&b("y0");var G=y.getComponentMethod("calendars","handleTraceDefaults");G(h,m,["x","y"],x)}function u(h,m,b,x){var _=x.prefix,A=d.coerce2(h,m,a,"marker.outliercolor"),f=b("marker.line.outliercolor"),k="outliers";m._hasPreCompStats?k="all":(A||f)&&(k="suspectedoutliers");var w=b(_+"points",k);w?(b("jitter",w==="all"?.3:0),b("pointpos",w==="all"?-1.5:0),b("marker.symbol"),b("marker.opacity"),b("marker.size"),b("marker.angle"),b("marker.color",m.line.color),b("marker.line.color"),b("marker.line.width"),w==="suspectedoutliers"&&(b("marker.line.outliercolor",m.marker.color),b("marker.line.outlierwidth")),b("selected.marker.color"),b("unselected.marker.color"),b("selected.marker.size"),b("unselected.marker.size"),b("text"),b("hovertext")):delete m.marker;var D=b("hoveron");(D==="all"||D.indexOf("points")!==-1)&&(b("hovertemplate"),b("hovertemplatefallback")),d.coerceSelectionMarkerOpacity(m,b)}function s(h,m){var b,x;function _(w){return d.coerce(x._input,x,a,w)}for(var A=0;A{var d=as(),y=ji(),z=G4();function P(n,a,l,o,u){for(var s=u+"Layout",h=!1,m=0;m{var d=Sr(),y=Os(),z=Dm(),P=ji(),i=ei().BADNUM,n=P._;Y.exports=function(w,D){var E=w._fullLayout,I=y.getFromId(w,D.xaxis||"x"),M=y.getFromId(w,D.yaxis||"y"),p=[],g=D.type==="violin"?"_numViolins":"_numBoxes",C,T,N,B,U,V,W;D.orientation==="h"?(N=I,B="x",U=M,V="y",W=!!D.yperiodalignment):(N=M,B="y",U=I,V="x",W=!!D.xperiodalignment);var F=a(D,V,U,E[g]),H=F[0],q=F[1],G=P.distinctVals(H,U),ee=G.vals,he=G.minDiff/2,be,ve,ce,re,ge,ne,se=(D.boxpoints||D.points)==="all"?P.identity:function(Yr){return Yr.vbe.uf};if(D._hasPreCompStats){var _e=D[B],oe=function(Yr){return N.d2c((D[Yr]||[])[C])},J=1/0,me=-1/0;for(C=0;C=be.q1&&be.q3>=be.med){var Ce=oe("lowerfence");be.lf=Ce!==i&&Ce<=be.q1?Ce:x(be,ce,re);var Re=oe("upperfence");be.uf=Re!==i&&Re>=be.q3?Re:_(be,ce,re);var Be=oe("mean");be.mean=Be!==i?Be:re?P.mean(ce,re):(be.q1+be.q3)/2;var Ze=oe("sd");be.sd=Be!==i&&Ze>=0?Ze:re?P.stdev(ce,re,be.mean):be.q3-be.q1,be.lo=A(be),be.uo=f(be);var Ge=oe("notchspan");Ge=Ge!==i&&Ge>0?Ge:k(be,re),be.ln=be.med-Ge,be.un=be.med+Ge;var tt=be.lf,_t=be.uf;D.boxpoints&&ce.length&&(tt=Math.min(tt,ce[0]),_t=Math.max(_t,ce[re-1])),D.notched&&(tt=Math.min(tt,be.ln),_t=Math.max(_t,be.un)),be.min=tt,be.max=_t}else{P.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+be.q1,"median = "+be.med,"q3 = "+be.q3].join(` +`));var mt;be.med!==i?mt=be.med:be.q1!==i?be.q3!==i?mt=(be.q1+be.q3)/2:mt=be.q1:be.q3!==i?mt=be.q3:mt=0,be.med=mt,be.q1=be.q3=mt,be.lf=be.uf=mt,be.mean=be.sd=mt,be.ln=be.un=mt,be.min=be.max=mt}J=Math.min(J,be.min),me=Math.max(me,be.max),be.pts2=ve.filter(se),p.push(be)}}D._extremes[N._id]=y.findExtremes(N,[J,me],{padded:!0})}else{var vt=N.makeCalcdata(D,B),ct=l(ee,he),Ae=ee.length,Oe=o(Ae);for(C=0;C=0&&Le0){if(be={},be.pos=be[V]=ee[C],ve=be.pts=Oe[C].sort(m),ce=be[B]=ve.map(b),re=ce.length,be.min=ce[0],be.max=ce[re-1],be.mean=P.mean(ce,re),be.sd=P.stdev(ce,re,be.mean)*D.sdmultiple,be.med=P.interp(ce,.5),re%2&&(Et||Gt)){var Qt,vr;Et?(Qt=ce.slice(0,re/2),vr=ce.slice(re/2+1)):Gt&&(Qt=ce.slice(0,re/2+1),vr=ce.slice(re/2)),be.q1=P.interp(Qt,.5),be.q3=P.interp(vr,.5)}else be.q1=P.interp(ce,.25),be.q3=P.interp(ce,.75);be.lf=x(be,ce,re),be.uf=_(be,ce,re),be.lo=A(be),be.uo=f(be);var mr=k(be,re);be.ln=be.med-mr,be.un=be.med+mr,nt=Math.min(nt,be.ln),xt=Math.max(xt,be.un),be.pts2=ve.filter(se),p.push(be)}D.notched&&P.isTypedArray(vt)&&(vt=Array.from(vt)),D._extremes[N._id]=y.findExtremes(N,D.notched?vt.concat([nt,xt]):vt,{padded:!0})}return h(p,D),p.length>0?(p[0].t={num:E[g],dPos:he,posLetter:V,valLetter:B,labels:{med:n(w,"median:"),min:n(w,"min:"),q1:n(w,"q1:"),q3:n(w,"q3:"),max:n(w,"max:"),mean:D.boxmean==="sd"||D.sizemode==="sd"?n(w,"mean ± σ:").replace("σ",D.sdmultiple===1?"σ":D.sdmultiple+"σ"):n(w,"mean:"),lf:n(w,"lower fence:"),uf:n(w,"upper fence:")}},E[g]++,p):[{t:{empty:!0}}]};function a(w,D,E,I){var M=D in w,p=D+"0"in w,g="d"+D in w;if(M||p&&g){var C=E.makeCalcdata(w,D),T=z(w,E,D,C).vals;return[T,C]}var N;p?N=w[D+"0"]:"name"in w&&(E.type==="category"||d(w.name)&&["linear","log"].indexOf(E.type)!==-1||P.isDateTime(w.name)&&E.type==="date")?N=w.name:N=I;for(var B=E.type==="multicategory"?E.r2c_just_indices(N):E.d2c(N,0,w[D+"calendar"]),U=w._length,V=new Array(U),W=0;W{var d=Os(),y=ji(),z=ry().getAxisGroup,P=["v","h"];function i(a,l){for(var o=a.calcdata,u=l.xaxis,s=l.yaxis,h=0;h1,p=1-h[a+"gap"],g=1-h[a+"groupgap"];for(x=0;x0;if(B==="positive"?(ve=U*(N?1:.5),ge=re,ce=ge=W):B==="negative"?(ve=ge=W,ce=U*(N?1:.5),ne=re):(ve=ce=U,ge=ne=re),fe){var Ce=C.pointpos,Re=C.jitter,Be=C.marker.size/2,Ze=0;Ce+Re>=0&&(Ze=re*(Ce+Re),Ze>ve?(me=!0,oe=Be,se=Ze):Ze>ge&&(oe=Be,se=ve)),Ze<=ve&&(se=ve);var Ge=0;Ce-Re<=0&&(Ge=-re*(Ce-Re),Ge>ce?(me=!0,J=Be,_e=Ge):Ge>ne&&(J=Be,_e=ce)),Ge<=ce&&(_e=ce)}else se=ve,_e=ce;var tt=new Array(A.length);for(_=0;_{var d=ri(),y=ji(),z=Zs(),P=5,i=.01;function n(u,s,h,m){var b=u._context.staticPlot,x=s.xaxis,_=s.yaxis;y.makeTraceGroups(m,h,"trace boxes").each(function(A){var f=d.select(this),k=A[0],w=k.t,D=k.trace;if(w.wdPos=w.bdPos*D.whiskerwidth,D.visible!==!0||w.empty){f.remove();return}var E,I;D.orientation==="h"?(E=_,I=x):(E=x,I=_),a(f,{pos:E,val:I},D,w,b),l(f,{x,y:_},D,w),o(f,{pos:E,val:I},D,w)})}function a(u,s,h,m,b){var x=h.orientation==="h",_=s.val,A=s.pos,f=!!A.rangebreaks,k=m.bPos,w=m.wdPos||0,D=m.bPosPxOffset||0,E=h.whiskerwidth||0,I=h.showwhiskers!==!1,M=h.notched||!1,p=M?1-2*h.notchwidth:1,g,C;Array.isArray(m.bdPos)?(g=m.bdPos[0],C=m.bdPos[1]):(g=m.bdPos,C=m.bdPos);var T=u.selectAll("path.box").data(h.type!=="violin"||h.box.visible?y.identity:[]);T.enter().append("path").style("vector-effect",b?"none":"non-scaling-stroke").attr("class","box"),T.exit().remove(),T.each(function(N){if(N.empty)return d.select(this).attr("d","M0,0Z");var B=A.c2l(N.pos+k,!0),U=A.l2p(B-g)+D,V=A.l2p(B+C)+D,W=f?(U+V)/2:A.l2p(B)+D,F=h.whiskerwidth,H=f?U*F+(1-F)*W:A.l2p(B-w)+D,q=f?V*F+(1-F)*W:A.l2p(B+w)+D,G=A.l2p(B-g*p)+D,ee=A.l2p(B+C*p)+D,he=h.sizemode==="sd",be=_.c2p(he?N.mean-N.sd:N.q1,!0),ve=he?_.c2p(N.mean+N.sd,!0):_.c2p(N.q3,!0),ce=y.constrain(he?_.c2p(N.mean,!0):_.c2p(N.med,!0),Math.min(be,ve)+1,Math.max(be,ve)-1),re=N.lf===void 0||h.boxpoints===!1||he,ge=_.c2p(re?N.min:N.lf,!0),ne=_.c2p(re?N.max:N.uf,!0),se=_.c2p(N.ln,!0),_e=_.c2p(N.un,!0);x?d.select(this).attr("d","M"+ce+","+G+"V"+ee+"M"+be+","+U+"V"+V+(M?"H"+se+"L"+ce+","+ee+"L"+_e+","+V:"")+"H"+ve+"V"+U+(M?"H"+_e+"L"+ce+","+G+"L"+se+","+U:"")+"Z"+(I?"M"+be+","+W+"H"+ge+"M"+ve+","+W+"H"+ne+(E===0?"":"M"+ge+","+H+"V"+q+"M"+ne+","+H+"V"+q):"")):d.select(this).attr("d","M"+G+","+ce+"H"+ee+"M"+U+","+be+"H"+V+(M?"V"+se+"L"+ee+","+ce+"L"+V+","+_e:"")+"V"+ve+"H"+U+(M?"V"+_e+"L"+G+","+ce+"L"+U+","+se:"")+"Z"+(I?"M"+W+","+be+"V"+ge+"M"+W+","+ve+"V"+ne+(E===0?"":"M"+H+","+ge+"H"+q+"M"+H+","+ne+"H"+q):""))})}function l(u,s,h,m){var b=s.x,x=s.y,_=m.bdPos,A=m.bPos,f=h.boxpoints||h.points;y.seedPseudoRandom();var k=function(E){return E.forEach(function(I){I.t=m,I.trace=h}),E},w=u.selectAll("g.points").data(f?k:[]);w.enter().append("g").attr("class","points"),w.exit().remove();var D=w.selectAll("path").data(function(E){var I,M=E.pts2,p=Math.max((E.max-E.min)/10,E.q3-E.q1),g=p*1e-9,C=p*i,T=[],N=0,B;if(h.jitter){if(p===0)for(N=1,T=new Array(M.length),I=0;IE.lo&&(q.so=!0)}return M});D.enter().append("path").classed("point",!0),D.exit().remove(),D.call(z.translatePoints,b,x)}function o(u,s,h,m){var b=s.val,x=s.pos,_=!!x.rangebreaks,A=m.bPos,f=m.bPosPxOffset||0,k=h.boxmean||(h.meanline||{}).visible,w,D;Array.isArray(m.bdPos)?(w=m.bdPos[0],D=m.bdPos[1]):(w=m.bdPos,D=m.bdPos);var E=u.selectAll("path.mean").data(h.type==="box"&&h.boxmean||h.type==="violin"&&h.box.visible&&h.meanline.visible?y.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(I){var M=x.c2l(I.pos+A,!0),p=x.l2p(M-w)+f,g=x.l2p(M+D)+f,C=_?(p+g)/2:x.l2p(M)+f,T=b.c2p(I.mean,!0),N=b.c2p(I.mean-I.sd,!0),B=b.c2p(I.mean+I.sd,!0);h.orientation==="h"?d.select(this).attr("d","M"+T+","+p+"V"+g+(k==="sd"?"m0,0L"+N+","+C+"L"+T+","+p+"L"+B+","+C+"Z":"")):d.select(this).attr("d","M"+p+","+T+"H"+g+(k==="sd"?"m0,0L"+C+","+N+"L"+p+","+T+"L"+C+","+B+"Z":""))})}Y.exports={plot:n,plotBoxAndWhiskers:a,plotPoints:l,plotBoxMean:o}}),DS=ze((te,Y)=>{var d=ri(),y=Xi(),z=Zs();function P(n,a,l){var o=l||d.select(n).selectAll("g.trace.boxes");o.style("opacity",function(u){return u[0].trace.opacity}),o.each(function(u){var s=d.select(this),h=u[0].trace,m=h.line.width;function b(A,f,k,w){A.style("stroke-width",f+"px").call(y.stroke,k).call(y.fill,w)}var x=s.selectAll("path.box");if(h.type==="candlestick")x.each(function(A){if(!A.empty){var f=d.select(this),k=h[A.dir];b(f,k.line.width,k.line.color,k.fillcolor),f.style("opacity",h.selectedpoints&&!A.selected?.3:1)}});else{b(x,m,h.line.color,h.fillcolor),s.selectAll("path.mean").style({"stroke-width":m,"stroke-dasharray":2*m+"px,"+m+"px"}).call(y.stroke,h.line.color);var _=s.selectAll("path.point");z.pointStyle(_,h,n)}})}function i(n,a,l){var o=a[0].trace,u=l.selectAll("path.point");o.selectedpoints?z.selectedPointStyle(u,o):z.pointStyle(u,o,n)}Y.exports={style:P,styleOnSelect:i}}),DL=ze((te,Y)=>{var d=Os(),y=ji(),z=hf(),P=Xi(),i=y.fillText;function n(o,u,s,h){var m=o.cd,b=m[0].trace,x=b.hoveron,_=[],A;return x.indexOf("boxes")!==-1&&(_=_.concat(a(o,u,s,h))),x.indexOf("points")!==-1&&(A=l(o,u,s)),h==="closest"?A?[A]:_:(A&&_.push(A),_)}function a(o,u,s,h){var m=o.cd,b=o.xa,x=o.ya,_=m[0].trace,A=m[0].t,f=_.type==="violin",k,w,D,E,I,M,p,g,C,T,N,B=A.bdPos,U,V,W=A.wHover,F=function(Ge){return D.c2l(Ge.pos)+A.bPos-D.c2l(M)};f&&_.side!=="both"?(_.side==="positive"&&(C=function(Ge){var tt=F(Ge);return z.inbox(tt,tt+W,T)},U=B,V=0),_.side==="negative"&&(C=function(Ge){var tt=F(Ge);return z.inbox(tt-W,tt,T)},U=0,V=B)):(C=function(Ge){var tt=F(Ge);return z.inbox(tt-W,tt+W,T)},U=V=B);var H;f?H=function(Ge){return z.inbox(Ge.span[0]-I,Ge.span[1]-I,T)}:H=function(Ge){return z.inbox(Ge.min-I,Ge.max-I,T)},_.orientation==="h"?(I=u,M=s,p=H,g=C,k="y",D=x,w="x",E=b):(I=s,M=u,p=C,g=H,k="x",D=b,w="y",E=x);var q=Math.min(1,B/Math.abs(D.r2c(D.range[1])-D.r2c(D.range[0])));T=o.maxHoverDistance-q,N=o.maxSpikeDistance-q;function G(Ge){return(p(Ge)+g(Ge))/2}var ee=z.getDistanceFunction(h,p,g,G);if(z.getClosest(m,ee,o),o.index===!1)return[];var he=m[o.index],be=_.line.color,ve=(_.marker||{}).color;P.opacity(be)&&_.line.width?o.color=be:P.opacity(ve)&&_.boxpoints?o.color=ve:o.color=_.fillcolor,o[k+"0"]=D.c2p(he.pos+A.bPos-V,!0),o[k+"1"]=D.c2p(he.pos+A.bPos+U,!0),o[k+"LabelVal"]=he.orig_p!==void 0?he.orig_p:he.pos;var ce=k+"Spike";o.spikeDistance=G(he)*N/T,o[ce]=D.c2p(he.pos,!0);var re=_.boxmean||_.sizemode==="sd"||(_.meanline||{}).visible,ge=_.boxpoints||_.points,ne=ge&&re?["max","uf","q3","med","mean","q1","lf","min"]:ge&&!re?["max","uf","q3","med","q1","lf","min"]:!ge&&re?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],se=E.range[1]{Y.exports=function(d,y){return y.hoverOnBox&&(d.hoverOnBox=y.hoverOnBox),"xVal"in y&&(d.x=y.xVal),"yVal"in y&&(d.y=y.yVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),zL=ze((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l;if(y===!1)for(a=0;a{Y.exports={attributes:q4(),layoutAttributes:G4(),supplyDefaults:Z4().supplyDefaults,crossTraceDefaults:Z4().crossTraceDefaults,supplyLayoutDefaults:LS().supplyLayoutDefaults,calc:IL(),crossTraceCalc:PS().crossTraceCalc,plot:IS().plot,style:DS().style,styleOnSelect:DS().styleOnSelect,hoverPoints:DL().hoverPoints,eventData:Sq(),selectPoints:zL(),moduleType:"trace",name:"box",basePlotModule:Ff(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}),Aq=ze((te,Y)=>{Y.exports=Cq()}),Pw=ze((te,Y)=>{var d=Oc(),{extendFlat:y}=nn(),z=xa(),{axisHoverFormat:P}=Sh(),i=On(),{hovertemplateAttrs:n,templatefallbackAttrs:a,texttemplateAttrs:l}=rc(),o=ff();Y.exports=y({z:{valType:"data_array",editType:"calc"},x:y({},o.x,{impliedEdits:{xtype:"array"}}),x0:y({},o.x0,{impliedEdits:{xtype:"scaled"}}),dx:y({},o.dx,{impliedEdits:{xtype:"scaled"}}),y:y({},o.y,{impliedEdits:{ytype:"array"}}),y0:y({},o.y0,{impliedEdits:{ytype:"scaled"}}),dy:y({},o.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:y({},o.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:y({},o.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:y({},o.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:y({},o.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:y({},o.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:y({},o.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:n(),hovertemplatefallback:a(),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:a({editType:"plot"}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:y({},z.showlegend,{dflt:!1}),zorder:o.zorder},d("",{cLetter:"z",autoColorDflt:!1}))}),zS=ze((te,Y)=>{var d=Sr(),y=ji(),z=as();Y.exports=function(n,a,l,o,u,s){var h=l("z");u=u||"x",s=s||"y";var m,b;if(h===void 0||!h.length)return 0;if(y.isArray1D(h)){m=l(u),b=l(s);var x=y.minRowLength(m),_=y.minRowLength(b);if(x===0||_===0)return 0;a._length=Math.min(x,_,h.length)}else{if(m=P(u,l),b=P(s,l),!i(h))return 0;l("transpose"),a._length=null}var A=z.getComponentMethod("calendars","handleTraceDefaults");return A(n,a,[u,s],o),!0};function P(n,a){var l=a(n),o=l?a(n+"type","array"):"scaled";return o==="scaled"&&(a(n+"0"),a("d"+n)),l}function i(n){for(var a=!0,l=!1,o=!1,u,s=0;s0&&(l=!0);for(var h=0;h{var d=ji();Y.exports=function(y,z){y("texttemplate"),y("texttemplatefallback");var P=d.extendFlat({},z.font,{color:"auto",size:"auto"});d.coerceFont(y,"textfont",P)}}),OL=ze((te,Y)=>{Y.exports=function(d,y,z){var P=z("zsmooth");P===!1&&(z("xgap"),z("ygap")),z("zhoverformat")}}),Mq=ze((te,Y)=>{var d=ji(),y=zS(),z=K4(),P=S0(),i=OL(),n=Cc(),a=Pw();Y.exports=function(l,o,u,s){function h(b,x){return d.coerce(l,o,a,b,x)}var m=y(l,o,h,s);if(!m){o.visible=!1;return}P(l,o,s,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),h("hovertemplatefallback"),z(h,s),i(l,o,h,s),h("hoverongaps"),h("connectgaps",d.isArray1D(o.z)&&o.zsmooth!==!1),n(l,o,s,h,{prefix:"",cLetter:"z"}),h("zorder")}}),BL=ze((te,Y)=>{var d=Sr();Y.exports={count:function(y,z,P){return P[y]++,1},sum:function(y,z,P,i){var n=i[z];return d(n)?(n=Number(n),P[y]+=n,n):0},avg:function(y,z,P,i,n){var a=i[z];return d(a)&&(a=Number(a),P[y]+=a,n[y]++),0},min:function(y,z,P,i){var n=i[z];if(d(n))if(n=Number(n),d(P[y])){if(P[y]>n){var a=n-P[y];return P[y]=n,a}}else return P[y]=n,n;return 0},max:function(y,z,P,i){var n=i[z];if(d(n))if(n=Number(n),d(P[y])){if(P[y]{Y.exports={percent:function(d,y){for(var z=d.length,P=100/y,i=0;i{Y.exports=function(d,y){for(var z=d.length,P=0,i=0;i{var d=ei(),y=d.ONEAVGYEAR,z=d.ONEAVGMONTH,P=d.ONEDAY,i=d.ONEHOUR,n=d.ONEMIN,a=d.ONESEC,l=Os().tickIncrement;Y.exports=function(m,b,x,_,A){var f=-1.1*b,k=-.1*b,w=m-k,D=x[0],E=x[1],I=Math.min(o(D+k,D+w,_,A),o(E+k,E+w,_,A)),M=Math.min(o(D+f,D+k,_,A),o(E+f,E+k,_,A)),p,g;if(I>M&&MP){var C=p===y?1:6,T=p===y?"M12":"M1";return function(N,B){var U=_.c2d(N,y,A),V=U.indexOf("-",C);V>0&&(U=U.substr(0,V));var W=_.d2c(U,0,A);if(Wa?m>P?m>y*1.1?y:m>z*1.1?z:P:m>i?i:m>n?n:a:Math.pow(10,Math.floor(Math.log(m)/Math.LN10))}function s(m,b,x,_,A,f){if(_&&m>P){var k=h(b,A,f),w=h(x,A,f),D=m===y?0:1;return k[D]!==w[D]}return Math.floor(x/m)-Math.floor(b/m)>.1}function h(m,b,x){var _=b.c2d(m,y,x).split("-");return _[0]===""&&(_.unshift(),_[0]="-"+_[0]),_}}),jL=ze((te,Y)=>{var d=Sr(),y=ji(),z=as(),P=Os(),{hasColorscale:i}=hp(),n=Tp(),a=W4(),l=BL(),o=RL(),u=FL(),s=NL();function h(A,f){var k=[],w=[],D=f.orientation==="h",E=P.getFromId(A,D?f.yaxis:f.xaxis),I=D?"y":"x",M={x:"y",y:"x"}[I],p=f[I+"calendar"],g=f.cumulative,C,T=m(A,f,E,I),N=T[0],B=T[1],U=typeof N.size=="string",V=[],W=U?V:N,F=[],H=[],q=[],G=0,ee=f.histnorm,he=f.histfunc,be=ee.indexOf("density")!==-1,ve,ce,re;g.enabled&&be&&(ee=ee.replace(/ ?density$/,""),be=!1);var ge=he==="max"||he==="min",ne=ge?null:0,se=l.count,_e=o[ee],oe=!1,J=function(nt){return E.r2c(nt,0,p)},me;for(y.isArrayOrTypedArray(f[M])&&he!=="count"&&(me=f[M],oe=he==="avg",se=l[he]),C=J(N.start),ce=J(N.end)+(C-P.tickIncrement(C,N.size,!1,p))/1e6;C=0&&re=Ae;C--)if(w[C]){Oe=C;break}for(C=Ae;C<=Oe;C++)if(d(k[C])&&d(w[C])){var Le={p:k[C],s:w[C],b:0};g.enabled||(Le.pts=q[C],Be?Le.ph0=Le.ph1=q[C].length?B[q[C][0]]:k[C]:(f._computePh=!0,Le.ph0=mt(V[C]),Le.ph1=mt(V[C+1],!0))),ct.push(Le)}return ct.length===1&&(ct[0].width1=P.tickIncrement(ct[0].p,N.size,!1,p)-ct[0].p),i(f,"marker")&&n(A,f,{vals:f.marker.color,containerStr:"marker",cLetter:"c"}),i(f,"marker.line")&&n(A,f,{vals:f.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(ct,f),y.isArrayOrTypedArray(f.selectedpoints)&&y.tagSelected(ct,f,tt),ct}function m(A,f,k,w,D){var E=w+"bins",I=A._fullLayout,M=f["_"+w+"bingroup"],p=I._histogramBinOpts[M],g=I.barmode==="overlay",C,T,N,B,U,V,W,F=function(_t){return k.r2c(_t,0,B)},H=function(_t){return k.c2r(_t,0,B)},q=k.type==="date"?function(_t){return _t||_t===0?y.cleanDate(_t,null,B):null}:function(_t){return d(_t)?Number(_t):null};function G(_t,mt,vt){mt[_t+"Found"]?(mt[_t]=q(mt[_t]),mt[_t]===null&&(mt[_t]=vt[_t])):(V[_t]=mt[_t]=vt[_t],y.nestedProperty(T[0],E+"."+_t).set(vt[_t]))}if(f["_"+w+"autoBinFinished"])delete f["_"+w+"autoBinFinished"];else{T=p.traces;var ee=[],he=!0,be=!1,ve=!1;for(C=0;C"u"){if(D)return[re,U,!0];re=b(A,f,k,w,E)}W=N.cumulative||{},W.enabled&&W.currentbin!=="include"&&(W.direction==="decreasing"?re.start=H(P.tickIncrement(F(re.start),re.size,!0,B)):re.end=H(P.tickIncrement(F(re.end),re.size,!1,B))),p.size=re.size,p.sizeFound||(V.size=re.size,y.nestedProperty(T[0],E+".size").set(re.size)),G("start",p,re),G("end",p,re)}U=f["_"+w+"pos0"],delete f["_"+w+"pos0"];var ne=f._input[E]||{},se=y.extendFlat({},p),_e=p.start,oe=k.r2l(ne.start),J=oe!==void 0;if((p.startFound||J)&&oe!==k.r2l(_e)){var me=J?oe:y.aggNums(Math.min,null,U),fe={type:k.type==="category"||k.type==="multicategory"?"linear":k.type,r2l:k.r2l,dtick:p.size,tick0:_e,calendar:B,range:[me,P.tickIncrement(me,p.size,!1,B)].map(k.l2r)},Ce=P.tickFirst(fe);Ce>k.r2l(me)&&(Ce=P.tickIncrement(Ce,p.size,!0,B)),se.start=k.l2r(Ce),J||y.nestedProperty(f,E+".start").set(se.start)}var Re=p.end,Be=k.r2l(ne.end),Ze=Be!==void 0;if((p.endFound||Ze)&&Be!==k.r2l(Re)){var Ge=Ze?Be:y.aggNums(Math.max,null,U);se.end=k.l2r(Ge),Ze||y.nestedProperty(f,E+".start").set(se.end)}var tt="autobin"+w;return f._input[tt]===!1&&(f._input[E]=y.extendFlat({},f[E]||{}),delete f._input[tt],delete f[tt]),[se,U]}function b(A,f,k,w,D){var E=A._fullLayout,I=x(A,f),M=!1,p=1/0,g=[f],C,T,N;for(C=0;C=0;w--)M(w);else if(f==="increasing"){for(w=1;w=0;w--)A[w]+=A[w+1];k==="exclude"&&(A.push(0),A.shift())}}Y.exports={calc:h,calcAllAutoBins:m}}),Eq=ze((te,Y)=>{var d=ji(),y=Os(),z=BL(),P=RL(),i=FL(),n=NL(),a=jL().calcAllAutoBins;Y.exports=function(s,h){var m=y.getFromId(s,h.xaxis),b=y.getFromId(s,h.yaxis),x=h.xcalendar,_=h.ycalendar,A=function(Ot){return m.r2c(Ot,0,x)},f=function(Ot){return b.r2c(Ot,0,_)},k=function(Ot){return m.c2r(Ot,0,x)},w=function(Ot){return b.c2r(Ot,0,_)},D,E,I,M,p=a(s,h,m,"x"),g=p[0],C=p[1],T=a(s,h,b,"y"),N=T[0],B=T[1],U=h._length;C.length>U&&C.splice(U,C.length-U),B.length>U&&B.splice(U,B.length-U);var V=[],W=[],F=[],H=typeof g.size=="string",q=typeof N.size=="string",G=[],ee=[],he=H?G:g,be=q?ee:N,ve=0,ce=[],re=[],ge=h.histnorm,ne=h.histfunc,se=ge.indexOf("density")!==-1,_e=ne==="max"||ne==="min",oe=_e?null:0,J=z.count,me=P[ge],fe=!1,Ce=[],Re=[],Be="z"in h?h.z:"marker"in h&&Array.isArray(h.marker.color)?h.marker.color:"";Be&&ne!=="count"&&(fe=ne==="avg",J=z[ne]);var Ze=g.size,Ge=A(g.start),tt=A(g.end)+(Ge-y.tickIncrement(Ge,Ze,!1,x))/1e6;for(D=Ge;D=0&&I<_t&&M>=0&&M{var d=ji(),y=ei().BADNUM,z=Dm();Y.exports=function(P,i,n,a,l,o){var u=P._length,s=i.makeCalcdata(P,a),h=n.makeCalcdata(P,l);s=z(P,i,a,s).vals,h=z(P,n,l,h).vals;var m=P.text,b=m!==void 0&&d.isArray1D(m),x=P.hovertext,_=x!==void 0&&d.isArray1D(x),A,f,k=d.distinctVals(s),w=k.vals,D=d.distinctVals(h),E=D.vals,I=[],M,p,g=E.length,C=w.length;for(A=0;A{var d=Sr(),y=ji(),z=ei().BADNUM;Y.exports=function(P,i,n,a){var l,o,u,s,h,m;function b(w){if(d(w))return+w}if(i&&i.transpose){for(l=0,h=0;h{var d=ji(),y=.01,z=[[-1,0],[1,0],[0,-1],[0,1]];function P(n){return .5-.25*Math.min(1,n*.5)}Y.exports=function(n,a){var l=1,o;for(i(n,a),o=0;oy;o++)l=i(n,a,P(l));return l>y&&d.log("interp2d didn't converge quickly",l),n};function i(n,a,l){var o=0,u,s,h,m,b,x,_,A,f,k,w,D,E;for(m=0;mD&&(o=Math.max(o,Math.abs(n[s][h]-w)/(E-D))))}return o}}),FS=ze((te,Y)=>{var d=ji().maxRowLength;Y.exports=function(y){var z=[],P={},i=[],n=y[0],a=[],l=[0,0,0],o=d(y),u,s,h,m,b,x,_,A;for(s=0;s=0;b--)m=i[b],s=m[0],h=m[1],x=((P[[s-1,h]]||l)[2]+(P[[s+1,h]]||l)[2]+(P[[s,h-1]]||l)[2]+(P[[s,h+1]]||l)[2])/20,x&&(_[m]=[s,h,x],i.splice(b,1),A=!0);if(!A)throw"findEmpties iterated with no new neighbors";for(m in _)P[m]=_[m],z.push(_[m])}return z.sort(function(f,k){return k[2]-f[2]})}}),UL=ze((te,Y)=>{var d=as(),y=ji().isArrayOrTypedArray;Y.exports=function(z,P,i,n,a,l){var o=[],u=d.traceIs(z,"contour"),s=d.traceIs(z,"histogram"),h,m,b,x=y(P)&&P.length>1;if(x&&!s&&l.type!=="category"){var _=P.length;if(_<=a){if(u)o=Array.from(P).slice(0,a);else if(a===1)l.type==="log"?o=[.5*P[0],2*P[0]]:o=[P[0]-.5,P[0]+.5];else if(l.type==="log"){for(o=[Math.pow(P[0],1.5)/Math.pow(P[1],.5)],b=1;b<_;b++)o.push(Math.sqrt(P[b-1]*P[b]));o.push(Math.pow(P[_-1],1.5)/Math.pow(P[_-2],.5))}else{for(o=[1.5*P[0]-.5*P[1]],b=1;b<_;b++)o.push((P[b-1]+P[b])*.5);o.push(1.5*P[_-1]-.5*P[_-2])}if(_{var d=as(),y=ji(),z=Os(),P=Dm(),i=Eq(),n=Tp(),a=OS(),l=BS(),o=RS(),u=FS(),s=UL(),h=ei().BADNUM;Y.exports=function(x,_){var A=z.getFromId(x,_.xaxis||"x"),f=z.getFromId(x,_.yaxis||"y"),k=d.traceIs(_,"contour"),w=d.traceIs(_,"histogram"),D=k?"best":_.zsmooth,E,I,M,p,g,C,T,N,B,U,V;if(A._minDtick=0,f._minDtick=0,w)V=i(x,_),p=V.orig_x,E=V.x,I=V.x0,M=V.dx,N=V.orig_y,g=V.y,C=V.y0,T=V.dy,B=V.z;else{var W=_.z;y.isArray1D(W)?(a(_,A,f,"x","y",["z"]),E=_._x,g=_._y,W=_._z):(p=_.x?A.makeCalcdata(_,"x"):[],N=_.y?f.makeCalcdata(_,"y"):[],E=P(_,A,"x",p).vals,g=P(_,f,"y",N).vals,_._x=E,_._y=g),I=_.x0,M=_.dx,C=_.y0,T=_.dy,B=l(W,_,A,f)}(A.rangebreaks||f.rangebreaks)&&(B=b(E,g,B),w||(E=m(E),g=m(g),_._x=E,_._y=g)),!w&&(k||_.connectgaps)&&(_._emptypoints=u(B),o(B,_._emptypoints));function F(re){D=_._input.zsmooth=_.zsmooth=!1,y.warn('cannot use zsmooth: "fast": '+re)}function H(re){if(re.length>1){var ge=(re[re.length-1]-re[0])/(re.length-1),ne=Math.abs(ge/100);for(U=0;Une)return!1}return!0}_._islinear=!1,A.type==="log"||f.type==="log"?D==="fast"&&F("log axis found"):H(E)?H(g)?_._islinear=!0:D==="fast"&&F("y scale is not linear"):D==="fast"&&F("x scale is not linear");var q=y.maxRowLength(B),G=_.xtype==="scaled"?"":E,ee=s(_,G,I,M,q,A),he=_.ytype==="scaled"?"":g,be=s(_,he,C,T,B.length,f);_._extremes[A._id]=z.findExtremes(A,ee),_._extremes[f._id]=z.findExtremes(f,be);var ve={x:ee,y:be,z:B,text:_._text||_.text,hovertext:_._hovertext||_.hovertext};if(_.xperiodalignment&&p&&(ve.orig_x=p),_.yperiodalignment&&N&&(ve.orig_y=N),G&&G.length===ee.length-1&&(ve.xCenter=G),he&&he.length===be.length-1&&(ve.yCenter=he),w&&(ve.xRanges=V.xRanges,ve.yRanges=V.yRanges,ve.pts=V.pts),k||n(x,_,{vals:B,cLetter:"z"}),k&&_.contours&&_.contours.coloring==="heatmap"){var ce={type:_.type==="contour"?"heatmap":"histogram2d",xcalendar:_.xcalendar,ycalendar:_.ycalendar};ve.xfill=s(ce,G,I,M,q,A),ve.yfill=s(ce,he,C,T,B.length,f)}return[ve]};function m(x){for(var _=[],A=x.length,f=0;f{te.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],te.STYLE=te.CSS_DECLARATIONS.map(function(Y){return Y.join(": ")+"; "}).join("")}),$L=ze((te,Y)=>{var d=jS(),y=Zs(),z=ji(),P=null;function i(){if(P!==null)return P;P=!1;var n=z.isSafari()||z.isMacWKWebView()||z.isIOS();if(window.navigator.userAgent&&!n){var a=Array.from(d.CSS_DECLARATIONS).reverse(),l=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof l=="function")P=a.some(function(h){return l.apply(null,h)});else{var o=y.tester.append("image").attr("style",d.STYLE),u=window.getComputedStyle(o.node()),s=u.imageRendering;P=a.some(function(h){var m=h[1];return s===m||s===m.toLowerCase()}),o.remove()}}return P}Y.exports=i}),US=ze((te,Y)=>{var d=ri(),y=ln(),z=as(),P=Zs(),i=Os(),n=ji(),a=cc(),l=Ys(),o=Xi(),u=lh().extractOpts,s=lh().makeColorScaleFuncFromTrace,h=k0(),m=Rf(),b=m.LINE_SPACING,x=$L(),_=jS().STYLE,A="heatmap-label";function f(I){return I.selectAll("g."+A)}function k(I){f(I).remove()}Y.exports=function(I,M,p,g){var C=M.xaxis,T=M.yaxis;n.makeTraceGroups(g,p,"hm").each(function(N){var B=d.select(this),U=N[0],V=U.trace,W=V.xgap||0,F=V.ygap||0,H=U.z,q=U.x,G=U.y,ee=U.xCenter,he=U.yCenter,be=z.traceIs(V,"contour"),ve=be?"best":V.zsmooth,ce=H.length,re=n.maxRowLength(H),ge=!1,ne=!1,se,_e,oe,J,me,fe,Ce,Re;for(fe=0;se===void 0&&fe0;)_e=C.c2p(q[fe]),fe--;for(_e0;)me=T.c2p(G[fe]),fe--;me=C._length||_e<=0||J>=T._length||me<=0;if(_t){var mt=B.selectAll("image").data([]);mt.exit().remove(),k(B);return}var vt,ct;Be==="fast"?(vt=re,ct=ce):(vt=Ge,ct=tt);var Ae=document.createElement("canvas");Ae.width=vt,Ae.height=ct;var Oe=Ae.getContext("2d",{willReadFrequently:!0}),Le=s(V,{noNumericCheck:!0,returnArray:!0}),nt,xt;Be==="fast"?(nt=ge?function(pn){return re-1-pn}:n.identity,xt=ne?function(pn){return ce-1-pn}:n.identity):(nt=function(pn){return n.constrain(Math.round(C.c2p(q[pn])-se),0,Ge)},xt=function(pn){return n.constrain(Math.round(T.c2p(G[pn])-J),0,tt)});var ut=xt(0),Et=[ut,ut],Gt=ge?0:1,Qt=ne?0:1,vr=0,mr=0,Yr=0,ii=0,Lr,ci,vi,Ot,Xe;function ot(pn,Ua){if(pn!==void 0){var ea=Le(pn);return ea[0]=Math.round(ea[0]),ea[1]=Math.round(ea[1]),ea[2]=Math.round(ea[2]),vr+=Ua,mr+=ea[0]*Ua,Yr+=ea[1]*Ua,ii+=ea[2]*Ua,ea}return[0,0,0,0]}function De(pn,Ua,ea,fo){var ho=pn[ea.bin0];if(ho===void 0)return ot(void 0,1);var Vo=pn[ea.bin1],Ao=Ua[ea.bin0],Wo=Ua[ea.bin1],Wa=Vo-ho||0,Ts=Ao-ho||0,fs;return Vo===void 0?Wo===void 0?fs=0:Ao===void 0?fs=2*(Wo-ho):fs=(2*Wo-Ao-ho)*2/3:Wo===void 0?Ao===void 0?fs=0:fs=(2*ho-Vo-Ao)*2/3:Ao===void 0?fs=(2*Wo-Vo-ho)*2/3:fs=Wo+ho-Vo-Ao,ot(ho+ea.frac*Wa+fo.frac*(Ts+ea.frac*fs))}if(Be!=="default"){var ye=0,Pe;try{Pe=new Uint8Array(vt*ct*4)}catch{Pe=new Array(vt*ct*4)}if(Be==="smooth"){var He=ee||q,at=he||G,ht=new Array(He.length),At=new Array(at.length),Wt=new Array(Ge),Yt=ee?D:w,hr=he?D:w,zr,Dr,br;for(fe=0;feFn||Fn>T._length))for(Ce=qi;CeJn||Jn>C._length)){var sa=l({x:Kn,y:Ln},V,I._fullLayout);sa.x=Kn,sa.y=Ln;var Mn=U.z[fe][Ce];Mn===void 0?(sa.z="",sa.zLabel=""):(sa.z=Mn,sa.zLabel=i.tickText(Kt,Mn,"hover").text);var Ha=U.text&&U.text[fe]&&U.text[fe][Ce];(Ha===void 0||Ha===!1)&&(Ha=""),sa.text=Ha;var io=n.texttemplateString({data:[sa,V._meta],fallback:V.texttemplatefallback,labels:sa,locale:I._fullLayout._d3locale,template:va});if(io){var Ft=io.split("
"),Rt=Ft.length,qr=0;for(Re=0;Re{Y.exports={min:"zmin",max:"zmax"}}),$S=ze((te,Y)=>{var d=ri();Y.exports=function(y){d.select(y).selectAll(".hm image").style("opacity",function(z){return z.trace.opacity})}}),HS=ze((te,Y)=>{var d=hf(),y=ji(),z=y.isArrayOrTypedArray,P=Os(),i=lh().extractOpts;Y.exports=function(n,a,l,o,u){u||(u={});var s=u.isContour,h=n.cd[0],m=h.trace,b=n.xa,x=n.ya,_=h.x,A=h.y,f=h.z,k=h.xCenter,w=h.yCenter,D=h.zmask,E=m.zhoverformat,I=_,M=A,p,g,C,T;if(n.index!==!1){try{C=Math.round(n.index[1]),T=Math.round(n.index[0])}catch{y.error("Error hovering on heatmap, pointNumber must be [row,col], found:",n.index);return}if(C<0||C>=f[0].length||T<0||T>f.length)return}else{if(d.inbox(a-_[0],a-_[_.length-1],0)>0||d.inbox(l-A[0],l-A[A.length-1],0)>0)return;if(s){var N;for(I=[2*_[0]-_[1]],N=1;N<_.length;N++)I.push((_[N]+_[N-1])/2);for(I.push([2*_[_.length-1]-_[_.length-2]]),M=[2*A[0]-A[1]],N=1;N{Y.exports={attributes:Pw(),supplyDefaults:Mq(),calc:NS(),plot:US(),colorbar:D_(),style:$S(),hoverPoints:HS(),moduleType:"trace",name:"heatmap",basePlotModule:Ff(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}),Pq=ze((te,Y)=>{Y.exports=Lq()}),HL=ze((te,Y)=>{Y.exports=function(d,y){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}),Iq=ze((te,Y)=>{Y.exports={eventDataKeys:["binNumber"]}}),VS=ze((te,Y)=>{var d=Xv(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,texttemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=On(),a=HL(),l=Iq(),o=nn().extendFlat;Y.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:y("x"),yhoverformat:y("y"),text:o({},d.text,{}),hovertext:o({},d.hovertext,{}),orientation:d.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:a("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:a("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({},{keys:l.eventDataKeys}),hovertemplatefallback:i(),texttemplate:P({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:i({editType:"plot"}),textposition:o({},d.textposition,{arrayOk:!1}),textfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:n({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:d.insidetextanchor,textangle:d.textangle,cliponaxis:d.cliponaxis,constraintext:d.constraintext,marker:d.marker,offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:d.selected,unselected:d.unselected,zorder:d.zorder}}),Dq=ze((te,Y)=>{var d=as(),y=ji(),z=Xi(),P=tg().handleText,i=MS(),n=VS();Y.exports=function(a,l,o,u){function s(M,p){return y.coerce(a,l,n,M,p)}var h=s("x"),m=s("y"),b=s("cumulative.enabled");b&&(s("cumulative.direction"),s("cumulative.currentbin")),s("text");var x=s("textposition");P(a,l,u,s,x,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),s("xhoverformat"),s("yhoverformat");var _=s("orientation",m&&!h?"h":"v"),A=_==="v"?"x":"y",f=_==="v"?"y":"x",k=h&&m?Math.min(y.minRowLength(h)&&y.minRowLength(m)):y.minRowLength(l[A]||[]);if(!k){l.visible=!1;return}l._length=k;var w=d.getComponentMethod("calendars","handleTraceDefaults");w(a,l,["x","y"],u);var D=l[f];D&&s("histfunc"),s("histnorm"),s("autobin"+A),i(a,l,s,o,u),y.coerceSelectionMarkerOpacity(l,s);var E=(l.marker.line||{}).color,I=d.getComponentMethod("errorbars","supplyDefaults");I(a,l,E||z.defaultLine,{axis:"y"}),I(a,l,E||z.defaultLine,{axis:"x",inherit:"y"}),s("zorder")}}),WS=ze((te,Y)=>{var d=ji(),y=Zc(),z=as().traceIs,P=Yv(),i=tg().validateCornerradius,n=d.nestedProperty,a=ry().getAxisGroup,l=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],o=["x","y"];Y.exports=function(u,s){var h=s._histogramBinOpts={},m=[],b={},x=[],_,A,f,k,w,D,E;function I(be,ve){return d.coerce(_._input,_,_._module.attributes,be,ve)}function M(be){return be.orientation==="v"?"x":"y"}function p(be,ve){var ce=y.getFromTrace({_fullLayout:s},be,ve);return ce.type}function g(be,ve,ce){var re=be.uid+"__"+ce;ve||(ve=re);var ge=p(be,ce),ne=be[ce+"calendar"]||"",se=h[ve],_e=!0;se&&(ge===se.axType&&ne===se.calendar?(_e=!1,se.traces.push(be),se.dirs.push(ce)):(ve=re,ge!==se.axType&&d.warn(["Attempted to group the bins of trace",be.index,"set on a","type:"+ge,"axis","with bins on","type:"+se.axType,"axis."].join(" ")),ne!==se.calendar&&d.warn(["Attempted to group the bins of trace",be.index,"set with a",ne,"calendar","with bins",se.calendar?"on a "+se.calendar+" calendar":"w/o a set calendar"].join(" ")))),_e&&(h[ve]={traces:[be],dirs:[ce],axType:ge,calendar:be[ce+"calendar"]||""}),be["_"+ce+"bingroup"]=ve}for(w=0;w{var d=Ew().hoverPoints,y=Os().hoverLabelText;Y.exports=function(z,P,i,n,a){var l=d(z,P,i,n,a);if(l){z=l[0];var o=z.cd[z.index],u=z.cd[0].trace;if(!u.cumulative.enabled){var s=u.orientation==="h"?"y":"x";z[s+"Label"]=y(z[s+"a"],[o.ph0,o.ph1],u[s+"hoverformat"])}return l}}}),VL=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){if(d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"zLabelVal"in y&&(d.z=y.zLabelVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),!(z.cumulative||{}).enabled){var n=Array.isArray(i)?P[0].pts[i[0]][i[1]]:P[i].pts;d.pointNumbers=n,d.binNumber=d.pointNumber,delete d.pointNumber,delete d.pointIndex;var a;if(z._indexToPoints){a=[];for(var l=0;l{Y.exports={attributes:VS(),layoutAttributes:AS(),supplyDefaults:Dq(),crossTraceDefaults:WS(),supplyLayoutDefaults:PL(),calc:jL().calc,crossTraceCalc:Ur().crossTraceCalc,plot:gb().plot,layerName:"barlayer",style:Lg().style,styleOnSelect:Lg().styleOnSelect,colorbar:Mo(),hoverPoints:zq(),selectPoints:Lw(),eventData:VL(),moduleType:"trace",name:"histogram",basePlotModule:Ff(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}),Bq=ze((te,Y)=>{Y.exports=Oq()}),qS=ze((te,Y)=>{var d=VS(),y=HL(),z=Pw(),P=xa(),i=Sh().axisHoverFormat,{hovertemplateAttrs:n,texttemplateAttrs:a,templatefallbackAttrs:l}=rc(),o=Oc(),u=nn().extendFlat;Y.exports=u({x:d.x,y:d.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:y("x"),nbinsy:d.nbinsy,ybins:y("y"),autobinx:d.autobinx,autobiny:d.autobiny,bingroup:u({},d.bingroup,{}),xbingroup:u({},d.bingroup,{}),ybingroup:u({},d.bingroup,{}),xgap:z.xgap,ygap:z.ygap,zsmooth:z.zsmooth,xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z",1),hovertemplate:n({},{keys:["z"]}),hovertemplatefallback:l(),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:l({editType:"plot"}),textfont:z.textfont,showlegend:u({},P.showlegend,{dflt:!1})},o("",{cLetter:"z",autoColorDflt:!1}))}),WL=ze((te,Y)=>{var d=as(),y=ji();Y.exports=function(z,P,i,n){var a=i("x"),l=i("y"),o=y.minRowLength(a),u=y.minRowLength(l);if(!o||!u){P.visible=!1;return}P._length=Math.min(o,u);var s=d.getComponentMethod("calendars","handleTraceDefaults");s(z,P,["x","y"],n);var h=i("z")||i("marker.color");h&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")}}),Rq=ze((te,Y)=>{var d=ji(),y=WL(),z=OL(),P=Cc(),i=K4(),n=qS();Y.exports=function(a,l,o,u){function s(h,m){return d.coerce(a,l,n,h,m)}y(a,l,s,u),l.visible!==!1&&(z(a,l,s,u),P(a,l,u,s,{prefix:"",cLetter:"z"}),s("hovertemplate"),s("hovertemplatefallback"),i(s,u),s("xhoverformat"),s("yhoverformat"))}}),Fq=ze((te,Y)=>{var d=HS(),y=Os().hoverLabelText;Y.exports=function(z,P,i,n,a){var l=d(z,P,i,n,a);if(l){z=l[0];var o=z.index,u=o[0],s=o[1],h=z.cd[0],m=h.trace,b=h.xRanges[s],x=h.yRanges[u];return z.xLabel=y(z.xa,[b[0],b[1]],m.xhoverformat),z.yLabel=y(z.ya,[x[0],x[1]],m.yhoverformat),l}}}),Nq=ze((te,Y)=>{Y.exports={attributes:qS(),supplyDefaults:Rq(),crossTraceDefaults:WS(),calc:NS(),plot:US(),layerName:"heatmaplayer",colorbar:D_(),style:$S(),hoverPoints:Fq(),eventData:VL(),moduleType:"trace",name:"histogram2d",basePlotModule:Ff(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}),jq=ze((te,Y)=>{Y.exports=Nq()}),GS=ze((te,Y)=>{Y.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}),Y4=ze((te,Y)=>{var d=Pw(),y=ff(),z=Sh(),P=z.axisHoverFormat,i=z.descriptionOnlyNumbers,n=Oc(),a=qd().dash,l=On(),o=nn().extendFlat,u=GS(),s=u.COMPARISON_OPS2,h=u.INTERVAL_OPS,m=y.line;Y.exports=o({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:y.xperiod0,yperiod0:y.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:o({},d.texttemplate,{}),texttemplatefallback:d.texttemplatefallback,textfont:o({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:o({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:l({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:i("contour label")},operation:{valType:"enumerated",values:[].concat(s).concat(h),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:o({},m.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:a,smoothing:o({},m.smoothing,{}),editType:"plot"},zorder:y.zorder},n("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}),qL=ze((te,Y)=>{var d=qS(),y=Y4(),z=Oc(),P=Sh().axisHoverFormat,i=nn().extendFlat;Y.exports=i({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:y.autocontour,ncontours:y.ncontours,contours:y.contours,line:{color:y.line.color,width:i({},y.line.width,{dflt:.5}),dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z",1),hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,texttemplate:y.texttemplate,texttemplatefallback:y.texttemplatefallback,textfont:y.textfont},z("",{cLetter:"z",editTypeOverride:"calc"}))}),ZS=ze((te,Y)=>{Y.exports=function(d,y,z,P){var i=P("contours.start"),n=P("contours.end"),a=i===!1||n===!1,l=z("contours.size"),o;a?o=y.autocontour=!0:o=z("autocontour",!1),(o||!l)&&z("ncontours")}}),GL=ze((te,Y)=>{var d=ji();Y.exports=function(y,z,P,i){i||(i={});var n=y("contours.showlabels");if(n){var a=z.font;d.coerceFont(y,"contours.labelfont",a,{overrideDflt:{color:P}}),y("contours.labelformat")}i.hasHover!==!1&&y("zhoverformat")}}),KS=ze((te,Y)=>{var d=Cc(),y=GL();Y.exports=function(z,P,i,n,a){var l=i("contours.coloring"),o,u="";l==="fill"&&(o=i("contours.showlines")),o!==!1&&(l!=="lines"&&(u=i("line.color","#000")),i("line.width",.5),i("line.dash")),l!=="none"&&(z.showlegend!==!0&&(P.showlegend=!1),P._dfltShowLegend=!1,d(z,P,n,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),y(i,n,u,a)}}),Uq=ze((te,Y)=>{var d=ji(),y=WL(),z=ZS(),P=KS(),i=K4(),n=qL();Y.exports=function(a,l,o,u){function s(m,b){return d.coerce(a,l,n,m,b)}function h(m){return d.coerce2(a,l,n,m)}y(a,l,s,u),l.visible!==!1&&(z(a,l,s,h),P(a,l,s,u),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),l.contours&&l.contours.coloring==="heatmap"&&i(s,u))}}),ZL=ze((te,Y)=>{var d=Os(),y=ji();Y.exports=function(P,i){var n=P.contours;if(P.autocontour){var a=P.zmin,l=P.zmax;(P.zauto||a===void 0)&&(a=y.aggNums(Math.min,null,i)),(P.zauto||l===void 0)&&(l=y.aggNums(Math.max,null,i));var o=z(a,l,P.ncontours);n.size=o.dtick,n.start=d.tickFirst(o),o.range.reverse(),n.end=d.tickFirst(o),n.start===a&&(n.start+=n.size),n.end===l&&(n.end-=n.size),n.start>n.end&&(n.start=n.end=(n.start+n.end)/2),P._input.contours||(P._input.contours={}),y.extendFlat(P._input.contours,{start:n.start,end:n.end,size:n.size}),P._input.autocontour=!0}else if(n.type!=="constraint"){var u=n.start,s=n.end,h=P._input.contours;if(u>s&&(n.start=h.start=s,s=n.end=h.end=u,u=n.start),!(n.size>0)){var m;u===s?m=1:m=z(u,s,P.ncontours).dtick,h.size=n.size=m}}};function z(P,i,n){var a={type:"linear",range:[P,i]};return d.autoTicks(a,(i-P)/(n||15)),a}}),X4=ze((te,Y)=>{Y.exports=function(d){return d.end+d.size/1e6}}),KL=ze((te,Y)=>{var d=lh(),y=NS(),z=ZL(),P=X4();Y.exports=function(i,n){var a=y(i,n),l=a[0].z;z(n,l);var o=n.contours,u=d.extractOpts(n),s;if(o.coloring==="heatmap"&&u.auto&&n.autocontour===!1){var h=o.start,m=P(o),b=o.size||1,x=Math.floor((m-h)/b)+1;isFinite(b)||(b=1,x=1);var _=h-b/2,A=_+x*b;s=[_,A]}else s=l;return d.calc(i,n,{vals:s,cLetter:"z"}),a}}),J4=ze((te,Y)=>{Y.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}),YL=ze((te,Y)=>{var d=J4();Y.exports=function(z){var P=z[0].z,i=P.length,n=P[0].length,a=i===2||n===2,l,o,u,s,h,m,b,x,_;for(o=0;oz?0:1)+(P[0][1]>z?0:2)+(P[1][1]>z?0:4)+(P[1][0]>z?0:8);if(i===5||i===10){var n=(P[0][0]+P[0][1]+P[1][0]+P[1][1])/4;return z>n?i===5?713:1114:i===5?104:208}return i===15?0:i}}),XL=ze((te,Y)=>{var d=ji(),y=J4();Y.exports=function(l,o,u){var s,h,m,b,x;for(o=o||.01,u=u||.01,m=0;m20?(b=y.CHOOSESADDLE[b][(x[0]||x[1])<0?0:1],l.crossings[m]=y.SADDLEREMAINDER[b]):delete l.crossings[m],x=y.NEWDELTA[b],!x){d.log("Found bad marching index:",b,o,l.level);break}_.push(a(l,o,x)),o[0]+=x[0],o[1]+=x[1],m=o.join(","),z(_[_.length-1],_[_.length-2],s,h)&&_.pop();var E=x[0]&&(o[0]<0||o[0]>f-2)||x[1]&&(o[1]<0||o[1]>A-2),I=o[0]===k[0]&&o[1]===k[1]&&x[0]===w[0]&&x[1]===w[1];if(I||u&&E)break;b=l.crossings[m]}D===1e4&&d.log("Infinite loop in contour?");var M=z(_[0],_[_.length-1],s,h),p=0,g=.2*l.smoothing,C=[],T=0,N,B,U,V,W,F,H,q,G,ee,he;for(D=1;D<_.length;D++)H=P(_[D],_[D-1]),p+=H,C.push(H);var be=p/C.length*g;function ve(ge){return _[ge%_.length]}for(D=_.length-2;D>=T;D--)if(N=C[D],N=T&&N+C[B]q&&G--,l.edgepaths[G]=he.concat(_,ee));break}re||(l.edgepaths[q]=_.concat(ee))}for(q=0;q20&&o?l===208||l===1114?s=u[0]===0?1:-1:h=u[1]===0?1:-1:y.BOTTOMSTART.indexOf(l)!==-1?h=1:y.LEFTSTART.indexOf(l)!==-1?s=1:y.TOPSTART.indexOf(l)!==-1?h=-1:s=-1,[s,h]}function a(l,o,u){var s=o[0]+Math.max(u[0],0),h=o[1]+Math.max(u[1],0),m=l.z[h][s],b=l.xaxis,x=l.yaxis;if(u[1]){var _=(l.level-m)/(l.z[h][s+1]-m),A=(_!==1?(1-_)*b.c2l(l.x[s]):0)+(_!==0?_*b.c2l(l.x[s+1]):0);return[b.c2p(b.l2c(A),!0),x.c2p(l.y[h],!0),s+_,h]}else{var f=(l.level-m)/(l.z[h+1][s]-m),k=(f!==1?(1-f)*x.c2l(l.y[h]):0)+(f!==0?f*x.c2l(l.y[h+1]):0);return[b.c2p(l.x[s],!0),x.c2p(x.l2c(k),!0),s,h+f]}}}),$q=ze((te,Y)=>{var d=GS(),y=Sr();Y.exports={"[]":P("[]"),"][":P("]["),">":i(">"),"<":i("<"),"=":i("=")};function z(n,a){var l=Array.isArray(a),o;function u(s){return y(s)?+s:null}return d.COMPARISON_OPS2.indexOf(n)!==-1?o=u(l?a[0]:a):d.INTERVAL_OPS.indexOf(n)!==-1?o=l?[u(a[0]),u(a[1])]:[u(a),u(a)]:d.SET_OPS.indexOf(n)!==-1&&(o=l?a.map(u):[u(a)]),o}function P(n){return function(a){a=z(n,a);var l=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);return{start:l,end:o,size:o-l}}}function i(n){return function(a){return a=z(n,a),{start:a,end:1/0,size:1/0}}}}),JL=ze((te,Y)=>{var d=ji(),y=$q(),z=X4();Y.exports=function(P,i,n){for(var a=P.type==="constraint"?y[P._operation](P.value):P,l=a.size,o=[],u=z(a),s=n.trace._carpetTrace,h=s?{xaxis:s.aaxis,yaxis:s.baxis,x:n.a,y:n.b}:{xaxis:i.xaxis,yaxis:i.yaxis,x:n.x,y:n.y},m=a.start;m1e3){d.warn("Too many contours, clipping at 1000",P);break}return o}}),QL=ze((te,Y)=>{var d=ji();Y.exports=function(z,P){var i,n,a,l=function(s){return s.reverse()},o=function(s){return s};switch(P){case"=":case"<":return z;case">":for(z.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),n=z[0],i=0;i{Y.exports=function(d,y){var z=d[0],P=z.z,i;switch(y.type){case"levels":var n=Math.min(P[0][0],P[0][1]);for(i=0;ia.level||a.starts.length&&n===a.level)}break;case"constraint":if(z.prefixBoundary=!1,z.edgepaths.length)return;var l=z.x.length,o=z.y.length,u=-1/0,s=1/0;for(i=0;i":h>u&&(z.prefixBoundary=!0);break;case"<":(hu||z.starts.length&&b===s)&&(z.prefixBoundary=!0);break;case"][":m=Math.min(h[0],h[1]),b=Math.max(h[0],h[1]),mu&&(z.prefixBoundary=!0);break}break}}}),YS=ze(te=>{var Y=ri(),d=ji(),y=Zs(),z=lh(),P=cc(),i=Os(),n=Z0(),a=US(),l=YL(),o=XL(),u=JL(),s=QL(),h=eP(),m=J4(),b=m.LABELOPTIMIZER;te.plot=function(E,I,M,p){var g=I.xaxis,C=I.yaxis;d.makeTraceGroups(p,M,"contour").each(function(T){var N=Y.select(this),B=T[0],U=B.trace,V=B.x,W=B.y,F=U.contours,H=u(F,I,B),q=d.ensureSingle(N,"g","heatmapcoloring"),G=[];F.coloring==="heatmap"&&(G=[T]),a(E,I,G,q),l(H),o(H);var ee=g.c2p(V[0],!0),he=g.c2p(V[V.length-1],!0),be=C.c2p(W[0],!0),ve=C.c2p(W[W.length-1],!0),ce=[[ee,ve],[he,ve],[he,be],[ee,be]],re=H;F.type==="constraint"&&(re=s(H,F._operation)),x(N,ce,F),_(N,re,ce,F),f(N,H,E,B,F),w(N,I,E,B,ce)})};function x(E,I,M){var p=d.ensureSingle(E,"g","contourbg"),g=p.selectAll("path").data(M.coloring==="fill"?[0]:[]);g.enter().append("path"),g.exit().remove(),g.attr("d","M"+I.join("L")+"Z").style("stroke","none")}function _(E,I,M,p){var g=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",C="M"+M.join("L")+"Z";g&&h(I,p);var T=d.ensureSingle(E,"g","contourfill"),N=T.selectAll("path").data(g?I:[]);N.enter().append("path"),N.exit().remove(),N.each(function(B){var U=(B.prefixBoundary?C:"")+A(B,M);U?Y.select(this).attr("d",U).style("stroke","none"):Y.select(this).remove()})}function A(E,I){var M="",p=0,g=E.edgepaths.map(function(he,be){return be}),C=!0,T,N,B,U,V,W;function F(he){return Math.abs(he[1]-I[0][1])<.01}function H(he){return Math.abs(he[1]-I[2][1])<.01}function q(he){return Math.abs(he[0]-I[0][0])<.01}function G(he){return Math.abs(he[0]-I[2][0])<.01}for(;g.length;){for(W=y.smoothopen(E.edgepaths[p],E.smoothing),M+=C?W:W.replace(/^M/,"L"),g.splice(g.indexOf(p),1),T=E.edgepaths[p][E.edgepaths[p].length-1],U=-1,B=0;B<4;B++){if(!T){d.log("Missing end?",p,E);break}for(F(T)&&!G(T)?N=I[1]:q(T)?N=I[0]:H(T)?N=I[3]:G(T)&&(N=I[2]),V=0;V=0&&(N=ee,U=V):Math.abs(T[1]-N[1])<.01?Math.abs(T[1]-ee[1])<.01&&(ee[0]-T[0])*(N[0]-ee[0])>=0&&(N=ee,U=V):d.log("endpt to newendpt is not vert. or horz.",T,N,ee)}if(T=N,U>=0)break;M+="L"+N}if(U===E.edgepaths.length){d.log("unclosed perimeter path");break}p=U,C=g.indexOf(p)===-1,C&&(p=g[0],M+="Z")}for(p=0;pb.MAXCOST*2)break;F&&(N/=2),T=U-N/2,B=T+N*1.5}if(W<=b.MAXCOST)return V};function k(E,I,M,p){var g=I.width/2,C=I.height/2,T=E.x,N=E.y,B=E.theta,U=Math.cos(B)*g,V=Math.sin(B)*g,W=(T>p.center?p.right-T:T-p.left)/(U+Math.abs(Math.sin(B)*C)),F=(N>p.middle?p.bottom-N:N-p.top)/(Math.abs(V)+Math.cos(B)*C);if(W<1||F<1)return 1/0;var H=b.EDGECOST*(1/(W-1)+1/(F-1));H+=b.ANGLECOST*B*B;for(var q=T-U,G=N-V,ee=T+U,he=N+V,be=0;be{var d=ri(),y=lh(),z=X4();Y.exports=function(P){var i=P.contours,n=i.start,a=z(i),l=i.size||1,o=Math.floor((a-n)/l)+1,u=i.coloring==="lines"?0:1,s=y.extractOpts(P);isFinite(l)||(l=1,o=1);var h=s.reversescale?y.flipScale(s.colorscale):s.colorscale,m=h.length,b=new Array(m),x=new Array(m),_,A,f=s.min,k=s.max;if(i.coloring==="heatmap"){for(A=0;A=k)&&(n<=f&&(n=f),a>=k&&(a=k),o=Math.floor((a-n)/l)+1,u=0),A=0;Af&&(b.unshift(f),x.unshift(x[0])),b[b.length-1]{var d=ri(),y=Zs(),z=$S(),P=tP();Y.exports=function(i){var n=d.select(i).selectAll("g.contour");n.style("opacity",function(a){return a[0].trace.opacity}),n.each(function(a){var l=d.select(this),o=a[0].trace,u=o.contours,s=o.line,h=u.size||1,m=u.start,b=u.type==="constraint",x=!b&&u.coloring==="lines",_=!b&&u.coloring==="fill",A=x||_?P(o):null;l.selectAll("g.contourlevel").each(function(w){d.select(this).selectAll("path").call(y.lineGroupStyle,s.width,x?A(w.level):s.color,s.dash)});var f=u.labelfont;if(l.selectAll("g.contourlabels text").each(function(w){y.font(d.select(this),{weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow,family:f.family,size:f.size,color:f.color||(x?A(w.level):s.color)})}),b)l.selectAll("g.contourfill path").style("fill",o.fillcolor);else if(_){var k;l.selectAll("g.contourfill path").style("fill",function(w){return k===void 0&&(k=w.level),A(w.level+.5*h)}),k===void 0&&(k=m),l.selectAll("g.contourbg path").style("fill",A(k-.5*h))}}),z(i)}}),JS=ze((te,Y)=>{var d=lh(),y=tP(),z=X4();function P(i,n,a){var l=n.contours,o=n.line,u=l.size||1,s=l.coloring,h=y(n,{isColorbar:!0});if(s==="heatmap"){var m=d.extractOpts(n);a._fillgradient=m.reversescale?d.flipScale(m.colorscale):m.colorscale,a._zrange=[m.min,m.max]}else s==="fill"&&(a._fillcolor=h);a._line={color:s==="lines"?h:o.color,width:l.showlines!==!1?o.width:0,dash:o.dash},a._levels={start:l.start,end:z(l),size:u}}Y.exports={min:"zmin",max:"zmax",calc:P}}),rP=ze((te,Y)=>{var d=Xi(),y=HS();Y.exports=function(z,P,i,n,a){a||(a={}),a.isContour=!0;var l=y(z,P,i,n,a);return l&&l.forEach(function(o){var u=o.trace;u.contours.type==="constraint"&&(u.fillcolor&&d.opacity(u.fillcolor)?o.color=d.addOpacity(u.fillcolor,1):u.contours.showlines&&d.opacity(u.line.color)&&(o.color=d.addOpacity(u.line.color,1)))}),l}}),Hq=ze((te,Y)=>{Y.exports={attributes:qL(),supplyDefaults:Uq(),crossTraceDefaults:WS(),calc:KL(),plot:YS().plot,layerName:"contourlayer",style:XS(),colorbar:JS(),hoverPoints:rP(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ff(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}),Vq=ze((te,Y)=>{Y.exports=Hq()}),iP=ze((te,Y)=>{var d=Sr(),y=GL(),z=Xi(),P=z.addOpacity,i=z.opacity,n=GS(),a=ji().isArrayOrTypedArray,l=n.CONSTRAINT_REDUCTION,o=n.COMPARISON_OPS2;Y.exports=function(s,h,m,b,x,_){var A=h.contours,f,k,w,D=m("contours.operation");if(A._operation=l[D],u(m,A),D==="="?f=A.showlines=!0:(f=m("contours.showlines"),w=m("fillcolor",P((s.line||{}).color||x,.5))),f){var E=w&&i(w)?P(h.fillcolor,1):x;k=m("line.color",E),m("line.width",2),m("line.dash")}m("line.smoothing"),y(m,b,k,_)};function u(s,h){var m;o.indexOf(h.operation)===-1?(s("contours.value",[0,1]),a(h.value)?h.value.length>2?h.value=h.value.slice(2):h.length===0?h.value=[0,1]:h.length<2?(m=parseFloat(h.value[0]),h.value=[m,m+1]):h.value=[parseFloat(h.value[0]),parseFloat(h.value[1])]:d(h.value)&&(m=parseFloat(h.value),h.value=[m,m+1])):(s("contours.value",0),d(h.value)||(a(h.value)?h.value=parseFloat(h.value[0]):h.value=0))}}),Wq=ze((te,Y)=>{var d=ji(),y=zS(),z=S0(),P=iP(),i=ZS(),n=KS(),a=K4(),l=Y4();Y.exports=function(o,u,s,h){function m(A,f){return d.coerce(o,u,l,A,f)}function b(A){return d.coerce2(o,u,l,A)}var x=y(o,u,m,h);if(!x){u.visible=!1;return}z(o,u,h,m),m("xhoverformat"),m("yhoverformat"),m("text"),m("hovertext"),m("hoverongaps"),m("hovertemplate"),m("hovertemplatefallback");var _=m("contours.type")==="constraint";m("connectgaps",d.isArray1D(u.z)),_?P(o,u,m,h,s):(i(o,u,m,b),n(o,u,m,h)),u.contours&&u.contours.coloring==="heatmap"&&a(m,h),m("zorder")}}),qq=ze((te,Y)=>{Y.exports={attributes:Y4(),supplyDefaults:Wq(),calc:KL(),plot:YS().plot,style:XS(),colorbar:JS(),hoverPoints:rP(),moduleType:"trace",name:"contour",basePlotModule:Ff(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}),Gq=ze((te,Y)=>{Y.exports=qq()}),nP=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=ff(),n=xa(),a=Oc(),l=qd().dash,o=nn().extendFlat,u=i.marker,s=i.line,h=u.line;Y.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},i.mode,{dflt:"markers"}),text:o({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},i.hovertext,{}),line:{color:s.color,width:s.width,dash:l,backoff:s.backoff,shape:o({},s.shape,{values:["linear","spline"]}),smoothing:s.smoothing,editType:"calc"},connectgaps:i.connectgaps,cliponaxis:i.cliponaxis,fill:o({},i.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:P(),marker:o({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:o({width:h.width,editType:"calc"},a("marker.line")),gradient:u.gradient,editType:"calc"},a("marker")),textfont:i.textfont,textposition:i.textposition,selected:i.selected,unselected:i.unselected,hoverinfo:o({},n.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:i.hoveron,hovertemplate:d(),hovertemplatefallback:z()}}),Zq=ze((te,Y)=>{var d=ji(),y=Mg(),z=Bc(),P=X0(),i=Pm(),n=ny(),a=mm(),l=Im(),o=nP();Y.exports=function(u,s,h,m){function b(D,E){return d.coerce(u,s,o,D,E)}var x=b("a"),_=b("b"),A=b("c"),f;if(x?(f=x.length,_?(f=Math.min(f,_.length),A&&(f=Math.min(f,A.length))):A?f=Math.min(f,A.length):f=0):_&&A&&(f=Math.min(_.length,A.length)),!f){s.visible=!1;return}s._length=f,b("sum"),b("text"),b("hovertext"),s.hoveron!=="fills"&&(b("hovertemplate"),b("hovertemplatefallback"));var k=f{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot;return i.aLabel=d.tickText(n.aaxis,y.a,!0).text,i.bLabel=d.tickText(n.baxis,y.b,!0).text,i.cLabel=d.tickText(n.caxis,y.c,!0).text,i}}),Yq=ze((te,Y)=>{var d=Sr(),y=zm(),z=de(),P=$e(),i=yt().calcMarkerSize,n=["a","b","c"],a={a:["b","c"],b:["a","c"],c:["a","b"]};Y.exports=function(l,o){var u=l._fullLayout[o.subplot],s=u.sum,h=o.sum||s,m={a:o.a,b:o.b,c:o.c},b=o.ids,x,_,A,f,k,w;for(x=0;x{var d=uo();Y.exports=function(y,z,P){var i=z.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var n=z.xaxis,a=z.yaxis,l={xaxis:n,yaxis:a,plot:i,layerClipId:z._hasClipOnAxisFalse?z.clipIdRelative:null},o=z.layers.frontplot.select("g.scatterlayer"),u=0;u{var d=Kd();Y.exports=function(y,z,P,i){var n=d(y,z,P,i);if(!n||n[0].index===!1)return;var a=n[0];if(a.index===void 0){var l=1-a.y0/y.ya._length,o=y.xa._length,u=o*l/2,s=o-u;return a.x0=Math.max(Math.min(a.x0,s),u),a.x1=Math.max(Math.min(a.x1,s),u),n}var h=a.cd[a.index],m=a.trace,b=a.subplot;a.a=h.a,a.b=h.b,a.c=h.c,a.xLabelVal=void 0,a.yLabelVal=void 0;var x={};x[m.subplot]={_subplot:b};var _=m._module.formatLabels(h,m,x);a.aLabel=_.aLabel,a.bLabel=_.bLabel,a.cLabel=_.cLabel;var A=h.hi||m.hoverinfo,f=[];function k(D,E){f.push(D._hovertitle+": "+E)}if(!m.hovertemplate){var w=A.split("+");w.indexOf("all")!==-1&&(w=["a","b","c"]),w.indexOf("a")!==-1&&k(b.aaxis,a.aLabel),w.indexOf("b")!==-1&&k(b.baxis,a.bLabel),w.indexOf("c")!==-1&&k(b.caxis,a.cLabel)}return a.extraText=f.join("
"),a.hovertemplate=m.hovertemplate,n}}),Qq=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){if(y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),P[i]){var n=P[i];d.a=n.a,d.b=n.b,d.c=n.c}else d.a=y.a,d.b=y.b,d.c=y.c;return d}}),eG=ze((te,Y)=>{var d=ri(),y=ln(),z=as(),P=ji(),i=P.strTranslate,n=P._,a=Xi(),l=Zs(),o=Z0(),u=nn().extendFlat,s=sh(),h=Os(),m=jp(),b=hf(),x=dm(),_=x.freeMode,A=x.rectMode,f=Np(),k=Ef().prepSelect,w=Ef().selectOnClick,D=Ef().clearOutline,E=Ef().clearSelectionsCache,I=dc();function M(H,q){this.id=H.id,this.graphDiv=H.graphDiv,this.init(q),this.makeFramework(q),this.updateFx(q),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}Y.exports=M;var p=M.prototype;p.init=function(H){this.container=H._ternarylayer,this.defs=H._defs,this.layoutId=H._uid,this.traceHash={},this.layers={}},p.plot=function(H,q){var G=this,ee=q[G.id],he=q._size;G._hasClipOnAxisFalse=!1;for(var be=0;beg*ge?(Ce=ge,fe=Ce*g):(fe=re,Ce=fe/g),Re=ve*fe/re,Be=ce*Ce/ge,J=q.l+q.w*he-fe/2,me=q.t+q.h*(1-be)-Ce/2,G.x0=J,G.y0=me,G.w=fe,G.h=Ce,G.sum=ne,G.xaxis={type:"linear",range:[se+2*oe-ne,ne-se-2*_e],domain:[he-Re/2,he+Re/2],_id:"x"},o(G.xaxis,G.graphDiv._fullLayout),G.xaxis.setScale(),G.xaxis.isPtWithinRange=function(nt){return nt.a>=G.aaxis.range[0]&&nt.a<=G.aaxis.range[1]&&nt.b>=G.baxis.range[1]&&nt.b<=G.baxis.range[0]&&nt.c>=G.caxis.range[1]&&nt.c<=G.caxis.range[0]},G.yaxis={type:"linear",range:[se,ne-_e-oe],domain:[be-Be/2,be+Be/2],_id:"y"},o(G.yaxis,G.graphDiv._fullLayout),G.yaxis.setScale(),G.yaxis.isPtWithinRange=function(){return!0};var Ze=G.yaxis.domain[0],Ge=G.aaxis=u({},H.aaxis,{range:[se,ne-_e-oe],side:"left",tickangle:(+H.aaxis.tickangle||0)-30,domain:[Ze,Ze+Be*g],anchor:"free",position:0,_id:"y",_length:fe});o(Ge,G.graphDiv._fullLayout),Ge.setScale();var tt=G.baxis=u({},H.baxis,{range:[ne-se-oe,_e],side:"bottom",domain:G.xaxis.domain,anchor:"free",position:0,_id:"x",_length:fe});o(tt,G.graphDiv._fullLayout),tt.setScale();var _t=G.caxis=u({},H.caxis,{range:[ne-se-_e,oe],side:"right",tickangle:(+H.caxis.tickangle||0)+30,domain:[Ze,Ze+Be*g],anchor:"free",position:0,_id:"y",_length:fe});o(_t,G.graphDiv._fullLayout),_t.setScale();var mt="M"+J+","+(me+Ce)+"h"+fe+"l-"+fe/2+",-"+Ce+"Z";G.clipDef.select("path").attr("d",mt),G.layers.plotbg.select("path").attr("d",mt);var vt="M0,"+Ce+"h"+fe+"l-"+fe/2+",-"+Ce+"Z";G.clipDefRelative.select("path").attr("d",vt);var ct=i(J,me);G.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ct),G.clipDefRelative.select("path").attr("transform",null);var Ae=i(J-tt._offset,me+Ce);G.layers.baxis.attr("transform",Ae),G.layers.bgrid.attr("transform",Ae);var Oe=i(J+fe/2,me)+"rotate(30)"+i(0,-Ge._offset);G.layers.aaxis.attr("transform",Oe),G.layers.agrid.attr("transform",Oe);var Le=i(J+fe/2,me)+"rotate(-30)"+i(0,-_t._offset);G.layers.caxis.attr("transform",Le),G.layers.cgrid.attr("transform",Le),G.drawAxes(!0),G.layers.aline.select("path").attr("d",Ge.showline?"M"+J+","+(me+Ce)+"l"+fe/2+",-"+Ce:"M0,0").call(a.stroke,Ge.linecolor||"#000").style("stroke-width",(Ge.linewidth||0)+"px"),G.layers.bline.select("path").attr("d",tt.showline?"M"+J+","+(me+Ce)+"h"+fe:"M0,0").call(a.stroke,tt.linecolor||"#000").style("stroke-width",(tt.linewidth||0)+"px"),G.layers.cline.select("path").attr("d",_t.showline?"M"+(J+fe/2)+","+me+"l"+fe/2+","+Ce:"M0,0").call(a.stroke,_t.linecolor||"#000").style("stroke-width",(_t.linewidth||0)+"px"),G.graphDiv._context.staticPlot||G.initInteractions(),l.setClipUrl(G.layers.frontplot,G._hasClipOnAxisFalse?null:G.clipId,G.graphDiv)},p.drawAxes=function(H){var q=this,G=q.graphDiv,ee=q.id.substr(7)+"title",he=q.layers,be=q.aaxis,ve=q.baxis,ce=q.caxis;if(q.drawAx(be),q.drawAx(ve),q.drawAx(ce),H){var re=Math.max(be.showticklabels?be.tickfont.size/2:0,(ce.showticklabels?ce.tickfont.size*.75:0)+(ce.ticks==="outside"?ce.ticklen*.87:0)),ge=(ve.showticklabels?ve.tickfont.size:0)+(ve.ticks==="outside"?ve.ticklen:0)+3;he["a-title"]=f.draw(G,"a"+ee,{propContainer:be,propName:q.id+".aaxis.title.text",placeholder:n(G,"Click to enter Component A title"),attributes:{x:q.x0+q.w/2,y:q.y0-be.title.font.size/3-re,"text-anchor":"middle"}}),he["b-title"]=f.draw(G,"b"+ee,{propContainer:ve,propName:q.id+".baxis.title.text",placeholder:n(G,"Click to enter Component B title"),attributes:{x:q.x0-ge,y:q.y0+q.h+ve.title.font.size*.83+ge,"text-anchor":"middle"}}),he["c-title"]=f.draw(G,"c"+ee,{propContainer:ce,propName:q.id+".caxis.title.text",placeholder:n(G,"Click to enter Component C title"),attributes:{x:q.x0+q.w+ge,y:q.y0+q.h+ce.title.font.size*.83+ge,"text-anchor":"middle"}})}},p.drawAx=function(H){var q=this,G=q.graphDiv,ee=H._name,he=ee.charAt(0),be=H._id,ve=q.layers[ee],ce=30,re=he+"tickLayout",ge=C(H);q[re]!==ge&&(ve.selectAll("."+be+"tick").remove(),q[re]=ge),H.setScale();var ne=h.calcTicks(H),se=h.clipEnds(H,ne),_e=h.makeTransTickFn(H),oe=h.getTickSigns(H)[2],J=P.deg2rad(ce),me=oe*(H.linewidth||1)/2,fe=oe*H.ticklen,Ce=q.w,Re=q.h,Be=he==="b"?"M0,"+me+"l"+Math.sin(J)*fe+","+Math.cos(J)*fe:"M"+me+",0l"+Math.cos(J)*fe+","+-Math.sin(J)*fe,Ze={a:"M0,0l"+Re+",-"+Ce/2,b:"M0,0l-"+Ce/2+",-"+Re,c:"M0,0l-"+Re+","+Ce/2}[he];h.drawTicks(G,H,{vals:H.ticks==="inside"?se:ne,layer:ve,path:Be,transFn:_e,crisp:!1}),h.drawGrid(G,H,{vals:se,layer:q.layers[he+"grid"],path:Ze,transFn:_e,crisp:!1}),h.drawLabels(G,H,{vals:ne,layer:ve,transFn:_e,labelFns:h.makeLabelFns(H,0,ce)})};function C(H){return H.ticks+String(H.ticklen)+String(H.showticklabels)}var T=I.MINZOOM/2+.87,N="m-0.87,.5h"+T+"v3h-"+(T+5.2)+"l"+(T/2+2.6)+",-"+(T*.87+4.5)+"l2.6,1.5l-"+T/2+","+T*.87+"Z",B="m0.87,.5h-"+T+"v3h"+(T+5.2)+"l-"+(T/2+2.6)+",-"+(T*.87+4.5)+"l-2.6,1.5l"+T/2+","+T*.87+"Z",U="m0,1l"+T/2+","+T*.87+"l2.6,-1.5l-"+(T/2+2.6)+",-"+(T*.87+4.5)+"l-"+(T/2+2.6)+","+(T*.87+4.5)+"l2.6,1.5l"+T/2+",-"+T*.87+"Z",V="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",W=!0;p.clearOutline=function(){E(this.dragOptions),D(this.dragOptions.gd)},p.initInteractions=function(){var H=this,q=H.layers.plotbg.select("path").node(),G=H.graphDiv,ee=G._fullLayout._zoomlayer,he,be;this.dragOptions={element:q,gd:G,plotinfo:{id:H.id,domain:G._fullLayout[H.id].domain,xaxis:H.xaxis,yaxis:H.yaxis},subplot:H.id,prepFn:function(Ae,Oe,Le){H.dragOptions.xaxes=[H.xaxis],H.dragOptions.yaxes=[H.yaxis],he=G._fullLayout._invScaleX,be=G._fullLayout._invScaleY;var nt=H.dragOptions.dragmode=G._fullLayout.dragmode;_(nt)?H.dragOptions.minDrag=1:H.dragOptions.minDrag=void 0,nt==="zoom"?(H.dragOptions.moveFn=tt,H.dragOptions.clickFn=Ce,H.dragOptions.doneFn=_t,Re(Ae,Oe,Le)):nt==="pan"?(H.dragOptions.moveFn=vt,H.dragOptions.clickFn=Ce,H.dragOptions.doneFn=ct,mt(),H.clearOutline(G)):(A(nt)||_(nt))&&k(Ae,Oe,Le,H.dragOptions,nt)}};var ve,ce,re,ge,ne,se,_e,oe,J,me;function fe(Ae){var Oe={};return Oe[H.id+".aaxis.min"]=Ae.a,Oe[H.id+".baxis.min"]=Ae.b,Oe[H.id+".caxis.min"]=Ae.c,Oe}function Ce(Ae,Oe){var Le=G._fullLayout.clickmode;F(G),Ae===2&&(G.emit("plotly_doubleclick",null),z.call("_guiRelayout",G,fe({a:0,b:0,c:0}))),Le.indexOf("select")>-1&&Ae===1&&w(Oe,G,[H.xaxis],[H.yaxis],H.id,H.dragOptions),Le.indexOf("event")>-1&&b.click(G,Oe,H.id)}function Re(Ae,Oe,Le){var nt=q.getBoundingClientRect();ve=Oe-nt.left,ce=Le-nt.top,G._fullLayout._calcInverseTransform(G);var xt=G._fullLayout._invTransform,ut=P.apply3DTransform(xt)(ve,ce);ve=ut[0],ce=ut[1],re={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},ne=re,ge=H.aaxis.range[1]-re.a,se=y(H.graphDiv._fullLayout[H.id].bgcolor).getLuminance(),_e="M0,"+H.h+"L"+H.w/2+", 0L"+H.w+","+H.h+"Z",oe=!1,J=ee.append("path").attr("class","zoombox").attr("transform",i(H.x0,H.y0)).style({fill:se>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",_e),me=ee.append("path").attr("class","zoombox-corners").attr("transform",i(H.x0,H.y0)).style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),H.clearOutline(G)}function Be(Ae,Oe){return 1-Oe/H.h}function Ze(Ae,Oe){return 1-(Ae+(H.h-Oe)/Math.sqrt(3))/H.w}function Ge(Ae,Oe){return(Ae-(H.h-Oe)/Math.sqrt(3))/H.w}function tt(Ae,Oe){var Le=ve+Ae*he,nt=ce+Oe*be,xt=Math.max(0,Math.min(1,Be(ve,ce),Be(Le,nt))),ut=Math.max(0,Math.min(1,Ze(ve,ce),Ze(Le,nt))),Et=Math.max(0,Math.min(1,Ge(ve,ce),Ge(Le,nt))),Gt=(xt/2+Et)*H.w,Qt=(1-xt/2-ut)*H.w,vr=(Gt+Qt)/2,mr=Qt-Gt,Yr=(1-xt)*H.h,ii=Yr-mr/g;mr.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),me.transition().style("opacity",1).duration(200),oe=!0),G.emit("plotly_relayouting",fe(ne))}function _t(){F(G),ne!==re&&(z.call("_guiRelayout",G,fe(ne)),W&&G.data&&G._context.showTips&&(P.notifier(n(G,"Double-click to zoom back out"),"long"),W=!1))}function mt(){re={a:H.aaxis.range[0],b:H.baxis.range[1],c:H.caxis.range[1]},ne=re}function vt(Ae,Oe){var Le=Ae/H.xaxis._m,nt=Oe/H.yaxis._m;ne={a:re.a-nt,b:re.b+(Le+nt)/2,c:re.c-(Le-nt)/2};var xt=[ne.a,ne.b,ne.c].sort(P.sorterAsc),ut={a:xt.indexOf(ne.a),b:xt.indexOf(ne.b),c:xt.indexOf(ne.c)};xt[0]<0&&(xt[1]+xt[0]/2<0?(xt[2]+=xt[0]+xt[1],xt[0]=xt[1]=0):(xt[2]+=xt[0]/2,xt[1]+=xt[0]/2,xt[0]=0),ne={a:xt[ut.a],b:xt[ut.b],c:xt[ut.c]},Oe=(re.a-ne.a)*H.yaxis._m,Ae=(re.c-ne.c-re.b+ne.b)*H.xaxis._m);var Et=i(H.x0+Ae,H.y0+Oe);H.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Et);var Gt=i(-Ae,-Oe);H.clipDefRelative.select("path").attr("transform",Gt),H.aaxis.range=[ne.a,H.sum-ne.b-ne.c],H.baxis.range=[H.sum-ne.a-ne.c,ne.b],H.caxis.range=[H.sum-ne.a-ne.b,ne.c],H.drawAxes(!1),H._hasClipOnAxisFalse&&H.plotContainer.select(".scatterlayer").selectAll(".trace").call(l.hideOutsideRangePoints,H),G.emit("plotly_relayouting",fe(ne))}function ct(){z.call("_guiRelayout",G,fe(ne))}q.onmousemove=function(Ae){b.hover(G,Ae,H.id),G._fullLayout._lasthover=q,G._fullLayout._hoversubplot=H.id},q.onmouseout=function(Ae){G._dragging||m.unhover(G,Ae)},m.init(this.dragOptions)};function F(H){d.select(H).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}),aP=ze((te,Y)=>{var d=Mi(),y=Xh().attributes,z=Gd(),P=oh().overrideAll,i=nn().extendFlat,n={title:{text:z.title.text,font:z.title.font},color:z.color,tickmode:z.minor.tickmode,nticks:i({},z.nticks,{dflt:6,min:1}),tick0:z.tick0,dtick:z.dtick,tickvals:z.tickvals,ticktext:z.ticktext,ticks:z.ticks,ticklen:z.ticklen,tickwidth:z.tickwidth,tickcolor:z.tickcolor,ticklabelstep:z.ticklabelstep,showticklabels:z.showticklabels,labelalias:z.labelalias,showtickprefix:z.showtickprefix,tickprefix:z.tickprefix,showticksuffix:z.showticksuffix,ticksuffix:z.ticksuffix,showexponent:z.showexponent,exponentformat:z.exponentformat,minexponent:z.minexponent,separatethousands:z.separatethousands,tickfont:z.tickfont,tickangle:z.tickangle,tickformat:z.tickformat,tickformatstops:z.tickformatstops,hoverformat:z.hoverformat,showline:i({},z.showline,{dflt:!0}),linecolor:z.linecolor,linewidth:z.linewidth,showgrid:i({},z.showgrid,{dflt:!0}),gridcolor:z.gridcolor,gridwidth:z.gridwidth,griddash:z.griddash,layer:z.layer,min:{valType:"number",dflt:0,min:0}},a=Y.exports=P({domain:y({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:n,baxis:n,caxis:n},"plot","from-root");a.uirevision={valType:"any",editType:"none"},a.aaxis.uirevision=a.baxis.uirevision=a.caxis.uirevision={valType:"any",editType:"none"}}),z_=ze((te,Y)=>{var d=ji(),y=ku(),z=Xh().defaults;Y.exports=function(P,i,n,a){var l=a.type,o=a.attributes,u=a.handleDefaults,s=a.partition||"x",h=i._subplots[l],m=h.length,b=m&&h[0].replace(/\d+$/,""),x,_;function A(D,E){return d.coerce(x,_,o,D,E)}for(var f=0;f{var d=Xi(),y=ku(),z=ji(),P=z_(),i=G0(),n=Tg(),a=jv(),l=Nv(),o=fb(),u=aP(),s=["aaxis","baxis","caxis"];Y.exports=function(b,x,_){P(b,x,_,{type:"ternary",attributes:u,handleDefaults:h,font:x.font,paper_bgcolor:x.paper_bgcolor})};function h(b,x,_,A){var f=_("bgcolor"),k=_("sum");A.bgColor=d.combine(f,A.paper_bgcolor);for(var w,D,E,I=0;I=k&&(M.min=0,p.min=0,g.min=0,b.aaxis&&delete b.aaxis.min,b.baxis&&delete b.baxis.min,b.caxis&&delete b.caxis.min)}function m(b,x,_,A){var f=u[x._name];function k(C,T){return z.coerce(b,x,f,C,T)}k("uirevision",A.uirevision),x.type="linear";var w=k("color"),D=w!==f.color.dflt?w:_.font.color,E=x._name,I=E.charAt(0).toUpperCase(),M="Component "+I,p=k("title.text",M);x._hovertitle=p===M?p:I,z.coerceFont(k,"title.font",_.font,{overrideDflt:{size:z.bigFont(_.font.size),color:D}}),k("min"),l(b,x,k,"linear"),n(b,x,k,"linear"),i(b,x,k,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),a(b,x,k,{outerTicks:!0});var g=k("showticklabels");g&&(z.coerceFont(k,"tickfont",_.font,{overrideDflt:{color:D}}),k("tickangle"),k("tickformat")),o(b,x,k,{dfltColor:w,bgColor:_.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:f}),k("hoverformat"),k("layer")}}),rG=ze(te=>{var Y=eG(),d=Ed().getSubplotCalcData,y=ji().counterRegex,z="ternary";te.name=z;var P=te.attr="subplot";te.idRoot=z,te.idRegex=te.attrRegex=y(z);var i=te.attributes={};i[P]={valType:"subplotid",dflt:"ternary",editType:"calc"},te.layoutAttributes=aP(),te.supplyLayoutDefaults=tG(),te.plot=function(n){for(var a=n._fullLayout,l=n.calcdata,o=a._subplots[z],u=0;u{Y.exports={attributes:nP(),supplyDefaults:Zq(),colorbar:Mo(),formatLabels:Kq(),calc:Yq(),plot:Xq(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Jq(),selectPoints:ed(),eventData:Qq(),moduleType:"trace",name:"scatterternary",basePlotModule:rG(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}),nG=ze((te,Y)=>{Y.exports=iG()}),oP=ze((te,Y)=>{var d=q4(),y=nn().extendFlat,z=Sh().axisHoverFormat;Y.exports={y:d.y,x:d.x,x0:d.x0,y0:d.y0,xhoverformat:z("x"),yhoverformat:z("y"),name:y({},d.name,{}),orientation:y({},d.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:d.fillcolor,points:y({},d.boxpoints,{}),jitter:y({},d.jitter,{}),pointpos:y({},d.pointpos,{}),width:y({},d.width,{}),marker:d.marker,text:d.text,hovertext:d.hovertext,hovertemplate:d.hovertemplate,hovertemplatefallback:d.hovertemplatefallback,quartilemethod:d.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,selected:d.selected,unselected:d.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:d.zorder}}),sP=ze((te,Y)=>{var d=G4(),y=ji().extendFlat;Y.exports={violinmode:y({},d.boxmode,{}),violingap:y({},d.boxgap,{}),violingroupgap:y({},d.boxgroupgap,{})}}),aG=ze((te,Y)=>{var d=ji(),y=Xi(),z=Z4(),P=oP();Y.exports=function(i,n,a,l){function o(p,g){return d.coerce(i,n,P,p,g)}function u(p,g){return d.coerce2(i,n,P,p,g)}if(z.handleSampleDefaults(i,n,o,l),n.visible!==!1){o("bandwidth"),o("side");var s=o("width");s||(o("scalegroup",n.name),o("scalemode"));var h=o("span"),m;Array.isArray(h)&&(m="manual"),o("spanmode",m);var b=o("line.color",(i.marker||{}).color||a),x=o("line.width"),_=o("fillcolor",y.addOpacity(n.line.color,.5));z.handlePointsDefaults(i,n,o,{prefix:""});var A=u("box.width"),f=u("box.fillcolor",_),k=u("box.line.color",b),w=u("box.line.width",x),D=o("box.visible",!!(A||f||k||w));D||(n.box={visible:!1});var E=u("meanline.color",b),I=u("meanline.width",x),M=o("meanline.visible",!!(E||I));M||(n.meanline={visible:!1}),o("quartilemethod"),o("zorder")}}}),oG=ze((te,Y)=>{var d=ji(),y=sP(),z=LS();Y.exports=function(P,i,n){function a(l,o){return d.coerce(P,i,y,l,o)}z._supply(P,i,n,a,"violin")}}),QS=ze(te=>{var Y=ji(),d={gaussian:function(y){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*y*y)}};te.makeKDE=function(y,z,P){var i=P.length,n=d.gaussian,a=y.bandwidth,l=1/(i*a);return function(o){for(var u=0,s=0;s{var d=ji(),y=Os(),z=IL(),P=QS(),i=ei().BADNUM;Y.exports=function(o,u){var s=z(o,u);if(s[0].t.empty)return s;for(var h=o._fullLayout,m=y.getFromId(o,u[u.orientation==="h"?"xaxis":"yaxis"]),b=1/0,x=-1/0,_=0,A=0,f=0;f{var d=PS().setPositionOffset,y=["v","h"];Y.exports=function(z,P){for(var i=z.calcdata,n=P.xaxis,a=P.yaxis,l=0;l{var d=ri(),y=ji(),z=Zs(),P=IS(),i=ra(),n=QS();Y.exports=function(a,l,o,u){var s=a._context.staticPlot,h=a._fullLayout,m=l.xaxis,b=l.yaxis;function x(_,A){var f=i(_,{xaxis:m,yaxis:b,trace:A,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return z.smoothopen(f[0],1)}y.makeTraceGroups(u,o,"trace violins").each(function(_){var A=d.select(this),f=_[0],k=f.t,w=f.trace;if(w.visible!==!0||k.empty){A.remove();return}var D=k.bPos,E=k.bdPos,I=l[k.valLetter+"axis"],M=l[k.posLetter+"axis"],p=w.side==="both",g=p||w.side==="positive",C=p||w.side==="negative",T=A.selectAll("path.violin").data(y.identity);T.enter().append("path").style("vector-effect",s?"none":"non-scaling-stroke").attr("class","violin"),T.exit().remove(),T.each(function(q){var G=d.select(this),ee=q.density,he=ee.length,be=M.c2l(q.pos+D,!0),ve=M.l2p(be),ce;if(w.width)ce=k.maxKDE/E;else{var re=h._violinScaleGroupStats[w.scalegroup];ce=w.scalemode==="count"?re.maxKDE/E*(re.maxCount/q.pts.length):re.maxKDE/E}var ge,ne,se,_e,oe,J,me;if(g){for(J=new Array(he),_e=0;_e{var d=ri(),y=Xi(),z=El().stylePoints;Y.exports=function(P){var i=d.select(P).selectAll("g.trace.violins");i.style("opacity",function(n){return n[0].trace.opacity}),i.each(function(n){var a=n[0].trace,l=d.select(this),o=a.box||{},u=o.line||{},s=a.meanline||{},h=s.width;l.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(y.stroke,a.line.color).call(y.fill,a.fillcolor),l.selectAll("path.box").style("stroke-width",u.width+"px").call(y.stroke,u.color).call(y.fill,o.fillcolor);var m={"stroke-width":h+"px","stroke-dasharray":2*h+"px,"+h+"px"};l.selectAll("path.mean").style(m).call(y.stroke,s.color),l.selectAll("path.meanline").style(m).call(y.stroke,s.color),z(l,a,P)})}}),hG=ze((te,Y)=>{var d=Xi(),y=ji(),z=Os(),P=DL(),i=QS();Y.exports=function(n,a,l,o,u){u||(u={});var s=u.hoverLayer,h=n.cd,m=h[0].trace,b=m.hoveron,x=b.indexOf("violins")!==-1,_=b.indexOf("kde")!==-1,A=[],f,k;if(x||_){var w=P.hoverOnBoxes(n,a,l,o);if(_&&w.length>0){var D=n.xa,E=n.ya,I,M,p,g,C;m.orientation==="h"?(C=a,I="y",p=E,M="x",g=D):(C=l,I="x",p=D,M="y",g=E);var T=h[n.index];if(C>=T.span[0]&&C<=T.span[1]){var N=y.extendFlat({},n),B=g.c2p(C,!0),U=i.getKdeValue(T,m,C),V=i.getPositionOnKdePath(T,m,B),W=p._offset,F=p._length;N[I+"0"]=V[0],N[I+"1"]=V[1],N[M+"0"]=N[M+"1"]=B,N[M+"Label"]=M+": "+z.hoverLabelText(g,C,m[M+"hoverformat"])+", "+h[0].t.labels.kde+" "+U.toFixed(3);for(var H=0,q=0;q{Y.exports={attributes:oP(),layoutAttributes:sP(),supplyDefaults:aG(),crossTraceDefaults:Z4().crossTraceDefaults,supplyLayoutDefaults:oG(),calc:sG(),crossTraceCalc:lG(),plot:uG(),style:cG(),styleOnSelect:El().styleOnSelect,hoverPoints:hG(),selectPoints:zL(),moduleType:"trace",name:"violin",basePlotModule:Ff(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}),dG=ze((te,Y)=>{Y.exports=fG()}),pG=ze((te,Y)=>{Y.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}),lP=ze((te,Y)=>{var d=Xv(),y=ff().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=pG(),o=nn().extendFlat,u=Xi();Y.exports={x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:d.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:a({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:o({},d.insidetextanchor,{dflt:"middle"}),textangle:o({},d.textangle,{dflt:0}),textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:o({},d.orientation,{}),offset:o({},d.offset,{arrayOk:!1}),width:o({},d.width,{arrayOk:!1}),marker:s(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:o({},y.color,{dflt:u.defaultLine}),width:o({},y.width,{dflt:0,editType:"plot"}),dash:y.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder};function s(){var h=o({},d.marker);return delete h.pattern,delete h.cornerradius,h}}),uP=ze((te,Y)=>{Y.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),cP=ze((te,Y)=>{var d=ji(),y=Yv(),z=tg().handleText,P=Jg(),i=S0(),n=lP(),a=Xi();function l(s,h,m,b){function x(E,I){return d.coerce(s,h,n,E,I)}var _=P(s,h,b,x);if(!_){h.visible=!1;return}i(s,h,b,x),x("xhoverformat"),x("yhoverformat"),x("orientation",h.y&&!h.x?"v":"h"),x("offset"),x("width");var A=x("text");x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var f=x("textposition");z(s,h,b,x,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&!h.texttemplate&&x("textinfo",d.isArrayOrTypedArray(A)?"text+value":"value");var k=x("marker.color",m);x("marker.line.color",a.defaultLine),x("marker.line.width");var w=x("connector.visible");if(w){x("connector.fillcolor",o(k));var D=x("connector.line.width");D&&(x("connector.line.color"),x("connector.line.dash"))}x("zorder")}function o(s){var h=d.isArrayOrTypedArray(s)?"#000":s;return a.addOpacity(h,.5*a.opacity(h))}function u(s,h){var m,b;function x(A){return d.coerce(b._input,b,n,A)}for(var _=0;_{var d=ji(),y=uP();Y.exports=function(z,P,i){var n=!1;function a(u,s){return d.coerce(z,P,y,u,s)}for(var l=0;l{var d=ji();Y.exports=function(y,z){for(var P=0;P{var d=Os(),y=Dm(),z=gG(),P=$e(),i=ei().BADNUM;Y.exports=function(a,l){var o=d.getFromId(a,l.xaxis||"x"),u=d.getFromId(a,l.yaxis||"y"),s,h,m,b,x,_,A,f;l.orientation==="h"?(s=o.makeCalcdata(l,"x"),m=u.makeCalcdata(l,"y"),b=y(l,u,"y",m),x=!!l.yperiodalignment,_="y"):(s=u.makeCalcdata(l,"y"),m=o.makeCalcdata(l,"x"),b=y(l,o,"x",m),x=!!l.xperiodalignment,_="x"),h=b.vals;var k=Math.min(h.length,s.length),w=new Array(k);for(l._base=[],A=0;A{var d=Ur().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,i=y._fullData,n=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],u=[],s=[],h,m;for(m=0;m{var d=ri(),y=ji(),z=Zs(),P=ei().BADNUM,i=gb(),n=C0().clearMinTextSize;Y.exports=function(u,s,h,m){var b=u._fullLayout;n("funnel",b),a(u,s,h,m),l(u,s,h,m),i.plot(u,s,h,m,{mode:b.funnelmode,norm:b.funnelmode,gap:b.funnelgap,groupgap:b.funnelgroupgap})};function a(u,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=d.select(this),f=_[0].trace,k=y.ensureSingle(A,"g","regions");if(!f.connector||!f.connector.visible){k.remove();return}var w=f.orientation==="h",D=k.selectAll("g.region").data(y.identity);D.enter().append("g").classed("region",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],T="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&g[2]!==P&&C[2]!==P&&g[3]!==P&&C[3]!==P&&(w?T+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2]+"H"+g[3]+"L"+g[1]+","+C[1]+"Z":T+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3]+"V"+C[2]+"L"+g[1]+","+C[0]+"Z"),T===""&&(T="M0,0Z"),y.ensureSingle(d.select(this),"path").attr("d",T).call(z.setClipUrl,s.layerClipId,u)}})})}function l(u,s,h,m){var b=s.xaxis,x=s.yaxis;y.makeTraceGroups(m,h,"trace bars").each(function(_){var A=d.select(this),f=_[0].trace,k=y.ensureSingle(A,"g","lines");if(!f.connector||!f.connector.visible||!f.connector.line.width){k.remove();return}var w=f.orientation==="h",D=k.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=o(I,b,x,w),g=p[0],C=p[1],T="";g[3]!==void 0&&C[3]!==void 0&&(w?(T+="M"+g[0]+","+C[1]+"L"+g[2]+","+C[2],T+="M"+g[1]+","+C[1]+"L"+g[3]+","+C[2]):(T+="M"+g[1]+","+C[1]+"L"+g[2]+","+C[3],T+="M"+g[1]+","+C[0]+"L"+g[2]+","+C[2])),T===""&&(T="M0,0Z"),y.ensureSingle(d.select(this),"path").attr("d",T).call(z.setClipUrl,s.layerClipId,u)}})})}function o(u,s,h,m){var b=[],x=[],_=m?s:h,A=m?h:s;return b[0]=_.c2p(u.s0,!0),x[0]=A.c2p(u.p0,!0),b[1]=_.c2p(u.s1,!0),x[1]=A.c2p(u.p1,!0),b[2]=_.c2p(u.nextS0,!0),x[2]=A.c2p(u.nextP0,!0),b[3]=_.c2p(u.nextS1,!0),x[3]=A.c2p(u.nextP1,!0),m?[b,x]:[x,b]}}),xG=ze((te,Y)=>{var d=ri(),y=Zs(),z=Xi(),P=so().DESELECTDIM,i=Lg(),n=C0().resizeText,a=i.styleTextPoints;function l(o,u,s){var h=s||d.select(o).selectAll('g[class^="funnellayer"]').selectAll("g.trace");n(o,h,"funnel"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=d.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x.marker;d.select(this).call(z.fill,_.mc||A.color).call(z.stroke,_.mlc||A.line.color).call(y.dashLine,A.line.dash,_.mlw||A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(z.fill,x.connector.fillcolor)}),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(d.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),bG=ze((te,Y)=>{var d=Xi().opacity,y=Ew().hoverOnBars,z=ji().formatPercent;Y.exports=function(i,n,a,l,o){var u=y(i,n,a,l,o);if(u){var s=u.cd,h=s[0].trace,m=h.orientation==="h",b=u.index,x=s[b],_=m?"x":"y";u[_+"LabelVal"]=x.s,u.percentInitial=x.begR,u.percentInitialLabel=z(x.begR,1),u.percentPrevious=x.difR,u.percentPreviousLabel=z(x.difR,1),u.percentTotal=x.sumR,u.percentTotalLabel=z(x.sumR,1);var A=x.hi||h.hoverinfo,f=[];if(A&&A!=="none"&&A!=="skip"){var k=A==="all",w=A.split("+"),D=function(E){return k||w.indexOf(E)!==-1};D("percent initial")&&f.push(u.percentInitialLabel+" of initial"),D("percent previous")&&f.push(u.percentPreviousLabel+" of previous"),D("percent total")&&f.push(u.percentTotalLabel+" of total")}return u.extraText=f.join("
"),u.color=P(h,x),[u]}};function P(i,n){var a=i.marker,l=n.mc||a.color,o=n.mlc||a.line.color,u=n.mlw||a.line.width;if(d(l))return l;if(d(o)&&u)return o}}),wG=ze((te,Y)=>{Y.exports=function(d,y){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"percentInitial"in y&&(d.percentInitial=y.percentInitial),"percentPrevious"in y&&(d.percentPrevious=y.percentPrevious),"percentTotal"in y&&(d.percentTotal=y.percentTotal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),kG=ze((te,Y)=>{Y.exports={attributes:lP(),layoutAttributes:uP(),supplyDefaults:cP().supplyDefaults,crossTraceDefaults:cP().crossTraceDefaults,supplyLayoutDefaults:mG(),calc:vG(),crossTraceCalc:yG(),plot:_G(),style:xG().style,hoverPoints:bG(),eventData:wG(),selectPoints:Lw(),moduleType:"trace",name:"funnel",basePlotModule:Ff(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),TG=ze((te,Y)=>{Y.exports=kG()}),SG=ze((te,Y)=>{Y.exports={eventDataKeys:["initial","delta","final"]}}),hP=ze((te,Y)=>{var d=Xv(),y=ff().line,z=xa(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=SG(),o=nn().extendFlat,u=Xi();function s(h){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}Y.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:P("x"),yhoverformat:P("y"),hovertext:d.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),hovertemplatefallback:a(),hoverinfo:o({},z.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),texttemplatefallback:a({editType:"plot"}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:s(),decreasing:s(),totals:s(),connector:{line:{color:o({},y.color,{dflt:u.defaultLine}),width:o({},y.width,{editType:"plot"}),dash:y.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}),fP=ze((te,Y)=>{Y.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}),Iw=ze((te,Y)=>{Y.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}),dP=ze((te,Y)=>{var d=ji(),y=Yv(),z=tg().handleText,P=Jg(),i=S0(),n=hP(),a=Xi(),l=Iw(),o=l.INCREASING.COLOR,u=l.DECREASING.COLOR,s="#4499FF";function h(x,_,A){x(_+".marker.color",A),x(_+".marker.line.color",a.defaultLine),x(_+".marker.line.width")}function m(x,_,A,f){function k(M,p){return d.coerce(x,_,n,M,p)}var w=P(x,_,f,k);if(!w){_.visible=!1;return}i(x,_,f,k),k("xhoverformat"),k("yhoverformat"),k("measure"),k("orientation",_.x&&!_.y?"h":"v"),k("base"),k("offset"),k("width"),k("text"),k("hovertext"),k("hovertemplate"),k("hovertemplatefallback");var D=k("textposition");z(x,_,f,k,D,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),_.textposition!=="none"&&(k("texttemplate"),k("texttemplatefallback"),_.texttemplate||k("textinfo")),h(k,"increasing",o),h(k,"decreasing",u),h(k,"totals",s);var E=k("connector.visible");if(E){k("connector.mode");var I=k("connector.line.width");I&&(k("connector.line.color"),k("connector.line.dash"))}k("zorder")}function b(x,_){var A,f;function k(D){return d.coerce(f._input,f,n,D)}if(_.waterfallmode==="group")for(var w=0;w{var d=ji(),y=fP();Y.exports=function(z,P,i){var n=!1;function a(u,s){return d.coerce(z,P,y,u,s)}for(var l=0;l{var d=Os(),y=Dm(),z=ji().mergeArray,P=$e(),i=ei().BADNUM;function n(l){return l==="a"||l==="absolute"}function a(l){return l==="t"||l==="total"}Y.exports=function(l,o){var u=d.getFromId(l,o.xaxis||"x"),s=d.getFromId(l,o.yaxis||"y"),h,m,b,x,_,A;o.orientation==="h"?(h=u.makeCalcdata(o,"x"),b=s.makeCalcdata(o,"y"),x=y(o,s,"y",b),_=!!o.yperiodalignment,A="y"):(h=s.makeCalcdata(o,"y"),b=u.makeCalcdata(o,"x"),x=y(o,u,"x",b),_=!!o.xperiodalignment,A="x"),m=x.vals;for(var f=Math.min(m.length,h.length),k=new Array(f),w=0,D,E=!1,I=0;I{var d=Ur().setGroupPositions;Y.exports=function(y,z){var P=y._fullLayout,i=y._fullData,n=y.calcdata,a=z.xaxis,l=z.yaxis,o=[],u=[],s=[],h,m;for(m=0;m{var d=ri(),y=ji(),z=Zs(),P=ei().BADNUM,i=gb(),n=C0().clearMinTextSize;Y.exports=function(o,u,s,h){var m=o._fullLayout;n("waterfall",m),i.plot(o,u,s,h,{mode:m.waterfallmode,norm:m.waterfallmode,gap:m.waterfallgap,groupgap:m.waterfallgroupgap}),a(o,u,s,h)};function a(o,u,s,h){var m=u.xaxis,b=u.yaxis;y.makeTraceGroups(h,s,"trace bars").each(function(x){var _=d.select(this),A=x[0].trace,f=y.ensureSingle(_,"g","lines");if(!A.connector||!A.connector.visible){f.remove();return}var k=A.orientation==="h",w=A.connector.mode,D=f.selectAll("g.line").data(y.identity);D.enter().append("g").classed("line",!0),D.exit().remove();var E=D.size();D.each(function(I,M){if(!(M!==E-1&&!I.cNext)){var p=l(I,m,b,k),g=p[0],C=p[1],T="";g[0]!==P&&C[0]!==P&&g[1]!==P&&C[1]!==P&&(w==="spanning"&&!I.isSum&&M>0&&(k?T+="M"+g[0]+","+C[1]+"V"+C[0]:T+="M"+g[1]+","+C[0]+"H"+g[0]),w!=="between"&&(I.isSum||M{var d=ri(),y=Zs(),z=Xi(),P=so().DESELECTDIM,i=Lg(),n=C0().resizeText,a=i.styleTextPoints;function l(o,u,s){var h=s||d.select(o).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");n(o,h,"waterfall"),h.style("opacity",function(m){return m[0].trace.opacity}),h.each(function(m){var b=d.select(this),x=m[0].trace;b.selectAll(".point > path").each(function(_){if(!_.isBlank){var A=x[_.dir].marker;d.select(this).call(z.fill,A.color).call(z.stroke,A.line.color).call(y.dashLine,A.line.dash,A.line.width).style("opacity",x.selectedpoints&&!_.selected?P:1)}}),a(b,x,o),b.selectAll(".lines").each(function(){var _=x.connector.line;y.lineGroupStyle(d.select(this).selectAll("path"),_.width,_.color,_.dash)})})}Y.exports={style:l}}),PG=ze((te,Y)=>{var d=Os().hoverLabelText,y=Xi().opacity,z=Ew().hoverOnBars,P=Iw(),i={increasing:P.INCREASING.SYMBOL,decreasing:P.DECREASING.SYMBOL};Y.exports=function(a,l,o,u,s){var h=z(a,l,o,u,s);if(!h)return;var m=h.cd,b=m[0].trace,x=b.orientation==="h",_=x?"x":"y",A=x?a.xa:a.ya;function f(T){return d(A,T,b[_+"hoverformat"])}var k=h.index,w=m[k],D=w.isSum?w.b+w.s:w.rawS;h.initial=w.b+w.s-D,h.delta=D,h.final=h.initial+h.delta;var E=f(Math.abs(h.delta));h.deltaLabel=D<0?"("+E+")":E,h.finalLabel=f(h.final),h.initialLabel=f(h.initial);var I=w.hi||b.hoverinfo,M=[];if(I&&I!=="none"&&I!=="skip"){var p=I==="all",g=I.split("+"),C=function(T){return p||g.indexOf(T)!==-1};w.isSum||(C("final")&&(x?!C("x"):!C("y"))&&M.push(h.finalLabel),C("delta")&&(D<0?M.push(h.deltaLabel+" "+i.decreasing):M.push(h.deltaLabel+" "+i.increasing)),C("initial")&&M.push("Initial: "+h.initialLabel))}return M.length&&(h.extraText=M.join("
")),h.color=n(b,w),[h]};function n(a,l){var o=a[l.dir].marker,u=o.color,s=o.line.color,h=o.line.width;if(y(u))return u;if(y(s)&&h)return s}}),IG=ze((te,Y)=>{Y.exports=function(d,y){return d.x="xVal"in y?y.xVal:y.x,d.y="yVal"in y?y.yVal:y.y,"initial"in y&&(d.initial=y.initial),"delta"in y&&(d.delta=y.delta),"final"in y&&(d.final=y.final),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d}}),DG=ze((te,Y)=>{Y.exports={attributes:hP(),layoutAttributes:fP(),supplyDefaults:dP().supplyDefaults,crossTraceDefaults:dP().crossTraceDefaults,supplyLayoutDefaults:CG(),calc:AG(),crossTraceCalc:MG(),plot:EG(),style:LG().style,hoverPoints:PG(),eventData:IG(),selectPoints:Lw(),moduleType:"trace",name:"waterfall",basePlotModule:Ff(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}),zG=ze((te,Y)=>{Y.exports=DG()}),Dw=ze((te,Y)=>{Y.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var y=d.slice(0,3);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var y=d.slice(0,4);return y[1]=y[1]+"%",y[2]=y[2]+"%",y},suffix:["°","%","%",""]}}}}),pP=ze((te,Y)=>{var d=xa(),y=ff().zorder,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=nn().extendFlat,n=Dw().colormodel,a=["rgb","rgba","rgba256","hsl","hsla"],l=[],o=[];for(s=0;s{var d=ji(),y=pP(),z=Dw(),P=Y0().IMAGE_URL_PREFIX;Y.exports=function(i,n){function a(u,s){return d.coerce(i,n,y,u,s)}a("source"),n.source&&!n.source.match(P)&&delete n.source,n._hasSource=!!n.source;var l=a("z");if(n._hasZ=!(l===void 0||!l.length||!l[0]||!l[0].length),!n._hasZ&&!n._hasSource){n.visible=!1;return}a("x0"),a("y0"),a("dx"),a("dy");var o;n._hasZ?(a("colormodel","rgb"),o=z.colormodel[n.colormodel],a("zmin",o.zminDflt||o.min),a("zmax",o.zmaxDflt||o.max)):n._hasSource&&(n.colormodel="rgba256",o=z.colormodel[n.colormodel],n.zmin=o.zminDflt,n.zmax=o.zmaxDflt),a("zsmooth"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),n._length=null,a("zorder")}}),ay=ze((te,Y)=>{typeof Object.create=="function"?Y.exports=function(d,y){y&&(d.super_=y,d.prototype=Object.create(y.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}))}:Y.exports=function(d,y){if(y){d.super_=y;var z=function(){};z.prototype=y.prototype,d.prototype=new z,d.prototype.constructor=d}}}),mP=ze((te,Y)=>{Y.exports=qg().EventEmitter}),BG=ze(te=>{te.byteLength=a,te.toByteArray=o,te.fromByteArray=h;var Y=[],d=[],y=typeof Uint8Array<"u"?Uint8Array:Array,z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(P=0,i=z.length;P0)throw new Error("Invalid string. Length must be a multiple of 4");var x=m.indexOf("=");x===-1&&(x=b);var _=x===b?0:4-x%4;return[x,_]}function a(m){var b=n(m),x=b[0],_=b[1];return(x+_)*3/4-_}function l(m,b,x){return(b+x)*3/4-x}function o(m){var b,x=n(m),_=x[0],A=x[1],f=new y(l(m,_,A)),k=0,w=A>0?_-4:_,D;for(D=0;D>16&255,f[k++]=b>>8&255,f[k++]=b&255;return A===2&&(b=d[m.charCodeAt(D)]<<2|d[m.charCodeAt(D+1)]>>4,f[k++]=b&255),A===1&&(b=d[m.charCodeAt(D)]<<10|d[m.charCodeAt(D+1)]<<4|d[m.charCodeAt(D+2)]>>2,f[k++]=b>>8&255,f[k++]=b&255),f}function u(m){return Y[m>>18&63]+Y[m>>12&63]+Y[m>>6&63]+Y[m&63]}function s(m,b,x){for(var _,A=[],f=b;fw?w:k+f));return _===1?(b=m[x-1],A.push(Y[b>>2]+Y[b<<4&63]+"==")):_===2&&(b=(m[x-2]<<8)+m[x-1],A.push(Y[b>>10]+Y[b>>4&63]+Y[b<<2&63]+"=")),A.join("")}}),RG=ze(te=>{te.read=function(Y,d,y,z,P){var i,n,a=P*8-z-1,l=(1<>1,u=-7,s=y?P-1:0,h=y?-1:1,m=Y[d+s];for(s+=h,i=m&(1<<-u)-1,m>>=-u,u+=a;u>0;i=i*256+Y[d+s],s+=h,u-=8);for(n=i&(1<<-u)-1,i>>=-u,u+=z;u>0;n=n*256+Y[d+s],s+=h,u-=8);if(i===0)i=1-o;else{if(i===l)return n?NaN:(m?-1:1)*(1/0);n=n+Math.pow(2,z),i=i-o}return(m?-1:1)*n*Math.pow(2,i-z)},te.write=function(Y,d,y,z,P,i){var n,a,l,o=i*8-P-1,u=(1<>1,h=P===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=z?0:i-1,b=z?1:-1,x=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(a=isNaN(d)?1:0,n=u):(n=Math.floor(Math.log(d)/Math.LN2),d*(l=Math.pow(2,-n))<1&&(n--,l*=2),n+s>=1?d+=h/l:d+=h*Math.pow(2,1-s),d*l>=2&&(n++,l/=2),n+s>=u?(a=0,n=u):n+s>=1?(a=(d*l-1)*Math.pow(2,P),n=n+s):(a=d*Math.pow(2,s-1)*Math.pow(2,P),n=0));P>=8;Y[y+m]=a&255,m+=b,a/=256,P-=8);for(n=n<0;Y[y+m]=n&255,m+=b,n/=256,o-=8);Y[y+m-b]|=x*128}}),vb=ze(te=>{var Y=BG(),d=RG(),y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;te.Buffer=n,te.SlowBuffer=A,te.INSPECT_MAX_BYTES=50;var z=2147483647;te.kMaxLength=z,n.TYPED_ARRAY_SUPPORT=P(),!n.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 P(){try{let Ae=new Uint8Array(1),Oe={foo:function(){return 42}};return Object.setPrototypeOf(Oe,Uint8Array.prototype),Object.setPrototypeOf(Ae,Oe),Ae.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function i(Ae){if(Ae>z)throw new RangeError('The value "'+Ae+'" is invalid for option "size"');let Oe=new Uint8Array(Ae);return Object.setPrototypeOf(Oe,n.prototype),Oe}function n(Ae,Oe,Le){if(typeof Ae=="number"){if(typeof Oe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(Ae)}return a(Ae,Oe,Le)}n.poolSize=8192;function a(Ae,Oe,Le){if(typeof Ae=="string")return s(Ae,Oe);if(ArrayBuffer.isView(Ae))return m(Ae);if(Ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae);if(tt(Ae,ArrayBuffer)||Ae&&tt(Ae.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(Ae,SharedArrayBuffer)||Ae&&tt(Ae.buffer,SharedArrayBuffer)))return b(Ae,Oe,Le);if(typeof Ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let nt=Ae.valueOf&&Ae.valueOf();if(nt!=null&&nt!==Ae)return n.from(nt,Oe,Le);let xt=x(Ae);if(xt)return xt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ae[Symbol.toPrimitive]=="function")return n.from(Ae[Symbol.toPrimitive]("string"),Oe,Le);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ae)}n.from=function(Ae,Oe,Le){return a(Ae,Oe,Le)},Object.setPrototypeOf(n.prototype,Uint8Array.prototype),Object.setPrototypeOf(n,Uint8Array);function l(Ae){if(typeof Ae!="number")throw new TypeError('"size" argument must be of type number');if(Ae<0)throw new RangeError('The value "'+Ae+'" is invalid for option "size"')}function o(Ae,Oe,Le){return l(Ae),Ae<=0?i(Ae):Oe!==void 0?typeof Le=="string"?i(Ae).fill(Oe,Le):i(Ae).fill(Oe):i(Ae)}n.alloc=function(Ae,Oe,Le){return o(Ae,Oe,Le)};function u(Ae){return l(Ae),i(Ae<0?0:_(Ae)|0)}n.allocUnsafe=function(Ae){return u(Ae)},n.allocUnsafeSlow=function(Ae){return u(Ae)};function s(Ae,Oe){if((typeof Oe!="string"||Oe==="")&&(Oe="utf8"),!n.isEncoding(Oe))throw new TypeError("Unknown encoding: "+Oe);let Le=f(Ae,Oe)|0,nt=i(Le),xt=nt.write(Ae,Oe);return xt!==Le&&(nt=nt.slice(0,xt)),nt}function h(Ae){let Oe=Ae.length<0?0:_(Ae.length)|0,Le=i(Oe);for(let nt=0;nt=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return Ae|0}function A(Ae){return+Ae!=Ae&&(Ae=0),n.alloc(+Ae)}n.isBuffer=function(Ae){return Ae!=null&&Ae._isBuffer===!0&&Ae!==n.prototype},n.compare=function(Ae,Oe){if(tt(Ae,Uint8Array)&&(Ae=n.from(Ae,Ae.offset,Ae.byteLength)),tt(Oe,Uint8Array)&&(Oe=n.from(Oe,Oe.offset,Oe.byteLength)),!n.isBuffer(Ae)||!n.isBuffer(Oe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ae===Oe)return 0;let Le=Ae.length,nt=Oe.length;for(let xt=0,ut=Math.min(Le,nt);xtnt.length?(n.isBuffer(ut)||(ut=n.from(ut)),ut.copy(nt,xt)):Uint8Array.prototype.set.call(nt,ut,xt);else if(n.isBuffer(ut))ut.copy(nt,xt);else throw new TypeError('"list" argument must be an Array of Buffers');xt+=ut.length}return nt};function f(Ae,Oe){if(n.isBuffer(Ae))return Ae.length;if(ArrayBuffer.isView(Ae)||tt(Ae,ArrayBuffer))return Ae.byteLength;if(typeof Ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ae);let Le=Ae.length,nt=arguments.length>2&&arguments[2]===!0;if(!nt&&Le===0)return 0;let xt=!1;for(;;)switch(Oe){case"ascii":case"latin1":case"binary":return Le;case"utf8":case"utf-8":return Ce(Ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Le*2;case"hex":return Le>>>1;case"base64":return Ze(Ae).length;default:if(xt)return nt?-1:Ce(Ae).length;Oe=(""+Oe).toLowerCase(),xt=!0}}n.byteLength=f;function k(Ae,Oe,Le){let nt=!1;if((Oe===void 0||Oe<0)&&(Oe=0),Oe>this.length||((Le===void 0||Le>this.length)&&(Le=this.length),Le<=0)||(Le>>>=0,Oe>>>=0,Le<=Oe))return"";for(Ae||(Ae="utf8");;)switch(Ae){case"hex":return F(this,Oe,Le);case"utf8":case"utf-8":return N(this,Oe,Le);case"ascii":return V(this,Oe,Le);case"latin1":case"binary":return W(this,Oe,Le);case"base64":return T(this,Oe,Le);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,Oe,Le);default:if(nt)throw new TypeError("Unknown encoding: "+Ae);Ae=(Ae+"").toLowerCase(),nt=!0}}n.prototype._isBuffer=!0;function w(Ae,Oe,Le){let nt=Ae[Oe];Ae[Oe]=Ae[Le],Ae[Le]=nt}n.prototype.swap16=function(){let Ae=this.length;if(Ae%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Oe=0;OeOe&&(Ae+=" ... "),""},y&&(n.prototype[y]=n.prototype.inspect),n.prototype.compare=function(Ae,Oe,Le,nt,xt){if(tt(Ae,Uint8Array)&&(Ae=n.from(Ae,Ae.offset,Ae.byteLength)),!n.isBuffer(Ae))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ae);if(Oe===void 0&&(Oe=0),Le===void 0&&(Le=Ae?Ae.length:0),nt===void 0&&(nt=0),xt===void 0&&(xt=this.length),Oe<0||Le>Ae.length||nt<0||xt>this.length)throw new RangeError("out of range index");if(nt>=xt&&Oe>=Le)return 0;if(nt>=xt)return-1;if(Oe>=Le)return 1;if(Oe>>>=0,Le>>>=0,nt>>>=0,xt>>>=0,this===Ae)return 0;let ut=xt-nt,Et=Le-Oe,Gt=Math.min(ut,Et),Qt=this.slice(nt,xt),vr=Ae.slice(Oe,Le);for(let mr=0;mr2147483647?Le=2147483647:Le<-2147483648&&(Le=-2147483648),Le=+Le,_t(Le)&&(Le=xt?0:Ae.length-1),Le<0&&(Le=Ae.length+Le),Le>=Ae.length){if(xt)return-1;Le=Ae.length-1}else if(Le<0)if(xt)Le=0;else return-1;if(typeof Oe=="string"&&(Oe=n.from(Oe,nt)),n.isBuffer(Oe))return Oe.length===0?-1:E(Ae,Oe,Le,nt,xt);if(typeof Oe=="number")return Oe=Oe&255,typeof Uint8Array.prototype.indexOf=="function"?xt?Uint8Array.prototype.indexOf.call(Ae,Oe,Le):Uint8Array.prototype.lastIndexOf.call(Ae,Oe,Le):E(Ae,[Oe],Le,nt,xt);throw new TypeError("val must be string, number or Buffer")}function E(Ae,Oe,Le,nt,xt){let ut=1,Et=Ae.length,Gt=Oe.length;if(nt!==void 0&&(nt=String(nt).toLowerCase(),nt==="ucs2"||nt==="ucs-2"||nt==="utf16le"||nt==="utf-16le")){if(Ae.length<2||Oe.length<2)return-1;ut=2,Et/=2,Gt/=2,Le/=2}function Qt(mr,Yr){return ut===1?mr[Yr]:mr.readUInt16BE(Yr*ut)}let vr;if(xt){let mr=-1;for(vr=Le;vrEt&&(Le=Et-Gt),vr=Le;vr>=0;vr--){let mr=!0;for(let Yr=0;Yrxt&&(nt=xt)):nt=xt;let ut=Oe.length;nt>ut/2&&(nt=ut/2);let Et;for(Et=0;Et>>0,isFinite(Le)?(Le=Le>>>0,nt===void 0&&(nt="utf8")):(nt=Le,Le=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let xt=this.length-Oe;if((Le===void 0||Le>xt)&&(Le=xt),Ae.length>0&&(Le<0||Oe<0)||Oe>this.length)throw new RangeError("Attempt to write outside buffer bounds");nt||(nt="utf8");let ut=!1;for(;;)switch(nt){case"hex":return I(this,Ae,Oe,Le);case"utf8":case"utf-8":return M(this,Ae,Oe,Le);case"ascii":case"latin1":case"binary":return p(this,Ae,Oe,Le);case"base64":return g(this,Ae,Oe,Le);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Ae,Oe,Le);default:if(ut)throw new TypeError("Unknown encoding: "+nt);nt=(""+nt).toLowerCase(),ut=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(Ae,Oe,Le){return Oe===0&&Le===Ae.length?Y.fromByteArray(Ae):Y.fromByteArray(Ae.slice(Oe,Le))}function N(Ae,Oe,Le){Le=Math.min(Ae.length,Le);let nt=[],xt=Oe;for(;xt239?4:ut>223?3:ut>191?2:1;if(xt+Gt<=Le){let Qt,vr,mr,Yr;switch(Gt){case 1:ut<128&&(Et=ut);break;case 2:Qt=Ae[xt+1],(Qt&192)===128&&(Yr=(ut&31)<<6|Qt&63,Yr>127&&(Et=Yr));break;case 3:Qt=Ae[xt+1],vr=Ae[xt+2],(Qt&192)===128&&(vr&192)===128&&(Yr=(ut&15)<<12|(Qt&63)<<6|vr&63,Yr>2047&&(Yr<55296||Yr>57343)&&(Et=Yr));break;case 4:Qt=Ae[xt+1],vr=Ae[xt+2],mr=Ae[xt+3],(Qt&192)===128&&(vr&192)===128&&(mr&192)===128&&(Yr=(ut&15)<<18|(Qt&63)<<12|(vr&63)<<6|mr&63,Yr>65535&&Yr<1114112&&(Et=Yr))}}Et===null?(Et=65533,Gt=1):Et>65535&&(Et-=65536,nt.push(Et>>>10&1023|55296),Et=56320|Et&1023),nt.push(Et),xt+=Gt}return U(nt)}var B=4096;function U(Ae){let Oe=Ae.length;if(Oe<=B)return String.fromCharCode.apply(String,Ae);let Le="",nt=0;for(;ntnt)&&(Le=nt);let xt="";for(let ut=Oe;utLe&&(Ae=Le),Oe<0?(Oe+=Le,Oe<0&&(Oe=0)):Oe>Le&&(Oe=Le),OeLe)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(Ae,Oe,Le){Ae=Ae>>>0,Oe=Oe>>>0,Le||q(Ae,Oe,this.length);let nt=this[Ae],xt=1,ut=0;for(;++ut>>0,Oe=Oe>>>0,Le||q(Ae,Oe,this.length);let nt=this[Ae+--Oe],xt=1;for(;Oe>0&&(xt*=256);)nt+=this[Ae+--Oe]*xt;return nt},n.prototype.readUint8=n.prototype.readUInt8=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,1,this.length),this[Ae]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,2,this.length),this[Ae]|this[Ae+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,2,this.length),this[Ae]<<8|this[Ae+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,4,this.length),(this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16)+this[Ae+3]*16777216},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,4,this.length),this[Ae]*16777216+(this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3])},n.prototype.readBigUInt64LE=vt(function(Ae){Ae=Ae>>>0,oe(Ae,"offset");let Oe=this[Ae],Le=this[Ae+7];(Oe===void 0||Le===void 0)&&J(Ae,this.length-8);let nt=Oe+this[++Ae]*2**8+this[++Ae]*2**16+this[++Ae]*2**24,xt=this[++Ae]+this[++Ae]*2**8+this[++Ae]*2**16+Le*2**24;return BigInt(nt)+(BigInt(xt)<>>0,oe(Ae,"offset");let Oe=this[Ae],Le=this[Ae+7];(Oe===void 0||Le===void 0)&&J(Ae,this.length-8);let nt=Oe*2**24+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae],xt=this[++Ae]*2**24+this[++Ae]*2**16+this[++Ae]*2**8+Le;return(BigInt(nt)<>>0,Oe=Oe>>>0,Le||q(Ae,Oe,this.length);let nt=this[Ae],xt=1,ut=0;for(;++ut=xt&&(nt-=Math.pow(2,8*Oe)),nt},n.prototype.readIntBE=function(Ae,Oe,Le){Ae=Ae>>>0,Oe=Oe>>>0,Le||q(Ae,Oe,this.length);let nt=Oe,xt=1,ut=this[Ae+--nt];for(;nt>0&&(xt*=256);)ut+=this[Ae+--nt]*xt;return xt*=128,ut>=xt&&(ut-=Math.pow(2,8*Oe)),ut},n.prototype.readInt8=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,1,this.length),this[Ae]&128?(255-this[Ae]+1)*-1:this[Ae]},n.prototype.readInt16LE=function(Ae,Oe){Ae=Ae>>>0,Oe||q(Ae,2,this.length);let Le=this[Ae]|this[Ae+1]<<8;return Le&32768?Le|4294901760:Le},n.prototype.readInt16BE=function(Ae,Oe){Ae=Ae>>>0,Oe||q(Ae,2,this.length);let Le=this[Ae+1]|this[Ae]<<8;return Le&32768?Le|4294901760:Le},n.prototype.readInt32LE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,4,this.length),this[Ae]|this[Ae+1]<<8|this[Ae+2]<<16|this[Ae+3]<<24},n.prototype.readInt32BE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,4,this.length),this[Ae]<<24|this[Ae+1]<<16|this[Ae+2]<<8|this[Ae+3]},n.prototype.readBigInt64LE=vt(function(Ae){Ae=Ae>>>0,oe(Ae,"offset");let Oe=this[Ae],Le=this[Ae+7];(Oe===void 0||Le===void 0)&&J(Ae,this.length-8);let nt=this[Ae+4]+this[Ae+5]*2**8+this[Ae+6]*2**16+(Le<<24);return(BigInt(nt)<>>0,oe(Ae,"offset");let Oe=this[Ae],Le=this[Ae+7];(Oe===void 0||Le===void 0)&&J(Ae,this.length-8);let nt=(Oe<<24)+this[++Ae]*2**16+this[++Ae]*2**8+this[++Ae];return(BigInt(nt)<>>0,Oe||q(Ae,4,this.length),d.read(this,Ae,!0,23,4)},n.prototype.readFloatBE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,4,this.length),d.read(this,Ae,!1,23,4)},n.prototype.readDoubleLE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,8,this.length),d.read(this,Ae,!0,52,8)},n.prototype.readDoubleBE=function(Ae,Oe){return Ae=Ae>>>0,Oe||q(Ae,8,this.length),d.read(this,Ae,!1,52,8)};function G(Ae,Oe,Le,nt,xt,ut){if(!n.isBuffer(Ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(Oe>xt||OeAe.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(Ae,Oe,Le,nt){if(Ae=+Ae,Oe=Oe>>>0,Le=Le>>>0,!nt){let Et=Math.pow(2,8*Le)-1;G(this,Ae,Oe,Le,Et,0)}let xt=1,ut=0;for(this[Oe]=Ae&255;++ut>>0,Le=Le>>>0,!nt){let Et=Math.pow(2,8*Le)-1;G(this,Ae,Oe,Le,Et,0)}let xt=Le-1,ut=1;for(this[Oe+xt]=Ae&255;--xt>=0&&(ut*=256);)this[Oe+xt]=Ae/ut&255;return Oe+Le},n.prototype.writeUint8=n.prototype.writeUInt8=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,1,255,0),this[Oe]=Ae&255,Oe+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,2,65535,0),this[Oe]=Ae&255,this[Oe+1]=Ae>>>8,Oe+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,2,65535,0),this[Oe]=Ae>>>8,this[Oe+1]=Ae&255,Oe+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,4,4294967295,0),this[Oe+3]=Ae>>>24,this[Oe+2]=Ae>>>16,this[Oe+1]=Ae>>>8,this[Oe]=Ae&255,Oe+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,4,4294967295,0),this[Oe]=Ae>>>24,this[Oe+1]=Ae>>>16,this[Oe+2]=Ae>>>8,this[Oe+3]=Ae&255,Oe+4};function ee(Ae,Oe,Le,nt,xt){_e(Oe,nt,xt,Ae,Le,7);let ut=Number(Oe&BigInt(4294967295));Ae[Le++]=ut,ut=ut>>8,Ae[Le++]=ut,ut=ut>>8,Ae[Le++]=ut,ut=ut>>8,Ae[Le++]=ut;let Et=Number(Oe>>BigInt(32)&BigInt(4294967295));return Ae[Le++]=Et,Et=Et>>8,Ae[Le++]=Et,Et=Et>>8,Ae[Le++]=Et,Et=Et>>8,Ae[Le++]=Et,Le}function he(Ae,Oe,Le,nt,xt){_e(Oe,nt,xt,Ae,Le,7);let ut=Number(Oe&BigInt(4294967295));Ae[Le+7]=ut,ut=ut>>8,Ae[Le+6]=ut,ut=ut>>8,Ae[Le+5]=ut,ut=ut>>8,Ae[Le+4]=ut;let Et=Number(Oe>>BigInt(32)&BigInt(4294967295));return Ae[Le+3]=Et,Et=Et>>8,Ae[Le+2]=Et,Et=Et>>8,Ae[Le+1]=Et,Et=Et>>8,Ae[Le]=Et,Le+8}n.prototype.writeBigUInt64LE=vt(function(Ae,Oe=0){return ee(this,Ae,Oe,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeBigUInt64BE=vt(function(Ae,Oe=0){return he(this,Ae,Oe,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeIntLE=function(Ae,Oe,Le,nt){if(Ae=+Ae,Oe=Oe>>>0,!nt){let Gt=Math.pow(2,8*Le-1);G(this,Ae,Oe,Le,Gt-1,-Gt)}let xt=0,ut=1,Et=0;for(this[Oe]=Ae&255;++xt>0)-Et&255;return Oe+Le},n.prototype.writeIntBE=function(Ae,Oe,Le,nt){if(Ae=+Ae,Oe=Oe>>>0,!nt){let Gt=Math.pow(2,8*Le-1);G(this,Ae,Oe,Le,Gt-1,-Gt)}let xt=Le-1,ut=1,Et=0;for(this[Oe+xt]=Ae&255;--xt>=0&&(ut*=256);)Ae<0&&Et===0&&this[Oe+xt+1]!==0&&(Et=1),this[Oe+xt]=(Ae/ut>>0)-Et&255;return Oe+Le},n.prototype.writeInt8=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,1,127,-128),Ae<0&&(Ae=255+Ae+1),this[Oe]=Ae&255,Oe+1},n.prototype.writeInt16LE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,2,32767,-32768),this[Oe]=Ae&255,this[Oe+1]=Ae>>>8,Oe+2},n.prototype.writeInt16BE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,2,32767,-32768),this[Oe]=Ae>>>8,this[Oe+1]=Ae&255,Oe+2},n.prototype.writeInt32LE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,4,2147483647,-2147483648),this[Oe]=Ae&255,this[Oe+1]=Ae>>>8,this[Oe+2]=Ae>>>16,this[Oe+3]=Ae>>>24,Oe+4},n.prototype.writeInt32BE=function(Ae,Oe,Le){return Ae=+Ae,Oe=Oe>>>0,Le||G(this,Ae,Oe,4,2147483647,-2147483648),Ae<0&&(Ae=4294967295+Ae+1),this[Oe]=Ae>>>24,this[Oe+1]=Ae>>>16,this[Oe+2]=Ae>>>8,this[Oe+3]=Ae&255,Oe+4},n.prototype.writeBigInt64LE=vt(function(Ae,Oe=0){return ee(this,Ae,Oe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),n.prototype.writeBigInt64BE=vt(function(Ae,Oe=0){return he(this,Ae,Oe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function be(Ae,Oe,Le,nt,xt,ut){if(Le+nt>Ae.length)throw new RangeError("Index out of range");if(Le<0)throw new RangeError("Index out of range")}function ve(Ae,Oe,Le,nt,xt){return Oe=+Oe,Le=Le>>>0,xt||be(Ae,Oe,Le,4),d.write(Ae,Oe,Le,nt,23,4),Le+4}n.prototype.writeFloatLE=function(Ae,Oe,Le){return ve(this,Ae,Oe,!0,Le)},n.prototype.writeFloatBE=function(Ae,Oe,Le){return ve(this,Ae,Oe,!1,Le)};function ce(Ae,Oe,Le,nt,xt){return Oe=+Oe,Le=Le>>>0,xt||be(Ae,Oe,Le,8),d.write(Ae,Oe,Le,nt,52,8),Le+8}n.prototype.writeDoubleLE=function(Ae,Oe,Le){return ce(this,Ae,Oe,!0,Le)},n.prototype.writeDoubleBE=function(Ae,Oe,Le){return ce(this,Ae,Oe,!1,Le)},n.prototype.copy=function(Ae,Oe,Le,nt){if(!n.isBuffer(Ae))throw new TypeError("argument should be a Buffer");if(Le||(Le=0),!nt&&nt!==0&&(nt=this.length),Oe>=Ae.length&&(Oe=Ae.length),Oe||(Oe=0),nt>0&&nt=this.length)throw new RangeError("Index out of range");if(nt<0)throw new RangeError("sourceEnd out of bounds");nt>this.length&&(nt=this.length),Ae.length-Oe>>0,Le=Le===void 0?this.length:Le>>>0,Ae||(Ae=0);let xt;if(typeof Ae=="number")for(xt=Oe;xt2**32?xt=ne(String(Le)):typeof Le=="bigint"&&(xt=String(Le),(Le>BigInt(2)**BigInt(32)||Le<-(BigInt(2)**BigInt(32)))&&(xt=ne(xt)),xt+="n"),nt+=` It must be ${Oe}. Received ${xt}`,nt},RangeError);function ne(Ae){let Oe="",Le=Ae.length,nt=Ae[0]==="-"?1:0;for(;Le>=nt+4;Le-=3)Oe=`_${Ae.slice(Le-3,Le)}${Oe}`;return`${Ae.slice(0,Le)}${Oe}`}function se(Ae,Oe,Le){oe(Oe,"offset"),(Ae[Oe]===void 0||Ae[Oe+Le]===void 0)&&J(Oe,Ae.length-(Le+1))}function _e(Ae,Oe,Le,nt,xt,ut){if(Ae>Le||Ae= 0${Et} and < 2${Et} ** ${(ut+1)*8}${Et}`:Gt=`>= -(2${Et} ** ${(ut+1)*8-1}${Et}) and < 2 ** ${(ut+1)*8-1}${Et}`,new re.ERR_OUT_OF_RANGE("value",Gt,Ae)}se(nt,xt,ut)}function oe(Ae,Oe){if(typeof Ae!="number")throw new re.ERR_INVALID_ARG_TYPE(Oe,"number",Ae)}function J(Ae,Oe,Le){throw Math.floor(Ae)!==Ae?(oe(Ae,Le),new re.ERR_OUT_OF_RANGE("offset","an integer",Ae)):Oe<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Oe}`,Ae)}var me=/[^+/0-9A-Za-z-_]/g;function fe(Ae){if(Ae=Ae.split("=")[0],Ae=Ae.trim().replace(me,""),Ae.length<2)return"";for(;Ae.length%4!==0;)Ae=Ae+"=";return Ae}function Ce(Ae,Oe){Oe=Oe||1/0;let Le,nt=Ae.length,xt=null,ut=[];for(let Et=0;Et55295&&Le<57344){if(!xt){if(Le>56319){(Oe-=3)>-1&&ut.push(239,191,189);continue}else if(Et+1===nt){(Oe-=3)>-1&&ut.push(239,191,189);continue}xt=Le;continue}if(Le<56320){(Oe-=3)>-1&&ut.push(239,191,189),xt=Le;continue}Le=(xt-55296<<10|Le-56320)+65536}else xt&&(Oe-=3)>-1&&ut.push(239,191,189);if(xt=null,Le<128){if((Oe-=1)<0)break;ut.push(Le)}else if(Le<2048){if((Oe-=2)<0)break;ut.push(Le>>6|192,Le&63|128)}else if(Le<65536){if((Oe-=3)<0)break;ut.push(Le>>12|224,Le>>6&63|128,Le&63|128)}else if(Le<1114112){if((Oe-=4)<0)break;ut.push(Le>>18|240,Le>>12&63|128,Le>>6&63|128,Le&63|128)}else throw new Error("Invalid code point")}return ut}function Re(Ae){let Oe=[];for(let Le=0;Le>8,xt=Le%256,ut.push(xt),ut.push(nt);return ut}function Ze(Ae){return Y.toByteArray(fe(Ae))}function Ge(Ae,Oe,Le,nt){let xt;for(xt=0;xt=Oe.length||xt>=Ae.length);++xt)Oe[xt+Le]=Ae[xt];return xt}function tt(Ae,Oe){return Ae instanceof Oe||Ae!=null&&Ae.constructor!=null&&Ae.constructor.name!=null&&Ae.constructor.name===Oe.name}function _t(Ae){return Ae!==Ae}var mt=function(){let Ae="0123456789abcdef",Oe=new Array(256);for(let Le=0;Le<16;++Le){let nt=Le*16;for(let xt=0;xt<16;++xt)Oe[nt+xt]=Ae[Le]+Ae[xt]}return Oe}();function vt(Ae){return typeof BigInt>"u"?ct:Ae}function ct(){throw new Error("BigInt not supported")}}),eC=ze((te,Y)=>{Y.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var d={},y=Symbol("test"),z=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(z)!=="[object Symbol]")return!1;var P=42;d[y]=P;for(var i in d)return!1;if(typeof Object.keys=="function"&&Object.keys(d).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(d).length!==0)return!1;var n=Object.getOwnPropertySymbols(d);if(n.length!==1||n[0]!==y||!Object.prototype.propertyIsEnumerable.call(d,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(d,y);if(a.value!==P||a.enumerable!==!0)return!1}return!0}}),Q4=ze((te,Y)=>{var d=eC();Y.exports=function(){return d()&&!!Symbol.toStringTag}}),gP=ze((te,Y)=>{Y.exports=Object}),FG=ze((te,Y)=>{Y.exports=Error}),NG=ze((te,Y)=>{Y.exports=EvalError}),jG=ze((te,Y)=>{Y.exports=RangeError}),UG=ze((te,Y)=>{Y.exports=ReferenceError}),vP=ze((te,Y)=>{Y.exports=SyntaxError}),zw=ze((te,Y)=>{Y.exports=TypeError}),$G=ze((te,Y)=>{Y.exports=URIError}),HG=ze((te,Y)=>{Y.exports=Math.abs}),VG=ze((te,Y)=>{Y.exports=Math.floor}),WG=ze((te,Y)=>{Y.exports=Math.max}),qG=ze((te,Y)=>{Y.exports=Math.min}),GG=ze((te,Y)=>{Y.exports=Math.pow}),ZG=ze((te,Y)=>{Y.exports=Math.round}),KG=ze((te,Y)=>{Y.exports=Number.isNaN||function(d){return d!==d}}),YG=ze((te,Y)=>{var d=KG();Y.exports=function(y){return d(y)||y===0?y:y<0?-1:1}}),XG=ze((te,Y)=>{Y.exports=Object.getOwnPropertyDescriptor}),yb=ze((te,Y)=>{var d=XG();if(d)try{d([],"length")}catch{d=null}Y.exports=d}),e6=ze((te,Y)=>{var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}Y.exports=d}),JG=ze((te,Y)=>{var d=typeof Symbol<"u"&&Symbol,y=eC();Y.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:y()}}),yP=ze((te,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),_P=ze((te,Y)=>{var d=gP();Y.exports=d.getPrototypeOf||null}),QG=ze((te,Y)=>{var d="Function.prototype.bind called on incompatible ",y=Object.prototype.toString,z=Math.max,P="[object Function]",i=function(l,o){for(var u=[],s=0;s{var d=QG();Y.exports=Function.prototype.bind||d}),tC=ze((te,Y)=>{Y.exports=Function.prototype.call}),xP=ze((te,Y)=>{Y.exports=Function.prototype.apply}),eZ=ze((te,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),tZ=ze((te,Y)=>{var d=Ow(),y=xP(),z=tC(),P=eZ();Y.exports=P||d.call(z,y)}),rZ=ze((te,Y)=>{var d=Ow(),y=zw(),z=tC(),P=tZ();Y.exports=function(i){if(i.length<1||typeof i[0]!="function")throw new y("a function is required");return P(d,z,i)}}),iZ=ze((te,Y)=>{var d=rZ(),y=yb(),z;try{z=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var P=!!z&&y&&y(Object.prototype,"__proto__"),i=Object,n=i.getPrototypeOf;Y.exports=P&&typeof P.get=="function"?d([P.get]):typeof n=="function"?function(a){return n(a==null?a:i(a))}:!1}),nZ=ze((te,Y)=>{var d=yP(),y=_P(),z=iZ();Y.exports=d?function(P){return d(P)}:y?function(P){if(!P||typeof P!="object"&&typeof P!="function")throw new TypeError("getProto: not an object");return y(P)}:z?function(P){return z(P)}:null}),aZ=ze((te,Y)=>{var d=Function.prototype.call,y=Object.prototype.hasOwnProperty,z=Ow();Y.exports=z.call(d,y)}),rC=ze((te,Y)=>{var d,y=gP(),z=FG(),P=NG(),i=jG(),n=UG(),a=vP(),l=zw(),o=$G(),u=HG(),s=VG(),h=WG(),m=qG(),b=GG(),x=ZG(),_=YG(),A=Function,f=function(se){try{return A('"use strict"; return ('+se+").constructor;")()}catch{}},k=yb(),w=e6(),D=function(){throw new l},E=k?function(){try{return arguments.callee,D}catch{try{return k(arguments,"callee").get}catch{return D}}}():D,I=JG()(),M=nZ(),p=_P(),g=yP(),C=xP(),T=tC(),N={},B=typeof Uint8Array>"u"||!M?d:M(Uint8Array),U={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":I&&M?M([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":z,"%eval%":eval,"%EvalError%":P,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&M?M(M([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!M?d:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":y,"%Object.getOwnPropertyDescriptor%":k,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":i,"%ReferenceError%":n,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!M?d:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&M?M(""[Symbol.iterator]()):d,"%Symbol%":I?Symbol:d,"%SyntaxError%":a,"%ThrowTypeError%":E,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":C,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":p,"%Math.abs%":u,"%Math.floor%":s,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":b,"%Math.round%":x,"%Math.sign%":_,"%Reflect.getPrototypeOf%":g};if(M)try{null.error}catch(se){V=M(M(se)),U["%Error.prototype%"]=V}var V,W=function se(_e){var oe;if(_e==="%AsyncFunction%")oe=f("async function () {}");else if(_e==="%GeneratorFunction%")oe=f("function* () {}");else if(_e==="%AsyncGeneratorFunction%")oe=f("async function* () {}");else if(_e==="%AsyncGenerator%"){var J=se("%AsyncGeneratorFunction%");J&&(oe=J.prototype)}else if(_e==="%AsyncIteratorPrototype%"){var me=se("%AsyncGenerator%");me&&M&&(oe=M(me.prototype))}return U[_e]=oe,oe},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=Ow(),q=aZ(),G=H.call(T,Array.prototype.concat),ee=H.call(C,Array.prototype.splice),he=H.call(T,String.prototype.replace),be=H.call(T,String.prototype.slice),ve=H.call(T,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,ge=function(se){var _e=be(se,0,1),oe=be(se,-1);if(_e==="%"&&oe!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(oe==="%"&&_e!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return he(se,ce,function(me,fe,Ce,Re){J[J.length]=Ce?he(Re,re,"$1"):fe||me}),J},ne=function(se,_e){var oe=se,J;if(q(F,oe)&&(J=F[oe],oe="%"+J[0]+"%"),q(U,oe)){var me=U[oe];if(me===N&&(me=W(oe)),typeof me>"u"&&!_e)throw new l("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:J,name:oe,value:me}}throw new a("intrinsic "+se+" does not exist!")};Y.exports=function(se,_e){if(typeof se!="string"||se.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof _e!="boolean")throw new l('"allowMissing" argument must be a boolean');if(ve(/^%?[^%]*%?$/,se)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var oe=ge(se),J=oe.length>0?oe[0]:"",me=ne("%"+J+"%",_e),fe=me.name,Ce=me.value,Re=!1,Be=me.alias;Be&&(J=Be[0],ee(oe,G([0,1],Be)));for(var Ze=1,Ge=!0;Ze=oe.length){var vt=k(Ce,tt);Ge=!!vt,Ge&&"get"in vt&&!("originalValue"in vt.get)?Ce=vt.get:Ce=Ce[tt]}else Ge=q(Ce,tt),Ce=Ce[tt];Ge&&!Re&&(U[fe]=Ce)}}return Ce}}),oZ=ze((te,Y)=>{var d=e6(),y=vP(),z=zw(),P=yb();Y.exports=function(i,n,a){if(!i||typeof i!="object"&&typeof i!="function")throw new z("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new z("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new z("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new z("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new z("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new z("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,h=!!P&&P(i,n);if(d)d(i,n,{configurable:u===null&&h?h.configurable:!u,enumerable:l===null&&h?h.enumerable:!l,value:a,writable:o===null&&h?h.writable:!o});else if(s||!l&&!o&&!u)i[n]=a;else throw new y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),bP=ze((te,Y)=>{var d=e6(),y=function(){return!!d};y.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},Y.exports=y}),sZ=ze((te,Y)=>{var d=rC(),y=oZ(),z=bP()(),P=yb(),i=zw(),n=d("%Math.floor%");Y.exports=function(a,l){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||n(l)!==l)throw new i("`length` must be a positive 32-bit integer");var o=arguments.length>2&&!!arguments[2],u=!0,s=!0;if("length"in a&&P){var h=P(a,"length");h&&!h.configurable&&(u=!1),h&&!h.writable&&(s=!1)}return(u||s||!o)&&(z?y(a,"length",l,!0,!0):y(a,"length",l)),a}}),t6=ze((te,Y)=>{var d=Ow(),y=rC(),z=sZ(),P=zw(),i=y("%Function.prototype.apply%"),n=y("%Function.prototype.call%"),a=y("%Reflect.apply%",!0)||d.call(n,i),l=e6(),o=y("%Math.max%");Y.exports=function(s){if(typeof s!="function")throw new P("a function is required");var h=a(d,n,arguments);return z(h,1+o(0,s.length-(arguments.length-1)),!0)};var u=function(){return a(d,i,arguments)};l?l(Y.exports,"apply",{value:u}):Y.exports.apply=u}),Bw=ze((te,Y)=>{var d=rC(),y=t6(),z=y(d("String.prototype.indexOf"));Y.exports=function(P,i){var n=d(P,!!i);return typeof n=="function"&&z(P,".prototype.")>-1?y(n):n}}),lZ=ze((te,Y)=>{var d=Q4()(),y=Bw(),z=y("Object.prototype.toString"),P=function(a){return d&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:z(a)==="[object Arguments]"},i=function(a){return P(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&z(a)!=="[object Array]"&&z(a.callee)==="[object Function]"},n=function(){return P(arguments)}();P.isLegacyArguments=i,Y.exports=n?P:i}),uZ=ze((te,Y)=>{var d=Object.prototype.toString,y=Function.prototype.toString,z=/^\s*(?:function)?\*/,P=Q4()(),i=Object.getPrototypeOf,n=function(){if(!P)return!1;try{return Function("return function*() {}")()}catch{}},a;Y.exports=function(l){if(typeof l!="function")return!1;if(z.test(y.call(l)))return!0;if(!P){var o=d.call(l);return o==="[object GeneratorFunction]"}if(!i)return!1;if(typeof a>"u"){var u=n();a=u?i(u):!1}return i(l)===a}}),cZ=ze((te,Y)=>{var d=Function.prototype.toString,y=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,z,P;if(typeof y=="function"&&typeof Object.defineProperty=="function")try{z=Object.defineProperty({},"length",{get:function(){throw P}}),P={},y(function(){throw 42},null,z)}catch(k){k!==P&&(y=null)}else y=null;var i=/^\s*class\b/,n=function(k){try{var w=d.call(k);return i.test(w)}catch{return!1}},a=function(k){try{return n(k)?!1:(d.call(k),!0)}catch{return!1}},l=Object.prototype.toString,o="[object Object]",u="[object Function]",s="[object GeneratorFunction]",h="[object HTMLAllCollection]",m="[object HTML document.all class]",b="[object HTMLCollection]",x=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),A=function(){return!1};typeof document=="object"&&(f=document.all,l.call(f)===l.call(document.all)&&(A=function(k){if((_||!k)&&(typeof k>"u"||typeof k=="object"))try{var w=l.call(k);return(w===h||w===m||w===b||w===o)&&k("")==null}catch{}return!1}));var f;Y.exports=y?function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;try{y(k,null,z)}catch(w){if(w!==P)return!1}return!n(k)&&a(k)}:function(k){if(A(k))return!0;if(!k||typeof k!="function"&&typeof k!="object")return!1;if(x)return a(k);if(n(k))return!1;var w=l.call(k);return w!==u&&w!==s&&!/^\[object HTML/.test(w)?!1:a(k)}}),wP=ze((te,Y)=>{var d=cZ(),y=Object.prototype.toString,z=Object.prototype.hasOwnProperty,P=function(l,o,u){for(var s=0,h=l.length;s=3&&(s=u),y.call(l)==="[object Array]"?P(l,o,s):typeof l=="string"?i(l,o,s):n(l,o,s)};Y.exports=a}),kP=ze((te,Y)=>{var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],y=typeof globalThis>"u"?window:globalThis;Y.exports=function(){for(var z=[],P=0;P{var d=wP(),y=kP(),z=t6(),P=Bw(),i=yb(),n=P("Object.prototype.toString"),a=Q4()(),l=typeof globalThis>"u"?window:globalThis,o=y(),u=P("String.prototype.slice"),s=Object.getPrototypeOf,h=P("Array.prototype.indexOf",!0)||function(_,A){for(var f=0;f<_.length;f+=1)if(_[f]===A)return f;return-1},m={__proto__:null};a&&i&&s?d(o,function(_){var A=new l[_];if(Symbol.toStringTag in A){var f=s(A),k=i(f,Symbol.toStringTag);if(!k){var w=s(f);k=i(w,Symbol.toStringTag)}m["$"+_]=z(k.get)}}):d(o,function(_){var A=new l[_],f=A.slice||A.set;f&&(m["$"+_]=z(f))});var b=function(_){var A=!1;return d(m,function(f,k){if(!A)try{"$"+f(_)===k&&(A=u(k,1))}catch{}}),A},x=function(_){var A=!1;return d(m,function(f,k){if(!A)try{f(_),A=u(k,1)}catch{}}),A};Y.exports=function(_){if(!_||typeof _!="object")return!1;if(!a){var A=u(n(_),8,-1);return h(o,A)>-1?A:A!=="Object"?!1:x(_)}return i?b(_):null}}),fZ=ze((te,Y)=>{var d=wP(),y=kP(),z=Bw(),P=z("Object.prototype.toString"),i=Q4()(),n=yb(),a=typeof globalThis>"u"?window:globalThis,l=y(),o=z("Array.prototype.indexOf",!0)||function(b,x){for(var _=0;_-1}return n?m(b):!1}}),TP=ze(te=>{var Y=lZ(),d=uZ(),y=hZ(),z=fZ();function P(Be){return Be.call.bind(Be)}var i=typeof BigInt<"u",n=typeof Symbol<"u",a=P(Object.prototype.toString),l=P(Number.prototype.valueOf),o=P(String.prototype.valueOf),u=P(Boolean.prototype.valueOf);i&&(s=P(BigInt.prototype.valueOf));var s;n&&(h=P(Symbol.prototype.valueOf));var h;function m(Be,Ze){if(typeof Be!="object")return!1;try{return Ze(Be),!0}catch{return!1}}te.isArgumentsObject=Y,te.isGeneratorFunction=d,te.isTypedArray=z;function b(Be){return typeof Promise<"u"&&Be instanceof Promise||Be!==null&&typeof Be=="object"&&typeof Be.then=="function"&&typeof Be.catch=="function"}te.isPromise=b;function x(Be){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Be):z(Be)||ee(Be)}te.isArrayBufferView=x;function _(Be){return y(Be)==="Uint8Array"}te.isUint8Array=_;function A(Be){return y(Be)==="Uint8ClampedArray"}te.isUint8ClampedArray=A;function f(Be){return y(Be)==="Uint16Array"}te.isUint16Array=f;function k(Be){return y(Be)==="Uint32Array"}te.isUint32Array=k;function w(Be){return y(Be)==="Int8Array"}te.isInt8Array=w;function D(Be){return y(Be)==="Int16Array"}te.isInt16Array=D;function E(Be){return y(Be)==="Int32Array"}te.isInt32Array=E;function I(Be){return y(Be)==="Float32Array"}te.isFloat32Array=I;function M(Be){return y(Be)==="Float64Array"}te.isFloat64Array=M;function p(Be){return y(Be)==="BigInt64Array"}te.isBigInt64Array=p;function g(Be){return y(Be)==="BigUint64Array"}te.isBigUint64Array=g;function C(Be){return a(Be)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function T(Be){return typeof Map>"u"?!1:C.working?C(Be):Be instanceof Map}te.isMap=T;function N(Be){return a(Be)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function B(Be){return typeof Set>"u"?!1:N.working?N(Be):Be instanceof Set}te.isSet=B;function U(Be){return a(Be)==="[object WeakMap]"}U.working=typeof WeakMap<"u"&&U(new WeakMap);function V(Be){return typeof WeakMap>"u"?!1:U.working?U(Be):Be instanceof WeakMap}te.isWeakMap=V;function W(Be){return a(Be)==="[object WeakSet]"}W.working=typeof WeakSet<"u"&&W(new WeakSet);function F(Be){return W(Be)}te.isWeakSet=F;function H(Be){return a(Be)==="[object ArrayBuffer]"}H.working=typeof ArrayBuffer<"u"&&H(new ArrayBuffer);function q(Be){return typeof ArrayBuffer>"u"?!1:H.working?H(Be):Be instanceof ArrayBuffer}te.isArrayBuffer=q;function G(Be){return a(Be)==="[object DataView]"}G.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&G(new DataView(new ArrayBuffer(1),0,1));function ee(Be){return typeof DataView>"u"?!1:G.working?G(Be):Be instanceof DataView}te.isDataView=ee;var he=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function be(Be){return a(Be)==="[object SharedArrayBuffer]"}function ve(Be){return typeof he>"u"?!1:(typeof be.working>"u"&&(be.working=be(new he)),be.working?be(Be):Be instanceof he)}te.isSharedArrayBuffer=ve;function ce(Be){return a(Be)==="[object AsyncFunction]"}te.isAsyncFunction=ce;function re(Be){return a(Be)==="[object Map Iterator]"}te.isMapIterator=re;function ge(Be){return a(Be)==="[object Set Iterator]"}te.isSetIterator=ge;function ne(Be){return a(Be)==="[object Generator]"}te.isGeneratorObject=ne;function se(Be){return a(Be)==="[object WebAssembly.Module]"}te.isWebAssemblyCompiledModule=se;function _e(Be){return m(Be,l)}te.isNumberObject=_e;function oe(Be){return m(Be,o)}te.isStringObject=oe;function J(Be){return m(Be,u)}te.isBooleanObject=J;function me(Be){return i&&m(Be,s)}te.isBigIntObject=me;function fe(Be){return n&&m(Be,h)}te.isSymbolObject=fe;function Ce(Be){return _e(Be)||oe(Be)||J(Be)||me(Be)||fe(Be)}te.isBoxedPrimitive=Ce;function Re(Be){return typeof Uint8Array<"u"&&(q(Be)||ve(Be))}te.isAnyArrayBuffer=Re,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Be){Object.defineProperty(te,Be,{enumerable:!1,value:function(){throw new Error(Be+" is not supported in userland")}})})}),SP=ze((te,Y)=>{Y.exports=function(d){return d&&typeof d=="object"&&typeof d.copy=="function"&&typeof d.fill=="function"&&typeof d.readUInt8=="function"}}),CP=ze(te=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var ee=Object.keys(G),he={},be=0;be=ve)return ne;switch(ne){case"%s":return String(be[he++]);case"%d":return Number(be[he++]);case"%j":try{return JSON.stringify(be[he++])}catch{return"[Circular]"}default:return ne}}),re=be[he];he"u")return function(){return te.deprecate(G,ee).apply(this,arguments)};var he=!1;function be(){if(!he){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),he=!0}return G.apply(this,arguments)}return be};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;te.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var ee=process.pid;y[G]=function(){var he=te.format.apply(te,arguments);console.error("%s %d: %s",G,ee,he)}}else y[G]=function(){};return y[G]};function i(G,ee){var he={seen:[],stylize:a};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),_(ee)?he.showHidden=ee:ee&&te._extend(he,ee),E(he.showHidden)&&(he.showHidden=!1),E(he.depth)&&(he.depth=2),E(he.colors)&&(he.colors=!1),E(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=n),o(he,G,he.depth)}te.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(G,ee){var he=i.styles[ee];return he?"\x1B["+i.colors[he][0]+"m"+G+"\x1B["+i.colors[he][1]+"m":G}function a(G,ee){return G}function l(G){var ee={};return G.forEach(function(he,be){ee[he]=!0}),ee}function o(G,ee,he){if(G.customInspect&&ee&&C(ee.inspect)&&ee.inspect!==te.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var be=ee.inspect(he,G);return w(be)||(be=o(G,be,he)),be}var ve=u(G,ee);if(ve)return ve;var ce=Object.keys(ee),re=l(ce);if(G.showHidden&&(ce=Object.getOwnPropertyNames(ee)),g(ee)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return s(ee);if(ce.length===0){if(C(ee)){var ge=ee.name?": "+ee.name:"";return G.stylize("[Function"+ge+"]","special")}if(I(ee))return G.stylize(RegExp.prototype.toString.call(ee),"regexp");if(p(ee))return G.stylize(Date.prototype.toString.call(ee),"date");if(g(ee))return s(ee)}var ne="",se=!1,_e=["{","}"];if(x(ee)&&(se=!0,_e=["[","]"]),C(ee)){var oe=ee.name?": "+ee.name:"";ne=" [Function"+oe+"]"}if(I(ee)&&(ne=" "+RegExp.prototype.toString.call(ee)),p(ee)&&(ne=" "+Date.prototype.toUTCString.call(ee)),g(ee)&&(ne=" "+s(ee)),ce.length===0&&(!se||ee.length==0))return _e[0]+ne+_e[1];if(he<0)return I(ee)?G.stylize(RegExp.prototype.toString.call(ee),"regexp"):G.stylize("[Object]","special");G.seen.push(ee);var J;return se?J=h(G,ee,he,re,ce):J=ce.map(function(me){return m(G,ee,he,re,me,se)}),G.seen.pop(),b(J,ne,_e)}function u(G,ee){if(E(ee))return G.stylize("undefined","undefined");if(w(ee)){var he="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(he,"string")}if(k(ee))return G.stylize(""+ee,"number");if(_(ee))return G.stylize(""+ee,"boolean");if(A(ee))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,ee,he,be,ve){for(var ce=[],re=0,ge=ee.length;re-1&&(ce?ge=ge.split(` `).map(function(se){return" "+se}).join(` `).slice(2):ge=` `+ge.split(` `).map(function(se){return" "+se}).join(` -`))):ge=G.stylize("[Circular]","special")),E(re)){if(ce&&ve.match(/^\d+$/))return ge;re=JSON.stringify(""+ve),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.slice(1,-1),re=G.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=G.stylize(re,"string"))}return re+": "+ge}function b(G,ee,he){var xe=0,ve=G.reduce(function(ce,re){return xe++,re.indexOf(` -`)>=0&&xe++,ce+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ve>60?he[0]+(ee===""?"":ee+` +`))):ge=G.stylize("[Circular]","special")),E(re)){if(ce&&ve.match(/^\d+$/))return ge;re=JSON.stringify(""+ve),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.slice(1,-1),re=G.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=G.stylize(re,"string"))}return re+": "+ge}function b(G,ee,he){var be=0,ve=G.reduce(function(ce,re){return be++,re.indexOf(` +`)>=0&&be++,ce+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ve>60?he[0]+(ee===""?"":ee+` `)+" "+G.join(`, - `)+" "+he[1]:he[0]+ee+" "+G.join(", ")+" "+he[1]}te.types=wP();function x(G){return Array.isArray(G)}te.isArray=x;function _(G){return typeof G=="boolean"}te.isBoolean=_;function A(G){return G===null}te.isNull=A;function f(G){return G==null}te.isNullOrUndefined=f;function k(G){return typeof G=="number"}te.isNumber=k;function w(G){return typeof G=="string"}te.isString=w;function D(G){return typeof G=="symbol"}te.isSymbol=D;function E(G){return G===void 0}te.isUndefined=E;function I(G){return M(G)&&N(G)==="[object RegExp]"}te.isRegExp=I,te.types.isRegExp=I;function M(G){return typeof G=="object"&&G!==null}te.isObject=M;function p(G){return M(G)&&N(G)==="[object Date]"}te.isDate=p,te.types.isDate=p;function g(G){return M(G)&&(N(G)==="[object Error]"||G instanceof Error)}te.isError=g,te.types.isNativeError=g;function C(G){return typeof G=="function"}te.isFunction=C;function T(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}te.isPrimitive=T,te.isBuffer=kP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,ee=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],ee].join(" ")}te.log=function(){console.log("%s - %s",V(),te.format.apply(te,arguments))},te.inherits=iy(),te._extend=function(G,ee){if(!ee||!M(ee))return G;for(var he=Object.keys(ee),xe=he.length;xe--;)G[he[xe]]=ee[he[xe]];return G};function W(G,ee){return Object.prototype.hasOwnProperty.call(G,ee)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;te.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var ee=G[F];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,F,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var he,xe,ve=new Promise(function(ge,ne){he=ge,xe=ne}),ce=[],re=0;re{function d(m,b){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(m);b&&(_=_.filter(function(A){return Object.getOwnPropertyDescriptor(m,A).enumerable})),x.push.apply(x,_)}return x}function y(m){for(var b=1;b0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(b){var x={data:b,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var x=this.head,_=""+x.data;x=x.next;)_+=b+x.data;return _}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var x=l.allocUnsafe(b>>>0),_=this.head,A=0;_;)h(_.data,x,A),A+=_.data.length,_=_.next;return x}},{key:"consume",value:function(b,x){var _;return bf.length?f.length:b;if(k===f.length?A+=f:A+=f.slice(0,b),b-=k,b===0){k===f.length?(++_,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=f.slice(k));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(b){var x=l.allocUnsafe(b),_=this.head,A=1;for(_.data.copy(x),b-=_.data.length;_=_.next;){var f=_.data,k=b>f.length?f.length:b;if(f.copy(x,x.length-b,0,k),b-=k,b===0){k===f.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=f.slice(k));break}++A}return this.length-=A,x}},{key:s,value:function(b,x){return u(this,y({},x,{depth:0,customInspect:!1}))}}]),m}()}),SP=Fe((te,Y)=>{function d(a,l){var o=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,a)):process.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!l&&h?o._writableState?o._writableState.errorEmitted?process.nextTick(z,o):(o._writableState.errorEmitted=!0,process.nextTick(y,o,h)):process.nextTick(y,o,h):l?(process.nextTick(z,o),l(h)):process.nextTick(z,o)}),this)}function y(a,l){i(a,l),z(a)}function z(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function P(){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 i(a,l){a.emit("error",l)}function n(a,l){var o=a._readableState,u=a._writableState;o&&o.autoDestroy||u&&u.autoDestroy?a.destroy(l):a.emit("error",l)}Y.exports={destroy:d,undestroy:P,errorOrDestroy:n}}),yb=Fe((te,Y)=>{function d(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.__proto__=o}var y={};function z(l,o,u){u||(u=Error);function s(m,b,x){return typeof o=="string"?o:o(m,b,x)}var h=function(m){d(b,m);function b(x,_,A){return m.call(this,s(x,_,A))||this}return b}(u);h.prototype.name=u.name,h.prototype.code=l,y[l]=h}function P(l,o){if(Array.isArray(l)){var u=l.length;return l=l.map(function(s){return String(s)}),u>2?"one of ".concat(o," ").concat(l.slice(0,u-1).join(", "),", or ")+l[u-1]:u===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}else return"of ".concat(o," ").concat(String(l))}function i(l,o,u){return l.substr(0,o.length)===o}function n(l,o,u){return(u===void 0||u>l.length)&&(u=l.length),l.substring(u-o.length,u)===o}function a(l,o,u){return typeof u!="number"&&(u=0),u+o.length>l.length?!1:l.indexOf(o,u)!==-1}z("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),z("ERR_INVALID_ARG_TYPE",function(l,o,u){var s;typeof o=="string"&&i(o,"not ")?(s="must not be",o=o.replace(/^not /,"")):s="must be";var h;if(n(l," argument"))h="The ".concat(l," ").concat(s," ").concat(P(o,"type"));else{var m=a(l,".")?"property":"argument";h='The "'.concat(l,'" ').concat(m," ").concat(s," ").concat(P(o,"type"))}return h+=". Received type ".concat(typeof u),h},TypeError),z("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),z("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),z("ERR_STREAM_PREMATURE_CLOSE","Premature close"),z("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),z("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),z("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),z("ERR_STREAM_WRITE_AFTER_END","write after end"),z("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),z("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),z("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Y.exports.codes=y}),CP=Fe((te,Y)=>{var d=yb().codes.ERR_INVALID_OPT_VALUE;function y(P,i,n){return P.highWaterMark!=null?P.highWaterMark:i?P[n]:null}function z(P,i,n,a){var l=y(i,a,n);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var o=a?n:"highWaterMark";throw new d(o,l)}return Math.floor(l)}return P.objectMode?16:16*1024}Y.exports={getHighWaterMark:z}}),hZ=Fe((te,Y)=>{Y.exports=d;function d(z,P){if(y("noDeprecation"))return z;var i=!1;function n(){if(!i){if(y("throwDeprecation"))throw new Error(P);y("traceDeprecation")?console.trace(P):console.warn(P),i=!0}return z.apply(this,arguments)}return n}function y(z){try{if(!window.localStorage)return!1}catch{return!1}var P=window.localStorage[z];return P==null?!1:String(P).toLowerCase()==="true"}}),AP=Fe((te,Y)=>{Y.exports=p;function d(re){var ge=this;this.next=null,this.entry=null,this.finish=function(){ce(ge,re)}}var y;p.WritableState=I;var z={deprecate:hZ()},P=dP(),i=gb().Buffer,n=window.Uint8Array||function(){};function a(re){return i.from(re)}function l(re){return i.isBuffer(re)||re instanceof n}var o=SP(),u=CP(),s=u.getHighWaterMark,h=yb().codes,m=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,x=h.ERR_MULTIPLE_CALLBACK,_=h.ERR_STREAM_CANNOT_PIPE,A=h.ERR_STREAM_DESTROYED,f=h.ERR_STREAM_NULL_VALUES,k=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,D=o.errorOrDestroy;iy()(p,P);function E(){}function I(re,ge,ne){y=y||_b(),re=re||{},typeof ne!="boolean"&&(ne=ge instanceof y),this.objectMode=!!re.objectMode,ne&&(this.objectMode=this.objectMode||!!re.writableObjectMode),this.highWaterMark=s(this,re,"writableHighWaterMark",ne),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var se=re.decodeStrings===!1;this.decodeStrings=!se,this.defaultEncoding=re.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(_e){W(ge,_e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=re.emitClose!==!1,this.autoDestroy=!!re.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}I.prototype.getBuffer=function(){for(var re=this.bufferedRequest,ge=[];re;)ge.push(re),re=re.next;return ge},function(){try{Object.defineProperty(I.prototype,"buffer",{get:z.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(re){return M.call(this,re)?!0:this!==p?!1:re&&re._writableState instanceof I}})):M=function(re){return re instanceof this};function p(re){y=y||_b();var ge=this instanceof y;if(!ge&&!M.call(p,this))return new p(re);this._writableState=new I(re,this,ge),this.writable=!0,re&&(typeof re.write=="function"&&(this._write=re.write),typeof re.writev=="function"&&(this._writev=re.writev),typeof re.destroy=="function"&&(this._destroy=re.destroy),typeof re.final=="function"&&(this._final=re.final)),P.call(this)}p.prototype.pipe=function(){D(this,new _)};function g(re,ge){var ne=new k;D(re,ne),process.nextTick(ge,ne)}function C(re,ge,ne,se){var _e;return ne===null?_e=new f:typeof ne!="string"&&!ge.objectMode&&(_e=new m("chunk",["string","Buffer"],ne)),_e?(D(re,_e),process.nextTick(se,_e),!1):!0}p.prototype.write=function(re,ge,ne){var se=this._writableState,_e=!1,oe=!se.objectMode&&l(re);return oe&&!i.isBuffer(re)&&(re=a(re)),typeof ge=="function"&&(ne=ge,ge=null),oe?ge="buffer":ge||(ge=se.defaultEncoding),typeof ne!="function"&&(ne=E),se.ending?g(this,ne):(oe||C(this,se,re,ne))&&(se.pendingcb++,_e=N(this,se,oe,re,ge,ne)),_e},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var re=this._writableState;re.corked&&(re.corked--,!re.writing&&!re.corked&&!re.bufferProcessing&&re.bufferedRequest&&q(this,re))},p.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=re.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((re+"").toLowerCase())>-1))throw new w(re);return this._writableState.defaultEncoding=re,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function T(re,ge,ne){return!re.objectMode&&re.decodeStrings!==!1&&typeof ge=="string"&&(ge=i.from(ge,ne)),ge}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(re,ge,ne,se,_e,oe){if(!ne){var J=T(ge,se,_e);se!==J&&(ne=!0,_e="buffer",se=J)}var me=ge.objectMode?1:se.length;ge.length+=me;var fe=ge.length{var d=Object.keys||function(u){var s=[];for(var h in u)s.push(h);return s};Y.exports=a;var y=EP(),z=AP();for(iy()(a,y),P=d(z.prototype),n=0;n{var d=gb(),y=d.Buffer;function z(i,n){for(var a in i)n[a]=i[a]}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?Y.exports=d:(z(d,te),te.Buffer=P);function P(i,n,a){return y(i,n,a)}P.prototype=Object.create(y.prototype),z(y,P),P.from=function(i,n,a){if(typeof i=="number")throw new TypeError("Argument must not be a number");return y(i,n,a)},P.alloc=function(i,n,a){if(typeof i!="number")throw new TypeError("Argument must be a number");var l=y(i);return n!==void 0?typeof a=="string"?l.fill(n,a):l.fill(n):l.fill(0),l},P.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return y(i)},P.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(i)}}),MP=Fe(te=>{var Y=fZ().Buffer,d=Y.isEncoding||function(A){switch(A=""+A,A&&A.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 y(A){if(!A)return"utf8";for(var f;;)switch(A){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 A;default:if(f)return;A=(""+A).toLowerCase(),f=!0}}function z(A){var f=y(A);if(typeof f!="string"&&(Y.isEncoding===d||!d(A)))throw new Error("Unknown encoding: "+A);return f||A}te.StringDecoder=P;function P(A){this.encoding=z(A);var f;switch(this.encoding){case"utf16le":this.text=s,this.end=h,f=4;break;case"utf8":this.fillLast=l,f=4;break;case"base64":this.text=m,this.end=b,f=3;break;default:this.write=x,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(f)}P.prototype.write=function(A){if(A.length===0)return"";var f,k;if(this.lastNeed){if(f=this.fillLast(A),f===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function n(A,f,k){var w=f.length-1;if(w=0?(D>0&&(A.lastNeed=D-1),D):--w=0?(D>0&&(A.lastNeed=D-2),D):--w=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function a(A,f,k){if((f[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&f.length>1){if((f[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&f.length>2&&(f[2]&192)!==128)return A.lastNeed=2,"�"}}function l(A){var f=this.lastTotal-this.lastNeed,k=a(this,A);if(k!==void 0)return k;if(this.lastNeed<=A.length)return A.copy(this.lastChar,f,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,f,0,A.length),this.lastNeed-=A.length}function o(A,f){var k=n(this,A,f);if(!this.lastNeed)return A.toString("utf8",f);this.lastTotal=k;var w=A.length-(k-this.lastNeed);return A.copy(this.lastChar,0,w),A.toString("utf8",f,w)}function u(A){var f=A&&A.length?this.write(A):"";return this.lastNeed?f+"�":f}function s(A,f){if((A.length-f)%2===0){var k=A.toString("utf16le",f);if(k){var w=k.charCodeAt(k.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",f,A.length-1)}function h(A){var f=A&&A.length?this.write(A):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return f+this.lastChar.toString("utf16le",0,k)}return f}function m(A,f){var k=(A.length-f)%3;return k===0?A.toString("base64",f):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",f,A.length-k))}function b(A){var f=A&&A.length?this.write(A):"";return this.lastNeed?f+this.lastChar.toString("base64",0,3-this.lastNeed):f}function x(A){return A.toString(this.encoding)}function _(A){return A&&A.length?this.write(A):""}}),tC=Fe((te,Y)=>{var d=yb().codes.ERR_STREAM_PREMATURE_CLOSE;function y(n){var a=!1;return function(){if(!a){a=!0;for(var l=arguments.length,o=new Array(l),u=0;u{var d;function y(f,k,w){return k in f?Object.defineProperty(f,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):f[k]=w,f}var z=tC(),P=Symbol("lastResolve"),i=Symbol("lastReject"),n=Symbol("error"),a=Symbol("ended"),l=Symbol("lastPromise"),o=Symbol("handlePromise"),u=Symbol("stream");function s(f,k){return{value:f,done:k}}function h(f){var k=f[P];if(k!==null){var w=f[u].read();w!==null&&(f[l]=null,f[P]=null,f[i]=null,k(s(w,!1)))}}function m(f){process.nextTick(h,f)}function b(f,k){return function(w,D){f.then(function(){if(k[a]){w(s(void 0,!0));return}k[o](w,D)},D)}}var x=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((d={get stream(){return this[u]},next:function(){var f=this,k=this[n];if(k!==null)return Promise.reject(k);if(this[a])return Promise.resolve(s(void 0,!0));if(this[u].destroyed)return new Promise(function(I,M){process.nextTick(function(){f[n]?M(f[n]):I(s(void 0,!0))})});var w=this[l],D;if(w)D=new Promise(b(w,this));else{var E=this[u].read();if(E!==null)return Promise.resolve(s(E,!1));D=new Promise(this[o])}return this[l]=D,D}},y(d,Symbol.asyncIterator,function(){return this}),y(d,"return",function(){var f=this;return new Promise(function(k,w){f[u].destroy(null,function(D){if(D){w(D);return}k(s(void 0,!0))})})}),d),x),A=function(f){var k,w=Object.create(_,(k={},y(k,u,{value:f,writable:!0}),y(k,P,{value:null,writable:!0}),y(k,i,{value:null,writable:!0}),y(k,n,{value:null,writable:!0}),y(k,a,{value:f._readableState.endEmitted,writable:!0}),y(k,o,{value:function(D,E){var I=w[u].read();I?(w[l]=null,w[P]=null,w[i]=null,D(s(I,!1))):(w[P]=D,w[i]=E)},writable:!0}),k));return w[l]=null,z(f,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var E=w[i];E!==null&&(w[l]=null,w[P]=null,w[i]=null,E(D)),w[n]=D;return}var I=w[P];I!==null&&(w[l]=null,w[P]=null,w[i]=null,I(s(void 0,!0))),w[a]=!0}),f.on("readable",m.bind(null,w)),w};Y.exports=A}),pZ=Fe((te,Y)=>{Y.exports=function(){throw new Error("Readable.from is not available in the browser")}}),EP=Fe((te,Y)=>{Y.exports=g;var d;g.ReadableState=p,qg().EventEmitter;var y=function(oe,J){return oe.listeners(J).length},z=dP(),P=gb().Buffer,i=window.Uint8Array||function(){};function n(oe){return P.from(oe)}function a(oe){return P.isBuffer(oe)||oe instanceof i}var l=TP(),o;l&&l.debuglog?o=l.debuglog("stream"):o=function(){};var u=cZ(),s=SP(),h=CP(),m=h.getHighWaterMark,b=yb().codes,x=b.ERR_INVALID_ARG_TYPE,_=b.ERR_STREAM_PUSH_AFTER_EOF,A=b.ERR_METHOD_NOT_IMPLEMENTED,f=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k,w,D;iy()(g,z);var E=s.errorOrDestroy,I=["error","close","destroy","pause","resume"];function M(oe,J,me){if(typeof oe.prependListener=="function")return oe.prependListener(J,me);!oe._events||!oe._events[J]?oe.on(J,me):Array.isArray(oe._events[J])?oe._events[J].unshift(me):oe._events[J]=[me,oe._events[J]]}function p(oe,J,me){d=d||_b(),oe=oe||{},typeof me!="boolean"&&(me=J instanceof d),this.objectMode=!!oe.objectMode,me&&(this.objectMode=this.objectMode||!!oe.readableObjectMode),this.highWaterMark=m(this,oe,"readableHighWaterMark",me),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=oe.emitClose!==!1,this.autoDestroy=!!oe.autoDestroy,this.destroyed=!1,this.defaultEncoding=oe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,oe.encoding&&(k||(k=MP().StringDecoder),this.decoder=new k(oe.encoding),this.encoding=oe.encoding)}function g(oe){if(d=d||_b(),!(this instanceof g))return new g(oe);var J=this instanceof d;this._readableState=new p(oe,this,J),this.readable=!0,oe&&(typeof oe.read=="function"&&(this._read=oe.read),typeof oe.destroy=="function"&&(this._destroy=oe.destroy)),z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(oe){this._readableState&&(this._readableState.destroyed=oe)}}),g.prototype.destroy=s.destroy,g.prototype._undestroy=s.undestroy,g.prototype._destroy=function(oe,J){J(oe)},g.prototype.push=function(oe,J){var me=this._readableState,fe;return me.objectMode?fe=!0:typeof oe=="string"&&(J=J||me.defaultEncoding,J!==me.encoding&&(oe=P.from(oe,J),J=""),fe=!0),C(this,oe,J,!1,fe)},g.prototype.unshift=function(oe){return C(this,oe,null,!0,!1)};function C(oe,J,me,fe,Ce){o("readableAddChunk",J);var Be=oe._readableState;if(J===null)Be.reading=!1,W(oe,Be);else{var Oe;if(Ce||(Oe=N(Be,J)),Oe)E(oe,Oe);else if(Be.objectMode||J&&J.length>0)if(typeof J!="string"&&!Be.objectMode&&Object.getPrototypeOf(J)!==P.prototype&&(J=n(J)),fe)Be.endEmitted?E(oe,new f):T(oe,Be,J,!0);else if(Be.ended)E(oe,new _);else{if(Be.destroyed)return!1;Be.reading=!1,Be.decoder&&!me?(J=Be.decoder.write(J),Be.objectMode||J.length!==0?T(oe,Be,J,!1):q(oe,Be)):T(oe,Be,J,!1)}else fe||(Be.reading=!1,q(oe,Be))}return!Be.ended&&(Be.length=B?oe=B:(oe--,oe|=oe>>>1,oe|=oe>>>2,oe|=oe>>>4,oe|=oe>>>8,oe|=oe>>>16,oe++),oe}function V(oe,J){return oe<=0||J.length===0&&J.ended?0:J.objectMode?1:oe!==oe?J.flowing&&J.length?J.buffer.head.data.length:J.length:(oe>J.highWaterMark&&(J.highWaterMark=U(oe)),oe<=J.length?oe:J.ended?J.length:(J.needReadable=!0,0))}g.prototype.read=function(oe){o("read",oe),oe=parseInt(oe,10);var J=this._readableState,me=oe;if(oe!==0&&(J.emittedReadable=!1),oe===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return o("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?ne(this):F(this),null;if(oe=V(oe,J),oe===0&&J.ended)return J.length===0&&ne(this),null;var fe=J.needReadable;o("need readable",fe),(J.length===0||J.length-oe0?Ce=ge(oe,J):Ce=null,Ce===null?(J.needReadable=J.length<=J.highWaterMark,oe=0):(J.length-=oe,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),me!==oe&&J.ended&&ne(this)),Ce!==null&&this.emit("data",Ce),Ce};function W(oe,J){if(o("onEofChunk"),!J.ended){if(J.decoder){var me=J.decoder.end();me&&me.length&&(J.buffer.push(me),J.length+=J.objectMode?1:me.length)}J.ended=!0,J.sync?F(oe):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,$(oe)))}}function F(oe){var J=oe._readableState;o("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(o("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick($,oe))}function $(oe){var J=oe._readableState;o("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(oe.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,re(oe)}function q(oe,J){J.readingMore||(J.readingMore=!0,process.nextTick(G,oe,J))}function G(oe,J){for(;!J.reading&&!J.ended&&(J.length1&&_e(fe.pipes,oe)!==-1)&&!rt&&(o("false write response, pause",fe.awaitDrain),fe.awaitDrain++),me.pause())}function gt(Ee){o("onerror",Ee),ze(),oe.removeListener("error",gt),y(oe,"error")===0&&E(oe,Ee)}M(oe,"error",gt);function ct(){oe.removeListener("finish",Ae),ze()}oe.once("close",ct);function Ae(){o("onfinish"),oe.removeListener("close",ct),ze()}oe.once("finish",Ae);function ze(){o("unpipe"),me.unpipe(oe)}return oe.emit("pipe",me),fe.flowing||(o("pipe resume"),me.resume()),oe};function ee(oe){return function(){var J=oe._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&y(oe,"data")&&(J.flowing=!0,re(oe))}}g.prototype.unpipe=function(oe){var J=this._readableState,me={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return oe&&oe!==J.pipes?this:(oe||(oe=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,oe&&oe.emit("unpipe",this,me),this);if(!oe){var fe=J.pipes,Ce=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Be=0;Be0,fe.flowing!==!1&&this.resume()):oe==="readable"&&!fe.endEmitted&&!fe.readableListening&&(fe.readableListening=fe.needReadable=!0,fe.flowing=!1,fe.emittedReadable=!1,o("on readable",fe.length,fe.reading),fe.length?F(this):fe.reading||process.nextTick(xe,this)),me},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(oe,J){var me=z.prototype.removeListener.call(this,oe,J);return oe==="readable"&&process.nextTick(he,this),me},g.prototype.removeAllListeners=function(oe){var J=z.prototype.removeAllListeners.apply(this,arguments);return(oe==="readable"||oe===void 0)&&process.nextTick(he,this),J};function he(oe){var J=oe._readableState;J.readableListening=oe.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:oe.listenerCount("data")>0&&oe.resume()}function xe(oe){o("readable nexttick read 0"),oe.read(0)}g.prototype.resume=function(){var oe=this._readableState;return oe.flowing||(o("resume"),oe.flowing=!oe.readableListening,ve(this,oe)),oe.paused=!1,this};function ve(oe,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(ce,oe,J))}function ce(oe,J){o("resume",J.reading),J.reading||oe.read(0),J.resumeScheduled=!1,oe.emit("resume"),re(oe),J.flowing&&!J.reading&&oe.read(0)}g.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function re(oe){var J=oe._readableState;for(o("flow",J.flowing);J.flowing&&oe.read()!==null;);}g.prototype.wrap=function(oe){var J=this,me=this._readableState,fe=!1;oe.on("end",function(){if(o("wrapped end"),me.decoder&&!me.ended){var Oe=me.decoder.end();Oe&&Oe.length&&J.push(Oe)}J.push(null)}),oe.on("data",function(Oe){if(o("wrapped data"),me.decoder&&(Oe=me.decoder.write(Oe)),!(me.objectMode&&Oe==null)&&!(!me.objectMode&&(!Oe||!Oe.length))){var Ze=J.push(Oe);Ze||(fe=!0,oe.pause())}});for(var Ce in oe)this[Ce]===void 0&&typeof oe[Ce]=="function"&&(this[Ce]=function(Oe){return function(){return oe[Oe].apply(oe,arguments)}}(Ce));for(var Be=0;Be=J.length?(J.decoder?me=J.buffer.join(""):J.buffer.length===1?me=J.buffer.first():me=J.buffer.concat(J.length),J.buffer.clear()):me=J.buffer.consume(oe,J.decoder),me}function ne(oe){var J=oe._readableState;o("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(se,J,oe))}function se(oe,J){if(o("endReadableNT",oe.endEmitted,oe.length),!oe.endEmitted&&oe.length===0&&(oe.endEmitted=!0,J.readable=!1,J.emit("end"),oe.autoDestroy)){var me=J._writableState;(!me||me.autoDestroy&&me.finished)&&J.destroy()}}typeof Symbol=="function"&&(g.from=function(oe,J){return D===void 0&&(D=pZ()),D(g,oe,J)});function _e(oe,J){for(var me=0,fe=oe.length;me{Y.exports=l;var d=yb().codes,y=d.ERR_METHOD_NOT_IMPLEMENTED,z=d.ERR_MULTIPLE_CALLBACK,P=d.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=d.ERR_TRANSFORM_WITH_LENGTH_0,n=_b();iy()(l,n);function a(s,h){var m=this._transformState;m.transforming=!1;var b=m.writecb;if(b===null)return this.emit("error",new z);m.writechunk=null,m.writecb=null,h!=null&&this.push(h),b(s);var x=this._readableState;x.reading=!1,(x.needReadable||x.length{Y.exports=y;var d=LP();iy()(y,d);function y(z){if(!(this instanceof y))return new y(z);d.call(this,z)}y.prototype._transform=function(z,P,i){i(null,z)}}),gZ=Fe((te,Y)=>{var d;function y(m){var b=!1;return function(){b||(b=!0,m.apply(void 0,arguments))}}var z=yb().codes,P=z.ERR_MISSING_ARGS,i=z.ERR_STREAM_DESTROYED;function n(m){if(m)throw m}function a(m){return m.setHeader&&typeof m.abort=="function"}function l(m,b,x,_){_=y(_);var A=!1;m.on("close",function(){A=!0}),d===void 0&&(d=tC()),d(m,{readable:b,writable:x},function(k){if(k)return _(k);A=!0,_()});var f=!1;return function(k){if(!A&&!f){if(f=!0,a(m))return m.abort();if(typeof m.destroy=="function")return m.destroy();_(k||new i("pipe"))}}}function o(m){m()}function u(m,b){return m.pipe(b)}function s(m){return!m.length||typeof m[m.length-1]!="function"?n:m.pop()}function h(){for(var m=arguments.length,b=new Array(m),x=0;x0;return l(k,D,E,function(I){A||(A=I),I&&f.forEach(o),!D&&(f.forEach(o),_(A))})});return b.reduce(u)}Y.exports=h}),vZ=Fe((te,Y)=>{Y.exports=z;var d=qg().EventEmitter,y=iy();y(z,d),z.Readable=EP(),z.Writable=AP(),z.Duplex=_b(),z.Transform=LP(),z.PassThrough=mZ(),z.finished=tC(),z.pipeline=gZ(),z.Stream=z;function z(){d.call(this)}z.prototype.pipe=function(P,i){var n=this;function a(b){P.writable&&P.write(b)===!1&&n.pause&&n.pause()}n.on("data",a);function l(){n.readable&&n.resume&&n.resume()}P.on("drain",l),!P._isStdio&&(!i||i.end!==!1)&&(n.on("end",u),n.on("close",s));var o=!1;function u(){o||(o=!0,P.end())}function s(){o||(o=!0,typeof P.destroy=="function"&&P.destroy())}function h(b){if(m(),d.listenerCount(this,"error")===0)throw b}n.on("error",h),P.on("error",h);function m(){n.removeListener("data",a),P.removeListener("drain",l),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",h),P.removeListener("error",h),n.removeListener("end",m),n.removeListener("close",m),P.removeListener("close",m)}return n.on("end",m),n.on("close",m),P.on("close",m),P.emit("pipe",n),P}}),Ow=Fe(te=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var ee=Object.keys(G),he={},xe=0;xe=ve)return ne;switch(ne){case"%s":return String(xe[he++]);case"%d":return Number(xe[he++]);case"%j":try{return JSON.stringify(xe[he++])}catch{return"[Circular]"}default:return ne}}),re=xe[he];he"u")return function(){return te.deprecate(G,ee).apply(this,arguments)};var he=!1;function xe(){if(!he){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),he=!0}return G.apply(this,arguments)}return xe};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;te.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var ee=process.pid;y[G]=function(){var he=te.format.apply(te,arguments);console.error("%s %d: %s",G,ee,he)}}else y[G]=function(){};return y[G]};function i(G,ee){var he={seen:[],stylize:a};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),_(ee)?he.showHidden=ee:ee&&te._extend(he,ee),E(he.showHidden)&&(he.showHidden=!1),E(he.depth)&&(he.depth=2),E(he.colors)&&(he.colors=!1),E(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=n),o(he,G,he.depth)}te.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(G,ee){var he=i.styles[ee];return he?"\x1B["+i.colors[he][0]+"m"+G+"\x1B["+i.colors[he][1]+"m":G}function a(G,ee){return G}function l(G){var ee={};return G.forEach(function(he,xe){ee[he]=!0}),ee}function o(G,ee,he){if(G.customInspect&&ee&&C(ee.inspect)&&ee.inspect!==te.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var xe=ee.inspect(he,G);return w(xe)||(xe=o(G,xe,he)),xe}var ve=u(G,ee);if(ve)return ve;var ce=Object.keys(ee),re=l(ce);if(G.showHidden&&(ce=Object.getOwnPropertyNames(ee)),g(ee)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return s(ee);if(ce.length===0){if(C(ee)){var ge=ee.name?": "+ee.name:"";return G.stylize("[Function"+ge+"]","special")}if(I(ee))return G.stylize(RegExp.prototype.toString.call(ee),"regexp");if(p(ee))return G.stylize(Date.prototype.toString.call(ee),"date");if(g(ee))return s(ee)}var ne="",se=!1,_e=["{","}"];if(x(ee)&&(se=!0,_e=["[","]"]),C(ee)){var oe=ee.name?": "+ee.name:"";ne=" [Function"+oe+"]"}if(I(ee)&&(ne=" "+RegExp.prototype.toString.call(ee)),p(ee)&&(ne=" "+Date.prototype.toUTCString.call(ee)),g(ee)&&(ne=" "+s(ee)),ce.length===0&&(!se||ee.length==0))return _e[0]+ne+_e[1];if(he<0)return I(ee)?G.stylize(RegExp.prototype.toString.call(ee),"regexp"):G.stylize("[Object]","special");G.seen.push(ee);var J;return se?J=h(G,ee,he,re,ce):J=ce.map(function(me){return m(G,ee,he,re,me,se)}),G.seen.pop(),b(J,ne,_e)}function u(G,ee){if(E(ee))return G.stylize("undefined","undefined");if(w(ee)){var he="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(he,"string")}if(k(ee))return G.stylize(""+ee,"number");if(_(ee))return G.stylize(""+ee,"boolean");if(A(ee))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,ee,he,xe,ve){for(var ce=[],re=0,ge=ee.length;re"u"}te.isPrimitive=T,te.isBuffer=SP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,ee=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],ee].join(" ")}te.log=function(){console.log("%s - %s",V(),te.format.apply(te,arguments))},te.inherits=ay(),te._extend=function(G,ee){if(!ee||!M(ee))return G;for(var he=Object.keys(ee),be=he.length;be--;)G[he[be]]=ee[he[be]];return G};function W(G,ee){return Object.prototype.hasOwnProperty.call(G,ee)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;te.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var ee=G[F];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,F,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var he,be,ve=new Promise(function(ge,ne){he=ge,be=ne}),ce=[],re=0;re{function d(m,b){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(m);b&&(_=_.filter(function(A){return Object.getOwnPropertyDescriptor(m,A).enumerable})),x.push.apply(x,_)}return x}function y(m){for(var b=1;b0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(b){var x={data:b,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var x=this.head,_=""+x.data;x=x.next;)_+=b+x.data;return _}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var x=l.allocUnsafe(b>>>0),_=this.head,A=0;_;)h(_.data,x,A),A+=_.data.length,_=_.next;return x}},{key:"consume",value:function(b,x){var _;return bf.length?f.length:b;if(k===f.length?A+=f:A+=f.slice(0,b),b-=k,b===0){k===f.length?(++_,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=f.slice(k));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(b){var x=l.allocUnsafe(b),_=this.head,A=1;for(_.data.copy(x),b-=_.data.length;_=_.next;){var f=_.data,k=b>f.length?f.length:b;if(f.copy(x,x.length-b,0,k),b-=k,b===0){k===f.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=f.slice(k));break}++A}return this.length-=A,x}},{key:s,value:function(b,x){return u(this,y({},x,{depth:0,customInspect:!1}))}}]),m}()}),AP=ze((te,Y)=>{function d(a,l){var o=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,a)):process.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!l&&h?o._writableState?o._writableState.errorEmitted?process.nextTick(z,o):(o._writableState.errorEmitted=!0,process.nextTick(y,o,h)):process.nextTick(y,o,h):l?(process.nextTick(z,o),l(h)):process.nextTick(z,o)}),this)}function y(a,l){i(a,l),z(a)}function z(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function P(){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 i(a,l){a.emit("error",l)}function n(a,l){var o=a._readableState,u=a._writableState;o&&o.autoDestroy||u&&u.autoDestroy?a.destroy(l):a.emit("error",l)}Y.exports={destroy:d,undestroy:P,errorOrDestroy:n}}),_b=ze((te,Y)=>{function d(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.__proto__=o}var y={};function z(l,o,u){u||(u=Error);function s(m,b,x){return typeof o=="string"?o:o(m,b,x)}var h=function(m){d(b,m);function b(x,_,A){return m.call(this,s(x,_,A))||this}return b}(u);h.prototype.name=u.name,h.prototype.code=l,y[l]=h}function P(l,o){if(Array.isArray(l)){var u=l.length;return l=l.map(function(s){return String(s)}),u>2?"one of ".concat(o," ").concat(l.slice(0,u-1).join(", "),", or ")+l[u-1]:u===2?"one of ".concat(o," ").concat(l[0]," or ").concat(l[1]):"of ".concat(o," ").concat(l[0])}else return"of ".concat(o," ").concat(String(l))}function i(l,o,u){return l.substr(0,o.length)===o}function n(l,o,u){return(u===void 0||u>l.length)&&(u=l.length),l.substring(u-o.length,u)===o}function a(l,o,u){return typeof u!="number"&&(u=0),u+o.length>l.length?!1:l.indexOf(o,u)!==-1}z("ERR_INVALID_OPT_VALUE",function(l,o){return'The value "'+o+'" is invalid for option "'+l+'"'},TypeError),z("ERR_INVALID_ARG_TYPE",function(l,o,u){var s;typeof o=="string"&&i(o,"not ")?(s="must not be",o=o.replace(/^not /,"")):s="must be";var h;if(n(l," argument"))h="The ".concat(l," ").concat(s," ").concat(P(o,"type"));else{var m=a(l,".")?"property":"argument";h='The "'.concat(l,'" ').concat(m," ").concat(s," ").concat(P(o,"type"))}return h+=". Received type ".concat(typeof u),h},TypeError),z("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),z("ERR_METHOD_NOT_IMPLEMENTED",function(l){return"The "+l+" method is not implemented"}),z("ERR_STREAM_PREMATURE_CLOSE","Premature close"),z("ERR_STREAM_DESTROYED",function(l){return"Cannot call "+l+" after a stream was destroyed"}),z("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),z("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),z("ERR_STREAM_WRITE_AFTER_END","write after end"),z("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),z("ERR_UNKNOWN_ENCODING",function(l){return"Unknown encoding: "+l},TypeError),z("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Y.exports.codes=y}),MP=ze((te,Y)=>{var d=_b().codes.ERR_INVALID_OPT_VALUE;function y(P,i,n){return P.highWaterMark!=null?P.highWaterMark:i?P[n]:null}function z(P,i,n,a){var l=y(i,a,n);if(l!=null){if(!(isFinite(l)&&Math.floor(l)===l)||l<0){var o=a?n:"highWaterMark";throw new d(o,l)}return Math.floor(l)}return P.objectMode?16:16*1024}Y.exports={getHighWaterMark:z}}),pZ=ze((te,Y)=>{Y.exports=d;function d(z,P){if(y("noDeprecation"))return z;var i=!1;function n(){if(!i){if(y("throwDeprecation"))throw new Error(P);y("traceDeprecation")?console.trace(P):console.warn(P),i=!0}return z.apply(this,arguments)}return n}function y(z){try{if(!window.localStorage)return!1}catch{return!1}var P=window.localStorage[z];return P==null?!1:String(P).toLowerCase()==="true"}}),EP=ze((te,Y)=>{Y.exports=p;function d(re){var ge=this;this.next=null,this.entry=null,this.finish=function(){ce(ge,re)}}var y;p.WritableState=I;var z={deprecate:pZ()},P=mP(),i=vb().Buffer,n=window.Uint8Array||function(){};function a(re){return i.from(re)}function l(re){return i.isBuffer(re)||re instanceof n}var o=AP(),u=MP(),s=u.getHighWaterMark,h=_b().codes,m=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,x=h.ERR_MULTIPLE_CALLBACK,_=h.ERR_STREAM_CANNOT_PIPE,A=h.ERR_STREAM_DESTROYED,f=h.ERR_STREAM_NULL_VALUES,k=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,D=o.errorOrDestroy;ay()(p,P);function E(){}function I(re,ge,ne){y=y||xb(),re=re||{},typeof ne!="boolean"&&(ne=ge instanceof y),this.objectMode=!!re.objectMode,ne&&(this.objectMode=this.objectMode||!!re.writableObjectMode),this.highWaterMark=s(this,re,"writableHighWaterMark",ne),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var se=re.decodeStrings===!1;this.decodeStrings=!se,this.defaultEncoding=re.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(_e){W(ge,_e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=re.emitClose!==!1,this.autoDestroy=!!re.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}I.prototype.getBuffer=function(){for(var re=this.bufferedRequest,ge=[];re;)ge.push(re),re=re.next;return ge},function(){try{Object.defineProperty(I.prototype,"buffer",{get:z.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(re){return M.call(this,re)?!0:this!==p?!1:re&&re._writableState instanceof I}})):M=function(re){return re instanceof this};function p(re){y=y||xb();var ge=this instanceof y;if(!ge&&!M.call(p,this))return new p(re);this._writableState=new I(re,this,ge),this.writable=!0,re&&(typeof re.write=="function"&&(this._write=re.write),typeof re.writev=="function"&&(this._writev=re.writev),typeof re.destroy=="function"&&(this._destroy=re.destroy),typeof re.final=="function"&&(this._final=re.final)),P.call(this)}p.prototype.pipe=function(){D(this,new _)};function g(re,ge){var ne=new k;D(re,ne),process.nextTick(ge,ne)}function C(re,ge,ne,se){var _e;return ne===null?_e=new f:typeof ne!="string"&&!ge.objectMode&&(_e=new m("chunk",["string","Buffer"],ne)),_e?(D(re,_e),process.nextTick(se,_e),!1):!0}p.prototype.write=function(re,ge,ne){var se=this._writableState,_e=!1,oe=!se.objectMode&&l(re);return oe&&!i.isBuffer(re)&&(re=a(re)),typeof ge=="function"&&(ne=ge,ge=null),oe?ge="buffer":ge||(ge=se.defaultEncoding),typeof ne!="function"&&(ne=E),se.ending?g(this,ne):(oe||C(this,se,re,ne))&&(se.pendingcb++,_e=N(this,se,oe,re,ge,ne)),_e},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var re=this._writableState;re.corked&&(re.corked--,!re.writing&&!re.corked&&!re.bufferProcessing&&re.bufferedRequest&&q(this,re))},p.prototype.setDefaultEncoding=function(re){if(typeof re=="string"&&(re=re.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((re+"").toLowerCase())>-1))throw new w(re);return this._writableState.defaultEncoding=re,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function T(re,ge,ne){return!re.objectMode&&re.decodeStrings!==!1&&typeof ge=="string"&&(ge=i.from(ge,ne)),ge}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(re,ge,ne,se,_e,oe){if(!ne){var J=T(ge,se,_e);se!==J&&(ne=!0,_e="buffer",se=J)}var me=ge.objectMode?1:se.length;ge.length+=me;var fe=ge.length{var d=Object.keys||function(u){var s=[];for(var h in u)s.push(h);return s};Y.exports=a;var y=PP(),z=EP();for(ay()(a,y),P=d(z.prototype),n=0;n{var d=vb(),y=d.Buffer;function z(i,n){for(var a in i)n[a]=i[a]}y.from&&y.alloc&&y.allocUnsafe&&y.allocUnsafeSlow?Y.exports=d:(z(d,te),te.Buffer=P);function P(i,n,a){return y(i,n,a)}P.prototype=Object.create(y.prototype),z(y,P),P.from=function(i,n,a){if(typeof i=="number")throw new TypeError("Argument must not be a number");return y(i,n,a)},P.alloc=function(i,n,a){if(typeof i!="number")throw new TypeError("Argument must be a number");var l=y(i);return n!==void 0?typeof a=="string"?l.fill(n,a):l.fill(n):l.fill(0),l},P.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return y(i)},P.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return d.SlowBuffer(i)}}),LP=ze(te=>{var Y=mZ().Buffer,d=Y.isEncoding||function(A){switch(A=""+A,A&&A.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 y(A){if(!A)return"utf8";for(var f;;)switch(A){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 A;default:if(f)return;A=(""+A).toLowerCase(),f=!0}}function z(A){var f=y(A);if(typeof f!="string"&&(Y.isEncoding===d||!d(A)))throw new Error("Unknown encoding: "+A);return f||A}te.StringDecoder=P;function P(A){this.encoding=z(A);var f;switch(this.encoding){case"utf16le":this.text=s,this.end=h,f=4;break;case"utf8":this.fillLast=l,f=4;break;case"base64":this.text=m,this.end=b,f=3;break;default:this.write=x,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(f)}P.prototype.write=function(A){if(A.length===0)return"";var f,k;if(this.lastNeed){if(f=this.fillLast(A),f===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k>5===6?2:A>>4===14?3:A>>3===30?4:A>>6===2?-1:-2}function n(A,f,k){var w=f.length-1;if(w=0?(D>0&&(A.lastNeed=D-1),D):--w=0?(D>0&&(A.lastNeed=D-2),D):--w=0?(D>0&&(D===2?D=0:A.lastNeed=D-3),D):0))}function a(A,f,k){if((f[0]&192)!==128)return A.lastNeed=0,"�";if(A.lastNeed>1&&f.length>1){if((f[1]&192)!==128)return A.lastNeed=1,"�";if(A.lastNeed>2&&f.length>2&&(f[2]&192)!==128)return A.lastNeed=2,"�"}}function l(A){var f=this.lastTotal-this.lastNeed,k=a(this,A);if(k!==void 0)return k;if(this.lastNeed<=A.length)return A.copy(this.lastChar,f,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);A.copy(this.lastChar,f,0,A.length),this.lastNeed-=A.length}function o(A,f){var k=n(this,A,f);if(!this.lastNeed)return A.toString("utf8",f);this.lastTotal=k;var w=A.length-(k-this.lastNeed);return A.copy(this.lastChar,0,w),A.toString("utf8",f,w)}function u(A){var f=A&&A.length?this.write(A):"";return this.lastNeed?f+"�":f}function s(A,f){if((A.length-f)%2===0){var k=A.toString("utf16le",f);if(k){var w=k.charCodeAt(k.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=A[A.length-1],A.toString("utf16le",f,A.length-1)}function h(A){var f=A&&A.length?this.write(A):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return f+this.lastChar.toString("utf16le",0,k)}return f}function m(A,f){var k=(A.length-f)%3;return k===0?A.toString("base64",f):(this.lastNeed=3-k,this.lastTotal=3,k===1?this.lastChar[0]=A[A.length-1]:(this.lastChar[0]=A[A.length-2],this.lastChar[1]=A[A.length-1]),A.toString("base64",f,A.length-k))}function b(A){var f=A&&A.length?this.write(A):"";return this.lastNeed?f+this.lastChar.toString("base64",0,3-this.lastNeed):f}function x(A){return A.toString(this.encoding)}function _(A){return A&&A.length?this.write(A):""}}),iC=ze((te,Y)=>{var d=_b().codes.ERR_STREAM_PREMATURE_CLOSE;function y(n){var a=!1;return function(){if(!a){a=!0;for(var l=arguments.length,o=new Array(l),u=0;u{var d;function y(f,k,w){return k in f?Object.defineProperty(f,k,{value:w,enumerable:!0,configurable:!0,writable:!0}):f[k]=w,f}var z=iC(),P=Symbol("lastResolve"),i=Symbol("lastReject"),n=Symbol("error"),a=Symbol("ended"),l=Symbol("lastPromise"),o=Symbol("handlePromise"),u=Symbol("stream");function s(f,k){return{value:f,done:k}}function h(f){var k=f[P];if(k!==null){var w=f[u].read();w!==null&&(f[l]=null,f[P]=null,f[i]=null,k(s(w,!1)))}}function m(f){process.nextTick(h,f)}function b(f,k){return function(w,D){f.then(function(){if(k[a]){w(s(void 0,!0));return}k[o](w,D)},D)}}var x=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((d={get stream(){return this[u]},next:function(){var f=this,k=this[n];if(k!==null)return Promise.reject(k);if(this[a])return Promise.resolve(s(void 0,!0));if(this[u].destroyed)return new Promise(function(I,M){process.nextTick(function(){f[n]?M(f[n]):I(s(void 0,!0))})});var w=this[l],D;if(w)D=new Promise(b(w,this));else{var E=this[u].read();if(E!==null)return Promise.resolve(s(E,!1));D=new Promise(this[o])}return this[l]=D,D}},y(d,Symbol.asyncIterator,function(){return this}),y(d,"return",function(){var f=this;return new Promise(function(k,w){f[u].destroy(null,function(D){if(D){w(D);return}k(s(void 0,!0))})})}),d),x),A=function(f){var k,w=Object.create(_,(k={},y(k,u,{value:f,writable:!0}),y(k,P,{value:null,writable:!0}),y(k,i,{value:null,writable:!0}),y(k,n,{value:null,writable:!0}),y(k,a,{value:f._readableState.endEmitted,writable:!0}),y(k,o,{value:function(D,E){var I=w[u].read();I?(w[l]=null,w[P]=null,w[i]=null,D(s(I,!1))):(w[P]=D,w[i]=E)},writable:!0}),k));return w[l]=null,z(f,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var E=w[i];E!==null&&(w[l]=null,w[P]=null,w[i]=null,E(D)),w[n]=D;return}var I=w[P];I!==null&&(w[l]=null,w[P]=null,w[i]=null,I(s(void 0,!0))),w[a]=!0}),f.on("readable",m.bind(null,w)),w};Y.exports=A}),vZ=ze((te,Y)=>{Y.exports=function(){throw new Error("Readable.from is not available in the browser")}}),PP=ze((te,Y)=>{Y.exports=g;var d;g.ReadableState=p,qg().EventEmitter;var y=function(oe,J){return oe.listeners(J).length},z=mP(),P=vb().Buffer,i=window.Uint8Array||function(){};function n(oe){return P.from(oe)}function a(oe){return P.isBuffer(oe)||oe instanceof i}var l=CP(),o;l&&l.debuglog?o=l.debuglog("stream"):o=function(){};var u=dZ(),s=AP(),h=MP(),m=h.getHighWaterMark,b=_b().codes,x=b.ERR_INVALID_ARG_TYPE,_=b.ERR_STREAM_PUSH_AFTER_EOF,A=b.ERR_METHOD_NOT_IMPLEMENTED,f=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,k,w,D;ay()(g,z);var E=s.errorOrDestroy,I=["error","close","destroy","pause","resume"];function M(oe,J,me){if(typeof oe.prependListener=="function")return oe.prependListener(J,me);!oe._events||!oe._events[J]?oe.on(J,me):Array.isArray(oe._events[J])?oe._events[J].unshift(me):oe._events[J]=[me,oe._events[J]]}function p(oe,J,me){d=d||xb(),oe=oe||{},typeof me!="boolean"&&(me=J instanceof d),this.objectMode=!!oe.objectMode,me&&(this.objectMode=this.objectMode||!!oe.readableObjectMode),this.highWaterMark=m(this,oe,"readableHighWaterMark",me),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=oe.emitClose!==!1,this.autoDestroy=!!oe.autoDestroy,this.destroyed=!1,this.defaultEncoding=oe.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,oe.encoding&&(k||(k=LP().StringDecoder),this.decoder=new k(oe.encoding),this.encoding=oe.encoding)}function g(oe){if(d=d||xb(),!(this instanceof g))return new g(oe);var J=this instanceof d;this._readableState=new p(oe,this,J),this.readable=!0,oe&&(typeof oe.read=="function"&&(this._read=oe.read),typeof oe.destroy=="function"&&(this._destroy=oe.destroy)),z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(oe){this._readableState&&(this._readableState.destroyed=oe)}}),g.prototype.destroy=s.destroy,g.prototype._undestroy=s.undestroy,g.prototype._destroy=function(oe,J){J(oe)},g.prototype.push=function(oe,J){var me=this._readableState,fe;return me.objectMode?fe=!0:typeof oe=="string"&&(J=J||me.defaultEncoding,J!==me.encoding&&(oe=P.from(oe,J),J=""),fe=!0),C(this,oe,J,!1,fe)},g.prototype.unshift=function(oe){return C(this,oe,null,!0,!1)};function C(oe,J,me,fe,Ce){o("readableAddChunk",J);var Re=oe._readableState;if(J===null)Re.reading=!1,W(oe,Re);else{var Be;if(Ce||(Be=N(Re,J)),Be)E(oe,Be);else if(Re.objectMode||J&&J.length>0)if(typeof J!="string"&&!Re.objectMode&&Object.getPrototypeOf(J)!==P.prototype&&(J=n(J)),fe)Re.endEmitted?E(oe,new f):T(oe,Re,J,!0);else if(Re.ended)E(oe,new _);else{if(Re.destroyed)return!1;Re.reading=!1,Re.decoder&&!me?(J=Re.decoder.write(J),Re.objectMode||J.length!==0?T(oe,Re,J,!1):q(oe,Re)):T(oe,Re,J,!1)}else fe||(Re.reading=!1,q(oe,Re))}return!Re.ended&&(Re.length=B?oe=B:(oe--,oe|=oe>>>1,oe|=oe>>>2,oe|=oe>>>4,oe|=oe>>>8,oe|=oe>>>16,oe++),oe}function V(oe,J){return oe<=0||J.length===0&&J.ended?0:J.objectMode?1:oe!==oe?J.flowing&&J.length?J.buffer.head.data.length:J.length:(oe>J.highWaterMark&&(J.highWaterMark=U(oe)),oe<=J.length?oe:J.ended?J.length:(J.needReadable=!0,0))}g.prototype.read=function(oe){o("read",oe),oe=parseInt(oe,10);var J=this._readableState,me=oe;if(oe!==0&&(J.emittedReadable=!1),oe===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return o("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?ne(this):F(this),null;if(oe=V(oe,J),oe===0&&J.ended)return J.length===0&&ne(this),null;var fe=J.needReadable;o("need readable",fe),(J.length===0||J.length-oe0?Ce=ge(oe,J):Ce=null,Ce===null?(J.needReadable=J.length<=J.highWaterMark,oe=0):(J.length-=oe,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),me!==oe&&J.ended&&ne(this)),Ce!==null&&this.emit("data",Ce),Ce};function W(oe,J){if(o("onEofChunk"),!J.ended){if(J.decoder){var me=J.decoder.end();me&&me.length&&(J.buffer.push(me),J.length+=J.objectMode?1:me.length)}J.ended=!0,J.sync?F(oe):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,H(oe)))}}function F(oe){var J=oe._readableState;o("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(o("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick(H,oe))}function H(oe){var J=oe._readableState;o("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(oe.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,re(oe)}function q(oe,J){J.readingMore||(J.readingMore=!0,process.nextTick(G,oe,J))}function G(oe,J){for(;!J.reading&&!J.ended&&(J.length1&&_e(fe.pipes,oe)!==-1)&&!tt&&(o("false write response, pause",fe.awaitDrain),fe.awaitDrain++),me.pause())}function vt(Le){o("onerror",Le),Oe(),oe.removeListener("error",vt),y(oe,"error")===0&&E(oe,Le)}M(oe,"error",vt);function ct(){oe.removeListener("finish",Ae),Oe()}oe.once("close",ct);function Ae(){o("onfinish"),oe.removeListener("close",ct),Oe()}oe.once("finish",Ae);function Oe(){o("unpipe"),me.unpipe(oe)}return oe.emit("pipe",me),fe.flowing||(o("pipe resume"),me.resume()),oe};function ee(oe){return function(){var J=oe._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&y(oe,"data")&&(J.flowing=!0,re(oe))}}g.prototype.unpipe=function(oe){var J=this._readableState,me={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return oe&&oe!==J.pipes?this:(oe||(oe=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,oe&&oe.emit("unpipe",this,me),this);if(!oe){var fe=J.pipes,Ce=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Re=0;Re0,fe.flowing!==!1&&this.resume()):oe==="readable"&&!fe.endEmitted&&!fe.readableListening&&(fe.readableListening=fe.needReadable=!0,fe.flowing=!1,fe.emittedReadable=!1,o("on readable",fe.length,fe.reading),fe.length?F(this):fe.reading||process.nextTick(be,this)),me},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(oe,J){var me=z.prototype.removeListener.call(this,oe,J);return oe==="readable"&&process.nextTick(he,this),me},g.prototype.removeAllListeners=function(oe){var J=z.prototype.removeAllListeners.apply(this,arguments);return(oe==="readable"||oe===void 0)&&process.nextTick(he,this),J};function he(oe){var J=oe._readableState;J.readableListening=oe.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:oe.listenerCount("data")>0&&oe.resume()}function be(oe){o("readable nexttick read 0"),oe.read(0)}g.prototype.resume=function(){var oe=this._readableState;return oe.flowing||(o("resume"),oe.flowing=!oe.readableListening,ve(this,oe)),oe.paused=!1,this};function ve(oe,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(ce,oe,J))}function ce(oe,J){o("resume",J.reading),J.reading||oe.read(0),J.resumeScheduled=!1,oe.emit("resume"),re(oe),J.flowing&&!J.reading&&oe.read(0)}g.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function re(oe){var J=oe._readableState;for(o("flow",J.flowing);J.flowing&&oe.read()!==null;);}g.prototype.wrap=function(oe){var J=this,me=this._readableState,fe=!1;oe.on("end",function(){if(o("wrapped end"),me.decoder&&!me.ended){var Be=me.decoder.end();Be&&Be.length&&J.push(Be)}J.push(null)}),oe.on("data",function(Be){if(o("wrapped data"),me.decoder&&(Be=me.decoder.write(Be)),!(me.objectMode&&Be==null)&&!(!me.objectMode&&(!Be||!Be.length))){var Ze=J.push(Be);Ze||(fe=!0,oe.pause())}});for(var Ce in oe)this[Ce]===void 0&&typeof oe[Ce]=="function"&&(this[Ce]=function(Be){return function(){return oe[Be].apply(oe,arguments)}}(Ce));for(var Re=0;Re=J.length?(J.decoder?me=J.buffer.join(""):J.buffer.length===1?me=J.buffer.first():me=J.buffer.concat(J.length),J.buffer.clear()):me=J.buffer.consume(oe,J.decoder),me}function ne(oe){var J=oe._readableState;o("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(se,J,oe))}function se(oe,J){if(o("endReadableNT",oe.endEmitted,oe.length),!oe.endEmitted&&oe.length===0&&(oe.endEmitted=!0,J.readable=!1,J.emit("end"),oe.autoDestroy)){var me=J._writableState;(!me||me.autoDestroy&&me.finished)&&J.destroy()}}typeof Symbol=="function"&&(g.from=function(oe,J){return D===void 0&&(D=vZ()),D(g,oe,J)});function _e(oe,J){for(var me=0,fe=oe.length;me{Y.exports=l;var d=_b().codes,y=d.ERR_METHOD_NOT_IMPLEMENTED,z=d.ERR_MULTIPLE_CALLBACK,P=d.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=d.ERR_TRANSFORM_WITH_LENGTH_0,n=xb();ay()(l,n);function a(s,h){var m=this._transformState;m.transforming=!1;var b=m.writecb;if(b===null)return this.emit("error",new z);m.writechunk=null,m.writecb=null,h!=null&&this.push(h),b(s);var x=this._readableState;x.reading=!1,(x.needReadable||x.length{Y.exports=y;var d=IP();ay()(y,d);function y(z){if(!(this instanceof y))return new y(z);d.call(this,z)}y.prototype._transform=function(z,P,i){i(null,z)}}),_Z=ze((te,Y)=>{var d;function y(m){var b=!1;return function(){b||(b=!0,m.apply(void 0,arguments))}}var z=_b().codes,P=z.ERR_MISSING_ARGS,i=z.ERR_STREAM_DESTROYED;function n(m){if(m)throw m}function a(m){return m.setHeader&&typeof m.abort=="function"}function l(m,b,x,_){_=y(_);var A=!1;m.on("close",function(){A=!0}),d===void 0&&(d=iC()),d(m,{readable:b,writable:x},function(k){if(k)return _(k);A=!0,_()});var f=!1;return function(k){if(!A&&!f){if(f=!0,a(m))return m.abort();if(typeof m.destroy=="function")return m.destroy();_(k||new i("pipe"))}}}function o(m){m()}function u(m,b){return m.pipe(b)}function s(m){return!m.length||typeof m[m.length-1]!="function"?n:m.pop()}function h(){for(var m=arguments.length,b=new Array(m),x=0;x0;return l(k,D,E,function(I){A||(A=I),I&&f.forEach(o),!D&&(f.forEach(o),_(A))})});return b.reduce(u)}Y.exports=h}),xZ=ze((te,Y)=>{Y.exports=z;var d=qg().EventEmitter,y=ay();y(z,d),z.Readable=PP(),z.Writable=EP(),z.Duplex=xb(),z.Transform=IP(),z.PassThrough=yZ(),z.finished=iC(),z.pipeline=_Z(),z.Stream=z;function z(){d.call(this)}z.prototype.pipe=function(P,i){var n=this;function a(b){P.writable&&P.write(b)===!1&&n.pause&&n.pause()}n.on("data",a);function l(){n.readable&&n.resume&&n.resume()}P.on("drain",l),!P._isStdio&&(!i||i.end!==!1)&&(n.on("end",u),n.on("close",s));var o=!1;function u(){o||(o=!0,P.end())}function s(){o||(o=!0,typeof P.destroy=="function"&&P.destroy())}function h(b){if(m(),d.listenerCount(this,"error")===0)throw b}n.on("error",h),P.on("error",h);function m(){n.removeListener("data",a),P.removeListener("drain",l),n.removeListener("end",u),n.removeListener("close",s),n.removeListener("error",h),P.removeListener("error",h),n.removeListener("end",m),n.removeListener("close",m),P.removeListener("close",m)}return n.on("end",m),n.on("close",m),P.on("close",m),P.emit("pipe",n),P}}),Rw=ze(te=>{var Y=Object.getOwnPropertyDescriptors||function(G){for(var ee=Object.keys(G),he={},be=0;be=ve)return ne;switch(ne){case"%s":return String(be[he++]);case"%d":return Number(be[he++]);case"%j":try{return JSON.stringify(be[he++])}catch{return"[Circular]"}default:return ne}}),re=be[he];he"u")return function(){return te.deprecate(G,ee).apply(this,arguments)};var he=!1;function be(){if(!he){if(process.throwDeprecation)throw new Error(ee);process.traceDeprecation?console.trace(ee):console.error(ee),he=!0}return G.apply(this,arguments)}return be};var y={},z=/^$/;P="false",P=P.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),z=new RegExp("^"+P+"$","i");var P;te.debuglog=function(G){if(G=G.toUpperCase(),!y[G])if(z.test(G)){var ee=process.pid;y[G]=function(){var he=te.format.apply(te,arguments);console.error("%s %d: %s",G,ee,he)}}else y[G]=function(){};return y[G]};function i(G,ee){var he={seen:[],stylize:a};return arguments.length>=3&&(he.depth=arguments[2]),arguments.length>=4&&(he.colors=arguments[3]),_(ee)?he.showHidden=ee:ee&&te._extend(he,ee),E(he.showHidden)&&(he.showHidden=!1),E(he.depth)&&(he.depth=2),E(he.colors)&&(he.colors=!1),E(he.customInspect)&&(he.customInspect=!0),he.colors&&(he.stylize=n),o(he,G,he.depth)}te.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function n(G,ee){var he=i.styles[ee];return he?"\x1B["+i.colors[he][0]+"m"+G+"\x1B["+i.colors[he][1]+"m":G}function a(G,ee){return G}function l(G){var ee={};return G.forEach(function(he,be){ee[he]=!0}),ee}function o(G,ee,he){if(G.customInspect&&ee&&C(ee.inspect)&&ee.inspect!==te.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var be=ee.inspect(he,G);return w(be)||(be=o(G,be,he)),be}var ve=u(G,ee);if(ve)return ve;var ce=Object.keys(ee),re=l(ce);if(G.showHidden&&(ce=Object.getOwnPropertyNames(ee)),g(ee)&&(ce.indexOf("message")>=0||ce.indexOf("description")>=0))return s(ee);if(ce.length===0){if(C(ee)){var ge=ee.name?": "+ee.name:"";return G.stylize("[Function"+ge+"]","special")}if(I(ee))return G.stylize(RegExp.prototype.toString.call(ee),"regexp");if(p(ee))return G.stylize(Date.prototype.toString.call(ee),"date");if(g(ee))return s(ee)}var ne="",se=!1,_e=["{","}"];if(x(ee)&&(se=!0,_e=["[","]"]),C(ee)){var oe=ee.name?": "+ee.name:"";ne=" [Function"+oe+"]"}if(I(ee)&&(ne=" "+RegExp.prototype.toString.call(ee)),p(ee)&&(ne=" "+Date.prototype.toUTCString.call(ee)),g(ee)&&(ne=" "+s(ee)),ce.length===0&&(!se||ee.length==0))return _e[0]+ne+_e[1];if(he<0)return I(ee)?G.stylize(RegExp.prototype.toString.call(ee),"regexp"):G.stylize("[Object]","special");G.seen.push(ee);var J;return se?J=h(G,ee,he,re,ce):J=ce.map(function(me){return m(G,ee,he,re,me,se)}),G.seen.pop(),b(J,ne,_e)}function u(G,ee){if(E(ee))return G.stylize("undefined","undefined");if(w(ee)){var he="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return G.stylize(he,"string")}if(k(ee))return G.stylize(""+ee,"number");if(_(ee))return G.stylize(""+ee,"boolean");if(A(ee))return G.stylize("null","null")}function s(G){return"["+Error.prototype.toString.call(G)+"]"}function h(G,ee,he,be,ve){for(var ce=[],re=0,ge=ee.length;re-1&&(ce?ge=ge.split(` `).map(function(se){return" "+se}).join(` `).slice(2):ge=` `+ge.split(` `).map(function(se){return" "+se}).join(` -`))):ge=G.stylize("[Circular]","special")),E(re)){if(ce&&ve.match(/^\d+$/))return ge;re=JSON.stringify(""+ve),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.slice(1,-1),re=G.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=G.stylize(re,"string"))}return re+": "+ge}function b(G,ee,he){var xe=0,ve=G.reduce(function(ce,re){return xe++,re.indexOf(` -`)>=0&&xe++,ce+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ve>60?he[0]+(ee===""?"":ee+` +`))):ge=G.stylize("[Circular]","special")),E(re)){if(ce&&ve.match(/^\d+$/))return ge;re=JSON.stringify(""+ve),re.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(re=re.slice(1,-1),re=G.stylize(re,"name")):(re=re.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),re=G.stylize(re,"string"))}return re+": "+ge}function b(G,ee,he){var be=0,ve=G.reduce(function(ce,re){return be++,re.indexOf(` +`)>=0&&be++,ce+re.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ve>60?he[0]+(ee===""?"":ee+` `)+" "+G.join(`, - `)+" "+he[1]:he[0]+ee+" "+G.join(", ")+" "+he[1]}te.types=wP();function x(G){return Array.isArray(G)}te.isArray=x;function _(G){return typeof G=="boolean"}te.isBoolean=_;function A(G){return G===null}te.isNull=A;function f(G){return G==null}te.isNullOrUndefined=f;function k(G){return typeof G=="number"}te.isNumber=k;function w(G){return typeof G=="string"}te.isString=w;function D(G){return typeof G=="symbol"}te.isSymbol=D;function E(G){return G===void 0}te.isUndefined=E;function I(G){return M(G)&&N(G)==="[object RegExp]"}te.isRegExp=I,te.types.isRegExp=I;function M(G){return typeof G=="object"&&G!==null}te.isObject=M;function p(G){return M(G)&&N(G)==="[object Date]"}te.isDate=p,te.types.isDate=p;function g(G){return M(G)&&(N(G)==="[object Error]"||G instanceof Error)}te.isError=g,te.types.isNativeError=g;function C(G){return typeof G=="function"}te.isFunction=C;function T(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}te.isPrimitive=T,te.isBuffer=kP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,ee=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],ee].join(" ")}te.log=function(){console.log("%s - %s",V(),te.format.apply(te,arguments))},te.inherits=iy(),te._extend=function(G,ee){if(!ee||!M(ee))return G;for(var he=Object.keys(ee),xe=he.length;xe--;)G[he[xe]]=ee[he[xe]];return G};function W(G,ee){return Object.prototype.hasOwnProperty.call(G,ee)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;te.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var ee=G[F];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,F,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var he,xe,ve=new Promise(function(ge,ne){he=ge,xe=ne}),ce=[],re=0;re{function d(k){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(k)}function y(k,w,D){return Object.defineProperty(k,"prototype",{writable:!1}),k}function z(k,w){if(!(k instanceof w))throw new TypeError("Cannot call a class as a function")}function P(k,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(w&&w.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),w&&i(k,w)}function i(k,w){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,E){return D.__proto__=E,D},i(k,w)}function n(k){var w=o();return function(){var D=u(k),E;if(w){var I=u(this).constructor;E=Reflect.construct(D,arguments,I)}else E=D.apply(this,arguments);return a(this,E)}}function a(k,w){if(w&&(d(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(k)}function l(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function o(){if(typeof Reflect>"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}}function u(k){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)},u(k)}var s={},h,m;function b(k,w,D){D||(D=Error);function E(M,p,g){return typeof w=="string"?w:w(M,p,g)}var I=function(M){P(g,M);var p=n(g);function g(C,T,N){var B;return z(this,g),B=p.call(this,E(C,T,N)),B.code=k,B}return y(g)}(D);s[k]=I}function x(k,w){if(Array.isArray(k)){var D=k.length;return k=k.map(function(E){return String(E)}),D>2?"one of ".concat(w," ").concat(k.slice(0,D-1).join(", "),", or ")+k[D-1]:D===2?"one of ".concat(w," ").concat(k[0]," or ").concat(k[1]):"of ".concat(w," ").concat(k[0])}else return"of ".concat(w," ").concat(String(k))}function _(k,w,D){return k.substr(0,w.length)===w}function A(k,w,D){return(D===void 0||D>k.length)&&(D=k.length),k.substring(D-w.length,D)===w}function f(k,w,D){return typeof D!="number"&&(D=0),D+w.length>k.length?!1:k.indexOf(w,D)!==-1}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",function(k,w,D){h===void 0&&(h=t6()),h(typeof k=="string","'name' must be a string");var E;typeof w=="string"&&_(w,"not ")?(E="must not be",w=w.replace(/^not /,"")):E="must be";var I;if(A(k," argument"))I="The ".concat(k," ").concat(E," ").concat(x(w,"type"));else{var M=f(k,".")?"property":"argument";I='The "'.concat(k,'" ').concat(M," ").concat(E," ").concat(x(w,"type"))}return I+=". Received type ".concat(d(D)),I},TypeError),b("ERR_INVALID_ARG_VALUE",function(k,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";m===void 0&&(m=Ow());var E=m.inspect(w);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(k,"' ").concat(D,". Received ").concat(E)},TypeError),b("ERR_INVALID_RETURN_VALUE",function(k,w,D){var E;return D&&D.constructor&&D.constructor.name?E="instance of ".concat(D.constructor.name):E="type ".concat(d(D)),"Expected ".concat(k,' to be returned from the "').concat(w,'"')+" function but got ".concat(E,".")},TypeError),b("ERR_MISSING_ARGS",function(){for(var k=arguments.length,w=new Array(k),D=0;D0,"At least one arg needs to be specified");var E="The ",I=w.length;switch(w=w.map(function(M){return'"'.concat(M,'"')}),I){case 1:E+="".concat(w[0]," argument");break;case 2:E+="".concat(w[0]," and ").concat(w[1]," arguments");break;default:E+=w.slice(0,I-1).join(", "),E+=", and ".concat(w[I-1]," arguments");break}return"".concat(E," must be specified")},TypeError),Y.exports.codes=s}),yZ=Fe((te,Y)=>{function d(q,G){var ee=Object.keys(q);if(Object.getOwnPropertySymbols){var he=Object.getOwnPropertySymbols(q);G&&(he=he.filter(function(xe){return Object.getOwnPropertyDescriptor(q,xe).enumerable})),ee.push.apply(ee,he)}return ee}function y(q){for(var G=1;G"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}}function _(q){return Function.toString.call(q).indexOf("[native code]")!==-1}function A(q,G){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ee,he){return ee.__proto__=he,ee},A(q,G)}function f(q){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},f(q)}function k(q){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},k(q)}var w=Ow(),D=w.inspect,E=PP(),I=E.codes.ERR_INVALID_ARG_TYPE;function M(q,G,ee){return(ee===void 0||ee>q.length)&&(ee=q.length),q.substring(ee-G.length,ee)===G}function p(q,G){if(G=Math.floor(G),q.length==0||G==0)return"";var ee=q.length*G;for(G=Math.floor(Math.log(G)/Math.log(2));G;)q+=q,G--;return q+=q.substring(0,ee-q.length),q}var g="",C="",T="",N="",B={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},U=10;function V(q){var G=Object.keys(q),ee=Object.create(Object.getPrototypeOf(q));return G.forEach(function(he){ee[he]=q[he]}),Object.defineProperty(ee,"message",{value:q.message}),ee}function W(q){return D(q,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function F(q,G,ee){var he="",xe="",ve=0,ce="",re=!1,ge=W(q),ne=ge.split(` + `)+" "+he[1]:he[0]+ee+" "+G.join(", ")+" "+he[1]}te.types=TP();function x(G){return Array.isArray(G)}te.isArray=x;function _(G){return typeof G=="boolean"}te.isBoolean=_;function A(G){return G===null}te.isNull=A;function f(G){return G==null}te.isNullOrUndefined=f;function k(G){return typeof G=="number"}te.isNumber=k;function w(G){return typeof G=="string"}te.isString=w;function D(G){return typeof G=="symbol"}te.isSymbol=D;function E(G){return G===void 0}te.isUndefined=E;function I(G){return M(G)&&N(G)==="[object RegExp]"}te.isRegExp=I,te.types.isRegExp=I;function M(G){return typeof G=="object"&&G!==null}te.isObject=M;function p(G){return M(G)&&N(G)==="[object Date]"}te.isDate=p,te.types.isDate=p;function g(G){return M(G)&&(N(G)==="[object Error]"||G instanceof Error)}te.isError=g,te.types.isNativeError=g;function C(G){return typeof G=="function"}te.isFunction=C;function T(G){return G===null||typeof G=="boolean"||typeof G=="number"||typeof G=="string"||typeof G=="symbol"||typeof G>"u"}te.isPrimitive=T,te.isBuffer=SP();function N(G){return Object.prototype.toString.call(G)}function B(G){return G<10?"0"+G.toString(10):G.toString(10)}var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(){var G=new Date,ee=[B(G.getHours()),B(G.getMinutes()),B(G.getSeconds())].join(":");return[G.getDate(),U[G.getMonth()],ee].join(" ")}te.log=function(){console.log("%s - %s",V(),te.format.apply(te,arguments))},te.inherits=ay(),te._extend=function(G,ee){if(!ee||!M(ee))return G;for(var he=Object.keys(ee),be=he.length;be--;)G[he[be]]=ee[he[be]];return G};function W(G,ee){return Object.prototype.hasOwnProperty.call(G,ee)}var F=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;te.promisify=function(G){if(typeof G!="function")throw new TypeError('The "original" argument must be of type Function');if(F&&G[F]){var ee=G[F];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,F,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var he,be,ve=new Promise(function(ge,ne){he=ge,be=ne}),ce=[],re=0;re{function d(k){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(k)}function y(k,w,D){return Object.defineProperty(k,"prototype",{writable:!1}),k}function z(k,w){if(!(k instanceof w))throw new TypeError("Cannot call a class as a function")}function P(k,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(w&&w.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),w&&i(k,w)}function i(k,w){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,E){return D.__proto__=E,D},i(k,w)}function n(k){var w=o();return function(){var D=u(k),E;if(w){var I=u(this).constructor;E=Reflect.construct(D,arguments,I)}else E=D.apply(this,arguments);return a(this,E)}}function a(k,w){if(w&&(d(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(k)}function l(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function o(){if(typeof Reflect>"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}}function u(k){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(w){return w.__proto__||Object.getPrototypeOf(w)},u(k)}var s={},h,m;function b(k,w,D){D||(D=Error);function E(M,p,g){return typeof w=="string"?w:w(M,p,g)}var I=function(M){P(g,M);var p=n(g);function g(C,T,N){var B;return z(this,g),B=p.call(this,E(C,T,N)),B.code=k,B}return y(g)}(D);s[k]=I}function x(k,w){if(Array.isArray(k)){var D=k.length;return k=k.map(function(E){return String(E)}),D>2?"one of ".concat(w," ").concat(k.slice(0,D-1).join(", "),", or ")+k[D-1]:D===2?"one of ".concat(w," ").concat(k[0]," or ").concat(k[1]):"of ".concat(w," ").concat(k[0])}else return"of ".concat(w," ").concat(String(k))}function _(k,w,D){return k.substr(0,w.length)===w}function A(k,w,D){return(D===void 0||D>k.length)&&(D=k.length),k.substring(D-w.length,D)===w}function f(k,w,D){return typeof D!="number"&&(D=0),D+w.length>k.length?!1:k.indexOf(w,D)!==-1}b("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),b("ERR_INVALID_ARG_TYPE",function(k,w,D){h===void 0&&(h=i6()),h(typeof k=="string","'name' must be a string");var E;typeof w=="string"&&_(w,"not ")?(E="must not be",w=w.replace(/^not /,"")):E="must be";var I;if(A(k," argument"))I="The ".concat(k," ").concat(E," ").concat(x(w,"type"));else{var M=f(k,".")?"property":"argument";I='The "'.concat(k,'" ').concat(M," ").concat(E," ").concat(x(w,"type"))}return I+=". Received type ".concat(d(D)),I},TypeError),b("ERR_INVALID_ARG_VALUE",function(k,w){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";m===void 0&&(m=Rw());var E=m.inspect(w);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(k,"' ").concat(D,". Received ").concat(E)},TypeError),b("ERR_INVALID_RETURN_VALUE",function(k,w,D){var E;return D&&D.constructor&&D.constructor.name?E="instance of ".concat(D.constructor.name):E="type ".concat(d(D)),"Expected ".concat(k,' to be returned from the "').concat(w,'"')+" function but got ".concat(E,".")},TypeError),b("ERR_MISSING_ARGS",function(){for(var k=arguments.length,w=new Array(k),D=0;D0,"At least one arg needs to be specified");var E="The ",I=w.length;switch(w=w.map(function(M){return'"'.concat(M,'"')}),I){case 1:E+="".concat(w[0]," argument");break;case 2:E+="".concat(w[0]," and ").concat(w[1]," arguments");break;default:E+=w.slice(0,I-1).join(", "),E+=", and ".concat(w[I-1]," arguments");break}return"".concat(E," must be specified")},TypeError),Y.exports.codes=s}),bZ=ze((te,Y)=>{function d(q,G){var ee=Object.keys(q);if(Object.getOwnPropertySymbols){var he=Object.getOwnPropertySymbols(q);G&&(he=he.filter(function(be){return Object.getOwnPropertyDescriptor(q,be).enumerable})),ee.push.apply(ee,he)}return ee}function y(q){for(var G=1;G"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}}function _(q){return Function.toString.call(q).indexOf("[native code]")!==-1}function A(q,G){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ee,he){return ee.__proto__=he,ee},A(q,G)}function f(q){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(G){return G.__proto__||Object.getPrototypeOf(G)},f(q)}function k(q){"@babel/helpers - typeof";return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},k(q)}var w=Rw(),D=w.inspect,E=DP(),I=E.codes.ERR_INVALID_ARG_TYPE;function M(q,G,ee){return(ee===void 0||ee>q.length)&&(ee=q.length),q.substring(ee-G.length,ee)===G}function p(q,G){if(G=Math.floor(G),q.length==0||G==0)return"";var ee=q.length*G;for(G=Math.floor(Math.log(G)/Math.log(2));G;)q+=q,G--;return q+=q.substring(0,ee-q.length),q}var g="",C="",T="",N="",B={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},U=10;function V(q){var G=Object.keys(q),ee=Object.create(Object.getPrototypeOf(q));return G.forEach(function(he){ee[he]=q[he]}),Object.defineProperty(ee,"message",{value:q.message}),ee}function W(q){return D(q,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function F(q,G,ee){var he="",be="",ve=0,ce="",re=!1,ge=W(q),ne=ge.split(` `),se=W(G).split(` `),_e=0,oe="";if(ee==="strictEqual"&&k(q)==="object"&&k(G)==="object"&&q!==null&&G!==null&&(ee="strictEqualObject"),ne.length===1&&se.length===1&&ne[0]!==se[0]){var J=ne[0].length+se[0].length;if(J<=U){if((k(q)!=="object"||q===null)&&(k(G)!=="object"||G===null)&&(q!==0||G!==0))return"".concat(B[ee],` `)+"".concat(ne[0]," !== ").concat(se[0],` `)}else if(ee!=="strictEqualObject"){var me=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(J2&&(oe=` `.concat(p(" ",_e),"^"),_e=0)}}}for(var fe=ne[ne.length-1],Ce=se[se.length-1];fe===Ce&&(_e++<2?ce=` - `.concat(fe).concat(ce):he=fe,ne.pop(),se.pop(),!(ne.length===0||se.length===0));)fe=ne[ne.length-1],Ce=se[se.length-1];var Be=Math.max(ne.length,se.length);if(Be===0){var Oe=ge.split(` -`);if(Oe.length>30)for(Oe[26]="".concat(g,"...").concat(N);Oe.length>27;)Oe.pop();return"".concat(B.notIdentical,` + `.concat(fe).concat(ce):he=fe,ne.pop(),se.pop(),!(ne.length===0||se.length===0));)fe=ne[ne.length-1],Ce=se[se.length-1];var Re=Math.max(ne.length,se.length);if(Re===0){var Be=ge.split(` +`);if(Be.length>30)for(Be[26]="".concat(g,"...").concat(N);Be.length>27;)Be.pop();return"".concat(B.notIdentical,` -`).concat(Oe.join(` +`).concat(Be.join(` `),` `)}_e>3&&(ce=` `.concat(g,"...").concat(N).concat(ce),re=!0),he!==""&&(ce=` `.concat(he).concat(ce),he="");var Ze=0,Ge=B[ee]+` -`.concat(C,"+ actual").concat(N," ").concat(T,"- expected").concat(N),rt=" ".concat(g,"...").concat(N," Lines skipped");for(_e=0;_e1&&_e>2&&(_t>4?(xe+=` -`.concat(g,"...").concat(N),re=!0):_t>3&&(xe+=` - `.concat(se[_e-2]),Ze++),xe+=` +`.concat(C,"+ actual").concat(N," ").concat(T,"- expected").concat(N),tt=" ".concat(g,"...").concat(N," Lines skipped");for(_e=0;_e1&&_e>2&&(_t>4?(be+=` +`.concat(g,"...").concat(N),re=!0):_t>3&&(be+=` + `.concat(se[_e-2]),Ze++),be+=` `.concat(se[_e-1]),Ze++),ve=_e,he+=` -`.concat(T,"-").concat(N," ").concat(se[_e]),Ze++;else if(se.length<_e+1)_t>1&&_e>2&&(_t>4?(xe+=` -`.concat(g,"...").concat(N),re=!0):_t>3&&(xe+=` - `.concat(ne[_e-2]),Ze++),xe+=` - `.concat(ne[_e-1]),Ze++),ve=_e,xe+=` -`.concat(C,"+").concat(N," ").concat(ne[_e]),Ze++;else{var pt=se[_e],gt=ne[_e],ct=gt!==pt&&(!M(gt,",")||gt.slice(0,-1)!==pt);ct&&M(pt,",")&&pt.slice(0,-1)===gt&&(ct=!1,gt+=","),ct?(_t>1&&_e>2&&(_t>4?(xe+=` -`.concat(g,"...").concat(N),re=!0):_t>3&&(xe+=` - `.concat(ne[_e-2]),Ze++),xe+=` - `.concat(ne[_e-1]),Ze++),ve=_e,xe+=` -`.concat(C,"+").concat(N," ").concat(gt),he+=` -`.concat(T,"-").concat(N," ").concat(pt),Ze+=2):(xe+=he,he="",(_t===1||_e===0)&&(xe+=` - `.concat(gt),Ze++))}if(Ze>20&&_e1&&_e>2&&(_t>4?(be+=` +`.concat(g,"...").concat(N),re=!0):_t>3&&(be+=` + `.concat(ne[_e-2]),Ze++),be+=` + `.concat(ne[_e-1]),Ze++),ve=_e,be+=` +`.concat(C,"+").concat(N," ").concat(ne[_e]),Ze++;else{var mt=se[_e],vt=ne[_e],ct=vt!==mt&&(!M(vt,",")||vt.slice(0,-1)!==mt);ct&&M(mt,",")&&mt.slice(0,-1)===vt&&(ct=!1,vt+=","),ct?(_t>1&&_e>2&&(_t>4?(be+=` +`.concat(g,"...").concat(N),re=!0):_t>3&&(be+=` + `.concat(ne[_e-2]),Ze++),be+=` + `.concat(ne[_e-1]),Ze++),ve=_e,be+=` +`.concat(C,"+").concat(N," ").concat(vt),he+=` +`.concat(T,"-").concat(N," ").concat(mt),Ze+=2):(be+=he,he="",(_t===1||_e===0)&&(be+=` + `.concat(vt),Ze++))}if(Ze>20&&_e30)for(J[26]="".concat(g,"...").concat(N);J.length>27;)J.pop();J.length===1?ve=ee.call(this,"".concat(oe," ").concat(J[0])):ve=ee.call(this,"".concat(oe,` `).concat(J.join(` @@ -202,8 +202,8 @@ function kie(t,e){for(var r=0;r{var d=Object.prototype.toString;Y.exports=function(y){var z=d.call(y),P=z==="[object Arguments]";return P||(P=z!=="[object Array]"&&y!==null&&typeof y=="object"&&typeof y.length=="number"&&y.length>=0&&d.call(y.callee)==="[object Function]"),P}}),_Z=Fe((te,Y)=>{var d;Object.keys||(y=Object.prototype.hasOwnProperty,z=Object.prototype.toString,P=IP(),i=Object.prototype.propertyIsEnumerable,n=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=function(m){var b=m.constructor;return b&&b.prototype===m},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},s=function(){if(typeof window>"u")return!1;for(var m in window)try{if(!u["$"+m]&&y.call(window,m)&&window[m]!==null&&typeof window[m]=="object")try{o(window[m])}catch{return!0}}catch{return!0}return!1}(),h=function(m){if(typeof window>"u"||!s)return o(m);try{return o(m)}catch{return!1}},d=function(m){var b=m!==null&&typeof m=="object",x=z.call(m)==="[object Function]",_=P(m),A=b&&z.call(m)==="[object String]",f=[];if(!b&&!x&&!_)throw new TypeError("Object.keys called on a non-object");var k=a&&x;if(A&&m.length>0&&!y.call(m,0))for(var w=0;w0)for(var D=0;D{var d=Array.prototype.slice,y=IP(),z=Object.keys,P=z?function(n){return z(n)}:_Z(),i=Object.keys;P.shim=function(){if(Object.keys){var n=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);n||(Object.keys=function(a){return y(a)?i(d.call(a)):i(a)})}else Object.keys=P;return Object.keys||P},Y.exports=P}),xZ=Fe((te,Y)=>{var d=DP(),y=J8()(),z=zw(),P=Object,i=z("Array.prototype.push"),n=z("Object.prototype.propertyIsEnumerable"),a=y?Object.getOwnPropertySymbols:null;Y.exports=function(l,o){if(l==null)throw new TypeError("target must be an object");var u=P(l);if(arguments.length===1)return u;for(var s=1;s{var d=xZ(),y=function(){if(!Object.assign)return!1;for(var P="abcdefghijklmnopqrst",i=P.split(""),n={},a=0;a{var d=function(y){return y!==y};Y.exports=function(y,z){return y===0&&z===0?1/y===1/z:!!(y===z||d(y)&&d(z))}}),rC=Fe((te,Y)=>{var d=zP();Y.exports=function(){return typeof Object.is=="function"?Object.is:d}}),e6=Fe((te,Y)=>{var d=DP(),y=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",z=Object.prototype.toString,P=Array.prototype.concat,i=Object.defineProperty,n=function(s){return typeof s=="function"&&z.call(s)==="[object Function]"},a=_P()(),l=i&&a,o=function(s,h,m,b){if(h in s){if(b===!0){if(s[h]===m)return}else if(!n(b)||!b())return}l?i(s,h,{configurable:!0,enumerable:!1,value:m,writable:!0}):s[h]=m},u=function(s,h){var m=arguments.length>2?arguments[2]:{},b=d(h);y&&(b=P.call(b,Object.getOwnPropertySymbols(h)));for(var x=0;x{var d=rC(),y=e6();Y.exports=function(){var z=d();return y(Object,{is:z},{is:function(){return Object.is!==z}}),z}}),kZ=Fe((te,Y)=>{var d=e6(),y=Q4(),z=zP(),P=rC(),i=wZ(),n=y(P(),Object);d(n,{getPolyfill:P,implementation:z,shim:i}),Y.exports=n}),OP=Fe((te,Y)=>{Y.exports=function(d){return d!==d}}),BP=Fe((te,Y)=>{var d=OP();Y.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:d}}),TZ=Fe((te,Y)=>{var d=e6(),y=BP();Y.exports=function(){var z=y();return d(Number,{isNaN:z},{isNaN:function(){return Number.isNaN!==z}}),z}}),SZ=Fe((te,Y)=>{var d=Q4(),y=e6(),z=OP(),P=BP(),i=TZ(),n=d(P(),Number);y(n,{getPolyfill:P,implementation:z,shim:i}),Y.exports=n}),CZ=Fe((te,Y)=>{function d(ct,Ae){return n(ct)||i(ct,Ae)||z(ct,Ae)||y()}function y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(ct,Ae){if(ct){if(typeof ct=="string")return P(ct,Ae);var ze=Object.prototype.toString.call(ct).slice(8,-1);if(ze==="Object"&&ct.constructor&&(ze=ct.constructor.name),ze==="Map"||ze==="Set")return Array.from(ct);if(ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ze))return P(ct,Ae)}}function P(ct,Ae){(Ae==null||Ae>ct.length)&&(Ae=ct.length);for(var ze=0,Ee=new Array(Ae);ze10)return!0;for(var Ae=0;Ae57)return!0}return ct.length===10&&ct>=Math.pow(2,32)}function $(ct){return Object.keys(ct).filter(F).concat(h(ct).filter(Object.prototype.propertyIsEnumerable.bind(ct)))}function q(ct,Ae){if(ct===Ae)return 0;for(var ze=ct.length,Ee=Ae.length,nt=0,xt=Math.min(ze,Ee);nt{function d(ve){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},d(ve)}function y(ve,ce,re){return Object.defineProperty(ve,"prototype",{writable:!1}),ve}function z(ve,ce){if(!(ve instanceof ce))throw new TypeError("Cannot call a class as a function")}var P=PP(),i=P.codes,n=i.ERR_AMBIGUOUS_ARGUMENT,a=i.ERR_INVALID_ARG_TYPE,l=i.ERR_INVALID_ARG_VALUE,o=i.ERR_INVALID_RETURN_VALUE,u=i.ERR_MISSING_ARGS,s=yZ(),h=Ow(),m=h.inspect,b=Ow().types,x=b.isPromise,_=b.isRegExp,A=bZ()(),f=rC()(),k=zw()("RegExp.prototype.test"),w,D;function E(){var ve=CZ();w=ve.isDeepEqual,D=ve.isDeepStrictEqual}var I=!1,M=Y.exports=N,p={};function g(ve){throw ve.message instanceof Error?ve.message:new s(ve)}function C(ve,ce,re,ge,ne){var se=arguments.length,_e;if(se===0)_e="Failed";else if(se===1)re=ve,ve=void 0;else{if(I===!1){I=!0;var oe=process.emitWarning?process.emitWarning:console.warn.bind(console);oe("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}se===2&&(ge="!=")}if(re instanceof Error)throw re;var J={actual:ve,expected:ce,operator:ge===void 0?"fail":ge,stackStartFn:ne||C};re!==void 0&&(J.message=re);var me=new s(J);throw _e&&(me.message=_e,me.generatedMessage=!0),me}M.fail=C,M.AssertionError=s;function T(ve,ce,re,ge){if(!re){var ne=!1;if(ce===0)ne=!0,ge="No value argument passed to `assert.ok()`";else if(ge instanceof Error)throw ge;var se=new s({actual:re,expected:!0,message:ge,operator:"==",stackStartFn:ve});throw se.generatedMessage=ne,se}}function N(){for(var ve=arguments.length,ce=new Array(ve),re=0;re{var d=Object.prototype.toString;Y.exports=function(y){var z=d.call(y),P=z==="[object Arguments]";return P||(P=z!=="[object Array]"&&y!==null&&typeof y=="object"&&typeof y.length=="number"&&y.length>=0&&d.call(y.callee)==="[object Function]"),P}}),wZ=ze((te,Y)=>{var d;Object.keys||(y=Object.prototype.hasOwnProperty,z=Object.prototype.toString,P=zP(),i=Object.prototype.propertyIsEnumerable,n=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=function(m){var b=m.constructor;return b&&b.prototype===m},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},s=function(){if(typeof window>"u")return!1;for(var m in window)try{if(!u["$"+m]&&y.call(window,m)&&window[m]!==null&&typeof window[m]=="object")try{o(window[m])}catch{return!0}}catch{return!0}return!1}(),h=function(m){if(typeof window>"u"||!s)return o(m);try{return o(m)}catch{return!1}},d=function(m){var b=m!==null&&typeof m=="object",x=z.call(m)==="[object Function]",_=P(m),A=b&&z.call(m)==="[object String]",f=[];if(!b&&!x&&!_)throw new TypeError("Object.keys called on a non-object");var k=a&&x;if(A&&m.length>0&&!y.call(m,0))for(var w=0;w0)for(var D=0;D{var d=Array.prototype.slice,y=zP(),z=Object.keys,P=z?function(n){return z(n)}:wZ(),i=Object.keys;P.shim=function(){if(Object.keys){var n=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);n||(Object.keys=function(a){return y(a)?i(d.call(a)):i(a)})}else Object.keys=P;return Object.keys||P},Y.exports=P}),kZ=ze((te,Y)=>{var d=OP(),y=eC()(),z=Bw(),P=Object,i=z("Array.prototype.push"),n=z("Object.prototype.propertyIsEnumerable"),a=y?Object.getOwnPropertySymbols:null;Y.exports=function(l,o){if(l==null)throw new TypeError("target must be an object");var u=P(l);if(arguments.length===1)return u;for(var s=1;s{var d=kZ(),y=function(){if(!Object.assign)return!1;for(var P="abcdefghijklmnopqrst",i=P.split(""),n={},a=0;a{var d=function(y){return y!==y};Y.exports=function(y,z){return y===0&&z===0?1/y===1/z:!!(y===z||d(y)&&d(z))}}),nC=ze((te,Y)=>{var d=BP();Y.exports=function(){return typeof Object.is=="function"?Object.is:d}}),r6=ze((te,Y)=>{var d=OP(),y=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",z=Object.prototype.toString,P=Array.prototype.concat,i=Object.defineProperty,n=function(s){return typeof s=="function"&&z.call(s)==="[object Function]"},a=bP()(),l=i&&a,o=function(s,h,m,b){if(h in s){if(b===!0){if(s[h]===m)return}else if(!n(b)||!b())return}l?i(s,h,{configurable:!0,enumerable:!1,value:m,writable:!0}):s[h]=m},u=function(s,h){var m=arguments.length>2?arguments[2]:{},b=d(h);y&&(b=P.call(b,Object.getOwnPropertySymbols(h)));for(var x=0;x{var d=nC(),y=r6();Y.exports=function(){var z=d();return y(Object,{is:z},{is:function(){return Object.is!==z}}),z}}),CZ=ze((te,Y)=>{var d=r6(),y=t6(),z=BP(),P=nC(),i=SZ(),n=y(P(),Object);d(n,{getPolyfill:P,implementation:z,shim:i}),Y.exports=n}),RP=ze((te,Y)=>{Y.exports=function(d){return d!==d}}),FP=ze((te,Y)=>{var d=RP();Y.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:d}}),AZ=ze((te,Y)=>{var d=r6(),y=FP();Y.exports=function(){var z=y();return d(Number,{isNaN:z},{isNaN:function(){return Number.isNaN!==z}}),z}}),MZ=ze((te,Y)=>{var d=t6(),y=r6(),z=RP(),P=FP(),i=AZ(),n=d(P(),Number);y(n,{getPolyfill:P,implementation:z,shim:i}),Y.exports=n}),EZ=ze((te,Y)=>{function d(ct,Ae){return n(ct)||i(ct,Ae)||z(ct,Ae)||y()}function y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(ct,Ae){if(ct){if(typeof ct=="string")return P(ct,Ae);var Oe=Object.prototype.toString.call(ct).slice(8,-1);if(Oe==="Object"&&ct.constructor&&(Oe=ct.constructor.name),Oe==="Map"||Oe==="Set")return Array.from(ct);if(Oe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Oe))return P(ct,Ae)}}function P(ct,Ae){(Ae==null||Ae>ct.length)&&(Ae=ct.length);for(var Oe=0,Le=new Array(Ae);Oe10)return!0;for(var Ae=0;Ae57)return!0}return ct.length===10&&ct>=Math.pow(2,32)}function H(ct){return Object.keys(ct).filter(F).concat(h(ct).filter(Object.prototype.propertyIsEnumerable.bind(ct)))}function q(ct,Ae){if(ct===Ae)return 0;for(var Oe=ct.length,Le=Ae.length,nt=0,xt=Math.min(Oe,Le);nt{function d(ve){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},d(ve)}function y(ve,ce,re){return Object.defineProperty(ve,"prototype",{writable:!1}),ve}function z(ve,ce){if(!(ve instanceof ce))throw new TypeError("Cannot call a class as a function")}var P=DP(),i=P.codes,n=i.ERR_AMBIGUOUS_ARGUMENT,a=i.ERR_INVALID_ARG_TYPE,l=i.ERR_INVALID_ARG_VALUE,o=i.ERR_INVALID_RETURN_VALUE,u=i.ERR_MISSING_ARGS,s=bZ(),h=Rw(),m=h.inspect,b=Rw().types,x=b.isPromise,_=b.isRegExp,A=TZ()(),f=nC()(),k=Bw()("RegExp.prototype.test"),w,D;function E(){var ve=EZ();w=ve.isDeepEqual,D=ve.isDeepStrictEqual}var I=!1,M=Y.exports=N,p={};function g(ve){throw ve.message instanceof Error?ve.message:new s(ve)}function C(ve,ce,re,ge,ne){var se=arguments.length,_e;if(se===0)_e="Failed";else if(se===1)re=ve,ve=void 0;else{if(I===!1){I=!0;var oe=process.emitWarning?process.emitWarning:console.warn.bind(console);oe("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}se===2&&(ge="!=")}if(re instanceof Error)throw re;var J={actual:ve,expected:ce,operator:ge===void 0?"fail":ge,stackStartFn:ne||C};re!==void 0&&(J.message=re);var me=new s(J);throw _e&&(me.message=_e,me.generatedMessage=!0),me}M.fail=C,M.AssertionError=s;function T(ve,ce,re,ge){if(!re){var ne=!1;if(ce===0)ne=!0,ge="No value argument passed to `assert.ok()`";else if(ge instanceof Error)throw ge;var se=new s({actual:re,expected:!0,message:ge,operator:"==",stackStartFn:ve});throw se.generatedMessage=ne,se}}function N(){for(var ve=arguments.length,ce=new Array(ve),re=0;re1?re-1:0),ne=1;ne1?re-1:0),ne=1;ne1?re-1:0),ne=1;ne1?re-1:0),ne=1;ne{var d=1e3,y=d*60,z=y*60,P=z*24,i=P*365.25;Y.exports=function(u,s){s=s||{};var h=typeof u;if(h==="string"&&u.length>0)return n(u);if(h==="number"&&isNaN(u)===!1)return s.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function n(u){if(u=String(u),!(u.length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(s){var h=parseFloat(s[1]),m=(s[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"days":case"day":case"d":return h*P;case"hours":case"hour":case"hrs":case"hr":case"h":return h*z;case"minutes":case"minute":case"mins":case"min":case"m":return h*y;case"seconds":case"second":case"secs":case"sec":case"s":return h*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){return u>=P?Math.round(u/P)+"d":u>=z?Math.round(u/z)+"h":u>=y?Math.round(u/y)+"m":u>=d?Math.round(u/d)+"s":u+"ms"}function l(u){return o(u,P,"day")||o(u,z,"hour")||o(u,y,"minute")||o(u,d,"second")||u+" ms"}function o(u,s,h){if(!(u{te=Y.exports=z.debug=z.default=z,te.coerce=a,te.disable=i,te.enable=P,te.enabled=n,te.humanize=AZ(),te.names=[],te.skips=[],te.formatters={};var d;function y(l){var o=0,u;for(u in l)o=(o<<5)-o+l.charCodeAt(u),o|=0;return te.colors[Math.abs(o)%te.colors.length]}function z(l){function o(){if(o.enabled){var u=o,s=+new Date,h=s-(d||s);u.diff=h,u.prev=d,u.curr=s,d=s;for(var m=new Array(arguments.length),b=0;b{te=Y.exports=MZ(),te.log=z,te.formatArgs=y,te.save=P,te.load=i,te.useColors=d,te.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:n(),te.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function d(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}te.formatters.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}};function y(a){var l=this.useColors;if(a[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+a[0]+(l?"%c ":" ")+"+"+te.humanize(this.diff),!!l){var o="color: "+this.color;a.splice(1,0,o,"color: inherit");var u=0,s=0;a[0].replace(/%[a-zA-Z%]/g,function(h){h!=="%%"&&(u++,h==="%c"&&(s=u))}),a.splice(s,0,o)}}function z(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function P(a){try{a==null?te.storage.removeItem("debug"):te.storage.debug=a}catch{}}function i(){var a;try{a=te.storage.debug}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=e.DEBUG),a}te.enable(i());function n(){try{return window.localStorage}catch{}}}),LZ=Fe((te,Y)=>{var d=t6(),y=EZ()("stream-parser");Y.exports=a;var z=-1,P=0,i=1,n=2;function a(f){var k=f&&typeof f._transform=="function",w=f&&typeof f._write=="function";if(!k&&!w)throw new Error("must pass a Writable or Transform stream in");y("extending Parser into stream"),f._bytes=o,f._skipBytes=u,k&&(f._passthrough=s),k?f._transform=m:f._write=h}function l(f){y("initializing parser stream"),f._parserBytesLeft=0,f._parserBuffers=[],f._parserBuffered=0,f._parserState=z,f._parserCallback=null,typeof f.push=="function"&&(f._parserOutput=f.push.bind(f)),f._parserInit=!0}function o(f,k){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(f)&&f>0,'can only buffer a finite number of bytes > 0, got "'+f+'"'),this._parserInit||l(this),y("buffering %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=P}function u(f,k){d(!this._parserCallback,'there is already a "callback" set!'),d(f>0,'can only skip > 0 bytes, got "'+f+'"'),this._parserInit||l(this),y("skipping %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=i}function s(f,k){d(!this._parserCallback,'There is already a "callback" set!'),d(f>0,'can only pass through > 0 bytes, got "'+f+'"'),this._parserInit||l(this),y("passing through %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=n}function h(f,k,w){this._parserInit||l(this),y("write(%o bytes)",f.length),typeof k=="function"&&(w=k),_(this,f,null,w)}function m(f,k,w){this._parserInit||l(this),y("transform(%o bytes)",f.length),typeof k!="function"&&(k=this._parserOutput),_(this,f,k,w)}function b(f,k,w,D){return f._parserBytesLeft<=0?D(new Error("got data but not currently parsing anything")):k.length<=f._parserBytesLeft?function(){return x(f,k,w,D)}:function(){var E=k.slice(0,f._parserBytesLeft);return x(f,E,w,function(I){if(I)return D(I);if(k.length>E.length)return function(){return b(f,k.slice(E.length),w,D)}})}}function x(f,k,w,D){if(f._parserBytesLeft-=k.length,y("%o bytes left for stream piece",f._parserBytesLeft),f._parserState===P?(f._parserBuffers.push(k),f._parserBuffered+=k.length):f._parserState===n&&w(k),f._parserBytesLeft===0){var E=f._parserCallback;if(E&&f._parserState===P&&f._parserBuffers.length>1&&(k=Buffer.concat(f._parserBuffers,f._parserBuffered)),f._parserState!==P&&(k=null),f._parserCallback=null,f._parserBuffered=0,f._parserState=z,f._parserBuffers.splice(0),E){var I=[];k&&I.push(k),w&&I.push(w);var M=E.length>I.length;M&&I.push(A(D));var p=E.apply(f,I);if(!M||D===p)return D}}else return D}var _=A(b);function A(f){return function(){for(var k=f.apply(this,arguments);typeof k=="function";)k=k();return k}}}),Ch=Fe(te=>{var Y=vZ().Transform,d=LZ();function y(){Y.call(this,{readableObjectMode:!0})}y.prototype=Object.create(Y.prototype),y.prototype.constructor=y,d(y.prototype),te.ParserStream=y,te.sliceEq=function(P,i,n){for(var a=i,l=0;l{var d=Ch().readUInt16BE,y=Ch().readUInt32BE;function z(s,h){if(s.length<4+h)return null;var m=y(s,h);return s.length>4&15,b=s[4]&15,x=s[5]>>4&15,_=d(s,6),A=8,f=0;f<_;f++){var k=d(s,A);A+=2;var w=d(s,A);A+=2;var D=i(s,A,x);A+=x;var E=d(s,A);if(A+=2,w===0&&E===1){var I=i(s,A,m),M=i(s,A+m,b);h.item_loc[k]={length:M,offset:I+D}}A+=E*(m+b)}}function a(s,h){for(var m=d(s,4),b=6,x=0;x_.width||x.width===_.width&&x.height>_.height?x:_}),m=s.reduce(function(x,_){return x.height>_.height||x.height===_.height&&x.width>_.width?x:_}),b;return h.width>m.height||h.width===m.height&&h.height>m.width?b=h:b=m,b}Y.exports.readSizeFromMeta=function(s){var h={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(o(s,h),!!h.sizes.length){var m=u(h.sizes),b=1;h.transforms.forEach(function(_){var A={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},f={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(_.type==="imir"&&(_.value===0?b=f[b]:(b=f[b],b=A[b],b=A[b])),_.type==="irot")for(var k=0;k<_.value;k++)b=A[b]});var x=null;return h.item_inf.Exif&&(x=h.item_loc[h.item_inf.Exif]),{width:m.width,height:m.height,orientation:h.transforms.length?b:null,variants:h.sizes,exif_location:x}}},Y.exports.getMimeType=function(s){var h=String.fromCharCode.apply(null,s.slice(0,4)),m={};m[h]=!0;for(var b=8;b{function d(P,i){var n=new Error(P);return n.code=i,n}function y(P){try{return decodeURIComponent(escape(P))}catch{return P}}function z(P,i,n){this.input=P.subarray(i,n),this.start=i;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if(a!=="II*\0"&&a!=="MM\0*")throw d("invalid TIFF signature","EBADDATA");this.big_endian=a[0]==="M"}z.prototype.each=function(P){this.aborted=!1;var i=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:i}];this.ifds_to_read.length>0&&!this.aborted;){var n=this.ifds_to_read.shift();n.offset&&this.scan_ifd(n.id,n.offset,P)}},z.prototype.read_uint16=function(P){var i=this.input;if(P+2>i.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?i[P]*256+i[P+1]:i[P]+i[P+1]*256},z.prototype.read_uint32=function(P){var i=this.input;if(P+4>i.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?i[P]*16777216+i[P+1]*65536+i[P+2]*256+i[P+3]:i[P]+i[P+1]*256+i[P+2]*65536+i[P+3]*16777216},z.prototype.is_subifd_link=function(P,i){return P===0&&i===34665||P===0&&i===34853||P===34665&&i===40965},z.prototype.exif_format_length=function(P){switch(P){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},z.prototype.exif_format_read=function(P,i){var n;switch(P){case 1:case 2:return n=this.input[i],n;case 6:return n=this.input[i],n|(n&128)*33554430;case 3:return n=this.read_uint16(i),n;case 8:return n=this.read_uint16(i),n|(n&32768)*131070;case 4:return n=this.read_uint32(i),n;case 9:return n=this.read_uint32(i),n|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},z.prototype.scan_ifd=function(P,i,n){var a=this.read_uint16(i);i+=2;for(var l=0;lthis.input.length)throw d("unexpected EOF","EBADDATA");for(var _=[],A=b,f=0;f0&&(this.ifds_to_read.push({id:o,offset:_[0]}),x=!0);var w={is_big_endian:this.big_endian,ifd:P,tag:o,format:u,count:s,entry_offset:i+this.start,data_length:m,data_offset:b+this.start,value:_,is_subifd_link:x};if(n(w)===!1){this.aborted=!0;return}i+=12}P===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(i)})},Y.exports.ExifParser=z,Y.exports.get_orientation=function(P){var i=0;try{return new z(P,0,P.length).each(function(n){if(n.ifd===0&&n.tag===274&&Array.isArray(n.value))return i=n.value[0],!1}),i}catch{return-1}}}),IZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=PZ(),i=iC(),n=d("ftyp");Y.exports=function(a){if(y(a,4,n)){var l=P.unbox(a,0);if(l){var o=P.getMimeType(l.data);if(o){for(var u,s=l.end;;){var h=P.unbox(a,s);if(!h)break;if(s=h.end,h.boxtype==="mdat")return;if(h.boxtype==="meta"){u=h.data;break}}if(u){var m=P.readSizeFromMeta(u);if(m){var b={width:m.width,height:m.height,type:o.type,mime:o.mime,wUnits:"px",hUnits:"px"};if(m.variants.length>1&&(b.variants=m.variants),m.orientation&&(b.orientation=m.orientation),m.exif_location&&m.exif_location.offset+m.exif_location.length<=a.length){var x=z(a,m.exif_location.offset),_=a.slice(m.exif_location.offset+x+4,m.exif_location.offset+m.exif_location.length),A=i.get_orientation(_);A>0&&(b.orientation=A)}return b}}}}}}}),DZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=d("BM");Y.exports=function(i){if(!(i.length<26)&&y(i,0,P))return{width:z(i,18),height:z(i,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),zZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=d("GIF87a"),i=d("GIF89a");Y.exports=function(n){if(!(n.length<10)&&!(!y(n,0,P)&&!y(n,0,i)))return{width:z(n,6),height:z(n,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),OZ=Fe((te,Y)=>{var d=Ch().readUInt16LE,y=0,z=1,P=16;Y.exports=function(i){var n=d(i,0),a=d(i,2),l=d(i,4);if(!(n!==y||a!==z||!l)){for(var o=[],u={width:0,height:0},s=0;su.width||m>u.height)&&(u=b)}return{width:u.width,height:u.height,variants:o,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),BZ=Fe((te,Y)=>{var d=Ch().readUInt16BE,y=Ch().str2arr,z=Ch().sliceEq,P=iC(),i=y("Exif\0\0");Y.exports=function(n){if(!(n.length<2)&&!(n[0]!==255||n[1]!==216||n[2]!==255))for(var a=2;;){for(;;){if(n.length-a<2)return;if(n[a++]===255)break}for(var l=n[a++],o;l===255;)l=n[a++];if(208<=l&&l<=217||l===1)o=0;else if(192<=l&&l<=254){if(n.length-a<2)return;o=d(n,a)-2,a+=2}else return;if(l===217||l===218)return;var u;if(l===225&&o>=10&&z(n,a,i)&&(u=P.get_orientation(n.slice(a+6,a+o))),o>=5&&192<=l&&l<=207&&l!==196&&l!==200&&l!==204){if(n.length-a0&&(s.orientation=u),s}a+=o}}}),RZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=d(`‰PNG\r +`));var oe=new s({actual:ve,expected:ce,message:re,operator:ne,stackStartFn:ge});throw oe.generatedMessage=_e,oe}}M.match=function ve(ce,re,ge){he(ce,re,ge,ve,"match")},M.doesNotMatch=function ve(ce,re,ge){he(ce,re,ge,ve,"doesNotMatch")};function be(){for(var ve=arguments.length,ce=new Array(ve),re=0;re{var d=1e3,y=d*60,z=y*60,P=z*24,i=P*365.25;Y.exports=function(u,s){s=s||{};var h=typeof u;if(h==="string"&&u.length>0)return n(u);if(h==="number"&&isNaN(u)===!1)return s.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function n(u){if(u=String(u),!(u.length>100)){var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(s){var h=parseFloat(s[1]),m=(s[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"days":case"day":case"d":return h*P;case"hours":case"hour":case"hrs":case"hr":case"h":return h*z;case"minutes":case"minute":case"mins":case"min":case"m":return h*y;case"seconds":case"second":case"secs":case"sec":case"s":return h*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){return u>=P?Math.round(u/P)+"d":u>=z?Math.round(u/z)+"h":u>=y?Math.round(u/y)+"m":u>=d?Math.round(u/d)+"s":u+"ms"}function l(u){return o(u,P,"day")||o(u,z,"hour")||o(u,y,"minute")||o(u,d,"second")||u+" ms"}function o(u,s,h){if(!(u{te=Y.exports=z.debug=z.default=z,te.coerce=a,te.disable=i,te.enable=P,te.enabled=n,te.humanize=LZ(),te.names=[],te.skips=[],te.formatters={};var d;function y(l){var o=0,u;for(u in l)o=(o<<5)-o+l.charCodeAt(u),o|=0;return te.colors[Math.abs(o)%te.colors.length]}function z(l){function o(){if(o.enabled){var u=o,s=+new Date,h=s-(d||s);u.diff=h,u.prev=d,u.curr=s,d=s;for(var m=new Array(arguments.length),b=0;b{te=Y.exports=PZ(),te.log=z,te.formatArgs=y,te.save=P,te.load=i,te.useColors=d,te.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:n(),te.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function d(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}te.formatters.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}};function y(a){var l=this.useColors;if(a[0]=(l?"%c":"")+this.namespace+(l?" %c":" ")+a[0]+(l?"%c ":" ")+"+"+te.humanize(this.diff),!!l){var o="color: "+this.color;a.splice(1,0,o,"color: inherit");var u=0,s=0;a[0].replace(/%[a-zA-Z%]/g,function(h){h!=="%%"&&(u++,h==="%c"&&(s=u))}),a.splice(s,0,o)}}function z(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function P(a){try{a==null?te.storage.removeItem("debug"):te.storage.debug=a}catch{}}function i(){var a;try{a=te.storage.debug}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=e.DEBUG),a}te.enable(i());function n(){try{return window.localStorage}catch{}}}),DZ=ze((te,Y)=>{var d=i6(),y=IZ()("stream-parser");Y.exports=a;var z=-1,P=0,i=1,n=2;function a(f){var k=f&&typeof f._transform=="function",w=f&&typeof f._write=="function";if(!k&&!w)throw new Error("must pass a Writable or Transform stream in");y("extending Parser into stream"),f._bytes=o,f._skipBytes=u,k&&(f._passthrough=s),k?f._transform=m:f._write=h}function l(f){y("initializing parser stream"),f._parserBytesLeft=0,f._parserBuffers=[],f._parserBuffered=0,f._parserState=z,f._parserCallback=null,typeof f.push=="function"&&(f._parserOutput=f.push.bind(f)),f._parserInit=!0}function o(f,k){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(f)&&f>0,'can only buffer a finite number of bytes > 0, got "'+f+'"'),this._parserInit||l(this),y("buffering %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=P}function u(f,k){d(!this._parserCallback,'there is already a "callback" set!'),d(f>0,'can only skip > 0 bytes, got "'+f+'"'),this._parserInit||l(this),y("skipping %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=i}function s(f,k){d(!this._parserCallback,'There is already a "callback" set!'),d(f>0,'can only pass through > 0 bytes, got "'+f+'"'),this._parserInit||l(this),y("passing through %o bytes",f),this._parserBytesLeft=f,this._parserCallback=k,this._parserState=n}function h(f,k,w){this._parserInit||l(this),y("write(%o bytes)",f.length),typeof k=="function"&&(w=k),_(this,f,null,w)}function m(f,k,w){this._parserInit||l(this),y("transform(%o bytes)",f.length),typeof k!="function"&&(k=this._parserOutput),_(this,f,k,w)}function b(f,k,w,D){return f._parserBytesLeft<=0?D(new Error("got data but not currently parsing anything")):k.length<=f._parserBytesLeft?function(){return x(f,k,w,D)}:function(){var E=k.slice(0,f._parserBytesLeft);return x(f,E,w,function(I){if(I)return D(I);if(k.length>E.length)return function(){return b(f,k.slice(E.length),w,D)}})}}function x(f,k,w,D){if(f._parserBytesLeft-=k.length,y("%o bytes left for stream piece",f._parserBytesLeft),f._parserState===P?(f._parserBuffers.push(k),f._parserBuffered+=k.length):f._parserState===n&&w(k),f._parserBytesLeft===0){var E=f._parserCallback;if(E&&f._parserState===P&&f._parserBuffers.length>1&&(k=Buffer.concat(f._parserBuffers,f._parserBuffered)),f._parserState!==P&&(k=null),f._parserCallback=null,f._parserBuffered=0,f._parserState=z,f._parserBuffers.splice(0),E){var I=[];k&&I.push(k),w&&I.push(w);var M=E.length>I.length;M&&I.push(A(D));var p=E.apply(f,I);if(!M||D===p)return D}}else return D}var _=A(b);function A(f){return function(){for(var k=f.apply(this,arguments);typeof k=="function";)k=k();return k}}}),Ch=ze(te=>{var Y=xZ().Transform,d=DZ();function y(){Y.call(this,{readableObjectMode:!0})}y.prototype=Object.create(Y.prototype),y.prototype.constructor=y,d(y.prototype),te.ParserStream=y,te.sliceEq=function(P,i,n){for(var a=i,l=0;l{var d=Ch().readUInt16BE,y=Ch().readUInt32BE;function z(s,h){if(s.length<4+h)return null;var m=y(s,h);return s.length>4&15,b=s[4]&15,x=s[5]>>4&15,_=d(s,6),A=8,f=0;f<_;f++){var k=d(s,A);A+=2;var w=d(s,A);A+=2;var D=i(s,A,x);A+=x;var E=d(s,A);if(A+=2,w===0&&E===1){var I=i(s,A,m),M=i(s,A+m,b);h.item_loc[k]={length:M,offset:I+D}}A+=E*(m+b)}}function a(s,h){for(var m=d(s,4),b=6,x=0;x_.width||x.width===_.width&&x.height>_.height?x:_}),m=s.reduce(function(x,_){return x.height>_.height||x.height===_.height&&x.width>_.width?x:_}),b;return h.width>m.height||h.width===m.height&&h.height>m.width?b=h:b=m,b}Y.exports.readSizeFromMeta=function(s){var h={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(o(s,h),!!h.sizes.length){var m=u(h.sizes),b=1;h.transforms.forEach(function(_){var A={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},f={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(_.type==="imir"&&(_.value===0?b=f[b]:(b=f[b],b=A[b],b=A[b])),_.type==="irot")for(var k=0;k<_.value;k++)b=A[b]});var x=null;return h.item_inf.Exif&&(x=h.item_loc[h.item_inf.Exif]),{width:m.width,height:m.height,orientation:h.transforms.length?b:null,variants:h.sizes,exif_location:x}}},Y.exports.getMimeType=function(s){var h=String.fromCharCode.apply(null,s.slice(0,4)),m={};m[h]=!0;for(var b=8;b{function d(P,i){var n=new Error(P);return n.code=i,n}function y(P){try{return decodeURIComponent(escape(P))}catch{return P}}function z(P,i,n){this.input=P.subarray(i,n),this.start=i;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if(a!=="II*\0"&&a!=="MM\0*")throw d("invalid TIFF signature","EBADDATA");this.big_endian=a[0]==="M"}z.prototype.each=function(P){this.aborted=!1;var i=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:i}];this.ifds_to_read.length>0&&!this.aborted;){var n=this.ifds_to_read.shift();n.offset&&this.scan_ifd(n.id,n.offset,P)}},z.prototype.read_uint16=function(P){var i=this.input;if(P+2>i.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?i[P]*256+i[P+1]:i[P]+i[P+1]*256},z.prototype.read_uint32=function(P){var i=this.input;if(P+4>i.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?i[P]*16777216+i[P+1]*65536+i[P+2]*256+i[P+3]:i[P]+i[P+1]*256+i[P+2]*65536+i[P+3]*16777216},z.prototype.is_subifd_link=function(P,i){return P===0&&i===34665||P===0&&i===34853||P===34665&&i===40965},z.prototype.exif_format_length=function(P){switch(P){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},z.prototype.exif_format_read=function(P,i){var n;switch(P){case 1:case 2:return n=this.input[i],n;case 6:return n=this.input[i],n|(n&128)*33554430;case 3:return n=this.read_uint16(i),n;case 8:return n=this.read_uint16(i),n|(n&32768)*131070;case 4:return n=this.read_uint32(i),n;case 9:return n=this.read_uint32(i),n|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},z.prototype.scan_ifd=function(P,i,n){var a=this.read_uint16(i);i+=2;for(var l=0;lthis.input.length)throw d("unexpected EOF","EBADDATA");for(var _=[],A=b,f=0;f0&&(this.ifds_to_read.push({id:o,offset:_[0]}),x=!0);var w={is_big_endian:this.big_endian,ifd:P,tag:o,format:u,count:s,entry_offset:i+this.start,data_length:m,data_offset:b+this.start,value:_,is_subifd_link:x};if(n(w)===!1){this.aborted=!0;return}i+=12}P===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(i)})},Y.exports.ExifParser=z,Y.exports.get_orientation=function(P){var i=0;try{return new z(P,0,P.length).each(function(n){if(n.ifd===0&&n.tag===274&&Array.isArray(n.value))return i=n.value[0],!1}),i}catch{return-1}}}),OZ=ze((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=zZ(),i=aC(),n=d("ftyp");Y.exports=function(a){if(y(a,4,n)){var l=P.unbox(a,0);if(l){var o=P.getMimeType(l.data);if(o){for(var u,s=l.end;;){var h=P.unbox(a,s);if(!h)break;if(s=h.end,h.boxtype==="mdat")return;if(h.boxtype==="meta"){u=h.data;break}}if(u){var m=P.readSizeFromMeta(u);if(m){var b={width:m.width,height:m.height,type:o.type,mime:o.mime,wUnits:"px",hUnits:"px"};if(m.variants.length>1&&(b.variants=m.variants),m.orientation&&(b.orientation=m.orientation),m.exif_location&&m.exif_location.offset+m.exif_location.length<=a.length){var x=z(a,m.exif_location.offset),_=a.slice(m.exif_location.offset+x+4,m.exif_location.offset+m.exif_location.length),A=i.get_orientation(_);A>0&&(b.orientation=A)}return b}}}}}}}),BZ=ze((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=d("BM");Y.exports=function(i){if(!(i.length<26)&&y(i,0,P))return{width:z(i,18),height:z(i,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}),RZ=ze((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=d("GIF87a"),i=d("GIF89a");Y.exports=function(n){if(!(n.length<10)&&!(!y(n,0,P)&&!y(n,0,i)))return{width:z(n,6),height:z(n,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}),FZ=ze((te,Y)=>{var d=Ch().readUInt16LE,y=0,z=1,P=16;Y.exports=function(i){var n=d(i,0),a=d(i,2),l=d(i,4);if(!(n!==y||a!==z||!l)){for(var o=[],u={width:0,height:0},s=0;su.width||m>u.height)&&(u=b)}return{width:u.width,height:u.height,variants:o,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}),NZ=ze((te,Y)=>{var d=Ch().readUInt16BE,y=Ch().str2arr,z=Ch().sliceEq,P=aC(),i=y("Exif\0\0");Y.exports=function(n){if(!(n.length<2)&&!(n[0]!==255||n[1]!==216||n[2]!==255))for(var a=2;;){for(;;){if(n.length-a<2)return;if(n[a++]===255)break}for(var l=n[a++],o;l===255;)l=n[a++];if(208<=l&&l<=217||l===1)o=0;else if(192<=l&&l<=254){if(n.length-a<2)return;o=d(n,a)-2,a+=2}else return;if(l===217||l===218)return;var u;if(l===225&&o>=10&&z(n,a,i)&&(u=P.get_orientation(n.slice(a+6,a+o))),o>=5&&192<=l&&l<=207&&l!==196&&l!==200&&l!==204){if(n.length-a0&&(s.orientation=u),s}a+=o}}}),jZ=ze((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=d(`‰PNG\r  -`),i=d("IHDR");Y.exports=function(n){if(!(n.length<24)&&y(n,0,P)&&y(n,12,i))return{width:z(n,16),height:z(n,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}),FZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=d("8BPS\0");Y.exports=function(i){if(!(i.length<22)&&y(i,0,P))return{width:z(i,18),height:z(i,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),NZ=Fe((te,Y)=>{function d(h){return h===32||h===9||h===13||h===10}function y(h){return typeof h=="number"&&isFinite(h)&&h>0}function z(h){var m=0,b=h.length;for(h[0]===239&&h[1]===187&&h[2]===191&&(m=3);m]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,n=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,o=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(h){var m=h.match(n),b=h.match(a),x=h.match(l);return{width:m&&(m[1]||m[2]),height:b&&(b[1]||b[2]),viewbox:x&&(x[1]||x[2])}}function s(h){return o.test(h)?h.match(o)[0]:"px"}Y.exports=function(h){if(z(h)){for(var m="",b=0;b{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt16BE,i=Ch().readUInt32LE,n=Ch().readUInt32BE,a=d("II*\0"),l=d("MM\0*");function o(h,m,b){return b?P(h,m):z(h,m)}function u(h,m,b){return b?n(h,m):i(h,m)}function s(h,m,b){var x=o(h,m+2,b),_=u(h,m+4,b);return _!==1||x!==3&&x!==4?null:x===3?o(h,m+8,b):u(h,m+8,b)}Y.exports=function(h){if(!(h.length<8)&&!(!y(h,0,a)&&!y(h,0,l))){var m=h[0]===77,b=u(h,4,m)-8;if(!(b<0)){var x=b+8;if(!(h.length-x<2)){var _=o(h,x+0,m)*12;if(!(_<=0)&&(x+=2,!(h.length-x<_))){var A,f,k,w;for(A=0;A<_;A+=12)w=o(h,x+A,m),w===256?f=s(h,x+A,m):w===257&&(k=s(h,x+A,m));if(f&&k)return{width:f,height:k,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),UZ=Fe((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt32LE,i=iC(),n=d("RIFF"),a=d("WEBP");function l(s,h){if(!(s[h+3]!==157||s[h+4]!==1||s[h+5]!==42))return{width:z(s,h+6)&16383,height:z(s,h+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function o(s,h){if(s[h]===47){var m=P(s,h+1);return{width:(m&16383)+1,height:(m>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function u(s,h){return{width:(s[h+6]<<16|s[h+5]<<8|s[h+4])+1,height:(s[h+9]<s.length)){for(;h+8=10?m=m||l(s,h+8):_==="VP8L"&&A>=9?m=m||o(s,h+8):_==="VP8X"&&A>=10?m=m||u(s,h+8):_==="EXIF"&&(b=i.get_orientation(s.slice(h+8,h+8+A)),h=1/0),h+=8+A}if(m)return b>0&&(m.orientation=b),m}}}}),$Z=Fe((te,Y)=>{Y.exports={avif:IZ(),bmp:DZ(),gif:zZ(),ico:OZ(),jpeg:BZ(),png:RZ(),psd:FZ(),svg:NZ(),tiff:jZ(),webp:UZ()}}),HZ=Fe((te,Y)=>{var d=$Z();function y(z){for(var P=Object.keys(d),i=0;i{var Y=HZ(),d=Y0().IMAGE_URL_PREFIX,y=gb().Buffer;te.getImageSize=function(z){var P=z.replace(d,""),i=new y(P,"base64");return Y(i)}}),WZ=Fe((te,Y)=>{var d=ji(),y=Pw(),z=Ar(),P=Os(),i=ji().maxRowLength,n=VZ().getImageSize;Y.exports=function(u,s){var h,m;if(s._hasZ)h=s.z.length,m=i(s.z);else if(s._hasSource){var b=n(s.source);h=b.height,m=b.width}var x=P.getFromId(u,s.xaxis||"x"),_=P.getFromId(u,s.yaxis||"y"),A=x.d2c(s.x0)-s.dx/2,f=_.d2c(s.y0)-s.dy/2,k,w=[A,A+m*s.dx],D=[f,f+h*s.dy];if(x&&x.type==="log")for(k=0;k{var d=ii(),y=ji(),z=y.strTranslate,P=k0(),i=Pw(),n=jL(),a=F8().STYLE;Y.exports=function(l,o,u,s){var h=o.xaxis,m=o.yaxis,b=!l._context._exportedPlot&&n();y.makeTraceGroups(s,u,"im").each(function(x){var _=d.select(this),A=x[0],f=A.trace,k=(f.zsmooth==="fast"||f.zsmooth===!1&&b)&&!f._hasZ&&f._hasSource&&h.type==="linear"&&m.type==="linear";f._realImage=k;var w=A.z,D=A.x0,E=A.y0,I=A.w,M=A.h,p=f.dx,g=f.dy,C,T,N,B,U,V;for(V=0;C===void 0&&V0;)T=h.c2p(D+V*p),V--;for(V=0;B===void 0&&V0;)U=m.c2p(E+V*g),V--;if(Tce[0];if(re||ge){var ne=C+F/2,se=B+$/2;xe+="transform:"+z(ne+"px",se+"px")+"scale("+(re?-1:1)+","+(ge?-1:1)+")"+z(-ne+"px",-se+"px")+";"}}he.attr("style",xe);var _e=new Promise(function(oe){if(f._hasZ)oe();else if(f._hasSource)if(f._canvas&&f._canvas.el.width===I&&f._canvas.el.height===M&&f._canvas.source===f.source)oe();else{var J=document.createElement("canvas");J.width=I,J.height=M;var me=J.getContext("2d",{willReadFrequently:!0});f._image=f._image||new Image;var fe=f._image;fe.onload=function(){me.drawImage(fe,0,0),f._canvas={el:J,source:f.source},oe()},fe.setAttribute("src",f.source)}}).then(function(){var oe,J;if(f._hasZ)J=ee(function(Ce,Be){var Oe=w[Be][Ce];return y.isTypedArray(Oe)&&(Oe=Array.from(Oe)),Oe}),oe=J.toDataURL("image/png");else if(f._hasSource)if(k)oe=f.source;else{var me=f._canvas.el.getContext("2d",{willReadFrequently:!0}),fe=me.getImageData(0,0,I,M).data;J=ee(function(Ce,Be){var Oe=4*(Be*I+Ce);return[fe[Oe],fe[Oe+1],fe[Oe+2],fe[Oe+3]]}),oe=J.toDataURL("image/png")}he.attr({"xlink:href":oe,height:$,width:F,x:C,y:B})});l._promises.push(_e)})}}),GZ=Fe((te,Y)=>{var d=ii();Y.exports=function(y){d.select(y).selectAll(".im image").style("opacity",function(z){return z[0].trace.opacity})}}),ZZ=Fe((te,Y)=>{var d=hf(),y=ji(),z=y.isArrayOrTypedArray,P=Pw();Y.exports=function(i,n,a){var l=i.cd[0],o=l.trace,u=i.xa,s=i.ya;if(!(d.inbox(n-l.x0,n-(l.x0+l.w*o.dx),0)>0||d.inbox(a-l.y0,a-(l.y0+l.h*o.dy),0)>0)){var h=Math.floor((n-l.x0)/o.dx),m=Math.floor(Math.abs(a-l.y0)/o.dy),b;if(o._hasZ?b=l.z[m][h]:o._hasSource&&(b=o._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,m,1,1).data),!!b){var x=l.hi||o.hoverinfo,_;if(x){var A=x.split("+");A.indexOf("all")!==-1&&(A=["color"]),A.indexOf("color")!==-1&&(_=!0)}var f=P.colormodel[o.colormodel],k=f.colormodel||o.colormodel,w=k.length,D=o._scaler(b),E=f.suffix,I=[];(o.hovertemplate||_)&&(I.push("["+[D[0]+E[0],D[1]+E[1],D[2]+E[2]].join(", ")),w===4&&I.push(", "+D[3]+E[3]),I.push("]"),I=I.join(""),i.extraText=k.toUpperCase()+": "+I);var M;z(o.hovertext)&&z(o.hovertext[m])?M=o.hovertext[m][h]:z(o.text)&&z(o.text[m])&&(M=o.text[m][h]);var p=s.c2p(l.y0+(m+.5)*o.dy),g=l.x0+(h+.5)*o.dx,C=l.y0+(m+.5)*o.dy,T="["+b.slice(0,o.colormodel.length).join(", ")+"]";return[y.extendFlat(i,{index:[m,h],x0:u.c2p(l.x0+h*o.dx),x1:u.c2p(l.x0+(h+1)*o.dx),y0:p,y1:p,color:D,xVal:g,xLabelVal:g,yVal:C,yLabelVal:C,zLabelVal:T,text:M,hovertemplateLabels:{zLabel:T,colorLabel:I,"color[0]Label":D[0]+E[0],"color[1]Label":D[1]+E[1],"color[2]Label":D[2]+E[2],"color[3]Label":D[3]+E[3]}})]}}}}),KZ=Fe((te,Y)=>{Y.exports=function(d,y){return"xVal"in y&&(d.x=y.xVal),"yVal"in y&&(d.y=y.yVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d.color=y.color,d.colormodel=y.trace.colormodel,d.z||(d.z=y.color),d}}),YZ=Fe((te,Y)=>{Y.exports={attributes:fP(),supplyDefaults:IG(),calc:WZ(),plot:qZ(),style:GZ(),hoverPoints:ZZ(),eventData:KZ(),moduleType:"trace",name:"image",basePlotModule:Rf(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),XZ=Fe((te,Y)=>{Y.exports=YZ()}),xb=Fe((te,Y)=>{var d=_a(),y=Xh().attributes,z=zn(),P=Mi(),{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=an().extendFlat,o=Wd().pattern,u=z({editType:"plot",arrayOk:!0,colorEditType:"plot"});Y.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:P.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:i({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:a(),texttemplate:n({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:a({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:y({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),bb=Fe((te,Y)=>{var d=Ar(),y=ji(),z=xb(),P=Xh().defaults,i=eg().handleText,n=ji().coercePattern;function a(u,s){var h=y.isArrayOrTypedArray(u),m=y.isArrayOrTypedArray(s),b=Math.min(h?u.length:1/0,m?s.length:1/0);if(isFinite(b)||(b=0),b&&m){for(var x,_=0;_0){x=!0;break}}x||(b=0)}return{hasLabels:h,hasValues:m,len:b}}function l(u,s,h,m,b){var x=m("marker.line.width");x&&m("marker.line.color",b?void 0:h.paper_bgcolor);var _=m("marker.colors");n(m,"marker.pattern",_),u.marker&&!s.marker.pattern.fgcolor&&(s.marker.pattern.fgcolor=u.marker.colors),s.marker.pattern.bgcolor||(s.marker.pattern.bgcolor=h.paper_bgcolor)}function o(u,s,h,m){function b(T,N){return y.coerce(u,s,z,T,N)}var x=b("labels"),_=b("values"),A=a(x,_),f=A.len;if(s._hasLabels=A.hasLabels,s._hasValues=A.hasValues,!s._hasLabels&&s._hasValues&&(b("label0"),b("dlabel")),!f){s.visible=!1;return}s._length=f,l(u,s,m,b,!0),b("scalegroup");var k=b("text"),w=b("texttemplate");b("texttemplatefallback");var D;if(w||(D=b("textinfo",y.isArrayOrTypedArray(k)?"text+percent":"percent")),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),w||D&&D!=="none"){var E=b("textposition");i(u,s,m,b,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var I=Array.isArray(E)||E==="auto",M=I||E==="outside";M&&b("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&b("insidetextorientation")}else D==="none"&&b("textposition","none");P(s,m,b);var p=b("hole"),g=b("title.text");if(g){var C=b("title.position",p?"middle center":"top center");!p&&C==="middle center"&&(s.title.position="top center"),y.coerceFont(b,"title.font",m.font)}b("sort"),b("direction"),b("rotation"),b("pull")}Y.exports={handleLabelsAndValues:a,handleMarkerDefaults:l,supplyDefaults:o}}),nC=Fe((te,Y)=>{Y.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),JZ=Fe((te,Y)=>{var d=ji(),y=nC();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("hiddenlabels"),i("piecolorway",P.colorway),i("extendpiecolors")}}),Bw=Fe((te,Y)=>{var d=Ar(),y=sn(),z=Xi(),P={};function i(o,u){var s=[],h=o._fullLayout,m=h.hiddenlabels||[],b=u.labels,x=u.marker.colors||[],_=u.values,A=u._length,f=u._hasValues&&A,k,w;if(u.dlabel)for(b=new Array(A),k=0;k=0});var N=u.type==="funnelarea"?M:u.sort;return N&&s.sort(function(B,U){return U.v-B.v}),s[0]&&(s[0].vTotal=I),s}function n(o){return function(u,s){return!u||(u=y(u),!u.isValid())?!1:(u=z.addOpacity(u,u.getAlpha()),o[s]||(o[s]=u),u)}}function a(o,u){var s=(u||{}).type;s||(s="pie");var h=o._fullLayout,m=o.calcdata,b=h[s+"colorway"],x=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(b=l(b,P));for(var _=0,A=0;A{var d=T0().appendArrayMultiPointValues;Y.exports=function(y,z){var P={curveNumber:z.index,pointNumbers:y.pts,data:z._input,fullData:z,label:y.label,color:y.color,value:y.v,percent:y.percent,text:y.text,bbox:y.bbox,v:y.v};return y.pts.length===1&&(P.pointNumber=P.i=y.pts[0]),d(P,z,y.pts),z.type==="funnelarea"&&(delete P.v,delete P.i),P}}),aC=Fe((te,Y)=>{var d=ii(),y=sh(),z=hf(),P=Xi(),i=Zs(),n=ji(),a=n.strScale,l=n.strTranslate,o=cc(),u=C0(),s=u.recordMinTextSize,h=u.clearMinTextSize,m=pb().TEXTPAD,b=Vv(),x=QZ(),_=ji().isValidTextValue;function A(ge,ne){var se=ge._context.staticPlot,_e=ge._fullLayout,oe=_e._size;h("pie",_e),E(ne,ge),ee(ne,oe);var J=n.makeTraceGroups(_e._pielayer,ne,"trace").each(function(me){var fe=d.select(this),Ce=me[0],Be=Ce.trace;xe(me),fe.attr("stroke-linejoin","round"),fe.each(function(){var Oe=d.select(this).selectAll("g.slice").data(me);Oe.enter().append("g").classed("slice",!0),Oe.exit().remove();var Ze=[[[],[]],[[],[]]],Ge=!1;Oe.each(function(Ee,nt){if(Ee.hidden){d.select(this).selectAll("path,g").remove();return}Ee.pointNumber=Ee.i,Ee.curveNumber=Be.index,Ze[Ee.pxmid[1]<0?0:1][Ee.pxmid[0]<0?0:1].push(Ee);var xt=Ce.cx,ut=Ce.cy,Et=d.select(this),Gt=Et.selectAll("path.surface").data([Ee]);if(Gt.enter().append("path").classed("surface",!0).style({"pointer-events":se?"none":"all"}),Et.call(k,ge,me),Be.pull){var Jt=+b.castOption(Be.pull,Ee.pts)||0;Jt>0&&(xt+=Jt*Ee.pxmid[0],ut+=Jt*Ee.pxmid[1])}Ee.cxFinal=xt,Ee.cyFinal=ut;function gr(Ot,Je,ot,De){var ye=De*(Je[0]-Ot[0]),Pe=De*(Je[1]-Ot[1]);return"a"+De*Ce.r+","+De*Ce.r+" 0 "+Ee.largeArc+(ot?" 1 ":" 0 ")+ye+","+Pe}var mr=Be.hole;if(Ee.v===Ce.vTotal){var Kr="M"+(xt+Ee.px0[0])+","+(ut+Ee.px0[1])+gr(Ee.px0,Ee.pxmid,!0,1)+gr(Ee.pxmid,Ee.px0,!0,1)+"Z";mr?Gt.attr("d","M"+(xt+mr*Ee.px0[0])+","+(ut+mr*Ee.px0[1])+gr(Ee.px0,Ee.pxmid,!1,mr)+gr(Ee.pxmid,Ee.px0,!1,mr)+"Z"+Kr):Gt.attr("d",Kr)}else{var ri=gr(Ee.px0,Ee.px1,!0,1);if(mr){var Mr=1-mr;Gt.attr("d","M"+(xt+mr*Ee.px1[0])+","+(ut+mr*Ee.px1[1])+gr(Ee.px1,Ee.px0,!1,mr)+"l"+Mr*Ee.px0[0]+","+Mr*Ee.px0[1]+ri+"Z")}else Gt.attr("d","M"+xt+","+ut+"l"+Ee.px0[0]+","+Ee.px0[1]+ri+"Z")}ce(ge,Ee,Ce);var ui=b.castOption(Be.textposition,Ee.pts),mi=Et.selectAll("g.slicetext").data(Ee.text&&ui!=="none"?[0]:[]);mi.enter().append("g").classed("slicetext",!0),mi.exit().remove(),mi.each(function(){var Ot=n.ensureSingle(d.select(this),"text","",function(ht){ht.attr("data-notex",1)}),Je=n.ensureUniformFontSize(ge,ui==="outside"?w(Be,Ee,_e.font):D(Be,Ee,_e.font));Ot.text(Ee.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,Je).call(o.convertToTspans,ge);var ot=i.bBox(Ot.node()),De;if(ui==="outside")De=U(ot,Ee);else if(De=I(ot,Ee,Ce),ui==="auto"&&De.scale<1){var ye=n.ensureUniformFontSize(ge,Be.outsidetextfont);Ot.call(i.font,ye),ot=i.bBox(Ot.node()),De=U(ot,Ee)}var Pe=De.textPosAngle,He=Pe===void 0?Ee.pxmid:ve(Ce.r,Pe);if(De.targetX=xt+He[0]*De.rCenter+(De.x||0),De.targetY=ut+He[1]*De.rCenter+(De.y||0),re(De,ot),De.outside){var at=De.targetY;Ee.yLabelMin=at-ot.height/2,Ee.yLabelMid=at,Ee.yLabelMax=at+ot.height/2,Ee.labelExtraX=0,Ee.labelExtraY=0,Ge=!0}De.fontSize=Je.size,s(Be.type,De,_e),me[nt].transform=De,n.setTransormAndDisplay(Ot,De)})});var rt=d.select(this).selectAll("g.titletext").data(Be.title.text?[0]:[]);if(rt.enter().append("g").classed("titletext",!0),rt.exit().remove(),rt.each(function(){var Ee=n.ensureSingle(d.select(this),"text","",function(ut){ut.attr("data-notex",1)}),nt=Be.title.text;Be._meta&&(nt=n.templateString(nt,Be._meta)),Ee.text(nt).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,Be.title.font).call(o.convertToTspans,ge);var xt;Be.title.position==="middle center"?xt=V(Ce):xt=W(Ce,oe),Ee.attr("transform",l(xt.x,xt.y)+a(Math.min(1,xt.scale))+l(xt.tx,xt.ty))}),Ge&&G(Ze,Be),f(Oe,Be),Ge&&Be.automargin){var _t=i.bBox(fe.node()),pt=Be.domain,gt=oe.w*(pt.x[1]-pt.x[0]),ct=oe.h*(pt.y[1]-pt.y[0]),Ae=(.5*gt-Ce.r)/oe.w,ze=(.5*ct-Ce.r)/oe.h;y.autoMargin(ge,"pie."+Be.uid+".automargin",{xl:pt.x[0]-Ae,xr:pt.x[1]+Ae,yb:pt.y[0]-ze,yt:pt.y[1]+ze,l:Math.max(Ce.cx-Ce.r-_t.left,0),r:Math.max(_t.right-(Ce.cx+Ce.r),0),b:Math.max(_t.bottom-(Ce.cy+Ce.r),0),t:Math.max(Ce.cy-Ce.r-_t.top,0),pad:5})}})});setTimeout(function(){J.selectAll("tspan").each(function(){var me=d.select(this);me.attr("dy")&&me.attr("dy",me.attr("dy"))})},0)}function f(ge,ne){ge.each(function(se){var _e=d.select(this);if(!se.labelExtraX&&!se.labelExtraY){_e.select("path.textline").remove();return}var oe=_e.select("g.slicetext text");se.transform.targetX+=se.labelExtraX,se.transform.targetY+=se.labelExtraY,n.setTransormAndDisplay(oe,se.transform);var J=se.cxFinal+se.pxmid[0],me=se.cyFinal+se.pxmid[1],fe="M"+J+","+me,Ce=(se.yLabelMax-se.yLabelMin)*(se.pxmid[0]<0?-1:1)/4;if(se.labelExtraX){var Be=se.labelExtraX*se.pxmid[1]/se.pxmid[0],Oe=se.yLabelMid+se.labelExtraY-(se.cyFinal+se.pxmid[1]);Math.abs(Be)>Math.abs(Oe)?fe+="l"+Oe*se.pxmid[0]/se.pxmid[1]+","+Oe+"H"+(J+se.labelExtraX+Ce):fe+="l"+se.labelExtraX+","+Be+"v"+(Oe-Be)+"h"+Ce}else fe+="V"+(se.yLabelMid+se.labelExtraY)+"h"+Ce;n.ensureSingle(_e,"path","textline").call(P.stroke,ne.outsidetextfont.color).attr({"stroke-width":Math.min(2,ne.outsidetextfont.size/8),d:fe,fill:"none"})})}function k(ge,ne,se){var _e=se[0],oe=_e.cx,J=_e.cy,me=_e.trace,fe=me.type==="funnelarea";"_hasHoverLabel"in me||(me._hasHoverLabel=!1),"_hasHoverEvent"in me||(me._hasHoverEvent=!1),ge.on("mouseover",function(Ce){var Be=ne._fullLayout,Oe=ne._fullData[me.index];if(!(ne._dragging||Be.hovermode===!1)){var Ze=Oe.hoverinfo;if(Array.isArray(Ze)&&(Ze=z.castHoverinfo({hoverinfo:[b.castOption(Ze,Ce.pts)],_module:me._module},Be,0)),Ze==="all"&&(Ze="label+text+value+percent+name"),Oe.hovertemplate||Ze!=="none"&&Ze!=="skip"&&Ze){var Ge=Ce.rInscribed||0,rt=oe+Ce.pxmid[0]*(1-Ge),_t=J+Ce.pxmid[1]*(1-Ge),pt=Be.separators,gt=[];if(Ze&&Ze.indexOf("label")!==-1&>.push(Ce.label),Ce.text=b.castOption(Oe.hovertext||Oe.text,Ce.pts),Ze&&Ze.indexOf("text")!==-1){var ct=Ce.text;n.isValidTextValue(ct)&>.push(ct)}Ce.value=Ce.v,Ce.valueLabel=b.formatPieValue(Ce.v,pt),Ze&&Ze.indexOf("value")!==-1&>.push(Ce.valueLabel),Ce.percent=Ce.v/_e.vTotal,Ce.percentLabel=b.formatPiePercent(Ce.percent,pt),Ze&&Ze.indexOf("percent")!==-1&>.push(Ce.percentLabel);var Ae=Oe.hoverlabel,ze=Ae.font,Ee=[];z.loneHover({trace:me,x0:rt-Ge*_e.r,x1:rt+Ge*_e.r,y:_t,_x0:fe?oe+Ce.TL[0]:rt-Ge*_e.r,_x1:fe?oe+Ce.TR[0]:rt+Ge*_e.r,_y0:fe?J+Ce.TL[1]:_t-Ge*_e.r,_y1:fe?J+Ce.BL[1]:_t+Ge*_e.r,text:gt.join("
"),name:Oe.hovertemplate||Ze.indexOf("name")!==-1?Oe.name:void 0,idealAlign:Ce.pxmid[0]<0?"left":"right",color:b.castOption(Ae.bgcolor,Ce.pts)||Ce.color,borderColor:b.castOption(Ae.bordercolor,Ce.pts),fontFamily:b.castOption(ze.family,Ce.pts),fontSize:b.castOption(ze.size,Ce.pts),fontColor:b.castOption(ze.color,Ce.pts),nameLength:b.castOption(Ae.namelength,Ce.pts),textAlign:b.castOption(Ae.align,Ce.pts),hovertemplate:b.castOption(Oe.hovertemplate,Ce.pts),hovertemplateLabels:Ce,eventData:[x(Ce,Oe)]},{container:Be._hoverlayer.node(),outerContainer:Be._paper.node(),gd:ne,inOut_bbox:Ee}),Ce.bbox=Ee[0],me._hasHoverLabel=!0}me._hasHoverEvent=!0,ne.emit("plotly_hover",{points:[x(Ce,Oe)],event:d.event})}}),ge.on("mouseout",function(Ce){var Be=ne._fullLayout,Oe=ne._fullData[me.index],Ze=d.select(this).datum();me._hasHoverEvent&&(Ce.originalEvent=d.event,ne.emit("plotly_unhover",{points:[x(Ze,Oe)],event:d.event}),me._hasHoverEvent=!1),me._hasHoverLabel&&(z.loneUnhover(Be._hoverlayer.node()),me._hasHoverLabel=!1)}),ge.on("click",function(Ce){var Be=ne._fullLayout,Oe=ne._fullData[me.index];ne._dragging||Be.hovermode===!1||(ne._hoverdata=[x(Ce,Oe)],z.click(ne,d.event))})}function w(ge,ne,se){var _e=b.castOption(ge.outsidetextfont.color,ne.pts)||b.castOption(ge.textfont.color,ne.pts)||se.color,oe=b.castOption(ge.outsidetextfont.family,ne.pts)||b.castOption(ge.textfont.family,ne.pts)||se.family,J=b.castOption(ge.outsidetextfont.size,ne.pts)||b.castOption(ge.textfont.size,ne.pts)||se.size,me=b.castOption(ge.outsidetextfont.weight,ne.pts)||b.castOption(ge.textfont.weight,ne.pts)||se.weight,fe=b.castOption(ge.outsidetextfont.style,ne.pts)||b.castOption(ge.textfont.style,ne.pts)||se.style,Ce=b.castOption(ge.outsidetextfont.variant,ne.pts)||b.castOption(ge.textfont.variant,ne.pts)||se.variant,Be=b.castOption(ge.outsidetextfont.textcase,ne.pts)||b.castOption(ge.textfont.textcase,ne.pts)||se.textcase,Oe=b.castOption(ge.outsidetextfont.lineposition,ne.pts)||b.castOption(ge.textfont.lineposition,ne.pts)||se.lineposition,Ze=b.castOption(ge.outsidetextfont.shadow,ne.pts)||b.castOption(ge.textfont.shadow,ne.pts)||se.shadow;return{color:_e,family:oe,size:J,weight:me,style:fe,variant:Ce,textcase:Be,lineposition:Oe,shadow:Ze}}function D(ge,ne,se){var _e=b.castOption(ge.insidetextfont.color,ne.pts);!_e&&ge._input.textfont&&(_e=b.castOption(ge._input.textfont.color,ne.pts));var oe=b.castOption(ge.insidetextfont.family,ne.pts)||b.castOption(ge.textfont.family,ne.pts)||se.family,J=b.castOption(ge.insidetextfont.size,ne.pts)||b.castOption(ge.textfont.size,ne.pts)||se.size,me=b.castOption(ge.insidetextfont.weight,ne.pts)||b.castOption(ge.textfont.weight,ne.pts)||se.weight,fe=b.castOption(ge.insidetextfont.style,ne.pts)||b.castOption(ge.textfont.style,ne.pts)||se.style,Ce=b.castOption(ge.insidetextfont.variant,ne.pts)||b.castOption(ge.textfont.variant,ne.pts)||se.variant,Be=b.castOption(ge.insidetextfont.textcase,ne.pts)||b.castOption(ge.textfont.textcase,ne.pts)||se.textcase,Oe=b.castOption(ge.insidetextfont.lineposition,ne.pts)||b.castOption(ge.textfont.lineposition,ne.pts)||se.lineposition,Ze=b.castOption(ge.insidetextfont.shadow,ne.pts)||b.castOption(ge.textfont.shadow,ne.pts)||se.shadow;return{color:_e||P.contrast(ne.color),family:oe,size:J,weight:me,style:fe,variant:Ce,textcase:Be,lineposition:Oe,shadow:Ze}}function E(ge,ne){for(var se,_e,oe=0;oe=-4;Ae-=2)ct(Math.PI*Ae,"tan");for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+1),"tan")}if(Ze||rt){for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+1.5),"rad");for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+.5),"rad")}}if(fe||_t||Ze){var ze=Math.sqrt(ge.width*ge.width+ge.height*ge.height);if(gt={scale:oe*_e*2/ze,rCenter:1-oe,rotate:0},gt.textPosAngle=(ne.startangle+ne.stopangle)/2,gt.scale>=1)return gt;pt.push(gt)}(_t||rt)&&(gt=p(ge,_e,me,Ce,Be),gt.textPosAngle=(ne.startangle+ne.stopangle)/2,pt.push(gt)),(_t||Ge)&&(gt=g(ge,_e,me,Ce,Be),gt.textPosAngle=(ne.startangle+ne.stopangle)/2,pt.push(gt));for(var Ee=0,nt=0,xt=0;xt=1)break}return pt[Ee]}function M(ge,ne){var se=ge.startangle,_e=ge.stopangle;return se>ne&&ne>_e||se0?1:-1)/2,y:J/(1+se*se/(_e*_e)),outside:!0}}function V(ge){var ne=Math.sqrt(ge.titleBox.width*ge.titleBox.width+ge.titleBox.height*ge.titleBox.height);return{x:ge.cx,y:ge.cy,scale:ge.trace.hole*ge.r*2/ne,tx:0,ty:-ge.titleBox.height/2+ge.trace.title.font.size}}function W(ge,ne){var se=1,_e=1,oe,J=ge.trace,me={x:ge.cx,y:ge.cy},fe={tx:0,ty:0};fe.ty+=J.title.font.size,oe=q(J),J.title.position.indexOf("top")!==-1?(me.y-=(1+oe)*ge.r,fe.ty-=ge.titleBox.height):J.title.position.indexOf("bottom")!==-1&&(me.y+=(1+oe)*ge.r);var Ce=F(ge.r,ge.trace.aspectratio),Be=ne.w*(J.domain.x[1]-J.domain.x[0])/2;return J.title.position.indexOf("left")!==-1?(Be=Be+Ce,me.x-=(1+oe)*Ce,fe.tx+=ge.titleBox.width/2):J.title.position.indexOf("center")!==-1?Be*=2:J.title.position.indexOf("right")!==-1&&(Be=Be+Ce,me.x+=(1+oe)*Ce,fe.tx-=ge.titleBox.width/2),se=Be/ge.titleBox.width,_e=$(ge,ne)/ge.titleBox.height,{x:me.x,y:me.y,scale:Math.min(se,_e),tx:fe.tx,ty:fe.ty}}function F(ge,ne){return ge/(ne===void 0?1:ne)}function $(ge,ne){var se=ge.trace,_e=ne.h*(se.domain.y[1]-se.domain.y[0]);return Math.min(ge.titleBox.height,_e/2)}function q(ge){var ne=ge.pull;if(!ne)return 0;var se;if(n.isArrayOrTypedArray(ne))for(ne=0,se=0;sene&&(ne=ge.pull[se]);return ne}function G(ge,ne){var se,_e,oe,J,me,fe,Ce,Be,Oe,Ze,Ge,rt,_t;function pt(ze,Ee){return ze.pxmid[1]-Ee.pxmid[1]}function gt(ze,Ee){return Ee.pxmid[1]-ze.pxmid[1]}function ct(ze,Ee){Ee||(Ee={});var nt=Ee.labelExtraY+(_e?Ee.yLabelMax:Ee.yLabelMin),xt=_e?ze.yLabelMin:ze.yLabelMax,ut=_e?ze.yLabelMax:ze.yLabelMin,Et=ze.cyFinal+me(ze.px0[1],ze.px1[1]),Gt=nt-xt,Jt,gr,mr,Kr,ri,Mr;if(Gt*Ce>0&&(ze.labelExtraY=Gt),!!n.isArrayOrTypedArray(ne.pull))for(gr=0;gr=(b.castOption(ne.pull,mr.pts)||0))&&((ze.pxmid[1]-mr.pxmid[1])*Ce>0?(Kr=mr.cyFinal+me(mr.px0[1],mr.px1[1]),Gt=Kr-xt-ze.labelExtraY,Gt*Ce>0&&(ze.labelExtraY+=Gt)):(ut+ze.labelExtraY-Et)*Ce>0&&(Jt=3*fe*Math.abs(gr-Ze.indexOf(ze)),ri=mr.cxFinal+J(mr.px0[0],mr.px1[0]),Mr=ri+Jt-(ze.cxFinal+ze.pxmid[0])-ze.labelExtraX,Mr*fe>0&&(ze.labelExtraX+=Mr)))}for(_e=0;_e<2;_e++)for(oe=_e?pt:gt,me=_e?Math.max:Math.min,Ce=_e?1:-1,se=0;se<2;se++){for(J=se?Math.max:Math.min,fe=se?1:-1,Be=ge[_e][se],Be.sort(oe),Oe=ge[1-_e][se],Ze=Oe.concat(Be),rt=[],Ge=0;Ge1?(Be=se.r,Oe=Be/oe.aspectratio):(Oe=se.r,Be=Oe*oe.aspectratio),Be*=(1+oe.baseratio)/2,Ce=Be*Oe}me=Math.min(me,Ce/se.vTotal)}for(_e=0;_ene.vTotal/2?1:0,Be.halfangle=Math.PI*Math.min(Be.v/ne.vTotal,.5),Be.ring=1-_e.hole,Be.rInscribed=B(Be,ne))}function ve(ge,ne){return[ge*Math.sin(ne),-ge*Math.cos(ne)]}function ce(ge,ne,se){var _e=ge._fullLayout,oe=se.trace,J=oe.texttemplate,me=oe.textinfo;if(!J&&me&&me!=="none"){var fe=me.split("+"),Ce=function(Ee){return fe.indexOf(Ee)!==-1},Be=Ce("label"),Oe=Ce("text"),Ze=Ce("value"),Ge=Ce("percent"),rt=_e.separators,_t;if(_t=Be?[ne.label]:[],Oe){var pt=b.getFirstFilled(oe.text,ne.pts);_(pt)&&_t.push(pt)}Ze&&_t.push(b.formatPieValue(ne.v,rt)),Ge&&_t.push(b.formatPiePercent(ne.v/se.vTotal,rt)),ne.text=_t.join("
")}function gt(Ee){return{label:Ee.label,value:Ee.v,valueLabel:b.formatPieValue(Ee.v,_e.separators),percent:Ee.v/se.vTotal,percentLabel:b.formatPiePercent(Ee.v/se.vTotal,_e.separators),color:Ee.color,text:Ee.text,customdata:n.castOption(oe,Ee.i,"customdata")}}if(J){var ct=n.castOption(oe,ne.i,"texttemplate");if(!ct)ne.text="";else{var Ae=gt(ne),ze=b.getFirstFilled(oe.text,ne.pts);(_(ze)||ze==="")&&(Ae.text=ze),ne.text=n.texttemplateString({data:[Ae,oe._meta],fallback:oe.texttemplatefallback,labels:Ae,locale:ge._fullLayout._d3locale,template:ct})}}}function re(ge,ne){var se=ge.rotate*Math.PI/180,_e=Math.cos(se),oe=Math.sin(se),J=(ne.left+ne.right)/2,me=(ne.top+ne.bottom)/2;ge.textX=J*_e-me*oe,ge.textY=J*oe+me*_e,ge.noCenter=!0}Y.exports={plot:A,formatSliceLabel:ce,transformInsideText:I,determineInsideTextFont:D,positionTitleOutside:W,prerenderTitles:E,layoutAreas:ee,attachFxHandlers:k,computeTransform:re}}),eK=Fe((te,Y)=>{var d=ii(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var i=P._fullLayout._pielayer.selectAll(".trace");z(P,i,"pie"),i.each(function(n){var a=n[0],l=a.trace,o=d.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(u){d.select(this).call(y,u,l,P)})})}}),tK=Fe(te=>{var Y=sh();te.name="pie",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),rK=Fe((te,Y)=>{Y.exports={attributes:xb(),supplyDefaults:bb().supplyDefaults,supplyLayoutDefaults:JZ(),layoutAttributes:nC(),calc:Bw().calc,crossTraceCalc:Bw().crossTraceCalc,plot:aC().plot,style:eK(),styleOne:Wv(),moduleType:"trace",name:"pie",basePlotModule:tK(),categories:["pie-like","pie","showLegend"],meta:{}}}),iK=Fe((te,Y)=>{Y.exports=rK()}),nK=Fe(te=>{var Y=sh();te.name="sunburst",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),RP=Fe((te,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),r6=Fe((te,Y)=>{var d=_a(),{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=zc(),n=Xh().attributes,a=xb(),l=RP(),o=an().extendFlat,u=Wd().pattern;Y.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},a.marker.line.color,{dflt:null}),width:o({},a.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:a.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:z({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:a.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:y({},{keys:l.eventDataKeys}),hovertemplatefallback:P(),textfont:a.textfont,insidetextorientation:a.insidetextorientation,insidetextfont:a.insidetextfont,outsidetextfont:o({},a.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:a.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:n({name:"sunburst",trace:!0,editType:"calc"})}}),FP=Fe((te,Y)=>{Y.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),aK=Fe((te,Y)=>{var d=ji(),y=r6(),z=Xh().defaults,P=eg().handleText,i=bb().handleMarkerDefaults,n=lh(),a=n.hasColorscale,l=n.handleDefaults;Y.exports=function(o,u,s,h){function m(w,D){return d.coerce(o,u,y,w,D)}var b=m("labels"),x=m("parents");if(!b||!b.length||!x||!x.length){u.visible=!1;return}var _=m("values");_&&_.length?m("branchvalues"):m("count"),m("level"),m("maxdepth"),i(o,u,h,m);var A=u._hasColorscale=a(o,"marker","colors")||(o.marker||{}).coloraxis;A&&l(o,u,h,m,{prefix:"marker.",cLetter:"c"}),m("leaf.opacity",A?1:.7);var f=m("text");m("texttemplate"),m("texttemplatefallback"),u.texttemplate||m("textinfo",d.isArrayOrTypedArray(f)?"text+label":"label"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback");var k="auto";P(o,u,h,m,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("insidetextorientation"),m("sort"),m("rotation"),m("root.color"),z(u,h,m),u._length=null}}),oK=Fe((te,Y)=>{var d=ji(),y=FP();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("sunburstcolorway",P.colorway),i("extendsunburstcolors")}}),i6=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(De,ye){return De.parent===ye.parent?1:2}function z(De){return De.reduce(P,0)/De.length}function P(De,ye){return De+ye.x}function i(De){return 1+De.reduce(n,0)}function n(De,ye){return Math.max(De,ye.y)}function a(De){for(var ye;ye=De.children;)De=ye[0];return De}function l(De){for(var ye;ye=De.children;)De=ye[ye.length-1];return De}function o(){var De=y,ye=1,Pe=1,He=!1;function at(ht){var At,Wt=0;ht.eachAfter(function(br){var hi=br.children;hi?(br.x=z(hi),br.y=i(hi)):(br.x=At?Wt+=De(br,At):0,br.y=0,At=br)});var Kt=a(ht),hr=l(ht),zr=Kt.x-De(Kt,hr)/2,Dr=hr.x+De(hr,Kt)/2;return ht.eachAfter(He?function(br){br.x=(br.x-ht.x)*ye,br.y=(ht.y-br.y)*Pe}:function(br){br.x=(br.x-zr)/(Dr-zr)*ye,br.y=(1-(ht.y?br.y/ht.y:1))*Pe})}return at.separation=function(ht){return arguments.length?(De=ht,at):De},at.size=function(ht){return arguments.length?(He=!1,ye=+ht[0],Pe=+ht[1],at):He?null:[ye,Pe]},at.nodeSize=function(ht){return arguments.length?(He=!0,ye=+ht[0],Pe=+ht[1],at):He?[ye,Pe]:null},at}function u(De){var ye=0,Pe=De.children,He=Pe&&Pe.length;if(!He)ye=1;else for(;--He>=0;)ye+=Pe[He].value;De.value=ye}function s(){return this.eachAfter(u)}function h(De){var ye=this,Pe,He=[ye],at,ht,At;do for(Pe=He.reverse(),He=[];ye=Pe.pop();)if(De(ye),at=ye.children,at)for(ht=0,At=at.length;ht=0;--at)Pe.push(He[at]);return this}function b(De){for(var ye=this,Pe=[ye],He=[],at,ht,At;ye=Pe.pop();)if(He.push(ye),at=ye.children,at)for(ht=0,At=at.length;ht=0;)Pe+=He[at].value;ye.value=Pe})}function _(De){return this.eachBefore(function(ye){ye.children&&ye.children.sort(De)})}function A(De){for(var ye=this,Pe=f(ye,De),He=[ye];ye!==Pe;)ye=ye.parent,He.push(ye);for(var at=He.length;De!==Pe;)He.splice(at,0,De),De=De.parent;return He}function f(De,ye){if(De===ye)return De;var Pe=De.ancestors(),He=ye.ancestors(),at=null;for(De=Pe.pop(),ye=He.pop();De===ye;)at=De,De=Pe.pop(),ye=He.pop();return at}function k(){for(var De=this,ye=[De];De=De.parent;)ye.push(De);return ye}function w(){var De=[];return this.each(function(ye){De.push(ye)}),De}function D(){var De=[];return this.eachBefore(function(ye){ye.children||De.push(ye)}),De}function E(){var De=this,ye=[];return De.each(function(Pe){Pe!==De&&ye.push({source:Pe.parent,target:Pe})}),ye}function I(De,ye){var Pe=new T(De),He=+De.value&&(Pe.value=De.value),at,ht=[Pe],At,Wt,Kt,hr;for(ye==null&&(ye=p);at=ht.pop();)if(He&&(at.value=+at.data.value),(Wt=ye(at.data))&&(hr=Wt.length))for(at.children=new Array(hr),Kt=hr-1;Kt>=0;--Kt)ht.push(At=at.children[Kt]=new T(Wt[Kt])),At.parent=at,At.depth=at.depth+1;return Pe.eachBefore(C)}function M(){return I(this).eachBefore(g)}function p(De){return De.children}function g(De){De.data=De.data.data}function C(De){var ye=0;do De.height=ye;while((De=De.parent)&&De.height<++ye)}function T(De){this.data=De,this.depth=this.height=0,this.parent=null}T.prototype=I.prototype={constructor:T,count:s,each:h,eachAfter:b,eachBefore:m,sum:x,sort:_,path:A,ancestors:k,descendants:w,leaves:D,links:E,copy:M};var N=Array.prototype.slice;function B(De){for(var ye=De.length,Pe,He;ye;)He=Math.random()*ye--|0,Pe=De[ye],De[ye]=De[He],De[He]=Pe;return De}function U(De){for(var ye=0,Pe=(De=B(N.call(De))).length,He=[],at,ht;ye0&&Pe*Pe>He*He+at*at}function $(De,ye){for(var Pe=0;PeKt?(at=(hr+Kt-ht)/(2*hr),Wt=Math.sqrt(Math.max(0,Kt/hr-at*at)),Pe.x=De.x-at*He-Wt*At,Pe.y=De.y-at*At+Wt*He):(at=(hr+ht-Kt)/(2*hr),Wt=Math.sqrt(Math.max(0,ht/hr-at*at)),Pe.x=ye.x+at*He-Wt*At,Pe.y=ye.y+at*At+Wt*He)):(Pe.x=ye.x+Pe.r,Pe.y=ye.y)}function ve(De,ye){var Pe=De.r+ye.r-1e-6,He=ye.x-De.x,at=ye.y-De.y;return Pe>0&&Pe*Pe>He*He+at*at}function ce(De){var ye=De._,Pe=De.next._,He=ye.r+Pe.r,at=(ye.x*Pe.r+Pe.x*ye.r)/He,ht=(ye.y*Pe.r+Pe.y*ye.r)/He;return at*at+ht*ht}function re(De){this._=De,this.next=null,this.previous=null}function ge(De){if(!(at=De.length))return 0;var ye,Pe,He,at,ht,At,Wt,Kt,hr,zr,Dr;if(ye=De[0],ye.x=0,ye.y=0,!(at>1))return ye.r;if(Pe=De[1],ye.x=-Pe.r,Pe.x=ye.r,Pe.y=0,!(at>2))return ye.r+Pe.r;xe(Pe,ye,He=De[2]),ye=new re(ye),Pe=new re(Pe),He=new re(He),ye.next=He.previous=Pe,Pe.next=ye.previous=He,He.next=Pe.previous=ye;e:for(Wt=3;Wt0)throw new Error("cycle");return Wt}return Pe.id=function(He){return arguments.length?(De=_e(He),Pe):De},Pe.parentId=function(He){return arguments.length?(ye=_e(He),Pe):ye},Pe}function Ee(De,ye){return De.parent===ye.parent?1:2}function nt(De){var ye=De.children;return ye?ye[0]:De.t}function xt(De){var ye=De.children;return ye?ye[ye.length-1]:De.t}function ut(De,ye,Pe){var He=Pe/(ye.i-De.i);ye.c-=He,ye.s+=Pe,De.c+=He,ye.z+=Pe,ye.m+=Pe}function Et(De){for(var ye=0,Pe=0,He=De.children,at=He.length,ht;--at>=0;)ht=He[at],ht.z+=ye,ht.m+=ye,ye+=ht.s+(Pe+=ht.c)}function Gt(De,ye,Pe){return De.a.parent===ye.parent?De.a:Pe}function Jt(De,ye){this._=De,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=ye}Jt.prototype=Object.create(T.prototype);function gr(De){for(var ye=new Jt(De,0),Pe,He=[ye],at,ht,At,Wt;Pe=He.pop();)if(ht=Pe._.children)for(Pe.children=new Array(Wt=ht.length),At=Wt-1;At>=0;--At)He.push(at=Pe.children[At]=new Jt(ht[At],At)),at.parent=Pe;return(ye.parent=new Jt(null,0)).children=[ye],ye}function mr(){var De=Ee,ye=1,Pe=1,He=null;function at(hr){var zr=gr(hr);if(zr.eachAfter(ht),zr.parent.m=-zr.z,zr.eachBefore(At),He)hr.eachBefore(Kt);else{var Dr=hr,br=hr,hi=hr;hr.eachBefore(function(Sn){Sn.xbr.x&&(br=Sn),Sn.depth>hi.depth&&(hi=Sn)});var un=Dr===br?1:De(Dr,br)/2,cn=un-Dr.x,yn=ye/(br.x+un+cn),Wn=Pe/(hi.depth||1);hr.eachBefore(function(Sn){Sn.x=(Sn.x+cn)*yn,Sn.y=Sn.depth*Wn})}return hr}function ht(hr){var zr=hr.children,Dr=hr.parent.children,br=hr.i?Dr[hr.i-1]:null;if(zr){Et(hr);var hi=(zr[0].z+zr[zr.length-1].z)/2;br?(hr.z=br.z+De(hr._,br._),hr.m=hr.z-hi):hr.z=hi}else br&&(hr.z=br.z+De(hr._,br._));hr.parent.A=Wt(hr,br,hr.parent.A||Dr[0])}function At(hr){hr._.x=hr.z+hr.parent.m,hr.m+=hr.parent.m}function Wt(hr,zr,Dr){if(zr){for(var br=hr,hi=hr,un=zr,cn=br.parent.children[0],yn=br.m,Wn=hi.m,Sn=un.m,fn=cn.m,ga;un=xt(un),br=nt(br),un&&br;)cn=nt(cn),hi=xt(hi),hi.a=hr,ga=un.z+Sn-br.z-yn+De(un._,br._),ga>0&&(ut(Gt(un,hr,Dr),hr,ga),yn+=ga,Wn+=ga),Sn+=un.m,yn+=br.m,fn+=cn.m,Wn+=hi.m;un&&!xt(hi)&&(hi.t=un,hi.m+=Sn-Wn),br&&!nt(cn)&&(cn.t=br,cn.m+=yn-fn,Dr=hr)}return Dr}function Kt(hr){hr.x*=ye,hr.y=hr.depth*Pe}return at.separation=function(hr){return arguments.length?(De=hr,at):De},at.size=function(hr){return arguments.length?(He=!1,ye=+hr[0],Pe=+hr[1],at):He?null:[ye,Pe]},at.nodeSize=function(hr){return arguments.length?(He=!0,ye=+hr[0],Pe=+hr[1],at):He?[ye,Pe]:null},at}function Kr(De,ye,Pe,He,at){for(var ht=De.children,At,Wt=-1,Kt=ht.length,hr=De.value&&(at-Pe)/De.value;++WtSn&&(Sn=hr),Zt=yn*yn*na,fn=Math.max(Sn/Zt,Zt/Wn),fn>ga){yn-=hr;break}ga=fn}At.push(Kt={value:yn,dice:hi1?He:1)},Pe}(ri);function mi(){var De=ui,ye=!1,Pe=1,He=1,at=[0],ht=oe,At=oe,Wt=oe,Kt=oe,hr=oe;function zr(br){return br.x0=br.y0=0,br.x1=Pe,br.y1=He,br.eachBefore(Dr),at=[0],ye&&br.eachBefore(Ze),br}function Dr(br){var hi=at[br.depth],un=br.x0+hi,cn=br.y0+hi,yn=br.x1-hi,Wn=br.y1-hi;yn=br-1){var Sn=ht[Dr];Sn.x0=un,Sn.y0=cn,Sn.x1=yn,Sn.y1=Wn;return}for(var fn=hr[Dr],ga=hi/2+fn,na=Dr+1,Zt=br-1;na>>1;hr[sr]Wn-cn){var fi=(un*Cr+yn*_r)/hi;zr(Dr,na,_r,un,cn,fi,Wn),zr(na,br,Cr,fi,cn,yn,Wn)}else{var qi=(cn*Cr+Wn*_r)/hi;zr(Dr,na,_r,un,cn,yn,qi),zr(na,br,Cr,un,qi,yn,Wn)}}}function Je(De,ye,Pe,He,at){(De.depth&1?Kr:Ge)(De,ye,Pe,He,at)}var ot=function De(ye){function Pe(He,at,ht,At,Wt){if((Kt=He._squarify)&&Kt.ratio===ye)for(var Kt,hr,zr,Dr,br=-1,hi,un=Kt.length,cn=He.value;++br1?He:1)},Pe}(ri);d.cluster=o,d.hierarchy=I,d.pack=fe,d.packEnclose=U,d.packSiblings=ne,d.partition=rt,d.stratify=ze,d.tree=mr,d.treemap=mi,d.treemapBinary=Ot,d.treemapDice=Ge,d.treemapResquarify=ot,d.treemapSlice=Kr,d.treemapSliceDice=Je,d.treemapSquarify=ui,Object.defineProperty(d,"__esModule",{value:!0})})}),n6=Fe(te=>{var Y=i6(),d=Ar(),y=ji(),z=lh().makeColorScaleFuncFromTrace,P=Bw().makePullColorFn,i=Bw().generateExtendedColors,n=lh().calc,a=ti().ALMOST_EQUAL,l={},o={},u={};te.calc=function(h,m){var b=h._fullLayout,x=m.ids,_=y.isArrayOrTypedArray(x),A=m.labels,f=m.parents,k=m.values,w=y.isArrayOrTypedArray(k),D=[],E={},I={},M=function(ne,se){E[ne]?E[ne].push(se):E[ne]=[se],I[se]=1},p=function(ne){return ne||typeof ne=="number"},g=function(ne){return!w||d(k[ne])&&k[ne]>=0},C,T,N;_?(C=Math.min(x.length,f.length),T=function(ne){return p(x[ne])&&g(ne)},N=function(ne){return String(x[ne])}):(C=Math.min(A.length,f.length),T=function(ne){return p(A[ne])&&g(ne)},N=function(ne){return String(A[ne])}),w&&(C=Math.min(C,k.length));for(var B=0;B1){for(var F=y.randstr(),$=0;${var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt32BE,P=d("8BPS\0");Y.exports=function(i){if(!(i.length<22)&&y(i,0,P))return{width:z(i,18),height:z(i,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}),$Z=ze((te,Y)=>{function d(h){return h===32||h===9||h===13||h===10}function y(h){return typeof h=="number"&&isFinite(h)&&h>0}function z(h){var m=0,b=h.length;for(h[0]===239&&h[1]===187&&h[2]===191&&(m=3);m]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,n=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,a=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,l=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,o=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function u(h){var m=h.match(n),b=h.match(a),x=h.match(l);return{width:m&&(m[1]||m[2]),height:b&&(b[1]||b[2]),viewbox:x&&(x[1]||x[2])}}function s(h){return o.test(h)?h.match(o)[0]:"px"}Y.exports=function(h){if(z(h)){for(var m="",b=0;b{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt16BE,i=Ch().readUInt32LE,n=Ch().readUInt32BE,a=d("II*\0"),l=d("MM\0*");function o(h,m,b){return b?P(h,m):z(h,m)}function u(h,m,b){return b?n(h,m):i(h,m)}function s(h,m,b){var x=o(h,m+2,b),_=u(h,m+4,b);return _!==1||x!==3&&x!==4?null:x===3?o(h,m+8,b):u(h,m+8,b)}Y.exports=function(h){if(!(h.length<8)&&!(!y(h,0,a)&&!y(h,0,l))){var m=h[0]===77,b=u(h,4,m)-8;if(!(b<0)){var x=b+8;if(!(h.length-x<2)){var _=o(h,x+0,m)*12;if(!(_<=0)&&(x+=2,!(h.length-x<_))){var A,f,k,w;for(A=0;A<_;A+=12)w=o(h,x+A,m),w===256?f=s(h,x+A,m):w===257&&(k=s(h,x+A,m));if(f&&k)return{width:f,height:k,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}}}}}}}),VZ=ze((te,Y)=>{var d=Ch().str2arr,y=Ch().sliceEq,z=Ch().readUInt16LE,P=Ch().readUInt32LE,i=aC(),n=d("RIFF"),a=d("WEBP");function l(s,h){if(!(s[h+3]!==157||s[h+4]!==1||s[h+5]!==42))return{width:z(s,h+6)&16383,height:z(s,h+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function o(s,h){if(s[h]===47){var m=P(s,h+1);return{width:(m&16383)+1,height:(m>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function u(s,h){return{width:(s[h+6]<<16|s[h+5]<<8|s[h+4])+1,height:(s[h+9]<s.length)){for(;h+8=10?m=m||l(s,h+8):_==="VP8L"&&A>=9?m=m||o(s,h+8):_==="VP8X"&&A>=10?m=m||u(s,h+8):_==="EXIF"&&(b=i.get_orientation(s.slice(h+8,h+8+A)),h=1/0),h+=8+A}if(m)return b>0&&(m.orientation=b),m}}}}),WZ=ze((te,Y)=>{Y.exports={avif:OZ(),bmp:BZ(),gif:RZ(),ico:FZ(),jpeg:NZ(),png:jZ(),psd:UZ(),svg:$Z(),tiff:HZ(),webp:VZ()}}),qZ=ze((te,Y)=>{var d=WZ();function y(z){for(var P=Object.keys(d),i=0;i{var Y=qZ(),d=Y0().IMAGE_URL_PREFIX,y=vb().Buffer;te.getImageSize=function(z){var P=z.replace(d,""),i=new y(P,"base64");return Y(i)}}),ZZ=ze((te,Y)=>{var d=ji(),y=Dw(),z=Sr(),P=Os(),i=ji().maxRowLength,n=GZ().getImageSize;Y.exports=function(u,s){var h,m;if(s._hasZ)h=s.z.length,m=i(s.z);else if(s._hasSource){var b=n(s.source);h=b.height,m=b.width}var x=P.getFromId(u,s.xaxis||"x"),_=P.getFromId(u,s.yaxis||"y"),A=x.d2c(s.x0)-s.dx/2,f=_.d2c(s.y0)-s.dy/2,k,w=[A,A+m*s.dx],D=[f,f+h*s.dy];if(x&&x.type==="log")for(k=0;k{var d=ri(),y=ji(),z=y.strTranslate,P=k0(),i=Dw(),n=$L(),a=jS().STYLE;Y.exports=function(l,o,u,s){var h=o.xaxis,m=o.yaxis,b=!l._context._exportedPlot&&n();y.makeTraceGroups(s,u,"im").each(function(x){var _=d.select(this),A=x[0],f=A.trace,k=(f.zsmooth==="fast"||f.zsmooth===!1&&b)&&!f._hasZ&&f._hasSource&&h.type==="linear"&&m.type==="linear";f._realImage=k;var w=A.z,D=A.x0,E=A.y0,I=A.w,M=A.h,p=f.dx,g=f.dy,C,T,N,B,U,V;for(V=0;C===void 0&&V0;)T=h.c2p(D+V*p),V--;for(V=0;B===void 0&&V0;)U=m.c2p(E+V*g),V--;if(Tce[0];if(re||ge){var ne=C+F/2,se=B+H/2;be+="transform:"+z(ne+"px",se+"px")+"scale("+(re?-1:1)+","+(ge?-1:1)+")"+z(-ne+"px",-se+"px")+";"}}he.attr("style",be);var _e=new Promise(function(oe){if(f._hasZ)oe();else if(f._hasSource)if(f._canvas&&f._canvas.el.width===I&&f._canvas.el.height===M&&f._canvas.source===f.source)oe();else{var J=document.createElement("canvas");J.width=I,J.height=M;var me=J.getContext("2d",{willReadFrequently:!0});f._image=f._image||new Image;var fe=f._image;fe.onload=function(){me.drawImage(fe,0,0),f._canvas={el:J,source:f.source},oe()},fe.setAttribute("src",f.source)}}).then(function(){var oe,J;if(f._hasZ)J=ee(function(Ce,Re){var Be=w[Re][Ce];return y.isTypedArray(Be)&&(Be=Array.from(Be)),Be}),oe=J.toDataURL("image/png");else if(f._hasSource)if(k)oe=f.source;else{var me=f._canvas.el.getContext("2d",{willReadFrequently:!0}),fe=me.getImageData(0,0,I,M).data;J=ee(function(Ce,Re){var Be=4*(Re*I+Ce);return[fe[Be],fe[Be+1],fe[Be+2],fe[Be+3]]}),oe=J.toDataURL("image/png")}he.attr({"xlink:href":oe,height:H,width:F,x:C,y:B})});l._promises.push(_e)})}}),YZ=ze((te,Y)=>{var d=ri();Y.exports=function(y){d.select(y).selectAll(".im image").style("opacity",function(z){return z[0].trace.opacity})}}),XZ=ze((te,Y)=>{var d=hf(),y=ji(),z=y.isArrayOrTypedArray,P=Dw();Y.exports=function(i,n,a){var l=i.cd[0],o=l.trace,u=i.xa,s=i.ya;if(!(d.inbox(n-l.x0,n-(l.x0+l.w*o.dx),0)>0||d.inbox(a-l.y0,a-(l.y0+l.h*o.dy),0)>0)){var h=Math.floor((n-l.x0)/o.dx),m=Math.floor(Math.abs(a-l.y0)/o.dy),b;if(o._hasZ?b=l.z[m][h]:o._hasSource&&(b=o._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(h,m,1,1).data),!!b){var x=l.hi||o.hoverinfo,_;if(x){var A=x.split("+");A.indexOf("all")!==-1&&(A=["color"]),A.indexOf("color")!==-1&&(_=!0)}var f=P.colormodel[o.colormodel],k=f.colormodel||o.colormodel,w=k.length,D=o._scaler(b),E=f.suffix,I=[];(o.hovertemplate||_)&&(I.push("["+[D[0]+E[0],D[1]+E[1],D[2]+E[2]].join(", ")),w===4&&I.push(", "+D[3]+E[3]),I.push("]"),I=I.join(""),i.extraText=k.toUpperCase()+": "+I);var M;z(o.hovertext)&&z(o.hovertext[m])?M=o.hovertext[m][h]:z(o.text)&&z(o.text[m])&&(M=o.text[m][h]);var p=s.c2p(l.y0+(m+.5)*o.dy),g=l.x0+(h+.5)*o.dx,C=l.y0+(m+.5)*o.dy,T="["+b.slice(0,o.colormodel.length).join(", ")+"]";return[y.extendFlat(i,{index:[m,h],x0:u.c2p(l.x0+h*o.dx),x1:u.c2p(l.x0+(h+1)*o.dx),y0:p,y1:p,color:D,xVal:g,xLabelVal:g,yVal:C,yLabelVal:C,zLabelVal:T,text:M,hovertemplateLabels:{zLabel:T,colorLabel:I,"color[0]Label":D[0]+E[0],"color[1]Label":D[1]+E[1],"color[2]Label":D[2]+E[2],"color[3]Label":D[3]+E[3]}})]}}}}),JZ=ze((te,Y)=>{Y.exports=function(d,y){return"xVal"in y&&(d.x=y.xVal),"yVal"in y&&(d.y=y.yVal),y.xa&&(d.xaxis=y.xa),y.ya&&(d.yaxis=y.ya),d.color=y.color,d.colormodel=y.trace.colormodel,d.z||(d.z=y.color),d}}),QZ=ze((te,Y)=>{Y.exports={attributes:pP(),supplyDefaults:OG(),calc:ZZ(),plot:KZ(),style:YZ(),hoverPoints:XZ(),eventData:JZ(),moduleType:"trace",name:"image",basePlotModule:Ff(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}),eK=ze((te,Y)=>{Y.exports=QZ()}),bb=ze((te,Y)=>{var d=xa(),y=Xh().attributes,z=On(),P=Mi(),{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=nn().extendFlat,o=qd().pattern,u=z({editType:"plot",arrayOk:!0,colorEditType:"plot"});Y.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:P.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:i({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:a(),texttemplate:n({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:a({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:y({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}),wb=ze((te,Y)=>{var d=Sr(),y=ji(),z=bb(),P=Xh().defaults,i=tg().handleText,n=ji().coercePattern;function a(u,s){var h=y.isArrayOrTypedArray(u),m=y.isArrayOrTypedArray(s),b=Math.min(h?u.length:1/0,m?s.length:1/0);if(isFinite(b)||(b=0),b&&m){for(var x,_=0;_0){x=!0;break}}x||(b=0)}return{hasLabels:h,hasValues:m,len:b}}function l(u,s,h,m,b){var x=m("marker.line.width");x&&m("marker.line.color",b?void 0:h.paper_bgcolor);var _=m("marker.colors");n(m,"marker.pattern",_),u.marker&&!s.marker.pattern.fgcolor&&(s.marker.pattern.fgcolor=u.marker.colors),s.marker.pattern.bgcolor||(s.marker.pattern.bgcolor=h.paper_bgcolor)}function o(u,s,h,m){function b(T,N){return y.coerce(u,s,z,T,N)}var x=b("labels"),_=b("values"),A=a(x,_),f=A.len;if(s._hasLabels=A.hasLabels,s._hasValues=A.hasValues,!s._hasLabels&&s._hasValues&&(b("label0"),b("dlabel")),!f){s.visible=!1;return}s._length=f,l(u,s,m,b,!0),b("scalegroup");var k=b("text"),w=b("texttemplate");b("texttemplatefallback");var D;if(w||(D=b("textinfo",y.isArrayOrTypedArray(k)?"text+percent":"percent")),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),w||D&&D!=="none"){var E=b("textposition");i(u,s,m,b,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var I=Array.isArray(E)||E==="auto",M=I||E==="outside";M&&b("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&b("insidetextorientation")}else D==="none"&&b("textposition","none");P(s,m,b);var p=b("hole"),g=b("title.text");if(g){var C=b("title.position",p?"middle center":"top center");!p&&C==="middle center"&&(s.title.position="top center"),y.coerceFont(b,"title.font",m.font)}b("sort"),b("direction"),b("rotation"),b("pull")}Y.exports={handleLabelsAndValues:a,handleMarkerDefaults:l,supplyDefaults:o}}),oC=ze((te,Y)=>{Y.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),tK=ze((te,Y)=>{var d=ji(),y=oC();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("hiddenlabels"),i("piecolorway",P.colorway),i("extendpiecolors")}}),Fw=ze((te,Y)=>{var d=Sr(),y=ln(),z=Xi(),P={};function i(o,u){var s=[],h=o._fullLayout,m=h.hiddenlabels||[],b=u.labels,x=u.marker.colors||[],_=u.values,A=u._length,f=u._hasValues&&A,k,w;if(u.dlabel)for(b=new Array(A),k=0;k=0});var N=u.type==="funnelarea"?M:u.sort;return N&&s.sort(function(B,U){return U.v-B.v}),s[0]&&(s[0].vTotal=I),s}function n(o){return function(u,s){return!u||(u=y(u),!u.isValid())?!1:(u=z.addOpacity(u,u.getAlpha()),o[s]||(o[s]=u),u)}}function a(o,u){var s=(u||{}).type;s||(s="pie");var h=o._fullLayout,m=o.calcdata,b=h[s+"colorway"],x=h["_"+s+"colormap"];h["extend"+s+"colors"]&&(b=l(b,P));for(var _=0,A=0;A{var d=T0().appendArrayMultiPointValues;Y.exports=function(y,z){var P={curveNumber:z.index,pointNumbers:y.pts,data:z._input,fullData:z,label:y.label,color:y.color,value:y.v,percent:y.percent,text:y.text,bbox:y.bbox,v:y.v};return y.pts.length===1&&(P.pointNumber=P.i=y.pts[0]),d(P,z,y.pts),z.type==="funnelarea"&&(delete P.v,delete P.i),P}}),sC=ze((te,Y)=>{var d=ri(),y=sh(),z=hf(),P=Xi(),i=Zs(),n=ji(),a=n.strScale,l=n.strTranslate,o=cc(),u=C0(),s=u.recordMinTextSize,h=u.clearMinTextSize,m=mb().TEXTPAD,b=Hv(),x=rK(),_=ji().isValidTextValue;function A(ge,ne){var se=ge._context.staticPlot,_e=ge._fullLayout,oe=_e._size;h("pie",_e),E(ne,ge),ee(ne,oe);var J=n.makeTraceGroups(_e._pielayer,ne,"trace").each(function(me){var fe=d.select(this),Ce=me[0],Re=Ce.trace;be(me),fe.attr("stroke-linejoin","round"),fe.each(function(){var Be=d.select(this).selectAll("g.slice").data(me);Be.enter().append("g").classed("slice",!0),Be.exit().remove();var Ze=[[[],[]],[[],[]]],Ge=!1;Be.each(function(Le,nt){if(Le.hidden){d.select(this).selectAll("path,g").remove();return}Le.pointNumber=Le.i,Le.curveNumber=Re.index,Ze[Le.pxmid[1]<0?0:1][Le.pxmid[0]<0?0:1].push(Le);var xt=Ce.cx,ut=Ce.cy,Et=d.select(this),Gt=Et.selectAll("path.surface").data([Le]);if(Gt.enter().append("path").classed("surface",!0).style({"pointer-events":se?"none":"all"}),Et.call(k,ge,me),Re.pull){var Qt=+b.castOption(Re.pull,Le.pts)||0;Qt>0&&(xt+=Qt*Le.pxmid[0],ut+=Qt*Le.pxmid[1])}Le.cxFinal=xt,Le.cyFinal=ut;function vr(Ot,Xe,ot,De){var ye=De*(Xe[0]-Ot[0]),Pe=De*(Xe[1]-Ot[1]);return"a"+De*Ce.r+","+De*Ce.r+" 0 "+Le.largeArc+(ot?" 1 ":" 0 ")+ye+","+Pe}var mr=Re.hole;if(Le.v===Ce.vTotal){var Yr="M"+(xt+Le.px0[0])+","+(ut+Le.px0[1])+vr(Le.px0,Le.pxmid,!0,1)+vr(Le.pxmid,Le.px0,!0,1)+"Z";mr?Gt.attr("d","M"+(xt+mr*Le.px0[0])+","+(ut+mr*Le.px0[1])+vr(Le.px0,Le.pxmid,!1,mr)+vr(Le.pxmid,Le.px0,!1,mr)+"Z"+Yr):Gt.attr("d",Yr)}else{var ii=vr(Le.px0,Le.px1,!0,1);if(mr){var Lr=1-mr;Gt.attr("d","M"+(xt+mr*Le.px1[0])+","+(ut+mr*Le.px1[1])+vr(Le.px1,Le.px0,!1,mr)+"l"+Lr*Le.px0[0]+","+Lr*Le.px0[1]+ii+"Z")}else Gt.attr("d","M"+xt+","+ut+"l"+Le.px0[0]+","+Le.px0[1]+ii+"Z")}ce(ge,Le,Ce);var ci=b.castOption(Re.textposition,Le.pts),vi=Et.selectAll("g.slicetext").data(Le.text&&ci!=="none"?[0]:[]);vi.enter().append("g").classed("slicetext",!0),vi.exit().remove(),vi.each(function(){var Ot=n.ensureSingle(d.select(this),"text","",function(ht){ht.attr("data-notex",1)}),Xe=n.ensureUniformFontSize(ge,ci==="outside"?w(Re,Le,_e.font):D(Re,Le,_e.font));Ot.text(Le.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(i.font,Xe).call(o.convertToTspans,ge);var ot=i.bBox(Ot.node()),De;if(ci==="outside")De=U(ot,Le);else if(De=I(ot,Le,Ce),ci==="auto"&&De.scale<1){var ye=n.ensureUniformFontSize(ge,Re.outsidetextfont);Ot.call(i.font,ye),ot=i.bBox(Ot.node()),De=U(ot,Le)}var Pe=De.textPosAngle,He=Pe===void 0?Le.pxmid:ve(Ce.r,Pe);if(De.targetX=xt+He[0]*De.rCenter+(De.x||0),De.targetY=ut+He[1]*De.rCenter+(De.y||0),re(De,ot),De.outside){var at=De.targetY;Le.yLabelMin=at-ot.height/2,Le.yLabelMid=at,Le.yLabelMax=at+ot.height/2,Le.labelExtraX=0,Le.labelExtraY=0,Ge=!0}De.fontSize=Xe.size,s(Re.type,De,_e),me[nt].transform=De,n.setTransormAndDisplay(Ot,De)})});var tt=d.select(this).selectAll("g.titletext").data(Re.title.text?[0]:[]);if(tt.enter().append("g").classed("titletext",!0),tt.exit().remove(),tt.each(function(){var Le=n.ensureSingle(d.select(this),"text","",function(ut){ut.attr("data-notex",1)}),nt=Re.title.text;Re._meta&&(nt=n.templateString(nt,Re._meta)),Le.text(nt).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(i.font,Re.title.font).call(o.convertToTspans,ge);var xt;Re.title.position==="middle center"?xt=V(Ce):xt=W(Ce,oe),Le.attr("transform",l(xt.x,xt.y)+a(Math.min(1,xt.scale))+l(xt.tx,xt.ty))}),Ge&&G(Ze,Re),f(Be,Re),Ge&&Re.automargin){var _t=i.bBox(fe.node()),mt=Re.domain,vt=oe.w*(mt.x[1]-mt.x[0]),ct=oe.h*(mt.y[1]-mt.y[0]),Ae=(.5*vt-Ce.r)/oe.w,Oe=(.5*ct-Ce.r)/oe.h;y.autoMargin(ge,"pie."+Re.uid+".automargin",{xl:mt.x[0]-Ae,xr:mt.x[1]+Ae,yb:mt.y[0]-Oe,yt:mt.y[1]+Oe,l:Math.max(Ce.cx-Ce.r-_t.left,0),r:Math.max(_t.right-(Ce.cx+Ce.r),0),b:Math.max(_t.bottom-(Ce.cy+Ce.r),0),t:Math.max(Ce.cy-Ce.r-_t.top,0),pad:5})}})});setTimeout(function(){J.selectAll("tspan").each(function(){var me=d.select(this);me.attr("dy")&&me.attr("dy",me.attr("dy"))})},0)}function f(ge,ne){ge.each(function(se){var _e=d.select(this);if(!se.labelExtraX&&!se.labelExtraY){_e.select("path.textline").remove();return}var oe=_e.select("g.slicetext text");se.transform.targetX+=se.labelExtraX,se.transform.targetY+=se.labelExtraY,n.setTransormAndDisplay(oe,se.transform);var J=se.cxFinal+se.pxmid[0],me=se.cyFinal+se.pxmid[1],fe="M"+J+","+me,Ce=(se.yLabelMax-se.yLabelMin)*(se.pxmid[0]<0?-1:1)/4;if(se.labelExtraX){var Re=se.labelExtraX*se.pxmid[1]/se.pxmid[0],Be=se.yLabelMid+se.labelExtraY-(se.cyFinal+se.pxmid[1]);Math.abs(Re)>Math.abs(Be)?fe+="l"+Be*se.pxmid[0]/se.pxmid[1]+","+Be+"H"+(J+se.labelExtraX+Ce):fe+="l"+se.labelExtraX+","+Re+"v"+(Be-Re)+"h"+Ce}else fe+="V"+(se.yLabelMid+se.labelExtraY)+"h"+Ce;n.ensureSingle(_e,"path","textline").call(P.stroke,ne.outsidetextfont.color).attr({"stroke-width":Math.min(2,ne.outsidetextfont.size/8),d:fe,fill:"none"})})}function k(ge,ne,se){var _e=se[0],oe=_e.cx,J=_e.cy,me=_e.trace,fe=me.type==="funnelarea";"_hasHoverLabel"in me||(me._hasHoverLabel=!1),"_hasHoverEvent"in me||(me._hasHoverEvent=!1),ge.on("mouseover",function(Ce){var Re=ne._fullLayout,Be=ne._fullData[me.index];if(!(ne._dragging||Re.hovermode===!1)){var Ze=Be.hoverinfo;if(Array.isArray(Ze)&&(Ze=z.castHoverinfo({hoverinfo:[b.castOption(Ze,Ce.pts)],_module:me._module},Re,0)),Ze==="all"&&(Ze="label+text+value+percent+name"),Be.hovertemplate||Ze!=="none"&&Ze!=="skip"&&Ze){var Ge=Ce.rInscribed||0,tt=oe+Ce.pxmid[0]*(1-Ge),_t=J+Ce.pxmid[1]*(1-Ge),mt=Re.separators,vt=[];if(Ze&&Ze.indexOf("label")!==-1&&vt.push(Ce.label),Ce.text=b.castOption(Be.hovertext||Be.text,Ce.pts),Ze&&Ze.indexOf("text")!==-1){var ct=Ce.text;n.isValidTextValue(ct)&&vt.push(ct)}Ce.value=Ce.v,Ce.valueLabel=b.formatPieValue(Ce.v,mt),Ze&&Ze.indexOf("value")!==-1&&vt.push(Ce.valueLabel),Ce.percent=Ce.v/_e.vTotal,Ce.percentLabel=b.formatPiePercent(Ce.percent,mt),Ze&&Ze.indexOf("percent")!==-1&&vt.push(Ce.percentLabel);var Ae=Be.hoverlabel,Oe=Ae.font,Le=[];z.loneHover({trace:me,x0:tt-Ge*_e.r,x1:tt+Ge*_e.r,y:_t,_x0:fe?oe+Ce.TL[0]:tt-Ge*_e.r,_x1:fe?oe+Ce.TR[0]:tt+Ge*_e.r,_y0:fe?J+Ce.TL[1]:_t-Ge*_e.r,_y1:fe?J+Ce.BL[1]:_t+Ge*_e.r,text:vt.join("
"),name:Be.hovertemplate||Ze.indexOf("name")!==-1?Be.name:void 0,idealAlign:Ce.pxmid[0]<0?"left":"right",color:b.castOption(Ae.bgcolor,Ce.pts)||Ce.color,borderColor:b.castOption(Ae.bordercolor,Ce.pts),fontFamily:b.castOption(Oe.family,Ce.pts),fontSize:b.castOption(Oe.size,Ce.pts),fontColor:b.castOption(Oe.color,Ce.pts),nameLength:b.castOption(Ae.namelength,Ce.pts),textAlign:b.castOption(Ae.align,Ce.pts),hovertemplate:b.castOption(Be.hovertemplate,Ce.pts),hovertemplateLabels:Ce,eventData:[x(Ce,Be)]},{container:Re._hoverlayer.node(),outerContainer:Re._paper.node(),gd:ne,inOut_bbox:Le}),Ce.bbox=Le[0],me._hasHoverLabel=!0}me._hasHoverEvent=!0,ne.emit("plotly_hover",{points:[x(Ce,Be)],event:d.event})}}),ge.on("mouseout",function(Ce){var Re=ne._fullLayout,Be=ne._fullData[me.index],Ze=d.select(this).datum();me._hasHoverEvent&&(Ce.originalEvent=d.event,ne.emit("plotly_unhover",{points:[x(Ze,Be)],event:d.event}),me._hasHoverEvent=!1),me._hasHoverLabel&&(z.loneUnhover(Re._hoverlayer.node()),me._hasHoverLabel=!1)}),ge.on("click",function(Ce){var Re=ne._fullLayout,Be=ne._fullData[me.index];ne._dragging||Re.hovermode===!1||(ne._hoverdata=[x(Ce,Be)],z.click(ne,d.event))})}function w(ge,ne,se){var _e=b.castOption(ge.outsidetextfont.color,ne.pts)||b.castOption(ge.textfont.color,ne.pts)||se.color,oe=b.castOption(ge.outsidetextfont.family,ne.pts)||b.castOption(ge.textfont.family,ne.pts)||se.family,J=b.castOption(ge.outsidetextfont.size,ne.pts)||b.castOption(ge.textfont.size,ne.pts)||se.size,me=b.castOption(ge.outsidetextfont.weight,ne.pts)||b.castOption(ge.textfont.weight,ne.pts)||se.weight,fe=b.castOption(ge.outsidetextfont.style,ne.pts)||b.castOption(ge.textfont.style,ne.pts)||se.style,Ce=b.castOption(ge.outsidetextfont.variant,ne.pts)||b.castOption(ge.textfont.variant,ne.pts)||se.variant,Re=b.castOption(ge.outsidetextfont.textcase,ne.pts)||b.castOption(ge.textfont.textcase,ne.pts)||se.textcase,Be=b.castOption(ge.outsidetextfont.lineposition,ne.pts)||b.castOption(ge.textfont.lineposition,ne.pts)||se.lineposition,Ze=b.castOption(ge.outsidetextfont.shadow,ne.pts)||b.castOption(ge.textfont.shadow,ne.pts)||se.shadow;return{color:_e,family:oe,size:J,weight:me,style:fe,variant:Ce,textcase:Re,lineposition:Be,shadow:Ze}}function D(ge,ne,se){var _e=b.castOption(ge.insidetextfont.color,ne.pts);!_e&&ge._input.textfont&&(_e=b.castOption(ge._input.textfont.color,ne.pts));var oe=b.castOption(ge.insidetextfont.family,ne.pts)||b.castOption(ge.textfont.family,ne.pts)||se.family,J=b.castOption(ge.insidetextfont.size,ne.pts)||b.castOption(ge.textfont.size,ne.pts)||se.size,me=b.castOption(ge.insidetextfont.weight,ne.pts)||b.castOption(ge.textfont.weight,ne.pts)||se.weight,fe=b.castOption(ge.insidetextfont.style,ne.pts)||b.castOption(ge.textfont.style,ne.pts)||se.style,Ce=b.castOption(ge.insidetextfont.variant,ne.pts)||b.castOption(ge.textfont.variant,ne.pts)||se.variant,Re=b.castOption(ge.insidetextfont.textcase,ne.pts)||b.castOption(ge.textfont.textcase,ne.pts)||se.textcase,Be=b.castOption(ge.insidetextfont.lineposition,ne.pts)||b.castOption(ge.textfont.lineposition,ne.pts)||se.lineposition,Ze=b.castOption(ge.insidetextfont.shadow,ne.pts)||b.castOption(ge.textfont.shadow,ne.pts)||se.shadow;return{color:_e||P.contrast(ne.color),family:oe,size:J,weight:me,style:fe,variant:Ce,textcase:Re,lineposition:Be,shadow:Ze}}function E(ge,ne){for(var se,_e,oe=0;oe=-4;Ae-=2)ct(Math.PI*Ae,"tan");for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+1),"tan")}if(Ze||tt){for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+1.5),"rad");for(Ae=4;Ae>=-4;Ae-=2)ct(Math.PI*(Ae+.5),"rad")}}if(fe||_t||Ze){var Oe=Math.sqrt(ge.width*ge.width+ge.height*ge.height);if(vt={scale:oe*_e*2/Oe,rCenter:1-oe,rotate:0},vt.textPosAngle=(ne.startangle+ne.stopangle)/2,vt.scale>=1)return vt;mt.push(vt)}(_t||tt)&&(vt=p(ge,_e,me,Ce,Re),vt.textPosAngle=(ne.startangle+ne.stopangle)/2,mt.push(vt)),(_t||Ge)&&(vt=g(ge,_e,me,Ce,Re),vt.textPosAngle=(ne.startangle+ne.stopangle)/2,mt.push(vt));for(var Le=0,nt=0,xt=0;xt=1)break}return mt[Le]}function M(ge,ne){var se=ge.startangle,_e=ge.stopangle;return se>ne&&ne>_e||se0?1:-1)/2,y:J/(1+se*se/(_e*_e)),outside:!0}}function V(ge){var ne=Math.sqrt(ge.titleBox.width*ge.titleBox.width+ge.titleBox.height*ge.titleBox.height);return{x:ge.cx,y:ge.cy,scale:ge.trace.hole*ge.r*2/ne,tx:0,ty:-ge.titleBox.height/2+ge.trace.title.font.size}}function W(ge,ne){var se=1,_e=1,oe,J=ge.trace,me={x:ge.cx,y:ge.cy},fe={tx:0,ty:0};fe.ty+=J.title.font.size,oe=q(J),J.title.position.indexOf("top")!==-1?(me.y-=(1+oe)*ge.r,fe.ty-=ge.titleBox.height):J.title.position.indexOf("bottom")!==-1&&(me.y+=(1+oe)*ge.r);var Ce=F(ge.r,ge.trace.aspectratio),Re=ne.w*(J.domain.x[1]-J.domain.x[0])/2;return J.title.position.indexOf("left")!==-1?(Re=Re+Ce,me.x-=(1+oe)*Ce,fe.tx+=ge.titleBox.width/2):J.title.position.indexOf("center")!==-1?Re*=2:J.title.position.indexOf("right")!==-1&&(Re=Re+Ce,me.x+=(1+oe)*Ce,fe.tx-=ge.titleBox.width/2),se=Re/ge.titleBox.width,_e=H(ge,ne)/ge.titleBox.height,{x:me.x,y:me.y,scale:Math.min(se,_e),tx:fe.tx,ty:fe.ty}}function F(ge,ne){return ge/(ne===void 0?1:ne)}function H(ge,ne){var se=ge.trace,_e=ne.h*(se.domain.y[1]-se.domain.y[0]);return Math.min(ge.titleBox.height,_e/2)}function q(ge){var ne=ge.pull;if(!ne)return 0;var se;if(n.isArrayOrTypedArray(ne))for(ne=0,se=0;sene&&(ne=ge.pull[se]);return ne}function G(ge,ne){var se,_e,oe,J,me,fe,Ce,Re,Be,Ze,Ge,tt,_t;function mt(Oe,Le){return Oe.pxmid[1]-Le.pxmid[1]}function vt(Oe,Le){return Le.pxmid[1]-Oe.pxmid[1]}function ct(Oe,Le){Le||(Le={});var nt=Le.labelExtraY+(_e?Le.yLabelMax:Le.yLabelMin),xt=_e?Oe.yLabelMin:Oe.yLabelMax,ut=_e?Oe.yLabelMax:Oe.yLabelMin,Et=Oe.cyFinal+me(Oe.px0[1],Oe.px1[1]),Gt=nt-xt,Qt,vr,mr,Yr,ii,Lr;if(Gt*Ce>0&&(Oe.labelExtraY=Gt),!!n.isArrayOrTypedArray(ne.pull))for(vr=0;vr=(b.castOption(ne.pull,mr.pts)||0))&&((Oe.pxmid[1]-mr.pxmid[1])*Ce>0?(Yr=mr.cyFinal+me(mr.px0[1],mr.px1[1]),Gt=Yr-xt-Oe.labelExtraY,Gt*Ce>0&&(Oe.labelExtraY+=Gt)):(ut+Oe.labelExtraY-Et)*Ce>0&&(Qt=3*fe*Math.abs(vr-Ze.indexOf(Oe)),ii=mr.cxFinal+J(mr.px0[0],mr.px1[0]),Lr=ii+Qt-(Oe.cxFinal+Oe.pxmid[0])-Oe.labelExtraX,Lr*fe>0&&(Oe.labelExtraX+=Lr)))}for(_e=0;_e<2;_e++)for(oe=_e?mt:vt,me=_e?Math.max:Math.min,Ce=_e?1:-1,se=0;se<2;se++){for(J=se?Math.max:Math.min,fe=se?1:-1,Re=ge[_e][se],Re.sort(oe),Be=ge[1-_e][se],Ze=Be.concat(Re),tt=[],Ge=0;Ge1?(Re=se.r,Be=Re/oe.aspectratio):(Be=se.r,Re=Be*oe.aspectratio),Re*=(1+oe.baseratio)/2,Ce=Re*Be}me=Math.min(me,Ce/se.vTotal)}for(_e=0;_ene.vTotal/2?1:0,Re.halfangle=Math.PI*Math.min(Re.v/ne.vTotal,.5),Re.ring=1-_e.hole,Re.rInscribed=B(Re,ne))}function ve(ge,ne){return[ge*Math.sin(ne),-ge*Math.cos(ne)]}function ce(ge,ne,se){var _e=ge._fullLayout,oe=se.trace,J=oe.texttemplate,me=oe.textinfo;if(!J&&me&&me!=="none"){var fe=me.split("+"),Ce=function(Le){return fe.indexOf(Le)!==-1},Re=Ce("label"),Be=Ce("text"),Ze=Ce("value"),Ge=Ce("percent"),tt=_e.separators,_t;if(_t=Re?[ne.label]:[],Be){var mt=b.getFirstFilled(oe.text,ne.pts);_(mt)&&_t.push(mt)}Ze&&_t.push(b.formatPieValue(ne.v,tt)),Ge&&_t.push(b.formatPiePercent(ne.v/se.vTotal,tt)),ne.text=_t.join("
")}function vt(Le){return{label:Le.label,value:Le.v,valueLabel:b.formatPieValue(Le.v,_e.separators),percent:Le.v/se.vTotal,percentLabel:b.formatPiePercent(Le.v/se.vTotal,_e.separators),color:Le.color,text:Le.text,customdata:n.castOption(oe,Le.i,"customdata")}}if(J){var ct=n.castOption(oe,ne.i,"texttemplate");if(!ct)ne.text="";else{var Ae=vt(ne),Oe=b.getFirstFilled(oe.text,ne.pts);(_(Oe)||Oe==="")&&(Ae.text=Oe),ne.text=n.texttemplateString({data:[Ae,oe._meta],fallback:oe.texttemplatefallback,labels:Ae,locale:ge._fullLayout._d3locale,template:ct})}}}function re(ge,ne){var se=ge.rotate*Math.PI/180,_e=Math.cos(se),oe=Math.sin(se),J=(ne.left+ne.right)/2,me=(ne.top+ne.bottom)/2;ge.textX=J*_e-me*oe,ge.textY=J*oe+me*_e,ge.noCenter=!0}Y.exports={plot:A,formatSliceLabel:ce,transformInsideText:I,determineInsideTextFont:D,positionTitleOutside:W,prerenderTitles:E,layoutAreas:ee,attachFxHandlers:k,computeTransform:re}}),iK=ze((te,Y)=>{var d=ri(),y=Vv(),z=C0().resizeText;Y.exports=function(P){var i=P._fullLayout._pielayer.selectAll(".trace");z(P,i,"pie"),i.each(function(n){var a=n[0],l=a.trace,o=d.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(u){d.select(this).call(y,u,l,P)})})}}),nK=ze(te=>{var Y=sh();te.name="pie",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),aK=ze((te,Y)=>{Y.exports={attributes:bb(),supplyDefaults:wb().supplyDefaults,supplyLayoutDefaults:tK(),layoutAttributes:oC(),calc:Fw().calc,crossTraceCalc:Fw().crossTraceCalc,plot:sC().plot,style:iK(),styleOne:Vv(),moduleType:"trace",name:"pie",basePlotModule:nK(),categories:["pie-like","pie","showLegend"],meta:{}}}),oK=ze((te,Y)=>{Y.exports=aK()}),sK=ze(te=>{var Y=sh();te.name="sunburst",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),NP=ze((te,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}),n6=ze((te,Y)=>{var d=xa(),{hovertemplateAttrs:y,texttemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=Oc(),n=Xh().attributes,a=bb(),l=NP(),o=nn().extendFlat,u=qd().pattern;Y.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},a.marker.line.color,{dflt:null}),width:o({},a.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:a.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:z({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:P({editType:"plot"}),hovertext:a.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:y({},{keys:l.eventDataKeys}),hovertemplatefallback:P(),textfont:a.textfont,insidetextorientation:a.insidetextorientation,insidetextfont:a.insidetextfont,outsidetextfont:o({},a.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:a.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:n({name:"sunburst",trace:!0,editType:"calc"})}}),jP=ze((te,Y)=>{Y.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),lK=ze((te,Y)=>{var d=ji(),y=n6(),z=Xh().defaults,P=tg().handleText,i=wb().handleMarkerDefaults,n=lh(),a=n.hasColorscale,l=n.handleDefaults;Y.exports=function(o,u,s,h){function m(w,D){return d.coerce(o,u,y,w,D)}var b=m("labels"),x=m("parents");if(!b||!b.length||!x||!x.length){u.visible=!1;return}var _=m("values");_&&_.length?m("branchvalues"):m("count"),m("level"),m("maxdepth"),i(o,u,h,m);var A=u._hasColorscale=a(o,"marker","colors")||(o.marker||{}).coloraxis;A&&l(o,u,h,m,{prefix:"marker.",cLetter:"c"}),m("leaf.opacity",A?1:.7);var f=m("text");m("texttemplate"),m("texttemplatefallback"),u.texttemplate||m("textinfo",d.isArrayOrTypedArray(f)?"text+label":"label"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback");var k="auto";P(o,u,h,m,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),m("insidetextorientation"),m("sort"),m("rotation"),m("root.color"),z(u,h,m),u._length=null}}),uK=ze((te,Y)=>{var d=ji(),y=jP();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("sunburstcolorway",P.colorway),i("extendsunburstcolors")}}),a6=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(De,ye){return De.parent===ye.parent?1:2}function z(De){return De.reduce(P,0)/De.length}function P(De,ye){return De+ye.x}function i(De){return 1+De.reduce(n,0)}function n(De,ye){return Math.max(De,ye.y)}function a(De){for(var ye;ye=De.children;)De=ye[0];return De}function l(De){for(var ye;ye=De.children;)De=ye[ye.length-1];return De}function o(){var De=y,ye=1,Pe=1,He=!1;function at(ht){var At,Wt=0;ht.eachAfter(function(br){var fi=br.children;fi?(br.x=z(fi),br.y=i(fi)):(br.x=At?Wt+=De(br,At):0,br.y=0,At=br)});var Yt=a(ht),hr=l(ht),zr=Yt.x-De(Yt,hr)/2,Dr=hr.x+De(hr,Yt)/2;return ht.eachAfter(He?function(br){br.x=(br.x-ht.x)*ye,br.y=(ht.y-br.y)*Pe}:function(br){br.x=(br.x-zr)/(Dr-zr)*ye,br.y=(1-(ht.y?br.y/ht.y:1))*Pe})}return at.separation=function(ht){return arguments.length?(De=ht,at):De},at.size=function(ht){return arguments.length?(He=!1,ye=+ht[0],Pe=+ht[1],at):He?null:[ye,Pe]},at.nodeSize=function(ht){return arguments.length?(He=!0,ye=+ht[0],Pe=+ht[1],at):He?[ye,Pe]:null},at}function u(De){var ye=0,Pe=De.children,He=Pe&&Pe.length;if(!He)ye=1;else for(;--He>=0;)ye+=Pe[He].value;De.value=ye}function s(){return this.eachAfter(u)}function h(De){var ye=this,Pe,He=[ye],at,ht,At;do for(Pe=He.reverse(),He=[];ye=Pe.pop();)if(De(ye),at=ye.children,at)for(ht=0,At=at.length;ht=0;--at)Pe.push(He[at]);return this}function b(De){for(var ye=this,Pe=[ye],He=[],at,ht,At;ye=Pe.pop();)if(He.push(ye),at=ye.children,at)for(ht=0,At=at.length;ht=0;)Pe+=He[at].value;ye.value=Pe})}function _(De){return this.eachBefore(function(ye){ye.children&&ye.children.sort(De)})}function A(De){for(var ye=this,Pe=f(ye,De),He=[ye];ye!==Pe;)ye=ye.parent,He.push(ye);for(var at=He.length;De!==Pe;)He.splice(at,0,De),De=De.parent;return He}function f(De,ye){if(De===ye)return De;var Pe=De.ancestors(),He=ye.ancestors(),at=null;for(De=Pe.pop(),ye=He.pop();De===ye;)at=De,De=Pe.pop(),ye=He.pop();return at}function k(){for(var De=this,ye=[De];De=De.parent;)ye.push(De);return ye}function w(){var De=[];return this.each(function(ye){De.push(ye)}),De}function D(){var De=[];return this.eachBefore(function(ye){ye.children||De.push(ye)}),De}function E(){var De=this,ye=[];return De.each(function(Pe){Pe!==De&&ye.push({source:Pe.parent,target:Pe})}),ye}function I(De,ye){var Pe=new T(De),He=+De.value&&(Pe.value=De.value),at,ht=[Pe],At,Wt,Yt,hr;for(ye==null&&(ye=p);at=ht.pop();)if(He&&(at.value=+at.data.value),(Wt=ye(at.data))&&(hr=Wt.length))for(at.children=new Array(hr),Yt=hr-1;Yt>=0;--Yt)ht.push(At=at.children[Yt]=new T(Wt[Yt])),At.parent=at,At.depth=at.depth+1;return Pe.eachBefore(C)}function M(){return I(this).eachBefore(g)}function p(De){return De.children}function g(De){De.data=De.data.data}function C(De){var ye=0;do De.height=ye;while((De=De.parent)&&De.height<++ye)}function T(De){this.data=De,this.depth=this.height=0,this.parent=null}T.prototype=I.prototype={constructor:T,count:s,each:h,eachAfter:b,eachBefore:m,sum:x,sort:_,path:A,ancestors:k,descendants:w,leaves:D,links:E,copy:M};var N=Array.prototype.slice;function B(De){for(var ye=De.length,Pe,He;ye;)He=Math.random()*ye--|0,Pe=De[ye],De[ye]=De[He],De[He]=Pe;return De}function U(De){for(var ye=0,Pe=(De=B(N.call(De))).length,He=[],at,ht;ye0&&Pe*Pe>He*He+at*at}function H(De,ye){for(var Pe=0;PeYt?(at=(hr+Yt-ht)/(2*hr),Wt=Math.sqrt(Math.max(0,Yt/hr-at*at)),Pe.x=De.x-at*He-Wt*At,Pe.y=De.y-at*At+Wt*He):(at=(hr+ht-Yt)/(2*hr),Wt=Math.sqrt(Math.max(0,ht/hr-at*at)),Pe.x=ye.x+at*He-Wt*At,Pe.y=ye.y+at*At+Wt*He)):(Pe.x=ye.x+Pe.r,Pe.y=ye.y)}function ve(De,ye){var Pe=De.r+ye.r-1e-6,He=ye.x-De.x,at=ye.y-De.y;return Pe>0&&Pe*Pe>He*He+at*at}function ce(De){var ye=De._,Pe=De.next._,He=ye.r+Pe.r,at=(ye.x*Pe.r+Pe.x*ye.r)/He,ht=(ye.y*Pe.r+Pe.y*ye.r)/He;return at*at+ht*ht}function re(De){this._=De,this.next=null,this.previous=null}function ge(De){if(!(at=De.length))return 0;var ye,Pe,He,at,ht,At,Wt,Yt,hr,zr,Dr;if(ye=De[0],ye.x=0,ye.y=0,!(at>1))return ye.r;if(Pe=De[1],ye.x=-Pe.r,Pe.x=ye.r,Pe.y=0,!(at>2))return ye.r+Pe.r;be(Pe,ye,He=De[2]),ye=new re(ye),Pe=new re(Pe),He=new re(He),ye.next=He.previous=Pe,Pe.next=ye.previous=He,He.next=Pe.previous=ye;e:for(Wt=3;Wt0)throw new Error("cycle");return Wt}return Pe.id=function(He){return arguments.length?(De=_e(He),Pe):De},Pe.parentId=function(He){return arguments.length?(ye=_e(He),Pe):ye},Pe}function Le(De,ye){return De.parent===ye.parent?1:2}function nt(De){var ye=De.children;return ye?ye[0]:De.t}function xt(De){var ye=De.children;return ye?ye[ye.length-1]:De.t}function ut(De,ye,Pe){var He=Pe/(ye.i-De.i);ye.c-=He,ye.s+=Pe,De.c+=He,ye.z+=Pe,ye.m+=Pe}function Et(De){for(var ye=0,Pe=0,He=De.children,at=He.length,ht;--at>=0;)ht=He[at],ht.z+=ye,ht.m+=ye,ye+=ht.s+(Pe+=ht.c)}function Gt(De,ye,Pe){return De.a.parent===ye.parent?De.a:Pe}function Qt(De,ye){this._=De,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=ye}Qt.prototype=Object.create(T.prototype);function vr(De){for(var ye=new Qt(De,0),Pe,He=[ye],at,ht,At,Wt;Pe=He.pop();)if(ht=Pe._.children)for(Pe.children=new Array(Wt=ht.length),At=Wt-1;At>=0;--At)He.push(at=Pe.children[At]=new Qt(ht[At],At)),at.parent=Pe;return(ye.parent=new Qt(null,0)).children=[ye],ye}function mr(){var De=Le,ye=1,Pe=1,He=null;function at(hr){var zr=vr(hr);if(zr.eachAfter(ht),zr.parent.m=-zr.z,zr.eachBefore(At),He)hr.eachBefore(Yt);else{var Dr=hr,br=hr,fi=hr;hr.eachBefore(function(Sn){Sn.xbr.x&&(br=Sn),Sn.depth>fi.depth&&(fi=Sn)});var un=Dr===br?1:De(Dr,br)/2,cn=un-Dr.x,yn=ye/(br.x+un+cn),Gn=Pe/(fi.depth||1);hr.eachBefore(function(Sn){Sn.x=(Sn.x+cn)*yn,Sn.y=Sn.depth*Gn})}return hr}function ht(hr){var zr=hr.children,Dr=hr.parent.children,br=hr.i?Dr[hr.i-1]:null;if(zr){Et(hr);var fi=(zr[0].z+zr[zr.length-1].z)/2;br?(hr.z=br.z+De(hr._,br._),hr.m=hr.z-fi):hr.z=fi}else br&&(hr.z=br.z+De(hr._,br._));hr.parent.A=Wt(hr,br,hr.parent.A||Dr[0])}function At(hr){hr._.x=hr.z+hr.parent.m,hr.m+=hr.parent.m}function Wt(hr,zr,Dr){if(zr){for(var br=hr,fi=hr,un=zr,cn=br.parent.children[0],yn=br.m,Gn=fi.m,Sn=un.m,dn=cn.m,va;un=xt(un),br=nt(br),un&&br;)cn=nt(cn),fi=xt(fi),fi.a=hr,va=un.z+Sn-br.z-yn+De(un._,br._),va>0&&(ut(Gt(un,hr,Dr),hr,va),yn+=va,Gn+=va),Sn+=un.m,yn+=br.m,dn+=cn.m,Gn+=fi.m;un&&!xt(fi)&&(fi.t=un,fi.m+=Sn-Gn),br&&!nt(cn)&&(cn.t=br,cn.m+=yn-dn,Dr=hr)}return Dr}function Yt(hr){hr.x*=ye,hr.y=hr.depth*Pe}return at.separation=function(hr){return arguments.length?(De=hr,at):De},at.size=function(hr){return arguments.length?(He=!1,ye=+hr[0],Pe=+hr[1],at):He?null:[ye,Pe]},at.nodeSize=function(hr){return arguments.length?(He=!0,ye=+hr[0],Pe=+hr[1],at):He?[ye,Pe]:null},at}function Yr(De,ye,Pe,He,at){for(var ht=De.children,At,Wt=-1,Yt=ht.length,hr=De.value&&(at-Pe)/De.value;++WtSn&&(Sn=hr),Kt=yn*yn*na,dn=Math.max(Sn/Kt,Kt/Gn),dn>va){yn-=hr;break}va=dn}At.push(Yt={value:yn,dice:fi1?He:1)},Pe}(ii);function vi(){var De=ci,ye=!1,Pe=1,He=1,at=[0],ht=oe,At=oe,Wt=oe,Yt=oe,hr=oe;function zr(br){return br.x0=br.y0=0,br.x1=Pe,br.y1=He,br.eachBefore(Dr),at=[0],ye&&br.eachBefore(Ze),br}function Dr(br){var fi=at[br.depth],un=br.x0+fi,cn=br.y0+fi,yn=br.x1-fi,Gn=br.y1-fi;yn=br-1){var Sn=ht[Dr];Sn.x0=un,Sn.y0=cn,Sn.x1=yn,Sn.y1=Gn;return}for(var dn=hr[Dr],va=fi/2+dn,na=Dr+1,Kt=br-1;na>>1;hr[lr]Gn-cn){var di=(un*Er+yn*_r)/fi;zr(Dr,na,_r,un,cn,di,Gn),zr(na,br,Er,di,cn,yn,Gn)}else{var qi=(cn*Er+Gn*_r)/fi;zr(Dr,na,_r,un,cn,yn,qi),zr(na,br,Er,un,qi,yn,Gn)}}}function Xe(De,ye,Pe,He,at){(De.depth&1?Yr:Ge)(De,ye,Pe,He,at)}var ot=function De(ye){function Pe(He,at,ht,At,Wt){if((Yt=He._squarify)&&Yt.ratio===ye)for(var Yt,hr,zr,Dr,br=-1,fi,un=Yt.length,cn=He.value;++br1?He:1)},Pe}(ii);d.cluster=o,d.hierarchy=I,d.pack=fe,d.packEnclose=U,d.packSiblings=ne,d.partition=tt,d.stratify=Oe,d.tree=mr,d.treemap=vi,d.treemapBinary=Ot,d.treemapDice=Ge,d.treemapResquarify=ot,d.treemapSlice=Yr,d.treemapSliceDice=Xe,d.treemapSquarify=ci,Object.defineProperty(d,"__esModule",{value:!0})})}),o6=ze(te=>{var Y=a6(),d=Sr(),y=ji(),z=lh().makeColorScaleFuncFromTrace,P=Fw().makePullColorFn,i=Fw().generateExtendedColors,n=lh().calc,a=ei().ALMOST_EQUAL,l={},o={},u={};te.calc=function(h,m){var b=h._fullLayout,x=m.ids,_=y.isArrayOrTypedArray(x),A=m.labels,f=m.parents,k=m.values,w=y.isArrayOrTypedArray(k),D=[],E={},I={},M=function(ne,se){E[ne]?E[ne].push(se):E[ne]=[se],I[se]=1},p=function(ne){return ne||typeof ne=="number"},g=function(ne){return!w||d(k[ne])&&k[ne]>=0},C,T,N;_?(C=Math.min(x.length,f.length),T=function(ne){return p(x[ne])&&g(ne)},N=function(ne){return String(x[ne])}):(C=Math.min(A.length,f.length),T=function(ne){return p(A[ne])&&g(ne)},N=function(ne){return String(A[ne])}),w&&(C=Math.min(C,k.length));for(var B=0;B1){for(var F=y.randstr(),H=0;H{});function ny(){}function NP(){return this.rgb().formatHex()}function sK(){return this.rgb().formatHex8()}function lK(){return WP(this).formatHsl()}function jP(){return this.rgb().formatRgb()}function Fw(te){var Y,d;return te=(te+"").trim().toLowerCase(),(Y=GP.exec(te))?(d=Y[1].length,Y=parseInt(Y[1],16),d===6?UP(Y):d===3?new jp(Y>>8&15|Y>>4&240,Y>>4&15|Y&240,(Y&15)<<4|Y&15,1):d===8?a6(Y>>24&255,Y>>16&255,Y>>8&255,(Y&255)/255):d===4?a6(Y>>12&15|Y>>8&240,Y>>8&15|Y>>4&240,Y>>4&15|Y&240,((Y&15)<<4|Y&15)/255):null):(Y=ZP.exec(te))?new jp(Y[1],Y[2],Y[3],1):(Y=KP.exec(te))?new jp(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,1):(Y=YP.exec(te))?a6(Y[1],Y[2],Y[3],Y[4]):(Y=XP.exec(te))?a6(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,Y[4]):(Y=JP.exec(te))?VP(Y[1],Y[2]/100,Y[3]/100,1):(Y=QP.exec(te))?VP(Y[1],Y[2]/100,Y[3]/100,Y[4]):cC.hasOwnProperty(te)?UP(cC[te]):te==="transparent"?new jp(NaN,NaN,NaN,0):null}function UP(te){return new jp(te>>16&255,te>>8&255,te&255,1)}function a6(te,Y,d,y){return y<=0&&(te=Y=d=NaN),new jp(te,Y,d,y)}function sC(te){return te instanceof ny||(te=Fw(te)),te?(te=te.rgb(),new jp(te.r,te.g,te.b,te.opacity)):new jp}function o6(te,Y,d,y){return arguments.length===1?sC(te):new jp(te,Y,d,y??1)}function jp(te,Y,d,y){this.r=+te,this.g=+Y,this.b=+d,this.opacity=+y}function $P(){return`#${I_(this.r)}${I_(this.g)}${I_(this.b)}`}function uK(){return`#${I_(this.r)}${I_(this.g)}${I_(this.b)}${I_((isNaN(this.opacity)?1:this.opacity)*255)}`}function HP(){let te=s6(this.opacity);return`${te===1?"rgb(":"rgba("}${P_(this.r)}, ${P_(this.g)}, ${P_(this.b)}${te===1?")":`, ${te})`}`}function s6(te){return isNaN(te)?1:Math.max(0,Math.min(1,te))}function P_(te){return Math.max(0,Math.min(255,Math.round(te)||0))}function I_(te){return te=P_(te),(te<16?"0":"")+te.toString(16)}function VP(te,Y,d,y){return y<=0?te=Y=d=NaN:d<=0||d>=1?te=Y=NaN:Y<=0&&(te=NaN),new Pg(te,Y,d,y)}function WP(te){if(te instanceof Pg)return new Pg(te.h,te.s,te.l,te.opacity);if(te instanceof ny||(te=Fw(te)),!te)return new Pg;if(te instanceof Pg)return te;te=te.rgb();var Y=te.r/255,d=te.g/255,y=te.b/255,z=Math.min(Y,d,y),P=Math.max(Y,d,y),i=NaN,n=P-z,a=(P+z)/2;return n?(Y===P?i=(d-y)/n+(d0&&a<1?0:i,new Pg(i,n,a,te.opacity)}function lC(te,Y,d,y){return arguments.length===1?WP(te):new Pg(te,Y,d,y??1)}function Pg(te,Y,d,y){this.h=+te,this.s=+Y,this.l=+d,this.opacity=+y}function qP(te){return te=(te||0)%360,te<0?te+360:te}function l6(te){return Math.max(0,Math.min(1,te||0))}function uC(te,Y,d){return(te<60?Y+(d-Y)*te/60:te<180?d:te<240?Y+(d-Y)*(240-te)/60:Y)*255}var ay,D_,z_,kb,Ig,GP,ZP,KP,YP,XP,JP,QP,cC,hC=Er(()=>{oC(),ay=.7,D_=1/ay,z_="\\s*([+-]?\\d+)\\s*",kb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ig="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",GP=/^#([0-9a-f]{3,8})$/,ZP=new RegExp(`^rgb\\(${z_},${z_},${z_}\\)$`),KP=new RegExp(`^rgb\\(${Ig},${Ig},${Ig}\\)$`),YP=new RegExp(`^rgba\\(${z_},${z_},${z_},${kb}\\)$`),XP=new RegExp(`^rgba\\(${Ig},${Ig},${Ig},${kb}\\)$`),JP=new RegExp(`^hsl\\(${kb},${Ig},${Ig}\\)$`),QP=new RegExp(`^hsla\\(${kb},${Ig},${Ig},${kb}\\)$`),cC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},wb(ny,Fw,{copy(te){return Object.assign(new this.constructor,this,te)},displayable(){return this.rgb().displayable()},hex:NP,formatHex:NP,formatHex8:sK,formatHsl:lK,formatRgb:jP,toString:jP}),wb(jp,o6,Rw(ny,{brighter(te){return te=te==null?D_:Math.pow(D_,te),new jp(this.r*te,this.g*te,this.b*te,this.opacity)},darker(te){return te=te==null?ay:Math.pow(ay,te),new jp(this.r*te,this.g*te,this.b*te,this.opacity)},rgb(){return this},clamp(){return new jp(P_(this.r),P_(this.g),P_(this.b),s6(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:$P,formatHex:$P,formatHex8:uK,formatRgb:HP,toString:HP})),wb(Pg,lC,Rw(ny,{brighter(te){return te=te==null?D_:Math.pow(D_,te),new Pg(this.h,this.s,this.l*te,this.opacity)},darker(te){return te=te==null?ay:Math.pow(ay,te),new Pg(this.h,this.s,this.l*te,this.opacity)},rgb(){var te=this.h%360+(this.h<0)*360,Y=isNaN(te)||isNaN(this.s)?0:this.s,d=this.l,y=d+(d<.5?d:1-d)*Y,z=2*d-y;return new jp(uC(te>=240?te-240:te+120,z,y),uC(te,z,y),uC(te<120?te+240:te-120,z,y),this.opacity)},clamp(){return new Pg(qP(this.h),l6(this.s),l6(this.l),s6(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(){let te=s6(this.opacity);return`${te===1?"hsl(":"hsla("}${qP(this.h)}, ${l6(this.s)*100}%, ${l6(this.l)*100}%${te===1?")":`, ${te})`}`}}))}),fC,dC,eI=Er(()=>{fC=Math.PI/180,dC=180/Math.PI});function tI(te){if(te instanceof ev)return new ev(te.l,te.a,te.b,te.opacity);if(te instanceof Qv)return rI(te);te instanceof jp||(te=sC(te));var Y=yC(te.r),d=yC(te.g),y=yC(te.b),z=mC((.2225045*Y+.7168786*d+.0606169*y)/bC),P,i;return Y===d&&d===y?P=i=z:(P=mC((.4360747*Y+.3850649*d+.1430804*y)/xC),i=mC((.0139322*Y+.0971045*d+.7141733*y)/wC)),new ev(116*z-16,500*(P-z),200*(z-i),te.opacity)}function pC(te,Y,d,y){return arguments.length===1?tI(te):new ev(te,Y,d,y??1)}function ev(te,Y,d,y){this.l=+te,this.a=+Y,this.b=+d,this.opacity=+y}function mC(te){return te>iI?Math.pow(te,.3333333333333333):te/TC+kC}function gC(te){return te>O_?te*te*te:TC*(te-kC)}function vC(te){return 255*(te<=.0031308?12.92*te:1.055*Math.pow(te,.4166666666666667)-.055)}function yC(te){return(te/=255)<=.04045?te/12.92:Math.pow((te+.055)/1.055,2.4)}function cK(te){if(te instanceof Qv)return new Qv(te.h,te.c,te.l,te.opacity);if(te instanceof ev||(te=tI(te)),te.a===0&&te.b===0)return new Qv(NaN,0{oC(),hC(),eI(),Nw=18,xC=.96422,bC=1,wC=.82521,kC=4/29,O_=6/29,TC=3*O_*O_,iI=O_*O_*O_,wb(ev,pC,Rw(ny,{brighter(te){return new ev(this.l+Nw*(te??1),this.a,this.b,this.opacity)},darker(te){return new ev(this.l-Nw*(te??1),this.a,this.b,this.opacity)},rgb(){var te=(this.l+16)/116,Y=isNaN(this.a)?te:te+this.a/500,d=isNaN(this.b)?te:te-this.b/200;return Y=xC*gC(Y),te=bC*gC(te),d=wC*gC(d),new jp(vC(3.1338561*Y-1.6168667*te-.4906146*d),vC(-.9787684*Y+1.9161415*te+.033454*d),vC(.0719453*Y-.2289914*te+1.4052427*d),this.opacity)}})),wb(Qv,_C,Rw(ny,{brighter(te){return new Qv(this.h,this.c,this.l+Nw*(te??1),this.opacity)},darker(te){return new Qv(this.h,this.c,this.l-Nw*(te??1),this.opacity)},rgb(){return rI(this).rgb()}}))});function fK(te){if(te instanceof B_)return new B_(te.h,te.s,te.l,te.opacity);te instanceof jp||(te=sC(te));var Y=te.r/255,d=te.g/255,y=te.b/255,z=(EC*y+AC*Y-MC*d)/(EC+AC-MC),P=y-z,i=(Tb*(d-z)-c6*P)/jw,n=Math.sqrt(i*i+P*P)/(Tb*z*(1-z)),a=n?Math.atan2(i,P)*dC-120:NaN;return new B_(a<0?a+360:a,n,z,te.opacity)}function SC(te,Y,d,y){return arguments.length===1?fK(te):new B_(te,Y,d,y??1)}function B_(te,Y,d,y){this.h=+te,this.s=+Y,this.l=+d,this.opacity=+y}var CC,u6,c6,jw,Tb,AC,MC,EC,dK=Er(()=>{oC(),hC(),eI(),CC=-.14861,u6=1.78277,c6=-.29227,jw=-.90649,Tb=1.97294,AC=Tb*jw,MC=Tb*u6,EC=u6*c6-jw*CC,wb(B_,SC,Rw(ny,{brighter(te){return te=te==null?D_:Math.pow(D_,te),new B_(this.h,this.s,this.l*te,this.opacity)},darker(te){return te=te==null?ay:Math.pow(ay,te),new B_(this.h,this.s,this.l*te,this.opacity)},rgb(){var te=isNaN(this.h)?0:(this.h+120)*fC,Y=+this.l,d=isNaN(this.s)?0:this.s*Y*(1-Y),y=Math.cos(te),z=Math.sin(te);return new jp(255*(Y+d*(CC*y+u6*z)),255*(Y+d*(c6*y+jw*z)),255*(Y+d*(Tb*y)),this.opacity)}}))}),Sb=Er(()=>{hC(),hK(),dK()});function nI(te,Y,d,y,z){var P=te*te,i=P*te;return((1-3*te+3*P-i)*Y+(4-6*P+3*i)*d+(1+3*te+3*P-3*i)*y+i*z)/6}function aI(te){var Y=te.length-1;return function(d){var y=d<=0?d=0:d>=1?(d=1,Y-1):Math.floor(d*Y),z=te[y],P=te[y+1],i=y>0?te[y-1]:2*z-P,n=y{});function oI(te){var Y=te.length;return function(d){var y=Math.floor(((d%=1)<0?++d:d)*Y),z=te[(y+Y-1)%Y],P=te[y%Y],i=te[(y+1)%Y],n=te[(y+2)%Y];return nI((d-y/Y)*Y,z,P,i,n)}}var sI=Er(()=>{LC()}),Uw,lI=Er(()=>{Uw=te=>()=>te});function uI(te,Y){return function(d){return te+d*Y}}function pK(te,Y,d){return te=Math.pow(te,d),Y=Math.pow(Y,d)-te,d=1/d,function(y){return Math.pow(te+y*Y,d)}}function h6(te,Y){var d=Y-te;return d?uI(te,d>180||d<-180?d-360*Math.round(d/360):d):Uw(isNaN(te)?Y:te)}function mK(te){return(te=+te)==1?Up:function(Y,d){return d-Y?pK(Y,d,te):Uw(isNaN(Y)?d:Y)}}function Up(te,Y){var d=Y-te;return d?uI(te,d):Uw(isNaN(te)?Y:te)}var Cb=Er(()=>{lI()});function cI(te){return function(Y){var d=Y.length,y=new Array(d),z=new Array(d),P=new Array(d),i,n;for(i=0;i{Sb(),LC(),sI(),Cb(),f6=function te(Y){var d=mK(Y);function y(z,P){var i=d((z=o6(z)).r,(P=o6(P)).r),n=d(z.g,P.g),a=d(z.b,P.b),l=Up(z.opacity,P.opacity);return function(o){return z.r=i(o),z.g=n(o),z.b=a(o),z.opacity=l(o),z+""}}return y.gamma=te,y}(1),hI=cI(aI),fI=cI(oI)});function PC(te,Y){Y||(Y=[]);var d=te?Math.min(Y.length,te.length):0,y=Y.slice(),z;return function(P){for(z=0;z{});function gK(te,Y){return(pI(Y)?PC:mI)(te,Y)}function mI(te,Y){var d=Y?Y.length:0,y=te?Math.min(d,te.length):0,z=new Array(y),P=new Array(d),i;for(i=0;i{v6(),IC()});function vI(te,Y){var d=new Date;return te=+te,Y=+Y,function(y){return d.setTime(te*(1-y)+Y*y),d}}var yI=Er(()=>{});function tv(te,Y){return te=+te,Y=+Y,function(d){return te*(1-d)+Y*d}}var d6=Er(()=>{});function _I(te,Y){var d={},y={},z;(te===null||typeof te!="object")&&(te={}),(Y===null||typeof Y!="object")&&(Y={});for(z in Y)z in te?d[z]=g6(te[z],Y[z]):y[z]=Y[z];return function(P){for(z in d)y[z]=d[z](P);return y}}var xI=Er(()=>{v6()});function vK(te){return function(){return te}}function yK(te){return function(Y){return te(Y)+""}}function bI(te,Y){var d=p6.lastIndex=m6.lastIndex=0,y,z,P,i=-1,n=[],a=[];for(te=te+"",Y=Y+"";(y=p6.exec(te))&&(z=m6.exec(Y));)(P=z.index)>d&&(P=Y.slice(d,P),n[i]?n[i]+=P:n[++i]=P),(y=y[0])===(z=z[0])?n[i]?n[i]+=z:n[++i]=z:(n[++i]=null,a.push({i,x:tv(y,z)})),d=m6.lastIndex;return d{d6(),p6=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,m6=new RegExp(p6.source,"g")});function g6(te,Y){var d=typeof Y,y;return Y==null||d==="boolean"?Uw(Y):(d==="number"?tv:d==="string"?(y=Fw(Y))?(Y=y,f6):bI:Y instanceof Fw?f6:Y instanceof Date?vI:pI(Y)?PC:Array.isArray(Y)?mI:typeof Y.valueOf!="function"&&typeof Y.toString!="function"||isNaN(Y)?_I:tv)(te,Y)}var v6=Er(()=>{Sb(),dI(),gI(),yI(),d6(),xI(),wI(),lI(),IC()});function _K(te){var Y=te.length;return function(d){return te[Math.max(0,Math.min(Y-1,Math.floor(d*Y)))]}}var xK=Er(()=>{});function bK(te,Y){var d=h6(+te,+Y);return function(y){var z=d(y);return z-360*Math.floor(z/360)}}var wK=Er(()=>{Cb()});function kK(te,Y){return te=+te,Y=+Y,function(d){return Math.round(te*(1-d)+Y*d)}}var TK=Er(()=>{});function kI(te,Y,d,y,z,P){var i,n,a;return(i=Math.sqrt(te*te+Y*Y))&&(te/=i,Y/=i),(a=te*d+Y*y)&&(d-=te*a,y-=Y*a),(n=Math.sqrt(d*d+y*y))&&(d/=n,y/=n,a/=n),te*y{DC=180/Math.PI,y6={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function CK(te){let Y=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(te+"");return Y.isIdentity?y6:kI(Y.a,Y.b,Y.c,Y.d,Y.e,Y.f)}function AK(te){return te==null?y6:(_6||(_6=document.createElementNS("http://www.w3.org/2000/svg","g")),_6.setAttribute("transform",te),(te=_6.transform.baseVal.consolidate())?(te=te.matrix,kI(te.a,te.b,te.c,te.d,te.e,te.f)):y6)}var _6,MK=Er(()=>{SK()});function TI(te,Y,d,y){function z(l){return l.length?l.pop()+" ":""}function P(l,o,u,s,h,m){if(l!==u||o!==s){var b=h.push("translate(",null,Y,null,d);m.push({i:b-4,x:tv(l,u)},{i:b-2,x:tv(o,s)})}else(u||s)&&h.push("translate("+u+Y+s+d)}function i(l,o,u,s){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),s.push({i:u.push(z(u)+"rotate(",null,y)-2,x:tv(l,o)})):o&&u.push(z(u)+"rotate("+o+y)}function n(l,o,u,s){l!==o?s.push({i:u.push(z(u)+"skewX(",null,y)-2,x:tv(l,o)}):o&&u.push(z(u)+"skewX("+o+y)}function a(l,o,u,s,h,m){if(l!==u||o!==s){var b=h.push(z(h)+"scale(",null,",",null,")");m.push({i:b-4,x:tv(l,u)},{i:b-2,x:tv(o,s)})}else(u!==1||s!==1)&&h.push(z(h)+"scale("+u+","+s+")")}return function(l,o){var u=[],s=[];return l=te(l),o=te(o),P(l.translateX,l.translateY,o.translateX,o.translateY,u,s),i(l.rotate,o.rotate,u,s),n(l.skewX,o.skewX,u,s),a(l.scaleX,l.scaleY,o.scaleX,o.scaleY,u,s),l=o=null,function(h){for(var m=-1,b=s.length,x;++m{d6(),MK(),SI=TI(CK,"px, ","px)","deg)"),CI=TI(AK,", ",")",")")});function AI(te){return((te=Math.exp(te))+1/te)/2}function LK(te){return((te=Math.exp(te))-1/te)/2}function PK(te){return((te=Math.exp(2*te))-1)/(te+1)}var MI,EI,IK=Er(()=>{MI=1e-12,EI=function te(Y,d,y){function z(P,i){var n=P[0],a=P[1],l=P[2],o=i[0],u=i[1],s=i[2],h=o-n,m=u-a,b=h*h+m*m,x,_;if(b{Sb(),Cb(),PI=LI(h6),II=LI(Up)});function zK(te,Y){var d=Up((te=pC(te)).l,(Y=pC(Y)).l),y=Up(te.a,Y.a),z=Up(te.b,Y.b),P=Up(te.opacity,Y.opacity);return function(i){return te.l=d(i),te.a=y(i),te.b=z(i),te.opacity=P(i),te+""}}var OK=Er(()=>{Sb(),Cb()});function DI(te){return function(Y,d){var y=te((Y=_C(Y)).h,(d=_C(d)).h),z=Up(Y.c,d.c),P=Up(Y.l,d.l),i=Up(Y.opacity,d.opacity);return function(n){return Y.h=y(n),Y.c=z(n),Y.l=P(n),Y.opacity=i(n),Y+""}}}var zI,OI,BK=Er(()=>{Sb(),Cb(),zI=DI(h6),OI=DI(Up)});function BI(te){return function Y(d){d=+d;function y(z,P){var i=te((z=SC(z)).h,(P=SC(P)).h),n=Up(z.s,P.s),a=Up(z.l,P.l),l=Up(z.opacity,P.opacity);return function(o){return z.h=i(o),z.s=n(o),z.l=a(Math.pow(o,d)),z.opacity=l(o),z+""}}return y.gamma=Y,y}(1)}var RI,FI,RK=Er(()=>{Sb(),Cb(),RI=BI(h6),FI=BI(Up)});function FK(te,Y){Y===void 0&&(Y=te,te=g6);for(var d=0,y=Y.length-1,z=Y[0],P=new Array(y<0?0:y);d{v6()});function jK(te,Y){for(var d=new Array(Y),y=0;y{}),R_={};wi(R_,{interpolate:()=>g6,interpolateArray:()=>gK,interpolateBasis:()=>aI,interpolateBasisClosed:()=>oI,interpolateCubehelix:()=>RI,interpolateCubehelixLong:()=>FI,interpolateDate:()=>vI,interpolateDiscrete:()=>_K,interpolateHcl:()=>zI,interpolateHclLong:()=>OI,interpolateHsl:()=>PI,interpolateHslLong:()=>II,interpolateHue:()=>bK,interpolateLab:()=>zK,interpolateNumber:()=>tv,interpolateNumberArray:()=>PC,interpolateObject:()=>_I,interpolateRgb:()=>f6,interpolateRgbBasis:()=>hI,interpolateRgbBasisClosed:()=>fI,interpolateRound:()=>kK,interpolateString:()=>bI,interpolateTransformCss:()=>SI,interpolateTransformSvg:()=>CI,interpolateZoom:()=>EI,piecewise:()=>FK,quantize:()=>jK});var Ab=Er(()=>{v6(),gI(),LC(),sI(),yI(),xK(),wK(),d6(),IC(),xI(),TK(),wI(),EK(),IK(),dI(),DK(),OK(),BK(),RK(),NK(),UK()}),zC=Fe((te,Y)=>{var d=Zs(),y=Xi();Y.exports=function(z,P,i,n,a){var l=P.data.data,o=l.i,u=a||l.color;if(o>=0){P.i=l.i;var s=i.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=u,P.color=u):(s.color=u,P.color=u),d.pointStyle(z,i,n,P)}else y.fill(z,u)}}),NI=Fe((te,Y)=>{var d=ii(),y=Xi(),z=ji(),P=C0().resizeText,i=zC();function n(l){var o=l._fullLayout._sunburstlayer.selectAll(".trace");P(l,o,"sunburst"),o.each(function(u){var s=d.select(this),h=u[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){d.select(this).call(a,b,m,l)})})}function a(l,o,u,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(u,b,"marker.line.color")||y.defaultLine,_=z.castOption(u,b,"marker.line.width")||0;l.call(i,o,u,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?u.leaf.opacity:null)}Y.exports={style:n,styleOne:a}}),oy=Fe(te=>{var Y=ji(),d=Xi(),y=Em(),z=Vv();te.findEntryWithLevel=function(a,l){var o;return l&&a.eachAfter(function(u){if(te.getPtId(u)===l)return o=u.copy()}),o||a},te.findEntryWithChild=function(a,l){var o;return a.eachAfter(function(u){for(var s=u.children||[],h=0;h0)},te.getMaxDepth=function(a){return a.maxdepth>=0?a.maxdepth:1/0},te.isHeader=function(a,l){return!(te.isLeaf(a)||a.depth===l._maxDepth-1)};function n(a){return a.data.data.pid}te.getParent=function(a,l){return te.findEntryWithLevel(a,n(l))},te.listPath=function(a,l){var o=a.parent;if(!o)return[];var u=l?[o.data[l]]:[o];return te.listPath(o,l).concat(u)},te.getPath=function(a){return te.listPath(a,"label").join("/")+"/"},te.formatValue=z.formatPieValue,te.formatPercent=function(a,l){var o=Y.formatPercent(a,0);return o==="0%"&&(o=z.formatPiePercent(a,l)),o}}),x6=Fe((te,Y)=>{var d=ii(),y=as(),z=T0().appendArrayPointValue,P=hf(),i=ji(),n=Gg(),a=oy(),l=Vv(),o=l.formatPieValue;Y.exports=function(s,h,m,b,x){var _=b[0],A=_.trace,f=_.hierarchy,k=A.type==="sunburst",w=A.type==="treemap"||A.type==="icicle";"_hasHoverLabel"in A||(A._hasHoverLabel=!1),"_hasHoverEvent"in A||(A._hasHoverEvent=!1);var D=function(M){var p=m._fullLayout;if(!(m._dragging||p.hovermode===!1)){var g=m._fullData[A.index],C=M.data.data,T=C.i,N=a.isHierarchyRoot(M),B=a.getParent(f,M),U=a.getValue(M),V=function(J){return i.castOption(g,T,J)},W=V("hovertemplate"),F=P.castHoverinfo(g,p,T),$=p.separators,q;if(W||F&&F!=="none"&&F!=="skip"){var G,ee;k&&(G=_.cx+M.pxmid[0]*(1-M.rInscribed),ee=_.cy+M.pxmid[1]*(1-M.rInscribed)),w&&(G=M._hoverX,ee=M._hoverY);var he={},xe=[],ve=[],ce=function(J){return xe.indexOf(J)!==-1};F&&(xe=F==="all"?g._module.attributes.hoverinfo.flags:F.split("+")),he.label=C.label,ce("label")&&he.label&&ve.push(he.label),C.hasOwnProperty("v")&&(he.value=C.v,he.valueLabel=o(he.value,$),ce("value")&&ve.push(he.valueLabel)),he.currentPath=M.currentPath=a.getPath(M.data),ce("current path")&&!N&&ve.push(he.currentPath);var re,ge=[],ne=function(){ge.indexOf(re)===-1&&(ve.push(re),ge.push(re))};he.percentParent=M.percentParent=U/a.getValue(B),he.parent=M.parentString=a.getPtLabel(B),ce("percent parent")&&(re=a.formatPercent(he.percentParent,$)+" of "+he.parent,ne()),he.percentEntry=M.percentEntry=U/a.getValue(h),he.entry=M.entry=a.getPtLabel(h),ce("percent entry")&&!N&&!M.onPathbar&&(re=a.formatPercent(he.percentEntry,$)+" of "+he.entry,ne()),he.percentRoot=M.percentRoot=U/a.getValue(f),he.root=M.root=a.getPtLabel(f),ce("percent root")&&!N&&(re=a.formatPercent(he.percentRoot,$)+" of "+he.root,ne()),he.text=V("hovertext")||V("text"),ce("text")&&(re=he.text,i.isValidTextValue(re)&&ve.push(re)),q=[u(M,g,x.eventDataKeys)];var se={trace:g,y:ee,_x0:M._x0,_x1:M._x1,_y0:M._y0,_y1:M._y1,text:ve.join("
"),name:W||ce("name")?g.name:void 0,color:V("hoverlabel.bgcolor")||C.color,borderColor:V("hoverlabel.bordercolor"),fontFamily:V("hoverlabel.font.family"),fontSize:V("hoverlabel.font.size"),fontColor:V("hoverlabel.font.color"),fontWeight:V("hoverlabel.font.weight"),fontStyle:V("hoverlabel.font.style"),fontVariant:V("hoverlabel.font.variant"),nameLength:V("hoverlabel.namelength"),textAlign:V("hoverlabel.align"),hovertemplate:W,hovertemplateLabels:he,eventData:q};k&&(se.x0=G-M.rInscribed*M.rpx1,se.x1=G+M.rInscribed*M.rpx1,se.idealAlign=M.pxmid[0]<0?"left":"right"),w&&(se.x=G,se.idealAlign=G<0?"left":"right");var _e=[];P.loneHover(se,{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:m,inOut_bbox:_e}),q[0].bbox=_e[0],A._hasHoverLabel=!0}if(w){var oe=s.select("path.surface");x.styleOne(oe,M,g,m,{hovered:!0})}A._hasHoverEvent=!0,m.emit("plotly_hover",{points:q||[u(M,g,x.eventDataKeys)],event:d.event})}},E=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=d.select(this).datum();if(A._hasHoverEvent&&(M.originalEvent=d.event,m.emit("plotly_unhover",{points:[u(C,g,x.eventDataKeys)],event:d.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(P.loneUnhover(p._hoverlayer.node()),A._hasHoverLabel=!1),w){var T=s.select("path.surface");x.styleOne(T,C,g,m,{hovered:!1})}},I=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=k&&(a.isHierarchyRoot(M)||a.isLeaf(M)),T=a.getPtId(M),N=a.isEntry(M)?a.findEntryWithChild(f,T):a.findEntryWithLevel(f,T),B=a.getPtId(N),U={points:[u(M,g,x.eventDataKeys)],event:d.event};C||(U.nextLevel=B);var V=n.triggerHandler(m,"plotly_"+A.type+"click",U);if(V!==!1&&p.hovermode&&(m._hoverdata=[u(M,g,x.eventDataKeys)],P.click(m,d.event)),!C&&V!==!1&&!m._dragging&&!m._transitioning){y.call("_storeDirectGUIEdit",g,p._tracePreGUI[g.uid],{level:g.level});var W={data:[{level:B}],traces:[A.index]},F={frame:{redraw:!1,duration:x.transitionTime},transition:{duration:x.transitionTime,easing:x.transitionEasing},mode:"immediate",fromcurrent:!0};P.loneUnhover(p._hoverlayer.node()),y.call("animate",m,W,F)}};s.on("mouseover",D),s.on("mouseout",E),s.on("click",I)};function u(s,h,m){for(var b=s.data.data,x={curveNumber:h.index,pointNumber:b.i,data:h._input,fullData:h},_=0;_{var Y=ii(),d=i6(),y=(Ab(),Ti(R_)).interpolate,z=Zs(),P=ji(),i=cc(),n=C0(),a=n.recordMinTextSize,l=n.clearMinTextSize,o=aC(),u=Vv().getRotationAngle,s=o.computeTransform,h=o.transformInsideText,m=NI().styleOne,b=Lg().resizeText,x=x6(),_=RP(),A=oy();te.plot=function(I,M,p,g){var C=I._fullLayout,T=C._sunburstlayer,N,B,U=!p,V=!C.uniformtext.mode&&A.hasTransition(p);if(l("sunburst",C),N=T.selectAll("g.trace.sunburst").data(M,function(F){return F[0].trace.uid}),N.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),N.order(),V){g&&(B=g());var W=Y.transition().duration(p.duration).ease(p.easing).each("end",function(){B&&B()}).each("interrupt",function(){B&&B()});W.each(function(){T.selectAll("g.trace").each(function(F){f(I,F,this,p)})})}else N.each(function(F){f(I,F,this,p)}),C.uniformtext.mode&&b(I,C._sunburstlayer.selectAll(".trace"),"sunburst");U&&N.exit().remove()};function f(I,M,p,g){var C=I._context.staticPlot,T=I._fullLayout,N=!T.uniformtext.mode&&A.hasTransition(g),B=Y.select(p),U=B.selectAll("g.slice"),V=M[0],W=V.trace,F=V.hierarchy,$=A.findEntryWithLevel(F,W.level),q=A.getMaxDepth(W),G=T._size,ee=W.domain,he=G.w*(ee.x[1]-ee.x[0]),xe=G.h*(ee.y[1]-ee.y[0]),ve=.5*Math.min(he,xe),ce=V.cx=G.l+G.w*(ee.x[1]+ee.x[0])/2,re=V.cy=G.t+G.h*(1-ee.y[0])-xe/2;if(!$)return U.remove();var ge=null,ne={};N&&U.each(function(Ee){ne[A.getPtId(Ee)]={rpx0:Ee.rpx0,rpx1:Ee.rpx1,x0:Ee.x0,x1:Ee.x1,transform:Ee.transform},!ge&&A.isEntry(Ee)&&(ge=Ee)});var se=k($).descendants(),_e=$.height+1,oe=0,J=q;V.hasMultipleRoots&&A.isHierarchyRoot($)&&(se=se.slice(1),_e-=1,oe=1,J+=1),se=se.filter(function(Ee){return Ee.y1<=J});var me=u(W.rotation);me&&se.forEach(function(Ee){Ee.x0+=me,Ee.x1+=me});var fe=Math.min(_e,q),Ce=function(Ee){return(Ee-oe)/fe*ve},Be=function(Ee,nt){return[Ee*Math.cos(nt),-Ee*Math.sin(nt)]},Oe=function(Ee){return P.pathAnnulus(Ee.rpx0,Ee.rpx1,Ee.x0,Ee.x1,ce,re)},Ze=function(Ee){return ce+D(Ee)[0]*(Ee.transform.rCenter||0)+(Ee.transform.x||0)},Ge=function(Ee){return re+D(Ee)[1]*(Ee.transform.rCenter||0)+(Ee.transform.y||0)};U=U.data(se,A.getPtId),U.enter().append("g").classed("slice",!0),N?U.exit().transition().each(function(){var Ee=Y.select(this),nt=Ee.select("path.surface");nt.transition().attrTween("d",function(ut){var Et=gt(ut);return function(Gt){return Oe(Et(Gt))}});var xt=Ee.select("g.slicetext");xt.attr("opacity",0)}).remove():U.exit().remove(),U.order();var rt=null;if(N&&ge){var _t=A.getPtId(ge);U.each(function(Ee){rt===null&&A.getPtId(Ee)===_t&&(rt=Ee.x1)})}var pt=U;N&&(pt=pt.transition().each("end",function(){var Ee=Y.select(this);A.setSliceCursor(Ee,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),pt.each(function(Ee){var nt=Y.select(this),xt=P.ensureSingle(nt,"path","surface",function(mr){mr.style("pointer-events",C?"none":"all")});Ee.rpx0=Ce(Ee.y0),Ee.rpx1=Ce(Ee.y1),Ee.xmid=(Ee.x0+Ee.x1)/2,Ee.pxmid=Be(Ee.rpx1,Ee.xmid),Ee.midangle=-(Ee.xmid-Math.PI/2),Ee.startangle=-(Ee.x0-Math.PI/2),Ee.stopangle=-(Ee.x1-Math.PI/2),Ee.halfangle=.5*Math.min(P.angleDelta(Ee.x0,Ee.x1)||Math.PI,Math.PI),Ee.ring=1-Ee.rpx0/Ee.rpx1,Ee.rInscribed=w(Ee),N?xt.transition().attrTween("d",function(mr){var Kr=ct(mr);return function(ri){return Oe(Kr(ri))}}):xt.attr("d",Oe),nt.call(x,$,I,M,{eventDataKeys:_.eventDataKeys,transitionTime:_.CLICK_TRANSITION_TIME,transitionEasing:_.CLICK_TRANSITION_EASING}).call(A.setSliceCursor,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:I._transitioning}),xt.call(m,Ee,W,I);var ut=P.ensureSingle(nt,"g","slicetext"),Et=P.ensureSingle(ut,"text","",function(mr){mr.attr("data-notex",1)}),Gt=P.ensureUniformFontSize(I,A.determineTextFont(W,Ee,T.font));Et.text(te.formatSliceLabel(Ee,$,W,M,T)).classed("slicetext",!0).attr("text-anchor","middle").call(z.font,Gt).call(i.convertToTspans,I);var Jt=z.bBox(Et.node());Ee.transform=h(Jt,Ee,V),Ee.transform.targetX=Ze(Ee),Ee.transform.targetY=Ge(Ee);var gr=function(mr,Kr){var ri=mr.transform;return s(ri,Kr),ri.fontSize=Gt.size,a(W.type,ri,T),P.getTextTransform(ri)};N?Et.transition().attrTween("transform",function(mr){var Kr=Ae(mr);return function(ri){return gr(Kr(ri),Jt)}}):Et.attr("transform",gr(Ee,Jt))});function gt(Ee){var nt=A.getPtId(Ee),xt=ne[nt],ut=ne[A.getPtId($)],Et;if(ut){var Gt=(Ee.x1>ut.x1?2*Math.PI:0)+me;Et=Ee.rpx1rt?2*Math.PI:0)+me;xt={x0:Et,x1:Et}}else xt={rpx0:ve,rpx1:ve},P.extendFlat(xt,ze(Ee));else xt={rpx0:0,rpx1:0};else xt={x0:me,x1:me};return y(xt,ut)}function Ae(Ee){var nt=ne[A.getPtId(Ee)],xt,ut=Ee.transform;if(nt)xt=nt;else if(xt={rpx1:Ee.rpx1,transform:{textPosAngle:ut.textPosAngle,scale:0,rotate:ut.rotate,rCenter:ut.rCenter,x:ut.x,y:ut.y}},ge)if(Ee.parent)if(rt){var Et=Ee.x1>rt?2*Math.PI:0;xt.x0=xt.x1=Et}else P.extendFlat(xt,ze(Ee));else xt.x0=xt.x1=me;else xt.x0=xt.x1=me;var Gt=y(xt.transform.textPosAngle,Ee.transform.textPosAngle),Jt=y(xt.rpx1,Ee.rpx1),gr=y(xt.x0,Ee.x0),mr=y(xt.x1,Ee.x1),Kr=y(xt.transform.scale,ut.scale),ri=y(xt.transform.rotate,ut.rotate),Mr=ut.rCenter===0?3:xt.transform.rCenter===0?1/3:1,ui=y(xt.transform.rCenter,ut.rCenter),mi=function(Ot){return ui(Math.pow(Ot,Mr))};return function(Ot){var Je=Jt(Ot);gr(Ot),mr(Ot);var ot=mi(Ot),De=Gt(Ot),ye={rpx1:Je,transform:{textPosAngle:De,rCenter:ot,x:ut.x,y:ut.y}};return a(W.type,ut,T),{transform:{targetX:Ze(ye),targetY:Ge(ye),scale:Kr(Ot),rotate:ri(Ot),rCenter:ot}}}}function ze(Ee){var nt=Ee.parent,xt=ne[A.getPtId(nt)],ut={};if(xt){var Et=nt.children,Gt=Et.indexOf(Ee),Jt=Et.length,gr=y(xt.x0,xt.x1);ut.x0=gr(Gt/Jt),ut.x1=gr(Gt/Jt)}else ut.x0=ut.x1=0;return ut}}function k(I){return d.partition().size([2*Math.PI,I.height+1])(I)}te.formatSliceLabel=function(I,M,p,g,C){var T=p.texttemplate,N=p.textinfo;if(!T&&(!N||N==="none"))return"";var B=C.separators,U=g[0],V=I.data.data,W=U.hierarchy,F=A.isHierarchyRoot(I),$=A.getParent(W,I),q=A.getValue(I);if(!T){var G=N.split("+"),ee=function(oe){return G.indexOf(oe)!==-1},he=[],xe;if(ee("label")&&V.label&&he.push(V.label),V.hasOwnProperty("v")&&ee("value")&&he.push(A.formatValue(V.v,B)),!F){ee("current path")&&he.push(A.getPath(I.data));var ve=0;ee("percent parent")&&ve++,ee("percent entry")&&ve++,ee("percent root")&&ve++;var ce=ve>1;if(ve){var re,ge=function(oe){xe=A.formatPercent(re,B),ce&&(xe+=" of "+oe),he.push(xe)};ee("percent parent")&&!F&&(re=q/A.getValue($),ge("parent")),ee("percent entry")&&(re=q/A.getValue(M),ge("entry")),ee("percent root")&&(re=q/A.getValue(W),ge("root"))}}return ee("text")&&(xe=P.castOption(p,V.i,"text"),P.isValidTextValue(xe)&&he.push(xe)),he.join("
")}var ne=P.castOption(p,V.i,"texttemplate");if(!ne)return"";var se={};V.label&&(se.label=V.label),V.hasOwnProperty("v")&&(se.value=V.v,se.valueLabel=A.formatValue(V.v,B)),se.currentPath=A.getPath(I.data),F||(se.percentParent=q/A.getValue($),se.percentParentLabel=A.formatPercent(se.percentParent,B),se.parent=A.getPtLabel($)),se.percentEntry=q/A.getValue(M),se.percentEntryLabel=A.formatPercent(se.percentEntry,B),se.entry=A.getPtLabel(M),se.percentRoot=q/A.getValue(W),se.percentRootLabel=A.formatPercent(se.percentRoot,B),se.root=A.getPtLabel(W),V.hasOwnProperty("color")&&(se.color=V.color);var _e=P.castOption(p,V.i,"text");return(P.isValidTextValue(_e)||_e==="")&&(se.text=_e),se.customdata=P.castOption(p,V.i,"customdata"),P.texttemplateString({data:[se,p._meta],fallback:p.texttemplatefallback,labels:se,locale:C._d3locale,template:ne})};function w(I){return I.rpx0===0&&P.isFullCircle([I.x0,I.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(I.halfangle)),I.ring/2))}function D(I){return E(I.rpx1,I.transform.textPosAngle)}function E(I,M){return[I*Math.sin(M),-I*Math.cos(M)]}}),$K=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"sunburst",basePlotModule:nK(),categories:[],animatable:!0,attributes:r6(),layoutAttributes:FP(),supplyDefaults:aK(),supplyLayoutDefaults:oK(),calc:n6().calc,crossTraceCalc:n6().crossTraceCalc,plot:OC().plot,style:NI().style,colorbar:Mo(),meta:{}}}),HK=Fe((te,Y)=>{Y.exports=$K()}),VK=Fe(te=>{var Y=sh();te.name="treemap",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),Mb=Fe((te,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),BC=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=zc(),i=Xh().attributes,n=xb(),a=r6(),l=Mb(),o=an().extendFlat,u=Wd().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:a.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:a.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},n.textfont,{}),editType:"calc"},text:n.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,hoverinfo:a.hoverinfo,hovertemplate:d({},{keys:l.eventDataKeys}),hovertemplatefallback:z(),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:o({},n.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:n.sort,root:a.root,domain:i({name:"treemap",trace:!0,editType:"calc"})}}),jI=Fe((te,Y)=>{Y.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),WK=Fe((te,Y)=>{var d=ji(),y=BC(),z=Xi(),P=Xh().defaults,i=eg().handleText,n=pb().TEXTPAD,a=bb().handleMarkerDefaults,l=lh(),o=l.hasColorscale,u=l.handleDefaults;Y.exports=function(s,h,m,b){function x(g,C){return d.coerce(s,h,y,g,C)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var f=x("values");f&&f.length?x("branchvalues"):x("count"),x("level"),x("maxdepth");var k=x("tiling.packing");k==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var w=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",d.isArrayOrTypedArray(w)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var D=x("pathbar.visible"),E="auto";i(s,h,b,x,E,{hasPathbar:D,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var I=h.textposition.indexOf("bottom")!==-1;a(s,h,b,x);var M=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;M?u(s,h,b,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(h.marker.colors||[]).length);var p=h.textfont.size*2;x("marker.pad.t",I?p/4:p),x("marker.pad.l",p/4),x("marker.pad.r",p/4),x("marker.pad.b",I?p:p/4),x("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},D&&(x("pathbar.thickness",h.pathbar.textfont.size+2*n),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),qK=Fe((te,Y)=>{var d=ji(),y=jI();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("treemapcolorway",P.colorway),i("extendtreemapcolors")}}),UI=Fe(te=>{var Y=n6();te.calc=function(d,y){return Y.calc(d,y)},te.crossTraceCalc=function(d){return Y._runCrossTraceCalc("treemap",d)}}),$I=Fe((te,Y)=>{Y.exports=function d(y,z,P){var i;P.swapXY&&(i=y.x0,y.x0=y.y0,y.y0=i,i=y.x1,y.x1=y.y1,y.y1=i),P.flipX&&(i=y.x0,y.x0=z[0]-y.x1,y.x1=z[0]-i),P.flipY&&(i=y.y0,y.y0=z[1]-y.y1,y.y1=z[1]-i);var n=y.children;if(n)for(var a=0;a{var d=i6(),y=$I();Y.exports=function(P,i,n){var a=n.flipX,l=n.flipY,o=n.packing==="dice-slice",u=n.pad[l?"bottom":"top"],s=n.pad[a?"right":"left"],h=n.pad[a?"left":"right"],m=n.pad[l?"top":"bottom"],b;o&&(b=s,s=u,u=b,b=h,h=m,m=b);var x=d.treemap().tile(z(n.packing,n.squarifyratio)).paddingInner(n.pad.inner).paddingLeft(s).paddingRight(h).paddingTop(u).paddingBottom(m).size(o?[i[1],i[0]]:i)(P);return(o||a||l)&&y(x,i,{swapXY:o,flipX:a,flipY:l}),x};function z(P,i){switch(P){case"squarify":return d.treemapSquarify.ratio(i);case"binary":return d.treemapBinary;case"dice":return d.treemapDice;case"slice":return d.treemapSlice;default:return d.treemapSliceDice}}}),RC=Fe((te,Y)=>{var d=ii(),y=Xi(),z=ji(),P=oy(),i=C0().resizeText,n=zC();function a(o){var u=o._fullLayout._treemaplayer.selectAll(".trace");i(o,u,"treemap"),u.each(function(s){var h=d.select(this),m=s[0],b=m.trace;h.style("opacity",b.opacity),h.selectAll("path.surface").each(function(x){d.select(this).call(l,x,b,o,{hovered:!1})})})}function l(o,u,s,h,m){var b=(m||{}).hovered,x=u.data.data,_=x.i,A,f,k=x.color,w=P.isHierarchyRoot(u),D=1;if(b)A=s._hovered.marker.line.color,f=s._hovered.marker.line.width;else if(w&&k===s.root.color)D=100,A="rgba(0,0,0,0)",f=0;else if(A=z.castOption(s,_,"marker.line.color")||y.defaultLine,f=z.castOption(s,_,"marker.line.width")||0,!s._hasColorscale&&!u.onPathbar){var E=s.marker.depthfade;if(E){var I=y.combine(y.addOpacity(s._backgroundColor,.75),k),M;if(E===!0){var p=P.getMaxDepth(s);isFinite(p)?P.isLeaf(u)?M=0:M=s._maxVisibleLayers-(u.data.depth-s._entryDepth):M=u.data.height+1}else M=u.data.depth-s._entryDepth,s._atRootLevel||M++;if(M>0)for(var g=0;g{var d=ii(),y=ji(),z=Zs(),P=cc(),i=HI(),n=RC().styleOne,a=Mb(),l=oy(),o=x6(),u=!0;Y.exports=function(s,h,m,b,x){var _=x.barDifY,A=x.width,f=x.height,k=x.viewX,w=x.viewY,D=x.pathSlice,E=x.toMoveInsideSlice,I=x.strTransform,M=x.hasTransition,p=x.handleSlicesExit,g=x.makeUpdateSliceInterpolator,C=x.makeUpdateTextInterpolator,T={},N=s._context.staticPlot,B=s._fullLayout,U=h[0],V=U.trace,W=U.hierarchy,F=A/V._entryDepth,$=l.listPath(m.data,"id"),q=i(W.copy(),[A,f],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();q=q.filter(function(ee){var he=$.indexOf(ee.data.id);return he===-1?!1:(ee.x0=F*he,ee.x1=F*(he+1),ee.y0=_,ee.y1=_+f,ee.onPathbar=!0,!0)}),q.reverse(),b=b.data(q,l.getPtId),b.enter().append("g").classed("pathbar",!0),p(b,u,T,[A,f],D),b.order();var G=b;M&&(G=G.transition().each("end",function(){var ee=d.select(this);l.setSliceCursor(ee,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),G.each(function(ee){ee._x0=k(ee.x0),ee._x1=k(ee.x1),ee._y0=w(ee.y0),ee._y1=w(ee.y1),ee._hoverX=k(ee.x1-Math.min(A,f)/2),ee._hoverY=w(ee.y1-f/2);var he=d.select(this),xe=y.ensureSingle(he,"path","surface",function(ge){ge.style("pointer-events",N?"none":"all")});M?xe.transition().attrTween("d",function(ge){var ne=g(ge,u,T,[A,f]);return function(se){return D(ne(se))}}):xe.attr("d",D),he.call(o,m,s,h,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:s._transitioning}),xe.call(n,ee,V,s,{hovered:!1}),ee._text=(l.getPtLabel(ee)||"").split("
").join(" ")||"";var ve=y.ensureSingle(he,"g","slicetext"),ce=y.ensureSingle(ve,"text","",function(ge){ge.attr("data-notex",1)}),re=y.ensureUniformFontSize(s,l.determineTextFont(V,ee,B.font,{onPathbar:!0}));ce.text(ee._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(z.font,re).call(P.convertToTspans,s),ee.textBB=z.bBox(ce.node()),ee.transform=E(ee,{fontSize:re.size,onPathbar:!0}),ee.transform.fontSize=re.size,M?ce.transition().attrTween("transform",function(ge){var ne=C(ge,u,T,[A,f]);return function(se){return I(ne(se))}}):ce.attr("transform",I(ee))})}}),ZK=Fe((te,Y)=>{var d=ii(),y=(Ab(),Ti(R_)).interpolate,z=oy(),P=ji(),i=pb().TEXTPAD,n=mb(),a=n.toMoveInsideBar,l=C0(),o=l.recordMinTextSize,u=Mb(),s=GK();function h(m){return z.isHierarchyRoot(m)?"":z.getPtId(m)}Y.exports=function(m,b,x,_,A){var f=m._fullLayout,k=b[0],w=k.trace,D=w.type,E=D==="icicle",I=k.hierarchy,M=z.findEntryWithLevel(I,w.level),p=d.select(x),g=p.selectAll("g.pathbar"),C=p.selectAll("g.slice");if(!M){g.remove(),C.remove();return}var T=z.isHierarchyRoot(M),N=!f.uniformtext.mode&&z.hasTransition(_),B=z.getMaxDepth(w),U=function(Mr){return Mr.data.depth-M.data.depth-1?$+ee:-(G+ee):0,xe={x0:q,x1:q,y0:he,y1:he+G},ve=function(Mr,ui,mi){var Ot=w.tiling.pad,Je=function(Pe){return Pe-Ot<=ui.x0},ot=function(Pe){return Pe+Ot>=ui.x1},De=function(Pe){return Pe-Ot<=ui.y0},ye=function(Pe){return Pe+Ot>=ui.y1};return Mr.x0===ui.x0&&Mr.x1===ui.x1&&Mr.y0===ui.y0&&Mr.y1===ui.y1?{x0:Mr.x0,x1:Mr.x1,y0:Mr.y0,y1:Mr.y1}:{x0:Je(Mr.x0-Ot)?0:ot(Mr.x0-Ot)?mi[0]:Mr.x0,x1:Je(Mr.x1+Ot)?0:ot(Mr.x1+Ot)?mi[0]:Mr.x1,y0:De(Mr.y0-Ot)?0:ye(Mr.y0-Ot)?mi[1]:Mr.y0,y1:De(Mr.y1+Ot)?0:ye(Mr.y1+Ot)?mi[1]:Mr.y1}},ce=null,re={},ge={},ne=null,se=function(Mr,ui){return ui?re[h(Mr)]:ge[h(Mr)]},_e=function(Mr,ui,mi,Ot){if(ui)return re[h(I)]||xe;var Je=ge[w.level]||mi;return U(Mr)?ve(Mr,Je,Ot):{}};k.hasMultipleRoots&&T&&B++,w._maxDepth=B,w._backgroundColor=f.paper_bgcolor,w._entryDepth=M.data.depth,w._atRootLevel=T;var oe=-F/2+V.l+V.w*(W.x[1]+W.x[0])/2,J=-$/2+V.t+V.h*(1-(W.y[1]+W.y[0])/2),me=function(Mr){return oe+Mr},fe=function(Mr){return J+Mr},Ce=fe(0),Be=me(0),Oe=function(Mr){return Be+Mr},Ze=function(Mr){return Ce+Mr};function Ge(Mr,ui){return Mr+","+ui}var rt=Oe(0),_t=function(Mr){Mr.x=Math.max(rt,Mr.x)},pt=w.pathbar.edgeshape,gt=function(Mr){var ui=Oe(Math.max(Math.min(Mr.x0,Mr.x0),0)),mi=Oe(Math.min(Math.max(Mr.x1,Mr.x1),q)),Ot=Ze(Mr.y0),Je=Ze(Mr.y1),ot=G/2,De={},ye={};De.x=ui,ye.x=mi,De.y=ye.y=(Ot+Je)/2;var Pe={x:ui,y:Ot},He={x:mi,y:Ot},at={x:mi,y:Je},ht={x:ui,y:Je};return pt===">"?(Pe.x-=ot,He.x-=ot,at.x-=ot,ht.x-=ot):pt==="/"?(at.x-=ot,ht.x-=ot,De.x-=ot/2,ye.x-=ot/2):pt==="\\"?(Pe.x-=ot,He.x-=ot,De.x-=ot/2,ye.x-=ot/2):pt==="<"&&(De.x-=ot,ye.x-=ot),_t(Pe),_t(ht),_t(De),_t(He),_t(at),_t(ye),"M"+Ge(Pe.x,Pe.y)+"L"+Ge(He.x,He.y)+"L"+Ge(ye.x,ye.y)+"L"+Ge(at.x,at.y)+"L"+Ge(ht.x,ht.y)+"L"+Ge(De.x,De.y)+"Z"},ct=w[E?"tiling":"marker"].pad,Ae=function(Mr){return w.textposition.indexOf(Mr)!==-1},ze=Ae("top"),Ee=Ae("left"),nt=Ae("right"),xt=Ae("bottom"),ut=function(Mr){var ui=me(Mr.x0),mi=me(Mr.x1),Ot=fe(Mr.y0),Je=fe(Mr.y1),ot=mi-ui,De=Je-Ot;if(!ot||!De)return"";var ye=w.marker.cornerradius||0,Pe=Math.min(ye,ot/2,De/2);Pe&&Mr.data&&Mr.data.data&&Mr.data.data.label&&(ze&&(Pe=Math.min(Pe,ct.t)),Ee&&(Pe=Math.min(Pe,ct.l)),nt&&(Pe=Math.min(Pe,ct.r)),xt&&(Pe=Math.min(Pe,ct.b)));var He=function(at,ht){return Pe?"a"+Ge(Pe,Pe)+" 0 0 1 "+Ge(at,ht):""};return"M"+Ge(ui,Ot+Pe)+He(Pe,-Pe)+"L"+Ge(mi-Pe,Ot)+He(Pe,Pe)+"L"+Ge(mi,Je-Pe)+He(-Pe,Pe)+"L"+Ge(ui+Pe,Je)+He(-Pe,-Pe)+"Z"},Et=function(Mr,ui){var mi=Mr.x0,Ot=Mr.x1,Je=Mr.y0,ot=Mr.y1,De=Mr.textBB,ye=ze||ui.isHeader&&!xt,Pe=ye?"start":xt?"end":"middle",He=Ae("right"),at=Ae("left")||ui.onPathbar,ht=at?-1:He?1:0;if(ui.isHeader){if(mi+=(E?ct:ct.l)-i,Ot-=(E?ct:ct.r)-i,mi>=Ot){var At=(mi+Ot)/2;mi=At,Ot=At}var Wt;xt?(Wt=ot-(E?ct:ct.b),Je{var d=ii(),y=oy(),z=C0(),P=z.clearMinTextSize,i=Lg().resizeText,n=ZK();Y.exports=function(a,l,o,u,s){var h=s.type,m=s.drawDescendants,b=a._fullLayout,x=b["_"+h+"layer"],_,A,f=!o;if(P(h,b),_=x.selectAll("g.trace."+h).data(l,function(w){return w[0].trace.uid}),_.enter().append("g").classed("trace",!0).classed(h,!0),_.order(),!b.uniformtext.mode&&y.hasTransition(o)){u&&(A=u());var k=d.transition().duration(o.duration).ease(o.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()});k.each(function(){x.selectAll("g.trace").each(function(w){n(a,w,this,o,m)})})}else _.each(function(w){n(a,w,this,o,m)}),b.uniformtext.mode&&i(a,x.selectAll(".trace"),h);f&&_.exit().remove()}}),KK=Fe((te,Y)=>{var d=ii(),y=ji(),z=Zs(),P=cc(),i=HI(),n=RC().styleOne,a=Mb(),l=oy(),o=x6(),u=OC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,f=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,T=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,$=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=!q&&!W.marker.pad.t||q&&!W.marker.pad.b,ee=i(b,[A,f],{packing:W.tiling.packing,squarifyratio:W.tiling.squarifyratio,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,pad:{inner:W.tiling.pad,top:W.marker.pad.t,left:W.marker.pad.l,right:W.marker.pad.r,bottom:W.marker.pad.b}}),he=ee.descendants(),xe=1/0,ve=-1/0;he.forEach(function(se){var _e=se.depth;_e>=W._maxDepth?(se.x0=se.x1=(se.x0+se.x1)/2,se.y0=se.y1=(se.y0+se.y1)/2):(xe=Math.min(xe,_e),ve=Math.max(ve,_e))}),x=x.data(he,l.getPtId),W._maxVisibleLayers=isFinite(ve)?ve-xe+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,f],D),x.order();var ce=null;if(M&&T){var re=l.getPtId(T);x.each(function(se){ce===null&&l.getPtId(se)===re&&(ce={x0:se.x0,x1:se.x1,y0:se.y0,y1:se.y1})})}var ge=function(){return ce||{x0:0,x1:A,y0:0,y1:f}},ne=x;return M&&(ne=ne.transition().each("end",function(){var se=d.select(this);l.setSliceCursor(se,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function(se){var _e=l.isHeader(se,W);se._x0=k(se.x0),se._x1=k(se.x1),se._y0=w(se.y0),se._y1=w(se.y1),se._hoverX=k(se.x1-W.marker.pad.r),se._hoverY=w(q?se.y1-W.marker.pad.b/2:se.y0+W.marker.pad.t/2);var oe=d.select(this),J=y.ensureSingle(oe,"path","surface",function(Ze){Ze.style("pointer-events",B?"none":"all")});M?J.transition().attrTween("d",function(Ze){var Ge=g(Ze,s,ge(),[A,f]);return function(rt){return D(Ge(rt))}}):J.attr("d",D),oe.call(o,b,h,m,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),J.call(n,se,W,h,{hovered:!1}),se.x0===se.x1||se.y0===se.y1?se._text="":_e?se._text=G?"":l.getPtLabel(se)||"":se._text=u(se,b,W,m,U)||"";var me=y.ensureSingle(oe,"g","slicetext"),fe=y.ensureSingle(me,"text","",function(Ze){Ze.attr("data-notex",1)}),Ce=y.ensureUniformFontSize(h,l.determineTextFont(W,se,U.font)),Be=se._text||" ",Oe=_e&&Be.indexOf("
")===-1;fe.text(Be).classed("slicetext",!0).attr("text-anchor",$?"end":F||Oe?"start":"middle").call(z.font,Ce).call(P.convertToTspans,h),se.textBB=z.bBox(fe.node()),se.transform=E(se,{fontSize:Ce.size,isHeader:_e}),se.transform.fontSize=Ce.size,M?fe.transition().attrTween("transform",function(Ze){var Ge=C(Ze,s,ge(),[A,f]);return function(rt){return I(Ge(rt))}}):fe.attr("transform",I(se))}),ce}}),YK=Fe((te,Y)=>{var d=VI(),y=KK();Y.exports=function(z,P,i,n){return d(z,P,i,n,{type:"treemap",drawDescendants:y})}}),XK=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"treemap",basePlotModule:VK(),categories:[],animatable:!0,attributes:BC(),layoutAttributes:jI(),supplyDefaults:WK(),supplyLayoutDefaults:qK(),calc:UI().calc,crossTraceCalc:UI().crossTraceCalc,plot:YK(),style:RC().style,colorbar:Mo(),meta:{}}}),JK=Fe((te,Y)=>{Y.exports=XK()}),QK=Fe(te=>{var Y=sh();te.name="icicle",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),WI=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=zc(),i=Xh().attributes,n=xb(),a=r6(),l=BC(),o=Mb(),u=an().extendFlat,s=Wd().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:a.marker.colors,line:a.marker.line,pattern:s,editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),leaf:a.leaf,pathbar:l.pathbar,text:n.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,hoverinfo:a.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),hovertemplatefallback:z(),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:n.sort,root:a.root,domain:i({name:"icicle",trace:!0,editType:"calc"})}}),qI=Fe((te,Y)=>{Y.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),eY=Fe((te,Y)=>{var d=ji(),y=WI(),z=Xi(),P=Xh().defaults,i=eg().handleText,n=pb().TEXTPAD,a=bb().handleMarkerDefaults,l=lh(),o=l.hasColorscale,u=l.handleDefaults;Y.exports=function(s,h,m,b){function x(I,M){return d.coerce(s,h,y,I,M)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var f=x("values");f&&f.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.orientation"),x("tiling.flip"),x("tiling.pad");var k=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",d.isArrayOrTypedArray(k)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var w=x("pathbar.visible"),D="auto";i(s,h,b,x,D,{hasPathbar:w,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition"),a(s,h,b,x);var E=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;E&&u(s,h,b,x,{prefix:"marker.",cLetter:"c"}),x("leaf.opacity",E?1:.7),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},w&&(x("pathbar.thickness",h.pathbar.textfont.size+2*n),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),tY=Fe((te,Y)=>{var d=ji(),y=qI();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("iciclecolorway",P.colorway),i("extendiciclecolors")}}),GI=Fe(te=>{var Y=n6();te.calc=function(d,y){return Y.calc(d,y)},te.crossTraceCalc=function(d){return Y._runCrossTraceCalc("icicle",d)}}),rY=Fe((te,Y)=>{var d=i6(),y=$I();Y.exports=function(z,P,i){var n=i.flipX,a=i.flipY,l=i.orientation==="h",o=i.maxDepth,u=P[0],s=P[1];o&&(u=(z.height+1)*P[0]/Math.min(z.height+1,o),s=(z.height+1)*P[1]/Math.min(z.height+1,o));var h=d.partition().padding(i.pad.inner).size(l?[P[1],u]:[P[0],s])(z);return(l||n||a)&&y(h,P,{swapXY:l,flipX:n,flipY:a}),h}}),ZI=Fe((te,Y)=>{var d=ii(),y=Xi(),z=ji(),P=C0().resizeText,i=zC();function n(l){var o=l._fullLayout._iciclelayer.selectAll(".trace");P(l,o,"icicle"),o.each(function(u){var s=d.select(this),h=u[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){d.select(this).call(a,b,m,l)})})}function a(l,o,u,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(u,b,"marker.line.color")||y.defaultLine,_=z.castOption(u,b,"marker.line.width")||0;l.call(i,o,u,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?u.leaf.opacity:null)}Y.exports={style:n,styleOne:a}}),iY=Fe((te,Y)=>{var d=ii(),y=ji(),z=Zs(),P=cc(),i=rY(),n=ZI().styleOne,a=Mb(),l=oy(),o=x6(),u=OC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,f=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,T=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,$=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=i(b,[A,f],{flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,orientation:W.tiling.orientation,pad:{inner:W.tiling.pad},maxDepth:W._maxDepth}),ee=G.descendants(),he=1/0,xe=-1/0;ee.forEach(function(ne){var se=ne.depth;se>=W._maxDepth?(ne.x0=ne.x1=(ne.x0+ne.x1)/2,ne.y0=ne.y1=(ne.y0+ne.y1)/2):(he=Math.min(he,se),xe=Math.max(xe,se))}),x=x.data(ee,l.getPtId),W._maxVisibleLayers=isFinite(xe)?xe-he+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,f],D),x.order();var ve=null;if(M&&T){var ce=l.getPtId(T);x.each(function(ne){ve===null&&l.getPtId(ne)===ce&&(ve={x0:ne.x0,x1:ne.x1,y0:ne.y0,y1:ne.y1})})}var re=function(){return ve||{x0:0,x1:A,y0:0,y1:f}},ge=x;return M&&(ge=ge.transition().each("end",function(){var ne=d.select(this);l.setSliceCursor(ne,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ge.each(function(ne){ne._x0=k(ne.x0),ne._x1=k(ne.x1),ne._y0=w(ne.y0),ne._y1=w(ne.y1),ne._hoverX=k(ne.x1-W.tiling.pad),ne._hoverY=w(q?ne.y1-W.tiling.pad/2:ne.y0+W.tiling.pad/2);var se=d.select(this),_e=y.ensureSingle(se,"path","surface",function(fe){fe.style("pointer-events",B?"none":"all")});M?_e.transition().attrTween("d",function(fe){var Ce=g(fe,s,re(),[A,f],{orientation:W.tiling.orientation,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1});return function(Be){return D(Ce(Be))}}):_e.attr("d",D),se.call(o,b,h,m,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),_e.call(n,ne,W,h,{hovered:!1}),ne.x0===ne.x1||ne.y0===ne.y1?ne._text="":ne._text=u(ne,b,W,m,U)||"";var oe=y.ensureSingle(se,"g","slicetext"),J=y.ensureSingle(oe,"text","",function(fe){fe.attr("data-notex",1)}),me=y.ensureUniformFontSize(h,l.determineTextFont(W,ne,U.font));J.text(ne._text||" ").classed("slicetext",!0).attr("text-anchor",$?"end":F?"start":"middle").call(z.font,me).call(P.convertToTspans,h),ne.textBB=z.bBox(J.node()),ne.transform=E(ne,{fontSize:me.size}),ne.transform.fontSize=me.size,M?J.transition().attrTween("transform",function(fe){var Ce=C(fe,s,re(),[A,f]);return function(Be){return I(Ce(Be))}}):J.attr("transform",I(ne))}),ve}}),nY=Fe((te,Y)=>{var d=VI(),y=iY();Y.exports=function(z,P,i,n){return d(z,P,i,n,{type:"icicle",drawDescendants:y})}}),aY=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"icicle",basePlotModule:QK(),categories:[],animatable:!0,attributes:WI(),layoutAttributes:qI(),supplyDefaults:eY(),supplyLayoutDefaults:tY(),calc:GI().calc,crossTraceCalc:GI().crossTraceCalc,plot:nY(),style:ZI().style,colorbar:Mo(),meta:{}}}),oY=Fe((te,Y)=>{Y.exports=aY()}),sY=Fe(te=>{var Y=sh();te.name="funnelarea",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),KI=Fe((te,Y)=>{var d=xb(),y=_a(),z=Xh().attributes,{hovertemplateAttrs:P,texttemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=an().extendFlat;Y.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:a({},d.marker.line.color,{dflt:null}),width:a({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:a({},d.scalegroup,{}),textinfo:a({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:i({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:n({editType:"plot"}),hoverinfo:a({},y.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:P({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:n(),textposition:a({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:a({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:z({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),YI=Fe((te,Y)=>{var d=nC().hiddenlabels;Y.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),lY=Fe((te,Y)=>{var d=ji(),y=KI(),z=Xh().defaults,P=eg().handleText,i=bb().handleLabelsAndValues,n=bb().handleMarkerDefaults;Y.exports=function(a,l,o,u){function s(D,E){return d.coerce(a,l,y,D,E)}var h=s("labels"),m=s("values"),b=i(h,m),x=b.len;if(l._hasLabels=b.hasLabels,l._hasValues=b.hasValues,!l._hasLabels&&l._hasValues&&(s("label0"),s("dlabel")),!x){l.visible=!1;return}l._length=x,n(a,l,u,s),s("scalegroup");var _=s("text"),A=s("texttemplate");s("texttemplatefallback");var f;if(A||(f=s("textinfo",Array.isArray(_)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),A||f&&f!=="none"){var k=s("textposition");P(a,l,u,s,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else f==="none"&&s("textposition","none");z(l,u,s);var w=s("title.text");w&&(s("title.position"),d.coerceFont(s,"title.font",u.font)),s("aspectratio"),s("baseratio")}}),uY=Fe((te,Y)=>{var d=ji(),y=YI();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("hiddenlabels"),i("funnelareacolorway",P.colorway),i("extendfunnelareacolors")}}),XI=Fe((te,Y)=>{var d=Bw();function y(P,i){return d.calc(P,i)}function z(P){d.crossTraceCalc(P,{type:"funnelarea"})}Y.exports={calc:y,crossTraceCalc:z}}),cY=Fe((te,Y)=>{var d=ii(),y=Zs(),z=ji(),P=z.strScale,i=z.strTranslate,n=cc(),a=mb(),l=a.toMoveInsideBar,o=C0(),u=o.recordMinTextSize,s=o.clearMinTextSize,h=Vv(),m=aC(),b=m.attachFxHandlers,x=m.determineInsideTextFont,_=m.layoutAreas,A=m.prerenderTitles,f=m.positionTitleOutside,k=m.formatSliceLabel;Y.exports=function(I,M){var p=I._context.staticPlot,g=I._fullLayout;s("funnelarea",g),A(M,I),_(M,g._size),z.makeTraceGroups(g._funnelarealayer,M,"trace").each(function(C){var T=d.select(this),N=C[0],B=N.trace;E(C),T.each(function(){var U=d.select(this).selectAll("g.slice").data(C);U.enter().append("g").classed("slice",!0),U.exit().remove(),U.each(function(W,F){if(W.hidden){d.select(this).selectAll("path,g").remove();return}W.pointNumber=W.i,W.curveNumber=B.index;var $=N.cx,q=N.cy,G=d.select(this),ee=G.selectAll("path.surface").data([W]);ee.enter().append("path").classed("surface",!0).style({"pointer-events":p?"none":"all"}),G.call(b,I,C);var he="M"+($+W.TR[0])+","+(q+W.TR[1])+w(W.TR,W.BR)+w(W.BR,W.BL)+w(W.BL,W.TL)+"Z";ee.attr("d",he),k(I,W,N);var xe=h.castOption(B.textposition,W.pts),ve=G.selectAll("g.slicetext").data(W.text&&xe!=="none"?[0]:[]);ve.enter().append("g").classed("slicetext",!0),ve.exit().remove(),ve.each(function(){var ce=z.ensureSingle(d.select(this),"text","",function(me){me.attr("data-notex",1)}),re=z.ensureUniformFontSize(I,x(B,W,g.font));ce.text(W.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,re).call(n.convertToTspans,I);var ge=y.bBox(ce.node()),ne,se,_e,oe=Math.min(W.BL[1],W.BR[1])+q,J=Math.max(W.TL[1],W.TR[1])+q;se=Math.max(W.TL[0],W.BL[0])+$,_e=Math.min(W.TR[0],W.BR[0])+$,ne=l(se,_e,oe,J,ge,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),ne.fontSize=re.size,u(B.type,ne,g),C[F].transform=ne,z.setTransormAndDisplay(ce,ne)})});var V=d.select(this).selectAll("g.titletext").data(B.title.text?[0]:[]);V.enter().append("g").classed("titletext",!0),V.exit().remove(),V.each(function(){var W=z.ensureSingle(d.select(this),"text","",function(q){q.attr("data-notex",1)}),F=B.title.text;B._meta&&(F=z.templateString(F,B._meta)),W.text(F).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,B.title.font).call(n.convertToTspans,I);var $=f(N,g._size);W.attr("transform",i($.x,$.y)+P(Math.min(1,$.scale))+i($.tx,$.ty))})})})};function w(I,M){var p=M[0]-I[0],g=M[1]-I[1];return"l"+p+","+g}function D(I,M){return[.5*(I[0]+M[0]),.5*(I[1]+M[1])]}function E(I){if(!I.length)return;var M=I[0],p=M.trace,g=p.aspectratio,C=p.baseratio;C>.999&&(C=.999);var T=Math.pow(C,2),N=M.vTotal,B=N*T/(1-T),U=N,V=B/N;function W(){var Ce=Math.sqrt(V);return{x:Ce,y:-Ce}}function F(){var Ce=W();return[Ce.x,Ce.y]}var $,q=[];q.push(F());var G,ee;for(G=I.length-1;G>-1;G--)if(ee=I[G],!ee.hidden){var he=ee.v/U;V+=he,q.push(F())}var xe=1/0,ve=-1/0;for(G=0;G-1;G--)if(ee=I[G],!ee.hidden){J+=1;var me=q[J][0],fe=q[J][1];ee.TL=[-me,fe],ee.TR=[me,fe],ee.BL=_e,ee.BR=oe,ee.pxmid=D(ee.TR,ee.BR),_e=ee.TL,oe=ee.TR}}}),hY=Fe((te,Y)=>{var d=ii(),y=Wv(),z=C0().resizeText;Y.exports=function(P){var i=P._fullLayout._funnelarealayer.selectAll(".trace");z(P,i,"funnelarea"),i.each(function(n){var a=n[0],l=a.trace,o=d.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(u){d.select(this).call(y,u,l,P)})})}}),fY=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"funnelarea",basePlotModule:sY(),categories:["pie-like","funnelarea","showLegend"],attributes:KI(),layoutAttributes:YI(),supplyDefaults:lY(),supplyLayoutDefaults:uY(),calc:XI().calc,crossTraceCalc:XI().crossTraceCalc,plot:cY(),style:hY(),styleOne:Wv(),meta:{}}}),dY=Fe((te,Y)=>{Y.exports=fY()}),$p=Fe((te,Y)=>{(function(){var d={24:function(i){var n={left:0,top:0};i.exports=a;function a(o,u,s){u=u||o.currentTarget||o.srcElement,Array.isArray(s)||(s=[0,0]);var h=o.clientX||0,m=o.clientY||0,b=l(u);return s[0]=h-b.left,s[1]=m-b.top,s}function l(o){return o===window||o===document||o===document.body?n:o.getBoundingClientRect()}},109:function(i){i.exports=n;function n(a,l,o,u){var s=o[0],h=o[2],m=l[0]-s,b=l[2]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=s+b*x+m*_,a[1]=l[1],a[2]=h+b*_-m*x,a}},160:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.max(l[0],o[0]),a[1]=Math.max(l[1],o[1]),a[2]=Math.max(l[2],o[2]),a[3]=Math.max(l[3],o[3]),a}},216:function(i){i.exports=n;function n(a,l){for(var o={},u=0;u1){x[0]in m||(m[x[0]]=[]),m=m[x[0]];for(var _=1;_=0;--$){var ge=W[$];q=ge[0];var ne=U[q],se=ne[0],_e=ne[1],oe=B[se],J=B[_e];if((oe[0]-J[0]||oe[1]-J[1])<0){var me=se;se=_e,_e=me}ne[0]=se;var fe=ne[1]=ge[1],Ce;for(F&&(Ce=ne[2]);$>0&&W[$-1][0]===q;){var ge=W[--$],Be=ge[1];F?U.push([fe,Be,Ce]):U.push([fe,Be]),fe=Be}F?U.push([fe,_e,Ce]):U.push([fe,_e])}return G}function I(B,U,V){for(var W=U.length,F=new l(W),$=[],q=0;qU[2]?1:0)}function g(B,U,V){if(B.length!==0){if(U)for(var W=0;W0||q.length>0}function N(B,U,V){var W;if(V){W=U;for(var F=new Array(U.length),$=0;${});function oy(){}function UP(){return this.rgb().formatHex()}function cK(){return this.rgb().formatHex8()}function hK(){return GP(this).formatHsl()}function $P(){return this.rgb().formatRgb()}function jw(te){var Y,d;return te=(te+"").trim().toLowerCase(),(Y=KP.exec(te))?(d=Y[1].length,Y=parseInt(Y[1],16),d===6?HP(Y):d===3?new Up(Y>>8&15|Y>>4&240,Y>>4&15|Y&240,(Y&15)<<4|Y&15,1):d===8?s6(Y>>24&255,Y>>16&255,Y>>8&255,(Y&255)/255):d===4?s6(Y>>12&15|Y>>8&240,Y>>8&15|Y>>4&240,Y>>4&15|Y&240,((Y&15)<<4|Y&15)/255):null):(Y=YP.exec(te))?new Up(Y[1],Y[2],Y[3],1):(Y=XP.exec(te))?new Up(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,1):(Y=JP.exec(te))?s6(Y[1],Y[2],Y[3],Y[4]):(Y=QP.exec(te))?s6(Y[1]*255/100,Y[2]*255/100,Y[3]*255/100,Y[4]):(Y=eI.exec(te))?qP(Y[1],Y[2]/100,Y[3]/100,1):(Y=tI.exec(te))?qP(Y[1],Y[2]/100,Y[3]/100,Y[4]):fC.hasOwnProperty(te)?HP(fC[te]):te==="transparent"?new Up(NaN,NaN,NaN,0):null}function HP(te){return new Up(te>>16&255,te>>8&255,te&255,1)}function s6(te,Y,d,y){return y<=0&&(te=Y=d=NaN),new Up(te,Y,d,y)}function uC(te){return te instanceof oy||(te=jw(te)),te?(te=te.rgb(),new Up(te.r,te.g,te.b,te.opacity)):new Up}function l6(te,Y,d,y){return arguments.length===1?uC(te):new Up(te,Y,d,y??1)}function Up(te,Y,d,y){this.r=+te,this.g=+Y,this.b=+d,this.opacity=+y}function VP(){return`#${B_(this.r)}${B_(this.g)}${B_(this.b)}`}function fK(){return`#${B_(this.r)}${B_(this.g)}${B_(this.b)}${B_((isNaN(this.opacity)?1:this.opacity)*255)}`}function WP(){let te=u6(this.opacity);return`${te===1?"rgb(":"rgba("}${O_(this.r)}, ${O_(this.g)}, ${O_(this.b)}${te===1?")":`, ${te})`}`}function u6(te){return isNaN(te)?1:Math.max(0,Math.min(1,te))}function O_(te){return Math.max(0,Math.min(255,Math.round(te)||0))}function B_(te){return te=O_(te),(te<16?"0":"")+te.toString(16)}function qP(te,Y,d,y){return y<=0?te=Y=d=NaN:d<=0||d>=1?te=Y=NaN:Y<=0&&(te=NaN),new Pg(te,Y,d,y)}function GP(te){if(te instanceof Pg)return new Pg(te.h,te.s,te.l,te.opacity);if(te instanceof oy||(te=jw(te)),!te)return new Pg;if(te instanceof Pg)return te;te=te.rgb();var Y=te.r/255,d=te.g/255,y=te.b/255,z=Math.min(Y,d,y),P=Math.max(Y,d,y),i=NaN,n=P-z,a=(P+z)/2;return n?(Y===P?i=(d-y)/n+(d0&&a<1?0:i,new Pg(i,n,a,te.opacity)}function cC(te,Y,d,y){return arguments.length===1?GP(te):new Pg(te,Y,d,y??1)}function Pg(te,Y,d,y){this.h=+te,this.s=+Y,this.l=+d,this.opacity=+y}function ZP(te){return te=(te||0)%360,te<0?te+360:te}function c6(te){return Math.max(0,Math.min(1,te||0))}function hC(te,Y,d){return(te<60?Y+(d-Y)*te/60:te<180?d:te<240?Y+(d-Y)*(240-te)/60:Y)*255}var sy,R_,F_,Tb,Ig,KP,YP,XP,JP,QP,eI,tI,fC,dC=Mr(()=>{lC(),sy=.7,R_=1/sy,F_="\\s*([+-]?\\d+)\\s*",Tb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ig="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",KP=/^#([0-9a-f]{3,8})$/,YP=new RegExp(`^rgb\\(${F_},${F_},${F_}\\)$`),XP=new RegExp(`^rgb\\(${Ig},${Ig},${Ig}\\)$`),JP=new RegExp(`^rgba\\(${F_},${F_},${F_},${Tb}\\)$`),QP=new RegExp(`^rgba\\(${Ig},${Ig},${Ig},${Tb}\\)$`),eI=new RegExp(`^hsl\\(${Tb},${Ig},${Ig}\\)$`),tI=new RegExp(`^hsla\\(${Tb},${Ig},${Ig},${Tb}\\)$`),fC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},kb(oy,jw,{copy(te){return Object.assign(new this.constructor,this,te)},displayable(){return this.rgb().displayable()},hex:UP,formatHex:UP,formatHex8:cK,formatHsl:hK,formatRgb:$P,toString:$P}),kb(Up,l6,Nw(oy,{brighter(te){return te=te==null?R_:Math.pow(R_,te),new Up(this.r*te,this.g*te,this.b*te,this.opacity)},darker(te){return te=te==null?sy:Math.pow(sy,te),new Up(this.r*te,this.g*te,this.b*te,this.opacity)},rgb(){return this},clamp(){return new Up(O_(this.r),O_(this.g),O_(this.b),u6(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:VP,formatHex:VP,formatHex8:fK,formatRgb:WP,toString:WP})),kb(Pg,cC,Nw(oy,{brighter(te){return te=te==null?R_:Math.pow(R_,te),new Pg(this.h,this.s,this.l*te,this.opacity)},darker(te){return te=te==null?sy:Math.pow(sy,te),new Pg(this.h,this.s,this.l*te,this.opacity)},rgb(){var te=this.h%360+(this.h<0)*360,Y=isNaN(te)||isNaN(this.s)?0:this.s,d=this.l,y=d+(d<.5?d:1-d)*Y,z=2*d-y;return new Up(hC(te>=240?te-240:te+120,z,y),hC(te,z,y),hC(te<120?te+240:te-120,z,y),this.opacity)},clamp(){return new Pg(ZP(this.h),c6(this.s),c6(this.l),u6(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(){let te=u6(this.opacity);return`${te===1?"hsl(":"hsla("}${ZP(this.h)}, ${c6(this.s)*100}%, ${c6(this.l)*100}%${te===1?")":`, ${te})`}`}}))}),pC,mC,rI=Mr(()=>{pC=Math.PI/180,mC=180/Math.PI});function iI(te){if(te instanceof ev)return new ev(te.l,te.a,te.b,te.opacity);if(te instanceof Jv)return nI(te);te instanceof Up||(te=uC(te));var Y=xC(te.r),d=xC(te.g),y=xC(te.b),z=vC((.2225045*Y+.7168786*d+.0606169*y)/kC),P,i;return Y===d&&d===y?P=i=z:(P=vC((.4360747*Y+.3850649*d+.1430804*y)/wC),i=vC((.0139322*Y+.0971045*d+.7141733*y)/TC)),new ev(116*z-16,500*(P-z),200*(z-i),te.opacity)}function gC(te,Y,d,y){return arguments.length===1?iI(te):new ev(te,Y,d,y??1)}function ev(te,Y,d,y){this.l=+te,this.a=+Y,this.b=+d,this.opacity=+y}function vC(te){return te>aI?Math.pow(te,.3333333333333333):te/CC+SC}function yC(te){return te>N_?te*te*te:CC*(te-SC)}function _C(te){return 255*(te<=.0031308?12.92*te:1.055*Math.pow(te,.4166666666666667)-.055)}function xC(te){return(te/=255)<=.04045?te/12.92:Math.pow((te+.055)/1.055,2.4)}function dK(te){if(te instanceof Jv)return new Jv(te.h,te.c,te.l,te.opacity);if(te instanceof ev||(te=iI(te)),te.a===0&&te.b===0)return new Jv(NaN,0{lC(),dC(),rI(),Uw=18,wC=.96422,kC=1,TC=.82521,SC=4/29,N_=6/29,CC=3*N_*N_,aI=N_*N_*N_,kb(ev,gC,Nw(oy,{brighter(te){return new ev(this.l+Uw*(te??1),this.a,this.b,this.opacity)},darker(te){return new ev(this.l-Uw*(te??1),this.a,this.b,this.opacity)},rgb(){var te=(this.l+16)/116,Y=isNaN(this.a)?te:te+this.a/500,d=isNaN(this.b)?te:te-this.b/200;return Y=wC*yC(Y),te=kC*yC(te),d=TC*yC(d),new Up(_C(3.1338561*Y-1.6168667*te-.4906146*d),_C(-.9787684*Y+1.9161415*te+.033454*d),_C(.0719453*Y-.2289914*te+1.4052427*d),this.opacity)}})),kb(Jv,bC,Nw(oy,{brighter(te){return new Jv(this.h,this.c,this.l+Uw*(te??1),this.opacity)},darker(te){return new Jv(this.h,this.c,this.l-Uw*(te??1),this.opacity)},rgb(){return nI(this).rgb()}}))});function mK(te){if(te instanceof j_)return new j_(te.h,te.s,te.l,te.opacity);te instanceof Up||(te=uC(te));var Y=te.r/255,d=te.g/255,y=te.b/255,z=(PC*y+EC*Y-LC*d)/(PC+EC-LC),P=y-z,i=(Sb*(d-z)-f6*P)/$w,n=Math.sqrt(i*i+P*P)/(Sb*z*(1-z)),a=n?Math.atan2(i,P)*mC-120:NaN;return new j_(a<0?a+360:a,n,z,te.opacity)}function AC(te,Y,d,y){return arguments.length===1?mK(te):new j_(te,Y,d,y??1)}function j_(te,Y,d,y){this.h=+te,this.s=+Y,this.l=+d,this.opacity=+y}var MC,h6,f6,$w,Sb,EC,LC,PC,gK=Mr(()=>{lC(),dC(),rI(),MC=-.14861,h6=1.78277,f6=-.29227,$w=-.90649,Sb=1.97294,EC=Sb*$w,LC=Sb*h6,PC=h6*f6-$w*MC,kb(j_,AC,Nw(oy,{brighter(te){return te=te==null?R_:Math.pow(R_,te),new j_(this.h,this.s,this.l*te,this.opacity)},darker(te){return te=te==null?sy:Math.pow(sy,te),new j_(this.h,this.s,this.l*te,this.opacity)},rgb(){var te=isNaN(this.h)?0:(this.h+120)*pC,Y=+this.l,d=isNaN(this.s)?0:this.s*Y*(1-Y),y=Math.cos(te),z=Math.sin(te);return new Up(255*(Y+d*(MC*y+h6*z)),255*(Y+d*(f6*y+$w*z)),255*(Y+d*(Sb*y)),this.opacity)}}))}),Cb=Mr(()=>{dC(),pK(),gK()});function oI(te,Y,d,y,z){var P=te*te,i=P*te;return((1-3*te+3*P-i)*Y+(4-6*P+3*i)*d+(1+3*te+3*P-3*i)*y+i*z)/6}function sI(te){var Y=te.length-1;return function(d){var y=d<=0?d=0:d>=1?(d=1,Y-1):Math.floor(d*Y),z=te[y],P=te[y+1],i=y>0?te[y-1]:2*z-P,n=y{});function lI(te){var Y=te.length;return function(d){var y=Math.floor(((d%=1)<0?++d:d)*Y),z=te[(y+Y-1)%Y],P=te[y%Y],i=te[(y+1)%Y],n=te[(y+2)%Y];return oI((d-y/Y)*Y,z,P,i,n)}}var uI=Mr(()=>{IC()}),Hw,cI=Mr(()=>{Hw=te=>()=>te});function hI(te,Y){return function(d){return te+d*Y}}function vK(te,Y,d){return te=Math.pow(te,d),Y=Math.pow(Y,d)-te,d=1/d,function(y){return Math.pow(te+y*Y,d)}}function d6(te,Y){var d=Y-te;return d?hI(te,d>180||d<-180?d-360*Math.round(d/360):d):Hw(isNaN(te)?Y:te)}function yK(te){return(te=+te)==1?$p:function(Y,d){return d-Y?vK(Y,d,te):Hw(isNaN(Y)?d:Y)}}function $p(te,Y){var d=Y-te;return d?hI(te,d):Hw(isNaN(te)?Y:te)}var Ab=Mr(()=>{cI()});function fI(te){return function(Y){var d=Y.length,y=new Array(d),z=new Array(d),P=new Array(d),i,n;for(i=0;i{Cb(),IC(),uI(),Ab(),p6=function te(Y){var d=yK(Y);function y(z,P){var i=d((z=l6(z)).r,(P=l6(P)).r),n=d(z.g,P.g),a=d(z.b,P.b),l=$p(z.opacity,P.opacity);return function(o){return z.r=i(o),z.g=n(o),z.b=a(o),z.opacity=l(o),z+""}}return y.gamma=te,y}(1),dI=fI(sI),pI=fI(lI)});function DC(te,Y){Y||(Y=[]);var d=te?Math.min(Y.length,te.length):0,y=Y.slice(),z;return function(P){for(z=0;z{});function _K(te,Y){return(gI(Y)?DC:vI)(te,Y)}function vI(te,Y){var d=Y?Y.length:0,y=te?Math.min(d,te.length):0,z=new Array(y),P=new Array(d),i;for(i=0;i{_6(),zC()});function _I(te,Y){var d=new Date;return te=+te,Y=+Y,function(y){return d.setTime(te*(1-y)+Y*y),d}}var xI=Mr(()=>{});function tv(te,Y){return te=+te,Y=+Y,function(d){return te*(1-d)+Y*d}}var m6=Mr(()=>{});function bI(te,Y){var d={},y={},z;(te===null||typeof te!="object")&&(te={}),(Y===null||typeof Y!="object")&&(Y={});for(z in Y)z in te?d[z]=y6(te[z],Y[z]):y[z]=Y[z];return function(P){for(z in d)y[z]=d[z](P);return y}}var wI=Mr(()=>{_6()});function xK(te){return function(){return te}}function bK(te){return function(Y){return te(Y)+""}}function kI(te,Y){var d=g6.lastIndex=v6.lastIndex=0,y,z,P,i=-1,n=[],a=[];for(te=te+"",Y=Y+"";(y=g6.exec(te))&&(z=v6.exec(Y));)(P=z.index)>d&&(P=Y.slice(d,P),n[i]?n[i]+=P:n[++i]=P),(y=y[0])===(z=z[0])?n[i]?n[i]+=z:n[++i]=z:(n[++i]=null,a.push({i,x:tv(y,z)})),d=v6.lastIndex;return d{m6(),g6=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v6=new RegExp(g6.source,"g")});function y6(te,Y){var d=typeof Y,y;return Y==null||d==="boolean"?Hw(Y):(d==="number"?tv:d==="string"?(y=jw(Y))?(Y=y,p6):kI:Y instanceof jw?p6:Y instanceof Date?_I:gI(Y)?DC:Array.isArray(Y)?vI:typeof Y.valueOf!="function"&&typeof Y.toString!="function"||isNaN(Y)?bI:tv)(te,Y)}var _6=Mr(()=>{Cb(),mI(),yI(),xI(),m6(),wI(),TI(),cI(),zC()});function wK(te){var Y=te.length;return function(d){return te[Math.max(0,Math.min(Y-1,Math.floor(d*Y)))]}}var kK=Mr(()=>{});function TK(te,Y){var d=d6(+te,+Y);return function(y){var z=d(y);return z-360*Math.floor(z/360)}}var SK=Mr(()=>{Ab()});function CK(te,Y){return te=+te,Y=+Y,function(d){return Math.round(te*(1-d)+Y*d)}}var AK=Mr(()=>{});function SI(te,Y,d,y,z,P){var i,n,a;return(i=Math.sqrt(te*te+Y*Y))&&(te/=i,Y/=i),(a=te*d+Y*y)&&(d-=te*a,y-=Y*a),(n=Math.sqrt(d*d+y*y))&&(d/=n,y/=n,a/=n),te*y{OC=180/Math.PI,x6={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function EK(te){let Y=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(te+"");return Y.isIdentity?x6:SI(Y.a,Y.b,Y.c,Y.d,Y.e,Y.f)}function LK(te){return te==null?x6:(b6||(b6=document.createElementNS("http://www.w3.org/2000/svg","g")),b6.setAttribute("transform",te),(te=b6.transform.baseVal.consolidate())?(te=te.matrix,SI(te.a,te.b,te.c,te.d,te.e,te.f)):x6)}var b6,PK=Mr(()=>{MK()});function CI(te,Y,d,y){function z(l){return l.length?l.pop()+" ":""}function P(l,o,u,s,h,m){if(l!==u||o!==s){var b=h.push("translate(",null,Y,null,d);m.push({i:b-4,x:tv(l,u)},{i:b-2,x:tv(o,s)})}else(u||s)&&h.push("translate("+u+Y+s+d)}function i(l,o,u,s){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),s.push({i:u.push(z(u)+"rotate(",null,y)-2,x:tv(l,o)})):o&&u.push(z(u)+"rotate("+o+y)}function n(l,o,u,s){l!==o?s.push({i:u.push(z(u)+"skewX(",null,y)-2,x:tv(l,o)}):o&&u.push(z(u)+"skewX("+o+y)}function a(l,o,u,s,h,m){if(l!==u||o!==s){var b=h.push(z(h)+"scale(",null,",",null,")");m.push({i:b-4,x:tv(l,u)},{i:b-2,x:tv(o,s)})}else(u!==1||s!==1)&&h.push(z(h)+"scale("+u+","+s+")")}return function(l,o){var u=[],s=[];return l=te(l),o=te(o),P(l.translateX,l.translateY,o.translateX,o.translateY,u,s),i(l.rotate,o.rotate,u,s),n(l.skewX,o.skewX,u,s),a(l.scaleX,l.scaleY,o.scaleX,o.scaleY,u,s),l=o=null,function(h){for(var m=-1,b=s.length,x;++m{m6(),PK(),AI=CI(EK,"px, ","px)","deg)"),MI=CI(LK,", ",")",")")});function EI(te){return((te=Math.exp(te))+1/te)/2}function DK(te){return((te=Math.exp(te))-1/te)/2}function zK(te){return((te=Math.exp(2*te))-1)/(te+1)}var LI,PI,OK=Mr(()=>{LI=1e-12,PI=function te(Y,d,y){function z(P,i){var n=P[0],a=P[1],l=P[2],o=i[0],u=i[1],s=i[2],h=o-n,m=u-a,b=h*h+m*m,x,_;if(b{Cb(),Ab(),DI=II(d6),zI=II($p)});function RK(te,Y){var d=$p((te=gC(te)).l,(Y=gC(Y)).l),y=$p(te.a,Y.a),z=$p(te.b,Y.b),P=$p(te.opacity,Y.opacity);return function(i){return te.l=d(i),te.a=y(i),te.b=z(i),te.opacity=P(i),te+""}}var FK=Mr(()=>{Cb(),Ab()});function OI(te){return function(Y,d){var y=te((Y=bC(Y)).h,(d=bC(d)).h),z=$p(Y.c,d.c),P=$p(Y.l,d.l),i=$p(Y.opacity,d.opacity);return function(n){return Y.h=y(n),Y.c=z(n),Y.l=P(n),Y.opacity=i(n),Y+""}}}var BI,RI,NK=Mr(()=>{Cb(),Ab(),BI=OI(d6),RI=OI($p)});function FI(te){return function Y(d){d=+d;function y(z,P){var i=te((z=AC(z)).h,(P=AC(P)).h),n=$p(z.s,P.s),a=$p(z.l,P.l),l=$p(z.opacity,P.opacity);return function(o){return z.h=i(o),z.s=n(o),z.l=a(Math.pow(o,d)),z.opacity=l(o),z+""}}return y.gamma=Y,y}(1)}var NI,jI,jK=Mr(()=>{Cb(),Ab(),NI=FI(d6),jI=FI($p)});function UK(te,Y){Y===void 0&&(Y=te,te=y6);for(var d=0,y=Y.length-1,z=Y[0],P=new Array(y<0?0:y);d{_6()});function HK(te,Y){for(var d=new Array(Y),y=0;y{}),U_={};ni(U_,{interpolate:()=>y6,interpolateArray:()=>_K,interpolateBasis:()=>sI,interpolateBasisClosed:()=>lI,interpolateCubehelix:()=>NI,interpolateCubehelixLong:()=>jI,interpolateDate:()=>_I,interpolateDiscrete:()=>wK,interpolateHcl:()=>BI,interpolateHclLong:()=>RI,interpolateHsl:()=>DI,interpolateHslLong:()=>zI,interpolateHue:()=>TK,interpolateLab:()=>RK,interpolateNumber:()=>tv,interpolateNumberArray:()=>DC,interpolateObject:()=>bI,interpolateRgb:()=>p6,interpolateRgbBasis:()=>dI,interpolateRgbBasisClosed:()=>pI,interpolateRound:()=>CK,interpolateString:()=>kI,interpolateTransformCss:()=>AI,interpolateTransformSvg:()=>MI,interpolateZoom:()=>PI,piecewise:()=>UK,quantize:()=>HK});var Mb=Mr(()=>{_6(),yI(),IC(),uI(),xI(),kK(),SK(),m6(),zC(),wI(),AK(),TI(),IK(),OK(),mI(),BK(),FK(),NK(),jK(),$K(),VK()}),BC=ze((te,Y)=>{var d=Zs(),y=Xi();Y.exports=function(z,P,i,n,a){var l=P.data.data,o=l.i,u=a||l.color;if(o>=0){P.i=l.i;var s=i.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=u,P.color=u):(s.color=u,P.color=u),d.pointStyle(z,i,n,P)}else y.fill(z,u)}}),UI=ze((te,Y)=>{var d=ri(),y=Xi(),z=ji(),P=C0().resizeText,i=BC();function n(l){var o=l._fullLayout._sunburstlayer.selectAll(".trace");P(l,o,"sunburst"),o.each(function(u){var s=d.select(this),h=u[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){d.select(this).call(a,b,m,l)})})}function a(l,o,u,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(u,b,"marker.line.color")||y.defaultLine,_=z.castOption(u,b,"marker.line.width")||0;l.call(i,o,u,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?u.leaf.opacity:null)}Y.exports={style:n,styleOne:a}}),ly=ze(te=>{var Y=ji(),d=Xi(),y=Em(),z=Hv();te.findEntryWithLevel=function(a,l){var o;return l&&a.eachAfter(function(u){if(te.getPtId(u)===l)return o=u.copy()}),o||a},te.findEntryWithChild=function(a,l){var o;return a.eachAfter(function(u){for(var s=u.children||[],h=0;h0)},te.getMaxDepth=function(a){return a.maxdepth>=0?a.maxdepth:1/0},te.isHeader=function(a,l){return!(te.isLeaf(a)||a.depth===l._maxDepth-1)};function n(a){return a.data.data.pid}te.getParent=function(a,l){return te.findEntryWithLevel(a,n(l))},te.listPath=function(a,l){var o=a.parent;if(!o)return[];var u=l?[o.data[l]]:[o];return te.listPath(o,l).concat(u)},te.getPath=function(a){return te.listPath(a,"label").join("/")+"/"},te.formatValue=z.formatPieValue,te.formatPercent=function(a,l){var o=Y.formatPercent(a,0);return o==="0%"&&(o=z.formatPiePercent(a,l)),o}}),w6=ze((te,Y)=>{var d=ri(),y=as(),z=T0().appendArrayPointValue,P=hf(),i=ji(),n=Gg(),a=ly(),l=Hv(),o=l.formatPieValue;Y.exports=function(s,h,m,b,x){var _=b[0],A=_.trace,f=_.hierarchy,k=A.type==="sunburst",w=A.type==="treemap"||A.type==="icicle";"_hasHoverLabel"in A||(A._hasHoverLabel=!1),"_hasHoverEvent"in A||(A._hasHoverEvent=!1);var D=function(M){var p=m._fullLayout;if(!(m._dragging||p.hovermode===!1)){var g=m._fullData[A.index],C=M.data.data,T=C.i,N=a.isHierarchyRoot(M),B=a.getParent(f,M),U=a.getValue(M),V=function(J){return i.castOption(g,T,J)},W=V("hovertemplate"),F=P.castHoverinfo(g,p,T),H=p.separators,q;if(W||F&&F!=="none"&&F!=="skip"){var G,ee;k&&(G=_.cx+M.pxmid[0]*(1-M.rInscribed),ee=_.cy+M.pxmid[1]*(1-M.rInscribed)),w&&(G=M._hoverX,ee=M._hoverY);var he={},be=[],ve=[],ce=function(J){return be.indexOf(J)!==-1};F&&(be=F==="all"?g._module.attributes.hoverinfo.flags:F.split("+")),he.label=C.label,ce("label")&&he.label&&ve.push(he.label),C.hasOwnProperty("v")&&(he.value=C.v,he.valueLabel=o(he.value,H),ce("value")&&ve.push(he.valueLabel)),he.currentPath=M.currentPath=a.getPath(M.data),ce("current path")&&!N&&ve.push(he.currentPath);var re,ge=[],ne=function(){ge.indexOf(re)===-1&&(ve.push(re),ge.push(re))};he.percentParent=M.percentParent=U/a.getValue(B),he.parent=M.parentString=a.getPtLabel(B),ce("percent parent")&&(re=a.formatPercent(he.percentParent,H)+" of "+he.parent,ne()),he.percentEntry=M.percentEntry=U/a.getValue(h),he.entry=M.entry=a.getPtLabel(h),ce("percent entry")&&!N&&!M.onPathbar&&(re=a.formatPercent(he.percentEntry,H)+" of "+he.entry,ne()),he.percentRoot=M.percentRoot=U/a.getValue(f),he.root=M.root=a.getPtLabel(f),ce("percent root")&&!N&&(re=a.formatPercent(he.percentRoot,H)+" of "+he.root,ne()),he.text=V("hovertext")||V("text"),ce("text")&&(re=he.text,i.isValidTextValue(re)&&ve.push(re)),q=[u(M,g,x.eventDataKeys)];var se={trace:g,y:ee,_x0:M._x0,_x1:M._x1,_y0:M._y0,_y1:M._y1,text:ve.join("
"),name:W||ce("name")?g.name:void 0,color:V("hoverlabel.bgcolor")||C.color,borderColor:V("hoverlabel.bordercolor"),fontFamily:V("hoverlabel.font.family"),fontSize:V("hoverlabel.font.size"),fontColor:V("hoverlabel.font.color"),fontWeight:V("hoverlabel.font.weight"),fontStyle:V("hoverlabel.font.style"),fontVariant:V("hoverlabel.font.variant"),nameLength:V("hoverlabel.namelength"),textAlign:V("hoverlabel.align"),hovertemplate:W,hovertemplateLabels:he,eventData:q};k&&(se.x0=G-M.rInscribed*M.rpx1,se.x1=G+M.rInscribed*M.rpx1,se.idealAlign=M.pxmid[0]<0?"left":"right"),w&&(se.x=G,se.idealAlign=G<0?"left":"right");var _e=[];P.loneHover(se,{container:p._hoverlayer.node(),outerContainer:p._paper.node(),gd:m,inOut_bbox:_e}),q[0].bbox=_e[0],A._hasHoverLabel=!0}if(w){var oe=s.select("path.surface");x.styleOne(oe,M,g,m,{hovered:!0})}A._hasHoverEvent=!0,m.emit("plotly_hover",{points:q||[u(M,g,x.eventDataKeys)],event:d.event})}},E=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=d.select(this).datum();if(A._hasHoverEvent&&(M.originalEvent=d.event,m.emit("plotly_unhover",{points:[u(C,g,x.eventDataKeys)],event:d.event}),A._hasHoverEvent=!1),A._hasHoverLabel&&(P.loneUnhover(p._hoverlayer.node()),A._hasHoverLabel=!1),w){var T=s.select("path.surface");x.styleOne(T,C,g,m,{hovered:!1})}},I=function(M){var p=m._fullLayout,g=m._fullData[A.index],C=k&&(a.isHierarchyRoot(M)||a.isLeaf(M)),T=a.getPtId(M),N=a.isEntry(M)?a.findEntryWithChild(f,T):a.findEntryWithLevel(f,T),B=a.getPtId(N),U={points:[u(M,g,x.eventDataKeys)],event:d.event};C||(U.nextLevel=B);var V=n.triggerHandler(m,"plotly_"+A.type+"click",U);if(V!==!1&&p.hovermode&&(m._hoverdata=[u(M,g,x.eventDataKeys)],P.click(m,d.event)),!C&&V!==!1&&!m._dragging&&!m._transitioning){y.call("_storeDirectGUIEdit",g,p._tracePreGUI[g.uid],{level:g.level});var W={data:[{level:B}],traces:[A.index]},F={frame:{redraw:!1,duration:x.transitionTime},transition:{duration:x.transitionTime,easing:x.transitionEasing},mode:"immediate",fromcurrent:!0};P.loneUnhover(p._hoverlayer.node()),y.call("animate",m,W,F)}};s.on("mouseover",D),s.on("mouseout",E),s.on("click",I)};function u(s,h,m){for(var b=s.data.data,x={curveNumber:h.index,pointNumber:b.i,data:h._input,fullData:h},_=0;_{var Y=ri(),d=a6(),y=(Mb(),gi(U_)).interpolate,z=Zs(),P=ji(),i=cc(),n=C0(),a=n.recordMinTextSize,l=n.clearMinTextSize,o=sC(),u=Hv().getRotationAngle,s=o.computeTransform,h=o.transformInsideText,m=UI().styleOne,b=Lg().resizeText,x=w6(),_=NP(),A=ly();te.plot=function(I,M,p,g){var C=I._fullLayout,T=C._sunburstlayer,N,B,U=!p,V=!C.uniformtext.mode&&A.hasTransition(p);if(l("sunburst",C),N=T.selectAll("g.trace.sunburst").data(M,function(F){return F[0].trace.uid}),N.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),N.order(),V){g&&(B=g());var W=Y.transition().duration(p.duration).ease(p.easing).each("end",function(){B&&B()}).each("interrupt",function(){B&&B()});W.each(function(){T.selectAll("g.trace").each(function(F){f(I,F,this,p)})})}else N.each(function(F){f(I,F,this,p)}),C.uniformtext.mode&&b(I,C._sunburstlayer.selectAll(".trace"),"sunburst");U&&N.exit().remove()};function f(I,M,p,g){var C=I._context.staticPlot,T=I._fullLayout,N=!T.uniformtext.mode&&A.hasTransition(g),B=Y.select(p),U=B.selectAll("g.slice"),V=M[0],W=V.trace,F=V.hierarchy,H=A.findEntryWithLevel(F,W.level),q=A.getMaxDepth(W),G=T._size,ee=W.domain,he=G.w*(ee.x[1]-ee.x[0]),be=G.h*(ee.y[1]-ee.y[0]),ve=.5*Math.min(he,be),ce=V.cx=G.l+G.w*(ee.x[1]+ee.x[0])/2,re=V.cy=G.t+G.h*(1-ee.y[0])-be/2;if(!H)return U.remove();var ge=null,ne={};N&&U.each(function(Le){ne[A.getPtId(Le)]={rpx0:Le.rpx0,rpx1:Le.rpx1,x0:Le.x0,x1:Le.x1,transform:Le.transform},!ge&&A.isEntry(Le)&&(ge=Le)});var se=k(H).descendants(),_e=H.height+1,oe=0,J=q;V.hasMultipleRoots&&A.isHierarchyRoot(H)&&(se=se.slice(1),_e-=1,oe=1,J+=1),se=se.filter(function(Le){return Le.y1<=J});var me=u(W.rotation);me&&se.forEach(function(Le){Le.x0+=me,Le.x1+=me});var fe=Math.min(_e,q),Ce=function(Le){return(Le-oe)/fe*ve},Re=function(Le,nt){return[Le*Math.cos(nt),-Le*Math.sin(nt)]},Be=function(Le){return P.pathAnnulus(Le.rpx0,Le.rpx1,Le.x0,Le.x1,ce,re)},Ze=function(Le){return ce+D(Le)[0]*(Le.transform.rCenter||0)+(Le.transform.x||0)},Ge=function(Le){return re+D(Le)[1]*(Le.transform.rCenter||0)+(Le.transform.y||0)};U=U.data(se,A.getPtId),U.enter().append("g").classed("slice",!0),N?U.exit().transition().each(function(){var Le=Y.select(this),nt=Le.select("path.surface");nt.transition().attrTween("d",function(ut){var Et=vt(ut);return function(Gt){return Be(Et(Gt))}});var xt=Le.select("g.slicetext");xt.attr("opacity",0)}).remove():U.exit().remove(),U.order();var tt=null;if(N&&ge){var _t=A.getPtId(ge);U.each(function(Le){tt===null&&A.getPtId(Le)===_t&&(tt=Le.x1)})}var mt=U;N&&(mt=mt.transition().each("end",function(){var Le=Y.select(this);A.setSliceCursor(Le,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),mt.each(function(Le){var nt=Y.select(this),xt=P.ensureSingle(nt,"path","surface",function(mr){mr.style("pointer-events",C?"none":"all")});Le.rpx0=Ce(Le.y0),Le.rpx1=Ce(Le.y1),Le.xmid=(Le.x0+Le.x1)/2,Le.pxmid=Re(Le.rpx1,Le.xmid),Le.midangle=-(Le.xmid-Math.PI/2),Le.startangle=-(Le.x0-Math.PI/2),Le.stopangle=-(Le.x1-Math.PI/2),Le.halfangle=.5*Math.min(P.angleDelta(Le.x0,Le.x1)||Math.PI,Math.PI),Le.ring=1-Le.rpx0/Le.rpx1,Le.rInscribed=w(Le),N?xt.transition().attrTween("d",function(mr){var Yr=ct(mr);return function(ii){return Be(Yr(ii))}}):xt.attr("d",Be),nt.call(x,H,I,M,{eventDataKeys:_.eventDataKeys,transitionTime:_.CLICK_TRANSITION_TIME,transitionEasing:_.CLICK_TRANSITION_EASING}).call(A.setSliceCursor,I,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:I._transitioning}),xt.call(m,Le,W,I);var ut=P.ensureSingle(nt,"g","slicetext"),Et=P.ensureSingle(ut,"text","",function(mr){mr.attr("data-notex",1)}),Gt=P.ensureUniformFontSize(I,A.determineTextFont(W,Le,T.font));Et.text(te.formatSliceLabel(Le,H,W,M,T)).classed("slicetext",!0).attr("text-anchor","middle").call(z.font,Gt).call(i.convertToTspans,I);var Qt=z.bBox(Et.node());Le.transform=h(Qt,Le,V),Le.transform.targetX=Ze(Le),Le.transform.targetY=Ge(Le);var vr=function(mr,Yr){var ii=mr.transform;return s(ii,Yr),ii.fontSize=Gt.size,a(W.type,ii,T),P.getTextTransform(ii)};N?Et.transition().attrTween("transform",function(mr){var Yr=Ae(mr);return function(ii){return vr(Yr(ii),Qt)}}):Et.attr("transform",vr(Le,Qt))});function vt(Le){var nt=A.getPtId(Le),xt=ne[nt],ut=ne[A.getPtId(H)],Et;if(ut){var Gt=(Le.x1>ut.x1?2*Math.PI:0)+me;Et=Le.rpx1tt?2*Math.PI:0)+me;xt={x0:Et,x1:Et}}else xt={rpx0:ve,rpx1:ve},P.extendFlat(xt,Oe(Le));else xt={rpx0:0,rpx1:0};else xt={x0:me,x1:me};return y(xt,ut)}function Ae(Le){var nt=ne[A.getPtId(Le)],xt,ut=Le.transform;if(nt)xt=nt;else if(xt={rpx1:Le.rpx1,transform:{textPosAngle:ut.textPosAngle,scale:0,rotate:ut.rotate,rCenter:ut.rCenter,x:ut.x,y:ut.y}},ge)if(Le.parent)if(tt){var Et=Le.x1>tt?2*Math.PI:0;xt.x0=xt.x1=Et}else P.extendFlat(xt,Oe(Le));else xt.x0=xt.x1=me;else xt.x0=xt.x1=me;var Gt=y(xt.transform.textPosAngle,Le.transform.textPosAngle),Qt=y(xt.rpx1,Le.rpx1),vr=y(xt.x0,Le.x0),mr=y(xt.x1,Le.x1),Yr=y(xt.transform.scale,ut.scale),ii=y(xt.transform.rotate,ut.rotate),Lr=ut.rCenter===0?3:xt.transform.rCenter===0?1/3:1,ci=y(xt.transform.rCenter,ut.rCenter),vi=function(Ot){return ci(Math.pow(Ot,Lr))};return function(Ot){var Xe=Qt(Ot);vr(Ot),mr(Ot);var ot=vi(Ot),De=Gt(Ot),ye={rpx1:Xe,transform:{textPosAngle:De,rCenter:ot,x:ut.x,y:ut.y}};return a(W.type,ut,T),{transform:{targetX:Ze(ye),targetY:Ge(ye),scale:Yr(Ot),rotate:ii(Ot),rCenter:ot}}}}function Oe(Le){var nt=Le.parent,xt=ne[A.getPtId(nt)],ut={};if(xt){var Et=nt.children,Gt=Et.indexOf(Le),Qt=Et.length,vr=y(xt.x0,xt.x1);ut.x0=vr(Gt/Qt),ut.x1=vr(Gt/Qt)}else ut.x0=ut.x1=0;return ut}}function k(I){return d.partition().size([2*Math.PI,I.height+1])(I)}te.formatSliceLabel=function(I,M,p,g,C){var T=p.texttemplate,N=p.textinfo;if(!T&&(!N||N==="none"))return"";var B=C.separators,U=g[0],V=I.data.data,W=U.hierarchy,F=A.isHierarchyRoot(I),H=A.getParent(W,I),q=A.getValue(I);if(!T){var G=N.split("+"),ee=function(oe){return G.indexOf(oe)!==-1},he=[],be;if(ee("label")&&V.label&&he.push(V.label),V.hasOwnProperty("v")&&ee("value")&&he.push(A.formatValue(V.v,B)),!F){ee("current path")&&he.push(A.getPath(I.data));var ve=0;ee("percent parent")&&ve++,ee("percent entry")&&ve++,ee("percent root")&&ve++;var ce=ve>1;if(ve){var re,ge=function(oe){be=A.formatPercent(re,B),ce&&(be+=" of "+oe),he.push(be)};ee("percent parent")&&!F&&(re=q/A.getValue(H),ge("parent")),ee("percent entry")&&(re=q/A.getValue(M),ge("entry")),ee("percent root")&&(re=q/A.getValue(W),ge("root"))}}return ee("text")&&(be=P.castOption(p,V.i,"text"),P.isValidTextValue(be)&&he.push(be)),he.join("
")}var ne=P.castOption(p,V.i,"texttemplate");if(!ne)return"";var se={};V.label&&(se.label=V.label),V.hasOwnProperty("v")&&(se.value=V.v,se.valueLabel=A.formatValue(V.v,B)),se.currentPath=A.getPath(I.data),F||(se.percentParent=q/A.getValue(H),se.percentParentLabel=A.formatPercent(se.percentParent,B),se.parent=A.getPtLabel(H)),se.percentEntry=q/A.getValue(M),se.percentEntryLabel=A.formatPercent(se.percentEntry,B),se.entry=A.getPtLabel(M),se.percentRoot=q/A.getValue(W),se.percentRootLabel=A.formatPercent(se.percentRoot,B),se.root=A.getPtLabel(W),V.hasOwnProperty("color")&&(se.color=V.color);var _e=P.castOption(p,V.i,"text");return(P.isValidTextValue(_e)||_e==="")&&(se.text=_e),se.customdata=P.castOption(p,V.i,"customdata"),P.texttemplateString({data:[se,p._meta],fallback:p.texttemplatefallback,labels:se,locale:C._d3locale,template:ne})};function w(I){return I.rpx0===0&&P.isFullCircle([I.x0,I.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(I.halfangle)),I.ring/2))}function D(I){return E(I.rpx1,I.transform.textPosAngle)}function E(I,M){return[I*Math.sin(M),-I*Math.cos(M)]}}),WK=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"sunburst",basePlotModule:sK(),categories:[],animatable:!0,attributes:n6(),layoutAttributes:jP(),supplyDefaults:lK(),supplyLayoutDefaults:uK(),calc:o6().calc,crossTraceCalc:o6().crossTraceCalc,plot:RC().plot,style:UI().style,colorbar:Mo(),meta:{}}}),qK=ze((te,Y)=>{Y.exports=WK()}),GK=ze(te=>{var Y=sh();te.name="treemap",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),Eb=ze((te,Y)=>{Y.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}),FC=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Oc(),i=Xh().attributes,n=bb(),a=n6(),l=Eb(),o=nn().extendFlat,u=qd().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:a.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:a.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},n.textfont,{}),editType:"calc"},text:n.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,hoverinfo:a.hoverinfo,hovertemplate:d({},{keys:l.eventDataKeys}),hovertemplatefallback:z(),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:o({},n.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:n.sort,root:a.root,domain:i({name:"treemap",trace:!0,editType:"calc"})}}),$I=ze((te,Y)=>{Y.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),ZK=ze((te,Y)=>{var d=ji(),y=FC(),z=Xi(),P=Xh().defaults,i=tg().handleText,n=mb().TEXTPAD,a=wb().handleMarkerDefaults,l=lh(),o=l.hasColorscale,u=l.handleDefaults;Y.exports=function(s,h,m,b){function x(g,C){return d.coerce(s,h,y,g,C)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var f=x("values");f&&f.length?x("branchvalues"):x("count"),x("level"),x("maxdepth");var k=x("tiling.packing");k==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var w=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",d.isArrayOrTypedArray(w)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var D=x("pathbar.visible"),E="auto";i(s,h,b,x,E,{hasPathbar:D,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var I=h.textposition.indexOf("bottom")!==-1;a(s,h,b,x);var M=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;M?u(s,h,b,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(h.marker.colors||[]).length);var p=h.textfont.size*2;x("marker.pad.t",I?p/4:p),x("marker.pad.l",p/4),x("marker.pad.r",p/4),x("marker.pad.b",I?p:p/4),x("marker.cornerradius"),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},D&&(x("pathbar.thickness",h.pathbar.textfont.size+2*n),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),KK=ze((te,Y)=>{var d=ji(),y=$I();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("treemapcolorway",P.colorway),i("extendtreemapcolors")}}),HI=ze(te=>{var Y=o6();te.calc=function(d,y){return Y.calc(d,y)},te.crossTraceCalc=function(d){return Y._runCrossTraceCalc("treemap",d)}}),VI=ze((te,Y)=>{Y.exports=function d(y,z,P){var i;P.swapXY&&(i=y.x0,y.x0=y.y0,y.y0=i,i=y.x1,y.x1=y.y1,y.y1=i),P.flipX&&(i=y.x0,y.x0=z[0]-y.x1,y.x1=z[0]-i),P.flipY&&(i=y.y0,y.y0=z[1]-y.y1,y.y1=z[1]-i);var n=y.children;if(n)for(var a=0;a{var d=a6(),y=VI();Y.exports=function(P,i,n){var a=n.flipX,l=n.flipY,o=n.packing==="dice-slice",u=n.pad[l?"bottom":"top"],s=n.pad[a?"right":"left"],h=n.pad[a?"left":"right"],m=n.pad[l?"top":"bottom"],b;o&&(b=s,s=u,u=b,b=h,h=m,m=b);var x=d.treemap().tile(z(n.packing,n.squarifyratio)).paddingInner(n.pad.inner).paddingLeft(s).paddingRight(h).paddingTop(u).paddingBottom(m).size(o?[i[1],i[0]]:i)(P);return(o||a||l)&&y(x,i,{swapXY:o,flipX:a,flipY:l}),x};function z(P,i){switch(P){case"squarify":return d.treemapSquarify.ratio(i);case"binary":return d.treemapBinary;case"dice":return d.treemapDice;case"slice":return d.treemapSlice;default:return d.treemapSliceDice}}}),NC=ze((te,Y)=>{var d=ri(),y=Xi(),z=ji(),P=ly(),i=C0().resizeText,n=BC();function a(o){var u=o._fullLayout._treemaplayer.selectAll(".trace");i(o,u,"treemap"),u.each(function(s){var h=d.select(this),m=s[0],b=m.trace;h.style("opacity",b.opacity),h.selectAll("path.surface").each(function(x){d.select(this).call(l,x,b,o,{hovered:!1})})})}function l(o,u,s,h,m){var b=(m||{}).hovered,x=u.data.data,_=x.i,A,f,k=x.color,w=P.isHierarchyRoot(u),D=1;if(b)A=s._hovered.marker.line.color,f=s._hovered.marker.line.width;else if(w&&k===s.root.color)D=100,A="rgba(0,0,0,0)",f=0;else if(A=z.castOption(s,_,"marker.line.color")||y.defaultLine,f=z.castOption(s,_,"marker.line.width")||0,!s._hasColorscale&&!u.onPathbar){var E=s.marker.depthfade;if(E){var I=y.combine(y.addOpacity(s._backgroundColor,.75),k),M;if(E===!0){var p=P.getMaxDepth(s);isFinite(p)?P.isLeaf(u)?M=0:M=s._maxVisibleLayers-(u.data.depth-s._entryDepth):M=u.data.height+1}else M=u.data.depth-s._entryDepth,s._atRootLevel||M++;if(M>0)for(var g=0;g{var d=ri(),y=ji(),z=Zs(),P=cc(),i=WI(),n=NC().styleOne,a=Eb(),l=ly(),o=w6(),u=!0;Y.exports=function(s,h,m,b,x){var _=x.barDifY,A=x.width,f=x.height,k=x.viewX,w=x.viewY,D=x.pathSlice,E=x.toMoveInsideSlice,I=x.strTransform,M=x.hasTransition,p=x.handleSlicesExit,g=x.makeUpdateSliceInterpolator,C=x.makeUpdateTextInterpolator,T={},N=s._context.staticPlot,B=s._fullLayout,U=h[0],V=U.trace,W=U.hierarchy,F=A/V._entryDepth,H=l.listPath(m.data,"id"),q=i(W.copy(),[A,f],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();q=q.filter(function(ee){var he=H.indexOf(ee.data.id);return he===-1?!1:(ee.x0=F*he,ee.x1=F*(he+1),ee.y0=_,ee.y1=_+f,ee.onPathbar=!0,!0)}),q.reverse(),b=b.data(q,l.getPtId),b.enter().append("g").classed("pathbar",!0),p(b,u,T,[A,f],D),b.order();var G=b;M&&(G=G.transition().each("end",function(){var ee=d.select(this);l.setSliceCursor(ee,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),G.each(function(ee){ee._x0=k(ee.x0),ee._x1=k(ee.x1),ee._y0=w(ee.y0),ee._y1=w(ee.y1),ee._hoverX=k(ee.x1-Math.min(A,f)/2),ee._hoverY=w(ee.y1-f/2);var he=d.select(this),be=y.ensureSingle(he,"path","surface",function(ge){ge.style("pointer-events",N?"none":"all")});M?be.transition().attrTween("d",function(ge){var ne=g(ge,u,T,[A,f]);return function(se){return D(ne(se))}}):be.attr("d",D),he.call(o,m,s,h,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,s,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:s._transitioning}),be.call(n,ee,V,s,{hovered:!1}),ee._text=(l.getPtLabel(ee)||"").split("
").join(" ")||"";var ve=y.ensureSingle(he,"g","slicetext"),ce=y.ensureSingle(ve,"text","",function(ge){ge.attr("data-notex",1)}),re=y.ensureUniformFontSize(s,l.determineTextFont(V,ee,B.font,{onPathbar:!0}));ce.text(ee._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(z.font,re).call(P.convertToTspans,s),ee.textBB=z.bBox(ce.node()),ee.transform=E(ee,{fontSize:re.size,onPathbar:!0}),ee.transform.fontSize=re.size,M?ce.transition().attrTween("transform",function(ge){var ne=C(ge,u,T,[A,f]);return function(se){return I(ne(se))}}):ce.attr("transform",I(ee))})}}),XK=ze((te,Y)=>{var d=ri(),y=(Mb(),gi(U_)).interpolate,z=ly(),P=ji(),i=mb().TEXTPAD,n=gb(),a=n.toMoveInsideBar,l=C0(),o=l.recordMinTextSize,u=Eb(),s=YK();function h(m){return z.isHierarchyRoot(m)?"":z.getPtId(m)}Y.exports=function(m,b,x,_,A){var f=m._fullLayout,k=b[0],w=k.trace,D=w.type,E=D==="icicle",I=k.hierarchy,M=z.findEntryWithLevel(I,w.level),p=d.select(x),g=p.selectAll("g.pathbar"),C=p.selectAll("g.slice");if(!M){g.remove(),C.remove();return}var T=z.isHierarchyRoot(M),N=!f.uniformtext.mode&&z.hasTransition(_),B=z.getMaxDepth(w),U=function(Lr){return Lr.data.depth-M.data.depth-1?H+ee:-(G+ee):0,be={x0:q,x1:q,y0:he,y1:he+G},ve=function(Lr,ci,vi){var Ot=w.tiling.pad,Xe=function(Pe){return Pe-Ot<=ci.x0},ot=function(Pe){return Pe+Ot>=ci.x1},De=function(Pe){return Pe-Ot<=ci.y0},ye=function(Pe){return Pe+Ot>=ci.y1};return Lr.x0===ci.x0&&Lr.x1===ci.x1&&Lr.y0===ci.y0&&Lr.y1===ci.y1?{x0:Lr.x0,x1:Lr.x1,y0:Lr.y0,y1:Lr.y1}:{x0:Xe(Lr.x0-Ot)?0:ot(Lr.x0-Ot)?vi[0]:Lr.x0,x1:Xe(Lr.x1+Ot)?0:ot(Lr.x1+Ot)?vi[0]:Lr.x1,y0:De(Lr.y0-Ot)?0:ye(Lr.y0-Ot)?vi[1]:Lr.y0,y1:De(Lr.y1+Ot)?0:ye(Lr.y1+Ot)?vi[1]:Lr.y1}},ce=null,re={},ge={},ne=null,se=function(Lr,ci){return ci?re[h(Lr)]:ge[h(Lr)]},_e=function(Lr,ci,vi,Ot){if(ci)return re[h(I)]||be;var Xe=ge[w.level]||vi;return U(Lr)?ve(Lr,Xe,Ot):{}};k.hasMultipleRoots&&T&&B++,w._maxDepth=B,w._backgroundColor=f.paper_bgcolor,w._entryDepth=M.data.depth,w._atRootLevel=T;var oe=-F/2+V.l+V.w*(W.x[1]+W.x[0])/2,J=-H/2+V.t+V.h*(1-(W.y[1]+W.y[0])/2),me=function(Lr){return oe+Lr},fe=function(Lr){return J+Lr},Ce=fe(0),Re=me(0),Be=function(Lr){return Re+Lr},Ze=function(Lr){return Ce+Lr};function Ge(Lr,ci){return Lr+","+ci}var tt=Be(0),_t=function(Lr){Lr.x=Math.max(tt,Lr.x)},mt=w.pathbar.edgeshape,vt=function(Lr){var ci=Be(Math.max(Math.min(Lr.x0,Lr.x0),0)),vi=Be(Math.min(Math.max(Lr.x1,Lr.x1),q)),Ot=Ze(Lr.y0),Xe=Ze(Lr.y1),ot=G/2,De={},ye={};De.x=ci,ye.x=vi,De.y=ye.y=(Ot+Xe)/2;var Pe={x:ci,y:Ot},He={x:vi,y:Ot},at={x:vi,y:Xe},ht={x:ci,y:Xe};return mt===">"?(Pe.x-=ot,He.x-=ot,at.x-=ot,ht.x-=ot):mt==="/"?(at.x-=ot,ht.x-=ot,De.x-=ot/2,ye.x-=ot/2):mt==="\\"?(Pe.x-=ot,He.x-=ot,De.x-=ot/2,ye.x-=ot/2):mt==="<"&&(De.x-=ot,ye.x-=ot),_t(Pe),_t(ht),_t(De),_t(He),_t(at),_t(ye),"M"+Ge(Pe.x,Pe.y)+"L"+Ge(He.x,He.y)+"L"+Ge(ye.x,ye.y)+"L"+Ge(at.x,at.y)+"L"+Ge(ht.x,ht.y)+"L"+Ge(De.x,De.y)+"Z"},ct=w[E?"tiling":"marker"].pad,Ae=function(Lr){return w.textposition.indexOf(Lr)!==-1},Oe=Ae("top"),Le=Ae("left"),nt=Ae("right"),xt=Ae("bottom"),ut=function(Lr){var ci=me(Lr.x0),vi=me(Lr.x1),Ot=fe(Lr.y0),Xe=fe(Lr.y1),ot=vi-ci,De=Xe-Ot;if(!ot||!De)return"";var ye=w.marker.cornerradius||0,Pe=Math.min(ye,ot/2,De/2);Pe&&Lr.data&&Lr.data.data&&Lr.data.data.label&&(Oe&&(Pe=Math.min(Pe,ct.t)),Le&&(Pe=Math.min(Pe,ct.l)),nt&&(Pe=Math.min(Pe,ct.r)),xt&&(Pe=Math.min(Pe,ct.b)));var He=function(at,ht){return Pe?"a"+Ge(Pe,Pe)+" 0 0 1 "+Ge(at,ht):""};return"M"+Ge(ci,Ot+Pe)+He(Pe,-Pe)+"L"+Ge(vi-Pe,Ot)+He(Pe,Pe)+"L"+Ge(vi,Xe-Pe)+He(-Pe,Pe)+"L"+Ge(ci+Pe,Xe)+He(-Pe,-Pe)+"Z"},Et=function(Lr,ci){var vi=Lr.x0,Ot=Lr.x1,Xe=Lr.y0,ot=Lr.y1,De=Lr.textBB,ye=Oe||ci.isHeader&&!xt,Pe=ye?"start":xt?"end":"middle",He=Ae("right"),at=Ae("left")||ci.onPathbar,ht=at?-1:He?1:0;if(ci.isHeader){if(vi+=(E?ct:ct.l)-i,Ot-=(E?ct:ct.r)-i,vi>=Ot){var At=(vi+Ot)/2;vi=At,Ot=At}var Wt;xt?(Wt=ot-(E?ct:ct.b),Xe{var d=ri(),y=ly(),z=C0(),P=z.clearMinTextSize,i=Lg().resizeText,n=XK();Y.exports=function(a,l,o,u,s){var h=s.type,m=s.drawDescendants,b=a._fullLayout,x=b["_"+h+"layer"],_,A,f=!o;if(P(h,b),_=x.selectAll("g.trace."+h).data(l,function(w){return w[0].trace.uid}),_.enter().append("g").classed("trace",!0).classed(h,!0),_.order(),!b.uniformtext.mode&&y.hasTransition(o)){u&&(A=u());var k=d.transition().duration(o.duration).ease(o.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()});k.each(function(){x.selectAll("g.trace").each(function(w){n(a,w,this,o,m)})})}else _.each(function(w){n(a,w,this,o,m)}),b.uniformtext.mode&&i(a,x.selectAll(".trace"),h);f&&_.exit().remove()}}),JK=ze((te,Y)=>{var d=ri(),y=ji(),z=Zs(),P=cc(),i=WI(),n=NC().styleOne,a=Eb(),l=ly(),o=w6(),u=RC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,f=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,T=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=!q&&!W.marker.pad.t||q&&!W.marker.pad.b,ee=i(b,[A,f],{packing:W.tiling.packing,squarifyratio:W.tiling.squarifyratio,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,pad:{inner:W.tiling.pad,top:W.marker.pad.t,left:W.marker.pad.l,right:W.marker.pad.r,bottom:W.marker.pad.b}}),he=ee.descendants(),be=1/0,ve=-1/0;he.forEach(function(se){var _e=se.depth;_e>=W._maxDepth?(se.x0=se.x1=(se.x0+se.x1)/2,se.y0=se.y1=(se.y0+se.y1)/2):(be=Math.min(be,_e),ve=Math.max(ve,_e))}),x=x.data(he,l.getPtId),W._maxVisibleLayers=isFinite(ve)?ve-be+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,f],D),x.order();var ce=null;if(M&&T){var re=l.getPtId(T);x.each(function(se){ce===null&&l.getPtId(se)===re&&(ce={x0:se.x0,x1:se.x1,y0:se.y0,y1:se.y1})})}var ge=function(){return ce||{x0:0,x1:A,y0:0,y1:f}},ne=x;return M&&(ne=ne.transition().each("end",function(){var se=d.select(this);l.setSliceCursor(se,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ne.each(function(se){var _e=l.isHeader(se,W);se._x0=k(se.x0),se._x1=k(se.x1),se._y0=w(se.y0),se._y1=w(se.y1),se._hoverX=k(se.x1-W.marker.pad.r),se._hoverY=w(q?se.y1-W.marker.pad.b/2:se.y0+W.marker.pad.t/2);var oe=d.select(this),J=y.ensureSingle(oe,"path","surface",function(Ze){Ze.style("pointer-events",B?"none":"all")});M?J.transition().attrTween("d",function(Ze){var Ge=g(Ze,s,ge(),[A,f]);return function(tt){return D(Ge(tt))}}):J.attr("d",D),oe.call(o,b,h,m,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),J.call(n,se,W,h,{hovered:!1}),se.x0===se.x1||se.y0===se.y1?se._text="":_e?se._text=G?"":l.getPtLabel(se)||"":se._text=u(se,b,W,m,U)||"";var me=y.ensureSingle(oe,"g","slicetext"),fe=y.ensureSingle(me,"text","",function(Ze){Ze.attr("data-notex",1)}),Ce=y.ensureUniformFontSize(h,l.determineTextFont(W,se,U.font)),Re=se._text||" ",Be=_e&&Re.indexOf("
")===-1;fe.text(Re).classed("slicetext",!0).attr("text-anchor",H?"end":F||Be?"start":"middle").call(z.font,Ce).call(P.convertToTspans,h),se.textBB=z.bBox(fe.node()),se.transform=E(se,{fontSize:Ce.size,isHeader:_e}),se.transform.fontSize=Ce.size,M?fe.transition().attrTween("transform",function(Ze){var Ge=C(Ze,s,ge(),[A,f]);return function(tt){return I(Ge(tt))}}):fe.attr("transform",I(se))}),ce}}),QK=ze((te,Y)=>{var d=qI(),y=JK();Y.exports=function(z,P,i,n){return d(z,P,i,n,{type:"treemap",drawDescendants:y})}}),eY=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"treemap",basePlotModule:GK(),categories:[],animatable:!0,attributes:FC(),layoutAttributes:$I(),supplyDefaults:ZK(),supplyLayoutDefaults:KK(),calc:HI().calc,crossTraceCalc:HI().crossTraceCalc,plot:QK(),style:NC().style,colorbar:Mo(),meta:{}}}),tY=ze((te,Y)=>{Y.exports=eY()}),rY=ze(te=>{var Y=sh();te.name="icicle",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),GI=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Oc(),i=Xh().attributes,n=bb(),a=n6(),l=FC(),o=Eb(),u=nn().extendFlat,s=qd().pattern;Y.exports={labels:a.labels,parents:a.parents,values:a.values,branchvalues:a.branchvalues,count:a.count,level:a.level,maxdepth:a.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:a.marker.colors,line:a.marker.line,pattern:s,editType:"calc"},P("marker",{colorAttr:"colors",anim:!1})),leaf:a.leaf,pathbar:l.pathbar,text:n.text,textinfo:a.textinfo,texttemplate:y({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,hoverinfo:a.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),hovertemplatefallback:z(),textfont:n.textfont,insidetextfont:n.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:n.sort,root:a.root,domain:i({name:"icicle",trace:!0,editType:"calc"})}}),ZI=ze((te,Y)=>{Y.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),iY=ze((te,Y)=>{var d=ji(),y=GI(),z=Xi(),P=Xh().defaults,i=tg().handleText,n=mb().TEXTPAD,a=wb().handleMarkerDefaults,l=lh(),o=l.hasColorscale,u=l.handleDefaults;Y.exports=function(s,h,m,b){function x(I,M){return d.coerce(s,h,y,I,M)}var _=x("labels"),A=x("parents");if(!_||!_.length||!A||!A.length){h.visible=!1;return}var f=x("values");f&&f.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.orientation"),x("tiling.flip"),x("tiling.pad");var k=x("text");x("texttemplate"),x("texttemplatefallback"),h.texttemplate||x("textinfo",d.isArrayOrTypedArray(k)?"text+label":"label"),x("hovertext"),x("hovertemplate"),x("hovertemplatefallback");var w=x("pathbar.visible"),D="auto";i(s,h,b,x,D,{hasPathbar:w,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition"),a(s,h,b,x);var E=h._hasColorscale=o(s,"marker","colors")||(s.marker||{}).coloraxis;E&&u(s,h,b,x,{prefix:"marker.",cLetter:"c"}),x("leaf.opacity",E?1:.7),h._hovered={marker:{line:{width:2,color:z.contrast(b.paper_bgcolor)}}},w&&(x("pathbar.thickness",h.pathbar.textfont.size+2*n),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),P(h,b,x),h._length=null}}),nY=ze((te,Y)=>{var d=ji(),y=ZI();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("iciclecolorway",P.colorway),i("extendiciclecolors")}}),KI=ze(te=>{var Y=o6();te.calc=function(d,y){return Y.calc(d,y)},te.crossTraceCalc=function(d){return Y._runCrossTraceCalc("icicle",d)}}),aY=ze((te,Y)=>{var d=a6(),y=VI();Y.exports=function(z,P,i){var n=i.flipX,a=i.flipY,l=i.orientation==="h",o=i.maxDepth,u=P[0],s=P[1];o&&(u=(z.height+1)*P[0]/Math.min(z.height+1,o),s=(z.height+1)*P[1]/Math.min(z.height+1,o));var h=d.partition().padding(i.pad.inner).size(l?[P[1],u]:[P[0],s])(z);return(l||n||a)&&y(h,P,{swapXY:l,flipX:n,flipY:a}),h}}),YI=ze((te,Y)=>{var d=ri(),y=Xi(),z=ji(),P=C0().resizeText,i=BC();function n(l){var o=l._fullLayout._iciclelayer.selectAll(".trace");P(l,o,"icicle"),o.each(function(u){var s=d.select(this),h=u[0],m=h.trace;s.style("opacity",m.opacity),s.selectAll("path.surface").each(function(b){d.select(this).call(a,b,m,l)})})}function a(l,o,u,s){var h=o.data.data,m=!o.children,b=h.i,x=z.castOption(u,b,"marker.line.color")||y.defaultLine,_=z.castOption(u,b,"marker.line.width")||0;l.call(i,o,u,s).style("stroke-width",_).call(y.stroke,x).style("opacity",m?u.leaf.opacity:null)}Y.exports={style:n,styleOne:a}}),oY=ze((te,Y)=>{var d=ri(),y=ji(),z=Zs(),P=cc(),i=aY(),n=YI().styleOne,a=Eb(),l=ly(),o=w6(),u=RC().formatSliceLabel,s=!1;Y.exports=function(h,m,b,x,_){var A=_.width,f=_.height,k=_.viewX,w=_.viewY,D=_.pathSlice,E=_.toMoveInsideSlice,I=_.strTransform,M=_.hasTransition,p=_.handleSlicesExit,g=_.makeUpdateSliceInterpolator,C=_.makeUpdateTextInterpolator,T=_.prevEntry,N={},B=h._context.staticPlot,U=h._fullLayout,V=m[0],W=V.trace,F=W.textposition.indexOf("left")!==-1,H=W.textposition.indexOf("right")!==-1,q=W.textposition.indexOf("bottom")!==-1,G=i(b,[A,f],{flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1,orientation:W.tiling.orientation,pad:{inner:W.tiling.pad},maxDepth:W._maxDepth}),ee=G.descendants(),he=1/0,be=-1/0;ee.forEach(function(ne){var se=ne.depth;se>=W._maxDepth?(ne.x0=ne.x1=(ne.x0+ne.x1)/2,ne.y0=ne.y1=(ne.y0+ne.y1)/2):(he=Math.min(he,se),be=Math.max(be,se))}),x=x.data(ee,l.getPtId),W._maxVisibleLayers=isFinite(be)?be-he+1:0,x.enter().append("g").classed("slice",!0),p(x,s,N,[A,f],D),x.order();var ve=null;if(M&&T){var ce=l.getPtId(T);x.each(function(ne){ve===null&&l.getPtId(ne)===ce&&(ve={x0:ne.x0,x1:ne.x1,y0:ne.y0,y1:ne.y1})})}var re=function(){return ve||{x0:0,x1:A,y0:0,y1:f}},ge=x;return M&&(ge=ge.transition().each("end",function(){var ne=d.select(this);l.setSliceCursor(ne,h,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),ge.each(function(ne){ne._x0=k(ne.x0),ne._x1=k(ne.x1),ne._y0=w(ne.y0),ne._y1=w(ne.y1),ne._hoverX=k(ne.x1-W.tiling.pad),ne._hoverY=w(q?ne.y1-W.tiling.pad/2:ne.y0+W.tiling.pad/2);var se=d.select(this),_e=y.ensureSingle(se,"path","surface",function(fe){fe.style("pointer-events",B?"none":"all")});M?_e.transition().attrTween("d",function(fe){var Ce=g(fe,s,re(),[A,f],{orientation:W.tiling.orientation,flipX:W.tiling.flip.indexOf("x")>-1,flipY:W.tiling.flip.indexOf("y")>-1});return function(Re){return D(Ce(Re))}}):_e.attr("d",D),se.call(o,b,h,m,{styleOne:n,eventDataKeys:a.eventDataKeys,transitionTime:a.CLICK_TRANSITION_TIME,transitionEasing:a.CLICK_TRANSITION_EASING}).call(l.setSliceCursor,h,{isTransitioning:h._transitioning}),_e.call(n,ne,W,h,{hovered:!1}),ne.x0===ne.x1||ne.y0===ne.y1?ne._text="":ne._text=u(ne,b,W,m,U)||"";var oe=y.ensureSingle(se,"g","slicetext"),J=y.ensureSingle(oe,"text","",function(fe){fe.attr("data-notex",1)}),me=y.ensureUniformFontSize(h,l.determineTextFont(W,ne,U.font));J.text(ne._text||" ").classed("slicetext",!0).attr("text-anchor",H?"end":F?"start":"middle").call(z.font,me).call(P.convertToTspans,h),ne.textBB=z.bBox(J.node()),ne.transform=E(ne,{fontSize:me.size}),ne.transform.fontSize=me.size,M?J.transition().attrTween("transform",function(fe){var Ce=C(fe,s,re(),[A,f]);return function(Re){return I(Ce(Re))}}):J.attr("transform",I(ne))}),ve}}),sY=ze((te,Y)=>{var d=qI(),y=oY();Y.exports=function(z,P,i,n){return d(z,P,i,n,{type:"icicle",drawDescendants:y})}}),lY=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"icicle",basePlotModule:rY(),categories:[],animatable:!0,attributes:GI(),layoutAttributes:ZI(),supplyDefaults:iY(),supplyLayoutDefaults:nY(),calc:KI().calc,crossTraceCalc:KI().crossTraceCalc,plot:sY(),style:YI().style,colorbar:Mo(),meta:{}}}),uY=ze((te,Y)=>{Y.exports=lY()}),cY=ze(te=>{var Y=sh();te.name="funnelarea",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),XI=ze((te,Y)=>{var d=bb(),y=xa(),z=Xh().attributes,{hovertemplateAttrs:P,texttemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=nn().extendFlat;Y.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:a({},d.marker.line.color,{dflt:null}),width:a({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:a({},d.scalegroup,{}),textinfo:a({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:i({editType:"plot"},{keys:["label","color","value","text","percent"]}),texttemplatefallback:n({editType:"plot"}),hoverinfo:a({},y.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:P({},{keys:["label","color","value","text","percent"]}),hovertemplatefallback:n(),textposition:a({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:a({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:z({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}),JI=ze((te,Y)=>{var d=oC().hiddenlabels;Y.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}),hY=ze((te,Y)=>{var d=ji(),y=XI(),z=Xh().defaults,P=tg().handleText,i=wb().handleLabelsAndValues,n=wb().handleMarkerDefaults;Y.exports=function(a,l,o,u){function s(D,E){return d.coerce(a,l,y,D,E)}var h=s("labels"),m=s("values"),b=i(h,m),x=b.len;if(l._hasLabels=b.hasLabels,l._hasValues=b.hasValues,!l._hasLabels&&l._hasValues&&(s("label0"),s("dlabel")),!x){l.visible=!1;return}l._length=x,n(a,l,u,s),s("scalegroup");var _=s("text"),A=s("texttemplate");s("texttemplatefallback");var f;if(A||(f=s("textinfo",Array.isArray(_)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),s("hovertemplatefallback"),A||f&&f!=="none"){var k=s("textposition");P(a,l,u,s,k,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else f==="none"&&s("textposition","none");z(l,u,s);var w=s("title.text");w&&(s("title.position"),d.coerceFont(s,"title.font",u.font)),s("aspectratio"),s("baseratio")}}),fY=ze((te,Y)=>{var d=ji(),y=JI();Y.exports=function(z,P){function i(n,a){return d.coerce(z,P,y,n,a)}i("hiddenlabels"),i("funnelareacolorway",P.colorway),i("extendfunnelareacolors")}}),QI=ze((te,Y)=>{var d=Fw();function y(P,i){return d.calc(P,i)}function z(P){d.crossTraceCalc(P,{type:"funnelarea"})}Y.exports={calc:y,crossTraceCalc:z}}),dY=ze((te,Y)=>{var d=ri(),y=Zs(),z=ji(),P=z.strScale,i=z.strTranslate,n=cc(),a=gb(),l=a.toMoveInsideBar,o=C0(),u=o.recordMinTextSize,s=o.clearMinTextSize,h=Hv(),m=sC(),b=m.attachFxHandlers,x=m.determineInsideTextFont,_=m.layoutAreas,A=m.prerenderTitles,f=m.positionTitleOutside,k=m.formatSliceLabel;Y.exports=function(I,M){var p=I._context.staticPlot,g=I._fullLayout;s("funnelarea",g),A(M,I),_(M,g._size),z.makeTraceGroups(g._funnelarealayer,M,"trace").each(function(C){var T=d.select(this),N=C[0],B=N.trace;E(C),T.each(function(){var U=d.select(this).selectAll("g.slice").data(C);U.enter().append("g").classed("slice",!0),U.exit().remove(),U.each(function(W,F){if(W.hidden){d.select(this).selectAll("path,g").remove();return}W.pointNumber=W.i,W.curveNumber=B.index;var H=N.cx,q=N.cy,G=d.select(this),ee=G.selectAll("path.surface").data([W]);ee.enter().append("path").classed("surface",!0).style({"pointer-events":p?"none":"all"}),G.call(b,I,C);var he="M"+(H+W.TR[0])+","+(q+W.TR[1])+w(W.TR,W.BR)+w(W.BR,W.BL)+w(W.BL,W.TL)+"Z";ee.attr("d",he),k(I,W,N);var be=h.castOption(B.textposition,W.pts),ve=G.selectAll("g.slicetext").data(W.text&&be!=="none"?[0]:[]);ve.enter().append("g").classed("slicetext",!0),ve.exit().remove(),ve.each(function(){var ce=z.ensureSingle(d.select(this),"text","",function(me){me.attr("data-notex",1)}),re=z.ensureUniformFontSize(I,x(B,W,g.font));ce.text(W.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,re).call(n.convertToTspans,I);var ge=y.bBox(ce.node()),ne,se,_e,oe=Math.min(W.BL[1],W.BR[1])+q,J=Math.max(W.TL[1],W.TR[1])+q;se=Math.max(W.TL[0],W.BL[0])+H,_e=Math.min(W.TR[0],W.BR[0])+H,ne=l(se,_e,oe,J,ge,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),ne.fontSize=re.size,u(B.type,ne,g),C[F].transform=ne,z.setTransormAndDisplay(ce,ne)})});var V=d.select(this).selectAll("g.titletext").data(B.title.text?[0]:[]);V.enter().append("g").classed("titletext",!0),V.exit().remove(),V.each(function(){var W=z.ensureSingle(d.select(this),"text","",function(q){q.attr("data-notex",1)}),F=B.title.text;B._meta&&(F=z.templateString(F,B._meta)),W.text(F).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,B.title.font).call(n.convertToTspans,I);var H=f(N,g._size);W.attr("transform",i(H.x,H.y)+P(Math.min(1,H.scale))+i(H.tx,H.ty))})})})};function w(I,M){var p=M[0]-I[0],g=M[1]-I[1];return"l"+p+","+g}function D(I,M){return[.5*(I[0]+M[0]),.5*(I[1]+M[1])]}function E(I){if(!I.length)return;var M=I[0],p=M.trace,g=p.aspectratio,C=p.baseratio;C>.999&&(C=.999);var T=Math.pow(C,2),N=M.vTotal,B=N*T/(1-T),U=N,V=B/N;function W(){var Ce=Math.sqrt(V);return{x:Ce,y:-Ce}}function F(){var Ce=W();return[Ce.x,Ce.y]}var H,q=[];q.push(F());var G,ee;for(G=I.length-1;G>-1;G--)if(ee=I[G],!ee.hidden){var he=ee.v/U;V+=he,q.push(F())}var be=1/0,ve=-1/0;for(G=0;G-1;G--)if(ee=I[G],!ee.hidden){J+=1;var me=q[J][0],fe=q[J][1];ee.TL=[-me,fe],ee.TR=[me,fe],ee.BL=_e,ee.BR=oe,ee.pxmid=D(ee.TR,ee.BR),_e=ee.TL,oe=ee.TR}}}),pY=ze((te,Y)=>{var d=ri(),y=Vv(),z=C0().resizeText;Y.exports=function(P){var i=P._fullLayout._funnelarealayer.selectAll(".trace");z(P,i,"funnelarea"),i.each(function(n){var a=n[0],l=a.trace,o=d.select(this);o.style({opacity:l.opacity}),o.selectAll("path.surface").each(function(u){d.select(this).call(y,u,l,P)})})}}),mY=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"funnelarea",basePlotModule:cY(),categories:["pie-like","funnelarea","showLegend"],attributes:XI(),layoutAttributes:JI(),supplyDefaults:hY(),supplyLayoutDefaults:fY(),calc:QI().calc,crossTraceCalc:QI().crossTraceCalc,plot:dY(),style:pY(),styleOne:Vv(),meta:{}}}),gY=ze((te,Y)=>{Y.exports=mY()}),Hp=ze((te,Y)=>{(function(){var d={24:function(i){var n={left:0,top:0};i.exports=a;function a(o,u,s){u=u||o.currentTarget||o.srcElement,Array.isArray(s)||(s=[0,0]);var h=o.clientX||0,m=o.clientY||0,b=l(u);return s[0]=h-b.left,s[1]=m-b.top,s}function l(o){return o===window||o===document||o===document.body?n:o.getBoundingClientRect()}},109:function(i){i.exports=n;function n(a,l,o,u){var s=o[0],h=o[2],m=l[0]-s,b=l[2]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=s+b*x+m*_,a[1]=l[1],a[2]=h+b*_-m*x,a}},160:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.max(l[0],o[0]),a[1]=Math.max(l[1],o[1]),a[2]=Math.max(l[2],o[2]),a[3]=Math.max(l[3],o[3]),a}},216:function(i){i.exports=n;function n(a,l){for(var o={},u=0;u1){x[0]in m||(m[x[0]]=[]),m=m[x[0]];for(var _=1;_=0;--H){var ge=W[H];q=ge[0];var ne=U[q],se=ne[0],_e=ne[1],oe=B[se],J=B[_e];if((oe[0]-J[0]||oe[1]-J[1])<0){var me=se;se=_e,_e=me}ne[0]=se;var fe=ne[1]=ge[1],Ce;for(F&&(Ce=ne[2]);H>0&&W[H-1][0]===q;){var ge=W[--H],Re=ge[1];F?U.push([fe,Re,Ce]):U.push([fe,Re]),fe=Re}F?U.push([fe,_e,Ce]):U.push([fe,_e])}return G}function I(B,U,V){for(var W=U.length,F=new l(W),H=[],q=0;qU[2]?1:0)}function g(B,U,V){if(B.length!==0){if(U)for(var W=0;W0||q.length>0}function N(B,U,V){var W;if(V){W=U;for(var F=new Array(U.length),H=0;H>>1;u(k,ne);for(var se=0,_e=0,ve=0;ve=s)oe=oe-s|0,D(x,_,_e--,oe);else if(oe>=0)D(m,b,se--,oe);else if(oe<=-s){oe=-oe-s|0;for(var J=0;J>>1;u(k,ne);for(var se=0,_e=0,oe=0,ve=0;ve>1===k[2*ve+3]>>1&&(me=2,ve+=1),J<0){for(var fe=-(J>>1)-1,Ce=0;Ce>1)-1;me===0?D(m,b,se--,fe):me===1?D(x,_,_e--,fe):me===2&&D(A,f,oe--,fe)}}}function p(C,T,N,B,U,V,W,F,$,q,G,ee){var he=0,xe=2*C,ve=T,ce=T+C,re=1,ge=1;B?ge=s:re=s;for(var ne=U;ne>>1;u(k,J);for(var me=0,ne=0;ne=s?(Ce=!B,se-=s):(Ce=!!B,se-=1),Ce)E(m,b,me++,se);else{var Be=ee[se],Oe=xe*se,Ze=G[Oe+T+1],Ge=G[Oe+T+1+C];e:for(var rt=0;rt>>1;u(k,se);for(var _e=0,ce=0;ce=s)m[_e++]=re-s;else{re-=1;var J=G[re],me=he*re,fe=q[me+T+1],Ce=q[me+T+1+C];e:for(var Be=0;Be<_e;++Be){var Oe=m[Be],Ze=W[Oe];if(Ze===J)break;var Ge=he*Oe;if(!(Ce=0;--Be)if(m[Be]===re){for(var rt=Be+1;rt<_e;++rt)m[rt-1]=m[rt];break}--_e}}}},868:function(i,n,a){i.exports=a(1387)},869:function(i,n,a){var l=a(2651),o=a(5716);i.exports=u;function u(s,h){var m=o(s),b=o(h);if(m===0)return[l(0),l(1)];if(b===0)return[l(0),l(0)];b<0&&(s=s.neg(),h=h.neg());var x=s.gcd(h);return x.cmpn(1)?[s.div(x),h.div(x)]:[s,h]}},870:function(i,n,a){var l=a(1433);function o(s){this.gl=s,this._elements=null,this._attributes=null,this._elementsType=s.UNSIGNED_SHORT}o.prototype.bind=function(){l(this.gl,this._elements,this._attributes)},o.prototype.update=function(s,h,m){this._elements=h,this._attributes=s,this._elementsType=m||this.gl.UNSIGNED_SHORT},o.prototype.dispose=function(){},o.prototype.unbind=function(){},o.prototype.draw=function(s,h,m){m=m||0;var b=this.gl;this._elements?b.drawElements(s,h,this._elementsType,m):b.drawArrays(s,m,h)};function u(s){return new o(s)}i.exports=u},946:function(i,n,a){var l=a(1369),o=a(4025);i.exports=u;function u(s){var h=s[0],m=s[1];if(h.cmpn(0)===0)return 0;var b=h.abs().divmod(m.abs()),x=b.div,_=l(x),A=b.mod,f=h.negative!==m.negative?-1:1;if(A.cmpn(0)===0)return f*_;if(_){var k=o(_)+4,w=l(A.ushln(k).divRound(m));return f*(_+w*Math.pow(2,-k))}else{var D=m.bitLength()-A.bitLength()+53,w=l(A.ushln(D).divRound(m));return D<1023?f*w*Math.pow(2,-D):(w*=Math.pow(2,-1023),f*w*Math.pow(2,1023-D))}}},990:function(i,n,a){var l=a(9405),o=a(3236),u=o([`precision highp float; +`]);n.meshShader={vertex:o,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},n.wireShader={vertex:s,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},n.pointShader={vertex:m,fragment:b,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},n.pickShader={vertex:x,fragment:_,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},n.pointPickShader={vertex:A,fragment:_,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},n.contourShader={vertex:f,fragment:k,attributes:[{name:"position",type:"vec3"}]}},855:function(i,n,a){i.exports={init:w,sweepBipartite:I,sweepComplete:M,scanBipartite:p,scanComplete:g};var l=a(1888),o=a(8828),u=a(4192),s=1<<28,h=1024,m=l.mallocInt32(h),b=l.mallocInt32(h),x=l.mallocInt32(h),_=l.mallocInt32(h),A=l.mallocInt32(h),f=l.mallocInt32(h),k=l.mallocDouble(h*8);function w(C){var T=o.nextPow2(C);m.length>>1;u(k,ne);for(var se=0,_e=0,ve=0;ve=s)oe=oe-s|0,D(x,_,_e--,oe);else if(oe>=0)D(m,b,se--,oe);else if(oe<=-s){oe=-oe-s|0;for(var J=0;J>>1;u(k,ne);for(var se=0,_e=0,oe=0,ve=0;ve>1===k[2*ve+3]>>1&&(me=2,ve+=1),J<0){for(var fe=-(J>>1)-1,Ce=0;Ce>1)-1;me===0?D(m,b,se--,fe):me===1?D(x,_,_e--,fe):me===2&&D(A,f,oe--,fe)}}}function p(C,T,N,B,U,V,W,F,H,q,G,ee){var he=0,be=2*C,ve=T,ce=T+C,re=1,ge=1;B?ge=s:re=s;for(var ne=U;ne>>1;u(k,J);for(var me=0,ne=0;ne=s?(Ce=!B,se-=s):(Ce=!!B,se-=1),Ce)E(m,b,me++,se);else{var Re=ee[se],Be=be*se,Ze=G[Be+T+1],Ge=G[Be+T+1+C];e:for(var tt=0;tt>>1;u(k,se);for(var _e=0,ce=0;ce=s)m[_e++]=re-s;else{re-=1;var J=G[re],me=he*re,fe=q[me+T+1],Ce=q[me+T+1+C];e:for(var Re=0;Re<_e;++Re){var Be=m[Re],Ze=W[Be];if(Ze===J)break;var Ge=he*Be;if(!(Ce=0;--Re)if(m[Re]===re){for(var tt=Re+1;tt<_e;++tt)m[tt-1]=m[tt];break}--_e}}}},868:function(i,n,a){i.exports=a(1387)},869:function(i,n,a){var l=a(2651),o=a(5716);i.exports=u;function u(s,h){var m=o(s),b=o(h);if(m===0)return[l(0),l(1)];if(b===0)return[l(0),l(0)];b<0&&(s=s.neg(),h=h.neg());var x=s.gcd(h);return x.cmpn(1)?[s.div(x),h.div(x)]:[s,h]}},870:function(i,n,a){var l=a(1433);function o(s){this.gl=s,this._elements=null,this._attributes=null,this._elementsType=s.UNSIGNED_SHORT}o.prototype.bind=function(){l(this.gl,this._elements,this._attributes)},o.prototype.update=function(s,h,m){this._elements=h,this._attributes=s,this._elementsType=m||this.gl.UNSIGNED_SHORT},o.prototype.dispose=function(){},o.prototype.unbind=function(){},o.prototype.draw=function(s,h,m){m=m||0;var b=this.gl;this._elements?b.drawElements(s,h,this._elementsType,m):b.drawArrays(s,m,h)};function u(s){return new o(s)}i.exports=u},946:function(i,n,a){var l=a(1369),o=a(4025);i.exports=u;function u(s){var h=s[0],m=s[1];if(h.cmpn(0)===0)return 0;var b=h.abs().divmod(m.abs()),x=b.div,_=l(x),A=b.mod,f=h.negative!==m.negative?-1:1;if(A.cmpn(0)===0)return f*_;if(_){var k=o(_)+4,w=l(A.ushln(k).divRound(m));return f*(_+w*Math.pow(2,-k))}else{var D=m.bitLength()-A.bitLength()+53,w=l(A.ushln(D).divRound(m));return D<1023?f*w*Math.pow(2,-D):(w*=Math.pow(2,-1023),f*w*Math.pow(2,1023-D))}}},990:function(i,n,a){var l=a(9405),o=a(3236),u=o([`precision highp float; #define GLSLIFY 1 attribute vec4 uv; @@ -1417,7 +1417,7 @@ varying vec4 fragColor; void main() { gl_FragColor = fragColor; -}`]);i.exports=function(h){return o(h,u,s,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},1498:function(i){i.exports=n;function n(a,l){return a[0]=-l[0],a[1]=-l[1],a[2]=-l[2],a[3]=-l[3],a}},1533:function(i,n,a){a(6859),i.exports=l;function l(o){return o&&typeof o=="object"&&!!o.words}},1538:function(i){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function n(g){g.permitHostObjects___&&g.permitHostObjects___(n)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=n);var a=!1;if(typeof WeakMap=="function"){var l=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var o=new l,u=Object.freeze({});if(o.set(u,1),o.get(u)!==1)a=!0;else{i.exports=WeakMap;return}}}var s=Object.getOwnPropertyNames,h=Object.defineProperty,m=Object.isExtensible,b="weakmap:",x=b+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var _=new ArrayBuffer(25),A=new Uint8Array(_);crypto.getRandomValues(A),x=b+"rand:"+Array.prototype.map.call(A,function(g){return(g%36).toString(36)}).join("")+"___"}function f(g){return!(g.substr(0,b.length)==b&&g.substr(g.length-3)==="___")}if(h(Object,"getOwnPropertyNames",{value:function(g){return s(g).filter(f)}}),"getPropertyNames"in Object){var k=Object.getPropertyNames;h(Object,"getPropertyNames",{value:function(g){return k(g).filter(f)}})}function w(g){if(g!==Object(g))throw new TypeError("Not an object: "+g);var C=g[x];if(C&&C.key===g)return C;if(m(g)){C={key:g};try{return h(g,x,{value:C,writable:!1,enumerable:!1,configurable:!1}),C}catch{return}}}(function(){var g=Object.freeze;h(Object,"freeze",{value:function(N){return w(N),g(N)}});var C=Object.seal;h(Object,"seal",{value:function(N){return w(N),C(N)}});var T=Object.preventExtensions;h(Object,"preventExtensions",{value:function(N){return w(N),T(N)}})})();function D(g){return g.prototype=null,Object.freeze(g)}var E=!1;function I(){!E&&typeof console<"u"&&(E=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var M=0,p=function(){this instanceof p||I();var g=[],C=[],T=M++;function N(W,F){var $,q=w(W);return q?T in q?q[T]:F:($=g.indexOf(W),$>=0?C[$]:F)}function B(W){var F=w(W);return F?T in F:g.indexOf(W)>=0}function U(W,F){var $,q=w(W);return q?q[T]=F:($=g.indexOf(W),$>=0?C[$]=F:($=g.length,C[$]=F,g[$]=W)),this}function V(W){var F=w(W),$,q;return F?T in F&&delete F[T]:($=g.indexOf(W),$<0?!1:(q=g.length-1,g[$]=void 0,C[$]=C[q],g[$]=g[q],g.length=q,C.length=q,!0))}return Object.create(p.prototype,{get___:{value:D(N)},has___:{value:D(B)},set___:{value:D(U)},delete___:{value:D(V)}})};p.prototype=Object.create(Object.prototype,{get:{value:function(g,C){return this.get___(g,C)},writable:!0,configurable:!0},has:{value:function(g){return this.has___(g)},writable:!0,configurable:!0},set:{value:function(g,C){return this.set___(g,C)},writable:!0,configurable:!0},delete:{value:function(g){return this.delete___(g)},writable:!0,configurable:!0}}),typeof l=="function"?function(){a&&typeof Proxy<"u"&&(Proxy=void 0);function g(){this instanceof p||I();var C=new l,T=void 0,N=!1;function B(F,$){return T?C.has(F)?C.get(F):T.get___(F,$):C.get(F,$)}function U(F){return C.has(F)||(T?T.has___(F):!1)}var V;a?V=function(F,$){return C.set(F,$),C.has(F)||(T||(T=new p),T.set(F,$)),this}:V=function(F,$){if(N)try{C.set(F,$)}catch{T||(T=new p),T.set___(F,$)}else C.set(F,$);return this};function W(F){var $=!!C.delete(F);return T&&T.delete___(F)||$}return Object.create(p.prototype,{get___:{value:D(B)},has___:{value:D(U)},set___:{value:D(V)},delete___:{value:D(W)},permitHostObjects___:{value:D(function(F){if(F===n)N=!0;else throw new Error("bogus call to permitHostObjects___")})}})}g.prototype=p.prototype,i.exports=g,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),i.exports=p)})()},1570:function(i){i.exports=a;var n=[function(){function l(o,u,s,h){for(var m=o.length,b=[],x=0;x>1,k=s[2*f+1];if(k===x)return f;x>1,k=s[2*f+1];if(k===x)return f;x>1,k=s[2*f+1];if(k===x)return f;x=0?C[H]:F)}function B(W){var F=w(W);return F?T in F:g.indexOf(W)>=0}function U(W,F){var H,q=w(W);return q?q[T]=F:(H=g.indexOf(W),H>=0?C[H]=F:(H=g.length,C[H]=F,g[H]=W)),this}function V(W){var F=w(W),H,q;return F?T in F&&delete F[T]:(H=g.indexOf(W),H<0?!1:(q=g.length-1,g[H]=void 0,C[H]=C[q],g[H]=g[q],g.length=q,C.length=q,!0))}return Object.create(p.prototype,{get___:{value:D(N)},has___:{value:D(B)},set___:{value:D(U)},delete___:{value:D(V)}})};p.prototype=Object.create(Object.prototype,{get:{value:function(g,C){return this.get___(g,C)},writable:!0,configurable:!0},has:{value:function(g){return this.has___(g)},writable:!0,configurable:!0},set:{value:function(g,C){return this.set___(g,C)},writable:!0,configurable:!0},delete:{value:function(g){return this.delete___(g)},writable:!0,configurable:!0}}),typeof l=="function"?function(){a&&typeof Proxy<"u"&&(Proxy=void 0);function g(){this instanceof p||I();var C=new l,T=void 0,N=!1;function B(F,H){return T?C.has(F)?C.get(F):T.get___(F,H):C.get(F,H)}function U(F){return C.has(F)||(T?T.has___(F):!1)}var V;a?V=function(F,H){return C.set(F,H),C.has(F)||(T||(T=new p),T.set(F,H)),this}:V=function(F,H){if(N)try{C.set(F,H)}catch{T||(T=new p),T.set___(F,H)}else C.set(F,H);return this};function W(F){var H=!!C.delete(F);return T&&T.delete___(F)||H}return Object.create(p.prototype,{get___:{value:D(B)},has___:{value:D(U)},set___:{value:D(V)},delete___:{value:D(W)},permitHostObjects___:{value:D(function(F){if(F===n)N=!0;else throw new Error("bogus call to permitHostObjects___")})}})}g.prototype=p.prototype,i.exports=g,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),i.exports=p)})()},1570:function(i){i.exports=a;var n=[function(){function l(o,u,s,h){for(var m=o.length,b=[],x=0;x>1,k=s[2*f+1];if(k===x)return f;x>1,k=s[2*f+1];if(k===x)return f;x>1,k=s[2*f+1];if(k===x)return f;x0?q.pop():new ArrayBuffer(F)}n.mallocArrayBuffer=k;function w(W){return new Uint8Array(k(W),0,W)}n.mallocUint8=w;function D(W){return new Uint16Array(k(2*W),0,W)}n.mallocUint16=D;function E(W){return new Uint32Array(k(4*W),0,W)}n.mallocUint32=E;function I(W){return new Int8Array(k(W),0,W)}n.mallocInt8=I;function M(W){return new Int16Array(k(2*W),0,W)}n.mallocInt16=M;function p(W){return new Int32Array(k(4*W),0,W)}n.mallocInt32=p;function g(W){return new Float32Array(k(4*W),0,W)}n.mallocFloat32=n.mallocFloat=g;function C(W){return new Float64Array(k(8*W),0,W)}n.mallocFloat64=n.mallocDouble=C;function T(W){return s?new Uint8ClampedArray(k(W),0,W):w(W)}n.mallocUint8Clamped=T;function N(W){return h?new BigUint64Array(k(8*W),0,W):null}n.mallocBigUint64=N;function B(W){return m?new BigInt64Array(k(8*W),0,W):null}n.mallocBigInt64=B;function U(W){return new DataView(k(W),0,W)}n.mallocDataView=U;function V(W){W=l.nextPow2(W);var F=l.log2(W),$=_[F];return $.length>0?$.pop():new u(W)}n.mallocBuffer=V,n.clearCache=function(){for(var W=0;W<32;++W)b.UINT8[W].length=0,b.UINT16[W].length=0,b.UINT32[W].length=0,b.INT8[W].length=0,b.INT16[W].length=0,b.INT32[W].length=0,b.FLOAT[W].length=0,b.DOUBLE[W].length=0,b.BIGUINT64[W].length=0,b.BIGINT64[W].length=0,b.UINT8C[W].length=0,x[W].length=0,_[W].length=0}},1903:function(i){i.exports=n;function n(a){var l=new Float32Array(16);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l[4]=a[4],l[5]=a[5],l[6]=a[6],l[7]=a[7],l[8]=a[8],l[9]=a[9],l[10]=a[10],l[11]=a[11],l[12]=a[12],l[13]=a[13],l[14]=a[14],l[15]=a[15],l}},1944:function(i,n,a){var l=a(5250),o=a(8210);i.exports=u;function u(s,h){for(var m=l(s[0],h[0]),b=1;b>1,V=m(g[U],C);V<=0?(V===0&&(B=U),T=U+1):V>0&&(N=U-1)}return B}n.findCell=A;function f(g,C){for(var T=new Array(g.length),N=0,B=T.length;N=g.length||m(g[he],U)!==0););}return T}n.incidence=f;function k(g,C){if(!C)return f(_(D(g,0)),g);for(var T=new Array(C),N=0;N>>$&1&&F.push(B[$]);C.push(F)}return x(C)}n.explode=w;function D(g,C){if(C<0)return[];for(var T=[],N=(1<0}p=p.filter(g);for(var C=p.length,T=new Array(C),N=new Array(C),M=0;M0;){var fe=J.pop(),Ce=ve[fe];m(Ce,function(_t,pt){return _t-pt});var Be=Ce.length,Oe=me[fe],Ze;if(Oe===0){var $=p[fe];Ze=[$]}for(var M=0;M=0)&&(me[Ge]=Oe^1,J.push(Ge),Oe===0)){var $=p[Ge];oe($)||($.reverse(),Ze.push($))}}Oe===0&&w.push(Ze)}return w}},2145:function(i,n){n.uniforms=u,n.attributes=s;var a={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},l=null;function o(h,m){if(!l){var b=Object.keys(a);l={};for(var x=0;x1)for(var k=0;k1&&V.drawBuffersWEBGL(o[U]);var G=C.getExtension("WEBGL_depth_texture");G?W?p.depth=f(C,N,B,G.UNSIGNED_INT_24_8_WEBGL,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):F&&(p.depth=f(C,N,B,C.UNSIGNED_SHORT,C.DEPTH_COMPONENT,C.DEPTH_ATTACHMENT)):F&&W?p._depth_rb=k(C,N,B,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):F?p._depth_rb=k(C,N,B,C.DEPTH_COMPONENT16,C.DEPTH_ATTACHMENT):W&&(p._depth_rb=k(C,N,B,C.STENCIL_INDEX,C.STENCIL_ATTACHMENT));var ee=C.checkFramebufferStatus(C.FRAMEBUFFER);if(ee!==C.FRAMEBUFFER_COMPLETE){p._destroyed=!0,C.bindFramebuffer(C.FRAMEBUFFER,null),C.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(C.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var q=0;qN||C<0||C>N)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=g,p._shape[1]=C;for(var B=b(T),U=0;UB||C<0||C>B)throw new Error("gl-fbo: Parameters are too large for FBO");T=T||{};var U=1;if("color"in T){if(U=Math.max(T.color|0,0),U<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(U>1)if(N){if(U>p.getParameter(N.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+U+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var V=p.UNSIGNED_BYTE,W=p.getExtension("OES_texture_float");if(T.float&&U>0){if(!W)throw new Error("gl-fbo: Context does not support floating point textures");V=p.FLOAT}else T.preferFloat&&U>0&&W&&(V=p.FLOAT);var F=!0;"depth"in T&&(F=!!T.depth);var $=!1;return"stencil"in T&&($=!!T.stencil),new D(p,g,C,V,U,F,$,N)}},2272:function(i,n,a){var l=a(2646)[4];a(2478),i.exports=u;function o(s,h,m,b,x,_){var A=h.opposite(b,x);if(!(A<0)){if(x0;){for(var k=m.pop(),_=m.pop(),w=-1,D=-1,A=x[_],I=1;I=0||(h.flip(_,k),o(s,h,m,w,_,D),o(s,h,m,_,D,w),o(s,h,m,D,k,w),o(s,h,m,k,w,D))}}},2334:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.min(l[0],o[0]),a[1]=Math.min(l[1],o[1]),a[2]=Math.min(l[2],o[2]),a[3]=Math.min(l[3],o[3]),a}},2335:function(i){i.exports=n;function n(a){var l=new Float32Array(4);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l}},2361:function(i){var n=!1;if(typeof Float64Array<"u"){var a=new Float64Array(1),l=new Uint32Array(a.buffer);if(a[0]=1,n=!0,l[1]===1072693248){let u=function(m,b){return l[0]=m,l[1]=b,a[0]},s=function(m){return a[0]=m,l[0]},h=function(m){return a[0]=m,l[1]};i.exports=function(m){return a[0]=m,[l[0],l[1]]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}else if(l[0]===1072693248){let u=function(m,b){return l[1]=m,l[0]=b,a[0]},s=function(m){return a[0]=m,l[1]},h=function(m){return a[0]=m,l[0]};i.exports=function(m){return a[0]=m,[l[1],l[0]]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}else n=!1}if(!n){let u=function(m,b){return o.writeUInt32LE(m,0,!0),o.writeUInt32LE(b,4,!0),o.readDoubleLE(0,!0)},s=function(m){return o.writeDoubleLE(m,0,!0),o.readUInt32LE(0,!0)},h=function(m){return o.writeDoubleLE(m,0,!0),o.readUInt32LE(4,!0)};var o=new Buffer(8);i.exports=function(m){return o.writeDoubleLE(m,0,!0),[o.readUInt32LE(0,!0),o.readUInt32LE(4,!0)]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}i.exports.sign=function(u){return i.exports.hi(u)>>>31},i.exports.exponent=function(u){var s=i.exports.hi(u);return(s<<1>>>21)-1023},i.exports.fraction=function(u){var s=i.exports.lo(u),h=i.exports.hi(u),m=h&(1<<20)-1;return h&2146435072&&(m+=1048576),[s,m]},i.exports.denormalized=function(u){var s=i.exports.hi(u);return!(s&2146435072)}},2408:function(i){i.exports=n;function n(a,l,o){var u=Math.sin(o),s=Math.cos(o),h=l[0],m=l[1],b=l[2],x=l[3],_=l[8],A=l[9],f=l[10],k=l[11];return l!==a&&(a[4]=l[4],a[5]=l[5],a[6]=l[6],a[7]=l[7],a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15]),a[0]=h*s-_*u,a[1]=m*s-A*u,a[2]=b*s-f*u,a[3]=x*s-k*u,a[8]=h*u+_*s,a[9]=m*u+A*s,a[10]=b*u+f*s,a[11]=x*u+k*s,a}},2419:function(i){i.exports=n;function n(a){for(var l=1,o=1;oD-w?u(m,b,x,_,A,f,k,w,D,E,I):s(m,b,x,_,A,f,k,w,D,E,I)}return h}function l(){function u(x,_,A,f,k,w,D,E,I,M,p){for(var g=2*x,C=f,T=g*f;CM-I?f?u(x,_,A,k,w,D,E,I,M,p,g):s(x,_,A,k,w,D,E,I,M,p,g):f?h(x,_,A,k,w,D,E,I,M,p,g):m(x,_,A,k,w,D,E,I,M,p,g)}return b}function o(u){return u?a():l()}n.partial=o(!1),n.full=o(!0)},2478:function(i){function n(h,m,b,x,_){for(var A=_+1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w>=0?(A=f,_=f-1):x=f+1}return A}function a(h,m,b,x,_){for(var A=_+1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w>0?(A=f,_=f-1):x=f+1}return A}function l(h,m,b,x,_){for(var A=x-1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w<0?(A=f,x=f+1):_=f-1}return A}function o(h,m,b,x,_){for(var A=x-1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w<=0?(A=f,x=f+1):_=f-1}return A}function u(h,m,b,x,_){for(;x<=_;){var A=x+_>>>1,f=h[A],k=b!==void 0?b(f,m):f-m;if(k===0)return A;k<=0?x=A+1:_=A-1}return-1}function s(h,m,b,x,_,A){return typeof b=="function"?A(h,m,b,x===void 0?0:x|0,_===void 0?h.length-1:_|0):A(h,m,void 0,b===void 0?0:b|0,x===void 0?h.length-1:x|0)}i.exports={ge:function(h,m,b,x,_){return s(h,m,b,x,_,n)},gt:function(h,m,b,x,_){return s(h,m,b,x,_,a)},lt:function(h,m,b,x,_){return s(h,m,b,x,_,l)},le:function(h,m,b,x,_){return s(h,m,b,x,_,o)},eq:function(h,m,b,x,_){return s(h,m,b,x,_,u)}}},2504:function(i){i.exports=n;function n(a,l,o){var u=o[0],s=o[1],h=o[2];return a[0]=l[0]*u,a[1]=l[1]*u,a[2]=l[2]*u,a[3]=l[3]*u,a[4]=l[4]*s,a[5]=l[5]*s,a[6]=l[6]*s,a[7]=l[7]*s,a[8]=l[8]*h,a[9]=l[9]*h,a[10]=l[10]*h,a[11]=l[11]*h,a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15],a}},2538:function(i,n,a){var l=a(8902),o=a(5542),u=a(2272),s=a(5023);i.exports=_;function h(A){return[Math.min(A[0],A[1]),Math.max(A[0],A[1])]}function m(A,f){return A[0]-f[0]||A[1]-f[1]}function b(A){return A.map(h).sort(m)}function x(A,f,k){return f in A?A[f]:k}function _(A,f,k){Array.isArray(f)?(k=k||{},f=f||[]):(k=f||{},f=[]);var w=!!x(k,"delaunay",!0),D=!!x(k,"interior",!0),E=!!x(k,"exterior",!0),I=!!x(k,"infinity",!1);if(!D&&!E||A.length===0)return[];var M=l(A,f);if(w||D!==E||I){for(var p=o(A.length,b(f)),g=0;g0){if(ee=1,ve[re++]=b(I[C],f,k,w),C+=$,D>0)for(G=1,T=I[C],ge=ve[re]=b(T,f,k,w),_e=ve[re+ne],me=ve[re+oe],Be=ve[re+fe],(ge!==_e||ge!==me||ge!==Be)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,_e,me,Be,f,k,w),Oe=ce[re]=he++),re+=1,C+=$,G=2;G0)for(G=1,T=I[C],ge=ve[re]=b(T,f,k,w),_e=ve[re+ne],me=ve[re+oe],Be=ve[re+fe],(ge!==_e||ge!==me||ge!==Be)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,_e,me,Be,f,k,w),Oe=ce[re]=he++,Be!==me&&m(ce[re+oe],Oe,V,F,me,Be,f,k,w)),re+=1,C+=$,G=2;G0){if(G=1,ve[re++]=b(I[C],f,k,w),C+=$,E>0)for(ee=1,T=I[C],ge=ve[re]=b(T,f,k,w),me=ve[re+oe],_e=ve[re+ne],Be=ve[re+fe],(ge!==me||ge!==_e||ge!==Be)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,me,_e,Be,f,k,w),Oe=ce[re]=he++),re+=1,C+=$,ee=2;ee0)for(ee=1,T=I[C],ge=ve[re]=b(T,f,k,w),me=ve[re+oe],_e=ve[re+ne],Be=ve[re+fe],(ge!==me||ge!==_e||ge!==Be)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,me,_e,Be,f,k,w),Oe=ce[re]=he++,Be!==me&&m(ce[re+oe],Oe,F,B,Be,me,f,k,w)),re+=1,C+=$,ee=2;ee 0"),typeof h.vertex!="function"&&m("Must specify vertex creation function"),typeof h.cell!="function"&&m("Must specify cell creation function"),typeof h.phase!="function"&&m("Must specify phase function");for(var A=h.getters||[],f=new Array(x),k=0;k=0?f[k]=!0:f[k]=!1;return u(h.vertex,h.cell,h.phase,_,b,f)}},2642:function(i,n,a){i.exports=u;var l=a(727);function o(s){for(var h=0,m=0;mf[1][2]&&(T[0]=-T[0]),f[0][2]>f[2][0]&&(T[1]=-T[1]),f[1][0]>f[0][1]&&(T[2]=-T[2]),!0};function w(I,M,p){var g=M[0],C=M[1],T=M[2],N=M[3];return I[0]=p[0]*g+p[4]*C+p[8]*T+p[12]*N,I[1]=p[1]*g+p[5]*C+p[9]*T+p[13]*N,I[2]=p[2]*g+p[6]*C+p[10]*T+p[14]*N,I[3]=p[3]*g+p[7]*C+p[11]*T+p[15]*N,I}function D(I,M){I[0][0]=M[0],I[0][1]=M[1],I[0][2]=M[2],I[1][0]=M[4],I[1][1]=M[5],I[1][2]=M[6],I[2][0]=M[8],I[2][1]=M[9],I[2][2]=M[10]}function E(I,M,p,g,C){I[0]=M[0]*g+p[0]*C,I[1]=M[1]*g+p[1]*C,I[2]=M[2]*g+p[2]*C}},2653:function(i,n,a){var l=a(3865);i.exports=o;function o(u,s){for(var h=u.length,m=new Array(h),b=0;b=b[D]&&(w+=1);f[k]=w}}return m}function h(m,b){try{return l(m,!0)}catch{var x=o(m);if(x.length<=b)return[];var _=u(m,x),A=l(_,!0);return s(A,x)}}},2762:function(i,n,a){var l=a(1888),o=a(5298),u=a(9618),s=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function h(f,k,w,D,E){this.gl=f,this.type=k,this.handle=w,this.length=D,this.usage=E}var m=h.prototype;m.bind=function(){this.gl.bindBuffer(this.type,this.handle)},m.unbind=function(){this.gl.bindBuffer(this.type,null)},m.dispose=function(){this.gl.deleteBuffer(this.handle)};function b(f,k,w,D,E,I){var M=E.length*E.BYTES_PER_ELEMENT;if(I<0)return f.bufferData(k,E,D),M;if(M+I>w)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return f.bufferSubData(k,I,E),w}function x(f,k){for(var w=l.malloc(f.length,k),D=f.length,E=0;E=0;--D){if(k[D]!==w)return!1;w*=f[D]}return!0}m.update=function(f,k){if(typeof k!="number"&&(k=-1),this.bind(),typeof f=="object"&&typeof f.shape<"u"){var w=f.dtype;if(s.indexOf(w)<0&&(w="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var D=gl.getExtension("OES_element_index_uint");D&&w!=="uint16"?w="uint32":w="uint16"}if(w===f.dtype&&_(f.shape,f.stride))f.offset===0&&f.data.length===f.shape[0]?this.length=b(this.gl,this.type,this.length,this.usage,f.data,k):this.length=b(this.gl,this.type,this.length,this.usage,f.data.subarray(f.offset,f.shape[0]),k);else{var E=l.malloc(f.size,w),I=u(E,f.shape);o.assign(I,f),k<0?this.length=b(this.gl,this.type,this.length,this.usage,E,k):this.length=b(this.gl,this.type,this.length,this.usage,E.subarray(0,f.size),k),l.free(E)}}else if(Array.isArray(f)){var M;this.type===this.gl.ELEMENT_ARRAY_BUFFER?M=x(f,"uint16"):M=x(f,"float32"),k<0?this.length=b(this.gl,this.type,this.length,this.usage,M,k):this.length=b(this.gl,this.type,this.length,this.usage,M.subarray(0,f.length),k),l.free(M)}else if(typeof f=="object"&&typeof f.length=="number")this.length=b(this.gl,this.type,this.length,this.usage,f,k);else if(typeof f=="number"||f===void 0){if(k>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");f=f|0,f<=0&&(f=1),this.gl.bufferData(this.type,f|0,this.usage),this.length=f}else throw new Error("gl-buffer: Invalid data type")};function A(f,k,w,D){if(w=w||f.ARRAY_BUFFER,D=D||f.DYNAMIC_DRAW,w!==f.ARRAY_BUFFER&&w!==f.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(D!==f.DYNAMIC_DRAW&&D!==f.STATIC_DRAW&&D!==f.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var E=f.createBuffer(),I=new h(f,w,E,0,D);return I.update(k),I}i.exports=A},2825:function(i){i.exports=n;function n(a,l,o){var u=new Float32Array(3);return u[0]=a,u[1]=l,u[2]=o,u}},2931:function(i,n,a){i.exports={EPSILON:a(2613),create:a(1091),clone:a(3126),angle:a(8192),fromValues:a(2825),copy:a(3990),set:a(1463),equals:a(9922),exactEquals:a(9265),add:a(5632),subtract:a(6843),sub:a(2229),multiply:a(5847),mul:a(4505),divide:a(6690),div:a(4008),min:a(8107),max:a(7417),floor:a(2681),ceil:a(9226),round:a(2447),scale:a(6621),scaleAndAdd:a(8489),distance:a(7056),dist:a(5455),squaredDistance:a(2953),sqrDist:a(6141),length:a(1387),len:a(868),squaredLength:a(3066),sqrLen:a(5486),negate:a(5093),inverse:a(811),normalize:a(3536),dot:a(244),cross:a(5911),lerp:a(6658),random:a(7636),transformMat4:a(5673),transformMat3:a(492),transformQuat:a(264),rotateX:a(6894),rotateY:a(109),rotateZ:a(8692),forEach:a(5137)}},2933:function(i){i.exports=n;function n(a,l){return a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a}},2953:function(i){i.exports=n;function n(a,l){var o=l[0]-a[0],u=l[1]-a[1],s=l[2]-a[2];return o*o+u*u+s*s}},2962:function(i,n,a){var l=a(5250),o=a(8210),u=a(3012),s=a(7004),h=6;function m(D,E,I,M){return function(p){return M(D(I(p[0][0],p[1][1]),I(-p[0][1],p[1][0])))}}function b(D,E,I,M){return function(p){return M(D(E(D(I(p[1][1],p[2][2]),I(-p[1][2],p[2][1])),p[0][0]),D(E(D(I(p[1][0],p[2][2]),I(-p[1][2],p[2][0])),-p[0][1]),E(D(I(p[1][0],p[2][1]),I(-p[1][1],p[2][0])),p[0][2]))))}}function x(D,E,I,M){return function(p){return M(D(D(E(D(E(D(I(p[2][2],p[3][3]),I(-p[2][3],p[3][2])),p[1][1]),D(E(D(I(p[2][1],p[3][3]),I(-p[2][3],p[3][1])),-p[1][2]),E(D(I(p[2][1],p[3][2]),I(-p[2][2],p[3][1])),p[1][3]))),p[0][0]),E(D(E(D(I(p[2][2],p[3][3]),I(-p[2][3],p[3][2])),p[1][0]),D(E(D(I(p[2][0],p[3][3]),I(-p[2][3],p[3][0])),-p[1][2]),E(D(I(p[2][0],p[3][2]),I(-p[2][2],p[3][0])),p[1][3]))),-p[0][1])),D(E(D(E(D(I(p[2][1],p[3][3]),I(-p[2][3],p[3][1])),p[1][0]),D(E(D(I(p[2][0],p[3][3]),I(-p[2][3],p[3][0])),-p[1][1]),E(D(I(p[2][0],p[3][1]),I(-p[2][1],p[3][0])),p[1][3]))),p[0][2]),E(D(E(D(I(p[2][1],p[3][2]),I(-p[2][2],p[3][1])),p[1][0]),D(E(D(I(p[2][0],p[3][2]),I(-p[2][2],p[3][0])),-p[1][1]),E(D(I(p[2][0],p[3][1]),I(-p[2][1],p[3][0])),p[1][2]))),-p[0][3]))))}}function _(D,E,I,M){return function(p){return M(D(D(E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][2]),D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),-p[2][3]),E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][4]))),p[1][1]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][3]),E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][4]))),-p[1][2])),D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][3]))),-p[1][4]))),p[0][0]),E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][2]),D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),-p[2][3]),E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][3]),E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),p[2][4]))),-p[1][2])),D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][3]))),-p[1][4]))),-p[0][1])),D(E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][3]),E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][3]),E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),p[2][4]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][3]))),-p[1][4]))),p[0][2]),D(E(D(D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][4]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][4]))),p[1][2]),E(D(E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][2]))),-p[1][4]))),-p[0][3]),E(D(D(E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][3]))),p[1][0]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][3]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][3]))),p[1][2]),E(D(E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][2]))),-p[1][3]))),p[0][4])))))}}function A(D){var E=D===2?m:D===3?b:D===4?x:D===5?_:void 0;return E(o,u,l,s)}var f=[function(){return[0]},function(D){return[D[0][0]]}];function k(D,E,I,M,p,g,C,T){return function(N){switch(N.length){case 0:return D(N);case 1:return E(N);case 2:return I(N);case 3:return M(N);case 4:return p(N);case 5:return g(N)}var B=C[N.length];return B||(B=C[N.length]=T(N.length)),B(N)}}function w(){for(;f.length0?q.pop():new ArrayBuffer(F)}n.mallocArrayBuffer=k;function w(W){return new Uint8Array(k(W),0,W)}n.mallocUint8=w;function D(W){return new Uint16Array(k(2*W),0,W)}n.mallocUint16=D;function E(W){return new Uint32Array(k(4*W),0,W)}n.mallocUint32=E;function I(W){return new Int8Array(k(W),0,W)}n.mallocInt8=I;function M(W){return new Int16Array(k(2*W),0,W)}n.mallocInt16=M;function p(W){return new Int32Array(k(4*W),0,W)}n.mallocInt32=p;function g(W){return new Float32Array(k(4*W),0,W)}n.mallocFloat32=n.mallocFloat=g;function C(W){return new Float64Array(k(8*W),0,W)}n.mallocFloat64=n.mallocDouble=C;function T(W){return s?new Uint8ClampedArray(k(W),0,W):w(W)}n.mallocUint8Clamped=T;function N(W){return h?new BigUint64Array(k(8*W),0,W):null}n.mallocBigUint64=N;function B(W){return m?new BigInt64Array(k(8*W),0,W):null}n.mallocBigInt64=B;function U(W){return new DataView(k(W),0,W)}n.mallocDataView=U;function V(W){W=l.nextPow2(W);var F=l.log2(W),H=_[F];return H.length>0?H.pop():new u(W)}n.mallocBuffer=V,n.clearCache=function(){for(var W=0;W<32;++W)b.UINT8[W].length=0,b.UINT16[W].length=0,b.UINT32[W].length=0,b.INT8[W].length=0,b.INT16[W].length=0,b.INT32[W].length=0,b.FLOAT[W].length=0,b.DOUBLE[W].length=0,b.BIGUINT64[W].length=0,b.BIGINT64[W].length=0,b.UINT8C[W].length=0,x[W].length=0,_[W].length=0}},1903:function(i){i.exports=n;function n(a){var l=new Float32Array(16);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l[4]=a[4],l[5]=a[5],l[6]=a[6],l[7]=a[7],l[8]=a[8],l[9]=a[9],l[10]=a[10],l[11]=a[11],l[12]=a[12],l[13]=a[13],l[14]=a[14],l[15]=a[15],l}},1944:function(i,n,a){var l=a(5250),o=a(8210);i.exports=u;function u(s,h){for(var m=l(s[0],h[0]),b=1;b>1,V=m(g[U],C);V<=0?(V===0&&(B=U),T=U+1):V>0&&(N=U-1)}return B}n.findCell=A;function f(g,C){for(var T=new Array(g.length),N=0,B=T.length;N=g.length||m(g[he],U)!==0););}return T}n.incidence=f;function k(g,C){if(!C)return f(_(D(g,0)),g);for(var T=new Array(C),N=0;N>>H&1&&F.push(B[H]);C.push(F)}return x(C)}n.explode=w;function D(g,C){if(C<0)return[];for(var T=[],N=(1<0}p=p.filter(g);for(var C=p.length,T=new Array(C),N=new Array(C),M=0;M0;){var fe=J.pop(),Ce=ve[fe];m(Ce,function(_t,mt){return _t-mt});var Re=Ce.length,Be=me[fe],Ze;if(Be===0){var H=p[fe];Ze=[H]}for(var M=0;M=0)&&(me[Ge]=Be^1,J.push(Ge),Be===0)){var H=p[Ge];oe(H)||(H.reverse(),Ze.push(H))}}Be===0&&w.push(Ze)}return w}},2145:function(i,n){n.uniforms=u,n.attributes=s;var a={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},l=null;function o(h,m){if(!l){var b=Object.keys(a);l={};for(var x=0;x1)for(var k=0;k1&&V.drawBuffersWEBGL(o[U]);var G=C.getExtension("WEBGL_depth_texture");G?W?p.depth=f(C,N,B,G.UNSIGNED_INT_24_8_WEBGL,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):F&&(p.depth=f(C,N,B,C.UNSIGNED_SHORT,C.DEPTH_COMPONENT,C.DEPTH_ATTACHMENT)):F&&W?p._depth_rb=k(C,N,B,C.DEPTH_STENCIL,C.DEPTH_STENCIL_ATTACHMENT):F?p._depth_rb=k(C,N,B,C.DEPTH_COMPONENT16,C.DEPTH_ATTACHMENT):W&&(p._depth_rb=k(C,N,B,C.STENCIL_INDEX,C.STENCIL_ATTACHMENT));var ee=C.checkFramebufferStatus(C.FRAMEBUFFER);if(ee!==C.FRAMEBUFFER_COMPLETE){p._destroyed=!0,C.bindFramebuffer(C.FRAMEBUFFER,null),C.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(C.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var q=0;qN||C<0||C>N)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=g,p._shape[1]=C;for(var B=b(T),U=0;UB||C<0||C>B)throw new Error("gl-fbo: Parameters are too large for FBO");T=T||{};var U=1;if("color"in T){if(U=Math.max(T.color|0,0),U<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(U>1)if(N){if(U>p.getParameter(N.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+U+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var V=p.UNSIGNED_BYTE,W=p.getExtension("OES_texture_float");if(T.float&&U>0){if(!W)throw new Error("gl-fbo: Context does not support floating point textures");V=p.FLOAT}else T.preferFloat&&U>0&&W&&(V=p.FLOAT);var F=!0;"depth"in T&&(F=!!T.depth);var H=!1;return"stencil"in T&&(H=!!T.stencil),new D(p,g,C,V,U,F,H,N)}},2272:function(i,n,a){var l=a(2646)[4];a(2478),i.exports=u;function o(s,h,m,b,x,_){var A=h.opposite(b,x);if(!(A<0)){if(x0;){for(var k=m.pop(),_=m.pop(),w=-1,D=-1,A=x[_],I=1;I=0||(h.flip(_,k),o(s,h,m,w,_,D),o(s,h,m,_,D,w),o(s,h,m,D,k,w),o(s,h,m,k,w,D))}}},2334:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.min(l[0],o[0]),a[1]=Math.min(l[1],o[1]),a[2]=Math.min(l[2],o[2]),a[3]=Math.min(l[3],o[3]),a}},2335:function(i){i.exports=n;function n(a){var l=new Float32Array(4);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[3],l}},2361:function(i){var n=!1;if(typeof Float64Array<"u"){var a=new Float64Array(1),l=new Uint32Array(a.buffer);if(a[0]=1,n=!0,l[1]===1072693248){let u=function(m,b){return l[0]=m,l[1]=b,a[0]},s=function(m){return a[0]=m,l[0]},h=function(m){return a[0]=m,l[1]};i.exports=function(m){return a[0]=m,[l[0],l[1]]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}else if(l[0]===1072693248){let u=function(m,b){return l[1]=m,l[0]=b,a[0]},s=function(m){return a[0]=m,l[1]},h=function(m){return a[0]=m,l[0]};i.exports=function(m){return a[0]=m,[l[1],l[0]]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}else n=!1}if(!n){let u=function(m,b){return o.writeUInt32LE(m,0,!0),o.writeUInt32LE(b,4,!0),o.readDoubleLE(0,!0)},s=function(m){return o.writeDoubleLE(m,0,!0),o.readUInt32LE(0,!0)},h=function(m){return o.writeDoubleLE(m,0,!0),o.readUInt32LE(4,!0)};var o=new Buffer(8);i.exports=function(m){return o.writeDoubleLE(m,0,!0),[o.readUInt32LE(0,!0),o.readUInt32LE(4,!0)]},i.exports.pack=u,i.exports.lo=s,i.exports.hi=h}i.exports.sign=function(u){return i.exports.hi(u)>>>31},i.exports.exponent=function(u){var s=i.exports.hi(u);return(s<<1>>>21)-1023},i.exports.fraction=function(u){var s=i.exports.lo(u),h=i.exports.hi(u),m=h&(1<<20)-1;return h&2146435072&&(m+=1048576),[s,m]},i.exports.denormalized=function(u){var s=i.exports.hi(u);return!(s&2146435072)}},2408:function(i){i.exports=n;function n(a,l,o){var u=Math.sin(o),s=Math.cos(o),h=l[0],m=l[1],b=l[2],x=l[3],_=l[8],A=l[9],f=l[10],k=l[11];return l!==a&&(a[4]=l[4],a[5]=l[5],a[6]=l[6],a[7]=l[7],a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15]),a[0]=h*s-_*u,a[1]=m*s-A*u,a[2]=b*s-f*u,a[3]=x*s-k*u,a[8]=h*u+_*s,a[9]=m*u+A*s,a[10]=b*u+f*s,a[11]=x*u+k*s,a}},2419:function(i){i.exports=n;function n(a){for(var l=1,o=1;oD-w?u(m,b,x,_,A,f,k,w,D,E,I):s(m,b,x,_,A,f,k,w,D,E,I)}return h}function l(){function u(x,_,A,f,k,w,D,E,I,M,p){for(var g=2*x,C=f,T=g*f;CM-I?f?u(x,_,A,k,w,D,E,I,M,p,g):s(x,_,A,k,w,D,E,I,M,p,g):f?h(x,_,A,k,w,D,E,I,M,p,g):m(x,_,A,k,w,D,E,I,M,p,g)}return b}function o(u){return u?a():l()}n.partial=o(!1),n.full=o(!0)},2478:function(i){function n(h,m,b,x,_){for(var A=_+1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w>=0?(A=f,_=f-1):x=f+1}return A}function a(h,m,b,x,_){for(var A=_+1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w>0?(A=f,_=f-1):x=f+1}return A}function l(h,m,b,x,_){for(var A=x-1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w<0?(A=f,x=f+1):_=f-1}return A}function o(h,m,b,x,_){for(var A=x-1;x<=_;){var f=x+_>>>1,k=h[f],w=b!==void 0?b(k,m):k-m;w<=0?(A=f,x=f+1):_=f-1}return A}function u(h,m,b,x,_){for(;x<=_;){var A=x+_>>>1,f=h[A],k=b!==void 0?b(f,m):f-m;if(k===0)return A;k<=0?x=A+1:_=A-1}return-1}function s(h,m,b,x,_,A){return typeof b=="function"?A(h,m,b,x===void 0?0:x|0,_===void 0?h.length-1:_|0):A(h,m,void 0,b===void 0?0:b|0,x===void 0?h.length-1:x|0)}i.exports={ge:function(h,m,b,x,_){return s(h,m,b,x,_,n)},gt:function(h,m,b,x,_){return s(h,m,b,x,_,a)},lt:function(h,m,b,x,_){return s(h,m,b,x,_,l)},le:function(h,m,b,x,_){return s(h,m,b,x,_,o)},eq:function(h,m,b,x,_){return s(h,m,b,x,_,u)}}},2504:function(i){i.exports=n;function n(a,l,o){var u=o[0],s=o[1],h=o[2];return a[0]=l[0]*u,a[1]=l[1]*u,a[2]=l[2]*u,a[3]=l[3]*u,a[4]=l[4]*s,a[5]=l[5]*s,a[6]=l[6]*s,a[7]=l[7]*s,a[8]=l[8]*h,a[9]=l[9]*h,a[10]=l[10]*h,a[11]=l[11]*h,a[12]=l[12],a[13]=l[13],a[14]=l[14],a[15]=l[15],a}},2538:function(i,n,a){var l=a(8902),o=a(5542),u=a(2272),s=a(5023);i.exports=_;function h(A){return[Math.min(A[0],A[1]),Math.max(A[0],A[1])]}function m(A,f){return A[0]-f[0]||A[1]-f[1]}function b(A){return A.map(h).sort(m)}function x(A,f,k){return f in A?A[f]:k}function _(A,f,k){Array.isArray(f)?(k=k||{},f=f||[]):(k=f||{},f=[]);var w=!!x(k,"delaunay",!0),D=!!x(k,"interior",!0),E=!!x(k,"exterior",!0),I=!!x(k,"infinity",!1);if(!D&&!E||A.length===0)return[];var M=l(A,f);if(w||D!==E||I){for(var p=o(A.length,b(f)),g=0;g0){if(ee=1,ve[re++]=b(I[C],f,k,w),C+=H,D>0)for(G=1,T=I[C],ge=ve[re]=b(T,f,k,w),_e=ve[re+ne],me=ve[re+oe],Re=ve[re+fe],(ge!==_e||ge!==me||ge!==Re)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,_e,me,Re,f,k,w),Be=ce[re]=he++),re+=1,C+=H,G=2;G0)for(G=1,T=I[C],ge=ve[re]=b(T,f,k,w),_e=ve[re+ne],me=ve[re+oe],Re=ve[re+fe],(ge!==_e||ge!==me||ge!==Re)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,_e,me,Re,f,k,w),Be=ce[re]=he++,Re!==me&&m(ce[re+oe],Be,V,F,me,Re,f,k,w)),re+=1,C+=H,G=2;G0){if(G=1,ve[re++]=b(I[C],f,k,w),C+=H,E>0)for(ee=1,T=I[C],ge=ve[re]=b(T,f,k,w),me=ve[re+oe],_e=ve[re+ne],Re=ve[re+fe],(ge!==me||ge!==_e||ge!==Re)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,me,_e,Re,f,k,w),Be=ce[re]=he++),re+=1,C+=H,ee=2;ee0)for(ee=1,T=I[C],ge=ve[re]=b(T,f,k,w),me=ve[re+oe],_e=ve[re+ne],Re=ve[re+fe],(ge!==me||ge!==_e||ge!==Re)&&(B=I[C+N],V=I[C+U],F=I[C+W],h(G,ee,T,B,V,F,ge,me,_e,Re,f,k,w),Be=ce[re]=he++,Re!==me&&m(ce[re+oe],Be,F,B,Re,me,f,k,w)),re+=1,C+=H,ee=2;ee 0"),typeof h.vertex!="function"&&m("Must specify vertex creation function"),typeof h.cell!="function"&&m("Must specify cell creation function"),typeof h.phase!="function"&&m("Must specify phase function");for(var A=h.getters||[],f=new Array(x),k=0;k=0?f[k]=!0:f[k]=!1;return u(h.vertex,h.cell,h.phase,_,b,f)}},2642:function(i,n,a){i.exports=u;var l=a(727);function o(s){for(var h=0,m=0;mf[1][2]&&(T[0]=-T[0]),f[0][2]>f[2][0]&&(T[1]=-T[1]),f[1][0]>f[0][1]&&(T[2]=-T[2]),!0};function w(I,M,p){var g=M[0],C=M[1],T=M[2],N=M[3];return I[0]=p[0]*g+p[4]*C+p[8]*T+p[12]*N,I[1]=p[1]*g+p[5]*C+p[9]*T+p[13]*N,I[2]=p[2]*g+p[6]*C+p[10]*T+p[14]*N,I[3]=p[3]*g+p[7]*C+p[11]*T+p[15]*N,I}function D(I,M){I[0][0]=M[0],I[0][1]=M[1],I[0][2]=M[2],I[1][0]=M[4],I[1][1]=M[5],I[1][2]=M[6],I[2][0]=M[8],I[2][1]=M[9],I[2][2]=M[10]}function E(I,M,p,g,C){I[0]=M[0]*g+p[0]*C,I[1]=M[1]*g+p[1]*C,I[2]=M[2]*g+p[2]*C}},2653:function(i,n,a){var l=a(3865);i.exports=o;function o(u,s){for(var h=u.length,m=new Array(h),b=0;b=b[D]&&(w+=1);f[k]=w}}return m}function h(m,b){try{return l(m,!0)}catch{var x=o(m);if(x.length<=b)return[];var _=u(m,x),A=l(_,!0);return s(A,x)}}},2762:function(i,n,a){var l=a(1888),o=a(5298),u=a(9618),s=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function h(f,k,w,D,E){this.gl=f,this.type=k,this.handle=w,this.length=D,this.usage=E}var m=h.prototype;m.bind=function(){this.gl.bindBuffer(this.type,this.handle)},m.unbind=function(){this.gl.bindBuffer(this.type,null)},m.dispose=function(){this.gl.deleteBuffer(this.handle)};function b(f,k,w,D,E,I){var M=E.length*E.BYTES_PER_ELEMENT;if(I<0)return f.bufferData(k,E,D),M;if(M+I>w)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return f.bufferSubData(k,I,E),w}function x(f,k){for(var w=l.malloc(f.length,k),D=f.length,E=0;E=0;--D){if(k[D]!==w)return!1;w*=f[D]}return!0}m.update=function(f,k){if(typeof k!="number"&&(k=-1),this.bind(),typeof f=="object"&&typeof f.shape<"u"){var w=f.dtype;if(s.indexOf(w)<0&&(w="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var D=gl.getExtension("OES_element_index_uint");D&&w!=="uint16"?w="uint32":w="uint16"}if(w===f.dtype&&_(f.shape,f.stride))f.offset===0&&f.data.length===f.shape[0]?this.length=b(this.gl,this.type,this.length,this.usage,f.data,k):this.length=b(this.gl,this.type,this.length,this.usage,f.data.subarray(f.offset,f.shape[0]),k);else{var E=l.malloc(f.size,w),I=u(E,f.shape);o.assign(I,f),k<0?this.length=b(this.gl,this.type,this.length,this.usage,E,k):this.length=b(this.gl,this.type,this.length,this.usage,E.subarray(0,f.size),k),l.free(E)}}else if(Array.isArray(f)){var M;this.type===this.gl.ELEMENT_ARRAY_BUFFER?M=x(f,"uint16"):M=x(f,"float32"),k<0?this.length=b(this.gl,this.type,this.length,this.usage,M,k):this.length=b(this.gl,this.type,this.length,this.usage,M.subarray(0,f.length),k),l.free(M)}else if(typeof f=="object"&&typeof f.length=="number")this.length=b(this.gl,this.type,this.length,this.usage,f,k);else if(typeof f=="number"||f===void 0){if(k>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");f=f|0,f<=0&&(f=1),this.gl.bufferData(this.type,f|0,this.usage),this.length=f}else throw new Error("gl-buffer: Invalid data type")};function A(f,k,w,D){if(w=w||f.ARRAY_BUFFER,D=D||f.DYNAMIC_DRAW,w!==f.ARRAY_BUFFER&&w!==f.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(D!==f.DYNAMIC_DRAW&&D!==f.STATIC_DRAW&&D!==f.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var E=f.createBuffer(),I=new h(f,w,E,0,D);return I.update(k),I}i.exports=A},2825:function(i){i.exports=n;function n(a,l,o){var u=new Float32Array(3);return u[0]=a,u[1]=l,u[2]=o,u}},2931:function(i,n,a){i.exports={EPSILON:a(2613),create:a(1091),clone:a(3126),angle:a(8192),fromValues:a(2825),copy:a(3990),set:a(1463),equals:a(9922),exactEquals:a(9265),add:a(5632),subtract:a(6843),sub:a(2229),multiply:a(5847),mul:a(4505),divide:a(6690),div:a(4008),min:a(8107),max:a(7417),floor:a(2681),ceil:a(9226),round:a(2447),scale:a(6621),scaleAndAdd:a(8489),distance:a(7056),dist:a(5455),squaredDistance:a(2953),sqrDist:a(6141),length:a(1387),len:a(868),squaredLength:a(3066),sqrLen:a(5486),negate:a(5093),inverse:a(811),normalize:a(3536),dot:a(244),cross:a(5911),lerp:a(6658),random:a(7636),transformMat4:a(5673),transformMat3:a(492),transformQuat:a(264),rotateX:a(6894),rotateY:a(109),rotateZ:a(8692),forEach:a(5137)}},2933:function(i){i.exports=n;function n(a,l){return a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a}},2953:function(i){i.exports=n;function n(a,l){var o=l[0]-a[0],u=l[1]-a[1],s=l[2]-a[2];return o*o+u*u+s*s}},2962:function(i,n,a){var l=a(5250),o=a(8210),u=a(3012),s=a(7004),h=6;function m(D,E,I,M){return function(p){return M(D(I(p[0][0],p[1][1]),I(-p[0][1],p[1][0])))}}function b(D,E,I,M){return function(p){return M(D(E(D(I(p[1][1],p[2][2]),I(-p[1][2],p[2][1])),p[0][0]),D(E(D(I(p[1][0],p[2][2]),I(-p[1][2],p[2][0])),-p[0][1]),E(D(I(p[1][0],p[2][1]),I(-p[1][1],p[2][0])),p[0][2]))))}}function x(D,E,I,M){return function(p){return M(D(D(E(D(E(D(I(p[2][2],p[3][3]),I(-p[2][3],p[3][2])),p[1][1]),D(E(D(I(p[2][1],p[3][3]),I(-p[2][3],p[3][1])),-p[1][2]),E(D(I(p[2][1],p[3][2]),I(-p[2][2],p[3][1])),p[1][3]))),p[0][0]),E(D(E(D(I(p[2][2],p[3][3]),I(-p[2][3],p[3][2])),p[1][0]),D(E(D(I(p[2][0],p[3][3]),I(-p[2][3],p[3][0])),-p[1][2]),E(D(I(p[2][0],p[3][2]),I(-p[2][2],p[3][0])),p[1][3]))),-p[0][1])),D(E(D(E(D(I(p[2][1],p[3][3]),I(-p[2][3],p[3][1])),p[1][0]),D(E(D(I(p[2][0],p[3][3]),I(-p[2][3],p[3][0])),-p[1][1]),E(D(I(p[2][0],p[3][1]),I(-p[2][1],p[3][0])),p[1][3]))),p[0][2]),E(D(E(D(I(p[2][1],p[3][2]),I(-p[2][2],p[3][1])),p[1][0]),D(E(D(I(p[2][0],p[3][2]),I(-p[2][2],p[3][0])),-p[1][1]),E(D(I(p[2][0],p[3][1]),I(-p[2][1],p[3][0])),p[1][2]))),-p[0][3]))))}}function _(D,E,I,M){return function(p){return M(D(D(E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][2]),D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),-p[2][3]),E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][4]))),p[1][1]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][3]),E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][4]))),-p[1][2])),D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][3]))),-p[1][4]))),p[0][0]),E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][2]),D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),-p[2][3]),E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][3]),E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),p[2][4]))),-p[1][2])),D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][3]))),-p[1][4]))),-p[0][1])),D(E(D(D(E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][3]),E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][3],p[4][4]),I(-p[3][4],p[4][3])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][3]),E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),p[2][4]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][4]))),p[1][3]),E(D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][3]))),-p[1][4]))),p[0][2]),D(E(D(D(E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][4]))),p[1][0]),E(D(E(D(I(p[3][2],p[4][4]),I(-p[3][4],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][4]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][4]),I(-p[3][4],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][4]),I(-p[3][4],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][4]))),p[1][2]),E(D(E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][2]))),-p[1][4]))),-p[0][3]),E(D(D(E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][1]),D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),-p[2][2]),E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][3]))),p[1][0]),E(D(E(D(I(p[3][2],p[4][3]),I(-p[3][3],p[4][2])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][2]),E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),p[2][3]))),-p[1][1])),D(E(D(E(D(I(p[3][1],p[4][3]),I(-p[3][3],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][3]),I(-p[3][3],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][3]))),p[1][2]),E(D(E(D(I(p[3][1],p[4][2]),I(-p[3][2],p[4][1])),p[2][0]),D(E(D(I(p[3][0],p[4][2]),I(-p[3][2],p[4][0])),-p[2][1]),E(D(I(p[3][0],p[4][1]),I(-p[3][1],p[4][0])),p[2][2]))),-p[1][3]))),p[0][4])))))}}function A(D){var E=D===2?m:D===3?b:D===4?x:D===5?_:void 0;return E(o,u,l,s)}var f=[function(){return[0]},function(D){return[D[0][0]]}];function k(D,E,I,M,p,g,C,T){return function(N){switch(N.length){case 0:return D(N);case 1:return E(N);case 2:return I(N);case 3:return M(N);case 4:return p(N);case 5:return g(N)}var B=C[N.length];return B||(B=C[N.length]=T(N.length)),B(N)}}function w(){for(;f.length0){T=b[U][g][0],B=U;break}N=T[B^1];for(var V=0;V<2;++V)for(var W=b[V][g],F=0;F0&&(T=$,N=q,B=V)}return C||T&&f(T,B),N}function w(p,g){var C=b[g][p][0],T=[p];f(C,g);for(var N=C[g^1],B=g;;){for(;N!==p;)T.push(N),N=k(T[T.length-2],N,!1);if(b[0][p].length+b[1][p].length===0)break;var U=T[T.length-1],V=p,W=T[1],F=k(U,V,!0);if(l(s[U],s[V],s[W],s[F])<0)break;T.push(p),N=k(U,V)}return T}function D(p,g){return g[1]===g[g.length-1]}for(var x=0;x0;){b[0][x].length;var M=w(x,E);D(I,M)?I.push.apply(I,M):(I.length>0&&A.push(I),I=M)}I.length>0&&A.push(I)}return A}},3090:function(i,n,a){i.exports=o;var l=a(3250)[3];function o(u){var s=u.length;if(s<3){for(var h=new Array(s),m=0;m1&&l(u[x[k-2]],u[x[k-1]],f)<=0;)k-=1,x.pop();for(x.push(A),k=_.length;k>1&&l(u[_[k-2]],u[_[k-1]],f)>=0;)k-=1,_.pop();_.push(A)}for(var h=new Array(_.length+x.length-2),w=0,m=0,D=x.length;m0;--E)h[w++]=_[E];return h}},3105:function(i,n){"use restrict";var a=32;n.INT_BITS=a,n.INT_MAX=2147483647,n.INT_MIN=-1<0)-(u<0)},n.abs=function(u){var s=u>>a-1;return(u^s)-s},n.min=function(u,s){return s^(u^s)&-(u65535)<<4,u>>>=s,h=(u>255)<<3,u>>>=h,s|=h,h=(u>15)<<2,u>>>=h,s|=h,h=(u>3)<<1,u>>>=h,s|=h,s|u>>1},n.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},n.popCount=function(u){return u=u-(u>>>1&1431655765),u=(u&858993459)+(u>>>2&858993459),(u+(u>>>4)&252645135)*16843009>>>24};function l(u){var s=32;return u&=-u,u&&s--,u&65535&&(s-=16),u&16711935&&(s-=8),u&252645135&&(s-=4),u&858993459&&(s-=2),u&1431655765&&(s-=1),s}n.countTrailingZeros=l,n.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u+1},n.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u-(u>>>1)},n.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,u&=15,27030>>>u&1};var o=new Array(256);(function(u){for(var s=0;s<256;++s){var h=s,m=s,b=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=h&1,--b;u[s]=m<>>8&255]<<16|o[u>>>16&255]<<8|o[u>>>24&255]},n.interleave2=function(u,s){return u&=65535,u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,u|s<<1},n.deinterleave2=function(u,s){return u=u>>>s&1431655765,u=(u|u>>>1)&858993459,u=(u|u>>>2)&252645135,u=(u|u>>>4)&16711935,u=(u|u>>>16)&65535,u<<16>>16},n.interleave3=function(u,s,h){return u&=1023,u=(u|u<<16)&4278190335,u=(u|u<<8)&251719695,u=(u|u<<4)&3272356035,u=(u|u<<2)&1227133513,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,u|=s<<1,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,u|h<<2},n.deinterleave3=function(u,s){return u=u>>>s&1227133513,u=(u|u>>>2)&3272356035,u=(u|u>>>4)&251719695,u=(u|u>>>8)&4278190335,u=(u|u>>>16)&1023,u<<22>>22},n.nextCombination=function(u){var s=u|u-1;return s+1|(~s&-~s)-1>>>l(u)+1}},3126:function(i){i.exports=n;function n(a){var l=new Float32Array(3);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l}},3134:function(i,n,a){i.exports=o;var l=a(1682);function o(u,s){var h=u.length;if(typeof s!="number"){s=0;for(var m=0;m=0}function b(x,_,A,f){var k=l(_,A,f);if(k===0){var w=o(l(x,_,A)),D=o(l(x,_,f));if(w===D){if(w===0){var E=m(x,_,A),I=m(x,_,f);return E===I?0:E?1:-1}return 0}else{if(D===0)return w>0||m(x,_,f)?-1:1;if(w===0)return D>0||m(x,_,A)?1:-1}return o(D-w)}var M=l(x,_,A);if(M>0)return k>0&&l(x,_,f)>0?1:-1;if(M<0)return k>0||l(x,_,f)>0?1:-1;var p=l(x,_,f);return p>0||m(x,_,A)?1:-1}},3202:function(i){i.exports=function(n,a){a||(a=[0,""]),n=String(n);var l=parseFloat(n,10);return a[0]=l,a[1]=n.match(/[\d.\-\+]*\s*(.*)/)[1]||"",a}},3233:function(i){var n="",a;i.exports=l;function l(o,u){if(typeof o!="string")throw new TypeError("expected a string");if(u===1)return o;if(u===2)return o+o;var s=o.length*u;if(a!==o||typeof a>"u")a=o,n="";else if(n.length>=s)return n.substr(0,s);for(;s>n.length&&u>1;)u&1&&(n+=o),u>>=1,o+=o;return n+=o,n=n.substr(0,s),n}},3236:function(i){i.exports=function(n){typeof n=="string"&&(n=[n]);for(var a=[].slice.call(arguments,1),l=[],o=0;o0){if(B<=0)return U;V=N+B}else if(N<0){if(B>=0)return U;V=-(N+B)}else return U;var W=b*V;return U>=W||U<=-W?U:w(g,C,T)},function(g,C,T,N){var B=g[0]-N[0],U=C[0]-N[0],V=T[0]-N[0],W=g[1]-N[1],F=C[1]-N[1],$=T[1]-N[1],q=g[2]-N[2],G=C[2]-N[2],ee=T[2]-N[2],he=U*$,xe=V*F,ve=V*W,ce=B*$,re=B*F,ge=U*W,ne=q*(he-xe)+G*(ve-ce)+ee*(re-ge),se=(Math.abs(he)+Math.abs(xe))*Math.abs(q)+(Math.abs(ve)+Math.abs(ce))*Math.abs(G)+(Math.abs(re)+Math.abs(ge))*Math.abs(ee),_e=x*se;return ne>_e||-ne>_e?ne:D(g,C,T,N)}];function I(g){var C=E[g.length];return C||(C=E[g.length]=k(g.length)),C.apply(void 0,g)}function M(g,C,T,N,B,U,V){return function(W,F,$,q,G){switch(arguments.length){case 0:case 1:return 0;case 2:return N(W,F);case 3:return B(W,F,$);case 4:return U(W,F,$,q);case 5:return V(W,F,$,q,G)}for(var ee=new Array(arguments.length),he=0;he4)throw new o("","Invalid data type");switch(q.charAt(0)){case"b":case"i":m["uniform"+G+"iv"](_[B],U);break;case"v":m["uniform"+G+"fv"](_[B],U);break;default:throw new o("","Unrecognized data type for vector "+name+": "+q)}}else if(q.indexOf("mat")===0&&q.length===4){if(G=q.charCodeAt(q.length-1)-48,G<2||G>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+q);m["uniformMatrix"+G+"fv"](_[B],!1,U);break}else throw new o("","Unknown uniform data type for "+name+": "+q)}}}}}function k(M,p){if(typeof p!="object")return[[M,p]];var g=[];for(var C in p){var T=p[C],N=M;parseInt(C)+""===C?N+="["+C+"]":N+="."+C,typeof T=="object"?g.push.apply(g,k(N,T)):g.push([N,T])}return g}function w(M){switch(M){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=M.indexOf("vec");if(0<=p&&p<=1&&M.length===4+p){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new o("","Invalid data type");return M.charAt(0)==="b"?s(g,!1):s(g,0)}else if(M.indexOf("mat")===0&&M.length===4){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+M);return s(g*g,0)}else throw new o("","Unknown uniform data type for "+name+": "+M)}}function D(M,p,g){if(typeof g=="object"){var C=E(g);Object.defineProperty(M,p,{get:u(C),set:f(g),enumerable:!0,configurable:!1})}else _[g]?Object.defineProperty(M,p,{get:A(g),set:f(g),enumerable:!0,configurable:!1}):M[p]=w(x[g].type)}function E(M){var p;if(Array.isArray(M)){p=new Array(M.length);for(var g=0;g=0!=p>=0&&_.push(w[0]+.5+.5*(M+p)/(M-p))}x+=I,++w[0]}}}function a(){return n()}var l=a;function o(h){var m={};return function(b,x,_){var A=b.dtype,f=b.order,k=[A,f.join()].join(),w=m[k];return w||(m[k]=w=h([A,f])),w(b.shape.slice(0),b.data,b.stride,b.offset|0,x,_)}}function u(h){return o(l.bind(void 0,h))}function s(h){return u({funcName:h.funcName})}i.exports=s({funcName:"zeroCrossings"})},3352:function(i,n,a){var l=a(2478),o=0,u=1,s=2;i.exports=C;function h(T,N,B,U,V){this.mid=T,this.left=N,this.right=B,this.leftPoints=U,this.rightPoints=V,this.count=(N?N.count:0)+(B?B.count:0)+U.length}var m=h.prototype;function b(T,N){T.mid=N.mid,T.left=N.left,T.right=N.right,T.leftPoints=N.leftPoints,T.rightPoints=N.rightPoints,T.count=N.count}function x(T,N){var B=M(N);T.mid=B.mid,T.left=B.left,T.right=B.right,T.leftPoints=B.leftPoints,T.rightPoints=B.rightPoints,T.count=B.count}function _(T,N){var B=T.intervals([]);B.push(N),x(T,B)}function A(T,N){var B=T.intervals([]),U=B.indexOf(N);return U<0?o:(B.splice(U,1),x(T,B),u)}m.intervals=function(T){return T.push.apply(T,this.leftPoints),this.left&&this.left.intervals(T),this.right&&this.right.intervals(T),T},m.insert=function(T){var N=this.count-this.leftPoints.length;if(this.count+=1,T[1]3*(N+1)?_(this,T):this.left.insert(T):this.left=M([T]);else if(T[0]>this.mid)this.right?4*(this.right.count+1)>3*(N+1)?_(this,T):this.right.insert(T):this.right=M([T]);else{var B=l.ge(this.leftPoints,T,E),U=l.ge(this.rightPoints,T,I);this.leftPoints.splice(B,0,T),this.rightPoints.splice(U,0,T)}},m.remove=function(T){var N=this.count-this.leftPoints;if(T[1]3*(N-1))return A(this,T);var U=this.left.remove(T);return U===s?(this.left=null,this.count-=1,u):(U===u&&(this.count-=1),U)}else if(T[0]>this.mid){if(!this.right)return o;var V=this.left?this.left.count:0;if(4*V>3*(N-1))return A(this,T);var U=this.right.remove(T);return U===s?(this.right=null,this.count-=1,u):(U===u&&(this.count-=1),U)}else{if(this.count===1)return this.leftPoints[0]===T?s:o;if(this.leftPoints.length===1&&this.leftPoints[0]===T){if(this.left&&this.right){for(var W=this,F=this.left;F.right;)W=F,F=F.right;if(W===this)F.right=this.right;else{var $=this.left,U=this.right;W.count-=F.count,W.right=F.left,F.left=$,F.right=U}b(this,F),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?b(this,this.left):b(this,this.right);return u}for(var $=l.ge(this.leftPoints,T,E);$=0&&T[U][1]>=N;--U){var V=B(T[U]);if(V)return V}}function w(T,N){for(var B=0;Bthis.mid){if(this.right){var B=this.right.queryPoint(T,N);if(B)return B}return k(this.rightPoints,T,N)}else return w(this.leftPoints,N)},m.queryInterval=function(T,N,B){if(Tthis.mid&&this.right){var U=this.right.queryInterval(T,N,B);if(U)return U}return Nthis.mid?k(this.rightPoints,T,B):w(this.leftPoints,B)};function D(T,N){return T-N}function E(T,N){var B=T[0]-N[0];return B||T[1]-N[1]}function I(T,N){var B=T[1]-N[1];return B||T[0]-N[0]}function M(T){if(T.length===0)return null;for(var N=[],B=0;B>1],V=[],W=[],F=[],B=0;B=0),I.type){case"b":k=parseInt(k,10).toString(2);break;case"c":k=String.fromCharCode(parseInt(k,10));break;case"d":case"i":k=parseInt(k,10);break;case"j":k=JSON.stringify(k,null,I.width?parseInt(I.width):0);break;case"e":k=I.precision?parseFloat(k).toExponential(I.precision):parseFloat(k).toExponential();break;case"f":k=I.precision?parseFloat(k).toFixed(I.precision):parseFloat(k);break;case"g":k=I.precision?String(Number(k.toPrecision(I.precision))):parseFloat(k);break;case"o":k=(parseInt(k,10)>>>0).toString(8);break;case"s":k=String(k),k=I.precision?k.substring(0,I.precision):k;break;case"t":k=String(!!k),k=I.precision?k.substring(0,I.precision):k;break;case"T":k=Object.prototype.toString.call(k).slice(8,-1).toLowerCase(),k=I.precision?k.substring(0,I.precision):k;break;case"u":k=parseInt(k,10)>>>0;break;case"v":k=k.valueOf(),k=I.precision?k.substring(0,I.precision):k;break;case"x":k=(parseInt(k,10)>>>0).toString(16);break;case"X":k=(parseInt(k,10)>>>0).toString(16).toUpperCase();break}o.json.test(I.type)?w+=k:(o.number.test(I.type)&&(!C||I.sign)?(T=C?"+":"-",k=k.toString().replace(o.sign,"")):T="",p=I.pad_char?I.pad_char==="0"?"0":I.pad_char.charAt(1):" ",g=I.width-(T+k).length,M=I.width&&g>0?p.repeat(g):"",w+=I.align?T+k+M:p==="0"?T+M+k:M+T+k)}return w}var m=Object.create(null);function b(x){if(m[x])return m[x];for(var _=x,A,f=[],k=0;_;){if((A=o.text.exec(_))!==null)f.push(A[0]);else if((A=o.modulo.exec(_))!==null)f.push("%");else if((A=o.placeholder.exec(_))!==null){if(A[2]){k|=1;var w=[],D=A[2],E=[];if((E=o.key.exec(D))!==null)for(w.push(E[1]);(D=D.substring(E[0].length))!=="";)if((E=o.key_access.exec(D))!==null)w.push(E[1]);else if((E=o.index_access.exec(D))!==null)w.push(E[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");A[2]=w}else k|=2;if(k===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");f.push({placeholder:A[0],param_no:A[1],keys:A[2],sign:A[3],pad_char:A[4],align:A[5],width:A[6],precision:A[7],type:A[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");_=_.substring(A[0].length)}return m[x]=f}n.sprintf=u,n.vsprintf=s,typeof window<"u"&&(window.sprintf=u,window.vsprintf=s,l=(function(){return{sprintf:u,vsprintf:s}}).call(n,a,n,i),l!==void 0&&(i.exports=l))})()},3390:function(i){i.exports=n;function n(a,l,o,u){var s=new Float32Array(4);return s[0]=a,s[1]=l,s[2]=o,s[3]=u,s}},3436:function(i,n,a){var l=a(3236),o=a(9405),u=l([`precision highp float; +`,C)}}return{long:f.trim(),short:k.trim()}}},3012:function(i,n,a){var l=a(5250),o=a(9362);i.exports=u;function u(s,h){var m=s.length;if(m===1){var b=l(s[0],h);return b[0]?b:[b[1]]}var x=new Array(2*m),_=[.1,.1],A=[.1,.1],f=0;l(s[0],h,_),_[0]&&(x[f++]=_[0]);for(var k=1;k0){T=b[U][g][0],B=U;break}N=T[B^1];for(var V=0;V<2;++V)for(var W=b[V][g],F=0;F0&&(T=H,N=q,B=V)}return C||T&&f(T,B),N}function w(p,g){var C=b[g][p][0],T=[p];f(C,g);for(var N=C[g^1],B=g;;){for(;N!==p;)T.push(N),N=k(T[T.length-2],N,!1);if(b[0][p].length+b[1][p].length===0)break;var U=T[T.length-1],V=p,W=T[1],F=k(U,V,!0);if(l(s[U],s[V],s[W],s[F])<0)break;T.push(p),N=k(U,V)}return T}function D(p,g){return g[1]===g[g.length-1]}for(var x=0;x0;){b[0][x].length;var M=w(x,E);D(I,M)?I.push.apply(I,M):(I.length>0&&A.push(I),I=M)}I.length>0&&A.push(I)}return A}},3090:function(i,n,a){i.exports=o;var l=a(3250)[3];function o(u){var s=u.length;if(s<3){for(var h=new Array(s),m=0;m1&&l(u[x[k-2]],u[x[k-1]],f)<=0;)k-=1,x.pop();for(x.push(A),k=_.length;k>1&&l(u[_[k-2]],u[_[k-1]],f)>=0;)k-=1,_.pop();_.push(A)}for(var h=new Array(_.length+x.length-2),w=0,m=0,D=x.length;m0;--E)h[w++]=_[E];return h}},3105:function(i,n){"use restrict";var a=32;n.INT_BITS=a,n.INT_MAX=2147483647,n.INT_MIN=-1<0)-(u<0)},n.abs=function(u){var s=u>>a-1;return(u^s)-s},n.min=function(u,s){return s^(u^s)&-(u65535)<<4,u>>>=s,h=(u>255)<<3,u>>>=h,s|=h,h=(u>15)<<2,u>>>=h,s|=h,h=(u>3)<<1,u>>>=h,s|=h,s|u>>1},n.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},n.popCount=function(u){return u=u-(u>>>1&1431655765),u=(u&858993459)+(u>>>2&858993459),(u+(u>>>4)&252645135)*16843009>>>24};function l(u){var s=32;return u&=-u,u&&s--,u&65535&&(s-=16),u&16711935&&(s-=8),u&252645135&&(s-=4),u&858993459&&(s-=2),u&1431655765&&(s-=1),s}n.countTrailingZeros=l,n.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u+1},n.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u-(u>>>1)},n.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,u&=15,27030>>>u&1};var o=new Array(256);(function(u){for(var s=0;s<256;++s){var h=s,m=s,b=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=h&1,--b;u[s]=m<>>8&255]<<16|o[u>>>16&255]<<8|o[u>>>24&255]},n.interleave2=function(u,s){return u&=65535,u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,u|s<<1},n.deinterleave2=function(u,s){return u=u>>>s&1431655765,u=(u|u>>>1)&858993459,u=(u|u>>>2)&252645135,u=(u|u>>>4)&16711935,u=(u|u>>>16)&65535,u<<16>>16},n.interleave3=function(u,s,h){return u&=1023,u=(u|u<<16)&4278190335,u=(u|u<<8)&251719695,u=(u|u<<4)&3272356035,u=(u|u<<2)&1227133513,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,u|=s<<1,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,u|h<<2},n.deinterleave3=function(u,s){return u=u>>>s&1227133513,u=(u|u>>>2)&3272356035,u=(u|u>>>4)&251719695,u=(u|u>>>8)&4278190335,u=(u|u>>>16)&1023,u<<22>>22},n.nextCombination=function(u){var s=u|u-1;return s+1|(~s&-~s)-1>>>l(u)+1}},3126:function(i){i.exports=n;function n(a){var l=new Float32Array(3);return l[0]=a[0],l[1]=a[1],l[2]=a[2],l}},3134:function(i,n,a){i.exports=o;var l=a(1682);function o(u,s){var h=u.length;if(typeof s!="number"){s=0;for(var m=0;m=0}function b(x,_,A,f){var k=l(_,A,f);if(k===0){var w=o(l(x,_,A)),D=o(l(x,_,f));if(w===D){if(w===0){var E=m(x,_,A),I=m(x,_,f);return E===I?0:E?1:-1}return 0}else{if(D===0)return w>0||m(x,_,f)?-1:1;if(w===0)return D>0||m(x,_,A)?1:-1}return o(D-w)}var M=l(x,_,A);if(M>0)return k>0&&l(x,_,f)>0?1:-1;if(M<0)return k>0||l(x,_,f)>0?1:-1;var p=l(x,_,f);return p>0||m(x,_,A)?1:-1}},3202:function(i){i.exports=function(n,a){a||(a=[0,""]),n=String(n);var l=parseFloat(n,10);return a[0]=l,a[1]=n.match(/[\d.\-\+]*\s*(.*)/)[1]||"",a}},3233:function(i){var n="",a;i.exports=l;function l(o,u){if(typeof o!="string")throw new TypeError("expected a string");if(u===1)return o;if(u===2)return o+o;var s=o.length*u;if(a!==o||typeof a>"u")a=o,n="";else if(n.length>=s)return n.substr(0,s);for(;s>n.length&&u>1;)u&1&&(n+=o),u>>=1,o+=o;return n+=o,n=n.substr(0,s),n}},3236:function(i){i.exports=function(n){typeof n=="string"&&(n=[n]);for(var a=[].slice.call(arguments,1),l=[],o=0;o0){if(B<=0)return U;V=N+B}else if(N<0){if(B>=0)return U;V=-(N+B)}else return U;var W=b*V;return U>=W||U<=-W?U:w(g,C,T)},function(g,C,T,N){var B=g[0]-N[0],U=C[0]-N[0],V=T[0]-N[0],W=g[1]-N[1],F=C[1]-N[1],H=T[1]-N[1],q=g[2]-N[2],G=C[2]-N[2],ee=T[2]-N[2],he=U*H,be=V*F,ve=V*W,ce=B*H,re=B*F,ge=U*W,ne=q*(he-be)+G*(ve-ce)+ee*(re-ge),se=(Math.abs(he)+Math.abs(be))*Math.abs(q)+(Math.abs(ve)+Math.abs(ce))*Math.abs(G)+(Math.abs(re)+Math.abs(ge))*Math.abs(ee),_e=x*se;return ne>_e||-ne>_e?ne:D(g,C,T,N)}];function I(g){var C=E[g.length];return C||(C=E[g.length]=k(g.length)),C.apply(void 0,g)}function M(g,C,T,N,B,U,V){return function(W,F,H,q,G){switch(arguments.length){case 0:case 1:return 0;case 2:return N(W,F);case 3:return B(W,F,H);case 4:return U(W,F,H,q);case 5:return V(W,F,H,q,G)}for(var ee=new Array(arguments.length),he=0;he4)throw new o("","Invalid data type");switch(q.charAt(0)){case"b":case"i":m["uniform"+G+"iv"](_[B],U);break;case"v":m["uniform"+G+"fv"](_[B],U);break;default:throw new o("","Unrecognized data type for vector "+name+": "+q)}}else if(q.indexOf("mat")===0&&q.length===4){if(G=q.charCodeAt(q.length-1)-48,G<2||G>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+q);m["uniformMatrix"+G+"fv"](_[B],!1,U);break}else throw new o("","Unknown uniform data type for "+name+": "+q)}}}}}function k(M,p){if(typeof p!="object")return[[M,p]];var g=[];for(var C in p){var T=p[C],N=M;parseInt(C)+""===C?N+="["+C+"]":N+="."+C,typeof T=="object"?g.push.apply(g,k(N,T)):g.push([N,T])}return g}function w(M){switch(M){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=M.indexOf("vec");if(0<=p&&p<=1&&M.length===4+p){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new o("","Invalid data type");return M.charAt(0)==="b"?s(g,!1):s(g,0)}else if(M.indexOf("mat")===0&&M.length===4){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+M);return s(g*g,0)}else throw new o("","Unknown uniform data type for "+name+": "+M)}}function D(M,p,g){if(typeof g=="object"){var C=E(g);Object.defineProperty(M,p,{get:u(C),set:f(g),enumerable:!0,configurable:!1})}else _[g]?Object.defineProperty(M,p,{get:A(g),set:f(g),enumerable:!0,configurable:!1}):M[p]=w(x[g].type)}function E(M){var p;if(Array.isArray(M)){p=new Array(M.length);for(var g=0;g=0!=p>=0&&_.push(w[0]+.5+.5*(M+p)/(M-p))}x+=I,++w[0]}}}function a(){return n()}var l=a;function o(h){var m={};return function(b,x,_){var A=b.dtype,f=b.order,k=[A,f.join()].join(),w=m[k];return w||(m[k]=w=h([A,f])),w(b.shape.slice(0),b.data,b.stride,b.offset|0,x,_)}}function u(h){return o(l.bind(void 0,h))}function s(h){return u({funcName:h.funcName})}i.exports=s({funcName:"zeroCrossings"})},3352:function(i,n,a){var l=a(2478),o=0,u=1,s=2;i.exports=C;function h(T,N,B,U,V){this.mid=T,this.left=N,this.right=B,this.leftPoints=U,this.rightPoints=V,this.count=(N?N.count:0)+(B?B.count:0)+U.length}var m=h.prototype;function b(T,N){T.mid=N.mid,T.left=N.left,T.right=N.right,T.leftPoints=N.leftPoints,T.rightPoints=N.rightPoints,T.count=N.count}function x(T,N){var B=M(N);T.mid=B.mid,T.left=B.left,T.right=B.right,T.leftPoints=B.leftPoints,T.rightPoints=B.rightPoints,T.count=B.count}function _(T,N){var B=T.intervals([]);B.push(N),x(T,B)}function A(T,N){var B=T.intervals([]),U=B.indexOf(N);return U<0?o:(B.splice(U,1),x(T,B),u)}m.intervals=function(T){return T.push.apply(T,this.leftPoints),this.left&&this.left.intervals(T),this.right&&this.right.intervals(T),T},m.insert=function(T){var N=this.count-this.leftPoints.length;if(this.count+=1,T[1]3*(N+1)?_(this,T):this.left.insert(T):this.left=M([T]);else if(T[0]>this.mid)this.right?4*(this.right.count+1)>3*(N+1)?_(this,T):this.right.insert(T):this.right=M([T]);else{var B=l.ge(this.leftPoints,T,E),U=l.ge(this.rightPoints,T,I);this.leftPoints.splice(B,0,T),this.rightPoints.splice(U,0,T)}},m.remove=function(T){var N=this.count-this.leftPoints;if(T[1]3*(N-1))return A(this,T);var U=this.left.remove(T);return U===s?(this.left=null,this.count-=1,u):(U===u&&(this.count-=1),U)}else if(T[0]>this.mid){if(!this.right)return o;var V=this.left?this.left.count:0;if(4*V>3*(N-1))return A(this,T);var U=this.right.remove(T);return U===s?(this.right=null,this.count-=1,u):(U===u&&(this.count-=1),U)}else{if(this.count===1)return this.leftPoints[0]===T?s:o;if(this.leftPoints.length===1&&this.leftPoints[0]===T){if(this.left&&this.right){for(var W=this,F=this.left;F.right;)W=F,F=F.right;if(W===this)F.right=this.right;else{var H=this.left,U=this.right;W.count-=F.count,W.right=F.left,F.left=H,F.right=U}b(this,F),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?b(this,this.left):b(this,this.right);return u}for(var H=l.ge(this.leftPoints,T,E);H=0&&T[U][1]>=N;--U){var V=B(T[U]);if(V)return V}}function w(T,N){for(var B=0;Bthis.mid){if(this.right){var B=this.right.queryPoint(T,N);if(B)return B}return k(this.rightPoints,T,N)}else return w(this.leftPoints,N)},m.queryInterval=function(T,N,B){if(Tthis.mid&&this.right){var U=this.right.queryInterval(T,N,B);if(U)return U}return Nthis.mid?k(this.rightPoints,T,B):w(this.leftPoints,B)};function D(T,N){return T-N}function E(T,N){var B=T[0]-N[0];return B||T[1]-N[1]}function I(T,N){var B=T[1]-N[1];return B||T[0]-N[0]}function M(T){if(T.length===0)return null;for(var N=[],B=0;B>1],V=[],W=[],F=[],B=0;B=0),I.type){case"b":k=parseInt(k,10).toString(2);break;case"c":k=String.fromCharCode(parseInt(k,10));break;case"d":case"i":k=parseInt(k,10);break;case"j":k=JSON.stringify(k,null,I.width?parseInt(I.width):0);break;case"e":k=I.precision?parseFloat(k).toExponential(I.precision):parseFloat(k).toExponential();break;case"f":k=I.precision?parseFloat(k).toFixed(I.precision):parseFloat(k);break;case"g":k=I.precision?String(Number(k.toPrecision(I.precision))):parseFloat(k);break;case"o":k=(parseInt(k,10)>>>0).toString(8);break;case"s":k=String(k),k=I.precision?k.substring(0,I.precision):k;break;case"t":k=String(!!k),k=I.precision?k.substring(0,I.precision):k;break;case"T":k=Object.prototype.toString.call(k).slice(8,-1).toLowerCase(),k=I.precision?k.substring(0,I.precision):k;break;case"u":k=parseInt(k,10)>>>0;break;case"v":k=k.valueOf(),k=I.precision?k.substring(0,I.precision):k;break;case"x":k=(parseInt(k,10)>>>0).toString(16);break;case"X":k=(parseInt(k,10)>>>0).toString(16).toUpperCase();break}o.json.test(I.type)?w+=k:(o.number.test(I.type)&&(!C||I.sign)?(T=C?"+":"-",k=k.toString().replace(o.sign,"")):T="",p=I.pad_char?I.pad_char==="0"?"0":I.pad_char.charAt(1):" ",g=I.width-(T+k).length,M=I.width&&g>0?p.repeat(g):"",w+=I.align?T+k+M:p==="0"?T+M+k:M+T+k)}return w}var m=Object.create(null);function b(x){if(m[x])return m[x];for(var _=x,A,f=[],k=0;_;){if((A=o.text.exec(_))!==null)f.push(A[0]);else if((A=o.modulo.exec(_))!==null)f.push("%");else if((A=o.placeholder.exec(_))!==null){if(A[2]){k|=1;var w=[],D=A[2],E=[];if((E=o.key.exec(D))!==null)for(w.push(E[1]);(D=D.substring(E[0].length))!=="";)if((E=o.key_access.exec(D))!==null)w.push(E[1]);else if((E=o.index_access.exec(D))!==null)w.push(E[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");A[2]=w}else k|=2;if(k===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");f.push({placeholder:A[0],param_no:A[1],keys:A[2],sign:A[3],pad_char:A[4],align:A[5],width:A[6],precision:A[7],type:A[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");_=_.substring(A[0].length)}return m[x]=f}n.sprintf=u,n.vsprintf=s,typeof window<"u"&&(window.sprintf=u,window.vsprintf=s,l=(function(){return{sprintf:u,vsprintf:s}}).call(n,a,n,i),l!==void 0&&(i.exports=l))})()},3390:function(i){i.exports=n;function n(a,l,o,u){var s=new Float32Array(4);return s[0]=a,s[1]=l,s[2]=o,s[3]=u,s}},3436:function(i,n,a){var l=a(3236),o=a(9405),u=l([`precision highp float; #define GLSLIFY 1 attribute vec3 position, offset; @@ -1690,11 +1690,11 @@ void main() { ) discard; gl_FragColor = opacity * fragColor; -}`]);i.exports=function(h){return o(h,u,s,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},3502:function(i,n,a){i.exports=u;var l=a(5995),o=a(9127);function u(s,h){return o(l(s,h))}},3508:function(i,n,a){var l=a(6852);l=l.slice().filter(function(o){return!/^(gl\_|texture)/.test(o)}),i.exports=l.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},3536:function(i){i.exports=n;function n(a,l){var o=l[0],u=l[1],s=l[2],h=o*o+u*u+s*s;return h>0&&(h=1/Math.sqrt(h),a[0]=l[0]*h,a[1]=l[1]*h,a[2]=l[2]*h),a}},3545:function(i,n,a){i.exports=h;var l=a(8105),o=l("lox&&A[M+b]>E;--I,M-=k){for(var p=M,g=M+k,C=0;C>>1,E=2*m,I=D,M=A[E*D+b];k=N?(I=T,M=N):C>=U?(I=g,M=C):(I=B,M=U):N>=U?(I=T,M=N):U>=C?(I=g,M=C):(I=B,M=U);for(var V=E*(w-1),W=E*I,F=0;Fthis.buffer.length){o.free(this.buffer);for(var w=this.buffer=o.mallocUint8(s(k*f*4)),D=0;DE|0},vertex:function(k,w,D,E,I,M,p,g,C,T,N,B,U){var V=(p<<0)+(g<<1)+(C<<2)+(T<<3)|0;if(!(V===0||V===15))switch(V){case 0:N.push([k-.5,w-.5]);break;case 1:N.push([k-.25-.25*(E+D-2*U)/(D-E),w-.25-.25*(I+D-2*U)/(D-I)]);break;case 2:N.push([k-.75-.25*(-E-D+2*U)/(E-D),w-.25-.25*(M+E-2*U)/(E-M)]);break;case 3:N.push([k-.5,w-.5-.5*(I+D+M+E-4*U)/(D-I+E-M)]);break;case 4:N.push([k-.25-.25*(M+I-2*U)/(I-M),w-.75-.25*(-I-D+2*U)/(I-D)]);break;case 5:N.push([k-.5-.5*(E+D+M+I-4*U)/(D-E+I-M),w-.5]);break;case 6:N.push([k-.5-.25*(-E-D+M+I)/(E-D+I-M),w-.5-.25*(-I-D+M+E)/(I-D+E-M)]);break;case 7:N.push([k-.75-.25*(M+I-2*U)/(I-M),w-.75-.25*(M+E-2*U)/(E-M)]);break;case 8:N.push([k-.75-.25*(-M-I+2*U)/(M-I),w-.75-.25*(-M-E+2*U)/(M-E)]);break;case 9:N.push([k-.5-.25*(E+D+-M-I)/(D-E+M-I),w-.5-.25*(I+D+-M-E)/(D-I+M-E)]);break;case 10:N.push([k-.5-.5*(-E-D+-M-I+4*U)/(E-D+M-I),w-.5]);break;case 11:N.push([k-.25-.25*(-M-I+2*U)/(M-I),w-.75-.25*(I+D-2*U)/(D-I)]);break;case 12:N.push([k-.5,w-.5-.5*(-I-D+-M-E+4*U)/(I-D+M-E)]);break;case 13:N.push([k-.75-.25*(E+D-2*U)/(D-E),w-.25-.25*(-M-E+2*U)/(M-E)]);break;case 14:N.push([k-.25-.25*(-E-D+2*U)/(E-D),w-.25-.25*(-I-D+2*U)/(I-D)]);break;case 15:N.push([k-.5,w-.5]);break}},cell:function(k,w,D,E,I,M,p,g,C){I?g.push([k,w]):g.push([w,k])}});return function(k,w){var D=[],E=[];return f(k,D,E,w),{positions:D,cells:E}}}};function s(x,_){var A=x.length+"d",f=u[A];if(f)return f(l,x,_)}function h(x,_){for(var A=o(x,_),f=A.length,k=new Array(f),w=new Array(f),D=0;D>1,A=-7,f=o?s-1:0,k=o?-1:1,w=a[l+f];for(f+=k,h=w&(1<<-A)-1,w>>=-A,A+=b;A>0;h=h*256+a[l+f],f+=k,A-=8);for(m=h&(1<<-A)-1,h>>=-A,A+=u;A>0;m=m*256+a[l+f],f+=k,A-=8);if(h===0)h=1-_;else{if(h===x)return m?NaN:(w?-1:1)*(1/0);m=m+Math.pow(2,u),h=h-_}return(w?-1:1)*m*Math.pow(2,h-u)},n.write=function(a,l,o,u,s,h){var m,b,x,_=h*8-s-1,A=(1<<_)-1,f=A>>1,k=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=u?0:h-1,D=u?1:-1,E=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(b=isNaN(l)?1:0,m=A):(m=Math.floor(Math.log(l)/Math.LN2),l*(x=Math.pow(2,-m))<1&&(m--,x*=2),m+f>=1?l+=k/x:l+=k*Math.pow(2,1-f),l*x>=2&&(m++,x/=2),m+f>=A?(b=0,m=A):m+f>=1?(b=(l*x-1)*Math.pow(2,s),m=m+f):(b=l*Math.pow(2,f-1)*Math.pow(2,s),m=0));s>=8;a[o+w]=b&255,w+=D,b/=256,s-=8);for(m=m<0;a[o+w]=m&255,w+=D,m/=256,_-=8);a[o+w-D]|=E*128}},3788:function(i,n,a){var l=a(8507),o=a(2419);i.exports=u;function u(s,h){return l(s,h)||o(s)-o(h)}},3837:function(i,n,a){i.exports=B;var l=a(4935),o=a(501),u=a(5304),s=a(6429),h=a(6444),m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),b=ArrayBuffer,x=DataView;function _(U){return b.isView(U)&&!(U instanceof x)}function A(U){return Array.isArray(U)||_(U)}function f(U,V){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U}function k(U){this.gl=U,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=u(U)}var w=k.prototype;w.update=function(U){U=U||{};function V(se,_e,oe){if(oe in U){var J=U[oe],me=this[oe],fe;(se?A(J)&&A(J[0]):A(J))?this[oe]=fe=[_e(J[0]),_e(J[1]),_e(J[2])]:this[oe]=fe=[_e(J),_e(J),_e(J)];for(var Ce=0;Ce<3;++Ce)if(fe[Ce]!==me[Ce])return!0}return!1}var W=V.bind(this,!1,Number),F=V.bind(this,!1,Boolean),$=V.bind(this,!1,String),q=V.bind(this,!0,function(se){if(A(se)){if(se.length===3)return[+se[0],+se[1],+se[2],1];if(se.length===4)return[+se[0],+se[1],+se[2],+se[3]]}return[0,0,0,1]}),G,ee=!1,he=!1;if("bounds"in U)for(var xe=U.bounds,ve=0;ve<2;++ve)for(var ce=0;ce<3;++ce)xe[ve][ce]!==this.bounds[ve][ce]&&(he=!0),this.bounds[ve][ce]=xe[ve][ce];if("ticks"in U){G=U.ticks,ee=!0,this.autoTicks=!1;for(var ve=0;ve<3;++ve)this.tickSpacing[ve]=0}else W("tickSpacing")&&(this.autoTicks=!0,he=!0);if(this._firstInit&&("ticks"in U||"tickSpacing"in U||(this.autoTicks=!0),he=!0,ee=!0,this._firstInit=!1),he&&this.autoTicks&&(G=h.create(this.bounds,this.tickSpacing),ee=!0),ee){for(var ve=0;ve<3;++ve)G[ve].sort(function(_e,oe){return _e.x-oe.x});h.equal(G,this.ticks)?ee=!1:this.ticks=G}F("tickEnable"),$("tickFont")&&(ee=!0),$("tickFontStyle")&&(ee=!0),$("tickFontWeight")&&(ee=!0),$("tickFontVariant")&&(ee=!0),W("tickSize"),W("tickAngle"),W("tickPad"),q("tickColor");var re=$("labels");$("labelFont")&&(re=!0),$("labelFontStyle")&&(re=!0),$("labelFontWeight")&&(re=!0),$("labelFontVariant")&&(re=!0),F("labelEnable"),W("labelSize"),W("labelPad"),q("labelColor"),F("lineEnable"),F("lineMirror"),W("lineWidth"),q("lineColor"),F("lineTickEnable"),F("lineTickMirror"),W("lineTickLength"),W("lineTickWidth"),q("lineTickColor"),F("gridEnable"),W("gridWidth"),q("gridColor"),F("zeroEnable"),q("zeroLineColor"),W("zeroLineWidth"),F("backgroundEnable"),q("backgroundColor");var ge=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ne=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(re||ee)&&this._text.update(this.bounds,this.labels,ge,this.ticks,ne):this._text=l(this.gl,this.bounds,this.labels,ge,this.ticks,ne),this._lines&&ee&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=o(this.gl,this.bounds,this.ticks))};function D(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var E=[new D,new D,new D];function I(U,V,W,F,$){for(var q=U.primalOffset,G=U.primalMinor,ee=U.mirrorOffset,he=U.mirrorMinor,xe=F[V],ve=0;ve<3;++ve)if(V!==ve){var ce=q,re=ee,ge=G,ne=he;xe&1<0?(ge[ve]=-1,ne[ve]=0):(ge[ve]=0,ne[ve]=1)}}var M=[0,0,0],p={model:m,view:m,projection:m,_ortho:!1};w.isOpaque=function(){return!0},w.isTransparent=function(){return!1},w.drawTransparent=function(U){};var g=0,C=[0,0,0],T=[0,0,0],N=[0,0,0];w.draw=function(U){U=U||p;for(var V=this.gl,W=U.model||m,F=U.view||m,$=U.projection||m,q=this.bounds,G=U._ortho||!1,ee=s(W,F,$,q,G),he=ee.cubeEdges,xe=ee.axis,ve=F[12],ce=F[13],re=F[14],ge=F[15],ne=G?2:1,se=ne*this.pixelRatio*($[3]*ve+$[7]*ce+$[11]*re+$[15]*ge)/V.drawingBufferHeight,_e=0;_e<3;++_e)this.lastCubeProps.cubeEdges[_e]=he[_e],this.lastCubeProps.axis[_e]=xe[_e];for(var oe=E,_e=0;_e<3;++_e)I(E[_e],_e,this.bounds,he,xe);for(var V=this.gl,J=M,_e=0;_e<3;++_e)this.backgroundEnable[_e]?J[_e]=xe[_e]:J[_e]=0;this._background.draw(W,F,$,q,J,this.backgroundColor),this._lines.bind(W,F,$,this);for(var _e=0;_e<3;++_e){var me=[0,0,0];xe[_e]>0?me[_e]=q[1][_e]:me[_e]=q[0][_e];for(var fe=0;fe<2;++fe){var Ce=(_e+1+fe)%3,Be=(_e+1+(fe^1))%3;this.gridEnable[Ce]&&this._lines.drawGrid(Ce,Be,this.bounds,me,this.gridColor[Ce],this.gridWidth[Ce]*this.pixelRatio)}for(var fe=0;fe<2;++fe){var Ce=(_e+1+fe)%3,Be=(_e+1+(fe^1))%3;this.zeroEnable[Be]&&Math.min(q[0][Be],q[1][Be])<=0&&Math.max(q[0][Be],q[1][Be])>=0&&this._lines.drawZero(Ce,Be,this.bounds,me,this.zeroLineColor[Be],this.zeroLineWidth[Be]*this.pixelRatio)}}for(var _e=0;_e<3;++_e){this.lineEnable[_e]&&this._lines.drawAxisLine(_e,this.bounds,oe[_e].primalOffset,this.lineColor[_e],this.lineWidth[_e]*this.pixelRatio),this.lineMirror[_e]&&this._lines.drawAxisLine(_e,this.bounds,oe[_e].mirrorOffset,this.lineColor[_e],this.lineWidth[_e]*this.pixelRatio);for(var Oe=f(C,oe[_e].primalMinor),Ze=f(T,oe[_e].mirrorMinor),Ge=this.lineTickLength,fe=0;fe<3;++fe){var rt=se/W[5*fe];Oe[fe]*=Ge[fe]*rt,Ze[fe]*=Ge[fe]*rt}this.lineTickEnable[_e]&&this._lines.drawAxisTicks(_e,oe[_e].primalOffset,Oe,this.lineTickColor[_e],this.lineTickWidth[_e]*this.pixelRatio),this.lineTickMirror[_e]&&this._lines.drawAxisTicks(_e,oe[_e].mirrorOffset,Ze,this.lineTickColor[_e],this.lineTickWidth[_e]*this.pixelRatio)}this._lines.unbind(),this._text.bind(W,F,$,this.pixelRatio);var _t,pt=.5,gt,ct;function Ae(Et){ct=[0,0,0],ct[Et]=1}function ze(Et,Gt,Jt){var gr=(Et+1)%3,mr=(Et+2)%3,Kr=Gt[gr],ri=Gt[mr],Mr=Jt[gr],ui=Jt[mr];if(Kr>0&&ui>0){Ae(gr);return}else if(Kr>0&&ui<0){Ae(gr);return}else if(Kr<0&&ui>0){Ae(gr);return}else if(Kr<0&&ui<0){Ae(gr);return}else if(ri>0&&Mr>0){Ae(mr);return}else if(ri>0&&Mr<0){Ae(mr);return}else if(ri<0&&Mr>0){Ae(mr);return}else if(ri<0&&Mr<0){Ae(mr);return}}for(var _e=0;_e<3;++_e){for(var Ee=oe[_e].primalMinor,nt=oe[_e].mirrorMinor,xt=f(N,oe[_e].primalOffset),fe=0;fe<3;++fe)this.lineTickEnable[_e]&&(xt[fe]+=se*Ee[fe]*Math.max(this.lineTickLength[fe],0)/W[5*fe]);var ut=[0,0,0];if(ut[_e]=1,this.tickEnable[_e]){this.tickAngle[_e]===-3600?(this.tickAngle[_e]=0,this.tickAlign[_e]="auto"):this.tickAlign[_e]=-1,gt=1,_t=[this.tickAlign[_e],pt,gt],_t[0]==="auto"?_t[0]=g:_t[0]=parseInt(""+_t[0]),ct=[0,0,0],ze(_e,Ee,nt);for(var fe=0;fe<3;++fe)xt[fe]+=se*Ee[fe]*this.tickPad[fe]/W[5*fe];this._text.drawTicks(_e,this.tickSize[_e],this.tickAngle[_e],xt,this.tickColor[_e],ut,ct,_t)}if(this.labelEnable[_e]){gt=0,ct=[0,0,0],this.labels[_e].length>4&&(Ae(_e),gt=1),_t=[this.labelAlign[_e],pt,gt],_t[0]==="auto"?_t[0]=g:_t[0]=parseInt(""+_t[0]);for(var fe=0;fe<3;++fe)xt[fe]+=se*Ee[fe]*this.labelPad[fe]/W[5*fe];xt[_e]+=.5*(q[0][_e]+q[1][_e]),this._text.drawLabel(_e,this.labelSize[_e],this.labelAngle[_e],xt,this.labelColor[_e],[0,0,0],ct,_t)}}this._text.unbind()},w.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function B(U,V){var W=new k(U);return W.update(V),W}},3840:function(i){i.exports=E;var n=0,a=1;function l(I,M,p,g,C,T){this._color=I,this.key=M,this.value=p,this.left=g,this.right=C,this._count=T}function o(I){return new l(I._color,I.key,I.value,I.left,I.right,I._count)}function u(I,M){return new l(I,M.key,M.value,M.left,M.right,M._count)}function s(I){I._count=1+(I.left?I.left._count:0)+(I.right?I.right._count:0)}function h(I,M){this._compare=I,this.root=M}var m=h.prototype;Object.defineProperty(m,"keys",{get:function(){var I=[];return this.forEach(function(M,p){I.push(M)}),I}}),Object.defineProperty(m,"values",{get:function(){var I=[];return this.forEach(function(M,p){I.push(p)}),I}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(I,M){for(var p=this._compare,g=this.root,C=[],T=[];g;){var N=p(I,g.key);C.push(g),T.push(N),N<=0?g=g.left:g=g.right}C.push(new l(n,I,M,null,null,1));for(var B=C.length-2;B>=0;--B){var g=C[B];T[B]<=0?C[B]=new l(g._color,g.key,g.value,C[B+1],g.right,g._count+1):C[B]=new l(g._color,g.key,g.value,g.left,C[B+1],g._count+1)}for(var B=C.length-1;B>1;--B){var U=C[B-1],g=C[B];if(U._color===a||g._color===a)break;var V=C[B-2];if(V.left===U)if(U.left===g){var W=V.right;if(W&&W._color===n)U._color=a,V.right=u(a,W),V._color=n,B-=1;else{if(V._color=n,V.left=U.right,U._color=a,U.right=V,C[B-2]=U,C[B-1]=g,s(V),s(U),B>=3){var F=C[B-3];F.left===V?F.left=U:F.right=U}break}}else{var W=V.right;if(W&&W._color===n)U._color=a,V.right=u(a,W),V._color=n,B-=1;else{if(U.right=g.left,V._color=n,V.left=g.right,g._color=a,g.left=U,g.right=V,C[B-2]=g,C[B-1]=U,s(V),s(U),s(g),B>=3){var F=C[B-3];F.left===V?F.left=g:F.right=g}break}}else if(U.right===g){var W=V.left;if(W&&W._color===n)U._color=a,V.left=u(a,W),V._color=n,B-=1;else{if(V._color=n,V.right=U.left,U._color=a,U.left=V,C[B-2]=U,C[B-1]=g,s(V),s(U),B>=3){var F=C[B-3];F.right===V?F.right=U:F.left=U}break}}else{var W=V.left;if(W&&W._color===n)U._color=a,V.left=u(a,W),V._color=n,B-=1;else{if(U.left=g.right,V._color=n,V.right=g.left,g._color=a,g.right=U,g.left=V,C[B-2]=g,C[B-1]=U,s(V),s(U),s(g),B>=3){var F=C[B-3];F.right===V?F.right=g:F.left=g}break}}}return C[0]._color=a,new h(p,C[0])};function b(I,M){if(M.left){var p=b(I,M.left);if(p)return p}var p=I(M.key,M.value);if(p)return p;if(M.right)return b(I,M.right)}function x(I,M,p,g){var C=M(I,g.key);if(C<=0){if(g.left){var T=x(I,M,p,g.left);if(T)return T}var T=p(g.key,g.value);if(T)return T}if(g.right)return x(I,M,p,g.right)}function _(I,M,p,g,C){var T=p(I,C.key),N=p(M,C.key),B;if(T<=0&&(C.left&&(B=_(I,M,p,g,C.left),B)||N>0&&(B=g(C.key,C.value),B)))return B;if(N>0&&C.right)return _(I,M,p,g,C.right)}m.forEach=function(I,M,p){if(this.root)switch(arguments.length){case 1:return b(I,this.root);case 2:return x(M,this._compare,I,this.root);case 3:return this._compare(M,p)>=0?void 0:_(M,p,this._compare,I,this.root)}},Object.defineProperty(m,"begin",{get:function(){for(var I=[],M=this.root;M;)I.push(M),M=M.left;return new A(this,I)}}),Object.defineProperty(m,"end",{get:function(){for(var I=[],M=this.root;M;)I.push(M),M=M.right;return new A(this,I)}}),m.at=function(I){if(I<0)return new A(this,[]);for(var M=this.root,p=[];;){if(p.push(M),M.left){if(I=M.right._count)break;M=M.right}else break}return new A(this,[])},m.ge=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T<=0&&(C=g.length),T<=0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.gt=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T<0&&(C=g.length),T<0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.lt=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T>0&&(C=g.length),T<=0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.le=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T>=0&&(C=g.length),T<0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.find=function(I){for(var M=this._compare,p=this.root,g=[];p;){var C=M(I,p.key);if(g.push(p),C===0)return new A(this,g);C<=0?p=p.left:p=p.right}return new A(this,[])},m.remove=function(I){var M=this.find(I);return M?M.remove():this},m.get=function(I){for(var M=this._compare,p=this.root;p;){var g=M(I,p.key);if(g===0)return p.value;g<=0?p=p.left:p=p.right}};function A(I,M){this.tree=I,this._stack=M}var f=A.prototype;Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new A(this.tree,this._stack.slice())};function k(I,M){I.key=M.key,I.value=M.value,I.left=M.left,I.right=M.right,I._color=M._color,I._count=M._count}function w(I){for(var M,p,g,C,T=I.length-1;T>=0;--T){if(M=I[T],T===0){M._color=a;return}if(p=I[T-1],p.left===M){if(g=p.right,g.right&&g.right._color===n){if(g=p.right=o(g),C=g.right=o(g.right),p.right=g.left,g.left=p,g.right=C,g._color=p._color,M._color=a,p._color=a,C._color=a,s(p),s(g),T>1){var N=I[T-2];N.left===p?N.left=g:N.right=g}I[T-1]=g;return}else if(g.left&&g.left._color===n){if(g=p.right=o(g),C=g.left=o(g.left),p.right=C.left,g.left=C.right,C.left=p,C.right=g,C._color=p._color,p._color=a,g._color=a,M._color=a,s(p),s(g),s(C),T>1){var N=I[T-2];N.left===p?N.left=C:N.right=C}I[T-1]=C;return}if(g._color===a)if(p._color===n){p._color=a,p.right=u(n,g);return}else{p.right=u(n,g);continue}else{if(g=o(g),p.right=g.left,g.left=p,g._color=p._color,p._color=n,s(p),s(g),T>1){var N=I[T-2];N.left===p?N.left=g:N.right=g}I[T-1]=g,I[T]=p,T+11){var N=I[T-2];N.right===p?N.right=g:N.left=g}I[T-1]=g;return}else if(g.right&&g.right._color===n){if(g=p.left=o(g),C=g.right=o(g.right),p.left=C.right,g.right=C.left,C.right=p,C.left=g,C._color=p._color,p._color=a,g._color=a,M._color=a,s(p),s(g),s(C),T>1){var N=I[T-2];N.right===p?N.right=C:N.left=C}I[T-1]=C;return}if(g._color===a)if(p._color===n){p._color=a,p.left=u(n,g);return}else{p.left=u(n,g);continue}else{if(g=o(g),p.left=g.right,g.right=p,g._color=p._color,p._color=n,s(p),s(g),T>1){var N=I[T-2];N.right===p?N.right=g:N.left=g}I[T-1]=g,I[T]=p,T+1=0;--g){var p=I[g];p.left===I[g+1]?M[g]=new l(p._color,p.key,p.value,M[g+1],p.right,p._count):M[g]=new l(p._color,p.key,p.value,p.left,M[g+1],p._count)}if(p=M[M.length-1],p.left&&p.right){var C=M.length;for(p=p.left;p.right;)M.push(p),p=p.right;var T=M[C-1];M.push(new l(p._color,T.key,T.value,p.left,p.right,p._count)),M[C-1].key=p.key,M[C-1].value=p.value;for(var g=M.length-2;g>=C;--g)p=M[g],M[g]=new l(p._color,p.key,p.value,p.left,M[g+1],p._count);M[C-1].left=M[C]}if(p=M[M.length-1],p._color===n){var N=M[M.length-2];N.left===p?N.left=null:N.right===p&&(N.right=null),M.pop();for(var g=0;g0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var I=0,M=this._stack;if(M.length===0){var p=this.tree.root;return p?p._count:0}else M[M.length-1].left&&(I=M[M.length-1].left._count);for(var g=M.length-2;g>=0;--g)M[g+1]===M[g].right&&(++I,M[g].left&&(I+=M[g].left._count));return I},enumerable:!0}),f.next=function(){var I=this._stack;if(I.length!==0){var M=I[I.length-1];if(M.right)for(M=M.right;M;)I.push(M),M=M.left;else for(I.pop();I.length>0&&I[I.length-1].right===M;)M=I[I.length-1],I.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var I=this._stack;if(I.length===0)return!1;if(I[I.length-1].right)return!0;for(var M=I.length-1;M>0;--M)if(I[M-1].left===I[M])return!0;return!1}}),f.update=function(I){var M=this._stack;if(M.length===0)throw new Error("Can't update empty node!");var p=new Array(M.length),g=M[M.length-1];p[p.length-1]=new l(g._color,g.key,I,g.left,g.right,g._count);for(var C=M.length-2;C>=0;--C)g=M[C],g.left===M[C+1]?p[C]=new l(g._color,g.key,g.value,p[C+1],g.right,g._count):p[C]=new l(g._color,g.key,g.value,g.left,p[C+1],g._count);return new h(this.tree._compare,p[0])},f.prev=function(){var I=this._stack;if(I.length!==0){var M=I[I.length-1];if(M.left)for(M=M.left;M;)I.push(M),M=M.right;else for(I.pop();I.length>0&&I[I.length-1].left===M;)M=I[I.length-1],I.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var I=this._stack;if(I.length===0)return!1;if(I[I.length-1].left)return!0;for(var M=I.length-1;M>0;--M)if(I[M-1].right===I[M])return!0;return!1}});function D(I,M){return IM?1:0}function E(I){return new h(I||D,null)}},3865:function(i,n,a){var l=a(869);i.exports=o;function o(u,s){return l(u[0].mul(s[1]).add(s[0].mul(u[1])),u[1].mul(s[1]))}},3952:function(i,n,a){i.exports=u;var l=a(3250);function o(s,h){for(var m=new Array(h+1),b=0;b20?52:m+32}},4040:function(i){i.exports=n;function n(a,l,o,u,s,h,m){var b=1/(l-o),x=1/(u-s),_=1/(h-m);return a[0]=-2*b,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*x,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*_,a[11]=0,a[12]=(l+o)*b,a[13]=(s+u)*x,a[14]=(m+h)*_,a[15]=1,a}},4041:function(i){i.exports=n;function n(a,l,o){var u=l[0],s=l[1],h=l[2],m=o[0],b=o[1],x=o[2],_=o[3],A=_*u+b*h-x*s,f=_*s+x*u-m*h,k=_*h+m*s-b*u,w=-m*u-b*s-x*h;return a[0]=A*_+w*-m+f*-x-k*-b,a[1]=f*_+w*-b+k*-m-A*-x,a[2]=k*_+w*-x+A*-b-f*-m,a[3]=l[3],a}},4081:function(i){i.exports=n;function n(a,l,o,u,s,h,m,b,x,_){var A=l+h+_;if(f>0){var f=Math.sqrt(A+1);a[0]=.5*(m-x)/f,a[1]=.5*(b-u)/f,a[2]=.5*(o-h)/f,a[3]=.5*f}else{var k=Math.max(l,h,_),f=Math.sqrt(2*k-A+1);l>=k?(a[0]=.5*f,a[1]=.5*(s+o)/f,a[2]=.5*(b+u)/f,a[3]=.5*(m-x)/f):h>=k?(a[0]=.5*(o+s)/f,a[1]=.5*f,a[2]=.5*(x+m)/f,a[3]=.5*(b-u)/f):(a[0]=.5*(u+b)/f,a[1]=.5*(m+x)/f,a[2]=.5*f,a[3]=.5*(o-s)/f)}return a}},4100:function(i,n,a){var l=a(4437),o=a(3837),u=a(5445),s=a(4449),h=a(3589),m=a(2260),b=a(7169),x=a(351),_=a(4772),A=a(4040),f=a(799),k=a(9216)({tablet:!0,featureDetect:!0});i.exports={createScene:M,createCamera:l};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function D(g,C){var T=null;try{T=g.getContext("webgl",C),T||(T=g.getContext("experimental-webgl",C))}catch{return null}return T}function E(g){var C=Math.round(Math.log(Math.abs(g))/Math.log(10));if(C<0){var T=Math.round(Math.pow(10,-C));return Math.ceil(g*T)/T}else if(C>0){var T=Math.round(Math.pow(10,C));return Math.ceil(g/T)*T}return Math.ceil(g)}function I(g){return typeof g=="boolean"?g:!0}function M(g){g=g||{},g.camera=g.camera||{};var C=g.canvas;if(!C)if(C=document.createElement("canvas"),g.container){var T=g.container;T.appendChild(C)}else document.body.appendChild(C);var N=g.gl;if(N||(g.glOptions&&(k=!!g.glOptions.preserveDrawingBuffer),N=D(C,g.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:k})),!N)throw new Error("webgl not supported");var B=g.bounds||[[-10,-10,-10],[10,10,10]],U=new w,V=m(N,N.drawingBufferWidth,N.drawingBufferHeight,{preferFloat:!k}),W=f(N),F=g.cameraObject&&g.cameraObject._ortho===!0||g.camera.projection&&g.camera.projection.type==="orthographic"||!1,$={eye:g.camera.eye||[2,0,0],center:g.camera.center||[0,0,0],up:g.camera.up||[0,1,0],zoomMin:g.camera.zoomMax||.1,zoomMax:g.camera.zoomMin||100,mode:g.camera.mode||"turntable",_ortho:F},q=g.axes||{},G=o(N,q);G.enable=!q.disable;var ee=g.spikes||{},he=s(N,ee),xe=[],ve=[],ce=[],re=[],ge=!0,oe=!0,ne=new Array(16),se=new Array(16),_e={view:null,projection:ne,model:se,_ortho:!1},oe=!0,J=[N.drawingBufferWidth,N.drawingBufferHeight],me=g.cameraObject||l(C,$),fe={gl:N,contextLost:!1,pixelRatio:g.pixelRatio||1,canvas:C,selection:U,camera:me,axes:G,axesPixels:null,spikes:he,bounds:B,objects:xe,shape:J,aspect:g.aspectRatio||[1,1,1],pickRadius:g.pickRadius||10,zNear:g.zNear||.01,zFar:g.zFar||1e3,fovy:g.fovy||Math.PI/4,clearColor:g.clearColor||[0,0,0,0],autoResize:I(g.autoResize),autoBounds:I(g.autoBounds),autoScale:!!g.autoScale,autoCenter:I(g.autoCenter),clipToBounds:I(g.clipToBounds),snapToData:!!g.snapToData,onselect:g.onselect||null,onrender:g.onrender||null,onclick:g.onclick||null,cameraParams:_e,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ct){this.aspect[0]=ct.x,this.aspect[1]=ct.y,this.aspect[2]=ct.z,oe=!0},setBounds:function(ct,Ae){this.bounds[0][ct]=Ae.min,this.bounds[1][ct]=Ae.max},setClearColor:function(ct){this.clearColor=ct},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},Ce=[N.drawingBufferWidth/fe.pixelRatio|0,N.drawingBufferHeight/fe.pixelRatio|0];function Be(){if(!fe._stopped&&fe.autoResize){var ct=C.parentNode,Ae=1,ze=1;ct&&ct!==document.body?(Ae=ct.clientWidth,ze=ct.clientHeight):(Ae=window.innerWidth,ze=window.innerHeight);var Ee=Math.ceil(Ae*fe.pixelRatio)|0,nt=Math.ceil(ze*fe.pixelRatio)|0;if(Ee!==C.width||nt!==C.height){C.width=Ee,C.height=nt;var xt=C.style;xt.position=xt.position||"absolute",xt.left="0px",xt.top="0px",xt.width=Ae+"px",xt.height=ze+"px",ge=!0}}}fe.autoResize&&Be(),window.addEventListener("resize",Be);function Oe(){for(var ct=xe.length,Ae=re.length,ze=0;ze0&&ce[Ae-1]===0;)ce.pop(),re.pop().dispose()}fe.update=function(ct){fe._stopped||(ge=!0,oe=!0)},fe.add=function(ct){fe._stopped||(ct.axes=G,xe.push(ct),ve.push(-1),ge=!0,oe=!0,Oe())},fe.remove=function(ct){if(!fe._stopped){var Ae=xe.indexOf(ct);Ae<0||(xe.splice(Ae,1),ve.pop(),ge=!0,oe=!0,Oe())}},fe.dispose=function(){if(!fe._stopped&&(fe._stopped=!0,window.removeEventListener("resize",Be),C.removeEventListener("webglcontextlost",Ze),fe.mouseListener.enabled=!1,!fe.contextLost)){G.dispose(),he.dispose();for(var ct=0;ctU.distance)continue;for(var Jt=0;Jt_;){var p=f[M-2],g=f[M-1];if(pf[A+1]:!0}function b(_,A,f,k){_*=2;var w=k[_];return w>1,I=E-k,M=E+k,p=w,g=I,C=E,T=M,N=D,B=_+1,U=A-1,V=0;m(p,g,f)&&(V=p,p=g,g=V),m(T,N,f)&&(V=T,T=N,N=V),m(p,C,f)&&(V=p,p=C,C=V),m(g,C,f)&&(V=g,g=C,C=V),m(p,T,f)&&(V=p,p=T,T=V),m(C,T,f)&&(V=C,C=T,T=V),m(g,N,f)&&(V=g,g=N,N=V),m(g,C,f)&&(V=g,g=C,C=V),m(T,N,f)&&(V=T,T=N,N=V);for(var W=f[2*g],F=f[2*g+1],$=f[2*T],q=f[2*T+1],G=2*p,ee=2*C,he=2*N,xe=2*w,ve=2*E,ce=2*D,re=0;re<2;++re){var ge=f[G+re],ne=f[ee+re],se=f[he+re];f[xe+re]=ge,f[ve+re]=ne,f[ce+re]=se}u(I,_,f),u(M,A,f);for(var _e=B;_e<=U;++_e)if(b(_e,W,F,f))_e!==B&&o(_e,B,f),++B;else if(!b(_e,$,q,f))for(;;)if(b(U,$,q,f)){b(U,W,F,f)?(s(_e,B,U,f),++B,--U):(o(_e,U,f),--U);break}else{if(--U<_e)break;continue}h(_,B-1,W,F,f),h(A,U+1,$,q,f),B-2-_<=n?l(_,B-2,f):x(_,B-2,f),A-(U+2)<=n?l(U+2,A,f):x(U+2,A,f),U-B<=n?l(B,U,f):x(B,U,f)}},4209:function(i,n,a){i.exports=f;var l=a(2478),o=a(3840),u=a(3250),s=a(1303);function h(k,w,D){this.slabs=k,this.coordinates=w,this.horizontal=D}var m=h.prototype;function b(k,w){return k.y-w}function x(k,w){for(var D=null;k;){var E=k.key,I,M;E[0][0]0)if(w[0]!==E[1][0])D=k,k=k.right;else{var g=x(k.right,w);if(g)return g;k=k.left}else{if(w[0]!==E[1][0])return k;var g=x(k.right,w);if(g)return g;k=k.left}}return D}m.castUp=function(k){var w=l.le(this.coordinates,k[0]);if(w<0)return-1;this.slabs[w];var D=x(this.slabs[w],k),E=-1;if(D&&(E=D.value),this.coordinates[w]===k[0]){var I=null;if(D&&(I=D.key),w>0){var M=x(this.slabs[w-1],k);M&&(I?s(M.key,I)>0&&(I=M.key,E=M.value):(E=M.value,I=M.key))}var p=this.horizontal[w];if(p.length>0){var g=l.ge(p,k[1],b);if(g=p.length)return E;C=p[g]}}if(C.start)if(I){var T=u(I[0],I[1],[k[0],C.y]);I[0][0]>I[1][0]&&(T=-T),T>0&&(E=C.index)}else E=C.index;else C.y!==k[1]&&(E=C.index)}}}return E};function _(k,w,D,E){this.y=k,this.index=w,this.start=D,this.closed=E}function A(k,w,D,E){this.x=k,this.segment=w,this.create=D,this.index=E}function f(k){for(var w=k.length,D=2*w,E=new Array(D),I=0;IMath.abs(g))f.rotate(N,0,0,-p*C*Math.PI*I.rotateSpeed/window.innerWidth);else if(!I._ortho){var B=-I.zoomSpeed*T*g/window.innerHeight*(N-f.lastT())/20;f.pan(N,0,0,w*(Math.exp(B)-1))}}},!0)},I.enableMouseListeners(),I}},4449:function(i,n,a){var l=a(2762),o=a(8116),u=a(1493);i.exports=A;var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(f,k,w,D){this.gl=f,this.buffer=k,this.vao=w,this.shader=D,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var m=h.prototype,b=[0,0,0],x=[0,0,0],_=[0,0];m.isTransparent=function(){return!1},m.drawTransparent=function(f){},m.draw=function(f){var k=this.gl,w=this.vao,D=this.shader;w.bind(),D.bind();var E=f.model||s,I=f.view||s,M=f.projection||s,p;this.axes&&(p=this.axes.lastCubeProps.axis);for(var g=b,C=x,T=0;T<3;++T)p&&p[T]<0?(g[T]=this.bounds[0][T],C[T]=this.bounds[1][T]):(g[T]=this.bounds[1][T],C[T]=this.bounds[0][T]);_[0]=k.drawingBufferWidth,_[1]=k.drawingBufferHeight,D.uniforms.model=E,D.uniforms.view=I,D.uniforms.projection=M,D.uniforms.coordinates=[this.position,g,C],D.uniforms.colors=this.colors,D.uniforms.screenShape=_;for(var T=0;T<3;++T)D.uniforms.lineWidth=this.lineWidth[T]*this.pixelRatio,this.enabled[T]&&(w.draw(k.TRIANGLES,6,6*T),this.drawSides[T]&&w.draw(k.TRIANGLES,12,18+12*T));w.unbind()},m.update=function(f){f&&("bounds"in f&&(this.bounds=f.bounds),"position"in f&&(this.position=f.position),"lineWidth"in f&&(this.lineWidth=f.lineWidth),"colors"in f&&(this.colors=f.colors),"enabled"in f&&(this.enabled=f.enabled),"drawSides"in f&&(this.drawSides=f.drawSides))},m.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function A(f,k){var w=[];function D(g,C,T,N,B,U){var V=[g,C,T,0,0,0,1];V[N+3]=1,V[N]=B,w.push.apply(w,V),V[6]=-1,w.push.apply(w,V),V[N]=U,w.push.apply(w,V),w.push.apply(w,V),V[6]=1,w.push.apply(w,V),V[N]=B,w.push.apply(w,V)}D(0,0,0,0,0,1),D(0,0,0,1,0,1),D(0,0,0,2,0,1),D(1,0,0,1,-1,1),D(1,0,0,2,-1,1),D(0,1,0,0,-1,1),D(0,1,0,2,-1,1),D(0,0,1,0,-1,1),D(0,0,1,1,-1,1);var E=l(f,w),I=o(f,[{type:f.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:f.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:f.FLOAT,buffer:E,size:1,offset:24,stride:28}]),M=u(f);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.weight.location=2;var p=new h(f,E,I,M);return p.update(k),p}},4494:function(i){i.exports=n;function n(a,l){return a[0]=1/l[0],a[1]=1/l[1],a[2]=1/l[2],a[3]=1/l[3],a}},4505:function(i,n,a){i.exports=a(5847)},4578:function(i){i.exports=n;function n(a,l,o,u,s){return a[0]=l,a[1]=o,a[2]=u,a[3]=s,a}},4623:function(i){"use restrict";i.exports=n;function n(a){this.roots=new Array(a),this.ranks=new Array(a);for(var l=0;l0)return 1<=0)return 1<=0;--f)m[f]=b*l[f]+x*o[f]+_*u[f]+A*s[f];return m}return b*l+x*o+_*u[f]+A*s}function a(l,o,u,s,h,m){var b=h-1,x=h*h,_=b*b,A=(1+2*h)*_,f=h*_,k=x*(3-2*h),w=x*b;if(l.length){m||(m=new Array(l.length));for(var D=l.length-1;D>=0;--D)m[D]=A*l[D]+f*o[D]+k*u[D]+w*s[D];return m}return A*l+f*o+k*u+w*s}i.exports=a,i.exports.derivative=n},4772:function(i){i.exports=n;function n(a,l,o,u,s){var h=1/Math.tan(l/2),m=1/(u-s);return a[0]=h/o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(s+u)*m,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*s*u*m,a[15]=0,a}},4793:function(i,n,a){function l(ye,Pe){if(!(ye instanceof Pe))throw new TypeError("Cannot call a class as a function")}function o(ye,Pe){for(var He=0;HeM)throw new RangeError('The value "'+ye+'" is invalid for option "size"');var Pe=new Uint8Array(ye);return Object.setPrototypeOf(Pe,C.prototype),Pe}function C(ye,Pe,He){if(typeof ye=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return U(ye)}return T(ye,Pe,He)}C.poolSize=8192;function T(ye,Pe,He){if(typeof ye=="string")return V(ye,Pe);if(ArrayBuffer.isView(ye))return F(ye);if(ye==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+w(ye));if(mi(ye,ArrayBuffer)||ye&&mi(ye.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(mi(ye,SharedArrayBuffer)||ye&&mi(ye.buffer,SharedArrayBuffer)))return $(ye,Pe,He);if(typeof ye=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=ye.valueOf&&ye.valueOf();if(at!=null&&at!==ye)return C.from(at,Pe,He);var ht=q(ye);if(ht)return ht;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ye[Symbol.toPrimitive]=="function")return C.from(ye[Symbol.toPrimitive]("string"),Pe,He);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+w(ye))}C.from=function(ye,Pe,He){return T(ye,Pe,He)},Object.setPrototypeOf(C.prototype,Uint8Array.prototype),Object.setPrototypeOf(C,Uint8Array);function N(ye){if(typeof ye!="number")throw new TypeError('"size" argument must be of type number');if(ye<0)throw new RangeError('The value "'+ye+'" is invalid for option "size"')}function B(ye,Pe,He){return N(ye),ye<=0?g(ye):Pe!==void 0?typeof He=="string"?g(ye).fill(Pe,He):g(ye).fill(Pe):g(ye)}C.alloc=function(ye,Pe,He){return B(ye,Pe,He)};function U(ye){return N(ye),g(ye<0?0:G(ye)|0)}C.allocUnsafe=function(ye){return U(ye)},C.allocUnsafeSlow=function(ye){return U(ye)};function V(ye,Pe){if((typeof Pe!="string"||Pe==="")&&(Pe="utf8"),!C.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);var He=ee(ye,Pe)|0,at=g(He),ht=at.write(ye,Pe);return ht!==He&&(at=at.slice(0,ht)),at}function W(ye){for(var Pe=ye.length<0?0:G(ye.length)|0,He=g(Pe),at=0;at=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return ye|0}C.isBuffer=function(ye){return ye!=null&&ye._isBuffer===!0&&ye!==C.prototype},C.compare=function(ye,Pe){if(mi(ye,Uint8Array)&&(ye=C.from(ye,ye.offset,ye.byteLength)),mi(Pe,Uint8Array)&&(Pe=C.from(Pe,Pe.offset,Pe.byteLength)),!C.isBuffer(ye)||!C.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ye===Pe)return 0;for(var He=ye.length,at=Pe.length,ht=0,At=Math.min(He,at);htat.length?(C.isBuffer(At)||(At=C.from(At)),At.copy(at,ht)):Uint8Array.prototype.set.call(at,At,ht);else if(C.isBuffer(At))At.copy(at,ht);else throw new TypeError('"list" argument must be an Array of Buffers');ht+=At.length}return at};function ee(ye,Pe){if(C.isBuffer(ye))return ye.length;if(ArrayBuffer.isView(ye)||mi(ye,ArrayBuffer))return ye.byteLength;if(typeof ye!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+w(ye));var He=ye.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&He===0)return 0;for(var ht=!1;;)switch(Pe){case"ascii":case"latin1":case"binary":return He;case"utf8":case"utf-8":return mr(ye).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He*2;case"hex":return He>>>1;case"base64":return Mr(ye).length;default:if(ht)return at?-1:mr(ye).length;Pe=(""+Pe).toLowerCase(),ht=!0}}C.byteLength=ee;function he(ye,Pe,He){var at=!1;if((Pe===void 0||Pe<0)&&(Pe=0),Pe>this.length||((He===void 0||He>this.length)&&(He=this.length),He<=0)||(He>>>=0,Pe>>>=0,He<=Pe))return"";for(ye||(ye="utf8");;)switch(ye){case"hex":return Oe(this,Pe,He);case"utf8":case"utf-8":return J(this,Pe,He);case"ascii":return Ce(this,Pe,He);case"latin1":case"binary":return Be(this,Pe,He);case"base64":return oe(this,Pe,He);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,Pe,He);default:if(at)throw new TypeError("Unknown encoding: "+ye);ye=(ye+"").toLowerCase(),at=!0}}C.prototype._isBuffer=!0;function xe(ye,Pe,He){var at=ye[Pe];ye[Pe]=ye[He],ye[He]=at}C.prototype.swap16=function(){var ye=this.length;if(ye%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Pe=0;PePe&&(ye+=" ... "),""},I&&(C.prototype[I]=C.prototype.inspect),C.prototype.compare=function(ye,Pe,He,at,ht){if(mi(ye,Uint8Array)&&(ye=C.from(ye,ye.offset,ye.byteLength)),!C.isBuffer(ye))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+w(ye));if(Pe===void 0&&(Pe=0),He===void 0&&(He=ye?ye.length:0),at===void 0&&(at=0),ht===void 0&&(ht=this.length),Pe<0||He>ye.length||at<0||ht>this.length)throw new RangeError("out of range index");if(at>=ht&&Pe>=He)return 0;if(at>=ht)return-1;if(Pe>=He)return 1;if(Pe>>>=0,He>>>=0,at>>>=0,ht>>>=0,this===ye)return 0;for(var At=ht-at,Wt=He-Pe,Kt=Math.min(At,Wt),hr=this.slice(at,ht),zr=ye.slice(Pe,He),Dr=0;Dr2147483647?He=2147483647:He<-2147483648&&(He=-2147483648),He=+He,Ot(He)&&(He=ht?0:ye.length-1),He<0&&(He=ye.length+He),He>=ye.length){if(ht)return-1;He=ye.length-1}else if(He<0)if(ht)He=0;else return-1;if(typeof Pe=="string"&&(Pe=C.from(Pe,at)),C.isBuffer(Pe))return Pe.length===0?-1:ce(ye,Pe,He,at,ht);if(typeof Pe=="number")return Pe=Pe&255,typeof Uint8Array.prototype.indexOf=="function"?ht?Uint8Array.prototype.indexOf.call(ye,Pe,He):Uint8Array.prototype.lastIndexOf.call(ye,Pe,He):ce(ye,[Pe],He,at,ht);throw new TypeError("val must be string, number or Buffer")}function ce(ye,Pe,He,at,ht){var At=1,Wt=ye.length,Kt=Pe.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(ye.length<2||Pe.length<2)return-1;At=2,Wt/=2,Kt/=2,He/=2}function hr(un,cn){return At===1?un[cn]:un.readUInt16BE(cn*At)}var zr;if(ht){var Dr=-1;for(zr=He;zrWt&&(He=Wt-Kt),zr=He;zr>=0;zr--){for(var br=!0,hi=0;hiht&&(at=ht)):at=ht;var At=Pe.length;at>At/2&&(at=At/2);var Wt;for(Wt=0;Wt>>0,isFinite(He)?(He=He>>>0,at===void 0&&(at="utf8")):(at=He,He=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ht=this.length-Pe;if((He===void 0||He>ht)&&(He=ht),ye.length>0&&(He<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");at||(at="utf8");for(var At=!1;;)switch(at){case"hex":return re(this,ye,Pe,He);case"utf8":case"utf-8":return ge(this,ye,Pe,He);case"ascii":case"latin1":case"binary":return ne(this,ye,Pe,He);case"base64":return se(this,ye,Pe,He);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,ye,Pe,He);default:if(At)throw new TypeError("Unknown encoding: "+at);at=(""+at).toLowerCase(),At=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(ye,Pe,He){return Pe===0&&He===ye.length?D.fromByteArray(ye):D.fromByteArray(ye.slice(Pe,He))}function J(ye,Pe,He){He=Math.min(ye.length,He);for(var at=[],ht=Pe;ht239?4:At>223?3:At>191?2:1;if(ht+Kt<=He){var hr=void 0,zr=void 0,Dr=void 0,br=void 0;switch(Kt){case 1:At<128&&(Wt=At);break;case 2:hr=ye[ht+1],(hr&192)===128&&(br=(At&31)<<6|hr&63,br>127&&(Wt=br));break;case 3:hr=ye[ht+1],zr=ye[ht+2],(hr&192)===128&&(zr&192)===128&&(br=(At&15)<<12|(hr&63)<<6|zr&63,br>2047&&(br<55296||br>57343)&&(Wt=br));break;case 4:hr=ye[ht+1],zr=ye[ht+2],Dr=ye[ht+3],(hr&192)===128&&(zr&192)===128&&(Dr&192)===128&&(br=(At&15)<<18|(hr&63)<<12|(zr&63)<<6|Dr&63,br>65535&&br<1114112&&(Wt=br))}}Wt===null?(Wt=65533,Kt=1):Wt>65535&&(Wt-=65536,at.push(Wt>>>10&1023|55296),Wt=56320|Wt&1023),at.push(Wt),ht+=Kt}return fe(at)}var me=4096;function fe(ye){var Pe=ye.length;if(Pe<=me)return String.fromCharCode.apply(String,ye);for(var He="",at=0;atat)&&(He=at);for(var ht="",At=Pe;AtHe&&(ye=He),Pe<0?(Pe+=He,Pe<0&&(Pe=0)):Pe>He&&(Pe=He),PeHe)throw new RangeError("Trying to access beyond buffer length")}C.prototype.readUintLE=C.prototype.readUIntLE=function(ye,Pe,He){ye=ye>>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye],ht=1,At=0;++At>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye+--Pe],ht=1;Pe>0&&(ht*=256);)at+=this[ye+--Pe]*ht;return at},C.prototype.readUint8=C.prototype.readUInt8=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,1,this.length),this[ye]},C.prototype.readUint16LE=C.prototype.readUInt16LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,2,this.length),this[ye]|this[ye+1]<<8},C.prototype.readUint16BE=C.prototype.readUInt16BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,2,this.length),this[ye]<<8|this[ye+1]},C.prototype.readUint32LE=C.prototype.readUInt32LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),(this[ye]|this[ye+1]<<8|this[ye+2]<<16)+this[ye+3]*16777216},C.prototype.readUint32BE=C.prototype.readUInt32BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]*16777216+(this[ye+1]<<16|this[ye+2]<<8|this[ye+3])},C.prototype.readBigUInt64LE=ot(function(ye){ye=ye>>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=Pe+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,24),ht=this[++ye]+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+He*Math.pow(2,24);return BigInt(at)+(BigInt(ht)<>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=Pe*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye],ht=this[++ye]*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+He;return(BigInt(at)<>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye],ht=1,At=0;++At=ht&&(at-=Math.pow(2,8*Pe)),at},C.prototype.readIntBE=function(ye,Pe,He){ye=ye>>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=Pe,ht=1,At=this[ye+--at];at>0&&(ht*=256);)At+=this[ye+--at]*ht;return ht*=128,At>=ht&&(At-=Math.pow(2,8*Pe)),At},C.prototype.readInt8=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,1,this.length),this[ye]&128?(255-this[ye]+1)*-1:this[ye]},C.prototype.readInt16LE=function(ye,Pe){ye=ye>>>0,Pe||Ge(ye,2,this.length);var He=this[ye]|this[ye+1]<<8;return He&32768?He|4294901760:He},C.prototype.readInt16BE=function(ye,Pe){ye=ye>>>0,Pe||Ge(ye,2,this.length);var He=this[ye+1]|this[ye]<<8;return He&32768?He|4294901760:He},C.prototype.readInt32LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]|this[ye+1]<<8|this[ye+2]<<16|this[ye+3]<<24},C.prototype.readInt32BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]<<24|this[ye+1]<<16|this[ye+2]<<8|this[ye+3]},C.prototype.readBigInt64LE=ot(function(ye){ye=ye>>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=this[ye+4]+this[ye+5]*Math.pow(2,8)+this[ye+6]*Math.pow(2,16)+(He<<24);return(BigInt(at)<>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=(Pe<<24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye];return(BigInt(at)<>>0,Pe||Ge(ye,4,this.length),E.read(this,ye,!0,23,4)},C.prototype.readFloatBE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),E.read(this,ye,!1,23,4)},C.prototype.readDoubleLE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,8,this.length),E.read(this,ye,!0,52,8)},C.prototype.readDoubleBE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,8,this.length),E.read(this,ye,!1,52,8)};function rt(ye,Pe,He,at,ht,At){if(!C.isBuffer(ye))throw new TypeError('"buffer" argument must be a Buffer instance');if(Pe>ht||Peye.length)throw new RangeError("Index out of range")}C.prototype.writeUintLE=C.prototype.writeUIntLE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,He=He>>>0,!at){var ht=Math.pow(2,8*He)-1;rt(this,ye,Pe,He,ht,0)}var At=1,Wt=0;for(this[Pe]=ye&255;++Wt>>0,He=He>>>0,!at){var ht=Math.pow(2,8*He)-1;rt(this,ye,Pe,He,ht,0)}var At=He-1,Wt=1;for(this[Pe+At]=ye&255;--At>=0&&(Wt*=256);)this[Pe+At]=ye/Wt&255;return Pe+He},C.prototype.writeUint8=C.prototype.writeUInt8=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,1,255,0),this[Pe]=ye&255,Pe+1},C.prototype.writeUint16LE=C.prototype.writeUInt16LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,2,65535,0),this[Pe]=ye&255,this[Pe+1]=ye>>>8,Pe+2},C.prototype.writeUint16BE=C.prototype.writeUInt16BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,2,65535,0),this[Pe]=ye>>>8,this[Pe+1]=ye&255,Pe+2},C.prototype.writeUint32LE=C.prototype.writeUInt32LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,4,4294967295,0),this[Pe+3]=ye>>>24,this[Pe+2]=ye>>>16,this[Pe+1]=ye>>>8,this[Pe]=ye&255,Pe+4},C.prototype.writeUint32BE=C.prototype.writeUInt32BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,4,4294967295,0),this[Pe]=ye>>>24,this[Pe+1]=ye>>>16,this[Pe+2]=ye>>>8,this[Pe+3]=ye&255,Pe+4};function _t(ye,Pe,He,at,ht){ut(Pe,at,ht,ye,He,7);var At=Number(Pe&BigInt(4294967295));ye[He++]=At,At=At>>8,ye[He++]=At,At=At>>8,ye[He++]=At,At=At>>8,ye[He++]=At;var Wt=Number(Pe>>BigInt(32)&BigInt(4294967295));return ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,He}function pt(ye,Pe,He,at,ht){ut(Pe,at,ht,ye,He,7);var At=Number(Pe&BigInt(4294967295));ye[He+7]=At,At=At>>8,ye[He+6]=At,At=At>>8,ye[He+5]=At,At=At>>8,ye[He+4]=At;var Wt=Number(Pe>>BigInt(32)&BigInt(4294967295));return ye[He+3]=Wt,Wt=Wt>>8,ye[He+2]=Wt,Wt=Wt>>8,ye[He+1]=Wt,Wt=Wt>>8,ye[He]=Wt,He+8}C.prototype.writeBigUInt64LE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return _t(this,ye,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeBigUInt64BE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return pt(this,ye,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeIntLE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,!at){var ht=Math.pow(2,8*He-1);rt(this,ye,Pe,He,ht-1,-ht)}var At=0,Wt=1,Kt=0;for(this[Pe]=ye&255;++At>0)-Kt&255;return Pe+He},C.prototype.writeIntBE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,!at){var ht=Math.pow(2,8*He-1);rt(this,ye,Pe,He,ht-1,-ht)}var At=He-1,Wt=1,Kt=0;for(this[Pe+At]=ye&255;--At>=0&&(Wt*=256);)ye<0&&Kt===0&&this[Pe+At+1]!==0&&(Kt=1),this[Pe+At]=(ye/Wt>>0)-Kt&255;return Pe+He},C.prototype.writeInt8=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,1,127,-128),ye<0&&(ye=255+ye+1),this[Pe]=ye&255,Pe+1},C.prototype.writeInt16LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,2,32767,-32768),this[Pe]=ye&255,this[Pe+1]=ye>>>8,Pe+2},C.prototype.writeInt16BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,2,32767,-32768),this[Pe]=ye>>>8,this[Pe+1]=ye&255,Pe+2},C.prototype.writeInt32LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,4,2147483647,-2147483648),this[Pe]=ye&255,this[Pe+1]=ye>>>8,this[Pe+2]=ye>>>16,this[Pe+3]=ye>>>24,Pe+4},C.prototype.writeInt32BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||rt(this,ye,Pe,4,2147483647,-2147483648),ye<0&&(ye=4294967295+ye+1),this[Pe]=ye>>>24,this[Pe+1]=ye>>>16,this[Pe+2]=ye>>>8,this[Pe+3]=ye&255,Pe+4},C.prototype.writeBigInt64LE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return _t(this,ye,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),C.prototype.writeBigInt64BE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return pt(this,ye,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function gt(ye,Pe,He,at,ht,At){if(He+at>ye.length)throw new RangeError("Index out of range");if(He<0)throw new RangeError("Index out of range")}function ct(ye,Pe,He,at,ht){return Pe=+Pe,He=He>>>0,ht||gt(ye,Pe,He,4),E.write(ye,Pe,He,at,23,4),He+4}C.prototype.writeFloatLE=function(ye,Pe,He){return ct(this,ye,Pe,!0,He)},C.prototype.writeFloatBE=function(ye,Pe,He){return ct(this,ye,Pe,!1,He)};function Ae(ye,Pe,He,at,ht){return Pe=+Pe,He=He>>>0,ht||gt(ye,Pe,He,8),E.write(ye,Pe,He,at,52,8),He+8}C.prototype.writeDoubleLE=function(ye,Pe,He){return Ae(this,ye,Pe,!0,He)},C.prototype.writeDoubleBE=function(ye,Pe,He){return Ae(this,ye,Pe,!1,He)},C.prototype.copy=function(ye,Pe,He,at){if(!C.isBuffer(ye))throw new TypeError("argument should be a Buffer");if(He||(He=0),!at&&at!==0&&(at=this.length),Pe>=ye.length&&(Pe=ye.length),Pe||(Pe=0),at>0&&at=this.length)throw new RangeError("Index out of range");if(at<0)throw new RangeError("sourceEnd out of bounds");at>this.length&&(at=this.length),ye.length-Pe>>0,He=He===void 0?this.length:He>>>0,ye||(ye=0);var At;if(typeof ye=="number")for(At=Pe;AtMath.pow(2,32)?ht=nt(String(He)):typeof He=="bigint"&&(ht=String(He),(He>Math.pow(BigInt(2),BigInt(32))||He<-Math.pow(BigInt(2),BigInt(32)))&&(ht=nt(ht)),ht+="n"),at+=" It must be ".concat(Pe,". Received ").concat(ht),at},RangeError);function nt(ye){for(var Pe="",He=ye.length,at=ye[0]==="-"?1:0;He>=at+4;He-=3)Pe="_".concat(ye.slice(He-3,He)).concat(Pe);return"".concat(ye.slice(0,He)).concat(Pe)}function xt(ye,Pe,He){Et(Pe,"offset"),(ye[Pe]===void 0||ye[Pe+He]===void 0)&&Gt(Pe,ye.length-(He+1))}function ut(ye,Pe,He,at,ht,At){if(ye>He||ye= 0".concat(Wt," and < 2").concat(Wt," ** ").concat((At+1)*8).concat(Wt):Kt=">= -(2".concat(Wt," ** ").concat((At+1)*8-1).concat(Wt,") and < 2 ** ")+"".concat((At+1)*8-1).concat(Wt),new ze.ERR_OUT_OF_RANGE("value",Kt,ye)}xt(at,ht,At)}function Et(ye,Pe){if(typeof ye!="number")throw new ze.ERR_INVALID_ARG_TYPE(Pe,"number",ye)}function Gt(ye,Pe,He){throw Math.floor(ye)!==ye?(Et(ye,He),new ze.ERR_OUT_OF_RANGE("offset","an integer",ye)):Pe<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(Pe),ye)}var Jt=/[^+/0-9A-Za-z-_]/g;function gr(ye){if(ye=ye.split("=")[0],ye=ye.trim().replace(Jt,""),ye.length<2)return"";for(;ye.length%4!==0;)ye=ye+"=";return ye}function mr(ye,Pe){Pe=Pe||1/0;for(var He,at=ye.length,ht=null,At=[],Wt=0;Wt55295&&He<57344){if(!ht){if(He>56319){(Pe-=3)>-1&&At.push(239,191,189);continue}else if(Wt+1===at){(Pe-=3)>-1&&At.push(239,191,189);continue}ht=He;continue}if(He<56320){(Pe-=3)>-1&&At.push(239,191,189),ht=He;continue}He=(ht-55296<<10|He-56320)+65536}else ht&&(Pe-=3)>-1&&At.push(239,191,189);if(ht=null,He<128){if((Pe-=1)<0)break;At.push(He)}else if(He<2048){if((Pe-=2)<0)break;At.push(He>>6|192,He&63|128)}else if(He<65536){if((Pe-=3)<0)break;At.push(He>>12|224,He>>6&63|128,He&63|128)}else if(He<1114112){if((Pe-=4)<0)break;At.push(He>>18|240,He>>12&63|128,He>>6&63|128,He&63|128)}else throw new Error("Invalid code point")}return At}function Kr(ye){for(var Pe=[],He=0;He>8,ht=He%256,At.push(ht),At.push(at);return At}function Mr(ye){return D.toByteArray(gr(ye))}function ui(ye,Pe,He,at){var ht;for(ht=0;ht=Pe.length||ht>=ye.length);++ht)Pe[ht+He]=ye[ht];return ht}function mi(ye,Pe){return ye instanceof Pe||ye!=null&&ye.constructor!=null&&ye.constructor.name!=null&&ye.constructor.name===Pe.name}function Ot(ye){return ye!==ye}var Je=function(){for(var ye="0123456789abcdef",Pe=new Array(256),He=0;He<16;++He)for(var at=He*16,ht=0;ht<16;++ht)Pe[at+ht]=ye[He]+ye[ht];return Pe}();function ot(ye){return typeof BigInt>"u"?De:ye}function De(){throw new Error("BigInt not supported")}},4844:function(i){i.exports=n;function n(a,l,o,u){return a[0]=l[0]+o[0]*u,a[1]=l[1]+o[1]*u,a[2]=l[2]+o[2]*u,a[3]=l[3]+o[3]*u,a}},4905:function(i,n,a){var l=a(5874);i.exports=o;function o(u,s){var h=l(s),m=[];return m=m.concat(h(u)),m=m.concat(h(null)),m}},4935:function(i,n,a){i.exports=k;var l=a(2762),o=a(8116),u=a(4359),s=a(1879).Q,h=window||process.global||{},m=h.__TEXT_CACHE||{};h.__TEXT_CACHE={};var b=3;function x(w,D,E,I){this.gl=w,this.shader=D,this.buffer=E,this.vao=I,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var _=x.prototype,A=[0,0];_.bind=function(w,D,E,I){this.vao.bind(),this.shader.bind();var M=this.shader.uniforms;M.model=w,M.view=D,M.projection=E,M.pixelScale=I,A[0]=this.gl.drawingBufferWidth,A[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=A},_.unbind=function(){this.vao.unbind()},_.update=function(w,D,E,I,M){var p=[];function g(q,G,ee,he,xe,ve){var ce=[ee.style,ee.weight,ee.variant,ee.family].join("_"),re=m[ce];re||(re=m[ce]={});var ge=re[G];ge||(ge=re[G]=f(G,{triangles:!0,font:ee.family,fontStyle:ee.style,fontWeight:ee.weight,fontVariant:ee.variant,textAlign:"center",textBaseline:"middle",lineSpacing:xe,styletags:ve}));for(var ne=(he||12)/12,se=ge.positions,_e=ge.cells,oe=0,J=_e.length;oe=0;--fe){var Ce=se[me[fe]];p.push(ne*Ce[0],-ne*Ce[1],q)}}for(var C=[0,0,0],T=[0,0,0],N=[0,0,0],B=[0,0,0],U=1.25,V={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},W=0;W<3;++W){N[W]=p.length/b|0,g(.5*(w[0][W]+w[1][W]),D[W],E[W],12,U,V),B[W]=(p.length/b|0)-N[W],C[W]=p.length/b|0;for(var F=0;F0||D.length>0;){for(;w.length>0;){var g=w.pop();if(E[g]!==-k){E[g]=k;for(var C=I[g],T=0;T<3;++T){var N=p[3*g+T];N>=0&&E[N]===0&&(M[3*g+T]?D.push(N):(w.push(N),E[N]=k))}}}var B=D;D=w,w=B,D.length=0,k=-k}var U=m(I,E,_);return A?U.concat(f.boundary):U}},5033:function(i){i.exports=n;function n(a,l,o){var u=l||0,s=o||1;return[[a[12]+a[0],a[13]+a[1],a[14]+a[2],a[15]+a[3]],[a[12]-a[0],a[13]-a[1],a[14]-a[2],a[15]-a[3]],[a[12]+a[4],a[13]+a[5],a[14]+a[6],a[15]+a[7]],[a[12]-a[4],a[13]-a[5],a[14]-a[6],a[15]-a[7]],[u*a[12]+a[8],u*a[13]+a[9],u*a[14]+a[10],u*a[15]+a[11]],[s*a[12]-a[8],s*a[13]-a[9],s*a[14]-a[10],s*a[15]-a[11]]]}},5085:function(i,n,a){i.exports=k;var l=a(3250)[3],o=a(4209),u=a(3352),s=a(2478);function h(){return!0}function m(w){return function(D,E){var I=w[D];return I?!!I.queryPoint(E,h):!1}}function b(w){for(var D={},E=0;E0&&D[I]===E[0])M=w[I-1];else return 1;for(var p=1;M;){var g=M.key,C=l(E,g[0],g[1]);if(g[0][0]0)p=-1,M=M.right;else return 0;else if(C>0)M=M.left;else if(C<0)p=1,M=M.right;else return 0}return p}}function _(w){return 1}function A(w){return function(D){return w(D[0],D[1])?0:1}}function f(w,D){return function(E){return w(E[0],E[1])?0:D(E)}}function k(w){for(var D=w.length,E=[],I=[],M=0,p=0;p"u"?a(606):WeakMap,s=new u,h=0;function m(D,E,I,M,p,g,C){this.id=D,this.src=E,this.type=I,this.shader=M,this.count=g,this.programs=[],this.cache=C}m.prototype.dispose=function(){if(--this.count===0){for(var D=this.cache,E=D.gl,I=this.programs,M=0,p=I.length;M0&&(m=1/Math.sqrt(m),a[0]=o*m,a[1]=u*m,a[2]=s*m,a[3]=h*m),a}},5202:function(i,n,a){var l=a(1944),o=a(8210);i.exports=h,i.exports.positive=m,i.exports.negative=b;function u(x,_){var A=o(l(x,_),[_[_.length-1]]);return A[A.length-1]}function s(x,_,A,f){var k=f-_,w=-_/k;w<0?w=0:w>1&&(w=1);for(var D=1-w,E=x.length,I=new Array(E),M=0;M0||k>0&&I<0){var M=s(w,I,D,k);A.push(M),f.push(M.slice())}I<0?f.push(D.slice()):I>0?A.push(D.slice()):(A.push(D.slice()),f.push(D.slice())),k=I}return{positive:A,negative:f}}function m(x,_){for(var A=[],f=u(x[x.length-1],_),k=x[x.length-1],w=x[0],D=0;D0||f>0&&E<0)&&A.push(s(k,E,w,f)),E>=0&&A.push(w.slice()),f=E}return A}function b(x,_){for(var A=[],f=u(x[x.length-1],_),k=x[x.length-1],w=x[0],D=0;D0||f>0&&E<0)&&A.push(s(k,E,w,f)),E<=0&&A.push(w.slice()),f=E}return A}},5219:function(i){i.exports=function(n){for(var a=n.length,l,o=0;o13)&&l!==32&&l!==133&&l!==160&&l!==5760&&l!==6158&&(l<8192||l>8205)&&l!==8232&&l!==8233&&l!==8239&&l!==8287&&l!==8288&&l!==12288&&l!==65279)return!1;return!0}},5250:function(i){i.exports=a;var n=+(Math.pow(2,27)+1);function a(l,o,u){var s=l*o,h=n*l,m=h-l,b=h-m,x=l-b,_=n*o,A=_-o,f=_-A,k=o-f,w=s-b*f,D=w-x*f,E=D-b*k,I=x*k-E;return u?(u[0]=I,u[1]=s,u):[I,s]}},5298:function(i,n){var a={"float64,2,1,0":function(){return function(b,x,_,A,f){var k=b[0],w=b[1],D=b[2],E=_[0],I=_[1],M=_[2];A|=0;var p=0,g=0,C=0,T=M,N=I-D*M,B=E-w*I;for(C=0;C0;){W<64?(E=W,W=0):(E=64,W-=64);for(var F=b[1]|0;F>0;){F<64?(I=F,F=0):(I=64,F-=64),A=U+W*p+F*g,w=V+W*T+F*N;var $=0,q=0,G=0,ee=C,he=p-M*C,xe=g-E*p,ve=B,ce=T-M*B,re=N-E*T;for(G=0;G0;){N<64?(E=N,N=0):(E=64,N-=64);for(var B=b[0]|0;B>0;){B<64?(D=B,B=0):(D=64,B-=64),A=C+N*M+B*I,w=T+N*g+B*p;var U=0,V=0,W=M,F=I-E*M,$=g,q=p-E*g;for(V=0;V0;){V<64?(I=V,V=0):(I=64,V-=64);for(var W=b[0]|0;W>0;){W<64?(D=W,W=0):(D=64,W-=64);for(var F=b[1]|0;F>0;){F<64?(E=F,F=0):(E=64,F-=64),A=B+V*g+W*M+F*p,w=U+V*N+W*C+F*T;var $=0,q=0,G=0,ee=g,he=M-I*g,xe=p-D*M,ve=N,ce=C-I*N,re=T-D*C;for(G=0;G=0}}(),u.removeTriangle=function(m,b,x){var _=this.stars;s(_[m],b,x),s(_[b],x,m),s(_[x],m,b)},u.addTriangle=function(m,b,x){var _=this.stars;_[m].push(b,x),_[b].push(x,m),_[x].push(m,b)},u.opposite=function(m,b){for(var x=this.stars[b],_=1,A=x.length;_0;){var f=x.pop();m[f]=!1;for(var k=h[f],_=0;_0){for(var ce=0;ce<24;++ce)B.push(B[B.length-12]);F+=2,he=!0}continue e}$[0][T]=Math.min($[0][T],xe[T],ve[T]),$[1][T]=Math.max($[1][T],xe[T],ve[T])}var re,ge;Array.isArray(G[0])?(re=G.length>C-1?G[C-1]:G.length>0?G[G.length-1]:[0,0,0,1],ge=G.length>C?G[C]:G.length>0?G[G.length-1]:[0,0,0,1]):re=ge=G,re.length===3&&(re=[re[0],re[1],re[2],1]),ge.length===3&&(ge=[ge[0],ge[1],ge[2],1]),!this.hasAlpha&&re[3]<1&&(this.hasAlpha=!0);var ne;Array.isArray(ee)?ne=ee.length>C-1?ee[C-1]:ee.length>0?ee[ee.length-1]:[0,0,0,1]:ne=ee;var se=W;if(W+=w(xe,ve),he){for(T=0;T<2;++T)B.push(xe[0],xe[1],xe[2],ve[0],ve[1],ve[2],se,ne,re[0],re[1],re[2],re[3]);F+=2,he=!1}B.push(xe[0],xe[1],xe[2],ve[0],ve[1],ve[2],se,ne,re[0],re[1],re[2],re[3],xe[0],xe[1],xe[2],ve[0],ve[1],ve[2],se,-ne,re[0],re[1],re[2],re[3],ve[0],ve[1],ve[2],xe[0],xe[1],xe[2],W,-ne,ge[0],ge[1],ge[2],ge[3],ve[0],ve[1],ve[2],xe[0],xe[1],xe[2],W,ne,ge[0],ge[1],ge[2],ge[3]),F+=4}}if(this.buffer.update(B),U.push(W),V.push(q[q.length-1].slice()),this.bounds=$,this.vertexCount=F,this.points=V,this.arcLength=U,"dashes"in g){var _e=g.dashes,oe=_e.slice();for(oe.unshift(0),C=1;Ca[o][0]&&(o=u);return lo?[[o],[l]]:[[l]]}},5771:function(i,n,a){var l=a(8507),o=a(3788),u=a(2419);i.exports=s;function s(h){h.sort(o);for(var m=h.length,b=0,x=0;x0){var f=h[b-1];if(l(_,f)===0&&u(f)!==A){b-=1;continue}}h[b++]=_}}return h.length=b,h}},5838:function(i,n,a){i.exports=o;var l=a(7842);function o(u){for(var s=new Array(u.length),h=0;h0)continue;nt=Ae.slice(0,1).join("")}return oe(nt),he+=nt.length,$=$.slice(nt.length),$.length}while(!0)}function _t(){return/[^a-fA-F0-9]/.test(W)?(oe($.join("")),V=m,B):($.push(W),F=W,B+1)}function pt(){return W==="."||/[eE]/.test(W)?($.push(W),V=w,F=W,B+1):W==="x"&&$.length===1&&$[0]==="0"?(V=g,$.push(W),F=W,B+1):/[^\d]/.test(W)?(oe($.join("")),V=m,B):($.push(W),F=W,B+1)}function gt(){return W==="f"&&($.push(W),F=W,B+=1),/[eE]/.test(W)||(W==="-"||W==="+")&&/[eE]/.test(F)?($.push(W),F=W,B+1):/[^\d]/.test(W)?(oe($.join("")),V=m,B):($.push(W),F=W,B+1)}function ct(){if(/[^\d\w_]/.test(W)){var Ae=$.join("");return _e[Ae]?V=I:se[Ae]?V=E:V=D,oe($.join("")),V=m,B}return $.push(W),F=W,B+1}}},5878:function(i,n,a){i.exports=s;var l=a(3250),o=a(2014);function u(h,m,b){var x=Math.abs(l(h,m,b)),_=Math.sqrt(Math.pow(m[0]-b[0],2)+Math.pow(m[1]-b[1],2));return x/_}function s(h,m,b){for(var x=m.length,_=h.length,A=new Array(x),f=new Array(x),k=new Array(x),w=new Array(x),D=0;D>1:(ce>>1)-1}function N(ce){for(var re=C(ce);;){var ge=re,ne=2*ce+1,se=2*(ce+1),_e=ce;if(ne0;){var ge=T(ce);if(ge>=0){var ne=C(ge);if(re0){var ce=F[0];return g(0,G-1),G-=1,N(0),ce}return-1}function V(ce,re){var ge=F[ce];return k[ge]===re?ce:(k[ge]=-1/0,B(ce),U(),k[ge]=re,G+=1,B(G-1))}function W(ce){if(!w[ce]){w[ce]=!0;var re=A[ce],ge=f[ce];A[ge]>=0&&(A[ge]=re),f[re]>=0&&(f[re]=ge),$[re]>=0&&V($[re],p(re)),$[ge]>=0&&V($[ge],p(ge))}}for(var F=[],$=new Array(x),D=0;D>1;D>=0;--D)N(D);for(;;){var ee=U();if(ee<0||k[ee]>b)break;W(ee)}for(var he=[],D=0;D=0&&ge>=0&&re!==ge){var ne=$[re],se=$[ge];ne!==se&&ve.push([ne,se])}}),o.unique(o.normalize(ve)),{positions:he,edges:ve}}},5911:function(i){i.exports=n;function n(a,l,o){var u=l[0],s=l[1],h=l[2],m=o[0],b=o[1],x=o[2];return a[0]=s*x-h*b,a[1]=h*m-u*x,a[2]=u*b-s*m,a}},5964:function(i){i.exports=function(n){return!n&&n!==0?"":n.toString()}},5995:function(i,n,a){i.exports=u;var l=a(7642),o=a(6037);function u(s,h){return l(h).filter(function(m){for(var b=new Array(m.length),x=0;x2&&C[1]>2&&M(g.pick(-1,-1).lo(1,1).hi(C[0]-2,C[1]-2),p.pick(-1,-1,0).lo(1,1).hi(C[0]-2,C[1]-2),p.pick(-1,-1,1).lo(1,1).hi(C[0]-2,C[1]-2)),C[1]>2&&(I(g.pick(0,-1).lo(1).hi(C[1]-2),p.pick(0,-1,1).lo(1).hi(C[1]-2)),E(p.pick(0,-1,0).lo(1).hi(C[1]-2))),C[1]>2&&(I(g.pick(C[0]-1,-1).lo(1).hi(C[1]-2),p.pick(C[0]-1,-1,1).lo(1).hi(C[1]-2)),E(p.pick(C[0]-1,-1,0).lo(1).hi(C[1]-2))),C[0]>2&&(I(g.pick(-1,0).lo(1).hi(C[0]-2),p.pick(-1,0,0).lo(1).hi(C[0]-2)),E(p.pick(-1,0,1).lo(1).hi(C[0]-2))),C[0]>2&&(I(g.pick(-1,C[1]-1).lo(1).hi(C[0]-2),p.pick(-1,C[1]-1,0).lo(1).hi(C[0]-2)),E(p.pick(-1,C[1]-1,1).lo(1).hi(C[0]-2))),p.set(0,0,0,0),p.set(0,0,1,0),p.set(C[0]-1,0,0,0),p.set(C[0]-1,0,1,0),p.set(0,C[1]-1,0,0),p.set(0,C[1]-1,1,0),p.set(C[0]-1,C[1]-1,0,0),p.set(C[0]-1,C[1]-1,1,0),p}}function w(D){var E=D.join(),C=x[E];if(C)return C;for(var I=D.length,M=[_,A],p=1;p<=I;++p)M.push(f(p));var g=k,C=g.apply(void 0,M);return x[E]=C,C}i.exports=function(D,E,I){if(Array.isArray(I)||(typeof I=="string"?I=l(E.dimension,I):I=l(E.dimension,"clamp")),E.size===0)return D;if(E.dimension===0)return D.set(0),D;var M=w(I);return M(D,E)}},6204:function(i){i.exports=n;function n(a){var l,o,u,s=a.length,h=0;for(l=0;lx&&(x=l.length(B)),T&&!C){var U=2*l.distance(E,N)/(l.length(I)+l.length(B));U?(p=Math.min(p,U),g=!1):g=!0}g||(E=N,I=B),M.push(B)}var V=[_,f,w],W=[A,k,D];s&&(s[0]=V,s[1]=W),x===0&&(x=1);var F=1/x;isFinite(p)||(p=1),b.vectorScale=p;var $=u.coneSize||(C?1:.5);u.absoluteConeSize&&($=u.absoluteConeSize*F),b.coneScale=$;for(var T=0,q=0;The&&(W|=1<he){W|=1<b[B][1])&&(_e=B);for(var oe=-1,B=0;B<3;++B){var J=_e^1<b[me][0]&&(me=J)}}var fe=w;fe[0]=fe[1]=fe[2]=0,fe[l.log2(oe^_e)]=_e&oe,fe[l.log2(_e^me)]=_e&me;var Ce=me^7;Ce===W||Ce===se?(Ce=oe^7,fe[l.log2(me^Ce)]=Ce&me):fe[l.log2(oe^Ce)]=Ce&oe;for(var Be=D,Oe=W,q=0;q<3;++q)Oe&1<=0&&(b=h.length-m-1);var x=Math.pow(10,b),_=Math.round(u*s*x),A=_+"";if(A.indexOf("e")>=0)return A;var f=_/x,k=_%x;_<0?(f=-Math.ceil(f)|0,k=-k|0):(f=Math.floor(f)|0,k=k|0);var w=""+f;if(_<0&&(w="-"+w),b){for(var D=""+k;D.length=u[0][m];--_)b.push({x:_*s[m],text:a(s[m],_)});h.push(b)}return h}function o(u,s){for(var h=0;h<3;++h){if(u[h].length!==s[h].length)return!1;for(var m=0;mE+1)throw new Error(w+" map requires nshades to be at least size "+k.length);Array.isArray(b.alpha)?b.alpha.length!==2?I=[1,1]:I=b.alpha.slice():typeof b.alpha=="number"?I=[b.alpha,b.alpha]:I=[1,1],x=k.map(function(N){return Math.round(N.index*E)}),I[0]=Math.min(Math.max(I[0],0),1),I[1]=Math.min(Math.max(I[1],0),1);var p=k.map(function(N,B){var U=k[B].index,V=k[B].rgb.slice();return V.length===4&&V[3]>=0&&V[3]<=1||(V[3]=I[0]+(I[1]-I[0])*U),V}),g=[];for(M=0;M0&&(h=1/Math.sqrt(h),a[0]=l[0]*h,a[1]=l[1]*h,a[2]=l[2]*h),a}},3545:function(i,n,a){i.exports=h;var l=a(8105),o=l("lox&&A[M+b]>E;--I,M-=k){for(var p=M,g=M+k,C=0;C>>1,E=2*m,I=D,M=A[E*D+b];k=N?(I=T,M=N):C>=U?(I=g,M=C):(I=B,M=U):N>=U?(I=T,M=N):U>=C?(I=g,M=C):(I=B,M=U);for(var V=E*(w-1),W=E*I,F=0;Fthis.buffer.length){o.free(this.buffer);for(var w=this.buffer=o.mallocUint8(s(k*f*4)),D=0;DE|0},vertex:function(k,w,D,E,I,M,p,g,C,T,N,B,U){var V=(p<<0)+(g<<1)+(C<<2)+(T<<3)|0;if(!(V===0||V===15))switch(V){case 0:N.push([k-.5,w-.5]);break;case 1:N.push([k-.25-.25*(E+D-2*U)/(D-E),w-.25-.25*(I+D-2*U)/(D-I)]);break;case 2:N.push([k-.75-.25*(-E-D+2*U)/(E-D),w-.25-.25*(M+E-2*U)/(E-M)]);break;case 3:N.push([k-.5,w-.5-.5*(I+D+M+E-4*U)/(D-I+E-M)]);break;case 4:N.push([k-.25-.25*(M+I-2*U)/(I-M),w-.75-.25*(-I-D+2*U)/(I-D)]);break;case 5:N.push([k-.5-.5*(E+D+M+I-4*U)/(D-E+I-M),w-.5]);break;case 6:N.push([k-.5-.25*(-E-D+M+I)/(E-D+I-M),w-.5-.25*(-I-D+M+E)/(I-D+E-M)]);break;case 7:N.push([k-.75-.25*(M+I-2*U)/(I-M),w-.75-.25*(M+E-2*U)/(E-M)]);break;case 8:N.push([k-.75-.25*(-M-I+2*U)/(M-I),w-.75-.25*(-M-E+2*U)/(M-E)]);break;case 9:N.push([k-.5-.25*(E+D+-M-I)/(D-E+M-I),w-.5-.25*(I+D+-M-E)/(D-I+M-E)]);break;case 10:N.push([k-.5-.5*(-E-D+-M-I+4*U)/(E-D+M-I),w-.5]);break;case 11:N.push([k-.25-.25*(-M-I+2*U)/(M-I),w-.75-.25*(I+D-2*U)/(D-I)]);break;case 12:N.push([k-.5,w-.5-.5*(-I-D+-M-E+4*U)/(I-D+M-E)]);break;case 13:N.push([k-.75-.25*(E+D-2*U)/(D-E),w-.25-.25*(-M-E+2*U)/(M-E)]);break;case 14:N.push([k-.25-.25*(-E-D+2*U)/(E-D),w-.25-.25*(-I-D+2*U)/(I-D)]);break;case 15:N.push([k-.5,w-.5]);break}},cell:function(k,w,D,E,I,M,p,g,C){I?g.push([k,w]):g.push([w,k])}});return function(k,w){var D=[],E=[];return f(k,D,E,w),{positions:D,cells:E}}}};function s(x,_){var A=x.length+"d",f=u[A];if(f)return f(l,x,_)}function h(x,_){for(var A=o(x,_),f=A.length,k=new Array(f),w=new Array(f),D=0;D>1,A=-7,f=o?s-1:0,k=o?-1:1,w=a[l+f];for(f+=k,h=w&(1<<-A)-1,w>>=-A,A+=b;A>0;h=h*256+a[l+f],f+=k,A-=8);for(m=h&(1<<-A)-1,h>>=-A,A+=u;A>0;m=m*256+a[l+f],f+=k,A-=8);if(h===0)h=1-_;else{if(h===x)return m?NaN:(w?-1:1)*(1/0);m=m+Math.pow(2,u),h=h-_}return(w?-1:1)*m*Math.pow(2,h-u)},n.write=function(a,l,o,u,s,h){var m,b,x,_=h*8-s-1,A=(1<<_)-1,f=A>>1,k=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=u?0:h-1,D=u?1:-1,E=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(b=isNaN(l)?1:0,m=A):(m=Math.floor(Math.log(l)/Math.LN2),l*(x=Math.pow(2,-m))<1&&(m--,x*=2),m+f>=1?l+=k/x:l+=k*Math.pow(2,1-f),l*x>=2&&(m++,x/=2),m+f>=A?(b=0,m=A):m+f>=1?(b=(l*x-1)*Math.pow(2,s),m=m+f):(b=l*Math.pow(2,f-1)*Math.pow(2,s),m=0));s>=8;a[o+w]=b&255,w+=D,b/=256,s-=8);for(m=m<0;a[o+w]=m&255,w+=D,m/=256,_-=8);a[o+w-D]|=E*128}},3788:function(i,n,a){var l=a(8507),o=a(2419);i.exports=u;function u(s,h){return l(s,h)||o(s)-o(h)}},3837:function(i,n,a){i.exports=B;var l=a(4935),o=a(501),u=a(5304),s=a(6429),h=a(6444),m=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),b=ArrayBuffer,x=DataView;function _(U){return b.isView(U)&&!(U instanceof x)}function A(U){return Array.isArray(U)||_(U)}function f(U,V){return U[0]=V[0],U[1]=V[1],U[2]=V[2],U}function k(U){this.gl=U,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=u(U)}var w=k.prototype;w.update=function(U){U=U||{};function V(se,_e,oe){if(oe in U){var J=U[oe],me=this[oe],fe;(se?A(J)&&A(J[0]):A(J))?this[oe]=fe=[_e(J[0]),_e(J[1]),_e(J[2])]:this[oe]=fe=[_e(J),_e(J),_e(J)];for(var Ce=0;Ce<3;++Ce)if(fe[Ce]!==me[Ce])return!0}return!1}var W=V.bind(this,!1,Number),F=V.bind(this,!1,Boolean),H=V.bind(this,!1,String),q=V.bind(this,!0,function(se){if(A(se)){if(se.length===3)return[+se[0],+se[1],+se[2],1];if(se.length===4)return[+se[0],+se[1],+se[2],+se[3]]}return[0,0,0,1]}),G,ee=!1,he=!1;if("bounds"in U)for(var be=U.bounds,ve=0;ve<2;++ve)for(var ce=0;ce<3;++ce)be[ve][ce]!==this.bounds[ve][ce]&&(he=!0),this.bounds[ve][ce]=be[ve][ce];if("ticks"in U){G=U.ticks,ee=!0,this.autoTicks=!1;for(var ve=0;ve<3;++ve)this.tickSpacing[ve]=0}else W("tickSpacing")&&(this.autoTicks=!0,he=!0);if(this._firstInit&&("ticks"in U||"tickSpacing"in U||(this.autoTicks=!0),he=!0,ee=!0,this._firstInit=!1),he&&this.autoTicks&&(G=h.create(this.bounds,this.tickSpacing),ee=!0),ee){for(var ve=0;ve<3;++ve)G[ve].sort(function(_e,oe){return _e.x-oe.x});h.equal(G,this.ticks)?ee=!1:this.ticks=G}F("tickEnable"),H("tickFont")&&(ee=!0),H("tickFontStyle")&&(ee=!0),H("tickFontWeight")&&(ee=!0),H("tickFontVariant")&&(ee=!0),W("tickSize"),W("tickAngle"),W("tickPad"),q("tickColor");var re=H("labels");H("labelFont")&&(re=!0),H("labelFontStyle")&&(re=!0),H("labelFontWeight")&&(re=!0),H("labelFontVariant")&&(re=!0),F("labelEnable"),W("labelSize"),W("labelPad"),q("labelColor"),F("lineEnable"),F("lineMirror"),W("lineWidth"),q("lineColor"),F("lineTickEnable"),F("lineTickMirror"),W("lineTickLength"),W("lineTickWidth"),q("lineTickColor"),F("gridEnable"),W("gridWidth"),q("gridColor"),F("zeroEnable"),q("zeroLineColor"),W("zeroLineWidth"),F("backgroundEnable"),q("backgroundColor");var ge=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],ne=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(re||ee)&&this._text.update(this.bounds,this.labels,ge,this.ticks,ne):this._text=l(this.gl,this.bounds,this.labels,ge,this.ticks,ne),this._lines&&ee&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=o(this.gl,this.bounds,this.ticks))};function D(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var E=[new D,new D,new D];function I(U,V,W,F,H){for(var q=U.primalOffset,G=U.primalMinor,ee=U.mirrorOffset,he=U.mirrorMinor,be=F[V],ve=0;ve<3;++ve)if(V!==ve){var ce=q,re=ee,ge=G,ne=he;be&1<0?(ge[ve]=-1,ne[ve]=0):(ge[ve]=0,ne[ve]=1)}}var M=[0,0,0],p={model:m,view:m,projection:m,_ortho:!1};w.isOpaque=function(){return!0},w.isTransparent=function(){return!1},w.drawTransparent=function(U){};var g=0,C=[0,0,0],T=[0,0,0],N=[0,0,0];w.draw=function(U){U=U||p;for(var V=this.gl,W=U.model||m,F=U.view||m,H=U.projection||m,q=this.bounds,G=U._ortho||!1,ee=s(W,F,H,q,G),he=ee.cubeEdges,be=ee.axis,ve=F[12],ce=F[13],re=F[14],ge=F[15],ne=G?2:1,se=ne*this.pixelRatio*(H[3]*ve+H[7]*ce+H[11]*re+H[15]*ge)/V.drawingBufferHeight,_e=0;_e<3;++_e)this.lastCubeProps.cubeEdges[_e]=he[_e],this.lastCubeProps.axis[_e]=be[_e];for(var oe=E,_e=0;_e<3;++_e)I(E[_e],_e,this.bounds,he,be);for(var V=this.gl,J=M,_e=0;_e<3;++_e)this.backgroundEnable[_e]?J[_e]=be[_e]:J[_e]=0;this._background.draw(W,F,H,q,J,this.backgroundColor),this._lines.bind(W,F,H,this);for(var _e=0;_e<3;++_e){var me=[0,0,0];be[_e]>0?me[_e]=q[1][_e]:me[_e]=q[0][_e];for(var fe=0;fe<2;++fe){var Ce=(_e+1+fe)%3,Re=(_e+1+(fe^1))%3;this.gridEnable[Ce]&&this._lines.drawGrid(Ce,Re,this.bounds,me,this.gridColor[Ce],this.gridWidth[Ce]*this.pixelRatio)}for(var fe=0;fe<2;++fe){var Ce=(_e+1+fe)%3,Re=(_e+1+(fe^1))%3;this.zeroEnable[Re]&&Math.min(q[0][Re],q[1][Re])<=0&&Math.max(q[0][Re],q[1][Re])>=0&&this._lines.drawZero(Ce,Re,this.bounds,me,this.zeroLineColor[Re],this.zeroLineWidth[Re]*this.pixelRatio)}}for(var _e=0;_e<3;++_e){this.lineEnable[_e]&&this._lines.drawAxisLine(_e,this.bounds,oe[_e].primalOffset,this.lineColor[_e],this.lineWidth[_e]*this.pixelRatio),this.lineMirror[_e]&&this._lines.drawAxisLine(_e,this.bounds,oe[_e].mirrorOffset,this.lineColor[_e],this.lineWidth[_e]*this.pixelRatio);for(var Be=f(C,oe[_e].primalMinor),Ze=f(T,oe[_e].mirrorMinor),Ge=this.lineTickLength,fe=0;fe<3;++fe){var tt=se/W[5*fe];Be[fe]*=Ge[fe]*tt,Ze[fe]*=Ge[fe]*tt}this.lineTickEnable[_e]&&this._lines.drawAxisTicks(_e,oe[_e].primalOffset,Be,this.lineTickColor[_e],this.lineTickWidth[_e]*this.pixelRatio),this.lineTickMirror[_e]&&this._lines.drawAxisTicks(_e,oe[_e].mirrorOffset,Ze,this.lineTickColor[_e],this.lineTickWidth[_e]*this.pixelRatio)}this._lines.unbind(),this._text.bind(W,F,H,this.pixelRatio);var _t,mt=.5,vt,ct;function Ae(Et){ct=[0,0,0],ct[Et]=1}function Oe(Et,Gt,Qt){var vr=(Et+1)%3,mr=(Et+2)%3,Yr=Gt[vr],ii=Gt[mr],Lr=Qt[vr],ci=Qt[mr];if(Yr>0&&ci>0){Ae(vr);return}else if(Yr>0&&ci<0){Ae(vr);return}else if(Yr<0&&ci>0){Ae(vr);return}else if(Yr<0&&ci<0){Ae(vr);return}else if(ii>0&&Lr>0){Ae(mr);return}else if(ii>0&&Lr<0){Ae(mr);return}else if(ii<0&&Lr>0){Ae(mr);return}else if(ii<0&&Lr<0){Ae(mr);return}}for(var _e=0;_e<3;++_e){for(var Le=oe[_e].primalMinor,nt=oe[_e].mirrorMinor,xt=f(N,oe[_e].primalOffset),fe=0;fe<3;++fe)this.lineTickEnable[_e]&&(xt[fe]+=se*Le[fe]*Math.max(this.lineTickLength[fe],0)/W[5*fe]);var ut=[0,0,0];if(ut[_e]=1,this.tickEnable[_e]){this.tickAngle[_e]===-3600?(this.tickAngle[_e]=0,this.tickAlign[_e]="auto"):this.tickAlign[_e]=-1,vt=1,_t=[this.tickAlign[_e],mt,vt],_t[0]==="auto"?_t[0]=g:_t[0]=parseInt(""+_t[0]),ct=[0,0,0],Oe(_e,Le,nt);for(var fe=0;fe<3;++fe)xt[fe]+=se*Le[fe]*this.tickPad[fe]/W[5*fe];this._text.drawTicks(_e,this.tickSize[_e],this.tickAngle[_e],xt,this.tickColor[_e],ut,ct,_t)}if(this.labelEnable[_e]){vt=0,ct=[0,0,0],this.labels[_e].length>4&&(Ae(_e),vt=1),_t=[this.labelAlign[_e],mt,vt],_t[0]==="auto"?_t[0]=g:_t[0]=parseInt(""+_t[0]);for(var fe=0;fe<3;++fe)xt[fe]+=se*Le[fe]*this.labelPad[fe]/W[5*fe];xt[_e]+=.5*(q[0][_e]+q[1][_e]),this._text.drawLabel(_e,this.labelSize[_e],this.labelAngle[_e],xt,this.labelColor[_e],[0,0,0],ct,_t)}}this._text.unbind()},w.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function B(U,V){var W=new k(U);return W.update(V),W}},3840:function(i){i.exports=E;var n=0,a=1;function l(I,M,p,g,C,T){this._color=I,this.key=M,this.value=p,this.left=g,this.right=C,this._count=T}function o(I){return new l(I._color,I.key,I.value,I.left,I.right,I._count)}function u(I,M){return new l(I,M.key,M.value,M.left,M.right,M._count)}function s(I){I._count=1+(I.left?I.left._count:0)+(I.right?I.right._count:0)}function h(I,M){this._compare=I,this.root=M}var m=h.prototype;Object.defineProperty(m,"keys",{get:function(){var I=[];return this.forEach(function(M,p){I.push(M)}),I}}),Object.defineProperty(m,"values",{get:function(){var I=[];return this.forEach(function(M,p){I.push(p)}),I}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(I,M){for(var p=this._compare,g=this.root,C=[],T=[];g;){var N=p(I,g.key);C.push(g),T.push(N),N<=0?g=g.left:g=g.right}C.push(new l(n,I,M,null,null,1));for(var B=C.length-2;B>=0;--B){var g=C[B];T[B]<=0?C[B]=new l(g._color,g.key,g.value,C[B+1],g.right,g._count+1):C[B]=new l(g._color,g.key,g.value,g.left,C[B+1],g._count+1)}for(var B=C.length-1;B>1;--B){var U=C[B-1],g=C[B];if(U._color===a||g._color===a)break;var V=C[B-2];if(V.left===U)if(U.left===g){var W=V.right;if(W&&W._color===n)U._color=a,V.right=u(a,W),V._color=n,B-=1;else{if(V._color=n,V.left=U.right,U._color=a,U.right=V,C[B-2]=U,C[B-1]=g,s(V),s(U),B>=3){var F=C[B-3];F.left===V?F.left=U:F.right=U}break}}else{var W=V.right;if(W&&W._color===n)U._color=a,V.right=u(a,W),V._color=n,B-=1;else{if(U.right=g.left,V._color=n,V.left=g.right,g._color=a,g.left=U,g.right=V,C[B-2]=g,C[B-1]=U,s(V),s(U),s(g),B>=3){var F=C[B-3];F.left===V?F.left=g:F.right=g}break}}else if(U.right===g){var W=V.left;if(W&&W._color===n)U._color=a,V.left=u(a,W),V._color=n,B-=1;else{if(V._color=n,V.right=U.left,U._color=a,U.left=V,C[B-2]=U,C[B-1]=g,s(V),s(U),B>=3){var F=C[B-3];F.right===V?F.right=U:F.left=U}break}}else{var W=V.left;if(W&&W._color===n)U._color=a,V.left=u(a,W),V._color=n,B-=1;else{if(U.left=g.right,V._color=n,V.right=g.left,g._color=a,g.right=U,g.left=V,C[B-2]=g,C[B-1]=U,s(V),s(U),s(g),B>=3){var F=C[B-3];F.right===V?F.right=g:F.left=g}break}}}return C[0]._color=a,new h(p,C[0])};function b(I,M){if(M.left){var p=b(I,M.left);if(p)return p}var p=I(M.key,M.value);if(p)return p;if(M.right)return b(I,M.right)}function x(I,M,p,g){var C=M(I,g.key);if(C<=0){if(g.left){var T=x(I,M,p,g.left);if(T)return T}var T=p(g.key,g.value);if(T)return T}if(g.right)return x(I,M,p,g.right)}function _(I,M,p,g,C){var T=p(I,C.key),N=p(M,C.key),B;if(T<=0&&(C.left&&(B=_(I,M,p,g,C.left),B)||N>0&&(B=g(C.key,C.value),B)))return B;if(N>0&&C.right)return _(I,M,p,g,C.right)}m.forEach=function(I,M,p){if(this.root)switch(arguments.length){case 1:return b(I,this.root);case 2:return x(M,this._compare,I,this.root);case 3:return this._compare(M,p)>=0?void 0:_(M,p,this._compare,I,this.root)}},Object.defineProperty(m,"begin",{get:function(){for(var I=[],M=this.root;M;)I.push(M),M=M.left;return new A(this,I)}}),Object.defineProperty(m,"end",{get:function(){for(var I=[],M=this.root;M;)I.push(M),M=M.right;return new A(this,I)}}),m.at=function(I){if(I<0)return new A(this,[]);for(var M=this.root,p=[];;){if(p.push(M),M.left){if(I=M.right._count)break;M=M.right}else break}return new A(this,[])},m.ge=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T<=0&&(C=g.length),T<=0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.gt=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T<0&&(C=g.length),T<0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.lt=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T>0&&(C=g.length),T<=0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.le=function(I){for(var M=this._compare,p=this.root,g=[],C=0;p;){var T=M(I,p.key);g.push(p),T>=0&&(C=g.length),T<0?p=p.left:p=p.right}return g.length=C,new A(this,g)},m.find=function(I){for(var M=this._compare,p=this.root,g=[];p;){var C=M(I,p.key);if(g.push(p),C===0)return new A(this,g);C<=0?p=p.left:p=p.right}return new A(this,[])},m.remove=function(I){var M=this.find(I);return M?M.remove():this},m.get=function(I){for(var M=this._compare,p=this.root;p;){var g=M(I,p.key);if(g===0)return p.value;g<=0?p=p.left:p=p.right}};function A(I,M){this.tree=I,this._stack=M}var f=A.prototype;Object.defineProperty(f,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(f,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),f.clone=function(){return new A(this.tree,this._stack.slice())};function k(I,M){I.key=M.key,I.value=M.value,I.left=M.left,I.right=M.right,I._color=M._color,I._count=M._count}function w(I){for(var M,p,g,C,T=I.length-1;T>=0;--T){if(M=I[T],T===0){M._color=a;return}if(p=I[T-1],p.left===M){if(g=p.right,g.right&&g.right._color===n){if(g=p.right=o(g),C=g.right=o(g.right),p.right=g.left,g.left=p,g.right=C,g._color=p._color,M._color=a,p._color=a,C._color=a,s(p),s(g),T>1){var N=I[T-2];N.left===p?N.left=g:N.right=g}I[T-1]=g;return}else if(g.left&&g.left._color===n){if(g=p.right=o(g),C=g.left=o(g.left),p.right=C.left,g.left=C.right,C.left=p,C.right=g,C._color=p._color,p._color=a,g._color=a,M._color=a,s(p),s(g),s(C),T>1){var N=I[T-2];N.left===p?N.left=C:N.right=C}I[T-1]=C;return}if(g._color===a)if(p._color===n){p._color=a,p.right=u(n,g);return}else{p.right=u(n,g);continue}else{if(g=o(g),p.right=g.left,g.left=p,g._color=p._color,p._color=n,s(p),s(g),T>1){var N=I[T-2];N.left===p?N.left=g:N.right=g}I[T-1]=g,I[T]=p,T+11){var N=I[T-2];N.right===p?N.right=g:N.left=g}I[T-1]=g;return}else if(g.right&&g.right._color===n){if(g=p.left=o(g),C=g.right=o(g.right),p.left=C.right,g.right=C.left,C.right=p,C.left=g,C._color=p._color,p._color=a,g._color=a,M._color=a,s(p),s(g),s(C),T>1){var N=I[T-2];N.right===p?N.right=C:N.left=C}I[T-1]=C;return}if(g._color===a)if(p._color===n){p._color=a,p.left=u(n,g);return}else{p.left=u(n,g);continue}else{if(g=o(g),p.left=g.right,g.right=p,g._color=p._color,p._color=n,s(p),s(g),T>1){var N=I[T-2];N.right===p?N.right=g:N.left=g}I[T-1]=g,I[T]=p,T+1=0;--g){var p=I[g];p.left===I[g+1]?M[g]=new l(p._color,p.key,p.value,M[g+1],p.right,p._count):M[g]=new l(p._color,p.key,p.value,p.left,M[g+1],p._count)}if(p=M[M.length-1],p.left&&p.right){var C=M.length;for(p=p.left;p.right;)M.push(p),p=p.right;var T=M[C-1];M.push(new l(p._color,T.key,T.value,p.left,p.right,p._count)),M[C-1].key=p.key,M[C-1].value=p.value;for(var g=M.length-2;g>=C;--g)p=M[g],M[g]=new l(p._color,p.key,p.value,p.left,M[g+1],p._count);M[C-1].left=M[C]}if(p=M[M.length-1],p._color===n){var N=M[M.length-2];N.left===p?N.left=null:N.right===p&&(N.right=null),M.pop();for(var g=0;g0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(f,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(f,"index",{get:function(){var I=0,M=this._stack;if(M.length===0){var p=this.tree.root;return p?p._count:0}else M[M.length-1].left&&(I=M[M.length-1].left._count);for(var g=M.length-2;g>=0;--g)M[g+1]===M[g].right&&(++I,M[g].left&&(I+=M[g].left._count));return I},enumerable:!0}),f.next=function(){var I=this._stack;if(I.length!==0){var M=I[I.length-1];if(M.right)for(M=M.right;M;)I.push(M),M=M.left;else for(I.pop();I.length>0&&I[I.length-1].right===M;)M=I[I.length-1],I.pop()}},Object.defineProperty(f,"hasNext",{get:function(){var I=this._stack;if(I.length===0)return!1;if(I[I.length-1].right)return!0;for(var M=I.length-1;M>0;--M)if(I[M-1].left===I[M])return!0;return!1}}),f.update=function(I){var M=this._stack;if(M.length===0)throw new Error("Can't update empty node!");var p=new Array(M.length),g=M[M.length-1];p[p.length-1]=new l(g._color,g.key,I,g.left,g.right,g._count);for(var C=M.length-2;C>=0;--C)g=M[C],g.left===M[C+1]?p[C]=new l(g._color,g.key,g.value,p[C+1],g.right,g._count):p[C]=new l(g._color,g.key,g.value,g.left,p[C+1],g._count);return new h(this.tree._compare,p[0])},f.prev=function(){var I=this._stack;if(I.length!==0){var M=I[I.length-1];if(M.left)for(M=M.left;M;)I.push(M),M=M.right;else for(I.pop();I.length>0&&I[I.length-1].left===M;)M=I[I.length-1],I.pop()}},Object.defineProperty(f,"hasPrev",{get:function(){var I=this._stack;if(I.length===0)return!1;if(I[I.length-1].left)return!0;for(var M=I.length-1;M>0;--M)if(I[M-1].right===I[M])return!0;return!1}});function D(I,M){return IM?1:0}function E(I){return new h(I||D,null)}},3865:function(i,n,a){var l=a(869);i.exports=o;function o(u,s){return l(u[0].mul(s[1]).add(s[0].mul(u[1])),u[1].mul(s[1]))}},3952:function(i,n,a){i.exports=u;var l=a(3250);function o(s,h){for(var m=new Array(h+1),b=0;b20?52:m+32}},4040:function(i){i.exports=n;function n(a,l,o,u,s,h,m){var b=1/(l-o),x=1/(u-s),_=1/(h-m);return a[0]=-2*b,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*x,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*_,a[11]=0,a[12]=(l+o)*b,a[13]=(s+u)*x,a[14]=(m+h)*_,a[15]=1,a}},4041:function(i){i.exports=n;function n(a,l,o){var u=l[0],s=l[1],h=l[2],m=o[0],b=o[1],x=o[2],_=o[3],A=_*u+b*h-x*s,f=_*s+x*u-m*h,k=_*h+m*s-b*u,w=-m*u-b*s-x*h;return a[0]=A*_+w*-m+f*-x-k*-b,a[1]=f*_+w*-b+k*-m-A*-x,a[2]=k*_+w*-x+A*-b-f*-m,a[3]=l[3],a}},4081:function(i){i.exports=n;function n(a,l,o,u,s,h,m,b,x,_){var A=l+h+_;if(f>0){var f=Math.sqrt(A+1);a[0]=.5*(m-x)/f,a[1]=.5*(b-u)/f,a[2]=.5*(o-h)/f,a[3]=.5*f}else{var k=Math.max(l,h,_),f=Math.sqrt(2*k-A+1);l>=k?(a[0]=.5*f,a[1]=.5*(s+o)/f,a[2]=.5*(b+u)/f,a[3]=.5*(m-x)/f):h>=k?(a[0]=.5*(o+s)/f,a[1]=.5*f,a[2]=.5*(x+m)/f,a[3]=.5*(b-u)/f):(a[0]=.5*(u+b)/f,a[1]=.5*(m+x)/f,a[2]=.5*f,a[3]=.5*(o-s)/f)}return a}},4100:function(i,n,a){var l=a(4437),o=a(3837),u=a(5445),s=a(4449),h=a(3589),m=a(2260),b=a(7169),x=a(351),_=a(4772),A=a(4040),f=a(799),k=a(9216)({tablet:!0,featureDetect:!0});i.exports={createScene:M,createCamera:l};function w(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function D(g,C){var T=null;try{T=g.getContext("webgl",C),T||(T=g.getContext("experimental-webgl",C))}catch{return null}return T}function E(g){var C=Math.round(Math.log(Math.abs(g))/Math.log(10));if(C<0){var T=Math.round(Math.pow(10,-C));return Math.ceil(g*T)/T}else if(C>0){var T=Math.round(Math.pow(10,C));return Math.ceil(g/T)*T}return Math.ceil(g)}function I(g){return typeof g=="boolean"?g:!0}function M(g){g=g||{},g.camera=g.camera||{};var C=g.canvas;if(!C)if(C=document.createElement("canvas"),g.container){var T=g.container;T.appendChild(C)}else document.body.appendChild(C);var N=g.gl;if(N||(g.glOptions&&(k=!!g.glOptions.preserveDrawingBuffer),N=D(C,g.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:k})),!N)throw new Error("webgl not supported");var B=g.bounds||[[-10,-10,-10],[10,10,10]],U=new w,V=m(N,N.drawingBufferWidth,N.drawingBufferHeight,{preferFloat:!k}),W=f(N),F=g.cameraObject&&g.cameraObject._ortho===!0||g.camera.projection&&g.camera.projection.type==="orthographic"||!1,H={eye:g.camera.eye||[2,0,0],center:g.camera.center||[0,0,0],up:g.camera.up||[0,1,0],zoomMin:g.camera.zoomMax||.1,zoomMax:g.camera.zoomMin||100,mode:g.camera.mode||"turntable",_ortho:F},q=g.axes||{},G=o(N,q);G.enable=!q.disable;var ee=g.spikes||{},he=s(N,ee),be=[],ve=[],ce=[],re=[],ge=!0,oe=!0,ne=new Array(16),se=new Array(16),_e={view:null,projection:ne,model:se,_ortho:!1},oe=!0,J=[N.drawingBufferWidth,N.drawingBufferHeight],me=g.cameraObject||l(C,H),fe={gl:N,contextLost:!1,pixelRatio:g.pixelRatio||1,canvas:C,selection:U,camera:me,axes:G,axesPixels:null,spikes:he,bounds:B,objects:be,shape:J,aspect:g.aspectRatio||[1,1,1],pickRadius:g.pickRadius||10,zNear:g.zNear||.01,zFar:g.zFar||1e3,fovy:g.fovy||Math.PI/4,clearColor:g.clearColor||[0,0,0,0],autoResize:I(g.autoResize),autoBounds:I(g.autoBounds),autoScale:!!g.autoScale,autoCenter:I(g.autoCenter),clipToBounds:I(g.clipToBounds),snapToData:!!g.snapToData,onselect:g.onselect||null,onrender:g.onrender||null,onclick:g.onclick||null,cameraParams:_e,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ct){this.aspect[0]=ct.x,this.aspect[1]=ct.y,this.aspect[2]=ct.z,oe=!0},setBounds:function(ct,Ae){this.bounds[0][ct]=Ae.min,this.bounds[1][ct]=Ae.max},setClearColor:function(ct){this.clearColor=ct},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},Ce=[N.drawingBufferWidth/fe.pixelRatio|0,N.drawingBufferHeight/fe.pixelRatio|0];function Re(){if(!fe._stopped&&fe.autoResize){var ct=C.parentNode,Ae=1,Oe=1;ct&&ct!==document.body?(Ae=ct.clientWidth,Oe=ct.clientHeight):(Ae=window.innerWidth,Oe=window.innerHeight);var Le=Math.ceil(Ae*fe.pixelRatio)|0,nt=Math.ceil(Oe*fe.pixelRatio)|0;if(Le!==C.width||nt!==C.height){C.width=Le,C.height=nt;var xt=C.style;xt.position=xt.position||"absolute",xt.left="0px",xt.top="0px",xt.width=Ae+"px",xt.height=Oe+"px",ge=!0}}}fe.autoResize&&Re(),window.addEventListener("resize",Re);function Be(){for(var ct=be.length,Ae=re.length,Oe=0;Oe0&&ce[Ae-1]===0;)ce.pop(),re.pop().dispose()}fe.update=function(ct){fe._stopped||(ge=!0,oe=!0)},fe.add=function(ct){fe._stopped||(ct.axes=G,be.push(ct),ve.push(-1),ge=!0,oe=!0,Be())},fe.remove=function(ct){if(!fe._stopped){var Ae=be.indexOf(ct);Ae<0||(be.splice(Ae,1),ve.pop(),ge=!0,oe=!0,Be())}},fe.dispose=function(){if(!fe._stopped&&(fe._stopped=!0,window.removeEventListener("resize",Re),C.removeEventListener("webglcontextlost",Ze),fe.mouseListener.enabled=!1,!fe.contextLost)){G.dispose(),he.dispose();for(var ct=0;ctU.distance)continue;for(var Qt=0;Qt_;){var p=f[M-2],g=f[M-1];if(pf[A+1]:!0}function b(_,A,f,k){_*=2;var w=k[_];return w>1,I=E-k,M=E+k,p=w,g=I,C=E,T=M,N=D,B=_+1,U=A-1,V=0;m(p,g,f)&&(V=p,p=g,g=V),m(T,N,f)&&(V=T,T=N,N=V),m(p,C,f)&&(V=p,p=C,C=V),m(g,C,f)&&(V=g,g=C,C=V),m(p,T,f)&&(V=p,p=T,T=V),m(C,T,f)&&(V=C,C=T,T=V),m(g,N,f)&&(V=g,g=N,N=V),m(g,C,f)&&(V=g,g=C,C=V),m(T,N,f)&&(V=T,T=N,N=V);for(var W=f[2*g],F=f[2*g+1],H=f[2*T],q=f[2*T+1],G=2*p,ee=2*C,he=2*N,be=2*w,ve=2*E,ce=2*D,re=0;re<2;++re){var ge=f[G+re],ne=f[ee+re],se=f[he+re];f[be+re]=ge,f[ve+re]=ne,f[ce+re]=se}u(I,_,f),u(M,A,f);for(var _e=B;_e<=U;++_e)if(b(_e,W,F,f))_e!==B&&o(_e,B,f),++B;else if(!b(_e,H,q,f))for(;;)if(b(U,H,q,f)){b(U,W,F,f)?(s(_e,B,U,f),++B,--U):(o(_e,U,f),--U);break}else{if(--U<_e)break;continue}h(_,B-1,W,F,f),h(A,U+1,H,q,f),B-2-_<=n?l(_,B-2,f):x(_,B-2,f),A-(U+2)<=n?l(U+2,A,f):x(U+2,A,f),U-B<=n?l(B,U,f):x(B,U,f)}},4209:function(i,n,a){i.exports=f;var l=a(2478),o=a(3840),u=a(3250),s=a(1303);function h(k,w,D){this.slabs=k,this.coordinates=w,this.horizontal=D}var m=h.prototype;function b(k,w){return k.y-w}function x(k,w){for(var D=null;k;){var E=k.key,I,M;E[0][0]0)if(w[0]!==E[1][0])D=k,k=k.right;else{var g=x(k.right,w);if(g)return g;k=k.left}else{if(w[0]!==E[1][0])return k;var g=x(k.right,w);if(g)return g;k=k.left}}return D}m.castUp=function(k){var w=l.le(this.coordinates,k[0]);if(w<0)return-1;this.slabs[w];var D=x(this.slabs[w],k),E=-1;if(D&&(E=D.value),this.coordinates[w]===k[0]){var I=null;if(D&&(I=D.key),w>0){var M=x(this.slabs[w-1],k);M&&(I?s(M.key,I)>0&&(I=M.key,E=M.value):(E=M.value,I=M.key))}var p=this.horizontal[w];if(p.length>0){var g=l.ge(p,k[1],b);if(g=p.length)return E;C=p[g]}}if(C.start)if(I){var T=u(I[0],I[1],[k[0],C.y]);I[0][0]>I[1][0]&&(T=-T),T>0&&(E=C.index)}else E=C.index;else C.y!==k[1]&&(E=C.index)}}}return E};function _(k,w,D,E){this.y=k,this.index=w,this.start=D,this.closed=E}function A(k,w,D,E){this.x=k,this.segment=w,this.create=D,this.index=E}function f(k){for(var w=k.length,D=2*w,E=new Array(D),I=0;IMath.abs(g))f.rotate(N,0,0,-p*C*Math.PI*I.rotateSpeed/window.innerWidth);else if(!I._ortho){var B=-I.zoomSpeed*T*g/window.innerHeight*(N-f.lastT())/20;f.pan(N,0,0,w*(Math.exp(B)-1))}}},!0)},I.enableMouseListeners(),I}},4449:function(i,n,a){var l=a(2762),o=a(8116),u=a(1493);i.exports=A;var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(f,k,w,D){this.gl=f,this.buffer=k,this.vao=w,this.shader=D,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var m=h.prototype,b=[0,0,0],x=[0,0,0],_=[0,0];m.isTransparent=function(){return!1},m.drawTransparent=function(f){},m.draw=function(f){var k=this.gl,w=this.vao,D=this.shader;w.bind(),D.bind();var E=f.model||s,I=f.view||s,M=f.projection||s,p;this.axes&&(p=this.axes.lastCubeProps.axis);for(var g=b,C=x,T=0;T<3;++T)p&&p[T]<0?(g[T]=this.bounds[0][T],C[T]=this.bounds[1][T]):(g[T]=this.bounds[1][T],C[T]=this.bounds[0][T]);_[0]=k.drawingBufferWidth,_[1]=k.drawingBufferHeight,D.uniforms.model=E,D.uniforms.view=I,D.uniforms.projection=M,D.uniforms.coordinates=[this.position,g,C],D.uniforms.colors=this.colors,D.uniforms.screenShape=_;for(var T=0;T<3;++T)D.uniforms.lineWidth=this.lineWidth[T]*this.pixelRatio,this.enabled[T]&&(w.draw(k.TRIANGLES,6,6*T),this.drawSides[T]&&w.draw(k.TRIANGLES,12,18+12*T));w.unbind()},m.update=function(f){f&&("bounds"in f&&(this.bounds=f.bounds),"position"in f&&(this.position=f.position),"lineWidth"in f&&(this.lineWidth=f.lineWidth),"colors"in f&&(this.colors=f.colors),"enabled"in f&&(this.enabled=f.enabled),"drawSides"in f&&(this.drawSides=f.drawSides))},m.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function A(f,k){var w=[];function D(g,C,T,N,B,U){var V=[g,C,T,0,0,0,1];V[N+3]=1,V[N]=B,w.push.apply(w,V),V[6]=-1,w.push.apply(w,V),V[N]=U,w.push.apply(w,V),w.push.apply(w,V),V[6]=1,w.push.apply(w,V),V[N]=B,w.push.apply(w,V)}D(0,0,0,0,0,1),D(0,0,0,1,0,1),D(0,0,0,2,0,1),D(1,0,0,1,-1,1),D(1,0,0,2,-1,1),D(0,1,0,0,-1,1),D(0,1,0,2,-1,1),D(0,0,1,0,-1,1),D(0,0,1,1,-1,1);var E=l(f,w),I=o(f,[{type:f.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:f.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:f.FLOAT,buffer:E,size:1,offset:24,stride:28}]),M=u(f);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.weight.location=2;var p=new h(f,E,I,M);return p.update(k),p}},4494:function(i){i.exports=n;function n(a,l){return a[0]=1/l[0],a[1]=1/l[1],a[2]=1/l[2],a[3]=1/l[3],a}},4505:function(i,n,a){i.exports=a(5847)},4578:function(i){i.exports=n;function n(a,l,o,u,s){return a[0]=l,a[1]=o,a[2]=u,a[3]=s,a}},4623:function(i){"use restrict";i.exports=n;function n(a){this.roots=new Array(a),this.ranks=new Array(a);for(var l=0;l0)return 1<=0)return 1<=0;--f)m[f]=b*l[f]+x*o[f]+_*u[f]+A*s[f];return m}return b*l+x*o+_*u[f]+A*s}function a(l,o,u,s,h,m){var b=h-1,x=h*h,_=b*b,A=(1+2*h)*_,f=h*_,k=x*(3-2*h),w=x*b;if(l.length){m||(m=new Array(l.length));for(var D=l.length-1;D>=0;--D)m[D]=A*l[D]+f*o[D]+k*u[D]+w*s[D];return m}return A*l+f*o+k*u+w*s}i.exports=a,i.exports.derivative=n},4772:function(i){i.exports=n;function n(a,l,o,u,s){var h=1/Math.tan(l/2),m=1/(u-s);return a[0]=h/o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(s+u)*m,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*s*u*m,a[15]=0,a}},4793:function(i,n,a){function l(ye,Pe){if(!(ye instanceof Pe))throw new TypeError("Cannot call a class as a function")}function o(ye,Pe){for(var He=0;HeM)throw new RangeError('The value "'+ye+'" is invalid for option "size"');var Pe=new Uint8Array(ye);return Object.setPrototypeOf(Pe,C.prototype),Pe}function C(ye,Pe,He){if(typeof ye=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return U(ye)}return T(ye,Pe,He)}C.poolSize=8192;function T(ye,Pe,He){if(typeof ye=="string")return V(ye,Pe);if(ArrayBuffer.isView(ye))return F(ye);if(ye==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+w(ye));if(vi(ye,ArrayBuffer)||ye&&vi(ye.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(vi(ye,SharedArrayBuffer)||ye&&vi(ye.buffer,SharedArrayBuffer)))return H(ye,Pe,He);if(typeof ye=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=ye.valueOf&&ye.valueOf();if(at!=null&&at!==ye)return C.from(at,Pe,He);var ht=q(ye);if(ht)return ht;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ye[Symbol.toPrimitive]=="function")return C.from(ye[Symbol.toPrimitive]("string"),Pe,He);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+w(ye))}C.from=function(ye,Pe,He){return T(ye,Pe,He)},Object.setPrototypeOf(C.prototype,Uint8Array.prototype),Object.setPrototypeOf(C,Uint8Array);function N(ye){if(typeof ye!="number")throw new TypeError('"size" argument must be of type number');if(ye<0)throw new RangeError('The value "'+ye+'" is invalid for option "size"')}function B(ye,Pe,He){return N(ye),ye<=0?g(ye):Pe!==void 0?typeof He=="string"?g(ye).fill(Pe,He):g(ye).fill(Pe):g(ye)}C.alloc=function(ye,Pe,He){return B(ye,Pe,He)};function U(ye){return N(ye),g(ye<0?0:G(ye)|0)}C.allocUnsafe=function(ye){return U(ye)},C.allocUnsafeSlow=function(ye){return U(ye)};function V(ye,Pe){if((typeof Pe!="string"||Pe==="")&&(Pe="utf8"),!C.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);var He=ee(ye,Pe)|0,at=g(He),ht=at.write(ye,Pe);return ht!==He&&(at=at.slice(0,ht)),at}function W(ye){for(var Pe=ye.length<0?0:G(ye.length)|0,He=g(Pe),at=0;at=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return ye|0}C.isBuffer=function(ye){return ye!=null&&ye._isBuffer===!0&&ye!==C.prototype},C.compare=function(ye,Pe){if(vi(ye,Uint8Array)&&(ye=C.from(ye,ye.offset,ye.byteLength)),vi(Pe,Uint8Array)&&(Pe=C.from(Pe,Pe.offset,Pe.byteLength)),!C.isBuffer(ye)||!C.isBuffer(Pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ye===Pe)return 0;for(var He=ye.length,at=Pe.length,ht=0,At=Math.min(He,at);htat.length?(C.isBuffer(At)||(At=C.from(At)),At.copy(at,ht)):Uint8Array.prototype.set.call(at,At,ht);else if(C.isBuffer(At))At.copy(at,ht);else throw new TypeError('"list" argument must be an Array of Buffers');ht+=At.length}return at};function ee(ye,Pe){if(C.isBuffer(ye))return ye.length;if(ArrayBuffer.isView(ye)||vi(ye,ArrayBuffer))return ye.byteLength;if(typeof ye!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+w(ye));var He=ye.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&He===0)return 0;for(var ht=!1;;)switch(Pe){case"ascii":case"latin1":case"binary":return He;case"utf8":case"utf-8":return mr(ye).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return He*2;case"hex":return He>>>1;case"base64":return Lr(ye).length;default:if(ht)return at?-1:mr(ye).length;Pe=(""+Pe).toLowerCase(),ht=!0}}C.byteLength=ee;function he(ye,Pe,He){var at=!1;if((Pe===void 0||Pe<0)&&(Pe=0),Pe>this.length||((He===void 0||He>this.length)&&(He=this.length),He<=0)||(He>>>=0,Pe>>>=0,He<=Pe))return"";for(ye||(ye="utf8");;)switch(ye){case"hex":return Be(this,Pe,He);case"utf8":case"utf-8":return J(this,Pe,He);case"ascii":return Ce(this,Pe,He);case"latin1":case"binary":return Re(this,Pe,He);case"base64":return oe(this,Pe,He);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,Pe,He);default:if(at)throw new TypeError("Unknown encoding: "+ye);ye=(ye+"").toLowerCase(),at=!0}}C.prototype._isBuffer=!0;function be(ye,Pe,He){var at=ye[Pe];ye[Pe]=ye[He],ye[He]=at}C.prototype.swap16=function(){var ye=this.length;if(ye%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Pe=0;PePe&&(ye+=" ... "),""},I&&(C.prototype[I]=C.prototype.inspect),C.prototype.compare=function(ye,Pe,He,at,ht){if(vi(ye,Uint8Array)&&(ye=C.from(ye,ye.offset,ye.byteLength)),!C.isBuffer(ye))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+w(ye));if(Pe===void 0&&(Pe=0),He===void 0&&(He=ye?ye.length:0),at===void 0&&(at=0),ht===void 0&&(ht=this.length),Pe<0||He>ye.length||at<0||ht>this.length)throw new RangeError("out of range index");if(at>=ht&&Pe>=He)return 0;if(at>=ht)return-1;if(Pe>=He)return 1;if(Pe>>>=0,He>>>=0,at>>>=0,ht>>>=0,this===ye)return 0;for(var At=ht-at,Wt=He-Pe,Yt=Math.min(At,Wt),hr=this.slice(at,ht),zr=ye.slice(Pe,He),Dr=0;Dr2147483647?He=2147483647:He<-2147483648&&(He=-2147483648),He=+He,Ot(He)&&(He=ht?0:ye.length-1),He<0&&(He=ye.length+He),He>=ye.length){if(ht)return-1;He=ye.length-1}else if(He<0)if(ht)He=0;else return-1;if(typeof Pe=="string"&&(Pe=C.from(Pe,at)),C.isBuffer(Pe))return Pe.length===0?-1:ce(ye,Pe,He,at,ht);if(typeof Pe=="number")return Pe=Pe&255,typeof Uint8Array.prototype.indexOf=="function"?ht?Uint8Array.prototype.indexOf.call(ye,Pe,He):Uint8Array.prototype.lastIndexOf.call(ye,Pe,He):ce(ye,[Pe],He,at,ht);throw new TypeError("val must be string, number or Buffer")}function ce(ye,Pe,He,at,ht){var At=1,Wt=ye.length,Yt=Pe.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(ye.length<2||Pe.length<2)return-1;At=2,Wt/=2,Yt/=2,He/=2}function hr(un,cn){return At===1?un[cn]:un.readUInt16BE(cn*At)}var zr;if(ht){var Dr=-1;for(zr=He;zrWt&&(He=Wt-Yt),zr=He;zr>=0;zr--){for(var br=!0,fi=0;fiht&&(at=ht)):at=ht;var At=Pe.length;at>At/2&&(at=At/2);var Wt;for(Wt=0;Wt>>0,isFinite(He)?(He=He>>>0,at===void 0&&(at="utf8")):(at=He,He=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ht=this.length-Pe;if((He===void 0||He>ht)&&(He=ht),ye.length>0&&(He<0||Pe<0)||Pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");at||(at="utf8");for(var At=!1;;)switch(at){case"hex":return re(this,ye,Pe,He);case"utf8":case"utf-8":return ge(this,ye,Pe,He);case"ascii":case"latin1":case"binary":return ne(this,ye,Pe,He);case"base64":return se(this,ye,Pe,He);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,ye,Pe,He);default:if(At)throw new TypeError("Unknown encoding: "+at);at=(""+at).toLowerCase(),At=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(ye,Pe,He){return Pe===0&&He===ye.length?D.fromByteArray(ye):D.fromByteArray(ye.slice(Pe,He))}function J(ye,Pe,He){He=Math.min(ye.length,He);for(var at=[],ht=Pe;ht239?4:At>223?3:At>191?2:1;if(ht+Yt<=He){var hr=void 0,zr=void 0,Dr=void 0,br=void 0;switch(Yt){case 1:At<128&&(Wt=At);break;case 2:hr=ye[ht+1],(hr&192)===128&&(br=(At&31)<<6|hr&63,br>127&&(Wt=br));break;case 3:hr=ye[ht+1],zr=ye[ht+2],(hr&192)===128&&(zr&192)===128&&(br=(At&15)<<12|(hr&63)<<6|zr&63,br>2047&&(br<55296||br>57343)&&(Wt=br));break;case 4:hr=ye[ht+1],zr=ye[ht+2],Dr=ye[ht+3],(hr&192)===128&&(zr&192)===128&&(Dr&192)===128&&(br=(At&15)<<18|(hr&63)<<12|(zr&63)<<6|Dr&63,br>65535&&br<1114112&&(Wt=br))}}Wt===null?(Wt=65533,Yt=1):Wt>65535&&(Wt-=65536,at.push(Wt>>>10&1023|55296),Wt=56320|Wt&1023),at.push(Wt),ht+=Yt}return fe(at)}var me=4096;function fe(ye){var Pe=ye.length;if(Pe<=me)return String.fromCharCode.apply(String,ye);for(var He="",at=0;atat)&&(He=at);for(var ht="",At=Pe;AtHe&&(ye=He),Pe<0?(Pe+=He,Pe<0&&(Pe=0)):Pe>He&&(Pe=He),PeHe)throw new RangeError("Trying to access beyond buffer length")}C.prototype.readUintLE=C.prototype.readUIntLE=function(ye,Pe,He){ye=ye>>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye],ht=1,At=0;++At>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye+--Pe],ht=1;Pe>0&&(ht*=256);)at+=this[ye+--Pe]*ht;return at},C.prototype.readUint8=C.prototype.readUInt8=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,1,this.length),this[ye]},C.prototype.readUint16LE=C.prototype.readUInt16LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,2,this.length),this[ye]|this[ye+1]<<8},C.prototype.readUint16BE=C.prototype.readUInt16BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,2,this.length),this[ye]<<8|this[ye+1]},C.prototype.readUint32LE=C.prototype.readUInt32LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),(this[ye]|this[ye+1]<<8|this[ye+2]<<16)+this[ye+3]*16777216},C.prototype.readUint32BE=C.prototype.readUInt32BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]*16777216+(this[ye+1]<<16|this[ye+2]<<8|this[ye+3])},C.prototype.readBigUInt64LE=ot(function(ye){ye=ye>>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=Pe+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,24),ht=this[++ye]+this[++ye]*Math.pow(2,8)+this[++ye]*Math.pow(2,16)+He*Math.pow(2,24);return BigInt(at)+(BigInt(ht)<>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=Pe*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye],ht=this[++ye]*Math.pow(2,24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+He;return(BigInt(at)<>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=this[ye],ht=1,At=0;++At=ht&&(at-=Math.pow(2,8*Pe)),at},C.prototype.readIntBE=function(ye,Pe,He){ye=ye>>>0,Pe=Pe>>>0,He||Ge(ye,Pe,this.length);for(var at=Pe,ht=1,At=this[ye+--at];at>0&&(ht*=256);)At+=this[ye+--at]*ht;return ht*=128,At>=ht&&(At-=Math.pow(2,8*Pe)),At},C.prototype.readInt8=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,1,this.length),this[ye]&128?(255-this[ye]+1)*-1:this[ye]},C.prototype.readInt16LE=function(ye,Pe){ye=ye>>>0,Pe||Ge(ye,2,this.length);var He=this[ye]|this[ye+1]<<8;return He&32768?He|4294901760:He},C.prototype.readInt16BE=function(ye,Pe){ye=ye>>>0,Pe||Ge(ye,2,this.length);var He=this[ye+1]|this[ye]<<8;return He&32768?He|4294901760:He},C.prototype.readInt32LE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]|this[ye+1]<<8|this[ye+2]<<16|this[ye+3]<<24},C.prototype.readInt32BE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),this[ye]<<24|this[ye+1]<<16|this[ye+2]<<8|this[ye+3]},C.prototype.readBigInt64LE=ot(function(ye){ye=ye>>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=this[ye+4]+this[ye+5]*Math.pow(2,8)+this[ye+6]*Math.pow(2,16)+(He<<24);return(BigInt(at)<>>0,Et(ye,"offset");var Pe=this[ye],He=this[ye+7];(Pe===void 0||He===void 0)&&Gt(ye,this.length-8);var at=(Pe<<24)+this[++ye]*Math.pow(2,16)+this[++ye]*Math.pow(2,8)+this[++ye];return(BigInt(at)<>>0,Pe||Ge(ye,4,this.length),E.read(this,ye,!0,23,4)},C.prototype.readFloatBE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,4,this.length),E.read(this,ye,!1,23,4)},C.prototype.readDoubleLE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,8,this.length),E.read(this,ye,!0,52,8)},C.prototype.readDoubleBE=function(ye,Pe){return ye=ye>>>0,Pe||Ge(ye,8,this.length),E.read(this,ye,!1,52,8)};function tt(ye,Pe,He,at,ht,At){if(!C.isBuffer(ye))throw new TypeError('"buffer" argument must be a Buffer instance');if(Pe>ht||Peye.length)throw new RangeError("Index out of range")}C.prototype.writeUintLE=C.prototype.writeUIntLE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,He=He>>>0,!at){var ht=Math.pow(2,8*He)-1;tt(this,ye,Pe,He,ht,0)}var At=1,Wt=0;for(this[Pe]=ye&255;++Wt>>0,He=He>>>0,!at){var ht=Math.pow(2,8*He)-1;tt(this,ye,Pe,He,ht,0)}var At=He-1,Wt=1;for(this[Pe+At]=ye&255;--At>=0&&(Wt*=256);)this[Pe+At]=ye/Wt&255;return Pe+He},C.prototype.writeUint8=C.prototype.writeUInt8=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,1,255,0),this[Pe]=ye&255,Pe+1},C.prototype.writeUint16LE=C.prototype.writeUInt16LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,2,65535,0),this[Pe]=ye&255,this[Pe+1]=ye>>>8,Pe+2},C.prototype.writeUint16BE=C.prototype.writeUInt16BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,2,65535,0),this[Pe]=ye>>>8,this[Pe+1]=ye&255,Pe+2},C.prototype.writeUint32LE=C.prototype.writeUInt32LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,4,4294967295,0),this[Pe+3]=ye>>>24,this[Pe+2]=ye>>>16,this[Pe+1]=ye>>>8,this[Pe]=ye&255,Pe+4},C.prototype.writeUint32BE=C.prototype.writeUInt32BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,4,4294967295,0),this[Pe]=ye>>>24,this[Pe+1]=ye>>>16,this[Pe+2]=ye>>>8,this[Pe+3]=ye&255,Pe+4};function _t(ye,Pe,He,at,ht){ut(Pe,at,ht,ye,He,7);var At=Number(Pe&BigInt(4294967295));ye[He++]=At,At=At>>8,ye[He++]=At,At=At>>8,ye[He++]=At,At=At>>8,ye[He++]=At;var Wt=Number(Pe>>BigInt(32)&BigInt(4294967295));return ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,Wt=Wt>>8,ye[He++]=Wt,He}function mt(ye,Pe,He,at,ht){ut(Pe,at,ht,ye,He,7);var At=Number(Pe&BigInt(4294967295));ye[He+7]=At,At=At>>8,ye[He+6]=At,At=At>>8,ye[He+5]=At,At=At>>8,ye[He+4]=At;var Wt=Number(Pe>>BigInt(32)&BigInt(4294967295));return ye[He+3]=Wt,Wt=Wt>>8,ye[He+2]=Wt,Wt=Wt>>8,ye[He+1]=Wt,Wt=Wt>>8,ye[He]=Wt,He+8}C.prototype.writeBigUInt64LE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return _t(this,ye,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeBigUInt64BE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return mt(this,ye,Pe,BigInt(0),BigInt("0xffffffffffffffff"))}),C.prototype.writeIntLE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,!at){var ht=Math.pow(2,8*He-1);tt(this,ye,Pe,He,ht-1,-ht)}var At=0,Wt=1,Yt=0;for(this[Pe]=ye&255;++At>0)-Yt&255;return Pe+He},C.prototype.writeIntBE=function(ye,Pe,He,at){if(ye=+ye,Pe=Pe>>>0,!at){var ht=Math.pow(2,8*He-1);tt(this,ye,Pe,He,ht-1,-ht)}var At=He-1,Wt=1,Yt=0;for(this[Pe+At]=ye&255;--At>=0&&(Wt*=256);)ye<0&&Yt===0&&this[Pe+At+1]!==0&&(Yt=1),this[Pe+At]=(ye/Wt>>0)-Yt&255;return Pe+He},C.prototype.writeInt8=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,1,127,-128),ye<0&&(ye=255+ye+1),this[Pe]=ye&255,Pe+1},C.prototype.writeInt16LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,2,32767,-32768),this[Pe]=ye&255,this[Pe+1]=ye>>>8,Pe+2},C.prototype.writeInt16BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,2,32767,-32768),this[Pe]=ye>>>8,this[Pe+1]=ye&255,Pe+2},C.prototype.writeInt32LE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,4,2147483647,-2147483648),this[Pe]=ye&255,this[Pe+1]=ye>>>8,this[Pe+2]=ye>>>16,this[Pe+3]=ye>>>24,Pe+4},C.prototype.writeInt32BE=function(ye,Pe,He){return ye=+ye,Pe=Pe>>>0,He||tt(this,ye,Pe,4,2147483647,-2147483648),ye<0&&(ye=4294967295+ye+1),this[Pe]=ye>>>24,this[Pe+1]=ye>>>16,this[Pe+2]=ye>>>8,this[Pe+3]=ye&255,Pe+4},C.prototype.writeBigInt64LE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return _t(this,ye,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),C.prototype.writeBigInt64BE=ot(function(ye){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return mt(this,ye,Pe,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function vt(ye,Pe,He,at,ht,At){if(He+at>ye.length)throw new RangeError("Index out of range");if(He<0)throw new RangeError("Index out of range")}function ct(ye,Pe,He,at,ht){return Pe=+Pe,He=He>>>0,ht||vt(ye,Pe,He,4),E.write(ye,Pe,He,at,23,4),He+4}C.prototype.writeFloatLE=function(ye,Pe,He){return ct(this,ye,Pe,!0,He)},C.prototype.writeFloatBE=function(ye,Pe,He){return ct(this,ye,Pe,!1,He)};function Ae(ye,Pe,He,at,ht){return Pe=+Pe,He=He>>>0,ht||vt(ye,Pe,He,8),E.write(ye,Pe,He,at,52,8),He+8}C.prototype.writeDoubleLE=function(ye,Pe,He){return Ae(this,ye,Pe,!0,He)},C.prototype.writeDoubleBE=function(ye,Pe,He){return Ae(this,ye,Pe,!1,He)},C.prototype.copy=function(ye,Pe,He,at){if(!C.isBuffer(ye))throw new TypeError("argument should be a Buffer");if(He||(He=0),!at&&at!==0&&(at=this.length),Pe>=ye.length&&(Pe=ye.length),Pe||(Pe=0),at>0&&at=this.length)throw new RangeError("Index out of range");if(at<0)throw new RangeError("sourceEnd out of bounds");at>this.length&&(at=this.length),ye.length-Pe>>0,He=He===void 0?this.length:He>>>0,ye||(ye=0);var At;if(typeof ye=="number")for(At=Pe;AtMath.pow(2,32)?ht=nt(String(He)):typeof He=="bigint"&&(ht=String(He),(He>Math.pow(BigInt(2),BigInt(32))||He<-Math.pow(BigInt(2),BigInt(32)))&&(ht=nt(ht)),ht+="n"),at+=" It must be ".concat(Pe,". Received ").concat(ht),at},RangeError);function nt(ye){for(var Pe="",He=ye.length,at=ye[0]==="-"?1:0;He>=at+4;He-=3)Pe="_".concat(ye.slice(He-3,He)).concat(Pe);return"".concat(ye.slice(0,He)).concat(Pe)}function xt(ye,Pe,He){Et(Pe,"offset"),(ye[Pe]===void 0||ye[Pe+He]===void 0)&&Gt(Pe,ye.length-(He+1))}function ut(ye,Pe,He,at,ht,At){if(ye>He||ye= 0".concat(Wt," and < 2").concat(Wt," ** ").concat((At+1)*8).concat(Wt):Yt=">= -(2".concat(Wt," ** ").concat((At+1)*8-1).concat(Wt,") and < 2 ** ")+"".concat((At+1)*8-1).concat(Wt),new Oe.ERR_OUT_OF_RANGE("value",Yt,ye)}xt(at,ht,At)}function Et(ye,Pe){if(typeof ye!="number")throw new Oe.ERR_INVALID_ARG_TYPE(Pe,"number",ye)}function Gt(ye,Pe,He){throw Math.floor(ye)!==ye?(Et(ye,He),new Oe.ERR_OUT_OF_RANGE("offset","an integer",ye)):Pe<0?new Oe.ERR_BUFFER_OUT_OF_BOUNDS:new Oe.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(Pe),ye)}var Qt=/[^+/0-9A-Za-z-_]/g;function vr(ye){if(ye=ye.split("=")[0],ye=ye.trim().replace(Qt,""),ye.length<2)return"";for(;ye.length%4!==0;)ye=ye+"=";return ye}function mr(ye,Pe){Pe=Pe||1/0;for(var He,at=ye.length,ht=null,At=[],Wt=0;Wt55295&&He<57344){if(!ht){if(He>56319){(Pe-=3)>-1&&At.push(239,191,189);continue}else if(Wt+1===at){(Pe-=3)>-1&&At.push(239,191,189);continue}ht=He;continue}if(He<56320){(Pe-=3)>-1&&At.push(239,191,189),ht=He;continue}He=(ht-55296<<10|He-56320)+65536}else ht&&(Pe-=3)>-1&&At.push(239,191,189);if(ht=null,He<128){if((Pe-=1)<0)break;At.push(He)}else if(He<2048){if((Pe-=2)<0)break;At.push(He>>6|192,He&63|128)}else if(He<65536){if((Pe-=3)<0)break;At.push(He>>12|224,He>>6&63|128,He&63|128)}else if(He<1114112){if((Pe-=4)<0)break;At.push(He>>18|240,He>>12&63|128,He>>6&63|128,He&63|128)}else throw new Error("Invalid code point")}return At}function Yr(ye){for(var Pe=[],He=0;He>8,ht=He%256,At.push(ht),At.push(at);return At}function Lr(ye){return D.toByteArray(vr(ye))}function ci(ye,Pe,He,at){var ht;for(ht=0;ht=Pe.length||ht>=ye.length);++ht)Pe[ht+He]=ye[ht];return ht}function vi(ye,Pe){return ye instanceof Pe||ye!=null&&ye.constructor!=null&&ye.constructor.name!=null&&ye.constructor.name===Pe.name}function Ot(ye){return ye!==ye}var Xe=function(){for(var ye="0123456789abcdef",Pe=new Array(256),He=0;He<16;++He)for(var at=He*16,ht=0;ht<16;++ht)Pe[at+ht]=ye[He]+ye[ht];return Pe}();function ot(ye){return typeof BigInt>"u"?De:ye}function De(){throw new Error("BigInt not supported")}},4844:function(i){i.exports=n;function n(a,l,o,u){return a[0]=l[0]+o[0]*u,a[1]=l[1]+o[1]*u,a[2]=l[2]+o[2]*u,a[3]=l[3]+o[3]*u,a}},4905:function(i,n,a){var l=a(5874);i.exports=o;function o(u,s){var h=l(s),m=[];return m=m.concat(h(u)),m=m.concat(h(null)),m}},4935:function(i,n,a){i.exports=k;var l=a(2762),o=a(8116),u=a(4359),s=a(1879).Q,h=window||process.global||{},m=h.__TEXT_CACHE||{};h.__TEXT_CACHE={};var b=3;function x(w,D,E,I){this.gl=w,this.shader=D,this.buffer=E,this.vao=I,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var _=x.prototype,A=[0,0];_.bind=function(w,D,E,I){this.vao.bind(),this.shader.bind();var M=this.shader.uniforms;M.model=w,M.view=D,M.projection=E,M.pixelScale=I,A[0]=this.gl.drawingBufferWidth,A[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=A},_.unbind=function(){this.vao.unbind()},_.update=function(w,D,E,I,M){var p=[];function g(q,G,ee,he,be,ve){var ce=[ee.style,ee.weight,ee.variant,ee.family].join("_"),re=m[ce];re||(re=m[ce]={});var ge=re[G];ge||(ge=re[G]=f(G,{triangles:!0,font:ee.family,fontStyle:ee.style,fontWeight:ee.weight,fontVariant:ee.variant,textAlign:"center",textBaseline:"middle",lineSpacing:be,styletags:ve}));for(var ne=(he||12)/12,se=ge.positions,_e=ge.cells,oe=0,J=_e.length;oe=0;--fe){var Ce=se[me[fe]];p.push(ne*Ce[0],-ne*Ce[1],q)}}for(var C=[0,0,0],T=[0,0,0],N=[0,0,0],B=[0,0,0],U=1.25,V={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},W=0;W<3;++W){N[W]=p.length/b|0,g(.5*(w[0][W]+w[1][W]),D[W],E[W],12,U,V),B[W]=(p.length/b|0)-N[W],C[W]=p.length/b|0;for(var F=0;F0||D.length>0;){for(;w.length>0;){var g=w.pop();if(E[g]!==-k){E[g]=k;for(var C=I[g],T=0;T<3;++T){var N=p[3*g+T];N>=0&&E[N]===0&&(M[3*g+T]?D.push(N):(w.push(N),E[N]=k))}}}var B=D;D=w,w=B,D.length=0,k=-k}var U=m(I,E,_);return A?U.concat(f.boundary):U}},5033:function(i){i.exports=n;function n(a,l,o){var u=l||0,s=o||1;return[[a[12]+a[0],a[13]+a[1],a[14]+a[2],a[15]+a[3]],[a[12]-a[0],a[13]-a[1],a[14]-a[2],a[15]-a[3]],[a[12]+a[4],a[13]+a[5],a[14]+a[6],a[15]+a[7]],[a[12]-a[4],a[13]-a[5],a[14]-a[6],a[15]-a[7]],[u*a[12]+a[8],u*a[13]+a[9],u*a[14]+a[10],u*a[15]+a[11]],[s*a[12]-a[8],s*a[13]-a[9],s*a[14]-a[10],s*a[15]-a[11]]]}},5085:function(i,n,a){i.exports=k;var l=a(3250)[3],o=a(4209),u=a(3352),s=a(2478);function h(){return!0}function m(w){return function(D,E){var I=w[D];return I?!!I.queryPoint(E,h):!1}}function b(w){for(var D={},E=0;E0&&D[I]===E[0])M=w[I-1];else return 1;for(var p=1;M;){var g=M.key,C=l(E,g[0],g[1]);if(g[0][0]0)p=-1,M=M.right;else return 0;else if(C>0)M=M.left;else if(C<0)p=1,M=M.right;else return 0}return p}}function _(w){return 1}function A(w){return function(D){return w(D[0],D[1])?0:1}}function f(w,D){return function(E){return w(E[0],E[1])?0:D(E)}}function k(w){for(var D=w.length,E=[],I=[],M=0,p=0;p"u"?a(606):WeakMap,s=new u,h=0;function m(D,E,I,M,p,g,C){this.id=D,this.src=E,this.type=I,this.shader=M,this.count=g,this.programs=[],this.cache=C}m.prototype.dispose=function(){if(--this.count===0){for(var D=this.cache,E=D.gl,I=this.programs,M=0,p=I.length;M0&&(m=1/Math.sqrt(m),a[0]=o*m,a[1]=u*m,a[2]=s*m,a[3]=h*m),a}},5202:function(i,n,a){var l=a(1944),o=a(8210);i.exports=h,i.exports.positive=m,i.exports.negative=b;function u(x,_){var A=o(l(x,_),[_[_.length-1]]);return A[A.length-1]}function s(x,_,A,f){var k=f-_,w=-_/k;w<0?w=0:w>1&&(w=1);for(var D=1-w,E=x.length,I=new Array(E),M=0;M0||k>0&&I<0){var M=s(w,I,D,k);A.push(M),f.push(M.slice())}I<0?f.push(D.slice()):I>0?A.push(D.slice()):(A.push(D.slice()),f.push(D.slice())),k=I}return{positive:A,negative:f}}function m(x,_){for(var A=[],f=u(x[x.length-1],_),k=x[x.length-1],w=x[0],D=0;D0||f>0&&E<0)&&A.push(s(k,E,w,f)),E>=0&&A.push(w.slice()),f=E}return A}function b(x,_){for(var A=[],f=u(x[x.length-1],_),k=x[x.length-1],w=x[0],D=0;D0||f>0&&E<0)&&A.push(s(k,E,w,f)),E<=0&&A.push(w.slice()),f=E}return A}},5219:function(i){i.exports=function(n){for(var a=n.length,l,o=0;o13)&&l!==32&&l!==133&&l!==160&&l!==5760&&l!==6158&&(l<8192||l>8205)&&l!==8232&&l!==8233&&l!==8239&&l!==8287&&l!==8288&&l!==12288&&l!==65279)return!1;return!0}},5250:function(i){i.exports=a;var n=+(Math.pow(2,27)+1);function a(l,o,u){var s=l*o,h=n*l,m=h-l,b=h-m,x=l-b,_=n*o,A=_-o,f=_-A,k=o-f,w=s-b*f,D=w-x*f,E=D-b*k,I=x*k-E;return u?(u[0]=I,u[1]=s,u):[I,s]}},5298:function(i,n){var a={"float64,2,1,0":function(){return function(b,x,_,A,f){var k=b[0],w=b[1],D=b[2],E=_[0],I=_[1],M=_[2];A|=0;var p=0,g=0,C=0,T=M,N=I-D*M,B=E-w*I;for(C=0;C0;){W<64?(E=W,W=0):(E=64,W-=64);for(var F=b[1]|0;F>0;){F<64?(I=F,F=0):(I=64,F-=64),A=U+W*p+F*g,w=V+W*T+F*N;var H=0,q=0,G=0,ee=C,he=p-M*C,be=g-E*p,ve=B,ce=T-M*B,re=N-E*T;for(G=0;G0;){N<64?(E=N,N=0):(E=64,N-=64);for(var B=b[0]|0;B>0;){B<64?(D=B,B=0):(D=64,B-=64),A=C+N*M+B*I,w=T+N*g+B*p;var U=0,V=0,W=M,F=I-E*M,H=g,q=p-E*g;for(V=0;V0;){V<64?(I=V,V=0):(I=64,V-=64);for(var W=b[0]|0;W>0;){W<64?(D=W,W=0):(D=64,W-=64);for(var F=b[1]|0;F>0;){F<64?(E=F,F=0):(E=64,F-=64),A=B+V*g+W*M+F*p,w=U+V*N+W*C+F*T;var H=0,q=0,G=0,ee=g,he=M-I*g,be=p-D*M,ve=N,ce=C-I*N,re=T-D*C;for(G=0;G=0}}(),u.removeTriangle=function(m,b,x){var _=this.stars;s(_[m],b,x),s(_[b],x,m),s(_[x],m,b)},u.addTriangle=function(m,b,x){var _=this.stars;_[m].push(b,x),_[b].push(x,m),_[x].push(m,b)},u.opposite=function(m,b){for(var x=this.stars[b],_=1,A=x.length;_0;){var f=x.pop();m[f]=!1;for(var k=h[f],_=0;_0){for(var ce=0;ce<24;++ce)B.push(B[B.length-12]);F+=2,he=!0}continue e}H[0][T]=Math.min(H[0][T],be[T],ve[T]),H[1][T]=Math.max(H[1][T],be[T],ve[T])}var re,ge;Array.isArray(G[0])?(re=G.length>C-1?G[C-1]:G.length>0?G[G.length-1]:[0,0,0,1],ge=G.length>C?G[C]:G.length>0?G[G.length-1]:[0,0,0,1]):re=ge=G,re.length===3&&(re=[re[0],re[1],re[2],1]),ge.length===3&&(ge=[ge[0],ge[1],ge[2],1]),!this.hasAlpha&&re[3]<1&&(this.hasAlpha=!0);var ne;Array.isArray(ee)?ne=ee.length>C-1?ee[C-1]:ee.length>0?ee[ee.length-1]:[0,0,0,1]:ne=ee;var se=W;if(W+=w(be,ve),he){for(T=0;T<2;++T)B.push(be[0],be[1],be[2],ve[0],ve[1],ve[2],se,ne,re[0],re[1],re[2],re[3]);F+=2,he=!1}B.push(be[0],be[1],be[2],ve[0],ve[1],ve[2],se,ne,re[0],re[1],re[2],re[3],be[0],be[1],be[2],ve[0],ve[1],ve[2],se,-ne,re[0],re[1],re[2],re[3],ve[0],ve[1],ve[2],be[0],be[1],be[2],W,-ne,ge[0],ge[1],ge[2],ge[3],ve[0],ve[1],ve[2],be[0],be[1],be[2],W,ne,ge[0],ge[1],ge[2],ge[3]),F+=4}}if(this.buffer.update(B),U.push(W),V.push(q[q.length-1].slice()),this.bounds=H,this.vertexCount=F,this.points=V,this.arcLength=U,"dashes"in g){var _e=g.dashes,oe=_e.slice();for(oe.unshift(0),C=1;Ca[o][0]&&(o=u);return lo?[[o],[l]]:[[l]]}},5771:function(i,n,a){var l=a(8507),o=a(3788),u=a(2419);i.exports=s;function s(h){h.sort(o);for(var m=h.length,b=0,x=0;x0){var f=h[b-1];if(l(_,f)===0&&u(f)!==A){b-=1;continue}}h[b++]=_}}return h.length=b,h}},5838:function(i,n,a){i.exports=o;var l=a(7842);function o(u){for(var s=new Array(u.length),h=0;h0)continue;nt=Ae.slice(0,1).join("")}return oe(nt),he+=nt.length,H=H.slice(nt.length),H.length}while(!0)}function _t(){return/[^a-fA-F0-9]/.test(W)?(oe(H.join("")),V=m,B):(H.push(W),F=W,B+1)}function mt(){return W==="."||/[eE]/.test(W)?(H.push(W),V=w,F=W,B+1):W==="x"&&H.length===1&&H[0]==="0"?(V=g,H.push(W),F=W,B+1):/[^\d]/.test(W)?(oe(H.join("")),V=m,B):(H.push(W),F=W,B+1)}function vt(){return W==="f"&&(H.push(W),F=W,B+=1),/[eE]/.test(W)||(W==="-"||W==="+")&&/[eE]/.test(F)?(H.push(W),F=W,B+1):/[^\d]/.test(W)?(oe(H.join("")),V=m,B):(H.push(W),F=W,B+1)}function ct(){if(/[^\d\w_]/.test(W)){var Ae=H.join("");return _e[Ae]?V=I:se[Ae]?V=E:V=D,oe(H.join("")),V=m,B}return H.push(W),F=W,B+1}}},5878:function(i,n,a){i.exports=s;var l=a(3250),o=a(2014);function u(h,m,b){var x=Math.abs(l(h,m,b)),_=Math.sqrt(Math.pow(m[0]-b[0],2)+Math.pow(m[1]-b[1],2));return x/_}function s(h,m,b){for(var x=m.length,_=h.length,A=new Array(x),f=new Array(x),k=new Array(x),w=new Array(x),D=0;D>1:(ce>>1)-1}function N(ce){for(var re=C(ce);;){var ge=re,ne=2*ce+1,se=2*(ce+1),_e=ce;if(ne0;){var ge=T(ce);if(ge>=0){var ne=C(ge);if(re0){var ce=F[0];return g(0,G-1),G-=1,N(0),ce}return-1}function V(ce,re){var ge=F[ce];return k[ge]===re?ce:(k[ge]=-1/0,B(ce),U(),k[ge]=re,G+=1,B(G-1))}function W(ce){if(!w[ce]){w[ce]=!0;var re=A[ce],ge=f[ce];A[ge]>=0&&(A[ge]=re),f[re]>=0&&(f[re]=ge),H[re]>=0&&V(H[re],p(re)),H[ge]>=0&&V(H[ge],p(ge))}}for(var F=[],H=new Array(x),D=0;D>1;D>=0;--D)N(D);for(;;){var ee=U();if(ee<0||k[ee]>b)break;W(ee)}for(var he=[],D=0;D=0&&ge>=0&&re!==ge){var ne=H[re],se=H[ge];ne!==se&&ve.push([ne,se])}}),o.unique(o.normalize(ve)),{positions:he,edges:ve}}},5911:function(i){i.exports=n;function n(a,l,o){var u=l[0],s=l[1],h=l[2],m=o[0],b=o[1],x=o[2];return a[0]=s*x-h*b,a[1]=h*m-u*x,a[2]=u*b-s*m,a}},5964:function(i){i.exports=function(n){return!n&&n!==0?"":n.toString()}},5995:function(i,n,a){i.exports=u;var l=a(7642),o=a(6037);function u(s,h){return l(h).filter(function(m){for(var b=new Array(m.length),x=0;x2&&C[1]>2&&M(g.pick(-1,-1).lo(1,1).hi(C[0]-2,C[1]-2),p.pick(-1,-1,0).lo(1,1).hi(C[0]-2,C[1]-2),p.pick(-1,-1,1).lo(1,1).hi(C[0]-2,C[1]-2)),C[1]>2&&(I(g.pick(0,-1).lo(1).hi(C[1]-2),p.pick(0,-1,1).lo(1).hi(C[1]-2)),E(p.pick(0,-1,0).lo(1).hi(C[1]-2))),C[1]>2&&(I(g.pick(C[0]-1,-1).lo(1).hi(C[1]-2),p.pick(C[0]-1,-1,1).lo(1).hi(C[1]-2)),E(p.pick(C[0]-1,-1,0).lo(1).hi(C[1]-2))),C[0]>2&&(I(g.pick(-1,0).lo(1).hi(C[0]-2),p.pick(-1,0,0).lo(1).hi(C[0]-2)),E(p.pick(-1,0,1).lo(1).hi(C[0]-2))),C[0]>2&&(I(g.pick(-1,C[1]-1).lo(1).hi(C[0]-2),p.pick(-1,C[1]-1,0).lo(1).hi(C[0]-2)),E(p.pick(-1,C[1]-1,1).lo(1).hi(C[0]-2))),p.set(0,0,0,0),p.set(0,0,1,0),p.set(C[0]-1,0,0,0),p.set(C[0]-1,0,1,0),p.set(0,C[1]-1,0,0),p.set(0,C[1]-1,1,0),p.set(C[0]-1,C[1]-1,0,0),p.set(C[0]-1,C[1]-1,1,0),p}}function w(D){var E=D.join(),C=x[E];if(C)return C;for(var I=D.length,M=[_,A],p=1;p<=I;++p)M.push(f(p));var g=k,C=g.apply(void 0,M);return x[E]=C,C}i.exports=function(D,E,I){if(Array.isArray(I)||(typeof I=="string"?I=l(E.dimension,I):I=l(E.dimension,"clamp")),E.size===0)return D;if(E.dimension===0)return D.set(0),D;var M=w(I);return M(D,E)}},6204:function(i){i.exports=n;function n(a){var l,o,u,s=a.length,h=0;for(l=0;lx&&(x=l.length(B)),T&&!C){var U=2*l.distance(E,N)/(l.length(I)+l.length(B));U?(p=Math.min(p,U),g=!1):g=!0}g||(E=N,I=B),M.push(B)}var V=[_,f,w],W=[A,k,D];s&&(s[0]=V,s[1]=W),x===0&&(x=1);var F=1/x;isFinite(p)||(p=1),b.vectorScale=p;var H=u.coneSize||(C?1:.5);u.absoluteConeSize&&(H=u.absoluteConeSize*F),b.coneScale=H;for(var T=0,q=0;The&&(W|=1<he){W|=1<b[B][1])&&(_e=B);for(var oe=-1,B=0;B<3;++B){var J=_e^1<b[me][0]&&(me=J)}}var fe=w;fe[0]=fe[1]=fe[2]=0,fe[l.log2(oe^_e)]=_e&oe,fe[l.log2(_e^me)]=_e&me;var Ce=me^7;Ce===W||Ce===se?(Ce=oe^7,fe[l.log2(me^Ce)]=Ce&me):fe[l.log2(oe^Ce)]=Ce&oe;for(var Re=D,Be=W,q=0;q<3;++q)Be&1<=0&&(b=h.length-m-1);var x=Math.pow(10,b),_=Math.round(u*s*x),A=_+"";if(A.indexOf("e")>=0)return A;var f=_/x,k=_%x;_<0?(f=-Math.ceil(f)|0,k=-k|0):(f=Math.floor(f)|0,k=k|0);var w=""+f;if(_<0&&(w="-"+w),b){for(var D=""+k;D.length=u[0][m];--_)b.push({x:_*s[m],text:a(s[m],_)});h.push(b)}return h}function o(u,s){for(var h=0;h<3;++h){if(u[h].length!==s[h].length)return!1;for(var m=0;mE+1)throw new Error(w+" map requires nshades to be at least size "+k.length);Array.isArray(b.alpha)?b.alpha.length!==2?I=[1,1]:I=b.alpha.slice():typeof b.alpha=="number"?I=[b.alpha,b.alpha]:I=[1,1],x=k.map(function(N){return Math.round(N.index*E)}),I[0]=Math.min(Math.max(I[0],0),1),I[1]=Math.min(Math.max(I[1],0),1);var p=k.map(function(N,B){var U=k[B].index,V=k[B].rgb.slice();return V.length===4&&V[3]>=0&&V[3]<=1||(V[3]=I[0]+(I[1]-I[0])*U),V}),g=[];for(M=0;M0?F:$},h.min=function(F,$){return F.cmp($)<0?F:$},h.prototype._init=function(F,$,q){if(typeof F=="number")return this._initNumber(F,$,q);if(typeof F=="object")return this._initArray(F,$,q);$==="hex"&&($=16),u($===($|0)&&$>=2&&$<=36),F=F.toString().replace(/\s+/g,"");var G=0;F[0]==="-"&&(G++,this.negative=1),G=0;G-=3)he=F[G]|F[G-1]<<8|F[G-2]<<16,this.words[ee]|=he<>>26-xe&67108863,xe+=24,xe>=26&&(xe-=26,ee++);else if(q==="le")for(G=0,ee=0;G>>26-xe&67108863,xe+=24,xe>=26&&(xe-=26,ee++);return this.strip()};function b(F,$){var q=F.charCodeAt($);return q>=65&&q<=70?q-55:q>=97&&q<=102?q-87:q-48&15}function x(F,$,q){var G=b(F,q);return q-1>=$&&(G|=b(F,q-1)<<4),G}h.prototype._parseHex=function(F,$,q){this.length=Math.ceil((F.length-$)/6),this.words=new Array(this.length);for(var G=0;G=$;G-=2)xe=x(F,$,G)<=18?(ee-=18,he+=1,this.words[he]|=xe>>>26):ee+=8;else{var ve=F.length-$;for(G=ve%2===0?$+1:$;G=18?(ee-=18,he+=1,this.words[he]|=xe>>>26):ee+=8}this.strip()};function _(F,$,q,G){for(var ee=0,he=Math.min(F.length,q),xe=$;xe=49?ee+=ve-49+10:ve>=17?ee+=ve-17+10:ee+=ve}return ee}h.prototype._parseBase=function(F,$,q){this.words=[0],this.length=1;for(var G=0,ee=1;ee<=67108863;ee*=$)G++;G--,ee=ee/$|0;for(var he=F.length-q,xe=he%G,ve=Math.min(he,he-xe)+q,ce=0,re=q;re1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},h.prototype.inspect=function(){return(this.red?""};var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],k=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];h.prototype.toString=function(F,$){F=F||10,$=$|0||1;var q;if(F===16||F==="hex"){q="";for(var G=0,ee=0,he=0;he>>24-G&16777215,ee!==0||he!==this.length-1?q=A[6-ve.length]+ve+q:q=ve+q,G+=2,G>=26&&(G-=26,he--)}for(ee!==0&&(q=ee.toString(16)+q);q.length%$!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}if(F===(F|0)&&F>=2&&F<=36){var ce=f[F],re=k[F];q="";var ge=this.clone();for(ge.negative=0;!ge.isZero();){var ne=ge.modn(re).toString(F);ge=ge.idivn(re),ge.isZero()?q=ne+q:q=A[ce-ne.length]+ne+q}for(this.isZero()&&(q="0"+q);q.length%$!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}u(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var F=this.words[0];return this.length===2?F+=this.words[1]*67108864:this.length===3&&this.words[2]===1?F+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-F:F},h.prototype.toJSON=function(){return this.toString(16)},h.prototype.toBuffer=function(F,$){return u(typeof m<"u"),this.toArrayLike(m,F,$)},h.prototype.toArray=function(F,$){return this.toArrayLike(Array,F,$)},h.prototype.toArrayLike=function(F,$,q){var G=this.byteLength(),ee=q||Math.max(1,G);u(G<=ee,"byte array longer than desired length"),u(ee>0,"Requested array length <= 0"),this.strip();var he=$==="le",xe=new F(ee),ve,ce,re=this.clone();if(he){for(ce=0;!re.isZero();ce++)ve=re.andln(255),re.iushrn(8),xe[ce]=ve;for(;ce=4096&&(q+=13,$>>>=13),$>=64&&(q+=7,$>>>=7),$>=8&&(q+=4,$>>>=4),$>=2&&(q+=2,$>>>=2),q+$},h.prototype._zeroBits=function(F){if(F===0)return 26;var $=F,q=0;return($&8191)===0&&(q+=13,$>>>=13),($&127)===0&&(q+=7,$>>>=7),($&15)===0&&(q+=4,$>>>=4),($&3)===0&&(q+=2,$>>>=2),($&1)===0&&q++,q},h.prototype.bitLength=function(){var F=this.words[this.length-1],$=this._countBits(F);return(this.length-1)*26+$};function w(F){for(var $=new Array(F.bitLength()),q=0;q<$.length;q++){var G=q/26|0,ee=q%26;$[q]=(F.words[G]&1<>>ee}return $}h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var F=0,$=0;$F.length?this.clone().ior(F):F.clone().ior(this)},h.prototype.uor=function(F){return this.length>F.length?this.clone().iuor(F):F.clone().iuor(this)},h.prototype.iuand=function(F){var $;this.length>F.length?$=F:$=this;for(var q=0;q<$.length;q++)this.words[q]=this.words[q]&F.words[q];return this.length=$.length,this.strip()},h.prototype.iand=function(F){return u((this.negative|F.negative)===0),this.iuand(F)},h.prototype.and=function(F){return this.length>F.length?this.clone().iand(F):F.clone().iand(this)},h.prototype.uand=function(F){return this.length>F.length?this.clone().iuand(F):F.clone().iuand(this)},h.prototype.iuxor=function(F){var $,q;this.length>F.length?($=this,q=F):($=F,q=this);for(var G=0;GF.length?this.clone().ixor(F):F.clone().ixor(this)},h.prototype.uxor=function(F){return this.length>F.length?this.clone().iuxor(F):F.clone().iuxor(this)},h.prototype.inotn=function(F){u(typeof F=="number"&&F>=0);var $=Math.ceil(F/26)|0,q=F%26;this._expand($),q>0&&$--;for(var G=0;G<$;G++)this.words[G]=~this.words[G]&67108863;return q>0&&(this.words[G]=~this.words[G]&67108863>>26-q),this.strip()},h.prototype.notn=function(F){return this.clone().inotn(F)},h.prototype.setn=function(F,$){u(typeof F=="number"&&F>=0);var q=F/26|0,G=F%26;return this._expand(q+1),$?this.words[q]=this.words[q]|1<F.length?(q=this,G=F):(q=F,G=this);for(var ee=0,he=0;he>>26;for(;ee!==0&&he>>26;if(this.length=q.length,ee!==0)this.words[this.length]=ee,this.length++;else if(q!==this)for(;heF.length?this.clone().iadd(F):F.clone().iadd(this)},h.prototype.isub=function(F){if(F.negative!==0){F.negative=0;var $=this.iadd(F);return F.negative=1,$._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(F),this.negative=1,this._normSign();var q=this.cmp(F);if(q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var G,ee;q>0?(G=this,ee=F):(G=F,ee=this);for(var he=0,xe=0;xe>26,this.words[xe]=$&67108863;for(;he!==0&&xe>26,this.words[xe]=$&67108863;if(he===0&&xe>>26,ne=ce&67108863,se=Math.min(re,$.length-1),_e=Math.max(0,re-F.length+1);_e<=se;_e++){var oe=re-_e|0;ee=F.words[oe]|0,he=$.words[_e]|0,xe=ee*he+ne,ge+=xe/67108864|0,ne=xe&67108863}q.words[re]=ne|0,ce=ge|0}return ce!==0?q.words[re]=ce|0:q.length--,q.strip()}var E=function(F,$,q){var G=F.words,ee=$.words,he=q.words,xe=0,ve,ce,re,ge=G[0]|0,ne=ge&8191,se=ge>>>13,_e=G[1]|0,oe=_e&8191,J=_e>>>13,me=G[2]|0,fe=me&8191,Ce=me>>>13,Be=G[3]|0,Oe=Be&8191,Ze=Be>>>13,Ge=G[4]|0,rt=Ge&8191,_t=Ge>>>13,pt=G[5]|0,gt=pt&8191,ct=pt>>>13,Ae=G[6]|0,ze=Ae&8191,Ee=Ae>>>13,nt=G[7]|0,xt=nt&8191,ut=nt>>>13,Et=G[8]|0,Gt=Et&8191,Jt=Et>>>13,gr=G[9]|0,mr=gr&8191,Kr=gr>>>13,ri=ee[0]|0,Mr=ri&8191,ui=ri>>>13,mi=ee[1]|0,Ot=mi&8191,Je=mi>>>13,ot=ee[2]|0,De=ot&8191,ye=ot>>>13,Pe=ee[3]|0,He=Pe&8191,at=Pe>>>13,ht=ee[4]|0,At=ht&8191,Wt=ht>>>13,Kt=ee[5]|0,hr=Kt&8191,zr=Kt>>>13,Dr=ee[6]|0,br=Dr&8191,hi=Dr>>>13,un=ee[7]|0,cn=un&8191,yn=un>>>13,Wn=ee[8]|0,Sn=Wn&8191,fn=Wn>>>13,ga=ee[9]|0,na=ga&8191,Zt=ga>>>13;q.negative=F.negative^$.negative,q.length=19,ve=Math.imul(ne,Mr),ce=Math.imul(ne,ui),ce=ce+Math.imul(se,Mr)|0,re=Math.imul(se,ui);var sr=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(sr>>>26)|0,sr&=67108863,ve=Math.imul(oe,Mr),ce=Math.imul(oe,ui),ce=ce+Math.imul(J,Mr)|0,re=Math.imul(J,ui),ve=ve+Math.imul(ne,Ot)|0,ce=ce+Math.imul(ne,Je)|0,ce=ce+Math.imul(se,Ot)|0,re=re+Math.imul(se,Je)|0;var _r=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(_r>>>26)|0,_r&=67108863,ve=Math.imul(fe,Mr),ce=Math.imul(fe,ui),ce=ce+Math.imul(Ce,Mr)|0,re=Math.imul(Ce,ui),ve=ve+Math.imul(oe,Ot)|0,ce=ce+Math.imul(oe,Je)|0,ce=ce+Math.imul(J,Ot)|0,re=re+Math.imul(J,Je)|0,ve=ve+Math.imul(ne,De)|0,ce=ce+Math.imul(ne,ye)|0,ce=ce+Math.imul(se,De)|0,re=re+Math.imul(se,ye)|0;var Cr=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,ve=Math.imul(Oe,Mr),ce=Math.imul(Oe,ui),ce=ce+Math.imul(Ze,Mr)|0,re=Math.imul(Ze,ui),ve=ve+Math.imul(fe,Ot)|0,ce=ce+Math.imul(fe,Je)|0,ce=ce+Math.imul(Ce,Ot)|0,re=re+Math.imul(Ce,Je)|0,ve=ve+Math.imul(oe,De)|0,ce=ce+Math.imul(oe,ye)|0,ce=ce+Math.imul(J,De)|0,re=re+Math.imul(J,ye)|0,ve=ve+Math.imul(ne,He)|0,ce=ce+Math.imul(ne,at)|0,ce=ce+Math.imul(se,He)|0,re=re+Math.imul(se,at)|0;var fi=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(fi>>>26)|0,fi&=67108863,ve=Math.imul(rt,Mr),ce=Math.imul(rt,ui),ce=ce+Math.imul(_t,Mr)|0,re=Math.imul(_t,ui),ve=ve+Math.imul(Oe,Ot)|0,ce=ce+Math.imul(Oe,Je)|0,ce=ce+Math.imul(Ze,Ot)|0,re=re+Math.imul(Ze,Je)|0,ve=ve+Math.imul(fe,De)|0,ce=ce+Math.imul(fe,ye)|0,ce=ce+Math.imul(Ce,De)|0,re=re+Math.imul(Ce,ye)|0,ve=ve+Math.imul(oe,He)|0,ce=ce+Math.imul(oe,at)|0,ce=ce+Math.imul(J,He)|0,re=re+Math.imul(J,at)|0,ve=ve+Math.imul(ne,At)|0,ce=ce+Math.imul(ne,Wt)|0,ce=ce+Math.imul(se,At)|0,re=re+Math.imul(se,Wt)|0;var qi=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(qi>>>26)|0,qi&=67108863,ve=Math.imul(gt,Mr),ce=Math.imul(gt,ui),ce=ce+Math.imul(ct,Mr)|0,re=Math.imul(ct,ui),ve=ve+Math.imul(rt,Ot)|0,ce=ce+Math.imul(rt,Je)|0,ce=ce+Math.imul(_t,Ot)|0,re=re+Math.imul(_t,Je)|0,ve=ve+Math.imul(Oe,De)|0,ce=ce+Math.imul(Oe,ye)|0,ce=ce+Math.imul(Ze,De)|0,re=re+Math.imul(Ze,ye)|0,ve=ve+Math.imul(fe,He)|0,ce=ce+Math.imul(fe,at)|0,ce=ce+Math.imul(Ce,He)|0,re=re+Math.imul(Ce,at)|0,ve=ve+Math.imul(oe,At)|0,ce=ce+Math.imul(oe,Wt)|0,ce=ce+Math.imul(J,At)|0,re=re+Math.imul(J,Wt)|0,ve=ve+Math.imul(ne,hr)|0,ce=ce+Math.imul(ne,zr)|0,ce=ce+Math.imul(se,hr)|0,re=re+Math.imul(se,zr)|0;var Ui=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,ve=Math.imul(ze,Mr),ce=Math.imul(ze,ui),ce=ce+Math.imul(Ee,Mr)|0,re=Math.imul(Ee,ui),ve=ve+Math.imul(gt,Ot)|0,ce=ce+Math.imul(gt,Je)|0,ce=ce+Math.imul(ct,Ot)|0,re=re+Math.imul(ct,Je)|0,ve=ve+Math.imul(rt,De)|0,ce=ce+Math.imul(rt,ye)|0,ce=ce+Math.imul(_t,De)|0,re=re+Math.imul(_t,ye)|0,ve=ve+Math.imul(Oe,He)|0,ce=ce+Math.imul(Oe,at)|0,ce=ce+Math.imul(Ze,He)|0,re=re+Math.imul(Ze,at)|0,ve=ve+Math.imul(fe,At)|0,ce=ce+Math.imul(fe,Wt)|0,ce=ce+Math.imul(Ce,At)|0,re=re+Math.imul(Ce,Wt)|0,ve=ve+Math.imul(oe,hr)|0,ce=ce+Math.imul(oe,zr)|0,ce=ce+Math.imul(J,hr)|0,re=re+Math.imul(J,zr)|0,ve=ve+Math.imul(ne,br)|0,ce=ce+Math.imul(ne,hi)|0,ce=ce+Math.imul(se,br)|0,re=re+Math.imul(se,hi)|0;var Hi=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,ve=Math.imul(xt,Mr),ce=Math.imul(xt,ui),ce=ce+Math.imul(ut,Mr)|0,re=Math.imul(ut,ui),ve=ve+Math.imul(ze,Ot)|0,ce=ce+Math.imul(ze,Je)|0,ce=ce+Math.imul(Ee,Ot)|0,re=re+Math.imul(Ee,Je)|0,ve=ve+Math.imul(gt,De)|0,ce=ce+Math.imul(gt,ye)|0,ce=ce+Math.imul(ct,De)|0,re=re+Math.imul(ct,ye)|0,ve=ve+Math.imul(rt,He)|0,ce=ce+Math.imul(rt,at)|0,ce=ce+Math.imul(_t,He)|0,re=re+Math.imul(_t,at)|0,ve=ve+Math.imul(Oe,At)|0,ce=ce+Math.imul(Oe,Wt)|0,ce=ce+Math.imul(Ze,At)|0,re=re+Math.imul(Ze,Wt)|0,ve=ve+Math.imul(fe,hr)|0,ce=ce+Math.imul(fe,zr)|0,ce=ce+Math.imul(Ce,hr)|0,re=re+Math.imul(Ce,zr)|0,ve=ve+Math.imul(oe,br)|0,ce=ce+Math.imul(oe,hi)|0,ce=ce+Math.imul(J,br)|0,re=re+Math.imul(J,hi)|0,ve=ve+Math.imul(ne,cn)|0,ce=ce+Math.imul(ne,yn)|0,ce=ce+Math.imul(se,cn)|0,re=re+Math.imul(se,yn)|0;var En=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(En>>>26)|0,En&=67108863,ve=Math.imul(Gt,Mr),ce=Math.imul(Gt,ui),ce=ce+Math.imul(Jt,Mr)|0,re=Math.imul(Jt,ui),ve=ve+Math.imul(xt,Ot)|0,ce=ce+Math.imul(xt,Je)|0,ce=ce+Math.imul(ut,Ot)|0,re=re+Math.imul(ut,Je)|0,ve=ve+Math.imul(ze,De)|0,ce=ce+Math.imul(ze,ye)|0,ce=ce+Math.imul(Ee,De)|0,re=re+Math.imul(Ee,ye)|0,ve=ve+Math.imul(gt,He)|0,ce=ce+Math.imul(gt,at)|0,ce=ce+Math.imul(ct,He)|0,re=re+Math.imul(ct,at)|0,ve=ve+Math.imul(rt,At)|0,ce=ce+Math.imul(rt,Wt)|0,ce=ce+Math.imul(_t,At)|0,re=re+Math.imul(_t,Wt)|0,ve=ve+Math.imul(Oe,hr)|0,ce=ce+Math.imul(Oe,zr)|0,ce=ce+Math.imul(Ze,hr)|0,re=re+Math.imul(Ze,zr)|0,ve=ve+Math.imul(fe,br)|0,ce=ce+Math.imul(fe,hi)|0,ce=ce+Math.imul(Ce,br)|0,re=re+Math.imul(Ce,hi)|0,ve=ve+Math.imul(oe,cn)|0,ce=ce+Math.imul(oe,yn)|0,ce=ce+Math.imul(J,cn)|0,re=re+Math.imul(J,yn)|0,ve=ve+Math.imul(ne,Sn)|0,ce=ce+Math.imul(ne,fn)|0,ce=ce+Math.imul(se,Sn)|0,re=re+Math.imul(se,fn)|0;var Rn=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,ve=Math.imul(mr,Mr),ce=Math.imul(mr,ui),ce=ce+Math.imul(Kr,Mr)|0,re=Math.imul(Kr,ui),ve=ve+Math.imul(Gt,Ot)|0,ce=ce+Math.imul(Gt,Je)|0,ce=ce+Math.imul(Jt,Ot)|0,re=re+Math.imul(Jt,Je)|0,ve=ve+Math.imul(xt,De)|0,ce=ce+Math.imul(xt,ye)|0,ce=ce+Math.imul(ut,De)|0,re=re+Math.imul(ut,ye)|0,ve=ve+Math.imul(ze,He)|0,ce=ce+Math.imul(ze,at)|0,ce=ce+Math.imul(Ee,He)|0,re=re+Math.imul(Ee,at)|0,ve=ve+Math.imul(gt,At)|0,ce=ce+Math.imul(gt,Wt)|0,ce=ce+Math.imul(ct,At)|0,re=re+Math.imul(ct,Wt)|0,ve=ve+Math.imul(rt,hr)|0,ce=ce+Math.imul(rt,zr)|0,ce=ce+Math.imul(_t,hr)|0,re=re+Math.imul(_t,zr)|0,ve=ve+Math.imul(Oe,br)|0,ce=ce+Math.imul(Oe,hi)|0,ce=ce+Math.imul(Ze,br)|0,re=re+Math.imul(Ze,hi)|0,ve=ve+Math.imul(fe,cn)|0,ce=ce+Math.imul(fe,yn)|0,ce=ce+Math.imul(Ce,cn)|0,re=re+Math.imul(Ce,yn)|0,ve=ve+Math.imul(oe,Sn)|0,ce=ce+Math.imul(oe,fn)|0,ce=ce+Math.imul(J,Sn)|0,re=re+Math.imul(J,fn)|0,ve=ve+Math.imul(ne,na)|0,ce=ce+Math.imul(ne,Zt)|0,ce=ce+Math.imul(se,na)|0,re=re+Math.imul(se,Zt)|0;var Gn=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Gn>>>26)|0,Gn&=67108863,ve=Math.imul(mr,Ot),ce=Math.imul(mr,Je),ce=ce+Math.imul(Kr,Ot)|0,re=Math.imul(Kr,Je),ve=ve+Math.imul(Gt,De)|0,ce=ce+Math.imul(Gt,ye)|0,ce=ce+Math.imul(Jt,De)|0,re=re+Math.imul(Jt,ye)|0,ve=ve+Math.imul(xt,He)|0,ce=ce+Math.imul(xt,at)|0,ce=ce+Math.imul(ut,He)|0,re=re+Math.imul(ut,at)|0,ve=ve+Math.imul(ze,At)|0,ce=ce+Math.imul(ze,Wt)|0,ce=ce+Math.imul(Ee,At)|0,re=re+Math.imul(Ee,Wt)|0,ve=ve+Math.imul(gt,hr)|0,ce=ce+Math.imul(gt,zr)|0,ce=ce+Math.imul(ct,hr)|0,re=re+Math.imul(ct,zr)|0,ve=ve+Math.imul(rt,br)|0,ce=ce+Math.imul(rt,hi)|0,ce=ce+Math.imul(_t,br)|0,re=re+Math.imul(_t,hi)|0,ve=ve+Math.imul(Oe,cn)|0,ce=ce+Math.imul(Oe,yn)|0,ce=ce+Math.imul(Ze,cn)|0,re=re+Math.imul(Ze,yn)|0,ve=ve+Math.imul(fe,Sn)|0,ce=ce+Math.imul(fe,fn)|0,ce=ce+Math.imul(Ce,Sn)|0,re=re+Math.imul(Ce,fn)|0,ve=ve+Math.imul(oe,na)|0,ce=ce+Math.imul(oe,Zt)|0,ce=ce+Math.imul(J,na)|0,re=re+Math.imul(J,Zt)|0;var Xn=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,ve=Math.imul(mr,De),ce=Math.imul(mr,ye),ce=ce+Math.imul(Kr,De)|0,re=Math.imul(Kr,ye),ve=ve+Math.imul(Gt,He)|0,ce=ce+Math.imul(Gt,at)|0,ce=ce+Math.imul(Jt,He)|0,re=re+Math.imul(Jt,at)|0,ve=ve+Math.imul(xt,At)|0,ce=ce+Math.imul(xt,Wt)|0,ce=ce+Math.imul(ut,At)|0,re=re+Math.imul(ut,Wt)|0,ve=ve+Math.imul(ze,hr)|0,ce=ce+Math.imul(ze,zr)|0,ce=ce+Math.imul(Ee,hr)|0,re=re+Math.imul(Ee,zr)|0,ve=ve+Math.imul(gt,br)|0,ce=ce+Math.imul(gt,hi)|0,ce=ce+Math.imul(ct,br)|0,re=re+Math.imul(ct,hi)|0,ve=ve+Math.imul(rt,cn)|0,ce=ce+Math.imul(rt,yn)|0,ce=ce+Math.imul(_t,cn)|0,re=re+Math.imul(_t,yn)|0,ve=ve+Math.imul(Oe,Sn)|0,ce=ce+Math.imul(Oe,fn)|0,ce=ce+Math.imul(Ze,Sn)|0,re=re+Math.imul(Ze,fn)|0,ve=ve+Math.imul(fe,na)|0,ce=ce+Math.imul(fe,Zt)|0,ce=ce+Math.imul(Ce,na)|0,re=re+Math.imul(Ce,Zt)|0;var sa=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(sa>>>26)|0,sa&=67108863,ve=Math.imul(mr,He),ce=Math.imul(mr,at),ce=ce+Math.imul(Kr,He)|0,re=Math.imul(Kr,at),ve=ve+Math.imul(Gt,At)|0,ce=ce+Math.imul(Gt,Wt)|0,ce=ce+Math.imul(Jt,At)|0,re=re+Math.imul(Jt,Wt)|0,ve=ve+Math.imul(xt,hr)|0,ce=ce+Math.imul(xt,zr)|0,ce=ce+Math.imul(ut,hr)|0,re=re+Math.imul(ut,zr)|0,ve=ve+Math.imul(ze,br)|0,ce=ce+Math.imul(ze,hi)|0,ce=ce+Math.imul(Ee,br)|0,re=re+Math.imul(Ee,hi)|0,ve=ve+Math.imul(gt,cn)|0,ce=ce+Math.imul(gt,yn)|0,ce=ce+Math.imul(ct,cn)|0,re=re+Math.imul(ct,yn)|0,ve=ve+Math.imul(rt,Sn)|0,ce=ce+Math.imul(rt,fn)|0,ce=ce+Math.imul(_t,Sn)|0,re=re+Math.imul(_t,fn)|0,ve=ve+Math.imul(Oe,na)|0,ce=ce+Math.imul(Oe,Zt)|0,ce=ce+Math.imul(Ze,na)|0,re=re+Math.imul(Ze,Zt)|0;var Mn=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,ve=Math.imul(mr,At),ce=Math.imul(mr,Wt),ce=ce+Math.imul(Kr,At)|0,re=Math.imul(Kr,Wt),ve=ve+Math.imul(Gt,hr)|0,ce=ce+Math.imul(Gt,zr)|0,ce=ce+Math.imul(Jt,hr)|0,re=re+Math.imul(Jt,zr)|0,ve=ve+Math.imul(xt,br)|0,ce=ce+Math.imul(xt,hi)|0,ce=ce+Math.imul(ut,br)|0,re=re+Math.imul(ut,hi)|0,ve=ve+Math.imul(ze,cn)|0,ce=ce+Math.imul(ze,yn)|0,ce=ce+Math.imul(Ee,cn)|0,re=re+Math.imul(Ee,yn)|0,ve=ve+Math.imul(gt,Sn)|0,ce=ce+Math.imul(gt,fn)|0,ce=ce+Math.imul(ct,Sn)|0,re=re+Math.imul(ct,fn)|0,ve=ve+Math.imul(rt,na)|0,ce=ce+Math.imul(rt,Zt)|0,ce=ce+Math.imul(_t,na)|0,re=re+Math.imul(_t,Zt)|0;var Ha=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,ve=Math.imul(mr,hr),ce=Math.imul(mr,zr),ce=ce+Math.imul(Kr,hr)|0,re=Math.imul(Kr,zr),ve=ve+Math.imul(Gt,br)|0,ce=ce+Math.imul(Gt,hi)|0,ce=ce+Math.imul(Jt,br)|0,re=re+Math.imul(Jt,hi)|0,ve=ve+Math.imul(xt,cn)|0,ce=ce+Math.imul(xt,yn)|0,ce=ce+Math.imul(ut,cn)|0,re=re+Math.imul(ut,yn)|0,ve=ve+Math.imul(ze,Sn)|0,ce=ce+Math.imul(ze,fn)|0,ce=ce+Math.imul(Ee,Sn)|0,re=re+Math.imul(Ee,fn)|0,ve=ve+Math.imul(gt,na)|0,ce=ce+Math.imul(gt,Zt)|0,ce=ce+Math.imul(ct,na)|0,re=re+Math.imul(ct,Zt)|0;var ro=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(ro>>>26)|0,ro&=67108863,ve=Math.imul(mr,br),ce=Math.imul(mr,hi),ce=ce+Math.imul(Kr,br)|0,re=Math.imul(Kr,hi),ve=ve+Math.imul(Gt,cn)|0,ce=ce+Math.imul(Gt,yn)|0,ce=ce+Math.imul(Jt,cn)|0,re=re+Math.imul(Jt,yn)|0,ve=ve+Math.imul(xt,Sn)|0,ce=ce+Math.imul(xt,fn)|0,ce=ce+Math.imul(ut,Sn)|0,re=re+Math.imul(ut,fn)|0,ve=ve+Math.imul(ze,na)|0,ce=ce+Math.imul(ze,Zt)|0,ce=ce+Math.imul(Ee,na)|0,re=re+Math.imul(Ee,Zt)|0;var Ft=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,ve=Math.imul(mr,cn),ce=Math.imul(mr,yn),ce=ce+Math.imul(Kr,cn)|0,re=Math.imul(Kr,yn),ve=ve+Math.imul(Gt,Sn)|0,ce=ce+Math.imul(Gt,fn)|0,ce=ce+Math.imul(Jt,Sn)|0,re=re+Math.imul(Jt,fn)|0,ve=ve+Math.imul(xt,na)|0,ce=ce+Math.imul(xt,Zt)|0,ce=ce+Math.imul(ut,na)|0,re=re+Math.imul(ut,Zt)|0;var Rt=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,ve=Math.imul(mr,Sn),ce=Math.imul(mr,fn),ce=ce+Math.imul(Kr,Sn)|0,re=Math.imul(Kr,fn),ve=ve+Math.imul(Gt,na)|0,ce=ce+Math.imul(Gt,Zt)|0,ce=ce+Math.imul(Jt,na)|0,re=re+Math.imul(Jt,Zt)|0;var qr=(xe+ve|0)+((ce&8191)<<13)|0;xe=(re+(ce>>>13)|0)+(qr>>>26)|0,qr&=67108863,ve=Math.imul(mr,na),ce=Math.imul(mr,Zt),ce=ce+Math.imul(Kr,na)|0,re=Math.imul(Kr,Zt);var ni=(xe+ve|0)+((ce&8191)<<13)|0;return xe=(re+(ce>>>13)|0)+(ni>>>26)|0,ni&=67108863,he[0]=sr,he[1]=_r,he[2]=Cr,he[3]=fi,he[4]=qi,he[5]=Ui,he[6]=Hi,he[7]=En,he[8]=Rn,he[9]=Gn,he[10]=Xn,he[11]=sa,he[12]=Mn,he[13]=Ha,he[14]=ro,he[15]=Ft,he[16]=Rt,he[17]=qr,he[18]=ni,xe!==0&&(he[19]=xe,q.length++),q};Math.imul||(E=D);function I(F,$,q){q.negative=$.negative^F.negative,q.length=F.length+$.length;for(var G=0,ee=0,he=0;he>>26)|0,ee+=xe>>>26,xe&=67108863}q.words[he]=ve,G=xe,xe=ee}return G!==0?q.words[he]=G:q.length--,q.strip()}function M(F,$,q){var G=new p;return G.mulp(F,$,q)}h.prototype.mulTo=function(F,$){var q,G=this.length+F.length;return this.length===10&&F.length===10?q=E(this,F,$):G<63?q=D(this,F,$):G<1024?q=I(this,F,$):q=M(this,F,$),q};function p(F,$){this.x=F,this.y=$}p.prototype.makeRBT=function(F){for(var $=new Array(F),q=h.prototype._countBits(F)-1,G=0;G>=1;return G},p.prototype.permute=function(F,$,q,G,ee,he){for(var xe=0;xe>>1)ee++;return 1<>>13,q[2*he+1]=ee&8191,ee=ee>>>13;for(he=2*$;he>=26,$+=G/67108864|0,$+=ee>>>26,this.words[q]=ee&67108863}return $!==0&&(this.words[q]=$,this.length++),this},h.prototype.muln=function(F){return this.clone().imuln(F)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(F){var $=w(F);if($.length===0)return new h(1);for(var q=this,G=0;G<$.length&&$[G]===0;G++,q=q.sqr());if(++G<$.length)for(var ee=q.sqr();G<$.length;G++,ee=ee.sqr())$[G]!==0&&(q=q.mul(ee));return q},h.prototype.iushln=function(F){u(typeof F=="number"&&F>=0);var $=F%26,q=(F-$)/26,G=67108863>>>26-$<<26-$,ee;if($!==0){var he=0;for(ee=0;ee>>26-$}he&&(this.words[ee]=he,this.length++)}if(q!==0){for(ee=this.length-1;ee>=0;ee--)this.words[ee+q]=this.words[ee];for(ee=0;ee=0);var G;$?G=($-$%26)/26:G=0;var ee=F%26,he=Math.min((F-ee)/26,this.length),xe=67108863^67108863>>>ee<he)for(this.length-=he,ce=0;ce=0&&(re!==0||ce>=G);ce--){var ge=this.words[ce]|0;this.words[ce]=re<<26-ee|ge>>>ee,re=ge&xe}return ve&&re!==0&&(ve.words[ve.length++]=re),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},h.prototype.ishrn=function(F,$,q){return u(this.negative===0),this.iushrn(F,$,q)},h.prototype.shln=function(F){return this.clone().ishln(F)},h.prototype.ushln=function(F){return this.clone().iushln(F)},h.prototype.shrn=function(F){return this.clone().ishrn(F)},h.prototype.ushrn=function(F){return this.clone().iushrn(F)},h.prototype.testn=function(F){u(typeof F=="number"&&F>=0);var $=F%26,q=(F-$)/26,G=1<<$;if(this.length<=q)return!1;var ee=this.words[q];return!!(ee&G)},h.prototype.imaskn=function(F){u(typeof F=="number"&&F>=0);var $=F%26,q=(F-$)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=q)return this;if($!==0&&q++,this.length=Math.min(q,this.length),$!==0){var G=67108863^67108863>>>$<<$;this.words[this.length-1]&=G}return this.strip()},h.prototype.maskn=function(F){return this.clone().imaskn(F)},h.prototype.iaddn=function(F){return u(typeof F=="number"),u(F<67108864),F<0?this.isubn(-F):this.negative!==0?this.length===1&&(this.words[0]|0)=67108864;$++)this.words[$]-=67108864,$===this.length-1?this.words[$+1]=1:this.words[$+1]++;return this.length=Math.max(this.length,$+1),this},h.prototype.isubn=function(F){if(u(typeof F=="number"),u(F<67108864),F<0)return this.iaddn(-F);if(this.negative!==0)return this.negative=0,this.iaddn(F),this.negative=1,this;if(this.words[0]-=F,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var $=0;$>26)-(ve/67108864|0),this.words[ee+q]=he&67108863}for(;ee>26,this.words[ee+q]=he&67108863;if(xe===0)return this.strip();for(u(xe===-1),xe=0,ee=0;ee>26,this.words[ee]=he&67108863;return this.negative=1,this.strip()},h.prototype._wordDiv=function(F,$){var q=this.length-F.length,G=this.clone(),ee=F,he=ee.words[ee.length-1]|0,xe=this._countBits(he);q=26-xe,q!==0&&(ee=ee.ushln(q),G.iushln(q),he=ee.words[ee.length-1]|0);var ve=G.length-ee.length,ce;if($!=="mod"){ce=new h(null),ce.length=ve+1,ce.words=new Array(ce.length);for(var re=0;re=0;ne--){var se=(G.words[ee.length+ne]|0)*67108864+(G.words[ee.length+ne-1]|0);for(se=Math.min(se/he|0,67108863),G._ishlnsubmul(ee,se,ne);G.negative!==0;)se--,G.negative=0,G._ishlnsubmul(ee,1,ne),G.isZero()||(G.negative^=1);ce&&(ce.words[ne]=se)}return ce&&ce.strip(),G.strip(),$!=="div"&&q!==0&&G.iushrn(q),{div:ce||null,mod:G}},h.prototype.divmod=function(F,$,q){if(u(!F.isZero()),this.isZero())return{div:new h(0),mod:new h(0)};var G,ee,he;return this.negative!==0&&F.negative===0?(he=this.neg().divmod(F,$),$!=="mod"&&(G=he.div.neg()),$!=="div"&&(ee=he.mod.neg(),q&&ee.negative!==0&&ee.iadd(F)),{div:G,mod:ee}):this.negative===0&&F.negative!==0?(he=this.divmod(F.neg(),$),$!=="mod"&&(G=he.div.neg()),{div:G,mod:he.mod}):(this.negative&F.negative)!==0?(he=this.neg().divmod(F.neg(),$),$!=="div"&&(ee=he.mod.neg(),q&&ee.negative!==0&&ee.isub(F)),{div:he.div,mod:ee}):F.length>this.length||this.cmp(F)<0?{div:new h(0),mod:this}:F.length===1?$==="div"?{div:this.divn(F.words[0]),mod:null}:$==="mod"?{div:null,mod:new h(this.modn(F.words[0]))}:{div:this.divn(F.words[0]),mod:new h(this.modn(F.words[0]))}:this._wordDiv(F,$)},h.prototype.div=function(F){return this.divmod(F,"div",!1).div},h.prototype.mod=function(F){return this.divmod(F,"mod",!1).mod},h.prototype.umod=function(F){return this.divmod(F,"mod",!0).mod},h.prototype.divRound=function(F){var $=this.divmod(F);if($.mod.isZero())return $.div;var q=$.div.negative!==0?$.mod.isub(F):$.mod,G=F.ushrn(1),ee=F.andln(1),he=q.cmp(G);return he<0||ee===1&&he===0?$.div:$.div.negative!==0?$.div.isubn(1):$.div.iaddn(1)},h.prototype.modn=function(F){u(F<=67108863);for(var $=67108864%F,q=0,G=this.length-1;G>=0;G--)q=($*q+(this.words[G]|0))%F;return q},h.prototype.idivn=function(F){u(F<=67108863);for(var $=0,q=this.length-1;q>=0;q--){var G=(this.words[q]|0)+$*67108864;this.words[q]=G/F|0,$=G%F}return this.strip()},h.prototype.divn=function(F){return this.clone().idivn(F)},h.prototype.egcd=function(F){u(F.negative===0),u(!F.isZero());var $=this,q=F.clone();$.negative!==0?$=$.umod(F):$=$.clone();for(var G=new h(1),ee=new h(0),he=new h(0),xe=new h(1),ve=0;$.isEven()&&q.isEven();)$.iushrn(1),q.iushrn(1),++ve;for(var ce=q.clone(),re=$.clone();!$.isZero();){for(var ge=0,ne=1;($.words[0]&ne)===0&&ge<26;++ge,ne<<=1);if(ge>0)for($.iushrn(ge);ge-- >0;)(G.isOdd()||ee.isOdd())&&(G.iadd(ce),ee.isub(re)),G.iushrn(1),ee.iushrn(1);for(var se=0,_e=1;(q.words[0]&_e)===0&&se<26;++se,_e<<=1);if(se>0)for(q.iushrn(se);se-- >0;)(he.isOdd()||xe.isOdd())&&(he.iadd(ce),xe.isub(re)),he.iushrn(1),xe.iushrn(1);$.cmp(q)>=0?($.isub(q),G.isub(he),ee.isub(xe)):(q.isub($),he.isub(G),xe.isub(ee))}return{a:he,b:xe,gcd:q.iushln(ve)}},h.prototype._invmp=function(F){u(F.negative===0),u(!F.isZero());var $=this,q=F.clone();$.negative!==0?$=$.umod(F):$=$.clone();for(var G=new h(1),ee=new h(0),he=q.clone();$.cmpn(1)>0&&q.cmpn(1)>0;){for(var xe=0,ve=1;($.words[0]&ve)===0&&xe<26;++xe,ve<<=1);if(xe>0)for($.iushrn(xe);xe-- >0;)G.isOdd()&&G.iadd(he),G.iushrn(1);for(var ce=0,re=1;(q.words[0]&re)===0&&ce<26;++ce,re<<=1);if(ce>0)for(q.iushrn(ce);ce-- >0;)ee.isOdd()&&ee.iadd(he),ee.iushrn(1);$.cmp(q)>=0?($.isub(q),G.isub(ee)):(q.isub($),ee.isub(G))}var ge;return $.cmpn(1)===0?ge=G:ge=ee,ge.cmpn(0)<0&&ge.iadd(F),ge},h.prototype.gcd=function(F){if(this.isZero())return F.abs();if(F.isZero())return this.abs();var $=this.clone(),q=F.clone();$.negative=0,q.negative=0;for(var G=0;$.isEven()&&q.isEven();G++)$.iushrn(1),q.iushrn(1);do{for(;$.isEven();)$.iushrn(1);for(;q.isEven();)q.iushrn(1);var ee=$.cmp(q);if(ee<0){var he=$;$=q,q=he}else if(ee===0||q.cmpn(1)===0)break;$.isub(q)}while(!0);return q.iushln(G)},h.prototype.invm=function(F){return this.egcd(F).a.umod(F)},h.prototype.isEven=function(){return(this.words[0]&1)===0},h.prototype.isOdd=function(){return(this.words[0]&1)===1},h.prototype.andln=function(F){return this.words[0]&F},h.prototype.bincn=function(F){u(typeof F=="number");var $=F%26,q=(F-$)/26,G=1<<$;if(this.length<=q)return this._expand(q+1),this.words[q]|=G,this;for(var ee=G,he=q;ee!==0&&he>>26,xe&=67108863,this.words[he]=xe}return ee!==0&&(this.words[he]=ee,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(F){var $=F<0;if(this.negative!==0&&!$)return-1;if(this.negative===0&&$)return 1;this.strip();var q;if(this.length>1)q=1;else{$&&(F=-F),u(F<=67108863,"Number is too big");var G=this.words[0]|0;q=G===F?0:GF.length)return 1;if(this.length=0;q--){var G=this.words[q]|0,ee=F.words[q]|0;if(G!==ee){Gee&&($=1);break}}return $},h.prototype.gtn=function(F){return this.cmpn(F)===1},h.prototype.gt=function(F){return this.cmp(F)===1},h.prototype.gten=function(F){return this.cmpn(F)>=0},h.prototype.gte=function(F){return this.cmp(F)>=0},h.prototype.ltn=function(F){return this.cmpn(F)===-1},h.prototype.lt=function(F){return this.cmp(F)===-1},h.prototype.lten=function(F){return this.cmpn(F)<=0},h.prototype.lte=function(F){return this.cmp(F)<=0},h.prototype.eqn=function(F){return this.cmpn(F)===0},h.prototype.eq=function(F){return this.cmp(F)===0},h.red=function(F){return new V(F)},h.prototype.toRed=function(F){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),F.convertTo(this)._forceRed(F)},h.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(F){return this.red=F,this},h.prototype.forceRed=function(F){return u(!this.red,"Already a number in reduction context"),this._forceRed(F)},h.prototype.redAdd=function(F){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,F)},h.prototype.redIAdd=function(F){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,F)},h.prototype.redSub=function(F){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,F)},h.prototype.redISub=function(F){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,F)},h.prototype.redShl=function(F){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,F)},h.prototype.redMul=function(F){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.mul(this,F)},h.prototype.redIMul=function(F){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.imul(this,F)},h.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(F){return u(this.red&&!F.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,F)};var g={k256:null,p224:null,p192:null,p25519:null};function C(F,$){this.name=F,this.p=new h($,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var F=new h(null);return F.words=new Array(Math.ceil(this.n/13)),F},C.prototype.ireduce=function(F){var $=F,q;do this.split($,this.tmp),$=this.imulK($),$=$.iadd(this.tmp),q=$.bitLength();while(q>this.n);var G=q0?$.isub(this.p):$.strip!==void 0?$.strip():$._strip(),$},C.prototype.split=function(F,$){F.iushrn(this.n,0,$)},C.prototype.imulK=function(F){return F.imul(this.k)};function T(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(T,C),T.prototype.split=function(F,$){for(var q=4194303,G=Math.min(F.length,9),ee=0;ee>>22,he=xe}he>>>=22,F.words[ee-10]=he,he===0&&F.length>10?F.length-=10:F.length-=9},T.prototype.imulK=function(F){F.words[F.length]=0,F.words[F.length+1]=0,F.length+=2;for(var $=0,q=0;q>>=26,F.words[q]=ee,$=G}return $!==0&&(F.words[F.length++]=$),F},h._prime=function(F){if(g[F])return g[F];var $;if(F==="k256")$=new T;else if(F==="p224")$=new N;else if(F==="p192")$=new B;else if(F==="p25519")$=new U;else throw new Error("Unknown prime "+F);return g[F]=$,$};function V(F){if(typeof F=="string"){var $=h._prime(F);this.m=$.p,this.prime=$}else u(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}V.prototype._verify1=function(F){u(F.negative===0,"red works only with positives"),u(F.red,"red works only with red numbers")},V.prototype._verify2=function(F,$){u((F.negative|$.negative)===0,"red works only with positives"),u(F.red&&F.red===$.red,"red works only with red numbers")},V.prototype.imod=function(F){return this.prime?this.prime.ireduce(F)._forceRed(this):F.umod(this.m)._forceRed(this)},V.prototype.neg=function(F){return F.isZero()?F.clone():this.m.sub(F)._forceRed(this)},V.prototype.add=function(F,$){this._verify2(F,$);var q=F.add($);return q.cmp(this.m)>=0&&q.isub(this.m),q._forceRed(this)},V.prototype.iadd=function(F,$){this._verify2(F,$);var q=F.iadd($);return q.cmp(this.m)>=0&&q.isub(this.m),q},V.prototype.sub=function(F,$){this._verify2(F,$);var q=F.sub($);return q.cmpn(0)<0&&q.iadd(this.m),q._forceRed(this)},V.prototype.isub=function(F,$){this._verify2(F,$);var q=F.isub($);return q.cmpn(0)<0&&q.iadd(this.m),q},V.prototype.shl=function(F,$){return this._verify1(F),this.imod(F.ushln($))},V.prototype.imul=function(F,$){return this._verify2(F,$),this.imod(F.imul($))},V.prototype.mul=function(F,$){return this._verify2(F,$),this.imod(F.mul($))},V.prototype.isqr=function(F){return this.imul(F,F.clone())},V.prototype.sqr=function(F){return this.mul(F,F)},V.prototype.sqrt=function(F){if(F.isZero())return F.clone();var $=this.m.andln(3);if(u($%2===1),$===3){var q=this.m.add(new h(1)).iushrn(2);return this.pow(F,q)}for(var G=this.m.subn(1),ee=0;!G.isZero()&&G.andln(1)===0;)ee++,G.iushrn(1);u(!G.isZero());var he=new h(1).toRed(this),xe=he.redNeg(),ve=this.m.subn(1).iushrn(1),ce=this.m.bitLength();for(ce=new h(2*ce*ce).toRed(this);this.pow(ce,ve).cmp(xe)!==0;)ce.redIAdd(xe);for(var re=this.pow(ce,G),ge=this.pow(F,G.addn(1).iushrn(1)),ne=this.pow(F,G),se=ee;ne.cmp(he)!==0;){for(var _e=ne,oe=0;_e.cmp(he)!==0;oe++)_e=_e.redSqr();u(oe=0;ee--){for(var re=$.words[ee],ge=ce-1;ge>=0;ge--){var ne=re>>ge&1;if(he!==G[0]&&(he=this.sqr(he)),ne===0&&xe===0){ve=0;continue}xe<<=1,xe|=ne,ve++,!(ve!==q&&(ee!==0||ge!==0))&&(he=this.mul(he,G[xe]),ve=0,xe=0)}ce=26}return he},V.prototype.convertTo=function(F){var $=F.umod(this.m);return $===F?$.clone():$},V.prototype.convertFrom=function(F){var $=F.clone();return $.red=null,$},h.mont=function(F){return new W(F)};function W(F){V.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(W,V),W.prototype.convertTo=function(F){return this.imod(F.ushln(this.shift))},W.prototype.convertFrom=function(F){var $=this.imod(F.mul(this.rinv));return $.red=null,$},W.prototype.imul=function(F,$){if(F.isZero()||$.isZero())return F.words[0]=0,F.length=1,F;var q=F.imul($),G=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ee=q.isub(G).iushrn(this.shift),he=ee;return ee.cmp(this.m)>=0?he=ee.isub(this.m):ee.cmpn(0)<0&&(he=ee.iadd(this.m)),he._forceRed(this)},W.prototype.mul=function(F,$){if(F.isZero()||$.isZero())return new h(0)._forceRed(this);var q=F.mul($),G=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ee=q.isub(G).iushrn(this.shift),he=ee;return ee.cmp(this.m)>=0?he=ee.isub(this.m):ee.cmpn(0)<0&&(he=ee.iadd(this.m)),he._forceRed(this)},W.prototype.invm=function(F){var $=this.imod(F._invmp(this.m).mul(this.r2));return $._forceRed(this)}}(i,this)},6860:function(i){i.exports=n;function n(a,l,o){return a[0]=l[0]-o[0],a[1]=l[1]-o[1],a[2]=l[2]-o[2],a[3]=l[3]-o[3],a}},6864:function(i){i.exports=n;function n(){var a=new Float32Array(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},6867:function(i,n,a){i.exports=f;var l=a(1888),o=a(855),u=a(7150);function s(k,w){for(var D=0;D>>1;if(!(p<=0)){var g,C=l.mallocDouble(2*p*I),T=l.mallocInt32(I);if(I=h(k,p,C,T),I>0){if(p===1&&E)o.init(I),g=o.sweepComplete(p,D,0,I,C,T,0,I,C,T);else{var N=l.mallocDouble(2*p*M),B=l.mallocInt32(M);M=h(w,p,N,B),M>0&&(o.init(I+M),p===1?g=o.sweepBipartite(p,D,0,I,C,T,0,M,N,B):g=u(p,D,E,I,C,T,M,N,B),l.free(N),l.free(B))}l.free(C),l.free(T)}return g}}}var b;function x(k,w){b.push([k,w])}function _(k){return b=[],m(k,k,x,!0),b}function A(k,w){return b=[],m(k,w,x,!1),b}function f(k,w,D){switch(arguments.length){case 1:return _(k);case 2:return typeof w=="function"?m(k,k,w,!0):A(k,w);case 3:return m(k,w,D,!1);default:throw new Error("box-intersect: Invalid arguments")}}},6894:function(i){i.exports=n;function n(a,l,o,u){var s=o[1],h=o[2],m=l[1]-s,b=l[2]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=l[0],a[1]=s+m*_-b*x,a[2]=h+m*x+b*_,a}},7004:function(i){i.exports=n;function n(a){for(var l=a.length,o=a[a.length-1],u=l,s=l-2;s>=0;--s){var h=o,m=a[s];o=h+m;var b=o-h,x=m-b;x&&(a[--u]=o,o=x)}for(var _=0,s=u;s=p0)&&!(p1>=hi)"),w=x("lo===p0"),D=x("lo0;){ge-=1;var _e=ge*p,oe=T[_e],J=T[_e+1],me=T[_e+2],fe=T[_e+3],Ce=T[_e+4],Be=T[_e+5],Oe=ge*g,Ze=N[Oe],Ge=N[Oe+1],rt=Be&1,_t=!!(Be&16),pt=he,gt=xe,ct=ce,Ae=re;if(rt&&(pt=ce,gt=re,ct=he,Ae=xe),!(Be&2&&(me=D($,oe,J,me,pt,gt,Ge),J>=me))&&!(Be&4&&(J=E($,oe,J,me,pt,gt,Ze),J>=me))){var ze=me-J,Ee=Ce-fe;if(_t){if($*ze*(ze+Ee)"u"?a(1538):WeakMap,o=a(2762),u=a(8116),s=new l;function h(m){var b=s.get(m),x=b&&(b._triangleBuffer.handle||b._triangleBuffer.buffer);if(!x||!m.isBuffer(x)){var _=o(m,new Float32Array([-1,-1,-1,4,4,-1]));b=u(m,[{buffer:_,type:m.FLOAT,size:2}]),b._triangleBuffer=_,s.set(m,b)}b.bind(),m.drawArrays(m.TRIANGLES,0,3),b.unbind()}i.exports=h},7182:function(i,n,a){var l={identity:a(7894),translate:a(7656),multiply:a(6760),create:a(6864),scale:a(2504),fromRotationTranslation:a(6743)};l.create();var o=l.create();i.exports=function(u,s,h,m,b,x){return l.identity(u),l.fromRotationTranslation(u,x,s),u[3]=b[0],u[7]=b[1],u[11]=b[2],u[15]=b[3],l.identity(o),m[2]!==0&&(o[9]=m[2],l.multiply(u,u,o)),m[1]!==0&&(o[9]=0,o[8]=m[1],l.multiply(u,u,o)),m[0]!==0&&(o[8]=0,o[4]=m[0],l.multiply(u,u,o)),l.scale(u,u,h),u}},7201:function(i,n,a){var l=1e-6,o=1e-6,u=a(9405),s=a(2762),h=a(8116),m=a(7766),b=a(8406),x=a(6760),_=a(7608),A=a(9618),f=a(6729),k=a(7765),w=a(1888),D=a(840),E=a(7626),I=D.meshShader,M=D.wireShader,p=D.pointShader,g=D.pickShader,C=D.pointPickShader,T=D.contourShader,N=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function B(ce,re,ge,ne,se,_e,oe,J,me,fe,Ce,Be,Oe,Ze,Ge,rt,_t,pt,gt,ct,Ae,ze,Ee,nt,xt,ut,Et){this.gl=ce,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=re,this.dirty=!0,this.triShader=ge,this.lineShader=ne,this.pointShader=se,this.pickShader=_e,this.pointPickShader=oe,this.contourShader=J,this.trianglePositions=me,this.triangleColors=Ce,this.triangleNormals=Oe,this.triangleUVs=Be,this.triangleIds=fe,this.triangleVAO=Ze,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ge,this.edgeColors=_t,this.edgeUVs=pt,this.edgeIds=rt,this.edgeVAO=gt,this.edgeCount=0,this.pointPositions=ct,this.pointColors=ze,this.pointUVs=Ee,this.pointSizes=nt,this.pointIds=Ae,this.pointVAO=xt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=ut,this.contourVAO=Et,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=N,this._view=N,this._projection=N,this._resolution=[1,1]}var U=B.prototype;U.isOpaque=function(){return!this.hasAlpha},U.isTransparent=function(){return this.hasAlpha},U.pickSlots=1,U.setPickBase=function(ce){this.pickId=ce};function V(ce,re){if(!re||!re.length)return 1;for(var ge=0;gece&&ge>0){var ne=(re[ge][0]-ce)/(re[ge][0]-re[ge-1][0]);return re[ge][1]*(1-ne)+ne*re[ge-1][1]}}return 1}function W(ce,re){for(var ge=f({colormap:ce,nshades:256,format:"rgba"}),ne=new Uint8Array(1024),se=0;se<256;++se){for(var _e=ge[se],oe=0;oe<3;++oe)ne[4*se+oe]=_e[oe];re?ne[4*se+3]=255*V(se/255,re):ne[4*se+3]=255*_e[3]}return A(ne,[256,256,4],[4,0,1])}function F(ce){for(var re=ce.length,ge=new Array(re),ne=0;ne0){var Oe=this.triShader;Oe.bind(),Oe.uniforms=J,this.triangleVAO.bind(),re.drawArrays(re.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Oe=this.lineShader;Oe.bind(),Oe.uniforms=J,this.edgeVAO.bind(),re.lineWidth(this.lineWidth*this.pixelRatio),re.drawArrays(re.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Oe=this.pointShader;Oe.bind(),Oe.uniforms=J,this.pointVAO.bind(),re.drawArrays(re.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Oe=this.contourShader;Oe.bind(),Oe.uniforms=J,this.contourVAO.bind(),re.drawArrays(re.LINES,0,this.contourCount),this.contourVAO.unbind()}},U.drawPick=function(ce){ce=ce||{};for(var re=this.gl,ge=ce.model||N,ne=ce.view||N,se=ce.projection||N,_e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],oe=0;oe<3;++oe)_e[0][oe]=Math.max(_e[0][oe],this.clipBounds[0][oe]),_e[1][oe]=Math.min(_e[1][oe],this.clipBounds[1][oe]);this._model=[].slice.call(ge),this._view=[].slice.call(ne),this._projection=[].slice.call(se),this._resolution=[re.drawingBufferWidth,re.drawingBufferHeight];var J={model:ge,view:ne,projection:se,clipBounds:_e,pickId:this.pickId/255},me=this.pickShader;if(me.bind(),me.uniforms=J,this.triangleCount>0&&(this.triangleVAO.bind(),re.drawArrays(re.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),re.lineWidth(this.lineWidth*this.pixelRatio),re.drawArrays(re.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var me=this.pointPickShader;me.bind(),me.uniforms=J,this.pointVAO.bind(),re.drawArrays(re.POINTS,0,this.pointCount),this.pointVAO.unbind()}},U.pick=function(ce){if(!ce||ce.id!==this.pickId)return null;for(var re=ce.value[0]+256*ce.value[1]+65536*ce.value[2],ge=this.cells[re],ne=this.positions,se=new Array(ge.length),_e=0;_eMath.max(I,M)?p[2]=1:I>Math.max(E,M)?p[0]=1:p[1]=1;for(var g=0,C=0,T=0;T<3;++T)g+=D[T]*D[T],C+=p[T]*D[T];for(var T=0;T<3;++T)p[T]-=C/g*D[T];return h(p,p),p}function A(D,E,I,M,p,g,C,T){this.center=l(I),this.up=l(M),this.right=l(p),this.radius=l([g]),this.angle=l([C,T]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(D,E),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var N=0;N<16;++N)this.computedMatrix[N]=.5;this.recalcMatrix(0)}var f=A.prototype;f.setDistanceLimits=function(D,E){D>0?D=Math.log(D):D=-1/0,E>0?E=Math.log(E):E=1/0,E=Math.max(E,D),this.radius.bounds[0][0]=D,this.radius.bounds[1][0]=E},f.getDistanceLimits=function(D){var E=this.radius.bounds[0];return D?(D[0]=Math.exp(E[0][0]),D[1]=Math.exp(E[1][0]),D):[Math.exp(E[0][0]),Math.exp(E[1][0])]},f.recalcMatrix=function(D){this.center.curve(D),this.up.curve(D),this.right.curve(D),this.radius.curve(D),this.angle.curve(D);for(var E=this.computedUp,I=this.computedRight,M=0,p=0,g=0;g<3;++g)p+=E[g]*I[g],M+=E[g]*E[g];for(var C=Math.sqrt(M),T=0,g=0;g<3;++g)I[g]-=E[g]*p/M,T+=I[g]*I[g],E[g]/=C;for(var N=Math.sqrt(T),g=0;g<3;++g)I[g]/=N;var B=this.computedToward;s(B,E,I),h(B,B);for(var U=Math.exp(this.computedRadius[0]),V=this.computedAngle[0],W=this.computedAngle[1],F=Math.cos(V),$=Math.sin(V),q=Math.cos(W),G=Math.sin(W),ee=this.computedCenter,he=F*q,xe=$*q,ve=G,ce=-F*G,re=-$*G,ge=q,ne=this.computedEye,se=this.computedMatrix,g=0;g<3;++g){var _e=he*I[g]+xe*B[g]+ve*E[g];se[4*g+1]=ce*I[g]+re*B[g]+ge*E[g],se[4*g+2]=_e,se[4*g+3]=0}var oe=se[1],J=se[5],me=se[9],fe=se[2],Ce=se[6],Be=se[10],Oe=J*Be-me*Ce,Ze=me*fe-oe*Be,Ge=oe*Ce-J*fe,rt=b(Oe,Ze,Ge);Oe/=rt,Ze/=rt,Ge/=rt,se[0]=Oe,se[4]=Ze,se[8]=Ge;for(var g=0;g<3;++g)ne[g]=ee[g]+se[2+4*g]*U;for(var g=0;g<3;++g){for(var T=0,_t=0;_t<3;++_t)T+=se[g+4*_t]*ne[_t];se[12+g]=-T}se[15]=1},f.getMatrix=function(D,E){this.recalcMatrix(D);var I=this.computedMatrix;if(E){for(var M=0;M<16;++M)E[M]=I[M];return E}return I};var k=[0,0,0];f.rotate=function(D,E,I,M){if(this.angle.move(D,E,I),M){this.recalcMatrix(D);var p=this.computedMatrix;k[0]=p[2],k[1]=p[6],k[2]=p[10];for(var g=this.computedUp,C=this.computedRight,T=this.computedToward,N=0;N<3;++N)p[4*N]=g[N],p[4*N+1]=C[N],p[4*N+2]=T[N];u(p,p,M,k);for(var N=0;N<3;++N)g[N]=p[4*N],C[N]=p[4*N+1];this.up.set(D,g[0],g[1],g[2]),this.right.set(D,C[0],C[1],C[2])}},f.pan=function(D,E,I,M){E=E||0,I=I||0,M=M||0,this.recalcMatrix(D);var p=this.computedMatrix;Math.exp(this.computedRadius[0]);var g=p[1],C=p[5],T=p[9],N=b(g,C,T);g/=N,C/=N,T/=N;var B=p[0],U=p[4],V=p[8],W=B*g+U*C+V*T;B-=g*W,U-=C*W,V-=T*W;var F=b(B,U,V);B/=F,U/=F,V/=F;var $=B*E+g*I,q=U*E+C*I,G=V*E+T*I;this.center.move(D,$,q,G);var ee=Math.exp(this.computedRadius[0]);ee=Math.max(1e-4,ee+M),this.radius.set(D,Math.log(ee))},f.translate=function(D,E,I,M){this.center.move(D,E||0,I||0,M||0)},f.setMatrix=function(D,E,I,M){var p=1;typeof I=="number"&&(p=I|0),(p<0||p>3)&&(p=1);var g=(p+2)%3;E||(this.recalcMatrix(D),E=this.computedMatrix);var C=E[p],T=E[p+4],N=E[p+8];if(M){var B=Math.abs(C),U=Math.abs(T),V=Math.abs(N),W=Math.max(B,U,V);B===W?(C=C<0?-1:1,T=N=0):V===W?(N=N<0?-1:1,C=T=0):(T=T<0?-1:1,C=N=0)}else{var F=b(C,T,N);C/=F,T/=F,N/=F}var $=E[g],q=E[g+4],G=E[g+8],ee=$*C+q*T+G*N;$-=C*ee,q-=T*ee,G-=N*ee;var he=b($,q,G);$/=he,q/=he,G/=he;var xe=T*G-N*q,ve=N*$-C*G,ce=C*q-T*$,re=b(xe,ve,ce);xe/=re,ve/=re,ce/=re,this.center.jump(D,Ae,ze,Ee),this.radius.idle(D),this.up.jump(D,C,T,N),this.right.jump(D,$,q,G);var ge,ne;if(p===2){var se=E[1],_e=E[5],oe=E[9],J=se*$+_e*q+oe*G,me=se*xe+_e*ve+oe*ce;Oe<0?ge=-Math.PI/2:ge=Math.PI/2,ne=Math.atan2(me,J)}else{var fe=E[2],Ce=E[6],Be=E[10],Oe=fe*C+Ce*T+Be*N,Ze=fe*$+Ce*q+Be*G,Ge=fe*xe+Ce*ve+Be*ce;ge=Math.asin(x(Oe)),ne=Math.atan2(Ge,Ze)}this.angle.jump(D,ne,ge),this.recalcMatrix(D);var rt=E[2],_t=E[6],pt=E[10],gt=this.computedMatrix;o(gt,E);var ct=gt[15],Ae=gt[12]/ct,ze=gt[13]/ct,Ee=gt[14]/ct,nt=Math.exp(this.computedRadius[0]);this.center.jump(D,Ae-rt*nt,ze-_t*nt,Ee-pt*nt)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(D){this.center.idle(D),this.up.idle(D),this.right.idle(D),this.radius.idle(D),this.angle.idle(D)},f.flush=function(D){this.center.flush(D),this.up.flush(D),this.right.flush(D),this.radius.flush(D),this.angle.flush(D)},f.setDistance=function(D,E){E>0&&this.radius.set(D,Math.log(E))},f.lookAt=function(D,E,I,M){this.recalcMatrix(D),E=E||this.computedEye,I=I||this.computedCenter,M=M||this.computedUp;var p=M[0],g=M[1],C=M[2],T=b(p,g,C);if(!(T<1e-6)){p/=T,g/=T,C/=T;var N=E[0]-I[0],B=E[1]-I[1],U=E[2]-I[2],V=b(N,B,U);if(!(V<1e-6)){N/=V,B/=V,U/=V;var W=this.computedRight,F=W[0],$=W[1],q=W[2],G=p*F+g*$+C*q;F-=G*p,$-=G*g,q-=G*C;var ee=b(F,$,q);if(!(ee<.01&&(F=g*U-C*B,$=C*N-p*U,q=p*B-g*N,ee=b(F,$,q),ee<1e-6))){F/=ee,$/=ee,q/=ee,this.up.set(D,p,g,C),this.right.set(D,F,$,q),this.center.set(D,I[0],I[1],I[2]),this.radius.set(D,Math.log(V));var he=g*q-C*$,xe=C*F-p*q,ve=p*$-g*F,ce=b(he,xe,ve);he/=ce,xe/=ce,ve/=ce;var re=p*N+g*B+C*U,ge=F*N+$*B+q*U,ne=he*N+xe*B+ve*U,se=Math.asin(x(re)),_e=Math.atan2(ne,ge),oe=this.angle._state,J=oe[oe.length-1],me=oe[oe.length-2];J=J%(2*Math.PI);var fe=Math.abs(J+2*Math.PI-_e),Ce=Math.abs(J-_e),Be=Math.abs(J-2*Math.PI-_e);fe0?F:H},h.min=function(F,H){return F.cmp(H)<0?F:H},h.prototype._init=function(F,H,q){if(typeof F=="number")return this._initNumber(F,H,q);if(typeof F=="object")return this._initArray(F,H,q);H==="hex"&&(H=16),u(H===(H|0)&&H>=2&&H<=36),F=F.toString().replace(/\s+/g,"");var G=0;F[0]==="-"&&(G++,this.negative=1),G=0;G-=3)he=F[G]|F[G-1]<<8|F[G-2]<<16,this.words[ee]|=he<>>26-be&67108863,be+=24,be>=26&&(be-=26,ee++);else if(q==="le")for(G=0,ee=0;G>>26-be&67108863,be+=24,be>=26&&(be-=26,ee++);return this.strip()};function b(F,H){var q=F.charCodeAt(H);return q>=65&&q<=70?q-55:q>=97&&q<=102?q-87:q-48&15}function x(F,H,q){var G=b(F,q);return q-1>=H&&(G|=b(F,q-1)<<4),G}h.prototype._parseHex=function(F,H,q){this.length=Math.ceil((F.length-H)/6),this.words=new Array(this.length);for(var G=0;G=H;G-=2)be=x(F,H,G)<=18?(ee-=18,he+=1,this.words[he]|=be>>>26):ee+=8;else{var ve=F.length-H;for(G=ve%2===0?H+1:H;G=18?(ee-=18,he+=1,this.words[he]|=be>>>26):ee+=8}this.strip()};function _(F,H,q,G){for(var ee=0,he=Math.min(F.length,q),be=H;be=49?ee+=ve-49+10:ve>=17?ee+=ve-17+10:ee+=ve}return ee}h.prototype._parseBase=function(F,H,q){this.words=[0],this.length=1;for(var G=0,ee=1;ee<=67108863;ee*=H)G++;G--,ee=ee/H|0;for(var he=F.length-q,be=he%G,ve=Math.min(he,he-be)+q,ce=0,re=q;re1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},h.prototype.inspect=function(){return(this.red?""};var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],k=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];h.prototype.toString=function(F,H){F=F||10,H=H|0||1;var q;if(F===16||F==="hex"){q="";for(var G=0,ee=0,he=0;he>>24-G&16777215,ee!==0||he!==this.length-1?q=A[6-ve.length]+ve+q:q=ve+q,G+=2,G>=26&&(G-=26,he--)}for(ee!==0&&(q=ee.toString(16)+q);q.length%H!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}if(F===(F|0)&&F>=2&&F<=36){var ce=f[F],re=k[F];q="";var ge=this.clone();for(ge.negative=0;!ge.isZero();){var ne=ge.modn(re).toString(F);ge=ge.idivn(re),ge.isZero()?q=ne+q:q=A[ce-ne.length]+ne+q}for(this.isZero()&&(q="0"+q);q.length%H!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}u(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var F=this.words[0];return this.length===2?F+=this.words[1]*67108864:this.length===3&&this.words[2]===1?F+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-F:F},h.prototype.toJSON=function(){return this.toString(16)},h.prototype.toBuffer=function(F,H){return u(typeof m<"u"),this.toArrayLike(m,F,H)},h.prototype.toArray=function(F,H){return this.toArrayLike(Array,F,H)},h.prototype.toArrayLike=function(F,H,q){var G=this.byteLength(),ee=q||Math.max(1,G);u(G<=ee,"byte array longer than desired length"),u(ee>0,"Requested array length <= 0"),this.strip();var he=H==="le",be=new F(ee),ve,ce,re=this.clone();if(he){for(ce=0;!re.isZero();ce++)ve=re.andln(255),re.iushrn(8),be[ce]=ve;for(;ce=4096&&(q+=13,H>>>=13),H>=64&&(q+=7,H>>>=7),H>=8&&(q+=4,H>>>=4),H>=2&&(q+=2,H>>>=2),q+H},h.prototype._zeroBits=function(F){if(F===0)return 26;var H=F,q=0;return(H&8191)===0&&(q+=13,H>>>=13),(H&127)===0&&(q+=7,H>>>=7),(H&15)===0&&(q+=4,H>>>=4),(H&3)===0&&(q+=2,H>>>=2),(H&1)===0&&q++,q},h.prototype.bitLength=function(){var F=this.words[this.length-1],H=this._countBits(F);return(this.length-1)*26+H};function w(F){for(var H=new Array(F.bitLength()),q=0;q>>ee}return H}h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var F=0,H=0;HF.length?this.clone().ior(F):F.clone().ior(this)},h.prototype.uor=function(F){return this.length>F.length?this.clone().iuor(F):F.clone().iuor(this)},h.prototype.iuand=function(F){var H;this.length>F.length?H=F:H=this;for(var q=0;qF.length?this.clone().iand(F):F.clone().iand(this)},h.prototype.uand=function(F){return this.length>F.length?this.clone().iuand(F):F.clone().iuand(this)},h.prototype.iuxor=function(F){var H,q;this.length>F.length?(H=this,q=F):(H=F,q=this);for(var G=0;GF.length?this.clone().ixor(F):F.clone().ixor(this)},h.prototype.uxor=function(F){return this.length>F.length?this.clone().iuxor(F):F.clone().iuxor(this)},h.prototype.inotn=function(F){u(typeof F=="number"&&F>=0);var H=Math.ceil(F/26)|0,q=F%26;this._expand(H),q>0&&H--;for(var G=0;G0&&(this.words[G]=~this.words[G]&67108863>>26-q),this.strip()},h.prototype.notn=function(F){return this.clone().inotn(F)},h.prototype.setn=function(F,H){u(typeof F=="number"&&F>=0);var q=F/26|0,G=F%26;return this._expand(q+1),H?this.words[q]=this.words[q]|1<F.length?(q=this,G=F):(q=F,G=this);for(var ee=0,he=0;he>>26;for(;ee!==0&&he>>26;if(this.length=q.length,ee!==0)this.words[this.length]=ee,this.length++;else if(q!==this)for(;heF.length?this.clone().iadd(F):F.clone().iadd(this)},h.prototype.isub=function(F){if(F.negative!==0){F.negative=0;var H=this.iadd(F);return F.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(F),this.negative=1,this._normSign();var q=this.cmp(F);if(q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var G,ee;q>0?(G=this,ee=F):(G=F,ee=this);for(var he=0,be=0;be>26,this.words[be]=H&67108863;for(;he!==0&&be>26,this.words[be]=H&67108863;if(he===0&&be>>26,ne=ce&67108863,se=Math.min(re,H.length-1),_e=Math.max(0,re-F.length+1);_e<=se;_e++){var oe=re-_e|0;ee=F.words[oe]|0,he=H.words[_e]|0,be=ee*he+ne,ge+=be/67108864|0,ne=be&67108863}q.words[re]=ne|0,ce=ge|0}return ce!==0?q.words[re]=ce|0:q.length--,q.strip()}var E=function(F,H,q){var G=F.words,ee=H.words,he=q.words,be=0,ve,ce,re,ge=G[0]|0,ne=ge&8191,se=ge>>>13,_e=G[1]|0,oe=_e&8191,J=_e>>>13,me=G[2]|0,fe=me&8191,Ce=me>>>13,Re=G[3]|0,Be=Re&8191,Ze=Re>>>13,Ge=G[4]|0,tt=Ge&8191,_t=Ge>>>13,mt=G[5]|0,vt=mt&8191,ct=mt>>>13,Ae=G[6]|0,Oe=Ae&8191,Le=Ae>>>13,nt=G[7]|0,xt=nt&8191,ut=nt>>>13,Et=G[8]|0,Gt=Et&8191,Qt=Et>>>13,vr=G[9]|0,mr=vr&8191,Yr=vr>>>13,ii=ee[0]|0,Lr=ii&8191,ci=ii>>>13,vi=ee[1]|0,Ot=vi&8191,Xe=vi>>>13,ot=ee[2]|0,De=ot&8191,ye=ot>>>13,Pe=ee[3]|0,He=Pe&8191,at=Pe>>>13,ht=ee[4]|0,At=ht&8191,Wt=ht>>>13,Yt=ee[5]|0,hr=Yt&8191,zr=Yt>>>13,Dr=ee[6]|0,br=Dr&8191,fi=Dr>>>13,un=ee[7]|0,cn=un&8191,yn=un>>>13,Gn=ee[8]|0,Sn=Gn&8191,dn=Gn>>>13,va=ee[9]|0,na=va&8191,Kt=va>>>13;q.negative=F.negative^H.negative,q.length=19,ve=Math.imul(ne,Lr),ce=Math.imul(ne,ci),ce=ce+Math.imul(se,Lr)|0,re=Math.imul(se,ci);var lr=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(lr>>>26)|0,lr&=67108863,ve=Math.imul(oe,Lr),ce=Math.imul(oe,ci),ce=ce+Math.imul(J,Lr)|0,re=Math.imul(J,ci),ve=ve+Math.imul(ne,Ot)|0,ce=ce+Math.imul(ne,Xe)|0,ce=ce+Math.imul(se,Ot)|0,re=re+Math.imul(se,Xe)|0;var _r=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(_r>>>26)|0,_r&=67108863,ve=Math.imul(fe,Lr),ce=Math.imul(fe,ci),ce=ce+Math.imul(Ce,Lr)|0,re=Math.imul(Ce,ci),ve=ve+Math.imul(oe,Ot)|0,ce=ce+Math.imul(oe,Xe)|0,ce=ce+Math.imul(J,Ot)|0,re=re+Math.imul(J,Xe)|0,ve=ve+Math.imul(ne,De)|0,ce=ce+Math.imul(ne,ye)|0,ce=ce+Math.imul(se,De)|0,re=re+Math.imul(se,ye)|0;var Er=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Er>>>26)|0,Er&=67108863,ve=Math.imul(Be,Lr),ce=Math.imul(Be,ci),ce=ce+Math.imul(Ze,Lr)|0,re=Math.imul(Ze,ci),ve=ve+Math.imul(fe,Ot)|0,ce=ce+Math.imul(fe,Xe)|0,ce=ce+Math.imul(Ce,Ot)|0,re=re+Math.imul(Ce,Xe)|0,ve=ve+Math.imul(oe,De)|0,ce=ce+Math.imul(oe,ye)|0,ce=ce+Math.imul(J,De)|0,re=re+Math.imul(J,ye)|0,ve=ve+Math.imul(ne,He)|0,ce=ce+Math.imul(ne,at)|0,ce=ce+Math.imul(se,He)|0,re=re+Math.imul(se,at)|0;var di=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(di>>>26)|0,di&=67108863,ve=Math.imul(tt,Lr),ce=Math.imul(tt,ci),ce=ce+Math.imul(_t,Lr)|0,re=Math.imul(_t,ci),ve=ve+Math.imul(Be,Ot)|0,ce=ce+Math.imul(Be,Xe)|0,ce=ce+Math.imul(Ze,Ot)|0,re=re+Math.imul(Ze,Xe)|0,ve=ve+Math.imul(fe,De)|0,ce=ce+Math.imul(fe,ye)|0,ce=ce+Math.imul(Ce,De)|0,re=re+Math.imul(Ce,ye)|0,ve=ve+Math.imul(oe,He)|0,ce=ce+Math.imul(oe,at)|0,ce=ce+Math.imul(J,He)|0,re=re+Math.imul(J,at)|0,ve=ve+Math.imul(ne,At)|0,ce=ce+Math.imul(ne,Wt)|0,ce=ce+Math.imul(se,At)|0,re=re+Math.imul(se,Wt)|0;var qi=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(qi>>>26)|0,qi&=67108863,ve=Math.imul(vt,Lr),ce=Math.imul(vt,ci),ce=ce+Math.imul(ct,Lr)|0,re=Math.imul(ct,ci),ve=ve+Math.imul(tt,Ot)|0,ce=ce+Math.imul(tt,Xe)|0,ce=ce+Math.imul(_t,Ot)|0,re=re+Math.imul(_t,Xe)|0,ve=ve+Math.imul(Be,De)|0,ce=ce+Math.imul(Be,ye)|0,ce=ce+Math.imul(Ze,De)|0,re=re+Math.imul(Ze,ye)|0,ve=ve+Math.imul(fe,He)|0,ce=ce+Math.imul(fe,at)|0,ce=ce+Math.imul(Ce,He)|0,re=re+Math.imul(Ce,at)|0,ve=ve+Math.imul(oe,At)|0,ce=ce+Math.imul(oe,Wt)|0,ce=ce+Math.imul(J,At)|0,re=re+Math.imul(J,Wt)|0,ve=ve+Math.imul(ne,hr)|0,ce=ce+Math.imul(ne,zr)|0,ce=ce+Math.imul(se,hr)|0,re=re+Math.imul(se,zr)|0;var Ui=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Ui>>>26)|0,Ui&=67108863,ve=Math.imul(Oe,Lr),ce=Math.imul(Oe,ci),ce=ce+Math.imul(Le,Lr)|0,re=Math.imul(Le,ci),ve=ve+Math.imul(vt,Ot)|0,ce=ce+Math.imul(vt,Xe)|0,ce=ce+Math.imul(ct,Ot)|0,re=re+Math.imul(ct,Xe)|0,ve=ve+Math.imul(tt,De)|0,ce=ce+Math.imul(tt,ye)|0,ce=ce+Math.imul(_t,De)|0,re=re+Math.imul(_t,ye)|0,ve=ve+Math.imul(Be,He)|0,ce=ce+Math.imul(Be,at)|0,ce=ce+Math.imul(Ze,He)|0,re=re+Math.imul(Ze,at)|0,ve=ve+Math.imul(fe,At)|0,ce=ce+Math.imul(fe,Wt)|0,ce=ce+Math.imul(Ce,At)|0,re=re+Math.imul(Ce,Wt)|0,ve=ve+Math.imul(oe,hr)|0,ce=ce+Math.imul(oe,zr)|0,ce=ce+Math.imul(J,hr)|0,re=re+Math.imul(J,zr)|0,ve=ve+Math.imul(ne,br)|0,ce=ce+Math.imul(ne,fi)|0,ce=ce+Math.imul(se,br)|0,re=re+Math.imul(se,fi)|0;var Hi=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,ve=Math.imul(xt,Lr),ce=Math.imul(xt,ci),ce=ce+Math.imul(ut,Lr)|0,re=Math.imul(ut,ci),ve=ve+Math.imul(Oe,Ot)|0,ce=ce+Math.imul(Oe,Xe)|0,ce=ce+Math.imul(Le,Ot)|0,re=re+Math.imul(Le,Xe)|0,ve=ve+Math.imul(vt,De)|0,ce=ce+Math.imul(vt,ye)|0,ce=ce+Math.imul(ct,De)|0,re=re+Math.imul(ct,ye)|0,ve=ve+Math.imul(tt,He)|0,ce=ce+Math.imul(tt,at)|0,ce=ce+Math.imul(_t,He)|0,re=re+Math.imul(_t,at)|0,ve=ve+Math.imul(Be,At)|0,ce=ce+Math.imul(Be,Wt)|0,ce=ce+Math.imul(Ze,At)|0,re=re+Math.imul(Ze,Wt)|0,ve=ve+Math.imul(fe,hr)|0,ce=ce+Math.imul(fe,zr)|0,ce=ce+Math.imul(Ce,hr)|0,re=re+Math.imul(Ce,zr)|0,ve=ve+Math.imul(oe,br)|0,ce=ce+Math.imul(oe,fi)|0,ce=ce+Math.imul(J,br)|0,re=re+Math.imul(J,fi)|0,ve=ve+Math.imul(ne,cn)|0,ce=ce+Math.imul(ne,yn)|0,ce=ce+Math.imul(se,cn)|0,re=re+Math.imul(se,yn)|0;var Ln=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,ve=Math.imul(Gt,Lr),ce=Math.imul(Gt,ci),ce=ce+Math.imul(Qt,Lr)|0,re=Math.imul(Qt,ci),ve=ve+Math.imul(xt,Ot)|0,ce=ce+Math.imul(xt,Xe)|0,ce=ce+Math.imul(ut,Ot)|0,re=re+Math.imul(ut,Xe)|0,ve=ve+Math.imul(Oe,De)|0,ce=ce+Math.imul(Oe,ye)|0,ce=ce+Math.imul(Le,De)|0,re=re+Math.imul(Le,ye)|0,ve=ve+Math.imul(vt,He)|0,ce=ce+Math.imul(vt,at)|0,ce=ce+Math.imul(ct,He)|0,re=re+Math.imul(ct,at)|0,ve=ve+Math.imul(tt,At)|0,ce=ce+Math.imul(tt,Wt)|0,ce=ce+Math.imul(_t,At)|0,re=re+Math.imul(_t,Wt)|0,ve=ve+Math.imul(Be,hr)|0,ce=ce+Math.imul(Be,zr)|0,ce=ce+Math.imul(Ze,hr)|0,re=re+Math.imul(Ze,zr)|0,ve=ve+Math.imul(fe,br)|0,ce=ce+Math.imul(fe,fi)|0,ce=ce+Math.imul(Ce,br)|0,re=re+Math.imul(Ce,fi)|0,ve=ve+Math.imul(oe,cn)|0,ce=ce+Math.imul(oe,yn)|0,ce=ce+Math.imul(J,cn)|0,re=re+Math.imul(J,yn)|0,ve=ve+Math.imul(ne,Sn)|0,ce=ce+Math.imul(ne,dn)|0,ce=ce+Math.imul(se,Sn)|0,re=re+Math.imul(se,dn)|0;var Fn=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,ve=Math.imul(mr,Lr),ce=Math.imul(mr,ci),ce=ce+Math.imul(Yr,Lr)|0,re=Math.imul(Yr,ci),ve=ve+Math.imul(Gt,Ot)|0,ce=ce+Math.imul(Gt,Xe)|0,ce=ce+Math.imul(Qt,Ot)|0,re=re+Math.imul(Qt,Xe)|0,ve=ve+Math.imul(xt,De)|0,ce=ce+Math.imul(xt,ye)|0,ce=ce+Math.imul(ut,De)|0,re=re+Math.imul(ut,ye)|0,ve=ve+Math.imul(Oe,He)|0,ce=ce+Math.imul(Oe,at)|0,ce=ce+Math.imul(Le,He)|0,re=re+Math.imul(Le,at)|0,ve=ve+Math.imul(vt,At)|0,ce=ce+Math.imul(vt,Wt)|0,ce=ce+Math.imul(ct,At)|0,re=re+Math.imul(ct,Wt)|0,ve=ve+Math.imul(tt,hr)|0,ce=ce+Math.imul(tt,zr)|0,ce=ce+Math.imul(_t,hr)|0,re=re+Math.imul(_t,zr)|0,ve=ve+Math.imul(Be,br)|0,ce=ce+Math.imul(Be,fi)|0,ce=ce+Math.imul(Ze,br)|0,re=re+Math.imul(Ze,fi)|0,ve=ve+Math.imul(fe,cn)|0,ce=ce+Math.imul(fe,yn)|0,ce=ce+Math.imul(Ce,cn)|0,re=re+Math.imul(Ce,yn)|0,ve=ve+Math.imul(oe,Sn)|0,ce=ce+Math.imul(oe,dn)|0,ce=ce+Math.imul(J,Sn)|0,re=re+Math.imul(J,dn)|0,ve=ve+Math.imul(ne,na)|0,ce=ce+Math.imul(ne,Kt)|0,ce=ce+Math.imul(se,na)|0,re=re+Math.imul(se,Kt)|0;var Kn=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,ve=Math.imul(mr,Ot),ce=Math.imul(mr,Xe),ce=ce+Math.imul(Yr,Ot)|0,re=Math.imul(Yr,Xe),ve=ve+Math.imul(Gt,De)|0,ce=ce+Math.imul(Gt,ye)|0,ce=ce+Math.imul(Qt,De)|0,re=re+Math.imul(Qt,ye)|0,ve=ve+Math.imul(xt,He)|0,ce=ce+Math.imul(xt,at)|0,ce=ce+Math.imul(ut,He)|0,re=re+Math.imul(ut,at)|0,ve=ve+Math.imul(Oe,At)|0,ce=ce+Math.imul(Oe,Wt)|0,ce=ce+Math.imul(Le,At)|0,re=re+Math.imul(Le,Wt)|0,ve=ve+Math.imul(vt,hr)|0,ce=ce+Math.imul(vt,zr)|0,ce=ce+Math.imul(ct,hr)|0,re=re+Math.imul(ct,zr)|0,ve=ve+Math.imul(tt,br)|0,ce=ce+Math.imul(tt,fi)|0,ce=ce+Math.imul(_t,br)|0,re=re+Math.imul(_t,fi)|0,ve=ve+Math.imul(Be,cn)|0,ce=ce+Math.imul(Be,yn)|0,ce=ce+Math.imul(Ze,cn)|0,re=re+Math.imul(Ze,yn)|0,ve=ve+Math.imul(fe,Sn)|0,ce=ce+Math.imul(fe,dn)|0,ce=ce+Math.imul(Ce,Sn)|0,re=re+Math.imul(Ce,dn)|0,ve=ve+Math.imul(oe,na)|0,ce=ce+Math.imul(oe,Kt)|0,ce=ce+Math.imul(J,na)|0,re=re+Math.imul(J,Kt)|0;var Jn=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,ve=Math.imul(mr,De),ce=Math.imul(mr,ye),ce=ce+Math.imul(Yr,De)|0,re=Math.imul(Yr,ye),ve=ve+Math.imul(Gt,He)|0,ce=ce+Math.imul(Gt,at)|0,ce=ce+Math.imul(Qt,He)|0,re=re+Math.imul(Qt,at)|0,ve=ve+Math.imul(xt,At)|0,ce=ce+Math.imul(xt,Wt)|0,ce=ce+Math.imul(ut,At)|0,re=re+Math.imul(ut,Wt)|0,ve=ve+Math.imul(Oe,hr)|0,ce=ce+Math.imul(Oe,zr)|0,ce=ce+Math.imul(Le,hr)|0,re=re+Math.imul(Le,zr)|0,ve=ve+Math.imul(vt,br)|0,ce=ce+Math.imul(vt,fi)|0,ce=ce+Math.imul(ct,br)|0,re=re+Math.imul(ct,fi)|0,ve=ve+Math.imul(tt,cn)|0,ce=ce+Math.imul(tt,yn)|0,ce=ce+Math.imul(_t,cn)|0,re=re+Math.imul(_t,yn)|0,ve=ve+Math.imul(Be,Sn)|0,ce=ce+Math.imul(Be,dn)|0,ce=ce+Math.imul(Ze,Sn)|0,re=re+Math.imul(Ze,dn)|0,ve=ve+Math.imul(fe,na)|0,ce=ce+Math.imul(fe,Kt)|0,ce=ce+Math.imul(Ce,na)|0,re=re+Math.imul(Ce,Kt)|0;var sa=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(sa>>>26)|0,sa&=67108863,ve=Math.imul(mr,He),ce=Math.imul(mr,at),ce=ce+Math.imul(Yr,He)|0,re=Math.imul(Yr,at),ve=ve+Math.imul(Gt,At)|0,ce=ce+Math.imul(Gt,Wt)|0,ce=ce+Math.imul(Qt,At)|0,re=re+Math.imul(Qt,Wt)|0,ve=ve+Math.imul(xt,hr)|0,ce=ce+Math.imul(xt,zr)|0,ce=ce+Math.imul(ut,hr)|0,re=re+Math.imul(ut,zr)|0,ve=ve+Math.imul(Oe,br)|0,ce=ce+Math.imul(Oe,fi)|0,ce=ce+Math.imul(Le,br)|0,re=re+Math.imul(Le,fi)|0,ve=ve+Math.imul(vt,cn)|0,ce=ce+Math.imul(vt,yn)|0,ce=ce+Math.imul(ct,cn)|0,re=re+Math.imul(ct,yn)|0,ve=ve+Math.imul(tt,Sn)|0,ce=ce+Math.imul(tt,dn)|0,ce=ce+Math.imul(_t,Sn)|0,re=re+Math.imul(_t,dn)|0,ve=ve+Math.imul(Be,na)|0,ce=ce+Math.imul(Be,Kt)|0,ce=ce+Math.imul(Ze,na)|0,re=re+Math.imul(Ze,Kt)|0;var Mn=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,ve=Math.imul(mr,At),ce=Math.imul(mr,Wt),ce=ce+Math.imul(Yr,At)|0,re=Math.imul(Yr,Wt),ve=ve+Math.imul(Gt,hr)|0,ce=ce+Math.imul(Gt,zr)|0,ce=ce+Math.imul(Qt,hr)|0,re=re+Math.imul(Qt,zr)|0,ve=ve+Math.imul(xt,br)|0,ce=ce+Math.imul(xt,fi)|0,ce=ce+Math.imul(ut,br)|0,re=re+Math.imul(ut,fi)|0,ve=ve+Math.imul(Oe,cn)|0,ce=ce+Math.imul(Oe,yn)|0,ce=ce+Math.imul(Le,cn)|0,re=re+Math.imul(Le,yn)|0,ve=ve+Math.imul(vt,Sn)|0,ce=ce+Math.imul(vt,dn)|0,ce=ce+Math.imul(ct,Sn)|0,re=re+Math.imul(ct,dn)|0,ve=ve+Math.imul(tt,na)|0,ce=ce+Math.imul(tt,Kt)|0,ce=ce+Math.imul(_t,na)|0,re=re+Math.imul(_t,Kt)|0;var Ha=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,ve=Math.imul(mr,hr),ce=Math.imul(mr,zr),ce=ce+Math.imul(Yr,hr)|0,re=Math.imul(Yr,zr),ve=ve+Math.imul(Gt,br)|0,ce=ce+Math.imul(Gt,fi)|0,ce=ce+Math.imul(Qt,br)|0,re=re+Math.imul(Qt,fi)|0,ve=ve+Math.imul(xt,cn)|0,ce=ce+Math.imul(xt,yn)|0,ce=ce+Math.imul(ut,cn)|0,re=re+Math.imul(ut,yn)|0,ve=ve+Math.imul(Oe,Sn)|0,ce=ce+Math.imul(Oe,dn)|0,ce=ce+Math.imul(Le,Sn)|0,re=re+Math.imul(Le,dn)|0,ve=ve+Math.imul(vt,na)|0,ce=ce+Math.imul(vt,Kt)|0,ce=ce+Math.imul(ct,na)|0,re=re+Math.imul(ct,Kt)|0;var io=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(io>>>26)|0,io&=67108863,ve=Math.imul(mr,br),ce=Math.imul(mr,fi),ce=ce+Math.imul(Yr,br)|0,re=Math.imul(Yr,fi),ve=ve+Math.imul(Gt,cn)|0,ce=ce+Math.imul(Gt,yn)|0,ce=ce+Math.imul(Qt,cn)|0,re=re+Math.imul(Qt,yn)|0,ve=ve+Math.imul(xt,Sn)|0,ce=ce+Math.imul(xt,dn)|0,ce=ce+Math.imul(ut,Sn)|0,re=re+Math.imul(ut,dn)|0,ve=ve+Math.imul(Oe,na)|0,ce=ce+Math.imul(Oe,Kt)|0,ce=ce+Math.imul(Le,na)|0,re=re+Math.imul(Le,Kt)|0;var Ft=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,ve=Math.imul(mr,cn),ce=Math.imul(mr,yn),ce=ce+Math.imul(Yr,cn)|0,re=Math.imul(Yr,yn),ve=ve+Math.imul(Gt,Sn)|0,ce=ce+Math.imul(Gt,dn)|0,ce=ce+Math.imul(Qt,Sn)|0,re=re+Math.imul(Qt,dn)|0,ve=ve+Math.imul(xt,na)|0,ce=ce+Math.imul(xt,Kt)|0,ce=ce+Math.imul(ut,na)|0,re=re+Math.imul(ut,Kt)|0;var Rt=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,ve=Math.imul(mr,Sn),ce=Math.imul(mr,dn),ce=ce+Math.imul(Yr,Sn)|0,re=Math.imul(Yr,dn),ve=ve+Math.imul(Gt,na)|0,ce=ce+Math.imul(Gt,Kt)|0,ce=ce+Math.imul(Qt,na)|0,re=re+Math.imul(Qt,Kt)|0;var qr=(be+ve|0)+((ce&8191)<<13)|0;be=(re+(ce>>>13)|0)+(qr>>>26)|0,qr&=67108863,ve=Math.imul(mr,na),ce=Math.imul(mr,Kt),ce=ce+Math.imul(Yr,na)|0,re=Math.imul(Yr,Kt);var ai=(be+ve|0)+((ce&8191)<<13)|0;return be=(re+(ce>>>13)|0)+(ai>>>26)|0,ai&=67108863,he[0]=lr,he[1]=_r,he[2]=Er,he[3]=di,he[4]=qi,he[5]=Ui,he[6]=Hi,he[7]=Ln,he[8]=Fn,he[9]=Kn,he[10]=Jn,he[11]=sa,he[12]=Mn,he[13]=Ha,he[14]=io,he[15]=Ft,he[16]=Rt,he[17]=qr,he[18]=ai,be!==0&&(he[19]=be,q.length++),q};Math.imul||(E=D);function I(F,H,q){q.negative=H.negative^F.negative,q.length=F.length+H.length;for(var G=0,ee=0,he=0;he>>26)|0,ee+=be>>>26,be&=67108863}q.words[he]=ve,G=be,be=ee}return G!==0?q.words[he]=G:q.length--,q.strip()}function M(F,H,q){var G=new p;return G.mulp(F,H,q)}h.prototype.mulTo=function(F,H){var q,G=this.length+F.length;return this.length===10&&F.length===10?q=E(this,F,H):G<63?q=D(this,F,H):G<1024?q=I(this,F,H):q=M(this,F,H),q};function p(F,H){this.x=F,this.y=H}p.prototype.makeRBT=function(F){for(var H=new Array(F),q=h.prototype._countBits(F)-1,G=0;G>=1;return G},p.prototype.permute=function(F,H,q,G,ee,he){for(var be=0;be>>1)ee++;return 1<>>13,q[2*he+1]=ee&8191,ee=ee>>>13;for(he=2*H;he>=26,H+=G/67108864|0,H+=ee>>>26,this.words[q]=ee&67108863}return H!==0&&(this.words[q]=H,this.length++),this},h.prototype.muln=function(F){return this.clone().imuln(F)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(F){var H=w(F);if(H.length===0)return new h(1);for(var q=this,G=0;G=0);var H=F%26,q=(F-H)/26,G=67108863>>>26-H<<26-H,ee;if(H!==0){var he=0;for(ee=0;ee>>26-H}he&&(this.words[ee]=he,this.length++)}if(q!==0){for(ee=this.length-1;ee>=0;ee--)this.words[ee+q]=this.words[ee];for(ee=0;ee=0);var G;H?G=(H-H%26)/26:G=0;var ee=F%26,he=Math.min((F-ee)/26,this.length),be=67108863^67108863>>>ee<he)for(this.length-=he,ce=0;ce=0&&(re!==0||ce>=G);ce--){var ge=this.words[ce]|0;this.words[ce]=re<<26-ee|ge>>>ee,re=ge&be}return ve&&re!==0&&(ve.words[ve.length++]=re),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},h.prototype.ishrn=function(F,H,q){return u(this.negative===0),this.iushrn(F,H,q)},h.prototype.shln=function(F){return this.clone().ishln(F)},h.prototype.ushln=function(F){return this.clone().iushln(F)},h.prototype.shrn=function(F){return this.clone().ishrn(F)},h.prototype.ushrn=function(F){return this.clone().iushrn(F)},h.prototype.testn=function(F){u(typeof F=="number"&&F>=0);var H=F%26,q=(F-H)/26,G=1<=0);var H=F%26,q=(F-H)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=q)return this;if(H!==0&&q++,this.length=Math.min(q,this.length),H!==0){var G=67108863^67108863>>>H<=67108864;H++)this.words[H]-=67108864,H===this.length-1?this.words[H+1]=1:this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},h.prototype.isubn=function(F){if(u(typeof F=="number"),u(F<67108864),F<0)return this.iaddn(-F);if(this.negative!==0)return this.negative=0,this.iaddn(F),this.negative=1,this;if(this.words[0]-=F,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H>26)-(ve/67108864|0),this.words[ee+q]=he&67108863}for(;ee>26,this.words[ee+q]=he&67108863;if(be===0)return this.strip();for(u(be===-1),be=0,ee=0;ee>26,this.words[ee]=he&67108863;return this.negative=1,this.strip()},h.prototype._wordDiv=function(F,H){var q=this.length-F.length,G=this.clone(),ee=F,he=ee.words[ee.length-1]|0,be=this._countBits(he);q=26-be,q!==0&&(ee=ee.ushln(q),G.iushln(q),he=ee.words[ee.length-1]|0);var ve=G.length-ee.length,ce;if(H!=="mod"){ce=new h(null),ce.length=ve+1,ce.words=new Array(ce.length);for(var re=0;re=0;ne--){var se=(G.words[ee.length+ne]|0)*67108864+(G.words[ee.length+ne-1]|0);for(se=Math.min(se/he|0,67108863),G._ishlnsubmul(ee,se,ne);G.negative!==0;)se--,G.negative=0,G._ishlnsubmul(ee,1,ne),G.isZero()||(G.negative^=1);ce&&(ce.words[ne]=se)}return ce&&ce.strip(),G.strip(),H!=="div"&&q!==0&&G.iushrn(q),{div:ce||null,mod:G}},h.prototype.divmod=function(F,H,q){if(u(!F.isZero()),this.isZero())return{div:new h(0),mod:new h(0)};var G,ee,he;return this.negative!==0&&F.negative===0?(he=this.neg().divmod(F,H),H!=="mod"&&(G=he.div.neg()),H!=="div"&&(ee=he.mod.neg(),q&&ee.negative!==0&&ee.iadd(F)),{div:G,mod:ee}):this.negative===0&&F.negative!==0?(he=this.divmod(F.neg(),H),H!=="mod"&&(G=he.div.neg()),{div:G,mod:he.mod}):(this.negative&F.negative)!==0?(he=this.neg().divmod(F.neg(),H),H!=="div"&&(ee=he.mod.neg(),q&&ee.negative!==0&&ee.isub(F)),{div:he.div,mod:ee}):F.length>this.length||this.cmp(F)<0?{div:new h(0),mod:this}:F.length===1?H==="div"?{div:this.divn(F.words[0]),mod:null}:H==="mod"?{div:null,mod:new h(this.modn(F.words[0]))}:{div:this.divn(F.words[0]),mod:new h(this.modn(F.words[0]))}:this._wordDiv(F,H)},h.prototype.div=function(F){return this.divmod(F,"div",!1).div},h.prototype.mod=function(F){return this.divmod(F,"mod",!1).mod},h.prototype.umod=function(F){return this.divmod(F,"mod",!0).mod},h.prototype.divRound=function(F){var H=this.divmod(F);if(H.mod.isZero())return H.div;var q=H.div.negative!==0?H.mod.isub(F):H.mod,G=F.ushrn(1),ee=F.andln(1),he=q.cmp(G);return he<0||ee===1&&he===0?H.div:H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},h.prototype.modn=function(F){u(F<=67108863);for(var H=67108864%F,q=0,G=this.length-1;G>=0;G--)q=(H*q+(this.words[G]|0))%F;return q},h.prototype.idivn=function(F){u(F<=67108863);for(var H=0,q=this.length-1;q>=0;q--){var G=(this.words[q]|0)+H*67108864;this.words[q]=G/F|0,H=G%F}return this.strip()},h.prototype.divn=function(F){return this.clone().idivn(F)},h.prototype.egcd=function(F){u(F.negative===0),u(!F.isZero());var H=this,q=F.clone();H.negative!==0?H=H.umod(F):H=H.clone();for(var G=new h(1),ee=new h(0),he=new h(0),be=new h(1),ve=0;H.isEven()&&q.isEven();)H.iushrn(1),q.iushrn(1),++ve;for(var ce=q.clone(),re=H.clone();!H.isZero();){for(var ge=0,ne=1;(H.words[0]&ne)===0&&ge<26;++ge,ne<<=1);if(ge>0)for(H.iushrn(ge);ge-- >0;)(G.isOdd()||ee.isOdd())&&(G.iadd(ce),ee.isub(re)),G.iushrn(1),ee.iushrn(1);for(var se=0,_e=1;(q.words[0]&_e)===0&&se<26;++se,_e<<=1);if(se>0)for(q.iushrn(se);se-- >0;)(he.isOdd()||be.isOdd())&&(he.iadd(ce),be.isub(re)),he.iushrn(1),be.iushrn(1);H.cmp(q)>=0?(H.isub(q),G.isub(he),ee.isub(be)):(q.isub(H),he.isub(G),be.isub(ee))}return{a:he,b:be,gcd:q.iushln(ve)}},h.prototype._invmp=function(F){u(F.negative===0),u(!F.isZero());var H=this,q=F.clone();H.negative!==0?H=H.umod(F):H=H.clone();for(var G=new h(1),ee=new h(0),he=q.clone();H.cmpn(1)>0&&q.cmpn(1)>0;){for(var be=0,ve=1;(H.words[0]&ve)===0&&be<26;++be,ve<<=1);if(be>0)for(H.iushrn(be);be-- >0;)G.isOdd()&&G.iadd(he),G.iushrn(1);for(var ce=0,re=1;(q.words[0]&re)===0&&ce<26;++ce,re<<=1);if(ce>0)for(q.iushrn(ce);ce-- >0;)ee.isOdd()&&ee.iadd(he),ee.iushrn(1);H.cmp(q)>=0?(H.isub(q),G.isub(ee)):(q.isub(H),ee.isub(G))}var ge;return H.cmpn(1)===0?ge=G:ge=ee,ge.cmpn(0)<0&&ge.iadd(F),ge},h.prototype.gcd=function(F){if(this.isZero())return F.abs();if(F.isZero())return this.abs();var H=this.clone(),q=F.clone();H.negative=0,q.negative=0;for(var G=0;H.isEven()&&q.isEven();G++)H.iushrn(1),q.iushrn(1);do{for(;H.isEven();)H.iushrn(1);for(;q.isEven();)q.iushrn(1);var ee=H.cmp(q);if(ee<0){var he=H;H=q,q=he}else if(ee===0||q.cmpn(1)===0)break;H.isub(q)}while(!0);return q.iushln(G)},h.prototype.invm=function(F){return this.egcd(F).a.umod(F)},h.prototype.isEven=function(){return(this.words[0]&1)===0},h.prototype.isOdd=function(){return(this.words[0]&1)===1},h.prototype.andln=function(F){return this.words[0]&F},h.prototype.bincn=function(F){u(typeof F=="number");var H=F%26,q=(F-H)/26,G=1<>>26,be&=67108863,this.words[he]=be}return ee!==0&&(this.words[he]=ee,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(F){var H=F<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var q;if(this.length>1)q=1;else{H&&(F=-F),u(F<=67108863,"Number is too big");var G=this.words[0]|0;q=G===F?0:GF.length)return 1;if(this.length=0;q--){var G=this.words[q]|0,ee=F.words[q]|0;if(G!==ee){Gee&&(H=1);break}}return H},h.prototype.gtn=function(F){return this.cmpn(F)===1},h.prototype.gt=function(F){return this.cmp(F)===1},h.prototype.gten=function(F){return this.cmpn(F)>=0},h.prototype.gte=function(F){return this.cmp(F)>=0},h.prototype.ltn=function(F){return this.cmpn(F)===-1},h.prototype.lt=function(F){return this.cmp(F)===-1},h.prototype.lten=function(F){return this.cmpn(F)<=0},h.prototype.lte=function(F){return this.cmp(F)<=0},h.prototype.eqn=function(F){return this.cmpn(F)===0},h.prototype.eq=function(F){return this.cmp(F)===0},h.red=function(F){return new V(F)},h.prototype.toRed=function(F){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),F.convertTo(this)._forceRed(F)},h.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(F){return this.red=F,this},h.prototype.forceRed=function(F){return u(!this.red,"Already a number in reduction context"),this._forceRed(F)},h.prototype.redAdd=function(F){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,F)},h.prototype.redIAdd=function(F){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,F)},h.prototype.redSub=function(F){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,F)},h.prototype.redISub=function(F){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,F)},h.prototype.redShl=function(F){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,F)},h.prototype.redMul=function(F){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.mul(this,F)},h.prototype.redIMul=function(F){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,F),this.red.imul(this,F)},h.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(F){return u(this.red&&!F.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,F)};var g={k256:null,p224:null,p192:null,p25519:null};function C(F,H){this.name=F,this.p=new h(H,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var F=new h(null);return F.words=new Array(Math.ceil(this.n/13)),F},C.prototype.ireduce=function(F){var H=F,q;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),q=H.bitLength();while(q>this.n);var G=q0?H.isub(this.p):H.strip!==void 0?H.strip():H._strip(),H},C.prototype.split=function(F,H){F.iushrn(this.n,0,H)},C.prototype.imulK=function(F){return F.imul(this.k)};function T(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(T,C),T.prototype.split=function(F,H){for(var q=4194303,G=Math.min(F.length,9),ee=0;ee>>22,he=be}he>>>=22,F.words[ee-10]=he,he===0&&F.length>10?F.length-=10:F.length-=9},T.prototype.imulK=function(F){F.words[F.length]=0,F.words[F.length+1]=0,F.length+=2;for(var H=0,q=0;q>>=26,F.words[q]=ee,H=G}return H!==0&&(F.words[F.length++]=H),F},h._prime=function(F){if(g[F])return g[F];var H;if(F==="k256")H=new T;else if(F==="p224")H=new N;else if(F==="p192")H=new B;else if(F==="p25519")H=new U;else throw new Error("Unknown prime "+F);return g[F]=H,H};function V(F){if(typeof F=="string"){var H=h._prime(F);this.m=H.p,this.prime=H}else u(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}V.prototype._verify1=function(F){u(F.negative===0,"red works only with positives"),u(F.red,"red works only with red numbers")},V.prototype._verify2=function(F,H){u((F.negative|H.negative)===0,"red works only with positives"),u(F.red&&F.red===H.red,"red works only with red numbers")},V.prototype.imod=function(F){return this.prime?this.prime.ireduce(F)._forceRed(this):F.umod(this.m)._forceRed(this)},V.prototype.neg=function(F){return F.isZero()?F.clone():this.m.sub(F)._forceRed(this)},V.prototype.add=function(F,H){this._verify2(F,H);var q=F.add(H);return q.cmp(this.m)>=0&&q.isub(this.m),q._forceRed(this)},V.prototype.iadd=function(F,H){this._verify2(F,H);var q=F.iadd(H);return q.cmp(this.m)>=0&&q.isub(this.m),q},V.prototype.sub=function(F,H){this._verify2(F,H);var q=F.sub(H);return q.cmpn(0)<0&&q.iadd(this.m),q._forceRed(this)},V.prototype.isub=function(F,H){this._verify2(F,H);var q=F.isub(H);return q.cmpn(0)<0&&q.iadd(this.m),q},V.prototype.shl=function(F,H){return this._verify1(F),this.imod(F.ushln(H))},V.prototype.imul=function(F,H){return this._verify2(F,H),this.imod(F.imul(H))},V.prototype.mul=function(F,H){return this._verify2(F,H),this.imod(F.mul(H))},V.prototype.isqr=function(F){return this.imul(F,F.clone())},V.prototype.sqr=function(F){return this.mul(F,F)},V.prototype.sqrt=function(F){if(F.isZero())return F.clone();var H=this.m.andln(3);if(u(H%2===1),H===3){var q=this.m.add(new h(1)).iushrn(2);return this.pow(F,q)}for(var G=this.m.subn(1),ee=0;!G.isZero()&&G.andln(1)===0;)ee++,G.iushrn(1);u(!G.isZero());var he=new h(1).toRed(this),be=he.redNeg(),ve=this.m.subn(1).iushrn(1),ce=this.m.bitLength();for(ce=new h(2*ce*ce).toRed(this);this.pow(ce,ve).cmp(be)!==0;)ce.redIAdd(be);for(var re=this.pow(ce,G),ge=this.pow(F,G.addn(1).iushrn(1)),ne=this.pow(F,G),se=ee;ne.cmp(he)!==0;){for(var _e=ne,oe=0;_e.cmp(he)!==0;oe++)_e=_e.redSqr();u(oe=0;ee--){for(var re=H.words[ee],ge=ce-1;ge>=0;ge--){var ne=re>>ge&1;if(he!==G[0]&&(he=this.sqr(he)),ne===0&&be===0){ve=0;continue}be<<=1,be|=ne,ve++,!(ve!==q&&(ee!==0||ge!==0))&&(he=this.mul(he,G[be]),ve=0,be=0)}ce=26}return he},V.prototype.convertTo=function(F){var H=F.umod(this.m);return H===F?H.clone():H},V.prototype.convertFrom=function(F){var H=F.clone();return H.red=null,H},h.mont=function(F){return new W(F)};function W(F){V.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(W,V),W.prototype.convertTo=function(F){return this.imod(F.ushln(this.shift))},W.prototype.convertFrom=function(F){var H=this.imod(F.mul(this.rinv));return H.red=null,H},W.prototype.imul=function(F,H){if(F.isZero()||H.isZero())return F.words[0]=0,F.length=1,F;var q=F.imul(H),G=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ee=q.isub(G).iushrn(this.shift),he=ee;return ee.cmp(this.m)>=0?he=ee.isub(this.m):ee.cmpn(0)<0&&(he=ee.iadd(this.m)),he._forceRed(this)},W.prototype.mul=function(F,H){if(F.isZero()||H.isZero())return new h(0)._forceRed(this);var q=F.mul(H),G=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),ee=q.isub(G).iushrn(this.shift),he=ee;return ee.cmp(this.m)>=0?he=ee.isub(this.m):ee.cmpn(0)<0&&(he=ee.iadd(this.m)),he._forceRed(this)},W.prototype.invm=function(F){var H=this.imod(F._invmp(this.m).mul(this.r2));return H._forceRed(this)}}(i,this)},6860:function(i){i.exports=n;function n(a,l,o){return a[0]=l[0]-o[0],a[1]=l[1]-o[1],a[2]=l[2]-o[2],a[3]=l[3]-o[3],a}},6864:function(i){i.exports=n;function n(){var a=new Float32Array(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},6867:function(i,n,a){i.exports=f;var l=a(1888),o=a(855),u=a(7150);function s(k,w){for(var D=0;D>>1;if(!(p<=0)){var g,C=l.mallocDouble(2*p*I),T=l.mallocInt32(I);if(I=h(k,p,C,T),I>0){if(p===1&&E)o.init(I),g=o.sweepComplete(p,D,0,I,C,T,0,I,C,T);else{var N=l.mallocDouble(2*p*M),B=l.mallocInt32(M);M=h(w,p,N,B),M>0&&(o.init(I+M),p===1?g=o.sweepBipartite(p,D,0,I,C,T,0,M,N,B):g=u(p,D,E,I,C,T,M,N,B),l.free(N),l.free(B))}l.free(C),l.free(T)}return g}}}var b;function x(k,w){b.push([k,w])}function _(k){return b=[],m(k,k,x,!0),b}function A(k,w){return b=[],m(k,w,x,!1),b}function f(k,w,D){switch(arguments.length){case 1:return _(k);case 2:return typeof w=="function"?m(k,k,w,!0):A(k,w);case 3:return m(k,w,D,!1);default:throw new Error("box-intersect: Invalid arguments")}}},6894:function(i){i.exports=n;function n(a,l,o,u){var s=o[1],h=o[2],m=l[1]-s,b=l[2]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=l[0],a[1]=s+m*_-b*x,a[2]=h+m*x+b*_,a}},7004:function(i){i.exports=n;function n(a){for(var l=a.length,o=a[a.length-1],u=l,s=l-2;s>=0;--s){var h=o,m=a[s];o=h+m;var b=o-h,x=m-b;x&&(a[--u]=o,o=x)}for(var _=0,s=u;s=p0)&&!(p1>=hi)"),w=x("lo===p0"),D=x("lo0;){ge-=1;var _e=ge*p,oe=T[_e],J=T[_e+1],me=T[_e+2],fe=T[_e+3],Ce=T[_e+4],Re=T[_e+5],Be=ge*g,Ze=N[Be],Ge=N[Be+1],tt=Re&1,_t=!!(Re&16),mt=he,vt=be,ct=ce,Ae=re;if(tt&&(mt=ce,vt=re,ct=he,Ae=be),!(Re&2&&(me=D(H,oe,J,me,mt,vt,Ge),J>=me))&&!(Re&4&&(J=E(H,oe,J,me,mt,vt,Ze),J>=me))){var Oe=me-J,Le=Ce-fe;if(_t){if(H*Oe*(Oe+Le)"u"?a(1538):WeakMap,o=a(2762),u=a(8116),s=new l;function h(m){var b=s.get(m),x=b&&(b._triangleBuffer.handle||b._triangleBuffer.buffer);if(!x||!m.isBuffer(x)){var _=o(m,new Float32Array([-1,-1,-1,4,4,-1]));b=u(m,[{buffer:_,type:m.FLOAT,size:2}]),b._triangleBuffer=_,s.set(m,b)}b.bind(),m.drawArrays(m.TRIANGLES,0,3),b.unbind()}i.exports=h},7182:function(i,n,a){var l={identity:a(7894),translate:a(7656),multiply:a(6760),create:a(6864),scale:a(2504),fromRotationTranslation:a(6743)};l.create();var o=l.create();i.exports=function(u,s,h,m,b,x){return l.identity(u),l.fromRotationTranslation(u,x,s),u[3]=b[0],u[7]=b[1],u[11]=b[2],u[15]=b[3],l.identity(o),m[2]!==0&&(o[9]=m[2],l.multiply(u,u,o)),m[1]!==0&&(o[9]=0,o[8]=m[1],l.multiply(u,u,o)),m[0]!==0&&(o[8]=0,o[4]=m[0],l.multiply(u,u,o)),l.scale(u,u,h),u}},7201:function(i,n,a){var l=1e-6,o=1e-6,u=a(9405),s=a(2762),h=a(8116),m=a(7766),b=a(8406),x=a(6760),_=a(7608),A=a(9618),f=a(6729),k=a(7765),w=a(1888),D=a(840),E=a(7626),I=D.meshShader,M=D.wireShader,p=D.pointShader,g=D.pickShader,C=D.pointPickShader,T=D.contourShader,N=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function B(ce,re,ge,ne,se,_e,oe,J,me,fe,Ce,Re,Be,Ze,Ge,tt,_t,mt,vt,ct,Ae,Oe,Le,nt,xt,ut,Et){this.gl=ce,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=re,this.dirty=!0,this.triShader=ge,this.lineShader=ne,this.pointShader=se,this.pickShader=_e,this.pointPickShader=oe,this.contourShader=J,this.trianglePositions=me,this.triangleColors=Ce,this.triangleNormals=Be,this.triangleUVs=Re,this.triangleIds=fe,this.triangleVAO=Ze,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ge,this.edgeColors=_t,this.edgeUVs=mt,this.edgeIds=tt,this.edgeVAO=vt,this.edgeCount=0,this.pointPositions=ct,this.pointColors=Oe,this.pointUVs=Le,this.pointSizes=nt,this.pointIds=Ae,this.pointVAO=xt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=ut,this.contourVAO=Et,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=N,this._view=N,this._projection=N,this._resolution=[1,1]}var U=B.prototype;U.isOpaque=function(){return!this.hasAlpha},U.isTransparent=function(){return this.hasAlpha},U.pickSlots=1,U.setPickBase=function(ce){this.pickId=ce};function V(ce,re){if(!re||!re.length)return 1;for(var ge=0;gece&&ge>0){var ne=(re[ge][0]-ce)/(re[ge][0]-re[ge-1][0]);return re[ge][1]*(1-ne)+ne*re[ge-1][1]}}return 1}function W(ce,re){for(var ge=f({colormap:ce,nshades:256,format:"rgba"}),ne=new Uint8Array(1024),se=0;se<256;++se){for(var _e=ge[se],oe=0;oe<3;++oe)ne[4*se+oe]=_e[oe];re?ne[4*se+3]=255*V(se/255,re):ne[4*se+3]=255*_e[3]}return A(ne,[256,256,4],[4,0,1])}function F(ce){for(var re=ce.length,ge=new Array(re),ne=0;ne0){var Be=this.triShader;Be.bind(),Be.uniforms=J,this.triangleVAO.bind(),re.drawArrays(re.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Be=this.lineShader;Be.bind(),Be.uniforms=J,this.edgeVAO.bind(),re.lineWidth(this.lineWidth*this.pixelRatio),re.drawArrays(re.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Be=this.pointShader;Be.bind(),Be.uniforms=J,this.pointVAO.bind(),re.drawArrays(re.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Be=this.contourShader;Be.bind(),Be.uniforms=J,this.contourVAO.bind(),re.drawArrays(re.LINES,0,this.contourCount),this.contourVAO.unbind()}},U.drawPick=function(ce){ce=ce||{};for(var re=this.gl,ge=ce.model||N,ne=ce.view||N,se=ce.projection||N,_e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],oe=0;oe<3;++oe)_e[0][oe]=Math.max(_e[0][oe],this.clipBounds[0][oe]),_e[1][oe]=Math.min(_e[1][oe],this.clipBounds[1][oe]);this._model=[].slice.call(ge),this._view=[].slice.call(ne),this._projection=[].slice.call(se),this._resolution=[re.drawingBufferWidth,re.drawingBufferHeight];var J={model:ge,view:ne,projection:se,clipBounds:_e,pickId:this.pickId/255},me=this.pickShader;if(me.bind(),me.uniforms=J,this.triangleCount>0&&(this.triangleVAO.bind(),re.drawArrays(re.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),re.lineWidth(this.lineWidth*this.pixelRatio),re.drawArrays(re.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var me=this.pointPickShader;me.bind(),me.uniforms=J,this.pointVAO.bind(),re.drawArrays(re.POINTS,0,this.pointCount),this.pointVAO.unbind()}},U.pick=function(ce){if(!ce||ce.id!==this.pickId)return null;for(var re=ce.value[0]+256*ce.value[1]+65536*ce.value[2],ge=this.cells[re],ne=this.positions,se=new Array(ge.length),_e=0;_eMath.max(I,M)?p[2]=1:I>Math.max(E,M)?p[0]=1:p[1]=1;for(var g=0,C=0,T=0;T<3;++T)g+=D[T]*D[T],C+=p[T]*D[T];for(var T=0;T<3;++T)p[T]-=C/g*D[T];return h(p,p),p}function A(D,E,I,M,p,g,C,T){this.center=l(I),this.up=l(M),this.right=l(p),this.radius=l([g]),this.angle=l([C,T]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(D,E),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var N=0;N<16;++N)this.computedMatrix[N]=.5;this.recalcMatrix(0)}var f=A.prototype;f.setDistanceLimits=function(D,E){D>0?D=Math.log(D):D=-1/0,E>0?E=Math.log(E):E=1/0,E=Math.max(E,D),this.radius.bounds[0][0]=D,this.radius.bounds[1][0]=E},f.getDistanceLimits=function(D){var E=this.radius.bounds[0];return D?(D[0]=Math.exp(E[0][0]),D[1]=Math.exp(E[1][0]),D):[Math.exp(E[0][0]),Math.exp(E[1][0])]},f.recalcMatrix=function(D){this.center.curve(D),this.up.curve(D),this.right.curve(D),this.radius.curve(D),this.angle.curve(D);for(var E=this.computedUp,I=this.computedRight,M=0,p=0,g=0;g<3;++g)p+=E[g]*I[g],M+=E[g]*E[g];for(var C=Math.sqrt(M),T=0,g=0;g<3;++g)I[g]-=E[g]*p/M,T+=I[g]*I[g],E[g]/=C;for(var N=Math.sqrt(T),g=0;g<3;++g)I[g]/=N;var B=this.computedToward;s(B,E,I),h(B,B);for(var U=Math.exp(this.computedRadius[0]),V=this.computedAngle[0],W=this.computedAngle[1],F=Math.cos(V),H=Math.sin(V),q=Math.cos(W),G=Math.sin(W),ee=this.computedCenter,he=F*q,be=H*q,ve=G,ce=-F*G,re=-H*G,ge=q,ne=this.computedEye,se=this.computedMatrix,g=0;g<3;++g){var _e=he*I[g]+be*B[g]+ve*E[g];se[4*g+1]=ce*I[g]+re*B[g]+ge*E[g],se[4*g+2]=_e,se[4*g+3]=0}var oe=se[1],J=se[5],me=se[9],fe=se[2],Ce=se[6],Re=se[10],Be=J*Re-me*Ce,Ze=me*fe-oe*Re,Ge=oe*Ce-J*fe,tt=b(Be,Ze,Ge);Be/=tt,Ze/=tt,Ge/=tt,se[0]=Be,se[4]=Ze,se[8]=Ge;for(var g=0;g<3;++g)ne[g]=ee[g]+se[2+4*g]*U;for(var g=0;g<3;++g){for(var T=0,_t=0;_t<3;++_t)T+=se[g+4*_t]*ne[_t];se[12+g]=-T}se[15]=1},f.getMatrix=function(D,E){this.recalcMatrix(D);var I=this.computedMatrix;if(E){for(var M=0;M<16;++M)E[M]=I[M];return E}return I};var k=[0,0,0];f.rotate=function(D,E,I,M){if(this.angle.move(D,E,I),M){this.recalcMatrix(D);var p=this.computedMatrix;k[0]=p[2],k[1]=p[6],k[2]=p[10];for(var g=this.computedUp,C=this.computedRight,T=this.computedToward,N=0;N<3;++N)p[4*N]=g[N],p[4*N+1]=C[N],p[4*N+2]=T[N];u(p,p,M,k);for(var N=0;N<3;++N)g[N]=p[4*N],C[N]=p[4*N+1];this.up.set(D,g[0],g[1],g[2]),this.right.set(D,C[0],C[1],C[2])}},f.pan=function(D,E,I,M){E=E||0,I=I||0,M=M||0,this.recalcMatrix(D);var p=this.computedMatrix;Math.exp(this.computedRadius[0]);var g=p[1],C=p[5],T=p[9],N=b(g,C,T);g/=N,C/=N,T/=N;var B=p[0],U=p[4],V=p[8],W=B*g+U*C+V*T;B-=g*W,U-=C*W,V-=T*W;var F=b(B,U,V);B/=F,U/=F,V/=F;var H=B*E+g*I,q=U*E+C*I,G=V*E+T*I;this.center.move(D,H,q,G);var ee=Math.exp(this.computedRadius[0]);ee=Math.max(1e-4,ee+M),this.radius.set(D,Math.log(ee))},f.translate=function(D,E,I,M){this.center.move(D,E||0,I||0,M||0)},f.setMatrix=function(D,E,I,M){var p=1;typeof I=="number"&&(p=I|0),(p<0||p>3)&&(p=1);var g=(p+2)%3;E||(this.recalcMatrix(D),E=this.computedMatrix);var C=E[p],T=E[p+4],N=E[p+8];if(M){var B=Math.abs(C),U=Math.abs(T),V=Math.abs(N),W=Math.max(B,U,V);B===W?(C=C<0?-1:1,T=N=0):V===W?(N=N<0?-1:1,C=T=0):(T=T<0?-1:1,C=N=0)}else{var F=b(C,T,N);C/=F,T/=F,N/=F}var H=E[g],q=E[g+4],G=E[g+8],ee=H*C+q*T+G*N;H-=C*ee,q-=T*ee,G-=N*ee;var he=b(H,q,G);H/=he,q/=he,G/=he;var be=T*G-N*q,ve=N*H-C*G,ce=C*q-T*H,re=b(be,ve,ce);be/=re,ve/=re,ce/=re,this.center.jump(D,Ae,Oe,Le),this.radius.idle(D),this.up.jump(D,C,T,N),this.right.jump(D,H,q,G);var ge,ne;if(p===2){var se=E[1],_e=E[5],oe=E[9],J=se*H+_e*q+oe*G,me=se*be+_e*ve+oe*ce;Be<0?ge=-Math.PI/2:ge=Math.PI/2,ne=Math.atan2(me,J)}else{var fe=E[2],Ce=E[6],Re=E[10],Be=fe*C+Ce*T+Re*N,Ze=fe*H+Ce*q+Re*G,Ge=fe*be+Ce*ve+Re*ce;ge=Math.asin(x(Be)),ne=Math.atan2(Ge,Ze)}this.angle.jump(D,ne,ge),this.recalcMatrix(D);var tt=E[2],_t=E[6],mt=E[10],vt=this.computedMatrix;o(vt,E);var ct=vt[15],Ae=vt[12]/ct,Oe=vt[13]/ct,Le=vt[14]/ct,nt=Math.exp(this.computedRadius[0]);this.center.jump(D,Ae-tt*nt,Oe-_t*nt,Le-mt*nt)},f.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},f.idle=function(D){this.center.idle(D),this.up.idle(D),this.right.idle(D),this.radius.idle(D),this.angle.idle(D)},f.flush=function(D){this.center.flush(D),this.up.flush(D),this.right.flush(D),this.radius.flush(D),this.angle.flush(D)},f.setDistance=function(D,E){E>0&&this.radius.set(D,Math.log(E))},f.lookAt=function(D,E,I,M){this.recalcMatrix(D),E=E||this.computedEye,I=I||this.computedCenter,M=M||this.computedUp;var p=M[0],g=M[1],C=M[2],T=b(p,g,C);if(!(T<1e-6)){p/=T,g/=T,C/=T;var N=E[0]-I[0],B=E[1]-I[1],U=E[2]-I[2],V=b(N,B,U);if(!(V<1e-6)){N/=V,B/=V,U/=V;var W=this.computedRight,F=W[0],H=W[1],q=W[2],G=p*F+g*H+C*q;F-=G*p,H-=G*g,q-=G*C;var ee=b(F,H,q);if(!(ee<.01&&(F=g*U-C*B,H=C*N-p*U,q=p*B-g*N,ee=b(F,H,q),ee<1e-6))){F/=ee,H/=ee,q/=ee,this.up.set(D,p,g,C),this.right.set(D,F,H,q),this.center.set(D,I[0],I[1],I[2]),this.radius.set(D,Math.log(V));var he=g*q-C*H,be=C*F-p*q,ve=p*H-g*F,ce=b(he,be,ve);he/=ce,be/=ce,ve/=ce;var re=p*N+g*B+C*U,ge=F*N+H*B+q*U,ne=he*N+be*B+ve*U,se=Math.asin(x(re)),_e=Math.atan2(ne,ge),oe=this.angle._state,J=oe[oe.length-1],me=oe[oe.length-2];J=J%(2*Math.PI);var fe=Math.abs(J+2*Math.PI-_e),Ce=Math.abs(J-_e),Re=Math.abs(J-2*Math.PI-_e);fe0)throw new Error("Invalid string. Length must be a multiple of 4");var E=w.indexOf("=");E===-1&&(E=D);var I=E===D?0:4-E%4;return[E,I]}function b(w){var D=m(w),E=D[0],I=D[1];return(E+I)*3/4-I}function x(w,D,E){return(D+E)*3/4-E}function _(w){var D,E=m(w),I=E[0],M=E[1],p=new o(x(w,I,M)),g=0,C=M>0?I-4:I,T;for(T=0;T>16&255,p[g++]=D>>8&255,p[g++]=D&255;return M===2&&(D=l[w.charCodeAt(T)]<<2|l[w.charCodeAt(T+1)]>>4,p[g++]=D&255),M===1&&(D=l[w.charCodeAt(T)]<<10|l[w.charCodeAt(T+1)]<<4|l[w.charCodeAt(T+2)]>>2,p[g++]=D>>8&255,p[g++]=D&255),p}function A(w){return a[w>>18&63]+a[w>>12&63]+a[w>>6&63]+a[w&63]}function f(w,D,E){for(var I,M=[],p=D;pC?C:g+p));return I===1?(D=w[E-1],M.push(a[D>>2]+a[D<<4&63]+"==")):I===2&&(D=(w[E-2]<<8)+w[E-1],M.push(a[D>>10]+a[D>>4&63]+a[D<<2&63]+"=")),M.join("")}},7518:function(i,n,a){var l=a(1433);function o(h,m,b,x,_,A){this.location=h,this.dimension=m,this.a=b,this.b=x,this.c=_,this.d=A}o.prototype.bind=function(h){switch(this.dimension){case 1:h.vertexAttrib1f(this.location,this.a);break;case 2:h.vertexAttrib2f(this.location,this.a,this.b);break;case 3:h.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:h.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function u(h,m,b){this.gl=h,this._ext=m,this.handle=b,this._attribs=[],this._useElements=!1,this._elementsType=h.UNSIGNED_SHORT}u.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var h=0;h1.0001)return null;T+=C[E]}return Math.abs(T-1)>.001?null:[I,m(x,C),C]}},7636:function(i){i.exports=n;function n(a,l){l=l||1;var o=Math.random()*2*Math.PI,u=Math.random()*2-1,s=Math.sqrt(1-u*u)*l;return a[0]=Math.cos(o)*s,a[1]=Math.sin(o)*s,a[2]=u*l,a}},7640:function(i,n,a){var l=a(1888);function o(_){switch(_){case"uint32":return[l.mallocUint32,l.freeUint32];default:return null}}var u={"uint32,1,0":function(_,A){return function(f,k,w,D,E,I,M,p,g,C,T){var N,B,U,V=f*E+D,W,F=_(p),$,q,G,ee;for(N=f+1;N<=k;++N){for(B=N,V+=E,U=V,$=0,q=V,W=0;Wf;){$=0,q=U-E;t:for(W=0;Wee)break t;q+=C,$+=T}for($=U,q=U-E,W=0;W>1,$=F-U,q=F+U,G=V,ee=$,he=F,xe=q,ve=W,ce=w+1,re=D-1,ge=!0,ne,se,_e,oe,J,me,fe,Ce,Be,Oe=0,Ze=0,Ge=0,rt,_t,pt,gt,ct,Ae,ze,Ee,nt,xt,ut,Et,Gt,Jt,gr,mr,Kr=C,ri=A(Kr),Mr=A(Kr);_t=M*G,pt=M*ee,mr=I;e:for(rt=0;rt0){se=G,G=ee,ee=se;break e}if(Ge<0)break e;mr+=N}_t=M*xe,pt=M*ve,mr=I;e:for(rt=0;rt0){se=xe,xe=ve,ve=se;break e}if(Ge<0)break e;mr+=N}_t=M*G,pt=M*he,mr=I;e:for(rt=0;rt0){se=G,G=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,pt=M*he,mr=I;e:for(rt=0;rt0){se=ee,ee=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*G,pt=M*xe,mr=I;e:for(rt=0;rt0){se=G,G=xe,xe=se;break e}if(Ge<0)break e;mr+=N}_t=M*he,pt=M*xe,mr=I;e:for(rt=0;rt0){se=he,he=xe,xe=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,pt=M*ve,mr=I;e:for(rt=0;rt0){se=ee,ee=ve,ve=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,pt=M*he,mr=I;e:for(rt=0;rt0){se=ee,ee=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*xe,pt=M*ve,mr=I;e:for(rt=0;rt0){se=xe,xe=ve,ve=se;break e}if(Ge<0)break e;mr+=N}for(_t=M*G,pt=M*ee,gt=M*he,ct=M*xe,Ae=M*ve,ze=M*V,Ee=M*F,nt=M*W,gr=0,mr=I,rt=0;rt0)re--;else if(Ge<0){for(_t=M*me,pt=M*ce,gt=M*re,mr=I,rt=0;rt0)for(;;){fe=I+re*M,gr=0;e:for(rt=0;rt0){if(--reW){e:for(;;){for(fe=I+ce*M,gr=0,mr=I,rt=0;rt1&&k?D(f,k[0],k[1]):D(f)}var b={"uint32,1,0":function(_,A){return function(f){var k=f.data,w=f.offset|0,D=f.shape,E=f.stride,I=E[0]|0,M=D[0]|0,p=E[1]|0,g=D[1]|0,C=p,T=p,N=1;M<=32?_(0,M-1,k,w,I,p,M,g,C,T,N):A(0,M-1,k,w,I,p,M,g,C,T,N)}}};function x(_,A){var f=[A,_].join(","),k=b[f],w=s(_,A),D=m(_,A,w);return k(w,D)}i.exports=x},7642:function(i,n,a){var l=a(8954),o=a(1682);i.exports=m;function u(b,x){this.point=b,this.index=x}function s(b,x){for(var _=b.point,A=x.point,f=_.length,k=0;k=2)return!1;V[F]=$}return!0}):U=U.filter(function(V){for(var W=0;W<=A;++W){var F=C[V[W]];if(F<0)return!1;V[W]=F}return!0}),A&1)for(var w=0;w",q="",G=$.length,ee=q.length,he=V[0]===k||V[0]===E,xe=0,ve=-ee;xe>-1&&(xe=W.indexOf($,xe),!(xe===-1||(ve=W.indexOf(q,xe+G),ve===-1)||ve<=xe));){for(var ce=xe;ce=ve)F[ce]=null,W=W.substr(0,ce)+" "+W.substr(ce+1);else if(F[ce]!==null){var re=F[ce].indexOf(V[0]);re===-1?F[ce]+=V:he&&(F[ce]=F[ce].substr(0,re+1)+(1+parseInt(F[ce][re+1]))+F[ce].substr(re+2))}var ge=xe+G,ne=W.substr(ge,ve-ge),se=ne.indexOf($);se!==-1?xe=se:xe=ve+ee}return F}function p(U,V,W){for(var F=V.textAlign||"start",$=V.textBaseline||"alphabetic",q=[1073741824,1073741824],G=[0,0],ee=U.length,he=0;he/g,` -`):W=W.replace(/\/g," ");var G="",ee=[];for(J=0;J-1?parseInt(Ee[1+ut]):0,Jt=Et>-1?parseInt(nt[1+Et]):0;Gt!==Jt&&(xt=xt.replace(Ge(),"?px "),Ce*=Math.pow(.75,Jt-Gt),xt=xt.replace("?px ",Ge())),fe+=.25*re*(Jt-Gt)}if(q.superscripts===!0){var gr=Ee.indexOf(k),mr=nt.indexOf(k),Kr=gr>-1?parseInt(Ee[1+gr]):0,ri=mr>-1?parseInt(nt[1+mr]):0;Kr!==ri&&(xt=xt.replace(Ge(),"?px "),Ce*=Math.pow(.75,ri-Kr),xt=xt.replace("?px ",Ge())),fe-=.25*re*(ri-Kr)}if(q.bolds===!0){var Mr=Ee.indexOf(x)>-1,ui=nt.indexOf(x)>-1;!Mr&&ui&&(mi?xt=xt.replace("italic ","italic bold "):xt="bold "+xt),Mr&&!ui&&(xt=xt.replace("bold ",""))}if(q.italics===!0){var mi=Ee.indexOf(A)>-1,Ot=nt.indexOf(A)>-1;!mi&&Ot&&(xt="italic "+xt),mi&&!Ot&&(xt=xt.replace("italic ",""))}V.font=xt}for(oe=0;oe0&&($=F.size),F.lineSpacing&&F.lineSpacing>0&&(q=F.lineSpacing),F.styletags&&F.styletags.breaklines&&(G.breaklines=!!F.styletags.breaklines),F.styletags&&F.styletags.bolds&&(G.bolds=!!F.styletags.bolds),F.styletags&&F.styletags.italics&&(G.italics=!!F.styletags.italics),F.styletags&&F.styletags.subscripts&&(G.subscripts=!!F.styletags.subscripts),F.styletags&&F.styletags.superscripts&&(G.superscripts=!!F.styletags.superscripts)),W.font=[F.fontStyle,F.fontVariant,F.fontWeight,$+"px",F.font].filter(function(he){return he}).join(" "),W.textAlign="start",W.textBaseline="alphabetic",W.direction="ltr";var ee=g(V,W,U,$,q,G);return N(ee,F,$)}},7721:function(i,n,a){var l=a(5716);i.exports=o;function o(u){return l(u[0])*l(u[1])}},7765:function(i,n,a){i.exports=f;var l=a(9618),o=a(1888),u=a(446),s=a(1570);function h(k){for(var w=k.length,D=0,E=0;E"u"&&(E=h(k));var I=k.length;if(I===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var M=m(w,+D),p=b(k,E),g=x(p,w,M,+D),C=_(p,w.length|0),T=s(E)(k,p.data,C,M),N=A(p),B=[].slice.call(g.data,0,g.shape[0]);return o.free(M),o.free(p.data),o.free(g.data),o.free(C),{cells:T,vertexIds:N,vertexWeights:B}}},7766:function(i,n,a){var l=a(9618),o=a(5298),u=a(1888);i.exports=g;var s=null,h=null,m=null;function b(C){s=[C.LINEAR,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_NEAREST],h=[C.NEAREST,C.LINEAR,C.NEAREST_MIPMAP_NEAREST,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_LINEAR],m=[C.REPEAT,C.CLAMP_TO_EDGE,C.MIRRORED_REPEAT]}function x(C){return typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&C instanceof HTMLVideoElement||typeof ImageData<"u"&&C instanceof ImageData}var _=function(C,T){o.muls(C,T,255)};function A(C,T,N){var B=C.gl,U=B.getParameter(B.MAX_TEXTURE_SIZE);if(T<0||T>U||N<0||N>U)throw new Error("gl-texture2d: Invalid texture size");return C._shape=[T,N],C.bind(),B.texImage2D(B.TEXTURE_2D,0,C.format,T,N,0,C.format,C.type,null),C._mipLevels=[0],C}function f(C,T,N,B,U,V){this.gl=C,this.handle=T,this.format=U,this.type=V,this._shape=[N,B],this._mipLevels=[0],this._magFilter=C.NEAREST,this._minFilter=C.NEAREST,this._wrapS=C.CLAMP_TO_EDGE,this._wrapT=C.CLAMP_TO_EDGE,this._anisoSamples=1;var W=this,F=[this._wrapS,this._wrapT];Object.defineProperties(F,[{get:function(){return W._wrapS},set:function(q){return W.wrapS=q}},{get:function(){return W._wrapT},set:function(q){return W.wrapT=q}}]),this._wrapVector=F;var $=[this._shape[0],this._shape[1]];Object.defineProperties($,[{get:function(){return W._shape[0]},set:function(q){return W.width=q}},{get:function(){return W._shape[1]},set:function(q){return W.height=q}}]),this._shapeVector=$}var k=f.prototype;Object.defineProperties(k,{minFilter:{get:function(){return this._minFilter},set:function(C){this.bind();var T=this.gl;if(this.type===T.FLOAT&&s.indexOf(C)>=0&&(T.getExtension("OES_texture_float_linear")||(C=T.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,C),this._minFilter=C}},magFilter:{get:function(){return this._magFilter},set:function(C){this.bind();var T=this.gl;if(this.type===T.FLOAT&&s.indexOf(C)>=0&&(T.getExtension("OES_texture_float_linear")||(C=T.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,C),this._magFilter=C}},mipSamples:{get:function(){return this._anisoSamples},set:function(C){var T=this._anisoSamples;if(this._anisoSamples=Math.max(C,1)|0,T!==this._anisoSamples){var N=this.gl.getExtension("EXT_texture_filter_anisotropic");N&&this.gl.texParameterf(this.gl.TEXTURE_2D,N.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,C),this._wrapS=C}},wrapT:{get:function(){return this._wrapT},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,C),this._wrapT=C}},wrap:{get:function(){return this._wrapVector},set:function(C){if(Array.isArray(C)||(C=[C,C]),C.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var T=0;T<2;++T)if(m.indexOf(C[T])<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);this._wrapS=C[0],this._wrapT=C[1];var N=this.gl;return this.bind(),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,this._wrapS),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,this._wrapT),C}},shape:{get:function(){return this._shapeVector},set:function(C){if(!Array.isArray(C))C=[C|0,C|0];else if(C.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return A(this,C[0]|0,C[1]|0),[C[0]|0,C[1]|0]}},width:{get:function(){return this._shape[0]},set:function(C){return C=C|0,A(this,C,this._shape[1]),C}},height:{get:function(){return this._shape[1]},set:function(C){return C=C|0,A(this,this._shape[0],C),C}}}),k.bind=function(C){var T=this.gl;return C!==void 0&&T.activeTexture(T.TEXTURE0+(C|0)),T.bindTexture(T.TEXTURE_2D,this.handle),C!==void 0?C|0:T.getParameter(T.ACTIVE_TEXTURE)-T.TEXTURE0},k.dispose=function(){this.gl.deleteTexture(this.handle)},k.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var C=Math.min(this._shape[0],this._shape[1]),T=0;C>0;++T,C>>>=1)this._mipLevels.indexOf(T)<0&&this._mipLevels.push(T)},k.setPixels=function(C,T,N,B){var U=this.gl;this.bind(),Array.isArray(T)?(B=N,N=T[1]|0,T=T[0]|0):(T=T||0,N=N||0),B=B||0;var V=x(C)?C:C.raw;if(V){var W=this._mipLevels.indexOf(B)<0;W?(U.texImage2D(U.TEXTURE_2D,0,this.format,this.format,this.type,V),this._mipLevels.push(B)):U.texSubImage2D(U.TEXTURE_2D,B,T,N,this.format,this.type,V)}else if(C.shape&&C.stride&&C.data){if(C.shape.length<2||T+C.shape[1]>this._shape[1]>>>B||N+C.shape[0]>this._shape[0]>>>B||T<0||N<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");D(U,T,N,B,this.format,this.type,this._mipLevels,C)}else throw new Error("gl-texture2d: Unsupported data type")};function w(C,T){return C.length===3?T[2]===1&&T[1]===C[0]*C[2]&&T[0]===C[2]:T[0]===1&&T[1]===C[0]}function D(C,T,N,B,U,V,W,F){var $=F.dtype,q=F.shape.slice();if(q.length<2||q.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var G=0,ee=0,he=w(q,F.stride.slice());if($==="float32"?G=C.FLOAT:$==="float64"?(G=C.FLOAT,he=!1,$="float32"):$==="uint8"?G=C.UNSIGNED_BYTE:(G=C.UNSIGNED_BYTE,he=!1,$="uint8"),q.length===2)ee=C.LUMINANCE,q=[q[0],q[1],1],F=l(F.data,q,[F.stride[0],F.stride[1],1],F.offset);else if(q.length===3){if(q[2]===1)ee=C.ALPHA;else if(q[2]===2)ee=C.LUMINANCE_ALPHA;else if(q[2]===3)ee=C.RGB;else if(q[2]===4)ee=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");q[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((ee===C.LUMINANCE||ee===C.ALPHA)&&(U===C.LUMINANCE||U===C.ALPHA)&&(ee=U),ee!==U)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var xe=F.size,ve=W.indexOf(B)<0;if(ve&&W.push(B),G===V&&he)F.offset===0&&F.data.length===xe?ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,F.data):ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data.subarray(F.offset,F.offset+xe)):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,F.data.subarray(F.offset,F.offset+xe));else{var ce;V===C.FLOAT?ce=u.mallocFloat32(xe):ce=u.mallocUint8(xe);var re=l(ce,q,[q[2],q[2]*q[0],1]);G===C.FLOAT&&V===C.UNSIGNED_BYTE?_(re,F):o.assign(re,F),ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,ce.subarray(0,xe)):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,ce.subarray(0,xe)),V===C.FLOAT?u.freeFloat32(ce):u.freeUint8(ce)}}function E(C){var T=C.createTexture();return C.bindTexture(C.TEXTURE_2D,T),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MIN_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MAG_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),T}function I(C,T,N,B,U){var V=C.getParameter(C.MAX_TEXTURE_SIZE);if(T<0||T>V||N<0||N>V)throw new Error("gl-texture2d: Invalid texture shape");if(U===C.FLOAT&&!C.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,B,T,N,0,B,U,null),new f(C,W,T,N,B,U)}function M(C,T,N,B,U,V){var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,U,U,V,T),new f(C,W,N,B,U,V)}function p(C,T){var N=T.dtype,B=T.shape.slice(),U=C.getParameter(C.MAX_TEXTURE_SIZE);if(B[0]<0||B[0]>U||B[1]<0||B[1]>U)throw new Error("gl-texture2d: Invalid texture size");var V=w(B,T.stride.slice()),W=0;N==="float32"?W=C.FLOAT:N==="float64"?(W=C.FLOAT,V=!1,N="float32"):N==="uint8"?W=C.UNSIGNED_BYTE:(W=C.UNSIGNED_BYTE,V=!1,N="uint8");var F=0;if(B.length===2)F=C.LUMINANCE,B=[B[0],B[1],1],T=l(T.data,B,[T.stride[0],T.stride[1],1],T.offset);else if(B.length===3)if(B[2]===1)F=C.ALPHA;else if(B[2]===2)F=C.LUMINANCE_ALPHA;else if(B[2]===3)F=C.RGB;else if(B[2]===4)F=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");W===C.FLOAT&&!C.getExtension("OES_texture_float")&&(W=C.UNSIGNED_BYTE,V=!1);var $,q,G=T.size;if(V)T.offset===0&&T.data.length===G?$=T.data:$=T.data.subarray(T.offset,T.offset+G);else{var ee=[B[2],B[2]*B[0],1];q=u.malloc(G,N);var he=l(q,B,ee,0);(N==="float32"||N==="float64")&&W===C.UNSIGNED_BYTE?_(he,T):o.assign(he,T),$=q.subarray(0,G)}var xe=E(C);return C.texImage2D(C.TEXTURE_2D,0,F,B[0],B[1],0,F,W,$),V||u.free(q),new f(C,xe,B[0],B[1],F,W)}function g(C){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(s||b(C),typeof arguments[1]=="number")return I(C,arguments[1],arguments[2],arguments[3]||C.RGBA,arguments[4]||C.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return I(C,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var T=arguments[1],N=x(T)?T:T.raw;if(N)return M(C,N,T.width|0,T.height|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(T.shape&&T.data&&T.stride)return p(C,T)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(i,n,a){var l=a(2931),o=a(9970),u=["xyz","xzy","yxz","yzx","zxy","zyx"],s=function(w,D,E,I){for(var M=w.points,p=w.velocities,g=w.divergences,C=[],T=[],N=[],B=[],U=[],V=[],W=0,F=0,$=o.create(),q=o.create(),G=8,ee=0;ee0)for(var ce=0;ceD)return I-1}return I},b=function(w,D,E){return wE?E:w},x=function(w,D,E){var I=D.vectors,M=D.meshgrid,p=w[0],g=w[1],C=w[2],T=M[0].length,N=M[1].length,B=M[2].length,U=m(M[0],p),V=m(M[1],g),W=m(M[2],C),F=U+1,$=V+1,q=W+1;if(U=b(U,0,T-1),F=b(F,0,T-1),V=b(V,0,N-1),$=b($,0,N-1),W=b(W,0,B-1),q=b(q,0,B-1),U<0||V<0||W<0||F>T-1||$>N-1||q>B-1)return l.create();var G=M[0][U],ee=M[0][F],he=M[1][V],xe=M[1][$],ve=M[2][W],ce=M[2][q],re=(p-G)/(ee-G),ge=(g-he)/(xe-he),ne=(C-ve)/(ce-ve);isFinite(re)||(re=.5),isFinite(ge)||(ge=.5),isFinite(ne)||(ne=.5);var se,_e,oe,J,me,fe;switch(E.reversedX&&(U=T-1-U,F=T-1-F),E.reversedY&&(V=N-1-V,$=N-1-$),E.reversedZ&&(W=B-1-W,q=B-1-q),E.filled){case 5:me=W,fe=q,oe=V*B,J=$*B,se=U*B*N,_e=F*B*N;break;case 4:me=W,fe=q,se=U*B,_e=F*B,oe=V*B*T,J=$*B*T;break;case 3:oe=V,J=$,me=W*N,fe=q*N,se=U*N*B,_e=F*N*B;break;case 2:oe=V,J=$,se=U*N,_e=F*N,me=W*N*T,fe=q*N*T;break;case 1:se=U,_e=F,me=W*T,fe=q*T,oe=V*T*B,J=$*T*B;break;default:se=U,_e=F,oe=V*T,J=$*T,me=W*T*N,fe=q*T*N;break}var Ce=I[se+oe+me],Be=I[se+oe+fe],Oe=I[se+J+me],Ze=I[se+J+fe],Ge=I[_e+oe+me],rt=I[_e+oe+fe],_t=I[_e+J+me],pt=I[_e+J+fe],gt=l.create(),ct=l.create(),Ae=l.create(),ze=l.create();l.lerp(gt,Ce,Ge,re),l.lerp(ct,Be,rt,re),l.lerp(Ae,Oe,_t,re),l.lerp(ze,Ze,pt,re);var Ee=l.create(),nt=l.create();l.lerp(Ee,gt,Ae,ge),l.lerp(nt,ct,ze,ge);var xt=l.create();return l.lerp(xt,Ee,nt,ne),xt},_=function(w){var D=1/0;w.sort(function(p,g){return p-g});for(var E=w.length,I=1;IF||pt$||gtq)},ee=l.distance(D[0],D[1]),he=10*ee/I,xe=he*he,ve=1,ce=0,re=E.length;re>1&&(ve=A(E));for(var ge=0;gece&&(ce=Ce),me.push(Ce),B.push({points:se,velocities:_e,divergences:me});for(var Be=0;Bexe&&l.scale(Oe,Oe,he/Math.sqrt(Ze)),l.add(Oe,Oe,ne),oe=T(Oe),l.squaredDistance(J,Oe)-xe>-1e-4*xe){se.push(Oe),J=Oe,_e.push(oe);var fe=N(Oe,oe),Ce=l.length(fe);isFinite(Ce)&&Ce>ce&&(ce=Ce),me.push(Ce)}ne=Oe}}var Ge=h(B,w.colormap,ce,ve);return p?Ge.tubeScale=p:(ce===0&&(ce=1),Ge.tubeScale=M*.5*ve/ce),Ge};var f=a(6740),k=a(6405).createMesh;i.exports.createTubeMesh=function(w,D){return k(w,D,{shaders:f,traceType:"streamtube"})}},7827:function(i){i.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(i,n,a){var l=a(6330),o=a(1533),u=a(2651),s=a(6768),h=a(869),m=a(8697);i.exports=b;function b(x,_){if(l(x))return _?m(x,b(_)):[x[0].clone(),x[1].clone()];var A=0,f,k;if(o(x))f=x.clone();else if(typeof x=="string")f=s(x);else{if(x===0)return[u(0),u(1)];if(x===Math.floor(x))f=u(x);else{for(;x!==Math.floor(x);)x=x*Math.pow(2,256),A-=256;f=u(x)}}if(l(_))f.mul(_[1]),k=_[0].clone();else if(o(_))k=_.clone();else if(typeof _=="string")k=s(_);else if(!_)k=u(1);else if(_===Math.floor(_))k=u(_);else{for(;_!==Math.floor(_);)_=_*Math.pow(2,256),A+=256;k=u(_)}return A>0?f=f.ushln(A):A<0&&(k=k.ushln(-A)),h(f,k)}},7894:function(i){i.exports=n;function n(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},7932:function(i,n,a){var l=a(620);i.exports=l.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},7960:function(i){i.exports=n;function n(a,l){var o=l[0]-a[0],u=l[1]-a[1],s=l[2]-a[2],h=l[3]-a[3];return o*o+u*u+s*s+h*h}},8105:function(i){i.exports=a;var n={"lo===p0":l,"lo=p0)&&!(p1>=hi)":b};function a(x){return n[x]}function l(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g];if(N===D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function o(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g];if(NB;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function u(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+C];if(N<=D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function s(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+C];if(N<=D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function h(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g],B=k[I+C];if(N<=D&&D<=B)if(p===T)p+=1,M+=E;else{for(var U=0;E>U;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[T];w[T]=w[p],w[p++]=W}}return p}function m(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g],B=k[I+C];if(NU;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[T];w[T]=w[p],w[p++]=W}}return p}function b(x,_,A,f,k,w,D,E){for(var I=2*x,M=I*A,p=M,g=A,C=_,T=x+_,N=A;f>N;++N,M+=I){var B=k[M+C],U=k[M+T];if(!(B>=D)&&!(E>=U))if(g===N)g+=1,p+=I;else{for(var V=0;I>V;++V){var W=k[M+V];k[M+V]=k[p],k[p++]=W}var F=w[N];w[N]=w[g],w[g++]=F}}return g}},8107:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.min(l[0],o[0]),a[1]=Math.min(l[1],o[1]),a[2]=Math.min(l[2],o[2]),a}},8116:function(i,n,a){var l=a(7518),o=a(870);function u(h){this.bindVertexArrayOES=h.bindVertexArray.bind(h),this.createVertexArrayOES=h.createVertexArray.bind(h),this.deleteVertexArrayOES=h.deleteVertexArray.bind(h)}function s(h,m,b,x){var _=h.createVertexArray?new u(h):h.getExtension("OES_vertex_array_object"),A;return _?A=l(h,_):A=o(h),A.update(m,b,x),A}i.exports=s},8192:function(i,n,a){i.exports=s;var l=a(2825),o=a(3536),u=a(244);function s(h,m){var b=l(h[0],h[1],h[2]),x=l(m[0],m[1],m[2]);o(b,b),o(x,x);var _=u(b,x);return _>1?0:Math.acos(_)}},8210:function(i){i.exports=a;function n(l,o){var u=l+o,s=u-l,h=u-s,m=o-s,b=l-h,x=b+m;return x?[x,u]:[u]}function a(l,o){var u=l.length|0,s=o.length|0;if(u===1&&s===1)return n(l[0],o[0]);var h=u+s,m=new Array(h),b=0,x=0,_=0,A=Math.abs,f=l[x],k=A(f),w=o[_],D=A(w),E,I;k=s?(E=f,x+=1,xb)for(var N=m[f],B=1/Math.sqrt(p*C),T=0;T<3;++T){var U=(T+1)%3,V=(T+2)%3;N[T]+=B*(g[U]*M[V]-g[V]*M[U])}}for(var x=0;xb)for(var B=1/Math.sqrt(W),T=0;T<3;++T)N[T]*=B;else for(var T=0;T<3;++T)N[T]=0}return m},n.faceNormals=function(o,u,s){for(var h=o.length,m=new Array(h),b=s===void 0?l:s,x=0;xb?E=1/Math.sqrt(E):E=0;for(var f=0;f<3;++f)D[f]*=E;m[x]=D}return m}},8418:function(i,n,a){var l=a(5219),o=a(2762),u=a(8116),s=a(1888),h=a(6760),m=a(1283),b=a(9366),x=a(5964),_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=ArrayBuffer,f=DataView;function k(se){return A.isView(se)&&!(se instanceof f)}function w(se){return Array.isArray(se)||k(se)}i.exports=ne;function D(se,_e){var oe=se[0],J=se[1],me=se[2],fe=se[3];return se[0]=_e[0]*oe+_e[4]*J+_e[8]*me+_e[12]*fe,se[1]=_e[1]*oe+_e[5]*J+_e[9]*me+_e[13]*fe,se[2]=_e[2]*oe+_e[6]*J+_e[10]*me+_e[14]*fe,se[3]=_e[3]*oe+_e[7]*J+_e[11]*me+_e[15]*fe,se}function E(se,_e,oe,J){return D(J,J),D(J,J),D(J,J)}function I(se,_e){this.index=se,this.dataCoordinate=this.position=_e}function M(se){return se===!0||se>1?1:se}function p(se,_e,oe,J,me,fe,Ce,Be,Oe,Ze,Ge,rt){this.gl=se,this.pixelRatio=1,this.shader=_e,this.orthoShader=oe,this.projectShader=J,this.pointBuffer=me,this.colorBuffer=fe,this.glyphBuffer=Ce,this.idBuffer=Be,this.vao=Oe,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ze,this.pickOrthoShader=Ge,this.pickProjectShader=rt,this.points=[],this._selectResult=new I(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var g=p.prototype;g.pickSlots=1,g.setPickBase=function(se){this.pickId=se},g.isTransparent=function(){if(this.hasAlpha)return!0;for(var se=0;se<3;++se)if(this.axesProject[se]&&this.projectHasAlpha)return!0;return!1},g.isOpaque=function(){if(!this.hasAlpha)return!0;for(var se=0;se<3;++se)if(this.axesProject[se]&&!this.projectHasAlpha)return!0;return!1};var C=[0,0],T=[0,0,0],N=[0,0,0],B=[0,0,0,1],U=[0,0,0,1],V=_.slice(),W=[0,0,0],F=[[0,0,0],[0,0,0]];function $(se){return se[0]=se[1]=se[2]=0,se}function q(se,_e){return se[0]=_e[0],se[1]=_e[1],se[2]=_e[2],se[3]=1,se}function G(se,_e,oe,J){return se[0]=_e[0],se[1]=_e[1],se[2]=_e[2],se[oe]=J,se}function ee(se){for(var _e=F,oe=0;oe<2;++oe)for(var J=0;J<3;++J)_e[oe][J]=Math.max(Math.min(se[oe][J],1e8),-1e8);return _e}function he(se,_e,oe,J){var me=_e.axesProject,fe=_e.gl,Ce=se.uniforms,Be=oe.model||_,Oe=oe.view||_,Ze=oe.projection||_,Ge=_e.axesBounds,rt=ee(_e.clipBounds),_t;_e.axes&&_e.axes.lastCubeProps?_t=_e.axes.lastCubeProps.axis:_t=[1,1,1],C[0]=2/fe.drawingBufferWidth,C[1]=2/fe.drawingBufferHeight,se.bind(),Ce.view=Oe,Ce.projection=Ze,Ce.screenSize=C,Ce.highlightId=_e.highlightId,Ce.highlightScale=_e.highlightScale,Ce.clipBounds=rt,Ce.pickGroup=_e.pickId/255,Ce.pixelRatio=J;for(var pt=0;pt<3;++pt)if(me[pt]){Ce.scale=_e.projectScale[pt],Ce.opacity=_e.projectOpacity[pt];for(var gt=V,ct=0;ct<16;++ct)gt[ct]=0;for(var ct=0;ct<4;++ct)gt[5*ct]=1;gt[5*pt]=0,_t[pt]<0?gt[12+pt]=Ge[0][pt]:gt[12+pt]=Ge[1][pt],h(gt,Be,gt),Ce.model=gt;var Ae=(pt+1)%3,ze=(pt+2)%3,Ee=$(T),nt=$(N);Ee[Ae]=1,nt[ze]=1;var xt=E(Ze,Oe,Be,q(B,Ee)),ut=E(Ze,Oe,Be,q(U,nt));if(Math.abs(xt[1])>Math.abs(ut[1])){var Et=xt;xt=ut,ut=Et,Et=Ee,Ee=nt,nt=Et;var Gt=Ae;Ae=ze,ze=Gt}xt[0]<0&&(Ee[Ae]=-1),ut[1]>0&&(nt[ze]=-1);for(var Jt=0,gr=0,ct=0;ct<4;++ct)Jt+=Math.pow(Be[4*Ae+ct],2),gr+=Math.pow(Be[4*ze+ct],2);Ee[Ae]/=Math.sqrt(Jt),nt[ze]/=Math.sqrt(gr),Ce.axes[0]=Ee,Ce.axes[1]=nt,Ce.fragClipBounds[0]=G(W,rt[0],pt,-1e8),Ce.fragClipBounds[1]=G(W,rt[1],pt,1e8),_e.vao.bind(),_e.vao.draw(fe.TRIANGLES,_e.vertexCount),_e.lineWidth>0&&(fe.lineWidth(_e.lineWidth*J),_e.vao.draw(fe.LINES,_e.lineVertexCount,_e.vertexCount)),_e.vao.unbind()}}var xe=[-1e8,-1e8,-1e8],ve=[1e8,1e8,1e8],ce=[xe,ve];function re(se,_e,oe,J,me,fe,Ce){var Be=oe.gl;if((fe===oe.projectHasAlpha||Ce)&&he(_e,oe,J,me),fe===oe.hasAlpha||Ce){se.bind();var Oe=se.uniforms;Oe.model=J.model||_,Oe.view=J.view||_,Oe.projection=J.projection||_,C[0]=2/Be.drawingBufferWidth,C[1]=2/Be.drawingBufferHeight,Oe.screenSize=C,Oe.highlightId=oe.highlightId,Oe.highlightScale=oe.highlightScale,Oe.fragClipBounds=ce,Oe.clipBounds=oe.axes.bounds,Oe.opacity=oe.opacity,Oe.pickGroup=oe.pickId/255,Oe.pixelRatio=me,oe.vao.bind(),oe.vao.draw(Be.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(Be.lineWidth(oe.lineWidth*me),oe.vao.draw(Be.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}g.draw=function(se){var _e=this.useOrtho?this.orthoShader:this.shader;re(_e,this.projectShader,this,se,this.pixelRatio,!1,!1)},g.drawTransparent=function(se){var _e=this.useOrtho?this.orthoShader:this.shader;re(_e,this.projectShader,this,se,this.pixelRatio,!0,!1)},g.drawPick=function(se){var _e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;re(_e,this.pickProjectShader,this,se,1,!0,!0)},g.pick=function(se){if(!se||se.id!==this.pickId)return null;var _e=se.value[2]+(se.value[1]<<8)+(se.value[0]<<16);if(_e>=this.pointCount||_e<0)return null;var oe=this.points[_e],J=this._selectResult;J.index=_e;for(var me=0;me<3;++me)J.position[me]=J.dataCoordinate[me]=oe[me];return J},g.highlight=function(se){if(!se)this.highlightId=[1,1,1,1];else{var _e=se.index,oe=_e&255,J=_e>>8&255,me=_e>>16&255;this.highlightId=[oe/255,J/255,me/255,0]}};function ge(se,_e,oe,J){var me;w(se)?_e0){var mi=0,Ot=ze,Je=[0,0,0,1],ot=[0,0,0,1],De=w(_t)&&w(_t[0]),ye=w(ct)&&w(ct[0]);e:for(var J=0;J0?1-gr[0][0]:Kt<0?1+gr[1][0]:1,hr*=hr>0?1-gr[0][1]:hr<0?1+gr[1][1]:1;for(var zr=[Kt,hr],Dr=Gt.cells||[],br=Gt.positions||[],ut=0;ut=s?(E=f,x+=1,x0?1:0}},8648:function(i,n,a){i.exports=a(783)},8692:function(i){i.exports=n;function n(a,l,o,u){var s=o[0],h=o[1],m=l[0]-s,b=l[1]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=s+m*_-b*x,a[1]=h+m*x+b*_,a[2]=l[2],a}},8697:function(i,n,a){var l=a(869);i.exports=o;function o(u,s){return l(u[0].mul(s[1]),u[1].mul(s[0]))}},8731:function(i,n,a){i.exports=b;var l=a(8866);function o(x,_,A,f,k,w){this._gl=x,this._wrapper=_,this._index=A,this._locations=f,this._dimension=k,this._constFunc=w}var u=o.prototype;u.pointer=function(x,_,A,f){var k=this,w=k._gl,D=k._locations[k._index];w.vertexAttribPointer(D,k._dimension,x||w.FLOAT,!!_,A||0,f||0),w.enableVertexAttribArray(D)},u.set=function(x,_,A,f){return this._constFunc(this._locations[this._index],x,_,A,f)},Object.defineProperty(u,"location",{get:function(){return this._locations[this._index]},set:function(x){return x!==this._locations[this._index]&&(this._locations[this._index]=x|0,this._wrapper.program=null),x|0}});var s=[function(x,_,A){return A.length===void 0?x.vertexAttrib1f(_,A):x.vertexAttrib1fv(_,A)},function(x,_,A,f){return A.length===void 0?x.vertexAttrib2f(_,A,f):x.vertexAttrib2fv(_,A)},function(x,_,A,f,k){return A.length===void 0?x.vertexAttrib3f(_,A,f,k):x.vertexAttrib3fv(_,A)},function(x,_,A,f,k,w){return A.length===void 0?x.vertexAttrib4f(_,A,f,k,w):x.vertexAttrib4fv(_,A)}];function h(x,_,A,f,k,w,D){var E=s[k],I=new o(x,_,A,f,k,E);Object.defineProperty(w,D,{set:function(M){return x.disableVertexAttribArray(f[A]),E(x,f[A],M),M},get:function(){return I},enumerable:!0})}function m(x,_,A,f,k,w,D){for(var E=new Array(k),I=new Array(k),M=0;M=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);h(x,_,p[0],f,g,k,I)}else if(M.indexOf("mat")>=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);m(x,_,p,f,g,k,I)}else throw new l("","Unknown data type for attribute "+I+": "+M);break}}return k}},8828:function(i,n){"use restrict";var a=32;n.INT_BITS=a,n.INT_MAX=2147483647,n.INT_MIN=-1<0)-(u<0)},n.abs=function(u){var s=u>>a-1;return(u^s)-s},n.min=function(u,s){return s^(u^s)&-(u65535)<<4,u>>>=s,h=(u>255)<<3,u>>>=h,s|=h,h=(u>15)<<2,u>>>=h,s|=h,h=(u>3)<<1,u>>>=h,s|=h,s|u>>1},n.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},n.popCount=function(u){return u=u-(u>>>1&1431655765),u=(u&858993459)+(u>>>2&858993459),(u+(u>>>4)&252645135)*16843009>>>24};function l(u){var s=32;return u&=-u,u&&s--,u&65535&&(s-=16),u&16711935&&(s-=8),u&252645135&&(s-=4),u&858993459&&(s-=2),u&1431655765&&(s-=1),s}n.countTrailingZeros=l,n.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u+1},n.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u-(u>>>1)},n.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,u&=15,27030>>>u&1};var o=new Array(256);(function(u){for(var s=0;s<256;++s){var h=s,m=s,b=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=h&1,--b;u[s]=m<>>8&255]<<16|o[u>>>16&255]<<8|o[u>>>24&255]},n.interleave2=function(u,s){return u&=65535,u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,u|s<<1},n.deinterleave2=function(u,s){return u=u>>>s&1431655765,u=(u|u>>>1)&858993459,u=(u|u>>>2)&252645135,u=(u|u>>>4)&16711935,u=(u|u>>>16)&65535,u<<16>>16},n.interleave3=function(u,s,h){return u&=1023,u=(u|u<<16)&4278190335,u=(u|u<<8)&251719695,u=(u|u<<4)&3272356035,u=(u|u<<2)&1227133513,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,u|=s<<1,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,u|h<<2},n.deinterleave3=function(u,s){return u=u>>>s&1227133513,u=(u|u>>>2)&3272356035,u=(u|u>>>4)&251719695,u=(u|u>>>8)&4278190335,u=(u|u>>>16)&1023,u<<22>>22},n.nextCombination=function(u){var s=u|u-1;return s+1|(~s&-~s)-1>>>l(u)+1}},8866:function(i){function n(a,l,o){this.shortMessage=l||"",this.longMessage=o||"",this.rawError=a||"",this.message="gl-shader: "+(l||a||"")+(o?` -`+o:""),this.stack=new Error().stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,i.exports=n},8902:function(i,n,a){var l=a(2478),o=a(3250)[3],u=0,s=1,h=2;i.exports=D;function m(E,I,M,p,g){this.a=E,this.b=I,this.idx=M,this.lowerIds=p,this.upperIds=g}function b(E,I,M,p){this.a=E,this.b=I,this.type=M,this.idx=p}function x(E,I){var M=E.a[0]-I.a[0]||E.a[1]-I.a[1]||E.type-I.type;return M||E.type!==u&&(M=o(E.a,E.b,I.b),M)?M:E.idx-I.idx}function _(E,I){return o(E.a,E.b,I)}function A(E,I,M,p,g){for(var C=l.lt(I,p,_),T=l.gt(I,p,_),N=C;N1&&o(M[U[V-2]],M[U[V-1]],p)>0;)E.push([U[V-1],U[V-2],g]),V-=1;U.length=V,U.push(g);for(var W=B.upperIds,V=W.length;V>1&&o(M[W[V-2]],M[W[V-1]],p)<0;)E.push([W[V-2],W[V-1],g]),V-=1;W.length=V,W.push(g)}}function f(E,I){var M;return E.a[0]B[0]&&g.push(new b(B,N,h,C),new b(N,B,s,C))}g.sort(x);for(var U=g[0].a[0]-(1+Math.abs(g[0].a[0]))*Math.pow(2,-52),V=[new m([U,1],[U,0],-1,[],[])],W=[],C=0,F=g.length;C0;){k=p.pop();for(var g=k.adjacent,C=0;C<=D;++C){var T=g[C];if(!(!T.boundary||T.lastVisited<=-E)){for(var N=T.vertices,B=0;B<=D;++B){var U=N[B];U<0?I[B]=w:I[B]=M[U]}var V=this.orient();if(V>0)return T;T.lastVisited=-E,V===0&&p.push(T)}}}return null},A.walk=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=w?this.interior.length*Math.random()|0:this.interior.length-1,g=this.interior[p];e:for(;!g.boundary;){for(var C=g.vertices,T=g.adjacent,N=0;N<=E;++N)M[N]=I[C[N]];g.lastVisited=D;for(var N=0;N<=E;++N){var B=T[N];if(!(B.lastVisited>=D)){var U=M[N];M[N]=k;var V=this.orient();if(M[N]=U,V<0){g=B;continue e}else B.boundary?B.lastVisited=-D:B.lastVisited=D}}return}return g},A.addPeaks=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=this.interior,g=this.simplices,C=[w];w.lastVisited=D,w.vertices[w.vertices.indexOf(-1)]=D,w.boundary=!1,p.push(w);for(var T=[];C.length>0;){var w=C.pop(),N=w.vertices,B=w.adjacent,U=N.indexOf(D);if(!(U<0)){for(var V=0;V<=E;++V)if(V!==U){var W=B[V];if(!(!W.boundary||W.lastVisited>=D)){var F=W.vertices;if(W.lastVisited!==-D){for(var $=0,q=0;q<=E;++q)F[q]<0?($=q,M[q]=k):M[q]=I[F[q]];var G=this.orient();if(G>0){F[$]=D,W.boundary=!1,p.push(W),C.push(W),W.lastVisited=D;continue}else W.lastVisited=-D}var ee=W.adjacent,he=N.slice(),xe=B.slice(),ve=new u(he,xe,!0);g.push(ve);var ce=ee.indexOf(w);if(!(ce<0)){ee[ce]=ve,xe[U]=W,he[V]=-1,xe[V]=w,B[V]=ve,ve.flip();for(var q=0;q<=E;++q){var re=he[q];if(!(re<0||re===D)){for(var ge=new Array(E-1),ne=0,se=0;se<=E;++se){var _e=he[se];_e<0||se===q||(ge[ne++]=_e)}T.push(new s(ge,ve,q))}}}}}}}T.sort(h);for(var V=0;V+1=0?p[C++]=g[N]:T=N&1;if(T===(k&1)){var B=p[0];p[0]=p[1],p[1]=B}w.push(p)}}return w};function f(k,w){var D=k.length;if(D===0)throw new Error("Must have at least d+1 points");var E=k[0].length;if(D<=E)throw new Error("Must input at least d+1 points");var I=k.slice(0,E+1),M=l.apply(void 0,I);if(M===0)throw new Error("Input not in general position");for(var p=new Array(E+1),g=0;g<=E;++g)p[g]=g;M<0&&(p[0]=1,p[1]=0);for(var C=new u(p,new Array(E+1),!1),T=C.adjacent,N=new Array(E+2),g=0;g<=E;++g){for(var B=p.slice(),U=0;U<=E;++U)U===g&&(B[U]=-1);var V=B[0];B[0]=B[1],B[1]=V;var W=new u(B,new Array(E+1),!0);T[g]=W,N[g]=W}N[E+1]=C;for(var g=0;g<=E;++g)for(var B=T[g].vertices,F=T[g].adjacent,U=0;U<=E;++U){var $=B[U];if($<0){F[U]=C;continue}for(var q=0;q<=E;++q)T[q].vertices.indexOf($)<0&&(F[U]=T[q])}for(var G=new _(E,I,N),ee=!!w,g=E+1;g=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(M){this.pickId=M};function k(M){for(var p=x({colormap:M,nshades:256,format:"rgba"}),g=new Uint8Array(1024),C=0;C<256;++C){for(var T=p[C],N=0;N<3;++N)g[4*C+N]=T[N];g[4*C+3]=T[3]*255}return b(g,[256,256,4],[4,0,1])}function w(M){for(var p=M.length,g=new Array(p),C=0;C0){var q=this.triShader;q.bind(),q.uniforms=U,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},f.drawPick=function(M){M=M||{};for(var p=this.gl,g=M.model||_,C=M.view||_,T=M.projection||_,N=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],B=0;B<3;++B)N[0][B]=Math.max(N[0][B],this.clipBounds[0][B]),N[1][B]=Math.min(N[1][B],this.clipBounds[1][B]);this._model=[].slice.call(g),this._view=[].slice.call(C),this._projection=[].slice.call(T),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var U={model:g,view:C,projection:T,clipBounds:N,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=U,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},f.pick=function(M){if(!M||M.id!==this.pickId)return null;var p=M.value[0]+256*M.value[1]+65536*M.value[2],g=this.cells[p],C=this.positions[g[1]].slice(0,3),T={position:C,dataCoordinate:C,index:Math.floor(g[1]/48)};return this.traceType==="cone"?T.index=Math.floor(g[1]/48):this.traceType==="streamtube"&&(T.intensity=this.intensity[g[1]],T.velocity=this.vectors[g[1]].slice(0,3),T.divergence=this.vectors[g[1]][3],T.index=p),T},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function D(M,p){var g=l(M,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return g.attributes.position.location=0,g.attributes.color.location=2,g.attributes.uv.location=3,g.attributes.vector.location=4,g}function E(M,p){var g=l(M,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return g.attributes.position.location=0,g.attributes.id.location=1,g.attributes.vector.location=4,g}function I(M,p,g){var C=g.shaders;arguments.length===1&&(p=M,M=p.gl);var T=D(M,C),N=E(M,C),B=s(M,b(new Uint8Array([255,255,255,255]),[1,1,4]));B.generateMipmap(),B.minFilter=M.LINEAR_MIPMAP_LINEAR,B.magFilter=M.LINEAR;var U=o(M),V=o(M),W=o(M),F=o(M),$=o(M),q=u(M,[{buffer:U,type:M.FLOAT,size:4},{buffer:$,type:M.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:W,type:M.FLOAT,size:4},{buffer:F,type:M.FLOAT,size:2},{buffer:V,type:M.FLOAT,size:4}]),G=new A(M,B,T,N,U,V,$,W,F,q,g.traceType||"cone");return G.update(p),G}i.exports=I},9127:function(i,n,a){i.exports=u;var l=a(6204),o=a(5771);function u(s){return o(l(s))}},9131:function(i,n,a){var l=a(5177),o=a(9288);i.exports=u;function u(s,h){return h=h||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,h),s}},9165:function(i,n,a){i.exports=A;var l=a(2762),o=a(8116),u=a(3436),s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(f,k,w,D){this.gl=f,this.shader=D,this.buffer=k,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var m=h.prototype;m.isOpaque=function(){return!this.hasAlpha},m.isTransparent=function(){return this.hasAlpha},m.drawTransparent=m.draw=function(f){var k=this.gl,w=this.shader.uniforms;this.shader.bind();var D=w.view=f.view||s,E=w.projection=f.projection||s;w.model=f.model||s,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var I=D[12],M=D[13],p=D[14],g=D[15],C=f._ortho||!1,T=C?2:1,N=T*this.pixelRatio*(E[3]*I+E[7]*M+E[11]*p+E[15]*g)/k.drawingBufferHeight;this.vao.bind();for(var B=0;B<3;++B)k.lineWidth(this.lineWidth[B]*this.pixelRatio),w.capSize=this.capSize[B]*N,this.lineCount[B]&&k.drawArrays(k.LINES,this.lineOffset[B],this.lineCount[B]);this.vao.unbind()};function b(f,k){for(var w=0;w<3;++w)f[0][w]=Math.min(f[0][w],k[w]),f[1][w]=Math.max(f[1][w],k[w])}var x=function(){for(var f=new Array(3),k=0;k<3;++k){for(var w=[],D=1;D<=2;++D)for(var E=-1;E<=1;E+=2){var I=(D+k)%3,M=[0,0,0];M[I]=E,w.push(M)}f[k]=w}return f}();function _(f,k,w,D){for(var E=x[D],I=0;I0){var U=C.slice();U[p]+=N[1][p],E.push(C[0],C[1],C[2],B[0],B[1],B[2],B[3],0,0,0,U[0],U[1],U[2],B[0],B[1],B[2],B[3],0,0,0),b(this.bounds,U),M+=2+_(E,U,B,p)}}}this.lineCount[p]=M-this.lineOffset[p]}this.buffer.update(E)}},m.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function A(f){var k=f.gl,w=l(k),D=o(k,[{buffer:w,type:k.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:k.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:k.FLOAT,size:3,offset:28,stride:40}]),E=u(k);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var I=new h(k,w,D,E);return I.update(f),I}},9215:function(i,n,a){i.exports=b;var l=a(4769),o=a(2478);function u(x,_,A){return Math.min(_,Math.max(x,A))}function s(x,_,A){this.dimension=x.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var f=0;f=A-1)for(var M=w.length-1,g=x-_[A-1],p=0;p=A-1)for(var I=w.length-1,M=x-_[A-1],p=0;p=0;--A)if(x[--_])return!1;return!0},h.jump=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=this.bounds,E=D[0],I=D[1];this._time.push(_,x);for(var M=0;M<2;++M)for(var p=0;p0;--p)f.push(u(E[p-1],I[p-1],arguments[p])),k.push(0)}},h.push=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=x-_,E=this.bounds,I=E[0],M=E[1],p=D>1e-6?1/D:0;this._time.push(x);for(var g=A;g>0;--g){var C=u(I[g-1],M[g-1],arguments[g]);f.push(C),k.push((C-f[w++])*p)}}},h.set=function(x){var _=this.dimension;if(!(x0;--E)A.push(u(w[E-1],D[E-1],arguments[E])),f.push(0)}},h.move=function(x){var _=this.lastT(),A=this.dimension;if(!(x<=_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=this.bounds,E=D[0],I=D[1],M=x-_,p=M>1e-6?1/M:0;this._time.push(x);for(var g=A;g>0;--g){var C=arguments[g];f.push(u(E[g-1],I[g-1],f[w++]+C)),k.push(C*p)}}},h.idle=function(x){var _=this.lastT();if(!(x<_)){var A=this.dimension,f=this._state,k=this._velocity,w=f.length-A,D=this.bounds,E=D[0],I=D[1],M=x-_;this._time.push(x);for(var p=A-1;p>=0;--p)f.push(u(E[p],I[p],f[w]+M*k[w])),k.push(0),w+=1}};function m(x){for(var _=new Array(x),A=0;A1&&s.indexOf("Macintosh")!==-1&&s.indexOf("Safari")!==-1&&(h=!0),h}},9226:function(i){i.exports=n;function n(a,l){return a[0]=Math.ceil(l[0]),a[1]=Math.ceil(l[1]),a[2]=Math.ceil(l[2]),a}},9265:function(i){i.exports=n;function n(a,l){return a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2]}},9288:function(i){i.exports=n;function n(a,l,o){return a[0]=l[0]*o,a[1]=l[1]*o,a[2]=l[2]*o,a[3]=l[3]*o,a}},9346:function(i){var n=new Float64Array(4),a=new Float64Array(4),l=new Float64Array(4);function o(u,s,h,m,b){n.length=_?(g=1,T=_+2*k+D):(g=-k/_,T=k*g+D)):(g=0,w>=0?(C=0,T=D):-w>=f?(C=1,T=f+2*w+D):(C=-w/f,T=w*C+D));else if(C<0)C=0,k>=0?(g=0,T=D):-k>=_?(g=1,T=_+2*k+D):(g=-k/_,T=k*g+D);else{var N=1/p;g*=N,C*=N,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D}else{var B,U,V,W;g<0?(B=A+k,U=f+w,U>B?(V=U-B,W=_-2*A+f,V>=W?(g=1,C=0,T=_+2*k+D):(g=V/W,C=1-g,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)):(g=0,U<=0?(C=1,T=f+2*w+D):w>=0?(C=0,T=D):(C=-w/f,T=w*C+D))):C<0?(B=A+w,U=_+k,U>B?(V=U-B,W=_-2*A+f,V>=W?(C=1,g=0,T=f+2*w+D):(C=V/W,g=1-C,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)):(C=0,U<=0?(g=1,T=_+2*k+D):k>=0?(g=0,T=D):(g=-k/_,T=k*g+D))):(V=f+w-A-k,V<=0?(g=0,C=1,T=f+2*w+D):(W=_-2*A+f,V>=W?(g=1,C=0,T=_+2*k+D):(g=V/W,C=1-g,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)))}for(var F=1-g-C,x=0;xw)for(f=w;fk)for(f=k;f=0){for(var F=W.type.charAt(W.type.length-1)|0,$=new Array(F),q=0;q=0;)G+=1;U[V]=G}var ee=new Array(w.length);function he(){I.program=s.program(M,I._vref,I._fref,B,U);for(var xe=0;xeoe&&me>0){var fe=(J[me][0]-oe)/(J[me][0]-J[me-1][0]);return J[me][1]*(1-fe)+fe*J[me-1][1]}}return 1}var q=[0,0,0],G={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function ee(oe,J){var me,fe,Ce,Be=J.axes&&J.axes.lastCubeProps.axis||q,Oe=J.showSurface,Ze=J.showContour;for(me=0;me<3;++me)for(Oe=Oe||J.surfaceProject[me],fe=0;fe<3;++fe)Ze=Ze||J.contourProject[me][fe];for(me=0;me<3;++me){var Ge=G.projections[me];for(fe=0;fe<16;++fe)Ge[fe]=0;for(fe=0;fe<4;++fe)Ge[5*fe]=1;Ge[5*me]=0,Ge[12+me]=J.axesBounds[+(Be[me]>0)][me],f(Ge,oe.model,Ge);var rt=G.clipBounds[me];for(Ce=0;Ce<2;++Ce)for(fe=0;fe<3;++fe)rt[Ce][fe]=oe.clipBounds[Ce][fe];rt[0][me]=-1e8,rt[1][me]=1e8}return G.showSurface=Oe,G.showContour=Ze,G}var he={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},xe=T.slice(),ve=[1,0,0,0,1,0,0,0,1];function ce(oe,J){oe=oe||{};var me=this.gl;me.disable(me.CULL_FACE),this._colorMap.bind(0);var fe=he;fe.model=oe.model||T,fe.view=oe.view||T,fe.projection=oe.projection||T,fe.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],fe.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],fe.objectOffset=this.objectOffset,fe.contourColor=this.contourColor[0],fe.inverseModel=k(fe.inverseModel,fe.model);for(var Ce=0;Ce<2;++Ce)for(var Be=fe.clipBounds[Ce],Oe=0;Oe<3;++Oe)Be[Oe]=Math.min(Math.max(this.clipBounds[Ce][Oe],-1e8),1e8);fe.kambient=this.ambientLight,fe.kdiffuse=this.diffuseLight,fe.kspecular=this.specularLight,fe.roughness=this.roughness,fe.fresnel=this.fresnel,fe.opacity=this.opacity,fe.height=0,fe.permutation=ve,fe.vertexColor=this.vertexColor;var Ze=xe;for(f(Ze,fe.view,fe.model),f(Ze,fe.projection,Ze),k(Ze,Ze),Ce=0;Ce<3;++Ce)fe.eyePosition[Ce]=Ze[12+Ce]/Ze[15];var Ge=Ze[15];for(Ce=0;Ce<3;++Ce)Ge+=this.lightPosition[Ce]*Ze[4*Ce+3];for(Ce=0;Ce<3;++Ce){var rt=Ze[12+Ce];for(Oe=0;Oe<3;++Oe)rt+=Ze[4*Oe+Ce]*this.lightPosition[Oe];fe.lightPosition[Ce]=rt/Ge}var _t=ee(fe,this);if(_t.showSurface){for(this._shader.bind(),this._shader.uniforms=fe,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(me.TRIANGLES,this._vertexCount),Ce=0;Ce<3;++Ce)!this.surfaceProject[Ce]||!this.vertexCount||(this._shader.uniforms.model=_t.projections[Ce],this._shader.uniforms.clipBounds=_t.clipBounds[Ce],this._vao.draw(me.TRIANGLES,this._vertexCount));this._vao.unbind()}if(_t.showContour){var pt=this._contourShader;fe.kambient=1,fe.kdiffuse=0,fe.kspecular=0,fe.opacity=1,pt.bind(),pt.uniforms=fe;var gt=this._contourVAO;for(gt.bind(),Ce=0;Ce<3;++Ce)for(pt.uniforms.permutation=B[Ce],me.lineWidth(this.contourWidth[Ce]*this.pixelRatio),Oe=0;Oe>4)/16)/255,Ce=Math.floor(fe),Be=fe-Ce,Oe=J[1]*(oe.value[1]+(oe.value[2]&15)/16)/255,Ze=Math.floor(Oe),Ge=Oe-Ze;Ce+=1,Ze+=1;var rt=me.position;rt[0]=rt[1]=rt[2]=0;for(var _t=0;_t<2;++_t)for(var pt=_t?Be:1-Be,gt=0;gt<2;++gt)for(var ct=gt?Ge:1-Ge,Ae=Ce+_t,ze=Ze+gt,Ee=pt*ct,nt=0;nt<3;++nt)rt[nt]+=this._field[nt].get(Ae,ze)*Ee;for(var xt=this._pickResult.level,ut=0;ut<3;++ut)if(xt[ut]=w.le(this.contourLevels[ut],rt[ut]),xt[ut]<0)this.contourLevels[ut].length>0&&(xt[ut]=0);else if(xt[ut]Math.abs(Gt-rt[ut])&&(xt[ut]+=1)}for(me.index[0]=Be<.5?Ce:Ce+1,me.index[1]=Ge<.5?Ze:Ze+1,me.uv[0]=fe/J[0],me.uv[1]=Oe/J[1],nt=0;nt<3;++nt)me.dataCoordinate[nt]=this._field[nt].get(me.index[0],me.index[1]);return me},F.padField=function(oe,J){var me=J.shape.slice(),fe=oe.shape.slice();b.assign(oe.lo(1,1).hi(me[0],me[1]),J),b.assign(oe.lo(1).hi(me[0],1),J.hi(me[0],1)),b.assign(oe.lo(1,fe[1]-1).hi(me[0],1),J.lo(0,me[1]-1).hi(me[0],1)),b.assign(oe.lo(0,1).hi(1,me[1]),J.hi(1)),b.assign(oe.lo(fe[0]-1,1).hi(1,me[1]),J.lo(me[0]-1)),oe.set(0,0,J.get(0,0)),oe.set(0,fe[1]-1,J.get(0,me[1]-1)),oe.set(fe[0]-1,0,J.get(me[0]-1,0)),oe.set(fe[0]-1,fe[1]-1,J.get(me[0]-1,me[1]-1))};function ge(oe,J){return Array.isArray(oe)?[J(oe[0]),J(oe[1]),J(oe[2])]:[J(oe),J(oe),J(oe)]}function ne(oe){return Array.isArray(oe)?oe.length===3?[oe[0],oe[1],oe[2],1]:[oe[0],oe[1],oe[2],oe[3]]:[0,0,0,1]}function se(oe){if(Array.isArray(oe)){if(Array.isArray(oe))return[ne(oe[0]),ne(oe[1]),ne(oe[2])];var J=ne(oe);return[J.slice(),J.slice(),J.slice()]}}F.update=function(oe){oe=oe||{},this.objectOffset=oe.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in oe&&(this.contourWidth=ge(oe.contourWidth,Number)),"showContour"in oe&&(this.showContour=ge(oe.showContour,Boolean)),"showSurface"in oe&&(this.showSurface=!!oe.showSurface),"contourTint"in oe&&(this.contourTint=ge(oe.contourTint,Boolean)),"contourColor"in oe&&(this.contourColor=se(oe.contourColor)),"contourProject"in oe&&(this.contourProject=ge(oe.contourProject,function(sa){return ge(sa,Boolean)})),"surfaceProject"in oe&&(this.surfaceProject=oe.surfaceProject),"dynamicColor"in oe&&(this.dynamicColor=se(oe.dynamicColor)),"dynamicTint"in oe&&(this.dynamicTint=ge(oe.dynamicTint,Number)),"dynamicWidth"in oe&&(this.dynamicWidth=ge(oe.dynamicWidth,Number)),"opacity"in oe&&(this.opacity=oe.opacity),"opacityscale"in oe&&(this.opacityscale=oe.opacityscale),"colorBounds"in oe&&(this.colorBounds=oe.colorBounds),"vertexColor"in oe&&(this.vertexColor=oe.vertexColor?1:0),"colormap"in oe&&this._colorMap.setPixels(this.genColormap(oe.colormap,this.opacityscale));var J=oe.field||oe.coords&&oe.coords[2]||null,me=!1;if(J||(this._field[2].shape[0]||this._field[2].shape[2]?J=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):J=this._field[2].hi(0,0)),"field"in oe||"coords"in oe){var fe=(J.shape[0]+2)*(J.shape[1]+2);fe>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(fe))),this._field[2]=_(this._field[2].data,[J.shape[0]+2,J.shape[1]+2]),this.padField(this._field[2],J),this.shape=J.shape.slice();for(var Ce=this.shape,Be=0;Be<2;++Be)this._field[2].size>this._field[Be].data.length&&(h.freeFloat(this._field[Be].data),this._field[Be].data=h.mallocFloat(this._field[2].size)),this._field[Be]=_(this._field[Be].data,[Ce[0]+2,Ce[1]+2]);if(oe.coords){var Oe=oe.coords;if(!Array.isArray(Oe)||Oe.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Be=0;Be<2;++Be){var Ze=Oe[Be];for(gt=0;gt<2;++gt)if(Ze.shape[gt]!==Ce[gt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Be],Ze)}}else if(oe.ticks){var Ge=oe.ticks;if(!Array.isArray(Ge)||Ge.length!==2)throw new Error("gl-surface: invalid ticks");for(Be=0;Be<2;++Be){var rt=Ge[Be];if((Array.isArray(rt)||rt.length)&&(rt=_(rt)),rt.shape[0]!==Ce[Be])throw new Error("gl-surface: invalid tick length");var _t=_(rt.data,Ce);_t.stride[Be]=rt.stride[0],_t.stride[Be^1]=0,this.padField(this._field[Be],_t)}}else{for(Be=0;Be<2;++Be){var pt=[0,0];pt[Be]=1,this._field[Be]=_(this._field[Be].data,[Ce[0]+2,Ce[1]+2],pt,0)}this._field[0].set(0,0,0);for(var gt=0;gt0){for(var Gn=0;Gn<5;++Gn)Dr.pop();De-=1}continue e}}}cn.push(De)}this._contourOffsets[br]=un,this._contourCounts[br]=cn}var Xn=h.mallocFloat(Dr.length);for(Be=0;Be=0&&(M=E|0,I+=g*M,p-=M),new w(this.data,p,g,I)},D.step=function(E){var I=this.shape[0],M=this.stride[0],p=this.offset,g=0,C=Math.ceil;return typeof E=="number"&&(g=E|0,g<0?(p+=M*(I-1),I=C(-I/g)):I=C(I/g),M*=g),new w(this.data,I,M,p)},D.transpose=function(E){E=E===void 0?0:E|0;var I=this.shape,M=this.stride;return new w(this.data,I[E],M[E],this.offset)},D.pick=function(E){var I=[],M=[],p=this.offset;typeof E=="number"&&E>=0?p=p+this.stride[0]*E|0:(I.push(this.shape[0]),M.push(this.stride[0]));var g=f[I.length+1];return g(this.data,I,M,p)},function(E,I,M,p){return new w(E,I[0],M[0],p)}},2:function(A,f,k){function w(E,I,M,p,g,C){this.data=E,this.shape=[I,M],this.stride=[p,g],this.offset=C|0}var D=w.prototype;return D.dtype=A,D.dimension=2,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(D,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),D.set=function(E,I,M){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I,M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]=M},D.get=function(E,I){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]},D.index=function(E,I){return this.offset+this.stride[0]*E+this.stride[1]*I},D.hi=function(E,I){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,this.stride[0],this.stride[1],this.offset)},D.lo=function(E,I){var M=this.offset,p=0,g=this.shape[0],C=this.shape[1],T=this.stride[0],N=this.stride[1];return typeof E=="number"&&E>=0&&(p=E|0,M+=T*p,g-=p),typeof I=="number"&&I>=0&&(p=I|0,M+=N*p,C-=p),new w(this.data,g,C,T,N,M)},D.step=function(E,I){var M=this.shape[0],p=this.shape[1],g=this.stride[0],C=this.stride[1],T=this.offset,N=0,B=Math.ceil;return typeof E=="number"&&(N=E|0,N<0?(T+=g*(M-1),M=B(-M/N)):M=B(M/N),g*=N),typeof I=="number"&&(N=I|0,N<0?(T+=C*(p-1),p=B(-p/N)):p=B(p/N),C*=N),new w(this.data,M,p,g,C,T)},D.transpose=function(E,I){E=E===void 0?0:E|0,I=I===void 0?1:I|0;var M=this.shape,p=this.stride;return new w(this.data,M[E],M[I],p[E],p[I],this.offset)},D.pick=function(E,I){var M=[],p=[],g=this.offset;typeof E=="number"&&E>=0?g=g+this.stride[0]*E|0:(M.push(this.shape[0]),p.push(this.stride[0])),typeof I=="number"&&I>=0?g=g+this.stride[1]*I|0:(M.push(this.shape[1]),p.push(this.stride[1]));var C=f[M.length+1];return C(this.data,M,p,g)},function(E,I,M,p){return new w(E,I[0],I[1],M[0],M[1],p)}},3:function(A,f,k){function w(E,I,M,p,g,C,T,N){this.data=E,this.shape=[I,M,p],this.stride=[g,C,T],this.offset=N|0}var D=w.prototype;return D.dtype=A,D.dimension=3,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(D,"order",{get:function(){var E=Math.abs(this.stride[0]),I=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return E>I?I>M?[2,1,0]:E>M?[1,2,0]:[1,0,2]:E>M?[2,0,1]:M>I?[0,1,2]:[0,2,1]}}),D.set=function(E,I,M,p){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M,p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]=p},D.get=function(E,I,M){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]},D.index=function(E,I,M){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M},D.hi=function(E,I,M){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},D.lo=function(E,I,M){var p=this.offset,g=0,C=this.shape[0],T=this.shape[1],N=this.shape[2],B=this.stride[0],U=this.stride[1],V=this.stride[2];return typeof E=="number"&&E>=0&&(g=E|0,p+=B*g,C-=g),typeof I=="number"&&I>=0&&(g=I|0,p+=U*g,T-=g),typeof M=="number"&&M>=0&&(g=M|0,p+=V*g,N-=g),new w(this.data,C,T,N,B,U,V,p)},D.step=function(E,I,M){var p=this.shape[0],g=this.shape[1],C=this.shape[2],T=this.stride[0],N=this.stride[1],B=this.stride[2],U=this.offset,V=0,W=Math.ceil;return typeof E=="number"&&(V=E|0,V<0?(U+=T*(p-1),p=W(-p/V)):p=W(p/V),T*=V),typeof I=="number"&&(V=I|0,V<0?(U+=N*(g-1),g=W(-g/V)):g=W(g/V),N*=V),typeof M=="number"&&(V=M|0,V<0?(U+=B*(C-1),C=W(-C/V)):C=W(C/V),B*=V),new w(this.data,p,g,C,T,N,B,U)},D.transpose=function(E,I,M){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0;var p=this.shape,g=this.stride;return new w(this.data,p[E],p[I],p[M],g[E],g[I],g[M],this.offset)},D.pick=function(E,I,M){var p=[],g=[],C=this.offset;typeof E=="number"&&E>=0?C=C+this.stride[0]*E|0:(p.push(this.shape[0]),g.push(this.stride[0])),typeof I=="number"&&I>=0?C=C+this.stride[1]*I|0:(p.push(this.shape[1]),g.push(this.stride[1])),typeof M=="number"&&M>=0?C=C+this.stride[2]*M|0:(p.push(this.shape[2]),g.push(this.stride[2]));var T=f[p.length+1];return T(this.data,p,g,C)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],M[0],M[1],M[2],p)}},4:function(A,f,k){function w(E,I,M,p,g,C,T,N,B,U){this.data=E,this.shape=[I,M,p,g],this.stride=[C,T,N,B],this.offset=U|0}var D=w.prototype;return D.dtype=A,D.dimension=4,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p,g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]=g},D.get=function(E,I,M,p){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]},D.index=function(E,I,M,p){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p},D.hi=function(E,I,M,p){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},D.lo=function(E,I,M,p){var g=this.offset,C=0,T=this.shape[0],N=this.shape[1],B=this.shape[2],U=this.shape[3],V=this.stride[0],W=this.stride[1],F=this.stride[2],$=this.stride[3];return typeof E=="number"&&E>=0&&(C=E|0,g+=V*C,T-=C),typeof I=="number"&&I>=0&&(C=I|0,g+=W*C,N-=C),typeof M=="number"&&M>=0&&(C=M|0,g+=F*C,B-=C),typeof p=="number"&&p>=0&&(C=p|0,g+=$*C,U-=C),new w(this.data,T,N,B,U,V,W,F,$,g)},D.step=function(E,I,M,p){var g=this.shape[0],C=this.shape[1],T=this.shape[2],N=this.shape[3],B=this.stride[0],U=this.stride[1],V=this.stride[2],W=this.stride[3],F=this.offset,$=0,q=Math.ceil;return typeof E=="number"&&($=E|0,$<0?(F+=B*(g-1),g=q(-g/$)):g=q(g/$),B*=$),typeof I=="number"&&($=I|0,$<0?(F+=U*(C-1),C=q(-C/$)):C=q(C/$),U*=$),typeof M=="number"&&($=M|0,$<0?(F+=V*(T-1),T=q(-T/$)):T=q(T/$),V*=$),typeof p=="number"&&($=p|0,$<0?(F+=W*(N-1),N=q(-N/$)):N=q(N/$),W*=$),new w(this.data,g,C,T,N,B,U,V,W,F)},D.transpose=function(E,I,M,p){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0;var g=this.shape,C=this.stride;return new w(this.data,g[E],g[I],g[M],g[p],C[E],C[I],C[M],C[p],this.offset)},D.pick=function(E,I,M,p){var g=[],C=[],T=this.offset;typeof E=="number"&&E>=0?T=T+this.stride[0]*E|0:(g.push(this.shape[0]),C.push(this.stride[0])),typeof I=="number"&&I>=0?T=T+this.stride[1]*I|0:(g.push(this.shape[1]),C.push(this.stride[1])),typeof M=="number"&&M>=0?T=T+this.stride[2]*M|0:(g.push(this.shape[2]),C.push(this.stride[2])),typeof p=="number"&&p>=0?T=T+this.stride[3]*p|0:(g.push(this.shape[3]),C.push(this.stride[3]));var N=f[g.length+1];return N(this.data,g,C,T)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],M[0],M[1],M[2],M[3],p)}},5:function(A,f,k){function w(E,I,M,p,g,C,T,N,B,U,V,W){this.data=E,this.shape=[I,M,p,g,C],this.stride=[T,N,B,U,V],this.offset=W|0}var D=w.prototype;return D.dtype=A,D.dimension=5,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g,C){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g,C):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]=C},D.get=function(E,I,M,p,g){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]},D.index=function(E,I,M,p,g){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g},D.hi=function(E,I,M,p,g){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,typeof g!="number"||g<0?this.shape[4]:g|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},D.lo=function(E,I,M,p,g){var C=this.offset,T=0,N=this.shape[0],B=this.shape[1],U=this.shape[2],V=this.shape[3],W=this.shape[4],F=this.stride[0],$=this.stride[1],q=this.stride[2],G=this.stride[3],ee=this.stride[4];return typeof E=="number"&&E>=0&&(T=E|0,C+=F*T,N-=T),typeof I=="number"&&I>=0&&(T=I|0,C+=$*T,B-=T),typeof M=="number"&&M>=0&&(T=M|0,C+=q*T,U-=T),typeof p=="number"&&p>=0&&(T=p|0,C+=G*T,V-=T),typeof g=="number"&&g>=0&&(T=g|0,C+=ee*T,W-=T),new w(this.data,N,B,U,V,W,F,$,q,G,ee,C)},D.step=function(E,I,M,p,g){var C=this.shape[0],T=this.shape[1],N=this.shape[2],B=this.shape[3],U=this.shape[4],V=this.stride[0],W=this.stride[1],F=this.stride[2],$=this.stride[3],q=this.stride[4],G=this.offset,ee=0,he=Math.ceil;return typeof E=="number"&&(ee=E|0,ee<0?(G+=V*(C-1),C=he(-C/ee)):C=he(C/ee),V*=ee),typeof I=="number"&&(ee=I|0,ee<0?(G+=W*(T-1),T=he(-T/ee)):T=he(T/ee),W*=ee),typeof M=="number"&&(ee=M|0,ee<0?(G+=F*(N-1),N=he(-N/ee)):N=he(N/ee),F*=ee),typeof p=="number"&&(ee=p|0,ee<0?(G+=$*(B-1),B=he(-B/ee)):B=he(B/ee),$*=ee),typeof g=="number"&&(ee=g|0,ee<0?(G+=q*(U-1),U=he(-U/ee)):U=he(U/ee),q*=ee),new w(this.data,C,T,N,B,U,V,W,F,$,q,G)},D.transpose=function(E,I,M,p,g){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0,g=g===void 0?4:g|0;var C=this.shape,T=this.stride;return new w(this.data,C[E],C[I],C[M],C[p],C[g],T[E],T[I],T[M],T[p],T[g],this.offset)},D.pick=function(E,I,M,p,g){var C=[],T=[],N=this.offset;typeof E=="number"&&E>=0?N=N+this.stride[0]*E|0:(C.push(this.shape[0]),T.push(this.stride[0])),typeof I=="number"&&I>=0?N=N+this.stride[1]*I|0:(C.push(this.shape[1]),T.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(C.push(this.shape[2]),T.push(this.stride[2])),typeof p=="number"&&p>=0?N=N+this.stride[3]*p|0:(C.push(this.shape[3]),T.push(this.stride[3])),typeof g=="number"&&g>=0?N=N+this.stride[4]*g|0:(C.push(this.shape[4]),T.push(this.stride[4]));var B=f[C.length+1];return B(this.data,C,T,N)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],I[4],M[0],M[1],M[2],M[3],M[4],p)}}};function m(A,f){var k=f===-1?"T":String(f),w=h[k];return f===-1?w(A):f===0?w(A,x[A][0]):w(A,x[A],s)}function b(A){if(l(A))return"buffer";if(o)switch(Object.prototype.toString.call(A)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(A)?"array":"generic"}var x={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function _(A,f,k,w){if(A===void 0){var g=x.array[0];return g([])}else typeof A=="number"&&(A=[A]);f===void 0&&(f=[A.length]);var D=f.length;if(k===void 0){k=new Array(D);for(var E=D-1,I=1;E>=0;--E)k[E]=I,I*=f[E]}if(w===void 0){w=0;for(var E=0;E1e-6?(k[0]=D/p,k[1]=E/p,k[2]=I/p,k[3]=M/p):(k[0]=k[1]=k[2]=0,k[3]=1)}function _(k,w,D){this.radius=l([D]),this.center=l(w),this.rotation=l(k),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var A=_.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(k){this.radius.curve(k),this.center.curve(k),this.rotation.curve(k);var w=this.computedRotation;x(w,w);var D=this.computedMatrix;u(D,w);var E=this.computedCenter,I=this.computedEye,M=this.computedUp,p=Math.exp(this.computedRadius[0]);I[0]=E[0]+p*D[2],I[1]=E[1]+p*D[6],I[2]=E[2]+p*D[10],M[0]=D[1],M[1]=D[5],M[2]=D[9];for(var g=0;g<3;++g){for(var C=0,T=0;T<3;++T)C+=D[g+4*T]*I[T];D[12+g]=-C}},A.getMatrix=function(k,w){this.recalcMatrix(k);var D=this.computedMatrix;if(w){for(var E=0;E<16;++E)w[E]=D[E];return w}return D},A.idle=function(k){this.center.idle(k),this.radius.idle(k),this.rotation.idle(k)},A.flush=function(k){this.center.flush(k),this.radius.flush(k),this.rotation.flush(k)},A.pan=function(k,w,D,E){w=w||0,D=D||0,E=E||0,this.recalcMatrix(k);var I=this.computedMatrix,M=I[1],p=I[5],g=I[9],C=m(M,p,g);M/=C,p/=C,g/=C;var T=I[0],N=I[4],B=I[8],U=T*M+N*p+B*g;T-=M*U,N-=p*U,B-=g*U;var V=m(T,N,B);T/=V,N/=V,B/=V,I[2],I[6],I[10];var W=T*w+M*D,F=N*w+p*D,$=B*w+g*D;this.center.move(k,W,F,$);var q=Math.exp(this.computedRadius[0]);q=Math.max(1e-4,q+E),this.radius.set(k,Math.log(q))},A.rotate=function(k,w,D,E){this.recalcMatrix(k),w=w||0,D=D||0;var I=this.computedMatrix,M=I[0],p=I[4],g=I[8],C=I[1],T=I[5],N=I[9],B=I[2],U=I[6],V=I[10],W=w*M+D*C,F=w*p+D*T,$=w*g+D*N,q=-(U*$-V*F),G=-(V*W-B*$),ee=-(B*F-U*W),he=Math.sqrt(Math.max(0,1-Math.pow(q,2)-Math.pow(G,2)-Math.pow(ee,2))),xe=b(q,G,ee,he);xe>1e-6?(q/=xe,G/=xe,ee/=xe,he/=xe):(q=G=ee=0,he=1);var ve=this.computedRotation,ce=ve[0],re=ve[1],ge=ve[2],ne=ve[3],se=ce*he+ne*q+re*ee-ge*G,_e=re*he+ne*G+ge*q-ce*ee,oe=ge*he+ne*ee+ce*G-re*q,J=ne*he-ce*q-re*G-ge*ee;if(E){q=B,G=U,ee=V;var me=Math.sin(E)/m(q,G,ee);q*=me,G*=me,ee*=me,he=Math.cos(w),se=se*he+J*q+_e*ee-oe*G,_e=_e*he+J*G+oe*q-se*ee,oe=oe*he+J*ee+se*G-_e*q,J=J*he-se*q-_e*G-oe*ee}var fe=b(se,_e,oe,J);fe>1e-6?(se/=fe,_e/=fe,oe/=fe,J/=fe):(se=_e=oe=0,J=1),this.rotation.set(k,se,_e,oe,J)},A.lookAt=function(k,w,D,E){this.recalcMatrix(k),D=D||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var I=this.computedMatrix;o(I,w,D,E);var M=this.computedRotation;h(M,I[0],I[1],I[2],I[4],I[5],I[6],I[8],I[9],I[10]),x(M,M),this.rotation.set(k,M[0],M[1],M[2],M[3]);for(var p=0,g=0;g<3;++g)p+=Math.pow(D[g]-w[g],2);this.radius.set(k,.5*Math.log(Math.max(p,1e-6))),this.center.set(k,D[0],D[1],D[2])},A.translate=function(k,w,D,E){this.center.move(k,w||0,D||0,E||0)},A.setMatrix=function(k,w){var D=this.computedRotation;h(D,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),x(D,D),this.rotation.set(k,D[0],D[1],D[2],D[3]);var E=this.computedMatrix;s(E,w);var I=E[15];if(Math.abs(I)>1e-6){var M=E[12]/I,p=E[13]/I,g=E[14]/I;this.recalcMatrix(k);var C=Math.exp(this.computedRadius[0]);this.center.set(k,M-E[2]*C,p-E[6]*C,g-E[10]*C),this.radius.idle(k)}else this.center.idle(k),this.radius.idle(k)},A.setDistance=function(k,w){w>0&&this.radius.set(k,Math.log(w))},A.setDistanceLimits=function(k,w){k>0?k=Math.log(k):k=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=w},A.getDistanceLimits=function(k){var w=this.radius.bounds;return k?(k[0]=Math.exp(w[0][0]),k[1]=Math.exp(w[1][0]),k):[Math.exp(w[0][0]),Math.exp(w[1][0])]},A.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},A.fromJSON=function(k){var w=this.lastT(),D=k.center;D&&this.center.set(w,D[0],D[1],D[2]);var E=k.rotation;E&&this.rotation.set(w,E[0],E[1],E[2],E[3]);var I=k.distance;I&&I>0&&this.radius.set(w,Math.log(I)),this.setDistanceLimits(k.zoomMin,k.zoomMax)};function f(k){k=k||{};var w=k.center||[0,0,0],D=k.rotation||[0,0,0,1],E=k.radius||1;w=[].slice.call(w,0,3),D=[].slice.call(D,0,4),x(D,D);var I=new _(D,w,Math.log(E));return I.setDistanceLimits(k.zoomMin,k.zoomMax),("eye"in k||"up"in k)&&I.lookAt(0,k.eye,k.center,k.up),I}},9994:function(i,n,a){var l=a(9618),o=a(8277);i.exports=function(u,s){for(var h=[],m=u,b=1;Array.isArray(m);)h.push(m.length),b*=m.length,m=m[0];return h.length===0?l():(s||(s=l(new Float64Array(b),h)),o(s,u),s)}}},y={};function z(i){var n=y[i];if(n!==void 0)return n.exports;var a=y[i]={id:i,loaded:!1,exports:{}};return d[i].call(a.exports,a,a.exports,z),a.loaded=!0,a.exports}(function(){z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){z.nmd=function(i){return i.paths=[],i.children||(i.children=[]),i}}();var P=z(1964);Y.exports=P})()}),JI=Fe((te,Y)=>{Y.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),pY=Fe((te,Y)=>{var d=JI();Y.exports=z;var y={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function z(P){var i,n=[],a=1,l;if(typeof P=="string")if(P=P.toLowerCase(),d[P])n=d[P].slice(),l="rgb";else if(P==="transparent")a=0,l="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(P)){var o=P.slice(1),u=o.length,s=u<=4;a=1,s?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],u===4&&(a=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],u===8&&(a=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),l="rgb"}else if(i=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(P)){var h=i[1],m=h==="rgb",o=h.replace(/a$/,"");l=o;var u=o==="cmyk"?4:o==="gray"?1:3;n=i[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(_,A){if(/%$/.test(_))return A===u?parseFloat(_)/100:o==="rgb"?parseFloat(_)*255/100:parseFloat(_);if(o[A]==="h"){if(/deg$/.test(_))return parseFloat(_);if(y[_]!==void 0)return y[_]}return parseFloat(_)}),h===o&&n.push(1),a=m||n[u]===void 0?1:n[u],n=n.slice(0,u)}else P.length>10&&/[0-9](?:\s|\/)/.test(P)&&(n=P.match(/([0-9]+)/g).map(function(b){return parseFloat(b)}),l=P.match(/([a-z])/ig).join("").toLowerCase());else isNaN(P)?Array.isArray(P)||P.length?(n=[P[0],P[1],P[2]],l="rgb",a=P.length===4?P[3]:1):P instanceof Object&&(P.r!=null||P.red!=null||P.R!=null?(l="rgb",n=[P.r||P.red||P.R||0,P.g||P.green||P.G||0,P.b||P.blue||P.B||0]):(l="hsl",n=[P.h||P.hue||P.H||0,P.s||P.saturation||P.S||0,P.l||P.lightness||P.L||P.b||P.brightness]),a=P.a||P.alpha||P.opacity||1,P.opacity!=null&&(a/=100)):(l="rgb",n=[P>>>16,(P&65280)>>>8,P&255]);return{space:l,values:n,alpha:a}}}),mY=Fe((te,Y)=>{var d=pY();Y.exports=function(z){Array.isArray(z)&&z.raw&&(z=String.raw.apply(null,arguments));var P,i=d(z);if(!i.space)return[];var n=[0,0,0],a=i.space[0]==="h"?[360,100,100]:[255,255,255];return P=Array(3),P[0]=Math.min(Math.max(i.values[0],n[0]),a[0]),P[1]=Math.min(Math.max(i.values[1],n[1]),a[1]),P[2]=Math.min(Math.max(i.values[2],n[2]),a[2]),i.space[0]==="h"&&(P=y(P)),P.push(Math.min(Math.max(i.alpha,0),1)),P};function y(z){var P=z[0]/360,i=z[1]/100,n=z[2]/100,a,l,o,u,s,h=0;if(i===0)return s=n*255,[s,s,s];for(l=n<.5?n*(1+i):n+i-n*i,a=2*n-l,u=[0,0,0];h<3;)o=P+1/3*-(h-1),o<0?o++:o>1&&o--,s=6*o<1?a+(l-a)*6*o:2*o<1?l:3*o<2?a+(l-a)*(2/3-o)*6:a,u[h++]=s*255;return u}}),b6=Fe((te,Y)=>{Y.exports=d;function d(y,z,P){return zP?P:y:yz?z:y}}),FC=Fe((te,Y)=>{Y.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),F_=Fe((te,Y)=>{var d=mY(),y=b6(),z=FC();Y.exports=function(i,n){(n==="float"||!n)&&(n="array"),n==="uint"&&(n="uint8"),n==="uint_clamped"&&(n="uint8_clamped");var a=z(n),l=new a(4),o=n!=="uint8"&&n!=="uint8_clamped";return(!i.length||typeof i=="string")&&(i=d(i),i[0]/=255,i[1]/=255,i[2]/=255),P(i)?(l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3]!=null?i[3]:255,o&&(l[0]/=255,l[1]/=255,l[2]/=255,l[3]/=255),l):(o?(l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3]!=null?i[3]:1):(l[0]=y(Math.floor(i[0]*255),0,255),l[1]=y(Math.floor(i[1]*255),0,255),l[2]=y(Math.floor(i[2]*255),0,255),l[3]=i[3]==null?255:y(Math.floor(i[3]*255),0,255)),l)};function P(i){return!!(i instanceof Uint8Array||i instanceof Uint8ClampedArray||Array.isArray(i)&&(i[0]>1||i[0]===0)&&(i[1]>1||i[1]===0)&&(i[2]>1||i[2]===0)&&(!i[3]||i[3]>1))}}),sy=Fe((te,Y)=>{var d=F_();function y(z){return z?d(z):[0,0,0,1]}Y.exports=y}),ly=Fe((te,Y)=>{var d=Ar(),y=sn(),z=F_(),P=lh(),i=Mi().defaultLine,n=Di().isArrayOrTypedArray,a=z(i),l=1;function o(b,x){var _=b;return _[3]*=x,_}function u(b){if(d(b))return a;var x=z(b);return x.length?x:a}function s(b){return d(b)?b:l}function h(b,x,_){var A=b.color;A&&A._inputArray&&(A=A._inputArray);var f=n(A),k=n(x),w=P.extractOpts(b),D=[],E,I,M,p,g;if(w.colorscale!==void 0?E=P.makeColorScaleFuncFromTrace(b):E=u,f?I=function(T,N){return T[N]===void 0?a:z(E(T[N]))}:I=u,k?M=function(T,N){return T[N]===void 0?l:s(T[N])}:M=s,f||k)for(var C=0;C<_;C++)p=I(A,C),g=M(x,C),D[C]=o(p,g);else D=o(z(A),x);return D}function m(b){var x=P.extractOpts(b),_=x.colorscale;return x.reversescale&&(_=P.flipScale(x.colorscale)),_.map(function(A){var f=A[0],k=y(A[1]),w=k.toRgb();return{index:f,rgb:[w.r,w.g,w.b,w.a]}})}Y.exports={formatColor:h,parseColorScale:m}}),QI=Fe((te,Y)=>{Y.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),NC=Fe((te,Y)=>{Y.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),gY=Fe((te,Y)=>{var d=as();function y(i,n,a,l){if(!n||!n.visible)return null;for(var o=d.getComponentMethod("errorbars","makeComputeError")(n),u=new Array(i.length),s=0;s0){var _=l.c2l(b);l._lowerLogErrorBound||(l._lowerLogErrorBound=_),l._lowerErrorBound=Math.min(l._lowerLogErrorBound,_)}}else u[s]=[-h[0]*a,h[1]*a]}return u}function z(i){for(var n=0;n{var d=$p().gl_line3d,y=$p().gl_scatter3d,z=$p().gl_error3d,P=$p().gl_mesh3d,i=$p().delaunay_triangulate,n=ji(),a=sy(),l=ly().formatColor,o=Hv(),u=QI(),s=NC(),h=Os(),m=T0().appendArrayPointValue,b=gY();function x(N,B){this.scene=N,this.uid=B,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var _=x.prototype;_.handlePick=function(N){if(N.object&&(N.object===this.linePlot||N.object===this.delaunayMesh||N.object===this.textMarkers||N.object===this.scatterPlot)){var B=N.index=N.data.index;return N.object.highlight&&N.object.highlight(null),this.scatterPlot&&(N.object=this.scatterPlot,this.scatterPlot.highlight(N.data)),N.textLabel="",this.textLabels&&(n.isArrayOrTypedArray(this.textLabels)?(this.textLabels[B]||this.textLabels[B]===0)&&(N.textLabel=this.textLabels[B]):N.textLabel=this.textLabels),N.traceCoordinate=[this.data.x[B],this.data.y[B],this.data.z[B]],!0}};function A(N,B,U){var V=(U+1)%3,W=(U+2)%3,F=[],$=[],q;for(q=0;q-1?-1:N.indexOf("right")>-1?1:0}function w(N){return N==null?0:N.indexOf("top")>-1?-1:N.indexOf("bottom")>-1?1:0}function D(N){var B=0,U=0,V=[B,U];if(Array.isArray(N))for(var W=0;W=0){var ee=A(q.position,q.delaunayColor,q.delaunayAxis);ee.opacity=N.opacity,this.delaunayMesh?this.delaunayMesh.update(ee):(ee.gl=B,this.delaunayMesh=P(ee),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},_.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function T(N,B){var U=new x(N,B.uid);return U.update(B),U}Y.exports=T}),eD=Fe((te,Y)=>{var d=ff(),y=zn(),z=zc(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=_a(),o=QI(),u=NC(),s=an().extendFlat,h=oh().overrideAll,m=Ym(),b=d.line,x=d.marker,_=x.line,A=s({width:b.width,dash:{valType:"enumerated",values:m(o),dflt:"solid"}},z("line"));function f(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var k=Y.exports=h({x:d.x,y:d.y,z:{valType:"data_array"},text:s({},d.text,{}),texttemplate:n(),texttemplatefallback:a({editType:"calc"}),hovertext:s({},d.hovertext,{}),hovertemplate:i(),hovertemplatefallback:a(),xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z"),mode:s({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:f(),y:f(),z:f()},connectgaps:d.connectgaps,line:A,marker:s({symbol:{valType:"enumerated",values:m(u),dflt:"circle",arrayOk:!0},size:s({},x.size,{dflt:8}),sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode,opacity:s({},x.opacity,{arrayOk:!1}),colorbar:x.colorbar,line:s({width:s({},_.width,{arrayOk:!1})},z("marker.line"))},z("marker")),textposition:s({},d.textposition,{dflt:"top center"}),textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:s({},l.hoverinfo)},"calc","nested");k.x.editType=k.y.editType=k.z.editType="calc+clearAxisTypes"}),yY=Fe((te,Y)=>{var d=as(),y=ji(),z=Oc(),P=X0(),i=Pm(),n=mm(),a=eD();Y.exports=function(o,u,s,h){function m(D,E){return y.coerce(o,u,a,D,E)}var b=l(o,u,m,h);if(!b){u.visible=!1;return}m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("xhoverformat"),m("yhoverformat"),m("zhoverformat"),m("mode"),z.hasMarkers(u)&&P(o,u,s,h,m,{noSelect:!0,noAngle:!0}),z.hasLines(u)&&(m("connectgaps"),i(o,u,s,h,m)),z.hasText(u)&&(m("texttemplate"),m("texttemplatefallback"),n(o,u,h,m,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var x=(u.line||{}).color,_=(u.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",x||_);for(var A=["x","y","z"],f=0;f<3;++f){var k="projection."+A[f];m(k+".show")&&(m(k+".opacity"),m(k+".scale"))}var w=d.getComponentMethod("errorbars","supplyDefaults");w(o,u,x||_||s,{axis:"z"}),w(o,u,x||_||s,{axis:"y",inherit:"z"}),w(o,u,x||_||s,{axis:"x",inherit:"z"})};function l(o,u,s,h){var m=0,b=s("x"),x=s("y"),_=s("z"),A=d.getComponentMethod("calendars","handleTraceDefaults");return A(o,u,["x","y","z"],h),b&&x&&_&&(m=Math.min(b.length,x.length,_.length),u._length=u._xlength=u._ylength=u._zlength=m),m}}),_Y=Fe((te,Y)=>{var d=de(),y=zm();Y.exports=function(z,P){var i=[{x:!1,y:!1,trace:P,t:{}}];return d(i,P),y(z,P),i}}),xY=Fe((te,Y)=>{Y.exports=d;function d(y,z){if(typeof y!="string")throw new TypeError("must specify type string");if(z=z||{},typeof document>"u"&&!z.canvas)return null;var P=z.canvas||document.createElement("canvas");typeof z.width=="number"&&(P.width=z.width),typeof z.height=="number"&&(P.height=z.height);var i=z,n;try{var a=[y];y.indexOf("webgl")===0&&a.push("experimental-"+y);for(var l=0;l{var d=xY();Y.exports=function(y){return d("webgl",y)}}),tD=Fe((te,Y)=>{var d=Xi(),y=function(){};Y.exports=function(z){for(var P in z)typeof z[P]=="function"&&(z[P]=y);z.destroy=function(){z.container.parentNode.removeChild(z.container)};var i=document.createElement("div");i.className="no-webgl",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=d.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=d.lightLine,i.style["z-index"]=30;var n=document.createElement("p");return n.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",n.style.position="relative",n.style.top="50%",n.style.left="50%",n.style.height="30%",n.style.width="50%",n.style.margin="-15% 0 0 -25%",i.appendChild(n),z.container.appendChild(i),z.container.style.background="#FFFFFF",z.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),wY=Fe((te,Y)=>{var d=sy(),y=ji(),z=["xaxis","yaxis","zaxis"];function P(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var i=P.prototype;i.merge=function(a,l){for(var o=this,u=0;u<3;++u){var s=l[z[u]];if(!s.visible){o.tickEnable[u]=!1,o.labelEnable[u]=!1,o.lineEnable[u]=!1,o.lineTickEnable[u]=!1,o.gridEnable[u]=!1,o.zeroEnable[u]=!1,o.backgroundEnable[u]=!1;continue}o.labels[u]=a._meta?y.templateString(s.title.text,a._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(o.labelColor[u]=d(s.title.font.color)),s.title.font.family&&(o.labelFont[u]=s.title.font.family),s.title.font.size&&(o.labelSize[u]=s.title.font.size),s.title.font.weight&&(o.labelFontWeight[u]=s.title.font.weight),s.title.font.style&&(o.labelFontStyle[u]=s.title.font.style),s.title.font.variant&&(o.labelFontVariant[u]=s.title.font.variant)),"showline"in s&&(o.lineEnable[u]=s.showline),"linecolor"in s&&(o.lineColor[u]=d(s.linecolor)),"linewidth"in s&&(o.lineWidth[u]=s.linewidth),"showgrid"in s&&(o.gridEnable[u]=s.showgrid),"gridcolor"in s&&(o.gridColor[u]=d(s.gridcolor)),"gridwidth"in s&&(o.gridWidth[u]=s.gridwidth),s.type==="log"?o.zeroEnable[u]=!1:"zeroline"in s&&(o.zeroEnable[u]=s.zeroline),"zerolinecolor"in s&&(o.zeroLineColor[u]=d(s.zerolinecolor)),"zerolinewidth"in s&&(o.zeroLineWidth[u]=s.zerolinewidth),"ticks"in s&&s.ticks?o.lineTickEnable[u]=!0:o.lineTickEnable[u]=!1,"ticklen"in s&&(o.lineTickLength[u]=o._defaultLineTickLength[u]=s.ticklen),"tickcolor"in s&&(o.lineTickColor[u]=d(s.tickcolor)),"tickwidth"in s&&(o.lineTickWidth[u]=s.tickwidth),"tickangle"in s&&(o.tickAngle[u]=s.tickangle==="auto"?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(o.tickEnable[u]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(o.tickColor[u]=d(s.tickfont.color)),s.tickfont.family&&(o.tickFont[u]=s.tickfont.family),s.tickfont.size&&(o.tickSize[u]=s.tickfont.size),s.tickfont.weight&&(o.tickFontWeight[u]=s.tickfont.weight),s.tickfont.style&&(o.tickFontStyle[u]=s.tickfont.style),s.tickfont.variant&&(o.tickFontVariant[u]=s.tickfont.variant)),"mirror"in s?["ticks","all","allticks"].indexOf(s.mirror)!==-1?(o.lineTickMirror[u]=!0,o.lineMirror[u]=!0):s.mirror===!0?(o.lineTickMirror[u]=!1,o.lineMirror[u]=!0):(o.lineTickMirror[u]=!1,o.lineMirror[u]=!1):o.lineMirror[u]=!1,"showbackground"in s&&s.showbackground!==!1?(o.backgroundEnable[u]=!0,o.backgroundColor[u]=d(s.backgroundcolor)):o.backgroundEnable[u]=!1}};function n(a,l){var o=new P;return o.merge(a,l),o}Y.exports=n}),kY=Fe((te,Y)=>{var d=sy(),y=["xaxis","yaxis","zaxis"];function z(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var P=z.prototype;P.merge=function(n){for(var a=0;a<3;++a){var l=n[y[a]];if(!l.visible){this.enabled[a]=!1,this.drawSides[a]=!1;continue}this.enabled[a]=l.showspikes,this.colors[a]=d(l.spikecolor),this.drawSides[a]=l.spikesides,this.lineWidth[a]=l.spikethickness}};function i(n){var a=new z;return a.merge(n),a}Y.exports=i}),TY=Fe((te,Y)=>{Y.exports=i;var d=Os(),y=ji(),z=["xaxis","yaxis","zaxis"];function P(n){for(var a=new Array(3),l=0;l<3;++l){for(var o=n[l],u=new Array(o.length),s=0;s/g," "));u[s]=x,h.tickmode=m}}a.ticks=u;for(var s=0;s<3;++s){.5*(n.glplot.bounds[0][s]+n.glplot.bounds[1][s]);for(var _=0;_<2;++_)a.bounds[_][s]=n.glplot.bounds[_][s]}n.contourLevels=P(u)}}),SY=Fe((te,Y)=>{var d=$p().gl_plot3d,y=d.createCamera,z=d.createScene,P=bY(),i=sw(),n=as(),a=ji(),l=a.preserveDrawingBuffer(),o=Os(),u=hf(),s=sy(),h=tD(),m=yL(),b=wY(),x=kY(),_=TY(),A=Xm().applyAutorangeOptions,f,k,w=!1;function D(U,V){var W=document.createElement("div"),F=U.container;this.graphDiv=U.graphDiv;var $=document.createElementNS("http://www.w3.org/2000/svg","svg");$.style.position="absolute",$.style.top=$.style.left="0px",$.style.width=$.style.height="100%",$.style["z-index"]=20,$.style["pointer-events"]="none",W.appendChild($),this.svgContainer=$,W.id=U.id,W.style.position="absolute",W.style.top=W.style.left="0px",W.style.width=W.style.height="100%",F.appendChild(W),this.fullLayout=V,this.id=U.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=b(V,V[this.id]),this.spikeOptions=x(V[this.id]),this.container=W,this.staticMode=!!U.staticPlot,this.pixelRatio=this.pixelRatio||U.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=n.getComponentMethod("annotations3d","convert"),this.drawAnnotations=n.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=D.prototype;E.prepareOptions=function(){var U=this,V={canvas:U.canvas,gl:U.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:U.container,axes:U.axesOptions,spikes:U.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:U.camera,pixelRatio:U.pixelRatio};if(U.staticMode){if(!k&&(f=document.createElement("canvas"),k=P({canvas:f,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!k))throw new Error("error creating static canvas/context for image server");V.gl=k,V.canvas=f}return V};var I=!0;E.tryCreatePlot=function(){var U=this,V=U.prepareOptions(),W=!0;try{U.glplot=z(V)}catch{if(U.staticMode||!I||l)W=!1;else{a.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{l=V.glOptions.preserveDrawingBuffer=!0,U.glplot=z(V)}catch{l=V.glOptions.preserveDrawingBuffer=!1,W=!1}}}return I=!1,W},E.initializeGLCamera=function(){var U=this,V=U.fullSceneLayout.camera,W=V.projection.type==="orthographic";U.camera=y(U.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:W,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var U=this;U.initializeGLCamera();var V=U.tryCreatePlot();if(!V)return h(U);U.traces={},U.make4thDimension();var W=U.graphDiv,F=W.layout,$=function(){var G={};return U.isCameraChanged(F)&&(G[U.id+".camera"]=U.getCamera()),U.isAspectChanged(F)&&(G[U.id+".aspectratio"]=U.glplot.getAspectratio(),F[U.id].aspectmode!=="manual"&&(U.fullSceneLayout.aspectmode=F[U.id].aspectmode=G[U.id+".aspectmode"]="manual")),G},q=function(G){if(G.fullSceneLayout.dragmode!==!1){var ee=$();G.saveLayout(F),G.graphDiv.emit("plotly_relayout",ee)}};return U.glplot.canvas&&(U.glplot.canvas.addEventListener("mouseup",function(){q(U)}),U.glplot.canvas.addEventListener("touchstart",function(){w=!0}),U.glplot.canvas.addEventListener("wheel",function(G){if(W._context._scrollZoom.gl3d){if(U.camera._ortho){var ee=G.deltaX>G.deltaY?1.1:.9090909090909091,he=U.glplot.getAspectratio();U.glplot.setAspectratio({x:ee*he.x,y:ee*he.y,z:ee*he.z})}q(U)}},i?{passive:!1}:!1),U.glplot.canvas.addEventListener("mousemove",function(){if(U.fullSceneLayout.dragmode!==!1&&U.camera.mouseListener.buttons!==0){var G=$();U.graphDiv.emit("plotly_relayouting",G)}}),U.staticMode||U.glplot.canvas.addEventListener("webglcontextlost",function(G){W&&W.emit&&W.emit("plotly_webglcontextlost",{event:G,layer:U.id})},!1)),U.glplot.oncontextloss=function(){U.recoverContext()},U.glplot.onrender=function(){U.render()},!0},E.render=function(){var U=this,V=U.graphDiv,W,F=U.svgContainer,$=U.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var q=V._fullLayout._invScaleX,G=V._fullLayout._invScaleY,ee=$.width*q,he=$.height*G;F.setAttributeNS(null,"viewBox","0 0 "+ee+" "+he),F.setAttributeNS(null,"width",ee),F.setAttributeNS(null,"height",he),_(U),U.glplot.axes.update(U.axesOptions);for(var xe=Object.keys(U.traces),ve=null,ce=U.glplot.selection,re=0;re")):W.type==="isosurface"||W.type==="volume"?(oe.valueLabel=o.hoverLabelText(U._mockAxis,U._mockAxis.d2l(ce.traceCoordinate[3]),W.valuehoverformat),Be.push("value: "+oe.valueLabel),ce.textLabel&&Be.push(ce.textLabel),Ce=Be.join("
")):Ce=ce.textLabel;var Oe={x:ce.traceCoordinate[0],y:ce.traceCoordinate[1],z:ce.traceCoordinate[2],data:se._input,fullData:se,curveNumber:se.index,pointNumber:_e};u.appendArrayPointValue(Oe,se,_e),W._module.eventData&&(Oe=se._module.eventData(Oe,ce,se,{},_e));var Ze={points:[Oe]};if(U.fullSceneLayout.hovermode){var Ge=[];u.loneHover({trace:se,x:(.5+.5*ne[0]/ne[3])*ee,y:(.5-.5*ne[1]/ne[3])*he,xLabel:oe.xLabel,yLabel:oe.yLabel,zLabel:oe.zLabel,text:Ce,name:ve.name,color:u.castHoverOption(se,_e,"bgcolor")||ve.color,borderColor:u.castHoverOption(se,_e,"bordercolor"),fontFamily:u.castHoverOption(se,_e,"font.family"),fontSize:u.castHoverOption(se,_e,"font.size"),fontColor:u.castHoverOption(se,_e,"font.color"),nameLength:u.castHoverOption(se,_e,"namelength"),textAlign:u.castHoverOption(se,_e,"align"),hovertemplate:a.castOption(se,_e,"hovertemplate"),hovertemplateLabels:a.extendFlat({},Oe,oe),eventData:[Oe]},{container:F,gd:V,inOut_bbox:Ge}),Oe.bbox=Ge[0]}ce.distance<5&&(ce.buttons||w)?V.emit("plotly_click",Ze):V.emit("plotly_hover",Ze),this.oldEventData=Ze}else u.loneUnhover(F),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;U.drawAnnotations(U)},E.recoverContext=function(){var U=this;U.glplot.dispose();var V=function(){if(U.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!U.initializeGLPlot()){a.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}U.plot.apply(U,U.plotArgs)};requestAnimationFrame(V)};var M=["xaxis","yaxis","zaxis"];function p(U,V,W){for(var F=U.fullSceneLayout,$=0;$<3;$++){var q=M[$],G=q.charAt(0),ee=F[q],he=V[G],xe=V[G+"calendar"],ve=V["_"+G+"length"];if(!a.isArrayOrTypedArray(he))W[0][$]=Math.min(W[0][$],0),W[1][$]=Math.max(W[1][$],ve-1);else for(var ce,re=0;re<(ve||he.length);re++)if(a.isArrayOrTypedArray(he[re]))for(var ge=0;gese[1][G])se[0][G]=-1,se[1][G]=1;else{var _t=se[1][G]-se[0][G];se[0][G]-=_t/32,se[1][G]+=_t/32}if(J=[se[0][G],se[1][G]],J=A(J,he),se[0][G]=J[0],se[1][G]=J[1],he.isReversed()){var pt=se[0][G];se[0][G]=se[1][G],se[1][G]=pt}}else J=he.range,se[0][G]=he.r2l(J[0]),se[1][G]=he.r2l(J[1]);se[0][G]===se[1][G]&&(se[0][G]-=1,se[1][G]+=1),_e[G]=se[1][G]-se[0][G],he.range=[se[0][G],se[1][G]],he.limitRange(),F.glplot.setBounds(G,{min:he.range[0]*ge[G],max:he.range[1]*ge[G]})}var gt,ct=ve.aspectmode;if(ct==="cube")gt=[1,1,1];else if(ct==="manual"){var Ae=ve.aspectratio;gt=[Ae.x,Ae.y,Ae.z]}else if(ct==="auto"||ct==="data"){var ze=[1,1,1];for(G=0;G<3;++G){he=ve[M[G]],xe=he.type;var Ee=oe[xe];ze[G]=Math.pow(Ee.acc,1/Ee.count)/ge[G]}ct==="data"||Math.max.apply(null,ze)/Math.min.apply(null,ze)<=4?gt=ze:gt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");ve.aspectratio.x=ce.aspectratio.x=gt[0],ve.aspectratio.y=ce.aspectratio.y=gt[1],ve.aspectratio.z=ce.aspectratio.z=gt[2],F.glplot.setAspectratio(ve.aspectratio),F.viewInitial.aspectratio||(F.viewInitial.aspectratio={x:ve.aspectratio.x,y:ve.aspectratio.y,z:ve.aspectratio.z}),F.viewInitial.aspectmode||(F.viewInitial.aspectmode=ve.aspectmode);var nt=ve.domain||null,xt=V._size||null;if(nt&&xt){var ut=F.container.style;ut.position="absolute",ut.left=xt.l+nt.x[0]*xt.w+"px",ut.top=xt.t+(1-nt.y[1])*xt.h+"px",ut.width=xt.w*(nt.x[1]-nt.x[0])+"px",ut.height=xt.h*(nt.y[1]-nt.y[0])+"px"}F.glplot.redraw()}},E.destroy=function(){var U=this;U.glplot&&(U.camera.mouseListener.enabled=!1,U.container.removeEventListener("wheel",U.camera.wheelListener),U.camera=null,U.glplot.dispose(),U.container.parentNode.removeChild(U.container),U.glplot=null)};function C(U){return[[U.eye.x,U.eye.y,U.eye.z],[U.center.x,U.center.y,U.center.z],[U.up.x,U.up.y,U.up.z]]}function T(U){return{up:{x:U.up[0],y:U.up[1],z:U.up[2]},center:{x:U.center[0],y:U.center[1],z:U.center[2]},eye:{x:U.eye[0],y:U.eye[1],z:U.eye[2]},projection:{type:U._ortho===!0?"orthographic":"perspective"}}}E.getCamera=function(){var U=this;return U.camera.view.recalcMatrix(U.camera.view.lastT()),T(U.camera)},E.setViewport=function(U){var V=this,W=U.camera;V.camera.lookAt.apply(this,C(W)),V.glplot.setAspectratio(U.aspectratio);var F=W.projection.type==="orthographic",$=V.camera._ortho;F!==$&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},E.isCameraChanged=function(U){var V=this,W=V.getCamera(),F=a.nestedProperty(U,V.id+".camera"),$=F.get();function q(xe,ve,ce,re){var ge=["up","center","eye"],ne=["x","y","z"];return ve[ge[ce]]&&xe[ge[ce]][ne[re]]===ve[ge[ce]][ne[re]]}var G=!1;if($===void 0)G=!0;else{for(var ee=0;ee<3;ee++)for(var he=0;he<3;he++)if(!q(W,$,ee,he)){G=!0;break}(!$.projection||W.projection&&W.projection.type!==$.projection.type)&&(G=!0)}return G},E.isAspectChanged=function(U){var V=this,W=V.glplot.getAspectratio(),F=a.nestedProperty(U,V.id+".aspectratio"),$=F.get();return $===void 0||$.x!==W.x||$.y!==W.y||$.z!==W.z},E.saveLayout=function(U){var V=this,W=V.fullLayout,F,$,q,G,ee,he,xe=V.isCameraChanged(U),ve=V.isAspectChanged(U),ce=xe||ve;if(ce){var re={};if(xe&&(F=V.getCamera(),$=a.nestedProperty(U,V.id+".camera"),q=$.get(),re[V.id+".camera"]=q),ve&&(G=V.glplot.getAspectratio(),ee=a.nestedProperty(U,V.id+".aspectratio"),he=ee.get(),re[V.id+".aspectratio"]=he),n.call("_storeDirectGUIEdit",U,W._preGUI,re),xe){$.set(F);var ge=a.nestedProperty(W,V.id+".camera");ge.set(F)}if(ve){ee.set(G);var ne=a.nestedProperty(W,V.id+".aspectratio");ne.set(G),V.glplot.redraw()}}return ce},E.updateFx=function(U,V){var W=this,F=W.camera;if(F)if(U==="orbit")F.mode="orbit",F.keyBindingMode="rotate";else if(U==="turntable"){F.up=[0,0,1],F.mode="turntable",F.keyBindingMode="rotate";var $=W.graphDiv,q=$._fullLayout,G=W.fullSceneLayout.camera,ee=G.up.x,he=G.up.y,xe=G.up.z;if(xe/Math.sqrt(ee*ee+he*he+xe*xe)<.999){var ve=W.id+".camera.up",ce={x:0,y:0,z:1},re={};re[ve]=ce;var ge=$.layout;n.call("_storeDirectGUIEdit",ge,q._preGUI,re),G.up=ce,a.nestedProperty(ge,ve).set(ce)}}else F.keyBindingMode=U;W.fullSceneLayout.hovermode=V};function N(U,V,W){for(var F=0,$=W-1;F<$;++F,--$)for(var q=0;q0)for(var ee=255/G,he=0;he<3;++he)U[q+he]=Math.min(ee*U[q+he],255)}}E.toImage=function(U){var V=this;U||(U="png"),V.staticMode&&V.container.appendChild(f),V.glplot.redraw();var W=V.glplot.gl,F=W.drawingBufferWidth,$=W.drawingBufferHeight;W.bindFramebuffer(W.FRAMEBUFFER,null);var q=new Uint8Array(F*$*4);W.readPixels(0,0,F,$,W.RGBA,W.UNSIGNED_BYTE,q),N(q,F,$),B(q,F,$);var G=document.createElement("canvas");G.width=F,G.height=$;var ee=G.getContext("2d",{willReadFrequently:!0}),he=ee.createImageData(F,$);he.data.set(q),ee.putImageData(he,0,0);var xe;switch(U){case"jpeg":xe=G.toDataURL("image/jpeg");break;case"webp":xe=G.toDataURL("image/webp");break;default:xe=G.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(f),xe},E.setConvert=function(){for(var U=this,V=0;V<3;V++){var W=U.fullSceneLayout[M[V]];o.setConvert(W,U.fullLayout),W.setScale=a.noop}},E.make4thDimension=function(){var U=this,V=U.graphDiv,W=V._fullLayout;U._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(U._mockAxis,W)},Y.exports=D}),CY=Fe((te,Y)=>{Y.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),rD=Fe((te,Y)=>{var d=Xi(),y=qd(),z=an().extendFlat,P=oh().overrideAll;Y.exports=P({visible:y.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:y.color,categoryorder:y.categoryorder,categoryarray:y.categoryarray,title:{text:y.title.text,font:y.title.font},type:z({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorange:y.autorange,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},rangemode:y.rangemode,minallowed:y.minallowed,maxallowed:y.maxallowed,range:z({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,mirror:y.mirror,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,tickfont:y.tickfont,tickangle:y.tickangle,tickprefix:y.tickprefix,showtickprefix:y.showtickprefix,ticksuffix:y.ticksuffix,showticksuffix:y.showticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickformat:y.tickformat,tickformatstops:y.tickformatstops,hoverformat:y.hoverformat,showline:y.showline,linecolor:y.linecolor,linewidth:y.linewidth,showgrid:y.showgrid,gridcolor:z({},y.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:y.gridwidth,zeroline:y.zeroline,zerolinecolor:y.zerolinecolor,zerolinewidth:y.zerolinewidth},"plot","from-root")}),iD=Fe((te,Y)=>{var d=rD(),y=Xh().attributes,z=an().extendFlat,P=ji().counterRegex;function i(n,a,l){return{x:{valType:"number",dflt:n,editType:"camera"},y:{valType:"number",dflt:a,editType:"camera"},z:{valType:"number",dflt:l,editType:"camera"},editType:"camera"}}Y.exports={_arrayAttrRegexps:[P("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:z(i(0,0,1),{}),center:z(i(0,0,0),{}),eye:z(i(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:y({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:d,yaxis:d,zaxis:d,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),AY=Fe((te,Y)=>{var d=sn().mix,y=ji(),z=ku(),P=rD(),i=s0(),n=fb(),a=["xaxis","yaxis","zaxis"],l=13600/187;Y.exports=function(o,u,s){var h,m;function b(A,f){return y.coerce(h,m,P,A,f)}for(var x=0;x{var d=ji(),y=Xi(),z=as(),P=L_(),i=AY(),n=iD(),a=Md().getSubplotData,l="gl3d";Y.exports=function(u,s,h){var m=s._basePlotModules.length>1;function b(x){if(!m){var _=d.validate(u[x],n[x]);if(_)return u[x]}}P(u,s,h,{type:l,attributes:n,handleDefaults:o,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:b,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function o(u,s,h,m){for(var b=h("bgcolor"),x=y.combine(b,m.paper_bgcolor),_=["up","center","eye"],A=0;A<_.length;A++)h("camera."+_[A]+".x"),h("camera."+_[A]+".y"),h("camera."+_[A]+".z");h("camera.projection.type");var f=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),k=f?"manual":"auto",w=h("aspectmode",k);f||(u.aspectratio=s.aspectratio={x:1,y:1,z:1},w==="manual"&&(s.aspectmode="auto"),u.aspectmode=s.aspectmode);var D=a(m.fullData,l,m.id);i(u,s,{font:m.font,scene:m.id,data:D,bgColor:x,calendar:m.calendar,autotypenumbersDflt:m.autotypenumbersDflt,fullLayout:m.fullLayout}),z.getComponentMethod("annotations3d","handleDefaults")(u,s,m);var E=m.getDfltFromLayout("dragmode");if(E!==!1&&!E)if(E="orbit",u.camera&&u.camera.up){var I=u.camera.up.x,M=u.camera.up.y,p=u.camera.up.z;p!==0&&(!I||!M||!p||p/Math.sqrt(I*I+M*M+p*p)>.999)&&(E="turntable")}else E="turntable";h("dragmode",E),h("hovermode",m.getDfltFromLayout("hovermode"))}}),N_=Fe(te=>{var Y=oh().overrideAll,d=Ya(),y=SY(),z=Md().getSubplotData,P=ji(),i=k0(),n="gl3d",a="scene";te.name=n,te.attr=a,te.idRoot=a,te.idRegex=te.attrRegex=P.counterRegex("scene"),te.attributes=CY(),te.layoutAttributes=iD(),te.baseLayoutAttrOverrides=Y({hoverlabel:d.hoverlabel},"plot","nested"),te.supplyLayoutDefaults=MY(),te.plot=function(l){for(var o=l._fullLayout,u=l._fullData,s=o._subplots[n],h=0;h{Y.exports={plot:vY(),attributes:eD(),markerSymbols:NC(),supplyDefaults:yY(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:_Y(),moduleType:"trace",name:"scatter3d",basePlotModule:N_(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),LY=Fe((te,Y)=>{Y.exports=EY()}),w6=Fe((te,Y)=>{var d=Xi(),y=zc(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=_a(),a=an().extendFlat,l=oh().overrideAll;function o(h){return{valType:"boolean",dflt:!1}}function u(h){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:o(),y:o(),z:o()},color:{valType:"color",dflt:d.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:d.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var s=Y.exports=l(a({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:P(),hovertemplatefallback:i(),xhoverformat:z("x"),yhoverformat:z("y"),zhoverformat:z("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},y("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:a({},n.hoverinfo),showlegend:a({},n.showlegend,{dflt:!1})}),"calc","nested");s.x.editType=s.y.editType=s.z.editType="calc+clearAxisTypes"}),nD=Fe((te,Y)=>{var d=as(),y=ji(),z=Cc(),P=w6(),i=.1;function n(u,s){for(var h=[],m=32,b=0;b{var d=kp();Y.exports=function(y,z){z.surfacecolor?d(y,z,{vals:z.surfacecolor,containerStr:"",cLetter:"c"}):d(y,z,{vals:z.z,containerStr:"",cLetter:"c"})}}),IY=Fe((te,Y)=>{var d=$p().gl_surface3d,y=$p().ndarray,z=$p().ndarray_linear_interpolate.d2,P=O8(),i=B8(),n=ji().isArrayOrTypedArray,a=ly().parseColorScale,l=sy(),o=lh().extractOpts;function u(C,T,N){this.scene=C,this.uid=N,this.surface=T,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var s=u.prototype;s.getXat=function(C,T,N,B){var U=n(this.data.x)?n(this.data.x[0])?this.data.x[T][C]:this.data.x[C]:C;return N===void 0?U:B.d2l(U,0,N)},s.getYat=function(C,T,N,B){var U=n(this.data.y)?n(this.data.y[0])?this.data.y[T][C]:this.data.y[T]:T;return N===void 0?U:B.d2l(U,0,N)},s.getZat=function(C,T,N,B){var U=this.data.z[T][C];return U===null&&this.data.connectgaps&&this.data._interpolatedZ&&(U=this.data._interpolatedZ[T][C]),N===void 0?U:B.d2l(U,0,N)},s.handlePick=function(C){if(C.object===this.surface){var T=(C.data.index[0]-1)/this.dataScaleX-1,N=(C.data.index[1]-1)/this.dataScaleY-1,B=Math.max(Math.min(Math.round(T),this.data.z[0].length-1),0),U=Math.max(Math.min(Math.round(N),this.data._ylength-1),0);C.index=[B,U],C.traceCoordinate=[this.getXat(B,U),this.getYat(B,U),this.getZat(B,U)],C.dataCoordinate=[this.getXat(B,U,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(B,U,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(B,U,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var V=0;V<3;V++){var W=C.dataCoordinate[V];W!=null&&(C.dataCoordinate[V]*=this.scene.dataScale[V])}var F=this.data.hovertext||this.data.text;return n(F)&&F[U]&&F[U][B]!==void 0?C.textLabel=F[U][B]:F?C.textLabel=F:C.textLabel="",C.data.dataCoordinate=C.dataCoordinate.slice(),this.surface.highlight(C.data),this.scene.glplot.spikes.position=C.dataCoordinate,!0}};function h(C){var T=C[0].rgb,N=C[C.length-1].rgb;return T[0]===N[0]&&T[1]===N[1]&&T[2]===N[2]&&T[3]===N[3]}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function b(C,T){if(C0){N=m[B];break}return N}function A(C,T){if(!(C<1||T<1)){for(var N=x(C),B=x(T),U=1,V=0;VD;)B--,B/=_(B),B++,B1?U:1};function E(C,T,N){var B=N[8]+N[2]*T[0]+N[5]*T[1];return C[0]=(N[6]+N[0]*T[0]+N[3]*T[1])/B,C[1]=(N[7]+N[1]*T[0]+N[4]*T[1])/B,C}function I(C,T,N){return M(C,T,E,N),C}function M(C,T,N,B){for(var U=[0,0],V=C.shape[0],W=C.shape[1],F=0;F0&&this.contourStart[B]!==null&&this.contourEnd[B]!==null&&this.contourEnd[B]>this.contourStart[B]))for(T[B]=!0,U=this.contourStart[B];Uhe&&(this.minValues[q]=he),this.maxValues[q]{Y.exports={attributes:w6(),supplyDefaults:nD().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:PY(),plot:IY(),moduleType:"trace",name:"surface",basePlotModule:N_(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),zY=Fe((te,Y)=>{Y.exports=DY()}),$w=Fe((te,Y)=>{var d=zc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=w6(),n=_a(),a=an().extendFlat;Y.exports=a({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"}),hovertemplatefallback:P({editType:"calc"}),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},d("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:a({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:a({},i.lightposition.x,{dflt:1e5}),y:a({},i.lightposition.y,{dflt:1e5}),z:a({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:a({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},i.lighting),hoverinfo:a({},n.hoverinfo,{editType:"calc"}),showlegend:a({},n.showlegend,{dflt:!1})})}),jC=Fe((te,Y)=>{var d=zc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=$w(),n=_a(),a=an().extendFlat,l=oh().overrideAll;function o(h){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function u(h){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var s=Y.exports=l(a({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:o(),y:o(),z:o()},caps:{x:u(),y:u(),z:u()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:z(),hovertemplatefallback:P(),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),valuehoverformat:y("value",1),showlegend:a({},n.showlegend,{dflt:!1})},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:a({},n.hoverinfo)}),"calc","nested");s.flatshading.dflt=!0,s.lighting.facenormalsepsilon.dflt=0,s.x.editType=s.y.editType=s.z.editType=s.value.editType="calc+clearAxisTypes"}),aD=Fe((te,Y)=>{var d=ji(),y=as(),z=jC(),P=Cc();function i(a,l,o,u){function s(h,m){return d.coerce(a,l,z,h,m)}n(a,l,o,u,s)}function n(a,l,o,u,s){var h=s("isomin"),m=s("isomax");m!=null&&h!==void 0&&h!==null&&h>m&&(l.isomin=null,l.isomax=null);var b=s("x"),x=s("y"),_=s("z"),A=s("value");if(!b||!b.length||!x||!x.length||!_||!_.length||!A||!A.length){l.visible=!1;return}var f=y.getComponentMethod("calendars","handleTraceDefaults");f(a,l,["x","y","z"],u),s("valuehoverformat"),["x","y","z"].forEach(function(E){s(E+"hoverformat");var I="caps."+E,M=s(I+".show");M&&s(I+".fill");var p="slices."+E,g=s(p+".show");g&&(s(p+".fill"),s(p+".locations"))});var k=s("spaceframe.show");k&&s("spaceframe.fill");var w=s("surface.show");w&&(s("surface.count"),s("surface.fill"),s("surface.pattern"));var D=s("contour.show");D&&(s("contour.color"),s("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(E){s(E)}),P(a,l,u,s,{prefix:"",cLetter:"c"}),l._length=null}Y.exports={supplyDefaults:i,supplyIsoDefaults:n}}),UC=Fe((te,Y)=>{var d=ji(),y=kp();function z(a,l){l._len=Math.min(l.u.length,l.v.length,l.w.length,l.x.length,l.y.length,l.z.length),l._u=n(l.u,l._len),l._v=n(l.v,l._len),l._w=n(l.w,l._len),l._x=n(l.x,l._len),l._y=n(l.y,l._len),l._z=n(l.z,l._len);var o=P(l);l._gridFill=o.fill,l._Xs=o.Xs,l._Ys=o.Ys,l._Zs=o.Zs,l._len=o.len;var u=0,s,h,m;l.starts&&(s=n(l.starts.x||[]),h=n(l.starts.y||[]),m=n(l.starts.z||[]),u=Math.min(s.length,h.length,m.length)),l._startsX=s||[],l._startsY=h||[],l._startsZ=m||[];var b=0,x=1/0,_;for(_=0;_1&&(g=l[s-1],T=o[s-1],B=u[s-1]),h=0;hg?"-":"+")+"x"),D=D.replace("y",(C>T?"-":"+")+"y"),D=D.replace("z",(N>B?"-":"+")+"z");var F=function(){s=0,U=[],V=[],W=[]};(!s||s{var d=kp(),y=UC().processGrid,z=UC().filter;Y.exports=function(P,i){i._len=Math.min(i.x.length,i.y.length,i.z.length,i.value.length),i._x=z(i.x,i._len),i._y=z(i.y,i._len),i._z=z(i.z,i._len),i._value=z(i.value,i._len);var n=y(i);i._gridFill=n.fill,i._Xs=n.Xs,i._Ys=n.Ys,i._Zs=n.Zs,i._len=n.len;for(var a=1/0,l=-1/0,o=0;o{Y.exports=function(d,y,z,P){P=P||d.length;for(var i=new Array(P),n=0;n{var d=$p().gl_mesh3d,y=ly().parseColorScale,z=ji().isArrayOrTypedArray,P=sy(),i=lh().extractOpts,n=Hw(),a=function(m,b){for(var x=b.length-1;x>0;x--){var _=Math.min(b[x],b[x-1]),A=Math.max(b[x],b[x-1]);if(A>_&&_-1}function me(Ot,Je){return Ot===null?Je:Ot}function fe(Ot,Je,ot){xe();var De=[Je],ye=[ot];if(se>=1)De=[Je],ye=[ot];else if(se>0){var Pe=oe(Je,ot);De=Pe.xyzv,ye=Pe.abc}for(var He=0;He-1?ot[ht]:he(At,Wt,Kt);zr>-1?at[ht]=zr:at[ht]=ce(At,Wt,Kt,me(Ot,hr))}re(at[0],at[1],at[2])}}function Ce(Ot,Je,ot){var De=function(ye,Pe,He){fe(Ot,[Je[ye],Je[Pe],Je[He]],[ot[ye],ot[Pe],ot[He]])};De(0,1,2),De(2,3,0)}function Be(Ot,Je,ot){var De=function(ye,Pe,He){fe(Ot,[Je[ye],Je[Pe],Je[He]],[ot[ye],ot[Pe],ot[He]])};De(0,1,2),De(3,0,1),De(2,3,0),De(1,2,3)}function Oe(Ot,Je,ot,De){var ye=Ot[3];yeDe&&(ye=De);for(var Pe=(Ot[3]-ye)/(Ot[3]-Je[3]+1e-9),He=[],at=0;at<4;at++)He[at]=(1-Pe)*Ot[at]+Pe*Je[at];return He}function Ze(Ot,Je,ot){return Ot>=Je&&Ot<=ot}function Ge(Ot){var Je=.001*(F-W);return Ot>=W-Je&&Ot<=F+Je}function rt(Ot){for(var Je=[],ot=0;ot<4;ot++){var De=Ot[ot];Je.push([m._x[De],m._y[De],m._z[De],m._value[De]])}return Je}var _t=3;function pt(Ot,Je,ot,De,ye,Pe){Pe||(Pe=1),ot=[-1,-1,-1];var He=!1,at=[Ze(Je[0][3],De,ye),Ze(Je[1][3],De,ye),Ze(Je[2][3],De,ye)];if(!at[0]&&!at[1]&&!at[2])return!1;var ht=function(Wt,Kt,hr){return Ge(Kt[0][3])&&Ge(Kt[1][3])&&Ge(Kt[2][3])?(fe(Wt,Kt,hr),!0):Pe<_t?pt(Wt,Kt,hr,W,F,++Pe):!1};if(at[0]&&at[1]&&at[2])return ht(Ot,Je,ot)||He;var At=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(Wt){if(at[Wt[0]]&&at[Wt[1]]&&!at[Wt[2]]){var Kt=Je[Wt[0]],hr=Je[Wt[1]],zr=Je[Wt[2]],Dr=Oe(zr,Kt,De,ye),br=Oe(zr,hr,De,ye);He=ht(Ot,[br,Dr,Kt],[-1,-1,ot[Wt[0]]])||He,He=ht(Ot,[Kt,hr,br],[ot[Wt[0]],ot[Wt[1]],-1])||He,At=!0}}),At||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(Wt){if(at[Wt[0]]&&!at[Wt[1]]&&!at[Wt[2]]){var Kt=Je[Wt[0]],hr=Je[Wt[1]],zr=Je[Wt[2]],Dr=Oe(hr,Kt,De,ye),br=Oe(zr,Kt,De,ye);He=ht(Ot,[br,Dr,Kt],[-1,-1,ot[Wt[0]]])||He,At=!0}}),He}function gt(Ot,Je,ot,De){var ye=!1,Pe=rt(Je),He=[Ze(Pe[0][3],ot,De),Ze(Pe[1][3],ot,De),Ze(Pe[2][3],ot,De),Ze(Pe[3][3],ot,De)];if(!He[0]&&!He[1]&&!He[2]&&!He[3])return ye;if(He[0]&&He[1]&&He[2]&&He[3])return k&&(ye=Be(Ot,Pe,Je)||ye),ye;var at=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(ht){if(He[ht[0]]&&He[ht[1]]&&He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Kt=Pe[ht[2]],hr=Pe[ht[3]];if(k)ye=fe(Ot,[At,Wt,Kt],[Je[ht[0]],Je[ht[1]],Je[ht[2]]])||ye;else{var zr=Oe(hr,At,ot,De),Dr=Oe(hr,Wt,ot,De),br=Oe(hr,Kt,ot,De);ye=fe(null,[zr,Dr,br],[-1,-1,-1])||ye}at=!0}}),at||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(ht){if(He[ht[0]]&&He[ht[1]]&&!He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Kt=Pe[ht[2]],hr=Pe[ht[3]],zr=Oe(Kt,At,ot,De),Dr=Oe(Kt,Wt,ot,De),br=Oe(hr,Wt,ot,De),hi=Oe(hr,At,ot,De);k?(ye=fe(Ot,[At,hi,zr],[Je[ht[0]],-1,-1])||ye,ye=fe(Ot,[Wt,Dr,br],[Je[ht[1]],-1,-1])||ye):ye=Ce(null,[zr,Dr,br,hi],[-1,-1,-1,-1])||ye,at=!0}}),at)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(ht){if(He[ht[0]]&&!He[ht[1]]&&!He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Kt=Pe[ht[2]],hr=Pe[ht[3]],zr=Oe(Wt,At,ot,De),Dr=Oe(Kt,At,ot,De),br=Oe(hr,At,ot,De);k?(ye=fe(Ot,[At,zr,Dr],[Je[ht[0]],-1,-1])||ye,ye=fe(Ot,[At,Dr,br],[Je[ht[0]],-1,-1])||ye,ye=fe(Ot,[At,br,zr],[Je[ht[0]],-1,-1])||ye):ye=fe(null,[zr,Dr,br],[-1,-1,-1])||ye,at=!0}}),ye}function ct(Ot,Je,ot,De,ye,Pe,He,at,ht,At,Wt){var Kt=!1;return f&&(J(Ot,"A")&&(Kt=gt(null,[Je,ot,De,Pe],At,Wt)||Kt),J(Ot,"B")&&(Kt=gt(null,[ot,De,ye,ht],At,Wt)||Kt),J(Ot,"C")&&(Kt=gt(null,[ot,Pe,He,ht],At,Wt)||Kt),J(Ot,"D")&&(Kt=gt(null,[De,Pe,at,ht],At,Wt)||Kt),J(Ot,"E")&&(Kt=gt(null,[ot,De,Pe,ht],At,Wt)||Kt)),k&&(Kt=gt(Ot,[ot,De,Pe,ht],At,Wt)||Kt),Kt}function Ae(Ot,Je,ot,De,ye,Pe,He,at){return[at[0]===!0?!0:pt(Ot,rt([Je,ot,De]),[Je,ot,De],Pe,He),at[1]===!0?!0:pt(Ot,rt([De,ye,Je]),[De,ye,Je],Pe,He)]}function ze(Ot,Je,ot,De,ye,Pe,He,at,ht){return at?Ae(Ot,Je,ot,ye,De,Pe,He,ht):Ae(Ot,ot,ye,De,Je,Pe,He,ht)}function Ee(Ot,Je,ot,De,ye,Pe,He){var at=!1,ht,At,Wt,Kt,hr=function(){at=pt(Ot,[ht,At,Wt],[-1,-1,-1],ye,Pe)||at,at=pt(Ot,[Wt,Kt,ht],[-1,-1,-1],ye,Pe)||at},zr=He[0],Dr=He[1],br=He[2];return zr&&(ht=ne(rt([B(Je,ot-0,De-0)])[0],rt([B(Je-1,ot-0,De-0)])[0],zr),At=ne(rt([B(Je,ot-0,De-1)])[0],rt([B(Je-1,ot-0,De-1)])[0],zr),Wt=ne(rt([B(Je,ot-1,De-1)])[0],rt([B(Je-1,ot-1,De-1)])[0],zr),Kt=ne(rt([B(Je,ot-1,De-0)])[0],rt([B(Je-1,ot-1,De-0)])[0],zr),hr()),Dr&&(ht=ne(rt([B(Je-0,ot,De-0)])[0],rt([B(Je-0,ot-1,De-0)])[0],Dr),At=ne(rt([B(Je-0,ot,De-1)])[0],rt([B(Je-0,ot-1,De-1)])[0],Dr),Wt=ne(rt([B(Je-1,ot,De-1)])[0],rt([B(Je-1,ot-1,De-1)])[0],Dr),Kt=ne(rt([B(Je-1,ot,De-0)])[0],rt([B(Je-1,ot-1,De-0)])[0],Dr),hr()),br&&(ht=ne(rt([B(Je-0,ot-0,De)])[0],rt([B(Je-0,ot-0,De-1)])[0],br),At=ne(rt([B(Je-0,ot-1,De)])[0],rt([B(Je-0,ot-1,De-1)])[0],br),Wt=ne(rt([B(Je-1,ot-1,De)])[0],rt([B(Je-1,ot-1,De-1)])[0],br),Kt=ne(rt([B(Je-1,ot-0,De)])[0],rt([B(Je-1,ot-0,De-1)])[0],br),hr()),at}function nt(Ot,Je,ot,De,ye,Pe,He,at,ht,At,Wt,Kt){var hr=Ot;return Kt?(f&&Ot==="even"&&(hr=null),ct(hr,Je,ot,De,ye,Pe,He,at,ht,At,Wt)):(f&&Ot==="odd"&&(hr=null),ct(hr,ht,at,He,Pe,ye,De,ot,Je,At,Wt))}function xt(Ot,Je,ot,De,ye){for(var Pe=[],He=0,at=0;atat?[U,Pe]:[Pe,V];gr(Je,ht[0],ht[1])}}var At=[[Math.min(W,V),Math.max(W,V)],[Math.min(U,F),Math.max(U,F)]];["x","y","z"].forEach(function(Wt){for(var Kt=[],hr=0;hr0&&(cn.push(Sn.id),Wt==="x"?yn.push([Sn.distRatio,0,0]):Wt==="y"?yn.push([0,Sn.distRatio,0]):yn.push([0,0,Sn.distRatio]))}else Wt==="x"?un=Mr(1,g-1):Wt==="y"?un=Mr(1,C-1):un=Mr(1,T-1);cn.length>0&&(Wt==="x"?Kt[zr]=mr(Ot,cn,Dr,br,yn,Kt[zr]):Wt==="y"?Kt[zr]=Kr(Ot,cn,Dr,br,yn,Kt[zr]):Kt[zr]=ri(Ot,cn,Dr,br,yn,Kt[zr]),zr++),un.length>0&&(Wt==="x"?Kt[zr]=xt(Ot,un,Dr,br,Kt[zr]):Wt==="y"?Kt[zr]=ut(Ot,un,Dr,br,Kt[zr]):Kt[zr]=Et(Ot,un,Dr,br,Kt[zr]),zr++)}var fn=m.caps[Wt];fn.show&&fn.fill&&(_e(fn.fill),Wt==="x"?Kt[zr]=xt(Ot,[0,g-1],Dr,br,Kt[zr]):Wt==="y"?Kt[zr]=ut(Ot,[0,C-1],Dr,br,Kt[zr]):Kt[zr]=Et(Ot,[0,T-1],Dr,br,Kt[zr]),zr++)}}),w===0&&ve(),m._meshX=$,m._meshY=q,m._meshZ=G,m._meshIntensity=ee,m._Xs=I,m._Ys=M,m._Zs=p}return mi(),m}function h(m,b){var x=m.glplot.gl,_=d({gl:x}),A=new l(m,_,b.uid);return _._trace=A,A.update(b),m.glplot.add(_),A}Y.exports={findNearestOnAxis:a,generateIsoMeshes:s,createIsosurfaceTrace:h}}),OY=Fe((te,Y)=>{Y.exports={attributes:jC(),supplyDefaults:aD().supplyDefaults,calc:oD(),colorbar:{min:"cmin",max:"cmax"},plot:$C().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:N_(),categories:["gl3d","showLegend"],meta:{}}}),BY=Fe((te,Y)=>{Y.exports=OY()}),sD=Fe((te,Y)=>{var d=zc(),y=jC(),z=w6(),P=_a(),i=an().extendFlat,n=oh().overrideAll,a=Y.exports=n(i({x:y.x,y:y.y,z:y.z,value:y.value,isomin:y.isomin,isomax:y.isomax,surface:y.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:y.slices,caps:y.caps,text:y.text,hovertext:y.hovertext,xhoverformat:y.xhoverformat,yhoverformat:y.yhoverformat,zhoverformat:y.zhoverformat,valuehoverformat:y.valuehoverformat,hovertemplate:y.hovertemplate,hovertemplatefallback:y.hovertemplatefallback},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:y.colorbar,opacity:y.opacity,opacityscale:z.opacityscale,lightposition:y.lightposition,lighting:y.lighting,flatshading:y.flatshading,contour:y.contour,hoverinfo:i({},P.hoverinfo),showlegend:i({},P.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),RY=Fe((te,Y)=>{var d=ji(),y=sD(),z=aD().supplyIsoDefaults,P=nD().opacityscaleDefaults;Y.exports=function(i,n,a,l){function o(u,s){return d.coerce(i,n,y,u,s)}z(i,n,a,l,o),P(i,n,l,o)}}),FY=Fe((te,Y)=>{var d=$p().gl_mesh3d,y=ly().parseColorScale,z=ji().isArrayOrTypedArray,P=sy(),i=lh().extractOpts,n=Hw(),a=$C().findNearestOnAxis,l=$C().generateIsoMeshes;function o(h,m,b){this.scene=h,this.uid=b,this.mesh=m,this.name="",this.data=null,this.showContour=!1}var u=o.prototype;u.handlePick=function(h){if(h.object===this.mesh){var m=h.data.index,b=this.data._meshX[m],x=this.data._meshY[m],_=this.data._meshZ[m],A=this.data._Ys.length,f=this.data._Zs.length,k=a(b,this.data._Xs).id,w=a(x,this.data._Ys).id,D=a(_,this.data._Zs).id,E=h.index=D+f*w+f*A*k;h.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var I=this.data.hovertext||this.data.text;return z(I)&&I[E]!==void 0?h.textLabel=I[E]:I&&(h.textLabel=I),!0}},u.update=function(h){var m=this.scene,b=m.fullSceneLayout;this.data=l(h);function x(w,D,E,I){return D.map(function(M){return w.d2l(M,0,I)*E})}var _=n(x(b.xaxis,h._meshX,m.dataScale[0],h.xcalendar),x(b.yaxis,h._meshY,m.dataScale[1],h.ycalendar),x(b.zaxis,h._meshZ,m.dataScale[2],h.zcalendar)),A=n(h._meshI,h._meshJ,h._meshK),f={positions:_,cells:A,lightPosition:[h.lightposition.x,h.lightposition.y,h.lightposition.z],ambient:h.lighting.ambient,diffuse:h.lighting.diffuse,specular:h.lighting.specular,roughness:h.lighting.roughness,fresnel:h.lighting.fresnel,vertexNormalsEpsilon:h.lighting.vertexnormalsepsilon,faceNormalsEpsilon:h.lighting.facenormalsepsilon,opacity:h.opacity,opacityscale:h.opacityscale,contourEnable:h.contour.show,contourColor:P(h.contour.color).slice(0,3),contourWidth:h.contour.width,useFacetNormals:h.flatshading},k=i(h);f.vertexIntensity=h._meshIntensity,f.vertexIntensityBounds=[k.min,k.max],f.colormap=y(h),this.mesh.update(f)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function s(h,m){var b=h.glplot.gl,x=d({gl:b}),_=new o(h,x,m.uid);return x._trace=_,_.update(m),h.glplot.add(x),_}Y.exports=s}),NY=Fe((te,Y)=>{Y.exports={attributes:sD(),supplyDefaults:RY(),calc:oD(),colorbar:{min:"cmin",max:"cmax"},plot:FY(),moduleType:"trace",name:"volume",basePlotModule:N_(),categories:["gl3d","showLegend"],meta:{}}}),jY=Fe((te,Y)=>{Y.exports=NY()}),UY=Fe((te,Y)=>{var d=as(),y=ji(),z=Cc(),P=$w();Y.exports=function(i,n,a,l){function o(b,x){return y.coerce(i,n,P,b,x)}function u(b){var x=b.map(function(_){var A=o(_);return A&&y.isArrayOrTypedArray(A)?A:null});return x.every(function(_){return _&&_.length===x[0].length})&&x}var s=u(["x","y","z"]);if(!s){n.visible=!1;return}if(u(["i","j","k"]),n.i&&(!n.j||!n.k)||n.j&&(!n.k||!n.i)||n.k&&(!n.i||!n.j)){n.visible=!1;return}var h=d.getComponentMethod("calendars","handleTraceDefaults");h(i,n,["x","y","z"],l),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(b){o(b)});var m=o("contour.show");m&&(o("contour.color"),o("contour.width")),"intensity"in i?(o("intensity"),o("intensitymode"),z(i,n,l,o,{prefix:"",cLetter:"c"})):(n.showscale=!1,"facecolor"in i?o("facecolor"):"vertexcolor"in i?o("vertexcolor"):o("color",a)),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("xhoverformat"),o("yhoverformat"),o("zhoverformat"),n._length=null}}),$Y=Fe((te,Y)=>{var d=kp();Y.exports=function(y,z){z.intensity&&d(y,z,{vals:z.intensity,containerStr:"",cLetter:"c"})}}),HY=Fe((te,Y)=>{var d=$p().gl_mesh3d,y=$p().delaunay_triangulate,z=$p().alpha_shape,P=$p().convex_hull,i=ly().parseColorScale,n=ji().isArrayOrTypedArray,a=sy(),l=lh().extractOpts,o=Hw();function u(f,k,w){this.scene=f,this.uid=w,this.mesh=k,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var s=u.prototype;s.handlePick=function(f){if(f.object===this.mesh){var k=f.index=f.data.index;f.data._cellCenter?f.traceCoordinate=f.data.dataCoordinate:f.traceCoordinate=[this.data.x[k],this.data.y[k],this.data.z[k]];var w=this.data.hovertext||this.data.text;return n(w)&&w[k]!==void 0?f.textLabel=w[k]:w&&(f.textLabel=w),!0}};function h(f){for(var k=[],w=f.length,D=0;D=k-.5)return!1;return!0}s.update=function(f){var k=this.scene,w=k.fullSceneLayout;this.data=f;var D=f.x.length,E=o(m(w.xaxis,f.x,k.dataScale[0],f.xcalendar),m(w.yaxis,f.y,k.dataScale[1],f.ycalendar),m(w.zaxis,f.z,k.dataScale[2],f.zcalendar)),I;if(f.i&&f.j&&f.k){if(f.i.length!==f.j.length||f.j.length!==f.k.length||!_(f.i,D)||!_(f.j,D)||!_(f.k,D))return;I=o(b(f.i),b(f.j),b(f.k))}else f.alphahull===0?I=P(E):f.alphahull>0?I=z(f.alphahull,E):I=x(f.delaunayaxis,E);var M={positions:E,cells:I,lightPosition:[f.lightposition.x,f.lightposition.y,f.lightposition.z],ambient:f.lighting.ambient,diffuse:f.lighting.diffuse,specular:f.lighting.specular,roughness:f.lighting.roughness,fresnel:f.lighting.fresnel,vertexNormalsEpsilon:f.lighting.vertexnormalsepsilon,faceNormalsEpsilon:f.lighting.facenormalsepsilon,opacity:f.opacity,contourEnable:f.contour.show,contourColor:a(f.contour.color).slice(0,3),contourWidth:f.contour.width,useFacetNormals:f.flatshading};if(f.intensity){var p=l(f);this.color="#fff";var g=f.intensitymode;M[g+"Intensity"]=f.intensity,M[g+"IntensityBounds"]=[p.min,p.max],M.colormap=i(f)}else f.vertexcolor?(this.color=f.vertexcolor[0],M.vertexColors=h(f.vertexcolor)):f.facecolor?(this.color=f.facecolor[0],M.cellColors=h(f.facecolor)):(this.color=f.color,M.meshColor=a(f.color));this.mesh.update(M)},s.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function A(f,k){var w=f.glplot.gl,D=d({gl:w}),E=new u(f,D,k.uid);return D._trace=E,E.update(k),f.glplot.add(D),E}Y.exports=A}),VY=Fe((te,Y)=>{Y.exports={attributes:$w(),supplyDefaults:UY(),calc:$Y(),colorbar:{min:"cmin",max:"cmax"},plot:HY(),moduleType:"trace",name:"mesh3d",basePlotModule:N_(),categories:["gl3d","showLegend"],meta:{}}}),WY=Fe((te,Y)=>{Y.exports=VY()}),lD=Fe((te,Y)=>{var d=zc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=$w(),n=_a(),a=an().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},n.showlegend,{dflt:!1})};a(l,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(u){l[u]=i[u]}),l.hoverinfo=a({},n.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),qY=Fe((te,Y)=>{var d=ji(),y=Cc(),z=lD();Y.exports=function(P,i,n,a){function l(_,A){return d.coerce(P,i,z,_,A)}var o=l("u"),u=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!u||!u.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){i.visible=!1;return}var x=l("sizemode");l("sizeref",x==="raw"?1:.5),l("anchor"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,i,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),i._length=null}}),GY=Fe((te,Y)=>{var d=kp();Y.exports=function(y,z){for(var P=z.u,i=z.v,n=z.w,a=Math.min(z.x.length,z.y.length,z.z.length,P.length,i.length,n.length),l=-1/0,o=1/0,u=0;u{var d=$p().gl_cone3d,y=$p().gl_cone3d.createConeMesh,z=ji().simpleMap,P=ly().parseColorScale,i=lh().extractOpts,n=ji().isArrayOrTypedArray,a=Hw();function l(x,_){this.scene=x,this.uid=_,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(x){if(x.object===this.mesh){var _=x.index=x.data.index,A=this.data.x[_],f=this.data.y[_],k=this.data.z[_],w=this.data.u[_],D=this.data.v[_],E=this.data.w[_];x.traceCoordinate=[A,f,k,w,D,E,Math.sqrt(w*w+D*D+E*E)];var I=this.data.hovertext||this.data.text;return n(I)&&I[_]!==void 0?x.textLabel=I[_]:I&&(x.textLabel=I),!0}};var u={xaxis:0,yaxis:1,zaxis:2},s={tip:1,tail:0,cm:.25,center:.5},h={tip:1,tail:1,cm:.75,center:.5};function m(x,_){var A=x.fullSceneLayout,f=x.dataScale,k={};function w(p,g){var C=A[g],T=f[u[g]];return z(p,function(N){return C.d2l(N)*T})}k.vectors=a(w(_.u,"xaxis"),w(_.v,"yaxis"),w(_.w,"zaxis"),_._len),k.positions=a(w(_.x,"xaxis"),w(_.y,"yaxis"),w(_.z,"zaxis"),_._len);var D=i(_);k.colormap=P(_),k.vertexIntensityBounds=[D.min/_._normMax,D.max/_._normMax],k.coneOffset=s[_.anchor];var E=_.sizemode;E==="scaled"?k.coneSize=_.sizeref||.5:E==="absolute"?k.coneSize=_.sizeref&&_._normMax?_.sizeref/_._normMax:.5:E==="raw"&&(k.coneSize=_.sizeref),k.coneSizemode=E;var I=d(k),M=_.lightposition;return I.lightPosition=[M.x,M.y,M.z],I.ambient=_.lighting.ambient,I.diffuse=_.lighting.diffuse,I.specular=_.lighting.specular,I.roughness=_.lighting.roughness,I.fresnel=_.lighting.fresnel,I.opacity=_.opacity,_._pad=h[_.anchor]*I.vectorScale*I.coneScale*_._normMax,I}o.update=function(x){this.data=x;var _=m(this.scene,x);this.mesh.update(_)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function b(x,_){var A=x.glplot.gl,f=m(x,_),k=y(A,f),w=new l(x,_.uid);return w.mesh=k,w.data=_,k._trace=w,x.glplot.add(k),w}Y.exports=b}),KY=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"cone",basePlotModule:N_(),categories:["gl3d","showLegend"],attributes:lD(),supplyDefaults:qY(),colorbar:{min:"cmin",max:"cmax"},calc:GY(),plot:ZY(),eventData:function(d,y){return d.norm=y.traceCoordinate[6],d},meta:{}}}),YY=Fe((te,Y)=>{Y.exports=KY()}),uD=Fe((te,Y)=>{var d=zc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=$w(),n=_a(),a=an().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},n.showlegend,{dflt:!1})};a(l,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(u){l[u]=i[u]}),l.hoverinfo=a({},n.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),XY=Fe((te,Y)=>{var d=ji(),y=Cc(),z=uD();Y.exports=function(P,i,n,a){function l(x,_){return d.coerce(P,i,z,x,_)}var o=l("u"),u=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!u||!u.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){i.visible=!1;return}l("starts.x"),l("starts.y"),l("starts.z"),l("maxdisplayed"),l("sizeref"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,i,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),i._length=null}}),JY=Fe((te,Y)=>{var d=$p().gl_streamtube3d,y=d.createTubeMesh,z=ji(),P=ly().parseColorScale,i=lh().extractOpts,n=Hw(),a={xaxis:0,yaxis:1,zaxis:2};function l(b,x){this.scene=b,this.uid=x,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(b){var x=this.scene.fullSceneLayout,_=this.scene.dataScale;function A(w,D){var E=x[D],I=_[a[D]];return E.l2c(w)/I}if(b.object===this.mesh){var f=b.data.position,k=b.data.velocity;return b.traceCoordinate=[A(f[0],"xaxis"),A(f[1],"yaxis"),A(f[2],"zaxis"),A(k[0],"xaxis"),A(k[1],"yaxis"),A(k[2],"zaxis"),b.data.intensity*this.data._normMax,b.data.divergence],b.textLabel=this.data.hovertext||this.data.text,!0}};function u(b){var x=b.length,_;return x>2?_=b.slice(1,x-1):x===2?_=[(b[0]+b[1])/2]:_=b,_}function s(b){var x=b.length;return x===1?[.5,.5]:[b[1]-b[0],b[x-1]-b[x-2]]}function h(b,x){var _=b.fullSceneLayout,A=b.dataScale,f=x._len,k={};function w(ce,re){var ge=_[re],ne=A[a[re]];return z.simpleMap(ce,function(se){return ge.d2l(se)*ne})}if(k.vectors=n(w(x._u,"xaxis"),w(x._v,"yaxis"),w(x._w,"zaxis"),f),!f)return{positions:[],cells:[]};var D=w(x._Xs,"xaxis"),E=w(x._Ys,"yaxis"),I=w(x._Zs,"zaxis");k.meshgrid=[D,E,I],k.gridFill=x._gridFill;var M=x._slen;if(M)k.startingPositions=n(w(x._startsX,"xaxis"),w(x._startsY,"yaxis"),w(x._startsZ,"zaxis"));else{for(var p=E[0],g=u(D),C=u(I),T=new Array(g.length*C.length),N=0,B=0;B{Y.exports={moduleType:"trace",name:"streamtube",basePlotModule:N_(),categories:["gl3d","showLegend"],attributes:uD(),supplyDefaults:XY(),colorbar:{min:"cmin",max:"cmax"},calc:UC().calc,plot:JY(),eventData:function(d,y){return d.tubex=d.x,d.tubey=d.y,d.tubez=d.z,d.tubeu=y.traceCoordinate[3],d.tubev=y.traceCoordinate[4],d.tubew=y.traceCoordinate[5],d.norm=y.traceCoordinate[6],d.divergence=y.traceCoordinate[7],delete d.x,delete d.y,delete d.z,d},meta:{}}}),eX=Fe((te,Y)=>{Y.exports=QY()}),Eb=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=ff(),n=_a(),a=zc(),l=Wd().dash,o=an().extendFlat,u=oh().overrideAll,s=i.marker,h=i.line,m=s.line;Y.exports=u({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:o({},i.mode,{dflt:"markers"}),text:o({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},i.hovertext,{}),textfont:i.textfont,textposition:i.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:i.connectgaps,marker:o({symbol:s.symbol,opacity:s.opacity,angle:s.angle,angleref:o({},s.angleref,{values:["previous","up","north"]}),standoff:s.standoff,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,colorbar:s.colorbar,line:o({width:m.width},a("marker.line")),gradient:s.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:P(),selected:i.selected,unselected:i.unselected,hoverinfo:o({},n.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),tX=Fe((te,Y)=>{var d=ji(),y=Oc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=Eb(),l=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(o,u,s,h){function m(D,E){return d.coerce(o,u,a,D,E)}var b=m("locations"),x;if(b&&b.length){var _=m("geojson"),A;(typeof _=="string"&&_!==""||d.isPlainObject(_))&&(A="geojson-id");var f=m("locationmode",A);f==="country names"&&d.warn(l),f==="geojson-id"&&m("featureidkey"),x=b.length}else{var k=m("lon")||[],w=m("lat")||[];x=Math.min(k.length,w.length)}if(!x){u.visible=!1;return}u._length=x,m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),y.hasMarkers(u)&&z(o,u,s,h,m,{gradient:!0}),y.hasLines(u)&&(P(o,u,s,h,m),m("connectgaps")),y.hasText(u)&&(m("texttemplate"),m("texttemplatefallback"),i(o,u,h,m)),m("fill"),u.fill!=="none"&&n(o,u,s,m),d.coerceSelectionMarkerOpacity(u,m)}}),rX=Fe((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.geo]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),HC=Fe((te,Y)=>{var d=Ar(),y=ti().BADNUM,z=zm(),P=de(),i=$e(),n=ji().isArrayOrTypedArray,a=ji()._;function l(o){return o&&typeof o=="string"}Y.exports=function(o,u){var s=n(u.locations),h=s?u.locations.length:u._length,m=new Array(h),b;u.geojson?b=function(w){return l(w)||d(w)}:b=l;for(var x=0;x{te.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},te.axesNames=["lonaxis","lataxis"],te.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},te.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},te.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},te.clipPad=.001,te.precision=.1,te.landColor="#F0DC82",te.waterColor="#3399FF",te.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},te.sphereSVG={type:"Sphere"},te.fillLayers={ocean:1,land:1,lakes:1},te.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},te.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],te.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],te.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),cD=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.topojson=d.topojson||{}))})(te,function(d){function y(w){return w}function z(w){if(w==null)return y;var D,E,I=w.scale[0],M=w.scale[1],p=w.translate[0],g=w.translate[1];return function(C,T){T||(D=E=0);var N=2,B=C.length,U=new Array(B);for(U[0]=(D+=C[0])*I+p,U[1]=(E+=C[1])*M+g;Np&&(p=N[0]),N[1]g&&(g=N[1])}function T(N){switch(N.type){case"GeometryCollection":N.geometries.forEach(T);break;case"Point":C(N.coordinates);break;case"MultiPoint":N.coordinates.forEach(C);break}}w.arcs.forEach(function(N){for(var B=-1,U=N.length,V;++Bp&&(p=V[0]),V[1]g&&(g=V[1])});for(E in w.objects)T(w.objects[E]);return[I,M,p,g]}function i(w,D){for(var E,I=w.length,M=I-D;M<--I;)E=w[M],w[M++]=w[I],w[I]=E}function n(w,D){return typeof D=="string"&&(D=w.objects[D]),D.type==="GeometryCollection"?{type:"FeatureCollection",features:D.geometries.map(function(E){return a(w,E)})}:a(w,D)}function a(w,D){var E=D.id,I=D.bbox,M=D.properties==null?{}:D.properties,p=l(w,D);return E==null&&I==null?{type:"Feature",properties:M,geometry:p}:I==null?{type:"Feature",id:E,properties:M,geometry:p}:{type:"Feature",id:E,bbox:I,properties:M,geometry:p}}function l(w,D){var E=z(w.transform),I=w.arcs;function M(B,U){U.length&&U.pop();for(var V=I[B<0?~B:B],W=0,F=V.length;W1)I=h(w,D,E);else for(M=0,I=new Array(p=w.arcs.length);M1)for(var U=1,V=C(N[0]),W,F;UV&&(F=N[0],N[0]=N[U],N[U]=F,V=W);return N}).filter(function(T){return T.length>0})}}function _(w,D){for(var E=0,I=w.length;E>>1;w[M]=2))throw new Error("n must be ≥2");T=w.bbox||P(w);var E=T[0],I=T[1],M=T[2],p=T[3],g;D={scale:[M-E?(M-E)/(g-1):1,p-I?(p-I)/(g-1):1],translate:[E,I]}}else T=w.bbox;var C=f(D),T,N,B=w.objects,U={};function V($){return C($)}function W($){var q;switch($.type){case"GeometryCollection":q={type:"GeometryCollection",geometries:$.geometries.map(W)};break;case"Point":q={type:"Point",coordinates:V($.coordinates)};break;case"MultiPoint":q={type:"MultiPoint",coordinates:$.coordinates.map(V)};break;default:return $}return $.id!=null&&(q.id=$.id),$.bbox!=null&&(q.bbox=$.bbox),$.properties!=null&&(q.properties=$.properties),q}function F($){var q=0,G=1,ee=$.length,he,xe=new Array(ee);for(xe[0]=C($[0],0);++q{var d=Y.exports={},y=k6().locationmodeToLayer,z=cD().feature;d.getTopojsonName=function(P){return[P.scope.replace(/ /g,"-"),"_",P.resolution.toString(),"m"].join("")},d.getTopojsonPath=function(P,i){return P+=P.endsWith("/")?"":"/",`${P}${i}.json`},d.getTopojsonFeatures=function(P,i){var n=y[P.locationmode],a=i.objects[n];return z(i,a).features}}),j_=Fe(te=>{var Y=ti().BADNUM;te.calcTraceToLineCoords=function(d){for(var y=d[0].trace,z=y.connectgaps,P=[],i=[],n=0;n0&&(P.push(i),i=[])}return i.length>0&&P.push(i),P},te.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},te.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var y=new Array(d.length),z=0;z{Y.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),WC=Fe(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=63710088e-1,d={centimeters:Y*100,centimetres:Y*100,degrees:360/(2*Math.PI),feet:Y*3.28084,inches:Y*39.37,kilometers:Y/1e3,kilometres:Y/1e3,meters:Y,metres:Y,miles:Y/1609.344,millimeters:Y*1e3,millimetres:Y*1e3,nauticalmiles:Y/1852,radians:1,yards:Y*1.0936},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function z(B,U,V={}){let W={type:"Feature"};return(V.id===0||V.id)&&(W.id=V.id),V.bbox&&(W.bbox=V.bbox),W.properties=U||{},W.geometry=B,W}function P(B,U,V={}){switch(B){case"Point":return i(U).geometry;case"LineString":return o(U).geometry;case"Polygon":return a(U).geometry;case"MultiPoint":return m(U).geometry;case"MultiLineString":return h(U).geometry;case"MultiPolygon":return b(U).geometry;default:throw new Error(B+" is invalid")}}function i(B,U,V={}){if(!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(B[0])||!g(B[1]))throw new Error("coordinates must contain numbers");return z({type:"Point",coordinates:B},U,V)}function n(B,U,V={}){return s(B.map(W=>i(W,U)),V)}function a(B,U,V={}){for(let W of B){if(W.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(W[W.length-1].length!==W[0].length)throw new Error("First and last Position are not equivalent.");for(let F=0;Fa(W,U)),V)}function o(B,U,V={}){if(B.length<2)throw new Error("coordinates must be an array of two or more positions");return z({type:"LineString",coordinates:B},U,V)}function u(B,U,V={}){return s(B.map(W=>o(W,U)),V)}function s(B,U={}){let V={type:"FeatureCollection"};return U.id&&(V.id=U.id),U.bbox&&(V.bbox=U.bbox),V.features=B,V}function h(B,U,V={}){return z({type:"MultiLineString",coordinates:B},U,V)}function m(B,U,V={}){return z({type:"MultiPoint",coordinates:B},U,V)}function b(B,U,V={}){return z({type:"MultiPolygon",coordinates:B},U,V)}function x(B,U,V={}){return z({type:"GeometryCollection",geometries:B},U,V)}function _(B,U=0){if(U&&!(U>=0))throw new Error("precision must be a positive number");let V=Math.pow(10,U||0);return Math.round(B*V)/V}function A(B,U="kilometers"){let V=d[U];if(!V)throw new Error(U+" units is invalid");return B*V}function f(B,U="kilometers"){let V=d[U];if(!V)throw new Error(U+" units is invalid");return B/V}function k(B,U){return E(f(B,U))}function w(B){let U=B%360;return U<0&&(U+=360),U}function D(B){return B=B%360,B>180?B-360:B<-180?B+360:B}function E(B){return B%(2*Math.PI)*180/Math.PI}function I(B){return B%360*Math.PI/180}function M(B,U="kilometers",V="kilometers"){if(!(B>=0))throw new Error("length must be a positive number");return A(f(B,U),V)}function p(B,U="meters",V="kilometers"){if(!(B>=0))throw new Error("area must be a positive number");let W=y[U];if(!W)throw new Error("invalid original units");let F=y[V];if(!F)throw new Error("invalid final units");return B/W*F}function g(B){return!isNaN(B)&&B!==null&&!Array.isArray(B)}function C(B){return B!==null&&typeof B=="object"&&!Array.isArray(B)}function T(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(U=>{if(!g(U))throw new Error("bbox must only contain numbers")})}function N(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}te.areaFactors=y,te.azimuthToBearing=D,te.bearingToAzimuth=w,te.convertArea=p,te.convertLength=M,te.degreesToRadians=I,te.earthRadius=Y,te.factors=d,te.feature=z,te.featureCollection=s,te.geometry=P,te.geometryCollection=x,te.isNumber=g,te.isObject=C,te.lengthToDegrees=k,te.lengthToRadians=f,te.lineString=o,te.lineStrings=u,te.multiLineString=h,te.multiPoint=m,te.multiPolygon=b,te.point=i,te.points=n,te.polygon=a,te.polygons=l,te.radiansToDegrees=E,te.radiansToLength=A,te.round=_,te.validateBBox=T,te.validateId=N}),qC=Fe(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=WC();function d(f,k,w){if(f!==null)for(var D,E,I,M,p,g,C,T=0,N=0,B,U=f.type,V=U==="FeatureCollection",W=U==="Feature",F=V?f.features.length:1,$=0;$g||V>C||W>T){p=N,g=D,C=V,T=W,I=0;return}var F=Y.lineString.call(void 0,[p,N],w.properties);if(k(F,D,E,W,I)===!1)return!1;I++,p=N})===!1)return!1}}})}function m(f,k,w){var D=w,E=!1;return h(f,function(I,M,p,g,C){E===!1&&w===void 0?D=I:D=k(D,I,M,p,g,C),E=!0}),D}function b(f,k){if(!f)throw new Error("geojson is required");u(f,function(w,D,E){if(w.geometry!==null){var I=w.geometry.type,M=w.geometry.coordinates;switch(I){case"LineString":if(k(w,D,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p{Object.defineProperty(te,"__esModule",{value:!0});var Y=WC(),d=qC();function y(o){return d.geomReduce.call(void 0,o,(u,s)=>u+z(s),0)}function z(o){let u=0,s;switch(o.type){case"Polygon":return P(o.coordinates);case"MultiPolygon":for(s=0;s0){u+=Math.abs(a(o[0]));for(let s=1;s=u?(h+2)%u:h+2],_=m[0]*n,A=b[1]*n,f=x[0]*n;s+=(f-_)*Math.sin(A),h++}return s*i}var l=y;te.area=y,te.default=l}),aX=Fe(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=WC(),d=qC();function y(P,i={}){let n=0,a=0,l=0;return d.coordEach.call(void 0,P,function(o){n+=o[0],a+=o[1],l++},!0),Y.point.call(void 0,[n/l,a/l],i.properties)}var z=y;te.centroid=y,te.default=z}),oX=Fe(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=qC();function d(z,P={}){if(z.bbox!=null&&P.recompute!==!0)return z.bbox;let i=[1/0,1/0,-1/0,-1/0];return Y.coordEach.call(void 0,z,n=>{i[0]>n[0]&&(i[0]=n[0]),i[1]>n[1]&&(i[1]=n[1]),i[2]{var d=ii(),y=iX(),{area:z}=nX(),{centroid:P}=aX(),{bbox:i}=oX(),n=__(),a=ns(),l=ei(),o=qn(),u=Cg(),s=Object.keys(y),h={"ISO-3":n,"USA-states":n,"country names":m};function m(D){for(var E=0;E0&&U[V+1][0]<0)return V;return null}switch(M==="RUS"||M==="FJI"?g=function(U){var V;if(B(U)===null)V=U;else for(V=new Array(U.length),N=0;NV?W[F++]=[U[N][0]+360,U[N][1]]:N===V?(W[F++]=U[N],W[F++]=[U[N][0],-90]):W[F++]=U[N];var $=u.tester(W);$.pts.pop(),p.push($)}:g=function(U){p.push(u.tester(U))},E.type){case"MultiPolygon":for(C=0;C0?$.properties.ct=f($):$.properties.ct=[NaN,NaN],W.fIn=U,W.fOut=$,p.push($)}else a.log(["Location",W.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete M[V]}switch(I.type){case"FeatureCollection":var N=I.features;for(g=0;gp&&(p=T,I=C)}else I=E;return P(I).geometry.coordinates}function k(D){var E=window.PlotlyGeoAssets||{},I=[];function M(N){return new Promise(function(B,U){d.json(N,function(V,W){if(V){delete E[N];var F=V.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return U(new Error(F))}return E[N]=W,B(W)})})}function p(N){return new Promise(function(B,U){var V=0,W=setInterval(function(){if(E[N]&&E[N]!=="pending")return clearInterval(W),B(E[N]);if(V>100)return clearInterval(W),U("Unexpected error while fetching from "+N);V++},50)})}for(var g=0;g{var d=ii(),y=Zs(),z=Xi(),P=El(),i=P.stylePoints,n=P.styleText;Y.exports=function(l,o){o&&a(l,o)};function a(l,o){var u=o[0].trace,s=o[0].node3;s.style("opacity",o[0].trace.opacity),i(s,u,l),n(s,u,l),s.selectAll("path.js-line").style("fill","none").each(function(h){var m=d.select(this),b=h.trace,x=b.line||{};m.call(z.stroke,x.color).call(y.dashLine,x.dash||"",x.width||0),b.fill!=="none"&&m.call(z.fill,b.fillcolor)})}}),fD=Fe((te,Y)=>{var d=ii(),y=ji(),z=VC().getTopojsonFeatures,P=j_(),i=U_(),n=Xm().findExtremes,a=ti().BADNUM,l=yt().calcMarkerSize,o=Oc(),u=hD();function s(m,b,x){var _=b.layers.frontplot.select(".scatterlayer"),A=y.makeTraceGroups(_,x,"trace scattergeo");function f(k,w){k.lonlat[0]===a&&d.select(w).remove()}A.selectAll("*").remove(),A.each(function(k){var w=d.select(this),D=k[0].trace;if(o.hasLines(D)||D.fill!=="none"){var E=P.calcTraceToLineCoords(k),I=D.fill!=="none"?P.makePolygon(E):P.makeLine(E);w.selectAll("path.js-line").data([{geojson:I,trace:D}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}o.hasMarkers(D)&&w.selectAll("path.point").data(y.identity).enter().append("path").classed("point",!0).each(function(M){f(M,this)}),o.hasText(D)&&w.selectAll("g").data(y.identity).enter().append("g").append("text").each(function(M){f(M,this)}),u(m,k)})}function h(m,b){var x=m[0].trace,_=b[x.geo],A=_._subplot,f=x._length,k,w;if(y.isArrayOrTypedArray(x.locations)){var D=x.locationmode,E=D==="geojson-id"?i.extractTraceFeature(m):z(x,A.topojson);for(k=0;k{var d=hf(),y=ti().BADNUM,z=qu(),P=ji().fillText,i=Eb();Y.exports=function(a,l,o){var u=a.cd,s=u[0].trace,h=a.xa,m=a.ya,b=a.subplot,x=b.projection.isLonLatOverEdges,_=b.project;function A(M){var p=M.lonlat;if(p[0]===y||x(p))return 1/0;var g=_(p),C=_([l,o]),T=Math.abs(g[0]-C[0]),N=Math.abs(g[1]-C[1]),B=Math.max(3,M.mrc||0);return Math.max(Math.sqrt(T*T+N*N)-B,1-3/B)}if(d.getClosest(u,A,a),a.index!==!1){var f=u[a.index],k=f.lonlat,w=[h.c2p(k),m.c2p(k)],D=f.mrc||1;a.x0=w[0]-D,a.x1=w[0]+D,a.y0=w[1]-D,a.y1=w[1]+D,a.loc=f.loc,a.lon=k[0],a.lat=k[1];var E={};E[s.geo]={_subplot:b};var I=s._module.formatLabels(f,s,E);return a.lonLabel=I.lonLabel,a.latLabel=I.latLabel,a.color=z(s,f),a.extraText=n(s,f,a,u[0].t.labels),a.hovertemplate=s.hovertemplate,[a]}};function n(a,l,o,u){if(a.hovertemplate)return;var s=l.hi||a.hoverinfo,h=s==="all"?i.hoverinfo.flags:s.split("+"),m=h.indexOf("location")!==-1&&Array.isArray(a.locations),b=h.indexOf("lon")!==-1,x=h.indexOf("lat")!==-1,_=h.indexOf("text")!==-1,A=[];function f(k){return k+"°"}return m?A.push(l.loc):b&&x?A.push("("+f(o.latLabel)+", "+f(o.lonLabel)+")"):b?A.push(u.lon+f(o.lonLabel)):x&&A.push(u.lat+f(o.latLabel)),_&&P(l,a,A),A.join("
")}}),lX=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){d.lon=y.lon,d.lat=y.lat,d.location=y.loc?y.loc:null;var n=P[i];return n.fIn&&n.fIn.properties&&(d.properties=n.fIn.properties),d}}),uX=Fe((te,Y)=>{var d=Oc(),y=ti().BADNUM;Y.exports=function(z,P){var i=z.cd,n=z.xaxis,a=z.yaxis,l=[],o=i[0].trace,u,s,h,m,b,x=!d.hasMarkers(o)&&!d.hasText(o);if(x)return[];if(P===!1)for(b=0;b{(function(d,y){y(typeof te=="object"&&typeof Y<"u"?te:d.d3=d.d3||{})})(te,function(d){function y(ne,se){return nese?1:ne>=se?0:NaN}function z(ne){return ne.length===1&&(ne=P(ne)),{left:function(se,_e,oe,J){for(oe==null&&(oe=0),J==null&&(J=se.length);oe>>1;ne(se[me],_e)<0?oe=me+1:J=me}return oe},right:function(se,_e,oe,J){for(oe==null&&(oe=0),J==null&&(J=se.length);oe>>1;ne(se[me],_e)>0?J=me:oe=me+1}return oe}}}function P(ne){return function(se,_e){return y(ne(se),_e)}}var i=z(y),n=i.right,a=i.left;function l(ne,se){se==null&&(se=o);for(var _e=0,oe=ne.length-1,J=ne[0],me=new Array(oe<0?0:oe);_ene?1:se>=ne?0:NaN}function h(ne){return ne===null?NaN:+ne}function m(ne,se){var _e=ne.length,oe=0,J=-1,me=0,fe,Ce,Be=0;if(se==null)for(;++J<_e;)isNaN(fe=h(ne[J]))||(Ce=fe-me,me+=Ce/++oe,Be+=Ce*(fe-me));else for(;++J<_e;)isNaN(fe=h(se(ne[J],J,ne)))||(Ce=fe-me,me+=Ce/++oe,Be+=Ce*(fe-me));if(oe>1)return Be/(oe-1)}function b(ne,se){var _e=m(ne,se);return _e&&Math.sqrt(_e)}function x(ne,se){var _e=ne.length,oe=-1,J,me,fe;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=fe=J;++oe<_e;)(J=ne[oe])!=null&&(me>J&&(me=J),fe=J)for(me=fe=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&(me>J&&(me=J),fe0)return[ne];if((oe=se0)for(ne=Math.ceil(ne/Ce),se=Math.floor(se/Ce),fe=new Array(me=Math.ceil(se-ne+1));++J=0?(me>=E?10:me>=I?5:me>=M?2:1)*Math.pow(10,J):-Math.pow(10,-J)/(me>=E?10:me>=I?5:me>=M?2:1)}function C(ne,se,_e){var oe=Math.abs(se-ne)/Math.max(0,_e),J=Math.pow(10,Math.floor(Math.log(oe)/Math.LN10)),me=oe/J;return me>=E?J*=10:me>=I?J*=5:me>=M&&(J*=2),seGe;)rt.pop(),--_t;var pt=new Array(_t+1),gt;for(me=0;me<=_t;++me)gt=pt[me]=[],gt.x0=me>0?rt[me-1]:Ze,gt.x1=me<_t?rt[me]:Ge;for(me=0;me=1)return+_e(ne[oe-1],oe-1,ne);var oe,J=(oe-1)*se,me=Math.floor(J),fe=+_e(ne[me],me,ne),Ce=+_e(ne[me+1],me+1,ne);return fe+(Ce-fe)*(J-me)}}function U(ne,se,_e){return ne=f.call(ne,h).sort(y),Math.ceil((_e-se)/(2*(B(ne,.75)-B(ne,.25))*Math.pow(ne.length,-1/3)))}function V(ne,se,_e){return Math.ceil((_e-se)/(3.5*b(ne)*Math.pow(ne.length,-1/3)))}function W(ne,se){var _e=ne.length,oe=-1,J,me;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=J;++oe<_e;)(J=ne[oe])!=null&&J>me&&(me=J)}else for(;++oe<_e;)if((J=se(ne[oe],oe,ne))!=null&&J>=J)for(me=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&J>me&&(me=J);return me}function F(ne,se){var _e=ne.length,oe=_e,J=-1,me,fe=0;if(se==null)for(;++J<_e;)isNaN(me=h(ne[J]))?--oe:fe+=me;else for(;++J<_e;)isNaN(me=h(se(ne[J],J,ne)))?--oe:fe+=me;if(oe)return fe/oe}function $(ne,se){var _e=ne.length,oe=-1,J,me=[];if(se==null)for(;++oe<_e;)isNaN(J=h(ne[oe]))||me.push(J);else for(;++oe<_e;)isNaN(J=h(se(ne[oe],oe,ne)))||me.push(J);return B(me.sort(y),.5)}function q(ne){for(var se=ne.length,_e,oe=-1,J=0,me,fe;++oe=0;)for(fe=ne[se],_e=fe.length;--_e>=0;)me[--J]=fe[_e];return me}function G(ne,se){var _e=ne.length,oe=-1,J,me;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=J;++oe<_e;)(J=ne[oe])!=null&&me>J&&(me=J)}else for(;++oe<_e;)if((J=se(ne[oe],oe,ne))!=null&&J>=J)for(me=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&me>J&&(me=J);return me}function ee(ne,se){for(var _e=se.length,oe=new Array(_e);_e--;)oe[_e]=ne[se[_e]];return oe}function he(ne,se){if(_e=ne.length){var _e,oe=0,J=0,me,fe=ne[J];for(se==null&&(se=y);++oe<_e;)(se(me=ne[oe],fe)<0||se(fe,fe)!==0)&&(fe=me,J=oe);if(se(fe,fe)===0)return J}}function xe(ne,se,_e){for(var oe=(_e??ne.length)-(se=se==null?0:+se),J,me;oe;)me=Math.random()*oe--|0,J=ne[oe+se],ne[oe+se]=ne[me+se],ne[me+se]=J;return ne}function ve(ne,se){var _e=ne.length,oe=-1,J,me=0;if(se==null)for(;++oe<_e;)(J=+ne[oe])&&(me+=J);else for(;++oe<_e;)(J=+se(ne[oe],oe,ne))&&(me+=J);return me}function ce(ne){if(!(me=ne.length))return[];for(var se=-1,_e=G(ne,re),oe=new Array(_e);++se<_e;)for(var J=-1,me,fe=oe[se]=new Array(me);++J{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,T6()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(){return new P}function P(){this.reset()}P.prototype={constructor:P,reset:function(){this.s=this.t=0},add:function(wr){n(i,wr,this.t),n(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new P;function n(wr,Yr,Ni){var Ai=wr.s=Yr+Ni,hn=Ai-Yr,Ln=Ai-hn;wr.t=Yr-Ln+(Ni-hn)}var a=1e-6,l=1e-12,o=Math.PI,u=o/2,s=o/4,h=o*2,m=180/o,b=o/180,x=Math.abs,_=Math.atan,A=Math.atan2,f=Math.cos,k=Math.ceil,w=Math.exp,D=Math.log,E=Math.pow,I=Math.sin,M=Math.sign||function(wr){return wr>0?1:wr<0?-1:0},p=Math.sqrt,g=Math.tan;function C(wr){return wr>1?0:wr<-1?o:Math.acos(wr)}function T(wr){return wr>1?u:wr<-1?-u:Math.asin(wr)}function N(wr){return(wr=I(wr/2))*wr}function B(){}function U(wr,Yr){wr&&W.hasOwnProperty(wr.type)&&W[wr.type](wr,Yr)}var V={Feature:function(wr,Yr){U(wr.geometry,Yr)},FeatureCollection:function(wr,Yr){for(var Ni=wr.features,Ai=-1,hn=Ni.length;++Ai=0?1:-1,hn=Ai*Ni,Ln=f(Yr),pa=I(Yr),Ea=re*pa,Za=ce*Ln+Ea*f(hn),ao=Ea*Ai*I(hn);G.add(A(ao,Za)),ve=wr,ce=Ln,re=pa}function J(wr){return ee.reset(),q(wr,ge),ee*2}function me(wr){return[A(wr[1],wr[0]),T(wr[2])]}function fe(wr){var Yr=wr[0],Ni=wr[1],Ai=f(Ni);return[Ai*f(Yr),Ai*I(Yr),I(Ni)]}function Ce(wr,Yr){return wr[0]*Yr[0]+wr[1]*Yr[1]+wr[2]*Yr[2]}function Be(wr,Yr){return[wr[1]*Yr[2]-wr[2]*Yr[1],wr[2]*Yr[0]-wr[0]*Yr[2],wr[0]*Yr[1]-wr[1]*Yr[0]]}function Oe(wr,Yr){wr[0]+=Yr[0],wr[1]+=Yr[1],wr[2]+=Yr[2]}function Ze(wr,Yr){return[wr[0]*Yr,wr[1]*Yr,wr[2]*Yr]}function Ge(wr){var Yr=p(wr[0]*wr[0]+wr[1]*wr[1]+wr[2]*wr[2]);wr[0]/=Yr,wr[1]/=Yr,wr[2]/=Yr}var rt,_t,pt,gt,ct,Ae,ze,Ee,nt=z(),xt,ut,Et={point:Gt,lineStart:gr,lineEnd:mr,polygonStart:function(){Et.point=Kr,Et.lineStart=ri,Et.lineEnd=Mr,nt.reset(),ge.polygonStart()},polygonEnd:function(){ge.polygonEnd(),Et.point=Gt,Et.lineStart=gr,Et.lineEnd=mr,G<0?(rt=-(pt=180),_t=-(gt=90)):nt>a?gt=90:nt<-a&&(_t=-90),ut[0]=rt,ut[1]=pt},sphere:function(){rt=-(pt=180),_t=-(gt=90)}};function Gt(wr,Yr){xt.push(ut=[rt=wr,pt=wr]),Yr<_t&&(_t=Yr),Yr>gt&&(gt=Yr)}function Jt(wr,Yr){var Ni=fe([wr*b,Yr*b]);if(Ee){var Ai=Be(Ee,Ni),hn=[Ai[1],-Ai[0],0],Ln=Be(hn,Ai);Ge(Ln),Ln=me(Ln);var pa=wr-ct,Ea=pa>0?1:-1,Za=Ln[0]*m*Ea,ao,xa=x(pa)>180;xa^(Ea*ctgt&&(gt=ao)):(Za=(Za+360)%360-180,xa^(Ea*ctgt&&(gt=Yr))),xa?wrui(rt,pt)&&(pt=wr):ui(wr,pt)>ui(rt,pt)&&(rt=wr):pt>=rt?(wrpt&&(pt=wr)):wr>ct?ui(rt,wr)>ui(rt,pt)&&(pt=wr):ui(wr,pt)>ui(rt,pt)&&(rt=wr)}else xt.push(ut=[rt=wr,pt=wr]);Yr<_t&&(_t=Yr),Yr>gt&&(gt=Yr),Ee=Ni,ct=wr}function gr(){Et.point=Jt}function mr(){ut[0]=rt,ut[1]=pt,Et.point=Gt,Ee=null}function Kr(wr,Yr){if(Ee){var Ni=wr-ct;nt.add(x(Ni)>180?Ni+(Ni>0?360:-360):Ni)}else Ae=wr,ze=Yr;ge.point(wr,Yr),Jt(wr,Yr)}function ri(){ge.lineStart()}function Mr(){Kr(Ae,ze),ge.lineEnd(),x(nt)>a&&(rt=-(pt=180)),ut[0]=rt,ut[1]=pt,Ee=null}function ui(wr,Yr){return(Yr-=wr)<0?Yr+360:Yr}function mi(wr,Yr){return wr[0]-Yr[0]}function Ot(wr,Yr){return wr[0]<=wr[1]?wr[0]<=Yr&&Yr<=wr[1]:Yrui(Ai[0],Ai[1])&&(Ai[1]=hn[1]),ui(hn[0],Ai[1])>ui(Ai[0],Ai[1])&&(Ai[0]=hn[0])):Ln.push(Ai=hn);for(pa=-1/0,Ni=Ln.length-1,Yr=0,Ai=Ln[Ni];Yr<=Ni;Ai=hn,++Yr)hn=Ln[Yr],(Ea=ui(Ai[1],hn[0]))>pa&&(pa=Ea,rt=hn[0],pt=Ai[1])}return xt=ut=null,rt===1/0||_t===1/0?[[NaN,NaN],[NaN,NaN]]:[[rt,_t],[pt,gt]]}var ot,De,ye,Pe,He,at,ht,At,Wt,Kt,hr,zr,Dr,br,hi,un,cn={sphere:B,point:yn,lineStart:Sn,lineEnd:na,polygonStart:function(){cn.lineStart=Zt,cn.lineEnd=sr},polygonEnd:function(){cn.lineStart=Sn,cn.lineEnd=na}};function yn(wr,Yr){wr*=b,Yr*=b;var Ni=f(Yr);Wn(Ni*f(wr),Ni*I(wr),I(Yr))}function Wn(wr,Yr,Ni){++ot,ye+=(wr-ye)/ot,Pe+=(Yr-Pe)/ot,He+=(Ni-He)/ot}function Sn(){cn.point=fn}function fn(wr,Yr){wr*=b,Yr*=b;var Ni=f(Yr);br=Ni*f(wr),hi=Ni*I(wr),un=I(Yr),cn.point=ga,Wn(br,hi,un)}function ga(wr,Yr){wr*=b,Yr*=b;var Ni=f(Yr),Ai=Ni*f(wr),hn=Ni*I(wr),Ln=I(Yr),pa=A(p((pa=hi*Ln-un*hn)*pa+(pa=un*Ai-br*Ln)*pa+(pa=br*hn-hi*Ai)*pa),br*Ai+hi*hn+un*Ln);De+=pa,at+=pa*(br+(br=Ai)),ht+=pa*(hi+(hi=hn)),At+=pa*(un+(un=Ln)),Wn(br,hi,un)}function na(){cn.point=yn}function Zt(){cn.point=_r}function sr(){Cr(zr,Dr),cn.point=yn}function _r(wr,Yr){zr=wr,Dr=Yr,wr*=b,Yr*=b,cn.point=Cr;var Ni=f(Yr);br=Ni*f(wr),hi=Ni*I(wr),un=I(Yr),Wn(br,hi,un)}function Cr(wr,Yr){wr*=b,Yr*=b;var Ni=f(Yr),Ai=Ni*f(wr),hn=Ni*I(wr),Ln=I(Yr),pa=hi*Ln-un*hn,Ea=un*Ai-br*Ln,Za=br*hn-hi*Ai,ao=p(pa*pa+Ea*Ea+Za*Za),xa=T(ao),Va=ao&&-xa/ao;Wt+=Va*pa,Kt+=Va*Ea,hr+=Va*Za,De+=xa,at+=xa*(br+(br=Ai)),ht+=xa*(hi+(hi=hn)),At+=xa*(un+(un=Ln)),Wn(br,hi,un)}function fi(wr){ot=De=ye=Pe=He=at=ht=At=Wt=Kt=hr=0,q(wr,cn);var Yr=Wt,Ni=Kt,Ai=hr,hn=Yr*Yr+Ni*Ni+Ai*Ai;return hno?wr+Math.round(-wr/h)*h:wr,Yr]}Hi.invert=Hi;function En(wr,Yr,Ni){return(wr%=h)?Yr||Ni?Ui(Gn(wr),Xn(Yr,Ni)):Gn(wr):Yr||Ni?Xn(Yr,Ni):Hi}function Rn(wr){return function(Yr,Ni){return Yr+=wr,[Yr>o?Yr-h:Yr<-o?Yr+h:Yr,Ni]}}function Gn(wr){var Yr=Rn(wr);return Yr.invert=Rn(-wr),Yr}function Xn(wr,Yr){var Ni=f(wr),Ai=I(wr),hn=f(Yr),Ln=I(Yr);function pa(Ea,Za){var ao=f(Za),xa=f(Ea)*ao,Va=I(Ea)*ao,Oa=I(Za),fa=Oa*Ni+xa*Ai;return[A(Va*hn-fa*Ln,xa*Ni-Oa*Ai),T(fa*hn+Va*Ln)]}return pa.invert=function(Ea,Za){var ao=f(Za),xa=f(Ea)*ao,Va=I(Ea)*ao,Oa=I(Za),fa=Oa*hn-Va*Ln;return[A(Va*hn+Oa*Ln,xa*Ni+fa*Ai),T(fa*Ni-xa*Ai)]},pa}function sa(wr){wr=En(wr[0]*b,wr[1]*b,wr.length>2?wr[2]*b:0);function Yr(Ni){return Ni=wr(Ni[0]*b,Ni[1]*b),Ni[0]*=m,Ni[1]*=m,Ni}return Yr.invert=function(Ni){return Ni=wr.invert(Ni[0]*b,Ni[1]*b),Ni[0]*=m,Ni[1]*=m,Ni},Yr}function Mn(wr,Yr,Ni,Ai,hn,Ln){if(Ni){var pa=f(Yr),Ea=I(Yr),Za=Ai*Ni;hn==null?(hn=Yr+Ai*h,Ln=Yr-Za/2):(hn=Ha(pa,hn),Ln=Ha(pa,Ln),(Ai>0?hnLn)&&(hn+=Ai*h));for(var ao,xa=hn;Ai>0?xa>Ln:xa1&&wr.push(wr.pop().concat(wr.shift()))},result:function(){var Ni=wr;return wr=[],Yr=null,Ni}}}function Rt(wr,Yr){return x(wr[0]-Yr[0])=0;--Ea)hn.point((Va=xa[Ea])[0],Va[1]);else Ai(Oa.x,Oa.p.x,-1,hn);Oa=Oa.p}Oa=Oa.o,xa=Oa.z,fa=!fa}while(!Oa.v);hn.lineEnd()}}}function oi(wr){if(Yr=wr.length){for(var Yr,Ni=0,Ai=wr[0],hn;++Ni=0?1:-1,Ql=mu*Ul,gu=Ql>o,Cl=hs*bs;if(Gr.add(A(Cl*mu*I(Ql),rs*ll+Cl*f(Ql))),pa+=gu?Ul+mu*h:Ul,gu^fa>=Ni^_o>=Ni){var ec=Be(fe(Oa),fe(xs));Ge(ec);var $u=Be(Ln,ec);Ge($u);var xu=(gu^Ul>=0?-1:1)*T($u[2]);(Ai>xu||Ai===xu&&(ec[0]||ec[1]))&&(Ea+=gu^Ul>=0?1:-1)}}return(pa<-a||pa0){for(Za||(hn.polygonStart(),Za=!0),hn.lineStart(),ll=0;ll1&&io&2&&bs.push(bs.pop().concat(bs.shift())),xa.push(bs.filter(zt))}}return Oa}}function zt(wr){return wr.length>1}function xr(wr,Yr){return((wr=wr.x)[0]<0?wr[1]-u-a:u-wr[1])-((Yr=Yr.x)[0]<0?Yr[1]-u-a:u-Yr[1])}var Jr=yi(function(){return!0},Ri,_n,[-o,-u]);function Ri(wr){var Yr=NaN,Ni=NaN,Ai=NaN,hn;return{lineStart:function(){wr.lineStart(),hn=1},point:function(Ln,pa){var Ea=Ln>0?o:-o,Za=x(Ln-Yr);x(Za-o)0?u:-u),wr.point(Ai,Ni),wr.lineEnd(),wr.lineStart(),wr.point(Ea,Ni),wr.point(Ln,Ni),hn=0):Ai!==Ea&&Za>=o&&(x(Yr-Ai)a?_((I(Yr)*(Ln=f(Ai))*I(Ni)-I(Ai)*(hn=f(Yr))*I(wr))/(hn*Ln*pa)):(Yr+Ai)/2}function _n(wr,Yr,Ni,Ai){var hn;if(wr==null)hn=Ni*u,Ai.point(-o,hn),Ai.point(0,hn),Ai.point(o,hn),Ai.point(o,0),Ai.point(o,-hn),Ai.point(0,-hn),Ai.point(-o,-hn),Ai.point(-o,0),Ai.point(-o,hn);else if(x(wr[0]-Yr[0])>a){var Ln=wr[0]0,hn=x(Yr)>a;function Ln(xa,Va,Oa,fa){Mn(fa,wr,Ni,Oa,xa,Va)}function pa(xa,Va){return f(xa)*f(Va)>Yr}function Ea(xa){var Va,Oa,fa,vo,hs;return{lineStart:function(){vo=fa=!1,hs=1},point:function(rs,ps){var xs=[rs,ps],_o,io=pa(rs,ps),bs=Ai?io?0:ao(rs,ps):io?ao(rs+(rs<0?o:-o),ps):0;if(!Va&&(vo=fa=io)&&xa.lineStart(),io!==fa&&(_o=Za(Va,xs),(!_o||Rt(Va,_o)||Rt(xs,_o))&&(xs[2]=1)),io!==fa)hs=0,io?(xa.lineStart(),_o=Za(xs,Va),xa.point(_o[0],_o[1])):(_o=Za(Va,xs),xa.point(_o[0],_o[1],2),xa.lineEnd()),Va=_o;else if(hn&&Va&&Ai^io){var ll;!(bs&Oa)&&(ll=Za(xs,Va,!0))&&(hs=0,Ai?(xa.lineStart(),xa.point(ll[0][0],ll[0][1]),xa.point(ll[1][0],ll[1][1]),xa.lineEnd()):(xa.point(ll[1][0],ll[1][1]),xa.lineEnd(),xa.lineStart(),xa.point(ll[0][0],ll[0][1],3)))}io&&(!Va||!Rt(Va,xs))&&xa.point(xs[0],xs[1]),Va=xs,fa=io,Oa=bs},lineEnd:function(){fa&&xa.lineEnd(),Va=null},clean:function(){return hs|(vo&&fa)<<1}}}function Za(xa,Va,Oa){var fa=fe(xa),vo=fe(Va),hs=[1,0,0],rs=Be(fa,vo),ps=Ce(rs,rs),xs=rs[0],_o=ps-xs*xs;if(!_o)return!Oa&&xa;var io=Yr*ps/_o,bs=-Yr*xs/_o,ll=Be(hs,rs),Ul=Ze(hs,io),mu=Ze(rs,bs);Oe(Ul,mu);var Ql=ll,gu=Ce(Ul,Ql),Cl=Ce(Ql,Ql),ec=gu*gu-Cl*(Ce(Ul,Ul)-1);if(!(ec<0)){var $u=p(ec),xu=Ze(Ql,(-gu-$u)/Cl);if(Oe(xu,Ul),xu=me(xu),!Oa)return xu;var Ho=xa[0],Is=Va[0],iu=xa[1],Wl=Va[1],Mc;Is0^xu[1]<(x(xu[0]-Ho)o^(Ho<=xu[0]&&xu[0]<=Is)){var th=Ze(Ql,(-gu+$u)/Cl);return Oe(th,Ul),[xu,me(th)]}}}function ao(xa,Va){var Oa=Ai?wr:o-wr,fa=0;return xa<-Oa?fa|=1:xa>Oa&&(fa|=2),Va<-Oa?fa|=4:Va>Oa&&(fa|=8),fa}return yi(pa,Ea,Ln,Ai?[0,-wr]:[-o,wr-o])}function Wi(wr,Yr,Ni,Ai,hn,Ln){var pa=wr[0],Ea=wr[1],Za=Yr[0],ao=Yr[1],xa=0,Va=1,Oa=Za-pa,fa=ao-Ea,vo;if(vo=Ni-pa,!(!Oa&&vo>0)){if(vo/=Oa,Oa<0){if(vo0){if(vo>Va)return;vo>xa&&(xa=vo)}if(vo=hn-pa,!(!Oa&&vo<0)){if(vo/=Oa,Oa<0){if(vo>Va)return;vo>xa&&(xa=vo)}else if(Oa>0){if(vo0)){if(vo/=fa,fa<0){if(vo0){if(vo>Va)return;vo>xa&&(xa=vo)}if(vo=Ln-Ea,!(!fa&&vo<0)){if(vo/=fa,fa<0){if(vo>Va)return;vo>xa&&(xa=vo)}else if(fa>0){if(vo0&&(wr[0]=pa+xa*Oa,wr[1]=Ea+xa*fa),Va<1&&(Yr[0]=pa+Va*Oa,Yr[1]=Ea+Va*fa),!0}}}}}var dn=1e9,Ua=-dn;function ea(wr,Yr,Ni,Ai){function hn(ao,xa){return wr<=ao&&ao<=Ni&&Yr<=xa&&xa<=Ai}function Ln(ao,xa,Va,Oa){var fa=0,vo=0;if(ao==null||(fa=pa(ao,Va))!==(vo=pa(xa,Va))||Za(ao,xa)<0^Va>0)do Oa.point(fa===0||fa===3?wr:Ni,fa>1?Ai:Yr);while((fa=(fa+Va+4)%4)!==vo);else Oa.point(xa[0],xa[1])}function pa(ao,xa){return x(ao[0]-wr)0?0:3:x(ao[0]-Ni)0?2:1:x(ao[1]-Yr)0?1:0:xa>0?3:2}function Ea(ao,xa){return Za(ao.x,xa.x)}function Za(ao,xa){var Va=pa(ao,1),Oa=pa(xa,1);return Va!==Oa?Va-Oa:Va===0?xa[1]-ao[1]:Va===1?ao[0]-xa[0]:Va===2?ao[1]-xa[1]:xa[0]-ao[0]}return function(ao){var xa=ao,Va=Ft(),Oa,fa,vo,hs,rs,ps,xs,_o,io,bs,ll,Ul={point:mu,lineStart:ec,lineEnd:$u,polygonStart:gu,polygonEnd:Cl};function mu(Ho,Is){hn(Ho,Is)&&xa.point(Ho,Is)}function Ql(){for(var Ho=0,Is=0,iu=fa.length;IsAi&&(Vh-Hh)*(Ai-th)>(Wu-th)*(wr-Hh)&&++Ho:Wu<=Ai&&(Vh-Hh)*(Ai-th)<(Wu-th)*(wr-Hh)&&--Ho;return Ho}function gu(){xa=Va,Oa=[],fa=[],ll=!0}function Cl(){var Ho=Ql(),Is=ll&&Ho,iu=(Oa=y.merge(Oa)).length;(Is||iu)&&(ao.polygonStart(),Is&&(ao.lineStart(),Ln(null,null,1,ao),ao.lineEnd()),iu&&ni(Oa,Ea,Ho,Ln,ao),ao.polygonEnd()),xa=ao,Oa=fa=vo=null}function ec(){Ul.point=xu,fa&&fa.push(vo=[]),bs=!0,io=!1,xs=_o=NaN}function $u(){Oa&&(xu(hs,rs),ps&&io&&Va.rejoin(),Oa.push(Va.result())),Ul.point=mu,io&&xa.lineEnd()}function xu(Ho,Is){var iu=hn(Ho,Is);if(fa&&vo.push([Ho,Is]),bs)hs=Ho,rs=Is,ps=iu,bs=!1,iu&&(xa.lineStart(),xa.point(Ho,Is));else if(iu&&io)xa.point(Ho,Is);else{var Wl=[xs=Math.max(Ua,Math.min(dn,xs)),_o=Math.max(Ua,Math.min(dn,_o))],Mc=[Ho=Math.max(Ua,Math.min(dn,Ho)),Is=Math.max(Ua,Math.min(dn,Is))];Wi(Wl,Mc,wr,Yr,Ni,Ai)?(io||(xa.lineStart(),xa.point(Wl[0],Wl[1])),xa.point(Mc[0],Mc[1]),iu||xa.lineEnd(),ll=!1):iu&&(xa.lineStart(),xa.point(Ho,Is),ll=!1)}xs=Ho,_o=Is,io=iu}return Ul}}function fo(){var wr=0,Yr=0,Ni=960,Ai=500,hn,Ln,pa;return pa={stream:function(Ea){return hn&&Ln===Ea?hn:hn=ea(wr,Yr,Ni,Ai)(Ln=Ea)},extent:function(Ea){return arguments.length?(wr=+Ea[0][0],Yr=+Ea[0][1],Ni=+Ea[1][0],Ai=+Ea[1][1],hn=Ln=null,pa):[[wr,Yr],[Ni,Ai]]}}}var ho=z(),Vo,Ao,Wo,Wa={sphere:B,point:B,lineStart:ks,lineEnd:B,polygonStart:B,polygonEnd:B};function ks(){Wa.point=_l,Wa.lineEnd=fs}function fs(){Wa.point=Wa.lineEnd=B}function _l(wr,Yr){wr*=b,Yr*=b,Vo=wr,Ao=I(Yr),Wo=f(Yr),Wa.point=es}function es(wr,Yr){wr*=b,Yr*=b;var Ni=I(Yr),Ai=f(Yr),hn=x(wr-Vo),Ln=f(hn),pa=I(hn),Ea=Ai*pa,Za=Wo*Ni-Ao*Ai*Ln,ao=Ao*Ni+Wo*Ai*Ln;ho.add(A(p(Ea*Ea+Za*Za),ao)),Vo=wr,Ao=Ni,Wo=Ai}function rl(wr){return ho.reset(),q(wr,Wa),+ho}var ds=[null,null],xl={type:"LineString",coordinates:ds};function ol(wr,Yr){return ds[0]=wr,ds[1]=Yr,rl(xl)}var Gl={Feature:function(wr,Yr){return Bs(wr.geometry,Yr)},FeatureCollection:function(wr,Yr){for(var Ni=wr.features,Ai=-1,hn=Ni.length;++Ai0&&(hn=ol(wr[Ln],wr[Ln-1]),hn>0&&Ni<=hn&&Ai<=hn&&(Ni+Ai-hn)*(1-Math.pow((Ni-Ai)/hn,2))a}).map(Oa)).concat(y.range(k(Ln/ao)*ao,hn,ao).filter(function(_o){return x(_o%Va)>a}).map(fa))}return ps.lines=function(){return xs().map(function(_o){return{type:"LineString",coordinates:_o}})},ps.outline=function(){return{type:"Polygon",coordinates:[vo(Ai).concat(hs(pa).slice(1),vo(Ni).reverse().slice(1),hs(Ea).reverse().slice(1))]}},ps.extent=function(_o){return arguments.length?ps.extentMajor(_o).extentMinor(_o):ps.extentMinor()},ps.extentMajor=function(_o){return arguments.length?(Ai=+_o[0][0],Ni=+_o[1][0],Ea=+_o[0][1],pa=+_o[1][1],Ai>Ni&&(_o=Ai,Ai=Ni,Ni=_o),Ea>pa&&(_o=Ea,Ea=pa,pa=_o),ps.precision(rs)):[[Ai,Ea],[Ni,pa]]},ps.extentMinor=function(_o){return arguments.length?(Yr=+_o[0][0],wr=+_o[1][0],Ln=+_o[0][1],hn=+_o[1][1],Yr>wr&&(_o=Yr,Yr=wr,wr=_o),Ln>hn&&(_o=Ln,Ln=hn,hn=_o),ps.precision(rs)):[[Yr,Ln],[wr,hn]]},ps.step=function(_o){return arguments.length?ps.stepMajor(_o).stepMinor(_o):ps.stepMinor()},ps.stepMajor=function(_o){return arguments.length?(xa=+_o[0],Va=+_o[1],ps):[xa,Va]},ps.stepMinor=function(_o){return arguments.length?(Za=+_o[0],ao=+_o[1],ps):[Za,ao]},ps.precision=function(_o){return arguments.length?(rs=+_o,Oa=$a(Ln,hn,90),fa=So(Yr,wr,rs),vo=$a(Ea,pa,90),hs=So(Ai,Ni,rs),ps):rs},ps.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function su(){return Xs()()}function is(wr,Yr){var Ni=wr[0]*b,Ai=wr[1]*b,hn=Yr[0]*b,Ln=Yr[1]*b,pa=f(Ai),Ea=I(Ai),Za=f(Ln),ao=I(Ln),xa=pa*f(Ni),Va=pa*I(Ni),Oa=Za*f(hn),fa=Za*I(hn),vo=2*T(p(N(Ln-Ai)+pa*Za*N(hn-Ni))),hs=I(vo),rs=vo?function(ps){var xs=I(ps*=vo)/hs,_o=I(vo-ps)/hs,io=_o*xa+xs*Oa,bs=_o*Va+xs*fa,ll=_o*Ea+xs*ao;return[A(bs,io)*m,A(ll,p(io*io+bs*bs))*m]}:function(){return[Ni*m,Ai*m]};return rs.distance=vo,rs}function tu(wr){return wr}var pl=z(),Nl=z(),Gu,bo,Ls,Rs,pu={point:B,lineStart:B,lineEnd:B,polygonStart:function(){pu.lineStart=bl,pu.lineEnd=ic},polygonEnd:function(){pu.lineStart=pu.lineEnd=pu.point=B,pl.add(x(Nl)),Nl.reset()},result:function(){var wr=pl/2;return pl.reset(),wr}};function bl(){pu.point=ls}function ls(wr,Yr){pu.point=Bu,Gu=Ls=wr,bo=Rs=Yr}function Bu(wr,Yr){Nl.add(Rs*wr-Ls*Yr),Ls=wr,Rs=Yr}function ic(){Bu(Gu,bo)}var Ll=1/0,Hl=Ll,lu=-Ll,hu=lu,pc={point:Ah,lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B,result:function(){var wr=[[Ll,Hl],[lu,hu]];return lu=hu=-(Hl=Ll=1/0),wr}};function Ah(wr,Yr){wrlu&&(lu=wr),Yrhu&&(hu=Yr)}var uh=0,gh=0,Qf=0,Ff=0,Vl=0,Kc=0,ed=0,xc=0,mc=0,bc,vh,yu,gc,hl={point:ru,lineStart:Fh,lineEnd:Mu,polygonStart:function(){hl.lineStart=Yd,hl.lineEnd=sl},polygonEnd:function(){hl.point=ru,hl.lineStart=Fh,hl.lineEnd=Mu},result:function(){var wr=mc?[ed/mc,xc/mc]:Kc?[Ff/Kc,Vl/Kc]:Qf?[uh/Qf,gh/Qf]:[NaN,NaN];return uh=gh=Qf=Ff=Vl=Kc=ed=xc=mc=0,wr}};function ru(wr,Yr){uh+=wr,gh+=Yr,++Qf}function Fh(){hl.point=jc}function jc(wr,Yr){hl.point=Jh,ru(yu=wr,gc=Yr)}function Jh(wr,Yr){var Ni=wr-yu,Ai=Yr-gc,hn=p(Ni*Ni+Ai*Ai);Ff+=hn*(yu+wr)/2,Vl+=hn*(gc+Yr)/2,Kc+=hn,ru(yu=wr,gc=Yr)}function Mu(){hl.point=ru}function Yd(){hl.point=hp}function sl(){jl(bc,vh)}function hp(wr,Yr){hl.point=jl,ru(bc=yu=wr,vh=gc=Yr)}function jl(wr,Yr){var Ni=wr-yu,Ai=Yr-gc,hn=p(Ni*Ni+Ai*Ai);Ff+=hn*(yu+wr)/2,Vl+=hn*(gc+Yr)/2,Kc+=hn,hn=gc*wr-yu*Yr,ed+=hn*(yu+wr),xc+=hn*(gc+Yr),mc+=hn*3,ru(yu=wr,gc=Yr)}function os(wr){this._context=wr}os.prototype={_radius:4.5,pointRadius:function(wr){return this._radius=wr,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(wr,Yr){switch(this._point){case 0:{this._context.moveTo(wr,Yr),this._point=1;break}case 1:{this._context.lineTo(wr,Yr);break}default:{this._context.moveTo(wr+this._radius,Yr),this._context.arc(wr,Yr,this._radius,0,h);break}}},result:B};var _f=z(),yh,hc,td,Qh,Ef,vc={point:B,lineStart:function(){vc.point=Ld},lineEnd:function(){yh&&cd(hc,td),vc.point=B},polygonStart:function(){yh=!0},polygonEnd:function(){yh=null},result:function(){var wr=+_f;return _f.reset(),wr}};function Ld(wr,Yr){vc.point=cd,hc=Qh=wr,td=Ef=Yr}function cd(wr,Yr){Qh-=wr,Ef-=Yr,_f.add(p(Qh*Qh+Ef*Ef)),Qh=wr,Ef=Yr}function Lf(){this._string=[]}Lf.prototype={_radius:4.5,_circle:ef(4.5),pointRadius:function(wr){return(wr=+wr)!==this._radius&&(this._radius=wr,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(wr,Yr){switch(this._point){case 0:{this._string.push("M",wr,",",Yr),this._point=1;break}case 1:{this._string.push("L",wr,",",Yr);break}default:{this._circle==null&&(this._circle=ef(this._radius)),this._string.push("M",wr,",",Yr,this._circle);break}}},result:function(){if(this._string.length){var wr=this._string.join("");return this._string=[],wr}else return null}};function ef(wr){return"m0,"+wr+"a"+wr+","+wr+" 0 1,1 0,"+-2*wr+"a"+wr+","+wr+" 0 1,1 0,"+2*wr+"z"}function rd(wr,Yr){var Ni=4.5,Ai,hn;function Ln(pa){return pa&&(typeof Ni=="function"&&hn.pointRadius(+Ni.apply(this,arguments)),q(pa,Ai(hn))),hn.result()}return Ln.area=function(pa){return q(pa,Ai(pu)),pu.result()},Ln.measure=function(pa){return q(pa,Ai(vc)),vc.result()},Ln.bounds=function(pa){return q(pa,Ai(pc)),pc.result()},Ln.centroid=function(pa){return q(pa,Ai(hl)),hl.result()},Ln.projection=function(pa){return arguments.length?(Ai=pa==null?(wr=null,tu):(wr=pa).stream,Ln):wr},Ln.context=function(pa){return arguments.length?(hn=pa==null?(Yr=null,new Lf):new os(Yr=pa),typeof Ni!="function"&&hn.pointRadius(Ni),Ln):Yr},Ln.pointRadius=function(pa){return arguments.length?(Ni=typeof pa=="function"?pa:(hn.pointRadius(+pa),+pa),Ln):Ni},Ln.projection(wr).context(Yr)}function id(wr){return{stream:_h(wr)}}function _h(wr){return function(Yr){var Ni=new hd;for(var Ai in wr)Ni[Ai]=wr[Ai];return Ni.stream=Yr,Ni}}function hd(){}hd.prototype={constructor:hd,point:function(wr,Yr){this.stream.point(wr,Yr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Nh(wr,Yr,Ni){var Ai=wr.clipExtent&&wr.clipExtent();return wr.scale(150).translate([0,0]),Ai!=null&&wr.clipExtent(null),q(Ni,wr.stream(pc)),Yr(pc.result()),Ai!=null&&wr.clipExtent(Ai),wr}function Mh(wr,Yr,Ni){return Nh(wr,function(Ai){var hn=Yr[1][0]-Yr[0][0],Ln=Yr[1][1]-Yr[0][1],pa=Math.min(hn/(Ai[1][0]-Ai[0][0]),Ln/(Ai[1][1]-Ai[0][1])),Ea=+Yr[0][0]+(hn-pa*(Ai[1][0]+Ai[0][0]))/2,Za=+Yr[0][1]+(Ln-pa*(Ai[1][1]+Ai[0][1]))/2;wr.scale(150*pa).translate([Ea,Za])},Ni)}function yc(wr,Yr,Ni){return Mh(wr,[[0,0],Yr],Ni)}function df(wr,Yr,Ni){return Nh(wr,function(Ai){var hn=+Yr,Ln=hn/(Ai[1][0]-Ai[0][0]),pa=(hn-Ln*(Ai[1][0]+Ai[0][0]))/2,Ea=-Ln*Ai[0][1];wr.scale(150*Ln).translate([pa,Ea])},Ni)}function nd(wr,Yr,Ni){return Nh(wr,function(Ai){var hn=+Yr,Ln=hn/(Ai[1][1]-Ai[0][1]),pa=-Ln*Ai[0][0],Ea=(hn-Ln*(Ai[1][1]+Ai[0][1]))/2;wr.scale(150*Ln).translate([pa,Ea])},Ni)}var uu=16,Nf=f(30*b);function Xd(wr,Yr){return+Yr?Pf(wr,Yr):fd(wr)}function fd(wr){return _h({point:function(Yr,Ni){Yr=wr(Yr,Ni),this.stream.point(Yr[0],Yr[1])}})}function Pf(wr,Yr){function Ni(Ai,hn,Ln,pa,Ea,Za,ao,xa,Va,Oa,fa,vo,hs,rs){var ps=ao-Ai,xs=xa-hn,_o=ps*ps+xs*xs;if(_o>4*Yr&&hs--){var io=pa+Oa,bs=Ea+fa,ll=Za+vo,Ul=p(io*io+bs*bs+ll*ll),mu=T(ll/=Ul),Ql=x(x(ll)-1)Yr||x((ps*$u+xs*xu)/_o-.5)>.3||pa*Oa+Ea*fa+Za*vo2?Ho[2]%360*b:0,$u()):[Ea*m,Za*m,ao*m]},Cl.angle=function(Ho){return arguments.length?(Va=Ho%360*b,$u()):Va*m},Cl.reflectX=function(Ho){return arguments.length?(Oa=Ho?-1:1,$u()):Oa<0},Cl.reflectY=function(Ho){return arguments.length?(fa=Ho?-1:1,$u()):fa<0},Cl.precision=function(Ho){return arguments.length?(ll=Xd(Ul,bs=Ho*Ho),xu()):p(bs)},Cl.fitExtent=function(Ho,Is){return Mh(Cl,Ho,Is)},Cl.fitSize=function(Ho,Is){return yc(Cl,Ho,Is)},Cl.fitWidth=function(Ho,Is){return df(Cl,Ho,Is)},Cl.fitHeight=function(Ho,Is){return nd(Cl,Ho,Is)};function $u(){var Ho=Vu(Ni,0,0,Oa,fa,Va).apply(null,Yr(Ln,pa)),Is=(Va?Vu:pd)(Ni,Ai-Ho[0],hn-Ho[1],Oa,fa,Va);return xa=En(Ea,Za,ao),Ul=Ui(Yr,Is),mu=Ui(xa,Ul),ll=Xd(Ul,bs),xu()}function xu(){return Ql=gu=null,Cl}return function(){return Yr=wr.apply(this,arguments),Cl.invert=Yr.invert&&ec,$u()}}function _u(wr){var Yr=0,Ni=o/3,Ai=tf(wr),hn=Ai(Yr,Ni);return hn.parallels=function(Ln){return arguments.length?Ai(Yr=Ln[0]*b,Ni=Ln[1]*b):[Yr*m,Ni*m]},hn}function jh(wr){var Yr=f(wr);function Ni(Ai,hn){return[Ai*Yr,I(hn)/Yr]}return Ni.invert=function(Ai,hn){return[Ai/Yr,T(hn*Yr)]},Ni}function Rc(wr,Yr){var Ni=I(wr),Ai=(Ni+I(Yr))/2;if(x(Ai)=.12&&rs<.234&&hs>=-.425&&hs<-.214?hn:rs>=.166&&rs<.234&&hs>=-.214&&hs<-.115?pa:Ni).invert(Oa)},xa.stream=function(Oa){return wr&&Yr===Oa?wr:wr=xf([Ni.stream(Yr=Oa),hn.stream(Oa),pa.stream(Oa)])},xa.precision=function(Oa){return arguments.length?(Ni.precision(Oa),hn.precision(Oa),pa.precision(Oa),Va()):Ni.precision()},xa.scale=function(Oa){return arguments.length?(Ni.scale(Oa),hn.scale(Oa*.35),pa.scale(Oa),xa.translate(Ni.translate())):Ni.scale()},xa.translate=function(Oa){if(!arguments.length)return Ni.translate();var fa=Ni.scale(),vo=+Oa[0],hs=+Oa[1];return Ai=Ni.translate(Oa).clipExtent([[vo-.455*fa,hs-.238*fa],[vo+.455*fa,hs+.238*fa]]).stream(ao),Ln=hn.translate([vo-.307*fa,hs+.201*fa]).clipExtent([[vo-.425*fa+a,hs+.12*fa+a],[vo-.214*fa-a,hs+.234*fa-a]]).stream(ao),Ea=pa.translate([vo-.205*fa,hs+.212*fa]).clipExtent([[vo-.214*fa+a,hs+.166*fa+a],[vo-.115*fa-a,hs+.234*fa-a]]).stream(ao),Va()},xa.fitExtent=function(Oa,fa){return Mh(xa,Oa,fa)},xa.fitSize=function(Oa,fa){return yc(xa,Oa,fa)},xa.fitWidth=function(Oa,fa){return df(xa,Oa,fa)},xa.fitHeight=function(Oa,fa){return nd(xa,Oa,fa)};function Va(){return wr=Yr=null,xa}return xa.scale(1070)}function rf(wr){return function(Yr,Ni){var Ai=f(Yr),hn=f(Ni),Ln=wr(Ai*hn);return[Ln*hn*I(Yr),Ln*I(Ni)]}}function jf(wr){return function(Yr,Ni){var Ai=p(Yr*Yr+Ni*Ni),hn=wr(Ai),Ln=I(hn),pa=f(hn);return[A(Yr*Ln,Ai*pa),T(Ai&&Ni*Ln/Ai)]}}var Jd=rf(function(wr){return p(2/(1+wr))});Jd.invert=jf(function(wr){return 2*T(wr/2)});function Tp(){return Xc(Jd).scale(124.75).clipAngle(180-.001)}var bf=rf(function(wr){return(wr=C(wr))&&wr/I(wr)});bf.invert=jf(function(wr){return wr});function Uf(){return Xc(bf).scale(79.4188).clipAngle(180-.001)}function Dc(wr,Yr){return[wr,D(g((u+Yr)/2))]}Dc.invert=function(wr,Yr){return[wr,2*_(w(Yr))-u]};function wf(){return ch(Dc).scale(961/h)}function ch(wr){var Yr=Xc(wr),Ni=Yr.center,Ai=Yr.scale,hn=Yr.translate,Ln=Yr.clipExtent,pa=null,Ea,Za,ao;Yr.scale=function(Va){return arguments.length?(Ai(Va),xa()):Ai()},Yr.translate=function(Va){return arguments.length?(hn(Va),xa()):hn()},Yr.center=function(Va){return arguments.length?(Ni(Va),xa()):Ni()},Yr.clipExtent=function(Va){return arguments.length?(Va==null?pa=Ea=Za=ao=null:(pa=+Va[0][0],Ea=+Va[0][1],Za=+Va[1][0],ao=+Va[1][1]),xa()):pa==null?null:[[pa,Ea],[Za,ao]]};function xa(){var Va=o*Ai(),Oa=Yr(sa(Yr.rotate()).invert([0,0]));return Ln(pa==null?[[Oa[0]-Va,Oa[1]-Va],[Oa[0]+Va,Oa[1]+Va]]:wr===Dc?[[Math.max(Oa[0]-Va,pa),Ea],[Math.min(Oa[0]+Va,Za),ao]]:[[pa,Math.max(Oa[1]-Va,Ea)],[Za,Math.min(Oa[1]+Va,ao)]])}return xa()}function kf(wr){return g((u+wr)/2)}function $f(wr,Yr){var Ni=f(wr),Ai=wr===Yr?I(wr):D(Ni/f(Yr))/D(kf(Yr)/kf(wr)),hn=Ni*E(kf(wr),Ai)/Ai;if(!Ai)return Dc;function Ln(pa,Ea){hn>0?Ea<-u+a&&(Ea=-u+a):Ea>u-a&&(Ea=u-a);var Za=hn/E(kf(Ea),Ai);return[Za*I(Ai*pa),hn-Za*f(Ai*pa)]}return Ln.invert=function(pa,Ea){var Za=hn-Ea,ao=M(Ai)*p(pa*pa+Za*Za),xa=A(pa,x(Za))*M(Za);return Za*Ai<0&&(xa-=o*M(pa)*M(Za)),[xa/Ai,2*_(E(hn/ao,1/Ai))-u]},Ln}function Lh(){return _u($f).scale(109.5).parallels([30,30])}function Lu(wr,Yr){return[wr,Yr]}Lu.invert=Lu;function Uh(){return Xc(Lu).scale(152.63)}function Qc(wr,Yr){var Ni=f(wr),Ai=wr===Yr?I(wr):(Ni-f(Yr))/(Yr-wr),hn=Ni/Ai+wr;if(x(Ai)a&&--Ai>0);return[wr/(.8707+(Ln=Ni*Ni)*(-.131979+Ln*(-.013791+Ln*Ln*Ln*(.003971-.001529*Ln)))),Ni]};function Ph(){return Xc($h).scale(175.295)}function Zu(wr,Yr){return[f(Yr)*I(wr),I(Yr)]}Zu.invert=jf(T);function fu(){return Xc(Zu).scale(249.5).clipAngle(90+a)}function Ih(wr,Yr){var Ni=f(Yr),Ai=1+f(wr)*Ni;return[Ni*I(wr)/Ai,I(Yr)/Ai]}Ih.invert=jf(function(wr){return 2*_(wr)});function Tf(){return Xc(Ih).scale(250).clipAngle(142)}function Dh(wr,Yr){return[D(g((u+Yr)/2)),-wr]}Dh.invert=function(wr,Yr){return[-Yr,2*_(w(wr))-u]};function ad(){var wr=ch(Dh),Yr=wr.center,Ni=wr.rotate;return wr.center=function(Ai){return arguments.length?Yr([-Ai[1],Ai[0]]):(Ai=Yr(),[Ai[1],-Ai[0]])},wr.rotate=function(Ai){return arguments.length?Ni([Ai[0],Ai[1],Ai.length>2?Ai[2]+90:90]):(Ai=Ni(),[Ai[0],Ai[1],Ai[2]-90])},Ni([0,0,90]).scale(159.155)}d.geoAlbers=Eu,d.geoAlbersUsa=Eh,d.geoArea=J,d.geoAzimuthalEqualArea=Tp,d.geoAzimuthalEqualAreaRaw=Jd,d.geoAzimuthalEquidistant=Uf,d.geoAzimuthalEquidistantRaw=bf,d.geoBounds=Je,d.geoCentroid=fi,d.geoCircle=ro,d.geoClipAntimeridian=Jr,d.geoClipCircle=Zi,d.geoClipExtent=fo,d.geoClipRectangle=ea,d.geoConicConformal=Lh,d.geoConicConformalRaw=$f,d.geoConicEqualArea=Jc,d.geoConicEqualAreaRaw=Rc,d.geoConicEquidistant=Pd,d.geoConicEquidistantRaw=Qc,d.geoContains=Gs,d.geoDistance=ol,d.geoEqualEarth=Qd,d.geoEqualEarthRaw=Df,d.geoEquirectangular=Uh,d.geoEquirectangularRaw=Lu,d.geoGnomonic=md,d.geoGnomonicRaw=Ac,d.geoGraticule=Xs,d.geoGraticule10=su,d.geoIdentity=fh,d.geoInterpolate=is,d.geoLength=rl,d.geoMercator=wf,d.geoMercatorRaw=Dc,d.geoNaturalEarth1=Ph,d.geoNaturalEarth1Raw=$h,d.geoOrthographic=fu,d.geoOrthographicRaw=Zu,d.geoPath=rd,d.geoProjection=Xc,d.geoProjectionMutator=tf,d.geoRotation=sa,d.geoStereographic=Tf,d.geoStereographicRaw=Ih,d.geoStream=q,d.geoTransform=id,d.geoTransverseMercator=ad,d.geoTransverseMercatorRaw=Dh,Object.defineProperty(d,"__esModule",{value:!0})})}),cX=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,dD(),T6()):y(d.d3=d.d3||{},d.d3,d.d3)})(te,function(d,y,z){var P=Math.abs,i=Math.atan,n=Math.atan2,a=Math.cos,l=Math.exp,o=Math.floor,u=Math.log,s=Math.max,h=Math.min,m=Math.pow,b=Math.round,x=Math.sign||function(tt){return tt>0?1:tt<0?-1:0},_=Math.sin,A=Math.tan,f=1e-6,k=1e-12,w=Math.PI,D=w/2,E=w/4,I=Math.SQRT1_2,M=V(2),p=V(w),g=w*2,C=180/w,T=w/180;function N(tt){return tt?tt/Math.sin(tt):1}function B(tt){return tt>1?D:tt<-1?-D:Math.asin(tt)}function U(tt){return tt>1?0:tt<-1?w:Math.acos(tt)}function V(tt){return tt>0?Math.sqrt(tt):0}function W(tt){return tt=l(2*tt),(tt-1)/(tt+1)}function F(tt){return(l(tt)-l(-tt))/2}function $(tt){return(l(tt)+l(-tt))/2}function q(tt){return u(tt+V(tt*tt+1))}function G(tt){return u(tt+V(tt*tt-1))}function ee(tt){var lt=A(tt/2),Tt=2*u(a(tt/2))/(lt*lt);function Lt(Vt,Nt){var Yt=a(Vt),Lr=a(Nt),$r=_(Nt),Zr=Lr*Yt,di=-((1-Zr?u((1+Zr)/2)/(1-Zr):-.5)+Tt/(1+Zr));return[di*Lr*_(Vt),di*$r]}return Lt.invert=function(Vt,Nt){var Yt=V(Vt*Vt+Nt*Nt),Lr=-tt/2,$r=50,Zr;if(!Yt)return[0,0];do{var di=Lr/2,zi=a(di),Ki=_(di),nn=Ki/zi,kn=-u(P(zi));Lr-=Zr=(2/nn*kn-Tt*nn-Yt)/(-kn/(Ki*Ki)+1-Tt/(2*zi*zi))*(zi<0?.7:1)}while(P(Zr)>f&&--$r>0);var Jn=_(Lr);return[n(Vt*Jn,Yt*a(Lr)),B(Nt*Jn/Yt)]},Lt}function he(){var tt=D,lt=y.geoProjectionMutator(ee),Tt=lt(tt);return Tt.radius=function(Lt){return arguments.length?lt(tt=Lt*T):tt*C},Tt.scale(179.976).clipAngle(147)}function xe(tt,lt){var Tt=a(lt),Lt=N(U(Tt*a(tt/=2)));return[2*Tt*_(tt)*Lt,_(lt)*Lt]}xe.invert=function(tt,lt){if(!(tt*tt+4*lt*lt>w*w+f)){var Tt=tt,Lt=lt,Vt=25;do{var Nt=_(Tt),Yt=_(Tt/2),Lr=a(Tt/2),$r=_(Lt),Zr=a(Lt),di=_(2*Lt),zi=$r*$r,Ki=Zr*Zr,nn=Yt*Yt,kn=1-Ki*Lr*Lr,Jn=kn?U(Zr*Lr)*V(Sa=1/kn):Sa=0,Sa,wa=2*Jn*Zr*Yt-tt,Ba=Jn*$r-lt,xo=Sa*(Ki*nn+Jn*Zr*Lr*zi),Go=Sa*(.5*Nt*di-Jn*2*$r*Yt),Bo=Sa*.25*(di*Yt-Jn*$r*Ki*Nt),_s=Sa*(zi*Lr+Jn*nn*Zr),wl=Go*Bo-_s*xo;if(!wl)break;var Al=(Ba*Go-wa*_s)/wl,Us=(wa*Bo-Ba*xo)/wl;Tt-=Al,Lt-=Us}while((P(Al)>f||P(Us)>f)&&--Vt>0);return[Tt,Lt]}};function ve(){return y.geoProjection(xe).scale(152.63)}function ce(tt){var lt=_(tt),Tt=a(tt),Lt=tt>=0?1:-1,Vt=A(Lt*tt),Nt=(1+lt-Tt)/2;function Yt(Lr,$r){var Zr=a($r),di=a(Lr/=2);return[(1+Zr)*_(Lr),(Lt*$r>-n(di,Vt)-.001?0:-Lt*10)+Nt+_($r)*Tt-(1+Zr)*lt*di]}return Yt.invert=function(Lr,$r){var Zr=0,di=0,zi=50;do{var Ki=a(Zr),nn=_(Zr),kn=a(di),Jn=_(di),Sa=1+kn,wa=Sa*nn-Lr,Ba=Nt+Jn*Tt-Sa*lt*Ki-$r,xo=Sa*Ki/2,Go=-nn*Jn,Bo=lt*Sa*nn/2,_s=Tt*kn+lt*Ki*Jn,wl=Go*Bo-_s*xo,Al=(Ba*Go-wa*_s)/wl/2,Us=(wa*Bo-Ba*xo)/wl;P(Us)>2&&(Us/=2),Zr-=Al,di-=Us}while((P(Al)>f||P(Us)>f)&&--zi>0);return Lt*di>-n(a(Zr),Vt)-.001?[Zr*2,di]:null},Yt}function re(){var tt=20*T,lt=tt>=0?1:-1,Tt=A(lt*tt),Lt=y.geoProjectionMutator(ce),Vt=Lt(tt),Nt=Vt.stream;return Vt.parallel=function(Yt){return arguments.length?(Tt=A((lt=(tt=Yt*T)>=0?1:-1)*tt),Lt(tt)):tt*C},Vt.stream=function(Yt){var Lr=Vt.rotate(),$r=Nt(Yt),Zr=(Vt.rotate([0,0]),Nt(Yt)),di=Vt.precision();return Vt.rotate(Lr),$r.sphere=function(){Zr.polygonStart(),Zr.lineStart();for(var zi=lt*-180;lt*zi<180;zi+=lt*90)Zr.point(zi,lt*90);if(tt)for(;lt*(zi-=3*lt*di)>=-180;)Zr.point(zi,lt*-n(a(zi*T/2),Tt)*C);Zr.lineEnd(),Zr.polygonEnd()},$r},Vt.scale(218.695).center([0,28.0974])}function ge(tt,lt){var Tt=A(lt/2),Lt=V(1-Tt*Tt),Vt=1+Lt*a(tt/=2),Nt=_(tt)*Lt/Vt,Yt=Tt/Vt,Lr=Nt*Nt,$r=Yt*Yt;return[4/3*Nt*(3+Lr-3*$r),4/3*Yt*(3+3*Lr-$r)]}ge.invert=function(tt,lt){if(tt*=3/8,lt*=3/8,!tt&&P(lt)>1)return null;var Tt=tt*tt,Lt=lt*lt,Vt=1+Tt+Lt,Nt=V((Vt-V(Vt*Vt-4*lt*lt))/2),Yt=B(Nt)/3,Lr=Nt?G(P(lt/Nt))/3:q(P(tt))/3,$r=a(Yt),Zr=$(Lr),di=Zr*Zr-$r*$r;return[x(tt)*2*n(F(Lr)*$r,.25-di),x(lt)*2*n(Zr*_(Yt),.25+di)]};function ne(){return y.geoProjection(ge).scale(66.1603)}var se=V(8),_e=u(1+M);function oe(tt,lt){var Tt=P(lt);return Ttk&&--Lt>0);return[tt/(a(Tt)*(se-1/_(Tt))),x(lt)*Tt]};function J(){return y.geoProjection(oe).scale(112.314)}function me(tt){var lt=2*w/tt;function Tt(Lt,Vt){var Nt=y.geoAzimuthalEquidistantRaw(Lt,Vt);if(P(Lt)>D){var Yt=n(Nt[1],Nt[0]),Lr=V(Nt[0]*Nt[0]+Nt[1]*Nt[1]),$r=lt*b((Yt-D)/lt)+D,Zr=n(_(Yt-=$r),2-a(Yt));Yt=$r+B(w/Lr*_(Zr))-Zr,Nt[0]=Lr*a(Yt),Nt[1]=Lr*_(Yt)}return Nt}return Tt.invert=function(Lt,Vt){var Nt=V(Lt*Lt+Vt*Vt);if(Nt>D){var Yt=n(Vt,Lt),Lr=lt*b((Yt-D)/lt)+D,$r=Yt>Lr?-1:1,Zr=Nt*a(Lr-Yt),di=1/A($r*U((Zr-w)/V(w*(w-2*Zr)+Nt*Nt)));Yt=Lr+2*i((di+$r*V(di*di-3))/3),Lt=Nt*a(Yt),Vt=Nt*_(Yt)}return y.geoAzimuthalEquidistantRaw.invert(Lt,Vt)},Tt}function fe(){var tt=5,lt=y.geoProjectionMutator(me),Tt=lt(tt),Lt=Tt.stream,Vt=.01,Nt=-a(Vt*T),Yt=_(Vt*T);return Tt.lobes=function(Lr){return arguments.length?lt(tt=+Lr):tt},Tt.stream=function(Lr){var $r=Tt.rotate(),Zr=Lt(Lr),di=(Tt.rotate([0,0]),Lt(Lr));return Tt.rotate($r),Zr.sphere=function(){di.polygonStart(),di.lineStart();for(var zi=0,Ki=360/tt,nn=2*w/tt,kn=90-180/tt,Jn=D;zi0&&P(Vt)>f);return Lt<0?NaN:Tt}function Ge(tt,lt,Tt){return lt===void 0&&(lt=40),Tt===void 0&&(Tt=k),function(Lt,Vt,Nt,Yt){var Lr,$r,Zr;Nt=Nt===void 0?0:+Nt,Yt=Yt===void 0?0:+Yt;for(var di=0;diLr){Nt-=$r/=2,Yt-=Zr/=2;continue}Lr=kn;var Jn=(Nt>0?-1:1)*Tt,Sa=(Yt>0?-1:1)*Tt,wa=tt(Nt+Jn,Yt),Ba=tt(Nt,Yt+Sa),xo=(wa[0]-zi[0])/Jn,Go=(wa[1]-zi[1])/Jn,Bo=(Ba[0]-zi[0])/Sa,_s=(Ba[1]-zi[1])/Sa,wl=_s*xo-Go*Bo,Al=(P(wl)<.5?.5:1)/wl;if($r=(nn*Bo-Ki*_s)*Al,Zr=(Ki*Go-nn*xo)*Al,Nt+=$r,Yt+=Zr,P($r)0&&(Lr[1]*=1+$r/1.5*Lr[0]*Lr[0]),Lr}return Lt.invert=Ge(Lt),Lt}function _t(){return y.geoProjection(rt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function pt(tt,lt){var Tt=tt*_(lt),Lt=30,Vt;do lt-=Vt=(lt+_(lt)-Tt)/(1+a(lt));while(P(Vt)>f&&--Lt>0);return lt/2}function gt(tt,lt,Tt){function Lt(Vt,Nt){return[tt*Vt*a(Nt=pt(Tt,Nt)),lt*_(Nt)]}return Lt.invert=function(Vt,Nt){return Nt=B(Nt/lt),[Vt/(tt*a(Nt)),B((2*Nt+_(2*Nt))/Tt)]},Lt}var ct=gt(M/D,M,w);function Ae(){return y.geoProjection(ct).scale(169.529)}var ze=2.00276,Ee=1.11072;function nt(tt,lt){var Tt=pt(w,lt);return[ze*tt/(1/a(lt)+Ee/a(Tt)),(lt+M*_(Tt))/ze]}nt.invert=function(tt,lt){var Tt=ze*lt,Lt=lt<0?-E:E,Vt=25,Nt,Yt;do Yt=Tt-M*_(Lt),Lt-=Nt=(_(2*Lt)+2*Lt-w*_(Yt))/(2*a(2*Lt)+2+w*a(Yt)*M*a(Lt));while(P(Nt)>f&&--Vt>0);return Yt=Tt-M*_(Lt),[tt*(1/a(Yt)+Ee/a(Lt))/ze,Yt]};function xt(){return y.geoProjection(nt).scale(160.857)}function ut(tt){var lt=0,Tt=y.geoProjectionMutator(tt),Lt=Tt(lt);return Lt.parallel=function(Vt){return arguments.length?Tt(lt=Vt*T):lt*C},Lt}function Et(tt,lt){return[tt*a(lt),lt]}Et.invert=function(tt,lt){return[tt/a(lt),lt]};function Gt(){return y.geoProjection(Et).scale(152.63)}function Jt(tt){if(!tt)return Et;var lt=1/A(tt);function Tt(Lt,Vt){var Nt=lt+tt-Vt,Yt=Nt&&Lt*a(Vt)/Nt;return[Nt*_(Yt),lt-Nt*a(Yt)]}return Tt.invert=function(Lt,Vt){var Nt=V(Lt*Lt+(Vt=lt-Vt)*Vt),Yt=lt+tt-Nt;return[Nt/a(Yt)*n(Lt,Vt),Yt]},Tt}function gr(){return ut(Jt).scale(123.082).center([0,26.1441]).parallel(45)}function mr(tt){function lt(Tt,Lt){var Vt=D-Lt,Nt=Vt&&Tt*tt*_(Vt)/Vt;return[Vt*_(Nt)/tt,D-Vt*a(Nt)]}return lt.invert=function(Tt,Lt){var Vt=Tt*tt,Nt=D-Lt,Yt=V(Vt*Vt+Nt*Nt),Lr=n(Vt,Nt);return[(Yt?Yt/_(Yt):1)*Lr/tt,D-Yt]},lt}function Kr(){var tt=.5,lt=y.geoProjectionMutator(mr),Tt=lt(tt);return Tt.fraction=function(Lt){return arguments.length?lt(tt=+Lt):tt},Tt.scale(158.837)}var ri=gt(1,4/w,w);function Mr(){return y.geoProjection(ri).scale(152.63)}function ui(tt,lt,Tt,Lt,Vt,Nt){var Yt=a(Nt),Lr;if(P(tt)>1||P(Nt)>1)Lr=U(Tt*Vt+lt*Lt*Yt);else{var $r=_(tt/2),Zr=_(Nt/2);Lr=2*B(V($r*$r+lt*Lt*Zr*Zr))}return P(Lr)>f?[Lr,n(Lt*_(Nt),lt*Vt-Tt*Lt*Yt)]:[0,0]}function mi(tt,lt,Tt){return U((tt*tt+lt*lt-Tt*Tt)/(2*tt*lt))}function Ot(tt){return tt-2*w*o((tt+w)/(2*w))}function Je(tt,lt,Tt){for(var Lt=[[tt[0],tt[1],_(tt[1]),a(tt[1])],[lt[0],lt[1],_(lt[1]),a(lt[1])],[Tt[0],Tt[1],_(Tt[1]),a(Tt[1])]],Vt=Lt[2],Nt,Yt=0;Yt<3;++Yt,Vt=Nt)Nt=Lt[Yt],Vt.v=ui(Nt[1]-Vt[1],Vt[3],Vt[2],Nt[3],Nt[2],Nt[0]-Vt[0]),Vt.point=[0,0];var Lr=mi(Lt[0].v[0],Lt[2].v[0],Lt[1].v[0]),$r=mi(Lt[0].v[0],Lt[1].v[0],Lt[2].v[0]),Zr=w-Lr;Lt[2].point[1]=0,Lt[0].point[0]=-(Lt[1].point[0]=Lt[0].v[0]/2);var di=[Lt[2].point[0]=Lt[0].point[0]+Lt[2].v[0]*a(Lr),2*(Lt[0].point[1]=Lt[1].point[1]=Lt[2].v[0]*_(Lr))];function zi(Ki,nn){var kn=_(nn),Jn=a(nn),Sa=new Array(3),wa;for(wa=0;wa<3;++wa){var Ba=Lt[wa];if(Sa[wa]=ui(nn-Ba[1],Ba[3],Ba[2],Jn,kn,Ki-Ba[0]),!Sa[wa][0])return Ba.point;Sa[wa][1]=Ot(Sa[wa][1]-Ba.v[1])}var xo=di.slice();for(wa=0;wa<3;++wa){var Go=wa==2?0:wa+1,Bo=mi(Lt[wa].v[0],Sa[wa][0],Sa[Go][0]);Sa[wa][1]<0&&(Bo=-Bo),wa?wa==1?(Bo=$r-Bo,xo[0]-=Sa[wa][0]*a(Bo),xo[1]-=Sa[wa][0]*_(Bo)):(Bo=Zr-Bo,xo[0]+=Sa[wa][0]*a(Bo),xo[1]+=Sa[wa][0]*_(Bo)):(xo[0]+=Sa[wa][0]*a(Bo),xo[1]-=Sa[wa][0]*_(Bo))}return xo[0]/=3,xo[1]/=3,xo}return zi}function ot(tt){return tt[0]*=T,tt[1]*=T,tt}function De(){return ye([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ye(tt,lt,Tt){var Lt=y.geoCentroid({type:"MultiPoint",coordinates:[tt,lt,Tt]}),Vt=[-Lt[0],-Lt[1]],Nt=y.geoRotation(Vt),Yt=Je(ot(Nt(tt)),ot(Nt(lt)),ot(Nt(Tt)));Yt.invert=Ge(Yt);var Lr=y.geoProjection(Yt).rotate(Vt),$r=Lr.center;return delete Lr.rotate,Lr.center=function(Zr){return arguments.length?$r(Nt(Zr)):Nt.invert($r())},Lr.clipAngle(90)}function Pe(tt,lt){var Tt=V(1-_(lt));return[2/p*tt*Tt,p*(1-Tt)]}Pe.invert=function(tt,lt){var Tt=(Tt=lt/p-1)*Tt;return[Tt>0?tt*V(w/Tt)/2:0,B(1-Tt)]};function He(){return y.geoProjection(Pe).scale(95.6464).center([0,30])}function at(tt){var lt=A(tt);function Tt(Lt,Vt){return[Lt,(Lt?Lt/_(Lt):1)*(_(Vt)*a(Lt)-lt*a(Vt))]}return Tt.invert=lt?function(Lt,Vt){Lt&&(Vt*=_(Lt)/Lt);var Nt=a(Lt);return[Lt,2*n(V(Nt*Nt+lt*lt-Vt*Vt)-Nt,lt-Vt)]}:function(Lt,Vt){return[Lt,B(Lt?Vt*A(Lt)/Lt:Vt)]},Tt}function ht(){return ut(at).scale(249.828).clipAngle(90)}var At=V(3);function Wt(tt,lt){return[At*tt*(2*a(2*lt/3)-1)/p,At*p*_(lt/3)]}Wt.invert=function(tt,lt){var Tt=3*B(lt/(At*p));return[p*tt/(At*(2*a(2*Tt/3)-1)),Tt]};function Kt(){return y.geoProjection(Wt).scale(156.19)}function hr(tt){var lt=a(tt);function Tt(Lt,Vt){return[Lt*lt,_(Vt)/lt]}return Tt.invert=function(Lt,Vt){return[Lt/lt,B(Vt*lt)]},Tt}function zr(){return ut(hr).parallel(38.58).scale(195.044)}function Dr(tt){var lt=a(tt);function Tt(Lt,Vt){return[Lt*lt,(1+lt)*A(Vt/2)]}return Tt.invert=function(Lt,Vt){return[Lt/lt,i(Vt/(1+lt))*2]},Tt}function br(){return ut(Dr).scale(124.75)}function hi(tt,lt){var Tt=V(8/(3*w));return[Tt*tt*(1-P(lt)/w),Tt*lt]}hi.invert=function(tt,lt){var Tt=V(8/(3*w)),Lt=lt/Tt;return[tt/(Tt*(1-P(Lt)/w)),Lt]};function un(){return y.geoProjection(hi).scale(165.664)}function cn(tt,lt){var Tt=V(4-3*_(P(lt)));return[2/V(6*w)*tt*Tt,x(lt)*V(2*w/3)*(2-Tt)]}cn.invert=function(tt,lt){var Tt=2-P(lt)/V(2*w/3);return[tt*V(6*w)/(2*Tt),x(lt)*B((4-Tt*Tt)/3)]};function yn(){return y.geoProjection(cn).scale(165.664)}function Wn(tt,lt){var Tt=V(w*(4+w));return[2/Tt*tt*(1+V(1-4*lt*lt/(w*w))),4/Tt*lt]}Wn.invert=function(tt,lt){var Tt=V(w*(4+w))/2;return[tt*Tt/(1+V(1-lt*lt*(4+w)/(4*w))),lt*Tt/2]};function Sn(){return y.geoProjection(Wn).scale(180.739)}function fn(tt,lt){var Tt=(2+D)*_(lt);lt/=2;for(var Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;Lt++){var Nt=a(lt);lt-=Vt=(lt+_(lt)*(Nt+2)-Tt)/(2*Nt*(1+Nt))}return[2/V(w*(4+w))*tt*(1+a(lt)),2*V(w/(4+w))*_(lt)]}fn.invert=function(tt,lt){var Tt=lt*V((4+w)/w)/2,Lt=B(Tt),Vt=a(Lt);return[tt/(2/V(w*(4+w))*(1+Vt)),B((Lt+Tt*(Vt+2))/(2+D))]};function ga(){return y.geoProjection(fn).scale(180.739)}function na(tt,lt){return[tt*(1+a(lt))/V(2+w),2*lt/V(2+w)]}na.invert=function(tt,lt){var Tt=V(2+w),Lt=lt*Tt/2;return[Tt*tt/(1+a(Lt)),Lt]};function Zt(){return y.geoProjection(na).scale(173.044)}function sr(tt,lt){for(var Tt=(1+D)*_(lt),Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;Lt++)lt-=Vt=(lt+_(lt)-Tt)/(1+a(lt));return Tt=V(2+w),[tt*(1+a(lt))/Tt,2*lt/Tt]}sr.invert=function(tt,lt){var Tt=1+D,Lt=V(Tt/2);return[tt*2*Lt/(1+a(lt*=Lt)),B((lt+_(lt))/Tt)]};function _r(){return y.geoProjection(sr).scale(173.044)}var Cr=3+2*M;function fi(tt,lt){var Tt=_(tt/=2),Lt=a(tt),Vt=V(a(lt)),Nt=a(lt/=2),Yt=_(lt)/(Nt+M*Lt*Vt),Lr=V(2/(1+Yt*Yt)),$r=V((M*Nt+(Lt+Tt)*Vt)/(M*Nt+(Lt-Tt)*Vt));return[Cr*(Lr*($r-1/$r)-2*u($r)),Cr*(Lr*Yt*($r+1/$r)-2*i(Yt))]}fi.invert=function(tt,lt){if(!(Nt=ge.invert(tt/1.2,lt*1.065)))return null;var Tt=Nt[0],Lt=Nt[1],Vt=20,Nt;tt/=Cr,lt/=Cr;do{var Yt=Tt/2,Lr=Lt/2,$r=_(Yt),Zr=a(Yt),di=_(Lr),zi=a(Lr),Ki=a(Lt),nn=V(Ki),kn=di/(zi+M*Zr*nn),Jn=kn*kn,Sa=V(2/(1+Jn)),wa=M*zi+(Zr+$r)*nn,Ba=M*zi+(Zr-$r)*nn,xo=wa/Ba,Go=V(xo),Bo=Go-1/Go,_s=Go+1/Go,wl=Sa*Bo-2*u(Go)-tt,Al=Sa*kn*_s-2*i(kn)-lt,Us=di&&I*nn*$r*Jn/di,Pl=(M*Zr*zi+nn)/(2*(zi+M*Zr*nn)*(zi+M*Zr*nn)*nn),Ru=-.5*kn*Sa*Sa*Sa,Tu=Ru*Us,Js=Ru*Pl,Qs=(Qs=2*zi+M*nn*(Zr-$r))*Qs*Go,nc=(M*Zr*zi*nn+Ki)/Qs,wc=-(M*$r*di)/(nn*Qs),ih=Bo*Tu-2*nc/Go+Sa*(nc+nc/xo),Me=Bo*Js-2*wc/Go+Sa*(wc+wc/xo),Ve=kn*_s*Tu-2*Us/(1+Jn)+Sa*_s*Us+Sa*kn*(nc-nc/xo),ft=kn*_s*Js-2*Pl/(1+Jn)+Sa*_s*Pl+Sa*kn*(wc-wc/xo),Pt=Me*Ve-ft*ih;if(!Pt)break;var Bt=(Al*Me-wl*ft)/Pt,Ht=(wl*Ve-Al*ih)/Pt;Tt-=Bt,Lt=s(-D,h(D,Lt-Ht))}while((P(Bt)>f||P(Ht)>f)&&--Vt>0);return P(P(Lt)-D)Lt){var zi=V(di),Ki=n(Zr,$r),nn=Tt*b(Ki/Tt),kn=Ki-nn,Jn=tt*a(kn),Sa=(tt*_(kn)-kn*_(Jn))/(D-Jn),wa=Rt(kn,Sa),Ba=(w-tt)/qr(wa,Jn,w);$r=zi;var xo=50,Go;do $r-=Go=(tt+qr(wa,Jn,$r)*Ba-zi)/(wa($r)*Ba);while(P(Go)>f&&--xo>0);Zr=kn*_($r),$rLt){var $r=V(Lr),Zr=n(Yt,Nt),di=Tt*b(Zr/Tt),zi=Zr-di;Nt=$r*a(zi),Yt=$r*_(zi);for(var Ki=Nt-D,nn=_(Nt),kn=Yt/nn,Jn=Ntf||P(kn)>f)&&--Jn>0);return[zi,Ki]},$r}var Gr=oi(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function si(){return y.geoProjection(Gr).scale(149.995)}var Pi=oi(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function yi(){return y.geoProjection(Pi).scale(153.93)}var zt=oi(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function xr(){return y.geoProjection(zt).scale(130.945)}function Jr(tt,lt){var Tt=tt*tt,Lt=lt*lt;return[tt*(1-.162388*Lt)*(.87-952426e-9*Tt*Tt),lt*(1+Lt/12)]}Jr.invert=function(tt,lt){var Tt=tt,Lt=lt,Vt=50,Nt;do{var Yt=Lt*Lt;Lt-=Nt=(Lt*(1+Yt/12)-lt)/(1+Yt/4)}while(P(Nt)>f&&--Vt>0);Vt=50,tt/=1-.162388*Yt;do{var Lr=(Lr=Tt*Tt)*Lr;Tt-=Nt=(Tt*(.87-952426e-9*Lr)-tt)/(.87-.00476213*Lr)}while(P(Nt)>f&&--Vt>0);return[Tt,Lt]};function Ri(){return y.geoProjection(Jr).scale(131.747)}var tn=oi(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function _n(){return y.geoProjection(tn).scale(131.087)}function Zi(tt){var lt=tt(D,0)[0]-tt(-D,0)[0];function Tt(Lt,Vt){var Nt=Lt>0?-.5:.5,Yt=tt(Lt+Nt*w,Vt);return Yt[0]-=Nt*lt,Yt}return tt.invert&&(Tt.invert=function(Lt,Vt){var Nt=Lt>0?-.5:.5,Yt=tt.invert(Lt+Nt*lt,Vt),Lr=Yt[0]-Nt*w;return Lr<-w?Lr+=2*w:Lr>w&&(Lr-=2*w),Yt[0]=Lr,Yt}),Tt}function Wi(tt,lt){var Tt=x(tt),Lt=x(lt),Vt=a(lt),Nt=a(tt)*Vt,Yt=_(tt)*Vt,Lr=_(Lt*lt);tt=P(n(Yt,Lr)),lt=B(Nt),P(tt-D)>f&&(tt%=D);var $r=dn(tt>w/4?D-tt:tt,lt);return tt>w/4&&(Lr=$r[0],$r[0]=-$r[1],$r[1]=-Lr),$r[0]*=Tt,$r[1]*=-Lt,$r}Wi.invert=function(tt,lt){P(tt)>1&&(tt=x(tt)*2-tt),P(lt)>1&&(lt=x(lt)*2-lt);var Tt=x(tt),Lt=x(lt),Vt=-Tt*tt,Nt=-Lt*lt,Yt=Nt/Vt<1,Lr=Ua(Yt?Nt:Vt,Yt?Vt:Nt),$r=Lr[0],Zr=Lr[1],di=a(Zr);return Yt&&($r=-D-$r),[Tt*(n(_($r)*di,-_(Zr))+w),Lt*B(a($r)*di)]};function dn(tt,lt){if(lt===D)return[0,0];var Tt=_(lt),Lt=Tt*Tt,Vt=Lt*Lt,Nt=1+Vt,Yt=1+3*Vt,Lr=1-Vt,$r=B(1/V(Nt)),Zr=Lr+Lt*Nt*$r,di=(1-Tt)/Zr,zi=V(di),Ki=di*Nt,nn=V(Ki),kn=zi*Lr,Jn,Sa;if(tt===0)return[0,-(kn+Lt*nn)];var wa=a(lt),Ba=1/wa,xo=2*Tt*wa,Go=(-3*Lt+$r*Yt)*xo,Bo=(-Zr*wa-(1-Tt)*Go)/(Zr*Zr),_s=.5*Bo/zi,wl=Lr*_s-2*Lt*zi*xo,Al=Lt*Nt*Bo+di*Yt*xo,Us=-Ba*xo,Pl=-Ba*Al,Ru=-2*Ba*wl,Tu=4*tt/w,Js;if(tt>.222*w||lt.175*w){if(Jn=(kn+Lt*V(Ki*(1+Vt)-kn*kn))/(1+Vt),tt>w/4)return[Jn,Jn];var Qs=Jn,nc=.5*Jn;Jn=.5*(nc+Qs),Sa=50;do{var wc=V(Ki-Jn*Jn),ih=Jn*(Ru+Us*wc)+Pl*B(Jn/nn)-Tu;if(!ih)break;ih<0?nc=Jn:Qs=Jn,Jn=.5*(nc+Qs)}while(P(Qs-nc)>f&&--Sa>0)}else{Jn=f,Sa=25;do{var Me=Jn*Jn,Ve=V(Ki-Me),ft=Ru+Us*Ve,Pt=Jn*ft+Pl*B(Jn/nn)-Tu,Bt=ft+(Pl-Us*Me)/Ve;Jn-=Js=Ve?Pt/Bt:0}while(P(Js)>f&&--Sa>0)}return[Jn,-kn-Lt*V(Ki-Jn*Jn)]}function Ua(tt,lt){for(var Tt=0,Lt=1,Vt=.5,Nt=50;;){var Yt=Vt*Vt,Lr=V(Vt),$r=B(1/V(1+Yt)),Zr=1-Yt+Vt*(1+Yt)*$r,di=(1-Lr)/Zr,zi=V(di),Ki=di*(1+Yt),nn=zi*(1-Yt),kn=Ki-tt*tt,Jn=V(kn),Sa=lt+nn+Vt*Jn;if(P(Lt-Tt)0?Tt=Vt:Lt=Vt,Vt=.5*(Tt+Lt)}if(!Nt)return null;var wa=B(Lr),Ba=a(wa),xo=1/Ba,Go=2*Lr*Ba,Bo=(-3*Vt+$r*(1+3*Yt))*Go,_s=(-Zr*Ba-(1-Lr)*Bo)/(Zr*Zr),wl=.5*_s/zi,Al=(1-Yt)*wl-2*Vt*zi*Go,Us=-2*xo*Al,Pl=-xo*Go,Ru=-xo*(Vt*(1+Yt)*_s+di*(1+3*Yt)*Go);return[w/4*(tt*(Us+Pl*Jn)+Ru*B(tt/V(Ki))),wa]}function ea(){return y.geoProjection(Zi(Wi)).scale(239.75)}function fo(tt,lt,Tt){var Lt,Vt,Nt;return tt?(Lt=ho(tt,Tt),lt?(Vt=ho(lt,1-Tt),Nt=Vt[1]*Vt[1]+Tt*Lt[0]*Lt[0]*Vt[0]*Vt[0],[[Lt[0]*Vt[2]/Nt,Lt[1]*Lt[2]*Vt[0]*Vt[1]/Nt],[Lt[1]*Vt[1]/Nt,-Lt[0]*Lt[2]*Vt[0]*Vt[2]/Nt],[Lt[2]*Vt[1]*Vt[2]/Nt,-Tt*Lt[0]*Lt[1]*Vt[0]/Nt]]):[[Lt[0],0],[Lt[1],0],[Lt[2],0]]):(Vt=ho(lt,1-Tt),[[0,Vt[0]/Vt[1]],[1/Vt[1],0],[Vt[2]/Vt[1],0]])}function ho(tt,lt){var Tt,Lt,Vt,Nt,Yt;if(lt=1-f)return Tt=(1-lt)/4,Lt=$(tt),Nt=W(tt),Vt=1/Lt,Yt=Lt*F(tt),[Nt+Tt*(Yt-tt)/(Lt*Lt),Vt-Tt*Nt*Vt*(Yt-tt),Vt+Tt*Nt*Vt*(Yt+tt),2*i(l(tt))-D+Tt*(Yt-tt)/Lt];var Lr=[1,0,0,0,0,0,0,0,0],$r=[V(lt),0,0,0,0,0,0,0,0],Zr=0;for(Lt=V(1-lt),Yt=1;P($r[Zr]/Lr[Zr])>f&&Zr<8;)Tt=Lr[Zr++],$r[Zr]=(Tt-Lt)/2,Lr[Zr]=(Tt+Lt)/2,Lt=V(Tt*Lt),Yt*=2;Vt=Yt*Lr[Zr]*tt;do Nt=$r[Zr]*_(Lt=Vt)/Lr[Zr],Vt=(B(Nt)+Vt)/2;while(--Zr);return[_(Vt),Nt=a(Vt),Nt/a(Vt-Lt),Vt]}function Vo(tt,lt,Tt){var Lt=P(tt),Vt=P(lt),Nt=F(Vt);if(Lt){var Yt=1/_(Lt),Lr=1/(A(Lt)*A(Lt)),$r=-(Lr+Tt*(Nt*Nt*Yt*Yt)-1+Tt),Zr=(Tt-1)*Lr,di=(-$r+V($r*$r-4*Zr))/2;return[Ao(i(1/V(di)),Tt)*x(tt),Ao(i(V((di/Lr-1)/Tt)),1-Tt)*x(lt)]}return[0,Ao(i(Nt),1-Tt)*x(lt)]}function Ao(tt,lt){if(!lt)return tt;if(lt===1)return u(A(tt/2+E));for(var Tt=1,Lt=V(1-lt),Vt=V(lt),Nt=0;P(Vt)>f;Nt++){if(tt%w){var Yt=i(Lt*A(tt)/Tt);Yt<0&&(Yt+=w),tt+=Yt+~~(tt/w)*w}else tt+=tt;Vt=(Tt+Lt)/2,Lt=V(Tt*Lt),Vt=((Tt=Vt)-Lt)/2}return tt/(m(2,Nt)*Tt)}function Wo(tt,lt){var Tt=(M-1)/(M+1),Lt=V(1-Tt*Tt),Vt=Ao(D,Lt*Lt),Nt=-1,Yt=u(A(w/4+P(lt)/2)),Lr=l(Nt*Yt)/V(Tt),$r=Wa(Lr*a(Nt*tt),Lr*_(Nt*tt)),Zr=Vo($r[0],$r[1],Lt*Lt);return[-Zr[1],(lt>=0?1:-1)*(.5*Vt-Zr[0])]}function Wa(tt,lt){var Tt=tt*tt,Lt=lt+1,Vt=1-Tt-lt*lt;return[.5*((tt>=0?D:-D)-n(Vt,2*tt)),-.25*u(Vt*Vt+4*Tt)+.5*u(Lt*Lt+Tt)]}function ks(tt,lt){var Tt=lt[0]*lt[0]+lt[1]*lt[1];return[(tt[0]*lt[0]+tt[1]*lt[1])/Tt,(tt[1]*lt[0]-tt[0]*lt[1])/Tt]}Wo.invert=function(tt,lt){var Tt=(M-1)/(M+1),Lt=V(1-Tt*Tt),Vt=Ao(D,Lt*Lt),Nt=-1,Yt=fo(.5*Vt-lt,-tt,Lt*Lt),Lr=ks(Yt[0],Yt[1]),$r=n(Lr[1],Lr[0])/Nt;return[$r,2*i(l(.5/Nt*u(Tt*Lr[0]*Lr[0]+Tt*Lr[1]*Lr[1])))-D]};function fs(){return y.geoProjection(Zi(Wo)).scale(151.496)}function _l(tt){var lt=_(tt),Tt=a(tt),Lt=es(tt);Lt.invert=es(-tt);function Vt(Nt,Yt){var Lr=Lt(Nt,Yt);Nt=Lr[0],Yt=Lr[1];var $r=_(Yt),Zr=a(Yt),di=a(Nt),zi=U(lt*$r+Tt*Zr*di),Ki=_(zi),nn=P(Ki)>f?zi/Ki:1;return[nn*Tt*_(Nt),(P(Nt)>D?nn:-nn)*(lt*Zr-Tt*$r*di)]}return Vt.invert=function(Nt,Yt){var Lr=V(Nt*Nt+Yt*Yt),$r=-_(Lr),Zr=a(Lr),di=Lr*Zr,zi=-Yt*$r,Ki=Lr*lt,nn=V(di*di+zi*zi-Ki*Ki),kn=n(di*Ki+zi*nn,zi*Ki-di*nn),Jn=(Lr>D?-1:1)*n(Nt*$r,Lr*a(kn)*Zr+Yt*_(kn)*$r);return Lt.invert(Jn,kn)},Vt}function es(tt){var lt=_(tt),Tt=a(tt);return function(Lt,Vt){var Nt=a(Vt),Yt=a(Lt)*Nt,Lr=_(Lt)*Nt,$r=_(Vt);return[n(Lr,Yt*Tt-$r*lt),B($r*Tt+Yt*lt)]}}function rl(){var tt=0,lt=y.geoProjectionMutator(_l),Tt=lt(tt),Lt=Tt.rotate,Vt=Tt.stream,Nt=y.geoCircle();return Tt.parallel=function(Yt){if(!arguments.length)return tt*C;var Lr=Tt.rotate();return lt(tt=Yt*T).rotate(Lr)},Tt.rotate=function(Yt){return arguments.length?(Lt.call(Tt,[Yt[0],Yt[1]-tt*C]),Nt.center([-Yt[0],-Yt[1]]),Tt):(Yt=Lt.call(Tt),Yt[1]+=tt*C,Yt)},Tt.stream=function(Yt){return Yt=Vt(Yt),Yt.sphere=function(){Yt.polygonStart();var Lr=.01,$r=Nt.radius(90-Lr)().coordinates[0],Zr=$r.length-1,di=-1,zi;for(Yt.lineStart();++di=0;)Yt.point((zi=$r[di])[0],zi[1]);Yt.lineEnd(),Yt.polygonEnd()},Yt},Tt.scale(79.4187).parallel(45).clipAngle(180-.001)}var ds=3,xl=B(1-1/ds)*C,ol=hr(0);function Gl(tt){var lt=xl*T,Tt=Pe(w,lt)[0]-Pe(-w,lt)[0],Lt=ol(0,lt)[1],Vt=Pe(0,lt)[1],Nt=p-Vt,Yt=g/tt,Lr=4/g,$r=Lt+Nt*Nt*4/g;function Zr(di,zi){var Ki,nn=P(zi);if(nn>lt){var kn=h(tt-1,s(0,o((di+w)/Yt)));di+=w*(tt-1)/tt-kn*Yt,Ki=Pe(di,nn),Ki[0]=Ki[0]*g/Tt-g*(tt-1)/(2*tt)+kn*g/tt,Ki[1]=Lt+(Ki[1]-Vt)*4*Nt/g,zi<0&&(Ki[1]=-Ki[1])}else Ki=ol(di,zi);return Ki[0]*=Lr,Ki[1]/=$r,Ki}return Zr.invert=function(di,zi){di/=Lr,zi*=$r;var Ki=P(zi);if(Ki>Lt){var nn=h(tt-1,s(0,o((di+w)/Yt)));di=(di+w*(tt-1)/tt-nn*Yt)*Tt/g;var kn=Pe.invert(di,.25*(Ki-Lt)*g/Nt+Vt);return kn[0]-=w*(tt-1)/tt-nn*Yt,zi<0&&(kn[1]=-kn[1]),kn}return ol.invert(di,zi)},Zr}function ms(tt,lt){return[tt,lt&1?90-f:xl]}function Bs(tt,lt){return[tt,lt&1?-90+f:-xl]}function No(tt){return[tt[0]*(1-f),tt[1]]}function Es(tt){var lt=[].concat(z.range(-180,180+tt/2,tt).map(ms),z.range(180,-180-tt/2,-tt).map(Bs));return{type:"Polygon",coordinates:[tt===180?lt.map(No):lt]}}function Il(){var tt=4,lt=y.geoProjectionMutator(Gl),Tt=lt(tt),Lt=Tt.stream;return Tt.lobes=function(Vt){return arguments.length?lt(tt=+Vt):tt},Tt.stream=function(Vt){var Nt=Tt.rotate(),Yt=Lt(Vt),Lr=(Tt.rotate([0,0]),Lt(Vt));return Tt.rotate(Nt),Yt.sphere=function(){y.geoStream(Es(180/tt),Lr)},Yt},Tt.scale(239.75)}function Jl(tt){var lt=1+tt,Tt=_(1/lt),Lt=B(Tt),Vt=2*V(w/(Nt=w+4*Lt*lt)),Nt,Yt=.5*Vt*(lt+V(tt*(2+tt))),Lr=tt*tt,$r=lt*lt;function Zr(di,zi){var Ki=1-_(zi),nn,kn;if(Ki&&Ki<2){var Jn=D-zi,Sa=25,wa;do{var Ba=_(Jn),xo=a(Jn),Go=Lt+n(Ba,lt-xo),Bo=1+$r-2*lt*xo;Jn-=wa=(Jn-Lr*Lt-lt*Ba+Bo*Go-.5*Ki*Nt)/(2*lt*Ba*Go)}while(P(wa)>k&&--Sa>0);nn=Vt*V(Bo),kn=di*Go/w}else nn=Vt*(tt+Ki),kn=di*Lt/w;return[nn*_(kn),Yt-nn*a(kn)]}return Zr.invert=function(di,zi){var Ki=di*di+(zi-=Yt)*zi,nn=(1+$r-Ki/(Vt*Vt))/(2*lt),kn=U(nn),Jn=_(kn),Sa=Lt+n(Jn,lt-nn);return[B(di/V(Ki))*w/Sa,B(1-2*(kn-Lr*Lt-lt*Jn+(1+$r-2*lt*nn)*Sa)/Nt)]},Zr}function ou(){var tt=1,lt=y.geoProjectionMutator(Jl),Tt=lt(tt);return Tt.ratio=function(Lt){return arguments.length?lt(tt=+Lt):tt},Tt.scale(167.774).center([0,18.67])}var Gs=.7109889596207567,$a=.0528035274542;function So(tt,lt){return lt>-Gs?(tt=ct(tt,lt),tt[1]+=$a,tt):Et(tt,lt)}So.invert=function(tt,lt){return lt>-Gs?ct.invert(tt,lt-$a):Et.invert(tt,lt)};function Xs(){return y.geoProjection(So).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function su(tt,lt){return P(lt)>Gs?(tt=ct(tt,lt),tt[1]-=lt>0?$a:-$a,tt):Et(tt,lt)}su.invert=function(tt,lt){return P(lt)>Gs?ct.invert(tt,lt+(lt>0?$a:-$a)):Et.invert(tt,lt)};function is(){return y.geoProjection(su).scale(152.63)}function tu(tt,lt,Tt,Lt){var Vt=V(4*w/(2*Tt+(1+tt-lt/2)*_(2*Tt)+(tt+lt)/2*_(4*Tt)+lt/2*_(6*Tt))),Nt=V(Lt*_(Tt)*V((1+tt*a(2*Tt)+lt*a(4*Tt))/(1+tt+lt))),Yt=Tt*$r(1);function Lr(zi){return V(1+tt*a(2*zi)+lt*a(4*zi))}function $r(zi){var Ki=zi*Tt;return(2*Ki+(1+tt-lt/2)*_(2*Ki)+(tt+lt)/2*_(4*Ki)+lt/2*_(6*Ki))/Tt}function Zr(zi){return Lr(zi)*_(zi)}var di=function(zi,Ki){var nn=Tt*Ze($r,Yt*_(Ki)/Tt,Ki/w);isNaN(nn)&&(nn=Tt*x(Ki));var kn=Vt*Lr(nn);return[kn*Nt*zi/w*a(nn),kn/Nt*_(nn)]};return di.invert=function(zi,Ki){var nn=Ze(Zr,Ki*Nt/Vt);return[zi*w/(a(nn)*Vt*Nt*Lr(nn)),B(Tt*$r(nn/Tt)/Yt)]},Tt===0&&(Vt=V(Lt/w),di=function(zi,Ki){return[zi*Vt,_(Ki)/Vt]},di.invert=function(zi,Ki){return[zi/Vt,B(Ki*Vt)]}),di}function pl(){var tt=1,lt=0,Tt=45*T,Lt=2,Vt=y.geoProjectionMutator(tu),Nt=Vt(tt,lt,Tt,Lt);return Nt.a=function(Yt){return arguments.length?Vt(tt=+Yt,lt,Tt,Lt):tt},Nt.b=function(Yt){return arguments.length?Vt(tt,lt=+Yt,Tt,Lt):lt},Nt.psiMax=function(Yt){return arguments.length?Vt(tt,lt,Tt=+Yt*T,Lt):Tt*C},Nt.ratio=function(Yt){return arguments.length?Vt(tt,lt,Tt,Lt=+Yt):Lt},Nt.scale(180.739)}function Nl(tt,lt,Tt,Lt,Vt,Nt,Yt,Lr,$r,Zr,di){if(di.nanEncountered)return NaN;var zi,Ki,nn,kn,Jn,Sa,wa,Ba,xo,Go;if(zi=Tt-lt,Ki=tt(lt+zi*.25),nn=tt(Tt-zi*.25),isNaN(Ki)){di.nanEncountered=!0;return}if(isNaN(nn)){di.nanEncountered=!0;return}return kn=zi*(Lt+4*Ki+Vt)/12,Jn=zi*(Vt+4*nn+Nt)/12,Sa=kn+Jn,Go=(Sa-Yt)/15,Zr>$r?(di.maxDepthCount++,Sa+Go):Math.abs(Go)>1;do $r[Sa]>nn?Jn=Sa:kn=Sa,Sa=kn+Jn>>1;while(Sa>kn);var wa=$r[Sa+1]-$r[Sa];return wa&&(wa=(nn-$r[Sa+1])/wa),(Sa+1+wa)/Yt}var zi=2*di(1)/w*Nt/Tt,Ki=function(nn,kn){var Jn=di(P(_(kn))),Sa=Lt(Jn)*nn;return Jn/=zi,[Sa,kn>=0?Jn:-Jn]};return Ki.invert=function(nn,kn){var Jn;return kn*=zi,P(kn)<1&&(Jn=x(kn)*B(Vt(P(kn))*Nt)),[nn/Lt(P(kn)),Jn]},Ki}function Ls(){var tt=0,lt=2.5,Tt=1.183136,Lt=y.geoProjectionMutator(bo),Vt=Lt(tt,lt,Tt);return Vt.alpha=function(Nt){return arguments.length?Lt(tt=+Nt,lt,Tt):tt},Vt.k=function(Nt){return arguments.length?Lt(tt,lt=+Nt,Tt):lt},Vt.gamma=function(Nt){return arguments.length?Lt(tt,lt,Tt=+Nt):Tt},Vt.scale(152.63)}function Rs(tt,lt){return P(tt[0]-lt[0])=0;--$r)Tt=tt[1][$r],Lt=Tt[0][0],Vt=Tt[0][1],Nt=Tt[1][1],Yt=Tt[2][0],Lr=Tt[2][1],lt.push(pu([[Yt-f,Lr-f],[Yt-f,Nt+f],[Lt+f,Nt+f],[Lt+f,Vt-f]],30));return{type:"Polygon",coordinates:[z.merge(lt)]}}function ls(tt,lt,Tt){var Lt,Vt;function Nt($r,Zr){for(var di=Zr<0?-1:1,zi=lt[+(Zr<0)],Ki=0,nn=zi.length-1;Kizi[Ki][2][0];++Ki);var kn=tt($r-zi[Ki][1][0],Zr);return kn[0]+=tt(zi[Ki][1][0],di*Zr>di*zi[Ki][0][1]?zi[Ki][0][1]:Zr)[0],kn}Tt?Nt.invert=Tt(Nt):tt.invert&&(Nt.invert=function($r,Zr){for(var di=Vt[+(Zr<0)],zi=lt[+(Zr<0)],Ki=0,nn=di.length;Kikn&&(Jn=nn,nn=kn,kn=Jn),[[zi,nn],[Ki,kn]]})}),Yt):lt.map(function(Zr){return Zr.map(function(di){return[[di[0][0]*C,di[0][1]*C],[di[1][0]*C,di[1][1]*C],[di[2][0]*C,di[2][1]*C]]})})},lt!=null&&Yt.lobes(lt),Yt}var Bu=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ic(){return ls(nt,Bu).scale(160.857)}var Ll=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Hl(){return ls(su,Ll).scale(152.63)}var lu=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hu(){return ls(ct,lu).scale(169.529)}var pc=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ah(){return ls(ct,pc).scale(169.529).rotate([20,0])}var uh=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function gh(){return ls(So,uh,Ge).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Qf=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Ff(){return ls(Et,Qf).scale(152.63).rotate([-20,0])}function Vl(tt,lt){return[3/g*tt*V(w*w/3-lt*lt),lt]}Vl.invert=function(tt,lt){return[g/3*tt/V(w*w/3-lt*lt),lt]};function Kc(){return y.geoProjection(Vl).scale(158.837)}function ed(tt){function lt(Tt,Lt){if(P(P(Lt)-D)2)return null;Tt/=2,Lt/=2;var Nt=Tt*Tt,Yt=Lt*Lt,Lr=2*Lt/(1+Nt+Yt);return Lr=m((1+Lr)/(1-Lr),1/tt),[n(2*Tt,1-Nt-Yt)/tt,B((Lr-1)/(Lr+1))]},lt}function xc(){var tt=.5,lt=y.geoProjectionMutator(ed),Tt=lt(tt);return Tt.spacing=function(Lt){return arguments.length?lt(tt=+Lt):tt},Tt.scale(124.75)}var mc=w/M;function bc(tt,lt){return[tt*(1+V(a(lt)))/2,lt/(a(lt/2)*a(tt/6))]}bc.invert=function(tt,lt){var Tt=P(tt),Lt=P(lt),Vt=f,Nt=D;Ltf||P(Sa)>f)&&--Vt>0);return Vt&&[Tt,Lt]};function gc(){return y.geoProjection(yu).scale(139.98)}function hl(tt,lt){return[_(tt)/a(lt),A(lt)*a(tt)]}hl.invert=function(tt,lt){var Tt=tt*tt,Lt=lt*lt,Vt=Lt+1,Nt=Tt+Vt,Yt=tt?I*V((Nt-V(Nt*Nt-4*Tt))/Tt):1/V(Vt);return[B(tt*Yt),x(lt)*U(Yt)]};function ru(){return y.geoProjection(hl).scale(144.049).clipAngle(90-.001)}function Fh(tt){var lt=a(tt),Tt=A(E+tt/2);function Lt(Vt,Nt){var Yt=Nt-tt,Lr=P(Yt)=0;)di=tt[Zr],zi=di[0]+Lr*(nn=zi)-$r*Ki,Ki=di[1]+Lr*Ki+$r*nn;return zi=Lr*(nn=zi)-$r*Ki,Ki=Lr*Ki+$r*nn,[zi,Ki]}return Tt.invert=function(Lt,Vt){var Nt=20,Yt=Lt,Lr=Vt;do{for(var $r=lt,Zr=tt[$r],di=Zr[0],zi=Zr[1],Ki=0,nn=0,kn;--$r>=0;)Zr=tt[$r],Ki=di+Yt*(kn=Ki)-Lr*nn,nn=zi+Yt*nn+Lr*kn,di=Zr[0]+Yt*(kn=di)-Lr*zi,zi=Zr[1]+Yt*zi+Lr*kn;Ki=di+Yt*(kn=Ki)-Lr*nn,nn=zi+Yt*nn+Lr*kn,di=Yt*(kn=di)-Lr*zi-Lt,zi=Yt*zi+Lr*kn-Vt;var Jn=Ki*Ki+nn*nn,Sa,wa;Yt-=Sa=(di*Ki+zi*nn)/Jn,Lr-=wa=(zi*Ki-di*nn)/Jn}while(P(Sa)+P(wa)>f*f&&--Nt>0);if(Nt){var Ba=V(Yt*Yt+Lr*Lr),xo=2*i(Ba*.5),Go=_(xo);return[n(Yt*Go,Ba*a(xo)),Ba?B(Lr*Go/Ba):0]}},Tt}var sl=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],hp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],jl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],os=[[.9245,0],[0,0],[.01943,0]],_f=[[.721316,0],[0,0],[-.00881625,-.00617325]];function yh(){return vc(sl,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function hc(){return vc(hp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function td(){return vc(jl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Qh(){return vc(os,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Ef(){return vc(_f,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function vc(tt,lt){var Tt=y.geoProjection(Yd(tt)).rotate(lt).clipAngle(90),Lt=y.geoRotation(lt),Vt=Tt.center;return delete Tt.rotate,Tt.center=function(Nt){return arguments.length?Vt(Lt(Nt)):Lt.invert(Vt())},Tt}var Ld=V(6),cd=V(7);function Lf(tt,lt){var Tt=B(7*_(lt)/(3*Ld));return[Ld*tt*(2*a(2*Tt/3)-1)/cd,9*_(Tt/3)/cd]}Lf.invert=function(tt,lt){var Tt=3*B(lt*cd/9);return[tt*cd/(Ld*(2*a(2*Tt/3)-1)),B(_(Tt)*3*Ld/7)]};function ef(){return y.geoProjection(Lf).scale(164.859)}function rd(tt,lt){for(var Tt=(1+I)*_(lt),Lt=lt,Vt=0,Nt;Vt<25&&(Lt-=Nt=(_(Lt/2)+_(Lt)-Tt)/(.5*a(Lt/2)+a(Lt)),!(P(Nt)k&&--Lt>0);return Nt=Tt*Tt,Yt=Nt*Nt,Lr=Nt*Yt,[tt/(.84719-.13063*Nt+Lr*Lr*(-.04515+.05494*Nt-.02326*Yt+.00331*Lr)),Tt]};function Mh(){return y.geoProjection(Nh).scale(175.295)}function yc(tt,lt){return[tt*(1+a(lt))/2,2*(lt-A(lt/2))]}yc.invert=function(tt,lt){for(var Tt=lt/2,Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;++Lt){var Nt=a(lt/2);lt-=Vt=(lt-A(lt/2)-Tt)/(1-.5/(Nt*Nt))}return[2*tt/(1+a(lt)),lt]};function df(){return y.geoProjection(yc).scale(152.63)}var nd=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function uu(){return ls(Ce(1/0),nd).rotate([20,0]).scale(152.63)}function Nf(tt,lt){var Tt=_(lt),Lt=a(lt),Vt=x(tt);if(tt===0||P(lt)===D)return[0,lt];if(lt===0)return[tt,0];if(P(tt)===D)return[tt*Lt,D*Tt];var Nt=w/(2*tt)-2*tt/w,Yt=2*lt/w,Lr=(1-Yt*Yt)/(Tt-Yt),$r=Nt*Nt,Zr=Lr*Lr,di=1+$r/Zr,zi=1+Zr/$r,Ki=(Nt*Tt/Lr-Nt/2)/di,nn=(Zr*Tt/$r+Lr/2)/zi,kn=Ki*Ki+Lt*Lt/di,Jn=nn*nn-(Zr*Tt*Tt/$r+Lr*Tt-1)/zi;return[D*(Ki+V(kn)*Vt),D*(nn+V(Jn<0?0:Jn)*x(-lt*Nt)*Vt)]}Nf.invert=function(tt,lt){tt/=D,lt/=D;var Tt=tt*tt,Lt=lt*lt,Vt=Tt+Lt,Nt=w*w;return[tt?(Vt-1+V((1-Vt)*(1-Vt)+4*Tt))/(2*tt)*D:0,Ze(function(Yt){return Vt*(w*_(Yt)-2*Yt)*w+4*Yt*Yt*(lt-_(Yt))+2*w*Yt-Nt*lt},0)]};function Xd(){return y.geoProjection(Nf).scale(127.267)}var fd=1.0148,Pf=.23185,dd=-.14499,Yc=.02406,pd=fd,Vu=5*Pf,Xc=7*dd,tf=9*Yc,_u=1.790857183;function jh(tt,lt){var Tt=lt*lt;return[tt,lt*(fd+Tt*Tt*(Pf+Tt*(dd+Yc*Tt)))]}jh.invert=function(tt,lt){lt>_u?lt=_u:lt<-_u&&(lt=-_u);var Tt=lt,Lt;do{var Vt=Tt*Tt;Tt-=Lt=(Tt*(fd+Vt*Vt*(Pf+Vt*(dd+Yc*Vt)))-lt)/(pd+Vt*Vt*(Vu+Vt*(Xc+tf*Vt)))}while(P(Lt)>f);return[tt,Tt]};function Rc(){return y.geoProjection(jh).scale(139.319)}function Jc(tt,lt){if(P(lt)f&&--Vt>0);return Yt=A(Lt),[(P(lt)=0;)if(Lt=lt[Lr],Tt[0]===Lt[0]&&Tt[1]===Lt[1]){if(Nt)return[Nt,Tt];Nt=Tt}}}function ch(tt){for(var lt=tt.length,Tt=[],Lt=tt[lt-1],Vt=0;Vt0?[-Lt[0],0]:[180-Lt[0],180])};var lt=Lh.map(function(Tt){return{face:Tt,project:tt(Tt)}});return[-1,0,0,1,0,1,4,5].forEach(function(Tt,Lt){var Vt=lt[Tt];Vt&&(Vt.children||(Vt.children=[])).push(lt[Lt])}),bf(lt[0],function(Tt,Lt){return lt[Tt<-w/2?Lt<0?6:4:Tt<0?Lt<0?2:0:TtLt^nn>Lt&&Tt<(Ki-Zr)*(Lt-di)/(nn-di)+Zr&&(Vt=!Vt)}return Vt}function Ac(tt,lt){var Tt=lt.stream,Lt;if(!Tt)throw new Error("invalid projection");switch(tt&&tt.type){case"Feature":Lt=fh;break;case"FeatureCollection":Lt=md;break;default:Lt=Ph;break}return Lt(tt,Tt)}function md(tt,lt){return{type:"FeatureCollection",features:tt.features.map(function(Tt){return fh(Tt,lt)})}}function fh(tt,lt){return{type:"Feature",id:tt.id,properties:tt.properties,geometry:Ph(tt.geometry,lt)}}function $h(tt,lt){return{type:"GeometryCollection",geometries:tt.geometries.map(function(Tt){return Ph(Tt,lt)})}}function Ph(tt,lt){if(!tt)return null;if(tt.type==="GeometryCollection")return $h(tt,lt);var Tt;switch(tt.type){case"Point":Tt=Ih;break;case"MultiPoint":Tt=Ih;break;case"LineString":Tt=Tf;break;case"MultiLineString":Tt=Tf;break;case"Polygon":Tt=Dh;break;case"MultiPolygon":Tt=Dh;break;case"Sphere":Tt=Dh;break;default:return null}return y.geoStream(tt,lt(Tt)),Tt.result()}var Zu=[],fu=[],Ih={point:function(tt,lt){Zu.push([tt,lt])},result:function(){var tt=Zu.length?Zu.length<2?{type:"Point",coordinates:Zu[0]}:{type:"MultiPoint",coordinates:Zu}:null;return Zu=[],tt}},Tf={lineStart:af,point:function(tt,lt){Zu.push([tt,lt])},lineEnd:function(){Zu.length&&(fu.push(Zu),Zu=[])},result:function(){var tt=fu.length?fu.length<2?{type:"LineString",coordinates:fu[0]}:{type:"MultiLineString",coordinates:fu}:null;return fu=[],tt}},Dh={polygonStart:af,lineStart:af,point:function(tt,lt){Zu.push([tt,lt])},lineEnd:function(){var tt=Zu.length;if(tt){do Zu.push(Zu[0].slice());while(++tt<4);fu.push(Zu),Zu=[]}},polygonEnd:af,result:function(){if(!fu.length)return null;var tt=[],lt=[];return fu.forEach(function(Tt){Df(Tt)?tt.push([Tt]):lt.push(Tt)}),lt.forEach(function(Tt){var Lt=Tt[0];tt.some(function(Vt){if(Qd(Vt[0],Lt))return Vt.push(Tt),!0})||tt.push([Tt])}),fu=[],tt.length?tt.length>1?{type:"MultiPolygon",coordinates:tt}:{type:"Polygon",coordinates:tt[0]}:null}};function ad(tt){var lt=tt(D,0)[0]-tt(-D,0)[0];function Tt(Lt,Vt){var Nt=P(Lt)0?Lt-w:Lt+w,Vt),Lr=(Yt[0]-Yt[1])*I,$r=(Yt[0]+Yt[1])*I;if(Nt)return[Lr,$r];var Zr=lt*I,di=Lr>0^$r>0?-1:1;return[di*Lr-x($r)*Zr,di*$r-x(Lr)*Zr]}return tt.invert&&(Tt.invert=function(Lt,Vt){var Nt=(Lt+Vt)*I,Yt=(Vt-Lt)*I,Lr=P(Nt)<.5*lt&&P(Yt)<.5*lt;if(!Lr){var $r=lt*I,Zr=Nt>0^Yt>0?-1:1,di=-Zr*Lt+(Yt>0?1:-1)*$r,zi=-Zr*Vt+(Nt>0?1:-1)*$r;Nt=(-di-zi)*I,Yt=(di-zi)*I}var Ki=tt.invert(Nt,Yt);return Lr||(Ki[0]+=Nt>0?w:-w),Ki}),y.geoProjection(Tt).rotate([-90,-90,45]).clipAngle(180-.001)}function wr(){return ad(Wi).scale(176.423)}function Yr(){return ad(Wo).scale(111.48)}function Ni(tt,lt){if(!(0<=(lt=+lt)&<<=20))throw new Error("invalid digits");function Tt(Zr){var di=Zr.length,zi=2,Ki=new Array(di);for(Ki[0]=+Zr[0].toFixed(lt),Ki[1]=+Zr[1].toFixed(lt);zi2||nn[0]!=di[0]||nn[1]!=di[1])&&(zi.push(nn),di=nn)}return zi.length===1&&Zr.length>1&&zi.push(Tt(Zr[Zr.length-1])),zi}function Nt(Zr){return Zr.map(Vt)}function Yt(Zr){if(Zr==null)return Zr;var di;switch(Zr.type){case"GeometryCollection":di={type:"GeometryCollection",geometries:Zr.geometries.map(Yt)};break;case"Point":di={type:"Point",coordinates:Tt(Zr.coordinates)};break;case"MultiPoint":di={type:Zr.type,coordinates:Lt(Zr.coordinates)};break;case"LineString":di={type:Zr.type,coordinates:Vt(Zr.coordinates)};break;case"MultiLineString":case"Polygon":di={type:Zr.type,coordinates:Nt(Zr.coordinates)};break;case"MultiPolygon":di={type:"MultiPolygon",coordinates:Zr.coordinates.map(Nt)};break;default:return Zr}return Zr.bbox!=null&&(di.bbox=Zr.bbox),di}function Lr(Zr){var di={type:"Feature",properties:Zr.properties,geometry:Yt(Zr.geometry)};return Zr.id!=null&&(di.id=Zr.id),Zr.bbox!=null&&(di.bbox=Zr.bbox),di}if(tt!=null)switch(tt.type){case"Feature":return Lr(tt);case"FeatureCollection":{var $r={type:"FeatureCollection",features:tt.features.map(Lr)};return tt.bbox!=null&&($r.bbox=tt.bbox),$r}default:return Yt(tt)}return tt}function Ai(tt){var lt=_(tt);function Tt(Lt,Vt){var Nt=lt?A(Lt*lt/2)/lt:Lt/2;if(!Vt)return[2*Nt,-tt];var Yt=2*i(Nt*_(Vt)),Lr=1/A(Vt);return[_(Yt)*Lr,Vt+(1-a(Yt))*Lr-tt]}return Tt.invert=function(Lt,Vt){if(P(Vt+=tt)f&&--Lr>0);var Ki=Lt*(Zr=A(Yt)),nn=A(P(Vt)0?D:-D)*($r+Vt*(di-Yt)/2+Vt*Vt*(di-2*$r+Yt)/2)]}pa.invert=function(tt,lt){var Tt=lt/D,Lt=Tt*90,Vt=h(18,P(Lt/5)),Nt=s(0,o(Vt));do{var Yt=Ln[Nt][1],Lr=Ln[Nt+1][1],$r=Ln[h(19,Nt+2)][1],Zr=$r-Yt,di=$r-2*Lr+Yt,zi=2*(P(Tt)-Lr)/Zr,Ki=di/Zr,nn=zi*(1-Ki*zi*(1-2*Ki*zi));if(nn>=0||Nt===1){Lt=(lt>=0?5:-5)*(nn+Vt);var kn=50,Jn;do Vt=h(18,P(Lt)/5),Nt=o(Vt),nn=Vt-Nt,Yt=Ln[Nt][1],Lr=Ln[Nt+1][1],$r=Ln[h(19,Nt+2)][1],Lt-=(Jn=(lt>=0?D:-D)*(Lr+nn*($r-Yt)/2+nn*nn*($r-2*Lr+Yt)/2)-lt)*C;while(P(Jn)>k&&--kn>0);break}}while(--Nt>=0);var Sa=Ln[Nt][0],wa=Ln[Nt+1][0],Ba=Ln[h(19,Nt+2)][0];return[tt/(wa+nn*(Ba-Sa)/2+nn*nn*(Ba-2*wa+Sa)/2),Lt*T]};function Ea(){return y.geoProjection(pa).scale(152.63)}function Za(tt){function lt(Tt,Lt){var Vt=a(Lt),Nt=(tt-1)/(tt-Vt*a(Tt));return[Nt*Vt*_(Tt),Nt*_(Lt)]}return lt.invert=function(Tt,Lt){var Vt=Tt*Tt+Lt*Lt,Nt=V(Vt),Yt=(tt-V(1-Vt*(tt+1)/(tt-1)))/((tt-1)/Nt+Nt/(tt-1));return[n(Tt*Yt,Nt*V(1-Yt*Yt)),Nt?B(Lt*Yt/Nt):0]},lt}function ao(tt,lt){var Tt=Za(tt);if(!lt)return Tt;var Lt=a(lt),Vt=_(lt);function Nt(Yt,Lr){var $r=Tt(Yt,Lr),Zr=$r[1],di=Zr*Vt/(tt-1)+Lt;return[$r[0]*Lt/di,Zr/di]}return Nt.invert=function(Yt,Lr){var $r=(tt-1)/(tt-1-Lr*Vt);return Tt.invert($r*Yt,$r*Lr*Lt)},Nt}function xa(){var tt=2,lt=0,Tt=y.geoProjectionMutator(ao),Lt=Tt(tt,lt);return Lt.distance=function(Vt){return arguments.length?Tt(tt=+Vt,lt):tt},Lt.tilt=function(Vt){return arguments.length?Tt(tt,lt=Vt*T):lt*C},Lt.scale(432.147).clipAngle(U(1/tt)*C-1e-6)}var Va=1e-4,Oa=1e4,fa=-180,vo=fa+Va,hs=180,rs=hs-Va,ps=-90,xs=ps+Va,_o=90,io=_o-Va;function bs(tt){return tt.length>0}function ll(tt){return Math.floor(tt*Oa)/Oa}function Ul(tt){return tt===ps||tt===_o?[0,tt]:[fa,ll(tt)]}function mu(tt){var lt=tt[0],Tt=tt[1],Lt=!1;return lt<=vo?(lt=fa,Lt=!0):lt>=rs&&(lt=hs,Lt=!0),Tt<=xs?(Tt=ps,Lt=!0):Tt>=io&&(Tt=_o,Lt=!0),Lt?[lt,Tt]:tt}function Ql(tt){return tt.map(mu)}function gu(tt,lt,Tt){for(var Lt=0,Vt=tt.length;Lt=rs||di<=xs||di>=io){Nt[Yt]=mu($r);for(var zi=Yt+1;zivo&&nnxs&&kn=Lr)break;Tt.push({index:-1,polygon:lt,ring:Nt=Nt.slice(zi-1)}),Nt[0]=Ul(Nt[0][1]),Yt=-1,Lr=Nt.length}}}}function Cl(tt){var lt,Tt=tt.length,Lt={},Vt={},Nt,Yt,Lr,$r,Zr;for(lt=0;lt0?w-Lr:Lr)*C],Zr=y.geoProjection(tt(Yt)).rotate($r),di=y.geoRotation($r),zi=Zr.center;return delete Zr.rotate,Zr.center=function(Ki){return arguments.length?zi(di(Ki)):di.invert(zi())},Zr.clipAngle(90)}function Wl(tt){var lt=a(tt);function Tt(Lt,Vt){var Nt=y.geoGnomonicRaw(Lt,Vt);return Nt[0]*=lt,Nt}return Tt.invert=function(Lt,Vt){return y.geoGnomonicRaw.invert(Lt/lt,Vt)},Tt}function Mc(){return eh([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function eh(tt,lt){return iu(Wl,tt,lt)}function Uc(tt){if(!(tt*=2))return y.geoAzimuthalEquidistantRaw;var lt=-tt/2,Tt=-lt,Lt=tt*tt,Vt=A(Tt),Nt=.5/_(Tt);function Yt(Lr,$r){var Zr=U(a($r)*a(Lr-lt)),di=U(a($r)*a(Lr-Tt)),zi=$r<0?-1:1;return Zr*=Zr,di*=di,[(Zr-di)/(2*tt),zi*V(4*Lt*di-(Lt-Zr+di)*(Lt-Zr+di))/(2*tt)]}return Yt.invert=function(Lr,$r){var Zr=$r*$r,di=a(V(Zr+(Ki=Lr+lt)*Ki)),zi=a(V(Zr+(Ki=Lr+Tt)*Ki)),Ki,nn;return[n(nn=di-zi,Ki=(di+zi)*Vt),($r<0?-1:1)*U(V(Ki*Ki+nn*nn)*Nt)]},Yt}function Hh(){return th([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function th(tt,lt){return iu(Uc,tt,lt)}function Vh(tt,lt){if(P(lt)f&&--Lr>0);return[x(tt)*(V(Vt*Vt+4)+Vt)*w/4,D*Yt]};function od(){return y.geoProjection(tc).scale(127.16)}function Ke(tt,lt,Tt,Lt,Vt){function Nt(Yt,Lr){var $r=Tt*_(Lt*Lr),Zr=V(1-$r*$r),di=V(2/(1+Zr*a(Yt*=Vt)));return[tt*Zr*di*_(Yt),lt*$r*di]}return Nt.invert=function(Yt,Lr){var $r=Yt/tt,Zr=Lr/lt,di=V($r*$r+Zr*Zr),zi=2*B(di/2);return[n(Yt*A(zi),tt*di)/Vt,di&&B(Lr*_(zi)/(lt*Tt*di))/Lt]},Nt}function O(tt,lt,Tt,Lt){var Vt=w/3;tt=s(tt,f),lt=s(lt,f),tt=h(tt,D),lt=h(lt,w-f),Tt=s(Tt,0),Tt=h(Tt,100-f),Lt=s(Lt,f);var Nt=Tt/100+1,Yt=Lt/100,Lr=U(Nt*a(Vt))/Vt,$r=_(tt)/_(Lr*D),Zr=lt/w,di=V(Yt*_(tt/2)/_(lt/2)),zi=di/V(Zr*$r*Lr),Ki=1/(di*V(Zr*$r*Lr));return Ke(zi,Ki,$r,Lr,Zr)}function pe(){var tt=65*T,lt=60*T,Tt=20,Lt=200,Vt=y.geoProjectionMutator(O),Nt=Vt(tt,lt,Tt,Lt);return Nt.poleline=function(Yt){return arguments.length?Vt(tt=+Yt*T,lt,Tt,Lt):tt*C},Nt.parallels=function(Yt){return arguments.length?Vt(tt,lt=+Yt*T,Tt,Lt):lt*C},Nt.inflation=function(Yt){return arguments.length?Vt(tt,lt,Tt=+Yt,Lt):Tt},Nt.ratio=function(Yt){return arguments.length?Vt(tt,lt,Tt,Lt=+Yt):Lt},Nt.scale(163.775)}function Ie(){return pe().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Ne=4*w+3*V(3),qe=2*V(2*w*V(3)/Ne),Mt=gt(qe*V(3)/w,qe,Ne/6);function jt(){return y.geoProjection(Mt).scale(176.84)}function er(tt,lt){return[tt*V(1-3*lt*lt/(w*w)),lt]}er.invert=function(tt,lt){return[tt/V(1-3*lt*lt/(w*w)),lt]};function kr(){return y.geoProjection(er).scale(152.63)}function Hr(tt,lt){var Tt=a(lt),Lt=a(tt)*Tt,Vt=1-Lt,Nt=a(tt=n(_(tt)*Tt,-_(lt))),Yt=_(tt);return Tt=V(1-Lt*Lt),[Yt*Tt-Nt*Vt,-Nt*Tt-Yt*Vt]}Hr.invert=function(tt,lt){var Tt=(tt*tt+lt*lt)/-2,Lt=V(-Tt*(2+Tt)),Vt=lt*Tt+tt*Lt,Nt=tt*Tt-lt*Lt,Yt=V(Nt*Nt+Vt*Vt);return[n(Lt*Vt,Yt*(1+Tt)),Yt?-B(Lt*Nt/Yt):0]};function Vr(){return y.geoProjection(Hr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function ki(tt,lt){var Tt=xe(tt,lt);return[(Tt[0]+tt/D)/2,(Tt[1]+lt)/2]}ki.invert=function(tt,lt){var Tt=tt,Lt=lt,Vt=25;do{var Nt=a(Lt),Yt=_(Lt),Lr=_(2*Lt),$r=Yt*Yt,Zr=Nt*Nt,di=_(Tt),zi=a(Tt/2),Ki=_(Tt/2),nn=Ki*Ki,kn=1-Zr*zi*zi,Jn=kn?U(Nt*zi)*V(Sa=1/kn):Sa=0,Sa,wa=.5*(2*Jn*Nt*Ki+Tt/D)-tt,Ba=.5*(Jn*Yt+Lt)-lt,xo=.5*Sa*(Zr*nn+Jn*Nt*zi*$r)+.5/D,Go=Sa*(di*Lr/4-Jn*Yt*Ki),Bo=.125*Sa*(Lr*Ki-Jn*Yt*Zr*di),_s=.5*Sa*($r*zi+Jn*nn*Nt)+.5,wl=Go*Bo-_s*xo,Al=(Ba*Go-wa*_s)/wl,Us=(wa*Bo-Ba*xo)/wl;Tt-=Al,Lt-=Us}while((P(Al)>f||P(Us)>f)&&--Vt>0);return[Tt,Lt]};function Vi(){return y.geoProjection(ki).scale(158.837)}d.geoNaturalEarth=y.geoNaturalEarth1,d.geoNaturalEarthRaw=y.geoNaturalEarth1Raw,d.geoAiry=he,d.geoAiryRaw=ee,d.geoAitoff=ve,d.geoAitoffRaw=xe,d.geoArmadillo=re,d.geoArmadilloRaw=ce,d.geoAugust=ne,d.geoAugustRaw=ge,d.geoBaker=J,d.geoBakerRaw=oe,d.geoBerghaus=fe,d.geoBerghausRaw=me,d.geoBertin1953=_t,d.geoBertin1953Raw=rt,d.geoBoggs=xt,d.geoBoggsRaw=nt,d.geoBonne=gr,d.geoBonneRaw=Jt,d.geoBottomley=Kr,d.geoBottomleyRaw=mr,d.geoBromley=Mr,d.geoBromleyRaw=ri,d.geoChamberlin=ye,d.geoChamberlinRaw=Je,d.geoChamberlinAfrica=De,d.geoCollignon=He,d.geoCollignonRaw=Pe,d.geoCraig=ht,d.geoCraigRaw=at,d.geoCraster=Kt,d.geoCrasterRaw=Wt,d.geoCylindricalEqualArea=zr,d.geoCylindricalEqualAreaRaw=hr,d.geoCylindricalStereographic=br,d.geoCylindricalStereographicRaw=Dr,d.geoEckert1=un,d.geoEckert1Raw=hi,d.geoEckert2=yn,d.geoEckert2Raw=cn,d.geoEckert3=Sn,d.geoEckert3Raw=Wn,d.geoEckert4=ga,d.geoEckert4Raw=fn,d.geoEckert5=Zt,d.geoEckert5Raw=na,d.geoEckert6=_r,d.geoEckert6Raw=sr,d.geoEisenlohr=qi,d.geoEisenlohrRaw=fi,d.geoFahey=En,d.geoFaheyRaw=Hi,d.geoFoucaut=Gn,d.geoFoucautRaw=Rn,d.geoFoucautSinusoidal=sa,d.geoFoucautSinusoidalRaw=Xn,d.geoGilbert=ro,d.geoGingery=ni,d.geoGingeryRaw=Ft,d.geoGinzburg4=si,d.geoGinzburg4Raw=Gr,d.geoGinzburg5=yi,d.geoGinzburg5Raw=Pi,d.geoGinzburg6=xr,d.geoGinzburg6Raw=zt,d.geoGinzburg8=Ri,d.geoGinzburg8Raw=Jr,d.geoGinzburg9=_n,d.geoGinzburg9Raw=tn,d.geoGringorten=ea,d.geoGringortenRaw=Wi,d.geoGuyou=fs,d.geoGuyouRaw=Wo,d.geoHammer=Oe,d.geoHammerRaw=Ce,d.geoHammerRetroazimuthal=rl,d.geoHammerRetroazimuthalRaw=_l,d.geoHealpix=Il,d.geoHealpixRaw=Gl,d.geoHill=ou,d.geoHillRaw=Jl,d.geoHomolosine=is,d.geoHomolosineRaw=su,d.geoHufnagel=pl,d.geoHufnagelRaw=tu,d.geoHyperelliptical=Ls,d.geoHyperellipticalRaw=bo,d.geoInterrupt=ls,d.geoInterruptedBoggs=ic,d.geoInterruptedHomolosine=Hl,d.geoInterruptedMollweide=hu,d.geoInterruptedMollweideHemispheres=Ah,d.geoInterruptedSinuMollweide=gh,d.geoInterruptedSinusoidal=Ff,d.geoKavrayskiy7=Kc,d.geoKavrayskiy7Raw=Vl,d.geoLagrange=xc,d.geoLagrangeRaw=ed,d.geoLarrivee=vh,d.geoLarriveeRaw=bc,d.geoLaskowski=gc,d.geoLaskowskiRaw=yu,d.geoLittrow=ru,d.geoLittrowRaw=hl,d.geoLoximuthal=jc,d.geoLoximuthalRaw=Fh,d.geoMiller=Mu,d.geoMillerRaw=Jh,d.geoModifiedStereographic=vc,d.geoModifiedStereographicRaw=Yd,d.geoModifiedStereographicAlaska=yh,d.geoModifiedStereographicGs48=hc,d.geoModifiedStereographicGs50=td,d.geoModifiedStereographicMiller=Qh,d.geoModifiedStereographicLee=Ef,d.geoMollweide=Ae,d.geoMollweideRaw=ct,d.geoMtFlatPolarParabolic=ef,d.geoMtFlatPolarParabolicRaw=Lf,d.geoMtFlatPolarQuartic=id,d.geoMtFlatPolarQuarticRaw=rd,d.geoMtFlatPolarSinusoidal=hd,d.geoMtFlatPolarSinusoidalRaw=_h,d.geoNaturalEarth2=Mh,d.geoNaturalEarth2Raw=Nh,d.geoNellHammer=df,d.geoNellHammerRaw=yc,d.geoInterruptedQuarticAuthalic=uu,d.geoNicolosi=Xd,d.geoNicolosiRaw=Nf,d.geoPatterson=Rc,d.geoPattersonRaw=jh,d.geoPolyconic=Eu,d.geoPolyconicRaw=Jc,d.geoPolyhedral=bf,d.geoPolyhedralButterfly=Lu,d.geoPolyhedralCollignon=Pd,d.geoPolyhedralWaterman=Cu,d.geoProject=Ac,d.geoGringortenQuincuncial=wr,d.geoPeirceQuincuncial=Yr,d.geoPierceQuincuncial=Yr,d.geoQuantize=Ni,d.geoQuincuncial=ad,d.geoRectangularPolyconic=hn,d.geoRectangularPolyconicRaw=Ai,d.geoRobinson=Ea,d.geoRobinsonRaw=pa,d.geoSatellite=xa,d.geoSatelliteRaw=ao,d.geoSinuMollweide=Xs,d.geoSinuMollweideRaw=So,d.geoSinusoidal=Gt,d.geoSinusoidalRaw=Et,d.geoStitch=xu,d.geoTimes=Is,d.geoTimesRaw=Ho,d.geoTwoPointAzimuthal=eh,d.geoTwoPointAzimuthalRaw=Wl,d.geoTwoPointAzimuthalUsa=Mc,d.geoTwoPointEquidistant=th,d.geoTwoPointEquidistantRaw=Uc,d.geoTwoPointEquidistantUsa=Hh,d.geoVanDerGrinten=Wu,d.geoVanDerGrintenRaw=Vh,d.geoVanDerGrinten2=cs,d.geoVanDerGrinten2Raw=Wh,d.geoVanDerGrinten3=rh,d.geoVanDerGrinten3Raw=Fs,d.geoVanDerGrinten4=od,d.geoVanDerGrinten4Raw=tc,d.geoWagner=pe,d.geoWagner7=Ie,d.geoWagnerRaw=O,d.geoWagner4=jt,d.geoWagner4Raw=Mt,d.geoWagner6=kr,d.geoWagner6Raw=er,d.geoWiechel=Vr,d.geoWiechelRaw=Hr,d.geoWinkel3=Vi,d.geoWinkel3Raw=ki,Object.defineProperty(d,"__esModule",{value:!0})})}),hX=Fe((te,Y)=>{var d=ii(),y=ji(),z=as(),P=Math.PI/180,i=180/Math.PI,n={cursor:"pointer"},a={cursor:"auto"};function l(C,T){var N=C.projection,B;return T._isScoped?B=s:T._isClipped?B=m:B=h,B(C,N)}Y.exports=l;function o(C,T){return d.behavior.zoom().translate(T.translate()).scale(T.scale())}function u(C,T,N){var B=C.id,U=C.graphDiv,V=U.layout,W=V[B],F=U._fullLayout,$=F[B],q={},G={};function ee(he,xe){q[B+"."+he]=y.nestedProperty(W,he).get(),z.call("_storeDirectGUIEdit",V,F._preGUI,q);var ve=y.nestedProperty($,he);ve.get()!==xe&&(ve.set(xe),y.nestedProperty(W,he).set(xe),G[B+"."+he]=xe)}N(ee),ee("projection.scale",T.scale()/C.fitScale),ee("fitbounds",!1),U.emit("plotly_relayout",G)}function s(C,T){var N=o(C,T);function B(){d.select(this).style(n)}function U(){T.scale(d.event.scale).translate(d.event.translate),C.render(!0);var F=T.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.center.lon":F[0],"geo.center.lat":F[1]})}function V(F){var $=T.invert(C.midPt);F("center.lon",$[0]),F("center.lat",$[1])}function W(){d.select(this).style(a),u(C,T,V)}return N.on("zoomstart",B).on("zoom",U).on("zoomend",W),N}function h(C,T){var N=o(C,T),B=2,U,V,W,F,$,q,G,ee,he;function xe(se){return T.invert(se)}function ve(se){var _e=xe(se);if(!_e)return!0;var oe=T(_e);return Math.abs(oe[0]-se[0])>B||Math.abs(oe[1]-se[1])>B}function ce(){d.select(this).style(n),U=d.mouse(this),V=T.rotate(),W=T.translate(),F=V,$=xe(U)}function re(){if(q=d.mouse(this),ve(U)){N.scale(T.scale()),N.translate(T.translate());return}T.scale(d.event.scale),T.translate([W[0],d.event.translate[1]]),$?xe(q)&&(ee=xe(q),G=[F[0]+(ee[0]-$[0]),V[1],V[2]],T.rotate(G),F=G):(U=q,$=xe(U)),he=!0,C.render(!0);var se=T.rotate(),_e=T.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.center.lon":_e[0],"geo.center.lat":_e[1],"geo.projection.rotation.lon":-se[0]})}function ge(){d.select(this).style(a),he&&u(C,T,ne)}function ne(se){var _e=T.rotate(),oe=T.invert(C.midPt);se("projection.rotation.lon",-_e[0]),se("center.lon",oe[0]),se("center.lat",oe[1])}return N.on("zoomstart",ce).on("zoom",re).on("zoomend",ge),N}function m(C,T){T.rotate(),T.scale();var N=o(C,T),B=g(N,"zoomstart","zoom","zoomend"),U=0,V=N.on,W;N.on("zoomstart",function(){d.select(this).style(n);var ee=d.mouse(this),he=T.rotate(),xe=he,ve=T.translate(),ce=x(he);W=b(T,ee),V.call(N,"zoom",function(){var re=d.mouse(this);if(T.scale(d.event.scale),!W)ee=re,W=b(T,ee);else if(b(T,re)){T.rotate(he).translate(ve);var ge=b(T,re),ne=A(W,ge),se=E(_(ce,ne)),_e=f(se,W,xe);(!isFinite(_e[0])||!isFinite(_e[1])||!isFinite(_e[2]))&&(_e=xe),T.rotate(_e),xe=_e}$(B.of(this,arguments))}),F(B.of(this,arguments))}).on("zoomend",function(){d.select(this).style(a),V.call(N,"zoom",null),q(B.of(this,arguments)),u(C,T,G)}).on("zoom.redraw",function(){C.render(!0);var ee=T.rotate();C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.projection.rotation.lon":-ee[0],"geo.projection.rotation.lat":-ee[1]})});function F(ee){U++||ee({type:"zoomstart"})}function $(ee){ee({type:"zoom"})}function q(ee){--U||ee({type:"zoomend"})}function G(ee){var he=T.rotate();ee("projection.rotation.lon",-he[0]),ee("projection.rotation.lat",-he[1])}return d.rebind(N,B,"on")}function b(C,T){var N=C.invert(T);return N&&isFinite(N[0])&&isFinite(N[1])&&I(N)}function x(C){var T=.5*C[0]*P,N=.5*C[1]*P,B=.5*C[2]*P,U=Math.sin(T),V=Math.cos(T),W=Math.sin(N),F=Math.cos(N),$=Math.sin(B),q=Math.cos(B);return[V*F*q+U*W*$,U*F*q-V*W*$,V*W*q+U*F*$,V*F*$-U*W*q]}function _(C,T){var N=C[0],B=C[1],U=C[2],V=C[3],W=T[0],F=T[1],$=T[2],q=T[3];return[N*W-B*F-U*$-V*q,N*F+B*W+U*q-V*$,N*$-B*q+U*W+V*F,N*q+B*$-U*F+V*W]}function A(C,T){if(!(!C||!T)){var N=p(C,T),B=Math.sqrt(M(N,N)),U=.5*Math.acos(Math.max(-1,Math.min(1,M(C,T)))),V=Math.sin(U)/B;return B&&[Math.cos(U),N[2]*V,-N[1]*V,N[0]*V]}}function f(C,T,N){var B=D(T,2,C[0]);B=D(B,1,C[1]),B=D(B,0,C[2]-N[2]);var U=T[0],V=T[1],W=T[2],F=B[0],$=B[1],q=B[2],G=Math.atan2(V,U)*i,ee=Math.sqrt(U*U+V*V),he,xe;Math.abs($)>ee?(xe=($>0?90:-90)-G,he=0):(xe=Math.asin($/ee)*i-G,he=Math.sqrt(ee*ee-$*$));var ve=180-xe-2*G,ce=(Math.atan2(q,F)-Math.atan2(W,he))*i,re=(Math.atan2(q,F)-Math.atan2(W,-he))*i,ge=k(N[0],N[1],xe,ce),ne=k(N[0],N[1],ve,re);return ge<=ne?[xe,ce,N[2]]:[ve,re,N[2]]}function k(C,T,N,B){var U=w(N-C),V=w(B-T);return Math.sqrt(U*U+V*V)}function w(C){return(C%360+540)%360-180}function D(C,T,N){var B=N*P,U=C.slice(),V=T===0?1:0,W=T===2?1:2,F=Math.cos(B),$=Math.sin(B);return U[V]=C[V]*F-C[W]*$,U[W]=C[W]*F+C[V]*$,U}function E(C){return[Math.atan2(2*(C[0]*C[1]+C[2]*C[3]),1-2*(C[1]*C[1]+C[2]*C[2]))*i,Math.asin(Math.max(-1,Math.min(1,2*(C[0]*C[2]-C[3]*C[1]))))*i,Math.atan2(2*(C[0]*C[3]+C[1]*C[2]),1-2*(C[2]*C[2]+C[3]*C[3]))*i]}function I(C){var T=C[0]*P,N=C[1]*P,B=Math.cos(N);return[B*Math.cos(T),B*Math.sin(T),Math.sin(N)]}function M(C,T){for(var N=0,B=0,U=C.length;B{var d=ii(),y=dD(),z=y.geoPath,P=y.geoDistance,i=cX(),n=as(),a=ji(),l=a.strTranslate,o=Xi(),u=Zs(),s=hf(),h=sh(),m=Os(),b=Xm().getAutoRange,x=Np(),_=Mf().prepSelect,A=Mf().clearOutline,f=Mf().selectOnClick,k=hX(),w=k6(),D=U_(),E=VC(),I=cD().feature;function M(N){this.id=N.id,this.graphDiv=N.graphDiv,this.container=N.container,this.topojsonURL=N.topojsonURL,this.isStatic=N.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var p=M.prototype;Y.exports=function(N){return new M(N)},p.plot=function(N,B,U,V){var W=this;if(V)return W.update(N,B,!0);W._geoCalcData=N,W._fullLayout=B;var F=B[this.id],$=[],q=!1;for(var G in w.layerNameToAdjective)if(G!=="frame"&&F["show"+G]){q=!0;break}for(var ee=!1,he=0;he0&&$._module.calcGeoJSON(F,B)}if(!U){var q=this.updateProjection(N,B);if(q)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),h.generalUpdatePerTraceModule(this.graphDiv,this,N,V);var G=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=G.selectAll(".point"),this.dataPoints.text=G.selectAll("text"),this.dataPaths.line=G.selectAll(".js-line");var ee=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=ee.selectAll("path"),this._render()},p.updateProjection=function(N,B){var U=this.graphDiv,V=B[this.id],W=B._size,F=V.domain,$=V.projection,q=V.lonaxis,G=V.lataxis,ee=q._ax,he=G._ax,xe=this.projection=g(V),ve=[[W.l+W.w*F.x[0],W.t+W.h*(1-F.y[1])],[W.l+W.w*F.x[1],W.t+W.h*(1-F.y[0])]],ce=V.center||{},re=$.rotation||{},ge=q.range||[],ne=G.range||[];if(V.fitbounds){ee._length=ve[1][0]-ve[0][0],he._length=ve[1][1]-ve[0][1],ee.range=b(U,ee),he.range=b(U,he);var se=(ee.range[0]+ee.range[1])/2,_e=(he.range[0]+he.range[1])/2;if(V._isScoped)ce={lon:se,lat:_e};else if(V._isClipped){ce={lon:se,lat:_e},re={lon:se,lat:_e,roll:re.roll};var oe=$.type,J=w.lonaxisSpan[oe]/2||180,me=w.lataxisSpan[oe]/2||90;ge=[se-J,se+J],ne=[_e-me,_e+me]}else ce={lon:se,lat:_e},re={lon:se,lat:re.lat,roll:re.roll}}xe.center([ce.lon-re.lon,ce.lat-re.lat]).rotate([-re.lon,-re.lat,re.roll]).parallels($.parallels);var fe=T(ge,ne);xe.fitExtent(ve,fe);var Ce=this.bounds=xe.getBounds(fe),Be=this.fitScale=xe.scale(),Oe=xe.translate();if(V.fitbounds){var Ze=xe.getBounds(T(ee.range,he.range)),Ge=Math.min((Ce[1][0]-Ce[0][0])/(Ze[1][0]-Ze[0][0]),(Ce[1][1]-Ce[0][1])/(Ze[1][1]-Ze[0][1]));isFinite(Ge)?xe.scale(Ge*Be):a.warn("Something went wrong during"+this.id+"fitbounds computations.")}else xe.scale($.scale*Be);var rt=this.midPt=[(Ce[0][0]+Ce[1][0])/2,(Ce[0][1]+Ce[1][1])/2];if(xe.translate([Oe[0]+(rt[0]-Oe[0]),Oe[1]+(rt[1]-Oe[1])]).clipExtent(Ce),V._isAlbersUsa){var _t=xe([ce.lon,ce.lat]),pt=xe.translate();xe.translate([pt[0]-(_t[0]-pt[0]),pt[1]-(_t[1]-pt[1])])}},p.updateBaseLayers=function(N,B){var U=this,V=U.topojson,W=U.layers,F=U.basePaths;function $(ve){return ve==="lonaxis"||ve==="lataxis"}function q(ve){return!!w.lineLayers[ve]}function G(ve){return!!w.fillLayers[ve]}var ee=this.hasChoropleth?w.layersForChoropleth:w.layers,he=ee.filter(function(ve){return q(ve)||G(ve)?B["show"+ve]:$(ve)?B[ve].showgrid:!0}),xe=U.framework.selectAll(".layer").data(he,String);xe.exit().each(function(ve){delete W[ve],delete F[ve],d.select(this).remove()}),xe.enter().append("g").attr("class",function(ve){return"layer "+ve}).each(function(ve){var ce=W[ve]=d.select(this);ve==="bg"?U.bgRect=ce.append("rect").style("pointer-events","all"):$(ve)?F[ve]=ce.append("path").style("fill","none"):ve==="backplot"?ce.append("g").classed("choroplethlayer",!0):ve==="frontplot"?ce.append("g").classed("scatterlayer",!0):q(ve)?F[ve]=ce.append("path").style("fill","none").style("stroke-miterlimit",2):G(ve)&&(F[ve]=ce.append("path").style("stroke","none"))}),xe.order(),xe.each(function(ve){var ce=F[ve],re=w.layerNameToAdjective[ve];ve==="frame"?ce.datum(w.sphereSVG):q(ve)||G(ve)?ce.datum(I(V,V.objects[ve])):$(ve)&&ce.datum(C(ve,B,N)).call(o.stroke,B[ve].gridcolor).call(u.dashLine,B[ve].griddash,B[ve].gridwidth),q(ve)?ce.call(o.stroke,B[re+"color"]).call(u.dashLine,"",B[re+"width"]):G(ve)&&ce.call(o.fill,B[re+"color"])})},p.updateDims=function(N,B){var U=this.bounds,V=(B.framewidth||0)/2,W=U[0][0]-V,F=U[0][1]-V,$=U[1][0]-W+V,q=U[1][1]-F+V;u.setRect(this.clipRect,W,F,$,q),this.bgRect.call(u.setRect,W,F,$,q).call(o.fill,B.bgcolor),this.xaxis._offset=W,this.xaxis._length=$,this.yaxis._offset=F,this.yaxis._length=q},p.updateFx=function(N,B){var U=this,V=U.graphDiv,W=U.bgRect,F=N.dragmode,$=N.clickmode;if(U.isStatic)return;function q(){var xe=U.viewInitial,ve={};for(var ce in xe)ve[U.id+"."+ce]=xe[ce];n.call("_guiRelayout",V,ve),V.emit("plotly_doubleclick",null)}function G(xe){return U.projection.invert([xe[0]+U.xaxis._offset,xe[1]+U.yaxis._offset])}var ee=function(xe,ve){if(ve.isRect){var ce=xe.range={};ce[U.id]=[G([ve.xmin,ve.ymin]),G([ve.xmax,ve.ymax])]}else{var re=xe.lassoPoints={};re[U.id]=ve.map(G)}},he={element:U.bgRect.node(),gd:V,plotinfo:{id:U.id,xaxis:U.xaxis,yaxis:U.yaxis,fillRangeItems:ee},xaxes:[U.xaxis],yaxes:[U.yaxis],subplot:U.id,clickFn:function(xe){xe===2&&A(V)}};F==="pan"?(W.node().onmousedown=null,W.call(k(U,B)),W.on("dblclick.zoom",q),V._context._scrollZoom.geo||W.on("wheel.zoom",null)):(F==="select"||F==="lasso")&&(W.on(".zoom",null),he.prepFn=function(xe,ve,ce){_(xe,ve,ce,he,F)},x.init(he)),W.on("mousemove",function(){var xe=U.projection.invert(a.getPositionFromD3Event());if(!xe)return x.unhover(V,d.event);U.xaxis.p2c=function(){return xe[0]},U.yaxis.p2c=function(){return xe[1]},s.hover(V,d.event,U.id)}),W.on("mouseout",function(){V._dragging||x.unhover(V,d.event)}),W.on("click",function(){F!=="select"&&F!=="lasso"&&($.indexOf("select")>-1&&f(d.event,V,[U.xaxis],[U.yaxis],U.id,he),$.indexOf("event")>-1&&s.click(V,d.event))})},p.makeFramework=function(){var N=this,B=N.graphDiv,U=B._fullLayout,V="clip"+U._uid+N.id;N.clipDef=U._clips.append("clipPath").attr("id",V),N.clipRect=N.clipDef.append("rect"),N.framework=d.select(N.container).append("g").attr("class","geo "+N.id).call(u.setClipUrl,V,B),N.project=function(W){var F=N.projection(W);return F?[F[0]-N.xaxis._offset,F[1]-N.yaxis._offset]:[null,null]},N.xaxis={_id:"x",c2p:function(W){return N.project(W)[0]}},N.yaxis={_id:"y",c2p:function(W){return N.project(W)[1]}},N.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(N.mockAxis,U)},p.saveViewInitial=function(N){var B=N.center||{},U=N.projection,V=U.rotation||{};this.viewInitial={fitbounds:N.fitbounds,"projection.scale":U.scale};var W;N._isScoped?W={"center.lon":B.lon,"center.lat":B.lat}:N._isClipped?W={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:W={"center.lon":B.lon,"center.lat":B.lat,"projection.rotation.lon":V.lon},a.extendFlat(this.viewInitial,W)},p.render=function(N){this._hasMarkerAngles&&N?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var N=this.projection,B=N.getPath(),U;function V(F){var $=N(F.lonlat);return $?l($[0],$[1]):null}function W(F){return N.isLonLatOverEdges(F.lonlat)?"none":null}for(U in this.basePaths)this.basePaths[U].attr("d",B);for(U in this.dataPaths)this.dataPaths[U].attr("d",function(F){return B(F.geojson)});for(U in this.dataPoints)this.dataPoints[U].attr("display",W).attr("transform",V)};function g(N){var B=N.projection,U=B.type,V=w.projNames[U];V="geo"+a.titleCase(V);for(var W=y[V]||i[V],F=W(),$=N._isSatellite?Math.acos(1/B.distance)*180/Math.PI:N._isClipped?w.lonaxisSpan[U]/2:null,q=["center","rotate","parallels","clipExtent"],G=function(xe){return xe?F:[]},ee=0;eere}else return!1},F.getPath=function(){return z().projection(F)},F.getBounds=function(xe){return F.getPath().bounds(xe)},F.precision(w.precision),N._isSatellite&&F.tilt(B.tilt).distance(B.distance),$&&F.clipAngle($-w.clipPad),F}function C(N,B,U){var V=1e-6,W=2.5,F=B[N],$=w.scopeDefaults[B.scope],q,G,ee;N==="lonaxis"?(q=$.lonaxisRange,G=$.lataxisRange,ee=function(_e,oe){return[_e,oe]}):N==="lataxis"&&(q=$.lataxisRange,G=$.lonaxisRange,ee=function(_e,oe){return[oe,_e]});var he={type:"linear",range:[q[0],q[1]-V],tick0:F.tick0,dtick:F.dtick};m.setConvert(he,U);var xe=m.calcTicks(he);!B.isScoped&&N==="lonaxis"&&xe.pop();for(var ve=xe.length,ce=new Array(ve),re=0;re0&&W<0&&(W+=360);var q=(W-V)/4;return{type:"Polygon",coordinates:[[[V,F],[V,$],[V+q,$],[V+2*q,$],[V+3*q,$],[W,$],[W,F],[W-q,F],[W-2*q,F],[W-3*q,F],[V,F]]]}}}),pD=Fe((te,Y)=>{var d=Mi(),y=Xh().attributes,z=Wd().dash,P=k6(),i=oh().overrideAll,n=Ym(),a={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:z},l=Y.exports=i({domain:y({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:n(P.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:n(P.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:P.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:P.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:P.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:P.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:a,lataxis:a},"plot","from-root");l.uirevision={valType:"any",editType:"none"}}),dX=Fe((te,Y)=>{var d=ji(),y=L_(),z=Md().getSubplotData,P=k6(),i=pD(),n=P.axesNames;Y.exports=function(l,o,u){y(l,o,u,{type:"geo",attributes:i,handleDefaults:a,fullData:u,partition:"y"})};function a(l,o,u,s){var h=z(s.fullData,"geo",s.id),m=h.map(function(ne){return ne.index}),b=u("resolution"),x=u("scope"),_=P.scopeDefaults[x],A=u("projection.type",_.projType),f=o._isAlbersUsa=A==="albers usa";f&&(x=o.scope="usa");var k=o._isScoped=x!=="world",w=o._isSatellite=A==="satellite",D=o._isConic=A.indexOf("conic")!==-1||A==="albers",E=o._isClipped=!!P.lonaxisSpan[A];if(l.visible===!1){var I=d.extendDeep({},o._template);I.showcoastlines=!1,I.showcountries=!1,I.showframe=!1,I.showlakes=!1,I.showland=!1,I.showocean=!1,I.showrivers=!1,I.showsubunits=!1,I.lonaxis&&(I.lonaxis.showgrid=!1),I.lataxis&&(I.lataxis.showgrid=!1),o._template=I}for(var M=u("visible"),p,g=0;g0&&G<0&&(G+=360);var ee=(q+G)/2,he;if(!f){var xe=k?_.projRotate:[ee,0,0];he=u("projection.rotation.lon",xe[0]),u("projection.rotation.lat",xe[1]),u("projection.rotation.roll",xe[2]),p=u("showcoastlines",!k&&M),p&&(u("coastlinecolor"),u("coastlinewidth")),p=u("showocean",M?void 0:!1),p&&u("oceancolor")}var ve,ce;if(f?(ve=-96.6,ce=38.7):(ve=k?ee:he,ce=($[0]+$[1])/2),u("center.lon",ve),u("center.lat",ce),w&&(u("projection.tilt"),u("projection.distance")),D){var re=_.projParallels||[0,60];u("projection.parallels",re)}u("projection.scale"),p=u("showland",M?void 0:!1),p&&u("landcolor"),p=u("showlakes",M?void 0:!1),p&&u("lakecolor"),p=u("showrivers",M?void 0:!1),p&&(u("rivercolor"),u("riverwidth")),p=u("showcountries",k&&x!=="usa"&&M),p&&(u("countrycolor"),u("countrywidth")),(x==="usa"||x==="north america"&&b===50)&&(u("showsubunits",M),u("subunitcolor"),u("subunitwidth")),k||(p=u("showframe",M),p&&(u("framecolor"),u("framewidth"))),u("bgcolor");var ge=u("fitbounds");ge&&(delete o.projection.scale,k?(delete o.center.lon,delete o.center.lat):E?(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon,delete o.projection.rotation.lat,delete o.lonaxis.range,delete o.lataxis.range):(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon))}}),mD=Fe((te,Y)=>{var d=Md().getSubplotCalcData,y=ji().counterRegex,z=fX(),P="geo",i=y(P),n={};n[P]={valType:"subplotid",dflt:P,editType:"calc"};function a(u){for(var s=u._fullLayout,h=u.calcdata,m=s._subplots[P],b=0;b{Y.exports={attributes:Eb(),supplyDefaults:tX(),colorbar:Mo(),formatLabels:rX(),calc:HC(),calcGeoJSON:fD().calcGeoJSON,plot:fD().plot,style:hD(),styleOnSelect:El().styleOnSelect,hoverPoints:sX(),eventData:lX(),selectPoints:uX(),moduleType:"trace",name:"scattergeo",basePlotModule:mD(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),mX=Fe((te,Y)=>{Y.exports=pX()}),Vw=Fe((te,Y)=>{var{hovertemplateAttrs:d,templatefallbackAttrs:y}=rc(),z=Eb(),P=zc(),i=_a(),n=Mi().defaultLine,a=an().extendFlat,l=z.marker.line;Y.exports=a({locations:{valType:"data_array",editType:"calc"},locationmode:z.locationmode,z:{valType:"data_array",editType:"calc"},geojson:a({},z.geojson,{}),featureidkey:z.featureidkey,text:a({},z.text,{}),hovertext:a({},z.hovertext,{}),marker:{line:{color:a({},l.color,{dflt:n}),width:a({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:z.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:z.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:a({},i.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:y(),showlegend:a({},i.showlegend,{dflt:!1})},P("",{cLetter:"z",editTypeOverride:"calc"}))}),gX=Fe((te,Y)=>{var d=ji(),y=Cc(),z=Vw(),P=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(i,n,a,l){function o(_,A){return d.coerce(i,n,z,_,A)}var u=o("locations"),s=o("z");if(!(u&&u.length&&d.isArrayOrTypedArray(s)&&s.length)){n.visible=!1;return}n._length=Math.min(u.length,s.length);var h=o("geojson"),m;(typeof h=="string"&&h!==""||d.isPlainObject(h))&&(m="geojson-id");var b=o("locationmode",m);b==="country names"&&d.warn(P),b==="geojson-id"&&o("featureidkey"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback");var x=o("marker.line.width");x&&o("marker.line.color"),o("marker.opacity"),y(i,n,l,o,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(n,o)}}),GC=Fe((te,Y)=>{var d=Ar(),y=ti().BADNUM,z=kp(),P=de(),i=$e();function n(a){return a&&typeof a=="string"}Y.exports=function(a,l){var o=l._length,u=new Array(o),s;l.geojson?s=function(_){return n(_)||d(_)}:s=n;for(var h=0;h{var d=ii(),y=Xi(),z=Zs(),P=lh();function i(l,o){o&&n(l,o)}function n(l,o){var u=o[0].trace,s=o[0].node3,h=s.selectAll(".choroplethlocation"),m=u.marker||{},b=m.line||{},x=P.makeColorScaleFuncFromTrace(u);h.each(function(_){d.select(this).attr("fill",x(_.z)).call(y.stroke,_.mlc||b.color).call(z.dashLine,"",_.mlw||b.width||0).style("opacity",m.opacity)}),z.selectedPointStyle(h,u)}function a(l,o){var u=o[0].node3,s=o[0].trace;s.selectedpoints?z.selectedPointStyle(u.selectAll(".choroplethlocation"),s):n(l,o)}Y.exports={style:i,styleOnSelect:a}}),gD=Fe((te,Y)=>{var d=ii(),y=ji(),z=U_(),P=VC().getTopojsonFeatures,i=Xm().findExtremes,n=ZC().style;function a(o,u,s){var h=u.layers.backplot.select(".choroplethlayer");y.makeTraceGroups(h,s,"trace choropleth").each(function(m){var b=d.select(this),x=b.selectAll("path.choroplethlocation").data(y.identity);x.enter().append("path").classed("choroplethlocation",!0),x.exit().remove(),n(o,m)})}function l(o,u){for(var s=o[0].trace,h=u[s.geo],m=h._subplot,b=s.locationmode,x=s._length,_=b==="geojson-id"?z.extractTraceFeature(o):P(s,m.topojson),A=[],f=[],k=0;k{var d=Os(),y=Vw(),z=ji().fillText;Y.exports=function(i,n,a){var l=i.cd,o=l[0].trace,u=i.subplot,s,h,m,b,x=[n,a],_=[n+360,a];for(h=0;h")}}}),YC=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){d.location=y.location,d.z=y.z;var n=P[i];return n.fIn&&n.fIn.properties&&(d.properties=n.fIn.properties),d.ct=n.ct,d}}),XC=Fe((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l,o,u,s;if(y===!1)for(a=0;a{Y.exports={attributes:Vw(),supplyDefaults:gX(),colorbar:E_(),calc:GC(),calcGeoJSON:gD().calcGeoJSON,plot:gD().plot,style:ZC().style,styleOnSelect:ZC().styleOnSelect,hoverPoints:KC(),eventData:YC(),selectPoints:XC(),moduleType:"trace",name:"choropleth",basePlotModule:mD(),categories:["geo","noOpacity","showLegend"],meta:{}}}),yX=Fe((te,Y)=>{Y.exports=vX()}),JC=Fe((te,Y)=>{var d=as(),y=ji(),z=qu();function P(n,a,l,o){var u=n.cd,s=u[0].t,h=u[0].trace,m=n.xa,b=n.ya,x=s.x,_=s.y,A=m.c2p(a),f=b.c2p(l),k=n.distance,w;if(s.tree){var D=m.p2c(A-k),E=m.p2c(A+k),I=b.p2c(f-k),M=b.p2c(f+k);o==="x"?w=s.tree.range(Math.min(D,E),Math.min(b._rl[0],b._rl[1]),Math.max(D,E),Math.max(b._rl[0],b._rl[1])):w=s.tree.range(Math.min(D,E),Math.min(I,M),Math.max(D,E),Math.max(I,M))}else w=s.ids;var p,g,C,T,N,B,U,V,W,F=k;if(o==="x"){var $=!!h.xperiodalignment,q=!!h.yperiodalignment;for(N=0;N=Math.min(G,ee)&&A<=Math.max(G,ee)?0:1/0}if(B=Math.min(he,xe)&&f<=Math.max(he,xe)?0:1/0}W=Math.sqrt(B*B+U*U),g=w[N]}}}else for(N=w.length-1;N>-1;N--)p=w[N],C=x[p],T=_[p],B=m.c2p(C)-A,U=b.c2p(T)-f,V=Math.sqrt(B*B+U*U),V{var d=20;Y.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:d,SYMBOL_STROKE:d/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),S6=Fe((te,Y)=>{var d=_a(),y=zn(),z=Lm(),P=ff(),i=Sh().axisHoverFormat,n=zc(),a=Ym(),l=an().extendFlat,o=oh().overrideAll,u=$_().DASHES,s=P.line,h=P.marker,m=h.line,b=Y.exports=o({x:P.x,x0:P.x0,dx:P.dx,y:P.y,y0:P.y0,dy:P.dy,xperiod:P.xperiod,yperiod:P.yperiod,xperiod0:P.xperiod0,yperiod0:P.yperiod0,xperiodalignment:P.xperiodalignment,yperiodalignment:P.yperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),text:P.text,hovertext:P.hovertext,textposition:P.textposition,textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:s.color,width:s.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:a(u),dflt:"solid"}},marker:l({},n("marker"),{symbol:h.symbol,angle:h.angle,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:l({},n("marker.line"),{width:m.width})}),connectgaps:P.connectgaps,fill:l({},P.fill,{dflt:"none"}),fillcolor:z(),selected:{marker:P.selected.marker,textfont:P.selected.textfont},unselected:{marker:P.unselected.marker,textfont:P.unselected.textfont},opacity:d.opacity},"calc","nested");b.x.editType=b.y.editType=b.x0.editType=b.y0.editType="calc+clearAxisTypes",b.hovertemplate=P.hovertemplate,b.hovertemplatefallback=P.hovertemplatefallback,b.texttemplate=P.texttemplate,b.texttemplatefallback=P.texttemplatefallback}),QC=Fe(te=>{var Y=$_();te.isOpenSymbol=function(d){return typeof d=="string"?Y.OPEN_RE.test(d):d%200>100},te.isDotSymbol=function(d){return typeof d=="string"?Y.DOT_RE.test(d):d>200}}),_X=Fe((te,Y)=>{var d=ji(),y=as(),z=QC(),P=S6(),i=Mg(),n=Oc(),a=Jg(),l=S0(),o=X0(),u=Pm(),s=Im(),h=mm();Y.exports=function(m,b,x,_){function A(p,g){return d.coerce(m,b,P,p,g)}var f=m.marker?z.isOpenSymbol(m.marker.symbol):!1,k=n.isBubble(m),w=a(m,b,_,A);if(!w){b.visible=!1;return}l(m,b,_,A),A("xhoverformat"),A("yhoverformat");var D=w{var d=Ys();Y.exports=function(y,z,P){var i=y.i;return"x"in y||(y.x=z._x[i]),"y"in y||(y.y=z._y[i]),d(y,z,P)}}),bX=Fe((te,Y)=>{function d(a,l,o,u,s){for(var h=s+1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>=0?(h=m,s=m-1):u=m+1}return h}function y(a,l,o,u,s){for(var h=s+1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>0?(h=m,s=m-1):u=m+1}return h}function z(a,l,o,u,s){for(var h=u-1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<0?(h=m,u=m+1):s=m-1}return h}function P(a,l,o,u,s){for(var h=u-1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<=0?(h=m,u=m+1):s=m-1}return h}function i(a,l,o,u,s){for(;u<=s;){var h=u+s>>>1,m=a[h],b=o!==void 0?o(m,l):m-l;if(b===0)return h;b<=0?u=h+1:s=h-1}return-1}function n(a,l,o,u,s,h){return typeof o=="function"?h(a,l,o,u===void 0?0:u|0,s===void 0?a.length-1:s|0):h(a,l,void 0,o===void 0?0:o|0,u===void 0?a.length-1:u|0)}Y.exports={ge:function(a,l,o,u,s){return n(a,l,o,u,s,d)},gt:function(a,l,o,u,s){return n(a,l,o,u,s,y)},lt:function(a,l,o,u,s){return n(a,l,o,u,s,z)},le:function(a,l,o,u,s){return n(a,l,o,u,s,P)},eq:function(a,l,o,u,s){return n(a,l,o,u,s,i)}}}),e1=Fe((te,Y)=>{Y.exports=function(z,P,i){var n={},a,l;if(typeof P=="string"&&(P=y(P)),Array.isArray(P)){var o={};for(l=0;l{var d=e1();Y.exports=y;function y(z){var P;return arguments.length>1&&(z=arguments),typeof z=="string"?z=z.split(/\s/).map(parseFloat):typeof z=="number"&&(z=[z]),z.length&&typeof z[0]=="number"?z.length===1?P={width:z[0],height:z[0],x:0,y:0}:z.length===2?P={width:z[0],height:z[1],x:0,y:0}:P={x:z[0],y:z[1],width:z[2]-z[0]||0,height:z[3]-z[1]||0}:z&&(z=d(z,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),P={x:z.left||0,y:z.top||0},z.width==null?z.right?P.width=z.right-P.x:P.width=0:P.width=z.width,z.height==null?z.bottom?P.height=z.bottom-P.y:P.height=0:P.height=z.height),P}}),Lb=Fe((te,Y)=>{Y.exports=d;function d(y,z){if(!y||y.length==null)throw Error("Argument should be an array");z==null?z=1:z=Math.floor(z);for(var P=Array(z*2),i=0;in&&(n=y[l]),y[l]{Y.exports=function(){for(var d=0;d{var d=FC();Y.exports=y;function y(z,P,i){if(!z)throw new TypeError("must specify data as first parameter");if(i=+(i||0)|0,Array.isArray(z)&&z[0]&&typeof z[0][0]=="number"){var n=z[0].length,a=z.length*n,l,o,u,s;(!P||typeof P=="string")&&(P=new(d(P||"float32"))(a+i));var h=P.length-i;if(a!==h)throw new Error("source length "+a+" ("+n+"x"+z.length+") does not match destination length "+h);for(l=0,u=i;l{Y.exports=function(d){var y=typeof d;return d!==null&&(y==="object"||y==="function")}}),TX=Fe((te,Y)=>{Y.exports=Math.log2||function(d){return Math.log(d)*Math.LOG2E}}),SX=Fe((te,Y)=>{var d=bX(),y=b6(),z=Ww(),P=Lb(),i=e1(),n=wX(),a=Pb(),l=kX(),o=FC(),u=TX(),s=1073741824;Y.exports=function(m,b){b||(b={}),m=a(m,"float64"),b=i(b,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let x=n(b.maxDepth,255),_=n(b.bounds,P(m,2));_[0]===_[2]&&_[2]++,_[1]===_[3]&&_[3]++;let A=h(m,_),f=m.length>>>1,k;b.dtype||(b.dtype="array"),typeof b.dtype=="string"?k=new(o(b.dtype))(f):b.dtype&&(k=b.dtype,Array.isArray(k)&&(k.length=f));for(let N=0;Nx||F>s){for(let se=0;seme||G>fe||ee=xe||oe===J)return;let Ce=w[_e];J===void 0&&(J=Ce.length);for(let ct=oe;ct=V&&ze<=F&&Ee>=W&&Ee<=$&&ve.push(Ae)}let Be=D[_e],Oe=Be[oe*4+0],Ze=Be[oe*4+1],Ge=Be[oe*4+2],rt=Be[oe*4+3],_t=re(Be,oe+1),pt=se*.5,gt=_e+1;ce(ge,ne,pt,gt,Oe,Ze||Ge||rt||_t),ce(ge,ne+pt,pt,gt,Ze,Ge||rt||_t),ce(ge+pt,ne,pt,gt,Ge,rt||_t),ce(ge+pt,ne+pt,pt,gt,rt,_t)}function re(ge,ne){let se=null,_e=0;for(;se===null;)if(se=ge[ne*4+_e],_e++,_e>ge.length)return null;return se}return ve}function C(N,B,U,V,W){let F=[];for(let $=0;${Y.exports=SX()}),vD=Fe((te,Y)=>{Y.exports=d;function d(y){var z=0,P=0,i=0,n=0;return y.map(function(a){a=a.slice();var l=a[0],o=l.toUpperCase();if(l!=o)switch(a[0]=o,l){case"a":a[6]+=i,a[7]+=n;break;case"v":a[1]+=n;break;case"h":a[1]+=i;break;default:for(var u=1;u{Object.defineProperty(te,"__esModule",{value:!0});var d=function(){function l(o,u){var s=[],h=!0,m=!1,b=void 0;try{for(var x=o[Symbol.iterator](),_;!(h=(_=x.next()).done)&&(s.push(_.value),!(u&&s.length===u));h=!0);}catch(A){m=!0,b=A}finally{try{!h&&x.return&&x.return()}finally{if(m)throw b}}return s}return function(o,u){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return l(o,u);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=Math.PI*2,z=function(l,o,u,s,h,m,b){var x=l.x,_=l.y;x*=o,_*=u;var A=s*x-h*_,f=h*x+s*_;return{x:A+m,y:f+b}},P=function(l,o){var u=o===1.5707963267948966?.551915024494:o===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(o/4),s=Math.cos(l),h=Math.sin(l),m=Math.cos(l+o),b=Math.sin(l+o);return[{x:s-h*u,y:h+s*u},{x:m+b*u,y:b-m*u},{x:m,y:b}]},i=function(l,o,u,s){var h=l*s-o*u<0?-1:1,m=l*u+o*s;return m>1&&(m=1),m<-1&&(m=-1),h*Math.acos(m)},n=function(l,o,u,s,h,m,b,x,_,A,f,k){var w=Math.pow(h,2),D=Math.pow(m,2),E=Math.pow(f,2),I=Math.pow(k,2),M=w*D-w*I-D*E;M<0&&(M=0),M/=w*I+D*E,M=Math.sqrt(M)*(b===x?-1:1);var p=M*h/m*k,g=M*-m/h*f,C=A*p-_*g+(l+u)/2,T=_*p+A*g+(o+s)/2,N=(f-p)/h,B=(k-g)/m,U=(-f-p)/h,V=(-k-g)/m,W=i(1,0,N,B),F=i(N,B,U,V);return x===0&&F>0&&(F-=y),x===1&&F<0&&(F+=y),[C,T,W,F]},a=function(l){var o=l.px,u=l.py,s=l.cx,h=l.cy,m=l.rx,b=l.ry,x=l.xAxisRotation,_=x===void 0?0:x,A=l.largeArcFlag,f=A===void 0?0:A,k=l.sweepFlag,w=k===void 0?0:k,D=[];if(m===0||b===0)return[];var E=Math.sin(_*y/360),I=Math.cos(_*y/360),M=I*(o-s)/2+E*(u-h)/2,p=-E*(o-s)/2+I*(u-h)/2;if(M===0&&p===0)return[];m=Math.abs(m),b=Math.abs(b);var g=Math.pow(M,2)/Math.pow(m,2)+Math.pow(p,2)/Math.pow(b,2);g>1&&(m*=Math.sqrt(g),b*=Math.sqrt(g));var C=n(o,u,s,h,m,b,f,w,E,I,M,p),T=d(C,4),N=T[0],B=T[1],U=T[2],V=T[3],W=Math.abs(V)/(y/4);Math.abs(1-W)<1e-7&&(W=1);var F=Math.max(Math.ceil(W),1);V/=F;for(var $=0;${Y.exports=y;var d=CX();function y(i){for(var n,a=[],l=0,o=0,u=0,s=0,h=null,m=null,b=0,x=0,_=0,A=i.length;_4?(l=f[f.length-4],o=f[f.length-3]):(l=b,o=x),a.push(f)}return a}function z(i,n,a,l){return["C",i,n,a,l,a,l]}function P(i,n,a,l,o,u){return["C",i/3+2/3*a,n/3+2/3*l,o/3+2/3*a,u/3+2/3*l,o,u]}}),yD=Fe((te,Y)=>{Y.exports=function(d){return typeof d!="string"?!1:(d=d.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(d)&&/[\dz]$/i.test(d)&&d.length>4))}}),MX=Fe((te,Y)=>{var d=T_(),y=vD(),z=AX(),P=yD(),i=t6();Y.exports=n;function n(a){if(Array.isArray(a)&&a.length===1&&typeof a[0]=="string"&&(a=a[0]),typeof a=="string"&&(i(P(a),"String is not an SVG path."),a=d(a)),i(Array.isArray(a),"Argument should be a string or an array of path segments."),a=y(a),a=z(a),!a.length)return[0,0,0,0];for(var l=[1/0,1/0,-1/0,-1/0],o=0,u=a.length;ol[2]&&(l[2]=s[h+0]),s[h+1]>l[3]&&(l[3]=s[h+1]);return l}}),EX=Fe((te,Y)=>{var d=Math.PI,y=l(120);Y.exports=z;function z(o){for(var u,s=[],h=0,m=0,b=0,x=0,_=null,A=null,f=0,k=0,w=0,D=o.length;w7&&(s.push(E.splice(0,7)),E.unshift("C"));break;case"S":var M=f,p=k;(u=="C"||u=="S")&&(M+=M-h,p+=p-m),E=["C",M,p,E[1],E[2],E[3],E[4]];break;case"T":u=="Q"||u=="T"?(_=f*2-_,A=k*2-A):(_=f,A=k),E=i(f,k,_,A,E[1],E[2]);break;case"Q":_=E[1],A=E[2],E=i(f,k,E[1],E[2],E[3],E[4]);break;case"L":E=P(f,k,E[1],E[2]);break;case"H":E=P(f,k,E[1],k);break;case"V":E=P(f,k,f,E[1]);break;case"Z":E=P(f,k,b,x);break}u=I,f=E[E.length-2],k=E[E.length-1],E.length>4?(h=E[E.length-4],m=E[E.length-3]):(h=f,m=k),s.push(E)}return s}function P(o,u,s,h){return["C",o,u,s,h,s,h]}function i(o,u,s,h,m,b){return["C",o/3+2/3*s,u/3+2/3*h,m/3+2/3*s,b/3+2/3*h,m,b]}function n(o,u,s,h,m,b,x,_,A,f){if(f)T=f[0],N=f[1],g=f[2],C=f[3];else{var k=a(o,u,-m);o=k.x,u=k.y,k=a(_,A,-m),_=k.x,A=k.y;var w=(o-_)/2,D=(u-A)/2,E=w*w/(s*s)+D*D/(h*h);E>1&&(E=Math.sqrt(E),s=E*s,h=E*h);var I=s*s,M=h*h,p=(b==x?-1:1)*Math.sqrt(Math.abs((I*M-I*D*D-M*w*w)/(I*D*D+M*w*w)));p==1/0&&(p=1);var g=p*s*D/h+(o+_)/2,C=p*-h*w/s+(u+A)/2,T=Math.asin(((u-C)/h).toFixed(9)),N=Math.asin(((A-C)/h).toFixed(9));T=oN&&(T=T-d*2),!x&&N>T&&(N=N-d*2)}if(Math.abs(N-T)>y){var B=N,U=_,V=A;N=T+y*(x&&N>T?1:-1),_=g+s*Math.cos(N),A=C+h*Math.sin(N);var W=n(_,A,s,h,m,0,x,U,V,[N,B,g,C])}var F=Math.tan((N-T)/4),$=4/3*s*F,q=4/3*h*F,G=[2*o-(o+$*Math.sin(T)),2*u-(u-q*Math.cos(T)),_+$*Math.sin(N),A-q*Math.cos(N),_,A];if(f)return G;W&&(G=G.concat(W));for(var ee=0;ee{var d=vD(),y=EX(),z={M:"moveTo",C:"bezierCurveTo"};Y.exports=function(P,i){P.beginPath(),y(d(i)).forEach(function(n){var a=n[0],l=n.slice(1);P[z[a]].apply(P,l)}),P.closePath()}}),PX=Fe((te,Y)=>{var d=b6();Y.exports=z;var y=1e20;function z(n,a){a||(a={});var l=a.cutoff==null?.25:a.cutoff,o=a.radius==null?8:a.radius,u=a.channel||0,s,h,m,b,x,_,A,f,k,w,D;if(ArrayBuffer.isView(n)||Array.isArray(n)){if(!a.width||!a.height)throw Error("For raw data width and height should be provided by options");s=a.width,h=a.height,b=n,a.stride?_=a.stride:_=Math.floor(n.length/s/h)}else window.HTMLCanvasElement&&n instanceof window.HTMLCanvasElement?(f=n,A=f.getContext("2d"),s=f.width,h=f.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.CanvasRenderingContext2D&&n instanceof window.CanvasRenderingContext2D?(f=n.canvas,A=n,s=f.width,h=f.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.ImageData&&n instanceof window.ImageData&&(k=n,s=n.width,h=n.height,b=k.data,_=4);if(m=Math.max(s,h),window.Uint8ClampedArray&&b instanceof window.Uint8ClampedArray||window.Uint8Array&&b instanceof window.Uint8Array)for(x=b,b=Array(s*h),w=0,D=x.length;w{var d=MX(),y=T_(),z=LX(),P=yD(),i=PX(),n=document.createElement("canvas"),a=n.getContext("2d");Y.exports=l;function l(s,h){if(!P(s))throw Error("Argument should be valid svg path string");h||(h={});var m,b;h.shape?(m=h.shape[0],b=h.shape[1]):(m=n.width=h.w||h.width||200,b=n.height=h.h||h.height||200);var x=Math.min(m,b),_=h.stroke||0,A=h.viewbox||h.viewBox||d(s),f=[m/(A[2]-A[0]),b/(A[3]-A[1])],k=Math.min(f[0]||0,f[1]||0)/2;if(a.fillStyle="black",a.fillRect(0,0,m,b),a.fillStyle="white",_&&(typeof _!="number"&&(_=1),_>0?a.strokeStyle="white":a.strokeStyle="black",a.lineWidth=Math.abs(_)),a.translate(m*.5,b*.5),a.scale(k,k),u()){var w=new Path2D(s);a.fill(w),_&&a.stroke(w)}else{var D=y(s);z(a,D),a.fill(),_&&a.stroke()}a.setTransform(1,0,0,1,0,0);var E=i(a,{cutoff:h.cutoff!=null?h.cutoff:.5,radius:h.radius!=null?h.radius:x*.5});return E}var o;function u(){if(o!=null)return o;var s=document.createElement("canvas").getContext("2d");if(s.canvas.width=s.canvas.height=1,!window.Path2D)return o=!1;var h=new Path2D("M0,0h1v1h-1v-1Z");s.fillStyle="black",s.fill(h);var m=s.getImageData(0,0,1,1);return o=m&&m.data&&m.data[3]===255}}),Ib=Fe((te,Y)=>{var d=Ar(),y=IX(),z=F_(),P=as(),i=ji(),n=i.isArrayOrTypedArray,a=Zs(),l=Zc(),o=ly().formatColor,u=Oc(),s=Hv(),h=QC(),m=$_(),b=oo().DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},_=T0().appendArrayPointValue;function A(W,F){var $,q={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},G=W._context.plotGlPixelRatio;if(F.visible!==!0)return q;if(u.hasText(F)&&(q.text=f(W,F),q.textSel=E(W,F,F.selected),q.textUnsel=E(W,F,F.unselected)),u.hasMarkers(F)&&(q.marker=w(W,F),q.markerSel=D(W,F,F.selected),q.markerUnsel=D(W,F,F.unselected),!F.unselected&&n(F.marker.opacity))){var ee=F.marker.opacity;for(q.markerUnsel.opacity=new Array(ee.length),$=0;$500?"bold":"normal":W}function w(W,F){var $=F._length,q=F.marker,G={},ee,he=n(q.symbol),xe=n(q.angle),ve=n(q.color),ce=n(q.line.color),re=n(q.opacity),ge=n(q.size),ne=n(q.line.width),se;if(he||(se=h.isOpenSymbol(q.symbol)),he||ve||ce||re||xe){G.symbols=new Array($),G.angles=new Array($),G.colors=new Array($),G.borderColors=new Array($);var _e=q.symbol,oe=q.angle,J=o(q,q.opacity,$),me=o(q.line,q.opacity,$);if(!n(me[0])){var fe=me;for(me=Array($),ee=0;ee<$;ee++)me[ee]=fe}if(!n(J[0])){var Ce=J;for(J=Array($),ee=0;ee<$;ee++)J[ee]=Ce}if(!n(_e)){var Be=_e;for(_e=Array($),ee=0;ee<$;ee++)_e[ee]=Be}if(!n(oe)){var Oe=oe;for(oe=Array($),ee=0;ee<$;ee++)oe[ee]=Oe}for(G.symbols=_e,G.angles=oe,G.colors=J,G.borderColors=me,ee=0;ee<$;ee++)he&&(se=h.isOpenSymbol(q.symbol[ee])),se&&(me[ee]=J[ee].slice(),J[ee]=J[ee].slice(),J[ee][3]=0);for(G.opacity=F.opacity,G.markers=new Array($),ee=0;ee<$;ee++)G.markers[ee]=N({mx:G.symbols[ee],ma:G.angles[ee]},F)}else se?(G.color=z(q.color,"uint8"),G.color[3]=0,G.borderColor=z(q.color,"uint8")):(G.color=z(q.color,"uint8"),G.borderColor=z(q.line.color,"uint8")),G.opacity=F.opacity*q.opacity,G.marker=N({mx:q.symbol,ma:q.angle},F);var Ze=1,Ge=s(F,Ze),rt;if(ge||ne){var _t=G.sizes=new Array($),pt=G.borderSizes=new Array($),gt=0,ct;if(ge){for(ee=0;ee<$;ee++)_t[ee]=Ge(q.size[ee]),gt+=_t[ee];ct=gt/$}else for(rt=Ge(q.size),ee=0;ee<$;ee++)_t[ee]=rt;if(ne)for(ee=0;ee<$;ee++)pt[ee]=q.line.width[ee];else for(rt=q.line.width,ee=0;ee<$;ee++)pt[ee]=rt;G.sizeAvg=ct}else G.size=Ge(q&&q.size||10),G.borderSizes=Ge(q.line.width);return G}function D(W,F,$){var q=F.marker,G={};return $&&($.marker&&$.marker.symbol?G=w(W,i.extendFlat({},q,$.marker)):$.marker&&($.marker.size&&(G.size=$.marker.size),$.marker.color&&(G.colors=$.marker.color),$.marker.opacity!==void 0&&(G.opacity=$.marker.opacity))),G}function E(W,F,$){var q={};if(!$)return q;if($.textfont){var G={opacity:1,text:F.text,texttemplate:F.texttemplate,textposition:F.textposition,textfont:i.extendFlat({},F.textfont)};$.textfont&&i.extendFlat(G.textfont,$.textfont),q=f(W,G)}return q}function I(W,F,$){var q={capSize:F.width*2*$,lineWidth:F.thickness*$,color:F.color};return F.copy_ystyle&&(q=W.error_y),q}var M=m.SYMBOL_SDF_SIZE,p=m.SYMBOL_SIZE,g=m.SYMBOL_STROKE,C={},T=a.symbolFuncs[0](p*.05);function N(W,F){var $=W.mx;if($==="circle")return null;var q,G,ee=a.symbolNumber($),he=a.symbolFuncs[ee%100],xe=!!a.symbolNoDot[ee%100],ve=!!a.symbolNoFill[ee%100],ce=h.isDotSymbol($);if(W.ma&&($+="_"+W.ma),C[$])return C[$];var re=a.getMarkerAngle(W,F);return ce&&!xe?q=he(p*1.1,re)+T:q=he(p,re),G=y(q,{w:M,h:M,viewBox:[-p,-p,p,p],stroke:ve?g:-g}),C[$]=G,G||null}function B(W,F,$){var q=$.length,G=q/2,ee,he;if(u.hasLines(F)&&G)if(F.line.shape==="hv"){for(ee=[],he=0;hem.TOO_MANY_POINTS||u.hasMarkers(F)?"rect":"round";if(ce&&F.connectgaps){var ge=ee[0],ne=ee[1];for(he=0;he1?ve[he]:ve[0]:ve,se=n(ce)?ce.length>1?ce[he]:ce[0]:ce,_e=x[ne],oe=x[se],J=re?re/.8+1:0,me=-oe*J-oe*.5;ee.offset[he]=[_e*J/ge,me/ge]}}return ee}Y.exports={style:A,markerStyle:w,markerSelection:D,linePositions:B,errorBarPositions:U,textPosition:V}}),_D=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=z._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return z._scene||(P=z._scene={},P.init=function(){d.extendFlat(P,n,i)},P.init(),P.update=function(a){var l=d.repeat(a,P.count);if(P.fill2d&&P.fill2d.update(l),P.scatter2d&&P.scatter2d.update(l),P.line2d&&P.line2d.update(l),P.error2d&&P.error2d.update(l.concat(l)),P.select2d&&P.select2d.update(l),P.glText)for(var o=0;o{var d=eA(),y=ji(),z=Zc(),P=Xm().findExtremes,i=Dm(),n=yt(),a=n.calcMarkerSize,l=n.calcAxisExpansion,o=n.setFirstScatter,u=zm(),s=Ib(),h=_D(),m=ti().BADNUM,b=$_().TOO_MANY_POINTS;Y.exports=function(A,f){var k=A._fullLayout,w=f._xA=z.getFromId(A,f.xaxis,"x"),D=f._yA=z.getFromId(A,f.yaxis,"y"),E=k._plots[f.xaxis+f.yaxis],I=f._length,M=I>=b,p=I*2,g={},C,T=w.makeCalcdata(f,"x"),N=D.makeCalcdata(f,"y"),B=i(f,w,"x",T),U=i(f,D,"y",N),V=B.vals,W=U.vals;f._x=V,f._y=W,f.xperiodalignment&&(f._origX=T,f._xStarts=B.starts,f._xEnds=B.ends),f.yperiodalignment&&(f._origY=N,f._yStarts=U.starts,f._yEnds=U.ends);var F=new Array(p),$=new Array(I);for(C=0;C1&&y.extendFlat(I.line,s.linePositions(A,k,w)),I.errorX||I.errorY){var M=s.errorBarPositions(A,k,w,D,E);I.errorX&&y.extendFlat(I.errorX,M.x),I.errorY&&y.extendFlat(I.errorY,M.y)}return I.text&&(y.extendFlat(I.text,{positions:w},s.textPosition(A,k,I.text,I.marker)),y.extendFlat(I.textSel,{positions:w},s.textPosition(A,k,I.text,I.markerSel)),y.extendFlat(I.textUnsel,{positions:w},s.textPosition(A,k,I.text,I.markerUnsel))),I}}),xD=Fe((te,Y)=>{var d=ji(),y=Xi(),z=oo().DESELECTDIM;function P(i){var n=i[0],a=n.trace,l=n.t,o=l._scene,u=l.index,s=o.selectBatch[u],h=o.unselectBatch[u],m=o.textOptions[u],b=o.textSelectedOptions[u]||{},x=o.textUnselectedOptions[u]||{},_=d.extendFlat({},m),A,f;if(s.length||h.length){var k=b.color,w=x.color,D=m.color,E=d.isArrayOrTypedArray(D);for(_.color=new Array(a._length),A=0;A{var d=Oc(),y=xD().styleTextSelection;Y.exports=function(z,P){var i=z.cd,n=z.xaxis,a=z.yaxis,l=[],o=i[0].trace,u=i[0].t,s=o._length,h=u.x,m=u.y,b=u._scene,x=u.index;if(!b)return l;var _=d.hasText(o),A=d.hasMarkers(o),f=!A&&!_;if(o.visible!==!0||f)return l;var k=[],w=[];if(P!==!1&&!P.degenerate)for(var D=0;D{var d=JC();Y.exports={moduleType:"trace",name:"scattergl",basePlotModule:Rf(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:S6(),supplyDefaults:_X(),crossTraceDefaults:R4(),colorbar:Mo(),formatLabels:xX(),calc:DX(),hoverPoints:d.hoverPoints,selectPoints:bD(),meta:{}}}),OX=Fe((te,Y)=>{var d=b6();Y.exports=y,Y.exports.to=y,Y.exports.from=z;function y(P,i){i==null&&(i=!0);var n=P[0],a=P[1],l=P[2],o=P[3];o==null&&(o=i?1:255),i&&(n*=255,a*=255,l*=255,o*=255),n=d(n,0,255)&255,a=d(a,0,255)&255,l=d(l,0,255)&255,o=d(o,0,255)&255;var u=n*16777216+(a<<16)+(l<<8)+o;return u}function z(P,i){P=+P;var n=P>>>24,a=(P&16711680)>>>16,l=(P&65280)>>>8,o=P&255;return i===!1?[n,a,l,o]:[n/255,a/255,l/255,o/255]}}),Kd=Fe((te,Y)=>{var d=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;function P(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function i(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var o=Object.getOwnPropertyNames(a).map(function(s){return a[s]});if(o.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(s){u[s]=s}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Y.exports=i()?Object.assign:function(n,a){for(var l,o=P(n),u,s=1;s{Y.exports=function(d){typeof d=="string"&&(d=[d]);for(var y=[].slice.call(arguments,1),z=[],P=0;P{Y.exports=function(d,y,z){Array.isArray(z)||(z=[].slice.call(arguments,2));for(var P=0,i=z.length;P{Y.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),tA=Fe((te,Y)=>{Y.exports=z,Y.exports.float32=Y.exports.float=z,Y.exports.fract32=Y.exports.fract=y;var d=new Float32Array(1);function y(P,i){if(P.length){if(P instanceof Float32Array)return new Float32Array(P.length);i instanceof Float32Array||(i=z(P));for(var n=0,a=i.length;n{function d(C,T){var N=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(N!=null){var B,U,V,W,F=[],$=!0,q=!1;try{if(V=(N=N.call(C)).next,T!==0)for(;!($=(B=V.call(N)).done)&&(F.push(B.value),F.length!==T);$=!0);}catch(G){q=!0,U=G}finally{try{if(!$&&N.return!=null&&(W=N.return(),Object(W)!==W))return}finally{if(q)throw U}}return F}}function y(C,T){return i(C)||d(C,T)||a(C,T)||u()}function z(C){return P(C)||n(C)||a(C)||o()}function P(C){if(Array.isArray(C))return l(C)}function i(C){if(Array.isArray(C))return C}function n(C){if(typeof Symbol<"u"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function a(C,T){if(C){if(typeof C=="string")return l(C,T);var N=Object.prototype.toString.call(C).slice(8,-1);if(N==="Object"&&C.constructor&&(N=C.constructor.name),N==="Map"||N==="Set")return Array.from(C);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return l(C,T)}}function l(C,T){(T==null||T>C.length)&&(T=C.length);for(var N=0,B=new Array(T);N0)throw new Error("Invalid string. Length must be a multiple of 4");var E=w.indexOf("=");E===-1&&(E=D);var I=E===D?0:4-E%4;return[E,I]}function b(w){var D=m(w),E=D[0],I=D[1];return(E+I)*3/4-I}function x(w,D,E){return(D+E)*3/4-E}function _(w){var D,E=m(w),I=E[0],M=E[1],p=new o(x(w,I,M)),g=0,C=M>0?I-4:I,T;for(T=0;T>16&255,p[g++]=D>>8&255,p[g++]=D&255;return M===2&&(D=l[w.charCodeAt(T)]<<2|l[w.charCodeAt(T+1)]>>4,p[g++]=D&255),M===1&&(D=l[w.charCodeAt(T)]<<10|l[w.charCodeAt(T+1)]<<4|l[w.charCodeAt(T+2)]>>2,p[g++]=D>>8&255,p[g++]=D&255),p}function A(w){return a[w>>18&63]+a[w>>12&63]+a[w>>6&63]+a[w&63]}function f(w,D,E){for(var I,M=[],p=D;pC?C:g+p));return I===1?(D=w[E-1],M.push(a[D>>2]+a[D<<4&63]+"==")):I===2&&(D=(w[E-2]<<8)+w[E-1],M.push(a[D>>10]+a[D>>4&63]+a[D<<2&63]+"=")),M.join("")}},7518:function(i,n,a){var l=a(1433);function o(h,m,b,x,_,A){this.location=h,this.dimension=m,this.a=b,this.b=x,this.c=_,this.d=A}o.prototype.bind=function(h){switch(this.dimension){case 1:h.vertexAttrib1f(this.location,this.a);break;case 2:h.vertexAttrib2f(this.location,this.a,this.b);break;case 3:h.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:h.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d);break}};function u(h,m,b){this.gl=h,this._ext=m,this.handle=b,this._attribs=[],this._useElements=!1,this._elementsType=h.UNSIGNED_SHORT}u.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var h=0;h1.0001)return null;T+=C[E]}return Math.abs(T-1)>.001?null:[I,m(x,C),C]}},7636:function(i){i.exports=n;function n(a,l){l=l||1;var o=Math.random()*2*Math.PI,u=Math.random()*2-1,s=Math.sqrt(1-u*u)*l;return a[0]=Math.cos(o)*s,a[1]=Math.sin(o)*s,a[2]=u*l,a}},7640:function(i,n,a){var l=a(1888);function o(_){switch(_){case"uint32":return[l.mallocUint32,l.freeUint32];default:return null}}var u={"uint32,1,0":function(_,A){return function(f,k,w,D,E,I,M,p,g,C,T){var N,B,U,V=f*E+D,W,F=_(p),H,q,G,ee;for(N=f+1;N<=k;++N){for(B=N,V+=E,U=V,H=0,q=V,W=0;Wf;){H=0,q=U-E;t:for(W=0;Wee)break t;q+=C,H+=T}for(H=U,q=U-E,W=0;W>1,H=F-U,q=F+U,G=V,ee=H,he=F,be=q,ve=W,ce=w+1,re=D-1,ge=!0,ne,se,_e,oe,J,me,fe,Ce,Re,Be=0,Ze=0,Ge=0,tt,_t,mt,vt,ct,Ae,Oe,Le,nt,xt,ut,Et,Gt,Qt,vr,mr,Yr=C,ii=A(Yr),Lr=A(Yr);_t=M*G,mt=M*ee,mr=I;e:for(tt=0;tt0){se=G,G=ee,ee=se;break e}if(Ge<0)break e;mr+=N}_t=M*be,mt=M*ve,mr=I;e:for(tt=0;tt0){se=be,be=ve,ve=se;break e}if(Ge<0)break e;mr+=N}_t=M*G,mt=M*he,mr=I;e:for(tt=0;tt0){se=G,G=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,mt=M*he,mr=I;e:for(tt=0;tt0){se=ee,ee=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*G,mt=M*be,mr=I;e:for(tt=0;tt0){se=G,G=be,be=se;break e}if(Ge<0)break e;mr+=N}_t=M*he,mt=M*be,mr=I;e:for(tt=0;tt0){se=he,he=be,be=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,mt=M*ve,mr=I;e:for(tt=0;tt0){se=ee,ee=ve,ve=se;break e}if(Ge<0)break e;mr+=N}_t=M*ee,mt=M*he,mr=I;e:for(tt=0;tt0){se=ee,ee=he,he=se;break e}if(Ge<0)break e;mr+=N}_t=M*be,mt=M*ve,mr=I;e:for(tt=0;tt0){se=be,be=ve,ve=se;break e}if(Ge<0)break e;mr+=N}for(_t=M*G,mt=M*ee,vt=M*he,ct=M*be,Ae=M*ve,Oe=M*V,Le=M*F,nt=M*W,vr=0,mr=I,tt=0;tt0)re--;else if(Ge<0){for(_t=M*me,mt=M*ce,vt=M*re,mr=I,tt=0;tt0)for(;;){fe=I+re*M,vr=0;e:for(tt=0;tt0){if(--reW){e:for(;;){for(fe=I+ce*M,vr=0,mr=I,tt=0;tt1&&k?D(f,k[0],k[1]):D(f)}var b={"uint32,1,0":function(_,A){return function(f){var k=f.data,w=f.offset|0,D=f.shape,E=f.stride,I=E[0]|0,M=D[0]|0,p=E[1]|0,g=D[1]|0,C=p,T=p,N=1;M<=32?_(0,M-1,k,w,I,p,M,g,C,T,N):A(0,M-1,k,w,I,p,M,g,C,T,N)}}};function x(_,A){var f=[A,_].join(","),k=b[f],w=s(_,A),D=m(_,A,w);return k(w,D)}i.exports=x},7642:function(i,n,a){var l=a(8954),o=a(1682);i.exports=m;function u(b,x){this.point=b,this.index=x}function s(b,x){for(var _=b.point,A=x.point,f=_.length,k=0;k=2)return!1;V[F]=H}return!0}):U=U.filter(function(V){for(var W=0;W<=A;++W){var F=C[V[W]];if(F<0)return!1;V[W]=F}return!0}),A&1)for(var w=0;w",q="",G=H.length,ee=q.length,he=V[0]===k||V[0]===E,be=0,ve=-ee;be>-1&&(be=W.indexOf(H,be),!(be===-1||(ve=W.indexOf(q,be+G),ve===-1)||ve<=be));){for(var ce=be;ce=ve)F[ce]=null,W=W.substr(0,ce)+" "+W.substr(ce+1);else if(F[ce]!==null){var re=F[ce].indexOf(V[0]);re===-1?F[ce]+=V:he&&(F[ce]=F[ce].substr(0,re+1)+(1+parseInt(F[ce][re+1]))+F[ce].substr(re+2))}var ge=be+G,ne=W.substr(ge,ve-ge),se=ne.indexOf(H);se!==-1?be=se:be=ve+ee}return F}function p(U,V,W){for(var F=V.textAlign||"start",H=V.textBaseline||"alphabetic",q=[1073741824,1073741824],G=[0,0],ee=U.length,he=0;he/g,` +`):W=W.replace(/\/g," ");var G="",ee=[];for(J=0;J-1?parseInt(Le[1+ut]):0,Qt=Et>-1?parseInt(nt[1+Et]):0;Gt!==Qt&&(xt=xt.replace(Ge(),"?px "),Ce*=Math.pow(.75,Qt-Gt),xt=xt.replace("?px ",Ge())),fe+=.25*re*(Qt-Gt)}if(q.superscripts===!0){var vr=Le.indexOf(k),mr=nt.indexOf(k),Yr=vr>-1?parseInt(Le[1+vr]):0,ii=mr>-1?parseInt(nt[1+mr]):0;Yr!==ii&&(xt=xt.replace(Ge(),"?px "),Ce*=Math.pow(.75,ii-Yr),xt=xt.replace("?px ",Ge())),fe-=.25*re*(ii-Yr)}if(q.bolds===!0){var Lr=Le.indexOf(x)>-1,ci=nt.indexOf(x)>-1;!Lr&&ci&&(vi?xt=xt.replace("italic ","italic bold "):xt="bold "+xt),Lr&&!ci&&(xt=xt.replace("bold ",""))}if(q.italics===!0){var vi=Le.indexOf(A)>-1,Ot=nt.indexOf(A)>-1;!vi&&Ot&&(xt="italic "+xt),vi&&!Ot&&(xt=xt.replace("italic ",""))}V.font=xt}for(oe=0;oe0&&(H=F.size),F.lineSpacing&&F.lineSpacing>0&&(q=F.lineSpacing),F.styletags&&F.styletags.breaklines&&(G.breaklines=!!F.styletags.breaklines),F.styletags&&F.styletags.bolds&&(G.bolds=!!F.styletags.bolds),F.styletags&&F.styletags.italics&&(G.italics=!!F.styletags.italics),F.styletags&&F.styletags.subscripts&&(G.subscripts=!!F.styletags.subscripts),F.styletags&&F.styletags.superscripts&&(G.superscripts=!!F.styletags.superscripts)),W.font=[F.fontStyle,F.fontVariant,F.fontWeight,H+"px",F.font].filter(function(he){return he}).join(" "),W.textAlign="start",W.textBaseline="alphabetic",W.direction="ltr";var ee=g(V,W,U,H,q,G);return N(ee,F,H)}},7721:function(i,n,a){var l=a(5716);i.exports=o;function o(u){return l(u[0])*l(u[1])}},7765:function(i,n,a){i.exports=f;var l=a(9618),o=a(1888),u=a(446),s=a(1570);function h(k){for(var w=k.length,D=0,E=0;E"u"&&(E=h(k));var I=k.length;if(I===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var M=m(w,+D),p=b(k,E),g=x(p,w,M,+D),C=_(p,w.length|0),T=s(E)(k,p.data,C,M),N=A(p),B=[].slice.call(g.data,0,g.shape[0]);return o.free(M),o.free(p.data),o.free(g.data),o.free(C),{cells:T,vertexIds:N,vertexWeights:B}}},7766:function(i,n,a){var l=a(9618),o=a(5298),u=a(1888);i.exports=g;var s=null,h=null,m=null;function b(C){s=[C.LINEAR,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_NEAREST],h=[C.NEAREST,C.LINEAR,C.NEAREST_MIPMAP_NEAREST,C.NEAREST_MIPMAP_LINEAR,C.LINEAR_MIPMAP_NEAREST,C.LINEAR_MIPMAP_LINEAR],m=[C.REPEAT,C.CLAMP_TO_EDGE,C.MIRRORED_REPEAT]}function x(C){return typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&C instanceof HTMLVideoElement||typeof ImageData<"u"&&C instanceof ImageData}var _=function(C,T){o.muls(C,T,255)};function A(C,T,N){var B=C.gl,U=B.getParameter(B.MAX_TEXTURE_SIZE);if(T<0||T>U||N<0||N>U)throw new Error("gl-texture2d: Invalid texture size");return C._shape=[T,N],C.bind(),B.texImage2D(B.TEXTURE_2D,0,C.format,T,N,0,C.format,C.type,null),C._mipLevels=[0],C}function f(C,T,N,B,U,V){this.gl=C,this.handle=T,this.format=U,this.type=V,this._shape=[N,B],this._mipLevels=[0],this._magFilter=C.NEAREST,this._minFilter=C.NEAREST,this._wrapS=C.CLAMP_TO_EDGE,this._wrapT=C.CLAMP_TO_EDGE,this._anisoSamples=1;var W=this,F=[this._wrapS,this._wrapT];Object.defineProperties(F,[{get:function(){return W._wrapS},set:function(q){return W.wrapS=q}},{get:function(){return W._wrapT},set:function(q){return W.wrapT=q}}]),this._wrapVector=F;var H=[this._shape[0],this._shape[1]];Object.defineProperties(H,[{get:function(){return W._shape[0]},set:function(q){return W.width=q}},{get:function(){return W._shape[1]},set:function(q){return W.height=q}}]),this._shapeVector=H}var k=f.prototype;Object.defineProperties(k,{minFilter:{get:function(){return this._minFilter},set:function(C){this.bind();var T=this.gl;if(this.type===T.FLOAT&&s.indexOf(C)>=0&&(T.getExtension("OES_texture_float_linear")||(C=T.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MIN_FILTER,C),this._minFilter=C}},magFilter:{get:function(){return this._magFilter},set:function(C){this.bind();var T=this.gl;if(this.type===T.FLOAT&&s.indexOf(C)>=0&&(T.getExtension("OES_texture_float_linear")||(C=T.NEAREST)),h.indexOf(C)<0)throw new Error("gl-texture2d: Unknown filter mode "+C);return T.texParameteri(T.TEXTURE_2D,T.TEXTURE_MAG_FILTER,C),this._magFilter=C}},mipSamples:{get:function(){return this._anisoSamples},set:function(C){var T=this._anisoSamples;if(this._anisoSamples=Math.max(C,1)|0,T!==this._anisoSamples){var N=this.gl.getExtension("EXT_texture_filter_anisotropic");N&&this.gl.texParameterf(this.gl.TEXTURE_2D,N.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,C),this._wrapS=C}},wrapT:{get:function(){return this._wrapT},set:function(C){if(this.bind(),m.indexOf(C)<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,C),this._wrapT=C}},wrap:{get:function(){return this._wrapVector},set:function(C){if(Array.isArray(C)||(C=[C,C]),C.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var T=0;T<2;++T)if(m.indexOf(C[T])<0)throw new Error("gl-texture2d: Unknown wrap mode "+C);this._wrapS=C[0],this._wrapT=C[1];var N=this.gl;return this.bind(),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,this._wrapS),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,this._wrapT),C}},shape:{get:function(){return this._shapeVector},set:function(C){if(!Array.isArray(C))C=[C|0,C|0];else if(C.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return A(this,C[0]|0,C[1]|0),[C[0]|0,C[1]|0]}},width:{get:function(){return this._shape[0]},set:function(C){return C=C|0,A(this,C,this._shape[1]),C}},height:{get:function(){return this._shape[1]},set:function(C){return C=C|0,A(this,this._shape[0],C),C}}}),k.bind=function(C){var T=this.gl;return C!==void 0&&T.activeTexture(T.TEXTURE0+(C|0)),T.bindTexture(T.TEXTURE_2D,this.handle),C!==void 0?C|0:T.getParameter(T.ACTIVE_TEXTURE)-T.TEXTURE0},k.dispose=function(){this.gl.deleteTexture(this.handle)},k.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var C=Math.min(this._shape[0],this._shape[1]),T=0;C>0;++T,C>>>=1)this._mipLevels.indexOf(T)<0&&this._mipLevels.push(T)},k.setPixels=function(C,T,N,B){var U=this.gl;this.bind(),Array.isArray(T)?(B=N,N=T[1]|0,T=T[0]|0):(T=T||0,N=N||0),B=B||0;var V=x(C)?C:C.raw;if(V){var W=this._mipLevels.indexOf(B)<0;W?(U.texImage2D(U.TEXTURE_2D,0,this.format,this.format,this.type,V),this._mipLevels.push(B)):U.texSubImage2D(U.TEXTURE_2D,B,T,N,this.format,this.type,V)}else if(C.shape&&C.stride&&C.data){if(C.shape.length<2||T+C.shape[1]>this._shape[1]>>>B||N+C.shape[0]>this._shape[0]>>>B||T<0||N<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");D(U,T,N,B,this.format,this.type,this._mipLevels,C)}else throw new Error("gl-texture2d: Unsupported data type")};function w(C,T){return C.length===3?T[2]===1&&T[1]===C[0]*C[2]&&T[0]===C[2]:T[0]===1&&T[1]===C[0]}function D(C,T,N,B,U,V,W,F){var H=F.dtype,q=F.shape.slice();if(q.length<2||q.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var G=0,ee=0,he=w(q,F.stride.slice());if(H==="float32"?G=C.FLOAT:H==="float64"?(G=C.FLOAT,he=!1,H="float32"):H==="uint8"?G=C.UNSIGNED_BYTE:(G=C.UNSIGNED_BYTE,he=!1,H="uint8"),q.length===2)ee=C.LUMINANCE,q=[q[0],q[1],1],F=l(F.data,q,[F.stride[0],F.stride[1],1],F.offset);else if(q.length===3){if(q[2]===1)ee=C.ALPHA;else if(q[2]===2)ee=C.LUMINANCE_ALPHA;else if(q[2]===3)ee=C.RGB;else if(q[2]===4)ee=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");q[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((ee===C.LUMINANCE||ee===C.ALPHA)&&(U===C.LUMINANCE||U===C.ALPHA)&&(ee=U),ee!==U)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var be=F.size,ve=W.indexOf(B)<0;if(ve&&W.push(B),G===V&&he)F.offset===0&&F.data.length===be?ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,F.data):ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,F.data.subarray(F.offset,F.offset+be)):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,F.data.subarray(F.offset,F.offset+be));else{var ce;V===C.FLOAT?ce=u.mallocFloat32(be):ce=u.mallocUint8(be);var re=l(ce,q,[q[2],q[2]*q[0],1]);G===C.FLOAT&&V===C.UNSIGNED_BYTE?_(re,F):o.assign(re,F),ve?C.texImage2D(C.TEXTURE_2D,B,U,q[0],q[1],0,U,V,ce.subarray(0,be)):C.texSubImage2D(C.TEXTURE_2D,B,T,N,q[0],q[1],U,V,ce.subarray(0,be)),V===C.FLOAT?u.freeFloat32(ce):u.freeUint8(ce)}}function E(C){var T=C.createTexture();return C.bindTexture(C.TEXTURE_2D,T),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MIN_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_MAG_FILTER,C.NEAREST),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),T}function I(C,T,N,B,U){var V=C.getParameter(C.MAX_TEXTURE_SIZE);if(T<0||T>V||N<0||N>V)throw new Error("gl-texture2d: Invalid texture shape");if(U===C.FLOAT&&!C.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,B,T,N,0,B,U,null),new f(C,W,T,N,B,U)}function M(C,T,N,B,U,V){var W=E(C);return C.texImage2D(C.TEXTURE_2D,0,U,U,V,T),new f(C,W,N,B,U,V)}function p(C,T){var N=T.dtype,B=T.shape.slice(),U=C.getParameter(C.MAX_TEXTURE_SIZE);if(B[0]<0||B[0]>U||B[1]<0||B[1]>U)throw new Error("gl-texture2d: Invalid texture size");var V=w(B,T.stride.slice()),W=0;N==="float32"?W=C.FLOAT:N==="float64"?(W=C.FLOAT,V=!1,N="float32"):N==="uint8"?W=C.UNSIGNED_BYTE:(W=C.UNSIGNED_BYTE,V=!1,N="uint8");var F=0;if(B.length===2)F=C.LUMINANCE,B=[B[0],B[1],1],T=l(T.data,B,[T.stride[0],T.stride[1],1],T.offset);else if(B.length===3)if(B[2]===1)F=C.ALPHA;else if(B[2]===2)F=C.LUMINANCE_ALPHA;else if(B[2]===3)F=C.RGB;else if(B[2]===4)F=C.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");W===C.FLOAT&&!C.getExtension("OES_texture_float")&&(W=C.UNSIGNED_BYTE,V=!1);var H,q,G=T.size;if(V)T.offset===0&&T.data.length===G?H=T.data:H=T.data.subarray(T.offset,T.offset+G);else{var ee=[B[2],B[2]*B[0],1];q=u.malloc(G,N);var he=l(q,B,ee,0);(N==="float32"||N==="float64")&&W===C.UNSIGNED_BYTE?_(he,T):o.assign(he,T),H=q.subarray(0,G)}var be=E(C);return C.texImage2D(C.TEXTURE_2D,0,F,B[0],B[1],0,F,W,H),V||u.free(q),new f(C,be,B[0],B[1],F,W)}function g(C){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(s||b(C),typeof arguments[1]=="number")return I(C,arguments[1],arguments[2],arguments[3]||C.RGBA,arguments[4]||C.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return I(C,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var T=arguments[1],N=x(T)?T:T.raw;if(N)return M(C,N,T.width|0,T.height|0,arguments[2]||C.RGBA,arguments[3]||C.UNSIGNED_BYTE);if(T.shape&&T.data&&T.stride)return p(C,T)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},7790:function(){},7815:function(i,n,a){var l=a(2931),o=a(9970),u=["xyz","xzy","yxz","yzx","zxy","zyx"],s=function(w,D,E,I){for(var M=w.points,p=w.velocities,g=w.divergences,C=[],T=[],N=[],B=[],U=[],V=[],W=0,F=0,H=o.create(),q=o.create(),G=8,ee=0;ee0)for(var ce=0;ceD)return I-1}return I},b=function(w,D,E){return wE?E:w},x=function(w,D,E){var I=D.vectors,M=D.meshgrid,p=w[0],g=w[1],C=w[2],T=M[0].length,N=M[1].length,B=M[2].length,U=m(M[0],p),V=m(M[1],g),W=m(M[2],C),F=U+1,H=V+1,q=W+1;if(U=b(U,0,T-1),F=b(F,0,T-1),V=b(V,0,N-1),H=b(H,0,N-1),W=b(W,0,B-1),q=b(q,0,B-1),U<0||V<0||W<0||F>T-1||H>N-1||q>B-1)return l.create();var G=M[0][U],ee=M[0][F],he=M[1][V],be=M[1][H],ve=M[2][W],ce=M[2][q],re=(p-G)/(ee-G),ge=(g-he)/(be-he),ne=(C-ve)/(ce-ve);isFinite(re)||(re=.5),isFinite(ge)||(ge=.5),isFinite(ne)||(ne=.5);var se,_e,oe,J,me,fe;switch(E.reversedX&&(U=T-1-U,F=T-1-F),E.reversedY&&(V=N-1-V,H=N-1-H),E.reversedZ&&(W=B-1-W,q=B-1-q),E.filled){case 5:me=W,fe=q,oe=V*B,J=H*B,se=U*B*N,_e=F*B*N;break;case 4:me=W,fe=q,se=U*B,_e=F*B,oe=V*B*T,J=H*B*T;break;case 3:oe=V,J=H,me=W*N,fe=q*N,se=U*N*B,_e=F*N*B;break;case 2:oe=V,J=H,se=U*N,_e=F*N,me=W*N*T,fe=q*N*T;break;case 1:se=U,_e=F,me=W*T,fe=q*T,oe=V*T*B,J=H*T*B;break;default:se=U,_e=F,oe=V*T,J=H*T,me=W*T*N,fe=q*T*N;break}var Ce=I[se+oe+me],Re=I[se+oe+fe],Be=I[se+J+me],Ze=I[se+J+fe],Ge=I[_e+oe+me],tt=I[_e+oe+fe],_t=I[_e+J+me],mt=I[_e+J+fe],vt=l.create(),ct=l.create(),Ae=l.create(),Oe=l.create();l.lerp(vt,Ce,Ge,re),l.lerp(ct,Re,tt,re),l.lerp(Ae,Be,_t,re),l.lerp(Oe,Ze,mt,re);var Le=l.create(),nt=l.create();l.lerp(Le,vt,Ae,ge),l.lerp(nt,ct,Oe,ge);var xt=l.create();return l.lerp(xt,Le,nt,ne),xt},_=function(w){var D=1/0;w.sort(function(p,g){return p-g});for(var E=w.length,I=1;IF||mtH||vtq)},ee=l.distance(D[0],D[1]),he=10*ee/I,be=he*he,ve=1,ce=0,re=E.length;re>1&&(ve=A(E));for(var ge=0;gece&&(ce=Ce),me.push(Ce),B.push({points:se,velocities:_e,divergences:me});for(var Re=0;Rebe&&l.scale(Be,Be,he/Math.sqrt(Ze)),l.add(Be,Be,ne),oe=T(Be),l.squaredDistance(J,Be)-be>-1e-4*be){se.push(Be),J=Be,_e.push(oe);var fe=N(Be,oe),Ce=l.length(fe);isFinite(Ce)&&Ce>ce&&(ce=Ce),me.push(Ce)}ne=Be}}var Ge=h(B,w.colormap,ce,ve);return p?Ge.tubeScale=p:(ce===0&&(ce=1),Ge.tubeScale=M*.5*ve/ce),Ge};var f=a(6740),k=a(6405).createMesh;i.exports.createTubeMesh=function(w,D){return k(w,D,{shaders:f,traceType:"streamtube"})}},7827:function(i){i.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},7842:function(i,n,a){var l=a(6330),o=a(1533),u=a(2651),s=a(6768),h=a(869),m=a(8697);i.exports=b;function b(x,_){if(l(x))return _?m(x,b(_)):[x[0].clone(),x[1].clone()];var A=0,f,k;if(o(x))f=x.clone();else if(typeof x=="string")f=s(x);else{if(x===0)return[u(0),u(1)];if(x===Math.floor(x))f=u(x);else{for(;x!==Math.floor(x);)x=x*Math.pow(2,256),A-=256;f=u(x)}}if(l(_))f.mul(_[1]),k=_[0].clone();else if(o(_))k=_.clone();else if(typeof _=="string")k=s(_);else if(!_)k=u(1);else if(_===Math.floor(_))k=u(_);else{for(;_!==Math.floor(_);)_=_*Math.pow(2,256),A+=256;k=u(_)}return A>0?f=f.ushln(A):A<0&&(k=k.ushln(-A)),h(f,k)}},7894:function(i){i.exports=n;function n(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a}},7932:function(i,n,a){var l=a(620);i.exports=l.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},7960:function(i){i.exports=n;function n(a,l){var o=l[0]-a[0],u=l[1]-a[1],s=l[2]-a[2],h=l[3]-a[3];return o*o+u*u+s*s+h*h}},8105:function(i){i.exports=a;var n={"lo===p0":l,"lo=p0)&&!(p1>=hi)":b};function a(x){return n[x]}function l(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g];if(N===D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function o(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g];if(NB;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function u(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+C];if(N<=D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function s(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+C];if(N<=D)if(p===T)p+=1,M+=E;else{for(var B=0;E>B;++B){var U=k[I+B];k[I+B]=k[M],k[M++]=U}var V=w[T];w[T]=w[p],w[p++]=V}}return p}function h(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g],B=k[I+C];if(N<=D&&D<=B)if(p===T)p+=1,M+=E;else{for(var U=0;E>U;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[T];w[T]=w[p],w[p++]=W}}return p}function m(x,_,A,f,k,w,D){for(var E=2*x,I=E*A,M=I,p=A,g=_,C=x+_,T=A;f>T;++T,I+=E){var N=k[I+g],B=k[I+C];if(NU;++U){var V=k[I+U];k[I+U]=k[M],k[M++]=V}var W=w[T];w[T]=w[p],w[p++]=W}}return p}function b(x,_,A,f,k,w,D,E){for(var I=2*x,M=I*A,p=M,g=A,C=_,T=x+_,N=A;f>N;++N,M+=I){var B=k[M+C],U=k[M+T];if(!(B>=D)&&!(E>=U))if(g===N)g+=1,p+=I;else{for(var V=0;I>V;++V){var W=k[M+V];k[M+V]=k[p],k[p++]=W}var F=w[N];w[N]=w[g],w[g++]=F}}return g}},8107:function(i){i.exports=n;function n(a,l,o){return a[0]=Math.min(l[0],o[0]),a[1]=Math.min(l[1],o[1]),a[2]=Math.min(l[2],o[2]),a}},8116:function(i,n,a){var l=a(7518),o=a(870);function u(h){this.bindVertexArrayOES=h.bindVertexArray.bind(h),this.createVertexArrayOES=h.createVertexArray.bind(h),this.deleteVertexArrayOES=h.deleteVertexArray.bind(h)}function s(h,m,b,x){var _=h.createVertexArray?new u(h):h.getExtension("OES_vertex_array_object"),A;return _?A=l(h,_):A=o(h),A.update(m,b,x),A}i.exports=s},8192:function(i,n,a){i.exports=s;var l=a(2825),o=a(3536),u=a(244);function s(h,m){var b=l(h[0],h[1],h[2]),x=l(m[0],m[1],m[2]);o(b,b),o(x,x);var _=u(b,x);return _>1?0:Math.acos(_)}},8210:function(i){i.exports=a;function n(l,o){var u=l+o,s=u-l,h=u-s,m=o-s,b=l-h,x=b+m;return x?[x,u]:[u]}function a(l,o){var u=l.length|0,s=o.length|0;if(u===1&&s===1)return n(l[0],o[0]);var h=u+s,m=new Array(h),b=0,x=0,_=0,A=Math.abs,f=l[x],k=A(f),w=o[_],D=A(w),E,I;k=s?(E=f,x+=1,xb)for(var N=m[f],B=1/Math.sqrt(p*C),T=0;T<3;++T){var U=(T+1)%3,V=(T+2)%3;N[T]+=B*(g[U]*M[V]-g[V]*M[U])}}for(var x=0;xb)for(var B=1/Math.sqrt(W),T=0;T<3;++T)N[T]*=B;else for(var T=0;T<3;++T)N[T]=0}return m},n.faceNormals=function(o,u,s){for(var h=o.length,m=new Array(h),b=s===void 0?l:s,x=0;xb?E=1/Math.sqrt(E):E=0;for(var f=0;f<3;++f)D[f]*=E;m[x]=D}return m}},8418:function(i,n,a){var l=a(5219),o=a(2762),u=a(8116),s=a(1888),h=a(6760),m=a(1283),b=a(9366),x=a(5964),_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],A=ArrayBuffer,f=DataView;function k(se){return A.isView(se)&&!(se instanceof f)}function w(se){return Array.isArray(se)||k(se)}i.exports=ne;function D(se,_e){var oe=se[0],J=se[1],me=se[2],fe=se[3];return se[0]=_e[0]*oe+_e[4]*J+_e[8]*me+_e[12]*fe,se[1]=_e[1]*oe+_e[5]*J+_e[9]*me+_e[13]*fe,se[2]=_e[2]*oe+_e[6]*J+_e[10]*me+_e[14]*fe,se[3]=_e[3]*oe+_e[7]*J+_e[11]*me+_e[15]*fe,se}function E(se,_e,oe,J){return D(J,J),D(J,J),D(J,J)}function I(se,_e){this.index=se,this.dataCoordinate=this.position=_e}function M(se){return se===!0||se>1?1:se}function p(se,_e,oe,J,me,fe,Ce,Re,Be,Ze,Ge,tt){this.gl=se,this.pixelRatio=1,this.shader=_e,this.orthoShader=oe,this.projectShader=J,this.pointBuffer=me,this.colorBuffer=fe,this.glyphBuffer=Ce,this.idBuffer=Re,this.vao=Be,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ze,this.pickOrthoShader=Ge,this.pickProjectShader=tt,this.points=[],this._selectResult=new I(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var g=p.prototype;g.pickSlots=1,g.setPickBase=function(se){this.pickId=se},g.isTransparent=function(){if(this.hasAlpha)return!0;for(var se=0;se<3;++se)if(this.axesProject[se]&&this.projectHasAlpha)return!0;return!1},g.isOpaque=function(){if(!this.hasAlpha)return!0;for(var se=0;se<3;++se)if(this.axesProject[se]&&!this.projectHasAlpha)return!0;return!1};var C=[0,0],T=[0,0,0],N=[0,0,0],B=[0,0,0,1],U=[0,0,0,1],V=_.slice(),W=[0,0,0],F=[[0,0,0],[0,0,0]];function H(se){return se[0]=se[1]=se[2]=0,se}function q(se,_e){return se[0]=_e[0],se[1]=_e[1],se[2]=_e[2],se[3]=1,se}function G(se,_e,oe,J){return se[0]=_e[0],se[1]=_e[1],se[2]=_e[2],se[oe]=J,se}function ee(se){for(var _e=F,oe=0;oe<2;++oe)for(var J=0;J<3;++J)_e[oe][J]=Math.max(Math.min(se[oe][J],1e8),-1e8);return _e}function he(se,_e,oe,J){var me=_e.axesProject,fe=_e.gl,Ce=se.uniforms,Re=oe.model||_,Be=oe.view||_,Ze=oe.projection||_,Ge=_e.axesBounds,tt=ee(_e.clipBounds),_t;_e.axes&&_e.axes.lastCubeProps?_t=_e.axes.lastCubeProps.axis:_t=[1,1,1],C[0]=2/fe.drawingBufferWidth,C[1]=2/fe.drawingBufferHeight,se.bind(),Ce.view=Be,Ce.projection=Ze,Ce.screenSize=C,Ce.highlightId=_e.highlightId,Ce.highlightScale=_e.highlightScale,Ce.clipBounds=tt,Ce.pickGroup=_e.pickId/255,Ce.pixelRatio=J;for(var mt=0;mt<3;++mt)if(me[mt]){Ce.scale=_e.projectScale[mt],Ce.opacity=_e.projectOpacity[mt];for(var vt=V,ct=0;ct<16;++ct)vt[ct]=0;for(var ct=0;ct<4;++ct)vt[5*ct]=1;vt[5*mt]=0,_t[mt]<0?vt[12+mt]=Ge[0][mt]:vt[12+mt]=Ge[1][mt],h(vt,Re,vt),Ce.model=vt;var Ae=(mt+1)%3,Oe=(mt+2)%3,Le=H(T),nt=H(N);Le[Ae]=1,nt[Oe]=1;var xt=E(Ze,Be,Re,q(B,Le)),ut=E(Ze,Be,Re,q(U,nt));if(Math.abs(xt[1])>Math.abs(ut[1])){var Et=xt;xt=ut,ut=Et,Et=Le,Le=nt,nt=Et;var Gt=Ae;Ae=Oe,Oe=Gt}xt[0]<0&&(Le[Ae]=-1),ut[1]>0&&(nt[Oe]=-1);for(var Qt=0,vr=0,ct=0;ct<4;++ct)Qt+=Math.pow(Re[4*Ae+ct],2),vr+=Math.pow(Re[4*Oe+ct],2);Le[Ae]/=Math.sqrt(Qt),nt[Oe]/=Math.sqrt(vr),Ce.axes[0]=Le,Ce.axes[1]=nt,Ce.fragClipBounds[0]=G(W,tt[0],mt,-1e8),Ce.fragClipBounds[1]=G(W,tt[1],mt,1e8),_e.vao.bind(),_e.vao.draw(fe.TRIANGLES,_e.vertexCount),_e.lineWidth>0&&(fe.lineWidth(_e.lineWidth*J),_e.vao.draw(fe.LINES,_e.lineVertexCount,_e.vertexCount)),_e.vao.unbind()}}var be=[-1e8,-1e8,-1e8],ve=[1e8,1e8,1e8],ce=[be,ve];function re(se,_e,oe,J,me,fe,Ce){var Re=oe.gl;if((fe===oe.projectHasAlpha||Ce)&&he(_e,oe,J,me),fe===oe.hasAlpha||Ce){se.bind();var Be=se.uniforms;Be.model=J.model||_,Be.view=J.view||_,Be.projection=J.projection||_,C[0]=2/Re.drawingBufferWidth,C[1]=2/Re.drawingBufferHeight,Be.screenSize=C,Be.highlightId=oe.highlightId,Be.highlightScale=oe.highlightScale,Be.fragClipBounds=ce,Be.clipBounds=oe.axes.bounds,Be.opacity=oe.opacity,Be.pickGroup=oe.pickId/255,Be.pixelRatio=me,oe.vao.bind(),oe.vao.draw(Re.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(Re.lineWidth(oe.lineWidth*me),oe.vao.draw(Re.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}g.draw=function(se){var _e=this.useOrtho?this.orthoShader:this.shader;re(_e,this.projectShader,this,se,this.pixelRatio,!1,!1)},g.drawTransparent=function(se){var _e=this.useOrtho?this.orthoShader:this.shader;re(_e,this.projectShader,this,se,this.pixelRatio,!0,!1)},g.drawPick=function(se){var _e=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;re(_e,this.pickProjectShader,this,se,1,!0,!0)},g.pick=function(se){if(!se||se.id!==this.pickId)return null;var _e=se.value[2]+(se.value[1]<<8)+(se.value[0]<<16);if(_e>=this.pointCount||_e<0)return null;var oe=this.points[_e],J=this._selectResult;J.index=_e;for(var me=0;me<3;++me)J.position[me]=J.dataCoordinate[me]=oe[me];return J},g.highlight=function(se){if(!se)this.highlightId=[1,1,1,1];else{var _e=se.index,oe=_e&255,J=_e>>8&255,me=_e>>16&255;this.highlightId=[oe/255,J/255,me/255,0]}};function ge(se,_e,oe,J){var me;w(se)?_e0){var vi=0,Ot=Oe,Xe=[0,0,0,1],ot=[0,0,0,1],De=w(_t)&&w(_t[0]),ye=w(ct)&&w(ct[0]);e:for(var J=0;J0?1-vr[0][0]:Yt<0?1+vr[1][0]:1,hr*=hr>0?1-vr[0][1]:hr<0?1+vr[1][1]:1;for(var zr=[Yt,hr],Dr=Gt.cells||[],br=Gt.positions||[],ut=0;ut=s?(E=f,x+=1,x0?1:0}},8648:function(i,n,a){i.exports=a(783)},8692:function(i){i.exports=n;function n(a,l,o,u){var s=o[0],h=o[1],m=l[0]-s,b=l[1]-h,x=Math.sin(u),_=Math.cos(u);return a[0]=s+m*_-b*x,a[1]=h+m*x+b*_,a[2]=l[2],a}},8697:function(i,n,a){var l=a(869);i.exports=o;function o(u,s){return l(u[0].mul(s[1]),u[1].mul(s[0]))}},8731:function(i,n,a){i.exports=b;var l=a(8866);function o(x,_,A,f,k,w){this._gl=x,this._wrapper=_,this._index=A,this._locations=f,this._dimension=k,this._constFunc=w}var u=o.prototype;u.pointer=function(x,_,A,f){var k=this,w=k._gl,D=k._locations[k._index];w.vertexAttribPointer(D,k._dimension,x||w.FLOAT,!!_,A||0,f||0),w.enableVertexAttribArray(D)},u.set=function(x,_,A,f){return this._constFunc(this._locations[this._index],x,_,A,f)},Object.defineProperty(u,"location",{get:function(){return this._locations[this._index]},set:function(x){return x!==this._locations[this._index]&&(this._locations[this._index]=x|0,this._wrapper.program=null),x|0}});var s=[function(x,_,A){return A.length===void 0?x.vertexAttrib1f(_,A):x.vertexAttrib1fv(_,A)},function(x,_,A,f){return A.length===void 0?x.vertexAttrib2f(_,A,f):x.vertexAttrib2fv(_,A)},function(x,_,A,f,k){return A.length===void 0?x.vertexAttrib3f(_,A,f,k):x.vertexAttrib3fv(_,A)},function(x,_,A,f,k,w){return A.length===void 0?x.vertexAttrib4f(_,A,f,k,w):x.vertexAttrib4fv(_,A)}];function h(x,_,A,f,k,w,D){var E=s[k],I=new o(x,_,A,f,k,E);Object.defineProperty(w,D,{set:function(M){return x.disableVertexAttribArray(f[A]),E(x,f[A],M),M},get:function(){return I},enumerable:!0})}function m(x,_,A,f,k,w,D){for(var E=new Array(k),I=new Array(k),M=0;M=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);h(x,_,p[0],f,g,k,I)}else if(M.indexOf("mat")>=0){var g=M.charCodeAt(M.length-1)-48;if(g<2||g>4)throw new l("","Invalid data type for attribute "+I+": "+M);m(x,_,p,f,g,k,I)}else throw new l("","Unknown data type for attribute "+I+": "+M);break}}return k}},8828:function(i,n){"use restrict";var a=32;n.INT_BITS=a,n.INT_MAX=2147483647,n.INT_MIN=-1<0)-(u<0)},n.abs=function(u){var s=u>>a-1;return(u^s)-s},n.min=function(u,s){return s^(u^s)&-(u65535)<<4,u>>>=s,h=(u>255)<<3,u>>>=h,s|=h,h=(u>15)<<2,u>>>=h,s|=h,h=(u>3)<<1,u>>>=h,s|=h,s|u>>1},n.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},n.popCount=function(u){return u=u-(u>>>1&1431655765),u=(u&858993459)+(u>>>2&858993459),(u+(u>>>4)&252645135)*16843009>>>24};function l(u){var s=32;return u&=-u,u&&s--,u&65535&&(s-=16),u&16711935&&(s-=8),u&252645135&&(s-=4),u&858993459&&(s-=2),u&1431655765&&(s-=1),s}n.countTrailingZeros=l,n.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u+1},n.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u-(u>>>1)},n.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,u&=15,27030>>>u&1};var o=new Array(256);(function(u){for(var s=0;s<256;++s){var h=s,m=s,b=7;for(h>>>=1;h;h>>>=1)m<<=1,m|=h&1,--b;u[s]=m<>>8&255]<<16|o[u>>>16&255]<<8|o[u>>>24&255]},n.interleave2=function(u,s){return u&=65535,u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,s&=65535,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,u|s<<1},n.deinterleave2=function(u,s){return u=u>>>s&1431655765,u=(u|u>>>1)&858993459,u=(u|u>>>2)&252645135,u=(u|u>>>4)&16711935,u=(u|u>>>16)&65535,u<<16>>16},n.interleave3=function(u,s,h){return u&=1023,u=(u|u<<16)&4278190335,u=(u|u<<8)&251719695,u=(u|u<<4)&3272356035,u=(u|u<<2)&1227133513,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,u|=s<<1,h&=1023,h=(h|h<<16)&4278190335,h=(h|h<<8)&251719695,h=(h|h<<4)&3272356035,h=(h|h<<2)&1227133513,u|h<<2},n.deinterleave3=function(u,s){return u=u>>>s&1227133513,u=(u|u>>>2)&3272356035,u=(u|u>>>4)&251719695,u=(u|u>>>8)&4278190335,u=(u|u>>>16)&1023,u<<22>>22},n.nextCombination=function(u){var s=u|u-1;return s+1|(~s&-~s)-1>>>l(u)+1}},8866:function(i){function n(a,l,o){this.shortMessage=l||"",this.longMessage=o||"",this.rawError=a||"",this.message="gl-shader: "+(l||a||"")+(o?` +`+o:""),this.stack=new Error().stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,i.exports=n},8902:function(i,n,a){var l=a(2478),o=a(3250)[3],u=0,s=1,h=2;i.exports=D;function m(E,I,M,p,g){this.a=E,this.b=I,this.idx=M,this.lowerIds=p,this.upperIds=g}function b(E,I,M,p){this.a=E,this.b=I,this.type=M,this.idx=p}function x(E,I){var M=E.a[0]-I.a[0]||E.a[1]-I.a[1]||E.type-I.type;return M||E.type!==u&&(M=o(E.a,E.b,I.b),M)?M:E.idx-I.idx}function _(E,I){return o(E.a,E.b,I)}function A(E,I,M,p,g){for(var C=l.lt(I,p,_),T=l.gt(I,p,_),N=C;N1&&o(M[U[V-2]],M[U[V-1]],p)>0;)E.push([U[V-1],U[V-2],g]),V-=1;U.length=V,U.push(g);for(var W=B.upperIds,V=W.length;V>1&&o(M[W[V-2]],M[W[V-1]],p)<0;)E.push([W[V-2],W[V-1],g]),V-=1;W.length=V,W.push(g)}}function f(E,I){var M;return E.a[0]B[0]&&g.push(new b(B,N,h,C),new b(N,B,s,C))}g.sort(x);for(var U=g[0].a[0]-(1+Math.abs(g[0].a[0]))*Math.pow(2,-52),V=[new m([U,1],[U,0],-1,[],[])],W=[],C=0,F=g.length;C0;){k=p.pop();for(var g=k.adjacent,C=0;C<=D;++C){var T=g[C];if(!(!T.boundary||T.lastVisited<=-E)){for(var N=T.vertices,B=0;B<=D;++B){var U=N[B];U<0?I[B]=w:I[B]=M[U]}var V=this.orient();if(V>0)return T;T.lastVisited=-E,V===0&&p.push(T)}}}return null},A.walk=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=w?this.interior.length*Math.random()|0:this.interior.length-1,g=this.interior[p];e:for(;!g.boundary;){for(var C=g.vertices,T=g.adjacent,N=0;N<=E;++N)M[N]=I[C[N]];g.lastVisited=D;for(var N=0;N<=E;++N){var B=T[N];if(!(B.lastVisited>=D)){var U=M[N];M[N]=k;var V=this.orient();if(M[N]=U,V<0){g=B;continue e}else B.boundary?B.lastVisited=-D:B.lastVisited=D}}return}return g},A.addPeaks=function(k,w){var D=this.vertices.length-1,E=this.dimension,I=this.vertices,M=this.tuple,p=this.interior,g=this.simplices,C=[w];w.lastVisited=D,w.vertices[w.vertices.indexOf(-1)]=D,w.boundary=!1,p.push(w);for(var T=[];C.length>0;){var w=C.pop(),N=w.vertices,B=w.adjacent,U=N.indexOf(D);if(!(U<0)){for(var V=0;V<=E;++V)if(V!==U){var W=B[V];if(!(!W.boundary||W.lastVisited>=D)){var F=W.vertices;if(W.lastVisited!==-D){for(var H=0,q=0;q<=E;++q)F[q]<0?(H=q,M[q]=k):M[q]=I[F[q]];var G=this.orient();if(G>0){F[H]=D,W.boundary=!1,p.push(W),C.push(W),W.lastVisited=D;continue}else W.lastVisited=-D}var ee=W.adjacent,he=N.slice(),be=B.slice(),ve=new u(he,be,!0);g.push(ve);var ce=ee.indexOf(w);if(!(ce<0)){ee[ce]=ve,be[U]=W,he[V]=-1,be[V]=w,B[V]=ve,ve.flip();for(var q=0;q<=E;++q){var re=he[q];if(!(re<0||re===D)){for(var ge=new Array(E-1),ne=0,se=0;se<=E;++se){var _e=he[se];_e<0||se===q||(ge[ne++]=_e)}T.push(new s(ge,ve,q))}}}}}}}T.sort(h);for(var V=0;V+1=0?p[C++]=g[N]:T=N&1;if(T===(k&1)){var B=p[0];p[0]=p[1],p[1]=B}w.push(p)}}return w};function f(k,w){var D=k.length;if(D===0)throw new Error("Must have at least d+1 points");var E=k[0].length;if(D<=E)throw new Error("Must input at least d+1 points");var I=k.slice(0,E+1),M=l.apply(void 0,I);if(M===0)throw new Error("Input not in general position");for(var p=new Array(E+1),g=0;g<=E;++g)p[g]=g;M<0&&(p[0]=1,p[1]=0);for(var C=new u(p,new Array(E+1),!1),T=C.adjacent,N=new Array(E+2),g=0;g<=E;++g){for(var B=p.slice(),U=0;U<=E;++U)U===g&&(B[U]=-1);var V=B[0];B[0]=B[1],B[1]=V;var W=new u(B,new Array(E+1),!0);T[g]=W,N[g]=W}N[E+1]=C;for(var g=0;g<=E;++g)for(var B=T[g].vertices,F=T[g].adjacent,U=0;U<=E;++U){var H=B[U];if(H<0){F[U]=C;continue}for(var q=0;q<=E;++q)T[q].vertices.indexOf(H)<0&&(F[U]=T[q])}for(var G=new _(E,I,N),ee=!!w,g=E+1;g=1},f.isTransparent=function(){return this.opacity<1},f.pickSlots=1,f.setPickBase=function(M){this.pickId=M};function k(M){for(var p=x({colormap:M,nshades:256,format:"rgba"}),g=new Uint8Array(1024),C=0;C<256;++C){for(var T=p[C],N=0;N<3;++N)g[4*C+N]=T[N];g[4*C+3]=T[3]*255}return b(g,[256,256,4],[4,0,1])}function w(M){for(var p=M.length,g=new Array(p),C=0;C0){var q=this.triShader;q.bind(),q.uniforms=U,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},f.drawPick=function(M){M=M||{};for(var p=this.gl,g=M.model||_,C=M.view||_,T=M.projection||_,N=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],B=0;B<3;++B)N[0][B]=Math.max(N[0][B],this.clipBounds[0][B]),N[1][B]=Math.min(N[1][B],this.clipBounds[1][B]);this._model=[].slice.call(g),this._view=[].slice.call(C),this._projection=[].slice.call(T),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var U={model:g,view:C,projection:T,clipBounds:N,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},V=this.pickShader;V.bind(),V.uniforms=U,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},f.pick=function(M){if(!M||M.id!==this.pickId)return null;var p=M.value[0]+256*M.value[1]+65536*M.value[2],g=this.cells[p],C=this.positions[g[1]].slice(0,3),T={position:C,dataCoordinate:C,index:Math.floor(g[1]/48)};return this.traceType==="cone"?T.index=Math.floor(g[1]/48):this.traceType==="streamtube"&&(T.intensity=this.intensity[g[1]],T.velocity=this.vectors[g[1]].slice(0,3),T.divergence=this.vectors[g[1]][3],T.index=p),T},f.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function D(M,p){var g=l(M,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return g.attributes.position.location=0,g.attributes.color.location=2,g.attributes.uv.location=3,g.attributes.vector.location=4,g}function E(M,p){var g=l(M,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return g.attributes.position.location=0,g.attributes.id.location=1,g.attributes.vector.location=4,g}function I(M,p,g){var C=g.shaders;arguments.length===1&&(p=M,M=p.gl);var T=D(M,C),N=E(M,C),B=s(M,b(new Uint8Array([255,255,255,255]),[1,1,4]));B.generateMipmap(),B.minFilter=M.LINEAR_MIPMAP_LINEAR,B.magFilter=M.LINEAR;var U=o(M),V=o(M),W=o(M),F=o(M),H=o(M),q=u(M,[{buffer:U,type:M.FLOAT,size:4},{buffer:H,type:M.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:W,type:M.FLOAT,size:4},{buffer:F,type:M.FLOAT,size:2},{buffer:V,type:M.FLOAT,size:4}]),G=new A(M,B,T,N,U,V,H,W,F,q,g.traceType||"cone");return G.update(p),G}i.exports=I},9127:function(i,n,a){i.exports=u;var l=a(6204),o=a(5771);function u(s){return o(l(s))}},9131:function(i,n,a){var l=a(5177),o=a(9288);i.exports=u;function u(s,h){return h=h||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,h),s}},9165:function(i,n,a){i.exports=A;var l=a(2762),o=a(8116),u=a(3436),s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(f,k,w,D){this.gl=f,this.shader=D,this.buffer=k,this.vao=w,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var m=h.prototype;m.isOpaque=function(){return!this.hasAlpha},m.isTransparent=function(){return this.hasAlpha},m.drawTransparent=m.draw=function(f){var k=this.gl,w=this.shader.uniforms;this.shader.bind();var D=w.view=f.view||s,E=w.projection=f.projection||s;w.model=f.model||s,w.clipBounds=this.clipBounds,w.opacity=this.opacity;var I=D[12],M=D[13],p=D[14],g=D[15],C=f._ortho||!1,T=C?2:1,N=T*this.pixelRatio*(E[3]*I+E[7]*M+E[11]*p+E[15]*g)/k.drawingBufferHeight;this.vao.bind();for(var B=0;B<3;++B)k.lineWidth(this.lineWidth[B]*this.pixelRatio),w.capSize=this.capSize[B]*N,this.lineCount[B]&&k.drawArrays(k.LINES,this.lineOffset[B],this.lineCount[B]);this.vao.unbind()};function b(f,k){for(var w=0;w<3;++w)f[0][w]=Math.min(f[0][w],k[w]),f[1][w]=Math.max(f[1][w],k[w])}var x=function(){for(var f=new Array(3),k=0;k<3;++k){for(var w=[],D=1;D<=2;++D)for(var E=-1;E<=1;E+=2){var I=(D+k)%3,M=[0,0,0];M[I]=E,w.push(M)}f[k]=w}return f}();function _(f,k,w,D){for(var E=x[D],I=0;I0){var U=C.slice();U[p]+=N[1][p],E.push(C[0],C[1],C[2],B[0],B[1],B[2],B[3],0,0,0,U[0],U[1],U[2],B[0],B[1],B[2],B[3],0,0,0),b(this.bounds,U),M+=2+_(E,U,B,p)}}}this.lineCount[p]=M-this.lineOffset[p]}this.buffer.update(E)}},m.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function A(f){var k=f.gl,w=l(k),D=o(k,[{buffer:w,type:k.FLOAT,size:3,offset:0,stride:40},{buffer:w,type:k.FLOAT,size:4,offset:12,stride:40},{buffer:w,type:k.FLOAT,size:3,offset:28,stride:40}]),E=u(k);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var I=new h(k,w,D,E);return I.update(f),I}},9215:function(i,n,a){i.exports=b;var l=a(4769),o=a(2478);function u(x,_,A){return Math.min(_,Math.max(x,A))}function s(x,_,A){this.dimension=x.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var f=0;f=A-1)for(var M=w.length-1,g=x-_[A-1],p=0;p=A-1)for(var I=w.length-1,M=x-_[A-1],p=0;p=0;--A)if(x[--_])return!1;return!0},h.jump=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=this.bounds,E=D[0],I=D[1];this._time.push(_,x);for(var M=0;M<2;++M)for(var p=0;p0;--p)f.push(u(E[p-1],I[p-1],arguments[p])),k.push(0)}},h.push=function(x){var _=this.lastT(),A=this.dimension;if(!(x<_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=x-_,E=this.bounds,I=E[0],M=E[1],p=D>1e-6?1/D:0;this._time.push(x);for(var g=A;g>0;--g){var C=u(I[g-1],M[g-1],arguments[g]);f.push(C),k.push((C-f[w++])*p)}}},h.set=function(x){var _=this.dimension;if(!(x0;--E)A.push(u(w[E-1],D[E-1],arguments[E])),f.push(0)}},h.move=function(x){var _=this.lastT(),A=this.dimension;if(!(x<=_||arguments.length!==A+1)){var f=this._state,k=this._velocity,w=f.length-this.dimension,D=this.bounds,E=D[0],I=D[1],M=x-_,p=M>1e-6?1/M:0;this._time.push(x);for(var g=A;g>0;--g){var C=arguments[g];f.push(u(E[g-1],I[g-1],f[w++]+C)),k.push(C*p)}}},h.idle=function(x){var _=this.lastT();if(!(x<_)){var A=this.dimension,f=this._state,k=this._velocity,w=f.length-A,D=this.bounds,E=D[0],I=D[1],M=x-_;this._time.push(x);for(var p=A-1;p>=0;--p)f.push(u(E[p],I[p],f[w]+M*k[w])),k.push(0),w+=1}};function m(x){for(var _=new Array(x),A=0;A1&&s.indexOf("Macintosh")!==-1&&s.indexOf("Safari")!==-1&&(h=!0),h}},9226:function(i){i.exports=n;function n(a,l){return a[0]=Math.ceil(l[0]),a[1]=Math.ceil(l[1]),a[2]=Math.ceil(l[2]),a}},9265:function(i){i.exports=n;function n(a,l){return a[0]===l[0]&&a[1]===l[1]&&a[2]===l[2]}},9288:function(i){i.exports=n;function n(a,l,o){return a[0]=l[0]*o,a[1]=l[1]*o,a[2]=l[2]*o,a[3]=l[3]*o,a}},9346:function(i){var n=new Float64Array(4),a=new Float64Array(4),l=new Float64Array(4);function o(u,s,h,m,b){n.length=_?(g=1,T=_+2*k+D):(g=-k/_,T=k*g+D)):(g=0,w>=0?(C=0,T=D):-w>=f?(C=1,T=f+2*w+D):(C=-w/f,T=w*C+D));else if(C<0)C=0,k>=0?(g=0,T=D):-k>=_?(g=1,T=_+2*k+D):(g=-k/_,T=k*g+D);else{var N=1/p;g*=N,C*=N,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D}else{var B,U,V,W;g<0?(B=A+k,U=f+w,U>B?(V=U-B,W=_-2*A+f,V>=W?(g=1,C=0,T=_+2*k+D):(g=V/W,C=1-g,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)):(g=0,U<=0?(C=1,T=f+2*w+D):w>=0?(C=0,T=D):(C=-w/f,T=w*C+D))):C<0?(B=A+w,U=_+k,U>B?(V=U-B,W=_-2*A+f,V>=W?(C=1,g=0,T=f+2*w+D):(C=V/W,g=1-C,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)):(C=0,U<=0?(g=1,T=_+2*k+D):k>=0?(g=0,T=D):(g=-k/_,T=k*g+D))):(V=f+w-A-k,V<=0?(g=0,C=1,T=f+2*w+D):(W=_-2*A+f,V>=W?(g=1,C=0,T=_+2*k+D):(g=V/W,C=1-g,T=g*(_*g+A*C+2*k)+C*(A*g+f*C+2*w)+D)))}for(var F=1-g-C,x=0;xw)for(f=w;fk)for(f=k;f=0){for(var F=W.type.charAt(W.type.length-1)|0,H=new Array(F),q=0;q=0;)G+=1;U[V]=G}var ee=new Array(w.length);function he(){I.program=s.program(M,I._vref,I._fref,B,U);for(var be=0;beoe&&me>0){var fe=(J[me][0]-oe)/(J[me][0]-J[me-1][0]);return J[me][1]*(1-fe)+fe*J[me-1][1]}}return 1}var q=[0,0,0],G={showSurface:!1,showContour:!1,projections:[T.slice(),T.slice(),T.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function ee(oe,J){var me,fe,Ce,Re=J.axes&&J.axes.lastCubeProps.axis||q,Be=J.showSurface,Ze=J.showContour;for(me=0;me<3;++me)for(Be=Be||J.surfaceProject[me],fe=0;fe<3;++fe)Ze=Ze||J.contourProject[me][fe];for(me=0;me<3;++me){var Ge=G.projections[me];for(fe=0;fe<16;++fe)Ge[fe]=0;for(fe=0;fe<4;++fe)Ge[5*fe]=1;Ge[5*me]=0,Ge[12+me]=J.axesBounds[+(Re[me]>0)][me],f(Ge,oe.model,Ge);var tt=G.clipBounds[me];for(Ce=0;Ce<2;++Ce)for(fe=0;fe<3;++fe)tt[Ce][fe]=oe.clipBounds[Ce][fe];tt[0][me]=-1e8,tt[1][me]=1e8}return G.showSurface=Be,G.showContour=Ze,G}var he={model:T,view:T,projection:T,inverseModel:T.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},be=T.slice(),ve=[1,0,0,0,1,0,0,0,1];function ce(oe,J){oe=oe||{};var me=this.gl;me.disable(me.CULL_FACE),this._colorMap.bind(0);var fe=he;fe.model=oe.model||T,fe.view=oe.view||T,fe.projection=oe.projection||T,fe.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],fe.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],fe.objectOffset=this.objectOffset,fe.contourColor=this.contourColor[0],fe.inverseModel=k(fe.inverseModel,fe.model);for(var Ce=0;Ce<2;++Ce)for(var Re=fe.clipBounds[Ce],Be=0;Be<3;++Be)Re[Be]=Math.min(Math.max(this.clipBounds[Ce][Be],-1e8),1e8);fe.kambient=this.ambientLight,fe.kdiffuse=this.diffuseLight,fe.kspecular=this.specularLight,fe.roughness=this.roughness,fe.fresnel=this.fresnel,fe.opacity=this.opacity,fe.height=0,fe.permutation=ve,fe.vertexColor=this.vertexColor;var Ze=be;for(f(Ze,fe.view,fe.model),f(Ze,fe.projection,Ze),k(Ze,Ze),Ce=0;Ce<3;++Ce)fe.eyePosition[Ce]=Ze[12+Ce]/Ze[15];var Ge=Ze[15];for(Ce=0;Ce<3;++Ce)Ge+=this.lightPosition[Ce]*Ze[4*Ce+3];for(Ce=0;Ce<3;++Ce){var tt=Ze[12+Ce];for(Be=0;Be<3;++Be)tt+=Ze[4*Be+Ce]*this.lightPosition[Be];fe.lightPosition[Ce]=tt/Ge}var _t=ee(fe,this);if(_t.showSurface){for(this._shader.bind(),this._shader.uniforms=fe,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(me.TRIANGLES,this._vertexCount),Ce=0;Ce<3;++Ce)!this.surfaceProject[Ce]||!this.vertexCount||(this._shader.uniforms.model=_t.projections[Ce],this._shader.uniforms.clipBounds=_t.clipBounds[Ce],this._vao.draw(me.TRIANGLES,this._vertexCount));this._vao.unbind()}if(_t.showContour){var mt=this._contourShader;fe.kambient=1,fe.kdiffuse=0,fe.kspecular=0,fe.opacity=1,mt.bind(),mt.uniforms=fe;var vt=this._contourVAO;for(vt.bind(),Ce=0;Ce<3;++Ce)for(mt.uniforms.permutation=B[Ce],me.lineWidth(this.contourWidth[Ce]*this.pixelRatio),Be=0;Be>4)/16)/255,Ce=Math.floor(fe),Re=fe-Ce,Be=J[1]*(oe.value[1]+(oe.value[2]&15)/16)/255,Ze=Math.floor(Be),Ge=Be-Ze;Ce+=1,Ze+=1;var tt=me.position;tt[0]=tt[1]=tt[2]=0;for(var _t=0;_t<2;++_t)for(var mt=_t?Re:1-Re,vt=0;vt<2;++vt)for(var ct=vt?Ge:1-Ge,Ae=Ce+_t,Oe=Ze+vt,Le=mt*ct,nt=0;nt<3;++nt)tt[nt]+=this._field[nt].get(Ae,Oe)*Le;for(var xt=this._pickResult.level,ut=0;ut<3;++ut)if(xt[ut]=w.le(this.contourLevels[ut],tt[ut]),xt[ut]<0)this.contourLevels[ut].length>0&&(xt[ut]=0);else if(xt[ut]Math.abs(Gt-tt[ut])&&(xt[ut]+=1)}for(me.index[0]=Re<.5?Ce:Ce+1,me.index[1]=Ge<.5?Ze:Ze+1,me.uv[0]=fe/J[0],me.uv[1]=Be/J[1],nt=0;nt<3;++nt)me.dataCoordinate[nt]=this._field[nt].get(me.index[0],me.index[1]);return me},F.padField=function(oe,J){var me=J.shape.slice(),fe=oe.shape.slice();b.assign(oe.lo(1,1).hi(me[0],me[1]),J),b.assign(oe.lo(1).hi(me[0],1),J.hi(me[0],1)),b.assign(oe.lo(1,fe[1]-1).hi(me[0],1),J.lo(0,me[1]-1).hi(me[0],1)),b.assign(oe.lo(0,1).hi(1,me[1]),J.hi(1)),b.assign(oe.lo(fe[0]-1,1).hi(1,me[1]),J.lo(me[0]-1)),oe.set(0,0,J.get(0,0)),oe.set(0,fe[1]-1,J.get(0,me[1]-1)),oe.set(fe[0]-1,0,J.get(me[0]-1,0)),oe.set(fe[0]-1,fe[1]-1,J.get(me[0]-1,me[1]-1))};function ge(oe,J){return Array.isArray(oe)?[J(oe[0]),J(oe[1]),J(oe[2])]:[J(oe),J(oe),J(oe)]}function ne(oe){return Array.isArray(oe)?oe.length===3?[oe[0],oe[1],oe[2],1]:[oe[0],oe[1],oe[2],oe[3]]:[0,0,0,1]}function se(oe){if(Array.isArray(oe)){if(Array.isArray(oe))return[ne(oe[0]),ne(oe[1]),ne(oe[2])];var J=ne(oe);return[J.slice(),J.slice(),J.slice()]}}F.update=function(oe){oe=oe||{},this.objectOffset=oe.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in oe&&(this.contourWidth=ge(oe.contourWidth,Number)),"showContour"in oe&&(this.showContour=ge(oe.showContour,Boolean)),"showSurface"in oe&&(this.showSurface=!!oe.showSurface),"contourTint"in oe&&(this.contourTint=ge(oe.contourTint,Boolean)),"contourColor"in oe&&(this.contourColor=se(oe.contourColor)),"contourProject"in oe&&(this.contourProject=ge(oe.contourProject,function(sa){return ge(sa,Boolean)})),"surfaceProject"in oe&&(this.surfaceProject=oe.surfaceProject),"dynamicColor"in oe&&(this.dynamicColor=se(oe.dynamicColor)),"dynamicTint"in oe&&(this.dynamicTint=ge(oe.dynamicTint,Number)),"dynamicWidth"in oe&&(this.dynamicWidth=ge(oe.dynamicWidth,Number)),"opacity"in oe&&(this.opacity=oe.opacity),"opacityscale"in oe&&(this.opacityscale=oe.opacityscale),"colorBounds"in oe&&(this.colorBounds=oe.colorBounds),"vertexColor"in oe&&(this.vertexColor=oe.vertexColor?1:0),"colormap"in oe&&this._colorMap.setPixels(this.genColormap(oe.colormap,this.opacityscale));var J=oe.field||oe.coords&&oe.coords[2]||null,me=!1;if(J||(this._field[2].shape[0]||this._field[2].shape[2]?J=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):J=this._field[2].hi(0,0)),"field"in oe||"coords"in oe){var fe=(J.shape[0]+2)*(J.shape[1]+2);fe>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(fe))),this._field[2]=_(this._field[2].data,[J.shape[0]+2,J.shape[1]+2]),this.padField(this._field[2],J),this.shape=J.shape.slice();for(var Ce=this.shape,Re=0;Re<2;++Re)this._field[2].size>this._field[Re].data.length&&(h.freeFloat(this._field[Re].data),this._field[Re].data=h.mallocFloat(this._field[2].size)),this._field[Re]=_(this._field[Re].data,[Ce[0]+2,Ce[1]+2]);if(oe.coords){var Be=oe.coords;if(!Array.isArray(Be)||Be.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Re=0;Re<2;++Re){var Ze=Be[Re];for(vt=0;vt<2;++vt)if(Ze.shape[vt]!==Ce[vt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Re],Ze)}}else if(oe.ticks){var Ge=oe.ticks;if(!Array.isArray(Ge)||Ge.length!==2)throw new Error("gl-surface: invalid ticks");for(Re=0;Re<2;++Re){var tt=Ge[Re];if((Array.isArray(tt)||tt.length)&&(tt=_(tt)),tt.shape[0]!==Ce[Re])throw new Error("gl-surface: invalid tick length");var _t=_(tt.data,Ce);_t.stride[Re]=tt.stride[0],_t.stride[Re^1]=0,this.padField(this._field[Re],_t)}}else{for(Re=0;Re<2;++Re){var mt=[0,0];mt[Re]=1,this._field[Re]=_(this._field[Re].data,[Ce[0]+2,Ce[1]+2],mt,0)}this._field[0].set(0,0,0);for(var vt=0;vt0){for(var Kn=0;Kn<5;++Kn)Dr.pop();De-=1}continue e}}}cn.push(De)}this._contourOffsets[br]=un,this._contourCounts[br]=cn}var Jn=h.mallocFloat(Dr.length);for(Re=0;Re=0&&(M=E|0,I+=g*M,p-=M),new w(this.data,p,g,I)},D.step=function(E){var I=this.shape[0],M=this.stride[0],p=this.offset,g=0,C=Math.ceil;return typeof E=="number"&&(g=E|0,g<0?(p+=M*(I-1),I=C(-I/g)):I=C(I/g),M*=g),new w(this.data,I,M,p)},D.transpose=function(E){E=E===void 0?0:E|0;var I=this.shape,M=this.stride;return new w(this.data,I[E],M[E],this.offset)},D.pick=function(E){var I=[],M=[],p=this.offset;typeof E=="number"&&E>=0?p=p+this.stride[0]*E|0:(I.push(this.shape[0]),M.push(this.stride[0]));var g=f[I.length+1];return g(this.data,I,M,p)},function(E,I,M,p){return new w(E,I[0],M[0],p)}},2:function(A,f,k){function w(E,I,M,p,g,C){this.data=E,this.shape=[I,M],this.stride=[p,g],this.offset=C|0}var D=w.prototype;return D.dtype=A,D.dimension=2,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(D,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),D.set=function(E,I,M){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I,M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]=M},D.get=function(E,I){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I):this.data[this.offset+this.stride[0]*E+this.stride[1]*I]},D.index=function(E,I){return this.offset+this.stride[0]*E+this.stride[1]*I},D.hi=function(E,I){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,this.stride[0],this.stride[1],this.offset)},D.lo=function(E,I){var M=this.offset,p=0,g=this.shape[0],C=this.shape[1],T=this.stride[0],N=this.stride[1];return typeof E=="number"&&E>=0&&(p=E|0,M+=T*p,g-=p),typeof I=="number"&&I>=0&&(p=I|0,M+=N*p,C-=p),new w(this.data,g,C,T,N,M)},D.step=function(E,I){var M=this.shape[0],p=this.shape[1],g=this.stride[0],C=this.stride[1],T=this.offset,N=0,B=Math.ceil;return typeof E=="number"&&(N=E|0,N<0?(T+=g*(M-1),M=B(-M/N)):M=B(M/N),g*=N),typeof I=="number"&&(N=I|0,N<0?(T+=C*(p-1),p=B(-p/N)):p=B(p/N),C*=N),new w(this.data,M,p,g,C,T)},D.transpose=function(E,I){E=E===void 0?0:E|0,I=I===void 0?1:I|0;var M=this.shape,p=this.stride;return new w(this.data,M[E],M[I],p[E],p[I],this.offset)},D.pick=function(E,I){var M=[],p=[],g=this.offset;typeof E=="number"&&E>=0?g=g+this.stride[0]*E|0:(M.push(this.shape[0]),p.push(this.stride[0])),typeof I=="number"&&I>=0?g=g+this.stride[1]*I|0:(M.push(this.shape[1]),p.push(this.stride[1]));var C=f[M.length+1];return C(this.data,M,p,g)},function(E,I,M,p){return new w(E,I[0],I[1],M[0],M[1],p)}},3:function(A,f,k){function w(E,I,M,p,g,C,T,N){this.data=E,this.shape=[I,M,p],this.stride=[g,C,T],this.offset=N|0}var D=w.prototype;return D.dtype=A,D.dimension=3,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(D,"order",{get:function(){var E=Math.abs(this.stride[0]),I=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return E>I?I>M?[2,1,0]:E>M?[1,2,0]:[1,0,2]:E>M?[2,0,1]:M>I?[0,1,2]:[0,2,1]}}),D.set=function(E,I,M,p){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M,p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]=p},D.get=function(E,I,M){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M]},D.index=function(E,I,M){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M},D.hi=function(E,I,M){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},D.lo=function(E,I,M){var p=this.offset,g=0,C=this.shape[0],T=this.shape[1],N=this.shape[2],B=this.stride[0],U=this.stride[1],V=this.stride[2];return typeof E=="number"&&E>=0&&(g=E|0,p+=B*g,C-=g),typeof I=="number"&&I>=0&&(g=I|0,p+=U*g,T-=g),typeof M=="number"&&M>=0&&(g=M|0,p+=V*g,N-=g),new w(this.data,C,T,N,B,U,V,p)},D.step=function(E,I,M){var p=this.shape[0],g=this.shape[1],C=this.shape[2],T=this.stride[0],N=this.stride[1],B=this.stride[2],U=this.offset,V=0,W=Math.ceil;return typeof E=="number"&&(V=E|0,V<0?(U+=T*(p-1),p=W(-p/V)):p=W(p/V),T*=V),typeof I=="number"&&(V=I|0,V<0?(U+=N*(g-1),g=W(-g/V)):g=W(g/V),N*=V),typeof M=="number"&&(V=M|0,V<0?(U+=B*(C-1),C=W(-C/V)):C=W(C/V),B*=V),new w(this.data,p,g,C,T,N,B,U)},D.transpose=function(E,I,M){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0;var p=this.shape,g=this.stride;return new w(this.data,p[E],p[I],p[M],g[E],g[I],g[M],this.offset)},D.pick=function(E,I,M){var p=[],g=[],C=this.offset;typeof E=="number"&&E>=0?C=C+this.stride[0]*E|0:(p.push(this.shape[0]),g.push(this.stride[0])),typeof I=="number"&&I>=0?C=C+this.stride[1]*I|0:(p.push(this.shape[1]),g.push(this.stride[1])),typeof M=="number"&&M>=0?C=C+this.stride[2]*M|0:(p.push(this.shape[2]),g.push(this.stride[2]));var T=f[p.length+1];return T(this.data,p,g,C)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],M[0],M[1],M[2],p)}},4:function(A,f,k){function w(E,I,M,p,g,C,T,N,B,U){this.data=E,this.shape=[I,M,p,g],this.stride=[C,T,N,B],this.offset=U|0}var D=w.prototype;return D.dtype=A,D.dimension=4,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p,g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]=g},D.get=function(E,I,M,p){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p]},D.index=function(E,I,M,p){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p},D.hi=function(E,I,M,p){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},D.lo=function(E,I,M,p){var g=this.offset,C=0,T=this.shape[0],N=this.shape[1],B=this.shape[2],U=this.shape[3],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3];return typeof E=="number"&&E>=0&&(C=E|0,g+=V*C,T-=C),typeof I=="number"&&I>=0&&(C=I|0,g+=W*C,N-=C),typeof M=="number"&&M>=0&&(C=M|0,g+=F*C,B-=C),typeof p=="number"&&p>=0&&(C=p|0,g+=H*C,U-=C),new w(this.data,T,N,B,U,V,W,F,H,g)},D.step=function(E,I,M,p){var g=this.shape[0],C=this.shape[1],T=this.shape[2],N=this.shape[3],B=this.stride[0],U=this.stride[1],V=this.stride[2],W=this.stride[3],F=this.offset,H=0,q=Math.ceil;return typeof E=="number"&&(H=E|0,H<0?(F+=B*(g-1),g=q(-g/H)):g=q(g/H),B*=H),typeof I=="number"&&(H=I|0,H<0?(F+=U*(C-1),C=q(-C/H)):C=q(C/H),U*=H),typeof M=="number"&&(H=M|0,H<0?(F+=V*(T-1),T=q(-T/H)):T=q(T/H),V*=H),typeof p=="number"&&(H=p|0,H<0?(F+=W*(N-1),N=q(-N/H)):N=q(N/H),W*=H),new w(this.data,g,C,T,N,B,U,V,W,F)},D.transpose=function(E,I,M,p){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0;var g=this.shape,C=this.stride;return new w(this.data,g[E],g[I],g[M],g[p],C[E],C[I],C[M],C[p],this.offset)},D.pick=function(E,I,M,p){var g=[],C=[],T=this.offset;typeof E=="number"&&E>=0?T=T+this.stride[0]*E|0:(g.push(this.shape[0]),C.push(this.stride[0])),typeof I=="number"&&I>=0?T=T+this.stride[1]*I|0:(g.push(this.shape[1]),C.push(this.stride[1])),typeof M=="number"&&M>=0?T=T+this.stride[2]*M|0:(g.push(this.shape[2]),C.push(this.stride[2])),typeof p=="number"&&p>=0?T=T+this.stride[3]*p|0:(g.push(this.shape[3]),C.push(this.stride[3]));var N=f[g.length+1];return N(this.data,g,C,T)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],M[0],M[1],M[2],M[3],p)}},5:function(A,f,k){function w(E,I,M,p,g,C,T,N,B,U,V,W){this.data=E,this.shape=[I,M,p,g,C],this.stride=[T,N,B,U,V],this.offset=W|0}var D=w.prototype;return D.dtype=A,D.dimension=5,Object.defineProperty(D,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(D,"order",{get:k}),D.set=function(E,I,M,p,g,C){return A==="generic"?this.data.set(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g,C):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]=C},D.get=function(E,I,M,p,g){return A==="generic"?this.data.get(this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g):this.data[this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g]},D.index=function(E,I,M,p,g){return this.offset+this.stride[0]*E+this.stride[1]*I+this.stride[2]*M+this.stride[3]*p+this.stride[4]*g},D.hi=function(E,I,M,p,g){return new w(this.data,typeof E!="number"||E<0?this.shape[0]:E|0,typeof I!="number"||I<0?this.shape[1]:I|0,typeof M!="number"||M<0?this.shape[2]:M|0,typeof p!="number"||p<0?this.shape[3]:p|0,typeof g!="number"||g<0?this.shape[4]:g|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},D.lo=function(E,I,M,p,g){var C=this.offset,T=0,N=this.shape[0],B=this.shape[1],U=this.shape[2],V=this.shape[3],W=this.shape[4],F=this.stride[0],H=this.stride[1],q=this.stride[2],G=this.stride[3],ee=this.stride[4];return typeof E=="number"&&E>=0&&(T=E|0,C+=F*T,N-=T),typeof I=="number"&&I>=0&&(T=I|0,C+=H*T,B-=T),typeof M=="number"&&M>=0&&(T=M|0,C+=q*T,U-=T),typeof p=="number"&&p>=0&&(T=p|0,C+=G*T,V-=T),typeof g=="number"&&g>=0&&(T=g|0,C+=ee*T,W-=T),new w(this.data,N,B,U,V,W,F,H,q,G,ee,C)},D.step=function(E,I,M,p,g){var C=this.shape[0],T=this.shape[1],N=this.shape[2],B=this.shape[3],U=this.shape[4],V=this.stride[0],W=this.stride[1],F=this.stride[2],H=this.stride[3],q=this.stride[4],G=this.offset,ee=0,he=Math.ceil;return typeof E=="number"&&(ee=E|0,ee<0?(G+=V*(C-1),C=he(-C/ee)):C=he(C/ee),V*=ee),typeof I=="number"&&(ee=I|0,ee<0?(G+=W*(T-1),T=he(-T/ee)):T=he(T/ee),W*=ee),typeof M=="number"&&(ee=M|0,ee<0?(G+=F*(N-1),N=he(-N/ee)):N=he(N/ee),F*=ee),typeof p=="number"&&(ee=p|0,ee<0?(G+=H*(B-1),B=he(-B/ee)):B=he(B/ee),H*=ee),typeof g=="number"&&(ee=g|0,ee<0?(G+=q*(U-1),U=he(-U/ee)):U=he(U/ee),q*=ee),new w(this.data,C,T,N,B,U,V,W,F,H,q,G)},D.transpose=function(E,I,M,p,g){E=E===void 0?0:E|0,I=I===void 0?1:I|0,M=M===void 0?2:M|0,p=p===void 0?3:p|0,g=g===void 0?4:g|0;var C=this.shape,T=this.stride;return new w(this.data,C[E],C[I],C[M],C[p],C[g],T[E],T[I],T[M],T[p],T[g],this.offset)},D.pick=function(E,I,M,p,g){var C=[],T=[],N=this.offset;typeof E=="number"&&E>=0?N=N+this.stride[0]*E|0:(C.push(this.shape[0]),T.push(this.stride[0])),typeof I=="number"&&I>=0?N=N+this.stride[1]*I|0:(C.push(this.shape[1]),T.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(C.push(this.shape[2]),T.push(this.stride[2])),typeof p=="number"&&p>=0?N=N+this.stride[3]*p|0:(C.push(this.shape[3]),T.push(this.stride[3])),typeof g=="number"&&g>=0?N=N+this.stride[4]*g|0:(C.push(this.shape[4]),T.push(this.stride[4]));var B=f[C.length+1];return B(this.data,C,T,N)},function(E,I,M,p){return new w(E,I[0],I[1],I[2],I[3],I[4],M[0],M[1],M[2],M[3],M[4],p)}}};function m(A,f){var k=f===-1?"T":String(f),w=h[k];return f===-1?w(A):f===0?w(A,x[A][0]):w(A,x[A],s)}function b(A){if(l(A))return"buffer";if(o)switch(Object.prototype.toString.call(A)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(A)?"array":"generic"}var x={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function _(A,f,k,w){if(A===void 0){var g=x.array[0];return g([])}else typeof A=="number"&&(A=[A]);f===void 0&&(f=[A.length]);var D=f.length;if(k===void 0){k=new Array(D);for(var E=D-1,I=1;E>=0;--E)k[E]=I,I*=f[E]}if(w===void 0){w=0;for(var E=0;E1e-6?(k[0]=D/p,k[1]=E/p,k[2]=I/p,k[3]=M/p):(k[0]=k[1]=k[2]=0,k[3]=1)}function _(k,w,D){this.radius=l([D]),this.center=l(w),this.rotation=l(k),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var A=_.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(k){this.radius.curve(k),this.center.curve(k),this.rotation.curve(k);var w=this.computedRotation;x(w,w);var D=this.computedMatrix;u(D,w);var E=this.computedCenter,I=this.computedEye,M=this.computedUp,p=Math.exp(this.computedRadius[0]);I[0]=E[0]+p*D[2],I[1]=E[1]+p*D[6],I[2]=E[2]+p*D[10],M[0]=D[1],M[1]=D[5],M[2]=D[9];for(var g=0;g<3;++g){for(var C=0,T=0;T<3;++T)C+=D[g+4*T]*I[T];D[12+g]=-C}},A.getMatrix=function(k,w){this.recalcMatrix(k);var D=this.computedMatrix;if(w){for(var E=0;E<16;++E)w[E]=D[E];return w}return D},A.idle=function(k){this.center.idle(k),this.radius.idle(k),this.rotation.idle(k)},A.flush=function(k){this.center.flush(k),this.radius.flush(k),this.rotation.flush(k)},A.pan=function(k,w,D,E){w=w||0,D=D||0,E=E||0,this.recalcMatrix(k);var I=this.computedMatrix,M=I[1],p=I[5],g=I[9],C=m(M,p,g);M/=C,p/=C,g/=C;var T=I[0],N=I[4],B=I[8],U=T*M+N*p+B*g;T-=M*U,N-=p*U,B-=g*U;var V=m(T,N,B);T/=V,N/=V,B/=V,I[2],I[6],I[10];var W=T*w+M*D,F=N*w+p*D,H=B*w+g*D;this.center.move(k,W,F,H);var q=Math.exp(this.computedRadius[0]);q=Math.max(1e-4,q+E),this.radius.set(k,Math.log(q))},A.rotate=function(k,w,D,E){this.recalcMatrix(k),w=w||0,D=D||0;var I=this.computedMatrix,M=I[0],p=I[4],g=I[8],C=I[1],T=I[5],N=I[9],B=I[2],U=I[6],V=I[10],W=w*M+D*C,F=w*p+D*T,H=w*g+D*N,q=-(U*H-V*F),G=-(V*W-B*H),ee=-(B*F-U*W),he=Math.sqrt(Math.max(0,1-Math.pow(q,2)-Math.pow(G,2)-Math.pow(ee,2))),be=b(q,G,ee,he);be>1e-6?(q/=be,G/=be,ee/=be,he/=be):(q=G=ee=0,he=1);var ve=this.computedRotation,ce=ve[0],re=ve[1],ge=ve[2],ne=ve[3],se=ce*he+ne*q+re*ee-ge*G,_e=re*he+ne*G+ge*q-ce*ee,oe=ge*he+ne*ee+ce*G-re*q,J=ne*he-ce*q-re*G-ge*ee;if(E){q=B,G=U,ee=V;var me=Math.sin(E)/m(q,G,ee);q*=me,G*=me,ee*=me,he=Math.cos(w),se=se*he+J*q+_e*ee-oe*G,_e=_e*he+J*G+oe*q-se*ee,oe=oe*he+J*ee+se*G-_e*q,J=J*he-se*q-_e*G-oe*ee}var fe=b(se,_e,oe,J);fe>1e-6?(se/=fe,_e/=fe,oe/=fe,J/=fe):(se=_e=oe=0,J=1),this.rotation.set(k,se,_e,oe,J)},A.lookAt=function(k,w,D,E){this.recalcMatrix(k),D=D||this.computedCenter,w=w||this.computedEye,E=E||this.computedUp;var I=this.computedMatrix;o(I,w,D,E);var M=this.computedRotation;h(M,I[0],I[1],I[2],I[4],I[5],I[6],I[8],I[9],I[10]),x(M,M),this.rotation.set(k,M[0],M[1],M[2],M[3]);for(var p=0,g=0;g<3;++g)p+=Math.pow(D[g]-w[g],2);this.radius.set(k,.5*Math.log(Math.max(p,1e-6))),this.center.set(k,D[0],D[1],D[2])},A.translate=function(k,w,D,E){this.center.move(k,w||0,D||0,E||0)},A.setMatrix=function(k,w){var D=this.computedRotation;h(D,w[0],w[1],w[2],w[4],w[5],w[6],w[8],w[9],w[10]),x(D,D),this.rotation.set(k,D[0],D[1],D[2],D[3]);var E=this.computedMatrix;s(E,w);var I=E[15];if(Math.abs(I)>1e-6){var M=E[12]/I,p=E[13]/I,g=E[14]/I;this.recalcMatrix(k);var C=Math.exp(this.computedRadius[0]);this.center.set(k,M-E[2]*C,p-E[6]*C,g-E[10]*C),this.radius.idle(k)}else this.center.idle(k),this.radius.idle(k)},A.setDistance=function(k,w){w>0&&this.radius.set(k,Math.log(w))},A.setDistanceLimits=function(k,w){k>0?k=Math.log(k):k=-1/0,w>0?w=Math.log(w):w=1/0,w=Math.max(w,k),this.radius.bounds[0][0]=k,this.radius.bounds[1][0]=w},A.getDistanceLimits=function(k){var w=this.radius.bounds;return k?(k[0]=Math.exp(w[0][0]),k[1]=Math.exp(w[1][0]),k):[Math.exp(w[0][0]),Math.exp(w[1][0])]},A.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},A.fromJSON=function(k){var w=this.lastT(),D=k.center;D&&this.center.set(w,D[0],D[1],D[2]);var E=k.rotation;E&&this.rotation.set(w,E[0],E[1],E[2],E[3]);var I=k.distance;I&&I>0&&this.radius.set(w,Math.log(I)),this.setDistanceLimits(k.zoomMin,k.zoomMax)};function f(k){k=k||{};var w=k.center||[0,0,0],D=k.rotation||[0,0,0,1],E=k.radius||1;w=[].slice.call(w,0,3),D=[].slice.call(D,0,4),x(D,D);var I=new _(D,w,Math.log(E));return I.setDistanceLimits(k.zoomMin,k.zoomMax),("eye"in k||"up"in k)&&I.lookAt(0,k.eye,k.center,k.up),I}},9994:function(i,n,a){var l=a(9618),o=a(8277);i.exports=function(u,s){for(var h=[],m=u,b=1;Array.isArray(m);)h.push(m.length),b*=m.length,m=m[0];return h.length===0?l():(s||(s=l(new Float64Array(b),h)),o(s,u),s)}}},y={};function z(i){var n=y[i];if(n!==void 0)return n.exports;var a=y[i]={id:i,loaded:!1,exports:{}};return d[i].call(a.exports,a,a.exports,z),a.loaded=!0,a.exports}(function(){z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){z.nmd=function(i){return i.paths=[],i.children||(i.children=[]),i}}();var P=z(1964);Y.exports=P})()}),eD=ze((te,Y)=>{Y.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),vY=ze((te,Y)=>{var d=eD();Y.exports=z;var y={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function z(P){var i,n=[],a=1,l;if(typeof P=="string")if(P=P.toLowerCase(),d[P])n=d[P].slice(),l="rgb";else if(P==="transparent")a=0,l="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(P)){var o=P.slice(1),u=o.length,s=u<=4;a=1,s?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],u===4&&(a=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],u===8&&(a=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),l="rgb"}else if(i=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(P)){var h=i[1],m=h==="rgb",o=h.replace(/a$/,"");l=o;var u=o==="cmyk"?4:o==="gray"?1:3;n=i[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(_,A){if(/%$/.test(_))return A===u?parseFloat(_)/100:o==="rgb"?parseFloat(_)*255/100:parseFloat(_);if(o[A]==="h"){if(/deg$/.test(_))return parseFloat(_);if(y[_]!==void 0)return y[_]}return parseFloat(_)}),h===o&&n.push(1),a=m||n[u]===void 0?1:n[u],n=n.slice(0,u)}else P.length>10&&/[0-9](?:\s|\/)/.test(P)&&(n=P.match(/([0-9]+)/g).map(function(b){return parseFloat(b)}),l=P.match(/([a-z])/ig).join("").toLowerCase());else isNaN(P)?Array.isArray(P)||P.length?(n=[P[0],P[1],P[2]],l="rgb",a=P.length===4?P[3]:1):P instanceof Object&&(P.r!=null||P.red!=null||P.R!=null?(l="rgb",n=[P.r||P.red||P.R||0,P.g||P.green||P.G||0,P.b||P.blue||P.B||0]):(l="hsl",n=[P.h||P.hue||P.H||0,P.s||P.saturation||P.S||0,P.l||P.lightness||P.L||P.b||P.brightness]),a=P.a||P.alpha||P.opacity||1,P.opacity!=null&&(a/=100)):(l="rgb",n=[P>>>16,(P&65280)>>>8,P&255]);return{space:l,values:n,alpha:a}}}),yY=ze((te,Y)=>{var d=vY();Y.exports=function(z){Array.isArray(z)&&z.raw&&(z=String.raw.apply(null,arguments));var P,i=d(z);if(!i.space)return[];var n=[0,0,0],a=i.space[0]==="h"?[360,100,100]:[255,255,255];return P=Array(3),P[0]=Math.min(Math.max(i.values[0],n[0]),a[0]),P[1]=Math.min(Math.max(i.values[1],n[1]),a[1]),P[2]=Math.min(Math.max(i.values[2],n[2]),a[2]),i.space[0]==="h"&&(P=y(P)),P.push(Math.min(Math.max(i.alpha,0),1)),P};function y(z){var P=z[0]/360,i=z[1]/100,n=z[2]/100,a,l,o,u,s,h=0;if(i===0)return s=n*255,[s,s,s];for(l=n<.5?n*(1+i):n+i-n*i,a=2*n-l,u=[0,0,0];h<3;)o=P+1/3*-(h-1),o<0?o++:o>1&&o--,s=6*o<1?a+(l-a)*6*o:2*o<1?l:3*o<2?a+(l-a)*(2/3-o)*6:a,u[h++]=s*255;return u}}),k6=ze((te,Y)=>{Y.exports=d;function d(y,z,P){return zP?P:y:yz?z:y}}),jC=ze((te,Y)=>{Y.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}),$_=ze((te,Y)=>{var d=yY(),y=k6(),z=jC();Y.exports=function(i,n){(n==="float"||!n)&&(n="array"),n==="uint"&&(n="uint8"),n==="uint_clamped"&&(n="uint8_clamped");var a=z(n),l=new a(4),o=n!=="uint8"&&n!=="uint8_clamped";return(!i.length||typeof i=="string")&&(i=d(i),i[0]/=255,i[1]/=255,i[2]/=255),P(i)?(l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3]!=null?i[3]:255,o&&(l[0]/=255,l[1]/=255,l[2]/=255,l[3]/=255),l):(o?(l[0]=i[0],l[1]=i[1],l[2]=i[2],l[3]=i[3]!=null?i[3]:1):(l[0]=y(Math.floor(i[0]*255),0,255),l[1]=y(Math.floor(i[1]*255),0,255),l[2]=y(Math.floor(i[2]*255),0,255),l[3]=i[3]==null?255:y(Math.floor(i[3]*255),0,255)),l)};function P(i){return!!(i instanceof Uint8Array||i instanceof Uint8ClampedArray||Array.isArray(i)&&(i[0]>1||i[0]===0)&&(i[1]>1||i[1]===0)&&(i[2]>1||i[2]===0)&&(!i[3]||i[3]>1))}}),uy=ze((te,Y)=>{var d=$_();function y(z){return z?d(z):[0,0,0,1]}Y.exports=y}),cy=ze((te,Y)=>{var d=Sr(),y=ln(),z=$_(),P=lh(),i=Mi().defaultLine,n=Di().isArrayOrTypedArray,a=z(i),l=1;function o(b,x){var _=b;return _[3]*=x,_}function u(b){if(d(b))return a;var x=z(b);return x.length?x:a}function s(b){return d(b)?b:l}function h(b,x,_){var A=b.color;A&&A._inputArray&&(A=A._inputArray);var f=n(A),k=n(x),w=P.extractOpts(b),D=[],E,I,M,p,g;if(w.colorscale!==void 0?E=P.makeColorScaleFuncFromTrace(b):E=u,f?I=function(T,N){return T[N]===void 0?a:z(E(T[N]))}:I=u,k?M=function(T,N){return T[N]===void 0?l:s(T[N])}:M=s,f||k)for(var C=0;C<_;C++)p=I(A,C),g=M(x,C),D[C]=o(p,g);else D=o(z(A),x);return D}function m(b){var x=P.extractOpts(b),_=x.colorscale;return x.reversescale&&(_=P.flipScale(x.colorscale)),_.map(function(A){var f=A[0],k=y(A[1]),w=k.toRgb();return{index:f,rgb:[w.r,w.g,w.b,w.a]}})}Y.exports={formatColor:h,parseColorScale:m}}),tD=ze((te,Y)=>{Y.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}}),UC=ze((te,Y)=>{Y.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}}),_Y=ze((te,Y)=>{var d=as();function y(i,n,a,l){if(!n||!n.visible)return null;for(var o=d.getComponentMethod("errorbars","makeComputeError")(n),u=new Array(i.length),s=0;s0){var _=l.c2l(b);l._lowerLogErrorBound||(l._lowerLogErrorBound=_),l._lowerErrorBound=Math.min(l._lowerLogErrorBound,_)}}else u[s]=[-h[0]*a,h[1]*a]}return u}function z(i){for(var n=0;n{var d=Hp().gl_line3d,y=Hp().gl_scatter3d,z=Hp().gl_error3d,P=Hp().gl_mesh3d,i=Hp().delaunay_triangulate,n=ji(),a=uy(),l=cy().formatColor,o=$v(),u=tD(),s=UC(),h=Os(),m=T0().appendArrayPointValue,b=_Y();function x(N,B){this.scene=N,this.uid=B,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var _=x.prototype;_.handlePick=function(N){if(N.object&&(N.object===this.linePlot||N.object===this.delaunayMesh||N.object===this.textMarkers||N.object===this.scatterPlot)){var B=N.index=N.data.index;return N.object.highlight&&N.object.highlight(null),this.scatterPlot&&(N.object=this.scatterPlot,this.scatterPlot.highlight(N.data)),N.textLabel="",this.textLabels&&(n.isArrayOrTypedArray(this.textLabels)?(this.textLabels[B]||this.textLabels[B]===0)&&(N.textLabel=this.textLabels[B]):N.textLabel=this.textLabels),N.traceCoordinate=[this.data.x[B],this.data.y[B],this.data.z[B]],!0}};function A(N,B,U){var V=(U+1)%3,W=(U+2)%3,F=[],H=[],q;for(q=0;q-1?-1:N.indexOf("right")>-1?1:0}function w(N){return N==null?0:N.indexOf("top")>-1?-1:N.indexOf("bottom")>-1?1:0}function D(N){var B=0,U=0,V=[B,U];if(Array.isArray(N))for(var W=0;W=0){var ee=A(q.position,q.delaunayColor,q.delaunayAxis);ee.opacity=N.opacity,this.delaunayMesh?this.delaunayMesh.update(ee):(ee.gl=B,this.delaunayMesh=P(ee),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},_.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function T(N,B){var U=new x(N,B.uid);return U.update(B),U}Y.exports=T}),rD=ze((te,Y)=>{var d=ff(),y=On(),z=Oc(),P=Sh().axisHoverFormat,{hovertemplateAttrs:i,texttemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=xa(),o=tD(),u=UC(),s=nn().extendFlat,h=oh().overrideAll,m=Xm(),b=d.line,x=d.marker,_=x.line,A=s({width:b.width,dash:{valType:"enumerated",values:m(o),dflt:"solid"}},z("line"));function f(w){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var k=Y.exports=h({x:d.x,y:d.y,z:{valType:"data_array"},text:s({},d.text,{}),texttemplate:n(),texttemplatefallback:a({editType:"calc"}),hovertext:s({},d.hovertext,{}),hovertemplate:i(),hovertemplatefallback:a(),xhoverformat:P("x"),yhoverformat:P("y"),zhoverformat:P("z"),mode:s({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:f(),y:f(),z:f()},connectgaps:d.connectgaps,line:A,marker:s({symbol:{valType:"enumerated",values:m(u),dflt:"circle",arrayOk:!0},size:s({},x.size,{dflt:8}),sizeref:x.sizeref,sizemin:x.sizemin,sizemode:x.sizemode,opacity:s({},x.opacity,{arrayOk:!1}),colorbar:x.colorbar,line:s({width:s({},_.width,{arrayOk:!1})},z("marker.line"))},z("marker")),textposition:s({},d.textposition,{dflt:"top center"}),textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:s({},l.hoverinfo)},"calc","nested");k.x.editType=k.y.editType=k.z.editType="calc+clearAxisTypes"}),bY=ze((te,Y)=>{var d=as(),y=ji(),z=Bc(),P=X0(),i=Pm(),n=mm(),a=rD();Y.exports=function(o,u,s,h){function m(D,E){return y.coerce(o,u,a,D,E)}var b=l(o,u,m,h);if(!b){u.visible=!1;return}m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("xhoverformat"),m("yhoverformat"),m("zhoverformat"),m("mode"),z.hasMarkers(u)&&P(o,u,s,h,m,{noSelect:!0,noAngle:!0}),z.hasLines(u)&&(m("connectgaps"),i(o,u,s,h,m)),z.hasText(u)&&(m("texttemplate"),m("texttemplatefallback"),n(o,u,h,m,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var x=(u.line||{}).color,_=(u.marker||{}).color;m("surfaceaxis")>=0&&m("surfacecolor",x||_);for(var A=["x","y","z"],f=0;f<3;++f){var k="projection."+A[f];m(k+".show")&&(m(k+".opacity"),m(k+".scale"))}var w=d.getComponentMethod("errorbars","supplyDefaults");w(o,u,x||_||s,{axis:"z"}),w(o,u,x||_||s,{axis:"y",inherit:"z"}),w(o,u,x||_||s,{axis:"x",inherit:"z"})};function l(o,u,s,h){var m=0,b=s("x"),x=s("y"),_=s("z"),A=d.getComponentMethod("calendars","handleTraceDefaults");return A(o,u,["x","y","z"],h),b&&x&&_&&(m=Math.min(b.length,x.length,_.length),u._length=u._xlength=u._ylength=u._zlength=m),m}}),wY=ze((te,Y)=>{var d=de(),y=zm();Y.exports=function(z,P){var i=[{x:!1,y:!1,trace:P,t:{}}];return d(i,P),y(z,P),i}}),kY=ze((te,Y)=>{Y.exports=d;function d(y,z){if(typeof y!="string")throw new TypeError("must specify type string");if(z=z||{},typeof document>"u"&&!z.canvas)return null;var P=z.canvas||document.createElement("canvas");typeof z.width=="number"&&(P.width=z.width),typeof z.height=="number"&&(P.height=z.height);var i=z,n;try{var a=[y];y.indexOf("webgl")===0&&a.push("experimental-"+y);for(var l=0;l{var d=kY();Y.exports=function(y){return d("webgl",y)}}),iD=ze((te,Y)=>{var d=Xi(),y=function(){};Y.exports=function(z){for(var P in z)typeof z[P]=="function"&&(z[P]=y);z.destroy=function(){z.container.parentNode.removeChild(z.container)};var i=document.createElement("div");i.className="no-webgl",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=d.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=d.lightLine,i.style["z-index"]=30;var n=document.createElement("p");return n.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",n.style.position="relative",n.style.top="50%",n.style.left="50%",n.style.height="30%",n.style.width="50%",n.style.margin="-15% 0 0 -25%",i.appendChild(n),z.container.appendChild(i),z.container.style.background="#FFFFFF",z.container.onclick=function(){window.open("https://get.webgl.org")},!1}}),SY=ze((te,Y)=>{var d=uy(),y=ji(),z=["xaxis","yaxis","zaxis"];function P(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[10,10,10],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}var i=P.prototype;i.merge=function(a,l){for(var o=this,u=0;u<3;++u){var s=l[z[u]];if(!s.visible){o.tickEnable[u]=!1,o.labelEnable[u]=!1,o.lineEnable[u]=!1,o.lineTickEnable[u]=!1,o.gridEnable[u]=!1,o.zeroEnable[u]=!1,o.backgroundEnable[u]=!1;continue}o.labels[u]=a._meta?y.templateString(s.title.text,a._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(o.labelColor[u]=d(s.title.font.color)),s.title.font.family&&(o.labelFont[u]=s.title.font.family),s.title.font.size&&(o.labelSize[u]=s.title.font.size),s.title.font.weight&&(o.labelFontWeight[u]=s.title.font.weight),s.title.font.style&&(o.labelFontStyle[u]=s.title.font.style),s.title.font.variant&&(o.labelFontVariant[u]=s.title.font.variant)),"showline"in s&&(o.lineEnable[u]=s.showline),"linecolor"in s&&(o.lineColor[u]=d(s.linecolor)),"linewidth"in s&&(o.lineWidth[u]=s.linewidth),"showgrid"in s&&(o.gridEnable[u]=s.showgrid),"gridcolor"in s&&(o.gridColor[u]=d(s.gridcolor)),"gridwidth"in s&&(o.gridWidth[u]=s.gridwidth),s.type==="log"?o.zeroEnable[u]=!1:"zeroline"in s&&(o.zeroEnable[u]=s.zeroline),"zerolinecolor"in s&&(o.zeroLineColor[u]=d(s.zerolinecolor)),"zerolinewidth"in s&&(o.zeroLineWidth[u]=s.zerolinewidth),"ticks"in s&&s.ticks?o.lineTickEnable[u]=!0:o.lineTickEnable[u]=!1,"ticklen"in s&&(o.lineTickLength[u]=o._defaultLineTickLength[u]=s.ticklen),"tickcolor"in s&&(o.lineTickColor[u]=d(s.tickcolor)),"tickwidth"in s&&(o.lineTickWidth[u]=s.tickwidth),"tickangle"in s&&(o.tickAngle[u]=s.tickangle==="auto"?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(o.tickEnable[u]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(o.tickColor[u]=d(s.tickfont.color)),s.tickfont.family&&(o.tickFont[u]=s.tickfont.family),s.tickfont.size&&(o.tickSize[u]=s.tickfont.size),s.tickfont.weight&&(o.tickFontWeight[u]=s.tickfont.weight),s.tickfont.style&&(o.tickFontStyle[u]=s.tickfont.style),s.tickfont.variant&&(o.tickFontVariant[u]=s.tickfont.variant)),"mirror"in s?["ticks","all","allticks"].indexOf(s.mirror)!==-1?(o.lineTickMirror[u]=!0,o.lineMirror[u]=!0):s.mirror===!0?(o.lineTickMirror[u]=!1,o.lineMirror[u]=!0):(o.lineTickMirror[u]=!1,o.lineMirror[u]=!1):o.lineMirror[u]=!1,"showbackground"in s&&s.showbackground!==!1?(o.backgroundEnable[u]=!0,o.backgroundColor[u]=d(s.backgroundcolor)):o.backgroundEnable[u]=!1}};function n(a,l){var o=new P;return o.merge(a,l),o}Y.exports=n}),CY=ze((te,Y)=>{var d=uy(),y=["xaxis","yaxis","zaxis"];function z(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}var P=z.prototype;P.merge=function(n){for(var a=0;a<3;++a){var l=n[y[a]];if(!l.visible){this.enabled[a]=!1,this.drawSides[a]=!1;continue}this.enabled[a]=l.showspikes,this.colors[a]=d(l.spikecolor),this.drawSides[a]=l.spikesides,this.lineWidth[a]=l.spikethickness}};function i(n){var a=new z;return a.merge(n),a}Y.exports=i}),AY=ze((te,Y)=>{Y.exports=i;var d=Os(),y=ji(),z=["xaxis","yaxis","zaxis"];function P(n){for(var a=new Array(3),l=0;l<3;++l){for(var o=n[l],u=new Array(o.length),s=0;s/g," "));u[s]=x,h.tickmode=m}}a.ticks=u;for(var s=0;s<3;++s){.5*(n.glplot.bounds[0][s]+n.glplot.bounds[1][s]);for(var _=0;_<2;++_)a.bounds[_][s]=n.glplot.bounds[_][s]}n.contourLevels=P(u)}}),MY=ze((te,Y)=>{var d=Hp().gl_plot3d,y=d.createCamera,z=d.createScene,P=TY(),i=uw(),n=as(),a=ji(),l=a.preserveDrawingBuffer(),o=Os(),u=hf(),s=uy(),h=iD(),m=xL(),b=SY(),x=CY(),_=AY(),A=Jm().applyAutorangeOptions,f,k,w=!1;function D(U,V){var W=document.createElement("div"),F=U.container;this.graphDiv=U.graphDiv;var H=document.createElementNS("http://www.w3.org/2000/svg","svg");H.style.position="absolute",H.style.top=H.style.left="0px",H.style.width=H.style.height="100%",H.style["z-index"]=20,H.style["pointer-events"]="none",W.appendChild(H),this.svgContainer=H,W.id=U.id,W.style.position="absolute",W.style.top=W.style.left="0px",W.style.width=W.style.height="100%",F.appendChild(W),this.fullLayout=V,this.id=U.id||"scene",this.fullSceneLayout=V[this.id],this.plotArgs=[[],{},{}],this.axesOptions=b(V,V[this.id]),this.spikeOptions=x(V[this.id]),this.container=W,this.staticMode=!!U.staticPlot,this.pixelRatio=this.pixelRatio||U.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=n.getComponentMethod("annotations3d","convert"),this.drawAnnotations=n.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=D.prototype;E.prepareOptions=function(){var U=this,V={canvas:U.canvas,gl:U.gl,glOptions:{preserveDrawingBuffer:l,premultipliedAlpha:!0,antialias:!0},container:U.container,axes:U.axesOptions,spikes:U.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:U.camera,pixelRatio:U.pixelRatio};if(U.staticMode){if(!k&&(f=document.createElement("canvas"),k=P({canvas:f,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!k))throw new Error("error creating static canvas/context for image server");V.gl=k,V.canvas=f}return V};var I=!0;E.tryCreatePlot=function(){var U=this,V=U.prepareOptions(),W=!0;try{U.glplot=z(V)}catch{if(U.staticMode||!I||l)W=!1;else{a.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{l=V.glOptions.preserveDrawingBuffer=!0,U.glplot=z(V)}catch{l=V.glOptions.preserveDrawingBuffer=!1,W=!1}}}return I=!1,W},E.initializeGLCamera=function(){var U=this,V=U.fullSceneLayout.camera,W=V.projection.type==="orthographic";U.camera=y(U.container,{center:[V.center.x,V.center.y,V.center.z],eye:[V.eye.x,V.eye.y,V.eye.z],up:[V.up.x,V.up.y,V.up.z],_ortho:W,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var U=this;U.initializeGLCamera();var V=U.tryCreatePlot();if(!V)return h(U);U.traces={},U.make4thDimension();var W=U.graphDiv,F=W.layout,H=function(){var G={};return U.isCameraChanged(F)&&(G[U.id+".camera"]=U.getCamera()),U.isAspectChanged(F)&&(G[U.id+".aspectratio"]=U.glplot.getAspectratio(),F[U.id].aspectmode!=="manual"&&(U.fullSceneLayout.aspectmode=F[U.id].aspectmode=G[U.id+".aspectmode"]="manual")),G},q=function(G){if(G.fullSceneLayout.dragmode!==!1){var ee=H();G.saveLayout(F),G.graphDiv.emit("plotly_relayout",ee)}};return U.glplot.canvas&&(U.glplot.canvas.addEventListener("mouseup",function(){q(U)}),U.glplot.canvas.addEventListener("touchstart",function(){w=!0}),U.glplot.canvas.addEventListener("wheel",function(G){if(W._context._scrollZoom.gl3d){if(U.camera._ortho){var ee=G.deltaX>G.deltaY?1.1:.9090909090909091,he=U.glplot.getAspectratio();U.glplot.setAspectratio({x:ee*he.x,y:ee*he.y,z:ee*he.z})}q(U)}},i?{passive:!1}:!1),U.glplot.canvas.addEventListener("mousemove",function(){if(U.fullSceneLayout.dragmode!==!1&&U.camera.mouseListener.buttons!==0){var G=H();U.graphDiv.emit("plotly_relayouting",G)}}),U.staticMode||U.glplot.canvas.addEventListener("webglcontextlost",function(G){W&&W.emit&&W.emit("plotly_webglcontextlost",{event:G,layer:U.id})},!1)),U.glplot.oncontextloss=function(){U.recoverContext()},U.glplot.onrender=function(){U.render()},!0},E.render=function(){var U=this,V=U.graphDiv,W,F=U.svgContainer,H=U.container.getBoundingClientRect();V._fullLayout._calcInverseTransform(V);var q=V._fullLayout._invScaleX,G=V._fullLayout._invScaleY,ee=H.width*q,he=H.height*G;F.setAttributeNS(null,"viewBox","0 0 "+ee+" "+he),F.setAttributeNS(null,"width",ee),F.setAttributeNS(null,"height",he),_(U),U.glplot.axes.update(U.axesOptions);for(var be=Object.keys(U.traces),ve=null,ce=U.glplot.selection,re=0;re")):W.type==="isosurface"||W.type==="volume"?(oe.valueLabel=o.hoverLabelText(U._mockAxis,U._mockAxis.d2l(ce.traceCoordinate[3]),W.valuehoverformat),Re.push("value: "+oe.valueLabel),ce.textLabel&&Re.push(ce.textLabel),Ce=Re.join("
")):Ce=ce.textLabel;var Be={x:ce.traceCoordinate[0],y:ce.traceCoordinate[1],z:ce.traceCoordinate[2],data:se._input,fullData:se,curveNumber:se.index,pointNumber:_e};u.appendArrayPointValue(Be,se,_e),W._module.eventData&&(Be=se._module.eventData(Be,ce,se,{},_e));var Ze={points:[Be]};if(U.fullSceneLayout.hovermode){var Ge=[];u.loneHover({trace:se,x:(.5+.5*ne[0]/ne[3])*ee,y:(.5-.5*ne[1]/ne[3])*he,xLabel:oe.xLabel,yLabel:oe.yLabel,zLabel:oe.zLabel,text:Ce,name:ve.name,color:u.castHoverOption(se,_e,"bgcolor")||ve.color,borderColor:u.castHoverOption(se,_e,"bordercolor"),fontFamily:u.castHoverOption(se,_e,"font.family"),fontSize:u.castHoverOption(se,_e,"font.size"),fontColor:u.castHoverOption(se,_e,"font.color"),nameLength:u.castHoverOption(se,_e,"namelength"),textAlign:u.castHoverOption(se,_e,"align"),hovertemplate:a.castOption(se,_e,"hovertemplate"),hovertemplateLabels:a.extendFlat({},Be,oe),eventData:[Be]},{container:F,gd:V,inOut_bbox:Ge}),Be.bbox=Ge[0]}ce.distance<5&&(ce.buttons||w)?V.emit("plotly_click",Ze):V.emit("plotly_hover",Ze),this.oldEventData=Ze}else u.loneUnhover(F),this.oldEventData&&V.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;U.drawAnnotations(U)},E.recoverContext=function(){var U=this;U.glplot.dispose();var V=function(){if(U.glplot.gl.isContextLost()){requestAnimationFrame(V);return}if(!U.initializeGLPlot()){a.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}U.plot.apply(U,U.plotArgs)};requestAnimationFrame(V)};var M=["xaxis","yaxis","zaxis"];function p(U,V,W){for(var F=U.fullSceneLayout,H=0;H<3;H++){var q=M[H],G=q.charAt(0),ee=F[q],he=V[G],be=V[G+"calendar"],ve=V["_"+G+"length"];if(!a.isArrayOrTypedArray(he))W[0][H]=Math.min(W[0][H],0),W[1][H]=Math.max(W[1][H],ve-1);else for(var ce,re=0;re<(ve||he.length);re++)if(a.isArrayOrTypedArray(he[re]))for(var ge=0;gese[1][G])se[0][G]=-1,se[1][G]=1;else{var _t=se[1][G]-se[0][G];se[0][G]-=_t/32,se[1][G]+=_t/32}if(J=[se[0][G],se[1][G]],J=A(J,he),se[0][G]=J[0],se[1][G]=J[1],he.isReversed()){var mt=se[0][G];se[0][G]=se[1][G],se[1][G]=mt}}else J=he.range,se[0][G]=he.r2l(J[0]),se[1][G]=he.r2l(J[1]);se[0][G]===se[1][G]&&(se[0][G]-=1,se[1][G]+=1),_e[G]=se[1][G]-se[0][G],he.range=[se[0][G],se[1][G]],he.limitRange(),F.glplot.setBounds(G,{min:he.range[0]*ge[G],max:he.range[1]*ge[G]})}var vt,ct=ve.aspectmode;if(ct==="cube")vt=[1,1,1];else if(ct==="manual"){var Ae=ve.aspectratio;vt=[Ae.x,Ae.y,Ae.z]}else if(ct==="auto"||ct==="data"){var Oe=[1,1,1];for(G=0;G<3;++G){he=ve[M[G]],be=he.type;var Le=oe[be];Oe[G]=Math.pow(Le.acc,1/Le.count)/ge[G]}ct==="data"||Math.max.apply(null,Oe)/Math.min.apply(null,Oe)<=4?vt=Oe:vt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");ve.aspectratio.x=ce.aspectratio.x=vt[0],ve.aspectratio.y=ce.aspectratio.y=vt[1],ve.aspectratio.z=ce.aspectratio.z=vt[2],F.glplot.setAspectratio(ve.aspectratio),F.viewInitial.aspectratio||(F.viewInitial.aspectratio={x:ve.aspectratio.x,y:ve.aspectratio.y,z:ve.aspectratio.z}),F.viewInitial.aspectmode||(F.viewInitial.aspectmode=ve.aspectmode);var nt=ve.domain||null,xt=V._size||null;if(nt&&xt){var ut=F.container.style;ut.position="absolute",ut.left=xt.l+nt.x[0]*xt.w+"px",ut.top=xt.t+(1-nt.y[1])*xt.h+"px",ut.width=xt.w*(nt.x[1]-nt.x[0])+"px",ut.height=xt.h*(nt.y[1]-nt.y[0])+"px"}F.glplot.redraw()}},E.destroy=function(){var U=this;U.glplot&&(U.camera.mouseListener.enabled=!1,U.container.removeEventListener("wheel",U.camera.wheelListener),U.camera=null,U.glplot.dispose(),U.container.parentNode.removeChild(U.container),U.glplot=null)};function C(U){return[[U.eye.x,U.eye.y,U.eye.z],[U.center.x,U.center.y,U.center.z],[U.up.x,U.up.y,U.up.z]]}function T(U){return{up:{x:U.up[0],y:U.up[1],z:U.up[2]},center:{x:U.center[0],y:U.center[1],z:U.center[2]},eye:{x:U.eye[0],y:U.eye[1],z:U.eye[2]},projection:{type:U._ortho===!0?"orthographic":"perspective"}}}E.getCamera=function(){var U=this;return U.camera.view.recalcMatrix(U.camera.view.lastT()),T(U.camera)},E.setViewport=function(U){var V=this,W=U.camera;V.camera.lookAt.apply(this,C(W)),V.glplot.setAspectratio(U.aspectratio);var F=W.projection.type==="orthographic",H=V.camera._ortho;F!==H&&(V.glplot.redraw(),V.glplot.clearRGBA(),V.glplot.dispose(),V.initializeGLPlot())},E.isCameraChanged=function(U){var V=this,W=V.getCamera(),F=a.nestedProperty(U,V.id+".camera"),H=F.get();function q(be,ve,ce,re){var ge=["up","center","eye"],ne=["x","y","z"];return ve[ge[ce]]&&be[ge[ce]][ne[re]]===ve[ge[ce]][ne[re]]}var G=!1;if(H===void 0)G=!0;else{for(var ee=0;ee<3;ee++)for(var he=0;he<3;he++)if(!q(W,H,ee,he)){G=!0;break}(!H.projection||W.projection&&W.projection.type!==H.projection.type)&&(G=!0)}return G},E.isAspectChanged=function(U){var V=this,W=V.glplot.getAspectratio(),F=a.nestedProperty(U,V.id+".aspectratio"),H=F.get();return H===void 0||H.x!==W.x||H.y!==W.y||H.z!==W.z},E.saveLayout=function(U){var V=this,W=V.fullLayout,F,H,q,G,ee,he,be=V.isCameraChanged(U),ve=V.isAspectChanged(U),ce=be||ve;if(ce){var re={};if(be&&(F=V.getCamera(),H=a.nestedProperty(U,V.id+".camera"),q=H.get(),re[V.id+".camera"]=q),ve&&(G=V.glplot.getAspectratio(),ee=a.nestedProperty(U,V.id+".aspectratio"),he=ee.get(),re[V.id+".aspectratio"]=he),n.call("_storeDirectGUIEdit",U,W._preGUI,re),be){H.set(F);var ge=a.nestedProperty(W,V.id+".camera");ge.set(F)}if(ve){ee.set(G);var ne=a.nestedProperty(W,V.id+".aspectratio");ne.set(G),V.glplot.redraw()}}return ce},E.updateFx=function(U,V){var W=this,F=W.camera;if(F)if(U==="orbit")F.mode="orbit",F.keyBindingMode="rotate";else if(U==="turntable"){F.up=[0,0,1],F.mode="turntable",F.keyBindingMode="rotate";var H=W.graphDiv,q=H._fullLayout,G=W.fullSceneLayout.camera,ee=G.up.x,he=G.up.y,be=G.up.z;if(be/Math.sqrt(ee*ee+he*he+be*be)<.999){var ve=W.id+".camera.up",ce={x:0,y:0,z:1},re={};re[ve]=ce;var ge=H.layout;n.call("_storeDirectGUIEdit",ge,q._preGUI,re),G.up=ce,a.nestedProperty(ge,ve).set(ce)}}else F.keyBindingMode=U;W.fullSceneLayout.hovermode=V};function N(U,V,W){for(var F=0,H=W-1;F0)for(var ee=255/G,he=0;he<3;++he)U[q+he]=Math.min(ee*U[q+he],255)}}E.toImage=function(U){var V=this;U||(U="png"),V.staticMode&&V.container.appendChild(f),V.glplot.redraw();var W=V.glplot.gl,F=W.drawingBufferWidth,H=W.drawingBufferHeight;W.bindFramebuffer(W.FRAMEBUFFER,null);var q=new Uint8Array(F*H*4);W.readPixels(0,0,F,H,W.RGBA,W.UNSIGNED_BYTE,q),N(q,F,H),B(q,F,H);var G=document.createElement("canvas");G.width=F,G.height=H;var ee=G.getContext("2d",{willReadFrequently:!0}),he=ee.createImageData(F,H);he.data.set(q),ee.putImageData(he,0,0);var be;switch(U){case"jpeg":be=G.toDataURL("image/jpeg");break;case"webp":be=G.toDataURL("image/webp");break;default:be=G.toDataURL("image/png")}return V.staticMode&&V.container.removeChild(f),be},E.setConvert=function(){for(var U=this,V=0;V<3;V++){var W=U.fullSceneLayout[M[V]];o.setConvert(W,U.fullLayout),W.setScale=a.noop}},E.make4thDimension=function(){var U=this,V=U.graphDiv,W=V._fullLayout;U._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(U._mockAxis,W)},Y.exports=D}),EY=ze((te,Y)=>{Y.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}),nD=ze((te,Y)=>{var d=Xi(),y=Gd(),z=nn().extendFlat,P=oh().overrideAll;Y.exports=P({visible:y.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:y.color,categoryorder:y.categoryorder,categoryarray:y.categoryarray,title:{text:y.title.text,font:y.title.font},type:z({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorange:y.autorange,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},rangemode:y.rangemode,minallowed:y.minallowed,maxallowed:y.maxallowed,range:z({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,mirror:y.mirror,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,tickfont:y.tickfont,tickangle:y.tickangle,tickprefix:y.tickprefix,showtickprefix:y.showtickprefix,ticksuffix:y.ticksuffix,showticksuffix:y.showticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickformat:y.tickformat,tickformatstops:y.tickformatstops,hoverformat:y.hoverformat,showline:y.showline,linecolor:y.linecolor,linewidth:y.linewidth,showgrid:y.showgrid,gridcolor:z({},y.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:y.gridwidth,zeroline:y.zeroline,zerolinecolor:y.zerolinecolor,zerolinewidth:y.zerolinewidth},"plot","from-root")}),aD=ze((te,Y)=>{var d=nD(),y=Xh().attributes,z=nn().extendFlat,P=ji().counterRegex;function i(n,a,l){return{x:{valType:"number",dflt:n,editType:"camera"},y:{valType:"number",dflt:a,editType:"camera"},z:{valType:"number",dflt:l,editType:"camera"},editType:"camera"}}Y.exports={_arrayAttrRegexps:[P("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:z(i(0,0,1),{}),center:z(i(0,0,0),{}),eye:z(i(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:y({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:d,yaxis:d,zaxis:d,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}),LY=ze((te,Y)=>{var d=ln().mix,y=ji(),z=ku(),P=nD(),i=l0(),n=db(),a=["xaxis","yaxis","zaxis"],l=13600/187;Y.exports=function(o,u,s){var h,m;function b(A,f){return y.coerce(h,m,P,A,f)}for(var x=0;x{var d=ji(),y=Xi(),z=as(),P=z_(),i=LY(),n=aD(),a=Ed().getSubplotData,l="gl3d";Y.exports=function(u,s,h){var m=s._basePlotModules.length>1;function b(x){if(!m){var _=d.validate(u[x],n[x]);if(_)return u[x]}}P(u,s,h,{type:l,attributes:n,handleDefaults:o,fullLayout:s,font:s.font,fullData:h,getDfltFromLayout:b,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function o(u,s,h,m){for(var b=h("bgcolor"),x=y.combine(b,m.paper_bgcolor),_=["up","center","eye"],A=0;A<_.length;A++)h("camera."+_[A]+".x"),h("camera."+_[A]+".y"),h("camera."+_[A]+".z");h("camera.projection.type");var f=!!h("aspectratio.x")&&!!h("aspectratio.y")&&!!h("aspectratio.z"),k=f?"manual":"auto",w=h("aspectmode",k);f||(u.aspectratio=s.aspectratio={x:1,y:1,z:1},w==="manual"&&(s.aspectmode="auto"),u.aspectmode=s.aspectmode);var D=a(m.fullData,l,m.id);i(u,s,{font:m.font,scene:m.id,data:D,bgColor:x,calendar:m.calendar,autotypenumbersDflt:m.autotypenumbersDflt,fullLayout:m.fullLayout}),z.getComponentMethod("annotations3d","handleDefaults")(u,s,m);var E=m.getDfltFromLayout("dragmode");if(E!==!1&&!E)if(E="orbit",u.camera&&u.camera.up){var I=u.camera.up.x,M=u.camera.up.y,p=u.camera.up.z;p!==0&&(!I||!M||!p||p/Math.sqrt(I*I+M*M+p*p)>.999)&&(E="turntable")}else E="turntable";h("dragmode",E),h("hovermode",m.getDfltFromLayout("hovermode"))}}),H_=ze(te=>{var Y=oh().overrideAll,d=Xa(),y=MY(),z=Ed().getSubplotData,P=ji(),i=k0(),n="gl3d",a="scene";te.name=n,te.attr=a,te.idRoot=a,te.idRegex=te.attrRegex=P.counterRegex("scene"),te.attributes=EY(),te.layoutAttributes=aD(),te.baseLayoutAttrOverrides=Y({hoverlabel:d.hoverlabel},"plot","nested"),te.supplyLayoutDefaults=PY(),te.plot=function(l){for(var o=l._fullLayout,u=l._fullData,s=o._subplots[n],h=0;h{Y.exports={plot:xY(),attributes:rD(),markerSymbols:UC(),supplyDefaults:bY(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:wY(),moduleType:"trace",name:"scatter3d",basePlotModule:H_(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}),DY=ze((te,Y)=>{Y.exports=IY()}),T6=ze((te,Y)=>{var d=Xi(),y=Oc(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=xa(),a=nn().extendFlat,l=oh().overrideAll;function o(h){return{valType:"boolean",dflt:!1}}function u(h){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:o(),y:o(),z:o()},color:{valType:"color",dflt:d.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:d.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var s=Y.exports=l(a({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:P(),hovertemplatefallback:i(),xhoverformat:z("x"),yhoverformat:z("y"),zhoverformat:z("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},y("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:u(),y:u(),z:u()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05,description:"Represents the level that incident rays are reflected in a single direction, causing shine."},roughness:{valType:"number",min:0,max:1,dflt:.5,description:"Alters specular reflection; the rougher the surface, the wider and less contrasty the shine."},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:a({},n.hoverinfo),showlegend:a({},n.showlegend,{dflt:!1})}),"calc","nested");s.x.editType=s.y.editType=s.z.editType="calc+clearAxisTypes"}),oD=ze((te,Y)=>{var d=as(),y=ji(),z=Cc(),P=T6(),i=.1;function n(u,s){for(var h=[],m=32,b=0;b{var d=Tp();Y.exports=function(y,z){z.surfacecolor?d(y,z,{vals:z.surfacecolor,containerStr:"",cLetter:"c"}):d(y,z,{vals:z.z,containerStr:"",cLetter:"c"})}}),OY=ze((te,Y)=>{var d=Hp().gl_surface3d,y=Hp().ndarray,z=Hp().ndarray_linear_interpolate.d2,P=RS(),i=FS(),n=ji().isArrayOrTypedArray,a=cy().parseColorScale,l=uy(),o=lh().extractOpts;function u(C,T,N){this.scene=C,this.uid=N,this.surface=T,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var s=u.prototype;s.getXat=function(C,T,N,B){var U=n(this.data.x)?n(this.data.x[0])?this.data.x[T][C]:this.data.x[C]:C;return N===void 0?U:B.d2l(U,0,N)},s.getYat=function(C,T,N,B){var U=n(this.data.y)?n(this.data.y[0])?this.data.y[T][C]:this.data.y[T]:T;return N===void 0?U:B.d2l(U,0,N)},s.getZat=function(C,T,N,B){var U=this.data.z[T][C];return U===null&&this.data.connectgaps&&this.data._interpolatedZ&&(U=this.data._interpolatedZ[T][C]),N===void 0?U:B.d2l(U,0,N)},s.handlePick=function(C){if(C.object===this.surface){var T=(C.data.index[0]-1)/this.dataScaleX-1,N=(C.data.index[1]-1)/this.dataScaleY-1,B=Math.max(Math.min(Math.round(T),this.data.z[0].length-1),0),U=Math.max(Math.min(Math.round(N),this.data._ylength-1),0);C.index=[B,U],C.traceCoordinate=[this.getXat(B,U),this.getYat(B,U),this.getZat(B,U)],C.dataCoordinate=[this.getXat(B,U,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(B,U,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(B,U,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var V=0;V<3;V++){var W=C.dataCoordinate[V];W!=null&&(C.dataCoordinate[V]*=this.scene.dataScale[V])}var F=this.data.hovertext||this.data.text;return n(F)&&F[U]&&F[U][B]!==void 0?C.textLabel=F[U][B]:F?C.textLabel=F:C.textLabel="",C.data.dataCoordinate=C.dataCoordinate.slice(),this.surface.highlight(C.data),this.scene.glplot.spikes.position=C.dataCoordinate,!0}};function h(C){var T=C[0].rgb,N=C[C.length-1].rgb;return T[0]===N[0]&&T[1]===N[1]&&T[2]===N[2]&&T[3]===N[3]}var m=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function b(C,T){if(C0){N=m[B];break}return N}function A(C,T){if(!(C<1||T<1)){for(var N=x(C),B=x(T),U=1,V=0;VD;)B--,B/=_(B),B++,B1?U:1};function E(C,T,N){var B=N[8]+N[2]*T[0]+N[5]*T[1];return C[0]=(N[6]+N[0]*T[0]+N[3]*T[1])/B,C[1]=(N[7]+N[1]*T[0]+N[4]*T[1])/B,C}function I(C,T,N){return M(C,T,E,N),C}function M(C,T,N,B){for(var U=[0,0],V=C.shape[0],W=C.shape[1],F=0;F0&&this.contourStart[B]!==null&&this.contourEnd[B]!==null&&this.contourEnd[B]>this.contourStart[B]))for(T[B]=!0,U=this.contourStart[B];Uhe&&(this.minValues[q]=he),this.maxValues[q]{Y.exports={attributes:T6(),supplyDefaults:oD().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:zY(),plot:OY(),moduleType:"trace",name:"surface",basePlotModule:H_(),categories:["gl3d","2dMap","showLegend"],meta:{}}}),RY=ze((te,Y)=>{Y.exports=BY()}),Vw=ze((te,Y)=>{var d=Oc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=T6(),n=xa(),a=nn().extendFlat;Y.exports=a({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"}),hovertemplatefallback:P({editType:"calc"}),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"}},d("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:a({},i.contours.x.show,{}),color:i.contours.x.color,width:i.contours.x.width,editType:"calc"},lightposition:{x:a({},i.lightposition.x,{dflt:1e5}),y:a({},i.lightposition.y,{dflt:1e5}),z:a({},i.lightposition.z,{dflt:0}),editType:"calc"},lighting:a({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc",description:"Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry."},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc",description:"Epsilon for face normals calculation avoids math issues arising from degenerate geometry."},editType:"calc"},i.lighting),hoverinfo:a({},n.hoverinfo,{editType:"calc"}),showlegend:a({},n.showlegend,{dflt:!1})})}),$C=ze((te,Y)=>{var d=Oc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=Vw(),n=xa(),a=nn().extendFlat,l=oh().overrideAll;function o(h){return{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}}function u(h){return{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}}var s=Y.exports=l(a({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:o(),y:o(),z:o()},caps:{x:u(),y:u(),z:u()},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:z(),hovertemplatefallback:P(),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),valuehoverformat:y("value",1),showlegend:a({},n.showlegend,{dflt:!1})},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:i.opacity,lightposition:i.lightposition,lighting:i.lighting,flatshading:i.flatshading,contour:i.contour,hoverinfo:a({},n.hoverinfo)}),"calc","nested");s.flatshading.dflt=!0,s.lighting.facenormalsepsilon.dflt=0,s.x.editType=s.y.editType=s.z.editType=s.value.editType="calc+clearAxisTypes"}),sD=ze((te,Y)=>{var d=ji(),y=as(),z=$C(),P=Cc();function i(a,l,o,u){function s(h,m){return d.coerce(a,l,z,h,m)}n(a,l,o,u,s)}function n(a,l,o,u,s){var h=s("isomin"),m=s("isomax");m!=null&&h!==void 0&&h!==null&&h>m&&(l.isomin=null,l.isomax=null);var b=s("x"),x=s("y"),_=s("z"),A=s("value");if(!b||!b.length||!x||!x.length||!_||!_.length||!A||!A.length){l.visible=!1;return}var f=y.getComponentMethod("calendars","handleTraceDefaults");f(a,l,["x","y","z"],u),s("valuehoverformat"),["x","y","z"].forEach(function(E){s(E+"hoverformat");var I="caps."+E,M=s(I+".show");M&&s(I+".fill");var p="slices."+E,g=s(p+".show");g&&(s(p+".fill"),s(p+".locations"))});var k=s("spaceframe.show");k&&s("spaceframe.fill");var w=s("surface.show");w&&(s("surface.count"),s("surface.fill"),s("surface.pattern"));var D=s("contour.show");D&&(s("contour.color"),s("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach(function(E){s(E)}),P(a,l,u,s,{prefix:"",cLetter:"c"}),l._length=null}Y.exports={supplyDefaults:i,supplyIsoDefaults:n}}),HC=ze((te,Y)=>{var d=ji(),y=Tp();function z(a,l){l._len=Math.min(l.u.length,l.v.length,l.w.length,l.x.length,l.y.length,l.z.length),l._u=n(l.u,l._len),l._v=n(l.v,l._len),l._w=n(l.w,l._len),l._x=n(l.x,l._len),l._y=n(l.y,l._len),l._z=n(l.z,l._len);var o=P(l);l._gridFill=o.fill,l._Xs=o.Xs,l._Ys=o.Ys,l._Zs=o.Zs,l._len=o.len;var u=0,s,h,m;l.starts&&(s=n(l.starts.x||[]),h=n(l.starts.y||[]),m=n(l.starts.z||[]),u=Math.min(s.length,h.length,m.length)),l._startsX=s||[],l._startsY=h||[],l._startsZ=m||[];var b=0,x=1/0,_;for(_=0;_1&&(g=l[s-1],T=o[s-1],B=u[s-1]),h=0;hg?"-":"+")+"x"),D=D.replace("y",(C>T?"-":"+")+"y"),D=D.replace("z",(N>B?"-":"+")+"z");var F=function(){s=0,U=[],V=[],W=[]};(!s||s{var d=Tp(),y=HC().processGrid,z=HC().filter;Y.exports=function(P,i){i._len=Math.min(i.x.length,i.y.length,i.z.length,i.value.length),i._x=z(i.x,i._len),i._y=z(i.y,i._len),i._z=z(i.z,i._len),i._value=z(i.value,i._len);var n=y(i);i._gridFill=n.fill,i._Xs=n.Xs,i._Ys=n.Ys,i._Zs=n.Zs,i._len=n.len;for(var a=1/0,l=-1/0,o=0;o{Y.exports=function(d,y,z,P){P=P||d.length;for(var i=new Array(P),n=0;n{var d=Hp().gl_mesh3d,y=cy().parseColorScale,z=ji().isArrayOrTypedArray,P=uy(),i=lh().extractOpts,n=Ww(),a=function(m,b){for(var x=b.length-1;x>0;x--){var _=Math.min(b[x],b[x-1]),A=Math.max(b[x],b[x-1]);if(A>_&&_-1}function me(Ot,Xe){return Ot===null?Xe:Ot}function fe(Ot,Xe,ot){be();var De=[Xe],ye=[ot];if(se>=1)De=[Xe],ye=[ot];else if(se>0){var Pe=oe(Xe,ot);De=Pe.xyzv,ye=Pe.abc}for(var He=0;He-1?ot[ht]:he(At,Wt,Yt);zr>-1?at[ht]=zr:at[ht]=ce(At,Wt,Yt,me(Ot,hr))}re(at[0],at[1],at[2])}}function Ce(Ot,Xe,ot){var De=function(ye,Pe,He){fe(Ot,[Xe[ye],Xe[Pe],Xe[He]],[ot[ye],ot[Pe],ot[He]])};De(0,1,2),De(2,3,0)}function Re(Ot,Xe,ot){var De=function(ye,Pe,He){fe(Ot,[Xe[ye],Xe[Pe],Xe[He]],[ot[ye],ot[Pe],ot[He]])};De(0,1,2),De(3,0,1),De(2,3,0),De(1,2,3)}function Be(Ot,Xe,ot,De){var ye=Ot[3];yeDe&&(ye=De);for(var Pe=(Ot[3]-ye)/(Ot[3]-Xe[3]+1e-9),He=[],at=0;at<4;at++)He[at]=(1-Pe)*Ot[at]+Pe*Xe[at];return He}function Ze(Ot,Xe,ot){return Ot>=Xe&&Ot<=ot}function Ge(Ot){var Xe=.001*(F-W);return Ot>=W-Xe&&Ot<=F+Xe}function tt(Ot){for(var Xe=[],ot=0;ot<4;ot++){var De=Ot[ot];Xe.push([m._x[De],m._y[De],m._z[De],m._value[De]])}return Xe}var _t=3;function mt(Ot,Xe,ot,De,ye,Pe){Pe||(Pe=1),ot=[-1,-1,-1];var He=!1,at=[Ze(Xe[0][3],De,ye),Ze(Xe[1][3],De,ye),Ze(Xe[2][3],De,ye)];if(!at[0]&&!at[1]&&!at[2])return!1;var ht=function(Wt,Yt,hr){return Ge(Yt[0][3])&&Ge(Yt[1][3])&&Ge(Yt[2][3])?(fe(Wt,Yt,hr),!0):Pe<_t?mt(Wt,Yt,hr,W,F,++Pe):!1};if(at[0]&&at[1]&&at[2])return ht(Ot,Xe,ot)||He;var At=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach(function(Wt){if(at[Wt[0]]&&at[Wt[1]]&&!at[Wt[2]]){var Yt=Xe[Wt[0]],hr=Xe[Wt[1]],zr=Xe[Wt[2]],Dr=Be(zr,Yt,De,ye),br=Be(zr,hr,De,ye);He=ht(Ot,[br,Dr,Yt],[-1,-1,ot[Wt[0]]])||He,He=ht(Ot,[Yt,hr,br],[ot[Wt[0]],ot[Wt[1]],-1])||He,At=!0}}),At||[[0,1,2],[1,2,0],[2,0,1]].forEach(function(Wt){if(at[Wt[0]]&&!at[Wt[1]]&&!at[Wt[2]]){var Yt=Xe[Wt[0]],hr=Xe[Wt[1]],zr=Xe[Wt[2]],Dr=Be(hr,Yt,De,ye),br=Be(zr,Yt,De,ye);He=ht(Ot,[br,Dr,Yt],[-1,-1,ot[Wt[0]]])||He,At=!0}}),He}function vt(Ot,Xe,ot,De){var ye=!1,Pe=tt(Xe),He=[Ze(Pe[0][3],ot,De),Ze(Pe[1][3],ot,De),Ze(Pe[2][3],ot,De),Ze(Pe[3][3],ot,De)];if(!He[0]&&!He[1]&&!He[2]&&!He[3])return ye;if(He[0]&&He[1]&&He[2]&&He[3])return k&&(ye=Re(Ot,Pe,Xe)||ye),ye;var at=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach(function(ht){if(He[ht[0]]&&He[ht[1]]&&He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Yt=Pe[ht[2]],hr=Pe[ht[3]];if(k)ye=fe(Ot,[At,Wt,Yt],[Xe[ht[0]],Xe[ht[1]],Xe[ht[2]]])||ye;else{var zr=Be(hr,At,ot,De),Dr=Be(hr,Wt,ot,De),br=Be(hr,Yt,ot,De);ye=fe(null,[zr,Dr,br],[-1,-1,-1])||ye}at=!0}}),at||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach(function(ht){if(He[ht[0]]&&He[ht[1]]&&!He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Yt=Pe[ht[2]],hr=Pe[ht[3]],zr=Be(Yt,At,ot,De),Dr=Be(Yt,Wt,ot,De),br=Be(hr,Wt,ot,De),fi=Be(hr,At,ot,De);k?(ye=fe(Ot,[At,fi,zr],[Xe[ht[0]],-1,-1])||ye,ye=fe(Ot,[Wt,Dr,br],[Xe[ht[1]],-1,-1])||ye):ye=Ce(null,[zr,Dr,br,fi],[-1,-1,-1,-1])||ye,at=!0}}),at)||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach(function(ht){if(He[ht[0]]&&!He[ht[1]]&&!He[ht[2]]&&!He[ht[3]]){var At=Pe[ht[0]],Wt=Pe[ht[1]],Yt=Pe[ht[2]],hr=Pe[ht[3]],zr=Be(Wt,At,ot,De),Dr=Be(Yt,At,ot,De),br=Be(hr,At,ot,De);k?(ye=fe(Ot,[At,zr,Dr],[Xe[ht[0]],-1,-1])||ye,ye=fe(Ot,[At,Dr,br],[Xe[ht[0]],-1,-1])||ye,ye=fe(Ot,[At,br,zr],[Xe[ht[0]],-1,-1])||ye):ye=fe(null,[zr,Dr,br],[-1,-1,-1])||ye,at=!0}}),ye}function ct(Ot,Xe,ot,De,ye,Pe,He,at,ht,At,Wt){var Yt=!1;return f&&(J(Ot,"A")&&(Yt=vt(null,[Xe,ot,De,Pe],At,Wt)||Yt),J(Ot,"B")&&(Yt=vt(null,[ot,De,ye,ht],At,Wt)||Yt),J(Ot,"C")&&(Yt=vt(null,[ot,Pe,He,ht],At,Wt)||Yt),J(Ot,"D")&&(Yt=vt(null,[De,Pe,at,ht],At,Wt)||Yt),J(Ot,"E")&&(Yt=vt(null,[ot,De,Pe,ht],At,Wt)||Yt)),k&&(Yt=vt(Ot,[ot,De,Pe,ht],At,Wt)||Yt),Yt}function Ae(Ot,Xe,ot,De,ye,Pe,He,at){return[at[0]===!0?!0:mt(Ot,tt([Xe,ot,De]),[Xe,ot,De],Pe,He),at[1]===!0?!0:mt(Ot,tt([De,ye,Xe]),[De,ye,Xe],Pe,He)]}function Oe(Ot,Xe,ot,De,ye,Pe,He,at,ht){return at?Ae(Ot,Xe,ot,ye,De,Pe,He,ht):Ae(Ot,ot,ye,De,Xe,Pe,He,ht)}function Le(Ot,Xe,ot,De,ye,Pe,He){var at=!1,ht,At,Wt,Yt,hr=function(){at=mt(Ot,[ht,At,Wt],[-1,-1,-1],ye,Pe)||at,at=mt(Ot,[Wt,Yt,ht],[-1,-1,-1],ye,Pe)||at},zr=He[0],Dr=He[1],br=He[2];return zr&&(ht=ne(tt([B(Xe,ot-0,De-0)])[0],tt([B(Xe-1,ot-0,De-0)])[0],zr),At=ne(tt([B(Xe,ot-0,De-1)])[0],tt([B(Xe-1,ot-0,De-1)])[0],zr),Wt=ne(tt([B(Xe,ot-1,De-1)])[0],tt([B(Xe-1,ot-1,De-1)])[0],zr),Yt=ne(tt([B(Xe,ot-1,De-0)])[0],tt([B(Xe-1,ot-1,De-0)])[0],zr),hr()),Dr&&(ht=ne(tt([B(Xe-0,ot,De-0)])[0],tt([B(Xe-0,ot-1,De-0)])[0],Dr),At=ne(tt([B(Xe-0,ot,De-1)])[0],tt([B(Xe-0,ot-1,De-1)])[0],Dr),Wt=ne(tt([B(Xe-1,ot,De-1)])[0],tt([B(Xe-1,ot-1,De-1)])[0],Dr),Yt=ne(tt([B(Xe-1,ot,De-0)])[0],tt([B(Xe-1,ot-1,De-0)])[0],Dr),hr()),br&&(ht=ne(tt([B(Xe-0,ot-0,De)])[0],tt([B(Xe-0,ot-0,De-1)])[0],br),At=ne(tt([B(Xe-0,ot-1,De)])[0],tt([B(Xe-0,ot-1,De-1)])[0],br),Wt=ne(tt([B(Xe-1,ot-1,De)])[0],tt([B(Xe-1,ot-1,De-1)])[0],br),Yt=ne(tt([B(Xe-1,ot-0,De)])[0],tt([B(Xe-1,ot-0,De-1)])[0],br),hr()),at}function nt(Ot,Xe,ot,De,ye,Pe,He,at,ht,At,Wt,Yt){var hr=Ot;return Yt?(f&&Ot==="even"&&(hr=null),ct(hr,Xe,ot,De,ye,Pe,He,at,ht,At,Wt)):(f&&Ot==="odd"&&(hr=null),ct(hr,ht,at,He,Pe,ye,De,ot,Xe,At,Wt))}function xt(Ot,Xe,ot,De,ye){for(var Pe=[],He=0,at=0;atat?[U,Pe]:[Pe,V];vr(Xe,ht[0],ht[1])}}var At=[[Math.min(W,V),Math.max(W,V)],[Math.min(U,F),Math.max(U,F)]];["x","y","z"].forEach(function(Wt){for(var Yt=[],hr=0;hr0&&(cn.push(Sn.id),Wt==="x"?yn.push([Sn.distRatio,0,0]):Wt==="y"?yn.push([0,Sn.distRatio,0]):yn.push([0,0,Sn.distRatio]))}else Wt==="x"?un=Lr(1,g-1):Wt==="y"?un=Lr(1,C-1):un=Lr(1,T-1);cn.length>0&&(Wt==="x"?Yt[zr]=mr(Ot,cn,Dr,br,yn,Yt[zr]):Wt==="y"?Yt[zr]=Yr(Ot,cn,Dr,br,yn,Yt[zr]):Yt[zr]=ii(Ot,cn,Dr,br,yn,Yt[zr]),zr++),un.length>0&&(Wt==="x"?Yt[zr]=xt(Ot,un,Dr,br,Yt[zr]):Wt==="y"?Yt[zr]=ut(Ot,un,Dr,br,Yt[zr]):Yt[zr]=Et(Ot,un,Dr,br,Yt[zr]),zr++)}var dn=m.caps[Wt];dn.show&&dn.fill&&(_e(dn.fill),Wt==="x"?Yt[zr]=xt(Ot,[0,g-1],Dr,br,Yt[zr]):Wt==="y"?Yt[zr]=ut(Ot,[0,C-1],Dr,br,Yt[zr]):Yt[zr]=Et(Ot,[0,T-1],Dr,br,Yt[zr]),zr++)}}),w===0&&ve(),m._meshX=H,m._meshY=q,m._meshZ=G,m._meshIntensity=ee,m._Xs=I,m._Ys=M,m._Zs=p}return vi(),m}function h(m,b){var x=m.glplot.gl,_=d({gl:x}),A=new l(m,_,b.uid);return _._trace=A,A.update(b),m.glplot.add(_),A}Y.exports={findNearestOnAxis:a,generateIsoMeshes:s,createIsosurfaceTrace:h}}),FY=ze((te,Y)=>{Y.exports={attributes:$C(),supplyDefaults:sD().supplyDefaults,calc:lD(),colorbar:{min:"cmin",max:"cmax"},plot:VC().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:H_(),categories:["gl3d","showLegend"],meta:{}}}),NY=ze((te,Y)=>{Y.exports=FY()}),uD=ze((te,Y)=>{var d=Oc(),y=$C(),z=T6(),P=xa(),i=nn().extendFlat,n=oh().overrideAll,a=Y.exports=n(i({x:y.x,y:y.y,z:y.z,value:y.value,isomin:y.isomin,isomax:y.isomax,surface:y.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:y.slices,caps:y.caps,text:y.text,hovertext:y.hovertext,xhoverformat:y.xhoverformat,yhoverformat:y.yhoverformat,zhoverformat:y.zhoverformat,valuehoverformat:y.valuehoverformat,hovertemplate:y.hovertemplate,hovertemplatefallback:y.hovertemplatefallback},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:y.colorbar,opacity:y.opacity,opacityscale:z.opacityscale,lightposition:y.lightposition,lighting:y.lighting,flatshading:y.flatshading,contour:y.contour,hoverinfo:i({},P.hoverinfo),showlegend:i({},P.showlegend,{dflt:!1})}),"calc","nested");a.x.editType=a.y.editType=a.z.editType=a.value.editType="calc+clearAxisTypes"}),jY=ze((te,Y)=>{var d=ji(),y=uD(),z=sD().supplyIsoDefaults,P=oD().opacityscaleDefaults;Y.exports=function(i,n,a,l){function o(u,s){return d.coerce(i,n,y,u,s)}z(i,n,a,l,o),P(i,n,l,o)}}),UY=ze((te,Y)=>{var d=Hp().gl_mesh3d,y=cy().parseColorScale,z=ji().isArrayOrTypedArray,P=uy(),i=lh().extractOpts,n=Ww(),a=VC().findNearestOnAxis,l=VC().generateIsoMeshes;function o(h,m,b){this.scene=h,this.uid=b,this.mesh=m,this.name="",this.data=null,this.showContour=!1}var u=o.prototype;u.handlePick=function(h){if(h.object===this.mesh){var m=h.data.index,b=this.data._meshX[m],x=this.data._meshY[m],_=this.data._meshZ[m],A=this.data._Ys.length,f=this.data._Zs.length,k=a(b,this.data._Xs).id,w=a(x,this.data._Ys).id,D=a(_,this.data._Zs).id,E=h.index=D+f*w+f*A*k;h.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var I=this.data.hovertext||this.data.text;return z(I)&&I[E]!==void 0?h.textLabel=I[E]:I&&(h.textLabel=I),!0}},u.update=function(h){var m=this.scene,b=m.fullSceneLayout;this.data=l(h);function x(w,D,E,I){return D.map(function(M){return w.d2l(M,0,I)*E})}var _=n(x(b.xaxis,h._meshX,m.dataScale[0],h.xcalendar),x(b.yaxis,h._meshY,m.dataScale[1],h.ycalendar),x(b.zaxis,h._meshZ,m.dataScale[2],h.zcalendar)),A=n(h._meshI,h._meshJ,h._meshK),f={positions:_,cells:A,lightPosition:[h.lightposition.x,h.lightposition.y,h.lightposition.z],ambient:h.lighting.ambient,diffuse:h.lighting.diffuse,specular:h.lighting.specular,roughness:h.lighting.roughness,fresnel:h.lighting.fresnel,vertexNormalsEpsilon:h.lighting.vertexnormalsepsilon,faceNormalsEpsilon:h.lighting.facenormalsepsilon,opacity:h.opacity,opacityscale:h.opacityscale,contourEnable:h.contour.show,contourColor:P(h.contour.color).slice(0,3),contourWidth:h.contour.width,useFacetNormals:h.flatshading},k=i(h);f.vertexIntensity=h._meshIntensity,f.vertexIntensityBounds=[k.min,k.max],f.colormap=y(h),this.mesh.update(f)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function s(h,m){var b=h.glplot.gl,x=d({gl:b}),_=new o(h,x,m.uid);return x._trace=_,_.update(m),h.glplot.add(x),_}Y.exports=s}),$Y=ze((te,Y)=>{Y.exports={attributes:uD(),supplyDefaults:jY(),calc:lD(),colorbar:{min:"cmin",max:"cmax"},plot:UY(),moduleType:"trace",name:"volume",basePlotModule:H_(),categories:["gl3d","showLegend"],meta:{}}}),HY=ze((te,Y)=>{Y.exports=$Y()}),VY=ze((te,Y)=>{var d=as(),y=ji(),z=Cc(),P=Vw();Y.exports=function(i,n,a,l){function o(b,x){return y.coerce(i,n,P,b,x)}function u(b){var x=b.map(function(_){var A=o(_);return A&&y.isArrayOrTypedArray(A)?A:null});return x.every(function(_){return _&&_.length===x[0].length})&&x}var s=u(["x","y","z"]);if(!s){n.visible=!1;return}if(u(["i","j","k"]),n.i&&(!n.j||!n.k)||n.j&&(!n.k||!n.i)||n.k&&(!n.i||!n.j)){n.visible=!1;return}var h=d.getComponentMethod("calendars","handleTraceDefaults");h(i,n,["x","y","z"],l),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(b){o(b)});var m=o("contour.show");m&&(o("contour.color"),o("contour.width")),"intensity"in i?(o("intensity"),o("intensitymode"),z(i,n,l,o,{prefix:"",cLetter:"c"})):(n.showscale=!1,"facecolor"in i?o("facecolor"):"vertexcolor"in i?o("vertexcolor"):o("color",a)),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),o("xhoverformat"),o("yhoverformat"),o("zhoverformat"),n._length=null}}),WY=ze((te,Y)=>{var d=Tp();Y.exports=function(y,z){z.intensity&&d(y,z,{vals:z.intensity,containerStr:"",cLetter:"c"})}}),qY=ze((te,Y)=>{var d=Hp().gl_mesh3d,y=Hp().delaunay_triangulate,z=Hp().alpha_shape,P=Hp().convex_hull,i=cy().parseColorScale,n=ji().isArrayOrTypedArray,a=uy(),l=lh().extractOpts,o=Ww();function u(f,k,w){this.scene=f,this.uid=w,this.mesh=k,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var s=u.prototype;s.handlePick=function(f){if(f.object===this.mesh){var k=f.index=f.data.index;f.data._cellCenter?f.traceCoordinate=f.data.dataCoordinate:f.traceCoordinate=[this.data.x[k],this.data.y[k],this.data.z[k]];var w=this.data.hovertext||this.data.text;return n(w)&&w[k]!==void 0?f.textLabel=w[k]:w&&(f.textLabel=w),!0}};function h(f){for(var k=[],w=f.length,D=0;D=k-.5)return!1;return!0}s.update=function(f){var k=this.scene,w=k.fullSceneLayout;this.data=f;var D=f.x.length,E=o(m(w.xaxis,f.x,k.dataScale[0],f.xcalendar),m(w.yaxis,f.y,k.dataScale[1],f.ycalendar),m(w.zaxis,f.z,k.dataScale[2],f.zcalendar)),I;if(f.i&&f.j&&f.k){if(f.i.length!==f.j.length||f.j.length!==f.k.length||!_(f.i,D)||!_(f.j,D)||!_(f.k,D))return;I=o(b(f.i),b(f.j),b(f.k))}else f.alphahull===0?I=P(E):f.alphahull>0?I=z(f.alphahull,E):I=x(f.delaunayaxis,E);var M={positions:E,cells:I,lightPosition:[f.lightposition.x,f.lightposition.y,f.lightposition.z],ambient:f.lighting.ambient,diffuse:f.lighting.diffuse,specular:f.lighting.specular,roughness:f.lighting.roughness,fresnel:f.lighting.fresnel,vertexNormalsEpsilon:f.lighting.vertexnormalsepsilon,faceNormalsEpsilon:f.lighting.facenormalsepsilon,opacity:f.opacity,contourEnable:f.contour.show,contourColor:a(f.contour.color).slice(0,3),contourWidth:f.contour.width,useFacetNormals:f.flatshading};if(f.intensity){var p=l(f);this.color="#fff";var g=f.intensitymode;M[g+"Intensity"]=f.intensity,M[g+"IntensityBounds"]=[p.min,p.max],M.colormap=i(f)}else f.vertexcolor?(this.color=f.vertexcolor[0],M.vertexColors=h(f.vertexcolor)):f.facecolor?(this.color=f.facecolor[0],M.cellColors=h(f.facecolor)):(this.color=f.color,M.meshColor=a(f.color));this.mesh.update(M)},s.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function A(f,k){var w=f.glplot.gl,D=d({gl:w}),E=new u(f,D,k.uid);return D._trace=E,E.update(k),f.glplot.add(D),E}Y.exports=A}),GY=ze((te,Y)=>{Y.exports={attributes:Vw(),supplyDefaults:VY(),calc:WY(),colorbar:{min:"cmin",max:"cmax"},plot:qY(),moduleType:"trace",name:"mesh3d",basePlotModule:H_(),categories:["gl3d","showLegend"],meta:{}}}),ZY=ze((te,Y)=>{Y.exports=GY()}),cD=ze((te,Y)=>{var d=Oc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=Vw(),n=xa(),a=nn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["norm"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},n.showlegend,{dflt:!1})};a(l,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(u){l[u]=i[u]}),l.hoverinfo=a({},n.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),KY=ze((te,Y)=>{var d=ji(),y=Cc(),z=cD();Y.exports=function(P,i,n,a){function l(_,A){return d.coerce(P,i,z,_,A)}var o=l("u"),u=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!u||!u.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){i.visible=!1;return}var x=l("sizemode");l("sizeref",x==="raw"?1:.5),l("anchor"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,i,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),i._length=null}}),YY=ze((te,Y)=>{var d=Tp();Y.exports=function(y,z){for(var P=z.u,i=z.v,n=z.w,a=Math.min(z.x.length,z.y.length,z.z.length,P.length,i.length,n.length),l=-1/0,o=1/0,u=0;u{var d=Hp().gl_cone3d,y=Hp().gl_cone3d.createConeMesh,z=ji().simpleMap,P=cy().parseColorScale,i=lh().extractOpts,n=ji().isArrayOrTypedArray,a=Ww();function l(x,_){this.scene=x,this.uid=_,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(x){if(x.object===this.mesh){var _=x.index=x.data.index,A=this.data.x[_],f=this.data.y[_],k=this.data.z[_],w=this.data.u[_],D=this.data.v[_],E=this.data.w[_];x.traceCoordinate=[A,f,k,w,D,E,Math.sqrt(w*w+D*D+E*E)];var I=this.data.hovertext||this.data.text;return n(I)&&I[_]!==void 0?x.textLabel=I[_]:I&&(x.textLabel=I),!0}};var u={xaxis:0,yaxis:1,zaxis:2},s={tip:1,tail:0,cm:.25,center:.5},h={tip:1,tail:1,cm:.75,center:.5};function m(x,_){var A=x.fullSceneLayout,f=x.dataScale,k={};function w(p,g){var C=A[g],T=f[u[g]];return z(p,function(N){return C.d2l(N)*T})}k.vectors=a(w(_.u,"xaxis"),w(_.v,"yaxis"),w(_.w,"zaxis"),_._len),k.positions=a(w(_.x,"xaxis"),w(_.y,"yaxis"),w(_.z,"zaxis"),_._len);var D=i(_);k.colormap=P(_),k.vertexIntensityBounds=[D.min/_._normMax,D.max/_._normMax],k.coneOffset=s[_.anchor];var E=_.sizemode;E==="scaled"?k.coneSize=_.sizeref||.5:E==="absolute"?k.coneSize=_.sizeref&&_._normMax?_.sizeref/_._normMax:.5:E==="raw"&&(k.coneSize=_.sizeref),k.coneSizemode=E;var I=d(k),M=_.lightposition;return I.lightPosition=[M.x,M.y,M.z],I.ambient=_.lighting.ambient,I.diffuse=_.lighting.diffuse,I.specular=_.lighting.specular,I.roughness=_.lighting.roughness,I.fresnel=_.lighting.fresnel,I.opacity=_.opacity,_._pad=h[_.anchor]*I.vectorScale*I.coneScale*_._normMax,I}o.update=function(x){this.data=x;var _=m(this.scene,x);this.mesh.update(_)},o.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function b(x,_){var A=x.glplot.gl,f=m(x,_),k=y(A,f),w=new l(x,_.uid);return w.mesh=k,w.data=_,k._trace=w,x.glplot.add(k),w}Y.exports=b}),JY=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"cone",basePlotModule:H_(),categories:["gl3d","showLegend"],attributes:cD(),supplyDefaults:KY(),colorbar:{min:"cmin",max:"cmax"},calc:YY(),plot:XY(),eventData:function(d,y){return d.norm=y.traceCoordinate[6],d},meta:{}}}),QY=ze((te,Y)=>{Y.exports=JY()}),hD=ze((te,Y)=>{var d=Oc(),y=Sh().axisHoverFormat,{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=Vw(),n=xa(),a=nn().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),hovertemplatefallback:P({editType:"calc"}),uhoverformat:y("u",1),vhoverformat:y("v",1),whoverformat:y("w",1),xhoverformat:y("x"),yhoverformat:y("y"),zhoverformat:y("z"),showlegend:a({},n.showlegend,{dflt:!1})};a(l,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(u){l[u]=i[u]}),l.hoverinfo=a({},n.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),Y.exports=l}),eX=ze((te,Y)=>{var d=ji(),y=Cc(),z=hD();Y.exports=function(P,i,n,a){function l(x,_){return d.coerce(P,i,z,x,_)}var o=l("u"),u=l("v"),s=l("w"),h=l("x"),m=l("y"),b=l("z");if(!o||!o.length||!u||!u.length||!s||!s.length||!h||!h.length||!m||!m.length||!b||!b.length){i.visible=!1;return}l("starts.x"),l("starts.y"),l("starts.z"),l("maxdisplayed"),l("sizeref"),l("lighting.ambient"),l("lighting.diffuse"),l("lighting.specular"),l("lighting.roughness"),l("lighting.fresnel"),l("lightposition.x"),l("lightposition.y"),l("lightposition.z"),y(P,i,a,l,{prefix:"",cLetter:"c"}),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),l("uhoverformat"),l("vhoverformat"),l("whoverformat"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),i._length=null}}),tX=ze((te,Y)=>{var d=Hp().gl_streamtube3d,y=d.createTubeMesh,z=ji(),P=cy().parseColorScale,i=lh().extractOpts,n=Ww(),a={xaxis:0,yaxis:1,zaxis:2};function l(b,x){this.scene=b,this.uid=x,this.mesh=null,this.data=null}var o=l.prototype;o.handlePick=function(b){var x=this.scene.fullSceneLayout,_=this.scene.dataScale;function A(w,D){var E=x[D],I=_[a[D]];return E.l2c(w)/I}if(b.object===this.mesh){var f=b.data.position,k=b.data.velocity;return b.traceCoordinate=[A(f[0],"xaxis"),A(f[1],"yaxis"),A(f[2],"zaxis"),A(k[0],"xaxis"),A(k[1],"yaxis"),A(k[2],"zaxis"),b.data.intensity*this.data._normMax,b.data.divergence],b.textLabel=this.data.hovertext||this.data.text,!0}};function u(b){var x=b.length,_;return x>2?_=b.slice(1,x-1):x===2?_=[(b[0]+b[1])/2]:_=b,_}function s(b){var x=b.length;return x===1?[.5,.5]:[b[1]-b[0],b[x-1]-b[x-2]]}function h(b,x){var _=b.fullSceneLayout,A=b.dataScale,f=x._len,k={};function w(ce,re){var ge=_[re],ne=A[a[re]];return z.simpleMap(ce,function(se){return ge.d2l(se)*ne})}if(k.vectors=n(w(x._u,"xaxis"),w(x._v,"yaxis"),w(x._w,"zaxis"),f),!f)return{positions:[],cells:[]};var D=w(x._Xs,"xaxis"),E=w(x._Ys,"yaxis"),I=w(x._Zs,"zaxis");k.meshgrid=[D,E,I],k.gridFill=x._gridFill;var M=x._slen;if(M)k.startingPositions=n(w(x._startsX,"xaxis"),w(x._startsY,"yaxis"),w(x._startsZ,"zaxis"));else{for(var p=E[0],g=u(D),C=u(I),T=new Array(g.length*C.length),N=0,B=0;B{Y.exports={moduleType:"trace",name:"streamtube",basePlotModule:H_(),categories:["gl3d","showLegend"],attributes:hD(),supplyDefaults:eX(),colorbar:{min:"cmin",max:"cmax"},calc:HC().calc,plot:tX(),eventData:function(d,y){return d.tubex=d.x,d.tubey=d.y,d.tubez=d.z,d.tubeu=y.traceCoordinate[3],d.tubev=y.traceCoordinate[4],d.tubew=y.traceCoordinate[5],d.norm=y.traceCoordinate[6],d.divergence=y.traceCoordinate[7],delete d.x,delete d.y,delete d.z,d},meta:{}}}),iX=ze((te,Y)=>{Y.exports=rX()}),Lb=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=ff(),n=xa(),a=Oc(),l=qd().dash,o=nn().extendFlat,u=oh().overrideAll,s=i.marker,h=i.line,m=s.line;Y.exports=u({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:o({},i.mode,{dflt:"markers"}),text:o({},i.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","location","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:o({},i.hovertext,{}),textfont:i.textfont,textposition:i.textposition,line:{color:h.color,width:h.width,dash:l},connectgaps:i.connectgaps,marker:o({symbol:s.symbol,opacity:s.opacity,angle:s.angle,angleref:o({},s.angleref,{values:["previous","up","north"]}),standoff:s.standoff,size:s.size,sizeref:s.sizeref,sizemin:s.sizemin,sizemode:s.sizemode,colorbar:s.colorbar,line:o({width:m.width},a("marker.line")),gradient:s.gradient},a("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:P(),selected:i.selected,unselected:i.unselected,hoverinfo:o({},n.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),nX=ze((te,Y)=>{var d=ji(),y=Bc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=Lb(),l=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(o,u,s,h){function m(D,E){return d.coerce(o,u,a,D,E)}var b=m("locations"),x;if(b&&b.length){var _=m("geojson"),A;(typeof _=="string"&&_!==""||d.isPlainObject(_))&&(A="geojson-id");var f=m("locationmode",A);f==="country names"&&d.warn(l),f==="geojson-id"&&m("featureidkey"),x=b.length}else{var k=m("lon")||[],w=m("lat")||[];x=Math.min(k.length,w.length)}if(!x){u.visible=!1;return}u._length=x,m("text"),m("hovertext"),m("hovertemplate"),m("hovertemplatefallback"),m("mode"),y.hasMarkers(u)&&z(o,u,s,h,m,{gradient:!0}),y.hasLines(u)&&(P(o,u,s,h,m),m("connectgaps")),y.hasText(u)&&(m("texttemplate"),m("texttemplatefallback"),i(o,u,h,m)),m("fill"),u.fill!=="none"&&n(o,u,s,m),d.coerceSelectionMarkerOpacity(u,m)}}),aX=ze((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.geo]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),WC=ze((te,Y)=>{var d=Sr(),y=ei().BADNUM,z=zm(),P=de(),i=$e(),n=ji().isArrayOrTypedArray,a=ji()._;function l(o){return o&&typeof o=="string"}Y.exports=function(o,u){var s=n(u.locations),h=s?u.locations.length:u._length,m=new Array(h),b;u.geojson?b=function(w){return l(w)||d(w)}:b=l;for(var x=0;x{te.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},te.axesNames=["lonaxis","lataxis"],te.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},te.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},te.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]},antarctica:{lonaxisRange:[-180,180],lataxisRange:[-90,-60],projType:"equirectangular",projRotate:[0,0,0]},oceania:{lonaxisRange:[-180,180],lataxisRange:[-50,25],projType:"equirectangular",projRotate:[0,0,0]}},te.clipPad=.001,te.precision=.1,te.landColor="#F0DC82",te.waterColor="#3399FF",te.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},te.sphereSVG={type:"Sphere"},te.fillLayers={ocean:1,land:1,lakes:1},te.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},te.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],te.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],te.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}),fD=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.topojson=d.topojson||{}))})(te,function(d){function y(w){return w}function z(w){if(w==null)return y;var D,E,I=w.scale[0],M=w.scale[1],p=w.translate[0],g=w.translate[1];return function(C,T){T||(D=E=0);var N=2,B=C.length,U=new Array(B);for(U[0]=(D+=C[0])*I+p,U[1]=(E+=C[1])*M+g;Np&&(p=N[0]),N[1]g&&(g=N[1])}function T(N){switch(N.type){case"GeometryCollection":N.geometries.forEach(T);break;case"Point":C(N.coordinates);break;case"MultiPoint":N.coordinates.forEach(C);break}}w.arcs.forEach(function(N){for(var B=-1,U=N.length,V;++Bp&&(p=V[0]),V[1]g&&(g=V[1])});for(E in w.objects)T(w.objects[E]);return[I,M,p,g]}function i(w,D){for(var E,I=w.length,M=I-D;M<--I;)E=w[M],w[M++]=w[I],w[I]=E}function n(w,D){return typeof D=="string"&&(D=w.objects[D]),D.type==="GeometryCollection"?{type:"FeatureCollection",features:D.geometries.map(function(E){return a(w,E)})}:a(w,D)}function a(w,D){var E=D.id,I=D.bbox,M=D.properties==null?{}:D.properties,p=l(w,D);return E==null&&I==null?{type:"Feature",properties:M,geometry:p}:I==null?{type:"Feature",id:E,properties:M,geometry:p}:{type:"Feature",id:E,bbox:I,properties:M,geometry:p}}function l(w,D){var E=z(w.transform),I=w.arcs;function M(B,U){U.length&&U.pop();for(var V=I[B<0?~B:B],W=0,F=V.length;W1)I=h(w,D,E);else for(M=0,I=new Array(p=w.arcs.length);M1)for(var U=1,V=C(N[0]),W,F;UV&&(F=N[0],N[0]=N[U],N[U]=F,V=W);return N}).filter(function(T){return T.length>0})}}function _(w,D){for(var E=0,I=w.length;E>>1;w[M]=2))throw new Error("n must be ≥2");T=w.bbox||P(w);var E=T[0],I=T[1],M=T[2],p=T[3],g;D={scale:[M-E?(M-E)/(g-1):1,p-I?(p-I)/(g-1):1],translate:[E,I]}}else T=w.bbox;var C=f(D),T,N,B=w.objects,U={};function V(H){return C(H)}function W(H){var q;switch(H.type){case"GeometryCollection":q={type:"GeometryCollection",geometries:H.geometries.map(W)};break;case"Point":q={type:"Point",coordinates:V(H.coordinates)};break;case"MultiPoint":q={type:"MultiPoint",coordinates:H.coordinates.map(V)};break;default:return H}return H.id!=null&&(q.id=H.id),H.bbox!=null&&(q.bbox=H.bbox),H.properties!=null&&(q.properties=H.properties),q}function F(H){var q=0,G=1,ee=H.length,he,be=new Array(ee);for(be[0]=C(H[0],0);++q{var d=Y.exports={},y=S6().locationmodeToLayer,z=fD().feature;d.getTopojsonName=function(P){return[P.scope.replace(/ /g,"-"),"_",P.resolution.toString(),"m"].join("")},d.getTopojsonPath=function(P,i){return P+=P.endsWith("/")?"":"/",`${P}${i}.json`},d.getTopojsonFeatures=function(P,i){var n=y[P.locationmode],a=i.objects[n];return z(i,a).features}}),V_=ze(te=>{var Y=ei().BADNUM;te.calcTraceToLineCoords=function(d){for(var y=d[0].trace,z=y.connectgaps,P=[],i=[],n=0;n0&&(P.push(i),i=[])}return i.length>0&&P.push(i),P},te.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},te.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var y=new Array(d.length),z=0;z{Y.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}),GC=ze(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=63710088e-1,d={centimeters:Y*100,centimetres:Y*100,degrees:360/(2*Math.PI),feet:Y*3.28084,inches:Y*39.37,kilometers:Y/1e3,kilometres:Y/1e3,meters:Y,metres:Y,miles:Y/1609.344,millimeters:Y*1e3,millimetres:Y*1e3,nauticalmiles:Y/1852,radians:1,yards:Y*1.0936},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:29155334959812285e-23,millimeters:1e6,millimetres:1e6,yards:1.195990046};function z(B,U,V={}){let W={type:"Feature"};return(V.id===0||V.id)&&(W.id=V.id),V.bbox&&(W.bbox=V.bbox),W.properties=U||{},W.geometry=B,W}function P(B,U,V={}){switch(B){case"Point":return i(U).geometry;case"LineString":return o(U).geometry;case"Polygon":return a(U).geometry;case"MultiPoint":return m(U).geometry;case"MultiLineString":return h(U).geometry;case"MultiPolygon":return b(U).geometry;default:throw new Error(B+" is invalid")}}function i(B,U,V={}){if(!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(B[0])||!g(B[1]))throw new Error("coordinates must contain numbers");return z({type:"Point",coordinates:B},U,V)}function n(B,U,V={}){return s(B.map(W=>i(W,U)),V)}function a(B,U,V={}){for(let W of B){if(W.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(W[W.length-1].length!==W[0].length)throw new Error("First and last Position are not equivalent.");for(let F=0;Fa(W,U)),V)}function o(B,U,V={}){if(B.length<2)throw new Error("coordinates must be an array of two or more positions");return z({type:"LineString",coordinates:B},U,V)}function u(B,U,V={}){return s(B.map(W=>o(W,U)),V)}function s(B,U={}){let V={type:"FeatureCollection"};return U.id&&(V.id=U.id),U.bbox&&(V.bbox=U.bbox),V.features=B,V}function h(B,U,V={}){return z({type:"MultiLineString",coordinates:B},U,V)}function m(B,U,V={}){return z({type:"MultiPoint",coordinates:B},U,V)}function b(B,U,V={}){return z({type:"MultiPolygon",coordinates:B},U,V)}function x(B,U,V={}){return z({type:"GeometryCollection",geometries:B},U,V)}function _(B,U=0){if(U&&!(U>=0))throw new Error("precision must be a positive number");let V=Math.pow(10,U||0);return Math.round(B*V)/V}function A(B,U="kilometers"){let V=d[U];if(!V)throw new Error(U+" units is invalid");return B*V}function f(B,U="kilometers"){let V=d[U];if(!V)throw new Error(U+" units is invalid");return B/V}function k(B,U){return E(f(B,U))}function w(B){let U=B%360;return U<0&&(U+=360),U}function D(B){return B=B%360,B>180?B-360:B<-180?B+360:B}function E(B){return B%(2*Math.PI)*180/Math.PI}function I(B){return B%360*Math.PI/180}function M(B,U="kilometers",V="kilometers"){if(!(B>=0))throw new Error("length must be a positive number");return A(f(B,U),V)}function p(B,U="meters",V="kilometers"){if(!(B>=0))throw new Error("area must be a positive number");let W=y[U];if(!W)throw new Error("invalid original units");let F=y[V];if(!F)throw new Error("invalid final units");return B/W*F}function g(B){return!isNaN(B)&&B!==null&&!Array.isArray(B)}function C(B){return B!==null&&typeof B=="object"&&!Array.isArray(B)}function T(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(U=>{if(!g(U))throw new Error("bbox must only contain numbers")})}function N(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}te.areaFactors=y,te.azimuthToBearing=D,te.bearingToAzimuth=w,te.convertArea=p,te.convertLength=M,te.degreesToRadians=I,te.earthRadius=Y,te.factors=d,te.feature=z,te.featureCollection=s,te.geometry=P,te.geometryCollection=x,te.isNumber=g,te.isObject=C,te.lengthToDegrees=k,te.lengthToRadians=f,te.lineString=o,te.lineStrings=u,te.multiLineString=h,te.multiPoint=m,te.multiPolygon=b,te.point=i,te.points=n,te.polygon=a,te.polygons=l,te.radiansToDegrees=E,te.radiansToLength=A,te.round=_,te.validateBBox=T,te.validateId=N}),ZC=ze(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=GC();function d(f,k,w){if(f!==null)for(var D,E,I,M,p,g,C,T=0,N=0,B,U=f.type,V=U==="FeatureCollection",W=U==="Feature",F=V?f.features.length:1,H=0;Hg||V>C||W>T){p=N,g=D,C=V,T=W,I=0;return}var F=Y.lineString.call(void 0,[p,N],w.properties);if(k(F,D,E,W,I)===!1)return!1;I++,p=N})===!1)return!1}}})}function m(f,k,w){var D=w,E=!1;return h(f,function(I,M,p,g,C){E===!1&&w===void 0?D=I:D=k(D,I,M,p,g,C),E=!0}),D}function b(f,k){if(!f)throw new Error("geojson is required");u(f,function(w,D,E){if(w.geometry!==null){var I=w.geometry.type,M=w.geometry.coordinates;switch(I){case"LineString":if(k(w,D,E,0,0)===!1)return!1;break;case"Polygon":for(var p=0;p{Object.defineProperty(te,"__esModule",{value:!0});var Y=GC(),d=ZC();function y(o){return d.geomReduce.call(void 0,o,(u,s)=>u+z(s),0)}function z(o){let u=0,s;switch(o.type){case"Polygon":return P(o.coordinates);case"MultiPolygon":for(s=0;s0){u+=Math.abs(a(o[0]));for(let s=1;s=u?(h+2)%u:h+2],_=m[0]*n,A=b[1]*n,f=x[0]*n;s+=(f-_)*Math.sin(A),h++}return s*i}var l=y;te.area=y,te.default=l}),lX=ze(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=GC(),d=ZC();function y(P,i={}){let n=0,a=0,l=0;return d.coordEach.call(void 0,P,function(o){n+=o[0],a+=o[1],l++},!0),Y.point.call(void 0,[n/l,a/l],i.properties)}var z=y;te.centroid=y,te.default=z}),uX=ze(te=>{Object.defineProperty(te,"__esModule",{value:!0});var Y=ZC();function d(z,P={}){if(z.bbox!=null&&P.recompute!==!0)return z.bbox;let i=[1/0,1/0,-1/0,-1/0];return Y.coordEach.call(void 0,z,n=>{i[0]>n[0]&&(i[0]=n[0]),i[1]>n[1]&&(i[1]=n[1]),i[2]{var d=ri(),y=oX(),{area:z}=sX(),{centroid:P}=lX(),{bbox:i}=uX(),n=k_(),a=ns(),l=ti(),o=En(),u=Cg(),s=Object.keys(y),h={"ISO-3":n,"USA-states":n,"country names":m};function m(D){for(var E=0;E0&&U[V+1][0]<0)return V;return null}switch(M==="RUS"||M==="FJI"?g=function(U){var V;if(B(U)===null)V=U;else for(V=new Array(U.length),N=0;NV?W[F++]=[U[N][0]+360,U[N][1]]:N===V?(W[F++]=U[N],W[F++]=[U[N][0],-90]):W[F++]=U[N];var H=u.tester(W);H.pts.pop(),p.push(H)}:g=function(U){p.push(u.tester(U))},E.type){case"MultiPolygon":for(C=0;C0?H.properties.ct=f(H):H.properties.ct=[NaN,NaN],W.fIn=U,W.fOut=H,p.push(H)}else a.log(["Location",W.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete M[V]}switch(I.type){case"FeatureCollection":var N=I.features;for(g=0;gp&&(p=T,I=C)}else I=E;return P(I).geometry.coordinates}function k(D){var E=window.PlotlyGeoAssets||{},I=[];function M(N){return new Promise(function(B,U){d.json(N,function(V,W){if(V){delete E[N];var F=V.status===404?'GeoJSON at URL "'+N+'" does not exist.':"Unexpected error while fetching from "+N;return U(new Error(F))}return E[N]=W,B(W)})})}function p(N){return new Promise(function(B,U){var V=0,W=setInterval(function(){if(E[N]&&E[N]!=="pending")return clearInterval(W),B(E[N]);if(V>100)return clearInterval(W),U("Unexpected error while fetching from "+N);V++},50)})}for(var g=0;g{var d=ri(),y=Zs(),z=Xi(),P=El(),i=P.stylePoints,n=P.styleText;Y.exports=function(l,o){o&&a(l,o)};function a(l,o){var u=o[0].trace,s=o[0].node3;s.style("opacity",o[0].trace.opacity),i(s,u,l),n(s,u,l),s.selectAll("path.js-line").style("fill","none").each(function(h){var m=d.select(this),b=h.trace,x=b.line||{};m.call(z.stroke,x.color).call(y.dashLine,x.dash||"",x.width||0),b.fill!=="none"&&m.call(z.fill,b.fillcolor)})}}),pD=ze((te,Y)=>{var d=ri(),y=ji(),z=qC().getTopojsonFeatures,P=V_(),i=W_(),n=Jm().findExtremes,a=ei().BADNUM,l=yt().calcMarkerSize,o=Bc(),u=dD();function s(m,b,x){var _=b.layers.frontplot.select(".scatterlayer"),A=y.makeTraceGroups(_,x,"trace scattergeo");function f(k,w){k.lonlat[0]===a&&d.select(w).remove()}A.selectAll("*").remove(),A.each(function(k){var w=d.select(this),D=k[0].trace;if(o.hasLines(D)||D.fill!=="none"){var E=P.calcTraceToLineCoords(k),I=D.fill!=="none"?P.makePolygon(E):P.makeLine(E);w.selectAll("path.js-line").data([{geojson:I,trace:D}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}o.hasMarkers(D)&&w.selectAll("path.point").data(y.identity).enter().append("path").classed("point",!0).each(function(M){f(M,this)}),o.hasText(D)&&w.selectAll("g").data(y.identity).enter().append("g").append("text").each(function(M){f(M,this)}),u(m,k)})}function h(m,b){var x=m[0].trace,_=b[x.geo],A=_._subplot,f=x._length,k,w;if(y.isArrayOrTypedArray(x.locations)){var D=x.locationmode,E=D==="geojson-id"?i.extractTraceFeature(m):z(x,A.topojson);for(k=0;k{var d=hf(),y=ei().BADNUM,z=qu(),P=ji().fillText,i=Lb();Y.exports=function(a,l,o){var u=a.cd,s=u[0].trace,h=a.xa,m=a.ya,b=a.subplot,x=b.projection.isLonLatOverEdges,_=b.project;function A(M){var p=M.lonlat;if(p[0]===y||x(p))return 1/0;var g=_(p),C=_([l,o]),T=Math.abs(g[0]-C[0]),N=Math.abs(g[1]-C[1]),B=Math.max(3,M.mrc||0);return Math.max(Math.sqrt(T*T+N*N)-B,1-3/B)}if(d.getClosest(u,A,a),a.index!==!1){var f=u[a.index],k=f.lonlat,w=[h.c2p(k),m.c2p(k)],D=f.mrc||1;a.x0=w[0]-D,a.x1=w[0]+D,a.y0=w[1]-D,a.y1=w[1]+D,a.loc=f.loc,a.lon=k[0],a.lat=k[1];var E={};E[s.geo]={_subplot:b};var I=s._module.formatLabels(f,s,E);return a.lonLabel=I.lonLabel,a.latLabel=I.latLabel,a.color=z(s,f),a.extraText=n(s,f,a,u[0].t.labels),a.hovertemplate=s.hovertemplate,[a]}};function n(a,l,o,u){if(a.hovertemplate)return;var s=l.hi||a.hoverinfo,h=s==="all"?i.hoverinfo.flags:s.split("+"),m=h.indexOf("location")!==-1&&Array.isArray(a.locations),b=h.indexOf("lon")!==-1,x=h.indexOf("lat")!==-1,_=h.indexOf("text")!==-1,A=[];function f(k){return k+"°"}return m?A.push(l.loc):b&&x?A.push("("+f(o.latLabel)+", "+f(o.lonLabel)+")"):b?A.push(u.lon+f(o.lonLabel)):x&&A.push(u.lat+f(o.latLabel)),_&&P(l,a,A),A.join("
")}}),hX=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){d.lon=y.lon,d.lat=y.lat,d.location=y.loc?y.loc:null;var n=P[i];return n.fIn&&n.fIn.properties&&(d.properties=n.fIn.properties),d}}),fX=ze((te,Y)=>{var d=Bc(),y=ei().BADNUM;Y.exports=function(z,P){var i=z.cd,n=z.xaxis,a=z.yaxis,l=[],o=i[0].trace,u,s,h,m,b,x=!d.hasMarkers(o)&&!d.hasText(o);if(x)return[];if(P===!1)for(b=0;b{(function(d,y){y(typeof te=="object"&&typeof Y<"u"?te:d.d3=d.d3||{})})(te,function(d){function y(ne,se){return nese?1:ne>=se?0:NaN}function z(ne){return ne.length===1&&(ne=P(ne)),{left:function(se,_e,oe,J){for(oe==null&&(oe=0),J==null&&(J=se.length);oe>>1;ne(se[me],_e)<0?oe=me+1:J=me}return oe},right:function(se,_e,oe,J){for(oe==null&&(oe=0),J==null&&(J=se.length);oe>>1;ne(se[me],_e)>0?J=me:oe=me+1}return oe}}}function P(ne){return function(se,_e){return y(ne(se),_e)}}var i=z(y),n=i.right,a=i.left;function l(ne,se){se==null&&(se=o);for(var _e=0,oe=ne.length-1,J=ne[0],me=new Array(oe<0?0:oe);_ene?1:se>=ne?0:NaN}function h(ne){return ne===null?NaN:+ne}function m(ne,se){var _e=ne.length,oe=0,J=-1,me=0,fe,Ce,Re=0;if(se==null)for(;++J<_e;)isNaN(fe=h(ne[J]))||(Ce=fe-me,me+=Ce/++oe,Re+=Ce*(fe-me));else for(;++J<_e;)isNaN(fe=h(se(ne[J],J,ne)))||(Ce=fe-me,me+=Ce/++oe,Re+=Ce*(fe-me));if(oe>1)return Re/(oe-1)}function b(ne,se){var _e=m(ne,se);return _e&&Math.sqrt(_e)}function x(ne,se){var _e=ne.length,oe=-1,J,me,fe;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=fe=J;++oe<_e;)(J=ne[oe])!=null&&(me>J&&(me=J),fe=J)for(me=fe=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&(me>J&&(me=J),fe0)return[ne];if((oe=se0)for(ne=Math.ceil(ne/Ce),se=Math.floor(se/Ce),fe=new Array(me=Math.ceil(se-ne+1));++J=0?(me>=E?10:me>=I?5:me>=M?2:1)*Math.pow(10,J):-Math.pow(10,-J)/(me>=E?10:me>=I?5:me>=M?2:1)}function C(ne,se,_e){var oe=Math.abs(se-ne)/Math.max(0,_e),J=Math.pow(10,Math.floor(Math.log(oe)/Math.LN10)),me=oe/J;return me>=E?J*=10:me>=I?J*=5:me>=M&&(J*=2),seGe;)tt.pop(),--_t;var mt=new Array(_t+1),vt;for(me=0;me<=_t;++me)vt=mt[me]=[],vt.x0=me>0?tt[me-1]:Ze,vt.x1=me<_t?tt[me]:Ge;for(me=0;me=1)return+_e(ne[oe-1],oe-1,ne);var oe,J=(oe-1)*se,me=Math.floor(J),fe=+_e(ne[me],me,ne),Ce=+_e(ne[me+1],me+1,ne);return fe+(Ce-fe)*(J-me)}}function U(ne,se,_e){return ne=f.call(ne,h).sort(y),Math.ceil((_e-se)/(2*(B(ne,.75)-B(ne,.25))*Math.pow(ne.length,-1/3)))}function V(ne,se,_e){return Math.ceil((_e-se)/(3.5*b(ne)*Math.pow(ne.length,-1/3)))}function W(ne,se){var _e=ne.length,oe=-1,J,me;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=J;++oe<_e;)(J=ne[oe])!=null&&J>me&&(me=J)}else for(;++oe<_e;)if((J=se(ne[oe],oe,ne))!=null&&J>=J)for(me=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&J>me&&(me=J);return me}function F(ne,se){var _e=ne.length,oe=_e,J=-1,me,fe=0;if(se==null)for(;++J<_e;)isNaN(me=h(ne[J]))?--oe:fe+=me;else for(;++J<_e;)isNaN(me=h(se(ne[J],J,ne)))?--oe:fe+=me;if(oe)return fe/oe}function H(ne,se){var _e=ne.length,oe=-1,J,me=[];if(se==null)for(;++oe<_e;)isNaN(J=h(ne[oe]))||me.push(J);else for(;++oe<_e;)isNaN(J=h(se(ne[oe],oe,ne)))||me.push(J);return B(me.sort(y),.5)}function q(ne){for(var se=ne.length,_e,oe=-1,J=0,me,fe;++oe=0;)for(fe=ne[se],_e=fe.length;--_e>=0;)me[--J]=fe[_e];return me}function G(ne,se){var _e=ne.length,oe=-1,J,me;if(se==null){for(;++oe<_e;)if((J=ne[oe])!=null&&J>=J)for(me=J;++oe<_e;)(J=ne[oe])!=null&&me>J&&(me=J)}else for(;++oe<_e;)if((J=se(ne[oe],oe,ne))!=null&&J>=J)for(me=J;++oe<_e;)(J=se(ne[oe],oe,ne))!=null&&me>J&&(me=J);return me}function ee(ne,se){for(var _e=se.length,oe=new Array(_e);_e--;)oe[_e]=ne[se[_e]];return oe}function he(ne,se){if(_e=ne.length){var _e,oe=0,J=0,me,fe=ne[J];for(se==null&&(se=y);++oe<_e;)(se(me=ne[oe],fe)<0||se(fe,fe)!==0)&&(fe=me,J=oe);if(se(fe,fe)===0)return J}}function be(ne,se,_e){for(var oe=(_e??ne.length)-(se=se==null?0:+se),J,me;oe;)me=Math.random()*oe--|0,J=ne[oe+se],ne[oe+se]=ne[me+se],ne[me+se]=J;return ne}function ve(ne,se){var _e=ne.length,oe=-1,J,me=0;if(se==null)for(;++oe<_e;)(J=+ne[oe])&&(me+=J);else for(;++oe<_e;)(J=+se(ne[oe],oe,ne))&&(me+=J);return me}function ce(ne){if(!(me=ne.length))return[];for(var se=-1,_e=G(ne,re),oe=new Array(_e);++se<_e;)for(var J=-1,me,fe=oe[se]=new Array(me);++J{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,C6()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(){return new P}function P(){this.reset()}P.prototype={constructor:P,reset:function(){this.s=this.t=0},add:function(wr){n(i,wr,this.t),n(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new P;function n(wr,Xr,Ni){var Ai=wr.s=Xr+Ni,hn=Ai-Xr,Pn=Ai-hn;wr.t=Xr-Pn+(Ni-hn)}var a=1e-6,l=1e-12,o=Math.PI,u=o/2,s=o/4,h=o*2,m=180/o,b=o/180,x=Math.abs,_=Math.atan,A=Math.atan2,f=Math.cos,k=Math.ceil,w=Math.exp,D=Math.log,E=Math.pow,I=Math.sin,M=Math.sign||function(wr){return wr>0?1:wr<0?-1:0},p=Math.sqrt,g=Math.tan;function C(wr){return wr>1?0:wr<-1?o:Math.acos(wr)}function T(wr){return wr>1?u:wr<-1?-u:Math.asin(wr)}function N(wr){return(wr=I(wr/2))*wr}function B(){}function U(wr,Xr){wr&&W.hasOwnProperty(wr.type)&&W[wr.type](wr,Xr)}var V={Feature:function(wr,Xr){U(wr.geometry,Xr)},FeatureCollection:function(wr,Xr){for(var Ni=wr.features,Ai=-1,hn=Ni.length;++Ai=0?1:-1,hn=Ai*Ni,Pn=f(Xr),pa=I(Xr),Ea=re*pa,Ka=ce*Pn+Ea*f(hn),oo=Ea*Ai*I(hn);G.add(A(oo,Ka)),ve=wr,ce=Pn,re=pa}function J(wr){return ee.reset(),q(wr,ge),ee*2}function me(wr){return[A(wr[1],wr[0]),T(wr[2])]}function fe(wr){var Xr=wr[0],Ni=wr[1],Ai=f(Ni);return[Ai*f(Xr),Ai*I(Xr),I(Ni)]}function Ce(wr,Xr){return wr[0]*Xr[0]+wr[1]*Xr[1]+wr[2]*Xr[2]}function Re(wr,Xr){return[wr[1]*Xr[2]-wr[2]*Xr[1],wr[2]*Xr[0]-wr[0]*Xr[2],wr[0]*Xr[1]-wr[1]*Xr[0]]}function Be(wr,Xr){wr[0]+=Xr[0],wr[1]+=Xr[1],wr[2]+=Xr[2]}function Ze(wr,Xr){return[wr[0]*Xr,wr[1]*Xr,wr[2]*Xr]}function Ge(wr){var Xr=p(wr[0]*wr[0]+wr[1]*wr[1]+wr[2]*wr[2]);wr[0]/=Xr,wr[1]/=Xr,wr[2]/=Xr}var tt,_t,mt,vt,ct,Ae,Oe,Le,nt=z(),xt,ut,Et={point:Gt,lineStart:vr,lineEnd:mr,polygonStart:function(){Et.point=Yr,Et.lineStart=ii,Et.lineEnd=Lr,nt.reset(),ge.polygonStart()},polygonEnd:function(){ge.polygonEnd(),Et.point=Gt,Et.lineStart=vr,Et.lineEnd=mr,G<0?(tt=-(mt=180),_t=-(vt=90)):nt>a?vt=90:nt<-a&&(_t=-90),ut[0]=tt,ut[1]=mt},sphere:function(){tt=-(mt=180),_t=-(vt=90)}};function Gt(wr,Xr){xt.push(ut=[tt=wr,mt=wr]),Xr<_t&&(_t=Xr),Xr>vt&&(vt=Xr)}function Qt(wr,Xr){var Ni=fe([wr*b,Xr*b]);if(Le){var Ai=Re(Le,Ni),hn=[Ai[1],-Ai[0],0],Pn=Re(hn,Ai);Ge(Pn),Pn=me(Pn);var pa=wr-ct,Ea=pa>0?1:-1,Ka=Pn[0]*m*Ea,oo,wa=x(pa)>180;wa^(Ea*ctvt&&(vt=oo)):(Ka=(Ka+360)%360-180,wa^(Ea*ctvt&&(vt=Xr))),wa?wrci(tt,mt)&&(mt=wr):ci(wr,mt)>ci(tt,mt)&&(tt=wr):mt>=tt?(wrmt&&(mt=wr)):wr>ct?ci(tt,wr)>ci(tt,mt)&&(mt=wr):ci(wr,mt)>ci(tt,mt)&&(tt=wr)}else xt.push(ut=[tt=wr,mt=wr]);Xr<_t&&(_t=Xr),Xr>vt&&(vt=Xr),Le=Ni,ct=wr}function vr(){Et.point=Qt}function mr(){ut[0]=tt,ut[1]=mt,Et.point=Gt,Le=null}function Yr(wr,Xr){if(Le){var Ni=wr-ct;nt.add(x(Ni)>180?Ni+(Ni>0?360:-360):Ni)}else Ae=wr,Oe=Xr;ge.point(wr,Xr),Qt(wr,Xr)}function ii(){ge.lineStart()}function Lr(){Yr(Ae,Oe),ge.lineEnd(),x(nt)>a&&(tt=-(mt=180)),ut[0]=tt,ut[1]=mt,Le=null}function ci(wr,Xr){return(Xr-=wr)<0?Xr+360:Xr}function vi(wr,Xr){return wr[0]-Xr[0]}function Ot(wr,Xr){return wr[0]<=wr[1]?wr[0]<=Xr&&Xr<=wr[1]:Xrci(Ai[0],Ai[1])&&(Ai[1]=hn[1]),ci(hn[0],Ai[1])>ci(Ai[0],Ai[1])&&(Ai[0]=hn[0])):Pn.push(Ai=hn);for(pa=-1/0,Ni=Pn.length-1,Xr=0,Ai=Pn[Ni];Xr<=Ni;Ai=hn,++Xr)hn=Pn[Xr],(Ea=ci(Ai[1],hn[0]))>pa&&(pa=Ea,tt=hn[0],mt=Ai[1])}return xt=ut=null,tt===1/0||_t===1/0?[[NaN,NaN],[NaN,NaN]]:[[tt,_t],[mt,vt]]}var ot,De,ye,Pe,He,at,ht,At,Wt,Yt,hr,zr,Dr,br,fi,un,cn={sphere:B,point:yn,lineStart:Sn,lineEnd:na,polygonStart:function(){cn.lineStart=Kt,cn.lineEnd=lr},polygonEnd:function(){cn.lineStart=Sn,cn.lineEnd=na}};function yn(wr,Xr){wr*=b,Xr*=b;var Ni=f(Xr);Gn(Ni*f(wr),Ni*I(wr),I(Xr))}function Gn(wr,Xr,Ni){++ot,ye+=(wr-ye)/ot,Pe+=(Xr-Pe)/ot,He+=(Ni-He)/ot}function Sn(){cn.point=dn}function dn(wr,Xr){wr*=b,Xr*=b;var Ni=f(Xr);br=Ni*f(wr),fi=Ni*I(wr),un=I(Xr),cn.point=va,Gn(br,fi,un)}function va(wr,Xr){wr*=b,Xr*=b;var Ni=f(Xr),Ai=Ni*f(wr),hn=Ni*I(wr),Pn=I(Xr),pa=A(p((pa=fi*Pn-un*hn)*pa+(pa=un*Ai-br*Pn)*pa+(pa=br*hn-fi*Ai)*pa),br*Ai+fi*hn+un*Pn);De+=pa,at+=pa*(br+(br=Ai)),ht+=pa*(fi+(fi=hn)),At+=pa*(un+(un=Pn)),Gn(br,fi,un)}function na(){cn.point=yn}function Kt(){cn.point=_r}function lr(){Er(zr,Dr),cn.point=yn}function _r(wr,Xr){zr=wr,Dr=Xr,wr*=b,Xr*=b,cn.point=Er;var Ni=f(Xr);br=Ni*f(wr),fi=Ni*I(wr),un=I(Xr),Gn(br,fi,un)}function Er(wr,Xr){wr*=b,Xr*=b;var Ni=f(Xr),Ai=Ni*f(wr),hn=Ni*I(wr),Pn=I(Xr),pa=fi*Pn-un*hn,Ea=un*Ai-br*Pn,Ka=br*hn-fi*Ai,oo=p(pa*pa+Ea*Ea+Ka*Ka),wa=T(oo),Va=oo&&-wa/oo;Wt+=Va*pa,Yt+=Va*Ea,hr+=Va*Ka,De+=wa,at+=wa*(br+(br=Ai)),ht+=wa*(fi+(fi=hn)),At+=wa*(un+(un=Pn)),Gn(br,fi,un)}function di(wr){ot=De=ye=Pe=He=at=ht=At=Wt=Yt=hr=0,q(wr,cn);var Xr=Wt,Ni=Yt,Ai=hr,hn=Xr*Xr+Ni*Ni+Ai*Ai;return hno?wr+Math.round(-wr/h)*h:wr,Xr]}Hi.invert=Hi;function Ln(wr,Xr,Ni){return(wr%=h)?Xr||Ni?Ui(Kn(wr),Jn(Xr,Ni)):Kn(wr):Xr||Ni?Jn(Xr,Ni):Hi}function Fn(wr){return function(Xr,Ni){return Xr+=wr,[Xr>o?Xr-h:Xr<-o?Xr+h:Xr,Ni]}}function Kn(wr){var Xr=Fn(wr);return Xr.invert=Fn(-wr),Xr}function Jn(wr,Xr){var Ni=f(wr),Ai=I(wr),hn=f(Xr),Pn=I(Xr);function pa(Ea,Ka){var oo=f(Ka),wa=f(Ea)*oo,Va=I(Ea)*oo,Oa=I(Ka),fa=Oa*Ni+wa*Ai;return[A(Va*hn-fa*Pn,wa*Ni-Oa*Ai),T(fa*hn+Va*Pn)]}return pa.invert=function(Ea,Ka){var oo=f(Ka),wa=f(Ea)*oo,Va=I(Ea)*oo,Oa=I(Ka),fa=Oa*hn-Va*Pn;return[A(Va*hn+Oa*Pn,wa*Ni+fa*Ai),T(fa*Ni-wa*Ai)]},pa}function sa(wr){wr=Ln(wr[0]*b,wr[1]*b,wr.length>2?wr[2]*b:0);function Xr(Ni){return Ni=wr(Ni[0]*b,Ni[1]*b),Ni[0]*=m,Ni[1]*=m,Ni}return Xr.invert=function(Ni){return Ni=wr.invert(Ni[0]*b,Ni[1]*b),Ni[0]*=m,Ni[1]*=m,Ni},Xr}function Mn(wr,Xr,Ni,Ai,hn,Pn){if(Ni){var pa=f(Xr),Ea=I(Xr),Ka=Ai*Ni;hn==null?(hn=Xr+Ai*h,Pn=Xr-Ka/2):(hn=Ha(pa,hn),Pn=Ha(pa,Pn),(Ai>0?hnPn)&&(hn+=Ai*h));for(var oo,wa=hn;Ai>0?wa>Pn:wa1&&wr.push(wr.pop().concat(wr.shift()))},result:function(){var Ni=wr;return wr=[],Xr=null,Ni}}}function Rt(wr,Xr){return x(wr[0]-Xr[0])=0;--Ea)hn.point((Va=wa[Ea])[0],Va[1]);else Ai(Oa.x,Oa.p.x,-1,hn);Oa=Oa.p}Oa=Oa.o,wa=Oa.z,fa=!fa}while(!Oa.v);hn.lineEnd()}}}function si(wr){if(Xr=wr.length){for(var Xr,Ni=0,Ai=wr[0],hn;++Ni=0?1:-1,Ql=mu*Ul,gu=Ql>o,Cl=hs*ws;if(Gr.add(A(Cl*mu*I(Ql),rs*ul+Cl*f(Ql))),pa+=gu?Ul+mu*h:Ul,gu^fa>=Ni^_o>=Ni){var ec=Re(fe(Oa),fe(xs));Ge(ec);var $u=Re(Pn,ec);Ge($u);var xu=(gu^Ul>=0?-1:1)*T($u[2]);(Ai>xu||Ai===xu&&(ec[0]||ec[1]))&&(Ea+=gu^Ul>=0?1:-1)}}return(pa<-a||pa0){for(Ka||(hn.polygonStart(),Ka=!0),hn.lineStart(),ul=0;ul1&&no&2&&ws.push(ws.pop().concat(ws.shift())),wa.push(ws.filter(zt))}}return Oa}}function zt(wr){return wr.length>1}function xr(wr,Xr){return((wr=wr.x)[0]<0?wr[1]-u-a:u-wr[1])-((Xr=Xr.x)[0]<0?Xr[1]-u-a:u-Xr[1])}var Qr=xi(function(){return!0},Ri,_n,[-o,-u]);function Ri(wr){var Xr=NaN,Ni=NaN,Ai=NaN,hn;return{lineStart:function(){wr.lineStart(),hn=1},point:function(Pn,pa){var Ea=Pn>0?o:-o,Ka=x(Pn-Xr);x(Ka-o)0?u:-u),wr.point(Ai,Ni),wr.lineEnd(),wr.lineStart(),wr.point(Ea,Ni),wr.point(Pn,Ni),hn=0):Ai!==Ea&&Ka>=o&&(x(Xr-Ai)a?_((I(Xr)*(Pn=f(Ai))*I(Ni)-I(Ai)*(hn=f(Xr))*I(wr))/(hn*Pn*pa)):(Xr+Ai)/2}function _n(wr,Xr,Ni,Ai){var hn;if(wr==null)hn=Ni*u,Ai.point(-o,hn),Ai.point(0,hn),Ai.point(o,hn),Ai.point(o,0),Ai.point(o,-hn),Ai.point(0,-hn),Ai.point(-o,-hn),Ai.point(-o,0),Ai.point(-o,hn);else if(x(wr[0]-Xr[0])>a){var Pn=wr[0]0,hn=x(Xr)>a;function Pn(wa,Va,Oa,fa){Mn(fa,wr,Ni,Oa,wa,Va)}function pa(wa,Va){return f(wa)*f(Va)>Xr}function Ea(wa){var Va,Oa,fa,vo,hs;return{lineStart:function(){vo=fa=!1,hs=1},point:function(rs,ps){var xs=[rs,ps],_o,no=pa(rs,ps),ws=Ai?no?0:oo(rs,ps):no?oo(rs+(rs<0?o:-o),ps):0;if(!Va&&(vo=fa=no)&&wa.lineStart(),no!==fa&&(_o=Ka(Va,xs),(!_o||Rt(Va,_o)||Rt(xs,_o))&&(xs[2]=1)),no!==fa)hs=0,no?(wa.lineStart(),_o=Ka(xs,Va),wa.point(_o[0],_o[1])):(_o=Ka(Va,xs),wa.point(_o[0],_o[1],2),wa.lineEnd()),Va=_o;else if(hn&&Va&&Ai^no){var ul;!(ws&Oa)&&(ul=Ka(xs,Va,!0))&&(hs=0,Ai?(wa.lineStart(),wa.point(ul[0][0],ul[0][1]),wa.point(ul[1][0],ul[1][1]),wa.lineEnd()):(wa.point(ul[1][0],ul[1][1]),wa.lineEnd(),wa.lineStart(),wa.point(ul[0][0],ul[0][1],3)))}no&&(!Va||!Rt(Va,xs))&&wa.point(xs[0],xs[1]),Va=xs,fa=no,Oa=ws},lineEnd:function(){fa&&wa.lineEnd(),Va=null},clean:function(){return hs|(vo&&fa)<<1}}}function Ka(wa,Va,Oa){var fa=fe(wa),vo=fe(Va),hs=[1,0,0],rs=Re(fa,vo),ps=Ce(rs,rs),xs=rs[0],_o=ps-xs*xs;if(!_o)return!Oa&&wa;var no=Xr*ps/_o,ws=-Xr*xs/_o,ul=Re(hs,rs),Ul=Ze(hs,no),mu=Ze(rs,ws);Be(Ul,mu);var Ql=ul,gu=Ce(Ul,Ql),Cl=Ce(Ql,Ql),ec=gu*gu-Cl*(Ce(Ul,Ul)-1);if(!(ec<0)){var $u=p(ec),xu=Ze(Ql,(-gu-$u)/Cl);if(Be(xu,Ul),xu=me(xu),!Oa)return xu;var Ho=wa[0],Ds=Va[0],iu=wa[1],Wl=Va[1],Mc;Ds0^xu[1]<(x(xu[0]-Ho)o^(Ho<=xu[0]&&xu[0]<=Ds)){var th=Ze(Ql,(-gu+$u)/Cl);return Be(th,Ul),[xu,me(th)]}}}function oo(wa,Va){var Oa=Ai?wr:o-wr,fa=0;return wa<-Oa?fa|=1:wa>Oa&&(fa|=2),Va<-Oa?fa|=4:Va>Oa&&(fa|=8),fa}return xi(pa,Ea,Pn,Ai?[0,-wr]:[-o,wr-o])}function Wi(wr,Xr,Ni,Ai,hn,Pn){var pa=wr[0],Ea=wr[1],Ka=Xr[0],oo=Xr[1],wa=0,Va=1,Oa=Ka-pa,fa=oo-Ea,vo;if(vo=Ni-pa,!(!Oa&&vo>0)){if(vo/=Oa,Oa<0){if(vo0){if(vo>Va)return;vo>wa&&(wa=vo)}if(vo=hn-pa,!(!Oa&&vo<0)){if(vo/=Oa,Oa<0){if(vo>Va)return;vo>wa&&(wa=vo)}else if(Oa>0){if(vo0)){if(vo/=fa,fa<0){if(vo0){if(vo>Va)return;vo>wa&&(wa=vo)}if(vo=Pn-Ea,!(!fa&&vo<0)){if(vo/=fa,fa<0){if(vo>Va)return;vo>wa&&(wa=vo)}else if(fa>0){if(vo0&&(wr[0]=pa+wa*Oa,wr[1]=Ea+wa*fa),Va<1&&(Xr[0]=pa+Va*Oa,Xr[1]=Ea+Va*fa),!0}}}}}var pn=1e9,Ua=-pn;function ea(wr,Xr,Ni,Ai){function hn(oo,wa){return wr<=oo&&oo<=Ni&&Xr<=wa&&wa<=Ai}function Pn(oo,wa,Va,Oa){var fa=0,vo=0;if(oo==null||(fa=pa(oo,Va))!==(vo=pa(wa,Va))||Ka(oo,wa)<0^Va>0)do Oa.point(fa===0||fa===3?wr:Ni,fa>1?Ai:Xr);while((fa=(fa+Va+4)%4)!==vo);else Oa.point(wa[0],wa[1])}function pa(oo,wa){return x(oo[0]-wr)0?0:3:x(oo[0]-Ni)0?2:1:x(oo[1]-Xr)0?1:0:wa>0?3:2}function Ea(oo,wa){return Ka(oo.x,wa.x)}function Ka(oo,wa){var Va=pa(oo,1),Oa=pa(wa,1);return Va!==Oa?Va-Oa:Va===0?wa[1]-oo[1]:Va===1?oo[0]-wa[0]:Va===2?oo[1]-wa[1]:wa[0]-oo[0]}return function(oo){var wa=oo,Va=Ft(),Oa,fa,vo,hs,rs,ps,xs,_o,no,ws,ul,Ul={point:mu,lineStart:ec,lineEnd:$u,polygonStart:gu,polygonEnd:Cl};function mu(Ho,Ds){hn(Ho,Ds)&&wa.point(Ho,Ds)}function Ql(){for(var Ho=0,Ds=0,iu=fa.length;DsAi&&(Vh-Hh)*(Ai-th)>(Wu-th)*(wr-Hh)&&++Ho:Wu<=Ai&&(Vh-Hh)*(Ai-th)<(Wu-th)*(wr-Hh)&&--Ho;return Ho}function gu(){wa=Va,Oa=[],fa=[],ul=!0}function Cl(){var Ho=Ql(),Ds=ul&&Ho,iu=(Oa=y.merge(Oa)).length;(Ds||iu)&&(oo.polygonStart(),Ds&&(oo.lineStart(),Pn(null,null,1,oo),oo.lineEnd()),iu&&ai(Oa,Ea,Ho,Pn,oo),oo.polygonEnd()),wa=oo,Oa=fa=vo=null}function ec(){Ul.point=xu,fa&&fa.push(vo=[]),ws=!0,no=!1,xs=_o=NaN}function $u(){Oa&&(xu(hs,rs),ps&&no&&Va.rejoin(),Oa.push(Va.result())),Ul.point=mu,no&&wa.lineEnd()}function xu(Ho,Ds){var iu=hn(Ho,Ds);if(fa&&vo.push([Ho,Ds]),ws)hs=Ho,rs=Ds,ps=iu,ws=!1,iu&&(wa.lineStart(),wa.point(Ho,Ds));else if(iu&&no)wa.point(Ho,Ds);else{var Wl=[xs=Math.max(Ua,Math.min(pn,xs)),_o=Math.max(Ua,Math.min(pn,_o))],Mc=[Ho=Math.max(Ua,Math.min(pn,Ho)),Ds=Math.max(Ua,Math.min(pn,Ds))];Wi(Wl,Mc,wr,Xr,Ni,Ai)?(no||(wa.lineStart(),wa.point(Wl[0],Wl[1])),wa.point(Mc[0],Mc[1]),iu||wa.lineEnd(),ul=!1):iu&&(wa.lineStart(),wa.point(Ho,Ds),ul=!1)}xs=Ho,_o=Ds,no=iu}return Ul}}function fo(){var wr=0,Xr=0,Ni=960,Ai=500,hn,Pn,pa;return pa={stream:function(Ea){return hn&&Pn===Ea?hn:hn=ea(wr,Xr,Ni,Ai)(Pn=Ea)},extent:function(Ea){return arguments.length?(wr=+Ea[0][0],Xr=+Ea[0][1],Ni=+Ea[1][0],Ai=+Ea[1][1],hn=Pn=null,pa):[[wr,Xr],[Ni,Ai]]}}}var ho=z(),Vo,Ao,Wo,Wa={sphere:B,point:B,lineStart:Ts,lineEnd:B,polygonStart:B,polygonEnd:B};function Ts(){Wa.point=_l,Wa.lineEnd=fs}function fs(){Wa.point=Wa.lineEnd=B}function _l(wr,Xr){wr*=b,Xr*=b,Vo=wr,Ao=I(Xr),Wo=f(Xr),Wa.point=es}function es(wr,Xr){wr*=b,Xr*=b;var Ni=I(Xr),Ai=f(Xr),hn=x(wr-Vo),Pn=f(hn),pa=I(hn),Ea=Ai*pa,Ka=Wo*Ni-Ao*Ai*Pn,oo=Ao*Ni+Wo*Ai*Pn;ho.add(A(p(Ea*Ea+Ka*Ka),oo)),Vo=wr,Ao=Ni,Wo=Ai}function rl(wr){return ho.reset(),q(wr,Wa),+ho}var ds=[null,null],xl={type:"LineString",coordinates:ds};function sl(wr,Xr){return ds[0]=wr,ds[1]=Xr,rl(xl)}var Gl={Feature:function(wr,Xr){return Bs(wr.geometry,Xr)},FeatureCollection:function(wr,Xr){for(var Ni=wr.features,Ai=-1,hn=Ni.length;++Ai0&&(hn=sl(wr[Pn],wr[Pn-1]),hn>0&&Ni<=hn&&Ai<=hn&&(Ni+Ai-hn)*(1-Math.pow((Ni-Ai)/hn,2))a}).map(Oa)).concat(y.range(k(Pn/oo)*oo,hn,oo).filter(function(_o){return x(_o%Va)>a}).map(fa))}return ps.lines=function(){return xs().map(function(_o){return{type:"LineString",coordinates:_o}})},ps.outline=function(){return{type:"Polygon",coordinates:[vo(Ai).concat(hs(pa).slice(1),vo(Ni).reverse().slice(1),hs(Ea).reverse().slice(1))]}},ps.extent=function(_o){return arguments.length?ps.extentMajor(_o).extentMinor(_o):ps.extentMinor()},ps.extentMajor=function(_o){return arguments.length?(Ai=+_o[0][0],Ni=+_o[1][0],Ea=+_o[0][1],pa=+_o[1][1],Ai>Ni&&(_o=Ai,Ai=Ni,Ni=_o),Ea>pa&&(_o=Ea,Ea=pa,pa=_o),ps.precision(rs)):[[Ai,Ea],[Ni,pa]]},ps.extentMinor=function(_o){return arguments.length?(Xr=+_o[0][0],wr=+_o[1][0],Pn=+_o[0][1],hn=+_o[1][1],Xr>wr&&(_o=Xr,Xr=wr,wr=_o),Pn>hn&&(_o=Pn,Pn=hn,hn=_o),ps.precision(rs)):[[Xr,Pn],[wr,hn]]},ps.step=function(_o){return arguments.length?ps.stepMajor(_o).stepMinor(_o):ps.stepMinor()},ps.stepMajor=function(_o){return arguments.length?(wa=+_o[0],Va=+_o[1],ps):[wa,Va]},ps.stepMinor=function(_o){return arguments.length?(Ka=+_o[0],oo=+_o[1],ps):[Ka,oo]},ps.precision=function(_o){return arguments.length?(rs=+_o,Oa=$a(Pn,hn,90),fa=So(Xr,wr,rs),vo=$a(Ea,pa,90),hs=So(Ai,Ni,rs),ps):rs},ps.extentMajor([[-180,-90+a],[180,90-a]]).extentMinor([[-180,-80-a],[180,80+a]])}function su(){return Xs()()}function is(wr,Xr){var Ni=wr[0]*b,Ai=wr[1]*b,hn=Xr[0]*b,Pn=Xr[1]*b,pa=f(Ai),Ea=I(Ai),Ka=f(Pn),oo=I(Pn),wa=pa*f(Ni),Va=pa*I(Ni),Oa=Ka*f(hn),fa=Ka*I(hn),vo=2*T(p(N(Pn-Ai)+pa*Ka*N(hn-Ni))),hs=I(vo),rs=vo?function(ps){var xs=I(ps*=vo)/hs,_o=I(vo-ps)/hs,no=_o*wa+xs*Oa,ws=_o*Va+xs*fa,ul=_o*Ea+xs*oo;return[A(ws,no)*m,A(ul,p(no*no+ws*ws))*m]}:function(){return[Ni*m,Ai*m]};return rs.distance=vo,rs}function tu(wr){return wr}var pl=z(),Nl=z(),Gu,bo,Ps,Rs,pu={point:B,lineStart:B,lineEnd:B,polygonStart:function(){pu.lineStart=bl,pu.lineEnd=ic},polygonEnd:function(){pu.lineStart=pu.lineEnd=pu.point=B,pl.add(x(Nl)),Nl.reset()},result:function(){var wr=pl/2;return pl.reset(),wr}};function bl(){pu.point=ls}function ls(wr,Xr){pu.point=Ru,Gu=Ps=wr,bo=Rs=Xr}function Ru(wr,Xr){Nl.add(Rs*wr-Ps*Xr),Ps=wr,Rs=Xr}function ic(){Ru(Gu,bo)}var Ll=1/0,Hl=Ll,lu=-Ll,hu=lu,pc={point:Ah,lineStart:B,lineEnd:B,polygonStart:B,polygonEnd:B,result:function(){var wr=[[Ll,Hl],[lu,hu]];return lu=hu=-(Hl=Ll=1/0),wr}};function Ah(wr,Xr){wrlu&&(lu=wr),Xrhu&&(hu=Xr)}var uh=0,gh=0,td=0,Nf=0,Vl=0,Kc=0,rd=0,xc=0,mc=0,bc,vh,yu,gc,hl={point:ru,lineStart:Fh,lineEnd:Mu,polygonStart:function(){hl.lineStart=Xd,hl.lineEnd=ll},polygonEnd:function(){hl.point=ru,hl.lineStart=Fh,hl.lineEnd=Mu},result:function(){var wr=mc?[rd/mc,xc/mc]:Kc?[Nf/Kc,Vl/Kc]:td?[uh/td,gh/td]:[NaN,NaN];return uh=gh=td=Nf=Vl=Kc=rd=xc=mc=0,wr}};function ru(wr,Xr){uh+=wr,gh+=Xr,++td}function Fh(){hl.point=Uc}function Uc(wr,Xr){hl.point=Jh,ru(yu=wr,gc=Xr)}function Jh(wr,Xr){var Ni=wr-yu,Ai=Xr-gc,hn=p(Ni*Ni+Ai*Ai);Nf+=hn*(yu+wr)/2,Vl+=hn*(gc+Xr)/2,Kc+=hn,ru(yu=wr,gc=Xr)}function Mu(){hl.point=ru}function Xd(){hl.point=fp}function ll(){jl(bc,vh)}function fp(wr,Xr){hl.point=jl,ru(bc=yu=wr,vh=gc=Xr)}function jl(wr,Xr){var Ni=wr-yu,Ai=Xr-gc,hn=p(Ni*Ni+Ai*Ai);Nf+=hn*(yu+wr)/2,Vl+=hn*(gc+Xr)/2,Kc+=hn,hn=gc*wr-yu*Xr,rd+=hn*(yu+wr),xc+=hn*(gc+Xr),mc+=hn*3,ru(yu=wr,gc=Xr)}function os(wr){this._context=wr}os.prototype={_radius:4.5,pointRadius:function(wr){return this._radius=wr,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(wr,Xr){switch(this._point){case 0:{this._context.moveTo(wr,Xr),this._point=1;break}case 1:{this._context.lineTo(wr,Xr);break}default:{this._context.moveTo(wr+this._radius,Xr),this._context.arc(wr,Xr,this._radius,0,h);break}}},result:B};var _f=z(),yh,hc,id,Qh,Lf,vc={point:B,lineStart:function(){vc.point=Pd},lineEnd:function(){yh&&hd(hc,id),vc.point=B},polygonStart:function(){yh=!0},polygonEnd:function(){yh=null},result:function(){var wr=+_f;return _f.reset(),wr}};function Pd(wr,Xr){vc.point=hd,hc=Qh=wr,id=Lf=Xr}function hd(wr,Xr){Qh-=wr,Lf-=Xr,_f.add(p(Qh*Qh+Lf*Lf)),Qh=wr,Lf=Xr}function Pf(){this._string=[]}Pf.prototype={_radius:4.5,_circle:ef(4.5),pointRadius:function(wr){return(wr=+wr)!==this._radius&&(this._radius=wr,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(wr,Xr){switch(this._point){case 0:{this._string.push("M",wr,",",Xr),this._point=1;break}case 1:{this._string.push("L",wr,",",Xr);break}default:{this._circle==null&&(this._circle=ef(this._radius)),this._string.push("M",wr,",",Xr,this._circle);break}}},result:function(){if(this._string.length){var wr=this._string.join("");return this._string=[],wr}else return null}};function ef(wr){return"m0,"+wr+"a"+wr+","+wr+" 0 1,1 0,"+-2*wr+"a"+wr+","+wr+" 0 1,1 0,"+2*wr+"z"}function nd(wr,Xr){var Ni=4.5,Ai,hn;function Pn(pa){return pa&&(typeof Ni=="function"&&hn.pointRadius(+Ni.apply(this,arguments)),q(pa,Ai(hn))),hn.result()}return Pn.area=function(pa){return q(pa,Ai(pu)),pu.result()},Pn.measure=function(pa){return q(pa,Ai(vc)),vc.result()},Pn.bounds=function(pa){return q(pa,Ai(pc)),pc.result()},Pn.centroid=function(pa){return q(pa,Ai(hl)),hl.result()},Pn.projection=function(pa){return arguments.length?(Ai=pa==null?(wr=null,tu):(wr=pa).stream,Pn):wr},Pn.context=function(pa){return arguments.length?(hn=pa==null?(Xr=null,new Pf):new os(Xr=pa),typeof Ni!="function"&&hn.pointRadius(Ni),Pn):Xr},Pn.pointRadius=function(pa){return arguments.length?(Ni=typeof pa=="function"?pa:(hn.pointRadius(+pa),+pa),Pn):Ni},Pn.projection(wr).context(Xr)}function ad(wr){return{stream:_h(wr)}}function _h(wr){return function(Xr){var Ni=new fd;for(var Ai in wr)Ni[Ai]=wr[Ai];return Ni.stream=Xr,Ni}}function fd(){}fd.prototype={constructor:fd,point:function(wr,Xr){this.stream.point(wr,Xr)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Nh(wr,Xr,Ni){var Ai=wr.clipExtent&&wr.clipExtent();return wr.scale(150).translate([0,0]),Ai!=null&&wr.clipExtent(null),q(Ni,wr.stream(pc)),Xr(pc.result()),Ai!=null&&wr.clipExtent(Ai),wr}function Mh(wr,Xr,Ni){return Nh(wr,function(Ai){var hn=Xr[1][0]-Xr[0][0],Pn=Xr[1][1]-Xr[0][1],pa=Math.min(hn/(Ai[1][0]-Ai[0][0]),Pn/(Ai[1][1]-Ai[0][1])),Ea=+Xr[0][0]+(hn-pa*(Ai[1][0]+Ai[0][0]))/2,Ka=+Xr[0][1]+(Pn-pa*(Ai[1][1]+Ai[0][1]))/2;wr.scale(150*pa).translate([Ea,Ka])},Ni)}function yc(wr,Xr,Ni){return Mh(wr,[[0,0],Xr],Ni)}function df(wr,Xr,Ni){return Nh(wr,function(Ai){var hn=+Xr,Pn=hn/(Ai[1][0]-Ai[0][0]),pa=(hn-Pn*(Ai[1][0]+Ai[0][0]))/2,Ea=-Pn*Ai[0][1];wr.scale(150*Pn).translate([pa,Ea])},Ni)}function od(wr,Xr,Ni){return Nh(wr,function(Ai){var hn=+Xr,Pn=hn/(Ai[1][1]-Ai[0][1]),pa=-Pn*Ai[0][0],Ea=(hn-Pn*(Ai[1][1]+Ai[0][1]))/2;wr.scale(150*Pn).translate([pa,Ea])},Ni)}var uu=16,jf=f(30*b);function Jd(wr,Xr){return+Xr?If(wr,Xr):dd(wr)}function dd(wr){return _h({point:function(Xr,Ni){Xr=wr(Xr,Ni),this.stream.point(Xr[0],Xr[1])}})}function If(wr,Xr){function Ni(Ai,hn,Pn,pa,Ea,Ka,oo,wa,Va,Oa,fa,vo,hs,rs){var ps=oo-Ai,xs=wa-hn,_o=ps*ps+xs*xs;if(_o>4*Xr&&hs--){var no=pa+Oa,ws=Ea+fa,ul=Ka+vo,Ul=p(no*no+ws*ws+ul*ul),mu=T(ul/=Ul),Ql=x(x(ul)-1)Xr||x((ps*$u+xs*xu)/_o-.5)>.3||pa*Oa+Ea*fa+Ka*vo2?Ho[2]%360*b:0,$u()):[Ea*m,Ka*m,oo*m]},Cl.angle=function(Ho){return arguments.length?(Va=Ho%360*b,$u()):Va*m},Cl.reflectX=function(Ho){return arguments.length?(Oa=Ho?-1:1,$u()):Oa<0},Cl.reflectY=function(Ho){return arguments.length?(fa=Ho?-1:1,$u()):fa<0},Cl.precision=function(Ho){return arguments.length?(ul=Jd(Ul,ws=Ho*Ho),xu()):p(ws)},Cl.fitExtent=function(Ho,Ds){return Mh(Cl,Ho,Ds)},Cl.fitSize=function(Ho,Ds){return yc(Cl,Ho,Ds)},Cl.fitWidth=function(Ho,Ds){return df(Cl,Ho,Ds)},Cl.fitHeight=function(Ho,Ds){return od(Cl,Ho,Ds)};function $u(){var Ho=Vu(Ni,0,0,Oa,fa,Va).apply(null,Xr(Pn,pa)),Ds=(Va?Vu:md)(Ni,Ai-Ho[0],hn-Ho[1],Oa,fa,Va);return wa=Ln(Ea,Ka,oo),Ul=Ui(Xr,Ds),mu=Ui(wa,Ul),ul=Jd(Ul,ws),xu()}function xu(){return Ql=gu=null,Cl}return function(){return Xr=wr.apply(this,arguments),Cl.invert=Xr.invert&&ec,$u()}}function _u(wr){var Xr=0,Ni=o/3,Ai=tf(wr),hn=Ai(Xr,Ni);return hn.parallels=function(Pn){return arguments.length?Ai(Xr=Pn[0]*b,Ni=Pn[1]*b):[Xr*m,Ni*m]},hn}function jh(wr){var Xr=f(wr);function Ni(Ai,hn){return[Ai*Xr,I(hn)/Xr]}return Ni.invert=function(Ai,hn){return[Ai/Xr,T(hn*Xr)]},Ni}function Fc(wr,Xr){var Ni=I(wr),Ai=(Ni+I(Xr))/2;if(x(Ai)=.12&&rs<.234&&hs>=-.425&&hs<-.214?hn:rs>=.166&&rs<.234&&hs>=-.214&&hs<-.115?pa:Ni).invert(Oa)},wa.stream=function(Oa){return wr&&Xr===Oa?wr:wr=xf([Ni.stream(Xr=Oa),hn.stream(Oa),pa.stream(Oa)])},wa.precision=function(Oa){return arguments.length?(Ni.precision(Oa),hn.precision(Oa),pa.precision(Oa),Va()):Ni.precision()},wa.scale=function(Oa){return arguments.length?(Ni.scale(Oa),hn.scale(Oa*.35),pa.scale(Oa),wa.translate(Ni.translate())):Ni.scale()},wa.translate=function(Oa){if(!arguments.length)return Ni.translate();var fa=Ni.scale(),vo=+Oa[0],hs=+Oa[1];return Ai=Ni.translate(Oa).clipExtent([[vo-.455*fa,hs-.238*fa],[vo+.455*fa,hs+.238*fa]]).stream(oo),Pn=hn.translate([vo-.307*fa,hs+.201*fa]).clipExtent([[vo-.425*fa+a,hs+.12*fa+a],[vo-.214*fa-a,hs+.234*fa-a]]).stream(oo),Ea=pa.translate([vo-.205*fa,hs+.212*fa]).clipExtent([[vo-.214*fa+a,hs+.166*fa+a],[vo-.115*fa-a,hs+.234*fa-a]]).stream(oo),Va()},wa.fitExtent=function(Oa,fa){return Mh(wa,Oa,fa)},wa.fitSize=function(Oa,fa){return yc(wa,Oa,fa)},wa.fitWidth=function(Oa,fa){return df(wa,Oa,fa)},wa.fitHeight=function(Oa,fa){return od(wa,Oa,fa)};function Va(){return wr=Xr=null,wa}return wa.scale(1070)}function rf(wr){return function(Xr,Ni){var Ai=f(Xr),hn=f(Ni),Pn=wr(Ai*hn);return[Pn*hn*I(Xr),Pn*I(Ni)]}}function Uf(wr){return function(Xr,Ni){var Ai=p(Xr*Xr+Ni*Ni),hn=wr(Ai),Pn=I(hn),pa=f(hn);return[A(Xr*Pn,Ai*pa),T(Ai&&Ni*Pn/Ai)]}}var Qd=rf(function(wr){return p(2/(1+wr))});Qd.invert=Uf(function(wr){return 2*T(wr/2)});function Sp(){return Xc(Qd).scale(124.75).clipAngle(180-.001)}var bf=rf(function(wr){return(wr=C(wr))&&wr/I(wr)});bf.invert=Uf(function(wr){return wr});function $f(){return Xc(bf).scale(79.4188).clipAngle(180-.001)}function zc(wr,Xr){return[wr,D(g((u+Xr)/2))]}zc.invert=function(wr,Xr){return[wr,2*_(w(Xr))-u]};function wf(){return ch(zc).scale(961/h)}function ch(wr){var Xr=Xc(wr),Ni=Xr.center,Ai=Xr.scale,hn=Xr.translate,Pn=Xr.clipExtent,pa=null,Ea,Ka,oo;Xr.scale=function(Va){return arguments.length?(Ai(Va),wa()):Ai()},Xr.translate=function(Va){return arguments.length?(hn(Va),wa()):hn()},Xr.center=function(Va){return arguments.length?(Ni(Va),wa()):Ni()},Xr.clipExtent=function(Va){return arguments.length?(Va==null?pa=Ea=Ka=oo=null:(pa=+Va[0][0],Ea=+Va[0][1],Ka=+Va[1][0],oo=+Va[1][1]),wa()):pa==null?null:[[pa,Ea],[Ka,oo]]};function wa(){var Va=o*Ai(),Oa=Xr(sa(Xr.rotate()).invert([0,0]));return Pn(pa==null?[[Oa[0]-Va,Oa[1]-Va],[Oa[0]+Va,Oa[1]+Va]]:wr===zc?[[Math.max(Oa[0]-Va,pa),Ea],[Math.min(Oa[0]+Va,Ka),oo]]:[[pa,Math.max(Oa[1]-Va,Ea)],[Ka,Math.min(Oa[1]+Va,oo)]])}return wa()}function kf(wr){return g((u+wr)/2)}function Hf(wr,Xr){var Ni=f(wr),Ai=wr===Xr?I(wr):D(Ni/f(Xr))/D(kf(Xr)/kf(wr)),hn=Ni*E(kf(wr),Ai)/Ai;if(!Ai)return zc;function Pn(pa,Ea){hn>0?Ea<-u+a&&(Ea=-u+a):Ea>u-a&&(Ea=u-a);var Ka=hn/E(kf(Ea),Ai);return[Ka*I(Ai*pa),hn-Ka*f(Ai*pa)]}return Pn.invert=function(pa,Ea){var Ka=hn-Ea,oo=M(Ai)*p(pa*pa+Ka*Ka),wa=A(pa,x(Ka))*M(Ka);return Ka*Ai<0&&(wa-=o*M(pa)*M(Ka)),[wa/Ai,2*_(E(hn/oo,1/Ai))-u]},Pn}function Lh(){return _u(Hf).scale(109.5).parallels([30,30])}function Lu(wr,Xr){return[wr,Xr]}Lu.invert=Lu;function Uh(){return Xc(Lu).scale(152.63)}function Qc(wr,Xr){var Ni=f(wr),Ai=wr===Xr?I(wr):(Ni-f(Xr))/(Xr-wr),hn=Ni/Ai+wr;if(x(Ai)a&&--Ai>0);return[wr/(.8707+(Pn=Ni*Ni)*(-.131979+Pn*(-.013791+Pn*Pn*Pn*(.003971-.001529*Pn)))),Ni]};function Ph(){return Xc($h).scale(175.295)}function Zu(wr,Xr){return[f(Xr)*I(wr),I(Xr)]}Zu.invert=Uf(T);function fu(){return Xc(Zu).scale(249.5).clipAngle(90+a)}function Ih(wr,Xr){var Ni=f(Xr),Ai=1+f(wr)*Ni;return[Ni*I(wr)/Ai,I(Xr)/Ai]}Ih.invert=Uf(function(wr){return 2*_(wr)});function Tf(){return Xc(Ih).scale(250).clipAngle(142)}function Dh(wr,Xr){return[D(g((u+Xr)/2)),-wr]}Dh.invert=function(wr,Xr){return[-Xr,2*_(w(wr))-u]};function sd(){var wr=ch(Dh),Xr=wr.center,Ni=wr.rotate;return wr.center=function(Ai){return arguments.length?Xr([-Ai[1],Ai[0]]):(Ai=Xr(),[Ai[1],-Ai[0]])},wr.rotate=function(Ai){return arguments.length?Ni([Ai[0],Ai[1],Ai.length>2?Ai[2]+90:90]):(Ai=Ni(),[Ai[0],Ai[1],Ai[2]-90])},Ni([0,0,90]).scale(159.155)}d.geoAlbers=Eu,d.geoAlbersUsa=Eh,d.geoArea=J,d.geoAzimuthalEqualArea=Sp,d.geoAzimuthalEqualAreaRaw=Qd,d.geoAzimuthalEquidistant=$f,d.geoAzimuthalEquidistantRaw=bf,d.geoBounds=Xe,d.geoCentroid=di,d.geoCircle=io,d.geoClipAntimeridian=Qr,d.geoClipCircle=Zi,d.geoClipExtent=fo,d.geoClipRectangle=ea,d.geoConicConformal=Lh,d.geoConicConformalRaw=Hf,d.geoConicEqualArea=Jc,d.geoConicEqualAreaRaw=Fc,d.geoConicEquidistant=Id,d.geoConicEquidistantRaw=Qc,d.geoContains=Gs,d.geoDistance=sl,d.geoEqualEarth=ep,d.geoEqualEarthRaw=zf,d.geoEquirectangular=Uh,d.geoEquirectangularRaw=Lu,d.geoGnomonic=gd,d.geoGnomonicRaw=Ac,d.geoGraticule=Xs,d.geoGraticule10=su,d.geoIdentity=fh,d.geoInterpolate=is,d.geoLength=rl,d.geoMercator=wf,d.geoMercatorRaw=zc,d.geoNaturalEarth1=Ph,d.geoNaturalEarth1Raw=$h,d.geoOrthographic=fu,d.geoOrthographicRaw=Zu,d.geoPath=nd,d.geoProjection=Xc,d.geoProjectionMutator=tf,d.geoRotation=sa,d.geoStereographic=Tf,d.geoStereographicRaw=Ih,d.geoStream=q,d.geoTransform=ad,d.geoTransverseMercator=sd,d.geoTransverseMercatorRaw=Dh,Object.defineProperty(d,"__esModule",{value:!0})})}),dX=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,mD(),C6()):y(d.d3=d.d3||{},d.d3,d.d3)})(te,function(d,y,z){var P=Math.abs,i=Math.atan,n=Math.atan2,a=Math.cos,l=Math.exp,o=Math.floor,u=Math.log,s=Math.max,h=Math.min,m=Math.pow,b=Math.round,x=Math.sign||function(et){return et>0?1:et<0?-1:0},_=Math.sin,A=Math.tan,f=1e-6,k=1e-12,w=Math.PI,D=w/2,E=w/4,I=Math.SQRT1_2,M=V(2),p=V(w),g=w*2,C=180/w,T=w/180;function N(et){return et?et/Math.sin(et):1}function B(et){return et>1?D:et<-1?-D:Math.asin(et)}function U(et){return et>1?0:et<-1?w:Math.acos(et)}function V(et){return et>0?Math.sqrt(et):0}function W(et){return et=l(2*et),(et-1)/(et+1)}function F(et){return(l(et)-l(-et))/2}function H(et){return(l(et)+l(-et))/2}function q(et){return u(et+V(et*et+1))}function G(et){return u(et+V(et*et-1))}function ee(et){var lt=A(et/2),Tt=2*u(a(et/2))/(lt*lt);function Lt(Vt,Nt){var Xt=a(Vt),Pr=a(Nt),Hr=_(Nt),Zr=Pr*Xt,pi=-((1-Zr?u((1+Zr)/2)/(1-Zr):-.5)+Tt/(1+Zr));return[pi*Pr*_(Vt),pi*Hr]}return Lt.invert=function(Vt,Nt){var Xt=V(Vt*Vt+Nt*Nt),Pr=-et/2,Hr=50,Zr;if(!Xt)return[0,0];do{var pi=Pr/2,zi=a(pi),Ki=_(pi),rn=Ki/zi,kn=-u(P(zi));Pr-=Zr=(2/rn*kn-Tt*rn-Xt)/(-kn/(Ki*Ki)+1-Tt/(2*zi*zi))*(zi<0?.7:1)}while(P(Zr)>f&&--Hr>0);var Qn=_(Pr);return[n(Vt*Qn,Xt*a(Pr)),B(Nt*Qn/Xt)]},Lt}function he(){var et=D,lt=y.geoProjectionMutator(ee),Tt=lt(et);return Tt.radius=function(Lt){return arguments.length?lt(et=Lt*T):et*C},Tt.scale(179.976).clipAngle(147)}function be(et,lt){var Tt=a(lt),Lt=N(U(Tt*a(et/=2)));return[2*Tt*_(et)*Lt,_(lt)*Lt]}be.invert=function(et,lt){if(!(et*et+4*lt*lt>w*w+f)){var Tt=et,Lt=lt,Vt=25;do{var Nt=_(Tt),Xt=_(Tt/2),Pr=a(Tt/2),Hr=_(Lt),Zr=a(Lt),pi=_(2*Lt),zi=Hr*Hr,Ki=Zr*Zr,rn=Xt*Xt,kn=1-Ki*Pr*Pr,Qn=kn?U(Zr*Pr)*V(Ca=1/kn):Ca=0,Ca,Ta=2*Qn*Zr*Xt-et,Ba=Qn*Hr-lt,xo=Ca*(Ki*rn+Qn*Zr*Pr*zi),Go=Ca*(.5*Nt*pi-Qn*2*Hr*Xt),Bo=Ca*.25*(pi*Xt-Qn*Hr*Ki*Nt),_s=Ca*(zi*Pr+Qn*rn*Zr),wl=Go*Bo-_s*xo;if(!wl)break;var Al=(Ba*Go-Ta*_s)/wl,Us=(Ta*Bo-Ba*xo)/wl;Tt-=Al,Lt-=Us}while((P(Al)>f||P(Us)>f)&&--Vt>0);return[Tt,Lt]}};function ve(){return y.geoProjection(be).scale(152.63)}function ce(et){var lt=_(et),Tt=a(et),Lt=et>=0?1:-1,Vt=A(Lt*et),Nt=(1+lt-Tt)/2;function Xt(Pr,Hr){var Zr=a(Hr),pi=a(Pr/=2);return[(1+Zr)*_(Pr),(Lt*Hr>-n(pi,Vt)-.001?0:-Lt*10)+Nt+_(Hr)*Tt-(1+Zr)*lt*pi]}return Xt.invert=function(Pr,Hr){var Zr=0,pi=0,zi=50;do{var Ki=a(Zr),rn=_(Zr),kn=a(pi),Qn=_(pi),Ca=1+kn,Ta=Ca*rn-Pr,Ba=Nt+Qn*Tt-Ca*lt*Ki-Hr,xo=Ca*Ki/2,Go=-rn*Qn,Bo=lt*Ca*rn/2,_s=Tt*kn+lt*Ki*Qn,wl=Go*Bo-_s*xo,Al=(Ba*Go-Ta*_s)/wl/2,Us=(Ta*Bo-Ba*xo)/wl;P(Us)>2&&(Us/=2),Zr-=Al,pi-=Us}while((P(Al)>f||P(Us)>f)&&--zi>0);return Lt*pi>-n(a(Zr),Vt)-.001?[Zr*2,pi]:null},Xt}function re(){var et=20*T,lt=et>=0?1:-1,Tt=A(lt*et),Lt=y.geoProjectionMutator(ce),Vt=Lt(et),Nt=Vt.stream;return Vt.parallel=function(Xt){return arguments.length?(Tt=A((lt=(et=Xt*T)>=0?1:-1)*et),Lt(et)):et*C},Vt.stream=function(Xt){var Pr=Vt.rotate(),Hr=Nt(Xt),Zr=(Vt.rotate([0,0]),Nt(Xt)),pi=Vt.precision();return Vt.rotate(Pr),Hr.sphere=function(){Zr.polygonStart(),Zr.lineStart();for(var zi=lt*-180;lt*zi<180;zi+=lt*90)Zr.point(zi,lt*90);if(et)for(;lt*(zi-=3*lt*pi)>=-180;)Zr.point(zi,lt*-n(a(zi*T/2),Tt)*C);Zr.lineEnd(),Zr.polygonEnd()},Hr},Vt.scale(218.695).center([0,28.0974])}function ge(et,lt){var Tt=A(lt/2),Lt=V(1-Tt*Tt),Vt=1+Lt*a(et/=2),Nt=_(et)*Lt/Vt,Xt=Tt/Vt,Pr=Nt*Nt,Hr=Xt*Xt;return[4/3*Nt*(3+Pr-3*Hr),4/3*Xt*(3+3*Pr-Hr)]}ge.invert=function(et,lt){if(et*=3/8,lt*=3/8,!et&&P(lt)>1)return null;var Tt=et*et,Lt=lt*lt,Vt=1+Tt+Lt,Nt=V((Vt-V(Vt*Vt-4*lt*lt))/2),Xt=B(Nt)/3,Pr=Nt?G(P(lt/Nt))/3:q(P(et))/3,Hr=a(Xt),Zr=H(Pr),pi=Zr*Zr-Hr*Hr;return[x(et)*2*n(F(Pr)*Hr,.25-pi),x(lt)*2*n(Zr*_(Xt),.25+pi)]};function ne(){return y.geoProjection(ge).scale(66.1603)}var se=V(8),_e=u(1+M);function oe(et,lt){var Tt=P(lt);return Ttk&&--Lt>0);return[et/(a(Tt)*(se-1/_(Tt))),x(lt)*Tt]};function J(){return y.geoProjection(oe).scale(112.314)}function me(et){var lt=2*w/et;function Tt(Lt,Vt){var Nt=y.geoAzimuthalEquidistantRaw(Lt,Vt);if(P(Lt)>D){var Xt=n(Nt[1],Nt[0]),Pr=V(Nt[0]*Nt[0]+Nt[1]*Nt[1]),Hr=lt*b((Xt-D)/lt)+D,Zr=n(_(Xt-=Hr),2-a(Xt));Xt=Hr+B(w/Pr*_(Zr))-Zr,Nt[0]=Pr*a(Xt),Nt[1]=Pr*_(Xt)}return Nt}return Tt.invert=function(Lt,Vt){var Nt=V(Lt*Lt+Vt*Vt);if(Nt>D){var Xt=n(Vt,Lt),Pr=lt*b((Xt-D)/lt)+D,Hr=Xt>Pr?-1:1,Zr=Nt*a(Pr-Xt),pi=1/A(Hr*U((Zr-w)/V(w*(w-2*Zr)+Nt*Nt)));Xt=Pr+2*i((pi+Hr*V(pi*pi-3))/3),Lt=Nt*a(Xt),Vt=Nt*_(Xt)}return y.geoAzimuthalEquidistantRaw.invert(Lt,Vt)},Tt}function fe(){var et=5,lt=y.geoProjectionMutator(me),Tt=lt(et),Lt=Tt.stream,Vt=.01,Nt=-a(Vt*T),Xt=_(Vt*T);return Tt.lobes=function(Pr){return arguments.length?lt(et=+Pr):et},Tt.stream=function(Pr){var Hr=Tt.rotate(),Zr=Lt(Pr),pi=(Tt.rotate([0,0]),Lt(Pr));return Tt.rotate(Hr),Zr.sphere=function(){pi.polygonStart(),pi.lineStart();for(var zi=0,Ki=360/et,rn=2*w/et,kn=90-180/et,Qn=D;zi0&&P(Vt)>f);return Lt<0?NaN:Tt}function Ge(et,lt,Tt){return lt===void 0&&(lt=40),Tt===void 0&&(Tt=k),function(Lt,Vt,Nt,Xt){var Pr,Hr,Zr;Nt=Nt===void 0?0:+Nt,Xt=Xt===void 0?0:+Xt;for(var pi=0;piPr){Nt-=Hr/=2,Xt-=Zr/=2;continue}Pr=kn;var Qn=(Nt>0?-1:1)*Tt,Ca=(Xt>0?-1:1)*Tt,Ta=et(Nt+Qn,Xt),Ba=et(Nt,Xt+Ca),xo=(Ta[0]-zi[0])/Qn,Go=(Ta[1]-zi[1])/Qn,Bo=(Ba[0]-zi[0])/Ca,_s=(Ba[1]-zi[1])/Ca,wl=_s*xo-Go*Bo,Al=(P(wl)<.5?.5:1)/wl;if(Hr=(rn*Bo-Ki*_s)*Al,Zr=(Ki*Go-rn*xo)*Al,Nt+=Hr,Xt+=Zr,P(Hr)0&&(Pr[1]*=1+Hr/1.5*Pr[0]*Pr[0]),Pr}return Lt.invert=Ge(Lt),Lt}function _t(){return y.geoProjection(tt()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function mt(et,lt){var Tt=et*_(lt),Lt=30,Vt;do lt-=Vt=(lt+_(lt)-Tt)/(1+a(lt));while(P(Vt)>f&&--Lt>0);return lt/2}function vt(et,lt,Tt){function Lt(Vt,Nt){return[et*Vt*a(Nt=mt(Tt,Nt)),lt*_(Nt)]}return Lt.invert=function(Vt,Nt){return Nt=B(Nt/lt),[Vt/(et*a(Nt)),B((2*Nt+_(2*Nt))/Tt)]},Lt}var ct=vt(M/D,M,w);function Ae(){return y.geoProjection(ct).scale(169.529)}var Oe=2.00276,Le=1.11072;function nt(et,lt){var Tt=mt(w,lt);return[Oe*et/(1/a(lt)+Le/a(Tt)),(lt+M*_(Tt))/Oe]}nt.invert=function(et,lt){var Tt=Oe*lt,Lt=lt<0?-E:E,Vt=25,Nt,Xt;do Xt=Tt-M*_(Lt),Lt-=Nt=(_(2*Lt)+2*Lt-w*_(Xt))/(2*a(2*Lt)+2+w*a(Xt)*M*a(Lt));while(P(Nt)>f&&--Vt>0);return Xt=Tt-M*_(Lt),[et*(1/a(Xt)+Le/a(Lt))/Oe,Xt]};function xt(){return y.geoProjection(nt).scale(160.857)}function ut(et){var lt=0,Tt=y.geoProjectionMutator(et),Lt=Tt(lt);return Lt.parallel=function(Vt){return arguments.length?Tt(lt=Vt*T):lt*C},Lt}function Et(et,lt){return[et*a(lt),lt]}Et.invert=function(et,lt){return[et/a(lt),lt]};function Gt(){return y.geoProjection(Et).scale(152.63)}function Qt(et){if(!et)return Et;var lt=1/A(et);function Tt(Lt,Vt){var Nt=lt+et-Vt,Xt=Nt&&Lt*a(Vt)/Nt;return[Nt*_(Xt),lt-Nt*a(Xt)]}return Tt.invert=function(Lt,Vt){var Nt=V(Lt*Lt+(Vt=lt-Vt)*Vt),Xt=lt+et-Nt;return[Nt/a(Xt)*n(Lt,Vt),Xt]},Tt}function vr(){return ut(Qt).scale(123.082).center([0,26.1441]).parallel(45)}function mr(et){function lt(Tt,Lt){var Vt=D-Lt,Nt=Vt&&Tt*et*_(Vt)/Vt;return[Vt*_(Nt)/et,D-Vt*a(Nt)]}return lt.invert=function(Tt,Lt){var Vt=Tt*et,Nt=D-Lt,Xt=V(Vt*Vt+Nt*Nt),Pr=n(Vt,Nt);return[(Xt?Xt/_(Xt):1)*Pr/et,D-Xt]},lt}function Yr(){var et=.5,lt=y.geoProjectionMutator(mr),Tt=lt(et);return Tt.fraction=function(Lt){return arguments.length?lt(et=+Lt):et},Tt.scale(158.837)}var ii=vt(1,4/w,w);function Lr(){return y.geoProjection(ii).scale(152.63)}function ci(et,lt,Tt,Lt,Vt,Nt){var Xt=a(Nt),Pr;if(P(et)>1||P(Nt)>1)Pr=U(Tt*Vt+lt*Lt*Xt);else{var Hr=_(et/2),Zr=_(Nt/2);Pr=2*B(V(Hr*Hr+lt*Lt*Zr*Zr))}return P(Pr)>f?[Pr,n(Lt*_(Nt),lt*Vt-Tt*Lt*Xt)]:[0,0]}function vi(et,lt,Tt){return U((et*et+lt*lt-Tt*Tt)/(2*et*lt))}function Ot(et){return et-2*w*o((et+w)/(2*w))}function Xe(et,lt,Tt){for(var Lt=[[et[0],et[1],_(et[1]),a(et[1])],[lt[0],lt[1],_(lt[1]),a(lt[1])],[Tt[0],Tt[1],_(Tt[1]),a(Tt[1])]],Vt=Lt[2],Nt,Xt=0;Xt<3;++Xt,Vt=Nt)Nt=Lt[Xt],Vt.v=ci(Nt[1]-Vt[1],Vt[3],Vt[2],Nt[3],Nt[2],Nt[0]-Vt[0]),Vt.point=[0,0];var Pr=vi(Lt[0].v[0],Lt[2].v[0],Lt[1].v[0]),Hr=vi(Lt[0].v[0],Lt[1].v[0],Lt[2].v[0]),Zr=w-Pr;Lt[2].point[1]=0,Lt[0].point[0]=-(Lt[1].point[0]=Lt[0].v[0]/2);var pi=[Lt[2].point[0]=Lt[0].point[0]+Lt[2].v[0]*a(Pr),2*(Lt[0].point[1]=Lt[1].point[1]=Lt[2].v[0]*_(Pr))];function zi(Ki,rn){var kn=_(rn),Qn=a(rn),Ca=new Array(3),Ta;for(Ta=0;Ta<3;++Ta){var Ba=Lt[Ta];if(Ca[Ta]=ci(rn-Ba[1],Ba[3],Ba[2],Qn,kn,Ki-Ba[0]),!Ca[Ta][0])return Ba.point;Ca[Ta][1]=Ot(Ca[Ta][1]-Ba.v[1])}var xo=pi.slice();for(Ta=0;Ta<3;++Ta){var Go=Ta==2?0:Ta+1,Bo=vi(Lt[Ta].v[0],Ca[Ta][0],Ca[Go][0]);Ca[Ta][1]<0&&(Bo=-Bo),Ta?Ta==1?(Bo=Hr-Bo,xo[0]-=Ca[Ta][0]*a(Bo),xo[1]-=Ca[Ta][0]*_(Bo)):(Bo=Zr-Bo,xo[0]+=Ca[Ta][0]*a(Bo),xo[1]+=Ca[Ta][0]*_(Bo)):(xo[0]+=Ca[Ta][0]*a(Bo),xo[1]-=Ca[Ta][0]*_(Bo))}return xo[0]/=3,xo[1]/=3,xo}return zi}function ot(et){return et[0]*=T,et[1]*=T,et}function De(){return ye([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ye(et,lt,Tt){var Lt=y.geoCentroid({type:"MultiPoint",coordinates:[et,lt,Tt]}),Vt=[-Lt[0],-Lt[1]],Nt=y.geoRotation(Vt),Xt=Xe(ot(Nt(et)),ot(Nt(lt)),ot(Nt(Tt)));Xt.invert=Ge(Xt);var Pr=y.geoProjection(Xt).rotate(Vt),Hr=Pr.center;return delete Pr.rotate,Pr.center=function(Zr){return arguments.length?Hr(Nt(Zr)):Nt.invert(Hr())},Pr.clipAngle(90)}function Pe(et,lt){var Tt=V(1-_(lt));return[2/p*et*Tt,p*(1-Tt)]}Pe.invert=function(et,lt){var Tt=(Tt=lt/p-1)*Tt;return[Tt>0?et*V(w/Tt)/2:0,B(1-Tt)]};function He(){return y.geoProjection(Pe).scale(95.6464).center([0,30])}function at(et){var lt=A(et);function Tt(Lt,Vt){return[Lt,(Lt?Lt/_(Lt):1)*(_(Vt)*a(Lt)-lt*a(Vt))]}return Tt.invert=lt?function(Lt,Vt){Lt&&(Vt*=_(Lt)/Lt);var Nt=a(Lt);return[Lt,2*n(V(Nt*Nt+lt*lt-Vt*Vt)-Nt,lt-Vt)]}:function(Lt,Vt){return[Lt,B(Lt?Vt*A(Lt)/Lt:Vt)]},Tt}function ht(){return ut(at).scale(249.828).clipAngle(90)}var At=V(3);function Wt(et,lt){return[At*et*(2*a(2*lt/3)-1)/p,At*p*_(lt/3)]}Wt.invert=function(et,lt){var Tt=3*B(lt/(At*p));return[p*et/(At*(2*a(2*Tt/3)-1)),Tt]};function Yt(){return y.geoProjection(Wt).scale(156.19)}function hr(et){var lt=a(et);function Tt(Lt,Vt){return[Lt*lt,_(Vt)/lt]}return Tt.invert=function(Lt,Vt){return[Lt/lt,B(Vt*lt)]},Tt}function zr(){return ut(hr).parallel(38.58).scale(195.044)}function Dr(et){var lt=a(et);function Tt(Lt,Vt){return[Lt*lt,(1+lt)*A(Vt/2)]}return Tt.invert=function(Lt,Vt){return[Lt/lt,i(Vt/(1+lt))*2]},Tt}function br(){return ut(Dr).scale(124.75)}function fi(et,lt){var Tt=V(8/(3*w));return[Tt*et*(1-P(lt)/w),Tt*lt]}fi.invert=function(et,lt){var Tt=V(8/(3*w)),Lt=lt/Tt;return[et/(Tt*(1-P(Lt)/w)),Lt]};function un(){return y.geoProjection(fi).scale(165.664)}function cn(et,lt){var Tt=V(4-3*_(P(lt)));return[2/V(6*w)*et*Tt,x(lt)*V(2*w/3)*(2-Tt)]}cn.invert=function(et,lt){var Tt=2-P(lt)/V(2*w/3);return[et*V(6*w)/(2*Tt),x(lt)*B((4-Tt*Tt)/3)]};function yn(){return y.geoProjection(cn).scale(165.664)}function Gn(et,lt){var Tt=V(w*(4+w));return[2/Tt*et*(1+V(1-4*lt*lt/(w*w))),4/Tt*lt]}Gn.invert=function(et,lt){var Tt=V(w*(4+w))/2;return[et*Tt/(1+V(1-lt*lt*(4+w)/(4*w))),lt*Tt/2]};function Sn(){return y.geoProjection(Gn).scale(180.739)}function dn(et,lt){var Tt=(2+D)*_(lt);lt/=2;for(var Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;Lt++){var Nt=a(lt);lt-=Vt=(lt+_(lt)*(Nt+2)-Tt)/(2*Nt*(1+Nt))}return[2/V(w*(4+w))*et*(1+a(lt)),2*V(w/(4+w))*_(lt)]}dn.invert=function(et,lt){var Tt=lt*V((4+w)/w)/2,Lt=B(Tt),Vt=a(Lt);return[et/(2/V(w*(4+w))*(1+Vt)),B((Lt+Tt*(Vt+2))/(2+D))]};function va(){return y.geoProjection(dn).scale(180.739)}function na(et,lt){return[et*(1+a(lt))/V(2+w),2*lt/V(2+w)]}na.invert=function(et,lt){var Tt=V(2+w),Lt=lt*Tt/2;return[Tt*et/(1+a(Lt)),Lt]};function Kt(){return y.geoProjection(na).scale(173.044)}function lr(et,lt){for(var Tt=(1+D)*_(lt),Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;Lt++)lt-=Vt=(lt+_(lt)-Tt)/(1+a(lt));return Tt=V(2+w),[et*(1+a(lt))/Tt,2*lt/Tt]}lr.invert=function(et,lt){var Tt=1+D,Lt=V(Tt/2);return[et*2*Lt/(1+a(lt*=Lt)),B((lt+_(lt))/Tt)]};function _r(){return y.geoProjection(lr).scale(173.044)}var Er=3+2*M;function di(et,lt){var Tt=_(et/=2),Lt=a(et),Vt=V(a(lt)),Nt=a(lt/=2),Xt=_(lt)/(Nt+M*Lt*Vt),Pr=V(2/(1+Xt*Xt)),Hr=V((M*Nt+(Lt+Tt)*Vt)/(M*Nt+(Lt-Tt)*Vt));return[Er*(Pr*(Hr-1/Hr)-2*u(Hr)),Er*(Pr*Xt*(Hr+1/Hr)-2*i(Xt))]}di.invert=function(et,lt){if(!(Nt=ge.invert(et/1.2,lt*1.065)))return null;var Tt=Nt[0],Lt=Nt[1],Vt=20,Nt;et/=Er,lt/=Er;do{var Xt=Tt/2,Pr=Lt/2,Hr=_(Xt),Zr=a(Xt),pi=_(Pr),zi=a(Pr),Ki=a(Lt),rn=V(Ki),kn=pi/(zi+M*Zr*rn),Qn=kn*kn,Ca=V(2/(1+Qn)),Ta=M*zi+(Zr+Hr)*rn,Ba=M*zi+(Zr-Hr)*rn,xo=Ta/Ba,Go=V(xo),Bo=Go-1/Go,_s=Go+1/Go,wl=Ca*Bo-2*u(Go)-et,Al=Ca*kn*_s-2*i(kn)-lt,Us=pi&&I*rn*Hr*Qn/pi,Pl=(M*Zr*zi+rn)/(2*(zi+M*Zr*rn)*(zi+M*Zr*rn)*rn),Fu=-.5*kn*Ca*Ca*Ca,Tu=Fu*Us,Js=Fu*Pl,Qs=(Qs=2*zi+M*rn*(Zr-Hr))*Qs*Go,nc=(M*Zr*zi*rn+Ki)/Qs,wc=-(M*Hr*pi)/(rn*Qs),ih=Bo*Tu-2*nc/Go+Ca*(nc+nc/xo),Me=Bo*Js-2*wc/Go+Ca*(wc+wc/xo),Ve=kn*_s*Tu-2*Us/(1+Qn)+Ca*_s*Us+Ca*kn*(nc-nc/xo),ft=kn*_s*Js-2*Pl/(1+Qn)+Ca*_s*Pl+Ca*kn*(wc-wc/xo),Pt=Me*Ve-ft*ih;if(!Pt)break;var Bt=(Al*Me-wl*ft)/Pt,Ht=(wl*Ve-Al*ih)/Pt;Tt-=Bt,Lt=s(-D,h(D,Lt-Ht))}while((P(Bt)>f||P(Ht)>f)&&--Vt>0);return P(P(Lt)-D)Lt){var zi=V(pi),Ki=n(Zr,Hr),rn=Tt*b(Ki/Tt),kn=Ki-rn,Qn=et*a(kn),Ca=(et*_(kn)-kn*_(Qn))/(D-Qn),Ta=Rt(kn,Ca),Ba=(w-et)/qr(Ta,Qn,w);Hr=zi;var xo=50,Go;do Hr-=Go=(et+qr(Ta,Qn,Hr)*Ba-zi)/(Ta(Hr)*Ba);while(P(Go)>f&&--xo>0);Zr=kn*_(Hr),HrLt){var Hr=V(Pr),Zr=n(Xt,Nt),pi=Tt*b(Zr/Tt),zi=Zr-pi;Nt=Hr*a(zi),Xt=Hr*_(zi);for(var Ki=Nt-D,rn=_(Nt),kn=Xt/rn,Qn=Ntf||P(kn)>f)&&--Qn>0);return[zi,Ki]},Hr}var Gr=si(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function li(){return y.geoProjection(Gr).scale(149.995)}var Pi=si(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function xi(){return y.geoProjection(Pi).scale(153.93)}var zt=si(5/6*w,-.62636,-.0344,0,1.3493,-.05524,0,.045);function xr(){return y.geoProjection(zt).scale(130.945)}function Qr(et,lt){var Tt=et*et,Lt=lt*lt;return[et*(1-.162388*Lt)*(.87-952426e-9*Tt*Tt),lt*(1+Lt/12)]}Qr.invert=function(et,lt){var Tt=et,Lt=lt,Vt=50,Nt;do{var Xt=Lt*Lt;Lt-=Nt=(Lt*(1+Xt/12)-lt)/(1+Xt/4)}while(P(Nt)>f&&--Vt>0);Vt=50,et/=1-.162388*Xt;do{var Pr=(Pr=Tt*Tt)*Pr;Tt-=Nt=(Tt*(.87-952426e-9*Pr)-et)/(.87-.00476213*Pr)}while(P(Nt)>f&&--Vt>0);return[Tt,Lt]};function Ri(){return y.geoProjection(Qr).scale(131.747)}var en=si(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function _n(){return y.geoProjection(en).scale(131.087)}function Zi(et){var lt=et(D,0)[0]-et(-D,0)[0];function Tt(Lt,Vt){var Nt=Lt>0?-.5:.5,Xt=et(Lt+Nt*w,Vt);return Xt[0]-=Nt*lt,Xt}return et.invert&&(Tt.invert=function(Lt,Vt){var Nt=Lt>0?-.5:.5,Xt=et.invert(Lt+Nt*lt,Vt),Pr=Xt[0]-Nt*w;return Pr<-w?Pr+=2*w:Pr>w&&(Pr-=2*w),Xt[0]=Pr,Xt}),Tt}function Wi(et,lt){var Tt=x(et),Lt=x(lt),Vt=a(lt),Nt=a(et)*Vt,Xt=_(et)*Vt,Pr=_(Lt*lt);et=P(n(Xt,Pr)),lt=B(Nt),P(et-D)>f&&(et%=D);var Hr=pn(et>w/4?D-et:et,lt);return et>w/4&&(Pr=Hr[0],Hr[0]=-Hr[1],Hr[1]=-Pr),Hr[0]*=Tt,Hr[1]*=-Lt,Hr}Wi.invert=function(et,lt){P(et)>1&&(et=x(et)*2-et),P(lt)>1&&(lt=x(lt)*2-lt);var Tt=x(et),Lt=x(lt),Vt=-Tt*et,Nt=-Lt*lt,Xt=Nt/Vt<1,Pr=Ua(Xt?Nt:Vt,Xt?Vt:Nt),Hr=Pr[0],Zr=Pr[1],pi=a(Zr);return Xt&&(Hr=-D-Hr),[Tt*(n(_(Hr)*pi,-_(Zr))+w),Lt*B(a(Hr)*pi)]};function pn(et,lt){if(lt===D)return[0,0];var Tt=_(lt),Lt=Tt*Tt,Vt=Lt*Lt,Nt=1+Vt,Xt=1+3*Vt,Pr=1-Vt,Hr=B(1/V(Nt)),Zr=Pr+Lt*Nt*Hr,pi=(1-Tt)/Zr,zi=V(pi),Ki=pi*Nt,rn=V(Ki),kn=zi*Pr,Qn,Ca;if(et===0)return[0,-(kn+Lt*rn)];var Ta=a(lt),Ba=1/Ta,xo=2*Tt*Ta,Go=(-3*Lt+Hr*Xt)*xo,Bo=(-Zr*Ta-(1-Tt)*Go)/(Zr*Zr),_s=.5*Bo/zi,wl=Pr*_s-2*Lt*zi*xo,Al=Lt*Nt*Bo+pi*Xt*xo,Us=-Ba*xo,Pl=-Ba*Al,Fu=-2*Ba*wl,Tu=4*et/w,Js;if(et>.222*w||lt.175*w){if(Qn=(kn+Lt*V(Ki*(1+Vt)-kn*kn))/(1+Vt),et>w/4)return[Qn,Qn];var Qs=Qn,nc=.5*Qn;Qn=.5*(nc+Qs),Ca=50;do{var wc=V(Ki-Qn*Qn),ih=Qn*(Fu+Us*wc)+Pl*B(Qn/rn)-Tu;if(!ih)break;ih<0?nc=Qn:Qs=Qn,Qn=.5*(nc+Qs)}while(P(Qs-nc)>f&&--Ca>0)}else{Qn=f,Ca=25;do{var Me=Qn*Qn,Ve=V(Ki-Me),ft=Fu+Us*Ve,Pt=Qn*ft+Pl*B(Qn/rn)-Tu,Bt=ft+(Pl-Us*Me)/Ve;Qn-=Js=Ve?Pt/Bt:0}while(P(Js)>f&&--Ca>0)}return[Qn,-kn-Lt*V(Ki-Qn*Qn)]}function Ua(et,lt){for(var Tt=0,Lt=1,Vt=.5,Nt=50;;){var Xt=Vt*Vt,Pr=V(Vt),Hr=B(1/V(1+Xt)),Zr=1-Xt+Vt*(1+Xt)*Hr,pi=(1-Pr)/Zr,zi=V(pi),Ki=pi*(1+Xt),rn=zi*(1-Xt),kn=Ki-et*et,Qn=V(kn),Ca=lt+rn+Vt*Qn;if(P(Lt-Tt)0?Tt=Vt:Lt=Vt,Vt=.5*(Tt+Lt)}if(!Nt)return null;var Ta=B(Pr),Ba=a(Ta),xo=1/Ba,Go=2*Pr*Ba,Bo=(-3*Vt+Hr*(1+3*Xt))*Go,_s=(-Zr*Ba-(1-Pr)*Bo)/(Zr*Zr),wl=.5*_s/zi,Al=(1-Xt)*wl-2*Vt*zi*Go,Us=-2*xo*Al,Pl=-xo*Go,Fu=-xo*(Vt*(1+Xt)*_s+pi*(1+3*Xt)*Go);return[w/4*(et*(Us+Pl*Qn)+Fu*B(et/V(Ki))),Ta]}function ea(){return y.geoProjection(Zi(Wi)).scale(239.75)}function fo(et,lt,Tt){var Lt,Vt,Nt;return et?(Lt=ho(et,Tt),lt?(Vt=ho(lt,1-Tt),Nt=Vt[1]*Vt[1]+Tt*Lt[0]*Lt[0]*Vt[0]*Vt[0],[[Lt[0]*Vt[2]/Nt,Lt[1]*Lt[2]*Vt[0]*Vt[1]/Nt],[Lt[1]*Vt[1]/Nt,-Lt[0]*Lt[2]*Vt[0]*Vt[2]/Nt],[Lt[2]*Vt[1]*Vt[2]/Nt,-Tt*Lt[0]*Lt[1]*Vt[0]/Nt]]):[[Lt[0],0],[Lt[1],0],[Lt[2],0]]):(Vt=ho(lt,1-Tt),[[0,Vt[0]/Vt[1]],[1/Vt[1],0],[Vt[2]/Vt[1],0]])}function ho(et,lt){var Tt,Lt,Vt,Nt,Xt;if(lt=1-f)return Tt=(1-lt)/4,Lt=H(et),Nt=W(et),Vt=1/Lt,Xt=Lt*F(et),[Nt+Tt*(Xt-et)/(Lt*Lt),Vt-Tt*Nt*Vt*(Xt-et),Vt+Tt*Nt*Vt*(Xt+et),2*i(l(et))-D+Tt*(Xt-et)/Lt];var Pr=[1,0,0,0,0,0,0,0,0],Hr=[V(lt),0,0,0,0,0,0,0,0],Zr=0;for(Lt=V(1-lt),Xt=1;P(Hr[Zr]/Pr[Zr])>f&&Zr<8;)Tt=Pr[Zr++],Hr[Zr]=(Tt-Lt)/2,Pr[Zr]=(Tt+Lt)/2,Lt=V(Tt*Lt),Xt*=2;Vt=Xt*Pr[Zr]*et;do Nt=Hr[Zr]*_(Lt=Vt)/Pr[Zr],Vt=(B(Nt)+Vt)/2;while(--Zr);return[_(Vt),Nt=a(Vt),Nt/a(Vt-Lt),Vt]}function Vo(et,lt,Tt){var Lt=P(et),Vt=P(lt),Nt=F(Vt);if(Lt){var Xt=1/_(Lt),Pr=1/(A(Lt)*A(Lt)),Hr=-(Pr+Tt*(Nt*Nt*Xt*Xt)-1+Tt),Zr=(Tt-1)*Pr,pi=(-Hr+V(Hr*Hr-4*Zr))/2;return[Ao(i(1/V(pi)),Tt)*x(et),Ao(i(V((pi/Pr-1)/Tt)),1-Tt)*x(lt)]}return[0,Ao(i(Nt),1-Tt)*x(lt)]}function Ao(et,lt){if(!lt)return et;if(lt===1)return u(A(et/2+E));for(var Tt=1,Lt=V(1-lt),Vt=V(lt),Nt=0;P(Vt)>f;Nt++){if(et%w){var Xt=i(Lt*A(et)/Tt);Xt<0&&(Xt+=w),et+=Xt+~~(et/w)*w}else et+=et;Vt=(Tt+Lt)/2,Lt=V(Tt*Lt),Vt=((Tt=Vt)-Lt)/2}return et/(m(2,Nt)*Tt)}function Wo(et,lt){var Tt=(M-1)/(M+1),Lt=V(1-Tt*Tt),Vt=Ao(D,Lt*Lt),Nt=-1,Xt=u(A(w/4+P(lt)/2)),Pr=l(Nt*Xt)/V(Tt),Hr=Wa(Pr*a(Nt*et),Pr*_(Nt*et)),Zr=Vo(Hr[0],Hr[1],Lt*Lt);return[-Zr[1],(lt>=0?1:-1)*(.5*Vt-Zr[0])]}function Wa(et,lt){var Tt=et*et,Lt=lt+1,Vt=1-Tt-lt*lt;return[.5*((et>=0?D:-D)-n(Vt,2*et)),-.25*u(Vt*Vt+4*Tt)+.5*u(Lt*Lt+Tt)]}function Ts(et,lt){var Tt=lt[0]*lt[0]+lt[1]*lt[1];return[(et[0]*lt[0]+et[1]*lt[1])/Tt,(et[1]*lt[0]-et[0]*lt[1])/Tt]}Wo.invert=function(et,lt){var Tt=(M-1)/(M+1),Lt=V(1-Tt*Tt),Vt=Ao(D,Lt*Lt),Nt=-1,Xt=fo(.5*Vt-lt,-et,Lt*Lt),Pr=Ts(Xt[0],Xt[1]),Hr=n(Pr[1],Pr[0])/Nt;return[Hr,2*i(l(.5/Nt*u(Tt*Pr[0]*Pr[0]+Tt*Pr[1]*Pr[1])))-D]};function fs(){return y.geoProjection(Zi(Wo)).scale(151.496)}function _l(et){var lt=_(et),Tt=a(et),Lt=es(et);Lt.invert=es(-et);function Vt(Nt,Xt){var Pr=Lt(Nt,Xt);Nt=Pr[0],Xt=Pr[1];var Hr=_(Xt),Zr=a(Xt),pi=a(Nt),zi=U(lt*Hr+Tt*Zr*pi),Ki=_(zi),rn=P(Ki)>f?zi/Ki:1;return[rn*Tt*_(Nt),(P(Nt)>D?rn:-rn)*(lt*Zr-Tt*Hr*pi)]}return Vt.invert=function(Nt,Xt){var Pr=V(Nt*Nt+Xt*Xt),Hr=-_(Pr),Zr=a(Pr),pi=Pr*Zr,zi=-Xt*Hr,Ki=Pr*lt,rn=V(pi*pi+zi*zi-Ki*Ki),kn=n(pi*Ki+zi*rn,zi*Ki-pi*rn),Qn=(Pr>D?-1:1)*n(Nt*Hr,Pr*a(kn)*Zr+Xt*_(kn)*Hr);return Lt.invert(Qn,kn)},Vt}function es(et){var lt=_(et),Tt=a(et);return function(Lt,Vt){var Nt=a(Vt),Xt=a(Lt)*Nt,Pr=_(Lt)*Nt,Hr=_(Vt);return[n(Pr,Xt*Tt-Hr*lt),B(Hr*Tt+Xt*lt)]}}function rl(){var et=0,lt=y.geoProjectionMutator(_l),Tt=lt(et),Lt=Tt.rotate,Vt=Tt.stream,Nt=y.geoCircle();return Tt.parallel=function(Xt){if(!arguments.length)return et*C;var Pr=Tt.rotate();return lt(et=Xt*T).rotate(Pr)},Tt.rotate=function(Xt){return arguments.length?(Lt.call(Tt,[Xt[0],Xt[1]-et*C]),Nt.center([-Xt[0],-Xt[1]]),Tt):(Xt=Lt.call(Tt),Xt[1]+=et*C,Xt)},Tt.stream=function(Xt){return Xt=Vt(Xt),Xt.sphere=function(){Xt.polygonStart();var Pr=.01,Hr=Nt.radius(90-Pr)().coordinates[0],Zr=Hr.length-1,pi=-1,zi;for(Xt.lineStart();++pi=0;)Xt.point((zi=Hr[pi])[0],zi[1]);Xt.lineEnd(),Xt.polygonEnd()},Xt},Tt.scale(79.4187).parallel(45).clipAngle(180-.001)}var ds=3,xl=B(1-1/ds)*C,sl=hr(0);function Gl(et){var lt=xl*T,Tt=Pe(w,lt)[0]-Pe(-w,lt)[0],Lt=sl(0,lt)[1],Vt=Pe(0,lt)[1],Nt=p-Vt,Xt=g/et,Pr=4/g,Hr=Lt+Nt*Nt*4/g;function Zr(pi,zi){var Ki,rn=P(zi);if(rn>lt){var kn=h(et-1,s(0,o((pi+w)/Xt)));pi+=w*(et-1)/et-kn*Xt,Ki=Pe(pi,rn),Ki[0]=Ki[0]*g/Tt-g*(et-1)/(2*et)+kn*g/et,Ki[1]=Lt+(Ki[1]-Vt)*4*Nt/g,zi<0&&(Ki[1]=-Ki[1])}else Ki=sl(pi,zi);return Ki[0]*=Pr,Ki[1]/=Hr,Ki}return Zr.invert=function(pi,zi){pi/=Pr,zi*=Hr;var Ki=P(zi);if(Ki>Lt){var rn=h(et-1,s(0,o((pi+w)/Xt)));pi=(pi+w*(et-1)/et-rn*Xt)*Tt/g;var kn=Pe.invert(pi,.25*(Ki-Lt)*g/Nt+Vt);return kn[0]-=w*(et-1)/et-rn*Xt,zi<0&&(kn[1]=-kn[1]),kn}return sl.invert(pi,zi)},Zr}function ms(et,lt){return[et,lt&1?90-f:xl]}function Bs(et,lt){return[et,lt&1?-90+f:-xl]}function No(et){return[et[0]*(1-f),et[1]]}function Ls(et){var lt=[].concat(z.range(-180,180+et/2,et).map(ms),z.range(180,-180-et/2,-et).map(Bs));return{type:"Polygon",coordinates:[et===180?lt.map(No):lt]}}function Il(){var et=4,lt=y.geoProjectionMutator(Gl),Tt=lt(et),Lt=Tt.stream;return Tt.lobes=function(Vt){return arguments.length?lt(et=+Vt):et},Tt.stream=function(Vt){var Nt=Tt.rotate(),Xt=Lt(Vt),Pr=(Tt.rotate([0,0]),Lt(Vt));return Tt.rotate(Nt),Xt.sphere=function(){y.geoStream(Ls(180/et),Pr)},Xt},Tt.scale(239.75)}function Jl(et){var lt=1+et,Tt=_(1/lt),Lt=B(Tt),Vt=2*V(w/(Nt=w+4*Lt*lt)),Nt,Xt=.5*Vt*(lt+V(et*(2+et))),Pr=et*et,Hr=lt*lt;function Zr(pi,zi){var Ki=1-_(zi),rn,kn;if(Ki&&Ki<2){var Qn=D-zi,Ca=25,Ta;do{var Ba=_(Qn),xo=a(Qn),Go=Lt+n(Ba,lt-xo),Bo=1+Hr-2*lt*xo;Qn-=Ta=(Qn-Pr*Lt-lt*Ba+Bo*Go-.5*Ki*Nt)/(2*lt*Ba*Go)}while(P(Ta)>k&&--Ca>0);rn=Vt*V(Bo),kn=pi*Go/w}else rn=Vt*(et+Ki),kn=pi*Lt/w;return[rn*_(kn),Xt-rn*a(kn)]}return Zr.invert=function(pi,zi){var Ki=pi*pi+(zi-=Xt)*zi,rn=(1+Hr-Ki/(Vt*Vt))/(2*lt),kn=U(rn),Qn=_(kn),Ca=Lt+n(Qn,lt-rn);return[B(pi/V(Ki))*w/Ca,B(1-2*(kn-Pr*Lt-lt*Qn+(1+Hr-2*lt*rn)*Ca)/Nt)]},Zr}function ou(){var et=1,lt=y.geoProjectionMutator(Jl),Tt=lt(et);return Tt.ratio=function(Lt){return arguments.length?lt(et=+Lt):et},Tt.scale(167.774).center([0,18.67])}var Gs=.7109889596207567,$a=.0528035274542;function So(et,lt){return lt>-Gs?(et=ct(et,lt),et[1]+=$a,et):Et(et,lt)}So.invert=function(et,lt){return lt>-Gs?ct.invert(et,lt-$a):Et.invert(et,lt)};function Xs(){return y.geoProjection(So).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function su(et,lt){return P(lt)>Gs?(et=ct(et,lt),et[1]-=lt>0?$a:-$a,et):Et(et,lt)}su.invert=function(et,lt){return P(lt)>Gs?ct.invert(et,lt+(lt>0?$a:-$a)):Et.invert(et,lt)};function is(){return y.geoProjection(su).scale(152.63)}function tu(et,lt,Tt,Lt){var Vt=V(4*w/(2*Tt+(1+et-lt/2)*_(2*Tt)+(et+lt)/2*_(4*Tt)+lt/2*_(6*Tt))),Nt=V(Lt*_(Tt)*V((1+et*a(2*Tt)+lt*a(4*Tt))/(1+et+lt))),Xt=Tt*Hr(1);function Pr(zi){return V(1+et*a(2*zi)+lt*a(4*zi))}function Hr(zi){var Ki=zi*Tt;return(2*Ki+(1+et-lt/2)*_(2*Ki)+(et+lt)/2*_(4*Ki)+lt/2*_(6*Ki))/Tt}function Zr(zi){return Pr(zi)*_(zi)}var pi=function(zi,Ki){var rn=Tt*Ze(Hr,Xt*_(Ki)/Tt,Ki/w);isNaN(rn)&&(rn=Tt*x(Ki));var kn=Vt*Pr(rn);return[kn*Nt*zi/w*a(rn),kn/Nt*_(rn)]};return pi.invert=function(zi,Ki){var rn=Ze(Zr,Ki*Nt/Vt);return[zi*w/(a(rn)*Vt*Nt*Pr(rn)),B(Tt*Hr(rn/Tt)/Xt)]},Tt===0&&(Vt=V(Lt/w),pi=function(zi,Ki){return[zi*Vt,_(Ki)/Vt]},pi.invert=function(zi,Ki){return[zi/Vt,B(Ki*Vt)]}),pi}function pl(){var et=1,lt=0,Tt=45*T,Lt=2,Vt=y.geoProjectionMutator(tu),Nt=Vt(et,lt,Tt,Lt);return Nt.a=function(Xt){return arguments.length?Vt(et=+Xt,lt,Tt,Lt):et},Nt.b=function(Xt){return arguments.length?Vt(et,lt=+Xt,Tt,Lt):lt},Nt.psiMax=function(Xt){return arguments.length?Vt(et,lt,Tt=+Xt*T,Lt):Tt*C},Nt.ratio=function(Xt){return arguments.length?Vt(et,lt,Tt,Lt=+Xt):Lt},Nt.scale(180.739)}function Nl(et,lt,Tt,Lt,Vt,Nt,Xt,Pr,Hr,Zr,pi){if(pi.nanEncountered)return NaN;var zi,Ki,rn,kn,Qn,Ca,Ta,Ba,xo,Go;if(zi=Tt-lt,Ki=et(lt+zi*.25),rn=et(Tt-zi*.25),isNaN(Ki)){pi.nanEncountered=!0;return}if(isNaN(rn)){pi.nanEncountered=!0;return}return kn=zi*(Lt+4*Ki+Vt)/12,Qn=zi*(Vt+4*rn+Nt)/12,Ca=kn+Qn,Go=(Ca-Xt)/15,Zr>Hr?(pi.maxDepthCount++,Ca+Go):Math.abs(Go)>1;do Hr[Ca]>rn?Qn=Ca:kn=Ca,Ca=kn+Qn>>1;while(Ca>kn);var Ta=Hr[Ca+1]-Hr[Ca];return Ta&&(Ta=(rn-Hr[Ca+1])/Ta),(Ca+1+Ta)/Xt}var zi=2*pi(1)/w*Nt/Tt,Ki=function(rn,kn){var Qn=pi(P(_(kn))),Ca=Lt(Qn)*rn;return Qn/=zi,[Ca,kn>=0?Qn:-Qn]};return Ki.invert=function(rn,kn){var Qn;return kn*=zi,P(kn)<1&&(Qn=x(kn)*B(Vt(P(kn))*Nt)),[rn/Lt(P(kn)),Qn]},Ki}function Ps(){var et=0,lt=2.5,Tt=1.183136,Lt=y.geoProjectionMutator(bo),Vt=Lt(et,lt,Tt);return Vt.alpha=function(Nt){return arguments.length?Lt(et=+Nt,lt,Tt):et},Vt.k=function(Nt){return arguments.length?Lt(et,lt=+Nt,Tt):lt},Vt.gamma=function(Nt){return arguments.length?Lt(et,lt,Tt=+Nt):Tt},Vt.scale(152.63)}function Rs(et,lt){return P(et[0]-lt[0])=0;--Hr)Tt=et[1][Hr],Lt=Tt[0][0],Vt=Tt[0][1],Nt=Tt[1][1],Xt=Tt[2][0],Pr=Tt[2][1],lt.push(pu([[Xt-f,Pr-f],[Xt-f,Nt+f],[Lt+f,Nt+f],[Lt+f,Vt-f]],30));return{type:"Polygon",coordinates:[z.merge(lt)]}}function ls(et,lt,Tt){var Lt,Vt;function Nt(Hr,Zr){for(var pi=Zr<0?-1:1,zi=lt[+(Zr<0)],Ki=0,rn=zi.length-1;Kizi[Ki][2][0];++Ki);var kn=et(Hr-zi[Ki][1][0],Zr);return kn[0]+=et(zi[Ki][1][0],pi*Zr>pi*zi[Ki][0][1]?zi[Ki][0][1]:Zr)[0],kn}Tt?Nt.invert=Tt(Nt):et.invert&&(Nt.invert=function(Hr,Zr){for(var pi=Vt[+(Zr<0)],zi=lt[+(Zr<0)],Ki=0,rn=pi.length;Kikn&&(Qn=rn,rn=kn,kn=Qn),[[zi,rn],[Ki,kn]]})}),Xt):lt.map(function(Zr){return Zr.map(function(pi){return[[pi[0][0]*C,pi[0][1]*C],[pi[1][0]*C,pi[1][1]*C],[pi[2][0]*C,pi[2][1]*C]]})})},lt!=null&&Xt.lobes(lt),Xt}var Ru=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function ic(){return ls(nt,Ru).scale(160.857)}var Ll=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Hl(){return ls(su,Ll).scale(152.63)}var lu=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function hu(){return ls(ct,lu).scale(169.529)}var pc=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ah(){return ls(ct,pc).scale(169.529).rotate([20,0])}var uh=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function gh(){return ls(So,uh,Ge).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var td=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function Nf(){return ls(Et,td).scale(152.63).rotate([-20,0])}function Vl(et,lt){return[3/g*et*V(w*w/3-lt*lt),lt]}Vl.invert=function(et,lt){return[g/3*et/V(w*w/3-lt*lt),lt]};function Kc(){return y.geoProjection(Vl).scale(158.837)}function rd(et){function lt(Tt,Lt){if(P(P(Lt)-D)2)return null;Tt/=2,Lt/=2;var Nt=Tt*Tt,Xt=Lt*Lt,Pr=2*Lt/(1+Nt+Xt);return Pr=m((1+Pr)/(1-Pr),1/et),[n(2*Tt,1-Nt-Xt)/et,B((Pr-1)/(Pr+1))]},lt}function xc(){var et=.5,lt=y.geoProjectionMutator(rd),Tt=lt(et);return Tt.spacing=function(Lt){return arguments.length?lt(et=+Lt):et},Tt.scale(124.75)}var mc=w/M;function bc(et,lt){return[et*(1+V(a(lt)))/2,lt/(a(lt/2)*a(et/6))]}bc.invert=function(et,lt){var Tt=P(et),Lt=P(lt),Vt=f,Nt=D;Ltf||P(Ca)>f)&&--Vt>0);return Vt&&[Tt,Lt]};function gc(){return y.geoProjection(yu).scale(139.98)}function hl(et,lt){return[_(et)/a(lt),A(lt)*a(et)]}hl.invert=function(et,lt){var Tt=et*et,Lt=lt*lt,Vt=Lt+1,Nt=Tt+Vt,Xt=et?I*V((Nt-V(Nt*Nt-4*Tt))/Tt):1/V(Vt);return[B(et*Xt),x(lt)*U(Xt)]};function ru(){return y.geoProjection(hl).scale(144.049).clipAngle(90-.001)}function Fh(et){var lt=a(et),Tt=A(E+et/2);function Lt(Vt,Nt){var Xt=Nt-et,Pr=P(Xt)=0;)pi=et[Zr],zi=pi[0]+Pr*(rn=zi)-Hr*Ki,Ki=pi[1]+Pr*Ki+Hr*rn;return zi=Pr*(rn=zi)-Hr*Ki,Ki=Pr*Ki+Hr*rn,[zi,Ki]}return Tt.invert=function(Lt,Vt){var Nt=20,Xt=Lt,Pr=Vt;do{for(var Hr=lt,Zr=et[Hr],pi=Zr[0],zi=Zr[1],Ki=0,rn=0,kn;--Hr>=0;)Zr=et[Hr],Ki=pi+Xt*(kn=Ki)-Pr*rn,rn=zi+Xt*rn+Pr*kn,pi=Zr[0]+Xt*(kn=pi)-Pr*zi,zi=Zr[1]+Xt*zi+Pr*kn;Ki=pi+Xt*(kn=Ki)-Pr*rn,rn=zi+Xt*rn+Pr*kn,pi=Xt*(kn=pi)-Pr*zi-Lt,zi=Xt*zi+Pr*kn-Vt;var Qn=Ki*Ki+rn*rn,Ca,Ta;Xt-=Ca=(pi*Ki+zi*rn)/Qn,Pr-=Ta=(zi*Ki-pi*rn)/Qn}while(P(Ca)+P(Ta)>f*f&&--Nt>0);if(Nt){var Ba=V(Xt*Xt+Pr*Pr),xo=2*i(Ba*.5),Go=_(xo);return[n(Xt*Go,Ba*a(xo)),Ba?B(Pr*Go/Ba):0]}},Tt}var ll=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],fp=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],jl=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],os=[[.9245,0],[0,0],[.01943,0]],_f=[[.721316,0],[0,0],[-.00881625,-.00617325]];function yh(){return vc(ll,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function hc(){return vc(fp,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function id(){return vc(jl,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Qh(){return vc(os,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Lf(){return vc(_f,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function vc(et,lt){var Tt=y.geoProjection(Xd(et)).rotate(lt).clipAngle(90),Lt=y.geoRotation(lt),Vt=Tt.center;return delete Tt.rotate,Tt.center=function(Nt){return arguments.length?Vt(Lt(Nt)):Lt.invert(Vt())},Tt}var Pd=V(6),hd=V(7);function Pf(et,lt){var Tt=B(7*_(lt)/(3*Pd));return[Pd*et*(2*a(2*Tt/3)-1)/hd,9*_(Tt/3)/hd]}Pf.invert=function(et,lt){var Tt=3*B(lt*hd/9);return[et*hd/(Pd*(2*a(2*Tt/3)-1)),B(_(Tt)*3*Pd/7)]};function ef(){return y.geoProjection(Pf).scale(164.859)}function nd(et,lt){for(var Tt=(1+I)*_(lt),Lt=lt,Vt=0,Nt;Vt<25&&(Lt-=Nt=(_(Lt/2)+_(Lt)-Tt)/(.5*a(Lt/2)+a(Lt)),!(P(Nt)k&&--Lt>0);return Nt=Tt*Tt,Xt=Nt*Nt,Pr=Nt*Xt,[et/(.84719-.13063*Nt+Pr*Pr*(-.04515+.05494*Nt-.02326*Xt+.00331*Pr)),Tt]};function Mh(){return y.geoProjection(Nh).scale(175.295)}function yc(et,lt){return[et*(1+a(lt))/2,2*(lt-A(lt/2))]}yc.invert=function(et,lt){for(var Tt=lt/2,Lt=0,Vt=1/0;Lt<10&&P(Vt)>f;++Lt){var Nt=a(lt/2);lt-=Vt=(lt-A(lt/2)-Tt)/(1-.5/(Nt*Nt))}return[2*et/(1+a(lt)),lt]};function df(){return y.geoProjection(yc).scale(152.63)}var od=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function uu(){return ls(Ce(1/0),od).rotate([20,0]).scale(152.63)}function jf(et,lt){var Tt=_(lt),Lt=a(lt),Vt=x(et);if(et===0||P(lt)===D)return[0,lt];if(lt===0)return[et,0];if(P(et)===D)return[et*Lt,D*Tt];var Nt=w/(2*et)-2*et/w,Xt=2*lt/w,Pr=(1-Xt*Xt)/(Tt-Xt),Hr=Nt*Nt,Zr=Pr*Pr,pi=1+Hr/Zr,zi=1+Zr/Hr,Ki=(Nt*Tt/Pr-Nt/2)/pi,rn=(Zr*Tt/Hr+Pr/2)/zi,kn=Ki*Ki+Lt*Lt/pi,Qn=rn*rn-(Zr*Tt*Tt/Hr+Pr*Tt-1)/zi;return[D*(Ki+V(kn)*Vt),D*(rn+V(Qn<0?0:Qn)*x(-lt*Nt)*Vt)]}jf.invert=function(et,lt){et/=D,lt/=D;var Tt=et*et,Lt=lt*lt,Vt=Tt+Lt,Nt=w*w;return[et?(Vt-1+V((1-Vt)*(1-Vt)+4*Tt))/(2*et)*D:0,Ze(function(Xt){return Vt*(w*_(Xt)-2*Xt)*w+4*Xt*Xt*(lt-_(Xt))+2*w*Xt-Nt*lt},0)]};function Jd(){return y.geoProjection(jf).scale(127.267)}var dd=1.0148,If=.23185,pd=-.14499,Yc=.02406,md=dd,Vu=5*If,Xc=7*pd,tf=9*Yc,_u=1.790857183;function jh(et,lt){var Tt=lt*lt;return[et,lt*(dd+Tt*Tt*(If+Tt*(pd+Yc*Tt)))]}jh.invert=function(et,lt){lt>_u?lt=_u:lt<-_u&&(lt=-_u);var Tt=lt,Lt;do{var Vt=Tt*Tt;Tt-=Lt=(Tt*(dd+Vt*Vt*(If+Vt*(pd+Yc*Vt)))-lt)/(md+Vt*Vt*(Vu+Vt*(Xc+tf*Vt)))}while(P(Lt)>f);return[et,Tt]};function Fc(){return y.geoProjection(jh).scale(139.319)}function Jc(et,lt){if(P(lt)f&&--Vt>0);return Xt=A(Lt),[(P(lt)=0;)if(Lt=lt[Pr],Tt[0]===Lt[0]&&Tt[1]===Lt[1]){if(Nt)return[Nt,Tt];Nt=Tt}}}function ch(et){for(var lt=et.length,Tt=[],Lt=et[lt-1],Vt=0;Vt0?[-Lt[0],0]:[180-Lt[0],180])};var lt=Lh.map(function(Tt){return{face:Tt,project:et(Tt)}});return[-1,0,0,1,0,1,4,5].forEach(function(Tt,Lt){var Vt=lt[Tt];Vt&&(Vt.children||(Vt.children=[])).push(lt[Lt])}),bf(lt[0],function(Tt,Lt){return lt[Tt<-w/2?Lt<0?6:4:Tt<0?Lt<0?2:0:TtLt^rn>Lt&&Tt<(Ki-Zr)*(Lt-pi)/(rn-pi)+Zr&&(Vt=!Vt)}return Vt}function Ac(et,lt){var Tt=lt.stream,Lt;if(!Tt)throw new Error("invalid projection");switch(et&&et.type){case"Feature":Lt=fh;break;case"FeatureCollection":Lt=gd;break;default:Lt=Ph;break}return Lt(et,Tt)}function gd(et,lt){return{type:"FeatureCollection",features:et.features.map(function(Tt){return fh(Tt,lt)})}}function fh(et,lt){return{type:"Feature",id:et.id,properties:et.properties,geometry:Ph(et.geometry,lt)}}function $h(et,lt){return{type:"GeometryCollection",geometries:et.geometries.map(function(Tt){return Ph(Tt,lt)})}}function Ph(et,lt){if(!et)return null;if(et.type==="GeometryCollection")return $h(et,lt);var Tt;switch(et.type){case"Point":Tt=Ih;break;case"MultiPoint":Tt=Ih;break;case"LineString":Tt=Tf;break;case"MultiLineString":Tt=Tf;break;case"Polygon":Tt=Dh;break;case"MultiPolygon":Tt=Dh;break;case"Sphere":Tt=Dh;break;default:return null}return y.geoStream(et,lt(Tt)),Tt.result()}var Zu=[],fu=[],Ih={point:function(et,lt){Zu.push([et,lt])},result:function(){var et=Zu.length?Zu.length<2?{type:"Point",coordinates:Zu[0]}:{type:"MultiPoint",coordinates:Zu}:null;return Zu=[],et}},Tf={lineStart:af,point:function(et,lt){Zu.push([et,lt])},lineEnd:function(){Zu.length&&(fu.push(Zu),Zu=[])},result:function(){var et=fu.length?fu.length<2?{type:"LineString",coordinates:fu[0]}:{type:"MultiLineString",coordinates:fu}:null;return fu=[],et}},Dh={polygonStart:af,lineStart:af,point:function(et,lt){Zu.push([et,lt])},lineEnd:function(){var et=Zu.length;if(et){do Zu.push(Zu[0].slice());while(++et<4);fu.push(Zu),Zu=[]}},polygonEnd:af,result:function(){if(!fu.length)return null;var et=[],lt=[];return fu.forEach(function(Tt){zf(Tt)?et.push([Tt]):lt.push(Tt)}),lt.forEach(function(Tt){var Lt=Tt[0];et.some(function(Vt){if(ep(Vt[0],Lt))return Vt.push(Tt),!0})||et.push([Tt])}),fu=[],et.length?et.length>1?{type:"MultiPolygon",coordinates:et}:{type:"Polygon",coordinates:et[0]}:null}};function sd(et){var lt=et(D,0)[0]-et(-D,0)[0];function Tt(Lt,Vt){var Nt=P(Lt)0?Lt-w:Lt+w,Vt),Pr=(Xt[0]-Xt[1])*I,Hr=(Xt[0]+Xt[1])*I;if(Nt)return[Pr,Hr];var Zr=lt*I,pi=Pr>0^Hr>0?-1:1;return[pi*Pr-x(Hr)*Zr,pi*Hr-x(Pr)*Zr]}return et.invert&&(Tt.invert=function(Lt,Vt){var Nt=(Lt+Vt)*I,Xt=(Vt-Lt)*I,Pr=P(Nt)<.5*lt&&P(Xt)<.5*lt;if(!Pr){var Hr=lt*I,Zr=Nt>0^Xt>0?-1:1,pi=-Zr*Lt+(Xt>0?1:-1)*Hr,zi=-Zr*Vt+(Nt>0?1:-1)*Hr;Nt=(-pi-zi)*I,Xt=(pi-zi)*I}var Ki=et.invert(Nt,Xt);return Pr||(Ki[0]+=Nt>0?w:-w),Ki}),y.geoProjection(Tt).rotate([-90,-90,45]).clipAngle(180-.001)}function wr(){return sd(Wi).scale(176.423)}function Xr(){return sd(Wo).scale(111.48)}function Ni(et,lt){if(!(0<=(lt=+lt)&<<=20))throw new Error("invalid digits");function Tt(Zr){var pi=Zr.length,zi=2,Ki=new Array(pi);for(Ki[0]=+Zr[0].toFixed(lt),Ki[1]=+Zr[1].toFixed(lt);zi2||rn[0]!=pi[0]||rn[1]!=pi[1])&&(zi.push(rn),pi=rn)}return zi.length===1&&Zr.length>1&&zi.push(Tt(Zr[Zr.length-1])),zi}function Nt(Zr){return Zr.map(Vt)}function Xt(Zr){if(Zr==null)return Zr;var pi;switch(Zr.type){case"GeometryCollection":pi={type:"GeometryCollection",geometries:Zr.geometries.map(Xt)};break;case"Point":pi={type:"Point",coordinates:Tt(Zr.coordinates)};break;case"MultiPoint":pi={type:Zr.type,coordinates:Lt(Zr.coordinates)};break;case"LineString":pi={type:Zr.type,coordinates:Vt(Zr.coordinates)};break;case"MultiLineString":case"Polygon":pi={type:Zr.type,coordinates:Nt(Zr.coordinates)};break;case"MultiPolygon":pi={type:"MultiPolygon",coordinates:Zr.coordinates.map(Nt)};break;default:return Zr}return Zr.bbox!=null&&(pi.bbox=Zr.bbox),pi}function Pr(Zr){var pi={type:"Feature",properties:Zr.properties,geometry:Xt(Zr.geometry)};return Zr.id!=null&&(pi.id=Zr.id),Zr.bbox!=null&&(pi.bbox=Zr.bbox),pi}if(et!=null)switch(et.type){case"Feature":return Pr(et);case"FeatureCollection":{var Hr={type:"FeatureCollection",features:et.features.map(Pr)};return et.bbox!=null&&(Hr.bbox=et.bbox),Hr}default:return Xt(et)}return et}function Ai(et){var lt=_(et);function Tt(Lt,Vt){var Nt=lt?A(Lt*lt/2)/lt:Lt/2;if(!Vt)return[2*Nt,-et];var Xt=2*i(Nt*_(Vt)),Pr=1/A(Vt);return[_(Xt)*Pr,Vt+(1-a(Xt))*Pr-et]}return Tt.invert=function(Lt,Vt){if(P(Vt+=et)f&&--Pr>0);var Ki=Lt*(Zr=A(Xt)),rn=A(P(Vt)0?D:-D)*(Hr+Vt*(pi-Xt)/2+Vt*Vt*(pi-2*Hr+Xt)/2)]}pa.invert=function(et,lt){var Tt=lt/D,Lt=Tt*90,Vt=h(18,P(Lt/5)),Nt=s(0,o(Vt));do{var Xt=Pn[Nt][1],Pr=Pn[Nt+1][1],Hr=Pn[h(19,Nt+2)][1],Zr=Hr-Xt,pi=Hr-2*Pr+Xt,zi=2*(P(Tt)-Pr)/Zr,Ki=pi/Zr,rn=zi*(1-Ki*zi*(1-2*Ki*zi));if(rn>=0||Nt===1){Lt=(lt>=0?5:-5)*(rn+Vt);var kn=50,Qn;do Vt=h(18,P(Lt)/5),Nt=o(Vt),rn=Vt-Nt,Xt=Pn[Nt][1],Pr=Pn[Nt+1][1],Hr=Pn[h(19,Nt+2)][1],Lt-=(Qn=(lt>=0?D:-D)*(Pr+rn*(Hr-Xt)/2+rn*rn*(Hr-2*Pr+Xt)/2)-lt)*C;while(P(Qn)>k&&--kn>0);break}}while(--Nt>=0);var Ca=Pn[Nt][0],Ta=Pn[Nt+1][0],Ba=Pn[h(19,Nt+2)][0];return[et/(Ta+rn*(Ba-Ca)/2+rn*rn*(Ba-2*Ta+Ca)/2),Lt*T]};function Ea(){return y.geoProjection(pa).scale(152.63)}function Ka(et){function lt(Tt,Lt){var Vt=a(Lt),Nt=(et-1)/(et-Vt*a(Tt));return[Nt*Vt*_(Tt),Nt*_(Lt)]}return lt.invert=function(Tt,Lt){var Vt=Tt*Tt+Lt*Lt,Nt=V(Vt),Xt=(et-V(1-Vt*(et+1)/(et-1)))/((et-1)/Nt+Nt/(et-1));return[n(Tt*Xt,Nt*V(1-Xt*Xt)),Nt?B(Lt*Xt/Nt):0]},lt}function oo(et,lt){var Tt=Ka(et);if(!lt)return Tt;var Lt=a(lt),Vt=_(lt);function Nt(Xt,Pr){var Hr=Tt(Xt,Pr),Zr=Hr[1],pi=Zr*Vt/(et-1)+Lt;return[Hr[0]*Lt/pi,Zr/pi]}return Nt.invert=function(Xt,Pr){var Hr=(et-1)/(et-1-Pr*Vt);return Tt.invert(Hr*Xt,Hr*Pr*Lt)},Nt}function wa(){var et=2,lt=0,Tt=y.geoProjectionMutator(oo),Lt=Tt(et,lt);return Lt.distance=function(Vt){return arguments.length?Tt(et=+Vt,lt):et},Lt.tilt=function(Vt){return arguments.length?Tt(et,lt=Vt*T):lt*C},Lt.scale(432.147).clipAngle(U(1/et)*C-1e-6)}var Va=1e-4,Oa=1e4,fa=-180,vo=fa+Va,hs=180,rs=hs-Va,ps=-90,xs=ps+Va,_o=90,no=_o-Va;function ws(et){return et.length>0}function ul(et){return Math.floor(et*Oa)/Oa}function Ul(et){return et===ps||et===_o?[0,et]:[fa,ul(et)]}function mu(et){var lt=et[0],Tt=et[1],Lt=!1;return lt<=vo?(lt=fa,Lt=!0):lt>=rs&&(lt=hs,Lt=!0),Tt<=xs?(Tt=ps,Lt=!0):Tt>=no&&(Tt=_o,Lt=!0),Lt?[lt,Tt]:et}function Ql(et){return et.map(mu)}function gu(et,lt,Tt){for(var Lt=0,Vt=et.length;Lt=rs||pi<=xs||pi>=no){Nt[Xt]=mu(Hr);for(var zi=Xt+1;zivo&&rnxs&&kn=Pr)break;Tt.push({index:-1,polygon:lt,ring:Nt=Nt.slice(zi-1)}),Nt[0]=Ul(Nt[0][1]),Xt=-1,Pr=Nt.length}}}}function Cl(et){var lt,Tt=et.length,Lt={},Vt={},Nt,Xt,Pr,Hr,Zr;for(lt=0;lt0?w-Pr:Pr)*C],Zr=y.geoProjection(et(Xt)).rotate(Hr),pi=y.geoRotation(Hr),zi=Zr.center;return delete Zr.rotate,Zr.center=function(Ki){return arguments.length?zi(pi(Ki)):pi.invert(zi())},Zr.clipAngle(90)}function Wl(et){var lt=a(et);function Tt(Lt,Vt){var Nt=y.geoGnomonicRaw(Lt,Vt);return Nt[0]*=lt,Nt}return Tt.invert=function(Lt,Vt){return y.geoGnomonicRaw.invert(Lt/lt,Vt)},Tt}function Mc(){return eh([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function eh(et,lt){return iu(Wl,et,lt)}function $c(et){if(!(et*=2))return y.geoAzimuthalEquidistantRaw;var lt=-et/2,Tt=-lt,Lt=et*et,Vt=A(Tt),Nt=.5/_(Tt);function Xt(Pr,Hr){var Zr=U(a(Hr)*a(Pr-lt)),pi=U(a(Hr)*a(Pr-Tt)),zi=Hr<0?-1:1;return Zr*=Zr,pi*=pi,[(Zr-pi)/(2*et),zi*V(4*Lt*pi-(Lt-Zr+pi)*(Lt-Zr+pi))/(2*et)]}return Xt.invert=function(Pr,Hr){var Zr=Hr*Hr,pi=a(V(Zr+(Ki=Pr+lt)*Ki)),zi=a(V(Zr+(Ki=Pr+Tt)*Ki)),Ki,rn;return[n(rn=pi-zi,Ki=(pi+zi)*Vt),(Hr<0?-1:1)*U(V(Ki*Ki+rn*rn)*Nt)]},Xt}function Hh(){return th([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function th(et,lt){return iu($c,et,lt)}function Vh(et,lt){if(P(lt)f&&--Pr>0);return[x(et)*(V(Vt*Vt+4)+Vt)*w/4,D*Xt]};function ld(){return y.geoProjection(tc).scale(127.16)}function Ke(et,lt,Tt,Lt,Vt){function Nt(Xt,Pr){var Hr=Tt*_(Lt*Pr),Zr=V(1-Hr*Hr),pi=V(2/(1+Zr*a(Xt*=Vt)));return[et*Zr*pi*_(Xt),lt*Hr*pi]}return Nt.invert=function(Xt,Pr){var Hr=Xt/et,Zr=Pr/lt,pi=V(Hr*Hr+Zr*Zr),zi=2*B(pi/2);return[n(Xt*A(zi),et*pi)/Vt,pi&&B(Pr*_(zi)/(lt*Tt*pi))/Lt]},Nt}function O(et,lt,Tt,Lt){var Vt=w/3;et=s(et,f),lt=s(lt,f),et=h(et,D),lt=h(lt,w-f),Tt=s(Tt,0),Tt=h(Tt,100-f),Lt=s(Lt,f);var Nt=Tt/100+1,Xt=Lt/100,Pr=U(Nt*a(Vt))/Vt,Hr=_(et)/_(Pr*D),Zr=lt/w,pi=V(Xt*_(et/2)/_(lt/2)),zi=pi/V(Zr*Hr*Pr),Ki=1/(pi*V(Zr*Hr*Pr));return Ke(zi,Ki,Hr,Pr,Zr)}function pe(){var et=65*T,lt=60*T,Tt=20,Lt=200,Vt=y.geoProjectionMutator(O),Nt=Vt(et,lt,Tt,Lt);return Nt.poleline=function(Xt){return arguments.length?Vt(et=+Xt*T,lt,Tt,Lt):et*C},Nt.parallels=function(Xt){return arguments.length?Vt(et,lt=+Xt*T,Tt,Lt):lt*C},Nt.inflation=function(Xt){return arguments.length?Vt(et,lt,Tt=+Xt,Lt):Tt},Nt.ratio=function(Xt){return arguments.length?Vt(et,lt,Tt,Lt=+Xt):Lt},Nt.scale(163.775)}function Ie(){return pe().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Fe=4*w+3*V(3),qe=2*V(2*w*V(3)/Fe),Mt=vt(qe*V(3)/w,qe,Fe/6);function jt(){return y.geoProjection(Mt).scale(176.84)}function tr(et,lt){return[et*V(1-3*lt*lt/(w*w)),lt]}tr.invert=function(et,lt){return[et/V(1-3*lt*lt/(w*w)),lt]};function kr(){return y.geoProjection(tr).scale(152.63)}function Vr(et,lt){var Tt=a(lt),Lt=a(et)*Tt,Vt=1-Lt,Nt=a(et=n(_(et)*Tt,-_(lt))),Xt=_(et);return Tt=V(1-Lt*Lt),[Xt*Tt-Nt*Vt,-Nt*Tt-Xt*Vt]}Vr.invert=function(et,lt){var Tt=(et*et+lt*lt)/-2,Lt=V(-Tt*(2+Tt)),Vt=lt*Tt+et*Lt,Nt=et*Tt-lt*Lt,Xt=V(Nt*Nt+Vt*Vt);return[n(Lt*Vt,Xt*(1+Tt)),Xt?-B(Lt*Nt/Xt):0]};function Wr(){return y.geoProjection(Vr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Ti(et,lt){var Tt=be(et,lt);return[(Tt[0]+et/D)/2,(Tt[1]+lt)/2]}Ti.invert=function(et,lt){var Tt=et,Lt=lt,Vt=25;do{var Nt=a(Lt),Xt=_(Lt),Pr=_(2*Lt),Hr=Xt*Xt,Zr=Nt*Nt,pi=_(Tt),zi=a(Tt/2),Ki=_(Tt/2),rn=Ki*Ki,kn=1-Zr*zi*zi,Qn=kn?U(Nt*zi)*V(Ca=1/kn):Ca=0,Ca,Ta=.5*(2*Qn*Nt*Ki+Tt/D)-et,Ba=.5*(Qn*Xt+Lt)-lt,xo=.5*Ca*(Zr*rn+Qn*Nt*zi*Hr)+.5/D,Go=Ca*(pi*Pr/4-Qn*Xt*Ki),Bo=.125*Ca*(Pr*Ki-Qn*Xt*Zr*pi),_s=.5*Ca*(Hr*zi+Qn*rn*Nt)+.5,wl=Go*Bo-_s*xo,Al=(Ba*Go-Ta*_s)/wl,Us=(Ta*Bo-Ba*xo)/wl;Tt-=Al,Lt-=Us}while((P(Al)>f||P(Us)>f)&&--Vt>0);return[Tt,Lt]};function Vi(){return y.geoProjection(Ti).scale(158.837)}d.geoNaturalEarth=y.geoNaturalEarth1,d.geoNaturalEarthRaw=y.geoNaturalEarth1Raw,d.geoAiry=he,d.geoAiryRaw=ee,d.geoAitoff=ve,d.geoAitoffRaw=be,d.geoArmadillo=re,d.geoArmadilloRaw=ce,d.geoAugust=ne,d.geoAugustRaw=ge,d.geoBaker=J,d.geoBakerRaw=oe,d.geoBerghaus=fe,d.geoBerghausRaw=me,d.geoBertin1953=_t,d.geoBertin1953Raw=tt,d.geoBoggs=xt,d.geoBoggsRaw=nt,d.geoBonne=vr,d.geoBonneRaw=Qt,d.geoBottomley=Yr,d.geoBottomleyRaw=mr,d.geoBromley=Lr,d.geoBromleyRaw=ii,d.geoChamberlin=ye,d.geoChamberlinRaw=Xe,d.geoChamberlinAfrica=De,d.geoCollignon=He,d.geoCollignonRaw=Pe,d.geoCraig=ht,d.geoCraigRaw=at,d.geoCraster=Yt,d.geoCrasterRaw=Wt,d.geoCylindricalEqualArea=zr,d.geoCylindricalEqualAreaRaw=hr,d.geoCylindricalStereographic=br,d.geoCylindricalStereographicRaw=Dr,d.geoEckert1=un,d.geoEckert1Raw=fi,d.geoEckert2=yn,d.geoEckert2Raw=cn,d.geoEckert3=Sn,d.geoEckert3Raw=Gn,d.geoEckert4=va,d.geoEckert4Raw=dn,d.geoEckert5=Kt,d.geoEckert5Raw=na,d.geoEckert6=_r,d.geoEckert6Raw=lr,d.geoEisenlohr=qi,d.geoEisenlohrRaw=di,d.geoFahey=Ln,d.geoFaheyRaw=Hi,d.geoFoucaut=Kn,d.geoFoucautRaw=Fn,d.geoFoucautSinusoidal=sa,d.geoFoucautSinusoidalRaw=Jn,d.geoGilbert=io,d.geoGingery=ai,d.geoGingeryRaw=Ft,d.geoGinzburg4=li,d.geoGinzburg4Raw=Gr,d.geoGinzburg5=xi,d.geoGinzburg5Raw=Pi,d.geoGinzburg6=xr,d.geoGinzburg6Raw=zt,d.geoGinzburg8=Ri,d.geoGinzburg8Raw=Qr,d.geoGinzburg9=_n,d.geoGinzburg9Raw=en,d.geoGringorten=ea,d.geoGringortenRaw=Wi,d.geoGuyou=fs,d.geoGuyouRaw=Wo,d.geoHammer=Be,d.geoHammerRaw=Ce,d.geoHammerRetroazimuthal=rl,d.geoHammerRetroazimuthalRaw=_l,d.geoHealpix=Il,d.geoHealpixRaw=Gl,d.geoHill=ou,d.geoHillRaw=Jl,d.geoHomolosine=is,d.geoHomolosineRaw=su,d.geoHufnagel=pl,d.geoHufnagelRaw=tu,d.geoHyperelliptical=Ps,d.geoHyperellipticalRaw=bo,d.geoInterrupt=ls,d.geoInterruptedBoggs=ic,d.geoInterruptedHomolosine=Hl,d.geoInterruptedMollweide=hu,d.geoInterruptedMollweideHemispheres=Ah,d.geoInterruptedSinuMollweide=gh,d.geoInterruptedSinusoidal=Nf,d.geoKavrayskiy7=Kc,d.geoKavrayskiy7Raw=Vl,d.geoLagrange=xc,d.geoLagrangeRaw=rd,d.geoLarrivee=vh,d.geoLarriveeRaw=bc,d.geoLaskowski=gc,d.geoLaskowskiRaw=yu,d.geoLittrow=ru,d.geoLittrowRaw=hl,d.geoLoximuthal=Uc,d.geoLoximuthalRaw=Fh,d.geoMiller=Mu,d.geoMillerRaw=Jh,d.geoModifiedStereographic=vc,d.geoModifiedStereographicRaw=Xd,d.geoModifiedStereographicAlaska=yh,d.geoModifiedStereographicGs48=hc,d.geoModifiedStereographicGs50=id,d.geoModifiedStereographicMiller=Qh,d.geoModifiedStereographicLee=Lf,d.geoMollweide=Ae,d.geoMollweideRaw=ct,d.geoMtFlatPolarParabolic=ef,d.geoMtFlatPolarParabolicRaw=Pf,d.geoMtFlatPolarQuartic=ad,d.geoMtFlatPolarQuarticRaw=nd,d.geoMtFlatPolarSinusoidal=fd,d.geoMtFlatPolarSinusoidalRaw=_h,d.geoNaturalEarth2=Mh,d.geoNaturalEarth2Raw=Nh,d.geoNellHammer=df,d.geoNellHammerRaw=yc,d.geoInterruptedQuarticAuthalic=uu,d.geoNicolosi=Jd,d.geoNicolosiRaw=jf,d.geoPatterson=Fc,d.geoPattersonRaw=jh,d.geoPolyconic=Eu,d.geoPolyconicRaw=Jc,d.geoPolyhedral=bf,d.geoPolyhedralButterfly=Lu,d.geoPolyhedralCollignon=Id,d.geoPolyhedralWaterman=Cu,d.geoProject=Ac,d.geoGringortenQuincuncial=wr,d.geoPeirceQuincuncial=Xr,d.geoPierceQuincuncial=Xr,d.geoQuantize=Ni,d.geoQuincuncial=sd,d.geoRectangularPolyconic=hn,d.geoRectangularPolyconicRaw=Ai,d.geoRobinson=Ea,d.geoRobinsonRaw=pa,d.geoSatellite=wa,d.geoSatelliteRaw=oo,d.geoSinuMollweide=Xs,d.geoSinuMollweideRaw=So,d.geoSinusoidal=Gt,d.geoSinusoidalRaw=Et,d.geoStitch=xu,d.geoTimes=Ds,d.geoTimesRaw=Ho,d.geoTwoPointAzimuthal=eh,d.geoTwoPointAzimuthalRaw=Wl,d.geoTwoPointAzimuthalUsa=Mc,d.geoTwoPointEquidistant=th,d.geoTwoPointEquidistantRaw=$c,d.geoTwoPointEquidistantUsa=Hh,d.geoVanDerGrinten=Wu,d.geoVanDerGrintenRaw=Vh,d.geoVanDerGrinten2=cs,d.geoVanDerGrinten2Raw=Wh,d.geoVanDerGrinten3=rh,d.geoVanDerGrinten3Raw=Fs,d.geoVanDerGrinten4=ld,d.geoVanDerGrinten4Raw=tc,d.geoWagner=pe,d.geoWagner7=Ie,d.geoWagnerRaw=O,d.geoWagner4=jt,d.geoWagner4Raw=Mt,d.geoWagner6=kr,d.geoWagner6Raw=tr,d.geoWiechel=Wr,d.geoWiechelRaw=Vr,d.geoWinkel3=Vi,d.geoWinkel3Raw=Ti,Object.defineProperty(d,"__esModule",{value:!0})})}),pX=ze((te,Y)=>{var d=ri(),y=ji(),z=as(),P=Math.PI/180,i=180/Math.PI,n={cursor:"pointer"},a={cursor:"auto"};function l(C,T){var N=C.projection,B;return T._isScoped?B=s:T._isClipped?B=m:B=h,B(C,N)}Y.exports=l;function o(C,T){return d.behavior.zoom().translate(T.translate()).scale(T.scale())}function u(C,T,N){var B=C.id,U=C.graphDiv,V=U.layout,W=V[B],F=U._fullLayout,H=F[B],q={},G={};function ee(he,be){q[B+"."+he]=y.nestedProperty(W,he).get(),z.call("_storeDirectGUIEdit",V,F._preGUI,q);var ve=y.nestedProperty(H,he);ve.get()!==be&&(ve.set(be),y.nestedProperty(W,he).set(be),G[B+"."+he]=be)}N(ee),ee("projection.scale",T.scale()/C.fitScale),ee("fitbounds",!1),U.emit("plotly_relayout",G)}function s(C,T){var N=o(C,T);function B(){d.select(this).style(n)}function U(){T.scale(d.event.scale).translate(d.event.translate),C.render(!0);var F=T.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.center.lon":F[0],"geo.center.lat":F[1]})}function V(F){var H=T.invert(C.midPt);F("center.lon",H[0]),F("center.lat",H[1])}function W(){d.select(this).style(a),u(C,T,V)}return N.on("zoomstart",B).on("zoom",U).on("zoomend",W),N}function h(C,T){var N=o(C,T),B=2,U,V,W,F,H,q,G,ee,he;function be(se){return T.invert(se)}function ve(se){var _e=be(se);if(!_e)return!0;var oe=T(_e);return Math.abs(oe[0]-se[0])>B||Math.abs(oe[1]-se[1])>B}function ce(){d.select(this).style(n),U=d.mouse(this),V=T.rotate(),W=T.translate(),F=V,H=be(U)}function re(){if(q=d.mouse(this),ve(U)){N.scale(T.scale()),N.translate(T.translate());return}T.scale(d.event.scale),T.translate([W[0],d.event.translate[1]]),H?be(q)&&(ee=be(q),G=[F[0]+(ee[0]-H[0]),V[1],V[2]],T.rotate(G),F=G):(U=q,H=be(U)),he=!0,C.render(!0);var se=T.rotate(),_e=T.invert(C.midPt);C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.center.lon":_e[0],"geo.center.lat":_e[1],"geo.projection.rotation.lon":-se[0]})}function ge(){d.select(this).style(a),he&&u(C,T,ne)}function ne(se){var _e=T.rotate(),oe=T.invert(C.midPt);se("projection.rotation.lon",-_e[0]),se("center.lon",oe[0]),se("center.lat",oe[1])}return N.on("zoomstart",ce).on("zoom",re).on("zoomend",ge),N}function m(C,T){T.rotate(),T.scale();var N=o(C,T),B=g(N,"zoomstart","zoom","zoomend"),U=0,V=N.on,W;N.on("zoomstart",function(){d.select(this).style(n);var ee=d.mouse(this),he=T.rotate(),be=he,ve=T.translate(),ce=x(he);W=b(T,ee),V.call(N,"zoom",function(){var re=d.mouse(this);if(T.scale(d.event.scale),!W)ee=re,W=b(T,ee);else if(b(T,re)){T.rotate(he).translate(ve);var ge=b(T,re),ne=A(W,ge),se=E(_(ce,ne)),_e=f(se,W,be);(!isFinite(_e[0])||!isFinite(_e[1])||!isFinite(_e[2]))&&(_e=be),T.rotate(_e),be=_e}H(B.of(this,arguments))}),F(B.of(this,arguments))}).on("zoomend",function(){d.select(this).style(a),V.call(N,"zoom",null),q(B.of(this,arguments)),u(C,T,G)}).on("zoom.redraw",function(){C.render(!0);var ee=T.rotate();C.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":T.scale()/C.fitScale,"geo.projection.rotation.lon":-ee[0],"geo.projection.rotation.lat":-ee[1]})});function F(ee){U++||ee({type:"zoomstart"})}function H(ee){ee({type:"zoom"})}function q(ee){--U||ee({type:"zoomend"})}function G(ee){var he=T.rotate();ee("projection.rotation.lon",-he[0]),ee("projection.rotation.lat",-he[1])}return d.rebind(N,B,"on")}function b(C,T){var N=C.invert(T);return N&&isFinite(N[0])&&isFinite(N[1])&&I(N)}function x(C){var T=.5*C[0]*P,N=.5*C[1]*P,B=.5*C[2]*P,U=Math.sin(T),V=Math.cos(T),W=Math.sin(N),F=Math.cos(N),H=Math.sin(B),q=Math.cos(B);return[V*F*q+U*W*H,U*F*q-V*W*H,V*W*q+U*F*H,V*F*H-U*W*q]}function _(C,T){var N=C[0],B=C[1],U=C[2],V=C[3],W=T[0],F=T[1],H=T[2],q=T[3];return[N*W-B*F-U*H-V*q,N*F+B*W+U*q-V*H,N*H-B*q+U*W+V*F,N*q+B*H-U*F+V*W]}function A(C,T){if(!(!C||!T)){var N=p(C,T),B=Math.sqrt(M(N,N)),U=.5*Math.acos(Math.max(-1,Math.min(1,M(C,T)))),V=Math.sin(U)/B;return B&&[Math.cos(U),N[2]*V,-N[1]*V,N[0]*V]}}function f(C,T,N){var B=D(T,2,C[0]);B=D(B,1,C[1]),B=D(B,0,C[2]-N[2]);var U=T[0],V=T[1],W=T[2],F=B[0],H=B[1],q=B[2],G=Math.atan2(V,U)*i,ee=Math.sqrt(U*U+V*V),he,be;Math.abs(H)>ee?(be=(H>0?90:-90)-G,he=0):(be=Math.asin(H/ee)*i-G,he=Math.sqrt(ee*ee-H*H));var ve=180-be-2*G,ce=(Math.atan2(q,F)-Math.atan2(W,he))*i,re=(Math.atan2(q,F)-Math.atan2(W,-he))*i,ge=k(N[0],N[1],be,ce),ne=k(N[0],N[1],ve,re);return ge<=ne?[be,ce,N[2]]:[ve,re,N[2]]}function k(C,T,N,B){var U=w(N-C),V=w(B-T);return Math.sqrt(U*U+V*V)}function w(C){return(C%360+540)%360-180}function D(C,T,N){var B=N*P,U=C.slice(),V=T===0?1:0,W=T===2?1:2,F=Math.cos(B),H=Math.sin(B);return U[V]=C[V]*F-C[W]*H,U[W]=C[W]*F+C[V]*H,U}function E(C){return[Math.atan2(2*(C[0]*C[1]+C[2]*C[3]),1-2*(C[1]*C[1]+C[2]*C[2]))*i,Math.asin(Math.max(-1,Math.min(1,2*(C[0]*C[2]-C[3]*C[1]))))*i,Math.atan2(2*(C[0]*C[3]+C[1]*C[2]),1-2*(C[2]*C[2]+C[3]*C[3]))*i]}function I(C){var T=C[0]*P,N=C[1]*P,B=Math.cos(N);return[B*Math.cos(T),B*Math.sin(T),Math.sin(N)]}function M(C,T){for(var N=0,B=0,U=C.length;B{var d=ri(),y=mD(),z=y.geoPath,P=y.geoDistance,i=dX(),n=as(),a=ji(),l=a.strTranslate,o=Xi(),u=Zs(),s=hf(),h=sh(),m=Os(),b=Jm().getAutoRange,x=jp(),_=Ef().prepSelect,A=Ef().clearOutline,f=Ef().selectOnClick,k=pX(),w=S6(),D=W_(),E=qC(),I=fD().feature;function M(N){this.id=N.id,this.graphDiv=N.graphDiv,this.container=N.container,this.topojsonURL=N.topojsonURL,this.isStatic=N.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var p=M.prototype;Y.exports=function(N){return new M(N)},p.plot=function(N,B,U,V){var W=this;if(V)return W.update(N,B,!0);W._geoCalcData=N,W._fullLayout=B;var F=B[this.id],H=[],q=!1;for(var G in w.layerNameToAdjective)if(G!=="frame"&&F["show"+G]){q=!0;break}for(var ee=!1,he=0;he0&&H._module.calcGeoJSON(F,B)}if(!U){var q=this.updateProjection(N,B);if(q)return;(!this.viewInitial||this.scope!==V.scope)&&this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),h.generalUpdatePerTraceModule(this.graphDiv,this,N,V);var G=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=G.selectAll(".point"),this.dataPoints.text=G.selectAll("text"),this.dataPaths.line=G.selectAll(".js-line");var ee=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=ee.selectAll("path"),this._render()},p.updateProjection=function(N,B){var U=this.graphDiv,V=B[this.id],W=B._size,F=V.domain,H=V.projection,q=V.lonaxis,G=V.lataxis,ee=q._ax,he=G._ax,be=this.projection=g(V),ve=[[W.l+W.w*F.x[0],W.t+W.h*(1-F.y[1])],[W.l+W.w*F.x[1],W.t+W.h*(1-F.y[0])]],ce=V.center||{},re=H.rotation||{},ge=q.range||[],ne=G.range||[];if(V.fitbounds){ee._length=ve[1][0]-ve[0][0],he._length=ve[1][1]-ve[0][1],ee.range=b(U,ee),he.range=b(U,he);var se=(ee.range[0]+ee.range[1])/2,_e=(he.range[0]+he.range[1])/2;if(V._isScoped)ce={lon:se,lat:_e};else if(V._isClipped){ce={lon:se,lat:_e},re={lon:se,lat:_e,roll:re.roll};var oe=H.type,J=w.lonaxisSpan[oe]/2||180,me=w.lataxisSpan[oe]/2||90;ge=[se-J,se+J],ne=[_e-me,_e+me]}else ce={lon:se,lat:_e},re={lon:se,lat:re.lat,roll:re.roll}}be.center([ce.lon-re.lon,ce.lat-re.lat]).rotate([-re.lon,-re.lat,re.roll]).parallels(H.parallels);var fe=T(ge,ne);be.fitExtent(ve,fe);var Ce=this.bounds=be.getBounds(fe),Re=this.fitScale=be.scale(),Be=be.translate();if(V.fitbounds){var Ze=be.getBounds(T(ee.range,he.range)),Ge=Math.min((Ce[1][0]-Ce[0][0])/(Ze[1][0]-Ze[0][0]),(Ce[1][1]-Ce[0][1])/(Ze[1][1]-Ze[0][1]));isFinite(Ge)?be.scale(Ge*Re):a.warn("Something went wrong during"+this.id+"fitbounds computations.")}else be.scale(H.scale*Re);var tt=this.midPt=[(Ce[0][0]+Ce[1][0])/2,(Ce[0][1]+Ce[1][1])/2];if(be.translate([Be[0]+(tt[0]-Be[0]),Be[1]+(tt[1]-Be[1])]).clipExtent(Ce),V._isAlbersUsa){var _t=be([ce.lon,ce.lat]),mt=be.translate();be.translate([mt[0]-(_t[0]-mt[0]),mt[1]-(_t[1]-mt[1])])}},p.updateBaseLayers=function(N,B){var U=this,V=U.topojson,W=U.layers,F=U.basePaths;function H(ve){return ve==="lonaxis"||ve==="lataxis"}function q(ve){return!!w.lineLayers[ve]}function G(ve){return!!w.fillLayers[ve]}var ee=this.hasChoropleth?w.layersForChoropleth:w.layers,he=ee.filter(function(ve){return q(ve)||G(ve)?B["show"+ve]:H(ve)?B[ve].showgrid:!0}),be=U.framework.selectAll(".layer").data(he,String);be.exit().each(function(ve){delete W[ve],delete F[ve],d.select(this).remove()}),be.enter().append("g").attr("class",function(ve){return"layer "+ve}).each(function(ve){var ce=W[ve]=d.select(this);ve==="bg"?U.bgRect=ce.append("rect").style("pointer-events","all"):H(ve)?F[ve]=ce.append("path").style("fill","none"):ve==="backplot"?ce.append("g").classed("choroplethlayer",!0):ve==="frontplot"?ce.append("g").classed("scatterlayer",!0):q(ve)?F[ve]=ce.append("path").style("fill","none").style("stroke-miterlimit",2):G(ve)&&(F[ve]=ce.append("path").style("stroke","none"))}),be.order(),be.each(function(ve){var ce=F[ve],re=w.layerNameToAdjective[ve];ve==="frame"?ce.datum(w.sphereSVG):q(ve)||G(ve)?ce.datum(I(V,V.objects[ve])):H(ve)&&ce.datum(C(ve,B,N)).call(o.stroke,B[ve].gridcolor).call(u.dashLine,B[ve].griddash,B[ve].gridwidth),q(ve)?ce.call(o.stroke,B[re+"color"]).call(u.dashLine,"",B[re+"width"]):G(ve)&&ce.call(o.fill,B[re+"color"])})},p.updateDims=function(N,B){var U=this.bounds,V=(B.framewidth||0)/2,W=U[0][0]-V,F=U[0][1]-V,H=U[1][0]-W+V,q=U[1][1]-F+V;u.setRect(this.clipRect,W,F,H,q),this.bgRect.call(u.setRect,W,F,H,q).call(o.fill,B.bgcolor),this.xaxis._offset=W,this.xaxis._length=H,this.yaxis._offset=F,this.yaxis._length=q},p.updateFx=function(N,B){var U=this,V=U.graphDiv,W=U.bgRect,F=N.dragmode,H=N.clickmode;if(U.isStatic)return;function q(){var be=U.viewInitial,ve={};for(var ce in be)ve[U.id+"."+ce]=be[ce];n.call("_guiRelayout",V,ve),V.emit("plotly_doubleclick",null)}function G(be){return U.projection.invert([be[0]+U.xaxis._offset,be[1]+U.yaxis._offset])}var ee=function(be,ve){if(ve.isRect){var ce=be.range={};ce[U.id]=[G([ve.xmin,ve.ymin]),G([ve.xmax,ve.ymax])]}else{var re=be.lassoPoints={};re[U.id]=ve.map(G)}},he={element:U.bgRect.node(),gd:V,plotinfo:{id:U.id,xaxis:U.xaxis,yaxis:U.yaxis,fillRangeItems:ee},xaxes:[U.xaxis],yaxes:[U.yaxis],subplot:U.id,clickFn:function(be){be===2&&A(V)}};F==="pan"?(W.node().onmousedown=null,W.call(k(U,B)),W.on("dblclick.zoom",q),V._context._scrollZoom.geo||W.on("wheel.zoom",null)):(F==="select"||F==="lasso")&&(W.on(".zoom",null),he.prepFn=function(be,ve,ce){_(be,ve,ce,he,F)},x.init(he)),W.on("mousemove",function(){var be=U.projection.invert(a.getPositionFromD3Event());if(!be)return x.unhover(V,d.event);U.xaxis.p2c=function(){return be[0]},U.yaxis.p2c=function(){return be[1]},s.hover(V,d.event,U.id)}),W.on("mouseout",function(){V._dragging||x.unhover(V,d.event)}),W.on("click",function(){F!=="select"&&F!=="lasso"&&(H.indexOf("select")>-1&&f(d.event,V,[U.xaxis],[U.yaxis],U.id,he),H.indexOf("event")>-1&&s.click(V,d.event))})},p.makeFramework=function(){var N=this,B=N.graphDiv,U=B._fullLayout,V="clip"+U._uid+N.id;N.clipDef=U._clips.append("clipPath").attr("id",V),N.clipRect=N.clipDef.append("rect"),N.framework=d.select(N.container).append("g").attr("class","geo "+N.id).call(u.setClipUrl,V,B),N.project=function(W){var F=N.projection(W);return F?[F[0]-N.xaxis._offset,F[1]-N.yaxis._offset]:[null,null]},N.xaxis={_id:"x",c2p:function(W){return N.project(W)[0]}},N.yaxis={_id:"y",c2p:function(W){return N.project(W)[1]}},N.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},m.setConvert(N.mockAxis,U)},p.saveViewInitial=function(N){var B=N.center||{},U=N.projection,V=U.rotation||{};this.viewInitial={fitbounds:N.fitbounds,"projection.scale":U.scale};var W;N._isScoped?W={"center.lon":B.lon,"center.lat":B.lat}:N._isClipped?W={"projection.rotation.lon":V.lon,"projection.rotation.lat":V.lat}:W={"center.lon":B.lon,"center.lat":B.lat,"projection.rotation.lon":V.lon},a.extendFlat(this.viewInitial,W)},p.render=function(N){this._hasMarkerAngles&&N?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var N=this.projection,B=N.getPath(),U;function V(F){var H=N(F.lonlat);return H?l(H[0],H[1]):null}function W(F){return N.isLonLatOverEdges(F.lonlat)?"none":null}for(U in this.basePaths)this.basePaths[U].attr("d",B);for(U in this.dataPaths)this.dataPaths[U].attr("d",function(F){return B(F.geojson)});for(U in this.dataPoints)this.dataPoints[U].attr("display",W).attr("transform",V)};function g(N){var B=N.projection,U=B.type,V=w.projNames[U];V="geo"+a.titleCase(V);for(var W=y[V]||i[V],F=W(),H=N._isSatellite?Math.acos(1/B.distance)*180/Math.PI:N._isClipped?w.lonaxisSpan[U]/2:null,q=["center","rotate","parallels","clipExtent"],G=function(be){return be?F:[]},ee=0;eere}else return!1},F.getPath=function(){return z().projection(F)},F.getBounds=function(be){return F.getPath().bounds(be)},F.precision(w.precision),N._isSatellite&&F.tilt(B.tilt).distance(B.distance),H&&F.clipAngle(H-w.clipPad),F}function C(N,B,U){var V=1e-6,W=2.5,F=B[N],H=w.scopeDefaults[B.scope],q,G,ee;N==="lonaxis"?(q=H.lonaxisRange,G=H.lataxisRange,ee=function(_e,oe){return[_e,oe]}):N==="lataxis"&&(q=H.lataxisRange,G=H.lonaxisRange,ee=function(_e,oe){return[oe,_e]});var he={type:"linear",range:[q[0],q[1]-V],tick0:F.tick0,dtick:F.dtick};m.setConvert(he,U);var be=m.calcTicks(he);!B.isScoped&&N==="lonaxis"&&be.pop();for(var ve=be.length,ce=new Array(ve),re=0;re0&&W<0&&(W+=360);var q=(W-V)/4;return{type:"Polygon",coordinates:[[[V,F],[V,H],[V+q,H],[V+2*q,H],[V+3*q,H],[W,H],[W,F],[W-q,F],[W-2*q,F],[W-3*q,F],[V,F]]]}}}),gD=ze((te,Y)=>{var d=Mi(),y=Xh().attributes,z=qd().dash,P=S6(),i=oh().overrideAll,n=Xm(),a={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:z},l=Y.exports=i({domain:y({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:n(P.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:n(P.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:P.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:P.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:P.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:P.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:a,lataxis:a},"plot","from-root");l.uirevision={valType:"any",editType:"none"}}),gX=ze((te,Y)=>{var d=ji(),y=z_(),z=Ed().getSubplotData,P=S6(),i=gD(),n=P.axesNames;Y.exports=function(l,o,u){y(l,o,u,{type:"geo",attributes:i,handleDefaults:a,fullData:u,partition:"y"})};function a(l,o,u,s){var h=z(s.fullData,"geo",s.id),m=h.map(function(ne){return ne.index}),b=u("resolution"),x=u("scope"),_=P.scopeDefaults[x],A=u("projection.type",_.projType),f=o._isAlbersUsa=A==="albers usa";f&&(x=o.scope="usa");var k=o._isScoped=x!=="world",w=o._isSatellite=A==="satellite",D=o._isConic=A.indexOf("conic")!==-1||A==="albers",E=o._isClipped=!!P.lonaxisSpan[A];if(l.visible===!1){var I=d.extendDeep({},o._template);I.showcoastlines=!1,I.showcountries=!1,I.showframe=!1,I.showlakes=!1,I.showland=!1,I.showocean=!1,I.showrivers=!1,I.showsubunits=!1,I.lonaxis&&(I.lonaxis.showgrid=!1),I.lataxis&&(I.lataxis.showgrid=!1),o._template=I}for(var M=u("visible"),p,g=0;g0&&G<0&&(G+=360);var ee=(q+G)/2,he;if(!f){var be=k?_.projRotate:[ee,0,0];he=u("projection.rotation.lon",be[0]),u("projection.rotation.lat",be[1]),u("projection.rotation.roll",be[2]),p=u("showcoastlines",!k&&M),p&&(u("coastlinecolor"),u("coastlinewidth")),p=u("showocean",M?void 0:!1),p&&u("oceancolor")}var ve,ce;if(f?(ve=-96.6,ce=38.7):(ve=k?ee:he,ce=(H[0]+H[1])/2),u("center.lon",ve),u("center.lat",ce),w&&(u("projection.tilt"),u("projection.distance")),D){var re=_.projParallels||[0,60];u("projection.parallels",re)}u("projection.scale"),p=u("showland",M?void 0:!1),p&&u("landcolor"),p=u("showlakes",M?void 0:!1),p&&u("lakecolor"),p=u("showrivers",M?void 0:!1),p&&(u("rivercolor"),u("riverwidth")),p=u("showcountries",k&&x!=="usa"&&M),p&&(u("countrycolor"),u("countrywidth")),(x==="usa"||x==="north america"&&b===50)&&(u("showsubunits",M),u("subunitcolor"),u("subunitwidth")),k||(p=u("showframe",M),p&&(u("framecolor"),u("framewidth"))),u("bgcolor");var ge=u("fitbounds");ge&&(delete o.projection.scale,k?(delete o.center.lon,delete o.center.lat):E?(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon,delete o.projection.rotation.lat,delete o.lonaxis.range,delete o.lataxis.range):(delete o.center.lon,delete o.center.lat,delete o.projection.rotation.lon))}}),vD=ze((te,Y)=>{var d=Ed().getSubplotCalcData,y=ji().counterRegex,z=mX(),P="geo",i=y(P),n={};n[P]={valType:"subplotid",dflt:P,editType:"calc"};function a(u){for(var s=u._fullLayout,h=u.calcdata,m=s._subplots[P],b=0;b{Y.exports={attributes:Lb(),supplyDefaults:nX(),colorbar:Mo(),formatLabels:aX(),calc:WC(),calcGeoJSON:pD().calcGeoJSON,plot:pD().plot,style:dD(),styleOnSelect:El().styleOnSelect,hoverPoints:cX(),eventData:hX(),selectPoints:fX(),moduleType:"trace",name:"scattergeo",basePlotModule:vD(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}),yX=ze((te,Y)=>{Y.exports=vX()}),qw=ze((te,Y)=>{var{hovertemplateAttrs:d,templatefallbackAttrs:y}=rc(),z=Lb(),P=Oc(),i=xa(),n=Mi().defaultLine,a=nn().extendFlat,l=z.marker.line;Y.exports=a({locations:{valType:"data_array",editType:"calc"},locationmode:z.locationmode,z:{valType:"data_array",editType:"calc"},geojson:a({},z.geojson,{}),featureidkey:z.featureidkey,text:a({},z.text,{}),hovertext:a({},z.hovertext,{}),marker:{line:{color:a({},l.color,{dflt:n}),width:a({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:z.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:z.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:a({},i.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:d(),hovertemplatefallback:y(),showlegend:a({},i.showlegend,{dflt:!1})},P("",{cLetter:"z",editTypeOverride:"calc"}))}),_X=ze((te,Y)=>{var d=ji(),y=Cc(),z=qw(),P=["The library used by the *country names* `locationmode` option is changing in the next major version.","Some country names in existing plots may not work in the new version.","To ensure consistent behavior, consider setting `locationmode` to *ISO-3*."].join(" ");Y.exports=function(i,n,a,l){function o(_,A){return d.coerce(i,n,z,_,A)}var u=o("locations"),s=o("z");if(!(u&&u.length&&d.isArrayOrTypedArray(s)&&s.length)){n.visible=!1;return}n._length=Math.min(u.length,s.length);var h=o("geojson"),m;(typeof h=="string"&&h!==""||d.isPlainObject(h))&&(m="geojson-id");var b=o("locationmode",m);b==="country names"&&d.warn(P),b==="geojson-id"&&o("featureidkey"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback");var x=o("marker.line.width");x&&o("marker.line.color"),o("marker.opacity"),y(i,n,l,o,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(n,o)}}),KC=ze((te,Y)=>{var d=Sr(),y=ei().BADNUM,z=Tp(),P=de(),i=$e();function n(a){return a&&typeof a=="string"}Y.exports=function(a,l){var o=l._length,u=new Array(o),s;l.geojson?s=function(_){return n(_)||d(_)}:s=n;for(var h=0;h{var d=ri(),y=Xi(),z=Zs(),P=lh();function i(l,o){o&&n(l,o)}function n(l,o){var u=o[0].trace,s=o[0].node3,h=s.selectAll(".choroplethlocation"),m=u.marker||{},b=m.line||{},x=P.makeColorScaleFuncFromTrace(u);h.each(function(_){d.select(this).attr("fill",x(_.z)).call(y.stroke,_.mlc||b.color).call(z.dashLine,"",_.mlw||b.width||0).style("opacity",m.opacity)}),z.selectedPointStyle(h,u)}function a(l,o){var u=o[0].node3,s=o[0].trace;s.selectedpoints?z.selectedPointStyle(u.selectAll(".choroplethlocation"),s):n(l,o)}Y.exports={style:i,styleOnSelect:a}}),yD=ze((te,Y)=>{var d=ri(),y=ji(),z=W_(),P=qC().getTopojsonFeatures,i=Jm().findExtremes,n=YC().style;function a(o,u,s){var h=u.layers.backplot.select(".choroplethlayer");y.makeTraceGroups(h,s,"trace choropleth").each(function(m){var b=d.select(this),x=b.selectAll("path.choroplethlocation").data(y.identity);x.enter().append("path").classed("choroplethlocation",!0),x.exit().remove(),n(o,m)})}function l(o,u){for(var s=o[0].trace,h=u[s.geo],m=h._subplot,b=s.locationmode,x=s._length,_=b==="geojson-id"?z.extractTraceFeature(o):P(s,m.topojson),A=[],f=[],k=0;k{var d=Os(),y=qw(),z=ji().fillText;Y.exports=function(i,n,a){var l=i.cd,o=l[0].trace,u=i.subplot,s,h,m,b,x=[n,a],_=[n+360,a];for(h=0;h")}}}),JC=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){d.location=y.location,d.z=y.z;var n=P[i];return n.fIn&&n.fIn.properties&&(d.properties=n.fIn.properties),d.ct=n.ct,d}}),QC=ze((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l,o,u,s;if(y===!1)for(a=0;a{Y.exports={attributes:qw(),supplyDefaults:_X(),colorbar:D_(),calc:KC(),calcGeoJSON:yD().calcGeoJSON,plot:yD().plot,style:YC().style,styleOnSelect:YC().styleOnSelect,hoverPoints:XC(),eventData:JC(),selectPoints:QC(),moduleType:"trace",name:"choropleth",basePlotModule:vD(),categories:["geo","noOpacity","showLegend"],meta:{}}}),bX=ze((te,Y)=>{Y.exports=xX()}),eA=ze((te,Y)=>{var d=as(),y=ji(),z=qu();function P(n,a,l,o){var u=n.cd,s=u[0].t,h=u[0].trace,m=n.xa,b=n.ya,x=s.x,_=s.y,A=m.c2p(a),f=b.c2p(l),k=n.distance,w;if(s.tree){var D=m.p2c(A-k),E=m.p2c(A+k),I=b.p2c(f-k),M=b.p2c(f+k);o==="x"?w=s.tree.range(Math.min(D,E),Math.min(b._rl[0],b._rl[1]),Math.max(D,E),Math.max(b._rl[0],b._rl[1])):w=s.tree.range(Math.min(D,E),Math.min(I,M),Math.max(D,E),Math.max(I,M))}else w=s.ids;var p,g,C,T,N,B,U,V,W,F=k;if(o==="x"){var H=!!h.xperiodalignment,q=!!h.yperiodalignment;for(N=0;N=Math.min(G,ee)&&A<=Math.max(G,ee)?0:1/0}if(B=Math.min(he,be)&&f<=Math.max(he,be)?0:1/0}W=Math.sqrt(B*B+U*U),g=w[N]}}}else for(N=w.length-1;N>-1;N--)p=w[N],C=x[p],T=_[p],B=m.c2p(C)-A,U=b.c2p(T)-f,V=Math.sqrt(B*B+U*U),V{var d=20;Y.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:d,SYMBOL_STROKE:d/20,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}}),A6=ze((te,Y)=>{var d=xa(),y=On(),z=Lm(),P=ff(),i=Sh().axisHoverFormat,n=Oc(),a=Xm(),l=nn().extendFlat,o=oh().overrideAll,u=q_().DASHES,s=P.line,h=P.marker,m=h.line,b=Y.exports=o({x:P.x,x0:P.x0,dx:P.dx,y:P.y,y0:P.y0,dy:P.dy,xperiod:P.xperiod,yperiod:P.yperiod,xperiod0:P.xperiod0,yperiod0:P.yperiod0,xperiodalignment:P.xperiodalignment,yperiodalignment:P.yperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),text:P.text,hovertext:P.hovertext,textposition:P.textposition,textfont:y({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:s.color,width:s.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:a(u),dflt:"solid"}},marker:l({},n("marker"),{symbol:h.symbol,angle:h.angle,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,opacity:h.opacity,colorbar:h.colorbar,line:l({},n("marker.line"),{width:m.width})}),connectgaps:P.connectgaps,fill:l({},P.fill,{dflt:"none"}),fillcolor:z(),selected:{marker:P.selected.marker,textfont:P.selected.textfont},unselected:{marker:P.unselected.marker,textfont:P.unselected.textfont},opacity:d.opacity},"calc","nested");b.x.editType=b.y.editType=b.x0.editType=b.y0.editType="calc+clearAxisTypes",b.hovertemplate=P.hovertemplate,b.hovertemplatefallback=P.hovertemplatefallback,b.texttemplate=P.texttemplate,b.texttemplatefallback=P.texttemplatefallback}),tA=ze(te=>{var Y=q_();te.isOpenSymbol=function(d){return typeof d=="string"?Y.OPEN_RE.test(d):d%200>100},te.isDotSymbol=function(d){return typeof d=="string"?Y.DOT_RE.test(d):d>200}}),wX=ze((te,Y)=>{var d=ji(),y=as(),z=tA(),P=A6(),i=Mg(),n=Bc(),a=Jg(),l=S0(),o=X0(),u=Pm(),s=Im(),h=mm();Y.exports=function(m,b,x,_){function A(p,g){return d.coerce(m,b,P,p,g)}var f=m.marker?z.isOpenSymbol(m.marker.symbol):!1,k=n.isBubble(m),w=a(m,b,_,A);if(!w){b.visible=!1;return}l(m,b,_,A),A("xhoverformat"),A("yhoverformat");var D=w{var d=Ys();Y.exports=function(y,z,P){var i=y.i;return"x"in y||(y.x=z._x[i]),"y"in y||(y.y=z._y[i]),d(y,z,P)}}),TX=ze((te,Y)=>{function d(a,l,o,u,s){for(var h=s+1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>=0?(h=m,s=m-1):u=m+1}return h}function y(a,l,o,u,s){for(var h=s+1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x>0?(h=m,s=m-1):u=m+1}return h}function z(a,l,o,u,s){for(var h=u-1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<0?(h=m,u=m+1):s=m-1}return h}function P(a,l,o,u,s){for(var h=u-1;u<=s;){var m=u+s>>>1,b=a[m],x=o!==void 0?o(b,l):b-l;x<=0?(h=m,u=m+1):s=m-1}return h}function i(a,l,o,u,s){for(;u<=s;){var h=u+s>>>1,m=a[h],b=o!==void 0?o(m,l):m-l;if(b===0)return h;b<=0?u=h+1:s=h-1}return-1}function n(a,l,o,u,s,h){return typeof o=="function"?h(a,l,o,u===void 0?0:u|0,s===void 0?a.length-1:s|0):h(a,l,void 0,o===void 0?0:o|0,u===void 0?a.length-1:u|0)}Y.exports={ge:function(a,l,o,u,s){return n(a,l,o,u,s,d)},gt:function(a,l,o,u,s){return n(a,l,o,u,s,y)},lt:function(a,l,o,u,s){return n(a,l,o,u,s,z)},le:function(a,l,o,u,s){return n(a,l,o,u,s,P)},eq:function(a,l,o,u,s){return n(a,l,o,u,s,i)}}}),Qv=ze((te,Y)=>{Y.exports=function(z,P,i){var n={},a,l;if(typeof P=="string"&&(P=y(P)),Array.isArray(P)){var o={};for(l=0;l{var d=Qv();Y.exports=y;function y(z){var P;return arguments.length>1&&(z=arguments),typeof z=="string"?z=z.split(/\s/).map(parseFloat):typeof z=="number"&&(z=[z]),z.length&&typeof z[0]=="number"?z.length===1?P={width:z[0],height:z[0],x:0,y:0}:z.length===2?P={width:z[0],height:z[1],x:0,y:0}:P={x:z[0],y:z[1],width:z[2]-z[0]||0,height:z[3]-z[1]||0}:z&&(z=d(z,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"}),P={x:z.left||0,y:z.top||0},z.width==null?z.right?P.width=z.right-P.x:P.width=0:P.width=z.width,z.height==null?z.bottom?P.height=z.bottom-P.y:P.height=0:P.height=z.height),P}}),Pb=ze((te,Y)=>{Y.exports=d;function d(y,z){if(!y||y.length==null)throw Error("Argument should be an array");z==null?z=1:z=Math.floor(z);for(var P=Array(z*2),i=0;in&&(n=y[l]),y[l]{Y.exports=function(){for(var d=0;d{var d=jC();Y.exports=y;function y(z,P,i){if(!z)throw new TypeError("must specify data as first parameter");if(i=+(i||0)|0,Array.isArray(z)&&z[0]&&typeof z[0][0]=="number"){var n=z[0].length,a=z.length*n,l,o,u,s;(!P||typeof P=="string")&&(P=new(d(P||"float32"))(a+i));var h=P.length-i;if(a!==h)throw new Error("source length "+a+" ("+n+"x"+z.length+") does not match destination length "+h);for(l=0,u=i;l{Y.exports=function(d){var y=typeof d;return d!==null&&(y==="object"||y==="function")}}),AX=ze((te,Y)=>{Y.exports=Math.log2||function(d){return Math.log(d)*Math.LOG2E}}),MX=ze((te,Y)=>{var d=TX(),y=k6(),z=Gw(),P=Pb(),i=Qv(),n=SX(),a=Ib(),l=CX(),o=jC(),u=AX(),s=1073741824;Y.exports=function(m,b){b||(b={}),m=a(m,"float64"),b=i(b,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let x=n(b.maxDepth,255),_=n(b.bounds,P(m,2));_[0]===_[2]&&_[2]++,_[1]===_[3]&&_[3]++;let A=h(m,_),f=m.length>>>1,k;b.dtype||(b.dtype="array"),typeof b.dtype=="string"?k=new(o(b.dtype))(f):b.dtype&&(k=b.dtype,Array.isArray(k)&&(k.length=f));for(let N=0;Nx||F>s){for(let se=0;seme||G>fe||ee=be||oe===J)return;let Ce=w[_e];J===void 0&&(J=Ce.length);for(let ct=oe;ct=V&&Oe<=F&&Le>=W&&Le<=H&&ve.push(Ae)}let Re=D[_e],Be=Re[oe*4+0],Ze=Re[oe*4+1],Ge=Re[oe*4+2],tt=Re[oe*4+3],_t=re(Re,oe+1),mt=se*.5,vt=_e+1;ce(ge,ne,mt,vt,Be,Ze||Ge||tt||_t),ce(ge,ne+mt,mt,vt,Ze,Ge||tt||_t),ce(ge+mt,ne,mt,vt,Ge,tt||_t),ce(ge+mt,ne+mt,mt,vt,tt,_t)}function re(ge,ne){let se=null,_e=0;for(;se===null;)if(se=ge[ne*4+_e],_e++,_e>ge.length)return null;return se}return ve}function C(N,B,U,V,W){let F=[];for(let H=0;H{Y.exports=MX()}),_D=ze((te,Y)=>{Y.exports=d;function d(y){var z=0,P=0,i=0,n=0;return y.map(function(a){a=a.slice();var l=a[0],o=l.toUpperCase();if(l!=o)switch(a[0]=o,l){case"a":a[6]+=i,a[7]+=n;break;case"v":a[1]+=n;break;case"h":a[1]+=i;break;default:for(var u=1;u{Object.defineProperty(te,"__esModule",{value:!0});var d=function(){function l(o,u){var s=[],h=!0,m=!1,b=void 0;try{for(var x=o[Symbol.iterator](),_;!(h=(_=x.next()).done)&&(s.push(_.value),!(u&&s.length===u));h=!0);}catch(A){m=!0,b=A}finally{try{!h&&x.return&&x.return()}finally{if(m)throw b}}return s}return function(o,u){if(Array.isArray(o))return o;if(Symbol.iterator in Object(o))return l(o,u);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=Math.PI*2,z=function(l,o,u,s,h,m,b){var x=l.x,_=l.y;x*=o,_*=u;var A=s*x-h*_,f=h*x+s*_;return{x:A+m,y:f+b}},P=function(l,o){var u=o===1.5707963267948966?.551915024494:o===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(o/4),s=Math.cos(l),h=Math.sin(l),m=Math.cos(l+o),b=Math.sin(l+o);return[{x:s-h*u,y:h+s*u},{x:m+b*u,y:b-m*u},{x:m,y:b}]},i=function(l,o,u,s){var h=l*s-o*u<0?-1:1,m=l*u+o*s;return m>1&&(m=1),m<-1&&(m=-1),h*Math.acos(m)},n=function(l,o,u,s,h,m,b,x,_,A,f,k){var w=Math.pow(h,2),D=Math.pow(m,2),E=Math.pow(f,2),I=Math.pow(k,2),M=w*D-w*I-D*E;M<0&&(M=0),M/=w*I+D*E,M=Math.sqrt(M)*(b===x?-1:1);var p=M*h/m*k,g=M*-m/h*f,C=A*p-_*g+(l+u)/2,T=_*p+A*g+(o+s)/2,N=(f-p)/h,B=(k-g)/m,U=(-f-p)/h,V=(-k-g)/m,W=i(1,0,N,B),F=i(N,B,U,V);return x===0&&F>0&&(F-=y),x===1&&F<0&&(F+=y),[C,T,W,F]},a=function(l){var o=l.px,u=l.py,s=l.cx,h=l.cy,m=l.rx,b=l.ry,x=l.xAxisRotation,_=x===void 0?0:x,A=l.largeArcFlag,f=A===void 0?0:A,k=l.sweepFlag,w=k===void 0?0:k,D=[];if(m===0||b===0)return[];var E=Math.sin(_*y/360),I=Math.cos(_*y/360),M=I*(o-s)/2+E*(u-h)/2,p=-E*(o-s)/2+I*(u-h)/2;if(M===0&&p===0)return[];m=Math.abs(m),b=Math.abs(b);var g=Math.pow(M,2)/Math.pow(m,2)+Math.pow(p,2)/Math.pow(b,2);g>1&&(m*=Math.sqrt(g),b*=Math.sqrt(g));var C=n(o,u,s,h,m,b,f,w,E,I,M,p),T=d(C,4),N=T[0],B=T[1],U=T[2],V=T[3],W=Math.abs(V)/(y/4);Math.abs(1-W)<1e-7&&(W=1);var F=Math.max(Math.ceil(W),1);V/=F;for(var H=0;H{Y.exports=y;var d=EX();function y(i){for(var n,a=[],l=0,o=0,u=0,s=0,h=null,m=null,b=0,x=0,_=0,A=i.length;_4?(l=f[f.length-4],o=f[f.length-3]):(l=b,o=x),a.push(f)}return a}function z(i,n,a,l){return["C",i,n,a,l,a,l]}function P(i,n,a,l,o,u){return["C",i/3+2/3*a,n/3+2/3*l,o/3+2/3*a,u/3+2/3*l,o,u]}}),xD=ze((te,Y)=>{Y.exports=function(d){return typeof d!="string"?!1:(d=d.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(d)&&/[\dz]$/i.test(d)&&d.length>4))}}),PX=ze((te,Y)=>{var d=M_(),y=_D(),z=LX(),P=xD(),i=i6();Y.exports=n;function n(a){if(Array.isArray(a)&&a.length===1&&typeof a[0]=="string"&&(a=a[0]),typeof a=="string"&&(i(P(a),"String is not an SVG path."),a=d(a)),i(Array.isArray(a),"Argument should be a string or an array of path segments."),a=y(a),a=z(a),!a.length)return[0,0,0,0];for(var l=[1/0,1/0,-1/0,-1/0],o=0,u=a.length;ol[2]&&(l[2]=s[h+0]),s[h+1]>l[3]&&(l[3]=s[h+1]);return l}}),IX=ze((te,Y)=>{var d=Math.PI,y=l(120);Y.exports=z;function z(o){for(var u,s=[],h=0,m=0,b=0,x=0,_=null,A=null,f=0,k=0,w=0,D=o.length;w7&&(s.push(E.splice(0,7)),E.unshift("C"));break;case"S":var M=f,p=k;(u=="C"||u=="S")&&(M+=M-h,p+=p-m),E=["C",M,p,E[1],E[2],E[3],E[4]];break;case"T":u=="Q"||u=="T"?(_=f*2-_,A=k*2-A):(_=f,A=k),E=i(f,k,_,A,E[1],E[2]);break;case"Q":_=E[1],A=E[2],E=i(f,k,E[1],E[2],E[3],E[4]);break;case"L":E=P(f,k,E[1],E[2]);break;case"H":E=P(f,k,E[1],k);break;case"V":E=P(f,k,f,E[1]);break;case"Z":E=P(f,k,b,x);break}u=I,f=E[E.length-2],k=E[E.length-1],E.length>4?(h=E[E.length-4],m=E[E.length-3]):(h=f,m=k),s.push(E)}return s}function P(o,u,s,h){return["C",o,u,s,h,s,h]}function i(o,u,s,h,m,b){return["C",o/3+2/3*s,u/3+2/3*h,m/3+2/3*s,b/3+2/3*h,m,b]}function n(o,u,s,h,m,b,x,_,A,f){if(f)T=f[0],N=f[1],g=f[2],C=f[3];else{var k=a(o,u,-m);o=k.x,u=k.y,k=a(_,A,-m),_=k.x,A=k.y;var w=(o-_)/2,D=(u-A)/2,E=w*w/(s*s)+D*D/(h*h);E>1&&(E=Math.sqrt(E),s=E*s,h=E*h);var I=s*s,M=h*h,p=(b==x?-1:1)*Math.sqrt(Math.abs((I*M-I*D*D-M*w*w)/(I*D*D+M*w*w)));p==1/0&&(p=1);var g=p*s*D/h+(o+_)/2,C=p*-h*w/s+(u+A)/2,T=Math.asin(((u-C)/h).toFixed(9)),N=Math.asin(((A-C)/h).toFixed(9));T=oN&&(T=T-d*2),!x&&N>T&&(N=N-d*2)}if(Math.abs(N-T)>y){var B=N,U=_,V=A;N=T+y*(x&&N>T?1:-1),_=g+s*Math.cos(N),A=C+h*Math.sin(N);var W=n(_,A,s,h,m,0,x,U,V,[N,B,g,C])}var F=Math.tan((N-T)/4),H=4/3*s*F,q=4/3*h*F,G=[2*o-(o+H*Math.sin(T)),2*u-(u-q*Math.cos(T)),_+H*Math.sin(N),A-q*Math.cos(N),_,A];if(f)return G;W&&(G=G.concat(W));for(var ee=0;ee{var d=_D(),y=IX(),z={M:"moveTo",C:"bezierCurveTo"};Y.exports=function(P,i){P.beginPath(),y(d(i)).forEach(function(n){var a=n[0],l=n.slice(1);P[z[a]].apply(P,l)}),P.closePath()}}),zX=ze((te,Y)=>{var d=k6();Y.exports=z;var y=1e20;function z(n,a){a||(a={});var l=a.cutoff==null?.25:a.cutoff,o=a.radius==null?8:a.radius,u=a.channel||0,s,h,m,b,x,_,A,f,k,w,D;if(ArrayBuffer.isView(n)||Array.isArray(n)){if(!a.width||!a.height)throw Error("For raw data width and height should be provided by options");s=a.width,h=a.height,b=n,a.stride?_=a.stride:_=Math.floor(n.length/s/h)}else window.HTMLCanvasElement&&n instanceof window.HTMLCanvasElement?(f=n,A=f.getContext("2d"),s=f.width,h=f.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.CanvasRenderingContext2D&&n instanceof window.CanvasRenderingContext2D?(f=n.canvas,A=n,s=f.width,h=f.height,k=A.getImageData(0,0,s,h),b=k.data,_=4):window.ImageData&&n instanceof window.ImageData&&(k=n,s=n.width,h=n.height,b=k.data,_=4);if(m=Math.max(s,h),window.Uint8ClampedArray&&b instanceof window.Uint8ClampedArray||window.Uint8Array&&b instanceof window.Uint8Array)for(x=b,b=Array(s*h),w=0,D=x.length;w{var d=PX(),y=M_(),z=DX(),P=xD(),i=zX(),n=document.createElement("canvas"),a=n.getContext("2d");Y.exports=l;function l(s,h){if(!P(s))throw Error("Argument should be valid svg path string");h||(h={});var m,b;h.shape?(m=h.shape[0],b=h.shape[1]):(m=n.width=h.w||h.width||200,b=n.height=h.h||h.height||200);var x=Math.min(m,b),_=h.stroke||0,A=h.viewbox||h.viewBox||d(s),f=[m/(A[2]-A[0]),b/(A[3]-A[1])],k=Math.min(f[0]||0,f[1]||0)/2;if(a.fillStyle="black",a.fillRect(0,0,m,b),a.fillStyle="white",_&&(typeof _!="number"&&(_=1),_>0?a.strokeStyle="white":a.strokeStyle="black",a.lineWidth=Math.abs(_)),a.translate(m*.5,b*.5),a.scale(k,k),u()){var w=new Path2D(s);a.fill(w),_&&a.stroke(w)}else{var D=y(s);z(a,D),a.fill(),_&&a.stroke()}a.setTransform(1,0,0,1,0,0);var E=i(a,{cutoff:h.cutoff!=null?h.cutoff:.5,radius:h.radius!=null?h.radius:x*.5});return E}var o;function u(){if(o!=null)return o;var s=document.createElement("canvas").getContext("2d");if(s.canvas.width=s.canvas.height=1,!window.Path2D)return o=!1;var h=new Path2D("M0,0h1v1h-1v-1Z");s.fillStyle="black",s.fill(h);var m=s.getImageData(0,0,1,1);return o=m&&m.data&&m.data[3]===255}}),Db=ze((te,Y)=>{var d=Sr(),y=OX(),z=$_(),P=as(),i=ji(),n=i.isArrayOrTypedArray,a=Zs(),l=Zc(),o=cy().formatColor,u=Bc(),s=$v(),h=tA(),m=q_(),b=so().DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},_=T0().appendArrayPointValue;function A(W,F){var H,q={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},G=W._context.plotGlPixelRatio;if(F.visible!==!0)return q;if(u.hasText(F)&&(q.text=f(W,F),q.textSel=E(W,F,F.selected),q.textUnsel=E(W,F,F.unselected)),u.hasMarkers(F)&&(q.marker=w(W,F),q.markerSel=D(W,F,F.selected),q.markerUnsel=D(W,F,F.unselected),!F.unselected&&n(F.marker.opacity))){var ee=F.marker.opacity;for(q.markerUnsel.opacity=new Array(ee.length),H=0;H500?"bold":"normal":W}function w(W,F){var H=F._length,q=F.marker,G={},ee,he=n(q.symbol),be=n(q.angle),ve=n(q.color),ce=n(q.line.color),re=n(q.opacity),ge=n(q.size),ne=n(q.line.width),se;if(he||(se=h.isOpenSymbol(q.symbol)),he||ve||ce||re||be){G.symbols=new Array(H),G.angles=new Array(H),G.colors=new Array(H),G.borderColors=new Array(H);var _e=q.symbol,oe=q.angle,J=o(q,q.opacity,H),me=o(q.line,q.opacity,H);if(!n(me[0])){var fe=me;for(me=Array(H),ee=0;eem.TOO_MANY_POINTS||u.hasMarkers(F)?"rect":"round";if(ce&&F.connectgaps){var ge=ee[0],ne=ee[1];for(he=0;he1?ve[he]:ve[0]:ve,se=n(ce)?ce.length>1?ce[he]:ce[0]:ce,_e=x[ne],oe=x[se],J=re?re/.8+1:0,me=-oe*J-oe*.5;ee.offset[he]=[_e*J/ge,me/ge]}}return ee}Y.exports={style:A,markerStyle:w,markerSelection:D,linePositions:B,errorBarPositions:U,textPosition:V}}),bD=ze((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=z._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},n={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return z._scene||(P=z._scene={},P.init=function(){d.extendFlat(P,n,i)},P.init(),P.update=function(a){var l=d.repeat(a,P.count);if(P.fill2d&&P.fill2d.update(l),P.scatter2d&&P.scatter2d.update(l),P.line2d&&P.line2d.update(l),P.error2d&&P.error2d.update(l.concat(l)),P.select2d&&P.select2d.update(l),P.glText)for(var o=0;o{var d=rA(),y=ji(),z=Zc(),P=Jm().findExtremes,i=Dm(),n=yt(),a=n.calcMarkerSize,l=n.calcAxisExpansion,o=n.setFirstScatter,u=zm(),s=Db(),h=bD(),m=ei().BADNUM,b=q_().TOO_MANY_POINTS;Y.exports=function(A,f){var k=A._fullLayout,w=f._xA=z.getFromId(A,f.xaxis,"x"),D=f._yA=z.getFromId(A,f.yaxis,"y"),E=k._plots[f.xaxis+f.yaxis],I=f._length,M=I>=b,p=I*2,g={},C,T=w.makeCalcdata(f,"x"),N=D.makeCalcdata(f,"y"),B=i(f,w,"x",T),U=i(f,D,"y",N),V=B.vals,W=U.vals;f._x=V,f._y=W,f.xperiodalignment&&(f._origX=T,f._xStarts=B.starts,f._xEnds=B.ends),f.yperiodalignment&&(f._origY=N,f._yStarts=U.starts,f._yEnds=U.ends);var F=new Array(p),H=new Array(I);for(C=0;C1&&y.extendFlat(I.line,s.linePositions(A,k,w)),I.errorX||I.errorY){var M=s.errorBarPositions(A,k,w,D,E);I.errorX&&y.extendFlat(I.errorX,M.x),I.errorY&&y.extendFlat(I.errorY,M.y)}return I.text&&(y.extendFlat(I.text,{positions:w},s.textPosition(A,k,I.text,I.marker)),y.extendFlat(I.textSel,{positions:w},s.textPosition(A,k,I.text,I.markerSel)),y.extendFlat(I.textUnsel,{positions:w},s.textPosition(A,k,I.text,I.markerUnsel))),I}}),wD=ze((te,Y)=>{var d=ji(),y=Xi(),z=so().DESELECTDIM;function P(i){var n=i[0],a=n.trace,l=n.t,o=l._scene,u=l.index,s=o.selectBatch[u],h=o.unselectBatch[u],m=o.textOptions[u],b=o.textSelectedOptions[u]||{},x=o.textUnselectedOptions[u]||{},_=d.extendFlat({},m),A,f;if(s.length||h.length){var k=b.color,w=x.color,D=m.color,E=d.isArrayOrTypedArray(D);for(_.color=new Array(a._length),A=0;A{var d=Bc(),y=wD().styleTextSelection;Y.exports=function(z,P){var i=z.cd,n=z.xaxis,a=z.yaxis,l=[],o=i[0].trace,u=i[0].t,s=o._length,h=u.x,m=u.y,b=u._scene,x=u.index;if(!b)return l;var _=d.hasText(o),A=d.hasMarkers(o),f=!A&&!_;if(o.visible!==!0||f)return l;var k=[],w=[];if(P!==!1&&!P.degenerate)for(var D=0;D{var d=eA();Y.exports={moduleType:"trace",name:"scattergl",basePlotModule:Ff(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:A6(),supplyDefaults:wX(),crossTraceDefaults:N4(),colorbar:Mo(),formatLabels:kX(),calc:BX(),hoverPoints:d.hoverPoints,selectPoints:kD(),meta:{}}}),FX=ze((te,Y)=>{var d=k6();Y.exports=y,Y.exports.to=y,Y.exports.from=z;function y(P,i){i==null&&(i=!0);var n=P[0],a=P[1],l=P[2],o=P[3];o==null&&(o=i?1:255),i&&(n*=255,a*=255,l*=255,o*=255),n=d(n,0,255)&255,a=d(a,0,255)&255,l=d(l,0,255)&255,o=d(o,0,255)&255;var u=n*16777216+(a<<16)+(l<<8)+o;return u}function z(P,i){P=+P;var n=P>>>24,a=(P&16711680)>>>16,l=(P&65280)>>>8,o=P&255;return i===!1?[n,a,l,o]:[n/255,a/255,l/255,o/255]}}),Yd=ze((te,Y)=>{var d=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;function P(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function i(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var a={},l=0;l<10;l++)a["_"+String.fromCharCode(l)]=l;var o=Object.getOwnPropertyNames(a).map(function(s){return a[s]});if(o.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(s){u[s]=s}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Y.exports=i()?Object.assign:function(n,a){for(var l,o=P(n),u,s=1;s{Y.exports=function(d){typeof d=="string"&&(d=[d]);for(var y=[].slice.call(arguments,1),z=[],P=0;P{Y.exports=function(d,y,z){Array.isArray(z)||(z=[].slice.call(arguments,2));for(var P=0,i=z.length;P{Y.exports=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}),iA=ze((te,Y)=>{Y.exports=z,Y.exports.float32=Y.exports.float=z,Y.exports.fract32=Y.exports.fract=y;var d=new Float32Array(1);function y(P,i){if(P.length){if(P instanceof Float32Array)return new Float32Array(P.length);i instanceof Float32Array||(i=z(P));for(var n=0,a=i.length;n{function d(C,T){var N=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(N!=null){var B,U,V,W,F=[],H=!0,q=!1;try{if(V=(N=N.call(C)).next,T!==0)for(;!(H=(B=V.call(N)).done)&&(F.push(B.value),F.length!==T);H=!0);}catch(G){q=!0,U=G}finally{try{if(!H&&N.return!=null&&(W=N.return(),Object(W)!==W))return}finally{if(q)throw U}}return F}}function y(C,T){return i(C)||d(C,T)||a(C,T)||u()}function z(C){return P(C)||n(C)||a(C)||o()}function P(C){if(Array.isArray(C))return l(C)}function i(C){if(Array.isArray(C))return C}function n(C){if(typeof Symbol<"u"&&C[Symbol.iterator]!=null||C["@@iterator"]!=null)return Array.from(C)}function a(C,T){if(C){if(typeof C=="string")return l(C,T);var N=Object.prototype.toString.call(C).slice(8,-1);if(N==="Object"&&C.constructor&&(N=C.constructor.name),N==="Map"||N==="Set")return Array.from(C);if(N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N))return l(C,T)}}function l(C,T){(T==null||T>C.length)&&(T=C.length);for(var N=0,B=new Array(T);NAe)?gt.tree=b(pt,{bounds:ut}):Ae&&Ae.length&&(gt.tree=Ae),gt.tree){var Et={primitive:"points",usage:"static",data:gt.tree,type:"uint32"};gt.elements?gt.elements(Et):gt.elements=W.elements(Et)}var Gt=D.float32(pt);ze({data:Gt,usage:"dynamic"});var Jt=D.fract32(pt,Gt);return Ee({data:Jt,usage:"dynamic"}),nt({data:new Uint8Array(xt),type:"uint8",usage:"stream"}),pt}},{marker:function(pt,gt,ct){var Ae=gt.activation;if(Ae.forEach(function(Jt){return Jt&&Jt.destroy&&Jt.destroy()}),Ae.length=0,!pt||typeof pt[0]=="number"){var ze=C.addMarker(pt);Ae[ze]=!0}else{for(var Ee=[],nt=0,xt=Math.min(pt.length,gt.count);nt=0)return U;var V;if(C instanceof Uint8Array||C instanceof Uint8ClampedArray)V=C;else{V=new Uint8Array(C.length);for(var W=0,F=C.length;WB*4&&(this.tooManyColors=!0),this.updatePalette(N),U.length===1?U[0]:U},M.prototype.updatePalette=function(C){if(!this.tooManyColors){var T=this.maxColors,N=this.paletteTexture,B=Math.ceil(C.length*.25/T);if(B>1){C=C.slice();for(var U=C.length*.25%T;U{Y.exports=d,Y.exports.default=d;function d(W,F,$){$=$||2;var q=F&&F.length,G=q?F[0]*$:W.length,ee=y(W,0,G,$,!0),he=[];if(!ee||ee.next===ee.prev)return he;var xe,ve,ce,re,ge,ne,se;if(q&&(ee=o(W,F,ee,$)),W.length>80*$){xe=ce=W[0],ve=re=W[1];for(var _e=$;_ece&&(ce=ge),ne>re&&(re=ne);se=Math.max(ce-xe,re-ve),se=se!==0?32767/se:0}return P(ee,he,$,xe,ve,se,0),he}function y(W,F,$,q,G){var ee,he;if(G===V(W,F,$,q)>0)for(ee=F;ee<$;ee+=q)he=N(ee,W[ee],W[ee+1],he);else for(ee=$-q;ee>=F;ee-=q)he=N(ee,W[ee],W[ee+1],he);return he&&D(he,he.next)&&(B(he),he=he.next),he}function z(W,F){if(!W)return W;F||(F=W);var $=W,q;do if(q=!1,!$.steiner&&(D($,$.next)||w($.prev,$,$.next)===0)){if(B($),$=F=$.prev,$===$.next)break;q=!0}else $=$.next;while(q||$!==F);return F}function P(W,F,$,q,G,ee,he){if(W){!he&&ee&&b(W,q,G,ee);for(var xe=W,ve,ce;W.prev!==W.next;){if(ve=W.prev,ce=W.next,ee?n(W,q,G,ee):i(W)){F.push(ve.i/$|0),F.push(W.i/$|0),F.push(ce.i/$|0),B(W),W=ce.next,xe=ce.next;continue}if(W=ce,W===xe){he?he===1?(W=a(z(W),F,$),P(W,F,$,q,G,ee,2)):he===2&&l(W,F,$,q,G,ee):P(z(W),F,$,q,G,ee,1);break}}}}function i(W){var F=W.prev,$=W,q=W.next;if(w(F,$,q)>=0)return!1;for(var G=F.x,ee=$.x,he=q.x,xe=F.y,ve=$.y,ce=q.y,re=Gee?G>he?G:he:ee>he?ee:he,se=xe>ve?xe>ce?xe:ce:ve>ce?ve:ce,_e=q.next;_e!==F;){if(_e.x>=re&&_e.x<=ne&&_e.y>=ge&&_e.y<=se&&f(G,xe,ee,ve,he,ce,_e.x,_e.y)&&w(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function n(W,F,$,q){var G=W.prev,ee=W,he=W.next;if(w(G,ee,he)>=0)return!1;for(var xe=G.x,ve=ee.x,ce=he.x,re=G.y,ge=ee.y,ne=he.y,se=xeve?xe>ce?xe:ce:ve>ce?ve:ce,J=re>ge?re>ne?re:ne:ge>ne?ge:ne,me=_(se,_e,F,$,q),fe=_(oe,J,F,$,q),Ce=W.prevZ,Be=W.nextZ;Ce&&Ce.z>=me&&Be&&Be.z<=fe;){if(Ce.x>=se&&Ce.x<=oe&&Ce.y>=_e&&Ce.y<=J&&Ce!==G&&Ce!==he&&f(xe,re,ve,ge,ce,ne,Ce.x,Ce.y)&&w(Ce.prev,Ce,Ce.next)>=0||(Ce=Ce.prevZ,Be.x>=se&&Be.x<=oe&&Be.y>=_e&&Be.y<=J&&Be!==G&&Be!==he&&f(xe,re,ve,ge,ce,ne,Be.x,Be.y)&&w(Be.prev,Be,Be.next)>=0))return!1;Be=Be.nextZ}for(;Ce&&Ce.z>=me;){if(Ce.x>=se&&Ce.x<=oe&&Ce.y>=_e&&Ce.y<=J&&Ce!==G&&Ce!==he&&f(xe,re,ve,ge,ce,ne,Ce.x,Ce.y)&&w(Ce.prev,Ce,Ce.next)>=0)return!1;Ce=Ce.prevZ}for(;Be&&Be.z<=fe;){if(Be.x>=se&&Be.x<=oe&&Be.y>=_e&&Be.y<=J&&Be!==G&&Be!==he&&f(xe,re,ve,ge,ce,ne,Be.x,Be.y)&&w(Be.prev,Be,Be.next)>=0)return!1;Be=Be.nextZ}return!0}function a(W,F,$){var q=W;do{var G=q.prev,ee=q.next.next;!D(G,ee)&&E(G,q,q.next,ee)&&g(G,ee)&&g(ee,G)&&(F.push(G.i/$|0),F.push(q.i/$|0),F.push(ee.i/$|0),B(q),B(q.next),q=W=ee),q=q.next}while(q!==W);return z(q)}function l(W,F,$,q,G,ee){var he=W;do{for(var xe=he.next.next;xe!==he.prev;){if(he.i!==xe.i&&k(he,xe)){var ve=T(he,xe);he=z(he,he.next),ve=z(ve,ve.next),P(he,F,$,q,G,ee,0),P(ve,F,$,q,G,ee,0);return}xe=xe.next}he=he.next}while(he!==W)}function o(W,F,$,q){var G=[],ee,he,xe,ve,ce;for(ee=0,he=F.length;ee=$.next.y&&$.next.y!==$.y){var xe=$.x+(G-$.y)*($.next.x-$.x)/($.next.y-$.y);if(xe<=q&&xe>ee&&(ee=xe,he=$.x<$.next.x?$:$.next,xe===q))return he}$=$.next}while($!==F);if(!he)return null;var ve=he,ce=he.x,re=he.y,ge=1/0,ne;$=he;do q>=$.x&&$.x>=ce&&q!==$.x&&f(Ghe.x||$.x===he.x&&m(he,$)))&&(he=$,ge=ne)),$=$.next;while($!==ve);return he}function m(W,F){return w(W.prev,W,F.prev)<0&&w(F.next,W,W.next)<0}function b(W,F,$,q){var G=W;do G.z===0&&(G.z=_(G.x,G.y,F,$,q)),G.prevZ=G.prev,G.nextZ=G.next,G=G.next;while(G!==W);G.prevZ.nextZ=null,G.prevZ=null,x(G)}function x(W){var F,$,q,G,ee,he,xe,ve,ce=1;do{for($=W,W=null,ee=null,he=0;$;){for(he++,q=$,xe=0,F=0;F0||ve>0&&q;)xe!==0&&(ve===0||!q||$.z<=q.z)?(G=$,$=$.nextZ,xe--):(G=q,q=q.nextZ,ve--),ee?ee.nextZ=G:W=G,G.prevZ=ee,ee=G;$=q}ee.nextZ=null,ce*=2}while(he>1);return W}function _(W,F,$,q,G){return W=(W-$)*G|0,F=(F-q)*G|0,W=(W|W<<8)&16711935,W=(W|W<<4)&252645135,W=(W|W<<2)&858993459,W=(W|W<<1)&1431655765,F=(F|F<<8)&16711935,F=(F|F<<4)&252645135,F=(F|F<<2)&858993459,F=(F|F<<1)&1431655765,W|F<<1}function A(W){var F=W,$=W;do(F.x<$.x||F.x===$.x&&F.y<$.y)&&($=F),F=F.next;while(F!==W);return $}function f(W,F,$,q,G,ee,he,xe){return(G-he)*(F-xe)>=(W-he)*(ee-xe)&&(W-he)*(q-xe)>=($-he)*(F-xe)&&($-he)*(ee-xe)>=(G-he)*(q-xe)}function k(W,F){return W.next.i!==F.i&&W.prev.i!==F.i&&!p(W,F)&&(g(W,F)&&g(F,W)&&C(W,F)&&(w(W.prev,W,F.prev)||w(W,F.prev,F))||D(W,F)&&w(W.prev,W,W.next)>0&&w(F.prev,F,F.next)>0)}function w(W,F,$){return(F.y-W.y)*($.x-F.x)-(F.x-W.x)*($.y-F.y)}function D(W,F){return W.x===F.x&&W.y===F.y}function E(W,F,$,q){var G=M(w(W,F,$)),ee=M(w(W,F,q)),he=M(w($,q,W)),xe=M(w($,q,F));return!!(G!==ee&&he!==xe||G===0&&I(W,$,F)||ee===0&&I(W,q,F)||he===0&&I($,W,q)||xe===0&&I($,F,q))}function I(W,F,$){return F.x<=Math.max(W.x,$.x)&&F.x>=Math.min(W.x,$.x)&&F.y<=Math.max(W.y,$.y)&&F.y>=Math.min(W.y,$.y)}function M(W){return W>0?1:W<0?-1:0}function p(W,F){var $=W;do{if($.i!==W.i&&$.next.i!==W.i&&$.i!==F.i&&$.next.i!==F.i&&E($,$.next,W,F))return!0;$=$.next}while($!==W);return!1}function g(W,F){return w(W.prev,W,W.next)<0?w(W,F,W.next)>=0&&w(W,W.prev,F)>=0:w(W,F,W.prev)<0||w(W,W.next,F)<0}function C(W,F){var $=W,q=!1,G=(W.x+F.x)/2,ee=(W.y+F.y)/2;do $.y>ee!=$.next.y>ee&&$.next.y!==$.y&&G<($.next.x-$.x)*(ee-$.y)/($.next.y-$.y)+$.x&&(q=!q),$=$.next;while($!==W);return q}function T(W,F){var $=new U(W.i,W.x,W.y),q=new U(F.i,F.x,F.y),G=W.next,ee=F.prev;return W.next=F,F.prev=W,$.next=G,G.prev=$,q.next=$,$.prev=q,ee.next=q,q.prev=ee,q}function N(W,F,$,q){var G=new U(W,F,$);return q?(G.next=q.next,G.prev=q,q.next.prev=G,q.next=G):(G.prev=G,G.next=G),G}function B(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function U(W,F,$){this.i=W,this.x=F,this.y=$,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(W,F,$,q){var G=F&&F.length,ee=G?F[0]*$:W.length,he=Math.abs(V(W,0,ee,$));if(G)for(var xe=0,ve=F.length;xe0&&(q+=W[G-1].length,$.holes.push(q))}return $}}),NX=Fe((te,Y)=>{var d=Lb();Y.exports=y;function y(z,P,i){if(!z||z.length==null)throw Error("Argument should be an array");P==null&&(P=1),i==null&&(i=d(z,P));for(var n=0;n{Y.exports=function(){var d,y;if(typeof WeakMap!="function")return!1;try{d=new WeakMap([[y={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(d)!=="[object WeakMap]"||typeof d.set!="function"||d.set({},1)!==d||typeof d.delete!="function"||typeof d.has!="function"||d.get(y)!=="one")}}),UX=Fe((te,Y)=>{Y.exports=function(){}}),H_=Fe((te,Y)=>{var d=UX()();Y.exports=function(y){return y!==d&&y!==null}}),TD=Fe((te,Y)=>{var d=Object.create,y=Object.getPrototypeOf,z={};Y.exports=function(){var P=Object.setPrototypeOf,i=arguments[0]||d;return typeof P!="function"?!1:y(P(i(null),z))===z}}),SD=Fe((te,Y)=>{var d=H_(),y={function:!0,object:!0};Y.exports=function(z){return d(z)&&y[typeof z]||!1}}),uy=Fe((te,Y)=>{var d=H_();Y.exports=function(y){if(!d(y))throw new TypeError("Cannot use null or undefined");return y}}),$X=Fe((te,Y)=>{var d=Object.create,y;TD()()||(y=CD()),Y.exports=function(){var z,P,i;return!y||y.level!==1?d:(z={},P={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(n){if(n==="__proto__"){P[n]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}P[n]=i}),Object.defineProperties(z,P),Object.defineProperty(y,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:z}),function(n,a){return d(n===null?z:n,a)})}()}),CD=Fe((te,Y)=>{var d=SD(),y=uy(),z=Object.prototype.isPrototypeOf,P=Object.defineProperty,i={configurable:!0,enumerable:!1,writable:!0,value:void 0},n;n=function(a,l){if(y(a),l===null||d(l))return a;throw new TypeError("Prototype must be null or an object")},Y.exports=function(a){var l,o;return a?(a.level===2?a.set?(o=a.set,l=function(u,s){return o.call(n(u,s),s),u}):l=function(u,s){return n(u,s).__proto__=s,u}:l=function u(s,h){var m;return n(s,h),m=z.call(u.nullPolyfill,s),m&&delete u.nullPolyfill.__proto__,h===null&&(h=u.nullPolyfill),s.__proto__=h,m&&P(u.nullPolyfill,"__proto__",i),s},Object.defineProperty(l,"level",{configurable:!1,enumerable:!1,writable:!1,value:a.level})):null}(function(){var a=Object.create(null),l={},o,u=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(u){try{o=u.set,o.call(a,l)}catch{}if(Object.getPrototypeOf(a)===l)return{set:o,level:2}}return a.__proto__=l,Object.getPrototypeOf(a)===l?{level:2}:(a={},a.__proto__=l,Object.getPrototypeOf(a)===l?{level:1}:!1)}()),$X()}),rA=Fe((te,Y)=>{Y.exports=TD()()?Object.setPrototypeOf:CD()}),HX=Fe((te,Y)=>{var d=SD();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not an Object");return y}}),VX=Fe((te,Y)=>{var d=Object.create(null),y=Math.random;Y.exports=function(){var z;do z=y().toString(36).slice(2);while(d[z]);return z}}),Db=Fe((te,Y)=>{var d=void 0;Y.exports=function(y){return y!==d&&y!==null}}),iA=Fe((te,Y)=>{var d=Db(),y={object:!0,function:!0,undefined:!0};Y.exports=function(z){return d(z)?hasOwnProperty.call(y,typeof z):!1}}),WX=Fe((te,Y)=>{var d=iA();Y.exports=function(y){if(!d(y))return!1;try{return y.constructor?y.constructor.prototype===y:!1}catch{return!1}}}),qX=Fe((te,Y)=>{var d=WX();Y.exports=function(y){if(typeof y!="function"||!hasOwnProperty.call(y,"length"))return!1;try{if(typeof y.length!="number"||typeof y.call!="function"||typeof y.apply!="function")return!1}catch{return!1}return!d(y)}}),AD=Fe((te,Y)=>{var d=qX(),y=/^\s*class[\s{/}]/,z=Function.prototype.toString;Y.exports=function(P){return!(!d(P)||y.test(z.call(P)))}}),GX=Fe((te,Y)=>{Y.exports=function(){var d=Object.assign,y;return typeof d!="function"?!1:(y={foo:"raz"},d(y,{bar:"dwa"},{trzy:"trzy"}),y.foo+y.bar+y.trzy==="razdwatrzy")}}),ZX=Fe((te,Y)=>{Y.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),KX=Fe((te,Y)=>{var d=H_(),y=Object.keys;Y.exports=function(z){return y(d(z)?Object(z):z)}}),YX=Fe((te,Y)=>{Y.exports=ZX()()?Object.keys:KX()}),XX=Fe((te,Y)=>{var d=YX(),y=uy(),z=Math.max;Y.exports=function(P,i){var n,a,l=z(arguments.length,2),o;for(P=Object(y(P)),o=function(u){try{P[u]=i[u]}catch(s){n||(n=s)}},a=1;a{Y.exports=GX()()?Object.assign:XX()}),MD=Fe((te,Y)=>{var d=H_(),y=Array.prototype.forEach,z=Object.create,P=function(i,n){var a;for(a in i)n[a]=i[a]};Y.exports=function(i){var n=z(null);return y.call(arguments,function(a){d(a)&&P(Object(a),n)}),n}}),JX=Fe((te,Y)=>{var d="razdwatrzy";Y.exports=function(){return typeof d.contains!="function"?!1:d.contains("dwa")===!0&&d.contains("foo")===!1}}),QX=Fe((te,Y)=>{var d=String.prototype.indexOf;Y.exports=function(y){return d.call(this,y,arguments[1])>-1}}),ED=Fe((te,Y)=>{Y.exports=JX()()?String.prototype.contains:QX()}),cy=Fe((te,Y)=>{var d=Db(),y=AD(),z=nA(),P=MD(),i=ED(),n=Y.exports=function(a,l){var o,u,s,h,m;return arguments.length<2||typeof a!="string"?(h=l,l=a,a=null):h=arguments[2],d(a)?(o=i.call(a,"c"),u=i.call(a,"e"),s=i.call(a,"w")):(o=s=!0,u=!1),m={value:l,configurable:o,enumerable:u,writable:s},h?z(P(h),m):m};n.gs=function(a,l,o){var u,s,h,m;return typeof a!="string"?(h=o,o=l,l=a,a=null):h=arguments[3],d(l)?y(l)?d(o)?y(o)||(h=o,o=void 0):o=void 0:(h=l,l=o=void 0):l=void 0,d(a)?(u=i.call(a,"c"),s=i.call(a,"e")):(u=!0,s=!1),m={get:l,set:o,configurable:u,enumerable:s},h?z(P(h),m):m}}),C6=Fe((te,Y)=>{var d=Object.prototype.toString,y=d.call(function(){return arguments}());Y.exports=function(z){return d.call(z)===y}}),A6=Fe((te,Y)=>{var d=Object.prototype.toString,y=d.call("");Y.exports=function(z){return typeof z=="string"||z&&typeof z=="object"&&(z instanceof String||d.call(z)===y)||!1}}),eJ=Fe((te,Y)=>{Y.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),tJ=Fe((te,Y)=>{var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};Y.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}),M6=Fe((te,Y)=>{Y.exports=eJ()()?globalThis:tJ()}),rJ=Fe((te,Y)=>{var d=M6(),y={object:!0,symbol:!0};Y.exports=function(){var z=d.Symbol,P;if(typeof z!="function")return!1;P=z("test symbol");try{String(P)}catch{return!1}return!(!y[typeof z.iterator]||!y[typeof z.toPrimitive]||!y[typeof z.toStringTag])}}),iJ=Fe((te,Y)=>{Y.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}),LD=Fe((te,Y)=>{var d=iJ();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not a symbol");return y}}),nJ=Fe((te,Y)=>{var d=cy(),y=Object.create,z=Object.defineProperty,P=Object.prototype,i=y(null);Y.exports=function(n){for(var a=0,l,o;i[n+(a||"")];)++a;return n+=a||"",i[n]=!0,l="@@"+n,z(P,l,d.gs(null,function(u){o||(o=!0,z(this,l,d(u)),o=!1)})),l}}),aJ=Fe((te,Y)=>{var d=cy(),y=M6().Symbol;Y.exports=function(z){return Object.defineProperties(z,{hasInstance:d("",y&&y.hasInstance||z("hasInstance")),isConcatSpreadable:d("",y&&y.isConcatSpreadable||z("isConcatSpreadable")),iterator:d("",y&&y.iterator||z("iterator")),match:d("",y&&y.match||z("match")),replace:d("",y&&y.replace||z("replace")),search:d("",y&&y.search||z("search")),species:d("",y&&y.species||z("species")),split:d("",y&&y.split||z("split")),toPrimitive:d("",y&&y.toPrimitive||z("toPrimitive")),toStringTag:d("",y&&y.toStringTag||z("toStringTag")),unscopables:d("",y&&y.unscopables||z("unscopables"))})}}),oJ=Fe((te,Y)=>{var d=cy(),y=LD(),z=Object.create(null);Y.exports=function(P){return Object.defineProperties(P,{for:d(function(i){return z[i]?z[i]:z[i]=P(String(i))}),keyFor:d(function(i){var n;y(i);for(n in z)if(z[n]===i)return n})})}}),sJ=Fe((te,Y)=>{var d=cy(),y=LD(),z=M6().Symbol,P=nJ(),i=aJ(),n=oJ(),a=Object.create,l=Object.defineProperties,o=Object.defineProperty,u,s,h;if(typeof z=="function")try{String(z()),h=!0}catch{}else z=null;s=function(m){if(this instanceof s)throw new TypeError("Symbol is not a constructor");return u(m)},Y.exports=u=function m(b){var x;if(this instanceof m)throw new TypeError("Symbol is not a constructor");return h?z(b):(x=a(s.prototype),b=b===void 0?"":String(b),l(x,{__description__:d("",b),__name__:d("",P(b))}))},i(u),n(u),l(s.prototype,{constructor:d(u),toString:d("",function(){return this.__name__})}),l(u.prototype,{toString:d(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:d(function(){return y(this)})}),o(u.prototype,u.toPrimitive,d("",function(){var m=y(this);return typeof m=="symbol"?m:m.toString()})),o(u.prototype,u.toStringTag,d("c","Symbol")),o(s.prototype,u.toStringTag,d("c",u.prototype[u.toStringTag])),o(s.prototype,u.toPrimitive,d("c",u.prototype[u.toPrimitive]))}),V_=Fe((te,Y)=>{Y.exports=rJ()()?M6().Symbol:sJ()}),lJ=Fe((te,Y)=>{var d=uy();Y.exports=function(){return d(this).length=0,this}}),qw=Fe((te,Y)=>{Y.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}),uJ=Fe((te,Y)=>{var d=Db(),y=iA(),z=Object.prototype.toString;Y.exports=function(P){if(!d(P))return null;if(y(P)){var i=P.toString;if(typeof i!="function"||i===z)return null}try{return""+P}catch{return null}}}),cJ=Fe((te,Y)=>{Y.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}),hJ=Fe((te,Y)=>{var d=cJ(),y=/[\n\r\u2028\u2029]/g;Y.exports=function(z){var P=d(z);return P===null?"":(P.length>100&&(P=P.slice(0,99)+"…"),P=P.replace(y,function(i){switch(i){case` -`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),P)}}),PD=Fe((te,Y)=>{var d=Db(),y=iA(),z=uJ(),P=hJ(),i=function(n,a){return n.replace("%v",P(a))};Y.exports=function(n,a,l){if(!y(l))throw new TypeError(i(a,n));if(!d(n)){if("default"in l)return l.default;if(l.isOptional)return null}var o=z(l.errorMessage);throw d(o)||(o=a),new TypeError(i(o,n))}}),fJ=Fe((te,Y)=>{var d=PD(),y=Db();Y.exports=function(z){return y(z)?z:d(z,"Cannot use %v",arguments[1])}}),dJ=Fe((te,Y)=>{var d=PD(),y=AD();Y.exports=function(z){return y(z)?z:d(z,"%v is not a plain function",arguments[1])}}),pJ=Fe((te,Y)=>{Y.exports=function(){var d=Array.from,y,z;return typeof d!="function"?!1:(y=["raz","dwa"],z=d(y),!!(z&&z!==y&&z[1]==="dwa"))}}),mJ=Fe((te,Y)=>{var d=Object.prototype.toString,y=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);Y.exports=function(z){return typeof z=="function"&&y(d.call(z))}}),gJ=Fe((te,Y)=>{Y.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}),vJ=Fe((te,Y)=>{Y.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}),yJ=Fe((te,Y)=>{Y.exports=gJ()()?Math.sign:vJ()}),_J=Fe((te,Y)=>{var d=yJ(),y=Math.abs,z=Math.floor;Y.exports=function(P){return isNaN(P)?0:(P=Number(P),P===0||!isFinite(P)?P:d(P)*z(y(P)))}}),xJ=Fe((te,Y)=>{var d=_J(),y=Math.max;Y.exports=function(z){return y(0,d(z))}}),bJ=Fe((te,Y)=>{var d=V_().iterator,y=C6(),z=mJ(),P=xJ(),i=qw(),n=uy(),a=H_(),l=A6(),o=Array.isArray,u=Function.prototype.call,s={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;Y.exports=function(m){var b=arguments[1],x=arguments[2],_,A,f,k,w,D,E,I,M,p;if(m=Object(n(m)),a(b)&&i(b),!this||this===Array||!z(this)){if(!b){if(y(m))return w=m.length,w!==1?Array.apply(null,m):(k=new Array(1),k[0]=m[0],k);if(o(m)){for(k=new Array(w=m.length),A=0;A=55296&&D<=56319&&(p+=m[++A])),p=b?u.call(b,x,p,f):p,_?(s.value=p,h(k,f,s)):k[f]=p,++f;w=f}}if(w===void 0)for(w=P(m.length),_&&(k=new _(w)),A=0;A{Y.exports=pJ()()?Array.from:bJ()}),kJ=Fe((te,Y)=>{var d=wJ(),y=nA(),z=uy();Y.exports=function(P){var i=Object(z(P)),n=arguments[1],a=Object(arguments[2]);if(i!==P&&!n)return i;var l={};return n?d(n,function(o){(a.ensure||o in P)&&(l[o]=P[o])}):y(l,P),l}}),TJ=Fe((te,Y)=>{var d=qw(),y=uy(),z=Function.prototype.bind,P=Function.prototype.call,i=Object.keys,n=Object.prototype.propertyIsEnumerable;Y.exports=function(a,l){return function(o,u){var s,h=arguments[2],m=arguments[3];return o=Object(y(o)),d(u),s=i(o),m&&s.sort(typeof m=="function"?z.call(m,o):void 0),typeof a!="function"&&(a=s[a]),P.call(a,s,function(b,x){return n.call(o,b)?P.call(u,h,o[b],b,o,x):l})}}}),SJ=Fe((te,Y)=>{Y.exports=TJ()("forEach")}),CJ=Fe((te,Y)=>{var d=qw(),y=SJ(),z=Function.prototype.call;Y.exports=function(P,i){var n={},a=arguments[2];return d(i),y(P,function(l,o,u,s){n[o]=z.call(i,a,l,o,u,s)}),n}}),AJ=Fe((te,Y)=>{var d=Db(),y=fJ(),z=dJ(),P=kJ(),i=MD(),n=CJ(),a=Function.prototype.bind,l=Object.defineProperty,o=Object.prototype.hasOwnProperty,u;u=function(s,h,m){var b=y(h)&&z(h.value),x;return x=P(h),delete x.writable,delete x.value,x.get=function(){return!m.overwriteDefinition&&o.call(this,s)?b:(h.value=a.call(b,m.resolveContext?m.resolveContext(this):this),l(this,s,h),this[s])},x},Y.exports=function(s){var h=i(arguments[1]);return d(h.resolveContext)&&z(h.resolveContext),n(s,function(m,b){return u(b,m,h)})}}),ID=Fe((te,Y)=>{var d=lJ(),y=nA(),z=qw(),P=uy(),i=cy(),n=AJ(),a=V_(),l=Object.defineProperty,o=Object.defineProperties,u;Y.exports=u=function(s,h){if(!(this instanceof u))throw new TypeError("Constructor requires 'new'");o(this,{__list__:i("w",P(s)),__context__:i("w",h),__nextIndex__:i("w",0)}),h&&(z(h.on),h.on("_add",this._onAdd),h.on("_delete",this._onDelete),h.on("_clear",this._onClear))},delete u.prototype.constructor,o(u.prototype,y({_next:i(function(){var s;if(this.__list__){if(this.__redo__&&(s=this.__redo__.shift(),s!==void 0))return s;if(this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,"__redo__",i("c",[s]));return}this.__redo__.forEach(function(h,m){h>=s&&(this.__redo__[m]=++h)},this),this.__redo__.push(s)}}),_onDelete:i(function(s){var h;s>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(h=this.__redo__.indexOf(s),h!==-1&&this.__redo__.splice(h,1),this.__redo__.forEach(function(m,b){m>s&&(this.__redo__[b]=--m)},this)))}),_onClear:i(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),l(u.prototype,a.iterator,i(function(){return this}))}),MJ=Fe((te,Y)=>{var d=rA(),y=ED(),z=cy(),P=V_(),i=ID(),n=Object.defineProperty,a;a=Y.exports=function(l,o){if(!(this instanceof a))throw new TypeError("Constructor requires 'new'");i.call(this,l),o?y.call(o,"key+value")?o="key+value":y.call(o,"key")?o="key":o="value":o="value",n(this,"__kind__",z("",o))},d&&d(a,i),delete a.prototype.constructor,a.prototype=Object.create(i.prototype,{_resolve:z(function(l){return this.__kind__==="value"?this.__list__[l]:this.__kind__==="key+value"?[l,this.__list__[l]]:l})}),n(a.prototype,P.toStringTag,z("c","Array Iterator"))}),EJ=Fe((te,Y)=>{var d=rA(),y=cy(),z=V_(),P=ID(),i=Object.defineProperty,n;n=Y.exports=function(a){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");a=String(a),P.call(this,a),i(this,"__length__",y("",a.length))},d&&d(n,P),delete n.prototype.constructor,n.prototype=Object.create(P.prototype,{_next:y(function(){if(this.__list__){if(this.__nextIndex__=55296&&o<=56319?l+this.__list__[this.__nextIndex__++]:l)})}),i(n.prototype,z.toStringTag,y("c","String Iterator"))}),LJ=Fe((te,Y)=>{var d=C6(),y=H_(),z=A6(),P=V_().iterator,i=Array.isArray;Y.exports=function(n){return y(n)?i(n)||z(n)||d(n)?!0:typeof n[P]=="function":!1}}),PJ=Fe((te,Y)=>{var d=LJ();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not iterable");return y}}),DD=Fe((te,Y)=>{var d=C6(),y=A6(),z=MJ(),P=EJ(),i=PJ(),n=V_().iterator;Y.exports=function(a){return typeof i(a)[n]=="function"?a[n]():d(a)?new z(a):y(a)?new P(a):new z(a)}}),IJ=Fe((te,Y)=>{var d=C6(),y=qw(),z=A6(),P=DD(),i=Array.isArray,n=Function.prototype.call,a=Array.prototype.some;Y.exports=function(l,o){var u,s=arguments[2],h,m,b,x,_,A,f;if(i(l)||d(l)?u="array":z(l)?u="string":l=P(l),y(o),m=function(){b=!0},u==="array"){a.call(l,function(k){return n.call(o,s,k,m),b});return}if(u==="string"){for(_=l.length,x=0;x<_&&(A=l[x],x+1<_&&(f=A.charCodeAt(0),f>=55296&&f<=56319&&(A+=l[++x])),n.call(o,s,A,m),!b);++x);return}for(h=l.next();!h.done;){if(n.call(o,s,h.value,m),b)return;h=l.next()}}}),DJ=Fe((te,Y)=>{Y.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),zJ=Fe((te,Y)=>{var d=H_(),y=rA(),z=HX(),P=uy(),i=VX(),n=cy(),a=DD(),l=IJ(),o=V_().toStringTag,u=DJ(),s=Array.isArray,h=Object.defineProperty,m=Object.prototype.hasOwnProperty,b=Object.getPrototypeOf,x;Y.exports=x=function(){var _=arguments[0],A;if(!(this instanceof x))throw new TypeError("Constructor requires 'new'");return A=u&&y&&WeakMap!==x?y(new WeakMap,b(this)):this,d(_)&&(s(_)||(_=a(_))),h(A,"__weakMapData__",n("c","$weakMap$"+i())),_&&l(_,function(f){P(f),A.set(f[0],f[1])}),A},u&&(y&&y(x,WeakMap),x.prototype=Object.create(WeakMap.prototype,{constructor:n(x)})),Object.defineProperties(x.prototype,{delete:n(function(_){return m.call(z(_),this.__weakMapData__)?(delete _[this.__weakMapData__],!0):!1}),get:n(function(_){if(m.call(z(_),this.__weakMapData__))return _[this.__weakMapData__]}),has:n(function(_){return m.call(z(_),this.__weakMapData__)}),set:n(function(_,A){return h(z(_),this.__weakMapData__,n("c",A)),this}),toString:n(function(){return"[object WeakMap]"})}),h(x.prototype,o,n("c","WeakMap"))}),zD=Fe((te,Y)=>{Y.exports=jX()()?WeakMap:zJ()}),OJ=Fe((te,Y)=>{Y.exports=function(d,y,z){if(typeof Array.prototype.findIndex=="function")return d.findIndex(y,z);if(typeof y!="function")throw new TypeError("predicate must be a function");var P=Object(d),i=P.length;if(i===0)return-1;for(var n=0;n{var d=F_(),y=Lb(),z=Kd(),P=e1(),i=Pb(),n=FX(),a=NX(),{float32:l,fract32:o}=tA(),u=zD(),s=Ww(),h=OJ(),m=` +`]),w&&(ve.frag=ve.frag.replace("smoothstep","smoothStep"),be.frag=be.frag.replace("smoothstep","smoothStep")),this.drawCircle=C(ve)}M.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},M.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},M.prototype.draw=function(){for(var C=this,T=arguments.length,N=new Array(T),B=0;BAe)?vt.tree=b(mt,{bounds:ut}):Ae&&Ae.length&&(vt.tree=Ae),vt.tree){var Et={primitive:"points",usage:"static",data:vt.tree,type:"uint32"};vt.elements?vt.elements(Et):vt.elements=W.elements(Et)}var Gt=D.float32(mt);Oe({data:Gt,usage:"dynamic"});var Qt=D.fract32(mt,Gt);return Le({data:Qt,usage:"dynamic"}),nt({data:new Uint8Array(xt),type:"uint8",usage:"stream"}),mt}},{marker:function(mt,vt,ct){var Ae=vt.activation;if(Ae.forEach(function(Qt){return Qt&&Qt.destroy&&Qt.destroy()}),Ae.length=0,!mt||typeof mt[0]=="number"){var Oe=C.addMarker(mt);Ae[Oe]=!0}else{for(var Le=[],nt=0,xt=Math.min(mt.length,vt.count);nt=0)return U;var V;if(C instanceof Uint8Array||C instanceof Uint8ClampedArray)V=C;else{V=new Uint8Array(C.length);for(var W=0,F=C.length;WB*4&&(this.tooManyColors=!0),this.updatePalette(N),U.length===1?U[0]:U},M.prototype.updatePalette=function(C){if(!this.tooManyColors){var T=this.maxColors,N=this.paletteTexture,B=Math.ceil(C.length*.25/T);if(B>1){C=C.slice();for(var U=C.length*.25%T;U{Y.exports=d,Y.exports.default=d;function d(W,F,H){H=H||2;var q=F&&F.length,G=q?F[0]*H:W.length,ee=y(W,0,G,H,!0),he=[];if(!ee||ee.next===ee.prev)return he;var be,ve,ce,re,ge,ne,se;if(q&&(ee=o(W,F,ee,H)),W.length>80*H){be=ce=W[0],ve=re=W[1];for(var _e=H;_ece&&(ce=ge),ne>re&&(re=ne);se=Math.max(ce-be,re-ve),se=se!==0?32767/se:0}return P(ee,he,H,be,ve,se,0),he}function y(W,F,H,q,G){var ee,he;if(G===V(W,F,H,q)>0)for(ee=F;ee=F;ee-=q)he=N(ee,W[ee],W[ee+1],he);return he&&D(he,he.next)&&(B(he),he=he.next),he}function z(W,F){if(!W)return W;F||(F=W);var H=W,q;do if(q=!1,!H.steiner&&(D(H,H.next)||w(H.prev,H,H.next)===0)){if(B(H),H=F=H.prev,H===H.next)break;q=!0}else H=H.next;while(q||H!==F);return F}function P(W,F,H,q,G,ee,he){if(W){!he&&ee&&b(W,q,G,ee);for(var be=W,ve,ce;W.prev!==W.next;){if(ve=W.prev,ce=W.next,ee?n(W,q,G,ee):i(W)){F.push(ve.i/H|0),F.push(W.i/H|0),F.push(ce.i/H|0),B(W),W=ce.next,be=ce.next;continue}if(W=ce,W===be){he?he===1?(W=a(z(W),F,H),P(W,F,H,q,G,ee,2)):he===2&&l(W,F,H,q,G,ee):P(z(W),F,H,q,G,ee,1);break}}}}function i(W){var F=W.prev,H=W,q=W.next;if(w(F,H,q)>=0)return!1;for(var G=F.x,ee=H.x,he=q.x,be=F.y,ve=H.y,ce=q.y,re=Gee?G>he?G:he:ee>he?ee:he,se=be>ve?be>ce?be:ce:ve>ce?ve:ce,_e=q.next;_e!==F;){if(_e.x>=re&&_e.x<=ne&&_e.y>=ge&&_e.y<=se&&f(G,be,ee,ve,he,ce,_e.x,_e.y)&&w(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function n(W,F,H,q){var G=W.prev,ee=W,he=W.next;if(w(G,ee,he)>=0)return!1;for(var be=G.x,ve=ee.x,ce=he.x,re=G.y,ge=ee.y,ne=he.y,se=beve?be>ce?be:ce:ve>ce?ve:ce,J=re>ge?re>ne?re:ne:ge>ne?ge:ne,me=_(se,_e,F,H,q),fe=_(oe,J,F,H,q),Ce=W.prevZ,Re=W.nextZ;Ce&&Ce.z>=me&&Re&&Re.z<=fe;){if(Ce.x>=se&&Ce.x<=oe&&Ce.y>=_e&&Ce.y<=J&&Ce!==G&&Ce!==he&&f(be,re,ve,ge,ce,ne,Ce.x,Ce.y)&&w(Ce.prev,Ce,Ce.next)>=0||(Ce=Ce.prevZ,Re.x>=se&&Re.x<=oe&&Re.y>=_e&&Re.y<=J&&Re!==G&&Re!==he&&f(be,re,ve,ge,ce,ne,Re.x,Re.y)&&w(Re.prev,Re,Re.next)>=0))return!1;Re=Re.nextZ}for(;Ce&&Ce.z>=me;){if(Ce.x>=se&&Ce.x<=oe&&Ce.y>=_e&&Ce.y<=J&&Ce!==G&&Ce!==he&&f(be,re,ve,ge,ce,ne,Ce.x,Ce.y)&&w(Ce.prev,Ce,Ce.next)>=0)return!1;Ce=Ce.prevZ}for(;Re&&Re.z<=fe;){if(Re.x>=se&&Re.x<=oe&&Re.y>=_e&&Re.y<=J&&Re!==G&&Re!==he&&f(be,re,ve,ge,ce,ne,Re.x,Re.y)&&w(Re.prev,Re,Re.next)>=0)return!1;Re=Re.nextZ}return!0}function a(W,F,H){var q=W;do{var G=q.prev,ee=q.next.next;!D(G,ee)&&E(G,q,q.next,ee)&&g(G,ee)&&g(ee,G)&&(F.push(G.i/H|0),F.push(q.i/H|0),F.push(ee.i/H|0),B(q),B(q.next),q=W=ee),q=q.next}while(q!==W);return z(q)}function l(W,F,H,q,G,ee){var he=W;do{for(var be=he.next.next;be!==he.prev;){if(he.i!==be.i&&k(he,be)){var ve=T(he,be);he=z(he,he.next),ve=z(ve,ve.next),P(he,F,H,q,G,ee,0),P(ve,F,H,q,G,ee,0);return}be=be.next}he=he.next}while(he!==W)}function o(W,F,H,q){var G=[],ee,he,be,ve,ce;for(ee=0,he=F.length;ee=H.next.y&&H.next.y!==H.y){var be=H.x+(G-H.y)*(H.next.x-H.x)/(H.next.y-H.y);if(be<=q&&be>ee&&(ee=be,he=H.x=H.x&&H.x>=ce&&q!==H.x&&f(Ghe.x||H.x===he.x&&m(he,H)))&&(he=H,ge=ne)),H=H.next;while(H!==ve);return he}function m(W,F){return w(W.prev,W,F.prev)<0&&w(F.next,W,W.next)<0}function b(W,F,H,q){var G=W;do G.z===0&&(G.z=_(G.x,G.y,F,H,q)),G.prevZ=G.prev,G.nextZ=G.next,G=G.next;while(G!==W);G.prevZ.nextZ=null,G.prevZ=null,x(G)}function x(W){var F,H,q,G,ee,he,be,ve,ce=1;do{for(H=W,W=null,ee=null,he=0;H;){for(he++,q=H,be=0,F=0;F0||ve>0&&q;)be!==0&&(ve===0||!q||H.z<=q.z)?(G=H,H=H.nextZ,be--):(G=q,q=q.nextZ,ve--),ee?ee.nextZ=G:W=G,G.prevZ=ee,ee=G;H=q}ee.nextZ=null,ce*=2}while(he>1);return W}function _(W,F,H,q,G){return W=(W-H)*G|0,F=(F-q)*G|0,W=(W|W<<8)&16711935,W=(W|W<<4)&252645135,W=(W|W<<2)&858993459,W=(W|W<<1)&1431655765,F=(F|F<<8)&16711935,F=(F|F<<4)&252645135,F=(F|F<<2)&858993459,F=(F|F<<1)&1431655765,W|F<<1}function A(W){var F=W,H=W;do(F.x=(W-he)*(ee-be)&&(W-he)*(q-be)>=(H-he)*(F-be)&&(H-he)*(ee-be)>=(G-he)*(q-be)}function k(W,F){return W.next.i!==F.i&&W.prev.i!==F.i&&!p(W,F)&&(g(W,F)&&g(F,W)&&C(W,F)&&(w(W.prev,W,F.prev)||w(W,F.prev,F))||D(W,F)&&w(W.prev,W,W.next)>0&&w(F.prev,F,F.next)>0)}function w(W,F,H){return(F.y-W.y)*(H.x-F.x)-(F.x-W.x)*(H.y-F.y)}function D(W,F){return W.x===F.x&&W.y===F.y}function E(W,F,H,q){var G=M(w(W,F,H)),ee=M(w(W,F,q)),he=M(w(H,q,W)),be=M(w(H,q,F));return!!(G!==ee&&he!==be||G===0&&I(W,H,F)||ee===0&&I(W,q,F)||he===0&&I(H,W,q)||be===0&&I(H,F,q))}function I(W,F,H){return F.x<=Math.max(W.x,H.x)&&F.x>=Math.min(W.x,H.x)&&F.y<=Math.max(W.y,H.y)&&F.y>=Math.min(W.y,H.y)}function M(W){return W>0?1:W<0?-1:0}function p(W,F){var H=W;do{if(H.i!==W.i&&H.next.i!==W.i&&H.i!==F.i&&H.next.i!==F.i&&E(H,H.next,W,F))return!0;H=H.next}while(H!==W);return!1}function g(W,F){return w(W.prev,W,W.next)<0?w(W,F,W.next)>=0&&w(W,W.prev,F)>=0:w(W,F,W.prev)<0||w(W,W.next,F)<0}function C(W,F){var H=W,q=!1,G=(W.x+F.x)/2,ee=(W.y+F.y)/2;do H.y>ee!=H.next.y>ee&&H.next.y!==H.y&&G<(H.next.x-H.x)*(ee-H.y)/(H.next.y-H.y)+H.x&&(q=!q),H=H.next;while(H!==W);return q}function T(W,F){var H=new U(W.i,W.x,W.y),q=new U(F.i,F.x,F.y),G=W.next,ee=F.prev;return W.next=F,F.prev=W,H.next=G,G.prev=H,q.next=H,H.prev=q,ee.next=q,q.prev=ee,q}function N(W,F,H,q){var G=new U(W,F,H);return q?(G.next=q.next,G.prev=q,q.next.prev=G,q.next=G):(G.prev=G,G.next=G),G}function B(W){W.next.prev=W.prev,W.prev.next=W.next,W.prevZ&&(W.prevZ.nextZ=W.nextZ),W.nextZ&&(W.nextZ.prevZ=W.prevZ)}function U(W,F,H){this.i=W,this.x=F,this.y=H,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(W,F,H,q){var G=F&&F.length,ee=G?F[0]*H:W.length,he=Math.abs(V(W,0,ee,H));if(G)for(var be=0,ve=F.length;be0&&(q+=W[G-1].length,H.holes.push(q))}return H}}),$X=ze((te,Y)=>{var d=Pb();Y.exports=y;function y(z,P,i){if(!z||z.length==null)throw Error("Argument should be an array");P==null&&(P=1),i==null&&(i=d(z,P));for(var n=0;n{Y.exports=function(){var d,y;if(typeof WeakMap!="function")return!1;try{d=new WeakMap([[y={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return!(String(d)!=="[object WeakMap]"||typeof d.set!="function"||d.set({},1)!==d||typeof d.delete!="function"||typeof d.has!="function"||d.get(y)!=="one")}}),VX=ze((te,Y)=>{Y.exports=function(){}}),G_=ze((te,Y)=>{var d=VX()();Y.exports=function(y){return y!==d&&y!==null}}),CD=ze((te,Y)=>{var d=Object.create,y=Object.getPrototypeOf,z={};Y.exports=function(){var P=Object.setPrototypeOf,i=arguments[0]||d;return typeof P!="function"?!1:y(P(i(null),z))===z}}),AD=ze((te,Y)=>{var d=G_(),y={function:!0,object:!0};Y.exports=function(z){return d(z)&&y[typeof z]||!1}}),hy=ze((te,Y)=>{var d=G_();Y.exports=function(y){if(!d(y))throw new TypeError("Cannot use null or undefined");return y}}),WX=ze((te,Y)=>{var d=Object.create,y;CD()()||(y=MD()),Y.exports=function(){var z,P,i;return!y||y.level!==1?d:(z={},P={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(n){if(n==="__proto__"){P[n]={configurable:!0,enumerable:!1,writable:!0,value:void 0};return}P[n]=i}),Object.defineProperties(z,P),Object.defineProperty(y,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:z}),function(n,a){return d(n===null?z:n,a)})}()}),MD=ze((te,Y)=>{var d=AD(),y=hy(),z=Object.prototype.isPrototypeOf,P=Object.defineProperty,i={configurable:!0,enumerable:!1,writable:!0,value:void 0},n;n=function(a,l){if(y(a),l===null||d(l))return a;throw new TypeError("Prototype must be null or an object")},Y.exports=function(a){var l,o;return a?(a.level===2?a.set?(o=a.set,l=function(u,s){return o.call(n(u,s),s),u}):l=function(u,s){return n(u,s).__proto__=s,u}:l=function u(s,h){var m;return n(s,h),m=z.call(u.nullPolyfill,s),m&&delete u.nullPolyfill.__proto__,h===null&&(h=u.nullPolyfill),s.__proto__=h,m&&P(u.nullPolyfill,"__proto__",i),s},Object.defineProperty(l,"level",{configurable:!1,enumerable:!1,writable:!1,value:a.level})):null}(function(){var a=Object.create(null),l={},o,u=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(u){try{o=u.set,o.call(a,l)}catch{}if(Object.getPrototypeOf(a)===l)return{set:o,level:2}}return a.__proto__=l,Object.getPrototypeOf(a)===l?{level:2}:(a={},a.__proto__=l,Object.getPrototypeOf(a)===l?{level:1}:!1)}()),WX()}),nA=ze((te,Y)=>{Y.exports=CD()()?Object.setPrototypeOf:MD()}),qX=ze((te,Y)=>{var d=AD();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not an Object");return y}}),GX=ze((te,Y)=>{var d=Object.create(null),y=Math.random;Y.exports=function(){var z;do z=y().toString(36).slice(2);while(d[z]);return z}}),zb=ze((te,Y)=>{var d=void 0;Y.exports=function(y){return y!==d&&y!==null}}),aA=ze((te,Y)=>{var d=zb(),y={object:!0,function:!0,undefined:!0};Y.exports=function(z){return d(z)?hasOwnProperty.call(y,typeof z):!1}}),ZX=ze((te,Y)=>{var d=aA();Y.exports=function(y){if(!d(y))return!1;try{return y.constructor?y.constructor.prototype===y:!1}catch{return!1}}}),KX=ze((te,Y)=>{var d=ZX();Y.exports=function(y){if(typeof y!="function"||!hasOwnProperty.call(y,"length"))return!1;try{if(typeof y.length!="number"||typeof y.call!="function"||typeof y.apply!="function")return!1}catch{return!1}return!d(y)}}),ED=ze((te,Y)=>{var d=KX(),y=/^\s*class[\s{/}]/,z=Function.prototype.toString;Y.exports=function(P){return!(!d(P)||y.test(z.call(P)))}}),YX=ze((te,Y)=>{Y.exports=function(){var d=Object.assign,y;return typeof d!="function"?!1:(y={foo:"raz"},d(y,{bar:"dwa"},{trzy:"trzy"}),y.foo+y.bar+y.trzy==="razdwatrzy")}}),XX=ze((te,Y)=>{Y.exports=function(){try{return Object.keys("primitive"),!0}catch{return!1}}}),JX=ze((te,Y)=>{var d=G_(),y=Object.keys;Y.exports=function(z){return y(d(z)?Object(z):z)}}),QX=ze((te,Y)=>{Y.exports=XX()()?Object.keys:JX()}),eJ=ze((te,Y)=>{var d=QX(),y=hy(),z=Math.max;Y.exports=function(P,i){var n,a,l=z(arguments.length,2),o;for(P=Object(y(P)),o=function(u){try{P[u]=i[u]}catch(s){n||(n=s)}},a=1;a{Y.exports=YX()()?Object.assign:eJ()}),LD=ze((te,Y)=>{var d=G_(),y=Array.prototype.forEach,z=Object.create,P=function(i,n){var a;for(a in i)n[a]=i[a]};Y.exports=function(i){var n=z(null);return y.call(arguments,function(a){d(a)&&P(Object(a),n)}),n}}),tJ=ze((te,Y)=>{var d="razdwatrzy";Y.exports=function(){return typeof d.contains!="function"?!1:d.contains("dwa")===!0&&d.contains("foo")===!1}}),rJ=ze((te,Y)=>{var d=String.prototype.indexOf;Y.exports=function(y){return d.call(this,y,arguments[1])>-1}}),PD=ze((te,Y)=>{Y.exports=tJ()()?String.prototype.contains:rJ()}),fy=ze((te,Y)=>{var d=zb(),y=ED(),z=oA(),P=LD(),i=PD(),n=Y.exports=function(a,l){var o,u,s,h,m;return arguments.length<2||typeof a!="string"?(h=l,l=a,a=null):h=arguments[2],d(a)?(o=i.call(a,"c"),u=i.call(a,"e"),s=i.call(a,"w")):(o=s=!0,u=!1),m={value:l,configurable:o,enumerable:u,writable:s},h?z(P(h),m):m};n.gs=function(a,l,o){var u,s,h,m;return typeof a!="string"?(h=o,o=l,l=a,a=null):h=arguments[3],d(l)?y(l)?d(o)?y(o)||(h=o,o=void 0):o=void 0:(h=l,l=o=void 0):l=void 0,d(a)?(u=i.call(a,"c"),s=i.call(a,"e")):(u=!0,s=!1),m={get:l,set:o,configurable:u,enumerable:s},h?z(P(h),m):m}}),M6=ze((te,Y)=>{var d=Object.prototype.toString,y=d.call(function(){return arguments}());Y.exports=function(z){return d.call(z)===y}}),E6=ze((te,Y)=>{var d=Object.prototype.toString,y=d.call("");Y.exports=function(z){return typeof z=="string"||z&&typeof z=="object"&&(z instanceof String||d.call(z)===y)||!1}}),iJ=ze((te,Y)=>{Y.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}),nJ=ze((te,Y)=>{var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};Y.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}),L6=ze((te,Y)=>{Y.exports=iJ()()?globalThis:nJ()}),aJ=ze((te,Y)=>{var d=L6(),y={object:!0,symbol:!0};Y.exports=function(){var z=d.Symbol,P;if(typeof z!="function")return!1;P=z("test symbol");try{String(P)}catch{return!1}return!(!y[typeof z.iterator]||!y[typeof z.toPrimitive]||!y[typeof z.toStringTag])}}),oJ=ze((te,Y)=>{Y.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}),ID=ze((te,Y)=>{var d=oJ();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not a symbol");return y}}),sJ=ze((te,Y)=>{var d=fy(),y=Object.create,z=Object.defineProperty,P=Object.prototype,i=y(null);Y.exports=function(n){for(var a=0,l,o;i[n+(a||"")];)++a;return n+=a||"",i[n]=!0,l="@@"+n,z(P,l,d.gs(null,function(u){o||(o=!0,z(this,l,d(u)),o=!1)})),l}}),lJ=ze((te,Y)=>{var d=fy(),y=L6().Symbol;Y.exports=function(z){return Object.defineProperties(z,{hasInstance:d("",y&&y.hasInstance||z("hasInstance")),isConcatSpreadable:d("",y&&y.isConcatSpreadable||z("isConcatSpreadable")),iterator:d("",y&&y.iterator||z("iterator")),match:d("",y&&y.match||z("match")),replace:d("",y&&y.replace||z("replace")),search:d("",y&&y.search||z("search")),species:d("",y&&y.species||z("species")),split:d("",y&&y.split||z("split")),toPrimitive:d("",y&&y.toPrimitive||z("toPrimitive")),toStringTag:d("",y&&y.toStringTag||z("toStringTag")),unscopables:d("",y&&y.unscopables||z("unscopables"))})}}),uJ=ze((te,Y)=>{var d=fy(),y=ID(),z=Object.create(null);Y.exports=function(P){return Object.defineProperties(P,{for:d(function(i){return z[i]?z[i]:z[i]=P(String(i))}),keyFor:d(function(i){var n;y(i);for(n in z)if(z[n]===i)return n})})}}),cJ=ze((te,Y)=>{var d=fy(),y=ID(),z=L6().Symbol,P=sJ(),i=lJ(),n=uJ(),a=Object.create,l=Object.defineProperties,o=Object.defineProperty,u,s,h;if(typeof z=="function")try{String(z()),h=!0}catch{}else z=null;s=function(m){if(this instanceof s)throw new TypeError("Symbol is not a constructor");return u(m)},Y.exports=u=function m(b){var x;if(this instanceof m)throw new TypeError("Symbol is not a constructor");return h?z(b):(x=a(s.prototype),b=b===void 0?"":String(b),l(x,{__description__:d("",b),__name__:d("",P(b))}))},i(u),n(u),l(s.prototype,{constructor:d(u),toString:d("",function(){return this.__name__})}),l(u.prototype,{toString:d(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:d(function(){return y(this)})}),o(u.prototype,u.toPrimitive,d("",function(){var m=y(this);return typeof m=="symbol"?m:m.toString()})),o(u.prototype,u.toStringTag,d("c","Symbol")),o(s.prototype,u.toStringTag,d("c",u.prototype[u.toStringTag])),o(s.prototype,u.toPrimitive,d("c",u.prototype[u.toPrimitive]))}),Z_=ze((te,Y)=>{Y.exports=aJ()()?L6().Symbol:cJ()}),hJ=ze((te,Y)=>{var d=hy();Y.exports=function(){return d(this).length=0,this}}),Zw=ze((te,Y)=>{Y.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}),fJ=ze((te,Y)=>{var d=zb(),y=aA(),z=Object.prototype.toString;Y.exports=function(P){if(!d(P))return null;if(y(P)){var i=P.toString;if(typeof i!="function"||i===z)return null}try{return""+P}catch{return null}}}),dJ=ze((te,Y)=>{Y.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}),pJ=ze((te,Y)=>{var d=dJ(),y=/[\n\r\u2028\u2029]/g;Y.exports=function(z){var P=d(z);return P===null?"":(P.length>100&&(P=P.slice(0,99)+"…"),P=P.replace(y,function(i){switch(i){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),P)}}),DD=ze((te,Y)=>{var d=zb(),y=aA(),z=fJ(),P=pJ(),i=function(n,a){return n.replace("%v",P(a))};Y.exports=function(n,a,l){if(!y(l))throw new TypeError(i(a,n));if(!d(n)){if("default"in l)return l.default;if(l.isOptional)return null}var o=z(l.errorMessage);throw d(o)||(o=a),new TypeError(i(o,n))}}),mJ=ze((te,Y)=>{var d=DD(),y=zb();Y.exports=function(z){return y(z)?z:d(z,"Cannot use %v",arguments[1])}}),gJ=ze((te,Y)=>{var d=DD(),y=ED();Y.exports=function(z){return y(z)?z:d(z,"%v is not a plain function",arguments[1])}}),vJ=ze((te,Y)=>{Y.exports=function(){var d=Array.from,y,z;return typeof d!="function"?!1:(y=["raz","dwa"],z=d(y),!!(z&&z!==y&&z[1]==="dwa"))}}),yJ=ze((te,Y)=>{var d=Object.prototype.toString,y=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);Y.exports=function(z){return typeof z=="function"&&y(d.call(z))}}),_J=ze((te,Y)=>{Y.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}),xJ=ze((te,Y)=>{Y.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}),bJ=ze((te,Y)=>{Y.exports=_J()()?Math.sign:xJ()}),wJ=ze((te,Y)=>{var d=bJ(),y=Math.abs,z=Math.floor;Y.exports=function(P){return isNaN(P)?0:(P=Number(P),P===0||!isFinite(P)?P:d(P)*z(y(P)))}}),kJ=ze((te,Y)=>{var d=wJ(),y=Math.max;Y.exports=function(z){return y(0,d(z))}}),TJ=ze((te,Y)=>{var d=Z_().iterator,y=M6(),z=yJ(),P=kJ(),i=Zw(),n=hy(),a=G_(),l=E6(),o=Array.isArray,u=Function.prototype.call,s={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;Y.exports=function(m){var b=arguments[1],x=arguments[2],_,A,f,k,w,D,E,I,M,p;if(m=Object(n(m)),a(b)&&i(b),!this||this===Array||!z(this)){if(!b){if(y(m))return w=m.length,w!==1?Array.apply(null,m):(k=new Array(1),k[0]=m[0],k);if(o(m)){for(k=new Array(w=m.length),A=0;A=55296&&D<=56319&&(p+=m[++A])),p=b?u.call(b,x,p,f):p,_?(s.value=p,h(k,f,s)):k[f]=p,++f;w=f}}if(w===void 0)for(w=P(m.length),_&&(k=new _(w)),A=0;A{Y.exports=vJ()()?Array.from:TJ()}),CJ=ze((te,Y)=>{var d=SJ(),y=oA(),z=hy();Y.exports=function(P){var i=Object(z(P)),n=arguments[1],a=Object(arguments[2]);if(i!==P&&!n)return i;var l={};return n?d(n,function(o){(a.ensure||o in P)&&(l[o]=P[o])}):y(l,P),l}}),AJ=ze((te,Y)=>{var d=Zw(),y=hy(),z=Function.prototype.bind,P=Function.prototype.call,i=Object.keys,n=Object.prototype.propertyIsEnumerable;Y.exports=function(a,l){return function(o,u){var s,h=arguments[2],m=arguments[3];return o=Object(y(o)),d(u),s=i(o),m&&s.sort(typeof m=="function"?z.call(m,o):void 0),typeof a!="function"&&(a=s[a]),P.call(a,s,function(b,x){return n.call(o,b)?P.call(u,h,o[b],b,o,x):l})}}}),MJ=ze((te,Y)=>{Y.exports=AJ()("forEach")}),EJ=ze((te,Y)=>{var d=Zw(),y=MJ(),z=Function.prototype.call;Y.exports=function(P,i){var n={},a=arguments[2];return d(i),y(P,function(l,o,u,s){n[o]=z.call(i,a,l,o,u,s)}),n}}),LJ=ze((te,Y)=>{var d=zb(),y=mJ(),z=gJ(),P=CJ(),i=LD(),n=EJ(),a=Function.prototype.bind,l=Object.defineProperty,o=Object.prototype.hasOwnProperty,u;u=function(s,h,m){var b=y(h)&&z(h.value),x;return x=P(h),delete x.writable,delete x.value,x.get=function(){return!m.overwriteDefinition&&o.call(this,s)?b:(h.value=a.call(b,m.resolveContext?m.resolveContext(this):this),l(this,s,h),this[s])},x},Y.exports=function(s){var h=i(arguments[1]);return d(h.resolveContext)&&z(h.resolveContext),n(s,function(m,b){return u(b,m,h)})}}),zD=ze((te,Y)=>{var d=hJ(),y=oA(),z=Zw(),P=hy(),i=fy(),n=LJ(),a=Z_(),l=Object.defineProperty,o=Object.defineProperties,u;Y.exports=u=function(s,h){if(!(this instanceof u))throw new TypeError("Constructor requires 'new'");o(this,{__list__:i("w",P(s)),__context__:i("w",h),__nextIndex__:i("w",0)}),h&&(z(h.on),h.on("_add",this._onAdd),h.on("_delete",this._onDelete),h.on("_clear",this._onClear))},delete u.prototype.constructor,o(u.prototype,y({_next:i(function(){var s;if(this.__list__){if(this.__redo__&&(s=this.__redo__.shift(),s!==void 0))return s;if(this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){l(this,"__redo__",i("c",[s]));return}this.__redo__.forEach(function(h,m){h>=s&&(this.__redo__[m]=++h)},this),this.__redo__.push(s)}}),_onDelete:i(function(s){var h;s>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(h=this.__redo__.indexOf(s),h!==-1&&this.__redo__.splice(h,1),this.__redo__.forEach(function(m,b){m>s&&(this.__redo__[b]=--m)},this)))}),_onClear:i(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),l(u.prototype,a.iterator,i(function(){return this}))}),PJ=ze((te,Y)=>{var d=nA(),y=PD(),z=fy(),P=Z_(),i=zD(),n=Object.defineProperty,a;a=Y.exports=function(l,o){if(!(this instanceof a))throw new TypeError("Constructor requires 'new'");i.call(this,l),o?y.call(o,"key+value")?o="key+value":y.call(o,"key")?o="key":o="value":o="value",n(this,"__kind__",z("",o))},d&&d(a,i),delete a.prototype.constructor,a.prototype=Object.create(i.prototype,{_resolve:z(function(l){return this.__kind__==="value"?this.__list__[l]:this.__kind__==="key+value"?[l,this.__list__[l]]:l})}),n(a.prototype,P.toStringTag,z("c","Array Iterator"))}),IJ=ze((te,Y)=>{var d=nA(),y=fy(),z=Z_(),P=zD(),i=Object.defineProperty,n;n=Y.exports=function(a){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");a=String(a),P.call(this,a),i(this,"__length__",y("",a.length))},d&&d(n,P),delete n.prototype.constructor,n.prototype=Object.create(P.prototype,{_next:y(function(){if(this.__list__){if(this.__nextIndex__=55296&&o<=56319?l+this.__list__[this.__nextIndex__++]:l)})}),i(n.prototype,z.toStringTag,y("c","String Iterator"))}),DJ=ze((te,Y)=>{var d=M6(),y=G_(),z=E6(),P=Z_().iterator,i=Array.isArray;Y.exports=function(n){return y(n)?i(n)||z(n)||d(n)?!0:typeof n[P]=="function":!1}}),zJ=ze((te,Y)=>{var d=DJ();Y.exports=function(y){if(!d(y))throw new TypeError(y+" is not iterable");return y}}),OD=ze((te,Y)=>{var d=M6(),y=E6(),z=PJ(),P=IJ(),i=zJ(),n=Z_().iterator;Y.exports=function(a){return typeof i(a)[n]=="function"?a[n]():d(a)?new z(a):y(a)?new P(a):new z(a)}}),OJ=ze((te,Y)=>{var d=M6(),y=Zw(),z=E6(),P=OD(),i=Array.isArray,n=Function.prototype.call,a=Array.prototype.some;Y.exports=function(l,o){var u,s=arguments[2],h,m,b,x,_,A,f;if(i(l)||d(l)?u="array":z(l)?u="string":l=P(l),y(o),m=function(){b=!0},u==="array"){a.call(l,function(k){return n.call(o,s,k,m),b});return}if(u==="string"){for(_=l.length,x=0;x<_&&(A=l[x],x+1<_&&(f=A.charCodeAt(0),f>=55296&&f<=56319&&(A+=l[++x])),n.call(o,s,A,m),!b);++x);return}for(h=l.next();!h.done;){if(n.call(o,s,h.value,m),b)return;h=l.next()}}}),BJ=ze((te,Y)=>{Y.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}),RJ=ze((te,Y)=>{var d=G_(),y=nA(),z=qX(),P=hy(),i=GX(),n=fy(),a=OD(),l=OJ(),o=Z_().toStringTag,u=BJ(),s=Array.isArray,h=Object.defineProperty,m=Object.prototype.hasOwnProperty,b=Object.getPrototypeOf,x;Y.exports=x=function(){var _=arguments[0],A;if(!(this instanceof x))throw new TypeError("Constructor requires 'new'");return A=u&&y&&WeakMap!==x?y(new WeakMap,b(this)):this,d(_)&&(s(_)||(_=a(_))),h(A,"__weakMapData__",n("c","$weakMap$"+i())),_&&l(_,function(f){P(f),A.set(f[0],f[1])}),A},u&&(y&&y(x,WeakMap),x.prototype=Object.create(WeakMap.prototype,{constructor:n(x)})),Object.defineProperties(x.prototype,{delete:n(function(_){return m.call(z(_),this.__weakMapData__)?(delete _[this.__weakMapData__],!0):!1}),get:n(function(_){if(m.call(z(_),this.__weakMapData__))return _[this.__weakMapData__]}),has:n(function(_){return m.call(z(_),this.__weakMapData__)}),set:n(function(_,A){return h(z(_),this.__weakMapData__,n("c",A)),this}),toString:n(function(){return"[object WeakMap]"})}),h(x.prototype,o,n("c","WeakMap"))}),BD=ze((te,Y)=>{Y.exports=HX()()?WeakMap:RJ()}),FJ=ze((te,Y)=>{Y.exports=function(d,y,z){if(typeof Array.prototype.findIndex=="function")return d.findIndex(y,z);if(typeof y!="function")throw new TypeError("predicate must be a function");var P=Object(d),i=P.length;if(i===0)return-1;for(var n=0;n{var d=$_(),y=Pb(),z=Yd(),P=Qv(),i=Ib(),n=UX(),a=$X(),{float32:l,fract32:o}=iA(),u=BD(),s=Gw(),h=FJ(),m=` precision highp float; attribute vec2 aCoord, bCoord, aCoordFract, bCoordFract; @@ -2703,7 +2703,7 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= alpha * opacity * dash; } -`;Y.exports=k;function k(w,D){if(!(this instanceof k))return new k(w,D);if(typeof w=="function"?(D||(D={}),D.regl=w):D=w,D.length&&(D.positions=D),w=D.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=k.shaders.has(w)?k.shaders.get(w):k.shaders.set(w,k.createShaders(w)).get(w),this.update(D)}k.dashMult=2,k.maxPatternLength=256,k.precisionThreshold=3e6,k.maxPoints=1e4,k.maxLines=2048,k.shaders=new u,k.createShaders=function(w){let D=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(p,g)=>g.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(p,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},I=w(z({vert:m,frag:b,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),M;try{M=w(z({cull:{enable:!0,face:"back"},vert:A,frag:f,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{M=I}return{fill:w({primitive:"triangle",elements:(p,g)=>g.triangles,offset:0,vert:x,frag:_,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:I,miter:M}},k.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},k.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},k.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((D,E)=>{if(D&&Array.isArray(D))return this.draw(...D);typeof D=="number"&&(D=this.passes[D]),D&&D.count>1&&D.opacity&&(this.regl._refresh(),D.fill&&D.triangles&&D.triangles.length>2&&this.shaders.fill(D),D.thickness&&(D.scale[0]*D.viewport.width>k.precisionThreshold||D.scale[1]*D.viewport.height>k.precisionThreshold?this.shaders.rect(D):D.join==="rect"||!D.join&&(D.thickness<=2||D.count>=k.maxPoints)?this.shaders.rect(D):this.shaders.miter(D)))}),this},k.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:D,gl:E}=this;if(w.forEach((M,p)=>{let g=this.passes[p];if(M!==void 0){if(M===null){this.passes[p]=null;return}if(typeof M[0]=="number"&&(M={positions:M}),M=P(M,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[p]=g={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:D.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:D.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},M=z({},k.defaults,M)),M.thickness!=null&&(g.thickness=parseFloat(M.thickness)),M.opacity!=null&&(g.opacity=parseFloat(M.opacity)),M.miterLimit!=null&&(g.miterLimit=parseFloat(M.miterLimit)),M.overlay!=null&&(g.overlay=!!M.overlay,pve-ce),ee=[],he=0,xe=g.hole!=null?g.hole[0]:null;if(xe!=null){let ve=h(G,ce=>ce>=xe);G=G.slice(0,ve),G.push(xe)}for(let ve=0;vene-xe+(G[ve]-he)),ge=n(ce,re);ge=ge.map(ne=>ne+he+(ne+he{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}),BJ=Fe((te,Y)=>{var d=Lb(),y=F_(),z=wD(),P=e1(),i=Kd(),n=Pb(),{float32:a,fract32:l}=tA();Y.exports=u;var o=[[1,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,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function u(s,h){if(typeof s=="function"?(h||(h={}),h.regl=s):h=s,h.length&&(h.positions=h),s=h.regl,!s.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let m=s._gl,b,x,_,A,f,k,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},D=[];return A=s.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),x=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),k=s.buffer({usage:"static",type:"float",data:o}),p(h),b=s({vert:` +`;Y.exports=k;function k(w,D){if(!(this instanceof k))return new k(w,D);if(typeof w=="function"?(D||(D={}),D.regl=w):D=w,D.length&&(D.positions=D),w=D.regl,!w.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=w._gl,this.regl=w,this.passes=[],this.shaders=k.shaders.has(w)?k.shaders.get(w):k.shaders.set(w,k.createShaders(w)).get(w),this.update(D)}k.dashMult=2,k.maxPatternLength=256,k.precisionThreshold=3e6,k.maxPoints=1e4,k.maxLines=2048,k.shaders=new u,k.createShaders=function(w){let D=w.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:w.prop("count"),count:4,offset:0,uniforms:{miterMode:(p,g)=>g.join==="round"?2:1,miterLimit:w.prop("miterLimit"),scale:w.prop("scale"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),thickness:w.prop("thickness"),dashTexture:w.prop("dashTexture"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),dashLength:w.prop("dashLength"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight],depth:w.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(p,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:w.prop("viewport")},viewport:w.prop("viewport")},I=w(z({vert:m,frag:b,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),M;try{M=w(z({cull:{enable:!0,face:"back"},vert:A,frag:f,attributes:{lineEnd:{buffer:D,divisor:0,stride:8,offset:0},lineTop:{buffer:D,divisor:0,stride:8,offset:4},aColor:{buffer:w.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:w.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:w.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{M=I}return{fill:w({primitive:"triangle",elements:(p,g)=>g.triangles,offset:0,vert:x,frag:_,uniforms:{scale:w.prop("scale"),color:w.prop("fill"),scaleFract:w.prop("scaleFract"),translateFract:w.prop("translateFract"),translate:w.prop("translate"),opacity:w.prop("opacity"),pixelRatio:w.context("pixelRatio"),id:w.prop("id"),viewport:(p,g)=>[g.viewport.x,g.viewport.y,p.viewportWidth,p.viewportHeight]},attributes:{position:{buffer:w.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:w.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.viewport}),rect:I,miter:M}},k.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},k.prototype.render=function(...w){w.length&&this.update(...w),this.draw()},k.prototype.draw=function(...w){return(w.length?w:this.passes).forEach((D,E)=>{if(D&&Array.isArray(D))return this.draw(...D);typeof D=="number"&&(D=this.passes[D]),D&&D.count>1&&D.opacity&&(this.regl._refresh(),D.fill&&D.triangles&&D.triangles.length>2&&this.shaders.fill(D),D.thickness&&(D.scale[0]*D.viewport.width>k.precisionThreshold||D.scale[1]*D.viewport.height>k.precisionThreshold?this.shaders.rect(D):D.join==="rect"||!D.join&&(D.thickness<=2||D.count>=k.maxPoints)?this.shaders.rect(D):this.shaders.miter(D)))}),this},k.prototype.update=function(w){if(!w)return;w.length!=null?typeof w[0]=="number"&&(w=[{positions:w}]):Array.isArray(w)||(w=[w]);let{regl:D,gl:E}=this;if(w.forEach((M,p)=>{let g=this.passes[p];if(M!==void 0){if(M===null){this.passes[p]=null;return}if(typeof M[0]=="number"&&(M={positions:M}),M=P(M,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[p]=g={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:D.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:D.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:D.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},M=z({},k.defaults,M)),M.thickness!=null&&(g.thickness=parseFloat(M.thickness)),M.opacity!=null&&(g.opacity=parseFloat(M.opacity)),M.miterLimit!=null&&(g.miterLimit=parseFloat(M.miterLimit)),M.overlay!=null&&(g.overlay=!!M.overlay,pve-ce),ee=[],he=0,be=g.hole!=null?g.hole[0]:null;if(be!=null){let ve=h(G,ce=>ce>=be);G=G.slice(0,ve),G.push(be)}for(let ve=0;vene-be+(G[ve]-he)),ge=n(ce,re);ge=ge.map(ne=>ne+he+(ne+he{w.colorBuffer.destroy(),w.positionBuffer.destroy(),w.dashTexture.destroy()}),this.passes.length=0,this}}),NJ=ze((te,Y)=>{var d=Pb(),y=$_(),z=TD(),P=Qv(),i=Yd(),n=Ib(),{float32:a,fract32:l}=iA();Y.exports=u;var o=[[1,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,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function u(s,h){if(typeof s=="function"?(h||(h={}),h.regl=s):h=s,h.length&&(h.positions=h),s=h.regl,!s.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let m=s._gl,b,x,_,A,f,k,w={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},D=[];return A=s.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),x=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),_=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),f=s.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),k=s.buffer({usage:"static",type:"float",data:o}),p(h),b=s({vert:` precision highp float; attribute vec2 position, positionFract; @@ -2747,10 +2747,10 @@ void main() { gl_FragColor = fragColor; gl_FragColor.a *= opacity; } - `,uniforms:{range:s.prop("range"),lineWidth:s.prop("lineWidth"),capSize:s.prop("capSize"),opacity:s.prop("opacity"),scale:s.prop("scale"),translate:s.prop("translate"),scaleFract:s.prop("scaleFract"),translateFract:s.prop("translateFract"),viewport:(C,T)=>[T.viewport.x,T.viewport.y,C.viewportWidth,C.viewportHeight]},attributes:{color:{buffer:A,offset:(C,T)=>T.offset*4,divisor:1},position:{buffer:x,offset:(C,T)=>T.offset*8,divisor:1},positionFract:{buffer:_,offset:(C,T)=>T.offset*8,divisor:1},error:{buffer:f,offset:(C,T)=>T.offset*16,divisor:1},direction:{buffer:k,stride:24,offset:0},lineOffset:{buffer:k,stride:24,offset:8},capOffset:{buffer:k,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:s.prop("viewport")},viewport:s.prop("viewport"),stencil:!1,instances:s.prop("count"),count:o.length}),i(E,{update:p,draw:I,destroy:g,regl:s,gl:m,canvas:m.canvas,groups:D}),E;function E(C){C?p(C):C===null&&g(),I()}function I(C){if(typeof C=="number")return M(C);C&&!Array.isArray(C)&&(C=[C]),s._refresh(),D.forEach((T,N)=>{if(T){if(C&&(C[N]?T.draw=!0:T.draw=!1),!T.draw){T.draw=!0;return}M(N)}})}function M(C){typeof C=="number"&&(C=D[C]),C!=null&&C&&C.count&&C.color&&C.opacity&&C.positions&&C.positions.length>1&&(C.scaleRatio=[C.scale[0]*C.viewport.width,C.scale[1]*C.viewport.height],b(C),C.after&&C.after(C))}function p(C){if(!C)return;C.length!=null?typeof C[0]=="number"&&(C=[{positions:C}]):Array.isArray(C)||(C=[C]);let T=0,N=0;if(E.groups=D=C.map((V,W)=>{let F=D[W];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return F;return V=P(V,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),F||(D[W]=F={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=i({},w,V)),z(F,V,[{lineWidth:$=>+$*.5,capSize:$=>+$*.5,opacity:parseFloat,errors:$=>($=n($),N+=$.length,$),positions:($,q)=>($=n($,"float64"),q.count=Math.floor($.length/2),q.bounds=d($,2),q.offset=T,T+=q.count,$)},{color:($,q)=>{let G=q.count;if($||($="transparent"),!Array.isArray($)||typeof $[0]=="number"){let he=$;$=Array(G);for(let xe=0;xe{let ee=q.bounds;return $||($=ee),q.scale=[1/($[2]-$[0]),1/($[3]-$[1])],q.translate=[-$[0],-$[1]],q.scaleFract=l(q.scale),q.translateFract=l(q.translate),$},viewport:$=>{let q;return Array.isArray($)?q={x:$[0],y:$[1],width:$[2]-$[0],height:$[3]-$[1]}:$?(q={x:$.x||$.left||0,y:$.y||$.top||0},$.right?q.width=$.right-q.x:q.width=$.w||$.width||0,$.bottom?q.height=$.bottom-q.y:q.height=$.h||$.height||0):q={x:0,y:0,width:m.drawingBufferWidth,height:m.drawingBufferHeight},q}}]),F}),T||N){let V=D.reduce((q,G,ee)=>q+(G?G.count:0),0),W=new Float64Array(V*2),F=new Uint8Array(V*4),$=new Float32Array(V*4);D.forEach((q,G)=>{if(!q)return;let{positions:ee,count:he,offset:xe,color:ve,errors:ce}=q;he&&(F.set(ve,xe*4),$.set(ce,xe*4),W.set(ee,xe*2))});var B=a(W);x(B);var U=l(W,B);_(U),A(F),f($)}}function g(){x.destroy(),_.destroy(),A.destroy(),f.destroy(),k.destroy()}}}),RJ=Fe((te,Y)=>{var d=/[\'\"]/;Y.exports=function(y){return y?(d.test(y.charAt(0))&&(y=y.substr(1)),d.test(y.charAt(y.length-1))&&(y=y.substr(0,y.length-1)),y):""}}),BD=Fe((te,Y)=>{Y.exports=["inherit","initial","unset"]}),RD=Fe((te,Y)=>{Y.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),FD=Fe((te,Y)=>{Y.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),ND=Fe((te,Y)=>{Y.exports=["normal","italic","oblique"]}),jD=Fe((te,Y)=>{Y.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),FJ=Fe((te,Y)=>{function d(P,i){if(typeof P!="string")return[P];var n=[P];typeof i=="string"||Array.isArray(i)?i={brackets:i}:i||(i={});var a=i.brackets?Array.isArray(i.brackets)?i.brackets:[i.brackets]:["{}","[]","()"],l=i.escape||"___",o=!!i.flat;a.forEach(function(h){var m=new RegExp(["\\",h[0],"[^\\",h[0],"\\",h[1],"]*\\",h[1]].join("")),b=[];function x(_,A,f){var k=n.push(_.slice(h[0].length,-h[1].length))-1;return b.push(k),l+k+l}n.forEach(function(_,A){for(var f,k=0;_!=f;)if(f=_,_=_.replace(m,x),k++>1e4)throw Error("References have circular dependency. Please, check them.");n[A]=_}),b=b.reverse(),n=n.map(function(_){return b.forEach(function(A){_=_.replace(new RegExp("(\\"+l+A+"\\"+l+")","g"),h[0]+"$1"+h[1])}),_})});var u=new RegExp("\\"+l+"([0-9]+)\\"+l);function s(h,m,b){for(var x=[],_,A=0;_=u.exec(h);){if(A++>1e4)throw Error("Circular references in parenthesis");x.push(h.slice(0,_.index)),x.push(s(m[_[1]],m)),h=h.slice(_.index+_[0].length)}return x.push(h),x}return o?n:s(n[0],n)}function y(P,i){if(i&&i.flat){var n=i&&i.escape||"___",a=P[0],l;if(!a)return"";for(var o=new RegExp("\\"+n+"([0-9]+)\\"+n),u=0;a!=l;){if(u++>1e4)throw Error("Circular references in "+P);l=a,a=a.replace(o,s)}return a}return P.reduce(function h(m,b){return Array.isArray(b)&&(b=b.reduce(h,"")),m+b},"");function s(h,m){if(P[m]==null)throw Error("Reference "+m+"is undefined");return P[m]}}function z(P,i){return Array.isArray(P)?y(P,i):d(P,i)}z.parse=d,z.stringify=y,Y.exports=z}),NJ=Fe((te,Y)=>{var d=FJ();Y.exports=function(y,z,P){if(y==null)throw Error("First argument should be a string");if(z==null)throw Error("Separator should be a string or a RegExp");P?(typeof P=="string"||Array.isArray(P))&&(P={ignore:P}):P={},P.escape==null&&(P.escape=!0),P.ignore==null?P.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof P.ignore=="string"&&(P.ignore=[P.ignore]),P.ignore=P.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var i=d.parse(y,{flat:!0,brackets:P.ignore}),n=i[0],a=n.split(z);if(P.escape){for(var l=[],o=0;o{Y.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),UD=Fe((te,Y)=>{var d=jJ();Y.exports={isSize:function(y){return/^[\d\.]/.test(y)||y.indexOf("/")!==-1||d.indexOf(y)!==-1}}}),UJ=Fe((te,Y)=>{var d=RJ(),y=BD(),z=RD(),P=FD(),i=ND(),n=jD(),a=NJ(),l=UD().isSize;Y.exports=u;var o=u.cache={};function u(h){if(typeof h!="string")throw new Error("Font argument must be a string.");if(o[h])return o[h];if(h==="")throw new Error("Cannot parse an empty string.");if(z.indexOf(h)!==-1)return o[h]={system:h};for(var m={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},b=a(h,/\s+/),x;x=b.shift();){if(y.indexOf(x)!==-1)return["style","variant","weight","stretch"].forEach(function(A){m[A]=x}),o[h]=m;if(i.indexOf(x)!==-1){m.style=x;continue}if(x==="normal"||x==="small-caps"){m.variant=x;continue}if(n.indexOf(x)!==-1){m.stretch=x;continue}if(P.indexOf(x)!==-1){m.weight=x;continue}if(l(x)){var _=a(x,"/");if(m.size=_[0],_[1]!=null?m.lineHeight=s(_[1]):b[0]==="/"&&(b.shift(),m.lineHeight=s(b.shift())),!b.length)throw new Error("Missing required font-family.");return m.family=a(b.join(" "),/\s*,\s*/).map(d),o[h]=m}throw new Error("Unknown or unsupported font token: "+x)}throw new Error("Missing required font-size.")}function s(h){var m=parseFloat(h);return m.toString()===h?m:h}}),$D=Fe((te,Y)=>{var d=e1(),y=UD().isSize,z=h(BD()),P=h(RD()),i=h(FD()),n=h(ND()),a=h(jD()),l={normal:1,"small-caps":1},o={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},u={size:"1rem",family:"serif"};Y.exports=function(m){if(m=d(m,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),m.system)return m.system&&s(m.system,P),m.system;if(s(m.style,n),s(m.variant,l),s(m.weight,i),s(m.stretch,a),m.size==null&&(m.size=u.size),typeof m.size=="number"&&(m.size+="px"),!y)throw Error("Bad size value `"+m.size+"`");m.family||(m.family=u.family),Array.isArray(m.family)&&(m.family.length||(m.family=[u.family]),m.family=m.family.map(function(x){return o[x]?x:'"'+x+'"'}).join(", "));var b=[];return b.push(m.style),m.variant!==m.style&&b.push(m.variant),m.weight!==m.variant&&m.weight!==m.style&&b.push(m.weight),m.stretch!==m.weight&&m.stretch!==m.variant&&m.stretch!==m.style&&b.push(m.stretch),b.push(m.size+(m.lineHeight==null||m.lineHeight==="normal"||m.lineHeight+""=="1"?"":"/"+m.lineHeight)),b.push(m.family),b.filter(Boolean).join(" ")};function s(m,b){if(m&&!b[m]&&!z[m])throw Error("Unknown keyword `"+m+"`");return m}function h(m){for(var b={},x=0;x{Y.exports={parse:UJ(),stringify:$D()}}),HJ=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():d.createREGL=y()})(te,function(){var d=function(St,Pr){for(var Nr=Object.keys(Pr),en=0;en1&&Pr===Nr&&(Pr==='"'||Pr==="'"))return['"'+a(St.substr(1,St.length-2))+'"'];var en=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(en)return l(St.substr(0,en.index)).concat(l(en[1])).concat(l(St.substr(en.index+en[0].length)));var Cn=St.split(".");if(Cn.length===1)return['"'+a(St)+'"'];for(var xn=[],Oi=0;Oi"u"?1:window.devicePixelRatio,La=!1,no={},Ka=function(Ei){},da=function(){};if(typeof Pr=="string"?Nr=document.querySelector(Pr):typeof Pr=="object"&&(k(Pr)?Nr=Pr:w(Pr)?(xn=Pr,Cn=xn.canvas):("gl"in Pr?xn=Pr.gl:"canvas"in Pr?Cn=E(Pr.canvas):"container"in Pr&&(en=E(Pr.container)),"attributes"in Pr&&(Oi=Pr.attributes),"extensions"in Pr&&(Tn=D(Pr.extensions)),"optionalExtensions"in Pr&&(ua=D(Pr.optionalExtensions)),"onDone"in Pr&&(Ka=Pr.onDone),"profile"in Pr&&(La=!!Pr.profile),"pixelRatio"in Pr&&(ia=+Pr.pixelRatio),"cachedCode"in Pr&&(no=Pr.cachedCode))),Nr&&(Nr.nodeName.toLowerCase()==="canvas"?Cn=Nr:en=Nr),!xn){if(!Cn){var Nn=A(en||document.body,Ka,ia);if(!Nn)return null;Cn=Nn.canvas,da=Nn.onDestroy}Oi.premultipliedAlpha===void 0&&(Oi.premultipliedAlpha=!0),xn=f(Cn,Oi)}return xn?{gl:xn,canvas:Cn,container:en,extensions:Tn,optionalExtensions:ua,pixelRatio:ia,profile:La,cachedCode:no,onDone:Ka,onDestroy:da}:(da(),Ka("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(St,Pr){var Nr={};function en(Oi){var Tn=Oi.toLowerCase(),ua;try{ua=Nr[Tn]=St.getExtension(Tn)}catch{}return!!ua}for(var Cn=0;Cn65535)<<4,St>>>=Pr,Nr=(St>255)<<3,St>>>=Nr,Pr|=Nr,Nr=(St>15)<<2,St>>>=Nr,Pr|=Nr,Nr=(St>3)<<1,St>>>=Nr,Pr|=Nr,Pr|St>>1}function $(){var St=p(8,function(){return[]});function Pr(xn){var Oi=W(xn),Tn=St[F(Oi)>>2];return Tn.length>0?Tn.pop():new ArrayBuffer(Oi)}function Nr(xn){St[F(xn.byteLength)>>2].push(xn)}function en(xn,Oi){var Tn=null;switch(xn){case g:Tn=new Int8Array(Pr(Oi),0,Oi);break;case C:Tn=new Uint8Array(Pr(Oi),0,Oi);break;case T:Tn=new Int16Array(Pr(2*Oi),0,Oi);break;case N:Tn=new Uint16Array(Pr(2*Oi),0,Oi);break;case B:Tn=new Int32Array(Pr(4*Oi),0,Oi);break;case U:Tn=new Uint32Array(Pr(4*Oi),0,Oi);break;case V:Tn=new Float32Array(Pr(4*Oi),0,Oi);break;default:return null}return Tn.length!==Oi?Tn.subarray(0,Oi):Tn}function Cn(xn){Nr(xn.buffer)}return{alloc:Pr,free:Nr,allocType:en,freeType:Cn}}var q=$();q.zero=$();var G=3408,ee=3410,he=3411,xe=3412,ve=3413,ce=3414,re=3415,ge=33901,ne=33902,se=3379,_e=3386,oe=34921,J=36347,me=36348,fe=35661,Ce=35660,Be=34930,Oe=36349,Ze=34076,Ge=34024,rt=7936,_t=7937,pt=7938,gt=35724,ct=34047,Ae=36063,ze=34852,Ee=3553,nt=34067,xt=34069,ut=33984,Et=6408,Gt=5126,Jt=5121,gr=36160,mr=36053,Kr=36064,ri=16384,Mr=function(St,Pr){var Nr=1;Pr.ext_texture_filter_anisotropic&&(Nr=St.getParameter(ct));var en=1,Cn=1;Pr.webgl_draw_buffers&&(en=St.getParameter(ze),Cn=St.getParameter(Ae));var xn=!!Pr.oes_texture_float;if(xn){var Oi=St.createTexture();St.bindTexture(Ee,Oi),St.texImage2D(Ee,0,Et,1,1,0,Et,Gt,null);var Tn=St.createFramebuffer();if(St.bindFramebuffer(gr,Tn),St.framebufferTexture2D(gr,Kr,Ee,Oi,0),St.bindTexture(Ee,null),St.checkFramebufferStatus(gr)!==mr)xn=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(ri);var ua=q.allocType(Gt,4);St.readPixels(0,0,1,1,Et,Gt,ua),St.getError()?xn=!1:(St.deleteFramebuffer(Tn),St.deleteTexture(Oi),xn=ua[0]===1),q.freeType(ua)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),La=!0;if(!ia){var no=St.createTexture(),Ka=q.allocType(Jt,36);St.activeTexture(ut),St.bindTexture(nt,no),St.texImage2D(xt,0,Et,3,3,0,Et,Jt,Ka),q.freeType(Ka),St.bindTexture(nt,null),St.deleteTexture(no),La=!St.getError()}return{colorBits:[St.getParameter(ee),St.getParameter(he),St.getParameter(xe),St.getParameter(ve)],depthBits:St.getParameter(ce),stencilBits:St.getParameter(re),subpixelBits:St.getParameter(G),extensions:Object.keys(Pr).filter(function(da){return!!Pr[da]}),maxAnisotropic:Nr,maxDrawbuffers:en,maxColorAttachments:Cn,pointSizeDims:St.getParameter(ge),lineWidthDims:St.getParameter(ne),maxViewportDims:St.getParameter(_e),maxCombinedTextureUnits:St.getParameter(fe),maxCubeMapSize:St.getParameter(Ze),maxRenderbufferSize:St.getParameter(Ge),maxTextureUnits:St.getParameter(Be),maxTextureSize:St.getParameter(se),maxAttributes:St.getParameter(oe),maxVertexUniforms:St.getParameter(J),maxVertexTextureUnits:St.getParameter(Ce),maxVaryingVectors:St.getParameter(me),maxFragmentUniforms:St.getParameter(Oe),glsl:St.getParameter(gt),renderer:St.getParameter(_t),vendor:St.getParameter(rt),version:St.getParameter(pt),readFloat:xn,npotTextureCube:La}},ui=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function mi(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||ui(St.data))}var Ot=function(St){return Object.keys(St).map(function(Pr){return St[Pr]})},Je={shape:at,flatten:He};function ot(St,Pr,Nr){for(var en=0;en0){var Qa;if(Array.isArray(on[0])){ba=fn(on);for(var Bn=1,wn=1;wn0){if(typeof Bn[0]=="number"){var oa=q.allocType(bn.dtype,Bn.length);fi(oa,Bn),ba(oa,ja),q.freeType(oa)}else if(Array.isArray(Bn[0])||ui(Bn[0])){Ca=fn(Bn);var la=Sn(Bn,Ca,bn.dtype);ba(la,ja),q.freeType(la)}}}else if(mi(Bn)){Ca=Bn.shape;var Da=Bn.stride,$o=0,Io=0,Ia=0,qa=0;Ca.length===1?($o=Ca[0],Io=1,Ia=Da[0],qa=0):Ca.length===2&&($o=Ca[0],Io=Ca[1],Ia=Da[0],qa=Da[1]);var Co=Array.isArray(Bn.data)?bn.dtype:Cr(Bn.data),Ro=q.allocType(Co,$o*Io);qi(Ro,Bn.data,$o,Io,Ia,qa,Bn.offset),ba(Ro,ja),q.freeType(Ro)}return Na}return Kn||Na(Ei),Na._reglType="buffer",Na._buffer=bn,Na.subdata=Qa,Nr.profile&&(Na.stats=bn.stats),Na.destroy=function(){Ka(bn)},Na}function Nn(){Ot(xn).forEach(function(Ei){Ei.buffer=St.createBuffer(),St.bindBuffer(Ei.type,Ei.buffer),St.bufferData(Ei.type,Ei.persistentData||Ei.byteLength,Ei.usage)})}return Nr.profile&&(Pr.getTotalBufferSize=function(){var Ei=0;return Object.keys(xn).forEach(function(on){Ei+=xn[on].stats.size}),Ei}),{create:da,createStream:ua,destroyStream:ia,clear:function(){Ot(xn).forEach(Ka),Tn.forEach(Ka)},getBuffer:function(Ei){return Ei&&Ei._buffer instanceof Oi?Ei._buffer:null},restore:Nn,_initBuffer:no}}var Hi=0,En=0,Rn=1,Gn=1,Xn=4,sa=4,Mn={points:Hi,point:En,lines:Rn,line:Gn,triangles:Xn,triangle:sa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ha=0,ro=1,Ft=4,Rt=5120,qr=5121,ni=5122,oi=5123,Gr=5124,si=5125,Pi=34963,yi=35040,zt=35044;function xr(St,Pr,Nr,en){var Cn={},xn=0,Oi={uint8:qr,uint16:oi};Pr.oes_element_index_uint&&(Oi.uint32=si);function Tn(Nn){this.id=xn++,Cn[this.id]=this,this.buffer=Nn,this.primType=Ft,this.vertCount=0,this.type=0}Tn.prototype.bind=function(){this.buffer.bind()};var ua=[];function ia(Nn){var Ei=ua.pop();return Ei||(Ei=new Tn(Nr.create(null,Pi,!0,!1)._buffer)),no(Ei,Nn,yi,-1,-1,0,0),Ei}function La(Nn){ua.push(Nn)}function no(Nn,Ei,on,Kn,Fn,bn,Na){Nn.buffer.bind();var ba;if(Ei){var Qa=Na;!Na&&(!ui(Ei)||mi(Ei)&&!ui(Ei.data))&&(Qa=Pr.oes_element_index_uint?si:oi),Nr._initBuffer(Nn.buffer,Ei,on,Qa,3)}else St.bufferData(Pi,bn,on),Nn.buffer.dtype=ba||qr,Nn.buffer.usage=on,Nn.buffer.dimension=3,Nn.buffer.byteLength=bn;if(ba=Na,!Na){switch(Nn.buffer.dtype){case qr:case Rt:ba=qr;break;case oi:case ni:ba=oi;break;case si:case Gr:ba=si;break}Nn.buffer.dtype=ba}Nn.type=ba;var Bn=Fn;Bn<0&&(Bn=Nn.buffer.byteLength,ba===oi?Bn>>=1:ba===si&&(Bn>>=2)),Nn.vertCount=Bn;var wn=Kn;if(Kn<0){wn=Ft;var ja=Nn.buffer.dimension;ja===1&&(wn=Ha),ja===2&&(wn=ro),ja===3&&(wn=Ft)}Nn.primType=wn}function Ka(Nn){en.elementsCount--,delete Cn[Nn.id],Nn.buffer.destroy(),Nn.buffer=null}function da(Nn,Ei){var on=Nr.create(null,Pi,!0),Kn=new Tn(on._buffer);en.elementsCount++;function Fn(bn){if(!bn)on(),Kn.primType=Ft,Kn.vertCount=0,Kn.type=qr;else if(typeof bn=="number")on(bn),Kn.primType=Ft,Kn.vertCount=bn|0,Kn.type=qr;else{var Na=null,ba=zt,Qa=-1,Bn=-1,wn=0,ja=0;Array.isArray(bn)||ui(bn)||mi(bn)?Na=bn:("data"in bn&&(Na=bn.data),"usage"in bn&&(ba=Wn[bn.usage]),"primitive"in bn&&(Qa=Mn[bn.primitive]),"count"in bn&&(Bn=bn.count|0),"type"in bn&&(ja=Oi[bn.type]),"length"in bn?wn=bn.length|0:(wn=Bn,ja===oi||ja===ni?wn*=2:(ja===si||ja===Gr)&&(wn*=4))),no(Kn,Na,ba,Qa,Bn,wn,ja)}return Fn}return Fn(Nn),Fn._reglType="elements",Fn._elements=Kn,Fn.subdata=function(bn,Na){return on.subdata(bn,Na),Fn},Fn.destroy=function(){Ka(Kn)},Fn}return{create:da,createStream:ia,destroyStream:La,getElements:function(Nn){return typeof Nn=="function"&&Nn._elements instanceof Tn?Nn._elements:null},clear:function(){Ot(Cn).forEach(Ka)}}}var Jr=new Float32Array(1),Ri=new Uint32Array(Jr.buffer),tn=5123;function _n(St){for(var Pr=q.allocType(tn,St.length),Nr=0;Nr>>31<<15,xn=(en<<1>>>24)-127,Oi=en>>13&1023;if(xn<-24)Pr[Nr]=Cn;else if(xn<-14){var Tn=-14-xn;Pr[Nr]=Cn+(Oi+1024>>Tn)}else xn>15?Pr[Nr]=Cn+31744:Pr[Nr]=Cn+(xn+15<<10)+Oi}return Pr}function Zi(St){return Array.isArray(St)||ui(St)}var Wi=34467,dn=3553,Ua=34067,ea=34069,fo=6408,ho=6406,Vo=6407,Ao=6409,Wo=6410,Wa=32854,ks=32855,fs=36194,_l=32819,es=32820,rl=33635,ds=34042,xl=6402,ol=34041,Gl=35904,ms=35906,Bs=36193,No=33776,Es=33777,Il=33778,Jl=33779,ou=35986,Gs=35987,$a=34798,So=35840,Xs=35841,su=35842,is=35843,tu=36196,pl=5121,Nl=5123,Gu=5125,bo=5126,Ls=10242,Rs=10243,pu=10497,bl=33071,ls=33648,Bu=10240,ic=10241,Ll=9728,Hl=9729,lu=9984,hu=9985,pc=9986,Ah=9987,uh=33170,gh=4352,Qf=4353,Ff=4354,Vl=34046,Kc=3317,ed=37440,xc=37441,mc=37443,bc=37444,vh=33984,yu=[lu,pc,hu,Ah],gc=[0,Ao,Wo,Vo,fo],hl={};hl[Ao]=hl[ho]=hl[xl]=1,hl[ol]=hl[Wo]=2,hl[Vo]=hl[Gl]=3,hl[fo]=hl[ms]=4;function ru(St){return"[object "+St+"]"}var Fh=ru("HTMLCanvasElement"),jc=ru("OffscreenCanvas"),Jh=ru("CanvasRenderingContext2D"),Mu=ru("ImageBitmap"),Yd=ru("HTMLImageElement"),sl=ru("HTMLVideoElement"),hp=Object.keys(ht).concat([Fh,jc,Jh,Mu,Yd,sl]),jl=[];jl[pl]=1,jl[bo]=4,jl[Bs]=2,jl[Nl]=2,jl[Gu]=4;var os=[];os[Wa]=2,os[ks]=2,os[fs]=2,os[ol]=4,os[No]=.5,os[Es]=.5,os[Il]=1,os[Jl]=1,os[ou]=.5,os[Gs]=1,os[$a]=1,os[So]=.5,os[Xs]=.25,os[su]=.5,os[is]=.25,os[tu]=.5;function _f(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function yh(St){if(!Array.isArray(St))return!1;var Pr=St.length;return!(Pr===0||!Zi(St[0]))}function hc(St){return Object.prototype.toString.call(St)}function td(St){return hc(St)===Fh}function Qh(St){return hc(St)===jc}function Ef(St){return hc(St)===Jh}function vc(St){return hc(St)===Mu}function Ld(St){return hc(St)===Yd}function cd(St){return hc(St)===sl}function Lf(St){if(!St)return!1;var Pr=hc(St);return hp.indexOf(Pr)>=0?!0:_f(St)||yh(St)||mi(St)}function ef(St){return ht[Object.prototype.toString.call(St)]|0}function rd(St,Pr){var Nr=Pr.length;switch(St.type){case pl:case Nl:case Gu:case bo:var en=q.allocType(St.type,Nr);en.set(Pr),St.data=en;break;case Bs:St.data=_n(Pr);break}}function id(St,Pr){return q.allocType(St.type===Bs?bo:St.type,Pr)}function _h(St,Pr){St.type===Bs?(St.data=_n(Pr),q.freeType(Pr)):St.data=Pr}function hd(St,Pr,Nr,en,Cn,xn){for(var Oi=St.width,Tn=St.height,ua=St.channels,ia=Oi*Tn*ua,La=id(St,ia),no=0,Ka=0;Ka=1;)Tn+=Oi*ua*ua,ua/=2;return Tn}else return Oi*Nr*en}function Mh(St,Pr,Nr,en,Cn,xn,Oi){var Tn={"don't care":gh,"dont care":gh,nice:Ff,fast:Qf},ua={repeat:pu,clamp:bl,mirror:ls},ia={nearest:Ll,linear:Hl},La=d({mipmap:Ah,"nearest mipmap nearest":lu,"linear mipmap nearest":hu,"nearest mipmap linear":pc,"linear mipmap linear":Ah},ia),no={none:0,browser:bc},Ka={uint8:pl,rgba4:_l,rgb565:rl,"rgb5 a1":es},da={alpha:ho,luminance:Ao,"luminance alpha":Wo,rgb:Vo,rgba:fo,rgba4:Wa,"rgb5 a1":ks,rgb565:fs},Nn={};Pr.ext_srgb&&(da.srgb=Gl,da.srgba=ms),Pr.oes_texture_float&&(Ka.float32=Ka.float=bo),Pr.oes_texture_half_float&&(Ka.float16=Ka["half float"]=Bs),Pr.webgl_depth_texture&&(d(da,{depth:xl,"depth stencil":ol}),d(Ka,{uint16:Nl,uint32:Gu,"depth stencil":ds})),Pr.webgl_compressed_texture_s3tc&&d(Nn,{"rgb s3tc dxt1":No,"rgba s3tc dxt1":Es,"rgba s3tc dxt3":Il,"rgba s3tc dxt5":Jl}),Pr.webgl_compressed_texture_atc&&d(Nn,{"rgb atc":ou,"rgba atc explicit alpha":Gs,"rgba atc interpolated alpha":$a}),Pr.webgl_compressed_texture_pvrtc&&d(Nn,{"rgb pvrtc 4bppv1":So,"rgb pvrtc 2bppv1":Xs,"rgba pvrtc 4bppv1":su,"rgba pvrtc 2bppv1":is}),Pr.webgl_compressed_texture_etc1&&(Nn["rgb etc1"]=tu);var Ei=Array.prototype.slice.call(St.getParameter(Wi));Object.keys(Nn).forEach(function(K){var le=Nn[K];Ei.indexOf(le)>=0&&(da[K]=le)});var on=Object.keys(da);Nr.textureFormats=on;var Kn=[];Object.keys(da).forEach(function(K){var le=da[K];Kn[le]=K});var Fn=[];Object.keys(Ka).forEach(function(K){var le=Ka[K];Fn[le]=K});var bn=[];Object.keys(ia).forEach(function(K){var le=ia[K];bn[le]=K});var Na=[];Object.keys(La).forEach(function(K){var le=La[K];Na[le]=K});var ba=[];Object.keys(ua).forEach(function(K){var le=ua[K];ba[le]=K});var Qa=on.reduce(function(K,le){var ie=da[le];return ie===Ao||ie===ho||ie===Ao||ie===Wo||ie===xl||ie===ol||Pr.ext_srgb&&(ie===Gl||ie===ms)?K[ie]=ie:ie===ks||le.indexOf("rgba")>=0?K[ie]=fo:K[ie]=Vo,K},{});function Bn(){this.internalformat=fo,this.format=fo,this.type=pl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function wn(K,le){K.internalformat=le.internalformat,K.format=le.format,K.type=le.type,K.compressed=le.compressed,K.premultiplyAlpha=le.premultiplyAlpha,K.flipY=le.flipY,K.unpackAlignment=le.unpackAlignment,K.colorSpace=le.colorSpace,K.width=le.width,K.height=le.height,K.channels=le.channels}function ja(K,le){if(!(typeof le!="object"||!le)){if("premultiplyAlpha"in le&&(K.premultiplyAlpha=le.premultiplyAlpha),"flipY"in le&&(K.flipY=le.flipY),"alignment"in le&&(K.unpackAlignment=le.alignment),"colorSpace"in le&&(K.colorSpace=no[le.colorSpace]),"type"in le){var ie=le.type;K.type=Ka[ie]}var we=K.width,We=K.height,mt=K.channels,wt=!1;"shape"in le?(we=le.shape[0],We=le.shape[1],le.shape.length===3&&(mt=le.shape[2],wt=!0)):("radius"in le&&(we=We=le.radius),"width"in le&&(we=le.width),"height"in le&&(We=le.height),"channels"in le&&(mt=le.channels,wt=!0)),K.width=we|0,K.height=We|0,K.channels=mt|0;var Qe=!1;if("format"in le){var dt=le.format,It=K.internalformat=da[dt];K.format=Qa[It],dt in Ka&&("type"in le||(K.type=Ka[dt])),dt in Nn&&(K.compressed=!0),Qe=!0}!wt&&Qe?K.channels=hl[K.format]:wt&&!Qe&&K.channels!==gc[K.format]&&(K.format=K.internalformat=gc[K.channels])}}function Ca(K){St.pixelStorei(ed,K.flipY),St.pixelStorei(xc,K.premultiplyAlpha),St.pixelStorei(mc,K.colorSpace),St.pixelStorei(Kc,K.unpackAlignment)}function oa(){Bn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function la(K,le){var ie=null;if(Lf(le)?ie=le:le&&(ja(K,le),"x"in le&&(K.xOffset=le.x|0),"y"in le&&(K.yOffset=le.y|0),Lf(le.data)&&(ie=le.data)),le.copy){var we=Cn.viewportWidth,We=Cn.viewportHeight;K.width=K.width||we-K.xOffset,K.height=K.height||We-K.yOffset,K.needsCopy=!0}else if(!ie)K.width=K.width||1,K.height=K.height||1,K.channels=K.channels||4;else if(ui(ie))K.channels=K.channels||4,K.data=ie,!("type"in le)&&K.type===pl&&(K.type=ef(ie));else if(_f(ie))K.channels=K.channels||4,rd(K,ie),K.alignment=1,K.needsFree=!0;else if(mi(ie)){var mt=ie.data;!Array.isArray(mt)&&K.type===pl&&(K.type=ef(mt));var wt=ie.shape,Qe=ie.stride,dt,It,lr,Qt,ar,pr;wt.length===3?(lr=wt[2],pr=Qe[2]):(lr=1,pr=1),dt=wt[0],It=wt[1],Qt=Qe[0],ar=Qe[1],K.alignment=1,K.width=dt,K.height=It,K.channels=lr,K.format=K.internalformat=gc[lr],K.needsFree=!0,hd(K,mt,Qt,ar,pr,ie.offset)}else if(td(ie)||Qh(ie)||Ef(ie))td(ie)||Qh(ie)?K.element=ie:K.element=ie.canvas,K.width=K.element.width,K.height=K.element.height,K.channels=4;else if(vc(ie))K.element=ie,K.width=ie.width,K.height=ie.height,K.channels=4;else if(Ld(ie))K.element=ie,K.width=ie.naturalWidth,K.height=ie.naturalHeight,K.channels=4;else if(cd(ie))K.element=ie,K.width=ie.videoWidth,K.height=ie.videoHeight,K.channels=4;else if(yh(ie)){var yr=K.width||ie[0].length,qt=K.height||ie.length,tr=K.channels;Zi(ie[0][0])?tr=tr||ie[0][0].length:tr=tr||1;for(var Xt=Je.shape(ie),Fr=1,xi=0;xi>=We,ie.height>>=We,la(ie,we[We]),K.mipmask|=1<=0&&!("faces"in le)&&(K.genMipmaps=!0)}if("mag"in le){var we=le.mag;K.magFilter=ia[we]}var We=K.wrapS,mt=K.wrapT;if("wrap"in le){var wt=le.wrap;typeof wt=="string"?We=mt=ua[wt]:Array.isArray(wt)&&(We=ua[wt[0]],mt=ua[wt[1]])}else{if("wrapS"in le){var Qe=le.wrapS;We=ua[Qe]}if("wrapT"in le){var dt=le.wrapT;mt=ua[dt]}}if(K.wrapS=We,K.wrapT=mt,"anisotropic"in le&&(le.anisotropic,K.anisotropic=le.anisotropic),"mipmap"in le){var It=!1;switch(typeof le.mipmap){case"string":K.mipmapHint=Tn[le.mipmap],K.genMipmaps=!0,It=!0;break;case"boolean":It=K.genMipmaps=le.mipmap;break;case"object":K.genMipmaps=!1,It=!0;break}It&&!("min"in le)&&(K.minFilter=lu)}}function kc(K,le){St.texParameteri(le,ic,K.minFilter),St.texParameteri(le,Bu,K.magFilter),St.texParameteri(le,Ls,K.wrapS),St.texParameteri(le,Rs,K.wrapT),Pr.ext_texture_filter_anisotropic&&St.texParameteri(le,Vl,K.anisotropic),K.genMipmaps&&(St.hint(uh,K.mipmapHint),St.generateMipmap(le))}var Ec=0,Au={},wu=Nr.maxTextureUnits,Iu=Array(wu).map(function(){return null});function Zo(K){Bn.call(this),this.mipmask=0,this.internalformat=fo,this.id=Ec++,this.refCount=1,this.target=K,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new kl,Oi.profile&&(this.stats={size:0})}function Du(K){St.activeTexture(vh),St.bindTexture(K.target,K.texture)}function vl(){var K=Iu[0];K?St.bindTexture(K.target,K.texture):St.bindTexture(dn,null)}function Nu(K){var le=K.texture,ie=K.unit,we=K.target;ie>=0&&(St.activeTexture(vh+ie),St.bindTexture(we,null),Iu[ie]=null),St.deleteTexture(le),K.texture=null,K.params=null,K.pixels=null,K.refCount=0,delete Au[K.id],xn.textureCount--}d(Zo.prototype,{bind:function(){var K=this;K.bindCount+=1;var le=K.unit;if(le<0){for(var ie=0;ie0)continue;we.unit=-1}Iu[ie]=K,le=ie;break}Oi.profile&&xn.maxTextureUnits>ar)-lr,pr.height=pr.height||(ie.height>>ar)-Qt,Du(ie),$o(pr,dn,lr,Qt,ar),vl(),qa(pr),we}function mt(wt,Qe){var dt=wt|0,It=Qe|0||dt;if(dt===ie.width&&It===ie.height)return we;we.width=ie.width=dt,we.height=ie.height=It,Du(ie);for(var lr=0;ie.mipmask>>lr;++lr){var Qt=dt>>lr,ar=It>>lr;if(!Qt||!ar)break;St.texImage2D(dn,lr,ie.format,Qt,ar,0,ie.format,ie.type,null)}return vl(),Oi.profile&&(ie.stats.size=Nh(ie.internalformat,ie.type,dt,It,!1,!1)),we}return we(K,le),we.subimage=We,we.resize=mt,we._reglType="texture2d",we._texture=ie,Oi.profile&&(we.stats=ie.stats),we.destroy=function(){ie.decRef()},we}function Fo(K,le,ie,we,We,mt){var wt=new Zo(Ua);Au[wt.id]=wt,xn.cubeCount++;var Qe=new Array(6);function dt(Qt,ar,pr,yr,qt,tr){var Xt,Fr=wt.texInfo;for(kl.call(Fr),Xt=0;Xt<6;++Xt)Qe[Xt]=gs();if(typeof Qt=="number"||!Qt){var xi=Qt|0||1;for(Xt=0;Xt<6;++Xt)Ro(Qe[Xt],xi,xi)}else if(typeof Qt=="object")if(ar)us(Qe[0],Qt),us(Qe[1],ar),us(Qe[2],pr),us(Qe[3],yr),us(Qe[4],qt),us(Qe[5],tr);else if(Fu(Fr,Qt),ja(wt,Qt),"faces"in Qt){var Li=Qt.faces;for(Xt=0;Xt<6;++Xt)wn(Qe[Xt],wt),us(Qe[Xt],Li[Xt])}else for(Xt=0;Xt<6;++Xt)us(Qe[Xt],Qt);for(wn(wt,Qe[0]),Fr.genMipmaps?wt.mipmask=(Qe[0].width<<1)-1:wt.mipmask=Qe[0].mipmask,wt.internalformat=Qe[0].internalformat,dt.width=Qe[0].width,dt.height=Qe[0].height,Du(wt),Xt=0;Xt<6;++Xt)Kl(Qe[Xt],ea+Xt);for(kc(Fr,Ua),vl(),Oi.profile&&(wt.stats.size=Nh(wt.internalformat,wt.type,dt.width,dt.height,Fr.genMipmaps,!0)),dt.format=Kn[wt.internalformat],dt.type=Fn[wt.type],dt.mag=bn[Fr.magFilter],dt.min=Na[Fr.minFilter],dt.wrapS=ba[Fr.wrapS],dt.wrapT=ba[Fr.wrapT],Xt=0;Xt<6;++Xt)Pu(Qe[Xt]);return dt}function It(Qt,ar,pr,yr,qt){var tr=pr|0,Xt=yr|0,Fr=qt|0,xi=Ia();return wn(xi,wt),xi.width=0,xi.height=0,la(xi,ar),xi.width=xi.width||(wt.width>>Fr)-tr,xi.height=xi.height||(wt.height>>Fr)-Xt,Du(wt),$o(xi,ea+Qt,tr,Xt,Fr),vl(),qa(xi),dt}function lr(Qt){var ar=Qt|0;if(ar!==wt.width){dt.width=wt.width=ar,dt.height=wt.height=ar,Du(wt);for(var pr=0;pr<6;++pr)for(var yr=0;wt.mipmask>>yr;++yr)St.texImage2D(ea+pr,yr,wt.format,ar>>yr,ar>>yr,0,wt.format,wt.type,null);return vl(),Oi.profile&&(wt.stats.size=Nh(wt.internalformat,wt.type,dt.width,dt.height,!1,!0)),dt}}return dt(K,le,ie,we,We,mt),dt.subimage=It,dt.resize=lr,dt._reglType="textureCube",dt._texture=wt,Oi.profile&&(dt.stats=wt.stats),dt.destroy=function(){wt.decRef()},dt}function Ds(){for(var K=0;K>we,ie.height>>we,0,ie.internalformat,ie.type,null);else for(var We=0;We<6;++We)St.texImage2D(ea+We,we,ie.internalformat,ie.width>>we,ie.height>>we,0,ie.internalformat,ie.type,null);kc(ie.texInfo,ie.target)})}function Ml(){for(var K=0;K=0?Pu=!0:ua.indexOf(kl)>=0&&(Pu=!1))),("depthTexture"in Zo||"depthStencilTexture"in Zo)&&(Iu=!!(Zo.depthTexture||Zo.depthStencilTexture)),"depth"in Zo&&(typeof Zo.depth=="boolean"?Kl=Zo.depth:(Ec=Zo.depth,zl=!1)),"stencil"in Zo&&(typeof Zo.stencil=="boolean"?zl=Zo.stencil:(Au=Zo.stencil,Kl=!1)),"depthStencil"in Zo&&(typeof Zo.depthStencil=="boolean"?Kl=zl=Zo.depthStencil:(wu=Zo.depthStencil,Kl=!1,zl=!1))}var vl=null,Nu=null,Lc=null,Fo=null;if(Array.isArray(gs))vl=gs.map(Nn);else if(gs)vl=[Nn(gs)];else for(vl=new Array(kc),Co=0;Co0&&(qa.depth=la[0].depth,qa.stencil=la[0].stencil,qa.depthStencil=la[0].depthStencil),la[Ia]?la[Ia](qa):la[Ia]=wn(qa)}return d(Da,{width:Co,height:Co,color:kl})}function $o(Io){var Ia,qa=Io|0;if(qa===Da.width)return Da;var Co=Da.color;for(Ia=0;Ia=Co.byteLength?Ro.subdata(Co):(Ro.destroy(),wn.buffers[Io]=null)),wn.buffers[Io]||(Ro=wn.buffers[Io]=Cn.create(Ia,$f,!1,!0)),qa.buffer=Cn.getBuffer(Ro),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1,Da[Io]=1}else Cn.getBuffer(Ia)?(qa.buffer=Cn.getBuffer(Ia),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1):Cn.getBuffer(Ia.buffer)?(qa.buffer=Cn.getBuffer(Ia.buffer),qa.size=(+Ia.size||qa.buffer.dimension)|0,qa.normalized=!!Ia.normalized||!1,"type"in Ia?qa.type=un[Ia.type]:qa.type=qa.buffer.dtype,qa.offset=(Ia.offset||0)|0,qa.stride=(Ia.stride||0)|0,qa.divisor=(Ia.divisor||0)|0,qa.state=1):"x"in Ia&&(qa.x=+Ia.x||0,qa.y=+Ia.y||0,qa.z=+Ia.z||0,qa.w=+Ia.w||0,qa.state=2)}for(var us=0;us1)for(var Ca=0;CaEi&&(Ei=on.stats.uniformsCount)}),Ei},Nr.getMaxAttributesCount=function(){var Ei=0;return La.forEach(function(on){on.stats.attributesCount>Ei&&(Ei=on.stats.attributesCount)}),Ei});function Nn(){Cn={},xn={};for(var Ei=0;Ei>>4&15)+Pr.charAt(en&15);return Nr}function $h(St){for(var Pr="",Nr=-1,en,Cn;++Nr>>6&31,128|en&63):en<=65535?Pr+=String.fromCharCode(224|en>>>12&15,128|en>>>6&63,128|en&63):en<=2097151&&(Pr+=String.fromCharCode(240|en>>>18&7,128|en>>>12&63,128|en>>>6&63,128|en&63));return Pr}function Ph(St){for(var Pr=Array(St.length>>2),Nr=0;Nr>5]|=(St.charCodeAt(Nr/8)&255)<<24-Nr%32;return Pr}function Zu(St){for(var Pr="",Nr=0;Nr>5]>>>24-Nr%32&255);return Pr}function fu(St,Pr){return St>>>Pr|St<<32-Pr}function Ih(St,Pr){return St>>>Pr}function Tf(St,Pr,Nr){return St&Pr^~St&Nr}function Dh(St,Pr,Nr){return St&Pr^St&Nr^Pr&Nr}function ad(St){return fu(St,2)^fu(St,13)^fu(St,22)}function wr(St){return fu(St,6)^fu(St,11)^fu(St,25)}function Yr(St){return fu(St,7)^fu(St,18)^Ih(St,3)}function Ni(St){return fu(St,17)^fu(St,19)^Ih(St,10)}var Ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function hn(St,Pr){var Nr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),en=new Array(64),Cn,xn,Oi,Tn,ua,ia,La,no,Ka,da,Nn,Ei;for(St[Pr>>5]|=128<<24-Pr%32,St[(Pr+64>>9<<4)+15]=Pr,Ka=0;Ka>16)+(Pr>>16)+(Nr>>16);return en<<16|Nr&65535}function pa(St){return Array.prototype.slice.call(St)}function Ea(St){return pa(St).join("")}function Za(St){var Pr=St&&St.cache,Nr=0,en=[],Cn=[],xn=[];function Oi(Nn,Ei){var on=Ei&&Ei.stable;if(!on){for(var Kn=0;Kn0&&(Nn.push(Fn,"="),Nn.push.apply(Nn,pa(arguments)),Nn.push(";")),Fn}return d(Ei,{def:Kn,toString:function(){return Ea([on.length>0?"var "+on.join(",")+";":"",Ea(Nn)])}})}function ua(){var Nn=Tn(),Ei=Tn(),on=Nn.toString,Kn=Ei.toString;function Fn(bn,Na){Ei(bn,Na,"=",Nn.def(bn,Na),";")}return d(function(){Nn.apply(Nn,pa(arguments))},{def:Nn.def,entry:Nn,exit:Ei,save:Fn,set:function(bn,Na,ba){Fn(bn,Na),Nn(bn,Na,"=",ba,";")},toString:function(){return on()+Kn()}})}function ia(){var Nn=Ea(arguments),Ei=ua(),on=ua(),Kn=Ei.toString,Fn=on.toString;return d(Ei,{then:function(){return Ei.apply(Ei,pa(arguments)),this},else:function(){return on.apply(on,pa(arguments)),this},toString:function(){var bn=Fn();return bn&&(bn="else{"+bn+"}"),Ea(["if(",Nn,"){",Kn(),"}",bn])}})}var La=Tn(),no={};function Ka(Nn,Ei){var on=[];function Kn(){var Qa="a"+on.length;return on.push(Qa),Qa}Ei=Ei||0;for(var Fn=0;Fn[T.viewport.x,T.viewport.y,C.viewportWidth,C.viewportHeight]},attributes:{color:{buffer:A,offset:(C,T)=>T.offset*4,divisor:1},position:{buffer:x,offset:(C,T)=>T.offset*8,divisor:1},positionFract:{buffer:_,offset:(C,T)=>T.offset*8,divisor:1},error:{buffer:f,offset:(C,T)=>T.offset*16,divisor:1},direction:{buffer:k,stride:24,offset:0},lineOffset:{buffer:k,stride:24,offset:8},capOffset:{buffer:k,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:s.prop("viewport")},viewport:s.prop("viewport"),stencil:!1,instances:s.prop("count"),count:o.length}),i(E,{update:p,draw:I,destroy:g,regl:s,gl:m,canvas:m.canvas,groups:D}),E;function E(C){C?p(C):C===null&&g(),I()}function I(C){if(typeof C=="number")return M(C);C&&!Array.isArray(C)&&(C=[C]),s._refresh(),D.forEach((T,N)=>{if(T){if(C&&(C[N]?T.draw=!0:T.draw=!1),!T.draw){T.draw=!0;return}M(N)}})}function M(C){typeof C=="number"&&(C=D[C]),C!=null&&C&&C.count&&C.color&&C.opacity&&C.positions&&C.positions.length>1&&(C.scaleRatio=[C.scale[0]*C.viewport.width,C.scale[1]*C.viewport.height],b(C),C.after&&C.after(C))}function p(C){if(!C)return;C.length!=null?typeof C[0]=="number"&&(C=[{positions:C}]):Array.isArray(C)||(C=[C]);let T=0,N=0;if(E.groups=D=C.map((V,W)=>{let F=D[W];if(V)typeof V=="function"?V={after:V}:typeof V[0]=="number"&&(V={positions:V});else return F;return V=P(V,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),F||(D[W]=F={id:W,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},V=i({},w,V)),z(F,V,[{lineWidth:H=>+H*.5,capSize:H=>+H*.5,opacity:parseFloat,errors:H=>(H=n(H),N+=H.length,H),positions:(H,q)=>(H=n(H,"float64"),q.count=Math.floor(H.length/2),q.bounds=d(H,2),q.offset=T,T+=q.count,H)},{color:(H,q)=>{let G=q.count;if(H||(H="transparent"),!Array.isArray(H)||typeof H[0]=="number"){let he=H;H=Array(G);for(let be=0;be{let ee=q.bounds;return H||(H=ee),q.scale=[1/(H[2]-H[0]),1/(H[3]-H[1])],q.translate=[-H[0],-H[1]],q.scaleFract=l(q.scale),q.translateFract=l(q.translate),H},viewport:H=>{let q;return Array.isArray(H)?q={x:H[0],y:H[1],width:H[2]-H[0],height:H[3]-H[1]}:H?(q={x:H.x||H.left||0,y:H.y||H.top||0},H.right?q.width=H.right-q.x:q.width=H.w||H.width||0,H.bottom?q.height=H.bottom-q.y:q.height=H.h||H.height||0):q={x:0,y:0,width:m.drawingBufferWidth,height:m.drawingBufferHeight},q}}]),F}),T||N){let V=D.reduce((q,G,ee)=>q+(G?G.count:0),0),W=new Float64Array(V*2),F=new Uint8Array(V*4),H=new Float32Array(V*4);D.forEach((q,G)=>{if(!q)return;let{positions:ee,count:he,offset:be,color:ve,errors:ce}=q;he&&(F.set(ve,be*4),H.set(ce,be*4),W.set(ee,be*2))});var B=a(W);x(B);var U=l(W,B);_(U),A(F),f(H)}}function g(){x.destroy(),_.destroy(),A.destroy(),f.destroy(),k.destroy()}}}),jJ=ze((te,Y)=>{var d=/[\'\"]/;Y.exports=function(y){return y?(d.test(y.charAt(0))&&(y=y.substr(1)),d.test(y.charAt(y.length-1))&&(y=y.substr(0,y.length-1)),y):""}}),FD=ze((te,Y)=>{Y.exports=["inherit","initial","unset"]}),ND=ze((te,Y)=>{Y.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}),jD=ze((te,Y)=>{Y.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}),UD=ze((te,Y)=>{Y.exports=["normal","italic","oblique"]}),$D=ze((te,Y)=>{Y.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}),UJ=ze((te,Y)=>{function d(P,i){if(typeof P!="string")return[P];var n=[P];typeof i=="string"||Array.isArray(i)?i={brackets:i}:i||(i={});var a=i.brackets?Array.isArray(i.brackets)?i.brackets:[i.brackets]:["{}","[]","()"],l=i.escape||"___",o=!!i.flat;a.forEach(function(h){var m=new RegExp(["\\",h[0],"[^\\",h[0],"\\",h[1],"]*\\",h[1]].join("")),b=[];function x(_,A,f){var k=n.push(_.slice(h[0].length,-h[1].length))-1;return b.push(k),l+k+l}n.forEach(function(_,A){for(var f,k=0;_!=f;)if(f=_,_=_.replace(m,x),k++>1e4)throw Error("References have circular dependency. Please, check them.");n[A]=_}),b=b.reverse(),n=n.map(function(_){return b.forEach(function(A){_=_.replace(new RegExp("(\\"+l+A+"\\"+l+")","g"),h[0]+"$1"+h[1])}),_})});var u=new RegExp("\\"+l+"([0-9]+)\\"+l);function s(h,m,b){for(var x=[],_,A=0;_=u.exec(h);){if(A++>1e4)throw Error("Circular references in parenthesis");x.push(h.slice(0,_.index)),x.push(s(m[_[1]],m)),h=h.slice(_.index+_[0].length)}return x.push(h),x}return o?n:s(n[0],n)}function y(P,i){if(i&&i.flat){var n=i&&i.escape||"___",a=P[0],l;if(!a)return"";for(var o=new RegExp("\\"+n+"([0-9]+)\\"+n),u=0;a!=l;){if(u++>1e4)throw Error("Circular references in "+P);l=a,a=a.replace(o,s)}return a}return P.reduce(function h(m,b){return Array.isArray(b)&&(b=b.reduce(h,"")),m+b},"");function s(h,m){if(P[m]==null)throw Error("Reference "+m+"is undefined");return P[m]}}function z(P,i){return Array.isArray(P)?y(P,i):d(P,i)}z.parse=d,z.stringify=y,Y.exports=z}),$J=ze((te,Y)=>{var d=UJ();Y.exports=function(y,z,P){if(y==null)throw Error("First argument should be a string");if(z==null)throw Error("Separator should be a string or a RegExp");P?(typeof P=="string"||Array.isArray(P))&&(P={ignore:P}):P={},P.escape==null&&(P.escape=!0),P.ignore==null?P.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof P.ignore=="string"&&(P.ignore=[P.ignore]),P.ignore=P.ignore.map(function(h){return h.length===1&&(h=h+h),h}));var i=d.parse(y,{flat:!0,brackets:P.ignore}),n=i[0],a=n.split(z);if(P.escape){for(var l=[],o=0;o{Y.exports=["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller"]}),HD=ze((te,Y)=>{var d=HJ();Y.exports={isSize:function(y){return/^[\d\.]/.test(y)||y.indexOf("/")!==-1||d.indexOf(y)!==-1}}}),VJ=ze((te,Y)=>{var d=jJ(),y=FD(),z=ND(),P=jD(),i=UD(),n=$D(),a=$J(),l=HD().isSize;Y.exports=u;var o=u.cache={};function u(h){if(typeof h!="string")throw new Error("Font argument must be a string.");if(o[h])return o[h];if(h==="")throw new Error("Cannot parse an empty string.");if(z.indexOf(h)!==-1)return o[h]={system:h};for(var m={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},b=a(h,/\s+/),x;x=b.shift();){if(y.indexOf(x)!==-1)return["style","variant","weight","stretch"].forEach(function(A){m[A]=x}),o[h]=m;if(i.indexOf(x)!==-1){m.style=x;continue}if(x==="normal"||x==="small-caps"){m.variant=x;continue}if(n.indexOf(x)!==-1){m.stretch=x;continue}if(P.indexOf(x)!==-1){m.weight=x;continue}if(l(x)){var _=a(x,"/");if(m.size=_[0],_[1]!=null?m.lineHeight=s(_[1]):b[0]==="/"&&(b.shift(),m.lineHeight=s(b.shift())),!b.length)throw new Error("Missing required font-family.");return m.family=a(b.join(" "),/\s*,\s*/).map(d),o[h]=m}throw new Error("Unknown or unsupported font token: "+x)}throw new Error("Missing required font-size.")}function s(h){var m=parseFloat(h);return m.toString()===h?m:h}}),VD=ze((te,Y)=>{var d=Qv(),y=HD().isSize,z=h(FD()),P=h(ND()),i=h(jD()),n=h(UD()),a=h($D()),l={normal:1,"small-caps":1},o={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},u={size:"1rem",family:"serif"};Y.exports=function(m){if(m=d(m,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"}),m.system)return m.system&&s(m.system,P),m.system;if(s(m.style,n),s(m.variant,l),s(m.weight,i),s(m.stretch,a),m.size==null&&(m.size=u.size),typeof m.size=="number"&&(m.size+="px"),!y)throw Error("Bad size value `"+m.size+"`");m.family||(m.family=u.family),Array.isArray(m.family)&&(m.family.length||(m.family=[u.family]),m.family=m.family.map(function(x){return o[x]?x:'"'+x+'"'}).join(", "));var b=[];return b.push(m.style),m.variant!==m.style&&b.push(m.variant),m.weight!==m.variant&&m.weight!==m.style&&b.push(m.weight),m.stretch!==m.weight&&m.stretch!==m.variant&&m.stretch!==m.style&&b.push(m.stretch),b.push(m.size+(m.lineHeight==null||m.lineHeight==="normal"||m.lineHeight+""=="1"?"":"/"+m.lineHeight)),b.push(m.family),b.filter(Boolean).join(" ")};function s(m,b){if(m&&!b[m]&&!z[m])throw Error("Unknown keyword `"+m+"`");return m}function h(m){for(var b={},x=0;x{Y.exports={parse:VJ(),stringify:VD()}}),qJ=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():d.createREGL=y()})(te,function(){var d=function(St,Ir){for(var Nr=Object.keys(Ir),Qi=0;Qi1&&Ir===Nr&&(Ir==='"'||Ir==="'"))return['"'+a(St.substr(1,St.length-2))+'"'];var Qi=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(Qi)return l(St.substr(0,Qi.index)).concat(l(Qi[1])).concat(l(St.substr(Qi.index+Qi[0].length)));var Cn=St.split(".");if(Cn.length===1)return['"'+a(St)+'"'];for(var xn=[],Oi=0;Oi"u"?1:window.devicePixelRatio,La=!1,ao={},Ya=function(Ei){},da=function(){};if(typeof Ir=="string"?Nr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Nr=Ir:w(Ir)?(xn=Ir,Cn=xn.canvas):("gl"in Ir?xn=Ir.gl:"canvas"in Ir?Cn=E(Ir.canvas):"container"in Ir&&(Qi=E(Ir.container)),"attributes"in Ir&&(Oi=Ir.attributes),"extensions"in Ir&&(Tn=D(Ir.extensions)),"optionalExtensions"in Ir&&(ua=D(Ir.optionalExtensions)),"onDone"in Ir&&(Ya=Ir.onDone),"profile"in Ir&&(La=!!Ir.profile),"pixelRatio"in Ir&&(ia=+Ir.pixelRatio),"cachedCode"in Ir&&(ao=Ir.cachedCode))),Nr&&(Nr.nodeName.toLowerCase()==="canvas"?Cn=Nr:Qi=Nr),!xn){if(!Cn){var jn=A(Qi||document.body,Ya,ia);if(!jn)return null;Cn=jn.canvas,da=jn.onDestroy}Oi.premultipliedAlpha===void 0&&(Oi.premultipliedAlpha=!0),xn=f(Cn,Oi)}return xn?{gl:xn,canvas:Cn,container:Qi,extensions:Tn,optionalExtensions:ua,pixelRatio:ia,profile:La,cachedCode:ao,onDone:Ya,onDestroy:da}:(da(),Ya("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(St,Ir){var Nr={};function Qi(Oi){var Tn=Oi.toLowerCase(),ua;try{ua=Nr[Tn]=St.getExtension(Tn)}catch{}return!!ua}for(var Cn=0;Cn65535)<<4,St>>>=Ir,Nr=(St>255)<<3,St>>>=Nr,Ir|=Nr,Nr=(St>15)<<2,St>>>=Nr,Ir|=Nr,Nr=(St>3)<<1,St>>>=Nr,Ir|=Nr,Ir|St>>1}function H(){var St=p(8,function(){return[]});function Ir(xn){var Oi=W(xn),Tn=St[F(Oi)>>2];return Tn.length>0?Tn.pop():new ArrayBuffer(Oi)}function Nr(xn){St[F(xn.byteLength)>>2].push(xn)}function Qi(xn,Oi){var Tn=null;switch(xn){case g:Tn=new Int8Array(Ir(Oi),0,Oi);break;case C:Tn=new Uint8Array(Ir(Oi),0,Oi);break;case T:Tn=new Int16Array(Ir(2*Oi),0,Oi);break;case N:Tn=new Uint16Array(Ir(2*Oi),0,Oi);break;case B:Tn=new Int32Array(Ir(4*Oi),0,Oi);break;case U:Tn=new Uint32Array(Ir(4*Oi),0,Oi);break;case V:Tn=new Float32Array(Ir(4*Oi),0,Oi);break;default:return null}return Tn.length!==Oi?Tn.subarray(0,Oi):Tn}function Cn(xn){Nr(xn.buffer)}return{alloc:Ir,free:Nr,allocType:Qi,freeType:Cn}}var q=H();q.zero=H();var G=3408,ee=3410,he=3411,be=3412,ve=3413,ce=3414,re=3415,ge=33901,ne=33902,se=3379,_e=3386,oe=34921,J=36347,me=36348,fe=35661,Ce=35660,Re=34930,Be=36349,Ze=34076,Ge=34024,tt=7936,_t=7937,mt=7938,vt=35724,ct=34047,Ae=36063,Oe=34852,Le=3553,nt=34067,xt=34069,ut=33984,Et=6408,Gt=5126,Qt=5121,vr=36160,mr=36053,Yr=36064,ii=16384,Lr=function(St,Ir){var Nr=1;Ir.ext_texture_filter_anisotropic&&(Nr=St.getParameter(ct));var Qi=1,Cn=1;Ir.webgl_draw_buffers&&(Qi=St.getParameter(Oe),Cn=St.getParameter(Ae));var xn=!!Ir.oes_texture_float;if(xn){var Oi=St.createTexture();St.bindTexture(Le,Oi),St.texImage2D(Le,0,Et,1,1,0,Et,Gt,null);var Tn=St.createFramebuffer();if(St.bindFramebuffer(vr,Tn),St.framebufferTexture2D(vr,Yr,Le,Oi,0),St.bindTexture(Le,null),St.checkFramebufferStatus(vr)!==mr)xn=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(ii);var ua=q.allocType(Gt,4);St.readPixels(0,0,1,1,Et,Gt,ua),St.getError()?xn=!1:(St.deleteFramebuffer(Tn),St.deleteTexture(Oi),xn=ua[0]===1),q.freeType(ua)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),La=!0;if(!ia){var ao=St.createTexture(),Ya=q.allocType(Qt,36);St.activeTexture(ut),St.bindTexture(nt,ao),St.texImage2D(xt,0,Et,3,3,0,Et,Qt,Ya),q.freeType(Ya),St.bindTexture(nt,null),St.deleteTexture(ao),La=!St.getError()}return{colorBits:[St.getParameter(ee),St.getParameter(he),St.getParameter(be),St.getParameter(ve)],depthBits:St.getParameter(ce),stencilBits:St.getParameter(re),subpixelBits:St.getParameter(G),extensions:Object.keys(Ir).filter(function(da){return!!Ir[da]}),maxAnisotropic:Nr,maxDrawbuffers:Qi,maxColorAttachments:Cn,pointSizeDims:St.getParameter(ge),lineWidthDims:St.getParameter(ne),maxViewportDims:St.getParameter(_e),maxCombinedTextureUnits:St.getParameter(fe),maxCubeMapSize:St.getParameter(Ze),maxRenderbufferSize:St.getParameter(Ge),maxTextureUnits:St.getParameter(Re),maxTextureSize:St.getParameter(se),maxAttributes:St.getParameter(oe),maxVertexUniforms:St.getParameter(J),maxVertexTextureUnits:St.getParameter(Ce),maxVaryingVectors:St.getParameter(me),maxFragmentUniforms:St.getParameter(Be),glsl:St.getParameter(vt),renderer:St.getParameter(_t),vendor:St.getParameter(tt),version:St.getParameter(mt),readFloat:xn,npotTextureCube:La}},ci=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function vi(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||ci(St.data))}var Ot=function(St){return Object.keys(St).map(function(Ir){return St[Ir]})},Xe={shape:at,flatten:He};function ot(St,Ir,Nr){for(var Qi=0;Qi0){var eo;if(Array.isArray(an[0])){ka=dn(an);for(var Rn=1,wn=1;wn0){if(typeof Rn[0]=="number"){var oa=q.allocType(bn.dtype,Rn.length);di(oa,Rn),ka(oa,ja),q.freeType(oa)}else if(Array.isArray(Rn[0])||ci(Rn[0])){Aa=dn(Rn);var la=Sn(Rn,Aa,bn.dtype);ka(la,ja),q.freeType(la)}}}else if(vi(Rn)){Aa=Rn.shape;var Da=Rn.stride,$o=0,Do=0,Ia=0,qa=0;Aa.length===1?($o=Aa[0],Do=1,Ia=Da[0],qa=0):Aa.length===2&&($o=Aa[0],Do=Aa[1],Ia=Da[0],qa=Da[1]);var Co=Array.isArray(Rn.data)?bn.dtype:Er(Rn.data),Ro=q.allocType(Co,$o*Do);qi(Ro,Rn.data,$o,Do,Ia,qa,Rn.offset),ka(Ro,ja),q.freeType(Ro)}return Na}return Xn||Na(Ei),Na._reglType="buffer",Na._buffer=bn,Na.subdata=eo,Nr.profile&&(Na.stats=bn.stats),Na.destroy=function(){Ya(bn)},Na}function jn(){Ot(xn).forEach(function(Ei){Ei.buffer=St.createBuffer(),St.bindBuffer(Ei.type,Ei.buffer),St.bufferData(Ei.type,Ei.persistentData||Ei.byteLength,Ei.usage)})}return Nr.profile&&(Ir.getTotalBufferSize=function(){var Ei=0;return Object.keys(xn).forEach(function(an){Ei+=xn[an].stats.size}),Ei}),{create:da,createStream:ua,destroyStream:ia,clear:function(){Ot(xn).forEach(Ya),Tn.forEach(Ya)},getBuffer:function(Ei){return Ei&&Ei._buffer instanceof Oi?Ei._buffer:null},restore:jn,_initBuffer:ao}}var Hi=0,Ln=0,Fn=1,Kn=1,Jn=4,sa=4,Mn={points:Hi,point:Ln,lines:Fn,line:Kn,triangles:Jn,triangle:sa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ha=0,io=1,Ft=4,Rt=5120,qr=5121,ai=5122,si=5123,Gr=5124,li=5125,Pi=34963,xi=35040,zt=35044;function xr(St,Ir,Nr,Qi){var Cn={},xn=0,Oi={uint8:qr,uint16:si};Ir.oes_element_index_uint&&(Oi.uint32=li);function Tn(jn){this.id=xn++,Cn[this.id]=this,this.buffer=jn,this.primType=Ft,this.vertCount=0,this.type=0}Tn.prototype.bind=function(){this.buffer.bind()};var ua=[];function ia(jn){var Ei=ua.pop();return Ei||(Ei=new Tn(Nr.create(null,Pi,!0,!1)._buffer)),ao(Ei,jn,xi,-1,-1,0,0),Ei}function La(jn){ua.push(jn)}function ao(jn,Ei,an,Xn,Nn,bn,Na){jn.buffer.bind();var ka;if(Ei){var eo=Na;!Na&&(!ci(Ei)||vi(Ei)&&!ci(Ei.data))&&(eo=Ir.oes_element_index_uint?li:si),Nr._initBuffer(jn.buffer,Ei,an,eo,3)}else St.bufferData(Pi,bn,an),jn.buffer.dtype=ka||qr,jn.buffer.usage=an,jn.buffer.dimension=3,jn.buffer.byteLength=bn;if(ka=Na,!Na){switch(jn.buffer.dtype){case qr:case Rt:ka=qr;break;case si:case ai:ka=si;break;case li:case Gr:ka=li;break}jn.buffer.dtype=ka}jn.type=ka;var Rn=Nn;Rn<0&&(Rn=jn.buffer.byteLength,ka===si?Rn>>=1:ka===li&&(Rn>>=2)),jn.vertCount=Rn;var wn=Xn;if(Xn<0){wn=Ft;var ja=jn.buffer.dimension;ja===1&&(wn=Ha),ja===2&&(wn=io),ja===3&&(wn=Ft)}jn.primType=wn}function Ya(jn){Qi.elementsCount--,delete Cn[jn.id],jn.buffer.destroy(),jn.buffer=null}function da(jn,Ei){var an=Nr.create(null,Pi,!0),Xn=new Tn(an._buffer);Qi.elementsCount++;function Nn(bn){if(!bn)an(),Xn.primType=Ft,Xn.vertCount=0,Xn.type=qr;else if(typeof bn=="number")an(bn),Xn.primType=Ft,Xn.vertCount=bn|0,Xn.type=qr;else{var Na=null,ka=zt,eo=-1,Rn=-1,wn=0,ja=0;Array.isArray(bn)||ci(bn)||vi(bn)?Na=bn:("data"in bn&&(Na=bn.data),"usage"in bn&&(ka=Gn[bn.usage]),"primitive"in bn&&(eo=Mn[bn.primitive]),"count"in bn&&(Rn=bn.count|0),"type"in bn&&(ja=Oi[bn.type]),"length"in bn?wn=bn.length|0:(wn=Rn,ja===si||ja===ai?wn*=2:(ja===li||ja===Gr)&&(wn*=4))),ao(Xn,Na,ka,eo,Rn,wn,ja)}return Nn}return Nn(jn),Nn._reglType="elements",Nn._elements=Xn,Nn.subdata=function(bn,Na){return an.subdata(bn,Na),Nn},Nn.destroy=function(){Ya(Xn)},Nn}return{create:da,createStream:ia,destroyStream:La,getElements:function(jn){return typeof jn=="function"&&jn._elements instanceof Tn?jn._elements:null},clear:function(){Ot(Cn).forEach(Ya)}}}var Qr=new Float32Array(1),Ri=new Uint32Array(Qr.buffer),en=5123;function _n(St){for(var Ir=q.allocType(en,St.length),Nr=0;Nr>>31<<15,xn=(Qi<<1>>>24)-127,Oi=Qi>>13&1023;if(xn<-24)Ir[Nr]=Cn;else if(xn<-14){var Tn=-14-xn;Ir[Nr]=Cn+(Oi+1024>>Tn)}else xn>15?Ir[Nr]=Cn+31744:Ir[Nr]=Cn+(xn+15<<10)+Oi}return Ir}function Zi(St){return Array.isArray(St)||ci(St)}var Wi=34467,pn=3553,Ua=34067,ea=34069,fo=6408,ho=6406,Vo=6407,Ao=6409,Wo=6410,Wa=32854,Ts=32855,fs=36194,_l=32819,es=32820,rl=33635,ds=34042,xl=6402,sl=34041,Gl=35904,ms=35906,Bs=36193,No=33776,Ls=33777,Il=33778,Jl=33779,ou=35986,Gs=35987,$a=34798,So=35840,Xs=35841,su=35842,is=35843,tu=36196,pl=5121,Nl=5123,Gu=5125,bo=5126,Ps=10242,Rs=10243,pu=10497,bl=33071,ls=33648,Ru=10240,ic=10241,Ll=9728,Hl=9729,lu=9984,hu=9985,pc=9986,Ah=9987,uh=33170,gh=4352,td=4353,Nf=4354,Vl=34046,Kc=3317,rd=37440,xc=37441,mc=37443,bc=37444,vh=33984,yu=[lu,pc,hu,Ah],gc=[0,Ao,Wo,Vo,fo],hl={};hl[Ao]=hl[ho]=hl[xl]=1,hl[sl]=hl[Wo]=2,hl[Vo]=hl[Gl]=3,hl[fo]=hl[ms]=4;function ru(St){return"[object "+St+"]"}var Fh=ru("HTMLCanvasElement"),Uc=ru("OffscreenCanvas"),Jh=ru("CanvasRenderingContext2D"),Mu=ru("ImageBitmap"),Xd=ru("HTMLImageElement"),ll=ru("HTMLVideoElement"),fp=Object.keys(ht).concat([Fh,Uc,Jh,Mu,Xd,ll]),jl=[];jl[pl]=1,jl[bo]=4,jl[Bs]=2,jl[Nl]=2,jl[Gu]=4;var os=[];os[Wa]=2,os[Ts]=2,os[fs]=2,os[sl]=4,os[No]=.5,os[Ls]=.5,os[Il]=1,os[Jl]=1,os[ou]=.5,os[Gs]=1,os[$a]=1,os[So]=.5,os[Xs]=.25,os[su]=.5,os[is]=.25,os[tu]=.5;function _f(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function yh(St){if(!Array.isArray(St))return!1;var Ir=St.length;return!(Ir===0||!Zi(St[0]))}function hc(St){return Object.prototype.toString.call(St)}function id(St){return hc(St)===Fh}function Qh(St){return hc(St)===Uc}function Lf(St){return hc(St)===Jh}function vc(St){return hc(St)===Mu}function Pd(St){return hc(St)===Xd}function hd(St){return hc(St)===ll}function Pf(St){if(!St)return!1;var Ir=hc(St);return fp.indexOf(Ir)>=0?!0:_f(St)||yh(St)||vi(St)}function ef(St){return ht[Object.prototype.toString.call(St)]|0}function nd(St,Ir){var Nr=Ir.length;switch(St.type){case pl:case Nl:case Gu:case bo:var Qi=q.allocType(St.type,Nr);Qi.set(Ir),St.data=Qi;break;case Bs:St.data=_n(Ir);break}}function ad(St,Ir){return q.allocType(St.type===Bs?bo:St.type,Ir)}function _h(St,Ir){St.type===Bs?(St.data=_n(Ir),q.freeType(Ir)):St.data=Ir}function fd(St,Ir,Nr,Qi,Cn,xn){for(var Oi=St.width,Tn=St.height,ua=St.channels,ia=Oi*Tn*ua,La=ad(St,ia),ao=0,Ya=0;Ya=1;)Tn+=Oi*ua*ua,ua/=2;return Tn}else return Oi*Nr*Qi}function Mh(St,Ir,Nr,Qi,Cn,xn,Oi){var Tn={"don't care":gh,"dont care":gh,nice:Nf,fast:td},ua={repeat:pu,clamp:bl,mirror:ls},ia={nearest:Ll,linear:Hl},La=d({mipmap:Ah,"nearest mipmap nearest":lu,"linear mipmap nearest":hu,"nearest mipmap linear":pc,"linear mipmap linear":Ah},ia),ao={none:0,browser:bc},Ya={uint8:pl,rgba4:_l,rgb565:rl,"rgb5 a1":es},da={alpha:ho,luminance:Ao,"luminance alpha":Wo,rgb:Vo,rgba:fo,rgba4:Wa,"rgb5 a1":Ts,rgb565:fs},jn={};Ir.ext_srgb&&(da.srgb=Gl,da.srgba=ms),Ir.oes_texture_float&&(Ya.float32=Ya.float=bo),Ir.oes_texture_half_float&&(Ya.float16=Ya["half float"]=Bs),Ir.webgl_depth_texture&&(d(da,{depth:xl,"depth stencil":sl}),d(Ya,{uint16:Nl,uint32:Gu,"depth stencil":ds})),Ir.webgl_compressed_texture_s3tc&&d(jn,{"rgb s3tc dxt1":No,"rgba s3tc dxt1":Ls,"rgba s3tc dxt3":Il,"rgba s3tc dxt5":Jl}),Ir.webgl_compressed_texture_atc&&d(jn,{"rgb atc":ou,"rgba atc explicit alpha":Gs,"rgba atc interpolated alpha":$a}),Ir.webgl_compressed_texture_pvrtc&&d(jn,{"rgb pvrtc 4bppv1":So,"rgb pvrtc 2bppv1":Xs,"rgba pvrtc 4bppv1":su,"rgba pvrtc 2bppv1":is}),Ir.webgl_compressed_texture_etc1&&(jn["rgb etc1"]=tu);var Ei=Array.prototype.slice.call(St.getParameter(Wi));Object.keys(jn).forEach(function(K){var le=jn[K];Ei.indexOf(le)>=0&&(da[K]=le)});var an=Object.keys(da);Nr.textureFormats=an;var Xn=[];Object.keys(da).forEach(function(K){var le=da[K];Xn[le]=K});var Nn=[];Object.keys(Ya).forEach(function(K){var le=Ya[K];Nn[le]=K});var bn=[];Object.keys(ia).forEach(function(K){var le=ia[K];bn[le]=K});var Na=[];Object.keys(La).forEach(function(K){var le=La[K];Na[le]=K});var ka=[];Object.keys(ua).forEach(function(K){var le=ua[K];ka[le]=K});var eo=an.reduce(function(K,le){var ie=da[le];return ie===Ao||ie===ho||ie===Ao||ie===Wo||ie===xl||ie===sl||Ir.ext_srgb&&(ie===Gl||ie===ms)?K[ie]=ie:ie===Ts||le.indexOf("rgba")>=0?K[ie]=fo:K[ie]=Vo,K},{});function Rn(){this.internalformat=fo,this.format=fo,this.type=pl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function wn(K,le){K.internalformat=le.internalformat,K.format=le.format,K.type=le.type,K.compressed=le.compressed,K.premultiplyAlpha=le.premultiplyAlpha,K.flipY=le.flipY,K.unpackAlignment=le.unpackAlignment,K.colorSpace=le.colorSpace,K.width=le.width,K.height=le.height,K.channels=le.channels}function ja(K,le){if(!(typeof le!="object"||!le)){if("premultiplyAlpha"in le&&(K.premultiplyAlpha=le.premultiplyAlpha),"flipY"in le&&(K.flipY=le.flipY),"alignment"in le&&(K.unpackAlignment=le.alignment),"colorSpace"in le&&(K.colorSpace=ao[le.colorSpace]),"type"in le){var ie=le.type;K.type=Ya[ie]}var we=K.width,We=K.height,gt=K.channels,kt=!1;"shape"in le?(we=le.shape[0],We=le.shape[1],le.shape.length===3&&(gt=le.shape[2],kt=!0)):("radius"in le&&(we=We=le.radius),"width"in le&&(we=le.width),"height"in le&&(We=le.height),"channels"in le&&(gt=le.channels,kt=!0)),K.width=we|0,K.height=We|0,K.channels=gt|0;var Je=!1;if("format"in le){var dt=le.format,It=K.internalformat=da[dt];K.format=eo[It],dt in Ya&&("type"in le||(K.type=Ya[dt])),dt in jn&&(K.compressed=!0),Je=!0}!kt&&Je?K.channels=hl[K.format]:kt&&!Je&&K.channels!==gc[K.format]&&(K.format=K.internalformat=gc[K.channels])}}function Aa(K){St.pixelStorei(rd,K.flipY),St.pixelStorei(xc,K.premultiplyAlpha),St.pixelStorei(mc,K.colorSpace),St.pixelStorei(Kc,K.unpackAlignment)}function oa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function la(K,le){var ie=null;if(Pf(le)?ie=le:le&&(ja(K,le),"x"in le&&(K.xOffset=le.x|0),"y"in le&&(K.yOffset=le.y|0),Pf(le.data)&&(ie=le.data)),le.copy){var we=Cn.viewportWidth,We=Cn.viewportHeight;K.width=K.width||we-K.xOffset,K.height=K.height||We-K.yOffset,K.needsCopy=!0}else if(!ie)K.width=K.width||1,K.height=K.height||1,K.channels=K.channels||4;else if(ci(ie))K.channels=K.channels||4,K.data=ie,!("type"in le)&&K.type===pl&&(K.type=ef(ie));else if(_f(ie))K.channels=K.channels||4,nd(K,ie),K.alignment=1,K.needsFree=!0;else if(vi(ie)){var gt=ie.data;!Array.isArray(gt)&&K.type===pl&&(K.type=ef(gt));var kt=ie.shape,Je=ie.stride,dt,It,ur,er,ar,pr;kt.length===3?(ur=kt[2],pr=Je[2]):(ur=1,pr=1),dt=kt[0],It=kt[1],er=Je[0],ar=Je[1],K.alignment=1,K.width=dt,K.height=It,K.channels=ur,K.format=K.internalformat=gc[ur],K.needsFree=!0,fd(K,gt,er,ar,pr,ie.offset)}else if(id(ie)||Qh(ie)||Lf(ie))id(ie)||Qh(ie)?K.element=ie:K.element=ie.canvas,K.width=K.element.width,K.height=K.element.height,K.channels=4;else if(vc(ie))K.element=ie,K.width=ie.width,K.height=ie.height,K.channels=4;else if(Pd(ie))K.element=ie,K.width=ie.naturalWidth,K.height=ie.naturalHeight,K.channels=4;else if(hd(ie))K.element=ie,K.width=ie.videoWidth,K.height=ie.videoHeight,K.channels=4;else if(yh(ie)){var yr=K.width||ie[0].length,qt=K.height||ie.length,rr=K.channels;Zi(ie[0][0])?rr=rr||ie[0][0].length:rr=rr||1;for(var Jt=Xe.shape(ie),Fr=1,bi=0;bi>=We,ie.height>>=We,la(ie,we[We]),K.mipmask|=1<=0&&!("faces"in le)&&(K.genMipmaps=!0)}if("mag"in le){var we=le.mag;K.magFilter=ia[we]}var We=K.wrapS,gt=K.wrapT;if("wrap"in le){var kt=le.wrap;typeof kt=="string"?We=gt=ua[kt]:Array.isArray(kt)&&(We=ua[kt[0]],gt=ua[kt[1]])}else{if("wrapS"in le){var Je=le.wrapS;We=ua[Je]}if("wrapT"in le){var dt=le.wrapT;gt=ua[dt]}}if(K.wrapS=We,K.wrapT=gt,"anisotropic"in le&&(le.anisotropic,K.anisotropic=le.anisotropic),"mipmap"in le){var It=!1;switch(typeof le.mipmap){case"string":K.mipmapHint=Tn[le.mipmap],K.genMipmaps=!0,It=!0;break;case"boolean":It=K.genMipmaps=le.mipmap;break;case"object":K.genMipmaps=!1,It=!0;break}It&&!("min"in le)&&(K.minFilter=lu)}}function kc(K,le){St.texParameteri(le,ic,K.minFilter),St.texParameteri(le,Ru,K.magFilter),St.texParameteri(le,Ps,K.wrapS),St.texParameteri(le,Rs,K.wrapT),Ir.ext_texture_filter_anisotropic&&St.texParameteri(le,Vl,K.anisotropic),K.genMipmaps&&(St.hint(uh,K.mipmapHint),St.generateMipmap(le))}var Ec=0,Au={},wu=Nr.maxTextureUnits,Iu=Array(wu).map(function(){return null});function Zo(K){Rn.call(this),this.mipmask=0,this.internalformat=fo,this.id=Ec++,this.refCount=1,this.target=K,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new kl,Oi.profile&&(this.stats={size:0})}function Du(K){St.activeTexture(vh),St.bindTexture(K.target,K.texture)}function vl(){var K=Iu[0];K?St.bindTexture(K.target,K.texture):St.bindTexture(pn,null)}function ju(K){var le=K.texture,ie=K.unit,we=K.target;ie>=0&&(St.activeTexture(vh+ie),St.bindTexture(we,null),Iu[ie]=null),St.deleteTexture(le),K.texture=null,K.params=null,K.pixels=null,K.refCount=0,delete Au[K.id],xn.textureCount--}d(Zo.prototype,{bind:function(){var K=this;K.bindCount+=1;var le=K.unit;if(le<0){for(var ie=0;ie0)continue;we.unit=-1}Iu[ie]=K,le=ie;break}Oi.profile&&xn.maxTextureUnits>ar)-ur,pr.height=pr.height||(ie.height>>ar)-er,Du(ie),$o(pr,pn,ur,er,ar),vl(),qa(pr),we}function gt(kt,Je){var dt=kt|0,It=Je|0||dt;if(dt===ie.width&&It===ie.height)return we;we.width=ie.width=dt,we.height=ie.height=It,Du(ie);for(var ur=0;ie.mipmask>>ur;++ur){var er=dt>>ur,ar=It>>ur;if(!er||!ar)break;St.texImage2D(pn,ur,ie.format,er,ar,0,ie.format,ie.type,null)}return vl(),Oi.profile&&(ie.stats.size=Nh(ie.internalformat,ie.type,dt,It,!1,!1)),we}return we(K,le),we.subimage=We,we.resize=gt,we._reglType="texture2d",we._texture=ie,Oi.profile&&(we.stats=ie.stats),we.destroy=function(){ie.decRef()},we}function Fo(K,le,ie,we,We,gt){var kt=new Zo(Ua);Au[kt.id]=kt,xn.cubeCount++;var Je=new Array(6);function dt(er,ar,pr,yr,qt,rr){var Jt,Fr=kt.texInfo;for(kl.call(Fr),Jt=0;Jt<6;++Jt)Je[Jt]=gs();if(typeof er=="number"||!er){var bi=er|0||1;for(Jt=0;Jt<6;++Jt)Ro(Je[Jt],bi,bi)}else if(typeof er=="object")if(ar)us(Je[0],er),us(Je[1],ar),us(Je[2],pr),us(Je[3],yr),us(Je[4],qt),us(Je[5],rr);else if(Nu(Fr,er),ja(kt,er),"faces"in er){var Li=er.faces;for(Jt=0;Jt<6;++Jt)wn(Je[Jt],kt),us(Je[Jt],Li[Jt])}else for(Jt=0;Jt<6;++Jt)us(Je[Jt],er);for(wn(kt,Je[0]),Fr.genMipmaps?kt.mipmask=(Je[0].width<<1)-1:kt.mipmask=Je[0].mipmask,kt.internalformat=Je[0].internalformat,dt.width=Je[0].width,dt.height=Je[0].height,Du(kt),Jt=0;Jt<6;++Jt)Kl(Je[Jt],ea+Jt);for(kc(Fr,Ua),vl(),Oi.profile&&(kt.stats.size=Nh(kt.internalformat,kt.type,dt.width,dt.height,Fr.genMipmaps,!0)),dt.format=Xn[kt.internalformat],dt.type=Nn[kt.type],dt.mag=bn[Fr.magFilter],dt.min=Na[Fr.minFilter],dt.wrapS=ka[Fr.wrapS],dt.wrapT=ka[Fr.wrapT],Jt=0;Jt<6;++Jt)Pu(Je[Jt]);return dt}function It(er,ar,pr,yr,qt){var rr=pr|0,Jt=yr|0,Fr=qt|0,bi=Ia();return wn(bi,kt),bi.width=0,bi.height=0,la(bi,ar),bi.width=bi.width||(kt.width>>Fr)-rr,bi.height=bi.height||(kt.height>>Fr)-Jt,Du(kt),$o(bi,ea+er,rr,Jt,Fr),vl(),qa(bi),dt}function ur(er){var ar=er|0;if(ar!==kt.width){dt.width=kt.width=ar,dt.height=kt.height=ar,Du(kt);for(var pr=0;pr<6;++pr)for(var yr=0;kt.mipmask>>yr;++yr)St.texImage2D(ea+pr,yr,kt.format,ar>>yr,ar>>yr,0,kt.format,kt.type,null);return vl(),Oi.profile&&(kt.stats.size=Nh(kt.internalformat,kt.type,dt.width,dt.height,!1,!0)),dt}}return dt(K,le,ie,we,We,gt),dt.subimage=It,dt.resize=ur,dt._reglType="textureCube",dt._texture=kt,Oi.profile&&(dt.stats=kt.stats),dt.destroy=function(){kt.decRef()},dt}function zs(){for(var K=0;K>we,ie.height>>we,0,ie.internalformat,ie.type,null);else for(var We=0;We<6;++We)St.texImage2D(ea+We,we,ie.internalformat,ie.width>>we,ie.height>>we,0,ie.internalformat,ie.type,null);kc(ie.texInfo,ie.target)})}function Ml(){for(var K=0;K=0?Pu=!0:ua.indexOf(kl)>=0&&(Pu=!1))),("depthTexture"in Zo||"depthStencilTexture"in Zo)&&(Iu=!!(Zo.depthTexture||Zo.depthStencilTexture)),"depth"in Zo&&(typeof Zo.depth=="boolean"?Kl=Zo.depth:(Ec=Zo.depth,zl=!1)),"stencil"in Zo&&(typeof Zo.stencil=="boolean"?zl=Zo.stencil:(Au=Zo.stencil,Kl=!1)),"depthStencil"in Zo&&(typeof Zo.depthStencil=="boolean"?Kl=zl=Zo.depthStencil:(wu=Zo.depthStencil,Kl=!1,zl=!1))}var vl=null,ju=null,Lc=null,Fo=null;if(Array.isArray(gs))vl=gs.map(jn);else if(gs)vl=[jn(gs)];else for(vl=new Array(kc),Co=0;Co0&&(qa.depth=la[0].depth,qa.stencil=la[0].stencil,qa.depthStencil=la[0].depthStencil),la[Ia]?la[Ia](qa):la[Ia]=wn(qa)}return d(Da,{width:Co,height:Co,color:kl})}function $o(Do){var Ia,qa=Do|0;if(qa===Da.width)return Da;var Co=Da.color;for(Ia=0;Ia=Co.byteLength?Ro.subdata(Co):(Ro.destroy(),wn.buffers[Do]=null)),wn.buffers[Do]||(Ro=wn.buffers[Do]=Cn.create(Ia,Hf,!1,!0)),qa.buffer=Cn.getBuffer(Ro),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1,Da[Do]=1}else Cn.getBuffer(Ia)?(qa.buffer=Cn.getBuffer(Ia),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1):Cn.getBuffer(Ia.buffer)?(qa.buffer=Cn.getBuffer(Ia.buffer),qa.size=(+Ia.size||qa.buffer.dimension)|0,qa.normalized=!!Ia.normalized||!1,"type"in Ia?qa.type=un[Ia.type]:qa.type=qa.buffer.dtype,qa.offset=(Ia.offset||0)|0,qa.stride=(Ia.stride||0)|0,qa.divisor=(Ia.divisor||0)|0,qa.state=1):"x"in Ia&&(qa.x=+Ia.x||0,qa.y=+Ia.y||0,qa.z=+Ia.z||0,qa.w=+Ia.w||0,qa.state=2)}for(var us=0;us1)for(var Aa=0;AaEi&&(Ei=an.stats.uniformsCount)}),Ei},Nr.getMaxAttributesCount=function(){var Ei=0;return La.forEach(function(an){an.stats.attributesCount>Ei&&(Ei=an.stats.attributesCount)}),Ei});function jn(){Cn={},xn={};for(var Ei=0;Ei>>4&15)+Ir.charAt(Qi&15);return Nr}function $h(St){for(var Ir="",Nr=-1,Qi,Cn;++Nr>>6&31,128|Qi&63):Qi<=65535?Ir+=String.fromCharCode(224|Qi>>>12&15,128|Qi>>>6&63,128|Qi&63):Qi<=2097151&&(Ir+=String.fromCharCode(240|Qi>>>18&7,128|Qi>>>12&63,128|Qi>>>6&63,128|Qi&63));return Ir}function Ph(St){for(var Ir=Array(St.length>>2),Nr=0;Nr>5]|=(St.charCodeAt(Nr/8)&255)<<24-Nr%32;return Ir}function Zu(St){for(var Ir="",Nr=0;Nr>5]>>>24-Nr%32&255);return Ir}function fu(St,Ir){return St>>>Ir|St<<32-Ir}function Ih(St,Ir){return St>>>Ir}function Tf(St,Ir,Nr){return St&Ir^~St&Nr}function Dh(St,Ir,Nr){return St&Ir^St&Nr^Ir&Nr}function sd(St){return fu(St,2)^fu(St,13)^fu(St,22)}function wr(St){return fu(St,6)^fu(St,11)^fu(St,25)}function Xr(St){return fu(St,7)^fu(St,18)^Ih(St,3)}function Ni(St){return fu(St,17)^fu(St,19)^Ih(St,10)}var Ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function hn(St,Ir){var Nr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Qi=new Array(64),Cn,xn,Oi,Tn,ua,ia,La,ao,Ya,da,jn,Ei;for(St[Ir>>5]|=128<<24-Ir%32,St[(Ir+64>>9<<4)+15]=Ir,Ya=0;Ya>16)+(Ir>>16)+(Nr>>16);return Qi<<16|Nr&65535}function pa(St){return Array.prototype.slice.call(St)}function Ea(St){return pa(St).join("")}function Ka(St){var Ir=St&&St.cache,Nr=0,Qi=[],Cn=[],xn=[];function Oi(jn,Ei){var an=Ei&&Ei.stable;if(!an){for(var Xn=0;Xn0&&(jn.push(Nn,"="),jn.push.apply(jn,pa(arguments)),jn.push(";")),Nn}return d(Ei,{def:Xn,toString:function(){return Ea([an.length>0?"var "+an.join(",")+";":"",Ea(jn)])}})}function ua(){var jn=Tn(),Ei=Tn(),an=jn.toString,Xn=Ei.toString;function Nn(bn,Na){Ei(bn,Na,"=",jn.def(bn,Na),";")}return d(function(){jn.apply(jn,pa(arguments))},{def:jn.def,entry:jn,exit:Ei,save:Nn,set:function(bn,Na,ka){Nn(bn,Na),jn(bn,Na,"=",ka,";")},toString:function(){return an()+Xn()}})}function ia(){var jn=Ea(arguments),Ei=ua(),an=ua(),Xn=Ei.toString,Nn=an.toString;return d(Ei,{then:function(){return Ei.apply(Ei,pa(arguments)),this},else:function(){return an.apply(an,pa(arguments)),this},toString:function(){var bn=Nn();return bn&&(bn="else{"+bn+"}"),Ea(["if(",jn,"){",Xn(),"}",bn])}})}var La=Tn(),ao={};function Ya(jn,Ei){var an=[];function Xn(){var eo="a"+an.length;return an.push(eo),eo}Ei=Ei||0;for(var Nn=0;Nn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},On={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Un={cw:ft,ccw:Pt};function Zn(St){return Array.isArray(St)||ui(St)||mi(St)}function aa(St){return St.sort(function(Pr,Nr){return Pr===tc?-1:Nr===tc?1:Pr=1,en>=2,Pr)}else if(Nr===ps){var Cn=St.data;return new gn(Cn.thisDep,Cn.contextDep,Cn.propDep,Pr)}else{if(Nr===xs)return new gn(!1,!1,!1,Pr);if(Nr===_o){for(var xn=!1,Oi=!1,Tn=!1,ua=0;ua=1&&(Oi=!0),La>=2&&(Tn=!0)}else ia.type===ps&&(xn=xn||ia.data.thisDep,Oi=Oi||ia.data.contextDep,Tn=Tn||ia.data.propDep)}return new gn(xn,Oi,Tn,Pr)}else return new gn(Nr===rs,Nr===hs,Nr===vo,Pr)}}var jo=new gn(!1,!1,!1,function(){});function qo(St,Pr,Nr,en,Cn,xn,Oi,Tn,ua,ia,La,no,Ka,da,Nn,Ei){var on=ia.Record,Kn={add:32774,subtract:32778,"reverse subtract":32779};Nr.ext_blend_minmax&&(Kn.min=Bt,Kn.max=Ht);var Fn=Nr.angle_instanced_arrays,bn=Nr.webgl_draw_buffers,Na=Nr.oes_vertex_array_object,ba={dirty:!0,profile:Ei.profile},Qa={},Bn=[],wn={},ja={};function Ca(Qe){return Qe.replace(".","_")}function oa(Qe,dt,It){var lr=Ca(Qe);Bn.push(Qe),Qa[lr]=ba[lr]=!!It,wn[lr]=dt}function la(Qe,dt,It){var lr=Ca(Qe);Bn.push(Qe),Array.isArray(It)?(ba[lr]=It.slice(),Qa[lr]=It.slice()):ba[lr]=Qa[lr]=It,ja[lr]=dt}function Da(Qe){return!!isNaN(Qe)}oa(io,Zr),oa(bs,$r),la(ll,"blendColor",[0,0,0,0]),la(Ul,"blendEquationSeparate",[ci,ci]),la(mu,"blendFuncSeparate",[pi,Or,pi,Or]),oa(Ql,zi,!0),la(gu,"depthFunc",Bi),la(Cl,"depthRange",[0,1]),la(ec,"depthMask",!0),la($u,$u,[!0,!0,!0,!0]),oa(xu,Lr),la(Ho,"cullFace",Ve),la(Is,Is,Pt),la(iu,iu,1),oa(Wl,nn),la(Mc,"polygonOffset",[0,0]),oa(eh,kn),oa(Uc,Jn),la(Hh,"sampleCoverage",[1,!1]),oa(th,di),la(Vh,"stencilMask",-1),la(Wu,"stencilFunc",[fr,0,-1]),la(Wh,"stencilOpSeparate",[Me,cr,cr,cr]),la(cs,"stencilOpSeparate",[Ve,cr,cr,cr]),oa(Fs,Ki),la(rh,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),la(tc,tc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var $o={gl:St,context:Ka,strings:Pr,next:Qa,current:ba,draw:no,elements:xn,buffer:Cn,shader:La,attributes:ia.state,vao:ia,uniforms:ua,framebuffer:Tn,extensions:Nr,timer:da,isBufferArgs:Zn},Io={primTypes:Mn,compareFuncs:ln,blendFuncs:ta,blendEquations:Kn,stencilOps:On,glTypes:un,orientationType:Un};bn&&(Io.backBuffer=[Ve],Io.drawBuffer=p(en.maxDrawbuffers,function(Qe){return Qe===0?[0]:p(Qe,function(dt){return Qi+dt})}));var Ia=0;function qa(){var Qe=Za({cache:Nn}),dt=Qe.link,It=Qe.global;Qe.id=Ia++,Qe.batchId="0";var lr=dt($o),Qt=Qe.shared={props:"a0"};Object.keys($o).forEach(function(tr){Qt[tr]=It.def(lr,".",tr)});var ar=Qe.next={},pr=Qe.current={};Object.keys(ja).forEach(function(tr){Array.isArray(ba[tr])&&(ar[tr]=It.def(Qt.next,".",tr),pr[tr]=It.def(Qt.current,".",tr))});var yr=Qe.constants={};Object.keys(Io).forEach(function(tr){yr[tr]=It.def(JSON.stringify(Io[tr]))}),Qe.invoke=function(tr,Xt){switch(Xt.type){case fa:var Fr=["this",Qt.context,Qt.props,Qe.batchId];return tr.def(dt(Xt.data),".call(",Fr.slice(0,Math.max(Xt.data.length+1,4)),")");case vo:return tr.def(Qt.props,Xt.data);case hs:return tr.def(Qt.context,Xt.data);case rs:return tr.def("this",Xt.data);case ps:return Xt.data.append(Qe,tr),Xt.data.ref;case xs:return Xt.data.toString();case _o:return Xt.data.map(function(xi){return Qe.invoke(tr,xi)})}},Qe.attribCache={};var qt={};return Qe.scopeAttrib=function(tr){var Xt=Pr.id(tr);if(Xt in qt)return qt[Xt];var Fr=ia.scope[Xt];Fr||(Fr=ia.scope[Xt]=new on);var xi=qt[Xt]=dt(Fr);return xi},Qe}function Co(Qe){var dt=Qe.static,It=Qe.dynamic,lr;if(od in dt){var Qt=!!dt[od];lr=to(function(pr,yr){return Qt}),lr.enable=Qt}else if(od in It){var ar=It[od];lr=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}return lr}function Ro(Qe,dt){var It=Qe.static,lr=Qe.dynamic;if(Ke in It){var Qt=It[Ke];return Qt?(Qt=Tn.getFramebuffer(Qt),to(function(pr,yr){var qt=pr.link(Qt),tr=pr.shared;yr.set(tr.framebuffer,".next",qt);var Xt=tr.context;return yr.set(Xt,"."+Vr,qt+".width"),yr.set(Xt,"."+ki,qt+".height"),qt})):to(function(pr,yr){var qt=pr.shared;yr.set(qt.framebuffer,".next","null");var tr=qt.context;return yr.set(tr,"."+Vr,tr+"."+Tt),yr.set(tr,"."+ki,tr+"."+Lt),"null"})}else if(Ke in lr){var ar=lr[Ke];return yo(ar,function(pr,yr){var qt=pr.invoke(yr,ar),tr=pr.shared,Xt=tr.framebuffer,Fr=yr.def(Xt,".getFramebuffer(",qt,")");yr.set(Xt,".next",Fr);var xi=tr.context;return yr.set(xi,"."+Vr,Fr+"?"+Fr+".width:"+xi+"."+Tt),yr.set(xi,"."+ki,Fr+"?"+Fr+".height:"+xi+"."+Lt),Fr})}else return null}function us(Qe,dt,It){var lr=Qe.static,Qt=Qe.dynamic;function ar(qt){if(qt in lr){var tr=lr[qt],Xt=!0,Fr=tr.x|0,xi=tr.y|0,Li,Pn;return"width"in tr?Li=tr.width|0:Xt=!1,"height"in tr?Pn=tr.height|0:Xt=!1,new gn(!Xt&&dt&&dt.thisDep,!Xt&&dt&&dt.contextDep,!Xt&&dt&&dt.propDep,function(Hn,In){var ca=Hn.shared.context,$n=Li;"width"in tr||($n=In.def(ca,".",Vr,"-",Fr));var Vn=Pn;return"height"in tr||(Vn=In.def(ca,".",ki,"-",xi)),[Fr,xi,$n,Vn]})}else if(qt in Qt){var An=Qt[qt],mn=yo(An,function(Hn,In){var ca=Hn.invoke(In,An),$n=Hn.shared.context,Vn=In.def(ca,".x|0"),va=In.def(ca,".y|0"),po=In.def('"width" in ',ca,"?",ca,".width|0:","(",$n,".",Vr,"-",Vn,")"),To=In.def('"height" in ',ca,"?",ca,".height|0:","(",$n,".",ki,"-",va,")");return[Vn,va,po,To]});return dt&&(mn.thisDep=mn.thisDep||dt.thisDep,mn.contextDep=mn.contextDep||dt.contextDep,mn.propDep=mn.propDep||dt.propDep),mn}else return dt?new gn(dt.thisDep,dt.contextDep,dt.propDep,function(Hn,In){var ca=Hn.shared.context;return[0,0,In.def(ca,".",Vr),In.def(ca,".",ki)]}):null}var pr=ar(tc);if(pr){var yr=pr;pr=new gn(pr.thisDep,pr.contextDep,pr.propDep,function(qt,tr){var Xt=yr.append(qt,tr),Fr=qt.shared.context;return tr.set(Fr,"."+Vi,Xt[2]),tr.set(Fr,"."+tt,Xt[3]),Xt})}return{viewport:pr,scissor_box:ar(rh)}}function Kl(Qe,dt){var It=Qe.static,lr=typeof It[pe]=="string"&&typeof It[O]=="string";if(lr){if(Object.keys(dt.dynamic).length>0)return null;var Qt=dt.static,ar=Object.keys(Qt);if(ar.length>0&&typeof Qt[ar[0]]=="number"){for(var pr=[],yr=0;yr"+Vn+"?"+Xt+".constant["+Vn+"]:0;"}).join(""),"}}else{","if(",Li,"(",Xt,".buffer)){",Hn,"=",Pn,".createStream(",Nt,",",Xt,".buffer);","}else{",Hn,"=",Pn,".getBuffer(",Xt,".buffer);","}",In,'="type" in ',Xt,"?",xi.glTypes,"[",Xt,".type]:",Hn,".dtype;",An.normalized,"=!!",Xt,".normalized;");function ca($n){tr(An[$n],"=",Xt,".",$n,"|0;")}return ca("size"),ca("offset"),ca("stride"),ca("divisor"),tr("}}"),tr.exit("if(",An.isStream,"){",Pn,".destroyStream(",Hn,");","}"),An}Qt[ar]=yo(pr,yr)}),Qt}function kc(Qe){var dt=Qe.static,It=Qe.dynamic,lr={};return Object.keys(dt).forEach(function(Qt){var ar=dt[Qt];lr[Qt]=to(function(pr,yr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:pr.link(ar)})}),Object.keys(It).forEach(function(Qt){var ar=It[Qt];lr[Qt]=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}),lr}function Ec(Qe,dt,It,lr,Qt){Qe.static,Qe.dynamic;var ar=Kl(Qe,dt),pr=Ro(Qe),yr=us(Qe,pr),qt=gs(Qe),tr=Pu(Qe),Xt=zl(Qe,Qt,ar);function Fr(Hn){var In=yr[Hn];In&&(tr[Hn]=In)}Fr(tc),Fr(Ca(rh));var xi=Object.keys(tr).length>0,Li={framebuffer:pr,draw:qt,shader:Xt,state:tr,dirty:xi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Li.profile=Co(Qe),Li.uniforms=kl(It),Li.drawVAO=Li.scopeVAO=qt.vao,!Li.drawVAO&&Xt.program&&!ar&&Nr.angle_instanced_arrays&&qt.static.elements){var Pn=!0,An=Xt.program.attributes.map(function(Hn){var In=dt.static[Hn];return Pn=Pn&&!!In,In});if(Pn&&An.length>0){var mn=ia.getVAO(ia.createVAO({attributes:An,elements:qt.static.elements}));Li.drawVAO=new gn(null,null,null,function(Hn,In){return Hn.link(mn)}),Li.useVAO=!0}}return ar?Li.useVAO=!0:Li.attributes=Fu(dt),Li.context=kc(lr),Li}function Au(Qe,dt,It){var lr=Qe.shared,Qt=lr.context,ar=Qe.scope();Object.keys(It).forEach(function(pr){dt.save(Qt,"."+pr);var yr=It[pr],qt=yr.append(Qe,dt);Array.isArray(qt)?ar(Qt,".",pr,"=[",qt.join(),"];"):ar(Qt,".",pr,"=",qt,";")}),dt(ar)}function wu(Qe,dt,It,lr){var Qt=Qe.shared,ar=Qt.gl,pr=Qt.framebuffer,yr;bn&&(yr=dt.def(Qt.extensions,".webgl_draw_buffers"));var qt=Qe.constants,tr=qt.drawBuffer,Xt=qt.backBuffer,Fr;It?Fr=It.append(Qe,dt):Fr=dt.def(pr,".next"),lr||dt("if(",Fr,"!==",pr,".cur){"),dt("if(",Fr,"){",ar,".bindFramebuffer(",Yi,",",Fr,".framebuffer);"),bn&&dt(yr,".drawBuffersWEBGL(",tr,"[",Fr,".colorAttachments.length]);"),dt("}else{",ar,".bindFramebuffer(",Yi,",null);"),bn&&dt(yr,".drawBuffersWEBGL(",Xt,");"),dt("}",pr,".cur=",Fr,";"),lr||dt("}")}function Iu(Qe,dt,It){var lr=Qe.shared,Qt=lr.gl,ar=Qe.current,pr=Qe.next,yr=lr.current,qt=lr.next,tr=Qe.cond(yr,".dirty");Bn.forEach(function(Xt){var Fr=Ca(Xt);if(!(Fr in It.state)){var xi,Li;if(Fr in pr){xi=pr[Fr],Li=ar[Fr];var Pn=p(ba[Fr].length,function(mn){return tr.def(xi,"[",mn,"]")});tr(Qe.cond(Pn.map(function(mn,Hn){return mn+"!=="+Li+"["+Hn+"]"}).join("||")).then(Qt,".",ja[Fr],"(",Pn,");",Pn.map(function(mn,Hn){return Li+"["+Hn+"]="+mn}).join(";"),";"))}else{xi=tr.def(qt,".",Fr);var An=Qe.cond(xi,"!==",yr,".",Fr);tr(An),Fr in wn?An(Qe.cond(xi).then(Qt,".enable(",wn[Fr],");").else(Qt,".disable(",wn[Fr],");"),yr,".",Fr,"=",xi,";"):An(Qt,".",ja[Fr],"(",xi,");",yr,".",Fr,"=",xi,";")}}}),Object.keys(It.state).length===0&&tr(yr,".dirty=false;"),dt(tr)}function Zo(Qe,dt,It,lr){var Qt=Qe.shared,ar=Qe.current,pr=Qt.current,yr=Qt.gl,qt;aa(Object.keys(It)).forEach(function(tr){var Xt=It[tr];if(!(lr&&!lr(Xt))){var Fr=Xt.append(Qe,dt);if(wn[tr]){var xi=wn[tr];Ja(Xt)?(qt=Qe.link(Fr,{stable:!0}),dt(Qe.cond(qt).then(yr,".enable(",xi,");").else(yr,".disable(",xi,");")),dt(pr,".",tr,"=",qt,";")):(dt(Qe.cond(Fr).then(yr,".enable(",xi,");").else(yr,".disable(",xi,");")),dt(pr,".",tr,"=",Fr,";"))}else if(Zi(Fr)){var Li=ar[tr];dt(yr,".",ja[tr],"(",Fr,");",Fr.map(function(Pn,An){return Li+"["+An+"]="+Pn}).join(";"),";")}else Ja(Xt)?(qt=Qe.link(Fr,{stable:!0}),dt(yr,".",ja[tr],"(",qt,");",pr,".",tr,"=",qt,";")):dt(yr,".",ja[tr],"(",Fr,");",pr,".",tr,"=",Fr,";")}})}function Du(Qe,dt){Fn&&(Qe.instancing=dt.def(Qe.shared.extensions,".angle_instanced_arrays"))}function vl(Qe,dt,It,lr,Qt){var ar=Qe.shared,pr=Qe.stats,yr=ar.current,qt=ar.timer,tr=It.profile;function Xt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Fr,xi;function Li(ca){Fr=dt.def(),ca(Fr,"=",Xt(),";"),typeof Qt=="string"?ca(pr,".count+=",Qt,";"):ca(pr,".count++;"),da&&(lr?(xi=dt.def(),ca(xi,"=",qt,".getNumPendingQueries();")):ca(qt,".beginQuery(",pr,");"))}function Pn(ca){ca(pr,".cpuTime+=",Xt(),"-",Fr,";"),da&&(lr?ca(qt,".pushScopeStats(",xi,",",qt,".getNumPendingQueries(),",pr,");"):ca(qt,".endQuery();"))}function An(ca){var $n=dt.def(yr,".profile");dt(yr,".profile=",ca,";"),dt.exit(yr,".profile=",$n,";")}var mn;if(tr){if(Ja(tr)){tr.enable?(Li(dt),Pn(dt.exit),An("true")):An("false");return}mn=tr.append(Qe,dt),An(mn)}else mn=dt.def(yr,".profile");var Hn=Qe.block();Li(Hn),dt("if(",mn,"){",Hn,"}");var In=Qe.block();Pn(In),dt.exit("if(",mn,"){",In,"}")}function Nu(Qe,dt,It,lr,Qt){var ar=Qe.shared;function pr(qt){switch(qt){case wa:case Bo:case Us:return 2;case Ba:case _s:case Pl:return 3;case xo:case wl:case Ru:return 4;default:return 1}}function yr(qt,tr,Xt){var Fr=ar.gl,xi=dt.def(qt,".location"),Li=dt.def(ar.attributes,"[",xi,"]"),Pn=Xt.state,An=Xt.buffer,mn=[Xt.x,Xt.y,Xt.z,Xt.w],Hn=["buffer","normalized","offset","stride"];function In(){dt("if(!",Li,".buffer){",Fr,".enableVertexAttribArray(",xi,");}");var $n=Xt.type,Vn;if(Xt.size?Vn=dt.def(Xt.size,"||",tr):Vn=tr,dt("if(",Li,".type!==",$n,"||",Li,".size!==",Vn,"||",Hn.map(function(po){return Li+"."+po+"!=="+Xt[po]}).join("||"),"){",Fr,".bindBuffer(",Nt,",",An,".buffer);",Fr,".vertexAttribPointer(",[xi,Vn,$n,Xt.normalized,Xt.stride,Xt.offset],");",Li,".type=",$n,";",Li,".size=",Vn,";",Hn.map(function(po){return Li+"."+po+"="+Xt[po]+";"}).join(""),"}"),Fn){var va=Xt.divisor;dt("if(",Li,".divisor!==",va,"){",Qe.instancing,".vertexAttribDivisorANGLE(",[xi,va],");",Li,".divisor=",va,";}")}}function ca(){dt("if(",Li,".buffer){",Fr,".disableVertexAttribArray(",xi,");",Li,".buffer=null;","}if(",ao.map(function($n,Vn){return Li+"."+$n+"!=="+mn[Vn]}).join("||"),"){",Fr,".vertexAttrib4f(",xi,",",mn,");",ao.map(function($n,Vn){return Li+"."+$n+"="+mn[Vn]+";"}).join(""),"}")}Pn===Va?In():Pn===Oa?ca():(dt("if(",Pn,"===",Va,"){"),In(),dt("}else{"),ca(),dt("}"))}lr.forEach(function(qt){var tr=qt.name,Xt=It.attributes[tr],Fr;if(Xt){if(!Qt(Xt))return;Fr=Xt.append(Qe,dt)}else{if(!Qt(jo))return;var xi=Qe.scopeAttrib(tr);Fr={},Object.keys(new on).forEach(function(Li){Fr[Li]=dt.def(xi,".",Li)})}yr(Qe.link(qt),pr(qt.info.type),Fr)})}function Lc(Qe,dt,It,lr,Qt,ar){for(var pr=Qe.shared,yr=pr.gl,qt,tr=0;tr1){for(var Jo=[],Ts=[],$l=0;$l>1)",An],");")}function va(){It(mn,".drawArraysInstancedANGLE(",[xi,Li,Pn,An],");")}Xt&&Xt!=="null"?In?Vn():(It("if(",Xt,"){"),Vn(),It("}else{"),va(),It("}")):va()}function $n(){function Vn(){It(ar+".drawElements("+[xi,Pn,Hn,Li+"<<(("+Hn+"-"+xa+")>>1)"]+");")}function va(){It(ar+".drawArrays("+[xi,Li,Pn]+");")}Xt&&Xt!=="null"?In?Vn():(It("if(",Xt,"){"),Vn(),It("}else{"),va(),It("}")):va()}Fn&&(typeof An!="number"||An>=0)?typeof An=="string"?(It("if(",An,">0){"),ca(),It("}else if(",An,"<0){"),$n(),It("}")):ca():$n()}function Ds(Qe,dt,It,lr,Qt){var ar=qa(),pr=ar.proc("body",Qt);return Fn&&(ar.instancing=pr.def(ar.shared.extensions,".angle_instanced_arrays")),Qe(ar,pr,It,lr),ar.compile().body}function Ol(Qe,dt,It,lr){Du(Qe,dt),It.useVAO?It.drawVAO?dt(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,dt),");"):dt(Qe.shared.vao,".setVAO(",Qe.shared.vao,".targetVAO);"):(dt(Qe.shared.vao,".setVAO(null);"),Nu(Qe,dt,It,lr.attributes,function(){return!0})),Lc(Qe,dt,It,lr.uniforms,function(){return!0},!1),Fo(Qe,dt,dt,It)}function Ml(Qe,dt){var It=Qe.proc("draw",1);Du(Qe,It),Au(Qe,It,dt.context),wu(Qe,It,dt.framebuffer),Iu(Qe,It,dt),Zo(Qe,It,dt.state),vl(Qe,It,dt,!1,!0);var lr=dt.shader.progVar.append(Qe,It);if(It(Qe.shared.gl,".useProgram(",lr,".program);"),dt.shader.program)Ol(Qe,It,dt,dt.shader.program);else{It(Qe.shared.vao,".setVAO(null);");var Qt=Qe.global.def("{}"),ar=It.def(lr,".id"),pr=It.def(Qt,"[",ar,"]");It(Qe.cond(pr).then(pr,".call(this,a0);").else(pr,"=",Qt,"[",ar,"]=",Qe.link(function(yr){return Ds(Ol,Qe,dt,yr,1)}),"(",lr,");",pr,".call(this,a0);"))}Object.keys(dt.state).length>0&&It(Qe.shared.current,".dirty=true;"),Qe.shared.vao&&It(Qe.shared.vao,".setVAO(null);")}function K(Qe,dt,It,lr){Qe.batchId="a1",Du(Qe,dt);function Qt(){return!0}Nu(Qe,dt,It,lr.attributes,Qt),Lc(Qe,dt,It,lr.uniforms,Qt,!1),Fo(Qe,dt,dt,It)}function le(Qe,dt,It,lr){Du(Qe,dt);var Qt=It.contextDep,ar=dt.def(),pr="a0",yr="a1",qt=dt.def();Qe.shared.props=qt,Qe.batchId=ar;var tr=Qe.scope(),Xt=Qe.scope();dt(tr.entry,"for(",ar,"=0;",ar,"<",yr,";++",ar,"){",qt,"=",pr,"[",ar,"];",Xt,"}",tr.exit);function Fr(Hn){return Hn.contextDep&&Qt||Hn.propDep}function xi(Hn){return!Fr(Hn)}if(It.needsContext&&Au(Qe,Xt,It.context),It.needsFramebuffer&&wu(Qe,Xt,It.framebuffer),Zo(Qe,Xt,It.state,Fr),It.profile&&Fr(It.profile)&&vl(Qe,Xt,It,!1,!0),lr)It.useVAO?It.drawVAO?Fr(It.drawVAO)?Xt(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,Xt),");"):tr(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,tr),");"):tr(Qe.shared.vao,".setVAO(",Qe.shared.vao,".targetVAO);"):(tr(Qe.shared.vao,".setVAO(null);"),Nu(Qe,tr,It,lr.attributes,xi),Nu(Qe,Xt,It,lr.attributes,Fr)),Lc(Qe,tr,It,lr.uniforms,xi,!1),Lc(Qe,Xt,It,lr.uniforms,Fr,!0),Fo(Qe,tr,Xt,It);else{var Li=Qe.global.def("{}"),Pn=It.shader.progVar.append(Qe,Xt),An=Xt.def(Pn,".id"),mn=Xt.def(Li,"[",An,"]");Xt(Qe.shared.gl,".useProgram(",Pn,".program);","if(!",mn,"){",mn,"=",Li,"[",An,"]=",Qe.link(function(Hn){return Ds(K,Qe,It,Hn,2)}),"(",Pn,");}",mn,".call(this,a0[",ar,"],",ar,");")}}function ie(Qe,dt){var It=Qe.proc("batch",2);Qe.batchId="0",Du(Qe,It);var lr=!1,Qt=!0;Object.keys(dt.context).forEach(function(Li){lr=lr||dt.context[Li].propDep}),lr||(Au(Qe,It,dt.context),Qt=!1);var ar=dt.framebuffer,pr=!1;ar?(ar.propDep?lr=pr=!0:ar.contextDep&&lr&&(pr=!0),pr||wu(Qe,It,ar)):wu(Qe,It,null),dt.state.viewport&&dt.state.viewport.propDep&&(lr=!0);function yr(Li){return Li.contextDep&&lr||Li.propDep}Iu(Qe,It,dt),Zo(Qe,It,dt.state,function(Li){return!yr(Li)}),(!dt.profile||!yr(dt.profile))&&vl(Qe,It,dt,!1,"a1"),dt.contextDep=lr,dt.needsContext=Qt,dt.needsFramebuffer=pr;var qt=dt.shader.progVar;if(qt.contextDep&&lr||qt.propDep)le(Qe,It,dt,null);else{var tr=qt.append(Qe,It);if(It(Qe.shared.gl,".useProgram(",tr,".program);"),dt.shader.program)le(Qe,It,dt,dt.shader.program);else{It(Qe.shared.vao,".setVAO(null);");var Xt=Qe.global.def("{}"),Fr=It.def(tr,".id"),xi=It.def(Xt,"[",Fr,"]");It(Qe.cond(xi).then(xi,".call(this,a0,a1);").else(xi,"=",Xt,"[",Fr,"]=",Qe.link(function(Li){return Ds(le,Qe,dt,Li,2)}),"(",tr,");",xi,".call(this,a0,a1);"))}}Object.keys(dt.state).length>0&&It(Qe.shared.current,".dirty=true;"),Qe.shared.vao&&It(Qe.shared.vao,".setVAO(null);")}function we(Qe,dt){var It=Qe.proc("scope",3);Qe.batchId="a2";var lr=Qe.shared,Qt=lr.current;if(Au(Qe,It,dt.context),dt.framebuffer&&dt.framebuffer.append(Qe,It),aa(Object.keys(dt.state)).forEach(function(yr){var qt=dt.state[yr],tr=qt.append(Qe,It);Zi(tr)?tr.forEach(function(Xt,Fr){Da(Xt)?It.set(Qe.next[yr],"["+Fr+"]",Xt):It.set(Qe.next[yr],"["+Fr+"]",Qe.link(Xt,{stable:!0}))}):Ja(qt)?It.set(lr.next,"."+yr,Qe.link(tr,{stable:!0})):It.set(lr.next,"."+yr,tr)}),vl(Qe,It,dt,!0,!0),[Ie,Mt,qe,jt,Ne].forEach(function(yr){var qt=dt.draw[yr];if(qt){var tr=qt.append(Qe,It);Da(tr)?It.set(lr.draw,"."+yr,tr):It.set(lr.draw,"."+yr,Qe.link(tr),{stable:!0})}}),Object.keys(dt.uniforms).forEach(function(yr){var qt=dt.uniforms[yr].append(Qe,It);Array.isArray(qt)&&(qt="["+qt.map(function(tr){return Da(tr)?tr:Qe.link(tr,{stable:!0})})+"]"),It.set(lr.uniforms,"["+Qe.link(Pr.id(yr),{stable:!0})+"]",qt)}),Object.keys(dt.attributes).forEach(function(yr){var qt=dt.attributes[yr].append(Qe,It),tr=Qe.scopeAttrib(yr);Object.keys(new on).forEach(function(Xt){It.set(tr,"."+Xt,qt[Xt])})}),dt.scopeVAO){var ar=dt.scopeVAO.append(Qe,It);Da(ar)?It.set(lr.vao,".targetVAO",ar):It.set(lr.vao,".targetVAO",Qe.link(ar,{stable:!0}))}function pr(yr){var qt=dt.shader[yr];if(qt){var tr=qt.append(Qe,It);Da(tr)?It.set(lr.shader,"."+yr,tr):It.set(lr.shader,"."+yr,Qe.link(tr,{stable:!0}))}}pr(O),pr(pe),Object.keys(dt.state).length>0&&(It(Qt,".dirty=true;"),It.exit(Qt,".dirty=true;")),It("a1(",Qe.shared.context,",a0,",Qe.batchId,");")}function We(Qe){if(!(typeof Qe!="object"||Zi(Qe))){for(var dt=Object.keys(Qe),It=0;It=0;--Fo){var Ds=Da[Fo];Ds&&Ds(da,null,0)}Nr.flush(),ia&&ia.update()}function Ro(){!qa&&Da.length>0&&(qa=b.next(Co))}function us(){qa&&(b.cancel(Co),qa=null)}function Kl(Fo){Fo.preventDefault(),us(),$o.forEach(function(Ds){Ds()})}function zl(Fo){Nr.getError(),Cn.restore(),ba.restore(),Kn.restore(),Qa.restore(),Bn.restore(),wn.restore(),bn.restore(),ia&&ia.restore(),ja.procs.refresh(),Ro(),Io.forEach(function(Ds){Ds()})}la&&(la.addEventListener(fl,Kl,!1),la.addEventListener(vu,zl,!1));function gs(){Da.length=0,us(),la&&(la.removeEventListener(fl,Kl),la.removeEventListener(vu,zl)),ba.clear(),wn.clear(),Bn.clear(),bn.clear(),Qa.clear(),Fn.clear(),Kn.clear(),ia&&ia.clear(),Ia.forEach(function(Fo){Fo()})}function Pu(Fo){function Ds(Qt){var ar=d({},Qt);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function pr(yr){if(yr in ar){var qt=ar[yr];delete ar[yr],Object.keys(qt).forEach(function(tr){ar[yr+"."+tr]=qt[tr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in Qt&&(ar.vao=Qt.vao),ar}function Ol(Qt,ar){var pr={},yr={};return Object.keys(Qt).forEach(function(qt){var tr=Qt[qt];if(m.isDynamic(tr)){yr[qt]=m.unbox(tr,qt);return}else if(ar&&Array.isArray(tr)){for(var Xt=0;Xt0)return wt.call(this,It(Qt|0),Qt|0)}else if(Array.isArray(Qt)){if(Qt.length)return wt.call(this,Qt,Qt.length)}else return mt.call(this,Qt)}return d(lr,{stats:we,destroy:function(){We.destroy()}})}var kl=wn.setFBO=Pu({framebuffer:m.define.call(null,nu,"framebuffer")});function Fu(Fo,Ds){var Ol=0;ja.procs.poll();var Ml=Ds.color;Ml&&(Nr.clearColor(+Ml[0]||0,+Ml[1]||0,+Ml[2]||0,+Ml[3]||0),Ol|=ac),"depth"in Ds&&(Nr.clearDepth(+Ds.depth),Ol|=bu),"stencil"in Ds&&(Nr.clearStencil(Ds.stencil|0),Ol|=Eo),Nr.clear(Ol)}function kc(Fo){if("framebuffer"in Fo)if(Fo.framebuffer&&Fo.framebuffer_reglType==="framebufferCube")for(var Ds=0;Ds<6;++Ds)kl(d({framebuffer:Fo.framebuffer.faces[Ds]},Fo),Fu);else kl(Fo,Fu);else Fu(null,Fo)}function Ec(Fo){Da.push(Fo);function Ds(){var Ol=cu(Da,Fo);function Ml(){var K=cu(Da,Ml);Da[K]=Da[Da.length-1],Da.length-=1,Da.length<=0&&us()}Da[Ol]=Ml}return Ro(),{cancel:Ds}}function Au(){var Fo=oa.viewport,Ds=oa.scissor_box;Fo[0]=Fo[1]=Ds[0]=Ds[1]=0,da.viewportWidth=da.framebufferWidth=da.drawingBufferWidth=Fo[2]=Ds[2]=Nr.drawingBufferWidth,da.viewportHeight=da.framebufferHeight=da.drawingBufferHeight=Fo[3]=Ds[3]=Nr.drawingBufferHeight}function wu(){da.tick+=1,da.time=Zo(),Au(),ja.procs.poll()}function Iu(){Qa.refresh(),Au(),ja.procs.refresh(),ia&&ia.update()}function Zo(){return(x()-La)/1e3}Iu();function Du(Fo,Ds){var Ol;switch(Fo){case"frame":return Ec(Ds);case"lost":Ol=$o;break;case"restore":Ol=Io;break;case"destroy":Ol=Ia;break}return Ol.push(Ds),{cancel:function(){for(var Ml=0;Ml=0},read:Ca,destroy:gs,_gl:Nr,_refresh:Iu,poll:function(){wu(),ia&&ia.update()},now:Zo,stats:Oi,getCachedCode:vl,preloadCachedCode:Nu});return Pr.onDone(null,Lc),Lc}return zh})}),VJ=Fe((te,Y)=>{var d=e1();Y.exports=function(a){if(a?typeof a=="string"&&(a={container:a}):a={},z(a)?a={container:a}:P(a)?a={container:a}:i(a)?a={gl:a}:a=d(a,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),a.pixelRatio||(a.pixelRatio=window.pixelRatio||1),a.gl)return a.gl;if(a.canvas&&(a.container=a.canvas.parentNode),a.container){if(typeof a.container=="string"){var l=document.querySelector(a.container);if(!l)throw Error("Element "+a.container+" is not found");a.container=l}z(a.container)?(a.canvas=a.container,a.container=a.canvas.parentNode):a.canvas||(a.canvas=n(),a.container.appendChild(a.canvas),y(a))}else if(!a.canvas)if(typeof document<"u")a.container=document.body||document.documentElement,a.canvas=n(),a.container.appendChild(a.canvas),y(a);else throw Error("Not DOM environment. Use headless-gl.");return a.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(o){try{a.gl=a.canvas.getContext(o,a.attrs)}catch{}return a.gl}),a.gl};function y(a){if(a.container)if(a.container==document.body)document.body.style.width||(a.canvas.width=a.width||a.pixelRatio*window.innerWidth),document.body.style.height||(a.canvas.height=a.height||a.pixelRatio*window.innerHeight);else{var l=a.container.getBoundingClientRect();a.canvas.width=a.width||l.right-l.left,a.canvas.height=a.height||l.bottom-l.top}}function z(a){return typeof a.getContext=="function"&&"width"in a&&"height"in a}function P(a){return typeof a.nodeName=="string"&&typeof a.appendChild=="function"&&typeof a.getBoundingClientRect=="function"}function i(a){return typeof a.drawArrays=="function"||typeof a.drawElements=="function"}function n(){var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,a}}),WJ=Fe((te,Y)=>{var d=$D(),y=[32,126];Y.exports=z;function z(P){P=P||{};var i=P.shape?P.shape:P.canvas?[P.canvas.width,P.canvas.height]:[512,512],n=P.canvas||document.createElement("canvas"),a=P.font,l=typeof P.step=="number"?[P.step,P.step]:P.step||[32,32],o=P.chars||y;if(a&&typeof a!="string"&&(a=d(a)),!Array.isArray(o))o=String(o).split("");else if(o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"){for(var u=[],s=o[0],h=0;s<=o[1];s++)u[h++]=String.fromCharCode(s);o=u}i=i.slice(),n.width=i[0],n.height=i[1];var m=n.getContext("2d");m.fillStyle="#000",m.fillRect(0,0,n.width,n.height),m.font=a,m.textAlign="center",m.textBaseline="middle",m.fillStyle="#fff";for(var b=l[0]/2,x=l[1]/2,s=0;si[0]-l[0]/2&&(b=l[0]/2,x+=l[1]);return n}}),HD=Fe(te=>{"use restrict";var Y=32;te.INT_BITS=Y,te.INT_MAX=2147483647,te.INT_MIN=-1<0)-(z<0)},te.abs=function(z){var P=z>>Y-1;return(z^P)-P},te.min=function(z,P){return P^(z^P)&-(z65535)<<4,z>>>=P,i=(z>255)<<3,z>>>=i,P|=i,i=(z>15)<<2,z>>>=i,P|=i,i=(z>3)<<1,z>>>=i,P|=i,P|z>>1},te.log10=function(z){return z>=1e9?9:z>=1e8?8:z>=1e7?7:z>=1e6?6:z>=1e5?5:z>=1e4?4:z>=1e3?3:z>=100?2:z>=10?1:0},te.popCount=function(z){return z=z-(z>>>1&1431655765),z=(z&858993459)+(z>>>2&858993459),(z+(z>>>4)&252645135)*16843009>>>24};function d(z){var P=32;return z&=-z,z&&P--,z&65535&&(P-=16),z&16711935&&(P-=8),z&252645135&&(P-=4),z&858993459&&(P-=2),z&1431655765&&(P-=1),P}te.countTrailingZeros=d,te.nextPow2=function(z){return z+=z===0,--z,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z+1},te.prevPow2=function(z){return z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z-(z>>>1)},te.parity=function(z){return z^=z>>>16,z^=z>>>8,z^=z>>>4,z&=15,27030>>>z&1};var y=new Array(256);(function(z){for(var P=0;P<256;++P){var i=P,n=P,a=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=i&1,--a;z[P]=n<>>8&255]<<16|y[z>>>16&255]<<8|y[z>>>24&255]},te.interleave2=function(z,P){return z&=65535,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,P&=65535,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,z|P<<1},te.deinterleave2=function(z,P){return z=z>>>P&1431655765,z=(z|z>>>1)&858993459,z=(z|z>>>2)&252645135,z=(z|z>>>4)&16711935,z=(z|z>>>16)&65535,z<<16>>16},te.interleave3=function(z,P,i){return z&=1023,z=(z|z<<16)&4278190335,z=(z|z<<8)&251719695,z=(z|z<<4)&3272356035,z=(z|z<<2)&1227133513,P&=1023,P=(P|P<<16)&4278190335,P=(P|P<<8)&251719695,P=(P|P<<4)&3272356035,P=(P|P<<2)&1227133513,z|=P<<1,i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,z|i<<2},te.deinterleave3=function(z,P){return z=z>>>P&1227133513,z=(z|z>>>2)&3272356035,z=(z|z>>>4)&251719695,z=(z|z>>>8)&4278190335,z=(z|z>>>16)&1023,z<<22>>22},te.nextCombination=function(z){var P=z|z-1;return P+1|(~P&-~P)-1>>>d(z)+1}}),qJ=Fe((te,Y)=>{function d(P,i,n){var a=P[n]|0;if(a<=0)return[];var l=new Array(a),o;if(n===P.length-1)for(o=0;o"u"&&(i=0),typeof P){case"number":if(P>0)return y(P|0,i);break;case"object":if(typeof P.length=="number")return d(P,i,0);break}return[]}Y.exports=z}),GJ=Fe(te=>{var Y=HD(),d=qJ(),y=gb().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var z=typeof Uint8ClampedArray<"u",P=typeof BigUint64Array<"u",i=typeof BigInt64Array<"u",n=window.__TYPEDARRAY_POOL;n.UINT8C||(n.UINT8C=d([32,0])),n.BIGUINT64||(n.BIGUINT64=d([32,0])),n.BIGINT64||(n.BIGINT64=d([32,0])),n.BUFFER||(n.BUFFER=d([32,0]));var a=n.DATA,l=n.BUFFER;te.free=function(p){if(y.isBuffer(p))l[Y.log2(p.length)].push(p);else{if(Object.prototype.toString.call(p)!=="[object ArrayBuffer]"&&(p=p.buffer),!p)return;var g=p.length||p.byteLength,C=Y.log2(g)|0;a[C].push(p)}};function o(p){if(p){var g=p.length||p.byteLength,C=Y.log2(g);a[C].push(p)}}function u(p){o(p.buffer)}te.freeUint8=te.freeUint16=te.freeUint32=te.freeBigUint64=te.freeInt8=te.freeInt16=te.freeInt32=te.freeBigInt64=te.freeFloat32=te.freeFloat=te.freeFloat64=te.freeDouble=te.freeUint8Clamped=te.freeDataView=u,te.freeArrayBuffer=o,te.freeBuffer=function(p){l[Y.log2(p.length)].push(p)},te.malloc=function(p,g){if(g===void 0||g==="arraybuffer")return s(p);switch(g){case"uint8":return h(p);case"uint16":return m(p);case"uint32":return b(p);case"int8":return x(p);case"int16":return _(p);case"int32":return A(p);case"float":case"float32":return f(p);case"double":case"float64":return k(p);case"uint8_clamped":return w(p);case"bigint64":return E(p);case"biguint64":return D(p);case"buffer":return M(p);case"data":case"dataview":return I(p);default:return null}return null};function s(g){var g=Y.nextPow2(g),C=Y.log2(g),T=a[C];return T.length>0?T.pop():new ArrayBuffer(g)}te.mallocArrayBuffer=s;function h(p){return new Uint8Array(s(p),0,p)}te.mallocUint8=h;function m(p){return new Uint16Array(s(2*p),0,p)}te.mallocUint16=m;function b(p){return new Uint32Array(s(4*p),0,p)}te.mallocUint32=b;function x(p){return new Int8Array(s(p),0,p)}te.mallocInt8=x;function _(p){return new Int16Array(s(2*p),0,p)}te.mallocInt16=_;function A(p){return new Int32Array(s(4*p),0,p)}te.mallocInt32=A;function f(p){return new Float32Array(s(4*p),0,p)}te.mallocFloat32=te.mallocFloat=f;function k(p){return new Float64Array(s(8*p),0,p)}te.mallocFloat64=te.mallocDouble=k;function w(p){return z?new Uint8ClampedArray(s(p),0,p):h(p)}te.mallocUint8Clamped=w;function D(p){return P?new BigUint64Array(s(8*p),0,p):null}te.mallocBigUint64=D;function E(p){return i?new BigInt64Array(s(8*p),0,p):null}te.mallocBigInt64=E;function I(p){return new DataView(s(p),0,p)}te.mallocDataView=I;function M(p){p=Y.nextPow2(p);var g=Y.log2(p),C=l[g];return C.length>0?C.pop():new y(p)}te.mallocBuffer=M,te.clearCache=function(){for(var p=0;p<32;++p)n.UINT8[p].length=0,n.UINT16[p].length=0,n.UINT32[p].length=0,n.INT8[p].length=0,n.INT16[p].length=0,n.INT32[p].length=0,n.FLOAT[p].length=0,n.DOUBLE[p].length=0,n.BIGUINT64[p].length=0,n.BIGINT64[p].length=0,n.UINT8C[p].length=0,a[p].length=0,l[p].length=0}}),ZJ=Fe((te,Y)=>{var d=Object.prototype.toString;Y.exports=function(y){var z;return d.call(y)==="[object Object]"&&(z=Object.getPrototypeOf(y),z===null||z===Object.getPrototypeOf({}))}}),VD=Fe((te,Y)=>{Y.exports=function(d,y){y||(y=[0,""]),d=String(d);var z=parseFloat(d,10);return y[0]=z,y[1]=d.match(/[\d.\-\+]*\s*(.*)/)[1]||"",y}}),KJ=Fe((te,Y)=>{var d=VD();Y.exports=i;var y=96;function z(n,a){var l=d(getComputedStyle(n).getPropertyValue(a));return l[0]*i(l[1],n)}function P(n,a){var l=document.createElement("div");l.style["font-size"]="128"+n,a.appendChild(l);var o=z(l,"font-size")/128;return a.removeChild(l),o}function i(n,a){switch(a=a||document.body,n=(n||"px").trim().toLowerCase(),(a===window||a===document)&&(a=document.body),n){case"%":return a.clientHeight/100;case"ch":case"ex":return P(n,a);case"em":return z(a,"font-size");case"rem":return z(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return y;case"cm":return y/2.54;case"mm":return y/25.4;case"pt":return y/72;case"pc":return y/6}return 1}}),YJ=Fe((te,Y)=>{Y.exports=P;var d=P.canvas=document.createElement("canvas"),y=d.getContext("2d"),z=i([32,126]);P.createPairs=i,P.ascii=z;function P(n,a){Array.isArray(n)&&(n=n.join(", "));var l={},o,u=16,s=.05;a&&(a.length===2&&typeof a[0]=="number"?o=i(a):Array.isArray(a)?o=a:(a.o?o=i(a.o):a.pairs&&(o=a.pairs),a.fontSize&&(u=a.fontSize),a.threshold!=null&&(s=a.threshold))),o||(o=z),y.font=u+"px "+n;for(var h=0;hu*s){var _=(x-b)/u;l[m]=_*1e3}}return l}function i(n){for(var a=[],l=n[0];l<=n[1];l++)for(var o=String.fromCharCode(l),u=n[0];u{Y.exports=d,d.canvas=document.createElement("canvas"),d.cache={};function d(s,n){n||(n={}),(typeof s=="string"||Array.isArray(s))&&(n.family=s);var a=Array.isArray(n.family)?n.family.join(", "):n.family;if(!a)throw Error("`family` must be defined");var l=n.size||n.fontSize||n.em||48,o=n.weight||n.fontWeight||"",u=n.style||n.fontStyle||"",s=[u,o,l].join(" ")+"px "+a,h=n.origin||"top";if(d.cache[a]&&l<=d.cache[a].em)return y(d.cache[a],h);var m=n.canvas||d.canvas,b=m.getContext("2d"),x={upper:n.upper!==void 0?n.upper:"H",lower:n.lower!==void 0?n.lower:"x",descent:n.descent!==void 0?n.descent:"p",ascent:n.ascent!==void 0?n.ascent:"h",tittle:n.tittle!==void 0?n.tittle:"i",overshoot:n.overshoot!==void 0?n.overshoot:"O"},_=Math.ceil(l*1.5);m.height=_,m.width=_*.5,b.font=s;var A="H",f={top:0};b.clearRect(0,0,_,_),b.textBaseline="top",b.fillStyle="black",b.fillText(A,0,0);var k=z(b.getImageData(0,0,_,_));b.clearRect(0,0,_,_),b.textBaseline="bottom",b.fillText(A,0,_);var w=z(b.getImageData(0,0,_,_));f.lineHeight=f.bottom=_-w+k,b.clearRect(0,0,_,_),b.textBaseline="alphabetic",b.fillText(A,0,_);var D=z(b.getImageData(0,0,_,_)),E=_-D-1+k;f.baseline=f.alphabetic=E,b.clearRect(0,0,_,_),b.textBaseline="middle",b.fillText(A,0,_*.5);var I=z(b.getImageData(0,0,_,_));f.median=f.middle=_-I-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="hanging",b.fillText(A,0,_*.5);var M=z(b.getImageData(0,0,_,_));f.hanging=_-M-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="ideographic",b.fillText(A,0,_);var p=z(b.getImageData(0,0,_,_));if(f.ideographic=_-p-1+k,x.upper&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.upper,0,0),f.upper=z(b.getImageData(0,0,_,_)),f.capHeight=f.baseline-f.upper),x.lower&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.lower,0,0),f.lower=z(b.getImageData(0,0,_,_)),f.xHeight=f.baseline-f.lower),x.tittle&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.tittle,0,0),f.tittle=z(b.getImageData(0,0,_,_))),x.ascent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.ascent,0,0),f.ascent=z(b.getImageData(0,0,_,_))),x.descent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.descent,0,0),f.descent=P(b.getImageData(0,0,_,_))),x.overshoot){b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.overshoot,0,0);var g=P(b.getImageData(0,0,_,_));f.overshoot=g-E}for(var C in f)f[C]/=l;return f.em=l,d.cache[a]=f,y(f,h)}function y(i,n){var a={};typeof n=="string"&&(n=i[n]);for(var l in i)l!=="em"&&(a[l]=i[l]-n);return a}function z(i){for(var n=i.height,a=i.data,l=3;l0;l-=4)if(a[l]!==0)return Math.floor((l-3)*.25/n)}}),JJ=Fe((te,Y)=>{var d=$J(),y=e1(),z=HJ(),P=VJ(),i=zD(),n=F_(),a=WJ(),l=GJ(),o=Ww(),u=ZJ(),s=VD(),h=KJ(),m=YJ(),b=Kd(),x=XJ(),_=Pb(),A=HD(),f=A.nextPow2,k=new i,w=!1;document.body&&(D=document.body.appendChild(document.createElement("div")),D.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(D).fontStretch&&(w=!0),document.body.removeChild(D));var D,E=function(M){I(M)?(M={regl:M},this.gl=M.regl._gl):this.gl=P(M),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=M.regl||z({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),k.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(u(M)?M:{})};E.prototype.createShader=function(){var M=this.regl,p=M({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:M.prop("count"),offset:M.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:M.this("sizeBuffer")},width:{offset:0,stride:8,buffer:M.this("sizeBuffer")},char:M.this("charBuffer"),position:M.this("position")},uniforms:{atlasSize:function(C,T){return[T.atlas.width,T.atlas.height]},atlasDim:function(C,T){return[T.atlas.cols,T.atlas.rows]},atlas:function(C,T){return T.atlas.texture},charStep:function(C,T){return T.atlas.step},em:function(C,T){return T.atlas.em},color:M.prop("color"),opacity:M.prop("opacity"),viewport:M.this("viewportArray"),scale:M.this("scale"),align:M.prop("align"),baseline:M.prop("baseline"),translate:M.this("translate"),positionOffset:M.prop("positionOffset")},primitive:"points",viewport:M.this("viewport"),vert:` +`),an;if(Ir&&(an=Ac(Ei),Ir[an]))return Ir[an].apply(null,Cn);var Xn=Function.apply(null,Qi.concat(Ei));return Ir&&(Ir[an]=Xn),Xn.apply(null,Cn)}return{global:La,link:Oi,block:Tn,proc:Ya,scope:ua,cond:ia,compile:da}}var oo="xyzw".split(""),wa=5121,Va=1,Oa=2,fa=0,vo=1,hs=2,rs=3,ps=4,xs=5,_o=6,no="dither",ws="blend.enable",ul="blend.color",Ul="blend.equation",mu="blend.func",Ql="depth.enable",gu="depth.func",Cl="depth.range",ec="depth.mask",$u="colorMask",xu="cull.enable",Ho="cull.face",Ds="frontFace",iu="lineWidth",Wl="polygonOffset.enable",Mc="polygonOffset.offset",eh="sample.alpha",$c="sample.enable",Hh="sample.coverage",th="stencil.enable",Vh="stencil.mask",Wu="stencil.func",Wh="stencil.opFront",cs="stencil.opBack",Fs="scissor.enable",rh="scissor.box",tc="viewport",ld="profile",Ke="framebuffer",O="vert",pe="frag",Ie="elements",Fe="primitive",qe="count",Mt="offset",jt="instances",tr="vao",kr="Width",Vr="Height",Wr=Ke+kr,Ti=Ke+Vr,Vi=tc+kr,et=tc+Vr,lt="drawingBuffer",Tt=lt+kr,Lt=lt+Vr,Vt=[mu,Ul,Wu,Wh,cs,Hh,tc,rh,Mc],Nt=34962,Xt=34963,Pr=2884,Hr=3042,Zr=3024,pi=2960,zi=2929,Ki=3089,rn=32823,kn=32926,Qn=32928,Ca=5126,Ta=35664,Ba=35665,xo=35666,Go=5124,Bo=35667,_s=35668,wl=35669,Al=35670,Us=35671,Pl=35672,Fu=35673,Tu=35674,Js=35675,Qs=35676,nc=35678,wc=35680,ih=4,Me=1028,Ve=1029,ft=2304,Pt=2305,Bt=32775,Ht=32776,dr=519,cr=7680,Or=0,mi=1,hi=32774,Bi=513,Yi=36160,Ji=36064,ta={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},sn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$n={cw:ft,ccw:Pt};function Yn(St){return Array.isArray(St)||ci(St)||vi(St)}function aa(St){return St.sort(function(Ir,Nr){return Ir===tc?-1:Nr===tc?1:Ir=1,Qi>=2,Ir)}else if(Nr===ps){var Cn=St.data;return new vn(Cn.thisDep,Cn.contextDep,Cn.propDep,Ir)}else{if(Nr===xs)return new vn(!1,!1,!1,Ir);if(Nr===_o){for(var xn=!1,Oi=!1,Tn=!1,ua=0;ua=1&&(Oi=!0),La>=2&&(Tn=!0)}else ia.type===ps&&(xn=xn||ia.data.thisDep,Oi=Oi||ia.data.contextDep,Tn=Tn||ia.data.propDep)}return new vn(xn,Oi,Tn,Ir)}else return new vn(Nr===rs,Nr===hs,Nr===vo,Ir)}}var jo=new vn(!1,!1,!1,function(){});function qo(St,Ir,Nr,Qi,Cn,xn,Oi,Tn,ua,ia,La,ao,Ya,da,jn,Ei){var an=ia.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};Nr.ext_blend_minmax&&(Xn.min=Bt,Xn.max=Ht);var Nn=Nr.angle_instanced_arrays,bn=Nr.webgl_draw_buffers,Na=Nr.oes_vertex_array_object,ka={dirty:!0,profile:Ei.profile},eo={},Rn=[],wn={},ja={};function Aa(Je){return Je.replace(".","_")}function oa(Je,dt,It){var ur=Aa(Je);Rn.push(Je),eo[ur]=ka[ur]=!!It,wn[ur]=dt}function la(Je,dt,It){var ur=Aa(Je);Rn.push(Je),Array.isArray(It)?(ka[ur]=It.slice(),eo[ur]=It.slice()):ka[ur]=eo[ur]=It,ja[ur]=dt}function Da(Je){return!!isNaN(Je)}oa(no,Zr),oa(ws,Hr),la(ul,"blendColor",[0,0,0,0]),la(Ul,"blendEquationSeparate",[hi,hi]),la(mu,"blendFuncSeparate",[mi,Or,mi,Or]),oa(Ql,zi,!0),la(gu,"depthFunc",Bi),la(Cl,"depthRange",[0,1]),la(ec,"depthMask",!0),la($u,$u,[!0,!0,!0,!0]),oa(xu,Pr),la(Ho,"cullFace",Ve),la(Ds,Ds,Pt),la(iu,iu,1),oa(Wl,rn),la(Mc,"polygonOffset",[0,0]),oa(eh,kn),oa($c,Qn),la(Hh,"sampleCoverage",[1,!1]),oa(th,pi),la(Vh,"stencilMask",-1),la(Wu,"stencilFunc",[dr,0,-1]),la(Wh,"stencilOpSeparate",[Me,cr,cr,cr]),la(cs,"stencilOpSeparate",[Ve,cr,cr,cr]),oa(Fs,Ki),la(rh,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),la(tc,tc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var $o={gl:St,context:Ya,strings:Ir,next:eo,current:ka,draw:ao,elements:xn,buffer:Cn,shader:La,attributes:ia.state,vao:ia,uniforms:ua,framebuffer:Tn,extensions:Nr,timer:da,isBufferArgs:Yn},Do={primTypes:Mn,compareFuncs:sn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:un,orientationType:$n};bn&&(Do.backBuffer=[Ve],Do.drawBuffer=p(Qi.maxDrawbuffers,function(Je){return Je===0?[0]:p(Je,function(dt){return Ji+dt})}));var Ia=0;function qa(){var Je=Ka({cache:jn}),dt=Je.link,It=Je.global;Je.id=Ia++,Je.batchId="0";var ur=dt($o),er=Je.shared={props:"a0"};Object.keys($o).forEach(function(rr){er[rr]=It.def(ur,".",rr)});var ar=Je.next={},pr=Je.current={};Object.keys(ja).forEach(function(rr){Array.isArray(ka[rr])&&(ar[rr]=It.def(er.next,".",rr),pr[rr]=It.def(er.current,".",rr))});var yr=Je.constants={};Object.keys(Do).forEach(function(rr){yr[rr]=It.def(JSON.stringify(Do[rr]))}),Je.invoke=function(rr,Jt){switch(Jt.type){case fa:var Fr=["this",er.context,er.props,Je.batchId];return rr.def(dt(Jt.data),".call(",Fr.slice(0,Math.max(Jt.data.length+1,4)),")");case vo:return rr.def(er.props,Jt.data);case hs:return rr.def(er.context,Jt.data);case rs:return rr.def("this",Jt.data);case ps:return Jt.data.append(Je,rr),Jt.data.ref;case xs:return Jt.data.toString();case _o:return Jt.data.map(function(bi){return Je.invoke(rr,bi)})}},Je.attribCache={};var qt={};return Je.scopeAttrib=function(rr){var Jt=Ir.id(rr);if(Jt in qt)return qt[Jt];var Fr=ia.scope[Jt];Fr||(Fr=ia.scope[Jt]=new an);var bi=qt[Jt]=dt(Fr);return bi},Je}function Co(Je){var dt=Je.static,It=Je.dynamic,ur;if(ld in dt){var er=!!dt[ld];ur=to(function(pr,yr){return er}),ur.enable=er}else if(ld in It){var ar=It[ld];ur=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}return ur}function Ro(Je,dt){var It=Je.static,ur=Je.dynamic;if(Ke in It){var er=It[Ke];return er?(er=Tn.getFramebuffer(er),to(function(pr,yr){var qt=pr.link(er),rr=pr.shared;yr.set(rr.framebuffer,".next",qt);var Jt=rr.context;return yr.set(Jt,"."+Wr,qt+".width"),yr.set(Jt,"."+Ti,qt+".height"),qt})):to(function(pr,yr){var qt=pr.shared;yr.set(qt.framebuffer,".next","null");var rr=qt.context;return yr.set(rr,"."+Wr,rr+"."+Tt),yr.set(rr,"."+Ti,rr+"."+Lt),"null"})}else if(Ke in ur){var ar=ur[Ke];return yo(ar,function(pr,yr){var qt=pr.invoke(yr,ar),rr=pr.shared,Jt=rr.framebuffer,Fr=yr.def(Jt,".getFramebuffer(",qt,")");yr.set(Jt,".next",Fr);var bi=rr.context;return yr.set(bi,"."+Wr,Fr+"?"+Fr+".width:"+bi+"."+Tt),yr.set(bi,"."+Ti,Fr+"?"+Fr+".height:"+bi+"."+Lt),Fr})}else return null}function us(Je,dt,It){var ur=Je.static,er=Je.dynamic;function ar(qt){if(qt in ur){var rr=ur[qt],Jt=!0,Fr=rr.x|0,bi=rr.y|0,Li,In;return"width"in rr?Li=rr.width|0:Jt=!1,"height"in rr?In=rr.height|0:Jt=!1,new vn(!Jt&&dt&&dt.thisDep,!Jt&&dt&&dt.contextDep,!Jt&&dt&&dt.propDep,function(Vn,Dn){var ca=Vn.shared.context,Hn=Li;"width"in rr||(Hn=Dn.def(ca,".",Wr,"-",Fr));var Wn=In;return"height"in rr||(Wn=Dn.def(ca,".",Ti,"-",bi)),[Fr,bi,Hn,Wn]})}else if(qt in er){var An=er[qt],gn=yo(An,function(Vn,Dn){var ca=Vn.invoke(Dn,An),Hn=Vn.shared.context,Wn=Dn.def(ca,".x|0"),_a=Dn.def(ca,".y|0"),po=Dn.def('"width" in ',ca,"?",ca,".width|0:","(",Hn,".",Wr,"-",Wn,")"),To=Dn.def('"height" in ',ca,"?",ca,".height|0:","(",Hn,".",Ti,"-",_a,")");return[Wn,_a,po,To]});return dt&&(gn.thisDep=gn.thisDep||dt.thisDep,gn.contextDep=gn.contextDep||dt.contextDep,gn.propDep=gn.propDep||dt.propDep),gn}else return dt?new vn(dt.thisDep,dt.contextDep,dt.propDep,function(Vn,Dn){var ca=Vn.shared.context;return[0,0,Dn.def(ca,".",Wr),Dn.def(ca,".",Ti)]}):null}var pr=ar(tc);if(pr){var yr=pr;pr=new vn(pr.thisDep,pr.contextDep,pr.propDep,function(qt,rr){var Jt=yr.append(qt,rr),Fr=qt.shared.context;return rr.set(Fr,"."+Vi,Jt[2]),rr.set(Fr,"."+et,Jt[3]),Jt})}return{viewport:pr,scissor_box:ar(rh)}}function Kl(Je,dt){var It=Je.static,ur=typeof It[pe]=="string"&&typeof It[O]=="string";if(ur){if(Object.keys(dt.dynamic).length>0)return null;var er=dt.static,ar=Object.keys(er);if(ar.length>0&&typeof er[ar[0]]=="number"){for(var pr=[],yr=0;yr"+Wn+"?"+Jt+".constant["+Wn+"]:0;"}).join(""),"}}else{","if(",Li,"(",Jt,".buffer)){",Vn,"=",In,".createStream(",Nt,",",Jt,".buffer);","}else{",Vn,"=",In,".getBuffer(",Jt,".buffer);","}",Dn,'="type" in ',Jt,"?",bi.glTypes,"[",Jt,".type]:",Vn,".dtype;",An.normalized,"=!!",Jt,".normalized;");function ca(Hn){rr(An[Hn],"=",Jt,".",Hn,"|0;")}return ca("size"),ca("offset"),ca("stride"),ca("divisor"),rr("}}"),rr.exit("if(",An.isStream,"){",In,".destroyStream(",Vn,");","}"),An}er[ar]=yo(pr,yr)}),er}function kc(Je){var dt=Je.static,It=Je.dynamic,ur={};return Object.keys(dt).forEach(function(er){var ar=dt[er];ur[er]=to(function(pr,yr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:pr.link(ar)})}),Object.keys(It).forEach(function(er){var ar=It[er];ur[er]=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}),ur}function Ec(Je,dt,It,ur,er){Je.static,Je.dynamic;var ar=Kl(Je,dt),pr=Ro(Je),yr=us(Je,pr),qt=gs(Je),rr=Pu(Je),Jt=zl(Je,er,ar);function Fr(Vn){var Dn=yr[Vn];Dn&&(rr[Vn]=Dn)}Fr(tc),Fr(Aa(rh));var bi=Object.keys(rr).length>0,Li={framebuffer:pr,draw:qt,shader:Jt,state:rr,dirty:bi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Li.profile=Co(Je),Li.uniforms=kl(It),Li.drawVAO=Li.scopeVAO=qt.vao,!Li.drawVAO&&Jt.program&&!ar&&Nr.angle_instanced_arrays&&qt.static.elements){var In=!0,An=Jt.program.attributes.map(function(Vn){var Dn=dt.static[Vn];return In=In&&!!Dn,Dn});if(In&&An.length>0){var gn=ia.getVAO(ia.createVAO({attributes:An,elements:qt.static.elements}));Li.drawVAO=new vn(null,null,null,function(Vn,Dn){return Vn.link(gn)}),Li.useVAO=!0}}return ar?Li.useVAO=!0:Li.attributes=Nu(dt),Li.context=kc(ur),Li}function Au(Je,dt,It){var ur=Je.shared,er=ur.context,ar=Je.scope();Object.keys(It).forEach(function(pr){dt.save(er,"."+pr);var yr=It[pr],qt=yr.append(Je,dt);Array.isArray(qt)?ar(er,".",pr,"=[",qt.join(),"];"):ar(er,".",pr,"=",qt,";")}),dt(ar)}function wu(Je,dt,It,ur){var er=Je.shared,ar=er.gl,pr=er.framebuffer,yr;bn&&(yr=dt.def(er.extensions,".webgl_draw_buffers"));var qt=Je.constants,rr=qt.drawBuffer,Jt=qt.backBuffer,Fr;It?Fr=It.append(Je,dt):Fr=dt.def(pr,".next"),ur||dt("if(",Fr,"!==",pr,".cur){"),dt("if(",Fr,"){",ar,".bindFramebuffer(",Yi,",",Fr,".framebuffer);"),bn&&dt(yr,".drawBuffersWEBGL(",rr,"[",Fr,".colorAttachments.length]);"),dt("}else{",ar,".bindFramebuffer(",Yi,",null);"),bn&&dt(yr,".drawBuffersWEBGL(",Jt,");"),dt("}",pr,".cur=",Fr,";"),ur||dt("}")}function Iu(Je,dt,It){var ur=Je.shared,er=ur.gl,ar=Je.current,pr=Je.next,yr=ur.current,qt=ur.next,rr=Je.cond(yr,".dirty");Rn.forEach(function(Jt){var Fr=Aa(Jt);if(!(Fr in It.state)){var bi,Li;if(Fr in pr){bi=pr[Fr],Li=ar[Fr];var In=p(ka[Fr].length,function(gn){return rr.def(bi,"[",gn,"]")});rr(Je.cond(In.map(function(gn,Vn){return gn+"!=="+Li+"["+Vn+"]"}).join("||")).then(er,".",ja[Fr],"(",In,");",In.map(function(gn,Vn){return Li+"["+Vn+"]="+gn}).join(";"),";"))}else{bi=rr.def(qt,".",Fr);var An=Je.cond(bi,"!==",yr,".",Fr);rr(An),Fr in wn?An(Je.cond(bi).then(er,".enable(",wn[Fr],");").else(er,".disable(",wn[Fr],");"),yr,".",Fr,"=",bi,";"):An(er,".",ja[Fr],"(",bi,");",yr,".",Fr,"=",bi,";")}}}),Object.keys(It.state).length===0&&rr(yr,".dirty=false;"),dt(rr)}function Zo(Je,dt,It,ur){var er=Je.shared,ar=Je.current,pr=er.current,yr=er.gl,qt;aa(Object.keys(It)).forEach(function(rr){var Jt=It[rr];if(!(ur&&!ur(Jt))){var Fr=Jt.append(Je,dt);if(wn[rr]){var bi=wn[rr];Qa(Jt)?(qt=Je.link(Fr,{stable:!0}),dt(Je.cond(qt).then(yr,".enable(",bi,");").else(yr,".disable(",bi,");")),dt(pr,".",rr,"=",qt,";")):(dt(Je.cond(Fr).then(yr,".enable(",bi,");").else(yr,".disable(",bi,");")),dt(pr,".",rr,"=",Fr,";"))}else if(Zi(Fr)){var Li=ar[rr];dt(yr,".",ja[rr],"(",Fr,");",Fr.map(function(In,An){return Li+"["+An+"]="+In}).join(";"),";")}else Qa(Jt)?(qt=Je.link(Fr,{stable:!0}),dt(yr,".",ja[rr],"(",qt,");",pr,".",rr,"=",qt,";")):dt(yr,".",ja[rr],"(",Fr,");",pr,".",rr,"=",Fr,";")}})}function Du(Je,dt){Nn&&(Je.instancing=dt.def(Je.shared.extensions,".angle_instanced_arrays"))}function vl(Je,dt,It,ur,er){var ar=Je.shared,pr=Je.stats,yr=ar.current,qt=ar.timer,rr=It.profile;function Jt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Fr,bi;function Li(ca){Fr=dt.def(),ca(Fr,"=",Jt(),";"),typeof er=="string"?ca(pr,".count+=",er,";"):ca(pr,".count++;"),da&&(ur?(bi=dt.def(),ca(bi,"=",qt,".getNumPendingQueries();")):ca(qt,".beginQuery(",pr,");"))}function In(ca){ca(pr,".cpuTime+=",Jt(),"-",Fr,";"),da&&(ur?ca(qt,".pushScopeStats(",bi,",",qt,".getNumPendingQueries(),",pr,");"):ca(qt,".endQuery();"))}function An(ca){var Hn=dt.def(yr,".profile");dt(yr,".profile=",ca,";"),dt.exit(yr,".profile=",Hn,";")}var gn;if(rr){if(Qa(rr)){rr.enable?(Li(dt),In(dt.exit),An("true")):An("false");return}gn=rr.append(Je,dt),An(gn)}else gn=dt.def(yr,".profile");var Vn=Je.block();Li(Vn),dt("if(",gn,"){",Vn,"}");var Dn=Je.block();In(Dn),dt.exit("if(",gn,"){",Dn,"}")}function ju(Je,dt,It,ur,er){var ar=Je.shared;function pr(qt){switch(qt){case Ta:case Bo:case Us:return 2;case Ba:case _s:case Pl:return 3;case xo:case wl:case Fu:return 4;default:return 1}}function yr(qt,rr,Jt){var Fr=ar.gl,bi=dt.def(qt,".location"),Li=dt.def(ar.attributes,"[",bi,"]"),In=Jt.state,An=Jt.buffer,gn=[Jt.x,Jt.y,Jt.z,Jt.w],Vn=["buffer","normalized","offset","stride"];function Dn(){dt("if(!",Li,".buffer){",Fr,".enableVertexAttribArray(",bi,");}");var Hn=Jt.type,Wn;if(Jt.size?Wn=dt.def(Jt.size,"||",rr):Wn=rr,dt("if(",Li,".type!==",Hn,"||",Li,".size!==",Wn,"||",Vn.map(function(po){return Li+"."+po+"!=="+Jt[po]}).join("||"),"){",Fr,".bindBuffer(",Nt,",",An,".buffer);",Fr,".vertexAttribPointer(",[bi,Wn,Hn,Jt.normalized,Jt.stride,Jt.offset],");",Li,".type=",Hn,";",Li,".size=",Wn,";",Vn.map(function(po){return Li+"."+po+"="+Jt[po]+";"}).join(""),"}"),Nn){var _a=Jt.divisor;dt("if(",Li,".divisor!==",_a,"){",Je.instancing,".vertexAttribDivisorANGLE(",[bi,_a],");",Li,".divisor=",_a,";}")}}function ca(){dt("if(",Li,".buffer){",Fr,".disableVertexAttribArray(",bi,");",Li,".buffer=null;","}if(",oo.map(function(Hn,Wn){return Li+"."+Hn+"!=="+gn[Wn]}).join("||"),"){",Fr,".vertexAttrib4f(",bi,",",gn,");",oo.map(function(Hn,Wn){return Li+"."+Hn+"="+gn[Wn]+";"}).join(""),"}")}In===Va?Dn():In===Oa?ca():(dt("if(",In,"===",Va,"){"),Dn(),dt("}else{"),ca(),dt("}"))}ur.forEach(function(qt){var rr=qt.name,Jt=It.attributes[rr],Fr;if(Jt){if(!er(Jt))return;Fr=Jt.append(Je,dt)}else{if(!er(jo))return;var bi=Je.scopeAttrib(rr);Fr={},Object.keys(new an).forEach(function(Li){Fr[Li]=dt.def(bi,".",Li)})}yr(Je.link(qt),pr(qt.info.type),Fr)})}function Lc(Je,dt,It,ur,er,ar){for(var pr=Je.shared,yr=pr.gl,qt,rr=0;rr1){for(var Jo=[],Ss=[],$l=0;$l>1)",An],");")}function _a(){It(gn,".drawArraysInstancedANGLE(",[bi,Li,In,An],");")}Jt&&Jt!=="null"?Dn?Wn():(It("if(",Jt,"){"),Wn(),It("}else{"),_a(),It("}")):_a()}function Hn(){function Wn(){It(ar+".drawElements("+[bi,In,Vn,Li+"<<(("+Vn+"-"+wa+")>>1)"]+");")}function _a(){It(ar+".drawArrays("+[bi,Li,In]+");")}Jt&&Jt!=="null"?Dn?Wn():(It("if(",Jt,"){"),Wn(),It("}else{"),_a(),It("}")):_a()}Nn&&(typeof An!="number"||An>=0)?typeof An=="string"?(It("if(",An,">0){"),ca(),It("}else if(",An,"<0){"),Hn(),It("}")):ca():Hn()}function zs(Je,dt,It,ur,er){var ar=qa(),pr=ar.proc("body",er);return Nn&&(ar.instancing=pr.def(ar.shared.extensions,".angle_instanced_arrays")),Je(ar,pr,It,ur),ar.compile().body}function Ol(Je,dt,It,ur){Du(Je,dt),It.useVAO?It.drawVAO?dt(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,dt),");"):dt(Je.shared.vao,".setVAO(",Je.shared.vao,".targetVAO);"):(dt(Je.shared.vao,".setVAO(null);"),ju(Je,dt,It,ur.attributes,function(){return!0})),Lc(Je,dt,It,ur.uniforms,function(){return!0},!1),Fo(Je,dt,dt,It)}function Ml(Je,dt){var It=Je.proc("draw",1);Du(Je,It),Au(Je,It,dt.context),wu(Je,It,dt.framebuffer),Iu(Je,It,dt),Zo(Je,It,dt.state),vl(Je,It,dt,!1,!0);var ur=dt.shader.progVar.append(Je,It);if(It(Je.shared.gl,".useProgram(",ur,".program);"),dt.shader.program)Ol(Je,It,dt,dt.shader.program);else{It(Je.shared.vao,".setVAO(null);");var er=Je.global.def("{}"),ar=It.def(ur,".id"),pr=It.def(er,"[",ar,"]");It(Je.cond(pr).then(pr,".call(this,a0);").else(pr,"=",er,"[",ar,"]=",Je.link(function(yr){return zs(Ol,Je,dt,yr,1)}),"(",ur,");",pr,".call(this,a0);"))}Object.keys(dt.state).length>0&&It(Je.shared.current,".dirty=true;"),Je.shared.vao&&It(Je.shared.vao,".setVAO(null);")}function K(Je,dt,It,ur){Je.batchId="a1",Du(Je,dt);function er(){return!0}ju(Je,dt,It,ur.attributes,er),Lc(Je,dt,It,ur.uniforms,er,!1),Fo(Je,dt,dt,It)}function le(Je,dt,It,ur){Du(Je,dt);var er=It.contextDep,ar=dt.def(),pr="a0",yr="a1",qt=dt.def();Je.shared.props=qt,Je.batchId=ar;var rr=Je.scope(),Jt=Je.scope();dt(rr.entry,"for(",ar,"=0;",ar,"<",yr,";++",ar,"){",qt,"=",pr,"[",ar,"];",Jt,"}",rr.exit);function Fr(Vn){return Vn.contextDep&&er||Vn.propDep}function bi(Vn){return!Fr(Vn)}if(It.needsContext&&Au(Je,Jt,It.context),It.needsFramebuffer&&wu(Je,Jt,It.framebuffer),Zo(Je,Jt,It.state,Fr),It.profile&&Fr(It.profile)&&vl(Je,Jt,It,!1,!0),ur)It.useVAO?It.drawVAO?Fr(It.drawVAO)?Jt(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,Jt),");"):rr(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,rr),");"):rr(Je.shared.vao,".setVAO(",Je.shared.vao,".targetVAO);"):(rr(Je.shared.vao,".setVAO(null);"),ju(Je,rr,It,ur.attributes,bi),ju(Je,Jt,It,ur.attributes,Fr)),Lc(Je,rr,It,ur.uniforms,bi,!1),Lc(Je,Jt,It,ur.uniforms,Fr,!0),Fo(Je,rr,Jt,It);else{var Li=Je.global.def("{}"),In=It.shader.progVar.append(Je,Jt),An=Jt.def(In,".id"),gn=Jt.def(Li,"[",An,"]");Jt(Je.shared.gl,".useProgram(",In,".program);","if(!",gn,"){",gn,"=",Li,"[",An,"]=",Je.link(function(Vn){return zs(K,Je,It,Vn,2)}),"(",In,");}",gn,".call(this,a0[",ar,"],",ar,");")}}function ie(Je,dt){var It=Je.proc("batch",2);Je.batchId="0",Du(Je,It);var ur=!1,er=!0;Object.keys(dt.context).forEach(function(Li){ur=ur||dt.context[Li].propDep}),ur||(Au(Je,It,dt.context),er=!1);var ar=dt.framebuffer,pr=!1;ar?(ar.propDep?ur=pr=!0:ar.contextDep&&ur&&(pr=!0),pr||wu(Je,It,ar)):wu(Je,It,null),dt.state.viewport&&dt.state.viewport.propDep&&(ur=!0);function yr(Li){return Li.contextDep&&ur||Li.propDep}Iu(Je,It,dt),Zo(Je,It,dt.state,function(Li){return!yr(Li)}),(!dt.profile||!yr(dt.profile))&&vl(Je,It,dt,!1,"a1"),dt.contextDep=ur,dt.needsContext=er,dt.needsFramebuffer=pr;var qt=dt.shader.progVar;if(qt.contextDep&&ur||qt.propDep)le(Je,It,dt,null);else{var rr=qt.append(Je,It);if(It(Je.shared.gl,".useProgram(",rr,".program);"),dt.shader.program)le(Je,It,dt,dt.shader.program);else{It(Je.shared.vao,".setVAO(null);");var Jt=Je.global.def("{}"),Fr=It.def(rr,".id"),bi=It.def(Jt,"[",Fr,"]");It(Je.cond(bi).then(bi,".call(this,a0,a1);").else(bi,"=",Jt,"[",Fr,"]=",Je.link(function(Li){return zs(le,Je,dt,Li,2)}),"(",rr,");",bi,".call(this,a0,a1);"))}}Object.keys(dt.state).length>0&&It(Je.shared.current,".dirty=true;"),Je.shared.vao&&It(Je.shared.vao,".setVAO(null);")}function we(Je,dt){var It=Je.proc("scope",3);Je.batchId="a2";var ur=Je.shared,er=ur.current;if(Au(Je,It,dt.context),dt.framebuffer&&dt.framebuffer.append(Je,It),aa(Object.keys(dt.state)).forEach(function(yr){var qt=dt.state[yr],rr=qt.append(Je,It);Zi(rr)?rr.forEach(function(Jt,Fr){Da(Jt)?It.set(Je.next[yr],"["+Fr+"]",Jt):It.set(Je.next[yr],"["+Fr+"]",Je.link(Jt,{stable:!0}))}):Qa(qt)?It.set(ur.next,"."+yr,Je.link(rr,{stable:!0})):It.set(ur.next,"."+yr,rr)}),vl(Je,It,dt,!0,!0),[Ie,Mt,qe,jt,Fe].forEach(function(yr){var qt=dt.draw[yr];if(qt){var rr=qt.append(Je,It);Da(rr)?It.set(ur.draw,"."+yr,rr):It.set(ur.draw,"."+yr,Je.link(rr),{stable:!0})}}),Object.keys(dt.uniforms).forEach(function(yr){var qt=dt.uniforms[yr].append(Je,It);Array.isArray(qt)&&(qt="["+qt.map(function(rr){return Da(rr)?rr:Je.link(rr,{stable:!0})})+"]"),It.set(ur.uniforms,"["+Je.link(Ir.id(yr),{stable:!0})+"]",qt)}),Object.keys(dt.attributes).forEach(function(yr){var qt=dt.attributes[yr].append(Je,It),rr=Je.scopeAttrib(yr);Object.keys(new an).forEach(function(Jt){It.set(rr,"."+Jt,qt[Jt])})}),dt.scopeVAO){var ar=dt.scopeVAO.append(Je,It);Da(ar)?It.set(ur.vao,".targetVAO",ar):It.set(ur.vao,".targetVAO",Je.link(ar,{stable:!0}))}function pr(yr){var qt=dt.shader[yr];if(qt){var rr=qt.append(Je,It);Da(rr)?It.set(ur.shader,"."+yr,rr):It.set(ur.shader,"."+yr,Je.link(rr,{stable:!0}))}}pr(O),pr(pe),Object.keys(dt.state).length>0&&(It(er,".dirty=true;"),It.exit(er,".dirty=true;")),It("a1(",Je.shared.context,",a0,",Je.batchId,");")}function We(Je){if(!(typeof Je!="object"||Zi(Je))){for(var dt=Object.keys(Je),It=0;It=0;--Fo){var zs=Da[Fo];zs&&zs(da,null,0)}Nr.flush(),ia&&ia.update()}function Ro(){!qa&&Da.length>0&&(qa=b.next(Co))}function us(){qa&&(b.cancel(Co),qa=null)}function Kl(Fo){Fo.preventDefault(),us(),$o.forEach(function(zs){zs()})}function zl(Fo){Nr.getError(),Cn.restore(),ka.restore(),Xn.restore(),eo.restore(),Rn.restore(),wn.restore(),bn.restore(),ia&&ia.restore(),ja.procs.refresh(),Ro(),Do.forEach(function(zs){zs()})}la&&(la.addEventListener(fl,Kl,!1),la.addEventListener(vu,zl,!1));function gs(){Da.length=0,us(),la&&(la.removeEventListener(fl,Kl),la.removeEventListener(vu,zl)),ka.clear(),wn.clear(),Rn.clear(),bn.clear(),eo.clear(),Nn.clear(),Xn.clear(),ia&&ia.clear(),Ia.forEach(function(Fo){Fo()})}function Pu(Fo){function zs(er){var ar=d({},er);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function pr(yr){if(yr in ar){var qt=ar[yr];delete ar[yr],Object.keys(qt).forEach(function(rr){ar[yr+"."+rr]=qt[rr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in er&&(ar.vao=er.vao),ar}function Ol(er,ar){var pr={},yr={};return Object.keys(er).forEach(function(qt){var rr=er[qt];if(m.isDynamic(rr)){yr[qt]=m.unbox(rr,qt);return}else if(ar&&Array.isArray(rr)){for(var Jt=0;Jt0)return kt.call(this,It(er|0),er|0)}else if(Array.isArray(er)){if(er.length)return kt.call(this,er,er.length)}else return gt.call(this,er)}return d(ur,{stats:we,destroy:function(){We.destroy()}})}var kl=wn.setFBO=Pu({framebuffer:m.define.call(null,nu,"framebuffer")});function Nu(Fo,zs){var Ol=0;ja.procs.poll();var Ml=zs.color;Ml&&(Nr.clearColor(+Ml[0]||0,+Ml[1]||0,+Ml[2]||0,+Ml[3]||0),Ol|=ac),"depth"in zs&&(Nr.clearDepth(+zs.depth),Ol|=bu),"stencil"in zs&&(Nr.clearStencil(zs.stencil|0),Ol|=Eo),Nr.clear(Ol)}function kc(Fo){if("framebuffer"in Fo)if(Fo.framebuffer&&Fo.framebuffer_reglType==="framebufferCube")for(var zs=0;zs<6;++zs)kl(d({framebuffer:Fo.framebuffer.faces[zs]},Fo),Nu);else kl(Fo,Nu);else Nu(null,Fo)}function Ec(Fo){Da.push(Fo);function zs(){var Ol=cu(Da,Fo);function Ml(){var K=cu(Da,Ml);Da[K]=Da[Da.length-1],Da.length-=1,Da.length<=0&&us()}Da[Ol]=Ml}return Ro(),{cancel:zs}}function Au(){var Fo=oa.viewport,zs=oa.scissor_box;Fo[0]=Fo[1]=zs[0]=zs[1]=0,da.viewportWidth=da.framebufferWidth=da.drawingBufferWidth=Fo[2]=zs[2]=Nr.drawingBufferWidth,da.viewportHeight=da.framebufferHeight=da.drawingBufferHeight=Fo[3]=zs[3]=Nr.drawingBufferHeight}function wu(){da.tick+=1,da.time=Zo(),Au(),ja.procs.poll()}function Iu(){eo.refresh(),Au(),ja.procs.refresh(),ia&&ia.update()}function Zo(){return(x()-La)/1e3}Iu();function Du(Fo,zs){var Ol;switch(Fo){case"frame":return Ec(zs);case"lost":Ol=$o;break;case"restore":Ol=Do;break;case"destroy":Ol=Ia;break}return Ol.push(zs),{cancel:function(){for(var Ml=0;Ml=0},read:Aa,destroy:gs,_gl:Nr,_refresh:Iu,poll:function(){wu(),ia&&ia.update()},now:Zo,stats:Oi,getCachedCode:vl,preloadCachedCode:ju});return Ir.onDone(null,Lc),Lc}return zh})}),GJ=ze((te,Y)=>{var d=Qv();Y.exports=function(a){if(a?typeof a=="string"&&(a={container:a}):a={},z(a)?a={container:a}:P(a)?a={container:a}:i(a)?a={gl:a}:a=d(a,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0),a.pixelRatio||(a.pixelRatio=window.pixelRatio||1),a.gl)return a.gl;if(a.canvas&&(a.container=a.canvas.parentNode),a.container){if(typeof a.container=="string"){var l=document.querySelector(a.container);if(!l)throw Error("Element "+a.container+" is not found");a.container=l}z(a.container)?(a.canvas=a.container,a.container=a.canvas.parentNode):a.canvas||(a.canvas=n(),a.container.appendChild(a.canvas),y(a))}else if(!a.canvas)if(typeof document<"u")a.container=document.body||document.documentElement,a.canvas=n(),a.container.appendChild(a.canvas),y(a);else throw Error("Not DOM environment. Use headless-gl.");return a.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(o){try{a.gl=a.canvas.getContext(o,a.attrs)}catch{}return a.gl}),a.gl};function y(a){if(a.container)if(a.container==document.body)document.body.style.width||(a.canvas.width=a.width||a.pixelRatio*window.innerWidth),document.body.style.height||(a.canvas.height=a.height||a.pixelRatio*window.innerHeight);else{var l=a.container.getBoundingClientRect();a.canvas.width=a.width||l.right-l.left,a.canvas.height=a.height||l.bottom-l.top}}function z(a){return typeof a.getContext=="function"&&"width"in a&&"height"in a}function P(a){return typeof a.nodeName=="string"&&typeof a.appendChild=="function"&&typeof a.getBoundingClientRect=="function"}function i(a){return typeof a.drawArrays=="function"||typeof a.drawElements=="function"}function n(){var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,a}}),ZJ=ze((te,Y)=>{var d=VD(),y=[32,126];Y.exports=z;function z(P){P=P||{};var i=P.shape?P.shape:P.canvas?[P.canvas.width,P.canvas.height]:[512,512],n=P.canvas||document.createElement("canvas"),a=P.font,l=typeof P.step=="number"?[P.step,P.step]:P.step||[32,32],o=P.chars||y;if(a&&typeof a!="string"&&(a=d(a)),!Array.isArray(o))o=String(o).split("");else if(o.length===2&&typeof o[0]=="number"&&typeof o[1]=="number"){for(var u=[],s=o[0],h=0;s<=o[1];s++)u[h++]=String.fromCharCode(s);o=u}i=i.slice(),n.width=i[0],n.height=i[1];var m=n.getContext("2d");m.fillStyle="#000",m.fillRect(0,0,n.width,n.height),m.font=a,m.textAlign="center",m.textBaseline="middle",m.fillStyle="#fff";for(var b=l[0]/2,x=l[1]/2,s=0;si[0]-l[0]/2&&(b=l[0]/2,x+=l[1]);return n}}),WD=ze(te=>{"use restrict";var Y=32;te.INT_BITS=Y,te.INT_MAX=2147483647,te.INT_MIN=-1<0)-(z<0)},te.abs=function(z){var P=z>>Y-1;return(z^P)-P},te.min=function(z,P){return P^(z^P)&-(z65535)<<4,z>>>=P,i=(z>255)<<3,z>>>=i,P|=i,i=(z>15)<<2,z>>>=i,P|=i,i=(z>3)<<1,z>>>=i,P|=i,P|z>>1},te.log10=function(z){return z>=1e9?9:z>=1e8?8:z>=1e7?7:z>=1e6?6:z>=1e5?5:z>=1e4?4:z>=1e3?3:z>=100?2:z>=10?1:0},te.popCount=function(z){return z=z-(z>>>1&1431655765),z=(z&858993459)+(z>>>2&858993459),(z+(z>>>4)&252645135)*16843009>>>24};function d(z){var P=32;return z&=-z,z&&P--,z&65535&&(P-=16),z&16711935&&(P-=8),z&252645135&&(P-=4),z&858993459&&(P-=2),z&1431655765&&(P-=1),P}te.countTrailingZeros=d,te.nextPow2=function(z){return z+=z===0,--z,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z+1},te.prevPow2=function(z){return z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z-(z>>>1)},te.parity=function(z){return z^=z>>>16,z^=z>>>8,z^=z>>>4,z&=15,27030>>>z&1};var y=new Array(256);(function(z){for(var P=0;P<256;++P){var i=P,n=P,a=7;for(i>>>=1;i;i>>>=1)n<<=1,n|=i&1,--a;z[P]=n<>>8&255]<<16|y[z>>>16&255]<<8|y[z>>>24&255]},te.interleave2=function(z,P){return z&=65535,z=(z|z<<8)&16711935,z=(z|z<<4)&252645135,z=(z|z<<2)&858993459,z=(z|z<<1)&1431655765,P&=65535,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,z|P<<1},te.deinterleave2=function(z,P){return z=z>>>P&1431655765,z=(z|z>>>1)&858993459,z=(z|z>>>2)&252645135,z=(z|z>>>4)&16711935,z=(z|z>>>16)&65535,z<<16>>16},te.interleave3=function(z,P,i){return z&=1023,z=(z|z<<16)&4278190335,z=(z|z<<8)&251719695,z=(z|z<<4)&3272356035,z=(z|z<<2)&1227133513,P&=1023,P=(P|P<<16)&4278190335,P=(P|P<<8)&251719695,P=(P|P<<4)&3272356035,P=(P|P<<2)&1227133513,z|=P<<1,i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,z|i<<2},te.deinterleave3=function(z,P){return z=z>>>P&1227133513,z=(z|z>>>2)&3272356035,z=(z|z>>>4)&251719695,z=(z|z>>>8)&4278190335,z=(z|z>>>16)&1023,z<<22>>22},te.nextCombination=function(z){var P=z|z-1;return P+1|(~P&-~P)-1>>>d(z)+1}}),KJ=ze((te,Y)=>{function d(P,i,n){var a=P[n]|0;if(a<=0)return[];var l=new Array(a),o;if(n===P.length-1)for(o=0;o"u"&&(i=0),typeof P){case"number":if(P>0)return y(P|0,i);break;case"object":if(typeof P.length=="number")return d(P,i,0);break}return[]}Y.exports=z}),YJ=ze(te=>{var Y=WD(),d=KJ(),y=vb().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var z=typeof Uint8ClampedArray<"u",P=typeof BigUint64Array<"u",i=typeof BigInt64Array<"u",n=window.__TYPEDARRAY_POOL;n.UINT8C||(n.UINT8C=d([32,0])),n.BIGUINT64||(n.BIGUINT64=d([32,0])),n.BIGINT64||(n.BIGINT64=d([32,0])),n.BUFFER||(n.BUFFER=d([32,0]));var a=n.DATA,l=n.BUFFER;te.free=function(p){if(y.isBuffer(p))l[Y.log2(p.length)].push(p);else{if(Object.prototype.toString.call(p)!=="[object ArrayBuffer]"&&(p=p.buffer),!p)return;var g=p.length||p.byteLength,C=Y.log2(g)|0;a[C].push(p)}};function o(p){if(p){var g=p.length||p.byteLength,C=Y.log2(g);a[C].push(p)}}function u(p){o(p.buffer)}te.freeUint8=te.freeUint16=te.freeUint32=te.freeBigUint64=te.freeInt8=te.freeInt16=te.freeInt32=te.freeBigInt64=te.freeFloat32=te.freeFloat=te.freeFloat64=te.freeDouble=te.freeUint8Clamped=te.freeDataView=u,te.freeArrayBuffer=o,te.freeBuffer=function(p){l[Y.log2(p.length)].push(p)},te.malloc=function(p,g){if(g===void 0||g==="arraybuffer")return s(p);switch(g){case"uint8":return h(p);case"uint16":return m(p);case"uint32":return b(p);case"int8":return x(p);case"int16":return _(p);case"int32":return A(p);case"float":case"float32":return f(p);case"double":case"float64":return k(p);case"uint8_clamped":return w(p);case"bigint64":return E(p);case"biguint64":return D(p);case"buffer":return M(p);case"data":case"dataview":return I(p);default:return null}return null};function s(g){var g=Y.nextPow2(g),C=Y.log2(g),T=a[C];return T.length>0?T.pop():new ArrayBuffer(g)}te.mallocArrayBuffer=s;function h(p){return new Uint8Array(s(p),0,p)}te.mallocUint8=h;function m(p){return new Uint16Array(s(2*p),0,p)}te.mallocUint16=m;function b(p){return new Uint32Array(s(4*p),0,p)}te.mallocUint32=b;function x(p){return new Int8Array(s(p),0,p)}te.mallocInt8=x;function _(p){return new Int16Array(s(2*p),0,p)}te.mallocInt16=_;function A(p){return new Int32Array(s(4*p),0,p)}te.mallocInt32=A;function f(p){return new Float32Array(s(4*p),0,p)}te.mallocFloat32=te.mallocFloat=f;function k(p){return new Float64Array(s(8*p),0,p)}te.mallocFloat64=te.mallocDouble=k;function w(p){return z?new Uint8ClampedArray(s(p),0,p):h(p)}te.mallocUint8Clamped=w;function D(p){return P?new BigUint64Array(s(8*p),0,p):null}te.mallocBigUint64=D;function E(p){return i?new BigInt64Array(s(8*p),0,p):null}te.mallocBigInt64=E;function I(p){return new DataView(s(p),0,p)}te.mallocDataView=I;function M(p){p=Y.nextPow2(p);var g=Y.log2(p),C=l[g];return C.length>0?C.pop():new y(p)}te.mallocBuffer=M,te.clearCache=function(){for(var p=0;p<32;++p)n.UINT8[p].length=0,n.UINT16[p].length=0,n.UINT32[p].length=0,n.INT8[p].length=0,n.INT16[p].length=0,n.INT32[p].length=0,n.FLOAT[p].length=0,n.DOUBLE[p].length=0,n.BIGUINT64[p].length=0,n.BIGINT64[p].length=0,n.UINT8C[p].length=0,a[p].length=0,l[p].length=0}}),XJ=ze((te,Y)=>{var d=Object.prototype.toString;Y.exports=function(y){var z;return d.call(y)==="[object Object]"&&(z=Object.getPrototypeOf(y),z===null||z===Object.getPrototypeOf({}))}}),qD=ze((te,Y)=>{Y.exports=function(d,y){y||(y=[0,""]),d=String(d);var z=parseFloat(d,10);return y[0]=z,y[1]=d.match(/[\d.\-\+]*\s*(.*)/)[1]||"",y}}),JJ=ze((te,Y)=>{var d=qD();Y.exports=i;var y=96;function z(n,a){var l=d(getComputedStyle(n).getPropertyValue(a));return l[0]*i(l[1],n)}function P(n,a){var l=document.createElement("div");l.style["font-size"]="128"+n,a.appendChild(l);var o=z(l,"font-size")/128;return a.removeChild(l),o}function i(n,a){switch(a=a||document.body,n=(n||"px").trim().toLowerCase(),(a===window||a===document)&&(a=document.body),n){case"%":return a.clientHeight/100;case"ch":case"ex":return P(n,a);case"em":return z(a,"font-size");case"rem":return z(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return y;case"cm":return y/2.54;case"mm":return y/25.4;case"pt":return y/72;case"pc":return y/6}return 1}}),QJ=ze((te,Y)=>{Y.exports=P;var d=P.canvas=document.createElement("canvas"),y=d.getContext("2d"),z=i([32,126]);P.createPairs=i,P.ascii=z;function P(n,a){Array.isArray(n)&&(n=n.join(", "));var l={},o,u=16,s=.05;a&&(a.length===2&&typeof a[0]=="number"?o=i(a):Array.isArray(a)?o=a:(a.o?o=i(a.o):a.pairs&&(o=a.pairs),a.fontSize&&(u=a.fontSize),a.threshold!=null&&(s=a.threshold))),o||(o=z),y.font=u+"px "+n;for(var h=0;hu*s){var _=(x-b)/u;l[m]=_*1e3}}return l}function i(n){for(var a=[],l=n[0];l<=n[1];l++)for(var o=String.fromCharCode(l),u=n[0];u{Y.exports=d,d.canvas=document.createElement("canvas"),d.cache={};function d(s,n){n||(n={}),(typeof s=="string"||Array.isArray(s))&&(n.family=s);var a=Array.isArray(n.family)?n.family.join(", "):n.family;if(!a)throw Error("`family` must be defined");var l=n.size||n.fontSize||n.em||48,o=n.weight||n.fontWeight||"",u=n.style||n.fontStyle||"",s=[u,o,l].join(" ")+"px "+a,h=n.origin||"top";if(d.cache[a]&&l<=d.cache[a].em)return y(d.cache[a],h);var m=n.canvas||d.canvas,b=m.getContext("2d"),x={upper:n.upper!==void 0?n.upper:"H",lower:n.lower!==void 0?n.lower:"x",descent:n.descent!==void 0?n.descent:"p",ascent:n.ascent!==void 0?n.ascent:"h",tittle:n.tittle!==void 0?n.tittle:"i",overshoot:n.overshoot!==void 0?n.overshoot:"O"},_=Math.ceil(l*1.5);m.height=_,m.width=_*.5,b.font=s;var A="H",f={top:0};b.clearRect(0,0,_,_),b.textBaseline="top",b.fillStyle="black",b.fillText(A,0,0);var k=z(b.getImageData(0,0,_,_));b.clearRect(0,0,_,_),b.textBaseline="bottom",b.fillText(A,0,_);var w=z(b.getImageData(0,0,_,_));f.lineHeight=f.bottom=_-w+k,b.clearRect(0,0,_,_),b.textBaseline="alphabetic",b.fillText(A,0,_);var D=z(b.getImageData(0,0,_,_)),E=_-D-1+k;f.baseline=f.alphabetic=E,b.clearRect(0,0,_,_),b.textBaseline="middle",b.fillText(A,0,_*.5);var I=z(b.getImageData(0,0,_,_));f.median=f.middle=_-I-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="hanging",b.fillText(A,0,_*.5);var M=z(b.getImageData(0,0,_,_));f.hanging=_-M-1+k-_*.5,b.clearRect(0,0,_,_),b.textBaseline="ideographic",b.fillText(A,0,_);var p=z(b.getImageData(0,0,_,_));if(f.ideographic=_-p-1+k,x.upper&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.upper,0,0),f.upper=z(b.getImageData(0,0,_,_)),f.capHeight=f.baseline-f.upper),x.lower&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.lower,0,0),f.lower=z(b.getImageData(0,0,_,_)),f.xHeight=f.baseline-f.lower),x.tittle&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.tittle,0,0),f.tittle=z(b.getImageData(0,0,_,_))),x.ascent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.ascent,0,0),f.ascent=z(b.getImageData(0,0,_,_))),x.descent&&(b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.descent,0,0),f.descent=P(b.getImageData(0,0,_,_))),x.overshoot){b.clearRect(0,0,_,_),b.textBaseline="top",b.fillText(x.overshoot,0,0);var g=P(b.getImageData(0,0,_,_));f.overshoot=g-E}for(var C in f)f[C]/=l;return f.em=l,d.cache[a]=f,y(f,h)}function y(i,n){var a={};typeof n=="string"&&(n=i[n]);for(var l in i)l!=="em"&&(a[l]=i[l]-n);return a}function z(i){for(var n=i.height,a=i.data,l=3;l0;l-=4)if(a[l]!==0)return Math.floor((l-3)*.25/n)}}),tQ=ze((te,Y)=>{var d=WJ(),y=Qv(),z=qJ(),P=GJ(),i=BD(),n=$_(),a=ZJ(),l=YJ(),o=Gw(),u=XJ(),s=qD(),h=JJ(),m=QJ(),b=Yd(),x=eQ(),_=Ib(),A=WD(),f=A.nextPow2,k=new i,w=!1;document.body&&(D=document.body.appendChild(document.createElement("div")),D.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(D).fontStretch&&(w=!0),document.body.removeChild(D));var D,E=function(M){I(M)?(M={regl:M},this.gl=M.regl._gl):this.gl=P(M),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=M.regl||z({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),k.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(u(M)?M:{})};E.prototype.createShader=function(){var M=this.regl,p=M({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:M.prop("count"),offset:M.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:M.this("sizeBuffer")},width:{offset:0,stride:8,buffer:M.this("sizeBuffer")},char:M.this("charBuffer"),position:M.this("position")},uniforms:{atlasSize:function(C,T){return[T.atlas.width,T.atlas.height]},atlasDim:function(C,T){return[T.atlas.cols,T.atlas.rows]},atlas:function(C,T){return T.atlas.texture},charStep:function(C,T){return T.atlas.step},em:function(C,T){return T.atlas.em},color:M.prop("color"),opacity:M.prop("opacity"),viewport:M.this("viewportArray"),scale:M.this("scale"),align:M.prop("align"),baseline:M.prop("baseline"),translate:M.this("translate"),positionOffset:M.prop("positionOffset")},primitive:"points",viewport:M.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -2824,17 +2824,17 @@ void main() { // color.rgb += (1. - color.rgb) * (1. - mask.rgb); gl_FragColor = color; - }`}),g={};return{regl:M,draw:p,atlas:g}},E.prototype.update=function(M){var p=this;if(typeof M=="string")M={text:M};else if(!M)return;M=y(M,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0),M.opacity!=null&&(Array.isArray(M.opacity)?this.opacity=M.opacity.map(function(ze){return parseFloat(ze)}):this.opacity=parseFloat(M.opacity)),M.viewport!=null&&(this.viewport=o(M.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),this.viewport==null&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),M.kerning!=null&&(this.kerning=M.kerning),M.offset!=null&&(typeof M.offset=="number"&&(M.offset=[M.offset,0]),this.positionOffset=_(M.offset)),M.direction&&(this.direction=M.direction),M.range&&(this.range=M.range,this.scale=[1/(M.range[2]-M.range[0]),1/(M.range[3]-M.range[1])],this.translate=[-M.range[0],-M.range[1]]),M.scale&&(this.scale=M.scale),M.translate&&(this.translate=M.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!M.font&&(M.font=E.baseFontSize+"px sans-serif");var g=!1,C=!1;if(M.font&&(Array.isArray(M.font)?M.font:[M.font]).forEach(function(ze,Ee){if(typeof ze=="string")try{ze=d.parse(ze)}catch{ze=d.parse(E.baseFontSize+"px "+ze)}else{var nt=ze.style,xt=ze.weight,ut=ze.stretch,Et=ze.variant;ze=d.parse(d.stringify(ze)),nt&&(ze.style=nt),xt&&(ze.weight=xt),ut&&(ze.stretch=ut),Et&&(ze.variant=Et)}var Gt=d.stringify({size:E.baseFontSize,family:ze.family,stretch:w?ze.stretch:void 0,variant:ze.variant,weight:ze.weight,style:ze.style}),Jt=s(ze.size),gr=Math.round(Jt[0]*h(Jt[1]));if(gr!==p.fontSize[Ee]&&(C=!0,p.fontSize[Ee]=gr),(!p.font[Ee]||Gt!=p.font[Ee].baseString)&&(g=!0,p.font[Ee]=E.fonts[Gt],!p.font[Ee])){var mr=ze.family.join(", "),Kr=[ze.style];ze.style!=ze.variant&&Kr.push(ze.variant),ze.variant!=ze.weight&&Kr.push(ze.weight),w&&ze.weight!=ze.stretch&&Kr.push(ze.stretch),p.font[Ee]={baseString:Gt,family:mr,weight:ze.weight,stretch:ze.stretch,style:ze.style,variant:ze.variant,width:{},kerning:{},metrics:x(mr,{origin:"top",fontSize:E.baseFontSize,fontStyle:Kr.join(" ")})},E.fonts[Gt]=p.font[Ee]}}),(g||C)&&this.font.forEach(function(ze,Ee){var nt=d.stringify({size:p.fontSize[Ee],family:ze.family,stretch:w?ze.stretch:void 0,variant:ze.variant,weight:ze.weight,style:ze.style});if(p.fontAtlas[Ee]=p.shader.atlas[nt],!p.fontAtlas[Ee]){var xt=ze.metrics;p.shader.atlas[nt]=p.fontAtlas[Ee]={fontString:nt,step:Math.ceil(p.fontSize[Ee]*xt.bottom*.5)*2,em:p.fontSize[Ee],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:p.regl.texture()}}M.text==null&&(M.text=p.text)}),typeof M.text=="string"&&M.position&&M.position.length>2){for(var T=Array(M.position.length*.5),N=0;N2){for(var V=!M.position[0].length,W=l.mallocFloat(this.count*2),F=0,$=0;F1?p.align[Ee]:p.align[0]:p.align;if(typeof nt=="number")return nt;switch(nt){case"right":case"end":return-ze;case"center":case"centre":case"middle":return-ze*.5}return 0})),this.baseline==null&&M.baseline==null&&(M.baseline=0),M.baseline!=null&&(this.baseline=M.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ze,Ee){var nt=(p.font[Ee]||p.font[0]).metrics,xt=0;return xt+=nt.bottom*.5,typeof ze=="number"?xt+=ze-nt.baseline:xt+=-nt[ze],xt*=-1,xt})),M.color!=null)if(M.color||(M.color="transparent"),typeof M.color=="string"||!isNaN(M.color))this.color=n(M.color,"uint8");else{var Oe;if(typeof M.color[0]=="number"&&M.color.length>this.counts.length){var Ze=M.color.length;Oe=l.mallocUint8(Ze);for(var Ge=(M.color.subarray||M.color.slice).bind(M.color),rt=0;rt4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(gt){var ct=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ct);for(var Ae=0;Ae1?this.counts[Ae]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Ae]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Ae*4,Ae*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Ae]:this.opacity,baseline:this.baselineOffset[Ae]!=null?this.baselineOffset[Ae]:this.baselineOffset[0],align:this.align?this.alignOffset[Ae]!=null?this.alignOffset[Ae]:this.alignOffset[0]:0,atlas:this.fontAtlas[Ae]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Ae*2,Ae*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function I(M){return typeof M=="function"&&M._gl&&M.prop&&M.texture&&M.buffer}Y.exports=E}),QJ=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():d.createREGL=y()})(te,function(){var d=function(St,Pr){for(var Nr=Object.keys(Pr),en=0;en1&&Pr===Nr&&(Pr==='"'||Pr==="'"))return['"'+a(St.substr(1,St.length-2))+'"'];var en=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(en)return l(St.substr(0,en.index)).concat(l(en[1])).concat(l(St.substr(en.index+en[0].length)));var Cn=St.split(".");if(Cn.length===1)return['"'+a(St)+'"'];for(var xn=[],Oi=0;Oi"u"?1:window.devicePixelRatio,La=!1,no={},Ka=function(Ei){},da=function(){};if(typeof Pr=="string"?Nr=document.querySelector(Pr):typeof Pr=="object"&&(k(Pr)?Nr=Pr:w(Pr)?(xn=Pr,Cn=xn.canvas):("gl"in Pr?xn=Pr.gl:"canvas"in Pr?Cn=E(Pr.canvas):"container"in Pr&&(en=E(Pr.container)),"attributes"in Pr&&(Oi=Pr.attributes),"extensions"in Pr&&(Tn=D(Pr.extensions)),"optionalExtensions"in Pr&&(ua=D(Pr.optionalExtensions)),"onDone"in Pr&&(Ka=Pr.onDone),"profile"in Pr&&(La=!!Pr.profile),"pixelRatio"in Pr&&(ia=+Pr.pixelRatio),"cachedCode"in Pr&&(no=Pr.cachedCode))),Nr&&(Nr.nodeName.toLowerCase()==="canvas"?Cn=Nr:en=Nr),!xn){if(!Cn){var Nn=A(en||document.body,Ka,ia);if(!Nn)return null;Cn=Nn.canvas,da=Nn.onDestroy}Oi.premultipliedAlpha===void 0&&(Oi.premultipliedAlpha=!0),xn=f(Cn,Oi)}return xn?{gl:xn,canvas:Cn,container:en,extensions:Tn,optionalExtensions:ua,pixelRatio:ia,profile:La,cachedCode:no,onDone:Ka,onDestroy:da}:(da(),Ka("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(St,Pr){var Nr={};function en(Oi){var Tn=Oi.toLowerCase(),ua;try{ua=Nr[Tn]=St.getExtension(Tn)}catch{}return!!ua}for(var Cn=0;Cn65535)<<4,St>>>=Pr,Nr=(St>255)<<3,St>>>=Nr,Pr|=Nr,Nr=(St>15)<<2,St>>>=Nr,Pr|=Nr,Nr=(St>3)<<1,St>>>=Nr,Pr|=Nr,Pr|St>>1}function $(){var St=p(8,function(){return[]});function Pr(xn){var Oi=W(xn),Tn=St[F(Oi)>>2];return Tn.length>0?Tn.pop():new ArrayBuffer(Oi)}function Nr(xn){St[F(xn.byteLength)>>2].push(xn)}function en(xn,Oi){var Tn=null;switch(xn){case g:Tn=new Int8Array(Pr(Oi),0,Oi);break;case C:Tn=new Uint8Array(Pr(Oi),0,Oi);break;case T:Tn=new Int16Array(Pr(2*Oi),0,Oi);break;case N:Tn=new Uint16Array(Pr(2*Oi),0,Oi);break;case B:Tn=new Int32Array(Pr(4*Oi),0,Oi);break;case U:Tn=new Uint32Array(Pr(4*Oi),0,Oi);break;case V:Tn=new Float32Array(Pr(4*Oi),0,Oi);break;default:return null}return Tn.length!==Oi?Tn.subarray(0,Oi):Tn}function Cn(xn){Nr(xn.buffer)}return{alloc:Pr,free:Nr,allocType:en,freeType:Cn}}var q=$();q.zero=$();var G=3408,ee=3410,he=3411,xe=3412,ve=3413,ce=3414,re=3415,ge=33901,ne=33902,se=3379,_e=3386,oe=34921,J=36347,me=36348,fe=35661,Ce=35660,Be=34930,Oe=36349,Ze=34076,Ge=34024,rt=7936,_t=7937,pt=7938,gt=35724,ct=34047,Ae=36063,ze=34852,Ee=3553,nt=34067,xt=34069,ut=33984,Et=6408,Gt=5126,Jt=5121,gr=36160,mr=36053,Kr=36064,ri=16384,Mr=function(St,Pr){var Nr=1;Pr.ext_texture_filter_anisotropic&&(Nr=St.getParameter(ct));var en=1,Cn=1;Pr.webgl_draw_buffers&&(en=St.getParameter(ze),Cn=St.getParameter(Ae));var xn=!!Pr.oes_texture_float;if(xn){var Oi=St.createTexture();St.bindTexture(Ee,Oi),St.texImage2D(Ee,0,Et,1,1,0,Et,Gt,null);var Tn=St.createFramebuffer();if(St.bindFramebuffer(gr,Tn),St.framebufferTexture2D(gr,Kr,Ee,Oi,0),St.bindTexture(Ee,null),St.checkFramebufferStatus(gr)!==mr)xn=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(ri);var ua=q.allocType(Gt,4);St.readPixels(0,0,1,1,Et,Gt,ua),St.getError()?xn=!1:(St.deleteFramebuffer(Tn),St.deleteTexture(Oi),xn=ua[0]===1),q.freeType(ua)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),La=!0;if(!ia){var no=St.createTexture(),Ka=q.allocType(Jt,36);St.activeTexture(ut),St.bindTexture(nt,no),St.texImage2D(xt,0,Et,3,3,0,Et,Jt,Ka),q.freeType(Ka),St.bindTexture(nt,null),St.deleteTexture(no),La=!St.getError()}return{colorBits:[St.getParameter(ee),St.getParameter(he),St.getParameter(xe),St.getParameter(ve)],depthBits:St.getParameter(ce),stencilBits:St.getParameter(re),subpixelBits:St.getParameter(G),extensions:Object.keys(Pr).filter(function(da){return!!Pr[da]}),maxAnisotropic:Nr,maxDrawbuffers:en,maxColorAttachments:Cn,pointSizeDims:St.getParameter(ge),lineWidthDims:St.getParameter(ne),maxViewportDims:St.getParameter(_e),maxCombinedTextureUnits:St.getParameter(fe),maxCubeMapSize:St.getParameter(Ze),maxRenderbufferSize:St.getParameter(Ge),maxTextureUnits:St.getParameter(Be),maxTextureSize:St.getParameter(se),maxAttributes:St.getParameter(oe),maxVertexUniforms:St.getParameter(J),maxVertexTextureUnits:St.getParameter(Ce),maxVaryingVectors:St.getParameter(me),maxFragmentUniforms:St.getParameter(Oe),glsl:St.getParameter(gt),renderer:St.getParameter(_t),vendor:St.getParameter(rt),version:St.getParameter(pt),readFloat:xn,npotTextureCube:La}},ui=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function mi(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||ui(St.data))}var Ot=function(St){return Object.keys(St).map(function(Pr){return St[Pr]})},Je={shape:at,flatten:He};function ot(St,Pr,Nr){for(var en=0;en0){var Qa;if(Array.isArray(on[0])){ba=fn(on);for(var Bn=1,wn=1;wn0){if(typeof Bn[0]=="number"){var oa=q.allocType(bn.dtype,Bn.length);fi(oa,Bn),ba(oa,ja),q.freeType(oa)}else if(Array.isArray(Bn[0])||ui(Bn[0])){Ca=fn(Bn);var la=Sn(Bn,Ca,bn.dtype);ba(la,ja),q.freeType(la)}}}else if(mi(Bn)){Ca=Bn.shape;var Da=Bn.stride,$o=0,Io=0,Ia=0,qa=0;Ca.length===1?($o=Ca[0],Io=1,Ia=Da[0],qa=0):Ca.length===2&&($o=Ca[0],Io=Ca[1],Ia=Da[0],qa=Da[1]);var Co=Array.isArray(Bn.data)?bn.dtype:Cr(Bn.data),Ro=q.allocType(Co,$o*Io);qi(Ro,Bn.data,$o,Io,Ia,qa,Bn.offset),ba(Ro,ja),q.freeType(Ro)}return Na}return Kn||Na(Ei),Na._reglType="buffer",Na._buffer=bn,Na.subdata=Qa,Nr.profile&&(Na.stats=bn.stats),Na.destroy=function(){Ka(bn)},Na}function Nn(){Ot(xn).forEach(function(Ei){Ei.buffer=St.createBuffer(),St.bindBuffer(Ei.type,Ei.buffer),St.bufferData(Ei.type,Ei.persistentData||Ei.byteLength,Ei.usage)})}return Nr.profile&&(Pr.getTotalBufferSize=function(){var Ei=0;return Object.keys(xn).forEach(function(on){Ei+=xn[on].stats.size}),Ei}),{create:da,createStream:ua,destroyStream:ia,clear:function(){Ot(xn).forEach(Ka),Tn.forEach(Ka)},getBuffer:function(Ei){return Ei&&Ei._buffer instanceof Oi?Ei._buffer:null},restore:Nn,_initBuffer:no}}var Hi=0,En=0,Rn=1,Gn=1,Xn=4,sa=4,Mn={points:Hi,point:En,lines:Rn,line:Gn,triangles:Xn,triangle:sa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ha=0,ro=1,Ft=4,Rt=5120,qr=5121,ni=5122,oi=5123,Gr=5124,si=5125,Pi=34963,yi=35040,zt=35044;function xr(St,Pr,Nr,en){var Cn={},xn=0,Oi={uint8:qr,uint16:oi};Pr.oes_element_index_uint&&(Oi.uint32=si);function Tn(Nn){this.id=xn++,Cn[this.id]=this,this.buffer=Nn,this.primType=Ft,this.vertCount=0,this.type=0}Tn.prototype.bind=function(){this.buffer.bind()};var ua=[];function ia(Nn){var Ei=ua.pop();return Ei||(Ei=new Tn(Nr.create(null,Pi,!0,!1)._buffer)),no(Ei,Nn,yi,-1,-1,0,0),Ei}function La(Nn){ua.push(Nn)}function no(Nn,Ei,on,Kn,Fn,bn,Na){Nn.buffer.bind();var ba;if(Ei){var Qa=Na;!Na&&(!ui(Ei)||mi(Ei)&&!ui(Ei.data))&&(Qa=Pr.oes_element_index_uint?si:oi),Nr._initBuffer(Nn.buffer,Ei,on,Qa,3)}else St.bufferData(Pi,bn,on),Nn.buffer.dtype=ba||qr,Nn.buffer.usage=on,Nn.buffer.dimension=3,Nn.buffer.byteLength=bn;if(ba=Na,!Na){switch(Nn.buffer.dtype){case qr:case Rt:ba=qr;break;case oi:case ni:ba=oi;break;case si:case Gr:ba=si;break}Nn.buffer.dtype=ba}Nn.type=ba;var Bn=Fn;Bn<0&&(Bn=Nn.buffer.byteLength,ba===oi?Bn>>=1:ba===si&&(Bn>>=2)),Nn.vertCount=Bn;var wn=Kn;if(Kn<0){wn=Ft;var ja=Nn.buffer.dimension;ja===1&&(wn=Ha),ja===2&&(wn=ro),ja===3&&(wn=Ft)}Nn.primType=wn}function Ka(Nn){en.elementsCount--,delete Cn[Nn.id],Nn.buffer.destroy(),Nn.buffer=null}function da(Nn,Ei){var on=Nr.create(null,Pi,!0),Kn=new Tn(on._buffer);en.elementsCount++;function Fn(bn){if(!bn)on(),Kn.primType=Ft,Kn.vertCount=0,Kn.type=qr;else if(typeof bn=="number")on(bn),Kn.primType=Ft,Kn.vertCount=bn|0,Kn.type=qr;else{var Na=null,ba=zt,Qa=-1,Bn=-1,wn=0,ja=0;Array.isArray(bn)||ui(bn)||mi(bn)?Na=bn:("data"in bn&&(Na=bn.data),"usage"in bn&&(ba=Wn[bn.usage]),"primitive"in bn&&(Qa=Mn[bn.primitive]),"count"in bn&&(Bn=bn.count|0),"type"in bn&&(ja=Oi[bn.type]),"length"in bn?wn=bn.length|0:(wn=Bn,ja===oi||ja===ni?wn*=2:(ja===si||ja===Gr)&&(wn*=4))),no(Kn,Na,ba,Qa,Bn,wn,ja)}return Fn}return Fn(Nn),Fn._reglType="elements",Fn._elements=Kn,Fn.subdata=function(bn,Na){return on.subdata(bn,Na),Fn},Fn.destroy=function(){Ka(Kn)},Fn}return{create:da,createStream:ia,destroyStream:La,getElements:function(Nn){return typeof Nn=="function"&&Nn._elements instanceof Tn?Nn._elements:null},clear:function(){Ot(Cn).forEach(Ka)}}}var Jr=new Float32Array(1),Ri=new Uint32Array(Jr.buffer),tn=5123;function _n(St){for(var Pr=q.allocType(tn,St.length),Nr=0;Nr>>31<<15,xn=(en<<1>>>24)-127,Oi=en>>13&1023;if(xn<-24)Pr[Nr]=Cn;else if(xn<-14){var Tn=-14-xn;Pr[Nr]=Cn+(Oi+1024>>Tn)}else xn>15?Pr[Nr]=Cn+31744:Pr[Nr]=Cn+(xn+15<<10)+Oi}return Pr}function Zi(St){return Array.isArray(St)||ui(St)}var Wi=34467,dn=3553,Ua=34067,ea=34069,fo=6408,ho=6406,Vo=6407,Ao=6409,Wo=6410,Wa=32854,ks=32855,fs=36194,_l=32819,es=32820,rl=33635,ds=34042,xl=6402,ol=34041,Gl=35904,ms=35906,Bs=36193,No=33776,Es=33777,Il=33778,Jl=33779,ou=35986,Gs=35987,$a=34798,So=35840,Xs=35841,su=35842,is=35843,tu=36196,pl=5121,Nl=5123,Gu=5125,bo=5126,Ls=10242,Rs=10243,pu=10497,bl=33071,ls=33648,Bu=10240,ic=10241,Ll=9728,Hl=9729,lu=9984,hu=9985,pc=9986,Ah=9987,uh=33170,gh=4352,Qf=4353,Ff=4354,Vl=34046,Kc=3317,ed=37440,xc=37441,mc=37443,bc=37444,vh=33984,yu=[lu,pc,hu,Ah],gc=[0,Ao,Wo,Vo,fo],hl={};hl[Ao]=hl[ho]=hl[xl]=1,hl[ol]=hl[Wo]=2,hl[Vo]=hl[Gl]=3,hl[fo]=hl[ms]=4;function ru(St){return"[object "+St+"]"}var Fh=ru("HTMLCanvasElement"),jc=ru("OffscreenCanvas"),Jh=ru("CanvasRenderingContext2D"),Mu=ru("ImageBitmap"),Yd=ru("HTMLImageElement"),sl=ru("HTMLVideoElement"),hp=Object.keys(ht).concat([Fh,jc,Jh,Mu,Yd,sl]),jl=[];jl[pl]=1,jl[bo]=4,jl[Bs]=2,jl[Nl]=2,jl[Gu]=4;var os=[];os[Wa]=2,os[ks]=2,os[fs]=2,os[ol]=4,os[No]=.5,os[Es]=.5,os[Il]=1,os[Jl]=1,os[ou]=.5,os[Gs]=1,os[$a]=1,os[So]=.5,os[Xs]=.25,os[su]=.5,os[is]=.25,os[tu]=.5;function _f(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function yh(St){if(!Array.isArray(St))return!1;var Pr=St.length;return!(Pr===0||!Zi(St[0]))}function hc(St){return Object.prototype.toString.call(St)}function td(St){return hc(St)===Fh}function Qh(St){return hc(St)===jc}function Ef(St){return hc(St)===Jh}function vc(St){return hc(St)===Mu}function Ld(St){return hc(St)===Yd}function cd(St){return hc(St)===sl}function Lf(St){if(!St)return!1;var Pr=hc(St);return hp.indexOf(Pr)>=0?!0:_f(St)||yh(St)||mi(St)}function ef(St){return ht[Object.prototype.toString.call(St)]|0}function rd(St,Pr){var Nr=Pr.length;switch(St.type){case pl:case Nl:case Gu:case bo:var en=q.allocType(St.type,Nr);en.set(Pr),St.data=en;break;case Bs:St.data=_n(Pr);break}}function id(St,Pr){return q.allocType(St.type===Bs?bo:St.type,Pr)}function _h(St,Pr){St.type===Bs?(St.data=_n(Pr),q.freeType(Pr)):St.data=Pr}function hd(St,Pr,Nr,en,Cn,xn){for(var Oi=St.width,Tn=St.height,ua=St.channels,ia=Oi*Tn*ua,La=id(St,ia),no=0,Ka=0;Ka=1;)Tn+=Oi*ua*ua,ua/=2;return Tn}else return Oi*Nr*en}function Mh(St,Pr,Nr,en,Cn,xn,Oi){var Tn={"don't care":gh,"dont care":gh,nice:Ff,fast:Qf},ua={repeat:pu,clamp:bl,mirror:ls},ia={nearest:Ll,linear:Hl},La=d({mipmap:Ah,"nearest mipmap nearest":lu,"linear mipmap nearest":hu,"nearest mipmap linear":pc,"linear mipmap linear":Ah},ia),no={none:0,browser:bc},Ka={uint8:pl,rgba4:_l,rgb565:rl,"rgb5 a1":es},da={alpha:ho,luminance:Ao,"luminance alpha":Wo,rgb:Vo,rgba:fo,rgba4:Wa,"rgb5 a1":ks,rgb565:fs},Nn={};Pr.ext_srgb&&(da.srgb=Gl,da.srgba=ms),Pr.oes_texture_float&&(Ka.float32=Ka.float=bo),Pr.oes_texture_half_float&&(Ka.float16=Ka["half float"]=Bs),Pr.webgl_depth_texture&&(d(da,{depth:xl,"depth stencil":ol}),d(Ka,{uint16:Nl,uint32:Gu,"depth stencil":ds})),Pr.webgl_compressed_texture_s3tc&&d(Nn,{"rgb s3tc dxt1":No,"rgba s3tc dxt1":Es,"rgba s3tc dxt3":Il,"rgba s3tc dxt5":Jl}),Pr.webgl_compressed_texture_atc&&d(Nn,{"rgb atc":ou,"rgba atc explicit alpha":Gs,"rgba atc interpolated alpha":$a}),Pr.webgl_compressed_texture_pvrtc&&d(Nn,{"rgb pvrtc 4bppv1":So,"rgb pvrtc 2bppv1":Xs,"rgba pvrtc 4bppv1":su,"rgba pvrtc 2bppv1":is}),Pr.webgl_compressed_texture_etc1&&(Nn["rgb etc1"]=tu);var Ei=Array.prototype.slice.call(St.getParameter(Wi));Object.keys(Nn).forEach(function(K){var le=Nn[K];Ei.indexOf(le)>=0&&(da[K]=le)});var on=Object.keys(da);Nr.textureFormats=on;var Kn=[];Object.keys(da).forEach(function(K){var le=da[K];Kn[le]=K});var Fn=[];Object.keys(Ka).forEach(function(K){var le=Ka[K];Fn[le]=K});var bn=[];Object.keys(ia).forEach(function(K){var le=ia[K];bn[le]=K});var Na=[];Object.keys(La).forEach(function(K){var le=La[K];Na[le]=K});var ba=[];Object.keys(ua).forEach(function(K){var le=ua[K];ba[le]=K});var Qa=on.reduce(function(K,le){var ie=da[le];return ie===Ao||ie===ho||ie===Ao||ie===Wo||ie===xl||ie===ol||Pr.ext_srgb&&(ie===Gl||ie===ms)?K[ie]=ie:ie===ks||le.indexOf("rgba")>=0?K[ie]=fo:K[ie]=Vo,K},{});function Bn(){this.internalformat=fo,this.format=fo,this.type=pl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function wn(K,le){K.internalformat=le.internalformat,K.format=le.format,K.type=le.type,K.compressed=le.compressed,K.premultiplyAlpha=le.premultiplyAlpha,K.flipY=le.flipY,K.unpackAlignment=le.unpackAlignment,K.colorSpace=le.colorSpace,K.width=le.width,K.height=le.height,K.channels=le.channels}function ja(K,le){if(!(typeof le!="object"||!le)){if("premultiplyAlpha"in le&&(K.premultiplyAlpha=le.premultiplyAlpha),"flipY"in le&&(K.flipY=le.flipY),"alignment"in le&&(K.unpackAlignment=le.alignment),"colorSpace"in le&&(K.colorSpace=no[le.colorSpace]),"type"in le){var ie=le.type;K.type=Ka[ie]}var we=K.width,We=K.height,mt=K.channels,wt=!1;"shape"in le?(we=le.shape[0],We=le.shape[1],le.shape.length===3&&(mt=le.shape[2],wt=!0)):("radius"in le&&(we=We=le.radius),"width"in le&&(we=le.width),"height"in le&&(We=le.height),"channels"in le&&(mt=le.channels,wt=!0)),K.width=we|0,K.height=We|0,K.channels=mt|0;var Qe=!1;if("format"in le){var dt=le.format,It=K.internalformat=da[dt];K.format=Qa[It],dt in Ka&&("type"in le||(K.type=Ka[dt])),dt in Nn&&(K.compressed=!0),Qe=!0}!wt&&Qe?K.channels=hl[K.format]:wt&&!Qe&&K.channels!==gc[K.format]&&(K.format=K.internalformat=gc[K.channels])}}function Ca(K){St.pixelStorei(ed,K.flipY),St.pixelStorei(xc,K.premultiplyAlpha),St.pixelStorei(mc,K.colorSpace),St.pixelStorei(Kc,K.unpackAlignment)}function oa(){Bn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function la(K,le){var ie=null;if(Lf(le)?ie=le:le&&(ja(K,le),"x"in le&&(K.xOffset=le.x|0),"y"in le&&(K.yOffset=le.y|0),Lf(le.data)&&(ie=le.data)),le.copy){var we=Cn.viewportWidth,We=Cn.viewportHeight;K.width=K.width||we-K.xOffset,K.height=K.height||We-K.yOffset,K.needsCopy=!0}else if(!ie)K.width=K.width||1,K.height=K.height||1,K.channels=K.channels||4;else if(ui(ie))K.channels=K.channels||4,K.data=ie,!("type"in le)&&K.type===pl&&(K.type=ef(ie));else if(_f(ie))K.channels=K.channels||4,rd(K,ie),K.alignment=1,K.needsFree=!0;else if(mi(ie)){var mt=ie.data;!Array.isArray(mt)&&K.type===pl&&(K.type=ef(mt));var wt=ie.shape,Qe=ie.stride,dt,It,lr,Qt,ar,pr;wt.length===3?(lr=wt[2],pr=Qe[2]):(lr=1,pr=1),dt=wt[0],It=wt[1],Qt=Qe[0],ar=Qe[1],K.alignment=1,K.width=dt,K.height=It,K.channels=lr,K.format=K.internalformat=gc[lr],K.needsFree=!0,hd(K,mt,Qt,ar,pr,ie.offset)}else if(td(ie)||Qh(ie)||Ef(ie))td(ie)||Qh(ie)?K.element=ie:K.element=ie.canvas,K.width=K.element.width,K.height=K.element.height,K.channels=4;else if(vc(ie))K.element=ie,K.width=ie.width,K.height=ie.height,K.channels=4;else if(Ld(ie))K.element=ie,K.width=ie.naturalWidth,K.height=ie.naturalHeight,K.channels=4;else if(cd(ie))K.element=ie,K.width=ie.videoWidth,K.height=ie.videoHeight,K.channels=4;else if(yh(ie)){var yr=K.width||ie[0].length,qt=K.height||ie.length,tr=K.channels;Zi(ie[0][0])?tr=tr||ie[0][0].length:tr=tr||1;for(var Xt=Je.shape(ie),Fr=1,xi=0;xi>=We,ie.height>>=We,la(ie,we[We]),K.mipmask|=1<=0&&!("faces"in le)&&(K.genMipmaps=!0)}if("mag"in le){var we=le.mag;K.magFilter=ia[we]}var We=K.wrapS,mt=K.wrapT;if("wrap"in le){var wt=le.wrap;typeof wt=="string"?We=mt=ua[wt]:Array.isArray(wt)&&(We=ua[wt[0]],mt=ua[wt[1]])}else{if("wrapS"in le){var Qe=le.wrapS;We=ua[Qe]}if("wrapT"in le){var dt=le.wrapT;mt=ua[dt]}}if(K.wrapS=We,K.wrapT=mt,"anisotropic"in le&&(le.anisotropic,K.anisotropic=le.anisotropic),"mipmap"in le){var It=!1;switch(typeof le.mipmap){case"string":K.mipmapHint=Tn[le.mipmap],K.genMipmaps=!0,It=!0;break;case"boolean":It=K.genMipmaps=le.mipmap;break;case"object":K.genMipmaps=!1,It=!0;break}It&&!("min"in le)&&(K.minFilter=lu)}}function kc(K,le){St.texParameteri(le,ic,K.minFilter),St.texParameteri(le,Bu,K.magFilter),St.texParameteri(le,Ls,K.wrapS),St.texParameteri(le,Rs,K.wrapT),Pr.ext_texture_filter_anisotropic&&St.texParameteri(le,Vl,K.anisotropic),K.genMipmaps&&(St.hint(uh,K.mipmapHint),St.generateMipmap(le))}var Ec=0,Au={},wu=Nr.maxTextureUnits,Iu=Array(wu).map(function(){return null});function Zo(K){Bn.call(this),this.mipmask=0,this.internalformat=fo,this.id=Ec++,this.refCount=1,this.target=K,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new kl,Oi.profile&&(this.stats={size:0})}function Du(K){St.activeTexture(vh),St.bindTexture(K.target,K.texture)}function vl(){var K=Iu[0];K?St.bindTexture(K.target,K.texture):St.bindTexture(dn,null)}function Nu(K){var le=K.texture,ie=K.unit,we=K.target;ie>=0&&(St.activeTexture(vh+ie),St.bindTexture(we,null),Iu[ie]=null),St.deleteTexture(le),K.texture=null,K.params=null,K.pixels=null,K.refCount=0,delete Au[K.id],xn.textureCount--}d(Zo.prototype,{bind:function(){var K=this;K.bindCount+=1;var le=K.unit;if(le<0){for(var ie=0;ie0)continue;we.unit=-1}Iu[ie]=K,le=ie;break}Oi.profile&&xn.maxTextureUnits>ar)-lr,pr.height=pr.height||(ie.height>>ar)-Qt,Du(ie),$o(pr,dn,lr,Qt,ar),vl(),qa(pr),we}function mt(wt,Qe){var dt=wt|0,It=Qe|0||dt;if(dt===ie.width&&It===ie.height)return we;we.width=ie.width=dt,we.height=ie.height=It,Du(ie);for(var lr=0;ie.mipmask>>lr;++lr){var Qt=dt>>lr,ar=It>>lr;if(!Qt||!ar)break;St.texImage2D(dn,lr,ie.format,Qt,ar,0,ie.format,ie.type,null)}return vl(),Oi.profile&&(ie.stats.size=Nh(ie.internalformat,ie.type,dt,It,!1,!1)),we}return we(K,le),we.subimage=We,we.resize=mt,we._reglType="texture2d",we._texture=ie,Oi.profile&&(we.stats=ie.stats),we.destroy=function(){ie.decRef()},we}function Fo(K,le,ie,we,We,mt){var wt=new Zo(Ua);Au[wt.id]=wt,xn.cubeCount++;var Qe=new Array(6);function dt(Qt,ar,pr,yr,qt,tr){var Xt,Fr=wt.texInfo;for(kl.call(Fr),Xt=0;Xt<6;++Xt)Qe[Xt]=gs();if(typeof Qt=="number"||!Qt){var xi=Qt|0||1;for(Xt=0;Xt<6;++Xt)Ro(Qe[Xt],xi,xi)}else if(typeof Qt=="object")if(ar)us(Qe[0],Qt),us(Qe[1],ar),us(Qe[2],pr),us(Qe[3],yr),us(Qe[4],qt),us(Qe[5],tr);else if(Fu(Fr,Qt),ja(wt,Qt),"faces"in Qt){var Li=Qt.faces;for(Xt=0;Xt<6;++Xt)wn(Qe[Xt],wt),us(Qe[Xt],Li[Xt])}else for(Xt=0;Xt<6;++Xt)us(Qe[Xt],Qt);for(wn(wt,Qe[0]),Fr.genMipmaps?wt.mipmask=(Qe[0].width<<1)-1:wt.mipmask=Qe[0].mipmask,wt.internalformat=Qe[0].internalformat,dt.width=Qe[0].width,dt.height=Qe[0].height,Du(wt),Xt=0;Xt<6;++Xt)Kl(Qe[Xt],ea+Xt);for(kc(Fr,Ua),vl(),Oi.profile&&(wt.stats.size=Nh(wt.internalformat,wt.type,dt.width,dt.height,Fr.genMipmaps,!0)),dt.format=Kn[wt.internalformat],dt.type=Fn[wt.type],dt.mag=bn[Fr.magFilter],dt.min=Na[Fr.minFilter],dt.wrapS=ba[Fr.wrapS],dt.wrapT=ba[Fr.wrapT],Xt=0;Xt<6;++Xt)Pu(Qe[Xt]);return dt}function It(Qt,ar,pr,yr,qt){var tr=pr|0,Xt=yr|0,Fr=qt|0,xi=Ia();return wn(xi,wt),xi.width=0,xi.height=0,la(xi,ar),xi.width=xi.width||(wt.width>>Fr)-tr,xi.height=xi.height||(wt.height>>Fr)-Xt,Du(wt),$o(xi,ea+Qt,tr,Xt,Fr),vl(),qa(xi),dt}function lr(Qt){var ar=Qt|0;if(ar!==wt.width){dt.width=wt.width=ar,dt.height=wt.height=ar,Du(wt);for(var pr=0;pr<6;++pr)for(var yr=0;wt.mipmask>>yr;++yr)St.texImage2D(ea+pr,yr,wt.format,ar>>yr,ar>>yr,0,wt.format,wt.type,null);return vl(),Oi.profile&&(wt.stats.size=Nh(wt.internalformat,wt.type,dt.width,dt.height,!1,!0)),dt}}return dt(K,le,ie,we,We,mt),dt.subimage=It,dt.resize=lr,dt._reglType="textureCube",dt._texture=wt,Oi.profile&&(dt.stats=wt.stats),dt.destroy=function(){wt.decRef()},dt}function Ds(){for(var K=0;K>we,ie.height>>we,0,ie.internalformat,ie.type,null);else for(var We=0;We<6;++We)St.texImage2D(ea+We,we,ie.internalformat,ie.width>>we,ie.height>>we,0,ie.internalformat,ie.type,null);kc(ie.texInfo,ie.target)})}function Ml(){for(var K=0;K=0?Pu=!0:ua.indexOf(kl)>=0&&(Pu=!1))),("depthTexture"in Zo||"depthStencilTexture"in Zo)&&(Iu=!!(Zo.depthTexture||Zo.depthStencilTexture)),"depth"in Zo&&(typeof Zo.depth=="boolean"?Kl=Zo.depth:(Ec=Zo.depth,zl=!1)),"stencil"in Zo&&(typeof Zo.stencil=="boolean"?zl=Zo.stencil:(Au=Zo.stencil,Kl=!1)),"depthStencil"in Zo&&(typeof Zo.depthStencil=="boolean"?Kl=zl=Zo.depthStencil:(wu=Zo.depthStencil,Kl=!1,zl=!1))}var vl=null,Nu=null,Lc=null,Fo=null;if(Array.isArray(gs))vl=gs.map(Nn);else if(gs)vl=[Nn(gs)];else for(vl=new Array(kc),Co=0;Co0&&(qa.depth=la[0].depth,qa.stencil=la[0].stencil,qa.depthStencil=la[0].depthStencil),la[Ia]?la[Ia](qa):la[Ia]=wn(qa)}return d(Da,{width:Co,height:Co,color:kl})}function $o(Io){var Ia,qa=Io|0;if(qa===Da.width)return Da;var Co=Da.color;for(Ia=0;Ia=Co.byteLength?Ro.subdata(Co):(Ro.destroy(),wn.buffers[Io]=null)),wn.buffers[Io]||(Ro=wn.buffers[Io]=Cn.create(Ia,$f,!1,!0)),qa.buffer=Cn.getBuffer(Ro),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1,Da[Io]=1}else Cn.getBuffer(Ia)?(qa.buffer=Cn.getBuffer(Ia),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1):Cn.getBuffer(Ia.buffer)?(qa.buffer=Cn.getBuffer(Ia.buffer),qa.size=(+Ia.size||qa.buffer.dimension)|0,qa.normalized=!!Ia.normalized||!1,"type"in Ia?qa.type=un[Ia.type]:qa.type=qa.buffer.dtype,qa.offset=(Ia.offset||0)|0,qa.stride=(Ia.stride||0)|0,qa.divisor=(Ia.divisor||0)|0,qa.state=1):"x"in Ia&&(qa.x=+Ia.x||0,qa.y=+Ia.y||0,qa.z=+Ia.z||0,qa.w=+Ia.w||0,qa.state=2)}for(var us=0;us1)for(var Ca=0;CaEi&&(Ei=on.stats.uniformsCount)}),Ei},Nr.getMaxAttributesCount=function(){var Ei=0;return La.forEach(function(on){on.stats.attributesCount>Ei&&(Ei=on.stats.attributesCount)}),Ei});function Nn(){Cn={},xn={};for(var Ei=0;Ei>>4&15)+Pr.charAt(en&15);return Nr}function $h(St){for(var Pr="",Nr=-1,en,Cn;++Nr>>6&31,128|en&63):en<=65535?Pr+=String.fromCharCode(224|en>>>12&15,128|en>>>6&63,128|en&63):en<=2097151&&(Pr+=String.fromCharCode(240|en>>>18&7,128|en>>>12&63,128|en>>>6&63,128|en&63));return Pr}function Ph(St){for(var Pr=Array(St.length>>2),Nr=0;Nr>5]|=(St.charCodeAt(Nr/8)&255)<<24-Nr%32;return Pr}function Zu(St){for(var Pr="",Nr=0;Nr>5]>>>24-Nr%32&255);return Pr}function fu(St,Pr){return St>>>Pr|St<<32-Pr}function Ih(St,Pr){return St>>>Pr}function Tf(St,Pr,Nr){return St&Pr^~St&Nr}function Dh(St,Pr,Nr){return St&Pr^St&Nr^Pr&Nr}function ad(St){return fu(St,2)^fu(St,13)^fu(St,22)}function wr(St){return fu(St,6)^fu(St,11)^fu(St,25)}function Yr(St){return fu(St,7)^fu(St,18)^Ih(St,3)}function Ni(St){return fu(St,17)^fu(St,19)^Ih(St,10)}var Ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function hn(St,Pr){var Nr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),en=new Array(64),Cn,xn,Oi,Tn,ua,ia,La,no,Ka,da,Nn,Ei;for(St[Pr>>5]|=128<<24-Pr%32,St[(Pr+64>>9<<4)+15]=Pr,Ka=0;Ka>16)+(Pr>>16)+(Nr>>16);return en<<16|Nr&65535}function pa(St){return Array.prototype.slice.call(St)}function Ea(St){return pa(St).join("")}function Za(St){var Pr=St&&St.cache,Nr=0,en=[],Cn=[],xn=[];function Oi(Nn,Ei){var on=Ei&&Ei.stable;if(!on){for(var Kn=0;Kn0&&(Nn.push(Fn,"="),Nn.push.apply(Nn,pa(arguments)),Nn.push(";")),Fn}return d(Ei,{def:Kn,toString:function(){return Ea([on.length>0?"var "+on.join(",")+";":"",Ea(Nn)])}})}function ua(){var Nn=Tn(),Ei=Tn(),on=Nn.toString,Kn=Ei.toString;function Fn(bn,Na){Ei(bn,Na,"=",Nn.def(bn,Na),";")}return d(function(){Nn.apply(Nn,pa(arguments))},{def:Nn.def,entry:Nn,exit:Ei,save:Fn,set:function(bn,Na,ba){Fn(bn,Na),Nn(bn,Na,"=",ba,";")},toString:function(){return on()+Kn()}})}function ia(){var Nn=Ea(arguments),Ei=ua(),on=ua(),Kn=Ei.toString,Fn=on.toString;return d(Ei,{then:function(){return Ei.apply(Ei,pa(arguments)),this},else:function(){return on.apply(on,pa(arguments)),this},toString:function(){var bn=Fn();return bn&&(bn="else{"+bn+"}"),Ea(["if(",Nn,"){",Kn(),"}",bn])}})}var La=Tn(),no={};function Ka(Nn,Ei){var on=[];function Kn(){var Qa="a"+on.length;return on.push(Qa),Qa}Ei=Ei||0;for(var Fn=0;Fn2){for(var T=Array(M.position.length*.5),N=0;N2){for(var V=!M.position[0].length,W=l.mallocFloat(this.count*2),F=0,H=0;F1?p.align[Le]:p.align[0]:p.align;if(typeof nt=="number")return nt;switch(nt){case"right":case"end":return-Oe;case"center":case"centre":case"middle":return-Oe*.5}return 0})),this.baseline==null&&M.baseline==null&&(M.baseline=0),M.baseline!=null&&(this.baseline=M.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(Oe,Le){var nt=(p.font[Le]||p.font[0]).metrics,xt=0;return xt+=nt.bottom*.5,typeof Oe=="number"?xt+=Oe-nt.baseline:xt+=-nt[Oe],xt*=-1,xt})),M.color!=null)if(M.color||(M.color="transparent"),typeof M.color=="string"||!isNaN(M.color))this.color=n(M.color,"uint8");else{var Be;if(typeof M.color[0]=="number"&&M.color.length>this.counts.length){var Ze=M.color.length;Be=l.mallocUint8(Ze);for(var Ge=(M.color.subarray||M.color.slice).bind(M.color),tt=0;tt4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(vt){var ct=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(ct);for(var Ae=0;Ae1?this.counts[Ae]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[Ae]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(Ae*4,Ae*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[Ae]:this.opacity,baseline:this.baselineOffset[Ae]!=null?this.baselineOffset[Ae]:this.baselineOffset[0],align:this.align?this.alignOffset[Ae]!=null?this.alignOffset[Ae]:this.alignOffset[0]:0,atlas:this.fontAtlas[Ae]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(Ae*2,Ae*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function I(M){return typeof M=="function"&&M._gl&&M.prop&&M.texture&&M.buffer}Y.exports=E}),rQ=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():d.createREGL=y()})(te,function(){var d=function(St,Ir){for(var Nr=Object.keys(Ir),Qi=0;Qi1&&Ir===Nr&&(Ir==='"'||Ir==="'"))return['"'+a(St.substr(1,St.length-2))+'"'];var Qi=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(Qi)return l(St.substr(0,Qi.index)).concat(l(Qi[1])).concat(l(St.substr(Qi.index+Qi[0].length)));var Cn=St.split(".");if(Cn.length===1)return['"'+a(St)+'"'];for(var xn=[],Oi=0;Oi"u"?1:window.devicePixelRatio,La=!1,ao={},Ya=function(Ei){},da=function(){};if(typeof Ir=="string"?Nr=document.querySelector(Ir):typeof Ir=="object"&&(k(Ir)?Nr=Ir:w(Ir)?(xn=Ir,Cn=xn.canvas):("gl"in Ir?xn=Ir.gl:"canvas"in Ir?Cn=E(Ir.canvas):"container"in Ir&&(Qi=E(Ir.container)),"attributes"in Ir&&(Oi=Ir.attributes),"extensions"in Ir&&(Tn=D(Ir.extensions)),"optionalExtensions"in Ir&&(ua=D(Ir.optionalExtensions)),"onDone"in Ir&&(Ya=Ir.onDone),"profile"in Ir&&(La=!!Ir.profile),"pixelRatio"in Ir&&(ia=+Ir.pixelRatio),"cachedCode"in Ir&&(ao=Ir.cachedCode))),Nr&&(Nr.nodeName.toLowerCase()==="canvas"?Cn=Nr:Qi=Nr),!xn){if(!Cn){var jn=A(Qi||document.body,Ya,ia);if(!jn)return null;Cn=jn.canvas,da=jn.onDestroy}Oi.premultipliedAlpha===void 0&&(Oi.premultipliedAlpha=!0),xn=f(Cn,Oi)}return xn?{gl:xn,canvas:Cn,container:Qi,extensions:Tn,optionalExtensions:ua,pixelRatio:ia,profile:La,cachedCode:ao,onDone:Ya,onDestroy:da}:(da(),Ya("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function M(St,Ir){var Nr={};function Qi(Oi){var Tn=Oi.toLowerCase(),ua;try{ua=Nr[Tn]=St.getExtension(Tn)}catch{}return!!ua}for(var Cn=0;Cn65535)<<4,St>>>=Ir,Nr=(St>255)<<3,St>>>=Nr,Ir|=Nr,Nr=(St>15)<<2,St>>>=Nr,Ir|=Nr,Nr=(St>3)<<1,St>>>=Nr,Ir|=Nr,Ir|St>>1}function H(){var St=p(8,function(){return[]});function Ir(xn){var Oi=W(xn),Tn=St[F(Oi)>>2];return Tn.length>0?Tn.pop():new ArrayBuffer(Oi)}function Nr(xn){St[F(xn.byteLength)>>2].push(xn)}function Qi(xn,Oi){var Tn=null;switch(xn){case g:Tn=new Int8Array(Ir(Oi),0,Oi);break;case C:Tn=new Uint8Array(Ir(Oi),0,Oi);break;case T:Tn=new Int16Array(Ir(2*Oi),0,Oi);break;case N:Tn=new Uint16Array(Ir(2*Oi),0,Oi);break;case B:Tn=new Int32Array(Ir(4*Oi),0,Oi);break;case U:Tn=new Uint32Array(Ir(4*Oi),0,Oi);break;case V:Tn=new Float32Array(Ir(4*Oi),0,Oi);break;default:return null}return Tn.length!==Oi?Tn.subarray(0,Oi):Tn}function Cn(xn){Nr(xn.buffer)}return{alloc:Ir,free:Nr,allocType:Qi,freeType:Cn}}var q=H();q.zero=H();var G=3408,ee=3410,he=3411,be=3412,ve=3413,ce=3414,re=3415,ge=33901,ne=33902,se=3379,_e=3386,oe=34921,J=36347,me=36348,fe=35661,Ce=35660,Re=34930,Be=36349,Ze=34076,Ge=34024,tt=7936,_t=7937,mt=7938,vt=35724,ct=34047,Ae=36063,Oe=34852,Le=3553,nt=34067,xt=34069,ut=33984,Et=6408,Gt=5126,Qt=5121,vr=36160,mr=36053,Yr=36064,ii=16384,Lr=function(St,Ir){var Nr=1;Ir.ext_texture_filter_anisotropic&&(Nr=St.getParameter(ct));var Qi=1,Cn=1;Ir.webgl_draw_buffers&&(Qi=St.getParameter(Oe),Cn=St.getParameter(Ae));var xn=!!Ir.oes_texture_float;if(xn){var Oi=St.createTexture();St.bindTexture(Le,Oi),St.texImage2D(Le,0,Et,1,1,0,Et,Gt,null);var Tn=St.createFramebuffer();if(St.bindFramebuffer(vr,Tn),St.framebufferTexture2D(vr,Yr,Le,Oi,0),St.bindTexture(Le,null),St.checkFramebufferStatus(vr)!==mr)xn=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(ii);var ua=q.allocType(Gt,4);St.readPixels(0,0,1,1,Et,Gt,ua),St.getError()?xn=!1:(St.deleteFramebuffer(Tn),St.deleteTexture(Oi),xn=ua[0]===1),q.freeType(ua)}}var ia=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),La=!0;if(!ia){var ao=St.createTexture(),Ya=q.allocType(Qt,36);St.activeTexture(ut),St.bindTexture(nt,ao),St.texImage2D(xt,0,Et,3,3,0,Et,Qt,Ya),q.freeType(Ya),St.bindTexture(nt,null),St.deleteTexture(ao),La=!St.getError()}return{colorBits:[St.getParameter(ee),St.getParameter(he),St.getParameter(be),St.getParameter(ve)],depthBits:St.getParameter(ce),stencilBits:St.getParameter(re),subpixelBits:St.getParameter(G),extensions:Object.keys(Ir).filter(function(da){return!!Ir[da]}),maxAnisotropic:Nr,maxDrawbuffers:Qi,maxColorAttachments:Cn,pointSizeDims:St.getParameter(ge),lineWidthDims:St.getParameter(ne),maxViewportDims:St.getParameter(_e),maxCombinedTextureUnits:St.getParameter(fe),maxCubeMapSize:St.getParameter(Ze),maxRenderbufferSize:St.getParameter(Ge),maxTextureUnits:St.getParameter(Re),maxTextureSize:St.getParameter(se),maxAttributes:St.getParameter(oe),maxVertexUniforms:St.getParameter(J),maxVertexTextureUnits:St.getParameter(Ce),maxVaryingVectors:St.getParameter(me),maxFragmentUniforms:St.getParameter(Be),glsl:St.getParameter(vt),renderer:St.getParameter(_t),vendor:St.getParameter(tt),version:St.getParameter(mt),readFloat:xn,npotTextureCube:La}},ci=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function vi(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||ci(St.data))}var Ot=function(St){return Object.keys(St).map(function(Ir){return St[Ir]})},Xe={shape:at,flatten:He};function ot(St,Ir,Nr){for(var Qi=0;Qi0){var eo;if(Array.isArray(an[0])){ka=dn(an);for(var Rn=1,wn=1;wn0){if(typeof Rn[0]=="number"){var oa=q.allocType(bn.dtype,Rn.length);di(oa,Rn),ka(oa,ja),q.freeType(oa)}else if(Array.isArray(Rn[0])||ci(Rn[0])){Aa=dn(Rn);var la=Sn(Rn,Aa,bn.dtype);ka(la,ja),q.freeType(la)}}}else if(vi(Rn)){Aa=Rn.shape;var Da=Rn.stride,$o=0,Do=0,Ia=0,qa=0;Aa.length===1?($o=Aa[0],Do=1,Ia=Da[0],qa=0):Aa.length===2&&($o=Aa[0],Do=Aa[1],Ia=Da[0],qa=Da[1]);var Co=Array.isArray(Rn.data)?bn.dtype:Er(Rn.data),Ro=q.allocType(Co,$o*Do);qi(Ro,Rn.data,$o,Do,Ia,qa,Rn.offset),ka(Ro,ja),q.freeType(Ro)}return Na}return Xn||Na(Ei),Na._reglType="buffer",Na._buffer=bn,Na.subdata=eo,Nr.profile&&(Na.stats=bn.stats),Na.destroy=function(){Ya(bn)},Na}function jn(){Ot(xn).forEach(function(Ei){Ei.buffer=St.createBuffer(),St.bindBuffer(Ei.type,Ei.buffer),St.bufferData(Ei.type,Ei.persistentData||Ei.byteLength,Ei.usage)})}return Nr.profile&&(Ir.getTotalBufferSize=function(){var Ei=0;return Object.keys(xn).forEach(function(an){Ei+=xn[an].stats.size}),Ei}),{create:da,createStream:ua,destroyStream:ia,clear:function(){Ot(xn).forEach(Ya),Tn.forEach(Ya)},getBuffer:function(Ei){return Ei&&Ei._buffer instanceof Oi?Ei._buffer:null},restore:jn,_initBuffer:ao}}var Hi=0,Ln=0,Fn=1,Kn=1,Jn=4,sa=4,Mn={points:Hi,point:Ln,lines:Fn,line:Kn,triangles:Jn,triangle:sa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ha=0,io=1,Ft=4,Rt=5120,qr=5121,ai=5122,si=5123,Gr=5124,li=5125,Pi=34963,xi=35040,zt=35044;function xr(St,Ir,Nr,Qi){var Cn={},xn=0,Oi={uint8:qr,uint16:si};Ir.oes_element_index_uint&&(Oi.uint32=li);function Tn(jn){this.id=xn++,Cn[this.id]=this,this.buffer=jn,this.primType=Ft,this.vertCount=0,this.type=0}Tn.prototype.bind=function(){this.buffer.bind()};var ua=[];function ia(jn){var Ei=ua.pop();return Ei||(Ei=new Tn(Nr.create(null,Pi,!0,!1)._buffer)),ao(Ei,jn,xi,-1,-1,0,0),Ei}function La(jn){ua.push(jn)}function ao(jn,Ei,an,Xn,Nn,bn,Na){jn.buffer.bind();var ka;if(Ei){var eo=Na;!Na&&(!ci(Ei)||vi(Ei)&&!ci(Ei.data))&&(eo=Ir.oes_element_index_uint?li:si),Nr._initBuffer(jn.buffer,Ei,an,eo,3)}else St.bufferData(Pi,bn,an),jn.buffer.dtype=ka||qr,jn.buffer.usage=an,jn.buffer.dimension=3,jn.buffer.byteLength=bn;if(ka=Na,!Na){switch(jn.buffer.dtype){case qr:case Rt:ka=qr;break;case si:case ai:ka=si;break;case li:case Gr:ka=li;break}jn.buffer.dtype=ka}jn.type=ka;var Rn=Nn;Rn<0&&(Rn=jn.buffer.byteLength,ka===si?Rn>>=1:ka===li&&(Rn>>=2)),jn.vertCount=Rn;var wn=Xn;if(Xn<0){wn=Ft;var ja=jn.buffer.dimension;ja===1&&(wn=Ha),ja===2&&(wn=io),ja===3&&(wn=Ft)}jn.primType=wn}function Ya(jn){Qi.elementsCount--,delete Cn[jn.id],jn.buffer.destroy(),jn.buffer=null}function da(jn,Ei){var an=Nr.create(null,Pi,!0),Xn=new Tn(an._buffer);Qi.elementsCount++;function Nn(bn){if(!bn)an(),Xn.primType=Ft,Xn.vertCount=0,Xn.type=qr;else if(typeof bn=="number")an(bn),Xn.primType=Ft,Xn.vertCount=bn|0,Xn.type=qr;else{var Na=null,ka=zt,eo=-1,Rn=-1,wn=0,ja=0;Array.isArray(bn)||ci(bn)||vi(bn)?Na=bn:("data"in bn&&(Na=bn.data),"usage"in bn&&(ka=Gn[bn.usage]),"primitive"in bn&&(eo=Mn[bn.primitive]),"count"in bn&&(Rn=bn.count|0),"type"in bn&&(ja=Oi[bn.type]),"length"in bn?wn=bn.length|0:(wn=Rn,ja===si||ja===ai?wn*=2:(ja===li||ja===Gr)&&(wn*=4))),ao(Xn,Na,ka,eo,Rn,wn,ja)}return Nn}return Nn(jn),Nn._reglType="elements",Nn._elements=Xn,Nn.subdata=function(bn,Na){return an.subdata(bn,Na),Nn},Nn.destroy=function(){Ya(Xn)},Nn}return{create:da,createStream:ia,destroyStream:La,getElements:function(jn){return typeof jn=="function"&&jn._elements instanceof Tn?jn._elements:null},clear:function(){Ot(Cn).forEach(Ya)}}}var Qr=new Float32Array(1),Ri=new Uint32Array(Qr.buffer),en=5123;function _n(St){for(var Ir=q.allocType(en,St.length),Nr=0;Nr>>31<<15,xn=(Qi<<1>>>24)-127,Oi=Qi>>13&1023;if(xn<-24)Ir[Nr]=Cn;else if(xn<-14){var Tn=-14-xn;Ir[Nr]=Cn+(Oi+1024>>Tn)}else xn>15?Ir[Nr]=Cn+31744:Ir[Nr]=Cn+(xn+15<<10)+Oi}return Ir}function Zi(St){return Array.isArray(St)||ci(St)}var Wi=34467,pn=3553,Ua=34067,ea=34069,fo=6408,ho=6406,Vo=6407,Ao=6409,Wo=6410,Wa=32854,Ts=32855,fs=36194,_l=32819,es=32820,rl=33635,ds=34042,xl=6402,sl=34041,Gl=35904,ms=35906,Bs=36193,No=33776,Ls=33777,Il=33778,Jl=33779,ou=35986,Gs=35987,$a=34798,So=35840,Xs=35841,su=35842,is=35843,tu=36196,pl=5121,Nl=5123,Gu=5125,bo=5126,Ps=10242,Rs=10243,pu=10497,bl=33071,ls=33648,Ru=10240,ic=10241,Ll=9728,Hl=9729,lu=9984,hu=9985,pc=9986,Ah=9987,uh=33170,gh=4352,td=4353,Nf=4354,Vl=34046,Kc=3317,rd=37440,xc=37441,mc=37443,bc=37444,vh=33984,yu=[lu,pc,hu,Ah],gc=[0,Ao,Wo,Vo,fo],hl={};hl[Ao]=hl[ho]=hl[xl]=1,hl[sl]=hl[Wo]=2,hl[Vo]=hl[Gl]=3,hl[fo]=hl[ms]=4;function ru(St){return"[object "+St+"]"}var Fh=ru("HTMLCanvasElement"),Uc=ru("OffscreenCanvas"),Jh=ru("CanvasRenderingContext2D"),Mu=ru("ImageBitmap"),Xd=ru("HTMLImageElement"),ll=ru("HTMLVideoElement"),fp=Object.keys(ht).concat([Fh,Uc,Jh,Mu,Xd,ll]),jl=[];jl[pl]=1,jl[bo]=4,jl[Bs]=2,jl[Nl]=2,jl[Gu]=4;var os=[];os[Wa]=2,os[Ts]=2,os[fs]=2,os[sl]=4,os[No]=.5,os[Ls]=.5,os[Il]=1,os[Jl]=1,os[ou]=.5,os[Gs]=1,os[$a]=1,os[So]=.5,os[Xs]=.25,os[su]=.5,os[is]=.25,os[tu]=.5;function _f(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function yh(St){if(!Array.isArray(St))return!1;var Ir=St.length;return!(Ir===0||!Zi(St[0]))}function hc(St){return Object.prototype.toString.call(St)}function id(St){return hc(St)===Fh}function Qh(St){return hc(St)===Uc}function Lf(St){return hc(St)===Jh}function vc(St){return hc(St)===Mu}function Pd(St){return hc(St)===Xd}function hd(St){return hc(St)===ll}function Pf(St){if(!St)return!1;var Ir=hc(St);return fp.indexOf(Ir)>=0?!0:_f(St)||yh(St)||vi(St)}function ef(St){return ht[Object.prototype.toString.call(St)]|0}function nd(St,Ir){var Nr=Ir.length;switch(St.type){case pl:case Nl:case Gu:case bo:var Qi=q.allocType(St.type,Nr);Qi.set(Ir),St.data=Qi;break;case Bs:St.data=_n(Ir);break}}function ad(St,Ir){return q.allocType(St.type===Bs?bo:St.type,Ir)}function _h(St,Ir){St.type===Bs?(St.data=_n(Ir),q.freeType(Ir)):St.data=Ir}function fd(St,Ir,Nr,Qi,Cn,xn){for(var Oi=St.width,Tn=St.height,ua=St.channels,ia=Oi*Tn*ua,La=ad(St,ia),ao=0,Ya=0;Ya=1;)Tn+=Oi*ua*ua,ua/=2;return Tn}else return Oi*Nr*Qi}function Mh(St,Ir,Nr,Qi,Cn,xn,Oi){var Tn={"don't care":gh,"dont care":gh,nice:Nf,fast:td},ua={repeat:pu,clamp:bl,mirror:ls},ia={nearest:Ll,linear:Hl},La=d({mipmap:Ah,"nearest mipmap nearest":lu,"linear mipmap nearest":hu,"nearest mipmap linear":pc,"linear mipmap linear":Ah},ia),ao={none:0,browser:bc},Ya={uint8:pl,rgba4:_l,rgb565:rl,"rgb5 a1":es},da={alpha:ho,luminance:Ao,"luminance alpha":Wo,rgb:Vo,rgba:fo,rgba4:Wa,"rgb5 a1":Ts,rgb565:fs},jn={};Ir.ext_srgb&&(da.srgb=Gl,da.srgba=ms),Ir.oes_texture_float&&(Ya.float32=Ya.float=bo),Ir.oes_texture_half_float&&(Ya.float16=Ya["half float"]=Bs),Ir.webgl_depth_texture&&(d(da,{depth:xl,"depth stencil":sl}),d(Ya,{uint16:Nl,uint32:Gu,"depth stencil":ds})),Ir.webgl_compressed_texture_s3tc&&d(jn,{"rgb s3tc dxt1":No,"rgba s3tc dxt1":Ls,"rgba s3tc dxt3":Il,"rgba s3tc dxt5":Jl}),Ir.webgl_compressed_texture_atc&&d(jn,{"rgb atc":ou,"rgba atc explicit alpha":Gs,"rgba atc interpolated alpha":$a}),Ir.webgl_compressed_texture_pvrtc&&d(jn,{"rgb pvrtc 4bppv1":So,"rgb pvrtc 2bppv1":Xs,"rgba pvrtc 4bppv1":su,"rgba pvrtc 2bppv1":is}),Ir.webgl_compressed_texture_etc1&&(jn["rgb etc1"]=tu);var Ei=Array.prototype.slice.call(St.getParameter(Wi));Object.keys(jn).forEach(function(K){var le=jn[K];Ei.indexOf(le)>=0&&(da[K]=le)});var an=Object.keys(da);Nr.textureFormats=an;var Xn=[];Object.keys(da).forEach(function(K){var le=da[K];Xn[le]=K});var Nn=[];Object.keys(Ya).forEach(function(K){var le=Ya[K];Nn[le]=K});var bn=[];Object.keys(ia).forEach(function(K){var le=ia[K];bn[le]=K});var Na=[];Object.keys(La).forEach(function(K){var le=La[K];Na[le]=K});var ka=[];Object.keys(ua).forEach(function(K){var le=ua[K];ka[le]=K});var eo=an.reduce(function(K,le){var ie=da[le];return ie===Ao||ie===ho||ie===Ao||ie===Wo||ie===xl||ie===sl||Ir.ext_srgb&&(ie===Gl||ie===ms)?K[ie]=ie:ie===Ts||le.indexOf("rgba")>=0?K[ie]=fo:K[ie]=Vo,K},{});function Rn(){this.internalformat=fo,this.format=fo,this.type=pl,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=bc,this.width=0,this.height=0,this.channels=0}function wn(K,le){K.internalformat=le.internalformat,K.format=le.format,K.type=le.type,K.compressed=le.compressed,K.premultiplyAlpha=le.premultiplyAlpha,K.flipY=le.flipY,K.unpackAlignment=le.unpackAlignment,K.colorSpace=le.colorSpace,K.width=le.width,K.height=le.height,K.channels=le.channels}function ja(K,le){if(!(typeof le!="object"||!le)){if("premultiplyAlpha"in le&&(K.premultiplyAlpha=le.premultiplyAlpha),"flipY"in le&&(K.flipY=le.flipY),"alignment"in le&&(K.unpackAlignment=le.alignment),"colorSpace"in le&&(K.colorSpace=ao[le.colorSpace]),"type"in le){var ie=le.type;K.type=Ya[ie]}var we=K.width,We=K.height,gt=K.channels,kt=!1;"shape"in le?(we=le.shape[0],We=le.shape[1],le.shape.length===3&&(gt=le.shape[2],kt=!0)):("radius"in le&&(we=We=le.radius),"width"in le&&(we=le.width),"height"in le&&(We=le.height),"channels"in le&&(gt=le.channels,kt=!0)),K.width=we|0,K.height=We|0,K.channels=gt|0;var Je=!1;if("format"in le){var dt=le.format,It=K.internalformat=da[dt];K.format=eo[It],dt in Ya&&("type"in le||(K.type=Ya[dt])),dt in jn&&(K.compressed=!0),Je=!0}!kt&&Je?K.channels=hl[K.format]:kt&&!Je&&K.channels!==gc[K.format]&&(K.format=K.internalformat=gc[K.channels])}}function Aa(K){St.pixelStorei(rd,K.flipY),St.pixelStorei(xc,K.premultiplyAlpha),St.pixelStorei(mc,K.colorSpace),St.pixelStorei(Kc,K.unpackAlignment)}function oa(){Rn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function la(K,le){var ie=null;if(Pf(le)?ie=le:le&&(ja(K,le),"x"in le&&(K.xOffset=le.x|0),"y"in le&&(K.yOffset=le.y|0),Pf(le.data)&&(ie=le.data)),le.copy){var we=Cn.viewportWidth,We=Cn.viewportHeight;K.width=K.width||we-K.xOffset,K.height=K.height||We-K.yOffset,K.needsCopy=!0}else if(!ie)K.width=K.width||1,K.height=K.height||1,K.channels=K.channels||4;else if(ci(ie))K.channels=K.channels||4,K.data=ie,!("type"in le)&&K.type===pl&&(K.type=ef(ie));else if(_f(ie))K.channels=K.channels||4,nd(K,ie),K.alignment=1,K.needsFree=!0;else if(vi(ie)){var gt=ie.data;!Array.isArray(gt)&&K.type===pl&&(K.type=ef(gt));var kt=ie.shape,Je=ie.stride,dt,It,ur,er,ar,pr;kt.length===3?(ur=kt[2],pr=Je[2]):(ur=1,pr=1),dt=kt[0],It=kt[1],er=Je[0],ar=Je[1],K.alignment=1,K.width=dt,K.height=It,K.channels=ur,K.format=K.internalformat=gc[ur],K.needsFree=!0,fd(K,gt,er,ar,pr,ie.offset)}else if(id(ie)||Qh(ie)||Lf(ie))id(ie)||Qh(ie)?K.element=ie:K.element=ie.canvas,K.width=K.element.width,K.height=K.element.height,K.channels=4;else if(vc(ie))K.element=ie,K.width=ie.width,K.height=ie.height,K.channels=4;else if(Pd(ie))K.element=ie,K.width=ie.naturalWidth,K.height=ie.naturalHeight,K.channels=4;else if(hd(ie))K.element=ie,K.width=ie.videoWidth,K.height=ie.videoHeight,K.channels=4;else if(yh(ie)){var yr=K.width||ie[0].length,qt=K.height||ie.length,rr=K.channels;Zi(ie[0][0])?rr=rr||ie[0][0].length:rr=rr||1;for(var Jt=Xe.shape(ie),Fr=1,bi=0;bi>=We,ie.height>>=We,la(ie,we[We]),K.mipmask|=1<=0&&!("faces"in le)&&(K.genMipmaps=!0)}if("mag"in le){var we=le.mag;K.magFilter=ia[we]}var We=K.wrapS,gt=K.wrapT;if("wrap"in le){var kt=le.wrap;typeof kt=="string"?We=gt=ua[kt]:Array.isArray(kt)&&(We=ua[kt[0]],gt=ua[kt[1]])}else{if("wrapS"in le){var Je=le.wrapS;We=ua[Je]}if("wrapT"in le){var dt=le.wrapT;gt=ua[dt]}}if(K.wrapS=We,K.wrapT=gt,"anisotropic"in le&&(le.anisotropic,K.anisotropic=le.anisotropic),"mipmap"in le){var It=!1;switch(typeof le.mipmap){case"string":K.mipmapHint=Tn[le.mipmap],K.genMipmaps=!0,It=!0;break;case"boolean":It=K.genMipmaps=le.mipmap;break;case"object":K.genMipmaps=!1,It=!0;break}It&&!("min"in le)&&(K.minFilter=lu)}}function kc(K,le){St.texParameteri(le,ic,K.minFilter),St.texParameteri(le,Ru,K.magFilter),St.texParameteri(le,Ps,K.wrapS),St.texParameteri(le,Rs,K.wrapT),Ir.ext_texture_filter_anisotropic&&St.texParameteri(le,Vl,K.anisotropic),K.genMipmaps&&(St.hint(uh,K.mipmapHint),St.generateMipmap(le))}var Ec=0,Au={},wu=Nr.maxTextureUnits,Iu=Array(wu).map(function(){return null});function Zo(K){Rn.call(this),this.mipmask=0,this.internalformat=fo,this.id=Ec++,this.refCount=1,this.target=K,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new kl,Oi.profile&&(this.stats={size:0})}function Du(K){St.activeTexture(vh),St.bindTexture(K.target,K.texture)}function vl(){var K=Iu[0];K?St.bindTexture(K.target,K.texture):St.bindTexture(pn,null)}function ju(K){var le=K.texture,ie=K.unit,we=K.target;ie>=0&&(St.activeTexture(vh+ie),St.bindTexture(we,null),Iu[ie]=null),St.deleteTexture(le),K.texture=null,K.params=null,K.pixels=null,K.refCount=0,delete Au[K.id],xn.textureCount--}d(Zo.prototype,{bind:function(){var K=this;K.bindCount+=1;var le=K.unit;if(le<0){for(var ie=0;ie0)continue;we.unit=-1}Iu[ie]=K,le=ie;break}Oi.profile&&xn.maxTextureUnits>ar)-ur,pr.height=pr.height||(ie.height>>ar)-er,Du(ie),$o(pr,pn,ur,er,ar),vl(),qa(pr),we}function gt(kt,Je){var dt=kt|0,It=Je|0||dt;if(dt===ie.width&&It===ie.height)return we;we.width=ie.width=dt,we.height=ie.height=It,Du(ie);for(var ur=0;ie.mipmask>>ur;++ur){var er=dt>>ur,ar=It>>ur;if(!er||!ar)break;St.texImage2D(pn,ur,ie.format,er,ar,0,ie.format,ie.type,null)}return vl(),Oi.profile&&(ie.stats.size=Nh(ie.internalformat,ie.type,dt,It,!1,!1)),we}return we(K,le),we.subimage=We,we.resize=gt,we._reglType="texture2d",we._texture=ie,Oi.profile&&(we.stats=ie.stats),we.destroy=function(){ie.decRef()},we}function Fo(K,le,ie,we,We,gt){var kt=new Zo(Ua);Au[kt.id]=kt,xn.cubeCount++;var Je=new Array(6);function dt(er,ar,pr,yr,qt,rr){var Jt,Fr=kt.texInfo;for(kl.call(Fr),Jt=0;Jt<6;++Jt)Je[Jt]=gs();if(typeof er=="number"||!er){var bi=er|0||1;for(Jt=0;Jt<6;++Jt)Ro(Je[Jt],bi,bi)}else if(typeof er=="object")if(ar)us(Je[0],er),us(Je[1],ar),us(Je[2],pr),us(Je[3],yr),us(Je[4],qt),us(Je[5],rr);else if(Nu(Fr,er),ja(kt,er),"faces"in er){var Li=er.faces;for(Jt=0;Jt<6;++Jt)wn(Je[Jt],kt),us(Je[Jt],Li[Jt])}else for(Jt=0;Jt<6;++Jt)us(Je[Jt],er);for(wn(kt,Je[0]),Fr.genMipmaps?kt.mipmask=(Je[0].width<<1)-1:kt.mipmask=Je[0].mipmask,kt.internalformat=Je[0].internalformat,dt.width=Je[0].width,dt.height=Je[0].height,Du(kt),Jt=0;Jt<6;++Jt)Kl(Je[Jt],ea+Jt);for(kc(Fr,Ua),vl(),Oi.profile&&(kt.stats.size=Nh(kt.internalformat,kt.type,dt.width,dt.height,Fr.genMipmaps,!0)),dt.format=Xn[kt.internalformat],dt.type=Nn[kt.type],dt.mag=bn[Fr.magFilter],dt.min=Na[Fr.minFilter],dt.wrapS=ka[Fr.wrapS],dt.wrapT=ka[Fr.wrapT],Jt=0;Jt<6;++Jt)Pu(Je[Jt]);return dt}function It(er,ar,pr,yr,qt){var rr=pr|0,Jt=yr|0,Fr=qt|0,bi=Ia();return wn(bi,kt),bi.width=0,bi.height=0,la(bi,ar),bi.width=bi.width||(kt.width>>Fr)-rr,bi.height=bi.height||(kt.height>>Fr)-Jt,Du(kt),$o(bi,ea+er,rr,Jt,Fr),vl(),qa(bi),dt}function ur(er){var ar=er|0;if(ar!==kt.width){dt.width=kt.width=ar,dt.height=kt.height=ar,Du(kt);for(var pr=0;pr<6;++pr)for(var yr=0;kt.mipmask>>yr;++yr)St.texImage2D(ea+pr,yr,kt.format,ar>>yr,ar>>yr,0,kt.format,kt.type,null);return vl(),Oi.profile&&(kt.stats.size=Nh(kt.internalformat,kt.type,dt.width,dt.height,!1,!0)),dt}}return dt(K,le,ie,we,We,gt),dt.subimage=It,dt.resize=ur,dt._reglType="textureCube",dt._texture=kt,Oi.profile&&(dt.stats=kt.stats),dt.destroy=function(){kt.decRef()},dt}function zs(){for(var K=0;K>we,ie.height>>we,0,ie.internalformat,ie.type,null);else for(var We=0;We<6;++We)St.texImage2D(ea+We,we,ie.internalformat,ie.width>>we,ie.height>>we,0,ie.internalformat,ie.type,null);kc(ie.texInfo,ie.target)})}function Ml(){for(var K=0;K=0?Pu=!0:ua.indexOf(kl)>=0&&(Pu=!1))),("depthTexture"in Zo||"depthStencilTexture"in Zo)&&(Iu=!!(Zo.depthTexture||Zo.depthStencilTexture)),"depth"in Zo&&(typeof Zo.depth=="boolean"?Kl=Zo.depth:(Ec=Zo.depth,zl=!1)),"stencil"in Zo&&(typeof Zo.stencil=="boolean"?zl=Zo.stencil:(Au=Zo.stencil,Kl=!1)),"depthStencil"in Zo&&(typeof Zo.depthStencil=="boolean"?Kl=zl=Zo.depthStencil:(wu=Zo.depthStencil,Kl=!1,zl=!1))}var vl=null,ju=null,Lc=null,Fo=null;if(Array.isArray(gs))vl=gs.map(jn);else if(gs)vl=[jn(gs)];else for(vl=new Array(kc),Co=0;Co0&&(qa.depth=la[0].depth,qa.stencil=la[0].stencil,qa.depthStencil=la[0].depthStencil),la[Ia]?la[Ia](qa):la[Ia]=wn(qa)}return d(Da,{width:Co,height:Co,color:kl})}function $o(Do){var Ia,qa=Do|0;if(qa===Da.width)return Da;var Co=Da.color;for(Ia=0;Ia=Co.byteLength?Ro.subdata(Co):(Ro.destroy(),wn.buffers[Do]=null)),wn.buffers[Do]||(Ro=wn.buffers[Do]=Cn.create(Ia,Hf,!1,!0)),qa.buffer=Cn.getBuffer(Ro),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1,Da[Do]=1}else Cn.getBuffer(Ia)?(qa.buffer=Cn.getBuffer(Ia),qa.size=qa.buffer.dimension|0,qa.normalized=!1,qa.type=qa.buffer.dtype,qa.offset=0,qa.stride=0,qa.divisor=0,qa.state=1):Cn.getBuffer(Ia.buffer)?(qa.buffer=Cn.getBuffer(Ia.buffer),qa.size=(+Ia.size||qa.buffer.dimension)|0,qa.normalized=!!Ia.normalized||!1,"type"in Ia?qa.type=un[Ia.type]:qa.type=qa.buffer.dtype,qa.offset=(Ia.offset||0)|0,qa.stride=(Ia.stride||0)|0,qa.divisor=(Ia.divisor||0)|0,qa.state=1):"x"in Ia&&(qa.x=+Ia.x||0,qa.y=+Ia.y||0,qa.z=+Ia.z||0,qa.w=+Ia.w||0,qa.state=2)}for(var us=0;us1)for(var Aa=0;AaEi&&(Ei=an.stats.uniformsCount)}),Ei},Nr.getMaxAttributesCount=function(){var Ei=0;return La.forEach(function(an){an.stats.attributesCount>Ei&&(Ei=an.stats.attributesCount)}),Ei});function jn(){Cn={},xn={};for(var Ei=0;Ei>>4&15)+Ir.charAt(Qi&15);return Nr}function $h(St){for(var Ir="",Nr=-1,Qi,Cn;++Nr>>6&31,128|Qi&63):Qi<=65535?Ir+=String.fromCharCode(224|Qi>>>12&15,128|Qi>>>6&63,128|Qi&63):Qi<=2097151&&(Ir+=String.fromCharCode(240|Qi>>>18&7,128|Qi>>>12&63,128|Qi>>>6&63,128|Qi&63));return Ir}function Ph(St){for(var Ir=Array(St.length>>2),Nr=0;Nr>5]|=(St.charCodeAt(Nr/8)&255)<<24-Nr%32;return Ir}function Zu(St){for(var Ir="",Nr=0;Nr>5]>>>24-Nr%32&255);return Ir}function fu(St,Ir){return St>>>Ir|St<<32-Ir}function Ih(St,Ir){return St>>>Ir}function Tf(St,Ir,Nr){return St&Ir^~St&Nr}function Dh(St,Ir,Nr){return St&Ir^St&Nr^Ir&Nr}function sd(St){return fu(St,2)^fu(St,13)^fu(St,22)}function wr(St){return fu(St,6)^fu(St,11)^fu(St,25)}function Xr(St){return fu(St,7)^fu(St,18)^Ih(St,3)}function Ni(St){return fu(St,17)^fu(St,19)^Ih(St,10)}var Ai=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function hn(St,Ir){var Nr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Qi=new Array(64),Cn,xn,Oi,Tn,ua,ia,La,ao,Ya,da,jn,Ei;for(St[Ir>>5]|=128<<24-Ir%32,St[(Ir+64>>9<<4)+15]=Ir,Ya=0;Ya>16)+(Ir>>16)+(Nr>>16);return Qi<<16|Nr&65535}function pa(St){return Array.prototype.slice.call(St)}function Ea(St){return pa(St).join("")}function Ka(St){var Ir=St&&St.cache,Nr=0,Qi=[],Cn=[],xn=[];function Oi(jn,Ei){var an=Ei&&Ei.stable;if(!an){for(var Xn=0;Xn0&&(jn.push(Nn,"="),jn.push.apply(jn,pa(arguments)),jn.push(";")),Nn}return d(Ei,{def:Xn,toString:function(){return Ea([an.length>0?"var "+an.join(",")+";":"",Ea(jn)])}})}function ua(){var jn=Tn(),Ei=Tn(),an=jn.toString,Xn=Ei.toString;function Nn(bn,Na){Ei(bn,Na,"=",jn.def(bn,Na),";")}return d(function(){jn.apply(jn,pa(arguments))},{def:jn.def,entry:jn,exit:Ei,save:Nn,set:function(bn,Na,ka){Nn(bn,Na),jn(bn,Na,"=",ka,";")},toString:function(){return an()+Xn()}})}function ia(){var jn=Ea(arguments),Ei=ua(),an=ua(),Xn=Ei.toString,Nn=an.toString;return d(Ei,{then:function(){return Ei.apply(Ei,pa(arguments)),this},else:function(){return an.apply(an,pa(arguments)),this},toString:function(){var bn=Nn();return bn&&(bn="else{"+bn+"}"),Ea(["if(",jn,"){",Xn(),"}",bn])}})}var La=Tn(),ao={};function Ya(jn,Ei){var an=[];function Xn(){var eo="a"+an.length;return an.push(eo),eo}Ei=Ei||0;for(var Nn=0;Nn":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},On={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Un={cw:ft,ccw:Pt};function Zn(St){return Array.isArray(St)||ui(St)||mi(St)}function aa(St){return St.sort(function(Pr,Nr){return Pr===tc?-1:Nr===tc?1:Pr=1,en>=2,Pr)}else if(Nr===ps){var Cn=St.data;return new gn(Cn.thisDep,Cn.contextDep,Cn.propDep,Pr)}else{if(Nr===xs)return new gn(!1,!1,!1,Pr);if(Nr===_o){for(var xn=!1,Oi=!1,Tn=!1,ua=0;ua=1&&(Oi=!0),La>=2&&(Tn=!0)}else ia.type===ps&&(xn=xn||ia.data.thisDep,Oi=Oi||ia.data.contextDep,Tn=Tn||ia.data.propDep)}return new gn(xn,Oi,Tn,Pr)}else return new gn(Nr===rs,Nr===hs,Nr===vo,Pr)}}var jo=new gn(!1,!1,!1,function(){});function qo(St,Pr,Nr,en,Cn,xn,Oi,Tn,ua,ia,La,no,Ka,da,Nn,Ei){var on=ia.Record,Kn={add:32774,subtract:32778,"reverse subtract":32779};Nr.ext_blend_minmax&&(Kn.min=Bt,Kn.max=Ht);var Fn=Nr.angle_instanced_arrays,bn=Nr.webgl_draw_buffers,Na=Nr.oes_vertex_array_object,ba={dirty:!0,profile:Ei.profile},Qa={},Bn=[],wn={},ja={};function Ca(Qe){return Qe.replace(".","_")}function oa(Qe,dt,It){var lr=Ca(Qe);Bn.push(Qe),Qa[lr]=ba[lr]=!!It,wn[lr]=dt}function la(Qe,dt,It){var lr=Ca(Qe);Bn.push(Qe),Array.isArray(It)?(ba[lr]=It.slice(),Qa[lr]=It.slice()):ba[lr]=Qa[lr]=It,ja[lr]=dt}function Da(Qe){return!!isNaN(Qe)}oa(io,Zr),oa(bs,$r),la(ll,"blendColor",[0,0,0,0]),la(Ul,"blendEquationSeparate",[ci,ci]),la(mu,"blendFuncSeparate",[pi,Or,pi,Or]),oa(Ql,zi,!0),la(gu,"depthFunc",Bi),la(Cl,"depthRange",[0,1]),la(ec,"depthMask",!0),la($u,$u,[!0,!0,!0,!0]),oa(xu,Lr),la(Ho,"cullFace",Ve),la(Is,Is,Pt),la(iu,iu,1),oa(Wl,nn),la(Mc,"polygonOffset",[0,0]),oa(eh,kn),oa(Uc,Jn),la(Hh,"sampleCoverage",[1,!1]),oa(th,di),la(Vh,"stencilMask",-1),la(Wu,"stencilFunc",[fr,0,-1]),la(Wh,"stencilOpSeparate",[Me,cr,cr,cr]),la(cs,"stencilOpSeparate",[Ve,cr,cr,cr]),oa(Fs,Ki),la(rh,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),la(tc,tc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var $o={gl:St,context:Ka,strings:Pr,next:Qa,current:ba,draw:no,elements:xn,buffer:Cn,shader:La,attributes:ia.state,vao:ia,uniforms:ua,framebuffer:Tn,extensions:Nr,timer:da,isBufferArgs:Zn},Io={primTypes:Mn,compareFuncs:ln,blendFuncs:ta,blendEquations:Kn,stencilOps:On,glTypes:un,orientationType:Un};bn&&(Io.backBuffer=[Ve],Io.drawBuffer=p(en.maxDrawbuffers,function(Qe){return Qe===0?[0]:p(Qe,function(dt){return Qi+dt})}));var Ia=0;function qa(){var Qe=Za({cache:Nn}),dt=Qe.link,It=Qe.global;Qe.id=Ia++,Qe.batchId="0";var lr=dt($o),Qt=Qe.shared={props:"a0"};Object.keys($o).forEach(function(tr){Qt[tr]=It.def(lr,".",tr)});var ar=Qe.next={},pr=Qe.current={};Object.keys(ja).forEach(function(tr){Array.isArray(ba[tr])&&(ar[tr]=It.def(Qt.next,".",tr),pr[tr]=It.def(Qt.current,".",tr))});var yr=Qe.constants={};Object.keys(Io).forEach(function(tr){yr[tr]=It.def(JSON.stringify(Io[tr]))}),Qe.invoke=function(tr,Xt){switch(Xt.type){case fa:var Fr=["this",Qt.context,Qt.props,Qe.batchId];return tr.def(dt(Xt.data),".call(",Fr.slice(0,Math.max(Xt.data.length+1,4)),")");case vo:return tr.def(Qt.props,Xt.data);case hs:return tr.def(Qt.context,Xt.data);case rs:return tr.def("this",Xt.data);case ps:return Xt.data.append(Qe,tr),Xt.data.ref;case xs:return Xt.data.toString();case _o:return Xt.data.map(function(xi){return Qe.invoke(tr,xi)})}},Qe.attribCache={};var qt={};return Qe.scopeAttrib=function(tr){var Xt=Pr.id(tr);if(Xt in qt)return qt[Xt];var Fr=ia.scope[Xt];Fr||(Fr=ia.scope[Xt]=new on);var xi=qt[Xt]=dt(Fr);return xi},Qe}function Co(Qe){var dt=Qe.static,It=Qe.dynamic,lr;if(od in dt){var Qt=!!dt[od];lr=to(function(pr,yr){return Qt}),lr.enable=Qt}else if(od in It){var ar=It[od];lr=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}return lr}function Ro(Qe,dt){var It=Qe.static,lr=Qe.dynamic;if(Ke in It){var Qt=It[Ke];return Qt?(Qt=Tn.getFramebuffer(Qt),to(function(pr,yr){var qt=pr.link(Qt),tr=pr.shared;yr.set(tr.framebuffer,".next",qt);var Xt=tr.context;return yr.set(Xt,"."+Vr,qt+".width"),yr.set(Xt,"."+ki,qt+".height"),qt})):to(function(pr,yr){var qt=pr.shared;yr.set(qt.framebuffer,".next","null");var tr=qt.context;return yr.set(tr,"."+Vr,tr+"."+Tt),yr.set(tr,"."+ki,tr+"."+Lt),"null"})}else if(Ke in lr){var ar=lr[Ke];return yo(ar,function(pr,yr){var qt=pr.invoke(yr,ar),tr=pr.shared,Xt=tr.framebuffer,Fr=yr.def(Xt,".getFramebuffer(",qt,")");yr.set(Xt,".next",Fr);var xi=tr.context;return yr.set(xi,"."+Vr,Fr+"?"+Fr+".width:"+xi+"."+Tt),yr.set(xi,"."+ki,Fr+"?"+Fr+".height:"+xi+"."+Lt),Fr})}else return null}function us(Qe,dt,It){var lr=Qe.static,Qt=Qe.dynamic;function ar(qt){if(qt in lr){var tr=lr[qt],Xt=!0,Fr=tr.x|0,xi=tr.y|0,Li,Pn;return"width"in tr?Li=tr.width|0:Xt=!1,"height"in tr?Pn=tr.height|0:Xt=!1,new gn(!Xt&&dt&&dt.thisDep,!Xt&&dt&&dt.contextDep,!Xt&&dt&&dt.propDep,function(Hn,In){var ca=Hn.shared.context,$n=Li;"width"in tr||($n=In.def(ca,".",Vr,"-",Fr));var Vn=Pn;return"height"in tr||(Vn=In.def(ca,".",ki,"-",xi)),[Fr,xi,$n,Vn]})}else if(qt in Qt){var An=Qt[qt],mn=yo(An,function(Hn,In){var ca=Hn.invoke(In,An),$n=Hn.shared.context,Vn=In.def(ca,".x|0"),va=In.def(ca,".y|0"),po=In.def('"width" in ',ca,"?",ca,".width|0:","(",$n,".",Vr,"-",Vn,")"),To=In.def('"height" in ',ca,"?",ca,".height|0:","(",$n,".",ki,"-",va,")");return[Vn,va,po,To]});return dt&&(mn.thisDep=mn.thisDep||dt.thisDep,mn.contextDep=mn.contextDep||dt.contextDep,mn.propDep=mn.propDep||dt.propDep),mn}else return dt?new gn(dt.thisDep,dt.contextDep,dt.propDep,function(Hn,In){var ca=Hn.shared.context;return[0,0,In.def(ca,".",Vr),In.def(ca,".",ki)]}):null}var pr=ar(tc);if(pr){var yr=pr;pr=new gn(pr.thisDep,pr.contextDep,pr.propDep,function(qt,tr){var Xt=yr.append(qt,tr),Fr=qt.shared.context;return tr.set(Fr,"."+Vi,Xt[2]),tr.set(Fr,"."+tt,Xt[3]),Xt})}return{viewport:pr,scissor_box:ar(rh)}}function Kl(Qe,dt){var It=Qe.static,lr=typeof It[pe]=="string"&&typeof It[O]=="string";if(lr){if(Object.keys(dt.dynamic).length>0)return null;var Qt=dt.static,ar=Object.keys(Qt);if(ar.length>0&&typeof Qt[ar[0]]=="number"){for(var pr=[],yr=0;yr"+Vn+"?"+Xt+".constant["+Vn+"]:0;"}).join(""),"}}else{","if(",Li,"(",Xt,".buffer)){",Hn,"=",Pn,".createStream(",Nt,",",Xt,".buffer);","}else{",Hn,"=",Pn,".getBuffer(",Xt,".buffer);","}",In,'="type" in ',Xt,"?",xi.glTypes,"[",Xt,".type]:",Hn,".dtype;",An.normalized,"=!!",Xt,".normalized;");function ca($n){tr(An[$n],"=",Xt,".",$n,"|0;")}return ca("size"),ca("offset"),ca("stride"),ca("divisor"),tr("}}"),tr.exit("if(",An.isStream,"){",Pn,".destroyStream(",Hn,");","}"),An}Qt[ar]=yo(pr,yr)}),Qt}function kc(Qe){var dt=Qe.static,It=Qe.dynamic,lr={};return Object.keys(dt).forEach(function(Qt){var ar=dt[Qt];lr[Qt]=to(function(pr,yr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:pr.link(ar)})}),Object.keys(It).forEach(function(Qt){var ar=It[Qt];lr[Qt]=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}),lr}function Ec(Qe,dt,It,lr,Qt){Qe.static,Qe.dynamic;var ar=Kl(Qe,dt),pr=Ro(Qe),yr=us(Qe,pr),qt=gs(Qe),tr=Pu(Qe),Xt=zl(Qe,Qt,ar);function Fr(Hn){var In=yr[Hn];In&&(tr[Hn]=In)}Fr(tc),Fr(Ca(rh));var xi=Object.keys(tr).length>0,Li={framebuffer:pr,draw:qt,shader:Xt,state:tr,dirty:xi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Li.profile=Co(Qe),Li.uniforms=kl(It),Li.drawVAO=Li.scopeVAO=qt.vao,!Li.drawVAO&&Xt.program&&!ar&&Nr.angle_instanced_arrays&&qt.static.elements){var Pn=!0,An=Xt.program.attributes.map(function(Hn){var In=dt.static[Hn];return Pn=Pn&&!!In,In});if(Pn&&An.length>0){var mn=ia.getVAO(ia.createVAO({attributes:An,elements:qt.static.elements}));Li.drawVAO=new gn(null,null,null,function(Hn,In){return Hn.link(mn)}),Li.useVAO=!0}}return ar?Li.useVAO=!0:Li.attributes=Fu(dt),Li.context=kc(lr),Li}function Au(Qe,dt,It){var lr=Qe.shared,Qt=lr.context,ar=Qe.scope();Object.keys(It).forEach(function(pr){dt.save(Qt,"."+pr);var yr=It[pr],qt=yr.append(Qe,dt);Array.isArray(qt)?ar(Qt,".",pr,"=[",qt.join(),"];"):ar(Qt,".",pr,"=",qt,";")}),dt(ar)}function wu(Qe,dt,It,lr){var Qt=Qe.shared,ar=Qt.gl,pr=Qt.framebuffer,yr;bn&&(yr=dt.def(Qt.extensions,".webgl_draw_buffers"));var qt=Qe.constants,tr=qt.drawBuffer,Xt=qt.backBuffer,Fr;It?Fr=It.append(Qe,dt):Fr=dt.def(pr,".next"),lr||dt("if(",Fr,"!==",pr,".cur){"),dt("if(",Fr,"){",ar,".bindFramebuffer(",Yi,",",Fr,".framebuffer);"),bn&&dt(yr,".drawBuffersWEBGL(",tr,"[",Fr,".colorAttachments.length]);"),dt("}else{",ar,".bindFramebuffer(",Yi,",null);"),bn&&dt(yr,".drawBuffersWEBGL(",Xt,");"),dt("}",pr,".cur=",Fr,";"),lr||dt("}")}function Iu(Qe,dt,It){var lr=Qe.shared,Qt=lr.gl,ar=Qe.current,pr=Qe.next,yr=lr.current,qt=lr.next,tr=Qe.cond(yr,".dirty");Bn.forEach(function(Xt){var Fr=Ca(Xt);if(!(Fr in It.state)){var xi,Li;if(Fr in pr){xi=pr[Fr],Li=ar[Fr];var Pn=p(ba[Fr].length,function(mn){return tr.def(xi,"[",mn,"]")});tr(Qe.cond(Pn.map(function(mn,Hn){return mn+"!=="+Li+"["+Hn+"]"}).join("||")).then(Qt,".",ja[Fr],"(",Pn,");",Pn.map(function(mn,Hn){return Li+"["+Hn+"]="+mn}).join(";"),";"))}else{xi=tr.def(qt,".",Fr);var An=Qe.cond(xi,"!==",yr,".",Fr);tr(An),Fr in wn?An(Qe.cond(xi).then(Qt,".enable(",wn[Fr],");").else(Qt,".disable(",wn[Fr],");"),yr,".",Fr,"=",xi,";"):An(Qt,".",ja[Fr],"(",xi,");",yr,".",Fr,"=",xi,";")}}}),Object.keys(It.state).length===0&&tr(yr,".dirty=false;"),dt(tr)}function Zo(Qe,dt,It,lr){var Qt=Qe.shared,ar=Qe.current,pr=Qt.current,yr=Qt.gl,qt;aa(Object.keys(It)).forEach(function(tr){var Xt=It[tr];if(!(lr&&!lr(Xt))){var Fr=Xt.append(Qe,dt);if(wn[tr]){var xi=wn[tr];Ja(Xt)?(qt=Qe.link(Fr,{stable:!0}),dt(Qe.cond(qt).then(yr,".enable(",xi,");").else(yr,".disable(",xi,");")),dt(pr,".",tr,"=",qt,";")):(dt(Qe.cond(Fr).then(yr,".enable(",xi,");").else(yr,".disable(",xi,");")),dt(pr,".",tr,"=",Fr,";"))}else if(Zi(Fr)){var Li=ar[tr];dt(yr,".",ja[tr],"(",Fr,");",Fr.map(function(Pn,An){return Li+"["+An+"]="+Pn}).join(";"),";")}else Ja(Xt)?(qt=Qe.link(Fr,{stable:!0}),dt(yr,".",ja[tr],"(",qt,");",pr,".",tr,"=",qt,";")):dt(yr,".",ja[tr],"(",Fr,");",pr,".",tr,"=",Fr,";")}})}function Du(Qe,dt){Fn&&(Qe.instancing=dt.def(Qe.shared.extensions,".angle_instanced_arrays"))}function vl(Qe,dt,It,lr,Qt){var ar=Qe.shared,pr=Qe.stats,yr=ar.current,qt=ar.timer,tr=It.profile;function Xt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Fr,xi;function Li(ca){Fr=dt.def(),ca(Fr,"=",Xt(),";"),typeof Qt=="string"?ca(pr,".count+=",Qt,";"):ca(pr,".count++;"),da&&(lr?(xi=dt.def(),ca(xi,"=",qt,".getNumPendingQueries();")):ca(qt,".beginQuery(",pr,");"))}function Pn(ca){ca(pr,".cpuTime+=",Xt(),"-",Fr,";"),da&&(lr?ca(qt,".pushScopeStats(",xi,",",qt,".getNumPendingQueries(),",pr,");"):ca(qt,".endQuery();"))}function An(ca){var $n=dt.def(yr,".profile");dt(yr,".profile=",ca,";"),dt.exit(yr,".profile=",$n,";")}var mn;if(tr){if(Ja(tr)){tr.enable?(Li(dt),Pn(dt.exit),An("true")):An("false");return}mn=tr.append(Qe,dt),An(mn)}else mn=dt.def(yr,".profile");var Hn=Qe.block();Li(Hn),dt("if(",mn,"){",Hn,"}");var In=Qe.block();Pn(In),dt.exit("if(",mn,"){",In,"}")}function Nu(Qe,dt,It,lr,Qt){var ar=Qe.shared;function pr(qt){switch(qt){case wa:case Bo:case Us:return 2;case Ba:case _s:case Pl:return 3;case xo:case wl:case Ru:return 4;default:return 1}}function yr(qt,tr,Xt){var Fr=ar.gl,xi=dt.def(qt,".location"),Li=dt.def(ar.attributes,"[",xi,"]"),Pn=Xt.state,An=Xt.buffer,mn=[Xt.x,Xt.y,Xt.z,Xt.w],Hn=["buffer","normalized","offset","stride"];function In(){dt("if(!",Li,".buffer){",Fr,".enableVertexAttribArray(",xi,");}");var $n=Xt.type,Vn;if(Xt.size?Vn=dt.def(Xt.size,"||",tr):Vn=tr,dt("if(",Li,".type!==",$n,"||",Li,".size!==",Vn,"||",Hn.map(function(po){return Li+"."+po+"!=="+Xt[po]}).join("||"),"){",Fr,".bindBuffer(",Nt,",",An,".buffer);",Fr,".vertexAttribPointer(",[xi,Vn,$n,Xt.normalized,Xt.stride,Xt.offset],");",Li,".type=",$n,";",Li,".size=",Vn,";",Hn.map(function(po){return Li+"."+po+"="+Xt[po]+";"}).join(""),"}"),Fn){var va=Xt.divisor;dt("if(",Li,".divisor!==",va,"){",Qe.instancing,".vertexAttribDivisorANGLE(",[xi,va],");",Li,".divisor=",va,";}")}}function ca(){dt("if(",Li,".buffer){",Fr,".disableVertexAttribArray(",xi,");",Li,".buffer=null;","}if(",ao.map(function($n,Vn){return Li+"."+$n+"!=="+mn[Vn]}).join("||"),"){",Fr,".vertexAttrib4f(",xi,",",mn,");",ao.map(function($n,Vn){return Li+"."+$n+"="+mn[Vn]+";"}).join(""),"}")}Pn===Va?In():Pn===Oa?ca():(dt("if(",Pn,"===",Va,"){"),In(),dt("}else{"),ca(),dt("}"))}lr.forEach(function(qt){var tr=qt.name,Xt=It.attributes[tr],Fr;if(Xt){if(!Qt(Xt))return;Fr=Xt.append(Qe,dt)}else{if(!Qt(jo))return;var xi=Qe.scopeAttrib(tr);Fr={},Object.keys(new on).forEach(function(Li){Fr[Li]=dt.def(xi,".",Li)})}yr(Qe.link(qt),pr(qt.info.type),Fr)})}function Lc(Qe,dt,It,lr,Qt,ar){for(var pr=Qe.shared,yr=pr.gl,qt,tr=0;tr1){for(var Jo=[],Ts=[],$l=0;$l>1)",An],");")}function va(){It(mn,".drawArraysInstancedANGLE(",[xi,Li,Pn,An],");")}Xt&&Xt!=="null"?In?Vn():(It("if(",Xt,"){"),Vn(),It("}else{"),va(),It("}")):va()}function $n(){function Vn(){It(ar+".drawElements("+[xi,Pn,Hn,Li+"<<(("+Hn+"-"+xa+")>>1)"]+");")}function va(){It(ar+".drawArrays("+[xi,Li,Pn]+");")}Xt&&Xt!=="null"?In?Vn():(It("if(",Xt,"){"),Vn(),It("}else{"),va(),It("}")):va()}Fn&&(typeof An!="number"||An>=0)?typeof An=="string"?(It("if(",An,">0){"),ca(),It("}else if(",An,"<0){"),$n(),It("}")):ca():$n()}function Ds(Qe,dt,It,lr,Qt){var ar=qa(),pr=ar.proc("body",Qt);return Fn&&(ar.instancing=pr.def(ar.shared.extensions,".angle_instanced_arrays")),Qe(ar,pr,It,lr),ar.compile().body}function Ol(Qe,dt,It,lr){Du(Qe,dt),It.useVAO?It.drawVAO?dt(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,dt),");"):dt(Qe.shared.vao,".setVAO(",Qe.shared.vao,".targetVAO);"):(dt(Qe.shared.vao,".setVAO(null);"),Nu(Qe,dt,It,lr.attributes,function(){return!0})),Lc(Qe,dt,It,lr.uniforms,function(){return!0},!1),Fo(Qe,dt,dt,It)}function Ml(Qe,dt){var It=Qe.proc("draw",1);Du(Qe,It),Au(Qe,It,dt.context),wu(Qe,It,dt.framebuffer),Iu(Qe,It,dt),Zo(Qe,It,dt.state),vl(Qe,It,dt,!1,!0);var lr=dt.shader.progVar.append(Qe,It);if(It(Qe.shared.gl,".useProgram(",lr,".program);"),dt.shader.program)Ol(Qe,It,dt,dt.shader.program);else{It(Qe.shared.vao,".setVAO(null);");var Qt=Qe.global.def("{}"),ar=It.def(lr,".id"),pr=It.def(Qt,"[",ar,"]");It(Qe.cond(pr).then(pr,".call(this,a0);").else(pr,"=",Qt,"[",ar,"]=",Qe.link(function(yr){return Ds(Ol,Qe,dt,yr,1)}),"(",lr,");",pr,".call(this,a0);"))}Object.keys(dt.state).length>0&&It(Qe.shared.current,".dirty=true;"),Qe.shared.vao&&It(Qe.shared.vao,".setVAO(null);")}function K(Qe,dt,It,lr){Qe.batchId="a1",Du(Qe,dt);function Qt(){return!0}Nu(Qe,dt,It,lr.attributes,Qt),Lc(Qe,dt,It,lr.uniforms,Qt,!1),Fo(Qe,dt,dt,It)}function le(Qe,dt,It,lr){Du(Qe,dt);var Qt=It.contextDep,ar=dt.def(),pr="a0",yr="a1",qt=dt.def();Qe.shared.props=qt,Qe.batchId=ar;var tr=Qe.scope(),Xt=Qe.scope();dt(tr.entry,"for(",ar,"=0;",ar,"<",yr,";++",ar,"){",qt,"=",pr,"[",ar,"];",Xt,"}",tr.exit);function Fr(Hn){return Hn.contextDep&&Qt||Hn.propDep}function xi(Hn){return!Fr(Hn)}if(It.needsContext&&Au(Qe,Xt,It.context),It.needsFramebuffer&&wu(Qe,Xt,It.framebuffer),Zo(Qe,Xt,It.state,Fr),It.profile&&Fr(It.profile)&&vl(Qe,Xt,It,!1,!0),lr)It.useVAO?It.drawVAO?Fr(It.drawVAO)?Xt(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,Xt),");"):tr(Qe.shared.vao,".setVAO(",It.drawVAO.append(Qe,tr),");"):tr(Qe.shared.vao,".setVAO(",Qe.shared.vao,".targetVAO);"):(tr(Qe.shared.vao,".setVAO(null);"),Nu(Qe,tr,It,lr.attributes,xi),Nu(Qe,Xt,It,lr.attributes,Fr)),Lc(Qe,tr,It,lr.uniforms,xi,!1),Lc(Qe,Xt,It,lr.uniforms,Fr,!0),Fo(Qe,tr,Xt,It);else{var Li=Qe.global.def("{}"),Pn=It.shader.progVar.append(Qe,Xt),An=Xt.def(Pn,".id"),mn=Xt.def(Li,"[",An,"]");Xt(Qe.shared.gl,".useProgram(",Pn,".program);","if(!",mn,"){",mn,"=",Li,"[",An,"]=",Qe.link(function(Hn){return Ds(K,Qe,It,Hn,2)}),"(",Pn,");}",mn,".call(this,a0[",ar,"],",ar,");")}}function ie(Qe,dt){var It=Qe.proc("batch",2);Qe.batchId="0",Du(Qe,It);var lr=!1,Qt=!0;Object.keys(dt.context).forEach(function(Li){lr=lr||dt.context[Li].propDep}),lr||(Au(Qe,It,dt.context),Qt=!1);var ar=dt.framebuffer,pr=!1;ar?(ar.propDep?lr=pr=!0:ar.contextDep&&lr&&(pr=!0),pr||wu(Qe,It,ar)):wu(Qe,It,null),dt.state.viewport&&dt.state.viewport.propDep&&(lr=!0);function yr(Li){return Li.contextDep&&lr||Li.propDep}Iu(Qe,It,dt),Zo(Qe,It,dt.state,function(Li){return!yr(Li)}),(!dt.profile||!yr(dt.profile))&&vl(Qe,It,dt,!1,"a1"),dt.contextDep=lr,dt.needsContext=Qt,dt.needsFramebuffer=pr;var qt=dt.shader.progVar;if(qt.contextDep&&lr||qt.propDep)le(Qe,It,dt,null);else{var tr=qt.append(Qe,It);if(It(Qe.shared.gl,".useProgram(",tr,".program);"),dt.shader.program)le(Qe,It,dt,dt.shader.program);else{It(Qe.shared.vao,".setVAO(null);");var Xt=Qe.global.def("{}"),Fr=It.def(tr,".id"),xi=It.def(Xt,"[",Fr,"]");It(Qe.cond(xi).then(xi,".call(this,a0,a1);").else(xi,"=",Xt,"[",Fr,"]=",Qe.link(function(Li){return Ds(le,Qe,dt,Li,2)}),"(",tr,");",xi,".call(this,a0,a1);"))}}Object.keys(dt.state).length>0&&It(Qe.shared.current,".dirty=true;"),Qe.shared.vao&&It(Qe.shared.vao,".setVAO(null);")}function we(Qe,dt){var It=Qe.proc("scope",3);Qe.batchId="a2";var lr=Qe.shared,Qt=lr.current;if(Au(Qe,It,dt.context),dt.framebuffer&&dt.framebuffer.append(Qe,It),aa(Object.keys(dt.state)).forEach(function(yr){var qt=dt.state[yr],tr=qt.append(Qe,It);Zi(tr)?tr.forEach(function(Xt,Fr){Da(Xt)?It.set(Qe.next[yr],"["+Fr+"]",Xt):It.set(Qe.next[yr],"["+Fr+"]",Qe.link(Xt,{stable:!0}))}):Ja(qt)?It.set(lr.next,"."+yr,Qe.link(tr,{stable:!0})):It.set(lr.next,"."+yr,tr)}),vl(Qe,It,dt,!0,!0),[Ie,Mt,qe,jt,Ne].forEach(function(yr){var qt=dt.draw[yr];if(qt){var tr=qt.append(Qe,It);Da(tr)?It.set(lr.draw,"."+yr,tr):It.set(lr.draw,"."+yr,Qe.link(tr),{stable:!0})}}),Object.keys(dt.uniforms).forEach(function(yr){var qt=dt.uniforms[yr].append(Qe,It);Array.isArray(qt)&&(qt="["+qt.map(function(tr){return Da(tr)?tr:Qe.link(tr,{stable:!0})})+"]"),It.set(lr.uniforms,"["+Qe.link(Pr.id(yr),{stable:!0})+"]",qt)}),Object.keys(dt.attributes).forEach(function(yr){var qt=dt.attributes[yr].append(Qe,It),tr=Qe.scopeAttrib(yr);Object.keys(new on).forEach(function(Xt){It.set(tr,"."+Xt,qt[Xt])})}),dt.scopeVAO){var ar=dt.scopeVAO.append(Qe,It);Da(ar)?It.set(lr.vao,".targetVAO",ar):It.set(lr.vao,".targetVAO",Qe.link(ar,{stable:!0}))}function pr(yr){var qt=dt.shader[yr];if(qt){var tr=qt.append(Qe,It);Da(tr)?It.set(lr.shader,"."+yr,tr):It.set(lr.shader,"."+yr,Qe.link(tr,{stable:!0}))}}pr(O),pr(pe),Object.keys(dt.state).length>0&&(It(Qt,".dirty=true;"),It.exit(Qt,".dirty=true;")),It("a1(",Qe.shared.context,",a0,",Qe.batchId,");")}function We(Qe){if(!(typeof Qe!="object"||Zi(Qe))){for(var dt=Object.keys(Qe),It=0;It=0;--Fo){var Ds=Da[Fo];Ds&&Ds(da,null,0)}Nr.flush(),ia&&ia.update()}function Ro(){!qa&&Da.length>0&&(qa=b.next(Co))}function us(){qa&&(b.cancel(Co),qa=null)}function Kl(Fo){Fo.preventDefault(),us(),$o.forEach(function(Ds){Ds()})}function zl(Fo){Nr.getError(),Cn.restore(),ba.restore(),Kn.restore(),Qa.restore(),Bn.restore(),wn.restore(),bn.restore(),ia&&ia.restore(),ja.procs.refresh(),Ro(),Io.forEach(function(Ds){Ds()})}la&&(la.addEventListener(fl,Kl,!1),la.addEventListener(vu,zl,!1));function gs(){Da.length=0,us(),la&&(la.removeEventListener(fl,Kl),la.removeEventListener(vu,zl)),ba.clear(),wn.clear(),Bn.clear(),bn.clear(),Qa.clear(),Fn.clear(),Kn.clear(),ia&&ia.clear(),Ia.forEach(function(Fo){Fo()})}function Pu(Fo){function Ds(Qt){var ar=d({},Qt);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function pr(yr){if(yr in ar){var qt=ar[yr];delete ar[yr],Object.keys(qt).forEach(function(tr){ar[yr+"."+tr]=qt[tr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in Qt&&(ar.vao=Qt.vao),ar}function Ol(Qt,ar){var pr={},yr={};return Object.keys(Qt).forEach(function(qt){var tr=Qt[qt];if(m.isDynamic(tr)){yr[qt]=m.unbox(tr,qt);return}else if(ar&&Array.isArray(tr)){for(var Xt=0;Xt0)return wt.call(this,It(Qt|0),Qt|0)}else if(Array.isArray(Qt)){if(Qt.length)return wt.call(this,Qt,Qt.length)}else return mt.call(this,Qt)}return d(lr,{stats:we,destroy:function(){We.destroy()}})}var kl=wn.setFBO=Pu({framebuffer:m.define.call(null,nu,"framebuffer")});function Fu(Fo,Ds){var Ol=0;ja.procs.poll();var Ml=Ds.color;Ml&&(Nr.clearColor(+Ml[0]||0,+Ml[1]||0,+Ml[2]||0,+Ml[3]||0),Ol|=ac),"depth"in Ds&&(Nr.clearDepth(+Ds.depth),Ol|=bu),"stencil"in Ds&&(Nr.clearStencil(Ds.stencil|0),Ol|=Eo),Nr.clear(Ol)}function kc(Fo){if("framebuffer"in Fo)if(Fo.framebuffer&&Fo.framebuffer_reglType==="framebufferCube")for(var Ds=0;Ds<6;++Ds)kl(d({framebuffer:Fo.framebuffer.faces[Ds]},Fo),Fu);else kl(Fo,Fu);else Fu(null,Fo)}function Ec(Fo){Da.push(Fo);function Ds(){var Ol=cu(Da,Fo);function Ml(){var K=cu(Da,Ml);Da[K]=Da[Da.length-1],Da.length-=1,Da.length<=0&&us()}Da[Ol]=Ml}return Ro(),{cancel:Ds}}function Au(){var Fo=oa.viewport,Ds=oa.scissor_box;Fo[0]=Fo[1]=Ds[0]=Ds[1]=0,da.viewportWidth=da.framebufferWidth=da.drawingBufferWidth=Fo[2]=Ds[2]=Nr.drawingBufferWidth,da.viewportHeight=da.framebufferHeight=da.drawingBufferHeight=Fo[3]=Ds[3]=Nr.drawingBufferHeight}function wu(){da.tick+=1,da.time=Zo(),Au(),ja.procs.poll()}function Iu(){Qa.refresh(),Au(),ja.procs.refresh(),ia&&ia.update()}function Zo(){return(x()-La)/1e3}Iu();function Du(Fo,Ds){var Ol;switch(Fo){case"frame":return Ec(Ds);case"lost":Ol=$o;break;case"restore":Ol=Io;break;case"destroy":Ol=Ia;break}return Ol.push(Ds),{cancel:function(){for(var Ml=0;Ml=0},read:Ca,destroy:gs,_gl:Nr,_refresh:Iu,poll:function(){wu(),ia&&ia.update()},now:Zo,stats:Oi,getCachedCode:vl,preloadCachedCode:Nu});return Pr.onDone(null,Lc),Lc}return zh})}),aA=Fe((te,Y)=>{var d=tD(),y=QJ();Y.exports=function(z,P,i){var n=z._fullLayout,a=!0;return n._glcanvas.each(function(l){if(l.regl){l.regl.preloadCachedCode(i);return}if(!(l.pick&&!n._has("parcoords"))){try{l.regl=y({canvas:this,attributes:{antialias:!l.pick,preserveDrawingBuffer:!0},pixelRatio:z._context.plotGlPixelRatio||window.devicePixelRatio,extensions:P||[],cachedCode:i||{}})}catch{a=!1}l.regl||(a=!1),a&&this.addEventListener("webglcontextlost",function(o){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:o,layer:l.key})},!1)}}),a||d({container:n._glcontainer.node()}),a}}),WD=Fe((m,Y)=>{var d=kD(),y=OD(),z=BJ(),P=JJ(),i=ji(),n=dm().selectMode,a=aA(),l=Oc(),o=Xa(),u=xD().styleTextSelection,s={};function h(b,x,_,A){var f=b._size,k=b.width*A,w=b.height*A,D=f.l*A,E=f.b*A,I=f.r*A,M=f.t*A,p=f.w*A,g=f.h*A;return[D+x.domain[0]*p,E+_.domain[0]*g,k-I-(1-x.domain[1])*p,w-M-(1-_.domain[1])*g]}var m=Y.exports=function(b,x,_){if(_.length){var A=b._fullLayout,f=x._scene,k=x.xaxis,w=x.yaxis,D,E;if(f){var I=a(b,["ANGLE_instanced_arrays","OES_element_index_uint"],s);if(!I){f.init();return}var M=f.count,p=A._glcanvas.data()[0].regl;if(o(b,x,_),f.dirty){if((f.line2d||f.error2d)&&!(f.scatter2d||f.fill2d||f.glText)&&p.clear({color:!0,depth:!0}),f.error2d===!0&&(f.error2d=z(p)),f.line2d===!0&&(f.line2d=y(p)),f.scatter2d===!0&&(f.scatter2d=d(p)),f.fill2d===!0&&(f.fill2d=y(p)),f.glText===!0)for(f.glText=new Array(M),D=0;Df.glText.length){var g=M-f.glText.length;for(D=0;Dme&&(isNaN(J[fe])||isNaN(J[fe+1]));)fe-=2;oe.positions=J.slice(me,fe+2)}return oe}),f.line2d.update(f.lineOptions)),f.error2d){var N=(f.errorXOptions||[]).concat(f.errorYOptions||[]);f.error2d.update(N)}f.scatter2d&&f.scatter2d.update(f.markerOptions),f.fillOrder=i.repeat(null,M),f.fill2d&&(f.fillOptions=f.fillOptions.map(function(oe,J){var me=_[J];if(!(!oe||!me||!me[0]||!me[0].trace)){var fe=me[0],Ce=fe.trace,Be=fe.t,Oe=f.lineOptions[J],Ze,Ge,rt=[];Ce._ownfill&&rt.push(J),Ce._nexttrace&&rt.push(J+1),rt.length&&(f.fillOrder[J]=rt);var _t=[],pt=Oe&&Oe.positions||Be.positions,gt,ct;if(Ce.fill==="tozeroy"){for(gt=0;gtgt&&isNaN(pt[ct+1]);)ct-=2;pt[gt+1]!==0&&(_t=[pt[gt],0]),_t=_t.concat(pt.slice(gt,ct+2)),pt[ct+1]!==0&&(_t=_t.concat([pt[ct],0]))}else if(Ce.fill==="tozerox"){for(gt=0;gtgt&&isNaN(pt[ct]);)ct-=2;pt[gt]!==0&&(_t=[0,pt[gt+1]]),_t=_t.concat(pt.slice(gt,ct+2)),pt[ct]!==0&&(_t=_t.concat([0,pt[ct+1]]))}else if(Ce.fill==="toself"||Ce.fill==="tonext"){for(_t=[],Ze=0,oe.splitNull=!0,Ge=0;Ge-1;for(D=0;D{var d=zX();d.plot=WD(),Y.exports=d}),tQ=Fe((te,Y)=>{Y.exports=eQ()}),qD=Fe((te,Y)=>{var d=ff(),y=zc(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=S6(),a=dc().idRegex,l=ku().templatedArray,o=an().extendFlat,u=d.marker,s=u.line,h=o(y("marker.line",{editTypeOverride:"calc"}),{width:o({},s.width,{editType:"calc"}),editType:"calc"}),m=o(y("marker"),{symbol:u.symbol,angle:u.angle,size:o({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:h,editType:"calc"});m.color.editType=m.cmin.editType=m.cmax.editType="style";function b(x){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:a[x],editType:"plot"}}}Y.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:o({},n.text,{}),hovertext:o({},n.hovertext,{}),hovertemplate:P(),hovertemplatefallback:i(),xhoverformat:z("x"),yhoverformat:z("y"),marker:m,xaxes:b("x"),yaxes:b("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:n.selected.marker,editType:"calc"},unselected:{marker:n.unselected.marker,editType:"calc"},opacity:n.opacity}}),oA=Fe((te,Y)=>{Y.exports=function(d,y,z,P){P||(P=1/0);var i,n;for(i=0;i{var d=ji(),y=Gd(),z=qD(),P=Oc(),i=X0(),n=oA(),a=QC().isOpenSymbol;Y.exports=function(u,s,h,m){function b(E,I){return d.coerce(u,s,z,E,I)}var x=y(u,s,{name:"dimensions",handleItemDefaults:l}),_=b("diagonal.visible"),A=b("showupperhalf"),f=b("showlowerhalf"),k=n(s,x,"values");if(!k||!_&&!A&&!f){s.visible=!1;return}b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("xhoverformat"),b("yhoverformat"),i(u,s,h,m,b,{noAngleRef:!0,noStandOff:!0});var w=a(s.marker.symbol),D=P.isBubble(s);b("marker.line.width",w||D?1:0),o(u,s,m,b),d.coerceSelectionMarkerOpacity(s,b)};function l(u,s){function h(b,x){return d.coerce(u,s,z.dimensions,b,x)}h("label");var m=h("values");m&&m.length?h("visible"):s.visible=!1,h("axis.type"),h("axis.matches")}function o(u,s,h,m){var b=s.dimensions,x=b.length,_=s.showupperhalf,A=s.showlowerhalf,f=s.diagonal.visible,k,w,D=new Array(x),E=new Array(x);for(k=0;kw&&_||k{var d=ji();Y.exports=function(y,z){var P=y._fullLayout,i=z.uid,n=P._splomScenes;n||(n=P._splomScenes={});var a={dirty:!0,selectBatch:[],unselectBatch:[]},l={matrix:!1,selectBatch:[],unselectBatch:[]},o=n[z.uid];return o||(o=n[i]=d.extendFlat({},a,l),o.draw=function(){o.matrix&&o.matrix.draw&&(o.selectBatch.length||o.unselectBatch.length?o.matrix.draw(o.unselectBatch,o.selectBatch):o.matrix.draw()),o.dirty=!1},o.destroy=function(){o.matrix&&o.matrix.destroy&&o.matrix.destroy(),o.matrixOptions=null,o.selectBatch=null,o.unselectBatch=null,o=null}),o.dirty||d.extendFlat(o,a),o}}),nQ=Fe((te,Y)=>{var d=ji(),y=Zc(),z=yt().calcMarkerSize,P=yt().calcAxisExpansion,i=zm(),n=Ib().markerSelection,a=Ib().markerStyle,l=iQ(),o=ti().BADNUM,u=$_().TOO_MANY_POINTS;Y.exports=function(s,h){var m=h.dimensions,b=h._length,x={},_=x.cdata=[],A=x.data=[],f=h._visibleDims=[],k,w,D,E,I;function M(N,B){for(var U=N.makeCalcdata({v:B.values,vcalendar:h.calendar},"v"),V=0;Vu,C;for(g?C=x.sizeAvg||Math.max(x.size,3):C=z(h,b),w=0;w{(function(){var d,y,z,P,i,n;typeof performance<"u"&&performance!==null&&performance.now?Y.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Y.exports=function(){return(d()-i)/1e6},y=process.hrtime,d=function(){var a;return a=y(),a[0]*1e9+a[1]},P=d(),n=process.uptime()*1e9,i=P-n):Date.now?(Y.exports=function(){return Date.now()-z},z=Date.now()):(Y.exports=function(){return new Date().getTime()-z},z=new Date().getTime())}).call(te)}),oQ=Fe((te,Y)=>{var d=aQ(),y=window,z=["moz","webkit"],P="AnimationFrame",i=y["request"+P],n=y["cancel"+P]||y["cancelRequest"+P];for(a=0;!i&&a{Y.exports=function(d,y){var z=typeof d=="number",P=typeof y=="number";z&&!P?(y=d,d=0):!z&&!P&&(d=0,y=0),d=d|0,y=y|0;var i=y-d;if(i<0)throw new Error("array length must be positive");for(var n=new Array(i),a=0,l=d;a{var d=kD(),y=e1(),z=Lb(),P=oQ(),i=sQ(),n=Ww(),a=Pb();Y.exports=l;function l(h,m){if(!(this instanceof l))return new l(h);this.traces=[],this.passes={},this.regl=h,this.scatter=d(h),this.canvas=this.scatter.canvas}l.prototype.render=function(...h){return h.length&&this.update(...h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=P(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,P(()=>{this.dirty=!1})),this)},l.prototype.update=function(...h){if(!h.length)return;for(let x=0;xT||!_.lower&&C{m[A+k]=x})}this.scatter.draw(...m)}return this},l.prototype.destroy=function(){return this.traces.forEach(h=>{h.buffer&&h.buffer.destroy&&h.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function o(h,m,b){let x=h.id!=null?h.id:h,_=m,A=b;return x<<16|(_&255)<<8|A&255}function u(h,m,b){let x,_,A,f,k=h[m],w=h[b];return k.length>2?(k[0],k[2],x=k[1],_=k[3]):k.length?(x=k[0],_=k[1]):(k.x,x=k.y,k.x+k.width,_=k.y+k.height),w.length>2?(A=w[0],f=w[2],w[1],w[3]):w.length?(A=w[0],f=w[1]):(A=w.x,w.y,f=w.x+w.width,w.y+w.height),[A,x,f,_]}function s(h){if(typeof h=="number")return[h,h,h,h];if(h.length===2)return[h[0],h[1],h[0],h[1]];{let m=n(h);return[m.x,m.y,m.x+m.width,m.y+m.height]}}}),uQ=Fe((te,Y)=>{var d=lQ(),y=ji(),z=Zc(),P=dm().selectMode;Y.exports=function(n,a,l){if(l.length)for(var o=0;o-1,W=P(_)||!!u.selectedpoints||V,F=!0;if(W){var $=u._length;if(u.selectedpoints){h.selectBatch=u.selectedpoints;var q=u.selectedpoints,G={};for(k=0;k{te.getDimIndex=function(Y,d){for(var y=d._id,z=y.charAt(0),P={x:0,y:1}[z],i=Y._visibleDims,n=0;n{var d=GD(),y=JC().calcHover,z=Os().getFromId,P=an().extendFlat;function i(a,l,o,u,s){s||(s={});var h=(u||"").charAt(0)==="x",m=(u||"").charAt(0)==="y",b=n(a,l,o);if((h||m)&&s.hoversubplots==="axis"&&b[0])for(var x=(h?a.xa:a.ya)._subplotsWith,_=s.gd,A=P({},a),f=0;f{var d=ji(),y=d.pushUnique,z=Oc(),P=GD();Y.exports=function(i,n){var a=i.cd,l=a[0].trace,o=a[0].t,u=i.scene,s=u.matrixOptions.cdata,h=i.xaxis,m=i.yaxis,b=[];if(!u)return b;var x=!z.hasMarkers(l)&&!z.hasText(l);if(l.visible!==!0||x)return b;var _=P.getDimIndex(l,h),A=P.getDimIndex(l,m);if(_===!1||A===!1)return b;var f=o.xpx[_],k=o.ypx[A],w=s[_],D=s[A],E=(i.scene.selectBatch||[]).slice(),I=[];if(n!==!1&&!n.degenerate)for(var M=0;M{var d=ji(),y=zm(),z=Ib().markerStyle;Y.exports=function(P,i){var n=i.trace,a=P._fullLayout._splomScenes[n.uid];if(a){y(P,n),d.extendFlat(a.matrixOptions,z(P,n));var l=d.extendFlat({},a.matrixOptions,a.viewOpts);a.matrix.update(l,null)}}}),dQ=Fe((te,Y)=>{var d=as(),y=SL();Y.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:qD(),supplyDefaults:rQ(),colorbar:Mo(),calc:nQ(),plot:uQ(),hoverPoints:cQ().hoverPoints,selectPoints:hQ(),editStyle:fQ(),meta:{}},d.register(y)}),pQ=Fe((te,Y)=>{var d=OD(),y=as(),z=aA(),P=Md().getModuleCalcData,i=Rf(),n=Zc().getFromId,a=Os().shouldShowZeroLine,l="splom",o={};function u(_){var A=_._fullLayout,f=y.getModule(l),k=P(_.calcdata,f)[0],w=z(_,["ANGLE_instanced_arrays","OES_element_index_uint"],o);w&&(A._hasOnlyLargeSploms&&m(_),f.plot(_,{},k))}function s(_){var A=_.calcdata,f=_._fullLayout;f._hasOnlyLargeSploms&&m(_);for(var k=0;k{var d=dQ();d.basePlotModule=pQ(),Y.exports=d}),gQ=Fe((te,Y)=>{Y.exports=mQ()}),ZD=Fe((te,Y)=>{var d=zc(),y=qd(),z=zn(),P=Xh().attributes,i=an().extendFlat,n=ku().templatedArray;Y.exports={domain:P({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:z({editType:"plot"}),tickfont:z({autoShadowDflt:!0,editType:"plot"}),rangefont:z({editType:"plot"}),dimensions:n("dimension",{label:{valType:"string",editType:"plot"},tickvals:i({},y.tickvals,{editType:"plot"}),ticktext:i({},y.ticktext,{editType:"plot"}),tickformat:i({},y.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:i({editType:"calc"},d("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),E6=Fe((te,Y)=>{Y.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),t1=Fe((te,Y)=>{var d=__();function y(z){return[z]}Y.exports={keyFun:function(z){return z.key},repeat:y,descend:d,wrap:y,unwrap:function(z){return z[0]}}}),KD=Fe((te,Y)=>{var d=E6(),y=ii(),z=t1().keyFun,P=t1().repeat,i=ji().sorterAsc,n=ji().strTranslate,a=d.bar.snapRatio;function l(G,ee){return G*(1-a)+ee*a}var o=d.bar.snapClose;function u(G,ee){return G*(1-o)+ee*o}function s(G,ee,he,xe){if(h(he,xe))return he;var ve=G?-1:1,ce=0,re=ee.length-1;if(ve<0){var ge=ce;ce=re,re=ge}for(var ne=ee[ce],se=ne,_e=ce;ve*_e=ee[he][0]&&G<=ee[he][1])return!0;return!1}function m(G){G.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function b(G){G.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function x(G){if(!G.brush.filterSpecified)return"0,"+G.height;for(var ee=_(G.brush.filter.getConsolidated(),G.height),he=[0],xe,ve,ce,re=ee.length?ee[0][0]:null,ge=0;geG[1]+he||ee=.9*G[1]+.1*G[0]?"n":ee<=.9*G[0]+.1*G[1]?"s":"ns"}function f(){y.select(document.body).style("cursor",null)}function k(G){G.attr("stroke-dasharray",x)}function w(G,ee){var he=y.select(G).selectAll(".highlight, .highlight-shadow"),xe=ee?he.transition().duration(d.bar.snapDuration).each("end",ee):he;k(xe)}function D(G,ee){var he=G.brush,xe=he.filterSpecified,ve=NaN,ce={},re;if(xe){var ge=G.height,ne=he.filter.getConsolidated(),se=_(ne,ge),_e=NaN,oe=NaN,J=NaN;for(re=0;re<=se.length;re++){var me=se[re];if(me&&me[0]<=ee&&ee<=me[1]){_e=re;break}else if(oe=re?re-1:NaN,me&&me[0]>ee){J=re;break}}if(ve=_e,isNaN(ve)&&(isNaN(oe)||isNaN(J)?ve=isNaN(oe)?J:oe:ve=ee-se[oe][1]=Ze[0]&&Oe<=Ze[1]){ce.clickableOrdinalRange=Ze;break}}}return ce}function E(G,ee){y.event.sourceEvent.stopPropagation();var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,xe=ee.unitToPaddedPx.invert(he),ve=ee.brush,ce=D(ee,he),re=ce.interval,ge=ve.svgBrush;if(ge.wasDragged=!1,ge.grabbingBar=ce.region==="ns",ge.grabbingBar){var ne=re.map(ee.unitToPaddedPx);ge.grabPoint=he-ne[0]-d.verticalPadding,ge.barLength=ne[1]-ne[0]}ge.clickableOrdinalRange=ce.clickableOrdinalRange,ge.stayingIntervals=ee.multiselect&&ve.filterSpecified?ve.filter.getConsolidated():[],re&&(ge.stayingIntervals=ge.stayingIntervals.filter(function(se){return se[0]!==re[0]&&se[1]!==re[1]})),ge.startExtent=ce.region?re[ce.region==="s"?1:0]:xe,ee.parent.inBrushDrag=!0,ge.brushStartCallback()}function I(G,ee){y.event.sourceEvent.stopPropagation();var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,xe=ee.brush.svgBrush;xe.wasDragged=!0,xe._dragging=!0,xe.grabbingBar?xe.newExtent=[he-xe.grabPoint,he+xe.barLength-xe.grabPoint].map(ee.unitToPaddedPx.invert):xe.newExtent=[xe.startExtent,ee.unitToPaddedPx.invert(he)].sort(i),ee.brush.filterSpecified=!0,xe.extent=xe.stayingIntervals.concat([xe.newExtent]),xe.brushCallback(ee),w(G.parentNode)}function M(G,ee){var he=ee.brush,xe=he.filter,ve=he.svgBrush;ve._dragging||(p(G,ee),I(G,ee),ee.brush.svgBrush.wasDragged=!1),ve._dragging=!1;var ce=y.event;ce.sourceEvent.stopPropagation();var re=ve.grabbingBar;if(ve.grabbingBar=!1,ve.grabLocation=void 0,ee.parent.inBrushDrag=!1,f(),!ve.wasDragged){ve.wasDragged=void 0,ve.clickableOrdinalRange?he.filterSpecified&&ee.multiselect?ve.extent.push(ve.clickableOrdinalRange):(ve.extent=[ve.clickableOrdinalRange],he.filterSpecified=!0):re?(ve.extent=ve.stayingIntervals,ve.extent.length===0&&U(he)):U(he),ve.brushCallback(ee),w(G.parentNode),ve.brushEndCallback(he.filterSpecified?xe.getConsolidated():[]);return}var ge=function(){xe.set(xe.getConsolidated())};if(ee.ordinal){var ne=ee.unitTickvals;ne[ne.length-1]ve.newExtent[0];ve.extent=ve.stayingIntervals.concat(se?[ve.newExtent]:[]),ve.extent.length||U(he),ve.brushCallback(ee),se?w(G.parentNode,ge):(ge(),w(G.parentNode))}else ge();ve.brushEndCallback(he.filterSpecified?xe.getConsolidated():[])}function p(G,ee){var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,xe=D(ee,he),ve="crosshair";xe.clickableOrdinalRange?ve="pointer":xe.region&&(ve=xe.region+"-resize"),y.select(document.body).style("cursor",ve)}function g(G){G.on("mousemove",function(ee){y.event.preventDefault(),ee.parent.inBrushDrag||p(this,ee)}).on("mouseleave",function(ee){ee.parent.inBrushDrag||f()}).call(y.behavior.drag().on("dragstart",function(ee){E(this,ee)}).on("drag",function(ee){I(this,ee)}).on("dragend",function(ee){M(this,ee)}))}function C(G,ee){return G[0]-ee[0]}function T(G,ee,he){var xe=he._context.staticPlot,ve=G.selectAll(".background").data(P);ve.enter().append("rect").classed("background",!0).call(m).call(b).style("pointer-events",xe?"none":"auto").attr("transform",n(0,d.verticalPadding)),ve.call(g).attr("height",function(ge){return ge.height-d.verticalPadding});var ce=G.selectAll(".highlight-shadow").data(P);ce.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",ee).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),ce.attr("y1",function(ge){return ge.height}).call(k);var re=G.selectAll(".highlight").data(P);re.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),re.attr("y1",function(ge){return ge.height}).call(k)}function N(G,ee,he){var xe=G.selectAll("."+d.cn.axisBrush).data(P,z);xe.enter().append("g").classed(d.cn.axisBrush,!0),T(xe,ee,he)}function B(G){return G.svgBrush.extent.map(function(ee){return ee.slice()})}function U(G){G.filterSpecified=!1,G.svgBrush.extent=[[-1/0,1/0]]}function V(G){return function(ee){var he=ee.brush,xe=B(he),ve=xe.slice();he.filter.set(ve),G()}}function W(G){for(var ee=G.slice(),he=[],xe,ve=ee.shift();ve;){for(xe=ve.slice();(ve=ee.shift())&&ve[0]<=xe[1];)xe[1]=Math.max(xe[1],ve[1]);he.push(xe)}return he.length===1&&he[0][0]>he[0][1]&&(he=[]),he}function F(){var G=[],ee,he;return{set:function(xe){G=xe.map(function(ve){return ve.slice().sort(i)}).sort(C),G.length===1&&G[0][0]===-1/0&&G[0][1]===1/0&&(G=[[0,-1]]),ee=W(G),he=G.reduce(function(ve,ce){return[Math.min(ve[0],ce[0]),Math.max(ve[1],ce[1])]},[1/0,-1/0])},get:function(){return G.slice()},getConsolidated:function(){return ee},getBounds:function(){return he}}}function $(G,ee,he,xe,ve,ce){var re=F();return re.set(he),{filter:re,filterSpecified:ee,svgBrush:{extent:[],brushStartCallback:xe,brushCallback:V(ve),brushEndCallback:ce}}}function q(G,ee){if(Array.isArray(G[0])?(G=G.map(function(xe){return xe.sort(i)}),ee.multiselect?G=W(G.sort(C)):G=[G[0]]):G=[G.sort(i)],ee.tickvals){var he=ee.tickvals.slice().sort(i);if(G=G.map(function(xe){var ve=[s(0,he,xe[0],[]),s(1,he,xe[1],[])];if(ve[1]>ve[0])return ve}).filter(function(xe){return xe}),!G.length)return}return G.length>1?G:G[0]}Y.exports={makeBrush:$,ensureAxisBrush:N,cleanRanges:q}}),vQ=Fe((te,Y)=>{var d=ji(),y=cp().hasColorscale,z=Cc(),P=Xh().defaults,i=Gd(),n=Os(),a=ZD(),l=KD(),o=E6().maxDimensionCount,u=oA();function s(m,b,x,_,A){var f=A("line.color",x);if(y(m,"line")&&d.isArrayOrTypedArray(f)){if(f.length)return A("line.colorscale"),z(m,b,_,A,{prefix:"line.",cLetter:"c"}),f.length;b.line.color=x}return 1/0}function h(m,b,x,_){function A(E,I){return d.coerce(m,b,a.dimensions,E,I)}var f=A("values"),k=A("visible");if(f&&f.length||(k=b.visible=!1),k){A("label"),A("tickvals"),A("ticktext"),A("tickformat");var w=A("range");b._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},n.setConvert(b._ax,_.layout),A("multiselect");var D=A("constraintrange");D&&(b.constraintrange=l.cleanRanges(D,b))}}Y.exports=function(m,b,x,_){function A(E,I){return d.coerce(m,b,a,E,I)}var f=m.dimensions;Array.isArray(f)&&f.length>o&&(d.log("parcoords traces support up to "+o+" dimensions at the moment"),f.splice(o));var k=i(m,b,{name:"dimensions",layout:_,handleItemDefaults:h}),w=s(m,b,x,_,A);P(b,_,A),(!Array.isArray(k)||!k.length)&&(b.visible=!1),u(b,k,"values",w);var D=d.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});d.coerceFont(A,"labelfont",D),d.coerceFont(A,"tickfont",D,{autoShadowDflt:!0}),d.coerceFont(A,"rangefont",D),A("labelangle"),A("labelside"),A("unselected.line.color"),A("unselected.line.opacity")}}),yQ=Fe((te,Y)=>{var d=ji().isArrayOrTypedArray,y=lh(),z=t1().wrap;Y.exports=function(i,n){var a,l;return y.hasColorscale(n,"line")&&d(n.line.color)?(a=n.line.color,l=y.extractOpts(n.line).colorscale,y.calc(i,n,{vals:a,containerStr:"line",cLetter:"c"})):(a=P(n._length),l=[[0,n.line.color],[1,n.line.color]]),z({lineColor:a,cscale:l})};function P(i){for(var n=new Array(i),a=0;a>>16,(te&65280)>>>8,te&255],alpha:1};if(typeof te=="number")return{space:"rgb",values:[te>>>16,(te&65280)>>>8,te&255],alpha:1};if(te=String(te).toLowerCase(),sA.default[te])z=sA.default[te].slice(),i="rgb";else if(te==="transparent")P=0,i="rgb",z=[0,0,0];else if(te[0]==="#"){var n=te.slice(1),a=n.length,l=a<=4;P=1,l?(z=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],a===4&&(P=parseInt(n[3]+n[3],16)/255)):(z=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],a===8&&(P=parseInt(n[6]+n[7],16)/255)),z[0]||(z[0]=0),z[1]||(z[1]=0),z[2]||(z[2]=0),i="rgb"}else if(y=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(te)){var o=y[1];i=o.replace(/a$/,"");var u=i==="cmyk"?4:i==="gray"?1:3;z=y[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=z.shift()),z=z.map(function(s,h){if(s[s.length-1]==="%")return s=parseFloat(s)/100,h===3?s:i==="rgb"?s*255:i[0]==="h"||i[0]==="l"&&!h?s*100:i==="lab"?s*125:i==="lch"?h<2?s*150:s*360:i[0]==="o"&&!h?s:i==="oklab"?s*.4:i==="oklch"?h<2?s*.4:s*360:s;if(i[h]==="h"||h===2&&i[i.length-1]==="h"){if(lA[s]!==void 0)return lA[s];if(s.endsWith("deg"))return parseFloat(s);if(s.endsWith("turn"))return parseFloat(s)*360;if(s.endsWith("grad"))return parseFloat(s)*360/400;if(s.endsWith("rad"))return parseFloat(s)*180/Math.PI}return s==="none"?0:parseFloat(s)}),P=z.length>u?z.pop():1}else/[0-9](?:\s|\/|,)/.test(te)&&(z=te.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),i=((d=(Y=te.match(/([a-z])/ig))==null?void 0:Y.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:i,values:z,alpha:P}}var sA,YD,lA,xQ=Er(()=>{sA=Ir(JI()),YD=_Q,lA={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),L6,XD=Er(()=>{L6={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),P6,bQ=Er(()=>{XD(),P6={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(te){var Y=te[0]/360,d=te[1]/100,y=te[2]/100,z,P,i,n,a,l=0;if(d===0)return a=y*255,[a,a,a];for(P=y<.5?y*(1+d):y+d-y*d,z=2*y-P,n=[0,0,0];l<3;)i=Y+1/3*-(l-1),i<0?i++:i>1&&i--,a=6*i<1?z+(P-z)*6*i:2*i<1?P:3*i<2?z+(P-z)*(2/3-i)*6:z,n[l++]=a*255;return n}},L6.hsl=function(te){var Y=te[0]/255,d=te[1]/255,y=te[2]/255,z=Math.min(Y,d,y),P=Math.max(Y,d,y),i=P-z,n,a,l;return P===z?n=0:Y===P?n=(d-y)/i:d===P?n=2+(y-Y)/i:y===P&&(n=4+(Y-d)/i),n=Math.min(n*60,360),n<0&&(n+=360),l=(z+P)/2,P===z?a=0:l<=.5?a=i/(P+z):a=i/(2-P-z),[n,a*100,l*100]}}),JD={};wi(JD,{default:()=>wQ});function wQ(te){Array.isArray(te)&&te.raw&&(te=String.raw(...arguments)),te instanceof Number&&(te=+te);var Y,d=YD(te);if(!d.space)return[];let y=d.space[0]==="h"?P6.min:L6.min,z=d.space[0]==="h"?P6.max:L6.max;return Y=Array(3),Y[0]=Math.min(Math.max(d.values[0],y[0]),z[0]),Y[1]=Math.min(Math.max(d.values[1],y[1]),z[1]),Y[2]=Math.min(Math.max(d.values[2],y[2]),z[2]),d.space[0]==="h"&&(Y=P6.rgb(Y)),Y.push(Math.min(Math.max(d.alpha,0),1)),Y}var kQ=Er(()=>{xQ(),XD(),bQ()}),QD=Fe(te=>{var Y=ji().isTypedArray;te.convertTypedArray=function(d){return Y(d)?Array.prototype.slice.call(d):d},te.isOrdinal=function(d){return!!d.tickvals},te.isVisible=function(d){return d.visible||!("visible"in d)}}),TQ=Fe((te,Y)=>{var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),an;if(Ir&&(an=Ac(Ei),Ir[an]))return Ir[an].apply(null,Cn);var Xn=Function.apply(null,Qi.concat(Ei));return Ir&&(Ir[an]=Xn),Xn.apply(null,Cn)}return{global:La,link:Oi,block:Tn,proc:Ya,scope:ua,cond:ia,compile:da}}var oo="xyzw".split(""),wa=5121,Va=1,Oa=2,fa=0,vo=1,hs=2,rs=3,ps=4,xs=5,_o=6,no="dither",ws="blend.enable",ul="blend.color",Ul="blend.equation",mu="blend.func",Ql="depth.enable",gu="depth.func",Cl="depth.range",ec="depth.mask",$u="colorMask",xu="cull.enable",Ho="cull.face",Ds="frontFace",iu="lineWidth",Wl="polygonOffset.enable",Mc="polygonOffset.offset",eh="sample.alpha",$c="sample.enable",Hh="sample.coverage",th="stencil.enable",Vh="stencil.mask",Wu="stencil.func",Wh="stencil.opFront",cs="stencil.opBack",Fs="scissor.enable",rh="scissor.box",tc="viewport",ld="profile",Ke="framebuffer",O="vert",pe="frag",Ie="elements",Fe="primitive",qe="count",Mt="offset",jt="instances",tr="vao",kr="Width",Vr="Height",Wr=Ke+kr,Ti=Ke+Vr,Vi=tc+kr,et=tc+Vr,lt="drawingBuffer",Tt=lt+kr,Lt=lt+Vr,Vt=[mu,Ul,Wu,Wh,cs,Hh,tc,rh,Mc],Nt=34962,Xt=34963,Pr=2884,Hr=3042,Zr=3024,pi=2960,zi=2929,Ki=3089,rn=32823,kn=32926,Qn=32928,Ca=5126,Ta=35664,Ba=35665,xo=35666,Go=5124,Bo=35667,_s=35668,wl=35669,Al=35670,Us=35671,Pl=35672,Fu=35673,Tu=35674,Js=35675,Qs=35676,nc=35678,wc=35680,ih=4,Me=1028,Ve=1029,ft=2304,Pt=2305,Bt=32775,Ht=32776,dr=519,cr=7680,Or=0,mi=1,hi=32774,Bi=513,Yi=36160,Ji=36064,ta={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},sn={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Bn={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},$n={cw:ft,ccw:Pt};function Yn(St){return Array.isArray(St)||ci(St)||vi(St)}function aa(St){return St.sort(function(Ir,Nr){return Ir===tc?-1:Nr===tc?1:Ir=1,Qi>=2,Ir)}else if(Nr===ps){var Cn=St.data;return new vn(Cn.thisDep,Cn.contextDep,Cn.propDep,Ir)}else{if(Nr===xs)return new vn(!1,!1,!1,Ir);if(Nr===_o){for(var xn=!1,Oi=!1,Tn=!1,ua=0;ua=1&&(Oi=!0),La>=2&&(Tn=!0)}else ia.type===ps&&(xn=xn||ia.data.thisDep,Oi=Oi||ia.data.contextDep,Tn=Tn||ia.data.propDep)}return new vn(xn,Oi,Tn,Ir)}else return new vn(Nr===rs,Nr===hs,Nr===vo,Ir)}}var jo=new vn(!1,!1,!1,function(){});function qo(St,Ir,Nr,Qi,Cn,xn,Oi,Tn,ua,ia,La,ao,Ya,da,jn,Ei){var an=ia.Record,Xn={add:32774,subtract:32778,"reverse subtract":32779};Nr.ext_blend_minmax&&(Xn.min=Bt,Xn.max=Ht);var Nn=Nr.angle_instanced_arrays,bn=Nr.webgl_draw_buffers,Na=Nr.oes_vertex_array_object,ka={dirty:!0,profile:Ei.profile},eo={},Rn=[],wn={},ja={};function Aa(Je){return Je.replace(".","_")}function oa(Je,dt,It){var ur=Aa(Je);Rn.push(Je),eo[ur]=ka[ur]=!!It,wn[ur]=dt}function la(Je,dt,It){var ur=Aa(Je);Rn.push(Je),Array.isArray(It)?(ka[ur]=It.slice(),eo[ur]=It.slice()):ka[ur]=eo[ur]=It,ja[ur]=dt}function Da(Je){return!!isNaN(Je)}oa(no,Zr),oa(ws,Hr),la(ul,"blendColor",[0,0,0,0]),la(Ul,"blendEquationSeparate",[hi,hi]),la(mu,"blendFuncSeparate",[mi,Or,mi,Or]),oa(Ql,zi,!0),la(gu,"depthFunc",Bi),la(Cl,"depthRange",[0,1]),la(ec,"depthMask",!0),la($u,$u,[!0,!0,!0,!0]),oa(xu,Pr),la(Ho,"cullFace",Ve),la(Ds,Ds,Pt),la(iu,iu,1),oa(Wl,rn),la(Mc,"polygonOffset",[0,0]),oa(eh,kn),oa($c,Qn),la(Hh,"sampleCoverage",[1,!1]),oa(th,pi),la(Vh,"stencilMask",-1),la(Wu,"stencilFunc",[dr,0,-1]),la(Wh,"stencilOpSeparate",[Me,cr,cr,cr]),la(cs,"stencilOpSeparate",[Ve,cr,cr,cr]),oa(Fs,Ki),la(rh,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),la(tc,tc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var $o={gl:St,context:Ya,strings:Ir,next:eo,current:ka,draw:ao,elements:xn,buffer:Cn,shader:La,attributes:ia.state,vao:ia,uniforms:ua,framebuffer:Tn,extensions:Nr,timer:da,isBufferArgs:Yn},Do={primTypes:Mn,compareFuncs:sn,blendFuncs:ta,blendEquations:Xn,stencilOps:Bn,glTypes:un,orientationType:$n};bn&&(Do.backBuffer=[Ve],Do.drawBuffer=p(Qi.maxDrawbuffers,function(Je){return Je===0?[0]:p(Je,function(dt){return Ji+dt})}));var Ia=0;function qa(){var Je=Ka({cache:jn}),dt=Je.link,It=Je.global;Je.id=Ia++,Je.batchId="0";var ur=dt($o),er=Je.shared={props:"a0"};Object.keys($o).forEach(function(rr){er[rr]=It.def(ur,".",rr)});var ar=Je.next={},pr=Je.current={};Object.keys(ja).forEach(function(rr){Array.isArray(ka[rr])&&(ar[rr]=It.def(er.next,".",rr),pr[rr]=It.def(er.current,".",rr))});var yr=Je.constants={};Object.keys(Do).forEach(function(rr){yr[rr]=It.def(JSON.stringify(Do[rr]))}),Je.invoke=function(rr,Jt){switch(Jt.type){case fa:var Fr=["this",er.context,er.props,Je.batchId];return rr.def(dt(Jt.data),".call(",Fr.slice(0,Math.max(Jt.data.length+1,4)),")");case vo:return rr.def(er.props,Jt.data);case hs:return rr.def(er.context,Jt.data);case rs:return rr.def("this",Jt.data);case ps:return Jt.data.append(Je,rr),Jt.data.ref;case xs:return Jt.data.toString();case _o:return Jt.data.map(function(bi){return Je.invoke(rr,bi)})}},Je.attribCache={};var qt={};return Je.scopeAttrib=function(rr){var Jt=Ir.id(rr);if(Jt in qt)return qt[Jt];var Fr=ia.scope[Jt];Fr||(Fr=ia.scope[Jt]=new an);var bi=qt[Jt]=dt(Fr);return bi},Je}function Co(Je){var dt=Je.static,It=Je.dynamic,ur;if(ld in dt){var er=!!dt[ld];ur=to(function(pr,yr){return er}),ur.enable=er}else if(ld in It){var ar=It[ld];ur=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}return ur}function Ro(Je,dt){var It=Je.static,ur=Je.dynamic;if(Ke in It){var er=It[Ke];return er?(er=Tn.getFramebuffer(er),to(function(pr,yr){var qt=pr.link(er),rr=pr.shared;yr.set(rr.framebuffer,".next",qt);var Jt=rr.context;return yr.set(Jt,"."+Wr,qt+".width"),yr.set(Jt,"."+Ti,qt+".height"),qt})):to(function(pr,yr){var qt=pr.shared;yr.set(qt.framebuffer,".next","null");var rr=qt.context;return yr.set(rr,"."+Wr,rr+"."+Tt),yr.set(rr,"."+Ti,rr+"."+Lt),"null"})}else if(Ke in ur){var ar=ur[Ke];return yo(ar,function(pr,yr){var qt=pr.invoke(yr,ar),rr=pr.shared,Jt=rr.framebuffer,Fr=yr.def(Jt,".getFramebuffer(",qt,")");yr.set(Jt,".next",Fr);var bi=rr.context;return yr.set(bi,"."+Wr,Fr+"?"+Fr+".width:"+bi+"."+Tt),yr.set(bi,"."+Ti,Fr+"?"+Fr+".height:"+bi+"."+Lt),Fr})}else return null}function us(Je,dt,It){var ur=Je.static,er=Je.dynamic;function ar(qt){if(qt in ur){var rr=ur[qt],Jt=!0,Fr=rr.x|0,bi=rr.y|0,Li,In;return"width"in rr?Li=rr.width|0:Jt=!1,"height"in rr?In=rr.height|0:Jt=!1,new vn(!Jt&&dt&&dt.thisDep,!Jt&&dt&&dt.contextDep,!Jt&&dt&&dt.propDep,function(Vn,Dn){var ca=Vn.shared.context,Hn=Li;"width"in rr||(Hn=Dn.def(ca,".",Wr,"-",Fr));var Wn=In;return"height"in rr||(Wn=Dn.def(ca,".",Ti,"-",bi)),[Fr,bi,Hn,Wn]})}else if(qt in er){var An=er[qt],gn=yo(An,function(Vn,Dn){var ca=Vn.invoke(Dn,An),Hn=Vn.shared.context,Wn=Dn.def(ca,".x|0"),_a=Dn.def(ca,".y|0"),po=Dn.def('"width" in ',ca,"?",ca,".width|0:","(",Hn,".",Wr,"-",Wn,")"),To=Dn.def('"height" in ',ca,"?",ca,".height|0:","(",Hn,".",Ti,"-",_a,")");return[Wn,_a,po,To]});return dt&&(gn.thisDep=gn.thisDep||dt.thisDep,gn.contextDep=gn.contextDep||dt.contextDep,gn.propDep=gn.propDep||dt.propDep),gn}else return dt?new vn(dt.thisDep,dt.contextDep,dt.propDep,function(Vn,Dn){var ca=Vn.shared.context;return[0,0,Dn.def(ca,".",Wr),Dn.def(ca,".",Ti)]}):null}var pr=ar(tc);if(pr){var yr=pr;pr=new vn(pr.thisDep,pr.contextDep,pr.propDep,function(qt,rr){var Jt=yr.append(qt,rr),Fr=qt.shared.context;return rr.set(Fr,"."+Vi,Jt[2]),rr.set(Fr,"."+et,Jt[3]),Jt})}return{viewport:pr,scissor_box:ar(rh)}}function Kl(Je,dt){var It=Je.static,ur=typeof It[pe]=="string"&&typeof It[O]=="string";if(ur){if(Object.keys(dt.dynamic).length>0)return null;var er=dt.static,ar=Object.keys(er);if(ar.length>0&&typeof er[ar[0]]=="number"){for(var pr=[],yr=0;yr"+Wn+"?"+Jt+".constant["+Wn+"]:0;"}).join(""),"}}else{","if(",Li,"(",Jt,".buffer)){",Vn,"=",In,".createStream(",Nt,",",Jt,".buffer);","}else{",Vn,"=",In,".getBuffer(",Jt,".buffer);","}",Dn,'="type" in ',Jt,"?",bi.glTypes,"[",Jt,".type]:",Vn,".dtype;",An.normalized,"=!!",Jt,".normalized;");function ca(Hn){rr(An[Hn],"=",Jt,".",Hn,"|0;")}return ca("size"),ca("offset"),ca("stride"),ca("divisor"),rr("}}"),rr.exit("if(",An.isStream,"){",In,".destroyStream(",Vn,");","}"),An}er[ar]=yo(pr,yr)}),er}function kc(Je){var dt=Je.static,It=Je.dynamic,ur={};return Object.keys(dt).forEach(function(er){var ar=dt[er];ur[er]=to(function(pr,yr){return typeof ar=="number"||typeof ar=="boolean"?""+ar:pr.link(ar)})}),Object.keys(It).forEach(function(er){var ar=It[er];ur[er]=yo(ar,function(pr,yr){return pr.invoke(yr,ar)})}),ur}function Ec(Je,dt,It,ur,er){Je.static,Je.dynamic;var ar=Kl(Je,dt),pr=Ro(Je),yr=us(Je,pr),qt=gs(Je),rr=Pu(Je),Jt=zl(Je,er,ar);function Fr(Vn){var Dn=yr[Vn];Dn&&(rr[Vn]=Dn)}Fr(tc),Fr(Aa(rh));var bi=Object.keys(rr).length>0,Li={framebuffer:pr,draw:qt,shader:Jt,state:rr,dirty:bi,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Li.profile=Co(Je),Li.uniforms=kl(It),Li.drawVAO=Li.scopeVAO=qt.vao,!Li.drawVAO&&Jt.program&&!ar&&Nr.angle_instanced_arrays&&qt.static.elements){var In=!0,An=Jt.program.attributes.map(function(Vn){var Dn=dt.static[Vn];return In=In&&!!Dn,Dn});if(In&&An.length>0){var gn=ia.getVAO(ia.createVAO({attributes:An,elements:qt.static.elements}));Li.drawVAO=new vn(null,null,null,function(Vn,Dn){return Vn.link(gn)}),Li.useVAO=!0}}return ar?Li.useVAO=!0:Li.attributes=Nu(dt),Li.context=kc(ur),Li}function Au(Je,dt,It){var ur=Je.shared,er=ur.context,ar=Je.scope();Object.keys(It).forEach(function(pr){dt.save(er,"."+pr);var yr=It[pr],qt=yr.append(Je,dt);Array.isArray(qt)?ar(er,".",pr,"=[",qt.join(),"];"):ar(er,".",pr,"=",qt,";")}),dt(ar)}function wu(Je,dt,It,ur){var er=Je.shared,ar=er.gl,pr=er.framebuffer,yr;bn&&(yr=dt.def(er.extensions,".webgl_draw_buffers"));var qt=Je.constants,rr=qt.drawBuffer,Jt=qt.backBuffer,Fr;It?Fr=It.append(Je,dt):Fr=dt.def(pr,".next"),ur||dt("if(",Fr,"!==",pr,".cur){"),dt("if(",Fr,"){",ar,".bindFramebuffer(",Yi,",",Fr,".framebuffer);"),bn&&dt(yr,".drawBuffersWEBGL(",rr,"[",Fr,".colorAttachments.length]);"),dt("}else{",ar,".bindFramebuffer(",Yi,",null);"),bn&&dt(yr,".drawBuffersWEBGL(",Jt,");"),dt("}",pr,".cur=",Fr,";"),ur||dt("}")}function Iu(Je,dt,It){var ur=Je.shared,er=ur.gl,ar=Je.current,pr=Je.next,yr=ur.current,qt=ur.next,rr=Je.cond(yr,".dirty");Rn.forEach(function(Jt){var Fr=Aa(Jt);if(!(Fr in It.state)){var bi,Li;if(Fr in pr){bi=pr[Fr],Li=ar[Fr];var In=p(ka[Fr].length,function(gn){return rr.def(bi,"[",gn,"]")});rr(Je.cond(In.map(function(gn,Vn){return gn+"!=="+Li+"["+Vn+"]"}).join("||")).then(er,".",ja[Fr],"(",In,");",In.map(function(gn,Vn){return Li+"["+Vn+"]="+gn}).join(";"),";"))}else{bi=rr.def(qt,".",Fr);var An=Je.cond(bi,"!==",yr,".",Fr);rr(An),Fr in wn?An(Je.cond(bi).then(er,".enable(",wn[Fr],");").else(er,".disable(",wn[Fr],");"),yr,".",Fr,"=",bi,";"):An(er,".",ja[Fr],"(",bi,");",yr,".",Fr,"=",bi,";")}}}),Object.keys(It.state).length===0&&rr(yr,".dirty=false;"),dt(rr)}function Zo(Je,dt,It,ur){var er=Je.shared,ar=Je.current,pr=er.current,yr=er.gl,qt;aa(Object.keys(It)).forEach(function(rr){var Jt=It[rr];if(!(ur&&!ur(Jt))){var Fr=Jt.append(Je,dt);if(wn[rr]){var bi=wn[rr];Qa(Jt)?(qt=Je.link(Fr,{stable:!0}),dt(Je.cond(qt).then(yr,".enable(",bi,");").else(yr,".disable(",bi,");")),dt(pr,".",rr,"=",qt,";")):(dt(Je.cond(Fr).then(yr,".enable(",bi,");").else(yr,".disable(",bi,");")),dt(pr,".",rr,"=",Fr,";"))}else if(Zi(Fr)){var Li=ar[rr];dt(yr,".",ja[rr],"(",Fr,");",Fr.map(function(In,An){return Li+"["+An+"]="+In}).join(";"),";")}else Qa(Jt)?(qt=Je.link(Fr,{stable:!0}),dt(yr,".",ja[rr],"(",qt,");",pr,".",rr,"=",qt,";")):dt(yr,".",ja[rr],"(",Fr,");",pr,".",rr,"=",Fr,";")}})}function Du(Je,dt){Nn&&(Je.instancing=dt.def(Je.shared.extensions,".angle_instanced_arrays"))}function vl(Je,dt,It,ur,er){var ar=Je.shared,pr=Je.stats,yr=ar.current,qt=ar.timer,rr=It.profile;function Jt(){return typeof performance>"u"?"Date.now()":"performance.now()"}var Fr,bi;function Li(ca){Fr=dt.def(),ca(Fr,"=",Jt(),";"),typeof er=="string"?ca(pr,".count+=",er,";"):ca(pr,".count++;"),da&&(ur?(bi=dt.def(),ca(bi,"=",qt,".getNumPendingQueries();")):ca(qt,".beginQuery(",pr,");"))}function In(ca){ca(pr,".cpuTime+=",Jt(),"-",Fr,";"),da&&(ur?ca(qt,".pushScopeStats(",bi,",",qt,".getNumPendingQueries(),",pr,");"):ca(qt,".endQuery();"))}function An(ca){var Hn=dt.def(yr,".profile");dt(yr,".profile=",ca,";"),dt.exit(yr,".profile=",Hn,";")}var gn;if(rr){if(Qa(rr)){rr.enable?(Li(dt),In(dt.exit),An("true")):An("false");return}gn=rr.append(Je,dt),An(gn)}else gn=dt.def(yr,".profile");var Vn=Je.block();Li(Vn),dt("if(",gn,"){",Vn,"}");var Dn=Je.block();In(Dn),dt.exit("if(",gn,"){",Dn,"}")}function ju(Je,dt,It,ur,er){var ar=Je.shared;function pr(qt){switch(qt){case Ta:case Bo:case Us:return 2;case Ba:case _s:case Pl:return 3;case xo:case wl:case Fu:return 4;default:return 1}}function yr(qt,rr,Jt){var Fr=ar.gl,bi=dt.def(qt,".location"),Li=dt.def(ar.attributes,"[",bi,"]"),In=Jt.state,An=Jt.buffer,gn=[Jt.x,Jt.y,Jt.z,Jt.w],Vn=["buffer","normalized","offset","stride"];function Dn(){dt("if(!",Li,".buffer){",Fr,".enableVertexAttribArray(",bi,");}");var Hn=Jt.type,Wn;if(Jt.size?Wn=dt.def(Jt.size,"||",rr):Wn=rr,dt("if(",Li,".type!==",Hn,"||",Li,".size!==",Wn,"||",Vn.map(function(po){return Li+"."+po+"!=="+Jt[po]}).join("||"),"){",Fr,".bindBuffer(",Nt,",",An,".buffer);",Fr,".vertexAttribPointer(",[bi,Wn,Hn,Jt.normalized,Jt.stride,Jt.offset],");",Li,".type=",Hn,";",Li,".size=",Wn,";",Vn.map(function(po){return Li+"."+po+"="+Jt[po]+";"}).join(""),"}"),Nn){var _a=Jt.divisor;dt("if(",Li,".divisor!==",_a,"){",Je.instancing,".vertexAttribDivisorANGLE(",[bi,_a],");",Li,".divisor=",_a,";}")}}function ca(){dt("if(",Li,".buffer){",Fr,".disableVertexAttribArray(",bi,");",Li,".buffer=null;","}if(",oo.map(function(Hn,Wn){return Li+"."+Hn+"!=="+gn[Wn]}).join("||"),"){",Fr,".vertexAttrib4f(",bi,",",gn,");",oo.map(function(Hn,Wn){return Li+"."+Hn+"="+gn[Wn]+";"}).join(""),"}")}In===Va?Dn():In===Oa?ca():(dt("if(",In,"===",Va,"){"),Dn(),dt("}else{"),ca(),dt("}"))}ur.forEach(function(qt){var rr=qt.name,Jt=It.attributes[rr],Fr;if(Jt){if(!er(Jt))return;Fr=Jt.append(Je,dt)}else{if(!er(jo))return;var bi=Je.scopeAttrib(rr);Fr={},Object.keys(new an).forEach(function(Li){Fr[Li]=dt.def(bi,".",Li)})}yr(Je.link(qt),pr(qt.info.type),Fr)})}function Lc(Je,dt,It,ur,er,ar){for(var pr=Je.shared,yr=pr.gl,qt,rr=0;rr1){for(var Jo=[],Ss=[],$l=0;$l>1)",An],");")}function _a(){It(gn,".drawArraysInstancedANGLE(",[bi,Li,In,An],");")}Jt&&Jt!=="null"?Dn?Wn():(It("if(",Jt,"){"),Wn(),It("}else{"),_a(),It("}")):_a()}function Hn(){function Wn(){It(ar+".drawElements("+[bi,In,Vn,Li+"<<(("+Vn+"-"+wa+")>>1)"]+");")}function _a(){It(ar+".drawArrays("+[bi,Li,In]+");")}Jt&&Jt!=="null"?Dn?Wn():(It("if(",Jt,"){"),Wn(),It("}else{"),_a(),It("}")):_a()}Nn&&(typeof An!="number"||An>=0)?typeof An=="string"?(It("if(",An,">0){"),ca(),It("}else if(",An,"<0){"),Hn(),It("}")):ca():Hn()}function zs(Je,dt,It,ur,er){var ar=qa(),pr=ar.proc("body",er);return Nn&&(ar.instancing=pr.def(ar.shared.extensions,".angle_instanced_arrays")),Je(ar,pr,It,ur),ar.compile().body}function Ol(Je,dt,It,ur){Du(Je,dt),It.useVAO?It.drawVAO?dt(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,dt),");"):dt(Je.shared.vao,".setVAO(",Je.shared.vao,".targetVAO);"):(dt(Je.shared.vao,".setVAO(null);"),ju(Je,dt,It,ur.attributes,function(){return!0})),Lc(Je,dt,It,ur.uniforms,function(){return!0},!1),Fo(Je,dt,dt,It)}function Ml(Je,dt){var It=Je.proc("draw",1);Du(Je,It),Au(Je,It,dt.context),wu(Je,It,dt.framebuffer),Iu(Je,It,dt),Zo(Je,It,dt.state),vl(Je,It,dt,!1,!0);var ur=dt.shader.progVar.append(Je,It);if(It(Je.shared.gl,".useProgram(",ur,".program);"),dt.shader.program)Ol(Je,It,dt,dt.shader.program);else{It(Je.shared.vao,".setVAO(null);");var er=Je.global.def("{}"),ar=It.def(ur,".id"),pr=It.def(er,"[",ar,"]");It(Je.cond(pr).then(pr,".call(this,a0);").else(pr,"=",er,"[",ar,"]=",Je.link(function(yr){return zs(Ol,Je,dt,yr,1)}),"(",ur,");",pr,".call(this,a0);"))}Object.keys(dt.state).length>0&&It(Je.shared.current,".dirty=true;"),Je.shared.vao&&It(Je.shared.vao,".setVAO(null);")}function K(Je,dt,It,ur){Je.batchId="a1",Du(Je,dt);function er(){return!0}ju(Je,dt,It,ur.attributes,er),Lc(Je,dt,It,ur.uniforms,er,!1),Fo(Je,dt,dt,It)}function le(Je,dt,It,ur){Du(Je,dt);var er=It.contextDep,ar=dt.def(),pr="a0",yr="a1",qt=dt.def();Je.shared.props=qt,Je.batchId=ar;var rr=Je.scope(),Jt=Je.scope();dt(rr.entry,"for(",ar,"=0;",ar,"<",yr,";++",ar,"){",qt,"=",pr,"[",ar,"];",Jt,"}",rr.exit);function Fr(Vn){return Vn.contextDep&&er||Vn.propDep}function bi(Vn){return!Fr(Vn)}if(It.needsContext&&Au(Je,Jt,It.context),It.needsFramebuffer&&wu(Je,Jt,It.framebuffer),Zo(Je,Jt,It.state,Fr),It.profile&&Fr(It.profile)&&vl(Je,Jt,It,!1,!0),ur)It.useVAO?It.drawVAO?Fr(It.drawVAO)?Jt(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,Jt),");"):rr(Je.shared.vao,".setVAO(",It.drawVAO.append(Je,rr),");"):rr(Je.shared.vao,".setVAO(",Je.shared.vao,".targetVAO);"):(rr(Je.shared.vao,".setVAO(null);"),ju(Je,rr,It,ur.attributes,bi),ju(Je,Jt,It,ur.attributes,Fr)),Lc(Je,rr,It,ur.uniforms,bi,!1),Lc(Je,Jt,It,ur.uniforms,Fr,!0),Fo(Je,rr,Jt,It);else{var Li=Je.global.def("{}"),In=It.shader.progVar.append(Je,Jt),An=Jt.def(In,".id"),gn=Jt.def(Li,"[",An,"]");Jt(Je.shared.gl,".useProgram(",In,".program);","if(!",gn,"){",gn,"=",Li,"[",An,"]=",Je.link(function(Vn){return zs(K,Je,It,Vn,2)}),"(",In,");}",gn,".call(this,a0[",ar,"],",ar,");")}}function ie(Je,dt){var It=Je.proc("batch",2);Je.batchId="0",Du(Je,It);var ur=!1,er=!0;Object.keys(dt.context).forEach(function(Li){ur=ur||dt.context[Li].propDep}),ur||(Au(Je,It,dt.context),er=!1);var ar=dt.framebuffer,pr=!1;ar?(ar.propDep?ur=pr=!0:ar.contextDep&&ur&&(pr=!0),pr||wu(Je,It,ar)):wu(Je,It,null),dt.state.viewport&&dt.state.viewport.propDep&&(ur=!0);function yr(Li){return Li.contextDep&&ur||Li.propDep}Iu(Je,It,dt),Zo(Je,It,dt.state,function(Li){return!yr(Li)}),(!dt.profile||!yr(dt.profile))&&vl(Je,It,dt,!1,"a1"),dt.contextDep=ur,dt.needsContext=er,dt.needsFramebuffer=pr;var qt=dt.shader.progVar;if(qt.contextDep&&ur||qt.propDep)le(Je,It,dt,null);else{var rr=qt.append(Je,It);if(It(Je.shared.gl,".useProgram(",rr,".program);"),dt.shader.program)le(Je,It,dt,dt.shader.program);else{It(Je.shared.vao,".setVAO(null);");var Jt=Je.global.def("{}"),Fr=It.def(rr,".id"),bi=It.def(Jt,"[",Fr,"]");It(Je.cond(bi).then(bi,".call(this,a0,a1);").else(bi,"=",Jt,"[",Fr,"]=",Je.link(function(Li){return zs(le,Je,dt,Li,2)}),"(",rr,");",bi,".call(this,a0,a1);"))}}Object.keys(dt.state).length>0&&It(Je.shared.current,".dirty=true;"),Je.shared.vao&&It(Je.shared.vao,".setVAO(null);")}function we(Je,dt){var It=Je.proc("scope",3);Je.batchId="a2";var ur=Je.shared,er=ur.current;if(Au(Je,It,dt.context),dt.framebuffer&&dt.framebuffer.append(Je,It),aa(Object.keys(dt.state)).forEach(function(yr){var qt=dt.state[yr],rr=qt.append(Je,It);Zi(rr)?rr.forEach(function(Jt,Fr){Da(Jt)?It.set(Je.next[yr],"["+Fr+"]",Jt):It.set(Je.next[yr],"["+Fr+"]",Je.link(Jt,{stable:!0}))}):Qa(qt)?It.set(ur.next,"."+yr,Je.link(rr,{stable:!0})):It.set(ur.next,"."+yr,rr)}),vl(Je,It,dt,!0,!0),[Ie,Mt,qe,jt,Fe].forEach(function(yr){var qt=dt.draw[yr];if(qt){var rr=qt.append(Je,It);Da(rr)?It.set(ur.draw,"."+yr,rr):It.set(ur.draw,"."+yr,Je.link(rr),{stable:!0})}}),Object.keys(dt.uniforms).forEach(function(yr){var qt=dt.uniforms[yr].append(Je,It);Array.isArray(qt)&&(qt="["+qt.map(function(rr){return Da(rr)?rr:Je.link(rr,{stable:!0})})+"]"),It.set(ur.uniforms,"["+Je.link(Ir.id(yr),{stable:!0})+"]",qt)}),Object.keys(dt.attributes).forEach(function(yr){var qt=dt.attributes[yr].append(Je,It),rr=Je.scopeAttrib(yr);Object.keys(new an).forEach(function(Jt){It.set(rr,"."+Jt,qt[Jt])})}),dt.scopeVAO){var ar=dt.scopeVAO.append(Je,It);Da(ar)?It.set(ur.vao,".targetVAO",ar):It.set(ur.vao,".targetVAO",Je.link(ar,{stable:!0}))}function pr(yr){var qt=dt.shader[yr];if(qt){var rr=qt.append(Je,It);Da(rr)?It.set(ur.shader,"."+yr,rr):It.set(ur.shader,"."+yr,Je.link(rr,{stable:!0}))}}pr(O),pr(pe),Object.keys(dt.state).length>0&&(It(er,".dirty=true;"),It.exit(er,".dirty=true;")),It("a1(",Je.shared.context,",a0,",Je.batchId,");")}function We(Je){if(!(typeof Je!="object"||Zi(Je))){for(var dt=Object.keys(Je),It=0;It=0;--Fo){var zs=Da[Fo];zs&&zs(da,null,0)}Nr.flush(),ia&&ia.update()}function Ro(){!qa&&Da.length>0&&(qa=b.next(Co))}function us(){qa&&(b.cancel(Co),qa=null)}function Kl(Fo){Fo.preventDefault(),us(),$o.forEach(function(zs){zs()})}function zl(Fo){Nr.getError(),Cn.restore(),ka.restore(),Xn.restore(),eo.restore(),Rn.restore(),wn.restore(),bn.restore(),ia&&ia.restore(),ja.procs.refresh(),Ro(),Do.forEach(function(zs){zs()})}la&&(la.addEventListener(fl,Kl,!1),la.addEventListener(vu,zl,!1));function gs(){Da.length=0,us(),la&&(la.removeEventListener(fl,Kl),la.removeEventListener(vu,zl)),ka.clear(),wn.clear(),Rn.clear(),bn.clear(),eo.clear(),Nn.clear(),Xn.clear(),ia&&ia.clear(),Ia.forEach(function(Fo){Fo()})}function Pu(Fo){function zs(er){var ar=d({},er);delete ar.uniforms,delete ar.attributes,delete ar.context,delete ar.vao,"stencil"in ar&&ar.stencil.op&&(ar.stencil.opBack=ar.stencil.opFront=ar.stencil.op,delete ar.stencil.op);function pr(yr){if(yr in ar){var qt=ar[yr];delete ar[yr],Object.keys(qt).forEach(function(rr){ar[yr+"."+rr]=qt[rr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in er&&(ar.vao=er.vao),ar}function Ol(er,ar){var pr={},yr={};return Object.keys(er).forEach(function(qt){var rr=er[qt];if(m.isDynamic(rr)){yr[qt]=m.unbox(rr,qt);return}else if(ar&&Array.isArray(rr)){for(var Jt=0;Jt0)return kt.call(this,It(er|0),er|0)}else if(Array.isArray(er)){if(er.length)return kt.call(this,er,er.length)}else return gt.call(this,er)}return d(ur,{stats:we,destroy:function(){We.destroy()}})}var kl=wn.setFBO=Pu({framebuffer:m.define.call(null,nu,"framebuffer")});function Nu(Fo,zs){var Ol=0;ja.procs.poll();var Ml=zs.color;Ml&&(Nr.clearColor(+Ml[0]||0,+Ml[1]||0,+Ml[2]||0,+Ml[3]||0),Ol|=ac),"depth"in zs&&(Nr.clearDepth(+zs.depth),Ol|=bu),"stencil"in zs&&(Nr.clearStencil(zs.stencil|0),Ol|=Eo),Nr.clear(Ol)}function kc(Fo){if("framebuffer"in Fo)if(Fo.framebuffer&&Fo.framebuffer_reglType==="framebufferCube")for(var zs=0;zs<6;++zs)kl(d({framebuffer:Fo.framebuffer.faces[zs]},Fo),Nu);else kl(Fo,Nu);else Nu(null,Fo)}function Ec(Fo){Da.push(Fo);function zs(){var Ol=cu(Da,Fo);function Ml(){var K=cu(Da,Ml);Da[K]=Da[Da.length-1],Da.length-=1,Da.length<=0&&us()}Da[Ol]=Ml}return Ro(),{cancel:zs}}function Au(){var Fo=oa.viewport,zs=oa.scissor_box;Fo[0]=Fo[1]=zs[0]=zs[1]=0,da.viewportWidth=da.framebufferWidth=da.drawingBufferWidth=Fo[2]=zs[2]=Nr.drawingBufferWidth,da.viewportHeight=da.framebufferHeight=da.drawingBufferHeight=Fo[3]=zs[3]=Nr.drawingBufferHeight}function wu(){da.tick+=1,da.time=Zo(),Au(),ja.procs.poll()}function Iu(){eo.refresh(),Au(),ja.procs.refresh(),ia&&ia.update()}function Zo(){return(x()-La)/1e3}Iu();function Du(Fo,zs){var Ol;switch(Fo){case"frame":return Ec(zs);case"lost":Ol=$o;break;case"restore":Ol=Do;break;case"destroy":Ol=Ia;break}return Ol.push(zs),{cancel:function(){for(var Ml=0;Ml=0},read:Aa,destroy:gs,_gl:Nr,_refresh:Iu,poll:function(){wu(),ia&&ia.update()},now:Zo,stats:Oi,getCachedCode:vl,preloadCachedCode:ju});return Ir.onDone(null,Lc),Lc}return zh})}),sA=ze((te,Y)=>{var d=iD(),y=rQ();Y.exports=function(z,P,i){var n=z._fullLayout,a=!0;return n._glcanvas.each(function(l){if(l.regl){l.regl.preloadCachedCode(i);return}if(!(l.pick&&!n._has("parcoords"))){try{l.regl=y({canvas:this,attributes:{antialias:!l.pick,preserveDrawingBuffer:!0},pixelRatio:z._context.plotGlPixelRatio||window.devicePixelRatio,extensions:P||[],cachedCode:i||{}})}catch{a=!1}l.regl||(a=!1),a&&this.addEventListener("webglcontextlost",function(o){z&&z.emit&&z.emit("plotly_webglcontextlost",{event:o,layer:l.key})},!1)}}),a||d({container:n._glcontainer.node()}),a}}),GD=ze((m,Y)=>{var d=SD(),y=RD(),z=NJ(),P=tQ(),i=ji(),n=dm().selectMode,a=sA(),l=Bc(),o=Ja(),u=wD().styleTextSelection,s={};function h(b,x,_,A){var f=b._size,k=b.width*A,w=b.height*A,D=f.l*A,E=f.b*A,I=f.r*A,M=f.t*A,p=f.w*A,g=f.h*A;return[D+x.domain[0]*p,E+_.domain[0]*g,k-I-(1-x.domain[1])*p,w-M-(1-_.domain[1])*g]}var m=Y.exports=function(b,x,_){if(_.length){var A=b._fullLayout,f=x._scene,k=x.xaxis,w=x.yaxis,D,E;if(f){var I=a(b,["ANGLE_instanced_arrays","OES_element_index_uint"],s);if(!I){f.init();return}var M=f.count,p=A._glcanvas.data()[0].regl;if(o(b,x,_),f.dirty){if((f.line2d||f.error2d)&&!(f.scatter2d||f.fill2d||f.glText)&&p.clear({color:!0,depth:!0}),f.error2d===!0&&(f.error2d=z(p)),f.line2d===!0&&(f.line2d=y(p)),f.scatter2d===!0&&(f.scatter2d=d(p)),f.fill2d===!0&&(f.fill2d=y(p)),f.glText===!0)for(f.glText=new Array(M),D=0;Df.glText.length){var g=M-f.glText.length;for(D=0;Dme&&(isNaN(J[fe])||isNaN(J[fe+1]));)fe-=2;oe.positions=J.slice(me,fe+2)}return oe}),f.line2d.update(f.lineOptions)),f.error2d){var N=(f.errorXOptions||[]).concat(f.errorYOptions||[]);f.error2d.update(N)}f.scatter2d&&f.scatter2d.update(f.markerOptions),f.fillOrder=i.repeat(null,M),f.fill2d&&(f.fillOptions=f.fillOptions.map(function(oe,J){var me=_[J];if(!(!oe||!me||!me[0]||!me[0].trace)){var fe=me[0],Ce=fe.trace,Re=fe.t,Be=f.lineOptions[J],Ze,Ge,tt=[];Ce._ownfill&&tt.push(J),Ce._nexttrace&&tt.push(J+1),tt.length&&(f.fillOrder[J]=tt);var _t=[],mt=Be&&Be.positions||Re.positions,vt,ct;if(Ce.fill==="tozeroy"){for(vt=0;vtvt&&isNaN(mt[ct+1]);)ct-=2;mt[vt+1]!==0&&(_t=[mt[vt],0]),_t=_t.concat(mt.slice(vt,ct+2)),mt[ct+1]!==0&&(_t=_t.concat([mt[ct],0]))}else if(Ce.fill==="tozerox"){for(vt=0;vtvt&&isNaN(mt[ct]);)ct-=2;mt[vt]!==0&&(_t=[0,mt[vt+1]]),_t=_t.concat(mt.slice(vt,ct+2)),mt[ct]!==0&&(_t=_t.concat([0,mt[ct+1]]))}else if(Ce.fill==="toself"||Ce.fill==="tonext"){for(_t=[],Ze=0,oe.splitNull=!0,Ge=0;Ge-1;for(D=0;D{var d=RX();d.plot=GD(),Y.exports=d}),nQ=ze((te,Y)=>{Y.exports=iQ()}),ZD=ze((te,Y)=>{var d=ff(),y=Oc(),z=Sh().axisHoverFormat,{hovertemplateAttrs:P,templatefallbackAttrs:i}=rc(),n=A6(),a=dc().idRegex,l=ku().templatedArray,o=nn().extendFlat,u=d.marker,s=u.line,h=o(y("marker.line",{editTypeOverride:"calc"}),{width:o({},s.width,{editType:"calc"}),editType:"calc"}),m=o(y("marker"),{symbol:u.symbol,angle:u.angle,size:o({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:h,editType:"calc"});m.color.editType=m.cmin.editType=m.cmax.editType="style";function b(x){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:a[x],editType:"plot"}}}Y.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:o({},n.text,{}),hovertext:o({},n.hovertext,{}),hovertemplate:P(),hovertemplatefallback:i(),xhoverformat:z("x"),yhoverformat:z("y"),marker:m,xaxes:b("x"),yaxes:b("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:n.selected.marker,editType:"calc"},unselected:{marker:n.unselected.marker,editType:"calc"},opacity:n.opacity}}),lA=ze((te,Y)=>{Y.exports=function(d,y,z,P){P||(P=1/0);var i,n;for(i=0;i{var d=ji(),y=Zd(),z=ZD(),P=Bc(),i=X0(),n=lA(),a=tA().isOpenSymbol;Y.exports=function(u,s,h,m){function b(E,I){return d.coerce(u,s,z,E,I)}var x=y(u,s,{name:"dimensions",handleItemDefaults:l}),_=b("diagonal.visible"),A=b("showupperhalf"),f=b("showlowerhalf"),k=n(s,x,"values");if(!k||!_&&!A&&!f){s.visible=!1;return}b("text"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("xhoverformat"),b("yhoverformat"),i(u,s,h,m,b,{noAngleRef:!0,noStandOff:!0});var w=a(s.marker.symbol),D=P.isBubble(s);b("marker.line.width",w||D?1:0),o(u,s,m,b),d.coerceSelectionMarkerOpacity(s,b)};function l(u,s){function h(b,x){return d.coerce(u,s,z.dimensions,b,x)}h("label");var m=h("values");m&&m.length?h("visible"):s.visible=!1,h("axis.type"),h("axis.matches")}function o(u,s,h,m){var b=s.dimensions,x=b.length,_=s.showupperhalf,A=s.showlowerhalf,f=s.diagonal.visible,k,w,D=new Array(x),E=new Array(x);for(k=0;kw&&_||k{var d=ji();Y.exports=function(y,z){var P=y._fullLayout,i=z.uid,n=P._splomScenes;n||(n=P._splomScenes={});var a={dirty:!0,selectBatch:[],unselectBatch:[]},l={matrix:!1,selectBatch:[],unselectBatch:[]},o=n[z.uid];return o||(o=n[i]=d.extendFlat({},a,l),o.draw=function(){o.matrix&&o.matrix.draw&&(o.selectBatch.length||o.unselectBatch.length?o.matrix.draw(o.unselectBatch,o.selectBatch):o.matrix.draw()),o.dirty=!1},o.destroy=function(){o.matrix&&o.matrix.destroy&&o.matrix.destroy(),o.matrixOptions=null,o.selectBatch=null,o.unselectBatch=null,o=null}),o.dirty||d.extendFlat(o,a),o}}),sQ=ze((te,Y)=>{var d=ji(),y=Zc(),z=yt().calcMarkerSize,P=yt().calcAxisExpansion,i=zm(),n=Db().markerSelection,a=Db().markerStyle,l=oQ(),o=ei().BADNUM,u=q_().TOO_MANY_POINTS;Y.exports=function(s,h){var m=h.dimensions,b=h._length,x={},_=x.cdata=[],A=x.data=[],f=h._visibleDims=[],k,w,D,E,I;function M(N,B){for(var U=N.makeCalcdata({v:B.values,vcalendar:h.calendar},"v"),V=0;Vu,C;for(g?C=x.sizeAvg||Math.max(x.size,3):C=z(h,b),w=0;w{(function(){var d,y,z,P,i,n;typeof performance<"u"&&performance!==null&&performance.now?Y.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Y.exports=function(){return(d()-i)/1e6},y=process.hrtime,d=function(){var a;return a=y(),a[0]*1e9+a[1]},P=d(),n=process.uptime()*1e9,i=P-n):Date.now?(Y.exports=function(){return Date.now()-z},z=Date.now()):(Y.exports=function(){return new Date().getTime()-z},z=new Date().getTime())}).call(te)}),uQ=ze((te,Y)=>{var d=lQ(),y=window,z=["moz","webkit"],P="AnimationFrame",i=y["request"+P],n=y["cancel"+P]||y["cancelRequest"+P];for(a=0;!i&&a{Y.exports=function(d,y){var z=typeof d=="number",P=typeof y=="number";z&&!P?(y=d,d=0):!z&&!P&&(d=0,y=0),d=d|0,y=y|0;var i=y-d;if(i<0)throw new Error("array length must be positive");for(var n=new Array(i),a=0,l=d;a{var d=SD(),y=Qv(),z=Pb(),P=uQ(),i=cQ(),n=Gw(),a=Ib();Y.exports=l;function l(h,m){if(!(this instanceof l))return new l(h);this.traces=[],this.passes={},this.regl=h,this.scatter=d(h),this.canvas=this.scatter.canvas}l.prototype.render=function(...h){return h.length&&this.update(...h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=P(()=>{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,P(()=>{this.dirty=!1})),this)},l.prototype.update=function(...h){if(!h.length)return;for(let x=0;xT||!_.lower&&C{m[A+k]=x})}this.scatter.draw(...m)}return this},l.prototype.destroy=function(){return this.traces.forEach(h=>{h.buffer&&h.buffer.destroy&&h.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function o(h,m,b){let x=h.id!=null?h.id:h,_=m,A=b;return x<<16|(_&255)<<8|A&255}function u(h,m,b){let x,_,A,f,k=h[m],w=h[b];return k.length>2?(k[0],k[2],x=k[1],_=k[3]):k.length?(x=k[0],_=k[1]):(k.x,x=k.y,k.x+k.width,_=k.y+k.height),w.length>2?(A=w[0],f=w[2],w[1],w[3]):w.length?(A=w[0],f=w[1]):(A=w.x,w.y,f=w.x+w.width,w.y+w.height),[A,x,f,_]}function s(h){if(typeof h=="number")return[h,h,h,h];if(h.length===2)return[h[0],h[1],h[0],h[1]];{let m=n(h);return[m.x,m.y,m.x+m.width,m.y+m.height]}}}),fQ=ze((te,Y)=>{var d=hQ(),y=ji(),z=Zc(),P=dm().selectMode;Y.exports=function(n,a,l){if(l.length)for(var o=0;o-1,W=P(_)||!!u.selectedpoints||V,F=!0;if(W){var H=u._length;if(u.selectedpoints){h.selectBatch=u.selectedpoints;var q=u.selectedpoints,G={};for(k=0;k{te.getDimIndex=function(Y,d){for(var y=d._id,z=y.charAt(0),P={x:0,y:1}[z],i=Y._visibleDims,n=0;n{var d=KD(),y=eA().calcHover,z=Os().getFromId,P=nn().extendFlat;function i(a,l,o,u,s){s||(s={});var h=(u||"").charAt(0)==="x",m=(u||"").charAt(0)==="y",b=n(a,l,o);if((h||m)&&s.hoversubplots==="axis"&&b[0])for(var x=(h?a.xa:a.ya)._subplotsWith,_=s.gd,A=P({},a),f=0;f{var d=ji(),y=d.pushUnique,z=Bc(),P=KD();Y.exports=function(i,n){var a=i.cd,l=a[0].trace,o=a[0].t,u=i.scene,s=u.matrixOptions.cdata,h=i.xaxis,m=i.yaxis,b=[];if(!u)return b;var x=!z.hasMarkers(l)&&!z.hasText(l);if(l.visible!==!0||x)return b;var _=P.getDimIndex(l,h),A=P.getDimIndex(l,m);if(_===!1||A===!1)return b;var f=o.xpx[_],k=o.ypx[A],w=s[_],D=s[A],E=(i.scene.selectBatch||[]).slice(),I=[];if(n!==!1&&!n.degenerate)for(var M=0;M{var d=ji(),y=zm(),z=Db().markerStyle;Y.exports=function(P,i){var n=i.trace,a=P._fullLayout._splomScenes[n.uid];if(a){y(P,n),d.extendFlat(a.matrixOptions,z(P,n));var l=d.extendFlat({},a.matrixOptions,a.viewOpts);a.matrix.update(l,null)}}}),gQ=ze((te,Y)=>{var d=as(),y=AL();Y.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:ZD(),supplyDefaults:aQ(),colorbar:Mo(),calc:sQ(),plot:fQ(),hoverPoints:dQ().hoverPoints,selectPoints:pQ(),editStyle:mQ(),meta:{}},d.register(y)}),vQ=ze((te,Y)=>{var d=RD(),y=as(),z=sA(),P=Ed().getModuleCalcData,i=Ff(),n=Zc().getFromId,a=Os().shouldShowZeroLine,l="splom",o={};function u(_){var A=_._fullLayout,f=y.getModule(l),k=P(_.calcdata,f)[0],w=z(_,["ANGLE_instanced_arrays","OES_element_index_uint"],o);w&&(A._hasOnlyLargeSploms&&m(_),f.plot(_,{},k))}function s(_){var A=_.calcdata,f=_._fullLayout;f._hasOnlyLargeSploms&&m(_);for(var k=0;k{var d=gQ();d.basePlotModule=vQ(),Y.exports=d}),_Q=ze((te,Y)=>{Y.exports=yQ()}),YD=ze((te,Y)=>{var d=Oc(),y=Gd(),z=On(),P=Xh().attributes,i=nn().extendFlat,n=ku().templatedArray;Y.exports={domain:P({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:z({editType:"plot"}),tickfont:z({autoShadowDflt:!0,editType:"plot"}),rangefont:z({editType:"plot"}),dimensions:n("dimension",{label:{valType:"string",editType:"plot"},tickvals:i({},y.tickvals,{editType:"plot"}),ticktext:i({},y.ticktext,{editType:"plot"}),tickformat:i({},y.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:i({editType:"calc"},d("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}}),P6=ze((te,Y)=>{Y.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}),e1=ze((te,Y)=>{var d=k_();function y(z){return[z]}Y.exports={keyFun:function(z){return z.key},repeat:y,descend:d,wrap:y,unwrap:function(z){return z[0]}}}),XD=ze((te,Y)=>{var d=P6(),y=ri(),z=e1().keyFun,P=e1().repeat,i=ji().sorterAsc,n=ji().strTranslate,a=d.bar.snapRatio;function l(G,ee){return G*(1-a)+ee*a}var o=d.bar.snapClose;function u(G,ee){return G*(1-o)+ee*o}function s(G,ee,he,be){if(h(he,be))return he;var ve=G?-1:1,ce=0,re=ee.length-1;if(ve<0){var ge=ce;ce=re,re=ge}for(var ne=ee[ce],se=ne,_e=ce;ve*_e=ee[he][0]&&G<=ee[he][1])return!0;return!1}function m(G){G.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function b(G){G.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function x(G){if(!G.brush.filterSpecified)return"0,"+G.height;for(var ee=_(G.brush.filter.getConsolidated(),G.height),he=[0],be,ve,ce,re=ee.length?ee[0][0]:null,ge=0;geG[1]+he||ee=.9*G[1]+.1*G[0]?"n":ee<=.9*G[0]+.1*G[1]?"s":"ns"}function f(){y.select(document.body).style("cursor",null)}function k(G){G.attr("stroke-dasharray",x)}function w(G,ee){var he=y.select(G).selectAll(".highlight, .highlight-shadow"),be=ee?he.transition().duration(d.bar.snapDuration).each("end",ee):he;k(be)}function D(G,ee){var he=G.brush,be=he.filterSpecified,ve=NaN,ce={},re;if(be){var ge=G.height,ne=he.filter.getConsolidated(),se=_(ne,ge),_e=NaN,oe=NaN,J=NaN;for(re=0;re<=se.length;re++){var me=se[re];if(me&&me[0]<=ee&&ee<=me[1]){_e=re;break}else if(oe=re?re-1:NaN,me&&me[0]>ee){J=re;break}}if(ve=_e,isNaN(ve)&&(isNaN(oe)||isNaN(J)?ve=isNaN(oe)?J:oe:ve=ee-se[oe][1]=Ze[0]&&Be<=Ze[1]){ce.clickableOrdinalRange=Ze;break}}}return ce}function E(G,ee){y.event.sourceEvent.stopPropagation();var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,be=ee.unitToPaddedPx.invert(he),ve=ee.brush,ce=D(ee,he),re=ce.interval,ge=ve.svgBrush;if(ge.wasDragged=!1,ge.grabbingBar=ce.region==="ns",ge.grabbingBar){var ne=re.map(ee.unitToPaddedPx);ge.grabPoint=he-ne[0]-d.verticalPadding,ge.barLength=ne[1]-ne[0]}ge.clickableOrdinalRange=ce.clickableOrdinalRange,ge.stayingIntervals=ee.multiselect&&ve.filterSpecified?ve.filter.getConsolidated():[],re&&(ge.stayingIntervals=ge.stayingIntervals.filter(function(se){return se[0]!==re[0]&&se[1]!==re[1]})),ge.startExtent=ce.region?re[ce.region==="s"?1:0]:be,ee.parent.inBrushDrag=!0,ge.brushStartCallback()}function I(G,ee){y.event.sourceEvent.stopPropagation();var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,be=ee.brush.svgBrush;be.wasDragged=!0,be._dragging=!0,be.grabbingBar?be.newExtent=[he-be.grabPoint,he+be.barLength-be.grabPoint].map(ee.unitToPaddedPx.invert):be.newExtent=[be.startExtent,ee.unitToPaddedPx.invert(he)].sort(i),ee.brush.filterSpecified=!0,be.extent=be.stayingIntervals.concat([be.newExtent]),be.brushCallback(ee),w(G.parentNode)}function M(G,ee){var he=ee.brush,be=he.filter,ve=he.svgBrush;ve._dragging||(p(G,ee),I(G,ee),ee.brush.svgBrush.wasDragged=!1),ve._dragging=!1;var ce=y.event;ce.sourceEvent.stopPropagation();var re=ve.grabbingBar;if(ve.grabbingBar=!1,ve.grabLocation=void 0,ee.parent.inBrushDrag=!1,f(),!ve.wasDragged){ve.wasDragged=void 0,ve.clickableOrdinalRange?he.filterSpecified&&ee.multiselect?ve.extent.push(ve.clickableOrdinalRange):(ve.extent=[ve.clickableOrdinalRange],he.filterSpecified=!0):re?(ve.extent=ve.stayingIntervals,ve.extent.length===0&&U(he)):U(he),ve.brushCallback(ee),w(G.parentNode),ve.brushEndCallback(he.filterSpecified?be.getConsolidated():[]);return}var ge=function(){be.set(be.getConsolidated())};if(ee.ordinal){var ne=ee.unitTickvals;ne[ne.length-1]ve.newExtent[0];ve.extent=ve.stayingIntervals.concat(se?[ve.newExtent]:[]),ve.extent.length||U(he),ve.brushCallback(ee),se?w(G.parentNode,ge):(ge(),w(G.parentNode))}else ge();ve.brushEndCallback(he.filterSpecified?be.getConsolidated():[])}function p(G,ee){var he=ee.height-y.mouse(G)[1]-2*d.verticalPadding,be=D(ee,he),ve="crosshair";be.clickableOrdinalRange?ve="pointer":be.region&&(ve=be.region+"-resize"),y.select(document.body).style("cursor",ve)}function g(G){G.on("mousemove",function(ee){y.event.preventDefault(),ee.parent.inBrushDrag||p(this,ee)}).on("mouseleave",function(ee){ee.parent.inBrushDrag||f()}).call(y.behavior.drag().on("dragstart",function(ee){E(this,ee)}).on("drag",function(ee){I(this,ee)}).on("dragend",function(ee){M(this,ee)}))}function C(G,ee){return G[0]-ee[0]}function T(G,ee,he){var be=he._context.staticPlot,ve=G.selectAll(".background").data(P);ve.enter().append("rect").classed("background",!0).call(m).call(b).style("pointer-events",be?"none":"auto").attr("transform",n(0,d.verticalPadding)),ve.call(g).attr("height",function(ge){return ge.height-d.verticalPadding});var ce=G.selectAll(".highlight-shadow").data(P);ce.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",ee).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),ce.attr("y1",function(ge){return ge.height}).call(k);var re=G.selectAll(".highlight").data(P);re.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),re.attr("y1",function(ge){return ge.height}).call(k)}function N(G,ee,he){var be=G.selectAll("."+d.cn.axisBrush).data(P,z);be.enter().append("g").classed(d.cn.axisBrush,!0),T(be,ee,he)}function B(G){return G.svgBrush.extent.map(function(ee){return ee.slice()})}function U(G){G.filterSpecified=!1,G.svgBrush.extent=[[-1/0,1/0]]}function V(G){return function(ee){var he=ee.brush,be=B(he),ve=be.slice();he.filter.set(ve),G()}}function W(G){for(var ee=G.slice(),he=[],be,ve=ee.shift();ve;){for(be=ve.slice();(ve=ee.shift())&&ve[0]<=be[1];)be[1]=Math.max(be[1],ve[1]);he.push(be)}return he.length===1&&he[0][0]>he[0][1]&&(he=[]),he}function F(){var G=[],ee,he;return{set:function(be){G=be.map(function(ve){return ve.slice().sort(i)}).sort(C),G.length===1&&G[0][0]===-1/0&&G[0][1]===1/0&&(G=[[0,-1]]),ee=W(G),he=G.reduce(function(ve,ce){return[Math.min(ve[0],ce[0]),Math.max(ve[1],ce[1])]},[1/0,-1/0])},get:function(){return G.slice()},getConsolidated:function(){return ee},getBounds:function(){return he}}}function H(G,ee,he,be,ve,ce){var re=F();return re.set(he),{filter:re,filterSpecified:ee,svgBrush:{extent:[],brushStartCallback:be,brushCallback:V(ve),brushEndCallback:ce}}}function q(G,ee){if(Array.isArray(G[0])?(G=G.map(function(be){return be.sort(i)}),ee.multiselect?G=W(G.sort(C)):G=[G[0]]):G=[G.sort(i)],ee.tickvals){var he=ee.tickvals.slice().sort(i);if(G=G.map(function(be){var ve=[s(0,he,be[0],[]),s(1,he,be[1],[])];if(ve[1]>ve[0])return ve}).filter(function(be){return be}),!G.length)return}return G.length>1?G:G[0]}Y.exports={makeBrush:H,ensureAxisBrush:N,cleanRanges:q}}),xQ=ze((te,Y)=>{var d=ji(),y=hp().hasColorscale,z=Cc(),P=Xh().defaults,i=Zd(),n=Os(),a=YD(),l=XD(),o=P6().maxDimensionCount,u=lA();function s(m,b,x,_,A){var f=A("line.color",x);if(y(m,"line")&&d.isArrayOrTypedArray(f)){if(f.length)return A("line.colorscale"),z(m,b,_,A,{prefix:"line.",cLetter:"c"}),f.length;b.line.color=x}return 1/0}function h(m,b,x,_){function A(E,I){return d.coerce(m,b,a.dimensions,E,I)}var f=A("values"),k=A("visible");if(f&&f.length||(k=b.visible=!1),k){A("label"),A("tickvals"),A("ticktext"),A("tickformat");var w=A("range");b._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:w},n.setConvert(b._ax,_.layout),A("multiselect");var D=A("constraintrange");D&&(b.constraintrange=l.cleanRanges(D,b))}}Y.exports=function(m,b,x,_){function A(E,I){return d.coerce(m,b,a,E,I)}var f=m.dimensions;Array.isArray(f)&&f.length>o&&(d.log("parcoords traces support up to "+o+" dimensions at the moment"),f.splice(o));var k=i(m,b,{name:"dimensions",layout:_,handleItemDefaults:h}),w=s(m,b,x,_,A);P(b,_,A),(!Array.isArray(k)||!k.length)&&(b.visible=!1),u(b,k,"values",w);var D=d.extendFlat({},_.font,{size:Math.round(_.font.size/1.2)});d.coerceFont(A,"labelfont",D),d.coerceFont(A,"tickfont",D,{autoShadowDflt:!0}),d.coerceFont(A,"rangefont",D),A("labelangle"),A("labelside"),A("unselected.line.color"),A("unselected.line.opacity")}}),bQ=ze((te,Y)=>{var d=ji().isArrayOrTypedArray,y=lh(),z=e1().wrap;Y.exports=function(i,n){var a,l;return y.hasColorscale(n,"line")&&d(n.line.color)?(a=n.line.color,l=y.extractOpts(n.line).colorscale,y.calc(i,n,{vals:a,containerStr:"line",cLetter:"c"})):(a=P(n._length),l=[[0,n.line.color],[1,n.line.color]]),z({lineColor:a,cscale:l})};function P(i){for(var n=new Array(i),a=0;a>>16,(te&65280)>>>8,te&255],alpha:1};if(typeof te=="number")return{space:"rgb",values:[te>>>16,(te&65280)>>>8,te&255],alpha:1};if(te=String(te).toLowerCase(),uA.default[te])z=uA.default[te].slice(),i="rgb";else if(te==="transparent")P=0,i="rgb",z=[0,0,0];else if(te[0]==="#"){var n=te.slice(1),a=n.length,l=a<=4;P=1,l?(z=[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)],a===4&&(P=parseInt(n[3]+n[3],16)/255)):(z=[parseInt(n[0]+n[1],16),parseInt(n[2]+n[3],16),parseInt(n[4]+n[5],16)],a===8&&(P=parseInt(n[6]+n[7],16)/255)),z[0]||(z[0]=0),z[1]||(z[1]=0),z[2]||(z[2]=0),i="rgb"}else if(y=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(te)){var o=y[1];i=o.replace(/a$/,"");var u=i==="cmyk"?4:i==="gray"?1:3;z=y[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=z.shift()),z=z.map(function(s,h){if(s[s.length-1]==="%")return s=parseFloat(s)/100,h===3?s:i==="rgb"?s*255:i[0]==="h"||i[0]==="l"&&!h?s*100:i==="lab"?s*125:i==="lch"?h<2?s*150:s*360:i[0]==="o"&&!h?s:i==="oklab"?s*.4:i==="oklch"?h<2?s*.4:s*360:s;if(i[h]==="h"||h===2&&i[i.length-1]==="h"){if(cA[s]!==void 0)return cA[s];if(s.endsWith("deg"))return parseFloat(s);if(s.endsWith("turn"))return parseFloat(s)*360;if(s.endsWith("grad"))return parseFloat(s)*360/400;if(s.endsWith("rad"))return parseFloat(s)*180/Math.PI}return s==="none"?0:parseFloat(s)}),P=z.length>u?z.pop():1}else/[0-9](?:\s|\/|,)/.test(te)&&(z=te.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),i=((d=(Y=te.match(/([a-z])/ig))==null?void 0:Y.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:i,values:z,alpha:P}}var uA,JD,cA,kQ=Mr(()=>{uA=Cr(eD()),JD=wQ,cA={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}),I6,QD=Mr(()=>{I6={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}),D6,TQ=Mr(()=>{QD(),D6={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(te){var Y=te[0]/360,d=te[1]/100,y=te[2]/100,z,P,i,n,a,l=0;if(d===0)return a=y*255,[a,a,a];for(P=y<.5?y*(1+d):y+d-y*d,z=2*y-P,n=[0,0,0];l<3;)i=Y+1/3*-(l-1),i<0?i++:i>1&&i--,a=6*i<1?z+(P-z)*6*i:2*i<1?P:3*i<2?z+(P-z)*(2/3-i)*6:z,n[l++]=a*255;return n}},I6.hsl=function(te){var Y=te[0]/255,d=te[1]/255,y=te[2]/255,z=Math.min(Y,d,y),P=Math.max(Y,d,y),i=P-z,n,a,l;return P===z?n=0:Y===P?n=(d-y)/i:d===P?n=2+(y-Y)/i:y===P&&(n=4+(Y-d)/i),n=Math.min(n*60,360),n<0&&(n+=360),l=(z+P)/2,P===z?a=0:l<=.5?a=i/(P+z):a=i/(2-P-z),[n,a*100,l*100]}}),ez={};ni(ez,{default:()=>SQ});function SQ(te){Array.isArray(te)&&te.raw&&(te=String.raw(...arguments)),te instanceof Number&&(te=+te);var Y,d=JD(te);if(!d.space)return[];let y=d.space[0]==="h"?D6.min:I6.min,z=d.space[0]==="h"?D6.max:I6.max;return Y=Array(3),Y[0]=Math.min(Math.max(d.values[0],y[0]),z[0]),Y[1]=Math.min(Math.max(d.values[1],y[1]),z[1]),Y[2]=Math.min(Math.max(d.values[2],y[2]),z[2]),d.space[0]==="h"&&(Y=D6.rgb(Y)),Y.push(Math.min(Math.max(d.alpha,0),1)),Y}var CQ=Mr(()=>{kQ(),QD(),TQ()}),tz=ze(te=>{var Y=ji().isTypedArray;te.convertTypedArray=function(d){return Y(d)?Array.prototype.slice.call(d):d},te.isOrdinal=function(d){return!!d.tickvals},te.isVisible=function(d){return d.visible||!("visible"in d)}}),AQ=ze((te,Y)=>{var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` `),y=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),z=E6().maxDimensionCount,P=ji(),i=1e-6,n=2048,a=new Uint8Array(4),l=new Uint8Array(4),o={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function u(M){M.read({x:0,y:0,width:1,height:1,data:a})}function s(M,p,g,C,T){var N=M._gl;N.enable(N.SCISSOR_TEST),N.scissor(p,g,C,T),M.clear({color:[0,0,0,0],depth:1})}function h(M,p,g,C,T,N){var B=N.key;function U(V){var W=Math.min(C,T-V*C);V===0&&(window.cancelAnimationFrame(g.currentRafs[B]),delete g.currentRafs[B],s(M,N.scissorX,N.scissorY,N.scissorWidth,N.viewBoxSize[1])),!g.clearOnly&&(N.count=2*W,N.offset=2*V*C,p(N),V*C+W>>8*p)%256/255}function _(M,p,g){for(var C=new Array(M*(z+4)),T=0,N=0;NGe&&(Ge=oe[Ce].dim1.canvasX,Oe=Ce);fe===0&&s(T,0,0,W.canvasWidth,W.canvasHeight);var rt=re(g);for(Ce=0;Ce{var d=ii(),y=ji(),z=y.isArrayOrTypedArray,P=y.numberFormat,i=(kQ(),Ti(JD)).default,n=Os(),a=y.strRotate,l=y.strTranslate,o=cc(),u=Zs(),s=lh(),h=t1(),m=h.keyFun,b=h.repeat,x=h.unwrap,_=QD(),A=E6(),f=KD(),k=TQ();function w(xe,ve,ce){return y.aggNums(xe,null,ve,ce)}function D(xe,ve){return I(w(Math.min,xe,ve),w(Math.max,xe,ve))}function E(xe){var ve=xe.range;return ve?I(ve[0],ve[1]):D(xe.values,xe._length)}function I(xe,ve){return(isNaN(xe)||!isFinite(xe))&&(xe=0),(isNaN(ve)||!isFinite(ve))&&(ve=0),xe===ve&&(xe===0?(xe-=1,ve+=1):(xe*=.9,ve*=1.1)),[xe,ve]}function M(xe,ve){return ve?function(ce,re){var ge=ve[re];return ge??xe(ce)}:xe}function p(xe,ve,ce,re,ge){var ne=E(ce);return re?d.scale.ordinal().domain(re.map(M(P(ce.tickformat),ge))).range(re.map(function(se){var _e=(se-ne[0])/(ne[1]-ne[0]);return xe-ve+_e*(2*ve-xe)})):d.scale.linear().domain(ne).range([xe-ve,ve])}function g(xe,ve){return d.scale.linear().range([ve,xe-ve])}function C(xe,ve){return d.scale.linear().domain(E(xe)).range([ve,1-ve])}function T(xe){if(xe.tickvals){var ve=E(xe);return d.scale.ordinal().domain(xe.tickvals).range(xe.tickvals.map(function(ce){return(ce-ve[0])/(ve[1]-ve[0])}))}}function N(xe){var ve=xe.map(function(ne){return ne[0]}),ce=xe.map(function(ne){var se=i(ne[1]);return d.rgb("rgb("+se[0]+","+se[1]+","+se[2]+")")}),re=function(ne){return function(se){return se[ne]}},ge="rgb".split("").map(function(ne){return d.scale.linear().clamp(!0).domain(ve).range(ce.map(re(ne)))});return function(ne){return ge.map(function(se){return se(ne)})}}function B(xe){return xe.dimensions.some(function(ve){return ve.brush.filterSpecified})}function U(xe,ve,ce){var re=x(ve),ge=re.trace,ne=_.convertTypedArray(re.lineColor),se=ge.line,_e={color:i(ge.unselected.line.color),opacity:ge.unselected.line.opacity},oe=s.extractOpts(se),J=oe.reversescale?s.flipScale(re.cscale):re.cscale,me=ge.domain,fe=ge.dimensions,Ce=xe.width,Be=ge.labelangle,Oe=ge.labelside,Ze=ge.labelfont,Ge=ge.tickfont,rt=ge.rangefont,_t=y.extendDeepNoArrays({},se,{color:ne.map(d.scale.linear().domain(E({values:ne,range:[oe.min,oe.max],_length:ge._length}))),blockLineCount:A.blockLineCount,canvasOverdrag:A.overdrag*A.canvasPixelRatio}),pt=Math.floor(Ce*(me.x[1]-me.x[0])),gt=Math.floor(xe.height*(me.y[1]-me.y[0])),ct=xe.margin||{l:80,r:80,t:100,b:80},Ae=pt,ze=gt;return{key:ce,colCount:fe.filter(_.isVisible).length,dimensions:fe,tickDistance:A.tickDistance,unitToColor:N(J),lines:_t,deselectedLines:_e,labelAngle:Be,labelSide:Oe,labelFont:Ze,tickFont:Ge,rangeFont:rt,layoutWidth:Ce,layoutHeight:xe.height,domain:me,translateX:me.x[0]*Ce,translateY:xe.height-me.y[1]*xe.height,pad:ct,canvasWidth:Ae*A.canvasPixelRatio+2*_t.canvasOverdrag,canvasHeight:ze*A.canvasPixelRatio,width:Ae,height:ze,canvasPixelRatio:A.canvasPixelRatio}}function V(xe,ve,ce){var re=ce.width,ge=ce.height,ne=ce.dimensions,se=ce.canvasPixelRatio,_e=function(Ce){return re*Ce/Math.max(1,ce.colCount-1)},oe=A.verticalPadding/ge,J=g(ge,A.verticalPadding),me={key:ce.key,xScale:_e,model:ce,inBrushDrag:!1},fe={};return me.dimensions=ne.filter(_.isVisible).map(function(Ce,Be){var Oe=C(Ce,oe),Ze=fe[Ce.label];fe[Ce.label]=(Ze||0)+1;var Ge=Ce.label+(Ze?"__"+Ze:""),rt=Ce.constraintrange,_t=rt&&rt.length;_t&&!z(rt[0])&&(rt=[rt]);var pt=_t?rt.map(function(Gt){return Gt.map(Oe)}):[[-1/0,1/0]],gt=function(){var Gt=me;Gt.focusLayer&&Gt.focusLayer.render(Gt.panels,!0);var Jt=B(Gt);!xe.contextShown()&&Jt?(Gt.contextLayer&&Gt.contextLayer.render(Gt.panels,!0),xe.contextShown(!0)):xe.contextShown()&&!Jt&&(Gt.contextLayer&&Gt.contextLayer.render(Gt.panels,!0,!0),xe.contextShown(!1))},ct=Ce.values;ct.length>Ce._length&&(ct=ct.slice(0,Ce._length));var Ae=Ce.tickvals,ze;function Ee(Gt,Jt){return{val:Gt,text:ze[Jt]}}function nt(Gt,Jt){return Gt.val-Jt.val}if(z(Ae)&&Ae.length){y.isTypedArray(Ae)&&(Ae=Array.from(Ae)),ze=Ce.ticktext,!z(ze)||!ze.length?ze=Ae.map(P(Ce.tickformat)):ze.length>Ae.length?ze=ze.slice(0,Ae.length):Ae.length>ze.length&&(Ae=Ae.slice(0,ze.length));for(var xt=1;xt=Gt||Kr>=Jt)return;var ri=ut.lineLayer.readPixel(mr,Jt-1-Kr),Mr=ri[3]!==0,ui=Mr?ri[2]+256*(ri[1]+256*ri[0]):null,mi={x:mr,y:Kr,clientX:Et.clientX,clientY:Et.clientY,dataIndex:ut.model.key,curveNumber:ui};ui!==Be&&(Mr?re.hover(mi):re.unhover&&re.unhover(mi),Be=ui)}}),Ce.style("opacity",function(ut){return ut.pick?0:1}),se.style("background","rgba(255, 255, 255, 0)");var Ze=se.selectAll("."+A.cn.parcoords).data(fe,m);Ze.exit().remove(),Ze.enter().append("g").classed(A.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ze.attr("transform",function(ut){return l(ut.model.translateX,ut.model.translateY)});var Ge=Ze.selectAll("."+A.cn.parcoordsControlView).data(b,m);Ge.enter().append("g").classed(A.cn.parcoordsControlView,!0),Ge.attr("transform",function(ut){return l(ut.model.pad.l,ut.model.pad.t)});var rt=Ge.selectAll("."+A.cn.yAxis).data(function(ut){return ut.dimensions},m);rt.enter().append("g").classed(A.cn.yAxis,!0),Ge.each(function(ut){q(rt,ut,oe)}),Ce.each(function(ut){if(ut.viewModel){!ut.lineLayer||re?ut.lineLayer=k(this,ut):ut.lineLayer.update(ut),(ut.key||ut.key===0)&&(ut.viewModel[ut.key]=ut.lineLayer);var Et=!ut.context||re;ut.lineLayer.render(ut.viewModel.panels,Et)}}),rt.attr("transform",function(ut){return l(ut.xScale(ut.xIndex),0)}),rt.call(d.behavior.drag().origin(function(ut){return ut}).on("drag",function(ut){var Et=ut.parent;me.linePickActive(!1),ut.x=Math.max(-A.overdrag,Math.min(ut.model.width+A.overdrag,d.event.x)),ut.canvasX=ut.x*ut.model.canvasPixelRatio,rt.sort(function(Gt,Jt){return Gt.x-Jt.x}).each(function(Gt,Jt){Gt.xIndex=Jt,Gt.x=ut===Gt?Gt.x:Gt.xScale(Gt.xIndex),Gt.canvasX=Gt.x*Gt.model.canvasPixelRatio}),q(rt,Et,oe),rt.filter(function(Gt){return Math.abs(ut.xIndex-Gt.xIndex)!==0}).attr("transform",function(Gt){return l(Gt.xScale(Gt.xIndex),0)}),d.select(this).attr("transform",l(ut.x,0)),rt.each(function(Gt,Jt,gr){gr===ut.parent.key&&(Et.dimensions[Jt]=Gt)}),Et.contextLayer&&Et.contextLayer.render(Et.panels,!1,!B(Et)),Et.focusLayer.render&&Et.focusLayer.render(Et.panels)}).on("dragend",function(ut){var Et=ut.parent;ut.x=ut.xScale(ut.xIndex),ut.canvasX=ut.x*ut.model.canvasPixelRatio,q(rt,Et,oe),d.select(this).attr("transform",function(Gt){return l(Gt.x,0)}),Et.contextLayer&&Et.contextLayer.render(Et.panels,!1,!B(Et)),Et.focusLayer&&Et.focusLayer.render(Et.panels),Et.pickLayer&&Et.pickLayer.render(Et.panels,!0),me.linePickActive(!0),re&&re.axesMoved&&re.axesMoved(Et.key,Et.dimensions.map(function(Gt){return Gt.crossfilterDimensionIndex}))})),rt.exit().remove();var _t=rt.selectAll("."+A.cn.axisOverlays).data(b,m);_t.enter().append("g").classed(A.cn.axisOverlays,!0),_t.selectAll("."+A.cn.axis).remove();var pt=_t.selectAll("."+A.cn.axis).data(b,m);pt.enter().append("g").classed(A.cn.axis,!0),pt.each(function(ut){var Et=ut.model.height/ut.model.tickDistance,Gt=ut.domainScale,Jt=Gt.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Et,ut.tickFormat).tickValues(ut.ordinal?Jt:null).tickFormat(function(gr){return _.isOrdinal(ut)?gr:ee(ut.model.dimensions[ut.visibleIndex],gr)}).scale(Gt)),u.font(pt.selectAll("text"),ut.model.tickFont)}),pt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),pt.selectAll("text").style("cursor","default");var gt=_t.selectAll("."+A.cn.axisHeading).data(b,m);gt.enter().append("g").classed(A.cn.axisHeading,!0);var ct=gt.selectAll("."+A.cn.axisTitle).data(b,m);ct.enter().append("text").classed(A.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ge?"none":"auto"),ct.text(function(ut){return ut.label}).each(function(ut){var Et=d.select(this);u.font(Et,ut.model.labelFont),o.convertToTspans(Et,xe)}).attr("transform",function(ut){var Et=$(ut.model.labelAngle,ut.model.labelSide),Gt=A.axisTitleOffset;return(Et.dir>0?"":l(0,2*Gt+ut.model.height))+a(Et.degrees)+l(-Gt*Et.dx,-Gt*Et.dy)}).attr("text-anchor",function(ut){var Et=$(ut.model.labelAngle,ut.model.labelSide),Gt=Math.abs(Et.dx),Jt=Math.abs(Et.dy);return 2*Gt>Jt?Et.dir*Et.dx<0?"start":"end":"middle"});var Ae=_t.selectAll("."+A.cn.axisExtent).data(b,m);Ae.enter().append("g").classed(A.cn.axisExtent,!0);var ze=Ae.selectAll("."+A.cn.axisExtentTop).data(b,m);ze.enter().append("g").classed(A.cn.axisExtentTop,!0),ze.attr("transform",l(0,-A.axisExtentOffset));var Ee=ze.selectAll("."+A.cn.axisExtentTopText).data(b,m);Ee.enter().append("text").classed(A.cn.axisExtentTopText,!0).call(W),Ee.text(function(ut){return he(ut,!0)}).each(function(ut){u.font(d.select(this),ut.model.rangeFont)});var nt=Ae.selectAll("."+A.cn.axisExtentBottom).data(b,m);nt.enter().append("g").classed(A.cn.axisExtentBottom,!0),nt.attr("transform",function(ut){return l(0,ut.model.height+A.axisExtentOffset)});var xt=nt.selectAll("."+A.cn.axisExtentBottomText).data(b,m);xt.enter().append("text").classed(A.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(W),xt.text(function(ut){return he(ut,!1)}).each(function(ut){u.font(d.select(this),ut.model.rangeFont)}),f.ensureAxisBrush(_t,J,xe)}}),ez=Fe((a,Y)=>{var d=SQ(),y=aA(),z=QD().isVisible,P={};function i(l,o,u){var s=o.indexOf(u),h=l.indexOf(s);return h===-1&&(h+=o.length),h}function n(l,o){return function(u,s){return i(l,o,u)-i(l,o,s)}}var a=Y.exports=function(l,o){var u=l._fullLayout,s=y(l,[],P);if(s){var h={},m={},b={},x={},_=u._size;o.forEach(function(D,E){var I=D[0].trace;b[E]=I.index;var M=x[E]=I.index;h[E]=l.data[M].dimensions,m[E]=l.data[M].dimensions.slice()});var A=function(D,E,I){var M=m[D][E],p=I.map(function(U){return U.slice()}),g="dimensions["+E+"].constraintrange",C=u._tracePreGUI[l._fullData[b[D]]._fullInput.uid];if(C[g]===void 0){var T=M.constraintrange;C[g]=T||null}var N=l._fullData[b[D]].dimensions[E];p.length?(p.length===1&&(p=p[0]),M.constraintrange=p,N.constraintrange=p.slice(),p=[p]):(delete M.constraintrange,delete N.constraintrange,p=null);var B={};B[g]=p,l.emit("plotly_restyle",[B,[x[D]]])},f=function(D){l.emit("plotly_hover",D)},k=function(D){l.emit("plotly_unhover",D)},w=function(D,E){var I=n(E,m[D].filter(z));h[D].sort(I),m[D].filter(function(M){return!z(M)}).sort(function(M){return m[D].indexOf(M)}).forEach(function(M){h[D].splice(h[D].indexOf(M),1),h[D].splice(m[D].indexOf(M),0,M)}),l.emit("plotly_restyle",[{dimensions:[h[D]]},[x[D]]])};d(l,o,{width:_.w,height:_.h,margin:{t:_.t,r:_.r,b:_.b,l:_.l}},{filterChanged:A,hover:f,unhover:k,axesMoved:w})}};a.reglPrecompiled=P}),CQ=Fe(te=>{var Y=ii(),d=Md().getModuleCalcData,y=ez(),z=k0();te.name="parcoords",te.plot=function(P){var i=d(P.calcdata,"parcoords")[0];i.length&&y(P,i)},te.clean=function(P,i,n,a){var l=a._has&&a._has("parcoords"),o=i._has&&i._has("parcoords");l&&!o&&(a._paperdiv.selectAll(".parcoords").remove(),a._glimages.selectAll("*").remove())},te.toSVG=function(P){var i=P._fullLayout._glimages,n=Y.select(P).selectAll(".svg-container"),a=n.filter(function(o,u){return u===n.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function l(){var o=this,u=o.toDataURL("image/png"),s=i.append("svg:image");s.attr({xmlns:z.svg,"xlink:href":u,preserveAspectRatio:"none",x:0,y:0,width:o.style.width,height:o.style.height})}a.each(l),window.setTimeout(function(){Y.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),AQ=Fe((te,Y)=>{Y.exports={attributes:ZD(),supplyDefaults:vQ(),calc:yQ(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:CQ(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),MQ=Fe((te,Y)=>{var d=AQ();d.plot=ez(),Y.exports=d}),EQ=Fe((te,Y)=>{Y.exports=MQ()}),tz=Fe((te,Y)=>{var d=an().extendFlat,y=_a(),z=zn(),P=zc(),{hovertemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=Xh().attributes,l=d({editType:"calc"},P("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:i({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:n({editType:"plot"})});Y.exports={domain:a({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},y.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:i({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:n({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:z({editType:"calc"}),tickfont:z({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),LQ=Fe((te,Y)=>{var d=ji(),y=cp().hasColorscale,z=Cc(),P=Xh().defaults,i=Gd(),n=tz(),a=oA(),l=Di().isTypedArraySpec;function o(s,h,m,b,x){x("line.shape"),x("line.hovertemplate"),x("line.hovertemplatefallback");var _=x("line.color",b.colorway[0]);if(y(s,"line")&&d.isArrayOrTypedArray(_)){if(_.length)return x("line.colorscale"),z(s,h,b,x,{prefix:"line.",cLetter:"c"}),_.length;h.line.color=m}return 1/0}function u(s,h){function m(w,D){return d.coerce(s,h,n.dimensions,w,D)}var b=m("values"),x=m("visible");if(b&&b.length||(x=h.visible=!1),x){m("label"),m("displayindex",h._index);var _=s.categoryarray,A=d.isArrayOrTypedArray(_)&&_.length>0||l(_),f;A&&(f="array");var k=m("categoryorder",f);k==="array"?(m("categoryarray"),m("ticktext")):(delete s.categoryarray,delete s.ticktext),!A&&k==="array"&&(h.categoryorder="trace")}}Y.exports=function(s,h,m,b){function x(k,w){return d.coerce(s,h,n,k,w)}var _=i(s,h,{name:"dimensions",handleItemDefaults:u}),A=o(s,h,m,b,x);P(h,b,x),(!Array.isArray(_)||!_.length)&&(h.visible=!1),a(h,_,"values",A),x("hoveron"),x("hovertemplate"),x("hovertemplatefallback"),x("arrangement"),x("bundlecolors"),x("sortpaths"),x("counts");var f=b.font;d.coerceFont(x,"labelfont",f,{overrideDflt:{size:Math.round(f.size)}}),d.coerceFont(x,"tickfont",f,{autoShadowDflt:!0,overrideDflt:{size:Math.round(f.size/1.2)}})}}),PQ=Fe((te,Y)=>{var d=t1().wrap,y=cp().hasColorscale,z=kp(),P=Nc(),i=Zs(),n=ji(),a=Ar();Y.exports=function(f,k){var w=n.filterVisible(k.dimensions);if(w.length===0)return[];var D=w.map(function(ce){var re;if(ce.categoryorder==="trace")re=null;else if(ce.categoryorder==="array")re=ce.categoryarray;else{re=P(ce.values);for(var ge=!0,ne=0;ne=f.length||k[f[w]]!==void 0)return!1;k[f[w]]=!0}return!0}}),IQ=Fe((te,Y)=>{var d=ii(),y=(Ab(),Ti(R_)).interpolateNumber,z=ww(),P=hf(),i=ji(),n=i.strTranslate,a=Zs(),l=sn(),o=cc();function u(se,_e,oe,J){var me=_e._context.staticPlot,fe=se.map(ve.bind(0,_e,oe)),Ce=J.selectAll("g.parcatslayer").data([null]);Ce.enter().append("g").attr("class","parcatslayer").style("pointer-events",me?"none":"all");var Be=Ce.selectAll("g.trace.parcats").data(fe,s),Oe=Be.enter().append("g").attr("class","trace parcats");Be.attr("transform",function(Ee){return n(Ee.x,Ee.y)}),Oe.append("g").attr("class","paths");var Ze=Be.select("g.paths"),Ge=Ze.selectAll("path.path").data(function(Ee){return Ee.paths},s);Ge.attr("fill",function(Ee){return Ee.model.color});var rt=Ge.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Ee){return Ee.model.color}).attr("fill-opacity",0);k(rt),Ge.attr("d",function(Ee){return Ee.svgD}),rt.empty()||Ge.sort(m),Ge.exit().remove(),Ge.on("mouseover",b).on("mouseout",x).on("click",f),Oe.append("g").attr("class","dimensions");var _t=Be.select("g.dimensions"),pt=_t.selectAll("g.dimension").data(function(Ee){return Ee.dimensions},s);pt.enter().append("g").attr("class","dimension"),pt.attr("transform",function(Ee){return n(Ee.x,0)}),pt.exit().remove();var gt=pt.selectAll("g.category").data(function(Ee){return Ee.categories},s),ct=gt.enter().append("g").attr("class","category");gt.attr("transform",function(Ee){return n(0,Ee.y)}),ct.append("rect").attr("class","catrect").attr("pointer-events","none"),gt.select("rect.catrect").attr("fill","none").attr("width",function(Ee){return Ee.width}).attr("height",function(Ee){return Ee.height}),E(ct);var Ae=gt.selectAll("rect.bandrect").data(function(Ee){return Ee.bands},s);Ae.each(function(){i.raiseToTop(this)}),Ae.attr("fill",function(Ee){return Ee.color});var ze=Ae.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Ee){return Ee.color}).attr("fill-opacity",0);Ae.attr("fill",function(Ee){return Ee.color}).attr("width",function(Ee){return Ee.width}).attr("height",function(Ee){return Ee.height}).attr("y",function(Ee){return Ee.y}).attr("cursor",function(Ee){return Ee.parcatsViewModel.arrangement==="fixed"?"default":Ee.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),M(ze),Ae.exit().remove(),ct.append("text").attr("class","catlabel").attr("pointer-events","none"),gt.select("text.catlabel").attr("text-anchor",function(Ee){return h(Ee)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Ee){return h(Ee)?Ee.width+5:-5}).attr("y",function(Ee){return Ee.height/2}).text(function(Ee){return Ee.model.categoryLabel}).each(function(Ee){a.font(d.select(this),Ee.parcatsViewModel.categorylabelfont),o.convertToTspans(d.select(this),_e)}),ct.append("text").attr("class","dimlabel"),gt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Ee){return Ee.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Ee){return Ee.width/2}).attr("y",-5).text(function(Ee,nt){return nt===0?Ee.parcatsViewModel.model.dimensions[Ee.model.dimensionInd].dimensionLabel:null}).each(function(Ee){a.font(d.select(this),Ee.parcatsViewModel.labelfont)}),gt.selectAll("rect.bandrect").on("mouseover",W).on("mouseout",F),gt.exit().remove(),pt.call(d.behavior.drag().origin(function(Ee){return{x:Ee.x,y:0}}).on("dragstart",$).on("drag",q).on("dragend",G)),Be.each(function(Ee){Ee.traceSelection=d.select(this),Ee.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),Ee.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Be.exit().remove()}Y.exports=function(se,_e,oe,J){u(oe,se,J,_e)};function s(se){return se.key}function h(se){var _e=se.parcatsViewModel.dimensions.length,oe=se.parcatsViewModel.dimensions[_e-1].model.dimensionInd;return se.model.dimensionInd===oe}function m(se,_e){return se.model.rawColor>_e.model.rawColor?1:se.model.rawColor<_e.model.rawColor?-1:0}function b(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){i.raiseToTop(this),w(d.select(this));var _e=_(se),oe=A(se);if(se.parcatsViewModel.graphDiv.emit("plotly_hover",{points:_e,event:d.event,constraints:oe}),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var J=d.mouse(this)[0],me=se.parcatsViewModel.graphDiv,fe=se.parcatsViewModel.trace,Ce=me._fullLayout,Be=Ce._paperdiv.node().getBoundingClientRect(),Oe=se.parcatsViewModel.graphDiv.getBoundingClientRect(),Ze,Ge,rt;for(rt=0;rt"),Et=d.mouse(me)[0];P.loneHover({trace:fe,x:gt-Be.left+Oe.left,y:ct-Be.top+Oe.top,text:ut,color:se.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ae,idealAlign:Et1&&Ze.displayInd===Oe.dimensions.length-1?(_t=Ce.left,pt="left"):(_t=Ce.left+Ce.width,pt="right");var gt=Be.model.count,ct=Be.model.categoryLabel,Ae=gt/Be.parcatsViewModel.model.count,ze={countLabel:gt,categoryLabel:ct,probabilityLabel:Ae.toFixed(3)},Ee=[];Be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ee.push(["Count:",ze.countLabel].join(" ")),Be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Ee.push(["P("+ze.categoryLabel+"):",ze.probabilityLabel].join(" "));var nt=Ee.join("
");return{trace:Ge,x:J*(_t-_e.left),y:me*(rt-_e.top),text:nt,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:pt,hovertemplate:Ge.hovertemplate,hovertemplateLabels:ze,eventData:[{data:Ge._input,fullData:Ge,count:gt,category:ct,probability:Ae}]}}function U(se,_e,oe){var J=[];return d.select(oe.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var me=this;J.push(B(se,_e,me))}),J}function V(se,_e,oe){se._fullLayout._calcInverseTransform(se);var J=se._fullLayout._invScaleX,me=se._fullLayout._invScaleY,fe=oe.getBoundingClientRect(),Ce=d.select(oe).datum(),Be=Ce.categoryViewModel,Oe=Be.parcatsViewModel,Ze=Oe.model.dimensions[Be.model.dimensionInd],Ge=Oe.trace,rt=fe.y+fe.height/2,_t,pt;Oe.dimensions.length>1&&Ze.displayInd===Oe.dimensions.length-1?(_t=fe.left,pt="left"):(_t=fe.left+fe.width,pt="right");var gt=Be.model.categoryLabel,ct=Ce.parcatsViewModel.model.count,Ae=0;Ce.categoryViewModel.bands.forEach(function(mr){mr.color===Ce.color&&(Ae+=mr.count)});var ze=Be.model.count,Ee=0;Oe.pathSelection.each(function(mr){mr.model.color===Ce.color&&(Ee+=mr.model.count)});var nt=Ae/ct,xt=Ae/Ee,ut=Ae/ze,Et={countLabel:Ae,categoryLabel:gt,probabilityLabel:nt.toFixed(3)},Gt=[];Be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Gt.push(["Count:",Et.countLabel].join(" ")),Be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Gt.push("P(color ∩ "+gt+"): "+Et.probabilityLabel),Gt.push("P("+gt+" | color): "+xt.toFixed(3)),Gt.push("P(color | "+gt+"): "+ut.toFixed(3)));var Jt=Gt.join("
"),gr=l.mostReadable(Ce.color,["black","white"]);return{trace:Ge,x:J*(_t-_e.left),y:me*(rt-_e.top),text:Jt,color:Ce.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:gr,fontSize:10,idealAlign:pt,hovertemplate:Ge.hovertemplate,hovertemplateLabels:Et,eventData:[{data:Ge._input,fullData:Ge,category:gt,count:ct,probability:nt,categorycount:ze,colorcount:Ee,bandcolorcount:Ae}]}}function W(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var _e=d.mouse(this)[1];if(_e<-1)return;var oe=se.parcatsViewModel.graphDiv,J=oe._fullLayout,me=J._paperdiv.node().getBoundingClientRect(),fe=se.parcatsViewModel.hoveron,Ce=this;if(fe==="color"?(C(Ce),N(Ce,"plotly_hover",d.event)):(g(Ce),T(Ce,"plotly_hover",d.event)),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Be;fe==="category"?Be=B(oe,me,Ce):fe==="color"?Be=V(oe,me,Ce):fe==="dimension"&&(Be=U(oe,me,Ce)),Be&&P.loneHover(Be,{container:J._hoverlayer.node(),outerContainer:J._paper.node(),gd:oe})}}}function F(se){var _e=se.parcatsViewModel;if(!_e.dragDimension&&(k(_e.pathSelection),E(_e.dimensionSelection.selectAll("g.category")),M(_e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),P.loneUnhover(_e.graphDiv._fullLayout._hoverlayer.node()),_e.pathSelection.sort(m),_e.hoverinfoItems.indexOf("skip")===-1)){var oe=se.parcatsViewModel.hoveron,J=this;oe==="color"?N(J,"plotly_unhover",d.event):T(J,"plotly_unhover",d.event)}}function $(se){se.parcatsViewModel.arrangement!=="fixed"&&(se.dragDimensionDisplayInd=se.model.displayInd,se.initialDragDimensionDisplayInds=se.parcatsViewModel.model.dimensions.map(function(_e){return _e.displayInd}),se.dragHasMoved=!1,se.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(_e){var oe=d.mouse(this)[0],J=d.mouse(this)[1];-2<=oe&&oe<=_e.width+2&&-2<=J&&J<=_e.height+2&&(se.dragCategoryDisplayInd=_e.model.displayInd,se.initialDragCategoryDisplayInds=se.model.categories.map(function(me){return me.displayInd}),_e.model.dragY=_e.y,i.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(me){me.yGe.y+Ge.height/2&&(fe.model.displayInd=Ge.model.displayInd,Ge.model.displayInd=Be),se.dragCategoryDisplayInd=fe.model.displayInd}if(se.dragCategoryDisplayInd===null||se.parcatsViewModel.arrangement==="freeform"){me.model.dragX=d.event.x;var rt=se.parcatsViewModel.dimensions[oe],_t=se.parcatsViewModel.dimensions[J];rt!==void 0&&me.model.dragX_t.x&&(me.model.displayInd=_t.model.displayInd,_t.model.displayInd=se.dragDimensionDisplayInd),se.dragDimensionDisplayInd=me.model.displayInd}ge(se.parcatsViewModel),re(se.parcatsViewModel),xe(se.parcatsViewModel),he(se.parcatsViewModel)}}function G(se){if(se.parcatsViewModel.arrangement!=="fixed"&&se.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var _e={},oe=ee(se.parcatsViewModel),J=se.parcatsViewModel.model.dimensions.map(function(_t){return _t.displayInd}),me=se.initialDragDimensionDisplayInds.some(function(_t,pt){return _t!==J[pt]});me&&J.forEach(function(_t,pt){var gt=se.parcatsViewModel.model.dimensions[pt].containerInd;_e["dimensions["+gt+"].displayindex"]=_t});var fe=!1;if(se.dragCategoryDisplayInd!==null){var Ce=se.model.categories.map(function(_t){return _t.displayInd});if(fe=se.initialDragCategoryDisplayInds.some(function(_t,pt){return _t!==Ce[pt]}),fe){var Be=se.model.categories.slice().sort(function(_t,pt){return _t.displayInd-pt.displayInd}),Oe=Be.map(function(_t){return _t.categoryValue}),Ze=Be.map(function(_t){return _t.categoryLabel});_e["dimensions["+se.model.containerInd+"].categoryarray"]=[Oe],_e["dimensions["+se.model.containerInd+"].ticktext"]=[Ze],_e["dimensions["+se.model.containerInd+"].categoryorder"]="array"}}if(se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!se.dragHasMoved&&se.potentialClickBand&&(se.parcatsViewModel.hoveron==="color"?N(se.potentialClickBand,"plotly_click",d.event.sourceEvent):T(se.potentialClickBand,"plotly_click",d.event.sourceEvent)),se.model.dragX=null,se.dragCategoryDisplayInd!==null){var Ge=se.parcatsViewModel.dimensions[se.dragDimensionDisplayInd].categories[se.dragCategoryDisplayInd];Ge.model.dragY=null,se.dragCategoryDisplayInd=null}se.dragDimensionDisplayInd=null,se.parcatsViewModel.dragDimension=null,se.dragHasMoved=null,se.potentialClickBand=null,ge(se.parcatsViewModel),re(se.parcatsViewModel);var rt=d.transition().duration(300).ease("cubic-in-out");rt.each(function(){xe(se.parcatsViewModel,!0),he(se.parcatsViewModel,!0)}).each("end",function(){(me||fe)&&z.restyle(se.parcatsViewModel.graphDiv,_e,[oe])})}}function ee(se){for(var _e,oe=se.graphDiv._fullData,J=0;J=0;Oe--)Ze+="C"+Ce[Oe]+","+(_e[Oe+1]+J)+" "+fe[Oe]+","+(_e[Oe]+J)+" "+(se[Oe]+oe[Oe])+","+(_e[Oe]+J),Ze+="l-"+oe[Oe]+",0 ";return Ze+="Z",Ze}function re(se){var _e=se.dimensions,oe=se.model,J=_e.map(function(Mr){return Mr.categories.map(function(ui){return ui.y})}),me=se.model.dimensions.map(function(Mr){return Mr.categories.map(function(ui){return ui.displayInd})}),fe=se.model.dimensions.map(function(Mr){return Mr.displayInd}),Ce=se.dimensions.map(function(Mr){return Mr.model.dimensionInd}),Be=_e.map(function(Mr){return Mr.x}),Oe=_e.map(function(Mr){return Mr.width}),Ze=[];for(var Ge in oe.paths)oe.paths.hasOwnProperty(Ge)&&Ze.push(oe.paths[Ge]);function rt(Mr){var ui=Mr.categoryInds.map(function(Ot,Je){return me[Je][Ot]}),mi=Ce.map(function(Ot){return ui[Ot]});return mi}Ze.sort(function(Mr,ui){var mi=rt(Mr),Ot=rt(ui);return se.sortpaths==="backward"&&(mi.reverse(),Ot.reverse()),mi.push(Mr.valueInds[0]),Ot.push(ui.valueInds[0]),se.bundlecolors&&(mi.unshift(Mr.rawColor),Ot.unshift(ui.rawColor)),miOt?1:0});for(var _t=new Array(Ze.length),pt=_e[0].model.count,gt=_e[0].categories.map(function(Mr){return Mr.height}).reduce(function(Mr,ui){return Mr+ui}),ct=0;ct0?ze=gt*(Ae.count/pt):ze=0;for(var Ee=new Array(J.length),nt=0;nt1?Ce=(se.width-2*oe-J)/(me-1):Ce=0,Be=oe,Oe=Be+Ce*fe;var Ze=[],Ge=se.model.maxCats,rt=_e.categories.length,_t=8,pt=_e.count,gt=se.height-_t*(Ge-1),ct,Ae,ze,Ee,nt,xt=(Ge-rt)*_t/2,ut=_e.categories.map(function(Et){return{displayInd:Et.displayInd,categoryInd:Et.categoryInd}});for(ut.sort(function(Et,Gt){return Et.displayInd-Gt.displayInd}),nt=0;nt0?ct=Ae.count/pt*gt:ct=0,ze={key:Ae.valueInds[0],model:Ae,width:J,height:ct,y:Ae.dragY!==null?Ae.dragY:xt,bands:[],parcatsViewModel:se},xt=xt+ct+_t,Ze.push(ze);return{key:_e.dimensionInd,x:_e.dragX!==null?_e.dragX:Oe,y:0,width:J,model:_e,categories:Ze,parcatsViewModel:se,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),rz=Fe((te,Y)=>{var d=IQ();Y.exports=function(y,z,P,i){var n=y._fullLayout,a=n._paper,l=n._size;d(y,a,z,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},P,i)}}),DQ=Fe(te=>{var Y=Md().getModuleCalcData,d=rz(),y="parcats";te.name=y,te.plot=function(z,P,i,n){var a=Y(z.calcdata,y);if(a.length){var l=a[0];d(z,l,i,n)}},te.clean=function(z,P,i,n){var a=n._has&&n._has("parcats"),l=P._has&&P._has("parcats");a&&!l&&n._paperdiv.selectAll(".parcats").remove()}}),zQ=Fe((te,Y)=>{Y.exports={attributes:tz(),supplyDefaults:LQ(),calc:PQ(),plot:rz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:DQ(),categories:["noOpacity"],meta:{}}}),OQ=Fe((te,Y)=>{Y.exports=zQ()}),hy=Fe((te,Y)=>{var d=Ym(),y="1.13.4",z='© OpenStreetMap contributors',P=['© Carto',z].join(" "),i=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),n=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),a={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:z,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=d(a);Y.exports={requiredVersion:y,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:a,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+y+"."].join(` +`),z=P6().maxDimensionCount,P=ji(),i=1e-6,n=2048,a=new Uint8Array(4),l=new Uint8Array(4),o={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function u(M){M.read({x:0,y:0,width:1,height:1,data:a})}function s(M,p,g,C,T){var N=M._gl;N.enable(N.SCISSOR_TEST),N.scissor(p,g,C,T),M.clear({color:[0,0,0,0],depth:1})}function h(M,p,g,C,T,N){var B=N.key;function U(V){var W=Math.min(C,T-V*C);V===0&&(window.cancelAnimationFrame(g.currentRafs[B]),delete g.currentRafs[B],s(M,N.scissorX,N.scissorY,N.scissorWidth,N.viewBoxSize[1])),!g.clearOnly&&(N.count=2*W,N.offset=2*V*C,p(N),V*C+W>>8*p)%256/255}function _(M,p,g){for(var C=new Array(M*(z+4)),T=0,N=0;NGe&&(Ge=oe[Ce].dim1.canvasX,Be=Ce);fe===0&&s(T,0,0,W.canvasWidth,W.canvasHeight);var tt=re(g);for(Ce=0;Ce{var d=ri(),y=ji(),z=y.isArrayOrTypedArray,P=y.numberFormat,i=(CQ(),gi(ez)).default,n=Os(),a=y.strRotate,l=y.strTranslate,o=cc(),u=Zs(),s=lh(),h=e1(),m=h.keyFun,b=h.repeat,x=h.unwrap,_=tz(),A=P6(),f=XD(),k=AQ();function w(be,ve,ce){return y.aggNums(be,null,ve,ce)}function D(be,ve){return I(w(Math.min,be,ve),w(Math.max,be,ve))}function E(be){var ve=be.range;return ve?I(ve[0],ve[1]):D(be.values,be._length)}function I(be,ve){return(isNaN(be)||!isFinite(be))&&(be=0),(isNaN(ve)||!isFinite(ve))&&(ve=0),be===ve&&(be===0?(be-=1,ve+=1):(be*=.9,ve*=1.1)),[be,ve]}function M(be,ve){return ve?function(ce,re){var ge=ve[re];return ge??be(ce)}:be}function p(be,ve,ce,re,ge){var ne=E(ce);return re?d.scale.ordinal().domain(re.map(M(P(ce.tickformat),ge))).range(re.map(function(se){var _e=(se-ne[0])/(ne[1]-ne[0]);return be-ve+_e*(2*ve-be)})):d.scale.linear().domain(ne).range([be-ve,ve])}function g(be,ve){return d.scale.linear().range([ve,be-ve])}function C(be,ve){return d.scale.linear().domain(E(be)).range([ve,1-ve])}function T(be){if(be.tickvals){var ve=E(be);return d.scale.ordinal().domain(be.tickvals).range(be.tickvals.map(function(ce){return(ce-ve[0])/(ve[1]-ve[0])}))}}function N(be){var ve=be.map(function(ne){return ne[0]}),ce=be.map(function(ne){var se=i(ne[1]);return d.rgb("rgb("+se[0]+","+se[1]+","+se[2]+")")}),re=function(ne){return function(se){return se[ne]}},ge="rgb".split("").map(function(ne){return d.scale.linear().clamp(!0).domain(ve).range(ce.map(re(ne)))});return function(ne){return ge.map(function(se){return se(ne)})}}function B(be){return be.dimensions.some(function(ve){return ve.brush.filterSpecified})}function U(be,ve,ce){var re=x(ve),ge=re.trace,ne=_.convertTypedArray(re.lineColor),se=ge.line,_e={color:i(ge.unselected.line.color),opacity:ge.unselected.line.opacity},oe=s.extractOpts(se),J=oe.reversescale?s.flipScale(re.cscale):re.cscale,me=ge.domain,fe=ge.dimensions,Ce=be.width,Re=ge.labelangle,Be=ge.labelside,Ze=ge.labelfont,Ge=ge.tickfont,tt=ge.rangefont,_t=y.extendDeepNoArrays({},se,{color:ne.map(d.scale.linear().domain(E({values:ne,range:[oe.min,oe.max],_length:ge._length}))),blockLineCount:A.blockLineCount,canvasOverdrag:A.overdrag*A.canvasPixelRatio}),mt=Math.floor(Ce*(me.x[1]-me.x[0])),vt=Math.floor(be.height*(me.y[1]-me.y[0])),ct=be.margin||{l:80,r:80,t:100,b:80},Ae=mt,Oe=vt;return{key:ce,colCount:fe.filter(_.isVisible).length,dimensions:fe,tickDistance:A.tickDistance,unitToColor:N(J),lines:_t,deselectedLines:_e,labelAngle:Re,labelSide:Be,labelFont:Ze,tickFont:Ge,rangeFont:tt,layoutWidth:Ce,layoutHeight:be.height,domain:me,translateX:me.x[0]*Ce,translateY:be.height-me.y[1]*be.height,pad:ct,canvasWidth:Ae*A.canvasPixelRatio+2*_t.canvasOverdrag,canvasHeight:Oe*A.canvasPixelRatio,width:Ae,height:Oe,canvasPixelRatio:A.canvasPixelRatio}}function V(be,ve,ce){var re=ce.width,ge=ce.height,ne=ce.dimensions,se=ce.canvasPixelRatio,_e=function(Ce){return re*Ce/Math.max(1,ce.colCount-1)},oe=A.verticalPadding/ge,J=g(ge,A.verticalPadding),me={key:ce.key,xScale:_e,model:ce,inBrushDrag:!1},fe={};return me.dimensions=ne.filter(_.isVisible).map(function(Ce,Re){var Be=C(Ce,oe),Ze=fe[Ce.label];fe[Ce.label]=(Ze||0)+1;var Ge=Ce.label+(Ze?"__"+Ze:""),tt=Ce.constraintrange,_t=tt&&tt.length;_t&&!z(tt[0])&&(tt=[tt]);var mt=_t?tt.map(function(Gt){return Gt.map(Be)}):[[-1/0,1/0]],vt=function(){var Gt=me;Gt.focusLayer&&Gt.focusLayer.render(Gt.panels,!0);var Qt=B(Gt);!be.contextShown()&&Qt?(Gt.contextLayer&&Gt.contextLayer.render(Gt.panels,!0),be.contextShown(!0)):be.contextShown()&&!Qt&&(Gt.contextLayer&&Gt.contextLayer.render(Gt.panels,!0,!0),be.contextShown(!1))},ct=Ce.values;ct.length>Ce._length&&(ct=ct.slice(0,Ce._length));var Ae=Ce.tickvals,Oe;function Le(Gt,Qt){return{val:Gt,text:Oe[Qt]}}function nt(Gt,Qt){return Gt.val-Qt.val}if(z(Ae)&&Ae.length){y.isTypedArray(Ae)&&(Ae=Array.from(Ae)),Oe=Ce.ticktext,!z(Oe)||!Oe.length?Oe=Ae.map(P(Ce.tickformat)):Oe.length>Ae.length?Oe=Oe.slice(0,Ae.length):Ae.length>Oe.length&&(Ae=Ae.slice(0,Oe.length));for(var xt=1;xt=Gt||Yr>=Qt)return;var ii=ut.lineLayer.readPixel(mr,Qt-1-Yr),Lr=ii[3]!==0,ci=Lr?ii[2]+256*(ii[1]+256*ii[0]):null,vi={x:mr,y:Yr,clientX:Et.clientX,clientY:Et.clientY,dataIndex:ut.model.key,curveNumber:ci};ci!==Re&&(Lr?re.hover(vi):re.unhover&&re.unhover(vi),Re=ci)}}),Ce.style("opacity",function(ut){return ut.pick?0:1}),se.style("background","rgba(255, 255, 255, 0)");var Ze=se.selectAll("."+A.cn.parcoords).data(fe,m);Ze.exit().remove(),Ze.enter().append("g").classed(A.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ze.attr("transform",function(ut){return l(ut.model.translateX,ut.model.translateY)});var Ge=Ze.selectAll("."+A.cn.parcoordsControlView).data(b,m);Ge.enter().append("g").classed(A.cn.parcoordsControlView,!0),Ge.attr("transform",function(ut){return l(ut.model.pad.l,ut.model.pad.t)});var tt=Ge.selectAll("."+A.cn.yAxis).data(function(ut){return ut.dimensions},m);tt.enter().append("g").classed(A.cn.yAxis,!0),Ge.each(function(ut){q(tt,ut,oe)}),Ce.each(function(ut){if(ut.viewModel){!ut.lineLayer||re?ut.lineLayer=k(this,ut):ut.lineLayer.update(ut),(ut.key||ut.key===0)&&(ut.viewModel[ut.key]=ut.lineLayer);var Et=!ut.context||re;ut.lineLayer.render(ut.viewModel.panels,Et)}}),tt.attr("transform",function(ut){return l(ut.xScale(ut.xIndex),0)}),tt.call(d.behavior.drag().origin(function(ut){return ut}).on("drag",function(ut){var Et=ut.parent;me.linePickActive(!1),ut.x=Math.max(-A.overdrag,Math.min(ut.model.width+A.overdrag,d.event.x)),ut.canvasX=ut.x*ut.model.canvasPixelRatio,tt.sort(function(Gt,Qt){return Gt.x-Qt.x}).each(function(Gt,Qt){Gt.xIndex=Qt,Gt.x=ut===Gt?Gt.x:Gt.xScale(Gt.xIndex),Gt.canvasX=Gt.x*Gt.model.canvasPixelRatio}),q(tt,Et,oe),tt.filter(function(Gt){return Math.abs(ut.xIndex-Gt.xIndex)!==0}).attr("transform",function(Gt){return l(Gt.xScale(Gt.xIndex),0)}),d.select(this).attr("transform",l(ut.x,0)),tt.each(function(Gt,Qt,vr){vr===ut.parent.key&&(Et.dimensions[Qt]=Gt)}),Et.contextLayer&&Et.contextLayer.render(Et.panels,!1,!B(Et)),Et.focusLayer.render&&Et.focusLayer.render(Et.panels)}).on("dragend",function(ut){var Et=ut.parent;ut.x=ut.xScale(ut.xIndex),ut.canvasX=ut.x*ut.model.canvasPixelRatio,q(tt,Et,oe),d.select(this).attr("transform",function(Gt){return l(Gt.x,0)}),Et.contextLayer&&Et.contextLayer.render(Et.panels,!1,!B(Et)),Et.focusLayer&&Et.focusLayer.render(Et.panels),Et.pickLayer&&Et.pickLayer.render(Et.panels,!0),me.linePickActive(!0),re&&re.axesMoved&&re.axesMoved(Et.key,Et.dimensions.map(function(Gt){return Gt.crossfilterDimensionIndex}))})),tt.exit().remove();var _t=tt.selectAll("."+A.cn.axisOverlays).data(b,m);_t.enter().append("g").classed(A.cn.axisOverlays,!0),_t.selectAll("."+A.cn.axis).remove();var mt=_t.selectAll("."+A.cn.axis).data(b,m);mt.enter().append("g").classed(A.cn.axis,!0),mt.each(function(ut){var Et=ut.model.height/ut.model.tickDistance,Gt=ut.domainScale,Qt=Gt.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(Et,ut.tickFormat).tickValues(ut.ordinal?Qt:null).tickFormat(function(vr){return _.isOrdinal(ut)?vr:ee(ut.model.dimensions[ut.visibleIndex],vr)}).scale(Gt)),u.font(mt.selectAll("text"),ut.model.tickFont)}),mt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),mt.selectAll("text").style("cursor","default");var vt=_t.selectAll("."+A.cn.axisHeading).data(b,m);vt.enter().append("g").classed(A.cn.axisHeading,!0);var ct=vt.selectAll("."+A.cn.axisTitle).data(b,m);ct.enter().append("text").classed(A.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ge?"none":"auto"),ct.text(function(ut){return ut.label}).each(function(ut){var Et=d.select(this);u.font(Et,ut.model.labelFont),o.convertToTspans(Et,be)}).attr("transform",function(ut){var Et=H(ut.model.labelAngle,ut.model.labelSide),Gt=A.axisTitleOffset;return(Et.dir>0?"":l(0,2*Gt+ut.model.height))+a(Et.degrees)+l(-Gt*Et.dx,-Gt*Et.dy)}).attr("text-anchor",function(ut){var Et=H(ut.model.labelAngle,ut.model.labelSide),Gt=Math.abs(Et.dx),Qt=Math.abs(Et.dy);return 2*Gt>Qt?Et.dir*Et.dx<0?"start":"end":"middle"});var Ae=_t.selectAll("."+A.cn.axisExtent).data(b,m);Ae.enter().append("g").classed(A.cn.axisExtent,!0);var Oe=Ae.selectAll("."+A.cn.axisExtentTop).data(b,m);Oe.enter().append("g").classed(A.cn.axisExtentTop,!0),Oe.attr("transform",l(0,-A.axisExtentOffset));var Le=Oe.selectAll("."+A.cn.axisExtentTopText).data(b,m);Le.enter().append("text").classed(A.cn.axisExtentTopText,!0).call(W),Le.text(function(ut){return he(ut,!0)}).each(function(ut){u.font(d.select(this),ut.model.rangeFont)});var nt=Ae.selectAll("."+A.cn.axisExtentBottom).data(b,m);nt.enter().append("g").classed(A.cn.axisExtentBottom,!0),nt.attr("transform",function(ut){return l(0,ut.model.height+A.axisExtentOffset)});var xt=nt.selectAll("."+A.cn.axisExtentBottomText).data(b,m);xt.enter().append("text").classed(A.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(W),xt.text(function(ut){return he(ut,!1)}).each(function(ut){u.font(d.select(this),ut.model.rangeFont)}),f.ensureAxisBrush(_t,J,be)}}),rz=ze((a,Y)=>{var d=MQ(),y=sA(),z=tz().isVisible,P={};function i(l,o,u){var s=o.indexOf(u),h=l.indexOf(s);return h===-1&&(h+=o.length),h}function n(l,o){return function(u,s){return i(l,o,u)-i(l,o,s)}}var a=Y.exports=function(l,o){var u=l._fullLayout,s=y(l,[],P);if(s){var h={},m={},b={},x={},_=u._size;o.forEach(function(D,E){var I=D[0].trace;b[E]=I.index;var M=x[E]=I.index;h[E]=l.data[M].dimensions,m[E]=l.data[M].dimensions.slice()});var A=function(D,E,I){var M=m[D][E],p=I.map(function(U){return U.slice()}),g="dimensions["+E+"].constraintrange",C=u._tracePreGUI[l._fullData[b[D]]._fullInput.uid];if(C[g]===void 0){var T=M.constraintrange;C[g]=T||null}var N=l._fullData[b[D]].dimensions[E];p.length?(p.length===1&&(p=p[0]),M.constraintrange=p,N.constraintrange=p.slice(),p=[p]):(delete M.constraintrange,delete N.constraintrange,p=null);var B={};B[g]=p,l.emit("plotly_restyle",[B,[x[D]]])},f=function(D){l.emit("plotly_hover",D)},k=function(D){l.emit("plotly_unhover",D)},w=function(D,E){var I=n(E,m[D].filter(z));h[D].sort(I),m[D].filter(function(M){return!z(M)}).sort(function(M){return m[D].indexOf(M)}).forEach(function(M){h[D].splice(h[D].indexOf(M),1),h[D].splice(m[D].indexOf(M),0,M)}),l.emit("plotly_restyle",[{dimensions:[h[D]]},[x[D]]])};d(l,o,{width:_.w,height:_.h,margin:{t:_.t,r:_.r,b:_.b,l:_.l}},{filterChanged:A,hover:f,unhover:k,axesMoved:w})}};a.reglPrecompiled=P}),EQ=ze(te=>{var Y=ri(),d=Ed().getModuleCalcData,y=rz(),z=k0();te.name="parcoords",te.plot=function(P){var i=d(P.calcdata,"parcoords")[0];i.length&&y(P,i)},te.clean=function(P,i,n,a){var l=a._has&&a._has("parcoords"),o=i._has&&i._has("parcoords");l&&!o&&(a._paperdiv.selectAll(".parcoords").remove(),a._glimages.selectAll("*").remove())},te.toSVG=function(P){var i=P._fullLayout._glimages,n=Y.select(P).selectAll(".svg-container"),a=n.filter(function(o,u){return u===n.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function l(){var o=this,u=o.toDataURL("image/png"),s=i.append("svg:image");s.attr({xmlns:z.svg,"xlink:href":u,preserveAspectRatio:"none",x:0,y:0,width:o.style.width,height:o.style.height})}a.each(l),window.setTimeout(function(){Y.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}),LQ=ze((te,Y)=>{Y.exports={attributes:YD(),supplyDefaults:xQ(),calc:bQ(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:EQ(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}),PQ=ze((te,Y)=>{var d=LQ();d.plot=rz(),Y.exports=d}),IQ=ze((te,Y)=>{Y.exports=PQ()}),iz=ze((te,Y)=>{var d=nn().extendFlat,y=xa(),z=On(),P=Oc(),{hovertemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=Xh().attributes,l=d({editType:"calc"},P("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:i({editType:"plot",arrayOk:!1},{keys:["count","probability"]}),hovertemplatefallback:n({editType:"plot"})});Y.exports={domain:a({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},y.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:i({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),hovertemplatefallback:n({editType:"plot"}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:z({editType:"calc"}),tickfont:z({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}),DQ=ze((te,Y)=>{var d=ji(),y=hp().hasColorscale,z=Cc(),P=Xh().defaults,i=Zd(),n=iz(),a=lA(),l=Di().isTypedArraySpec;function o(s,h,m,b,x){x("line.shape"),x("line.hovertemplate"),x("line.hovertemplatefallback");var _=x("line.color",b.colorway[0]);if(y(s,"line")&&d.isArrayOrTypedArray(_)){if(_.length)return x("line.colorscale"),z(s,h,b,x,{prefix:"line.",cLetter:"c"}),_.length;h.line.color=m}return 1/0}function u(s,h){function m(w,D){return d.coerce(s,h,n.dimensions,w,D)}var b=m("values"),x=m("visible");if(b&&b.length||(x=h.visible=!1),x){m("label"),m("displayindex",h._index);var _=s.categoryarray,A=d.isArrayOrTypedArray(_)&&_.length>0||l(_),f;A&&(f="array");var k=m("categoryorder",f);k==="array"?(m("categoryarray"),m("ticktext")):(delete s.categoryarray,delete s.ticktext),!A&&k==="array"&&(h.categoryorder="trace")}}Y.exports=function(s,h,m,b){function x(k,w){return d.coerce(s,h,n,k,w)}var _=i(s,h,{name:"dimensions",handleItemDefaults:u}),A=o(s,h,m,b,x);P(h,b,x),(!Array.isArray(_)||!_.length)&&(h.visible=!1),a(h,_,"values",A),x("hoveron"),x("hovertemplate"),x("hovertemplatefallback"),x("arrangement"),x("bundlecolors"),x("sortpaths"),x("counts");var f=b.font;d.coerceFont(x,"labelfont",f,{overrideDflt:{size:Math.round(f.size)}}),d.coerceFont(x,"tickfont",f,{autoShadowDflt:!0,overrideDflt:{size:Math.round(f.size/1.2)}})}}),zQ=ze((te,Y)=>{var d=e1().wrap,y=hp().hasColorscale,z=Tp(),P=jc(),i=Zs(),n=ji(),a=Sr();Y.exports=function(f,k){var w=n.filterVisible(k.dimensions);if(w.length===0)return[];var D=w.map(function(ce){var re;if(ce.categoryorder==="trace")re=null;else if(ce.categoryorder==="array")re=ce.categoryarray;else{re=P(ce.values);for(var ge=!0,ne=0;ne=f.length||k[f[w]]!==void 0)return!1;k[f[w]]=!0}return!0}}),OQ=ze((te,Y)=>{var d=ri(),y=(Mb(),gi(U_)).interpolateNumber,z=Tw(),P=hf(),i=ji(),n=i.strTranslate,a=Zs(),l=ln(),o=cc();function u(se,_e,oe,J){var me=_e._context.staticPlot,fe=se.map(ve.bind(0,_e,oe)),Ce=J.selectAll("g.parcatslayer").data([null]);Ce.enter().append("g").attr("class","parcatslayer").style("pointer-events",me?"none":"all");var Re=Ce.selectAll("g.trace.parcats").data(fe,s),Be=Re.enter().append("g").attr("class","trace parcats");Re.attr("transform",function(Le){return n(Le.x,Le.y)}),Be.append("g").attr("class","paths");var Ze=Re.select("g.paths"),Ge=Ze.selectAll("path.path").data(function(Le){return Le.paths},s);Ge.attr("fill",function(Le){return Le.model.color});var tt=Ge.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Le){return Le.model.color}).attr("fill-opacity",0);k(tt),Ge.attr("d",function(Le){return Le.svgD}),tt.empty()||Ge.sort(m),Ge.exit().remove(),Ge.on("mouseover",b).on("mouseout",x).on("click",f),Be.append("g").attr("class","dimensions");var _t=Re.select("g.dimensions"),mt=_t.selectAll("g.dimension").data(function(Le){return Le.dimensions},s);mt.enter().append("g").attr("class","dimension"),mt.attr("transform",function(Le){return n(Le.x,0)}),mt.exit().remove();var vt=mt.selectAll("g.category").data(function(Le){return Le.categories},s),ct=vt.enter().append("g").attr("class","category");vt.attr("transform",function(Le){return n(0,Le.y)}),ct.append("rect").attr("class","catrect").attr("pointer-events","none"),vt.select("rect.catrect").attr("fill","none").attr("width",function(Le){return Le.width}).attr("height",function(Le){return Le.height}),E(ct);var Ae=vt.selectAll("rect.bandrect").data(function(Le){return Le.bands},s);Ae.each(function(){i.raiseToTop(this)}),Ae.attr("fill",function(Le){return Le.color});var Oe=Ae.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Le){return Le.color}).attr("fill-opacity",0);Ae.attr("fill",function(Le){return Le.color}).attr("width",function(Le){return Le.width}).attr("height",function(Le){return Le.height}).attr("y",function(Le){return Le.y}).attr("cursor",function(Le){return Le.parcatsViewModel.arrangement==="fixed"?"default":Le.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),M(Oe),Ae.exit().remove(),ct.append("text").attr("class","catlabel").attr("pointer-events","none"),vt.select("text.catlabel").attr("text-anchor",function(Le){return h(Le)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Le){return h(Le)?Le.width+5:-5}).attr("y",function(Le){return Le.height/2}).text(function(Le){return Le.model.categoryLabel}).each(function(Le){a.font(d.select(this),Le.parcatsViewModel.categorylabelfont),o.convertToTspans(d.select(this),_e)}),ct.append("text").attr("class","dimlabel"),vt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Le){return Le.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Le){return Le.width/2}).attr("y",-5).text(function(Le,nt){return nt===0?Le.parcatsViewModel.model.dimensions[Le.model.dimensionInd].dimensionLabel:null}).each(function(Le){a.font(d.select(this),Le.parcatsViewModel.labelfont)}),vt.selectAll("rect.bandrect").on("mouseover",W).on("mouseout",F),vt.exit().remove(),mt.call(d.behavior.drag().origin(function(Le){return{x:Le.x,y:0}}).on("dragstart",H).on("drag",q).on("dragend",G)),Re.each(function(Le){Le.traceSelection=d.select(this),Le.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),Le.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Re.exit().remove()}Y.exports=function(se,_e,oe,J){u(oe,se,J,_e)};function s(se){return se.key}function h(se){var _e=se.parcatsViewModel.dimensions.length,oe=se.parcatsViewModel.dimensions[_e-1].model.dimensionInd;return se.model.dimensionInd===oe}function m(se,_e){return se.model.rawColor>_e.model.rawColor?1:se.model.rawColor<_e.model.rawColor?-1:0}function b(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){i.raiseToTop(this),w(d.select(this));var _e=_(se),oe=A(se);if(se.parcatsViewModel.graphDiv.emit("plotly_hover",{points:_e,event:d.event,constraints:oe}),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var J=d.mouse(this)[0],me=se.parcatsViewModel.graphDiv,fe=se.parcatsViewModel.trace,Ce=me._fullLayout,Re=Ce._paperdiv.node().getBoundingClientRect(),Be=se.parcatsViewModel.graphDiv.getBoundingClientRect(),Ze,Ge,tt;for(tt=0;tt"),Et=d.mouse(me)[0];P.loneHover({trace:fe,x:vt-Re.left+Be.left,y:ct-Re.top+Be.top,text:ut,color:se.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ae,idealAlign:Et1&&Ze.displayInd===Be.dimensions.length-1?(_t=Ce.left,mt="left"):(_t=Ce.left+Ce.width,mt="right");var vt=Re.model.count,ct=Re.model.categoryLabel,Ae=vt/Re.parcatsViewModel.model.count,Oe={countLabel:vt,categoryLabel:ct,probabilityLabel:Ae.toFixed(3)},Le=[];Re.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Le.push(["Count:",Oe.countLabel].join(" ")),Re.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Le.push(["P("+Oe.categoryLabel+"):",Oe.probabilityLabel].join(" "));var nt=Le.join("
");return{trace:Ge,x:J*(_t-_e.left),y:me*(tt-_e.top),text:nt,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:mt,hovertemplate:Ge.hovertemplate,hovertemplateLabels:Oe,eventData:[{data:Ge._input,fullData:Ge,count:vt,category:ct,probability:Ae}]}}function U(se,_e,oe){var J=[];return d.select(oe.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var me=this;J.push(B(se,_e,me))}),J}function V(se,_e,oe){se._fullLayout._calcInverseTransform(se);var J=se._fullLayout._invScaleX,me=se._fullLayout._invScaleY,fe=oe.getBoundingClientRect(),Ce=d.select(oe).datum(),Re=Ce.categoryViewModel,Be=Re.parcatsViewModel,Ze=Be.model.dimensions[Re.model.dimensionInd],Ge=Be.trace,tt=fe.y+fe.height/2,_t,mt;Be.dimensions.length>1&&Ze.displayInd===Be.dimensions.length-1?(_t=fe.left,mt="left"):(_t=fe.left+fe.width,mt="right");var vt=Re.model.categoryLabel,ct=Ce.parcatsViewModel.model.count,Ae=0;Ce.categoryViewModel.bands.forEach(function(mr){mr.color===Ce.color&&(Ae+=mr.count)});var Oe=Re.model.count,Le=0;Be.pathSelection.each(function(mr){mr.model.color===Ce.color&&(Le+=mr.model.count)});var nt=Ae/ct,xt=Ae/Le,ut=Ae/Oe,Et={countLabel:Ae,categoryLabel:vt,probabilityLabel:nt.toFixed(3)},Gt=[];Re.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Gt.push(["Count:",Et.countLabel].join(" ")),Re.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Gt.push("P(color ∩ "+vt+"): "+Et.probabilityLabel),Gt.push("P("+vt+" | color): "+xt.toFixed(3)),Gt.push("P(color | "+vt+"): "+ut.toFixed(3)));var Qt=Gt.join("
"),vr=l.mostReadable(Ce.color,["black","white"]);return{trace:Ge,x:J*(_t-_e.left),y:me*(tt-_e.top),text:Qt,color:Ce.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:vr,fontSize:10,idealAlign:mt,hovertemplate:Ge.hovertemplate,hovertemplateLabels:Et,eventData:[{data:Ge._input,fullData:Ge,category:vt,count:ct,probability:nt,categorycount:Oe,colorcount:Le,bandcolorcount:Ae}]}}function W(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var _e=d.mouse(this)[1];if(_e<-1)return;var oe=se.parcatsViewModel.graphDiv,J=oe._fullLayout,me=J._paperdiv.node().getBoundingClientRect(),fe=se.parcatsViewModel.hoveron,Ce=this;if(fe==="color"?(C(Ce),N(Ce,"plotly_hover",d.event)):(g(Ce),T(Ce,"plotly_hover",d.event)),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Re;fe==="category"?Re=B(oe,me,Ce):fe==="color"?Re=V(oe,me,Ce):fe==="dimension"&&(Re=U(oe,me,Ce)),Re&&P.loneHover(Re,{container:J._hoverlayer.node(),outerContainer:J._paper.node(),gd:oe})}}}function F(se){var _e=se.parcatsViewModel;if(!_e.dragDimension&&(k(_e.pathSelection),E(_e.dimensionSelection.selectAll("g.category")),M(_e.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),P.loneUnhover(_e.graphDiv._fullLayout._hoverlayer.node()),_e.pathSelection.sort(m),_e.hoverinfoItems.indexOf("skip")===-1)){var oe=se.parcatsViewModel.hoveron,J=this;oe==="color"?N(J,"plotly_unhover",d.event):T(J,"plotly_unhover",d.event)}}function H(se){se.parcatsViewModel.arrangement!=="fixed"&&(se.dragDimensionDisplayInd=se.model.displayInd,se.initialDragDimensionDisplayInds=se.parcatsViewModel.model.dimensions.map(function(_e){return _e.displayInd}),se.dragHasMoved=!1,se.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(_e){var oe=d.mouse(this)[0],J=d.mouse(this)[1];-2<=oe&&oe<=_e.width+2&&-2<=J&&J<=_e.height+2&&(se.dragCategoryDisplayInd=_e.model.displayInd,se.initialDragCategoryDisplayInds=se.model.categories.map(function(me){return me.displayInd}),_e.model.dragY=_e.y,i.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(me){me.yGe.y+Ge.height/2&&(fe.model.displayInd=Ge.model.displayInd,Ge.model.displayInd=Re),se.dragCategoryDisplayInd=fe.model.displayInd}if(se.dragCategoryDisplayInd===null||se.parcatsViewModel.arrangement==="freeform"){me.model.dragX=d.event.x;var tt=se.parcatsViewModel.dimensions[oe],_t=se.parcatsViewModel.dimensions[J];tt!==void 0&&me.model.dragX_t.x&&(me.model.displayInd=_t.model.displayInd,_t.model.displayInd=se.dragDimensionDisplayInd),se.dragDimensionDisplayInd=me.model.displayInd}ge(se.parcatsViewModel),re(se.parcatsViewModel),be(se.parcatsViewModel),he(se.parcatsViewModel)}}function G(se){if(se.parcatsViewModel.arrangement!=="fixed"&&se.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var _e={},oe=ee(se.parcatsViewModel),J=se.parcatsViewModel.model.dimensions.map(function(_t){return _t.displayInd}),me=se.initialDragDimensionDisplayInds.some(function(_t,mt){return _t!==J[mt]});me&&J.forEach(function(_t,mt){var vt=se.parcatsViewModel.model.dimensions[mt].containerInd;_e["dimensions["+vt+"].displayindex"]=_t});var fe=!1;if(se.dragCategoryDisplayInd!==null){var Ce=se.model.categories.map(function(_t){return _t.displayInd});if(fe=se.initialDragCategoryDisplayInds.some(function(_t,mt){return _t!==Ce[mt]}),fe){var Re=se.model.categories.slice().sort(function(_t,mt){return _t.displayInd-mt.displayInd}),Be=Re.map(function(_t){return _t.categoryValue}),Ze=Re.map(function(_t){return _t.categoryLabel});_e["dimensions["+se.model.containerInd+"].categoryarray"]=[Be],_e["dimensions["+se.model.containerInd+"].ticktext"]=[Ze],_e["dimensions["+se.model.containerInd+"].categoryorder"]="array"}}if(se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!se.dragHasMoved&&se.potentialClickBand&&(se.parcatsViewModel.hoveron==="color"?N(se.potentialClickBand,"plotly_click",d.event.sourceEvent):T(se.potentialClickBand,"plotly_click",d.event.sourceEvent)),se.model.dragX=null,se.dragCategoryDisplayInd!==null){var Ge=se.parcatsViewModel.dimensions[se.dragDimensionDisplayInd].categories[se.dragCategoryDisplayInd];Ge.model.dragY=null,se.dragCategoryDisplayInd=null}se.dragDimensionDisplayInd=null,se.parcatsViewModel.dragDimension=null,se.dragHasMoved=null,se.potentialClickBand=null,ge(se.parcatsViewModel),re(se.parcatsViewModel);var tt=d.transition().duration(300).ease("cubic-in-out");tt.each(function(){be(se.parcatsViewModel,!0),he(se.parcatsViewModel,!0)}).each("end",function(){(me||fe)&&z.restyle(se.parcatsViewModel.graphDiv,_e,[oe])})}}function ee(se){for(var _e,oe=se.graphDiv._fullData,J=0;J=0;Be--)Ze+="C"+Ce[Be]+","+(_e[Be+1]+J)+" "+fe[Be]+","+(_e[Be]+J)+" "+(se[Be]+oe[Be])+","+(_e[Be]+J),Ze+="l-"+oe[Be]+",0 ";return Ze+="Z",Ze}function re(se){var _e=se.dimensions,oe=se.model,J=_e.map(function(Lr){return Lr.categories.map(function(ci){return ci.y})}),me=se.model.dimensions.map(function(Lr){return Lr.categories.map(function(ci){return ci.displayInd})}),fe=se.model.dimensions.map(function(Lr){return Lr.displayInd}),Ce=se.dimensions.map(function(Lr){return Lr.model.dimensionInd}),Re=_e.map(function(Lr){return Lr.x}),Be=_e.map(function(Lr){return Lr.width}),Ze=[];for(var Ge in oe.paths)oe.paths.hasOwnProperty(Ge)&&Ze.push(oe.paths[Ge]);function tt(Lr){var ci=Lr.categoryInds.map(function(Ot,Xe){return me[Xe][Ot]}),vi=Ce.map(function(Ot){return ci[Ot]});return vi}Ze.sort(function(Lr,ci){var vi=tt(Lr),Ot=tt(ci);return se.sortpaths==="backward"&&(vi.reverse(),Ot.reverse()),vi.push(Lr.valueInds[0]),Ot.push(ci.valueInds[0]),se.bundlecolors&&(vi.unshift(Lr.rawColor),Ot.unshift(ci.rawColor)),viOt?1:0});for(var _t=new Array(Ze.length),mt=_e[0].model.count,vt=_e[0].categories.map(function(Lr){return Lr.height}).reduce(function(Lr,ci){return Lr+ci}),ct=0;ct0?Oe=vt*(Ae.count/mt):Oe=0;for(var Le=new Array(J.length),nt=0;nt1?Ce=(se.width-2*oe-J)/(me-1):Ce=0,Re=oe,Be=Re+Ce*fe;var Ze=[],Ge=se.model.maxCats,tt=_e.categories.length,_t=8,mt=_e.count,vt=se.height-_t*(Ge-1),ct,Ae,Oe,Le,nt,xt=(Ge-tt)*_t/2,ut=_e.categories.map(function(Et){return{displayInd:Et.displayInd,categoryInd:Et.categoryInd}});for(ut.sort(function(Et,Gt){return Et.displayInd-Gt.displayInd}),nt=0;nt0?ct=Ae.count/mt*vt:ct=0,Oe={key:Ae.valueInds[0],model:Ae,width:J,height:ct,y:Ae.dragY!==null?Ae.dragY:xt,bands:[],parcatsViewModel:se},xt=xt+ct+_t,Ze.push(Oe);return{key:_e.dimensionInd,x:_e.dragX!==null?_e.dragX:Be,y:0,width:J,model:_e,categories:Ze,parcatsViewModel:se,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}),nz=ze((te,Y)=>{var d=OQ();Y.exports=function(y,z,P,i){var n=y._fullLayout,a=n._paper,l=n._size;d(y,a,z,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},P,i)}}),BQ=ze(te=>{var Y=Ed().getModuleCalcData,d=nz(),y="parcats";te.name=y,te.plot=function(z,P,i,n){var a=Y(z.calcdata,y);if(a.length){var l=a[0];d(z,l,i,n)}},te.clean=function(z,P,i,n){var a=n._has&&n._has("parcats"),l=P._has&&P._has("parcats");a&&!l&&n._paperdiv.selectAll(".parcats").remove()}}),RQ=ze((te,Y)=>{Y.exports={attributes:iz(),supplyDefaults:DQ(),calc:zQ(),plot:nz(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:BQ(),categories:["noOpacity"],meta:{}}}),FQ=ze((te,Y)=>{Y.exports=RQ()}),dy=ze((te,Y)=>{var d=Xm(),y="1.13.4",z='© OpenStreetMap contributors',P=['© Carto',z].join(" "),i=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),n=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),a={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:z,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:P,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:i,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:n,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=d(a);Y.exports={requiredVersion:y,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:a,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+y+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),I6=Fe((te,Y)=>{var d=ji(),y=Xi().defaultLine,z=Xh().attributes,P=zn(),i=ff().textposition,n=oh().overrideAll,a=ku().templatedArray,l=hy(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var u=Y.exports=n({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:z({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:d.extendFlat({},i,{arrayOk:!1})}})},"plot","from-root");u.uirevision={valType:"any",editType:"none"}}),uA=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=Eb(),n=ff(),a=I6(),l=_a(),o=zc(),u=an().extendFlat,s=oh().overrideAll,h=I6(),m=i.line,b=i.marker;Y.exports=s({lon:i.lon,lat:i.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},b.opacity,{dflt:1})},mode:u({},n.mode,{dflt:"markers"}),text:u({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:u({},n.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:n.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:i.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:n.selected.marker},unselected:{marker:n.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),iz=Fe((te,Y)=>{var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return d.indexOf(y)!==-1}}}),BQ=Fe((te,Y)=>{var d=ji(),y=Oc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=uA(),l=iz().isSupportedFont;Y.exports=function(u,s,h,m){function b(g,C){return d.coerce(u,s,a,g,C)}function x(g,C){return d.coerce2(u,s,a,g,C)}var _=o(u,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(u,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(d.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),d.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(u,s,h,m,b,{noDash:!0}),b("connectgaps"));var f=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=f!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;i(u,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&n(u,s,h,b),d.coerceSelectionMarkerOpacity(s,b)};function o(u,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),nz=Fe((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),az=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=y.split(" "),i=P[0],n=P[1],a=d.isArrayOrTypedArray(z)?d.mean(z):z,l=.5+a/100,o=1.5+a/100,u=["",""],s=[0,0];switch(i){case"top":u[0]="top",s[1]=-o;break;case"bottom":u[0]="bottom",s[1]=o;break}switch(n){case"left":u[1]="right",s[0]=-l;break;case"right":u[1]="left",s[0]=l;break}var h;return u[0]&&u[1]?h=u.join("-"):u[0]?h=u[0]:u[1]?h=u[1]:h="center",{anchor:h,offset:s}}}),RQ=Fe((te,Y)=>{var d=Ar(),y=ji(),z=ti().BADNUM,P=j_(),i=lh(),n=Zs(),a=Hv(),l=Oc(),o=iz().isSupportedFont,u=az(),s=T0().appendArrayPointValue,h=cc().NEWLINES,m=cc().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),T=l.hasMarkers(M),N=l.hasText(M),B=T&&M.marker.symbol==="circle",U=T&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),$=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:$,symbol:q};if(!p)return G;var ee;if((g||C)&&(ee=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(ee),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(ee),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var he=x(I);$.geojson=he.geojson,$.layout.visibility="visible",V&&($.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat($.paint,{"circle-color":he.mcc,"circle-radius":he.mrc,"circle-opacity":he.mo})}if(B&&V&&($.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var xe=(M.marker||{}).size,ve=u(M.textposition,xe);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),T=y.isArrayOrTypedArray(M.opacity),N;function B(ve){return I.opacity*ve}function U(ve){return ve/2}var V;g&&(i.hasColorscale(I,"marker")?V=i.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;T&&(F=function(ve){var ce=d(ve)?+y.constrain(ve,0,1):0;return B(ce)});var $=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),T&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),FQ=Fe((te,Y)=>{var d=ji(),y=RQ(),z=hy().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function i(a,l,o,u){this.type="scattermapbox",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=u,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var n=i.prototype;n.addSource=function(a,l,o){var u={type:"geojson",data:l.geojson};o&&o.enabled&&d.extendFlat(u,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],u)},n.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},n.addLayer=function(a,l,o){var u={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(u.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var T=g[C];u.removeLayer(x.layerIds[T])}p||u.removeSource(x.sourceIds.circle)}function f(p){for(var g=P.nonCluster,C=0;C=0;C--){var T=g[C];u.removeLayer(x.layerIds[T]),p||u.removeSource(x.sourceIds[T])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):f(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var u=l[o];a.removeLayer(this.layerIds[u]),a.removeSource(this.sourceIds[u])}},Y.exports=function(a,l){var o=l[0].trace,u=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new i(a,o.uid,u,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(u)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var d=hf(),y=ji(),z=qu(),P=y.fillText,i=ti().BADNUM,n=hy().traceLayerPrefix;function a(o,u,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],f=n+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[f]});A=w.map(function(W){return W.id})}var D=u>=0?Math.floor((u+180)/360):Math.ceil((u-180)/360),E=D*360,I=u-E;function M(W){var F=W.lonlat;if(F[0]===i||k&&A.indexOf(W.i+1)===-1)return 1/0;var $=y.modHalf(F[0],360),q=F[1],G=_.project([$,q]),ee=G.x-b.c2p([I,q]),he=G.y-x.c2p([$,s]),xe=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(ee*ee+he*he)-xe,1-3/xe)}if(d.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],T=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=T-B,o.x1=T+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,u,s){if(o.hovertemplate)return;var h=u.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=u.lonlat,f=[];function k(w){return w+"°"}return b||x&&_?f.push("("+k(A[1])+", "+k(A[0])+")"):x?f.push(s.lon+k(A[0])):_&&f.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(u,o,f),f.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),NQ=Fe((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d}}),jQ=Fe((te,Y)=>{var d=ji(),y=Oc(),z=ti().BADNUM;Y.exports=function(P,i){var n=P.cd,a=P.xaxis,l=P.yaxis,o=[],u=n[0].trace,s;if(!y.hasMarkers(u))return[];if(i===!1)for(s=0;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():(d=d||self,d.mapboxgl=y())})(te,function(){var d,y,z;function P(i,n){if(!d)d=n;else if(!y)y=n;else{var a="var sharedChunk = {}; ("+d+")(sharedChunk); ("+y+")(sharedChunk);",l={};d(l),z=n(l),typeof window<"u"&&(z.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}}return P(["exports"],function(i){function n(v,j){return j={exports:{}},v(j,j.exports),j.exports}var a="1.13.4",l=o;function o(v,j,Q,Te){this.cx=3*v,this.bx=3*(Q-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*j,this.by=3*(Te-j)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=Te,this.p2x=Q,this.p2y=Te}o.prototype.sampleCurveX=function(v){return((this.ax*v+this.bx)*v+this.cx)*v},o.prototype.sampleCurveY=function(v){return((this.ay*v+this.by)*v+this.cy)*v},o.prototype.sampleCurveDerivativeX=function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},o.prototype.solveCurveX=function(v,j){typeof j>"u"&&(j=1e-6);var Q,Te,je,Ye,st;for(je=v,st=0;st<8;st++){if(Ye=this.sampleCurveX(je)-v,Math.abs(Ye)Te)return Te;for(;QYe?Q=je:Te=je,je=(Te-Q)*.5+Q}return je},o.prototype.solve=function(v,j){return this.sampleCurveY(this.solveCurveX(v,j))};var u=s;function s(v,j){this.x=v,this.y=j}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(v){return this.clone()._add(v)},sub:function(v){return this.clone()._sub(v)},multByPoint:function(v){return this.clone()._multByPoint(v)},divByPoint:function(v){return this.clone()._divByPoint(v)},mult:function(v){return this.clone()._mult(v)},div:function(v){return this.clone()._div(v)},rotate:function(v){return this.clone()._rotate(v)},rotateAround:function(v,j){return this.clone()._rotateAround(v,j)},matMult:function(v){return this.clone()._matMult(v)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(v){return this.x===v.x&&this.y===v.y},dist:function(v){return Math.sqrt(this.distSqr(v))},distSqr:function(v){var j=v.x-this.x,Q=v.y-this.y;return j*j+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith:function(v){return this.angleWithSep(v.x,v.y)},angleWithSep:function(v,j){return Math.atan2(this.x*j-this.y*v,this.x*v+this.y*j)},_matMult:function(v){var j=v[0]*this.x+v[1]*this.y,Q=v[2]*this.x+v[3]*this.y;return this.x=j,this.y=Q,this},_add:function(v){return this.x+=v.x,this.y+=v.y,this},_sub:function(v){return this.x-=v.x,this.y-=v.y,this},_mult:function(v){return this.x*=v,this.y*=v,this},_div:function(v){return this.x/=v,this.y/=v,this},_multByPoint:function(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint:function(v){return this.x/=v.x,this.y/=v.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var v=this.y;return this.y=this.x,this.x=-v,this},_rotate:function(v){var j=Math.cos(v),Q=Math.sin(v),Te=j*this.x-Q*this.y,je=Q*this.x+j*this.y;return this.x=Te,this.y=je,this},_rotateAround:function(v,j){var Q=Math.cos(v),Te=Math.sin(v),je=j.x+Q*(this.x-j.x)-Te*(this.y-j.y),Ye=j.y+Te*(this.x-j.x)+Q*(this.y-j.y);return this.x=je,this.y=Ye,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(v){return v instanceof s?v:Array.isArray(v)?new s(v[0],v[1]):v};var h=typeof self<"u"?self:{};function m(v,j){if(Array.isArray(v)){if(!Array.isArray(j)||v.length!==j.length)return!1;for(var Q=0;Q=1)return 1;var j=v*v,Q=j*v;return 4*(v<.5?Q:3*(v-j)+Q-.75)}function _(v,j,Q,Te){var je=new l(v,j,Q,Te);return function(Ye){return je.solve(Ye)}}var A=_(.25,.1,.25,1);function f(v,j,Q){return Math.min(Q,Math.max(j,v))}function k(v,j,Q){var Te=Q-j,je=((v-j)%Te+Te)%Te+j;return je===j?Q:je}function w(v,j,Q){if(!v.length)return Q(null,[]);var Te=v.length,je=new Array(v.length),Ye=null;v.forEach(function(st,Ut){j(st,function(ir,Tr){ir&&(Ye=ir),je[Ut]=Tr,--Te===0&&Q(Ye,je)})})}function D(v){var j=[];for(var Q in v)j.push(v[Q]);return j}function E(v,j){var Q=[];for(var Te in v)Te in j||Q.push(Te);return Q}function I(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Te=0,je=j;Te>j/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,v)}return v()}function T(v){return v<=1?1:Math.pow(2,Math.ceil(Math.log(v)/Math.LN2))}function N(v){return v?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(v):!1}function B(v,j){v.forEach(function(Q){j[Q]&&(j[Q]=j[Q].bind(j))})}function U(v,j){return v.indexOf(j,v.length-j.length)!==-1}function V(v,j,Q){var Te={};for(var je in v)Te[je]=j.call(Q||this,v[je],je,v);return Te}function W(v,j,Q){var Te={};for(var je in v)j.call(Q||this,v[je],je,v)&&(Te[je]=v[je]);return Te}function F(v){return Array.isArray(v)?v.map(F):typeof v=="object"&&v?V(v,F):v}function $(v,j){for(var Q=0;Q=0)return!0;return!1}var q={};function G(v){q[v]||(typeof console<"u"&&console.warn(v),q[v]=!0)}function ee(v,j,Q){return(Q.y-v.y)*(j.x-v.x)>(j.y-v.y)*(Q.x-v.x)}function he(v){for(var j=0,Q=0,Te=v.length,je=Te-1,Ye=void 0,st=void 0;Q@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,Q={};if(v.replace(j,function(je,Ye,st,Ut){var ir=st||Ut;return Q[Ye]=ir?ir.toLowerCase():!0,""}),Q["max-age"]){var Te=parseInt(Q["max-age"],10);isNaN(Te)?delete Q["max-age"]:Q["max-age"]=Te}return Q}var re=null;function ge(v){if(re==null){var j=v.navigator?v.navigator.userAgent:null;re=!!v.safari||!!(j&&(/\b(iPad|iPhone|iPod)\b/.test(j)||j.match("Safari")&&!j.match("Chrome")))}return re}function ne(v){try{var j=h[v];return j.setItem("_mapbox_test_",1),j.removeItem("_mapbox_test_"),!0}catch{return!1}}function se(v){return h.btoa(encodeURIComponent(v).replace(/%([0-9A-F]{2})/g,function(j,Q){return String.fromCharCode(+("0x"+Q))}))}function _e(v){return decodeURIComponent(h.atob(v).split("").map(function(j){return"%"+("00"+j.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var oe=h.performance&&h.performance.now?h.performance.now.bind(h.performance):Date.now.bind(Date),J=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame,me=h.cancelAnimationFrame||h.mozCancelAnimationFrame||h.webkitCancelAnimationFrame||h.msCancelAnimationFrame,fe,Ce,Be={now:oe,frame:function(v){var j=J(v);return{cancel:function(){return me(j)}}},getImageData:function(v,j){j===void 0&&(j=0);var Q=h.document.createElement("canvas"),Te=Q.getContext("2d");if(!Te)throw new Error("failed to create canvas 2d context");return Q.width=v.width,Q.height=v.height,Te.drawImage(v,0,0,v.width,v.height),Te.getImageData(-j,-j,v.width+2*j,v.height+2*j)},resolveURL:function(v){return fe||(fe=h.document.createElement("a")),fe.href=v,fe.href},hardwareConcurrency:h.navigator&&h.navigator.hardwareConcurrency||4,get devicePixelRatio(){return h.devicePixelRatio},get prefersReducedMotion(){return h.matchMedia?(Ce==null&&(Ce=h.matchMedia("(prefers-reduced-motion: reduce)")),Ce.matches):!1}},Oe={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ze={supported:!1,testSupport:gt},Ge,rt=!1,_t,pt=!1;h.document&&(_t=h.document.createElement("img"),_t.onload=function(){Ge&&ct(Ge),Ge=null,pt=!0},_t.onerror=function(){rt=!0,Ge=null},_t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function gt(v){rt||!_t||(pt?ct(v):Ge=v)}function ct(v){var j=v.createTexture();v.bindTexture(v.TEXTURE_2D,j);try{if(v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,_t),v.isContextLost())return;Ze.supported=!0}catch{}v.deleteTexture(j),rt=!0}var Ae="01";function ze(){for(var v="1",j="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Q="",Te=0;Te<10;Te++)Q+=j[Math.floor(Math.random()*62)];var je=720*60*1e3,Ye=[v,Ae,Q].join(""),st=Date.now()+je;return{token:Ye,tokenExpiresAt:st}}var Ee=function(v,j){this._transformRequestFn=v,this._customAccessToken=j,this._createSkuToken()};Ee.prototype._createSkuToken=function(){var v=ze();this._skuToken=v.token,this._skuTokenExpiresAt=v.tokenExpiresAt},Ee.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Ee.prototype.transformRequest=function(v,j){return this._transformRequestFn?this._transformRequestFn(v,j)||{url:v}:{url:v}},Ee.prototype.normalizeStyleURL=function(v,j){if(!nt(v))return v;var Q=gr(v);return Q.path="/styles/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Ee.prototype.normalizeGlyphsURL=function(v,j){if(!nt(v))return v;var Q=gr(v);return Q.path="/fonts/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Ee.prototype.normalizeSourceURL=function(v,j){if(!nt(v))return v;var Q=gr(v);return Q.path="/v4/"+Q.authority+".json",Q.params.push("secure"),this._makeAPIURL(Q,this._customAccessToken||j)},Ee.prototype.normalizeSpriteURL=function(v,j,Q,Te){var je=gr(v);return nt(v)?(je.path="/styles/v1"+je.path+"/sprite"+j+Q,this._makeAPIURL(je,this._customAccessToken||Te)):(je.path+=""+j+Q,mr(je))},Ee.prototype.normalizeTileURL=function(v,j){if(this._isSkuTokenExpired()&&this._createSkuToken(),v&&!nt(v))return v;var Q=gr(v),Te=/(\.(png|jpg)\d*)(?=$)/,je=/^.+\/v4\//,Ye=Be.devicePixelRatio>=2||j===512?"@2x":"",st=Ze.supported?".webp":"$1";Q.path=Q.path.replace(Te,""+Ye+st),Q.path=Q.path.replace(je,"/"),Q.path="/v4"+Q.path;var Ut=this._customAccessToken||Gt(Q.params)||Oe.ACCESS_TOKEN;return Oe.REQUIRE_ACCESS_TOKEN&&Ut&&this._skuToken&&Q.params.push("sku="+this._skuToken),this._makeAPIURL(Q,Ut)},Ee.prototype.canonicalizeTileURL=function(v,j){var Q="/v4/",Te=/\.[\w]+$/,je=gr(v);if(!je.path.match(/(^\/v4\/)/)||!je.path.match(Te))return v;var Ye="mapbox://tiles/";Ye+=je.path.replace(Q,"");var st=je.params;return j&&(st=st.filter(function(Ut){return!Ut.match(/^access_token=/)})),st.length&&(Ye+="?"+st.join("&")),Ye},Ee.prototype.canonicalizeTileset=function(v,j){for(var Q=j?nt(j):!1,Te=[],je=0,Ye=v.tiles||[];je=0&&v.params.splice(je,1)}if(Te.path!=="/"&&(v.path=""+Te.path+v.path),!Oe.REQUIRE_ACCESS_TOKEN)return mr(v);if(j=j||Oe.ACCESS_TOKEN,!j)throw new Error("An API access token is required to use Mapbox GL. "+Q);if(j[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+Q);return v.params=v.params.filter(function(Ye){return Ye.indexOf("access_token")===-1}),v.params.push("access_token="+j),mr(v)};function nt(v){return v.indexOf("mapbox:")===0}var xt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ut(v){return xt.test(v)}function Et(v){return v.indexOf("sku=")>0&&ut(v)}function Gt(v){for(var j=0,Q=v;j=1&&h.localStorage.setItem(j,JSON.stringify(this.eventData))}catch{G("Unable to write to LocalStorage")}},Mr.prototype.processRequests=function(v){},Mr.prototype.postEvent=function(v,j,Q,Te){var je=this;if(Oe.EVENTS_URL){var Ye=gr(Oe.EVENTS_URL);Ye.params.push("access_token="+(Te||Oe.ACCESS_TOKEN||""));var st={event:this.type,created:new Date(v).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:a,skuId:Ae,userId:this.anonId},Ut=j?I(st,j):st,ir={url:mr(Ye),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ut])};this.pendingRequest=Hi(ir,function(Tr){je.pendingRequest=null,Q(Tr),je.saveEventData(),je.processRequests(Te)})}},Mr.prototype.queueRequest=function(v,j){this.queue.push(v),this.processRequests(j)};var ui=function(v){function j(){v.call(this,"map.load"),this.success={},this.skuToken=""}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postMapLoadEvent=function(Q,Te,je,Ye){this.skuToken=je,(Oe.EVENTS_URL&&Ye||Oe.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(st){return nt(st)||ut(st)}))&&this.queueRequest({id:Te,timestamp:Date.now()},Ye)},j.prototype.processRequests=function(Q){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){var je=this.queue.shift(),Ye=je.id,st=je.timestamp;Ye&&this.success[Ye]||(this.anonId||this.fetchEventData(),N(this.anonId)||(this.anonId=C()),this.postEvent(st,{skuToken:this.skuToken},function(Ut){Ut||Ye&&(Te.success[Ye]=!0)},Q))}},j}(Mr),mi=function(v){function j(Q){v.call(this,"appUserTurnstile"),this._customAccessToken=Q}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postTurnstileEvent=function(Q,Te){Oe.EVENTS_URL&&Oe.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(je){return nt(je)||ut(je)})&&this.queueRequest(Date.now(),Te)},j.prototype.processRequests=function(Q){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var je=ri(Oe.ACCESS_TOKEN),Ye=je?je.u:Oe.ACCESS_TOKEN,st=Ye!==this.eventData.tokenU;N(this.anonId)||(this.anonId=C(),st=!0);var Ut=this.queue.shift();if(this.eventData.lastSuccess){var ir=new Date(this.eventData.lastSuccess),Tr=new Date(Ut),Br=(Ut-this.eventData.lastSuccess)/(1440*60*1e3);st=st||Br>=1||Br<-1||ir.getDate()!==Tr.getDate()}else st=!0;if(!st)return this.processRequests();this.postEvent(Ut,{"enabled.telemetry":!1},function(li){li||(Te.eventData.lastSuccess=Ut,Te.eventData.tokenU=Ye)},Q)}},j}(Mr),Ot=new mi,Je=Ot.postTurnstileEvent.bind(Ot),ot=new ui,De=ot.postMapLoadEvent.bind(ot),ye="mapbox-tiles",Pe=500,He=50,at=1e3*60*7,ht;function At(){h.caches&&!ht&&(ht=h.caches.open(ye))}var Wt;function Kt(v,j){if(Wt===void 0)try{new Response(new ReadableStream),Wt=!0}catch{Wt=!1}Wt?j(v.body):v.blob().then(j)}function hr(v,j,Q){if(At(),!!ht){var Te={status:j.status,statusText:j.statusText,headers:new h.Headers};j.headers.forEach(function(st,Ut){return Te.headers.set(Ut,st)});var je=ce(j.headers.get("Cache-Control")||"");if(!je["no-store"]){je["max-age"]&&Te.headers.set("Expires",new Date(Q+je["max-age"]*1e3).toUTCString());var Ye=new Date(Te.headers.get("Expires")).getTime()-Q;YeDate.now()&&!Q["no-cache"]}var hi=1/0;function un(v){hi++,hi>He&&(v.getActor().send("enforceCacheSizeLimit",Pe),hi=0)}function cn(v){At(),ht&&ht.then(function(j){j.keys().then(function(Q){for(var Te=0;Te=200&&Q.status<300||Q.status===0)&&Q.response!==null){var je=Q.response;if(v.type==="json")try{je=JSON.parse(Q.response)}catch(Ye){return j(Ye)}j(null,je,Q.getResponseHeader("Cache-Control"),Q.getResponseHeader("Expires"))}else j(new na(Q.statusText,Q.status,v.url))},Q.send(v.body),{cancel:function(){return Q.abort()}}}var fi=function(v,j){if(!sr(v.url)){if(h.fetch&&h.Request&&h.AbortController&&h.Request.prototype.hasOwnProperty("signal"))return _r(v,j);if(ve()&&self.worker&&self.worker.actor){var Q=!0;return self.worker.actor.send("getResource",v,j,void 0,Q)}}return Cr(v,j)},qi=function(v,j){return fi(I(v,{type:"json"}),j)},Ui=function(v,j){return fi(I(v,{type:"arrayBuffer"}),j)},Hi=function(v,j){return fi(I(v,{method:"POST"}),j)};function En(v){var j=h.document.createElement("a");return j.href=v,j.protocol===h.document.location.protocol&&j.host===h.document.location.host}var Rn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Gn(v,j,Q,Te){var je=new h.Image,Ye=h.URL;je.onload=function(){j(null,je),Ye.revokeObjectURL(je.src),je.onload=null,h.requestAnimationFrame(function(){je.src=Rn})},je.onerror=function(){return j(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var st=new h.Blob([new Uint8Array(v)],{type:"image/png"});je.cacheControl=Q,je.expires=Te,je.src=v.byteLength?Ye.createObjectURL(st):Rn}function Xn(v,j){var Q=new h.Blob([new Uint8Array(v)],{type:"image/png"});h.createImageBitmap(Q).then(function(Te){j(null,Te)}).catch(function(Te){j(new Error("Could not load image because of "+Te.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var sa,Mn,Ha=function(){sa=[],Mn=0};Ha();var ro=function(v,j){if(Ze.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),Mn>=Oe.MAX_PARALLEL_IMAGE_REQUESTS){var Q={requestParameters:v,callback:j,cancelled:!1,cancel:function(){this.cancelled=!0}};return sa.push(Q),Q}Mn++;var Te=!1,je=function(){if(!Te)for(Te=!0,Mn--;sa.length&&Mn0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)},Gr.prototype.setEventedParent=function(v,j){return this._eventedParent=v,this._eventedParentData=j,this};var si=8,Pi={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},yi={"*":{type:"source"}},zt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],xr={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Jr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ri={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},tn={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},_n={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Zi={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Wi={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},dn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Ua={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ea={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},fo={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ho={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vo={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ao={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wa={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ks={type:"array",value:"*"},fs={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},_l={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},es={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},rl={type:"array",value:"*",minimum:1},ds={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},xl=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],ol={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},Gl={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},ms={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Bs={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},No={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Es={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Il={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Jl={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ou={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Gs={"*":{type:"string"}},$a={$version:si,$root:Pi,sources:yi,source:zt,source_vector:xr,source_raster:Jr,source_raster_dem:Ri,source_geojson:tn,source_video:_n,source_image:Zi,layer:Wi,layout:dn,layout_background:Ua,layout_fill:ea,layout_circle:fo,layout_heatmap:ho,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Vo,layout_symbol:Ao,layout_raster:Wo,layout_hillshade:Wa,filter:ks,filter_operator:fs,geometry_type:_l,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:es,expression:rl,light:ds,paint:xl,paint_fill:ol,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:Gl,paint_circle:ms,paint_heatmap:Bs,paint_symbol:No,paint_raster:Es,paint_hillshade:Il,paint_background:Jl,transition:ou,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Gs},So=function(v,j,Q,Te){this.message=(v?v+": ":"")+Q,Te&&(this.identifier=Te),j!=null&&j.__line__&&(this.line=j.__line__)};function Xs(v){var j=v.key,Q=v.value;return Q?[new So(j,Q,"constants have been deprecated as of v8")]:[]}function su(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Te=0,je=j;Te":v.itemType.kind==="value"?"array":"array<"+j+">"}else return v.kind}var pc=[Gu,bo,Ls,Rs,pu,Ll,bl,lu(ls),Hl];function Ah(v,j){if(j.kind==="error")return null;if(v.kind==="array"){if(j.kind==="array"&&(j.N===0&&j.itemType.kind==="value"||!Ah(v.itemType,j.itemType))&&(typeof v.N!="number"||v.N===j.N))return null}else{if(v.kind===j.kind)return null;if(v.kind==="value")for(var Q=0,Te=pc;Q255?255:Tr}function je(Tr){return Tr<0?0:Tr>1?1:Tr}function Ye(Tr){return Tr[Tr.length-1]==="%"?Te(parseFloat(Tr)/100*255):Te(parseInt(Tr))}function st(Tr){return Tr[Tr.length-1]==="%"?je(parseFloat(Tr)/100):je(parseFloat(Tr))}function Ut(Tr,Br,li){return li<0?li+=1:li>1&&(li-=1),li*6<1?Tr+(Br-Tr)*li*6:li*2<1?Br:li*3<2?Tr+(Br-Tr)*(2/3-li)*6:Tr}function ir(Tr){var Br=Tr.replace(/ /g,"").toLowerCase();if(Br in Q)return Q[Br].slice();if(Br[0]==="#"){if(Br.length===4){var li=parseInt(Br.substr(1),16);return li>=0&&li<=4095?[(li&3840)>>4|(li&3840)>>8,li&240|(li&240)>>4,li&15|(li&15)<<4,1]:null}else if(Br.length===7){var li=parseInt(Br.substr(1),16);return li>=0&&li<=16777215?[(li&16711680)>>16,(li&65280)>>8,li&255,1]:null}return null}var gi=Br.indexOf("("),Ii=Br.indexOf(")");if(gi!==-1&&Ii+1===Br.length){var rn=Br.substr(0,gi),Dn=Br.substr(gi+1,Ii-(gi+1)).split(","),ya=1;switch(rn){case"rgba":if(Dn.length!==4)return null;ya=st(Dn.pop());case"rgb":return Dn.length!==3?null:[Ye(Dn[0]),Ye(Dn[1]),Ye(Dn[2]),ya];case"hsla":if(Dn.length!==4)return null;ya=st(Dn.pop());case"hsl":if(Dn.length!==3)return null;var ma=(parseFloat(Dn[0])%360+360)%360/360,za=st(Dn[1]),Ga=st(Dn[2]),Pa=Ga<=.5?Ga*(za+1):Ga+za-Ga*za,co=Ga*2-Pa;return[Te(Ut(co,Pa,ma+1/3)*255),Te(Ut(co,Pa,ma)*255),Te(Ut(co,Pa,ma-1/3)*255),ya];default:return null}}return null}try{j.parseCSSColor=ir}catch{}}),Ff=Qf.parseCSSColor,Vl=function(v,j,Q,Te){Te===void 0&&(Te=1),this.r=v,this.g=j,this.b=Q,this.a=Te};Vl.parse=function(v){if(v){if(v instanceof Vl)return v;if(typeof v=="string"){var j=Ff(v);if(j)return new Vl(j[0]/255*j[3],j[1]/255*j[3],j[2]/255*j[3],j[3])}}},Vl.prototype.toString=function(){var v=this.toArray(),j=v[0],Q=v[1],Te=v[2],je=v[3];return"rgba("+Math.round(j)+","+Math.round(Q)+","+Math.round(Te)+","+je+")"},Vl.prototype.toArray=function(){var v=this,j=v.r,Q=v.g,Te=v.b,je=v.a;return je===0?[0,0,0,0]:[j*255/je,Q*255/je,Te*255/je,je]},Vl.black=new Vl(0,0,0,1),Vl.white=new Vl(1,1,1,1),Vl.transparent=new Vl(0,0,0,0),Vl.red=new Vl(1,0,0,1);var Kc=function(v,j,Q){v?this.sensitivity=j?"variant":"case":this.sensitivity=j?"accent":"base",this.locale=Q,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Kc.prototype.compare=function(v,j){return this.collator.compare(v,j)},Kc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ed=function(v,j,Q,Te,je){this.text=v,this.image=j,this.scale=Q,this.fontStack=Te,this.textColor=je},xc=function(v){this.sections=v};xc.fromString=function(v){return new xc([new ed(v,null,null,null,null)])},xc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(v){return v.text.length!==0||v.image&&v.image.name.length!==0})},xc.factory=function(v){return v instanceof xc?v:xc.fromString(v)},xc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(v){return v.text}).join("")},xc.prototype.serialize=function(){for(var v=["format"],j=0,Q=this.sections;j=0&&v<=255&&typeof j=="number"&&j>=0&&j<=255&&typeof Q=="number"&&Q>=0&&Q<=255)){var je=typeof Te=="number"?[v,j,Q,Te]:[v,j,Q];return"Invalid rgba value ["+je.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof Te>"u"||typeof Te=="number"&&Te>=0&&Te<=1?null:"Invalid rgba value ["+[v,j,Q,Te].join(", ")+"]: 'a' must be between 0 and 1."}function vh(v){if(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number"||v instanceof Vl||v instanceof Kc||v instanceof xc||v instanceof mc)return!0;if(Array.isArray(v)){for(var j=0,Q=v;j2){var st=v[1];if(typeof st!="string"||!(st in Fh)||st==="object")return j.error('The item type argument of "array" must be one of string, number, boolean',1);Ye=Fh[st],Q++}else Ye=ls;var Ut;if(v.length>3){if(v[2]!==null&&(typeof v[2]!="number"||v[2]<0||v[2]!==Math.floor(v[2])))return j.error('The length argument to "array" must be a positive integer literal',2);Ut=v[2],Q++}Te=lu(Ye,Ut)}else Te=Fh[je];for(var ir=[];Q1)&&j.push(Te)}}return j.concat(this.args.map(function(je){return je.serialize()}))};var Jh=function(v){this.type=Ll,this.sections=v};Jh.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[1];if(!Array.isArray(Q)&&typeof Q=="object")return j.error("First argument must be an image or text section.");for(var Te=[],je=!1,Ye=1;Ye<=v.length-1;++Ye){var st=v[Ye];if(je&&typeof st=="object"&&!Array.isArray(st)){je=!1;var Ut=null;if(st["font-scale"]&&(Ut=j.parse(st["font-scale"],1,bo),!Ut))return null;var ir=null;if(st["text-font"]&&(ir=j.parse(st["text-font"],1,lu(Ls)),!ir))return null;var Tr=null;if(st["text-color"]&&(Tr=j.parse(st["text-color"],1,pu),!Tr))return null;var Br=Te[Te.length-1];Br.scale=Ut,Br.font=ir,Br.textColor=Tr}else{var li=j.parse(v[Ye],1,ls);if(!li)return null;var gi=li.type.kind;if(gi!=="string"&&gi!=="value"&&gi!=="null"&&gi!=="resolvedImage")return j.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");je=!0,Te.push({content:li,scale:null,font:null,textColor:null})}}return new Jh(Te)},Jh.prototype.evaluate=function(v){var j=function(Q){var Te=Q.content.evaluate(v);return yu(Te)===Hl?new ed("",Te,null,null,null):new ed(gc(Te),null,Q.scale?Q.scale.evaluate(v):null,Q.font?Q.font.evaluate(v).join(","):null,Q.textColor?Q.textColor.evaluate(v):null)};return new xc(this.sections.map(j))},Jh.prototype.eachChild=function(v){for(var j=0,Q=this.sections;j-1),Q},Mu.prototype.eachChild=function(v){v(this.input)},Mu.prototype.outputDefined=function(){return!1},Mu.prototype.serialize=function(){return["image",this.input.serialize()]};var Yd={"to-boolean":Rs,"to-color":pu,"to-number":bo,"to-string":Ls},sl=function(v,j){this.type=v,this.args=j};sl.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[0];if((Q==="to-boolean"||Q==="to-string")&&v.length!==2)return j.error("Expected one argument.");for(var Te=Yd[Q],je=[],Ye=1;Ye4?Q="Invalid rbga value "+JSON.stringify(j)+": expected an array containing either three or four numeric values.":Q=bc(j[0],j[1],j[2],j[3]),!Q))return new Vl(j[0]/255,j[1]/255,j[2]/255,j[3])}throw new ru(Q||"Could not parse color from value '"+(typeof j=="string"?j:String(JSON.stringify(j)))+"'")}else if(this.type.kind==="number"){for(var Ut=null,ir=0,Tr=this.args;ir=j[2]||v[1]<=j[1]||v[3]>=j[3])}function Ld(v,j){var Q=Qh(v[0]),Te=Ef(v[1]),je=Math.pow(2,j.z);return[Math.round(Q*je*hc),Math.round(Te*je*hc)]}function cd(v,j,Q){var Te=v[0]-j[0],je=v[1]-j[1],Ye=v[0]-Q[0],st=v[1]-Q[1];return Te*st-Ye*je===0&&Te*Ye<=0&&je*st<=0}function Lf(v,j,Q){return j[1]>v[1]!=Q[1]>v[1]&&v[0]<(Q[0]-j[0])*(v[1]-j[1])/(Q[1]-j[1])+j[0]}function ef(v,j){for(var Q=!1,Te=0,je=j.length;Te0&&li<0||Br<0&&li>0}function hd(v,j,Q,Te){var je=[j[0]-v[0],j[1]-v[1]],Ye=[Te[0]-Q[0],Te[1]-Q[1]];return id(Ye,je)===0?!1:!!(_h(v,j,Q,Te)&&_h(Q,Te,v,j))}function Nh(v,j,Q){for(var Te=0,je=Q;TeQ[2]){var je=Te*.5,Ye=v[0]-Q[0]>je?-Te:Q[0]-v[0]>je?Te:0;Ye===0&&(Ye=v[0]-Q[2]>je?-Te:Q[2]-v[0]>je?Te:0),v[0]+=Ye}td(j,v)}function Nf(v){v[0]=v[1]=1/0,v[2]=v[3]=-1/0}function Xd(v,j,Q,Te){for(var je=Math.pow(2,Te.z)*hc,Ye=[Te.x*hc,Te.y*hc],st=[],Ut=0,ir=v;Ut=0)return!1;var Q=!0;return v.eachChild(function(Te){Q&&!Xc(Te,j)&&(Q=!1)}),Q}var tf=function(v,j){this.type=j.type,this.name=v,this.boundExpression=j};tf.parse=function(v,j){if(v.length!==2||typeof v[1]!="string")return j.error("'var' expression requires exactly one string literal argument.");var Q=v[1];return j.scope.has(Q)?new tf(Q,j.scope.get(Q)):j.error('Unknown variable "'+Q+'". Make sure "'+Q+'" has been bound in an enclosing "let" expression before using it.',1)},tf.prototype.evaluate=function(v){return this.boundExpression.evaluate(v)},tf.prototype.eachChild=function(){},tf.prototype.outputDefined=function(){return!1},tf.prototype.serialize=function(){return["var",this.name]};var _u=function(v,j,Q,Te,je){j===void 0&&(j=[]),Te===void 0&&(Te=new Nl),je===void 0&&(je=[]),this.registry=v,this.path=j,this.key=j.map(function(Ye){return"["+Ye+"]"}).join(""),this.scope=Te,this.errors=je,this.expectedType=Q};_u.prototype.parse=function(v,j,Q,Te,je){return je===void 0&&(je={}),j?this.concat(j,Q,Te)._parse(v,je):this._parse(v,je)},_u.prototype._parse=function(v,j){(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number")&&(v=["literal",v]);function Q(Tr,Br,li){return li==="assert"?new jc(Br,[Tr]):li==="coerce"?new sl(Br,[Tr]):Tr}if(Array.isArray(v)){if(v.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Te=v[0];if(typeof Te!="string")return this.error("Expression name must be a string, but found "+typeof Te+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var je=this.registry[Te];if(je){var Ye=je.parse(v,this);if(!Ye)return null;if(this.expectedType){var st=this.expectedType,Ut=Ye.type;if((st.kind==="string"||st.kind==="number"||st.kind==="boolean"||st.kind==="object"||st.kind==="array")&&Ut.kind==="value")Ye=Q(Ye,st,j.typeAnnotation||"assert");else if((st.kind==="color"||st.kind==="formatted"||st.kind==="resolvedImage")&&(Ut.kind==="value"||Ut.kind==="string"))Ye=Q(Ye,st,j.typeAnnotation||"coerce");else if(this.checkSubtype(st,Ut))return null}if(!(Ye instanceof hl)&&Ye.type.kind!=="resolvedImage"&&jh(Ye)){var ir=new jl;try{Ye=new hl(Ye.type,Ye.evaluate(ir))}catch(Tr){return this.error(Tr.message),null}}return Ye}return this.error('Unknown expression "'+Te+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof v>"u"?this.error("'undefined' value invalid. Use null instead."):typeof v=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof v+" instead.")},_u.prototype.concat=function(v,j,Q){var Te=typeof v=="number"?this.path.concat(v):this.path,je=Q?this.scope.concat(Q):this.scope;return new _u(this.registry,Te,j||null,je,this.errors)},_u.prototype.error=function(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];var Te=""+this.key+j.map(function(je){return"["+je+"]"}).join("");this.errors.push(new pl(Te,v))},_u.prototype.checkSubtype=function(v,j){var Q=Ah(v,j);return Q&&this.error(Q),Q};function jh(v){if(v instanceof tf)return jh(v.boundExpression);if(v instanceof os&&v.name==="error"||v instanceof yh||v instanceof Yc)return!1;var j=v instanceof sl||v instanceof jc,Q=!0;return v.eachChild(function(Te){j?Q=Q&&jh(Te):Q=Q&&Te instanceof hl}),Q?pd(v)&&Xc(v,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Rc(v,j){for(var Q=v.length-1,Te=0,je=Q,Ye=0,st,Ut;Te<=je;)if(Ye=Math.floor((Te+je)/2),st=v[Ye],Ut=v[Ye+1],st<=j){if(Ye===Q||jj)je=Ye-1;else throw new ru("Input is not a number.");return 0}var Jc=function(v,j,Q){this.type=v,this.input=j,this.labels=[],this.outputs=[];for(var Te=0,je=Q;Te=st)return j.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',ir);var Br=j.parse(Ut,Tr,je);if(!Br)return null;je=je||Br.type,Te.push([st,Br])}return new Jc(je,Q,Te)},Jc.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Te=this.input.evaluate(v);if(Te<=j[0])return Q[0].evaluate(v);var je=j.length;if(Te>=j[je-1])return Q[je-1].evaluate(v);var Ye=Rc(j,Te);return Q[Ye].evaluate(v)},Jc.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j0&&v.push(this.labels[j]),v.push(this.outputs[j].serialize());return v};function Eu(v,j,Q){return v*(1-Q)+j*Q}function xf(v,j,Q){return new Vl(Eu(v.r,j.r,Q),Eu(v.g,j.g,Q),Eu(v.b,j.b,Q),Eu(v.a,j.a,Q))}function Eh(v,j,Q){return v.map(function(Te,je){return Eu(Te,j[je],Q)})}var rf=Object.freeze({__proto__:null,number:Eu,color:xf,array:Eh}),jf=.95047,Jd=1,Tp=1.08883,bf=4/29,Uf=6/29,Dc=3*Uf*Uf,wf=Uf*Uf*Uf,ch=Math.PI/180,kf=180/Math.PI;function $f(v){return v>wf?Math.pow(v,1/3):v/Dc+bf}function Lh(v){return v>Uf?v*v*v:Dc*(v-bf)}function Lu(v){return 255*(v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055)}function Uh(v){return v/=255,v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function Qc(v){var j=Uh(v.r),Q=Uh(v.g),Te=Uh(v.b),je=$f((.4124564*j+.3575761*Q+.1804375*Te)/jf),Ye=$f((.2126729*j+.7151522*Q+.072175*Te)/Jd),st=$f((.0193339*j+.119192*Q+.9503041*Te)/Tp);return{l:116*Ye-16,a:500*(je-Ye),b:200*(Ye-st),alpha:v.a}}function Pd(v){var j=(v.l+16)/116,Q=isNaN(v.a)?j:j+v.a/500,Te=isNaN(v.b)?j:j-v.b/200;return j=Jd*Lh(j),Q=jf*Lh(Q),Te=Tp*Lh(Te),new Vl(Lu(3.2404542*Q-1.5371385*j-.4985314*Te),Lu(-.969266*Q+1.8760108*j+.041556*Te),Lu(.0556434*Q-.2040259*j+1.0572252*Te),v.alpha)}function Cu(v,j,Q){return{l:Eu(v.l,j.l,Q),a:Eu(v.a,j.a,Q),b:Eu(v.b,j.b,Q),alpha:Eu(v.alpha,j.alpha,Q)}}function If(v){var j=Qc(v),Q=j.l,Te=j.a,je=j.b,Ye=Math.atan2(je,Te)*kf;return{h:Ye<0?Ye+360:Ye,c:Math.sqrt(Te*Te+je*je),l:Q,alpha:v.a}}function nf(v){var j=v.h*ch,Q=v.c,Te=v.l;return Pd({l:Te,a:Math.cos(j)*Q,b:Math.sin(j)*Q,alpha:v.alpha})}function hh(v,j,Q){var Te=j-v;return v+Q*(Te>180||Te<-180?Te-360*Math.round(Te/360):Te)}function pf(v,j,Q){return{h:hh(v.h,j.h,Q),c:Eu(v.c,j.c,Q),l:Eu(v.l,j.l,Q),alpha:Eu(v.alpha,j.alpha,Q)}}var af={forward:Qc,reverse:Pd,interpolate:Cu},Df={forward:If,reverse:nf,interpolate:pf},Qd=Object.freeze({__proto__:null,lab:af,hcl:Df}),Ac=function(v,j,Q,Te,je){this.type=v,this.operator=j,this.interpolation=Q,this.input=Te,this.labels=[],this.outputs=[];for(var Ye=0,st=je;Ye1}))return j.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Te={name:"cubic-bezier",controlPoints:Ut}}else return j.error("Unknown interpolation type "+String(Te[0]),1,0);if(v.length-1<4)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if((v.length-1)%2!==0)return j.error("Expected an even number of arguments.");if(je=j.parse(je,2,bo),!je)return null;var ir=[],Tr=null;Q==="interpolate-hcl"||Q==="interpolate-lab"?Tr=pu:j.expectedType&&j.expectedType.kind!=="value"&&(Tr=j.expectedType);for(var Br=0;Br=li)return j.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Ii);var Dn=j.parse(gi,rn,Tr);if(!Dn)return null;Tr=Tr||Dn.type,ir.push([li,Dn])}return Tr.kind!=="number"&&Tr.kind!=="color"&&!(Tr.kind==="array"&&Tr.itemType.kind==="number"&&typeof Tr.N=="number")?j.error("Type "+hu(Tr)+" is not interpolatable."):new Ac(Tr,Q,Te,je,ir)},Ac.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Te=this.input.evaluate(v);if(Te<=j[0])return Q[0].evaluate(v);var je=j.length;if(Te>=j[je-1])return Q[je-1].evaluate(v);var Ye=Rc(j,Te),st=j[Ye],Ut=j[Ye+1],ir=Ac.interpolationFactor(this.interpolation,Te,st,Ut),Tr=Q[Ye].evaluate(v),Br=Q[Ye+1].evaluate(v);return this.operator==="interpolate"?rf[this.type.kind.toLowerCase()](Tr,Br,ir):this.operator==="interpolate-hcl"?Df.reverse(Df.interpolate(Df.forward(Tr),Df.forward(Br),ir)):af.reverse(af.interpolate(af.forward(Tr),af.forward(Br),ir))},Ac.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j=Q.length)throw new ru("Array index out of bounds: "+j+" > "+(Q.length-1)+".");if(j!==Math.floor(j))throw new ru("Array index must be an integer, but found "+j+" instead.");return Q[j]},Ph.prototype.eachChild=function(v){v(this.index),v(this.input)},Ph.prototype.outputDefined=function(){return!1},Ph.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zu=function(v,j){this.type=Rs,this.needle=v,this.haystack=j};Zu.parse=function(v,j){if(v.length!==3)return j.error("Expected 2 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,ls);return!Q||!Te?null:uh(Q.type,[Rs,Ls,bo,Gu,ls])?new Zu(Q,Te):j.error("Expected first argument to be of type boolean, string, number or null, but found "+hu(Q.type)+" instead")},Zu.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!Q)return!1;if(!gh(j,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+hu(yu(j))+" instead.");if(!gh(Q,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+hu(yu(Q))+" instead.");return Q.indexOf(j)>=0},Zu.prototype.eachChild=function(v){v(this.needle),v(this.haystack)},Zu.prototype.outputDefined=function(){return!0},Zu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fu=function(v,j,Q){this.type=bo,this.needle=v,this.haystack=j,this.fromIndex=Q};fu.parse=function(v,j){if(v.length<=2||v.length>=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,ls);if(!Q||!Te)return null;if(!uh(Q.type,[Rs,Ls,bo,Gu,ls]))return j.error("Expected first argument to be of type boolean, string, number or null, but found "+hu(Q.type)+" instead");if(v.length===4){var je=j.parse(v[3],3,bo);return je?new fu(Q,Te,je):null}else return new fu(Q,Te)},fu.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!gh(j,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+hu(yu(j))+" instead.");if(!gh(Q,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+hu(yu(Q))+" instead.");if(this.fromIndex){var Te=this.fromIndex.evaluate(v);return Q.indexOf(j,Te)}return Q.indexOf(j)},fu.prototype.eachChild=function(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)},fu.prototype.outputDefined=function(){return!1},fu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var v=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),v]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ih=function(v,j,Q,Te,je,Ye){this.inputType=v,this.type=j,this.input=Q,this.cases=Te,this.outputs=je,this.otherwise=Ye};Ih.parse=function(v,j){if(v.length<5)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if(v.length%2!==1)return j.error("Expected an even number of arguments.");var Q,Te;j.expectedType&&j.expectedType.kind!=="value"&&(Te=j.expectedType);for(var je={},Ye=[],st=2;stNumber.MAX_SAFE_INTEGER)return Tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof gi=="number"&&Math.floor(gi)!==gi)return Tr.error("Numeric branch labels must be integer values.");if(!Q)Q=yu(gi);else if(Tr.checkSubtype(Q,yu(gi)))return null;if(typeof je[String(gi)]<"u")return Tr.error("Branch labels must be unique.");je[String(gi)]=Ye.length}var Ii=j.parse(ir,st,Te);if(!Ii)return null;Te=Te||Ii.type,Ye.push(Ii)}var rn=j.parse(v[1],1,ls);if(!rn)return null;var Dn=j.parse(v[v.length-1],v.length-1,Te);return!Dn||rn.type.kind!=="value"&&j.concat(1).checkSubtype(Q,rn.type)?null:new Ih(Q,Te,rn,je,Ye,Dn)},Ih.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=yu(j)===this.inputType&&this.outputs[this.cases[j]]||this.otherwise;return Q.evaluate(v)},Ih.prototype.eachChild=function(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)},Ih.prototype.outputDefined=function(){return this.outputs.every(function(v){return v.outputDefined()})&&this.otherwise.outputDefined()},Ih.prototype.serialize=function(){for(var v=this,j=["match",this.input.serialize()],Q=Object.keys(this.cases).sort(),Te=[],je={},Ye=0,st=Q;Ye=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,bo);if(!Q||!Te)return null;if(!uh(Q.type,[lu(ls),Ls,ls]))return j.error("Expected first argument to be of type array or string, but found "+hu(Q.type)+" instead");if(v.length===4){var je=j.parse(v[3],3,bo);return je?new Dh(Q.type,Q,Te,je):null}else return new Dh(Q.type,Q,Te)},Dh.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=this.beginIndex.evaluate(v);if(!gh(j,["string","array"]))throw new ru("Expected first argument to be of type array or string, but found "+hu(yu(j))+" instead.");if(this.endIndex){var Te=this.endIndex.evaluate(v);return j.slice(Q,Te)}return j.slice(Q)},Dh.prototype.eachChild=function(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)},Dh.prototype.outputDefined=function(){return!1},Dh.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var v=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),v]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function ad(v,j){return v==="=="||v==="!="?j.kind==="boolean"||j.kind==="string"||j.kind==="number"||j.kind==="null"||j.kind==="value":j.kind==="string"||j.kind==="number"||j.kind==="value"}function wr(v,j,Q){return j===Q}function Yr(v,j,Q){return j!==Q}function Ni(v,j,Q){return jQ}function hn(v,j,Q){return j<=Q}function Ln(v,j,Q){return j>=Q}function pa(v,j,Q,Te){return Te.compare(j,Q)===0}function Ea(v,j,Q,Te){return!pa(v,j,Q,Te)}function Za(v,j,Q,Te){return Te.compare(j,Q)<0}function ao(v,j,Q,Te){return Te.compare(j,Q)>0}function xa(v,j,Q,Te){return Te.compare(j,Q)<=0}function Va(v,j,Q,Te){return Te.compare(j,Q)>=0}function Oa(v,j,Q){var Te=v!=="=="&&v!=="!=";return function(){function je(Ye,st,Ut){this.type=Rs,this.lhs=Ye,this.rhs=st,this.collator=Ut,this.hasUntypedArgument=Ye.type.kind==="value"||st.type.kind==="value"}return je.parse=function(Ye,st){if(Ye.length!==3&&Ye.length!==4)return st.error("Expected two or three arguments.");var Ut=Ye[0],ir=st.parse(Ye[1],1,ls);if(!ir)return null;if(!ad(Ut,ir.type))return st.concat(1).error('"'+Ut+`" comparisons are not supported for type '`+hu(ir.type)+"'.");var Tr=st.parse(Ye[2],2,ls);if(!Tr)return null;if(!ad(Ut,Tr.type))return st.concat(2).error('"'+Ut+`" comparisons are not supported for type '`+hu(Tr.type)+"'.");if(ir.type.kind!==Tr.type.kind&&ir.type.kind!=="value"&&Tr.type.kind!=="value")return st.error("Cannot compare types '"+hu(ir.type)+"' and '"+hu(Tr.type)+"'.");Te&&(ir.type.kind==="value"&&Tr.type.kind!=="value"?ir=new jc(Tr.type,[ir]):ir.type.kind!=="value"&&Tr.type.kind==="value"&&(Tr=new jc(ir.type,[Tr])));var Br=null;if(Ye.length===4){if(ir.type.kind!=="string"&&Tr.type.kind!=="string"&&ir.type.kind!=="value"&&Tr.type.kind!=="value")return st.error("Cannot use collator to compare non-string types.");if(Br=st.parse(Ye[3],3,ic),!Br)return null}return new je(ir,Tr,Br)},je.prototype.evaluate=function(Ye){var st=this.lhs.evaluate(Ye),Ut=this.rhs.evaluate(Ye);if(Te&&this.hasUntypedArgument){var ir=yu(st),Tr=yu(Ut);if(ir.kind!==Tr.kind||!(ir.kind==="string"||ir.kind==="number"))throw new ru('Expected arguments for "'+v+'" to be (string, string) or (number, number), but found ('+ir.kind+", "+Tr.kind+") instead.")}if(this.collator&&!Te&&this.hasUntypedArgument){var Br=yu(st),li=yu(Ut);if(Br.kind!=="string"||li.kind!=="string")return j(Ye,st,Ut)}return this.collator?Q(Ye,st,Ut,this.collator.evaluate(Ye)):j(Ye,st,Ut)},je.prototype.eachChild=function(Ye){Ye(this.lhs),Ye(this.rhs),this.collator&&Ye(this.collator)},je.prototype.outputDefined=function(){return!0},je.prototype.serialize=function(){var Ye=[v];return this.eachChild(function(st){Ye.push(st.serialize())}),Ye},je}()}var fa=Oa("==",wr,pa),vo=Oa("!=",Yr,Ea),hs=Oa("<",Ni,Za),rs=Oa(">",Ai,ao),ps=Oa("<=",hn,xa),xs=Oa(">=",Ln,Va),_o=function(v,j,Q,Te,je){this.type=Ls,this.number=v,this.locale=j,this.currency=Q,this.minFractionDigits=Te,this.maxFractionDigits=je};_o.parse=function(v,j){if(v.length!==3)return j.error("Expected two arguments.");var Q=j.parse(v[1],1,bo);if(!Q)return null;var Te=v[2];if(typeof Te!="object"||Array.isArray(Te))return j.error("NumberFormat options argument must be an object.");var je=null;if(Te.locale&&(je=j.parse(Te.locale,1,Ls),!je))return null;var Ye=null;if(Te.currency&&(Ye=j.parse(Te.currency,1,Ls),!Ye))return null;var st=null;if(Te["min-fraction-digits"]&&(st=j.parse(Te["min-fraction-digits"],1,bo),!st))return null;var Ut=null;return Te["max-fraction-digits"]&&(Ut=j.parse(Te["max-fraction-digits"],1,bo),!Ut)?null:new _o(Q,je,Ye,st,Ut)},_o.prototype.evaluate=function(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))},_o.prototype.eachChild=function(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){var v={};return this.locale&&(v.locale=this.locale.serialize()),this.currency&&(v.currency=this.currency.serialize()),this.minFractionDigits&&(v["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(v["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),v]};var io=function(v){this.type=bo,this.input=v};io.parse=function(v,j){if(v.length!==2)return j.error("Expected 1 argument, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1);return Q?Q.type.kind!=="array"&&Q.type.kind!=="string"&&Q.type.kind!=="value"?j.error("Expected argument of type string or array, but found "+hu(Q.type)+" instead."):new io(Q):null},io.prototype.evaluate=function(v){var j=this.input.evaluate(v);if(typeof j=="string"||Array.isArray(j))return j.length;throw new ru("Expected value to be of type string or array, but found "+hu(yu(j))+" instead.")},io.prototype.eachChild=function(v){v(this.input)},io.prototype.outputDefined=function(){return!1},io.prototype.serialize=function(){var v=["length"];return this.eachChild(function(j){v.push(j.serialize())}),v};var bs={"==":fa,"!=":vo,">":rs,"<":hs,">=":xs,"<=":ps,array:jc,at:Ph,boolean:jc,case:Tf,coalesce:fh,collator:yh,format:Jh,image:Mu,in:Zu,"index-of":fu,interpolate:Ac,"interpolate-hcl":Ac,"interpolate-lab":Ac,length:io,let:$h,literal:hl,match:Ih,number:jc,"number-format":_o,object:jc,slice:Dh,step:Jc,string:jc,"to-boolean":sl,"to-color":sl,"to-number":sl,"to-string":sl,var:tf,within:Yc};function ll(v,j){var Q=j[0],Te=j[1],je=j[2],Ye=j[3];Q=Q.evaluate(v),Te=Te.evaluate(v),je=je.evaluate(v);var st=Ye?Ye.evaluate(v):1,Ut=bc(Q,Te,je,st);if(Ut)throw new ru(Ut);return new Vl(Q/255*st,Te/255*st,je/255*st,st)}function Ul(v,j){return v in j}function mu(v,j){var Q=j[v];return typeof Q>"u"?null:Q}function Ql(v,j,Q,Te){for(;Q<=Te;){var je=Q+Te>>1;if(j[je]===v)return!0;j[je]>v?Te=je-1:Q=je+1}return!1}function gu(v){return{type:v}}os.register(bs,{error:[Bu,[Ls],function(v,j){var Q=j[0];throw new ru(Q.evaluate(v))}],typeof:[Ls,[ls],function(v,j){var Q=j[0];return hu(yu(Q.evaluate(v)))}],"to-rgba":[lu(bo,4),[pu],function(v,j){var Q=j[0];return Q.evaluate(v).toArray()}],rgb:[pu,[bo,bo,bo],ll],rgba:[pu,[bo,bo,bo,bo],ll],has:{type:Rs,overloads:[[[Ls],function(v,j){var Q=j[0];return Ul(Q.evaluate(v),v.properties())}],[[Ls,bl],function(v,j){var Q=j[0],Te=j[1];return Ul(Q.evaluate(v),Te.evaluate(v))}]]},get:{type:ls,overloads:[[[Ls],function(v,j){var Q=j[0];return mu(Q.evaluate(v),v.properties())}],[[Ls,bl],function(v,j){var Q=j[0],Te=j[1];return mu(Q.evaluate(v),Te.evaluate(v))}]]},"feature-state":[ls,[Ls],function(v,j){var Q=j[0];return mu(Q.evaluate(v),v.featureState||{})}],properties:[bl,[],function(v){return v.properties()}],"geometry-type":[Ls,[],function(v){return v.geometryType()}],id:[ls,[],function(v){return v.id()}],zoom:[bo,[],function(v){return v.globals.zoom}],"heatmap-density":[bo,[],function(v){return v.globals.heatmapDensity||0}],"line-progress":[bo,[],function(v){return v.globals.lineProgress||0}],accumulated:[ls,[],function(v){return v.globals.accumulated===void 0?null:v.globals.accumulated}],"+":[bo,gu(bo),function(v,j){for(var Q=0,Te=0,je=j;Te":[Rs,[Ls,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je>Ye}],"filter-id->":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te>je}],"filter-<=":[Rs,[Ls,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je<=Ye}],"filter-id-<=":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te<=je}],"filter->=":[Rs,[Ls,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je>=Ye}],"filter-id->=":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te>=je}],"filter-has":[Rs,[ls],function(v,j){var Q=j[0];return Q.value in v.properties()}],"filter-has-id":[Rs,[],function(v){return v.id()!==null&&v.id()!==void 0}],"filter-type-in":[Rs,[lu(Ls)],function(v,j){var Q=j[0];return Q.value.indexOf(v.geometryType())>=0}],"filter-id-in":[Rs,[lu(ls)],function(v,j){var Q=j[0];return Q.value.indexOf(v.id())>=0}],"filter-in-small":[Rs,[Ls,lu(ls)],function(v,j){var Q=j[0],Te=j[1];return Te.value.indexOf(v.properties()[Q.value])>=0}],"filter-in-large":[Rs,[Ls,lu(ls)],function(v,j){var Q=j[0],Te=j[1];return Ql(v.properties()[Q.value],Te.value,0,Te.value.length-1)}],all:{type:Rs,overloads:[[[Rs,Rs],function(v,j){var Q=j[0],Te=j[1];return Q.evaluate(v)&&Te.evaluate(v)}],[gu(Rs),function(v,j){for(var Q=0,Te=j;Q-1}function Ho(v){return!!v.expression&&v.expression.interpolated}function Is(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":v===null?"null":typeof v}function iu(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function Wl(v){return v}function Mc(v,j){var Q=j.type==="color",Te=v.stops&&typeof v.stops[0][0]=="object",je=Te||v.property!==void 0,Ye=Te||!je,st=v.type||(Ho(j)?"exponential":"interval");if(Q&&(v=su({},v),v.stops&&(v.stops=v.stops.map(function(Yo){return[Yo[0],Vl.parse(Yo[1])]})),v.default?v.default=Vl.parse(v.default):v.default=Vl.parse(j.default)),v.colorSpace&&v.colorSpace!=="rgb"&&!Qd[v.colorSpace])throw new Error("Unknown color space: "+v.colorSpace);var Ut,ir,Tr;if(st==="exponential")Ut=th;else if(st==="interval")Ut=Hh;else if(st==="categorical"){Ut=Uc,ir=Object.create(null);for(var Br=0,li=v.stops;Br=v.stops[Te-1][0])return v.stops[Te-1][1];var je=Rc(v.stops.map(function(Ye){return Ye[0]}),Q);return v.stops[je][1]}function th(v,j,Q){var Te=v.base!==void 0?v.base:1;if(Is(Q)!=="number")return eh(v.default,j.default);var je=v.stops.length;if(je===1||Q<=v.stops[0][0])return v.stops[0][1];if(Q>=v.stops[je-1][0])return v.stops[je-1][1];var Ye=Rc(v.stops.map(function(li){return li[0]}),Q),st=Wu(Q,Te,v.stops[Ye][0],v.stops[Ye+1][0]),Ut=v.stops[Ye][1],ir=v.stops[Ye+1][1],Tr=rf[j.type]||Wl;if(v.colorSpace&&v.colorSpace!=="rgb"){var Br=Qd[v.colorSpace];Tr=function(li,gi){return Br.reverse(Br.interpolate(Br.forward(li),Br.forward(gi),st))}}return typeof Ut.evaluate=="function"?{evaluate:function(){for(var li=[],gi=arguments.length;gi--;)li[gi]=arguments[gi];var Ii=Ut.evaluate.apply(void 0,li),rn=ir.evaluate.apply(void 0,li);if(!(Ii===void 0||rn===void 0))return Tr(Ii,rn,st)}}:Tr(Ut,ir,st)}function Vh(v,j,Q){return j.type==="color"?Q=Vl.parse(Q):j.type==="formatted"?Q=xc.fromString(Q.toString()):j.type==="resolvedImage"?Q=mc.fromString(Q.toString()):Is(Q)!==j.type&&(j.type!=="enum"||!j.values[Q])&&(Q=void 0),eh(Q,v.default,j.default)}function Wu(v,j,Q,Te){var je=Te-Q,Ye=v-Q;return je===0?0:j===1?Ye/je:(Math.pow(j,Ye)-1)/(Math.pow(j,je)-1)}var Wh=function(v,j){this.expression=v,this._warningHistory={},this._evaluator=new jl,this._defaultValue=j?Ne(j):null,this._enumValues=j&&j.type==="enum"?j.values:null};Wh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._evaluator.globals=v,this._evaluator.feature=j,this._evaluator.featureState=Q,this._evaluator.canonical=Te,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ye,this.expression.evaluate(this._evaluator)},Wh.prototype.evaluate=function(v,j,Q,Te,je,Ye){this._evaluator.globals=v,this._evaluator.feature=j||null,this._evaluator.featureState=Q||null,this._evaluator.canonical=Te,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ye||null;try{var st=this.expression.evaluate(this._evaluator);if(st==null||typeof st=="number"&&st!==st)return this._defaultValue;if(this._enumValues&&!(st in this._enumValues))throw new ru("Expected value to be one of "+Object.keys(this._enumValues).map(function(Ut){return JSON.stringify(Ut)}).join(", ")+", but found "+JSON.stringify(st)+" instead.");return st}catch(Ut){return this._warningHistory[Ut.message]||(this._warningHistory[Ut.message]=!0,typeof console<"u"&&console.warn(Ut.message)),this._defaultValue}};function cs(v){return Array.isArray(v)&&v.length>0&&typeof v[0]=="string"&&v[0]in bs}function Fs(v,j){var Q=new _u(bs,[],j?Ie(j):void 0),Te=Q.parse(v,void 0,void 0,void 0,j&&j.type==="string"?{typeAnnotation:"coerce"}:void 0);return Te?Cl(new Wh(Te,j)):ec(Q.errors)}var rh=function(v,j){this.kind=v,this._styleExpression=j,this.isStateDependent=v!=="constant"&&!Vu(j.expression)};rh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Te,je,Ye)},rh.prototype.evaluate=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluate(v,j,Q,Te,je,Ye)};var tc=function(v,j,Q,Te){this.kind=v,this.zoomStops=Q,this._styleExpression=j,this.isStateDependent=v!=="camera"&&!Vu(j.expression),this.interpolationType=Te};tc.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Te,je,Ye)},tc.prototype.evaluate=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluate(v,j,Q,Te,je,Ye)},tc.prototype.interpolationFactor=function(v,j,Q){return this.interpolationType?Ac.interpolationFactor(this.interpolationType,v,j,Q):0};function od(v,j){if(v=Fs(v,j),v.result==="error")return v;var Q=v.value.expression,Te=pd(Q);if(!Te&&!$u(j))return ec([new pl("","data expressions not supported")]);var je=Xc(Q,["zoom"]);if(!je&&!xu(j))return ec([new pl("","zoom expressions not supported")]);var Ye=pe(Q);if(!Ye&&!je)return ec([new pl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ye instanceof pl)return ec([Ye]);if(Ye instanceof Ac&&!Ho(j))return ec([new pl("",'"interpolate" expressions cannot be used with this property')]);if(!Ye)return Cl(Te?new rh("constant",v.value):new rh("source",v.value));var st=Ye instanceof Ac?Ye.interpolation:void 0;return Cl(Te?new tc("camera",v.value,Ye.labels,st):new tc("composite",v.value,Ye.labels,st))}var Ke=function(v,j){this._parameters=v,this._specification=j,su(this,Mc(this._parameters,this._specification))};Ke.deserialize=function(v){return new Ke(v._parameters,v._specification)},Ke.serialize=function(v){return{_parameters:v._parameters,_specification:v._specification}};function O(v,j){if(iu(v))return new Ke(v,j);if(cs(v)){var Q=od(v,j);if(Q.result==="error")throw new Error(Q.value.map(function(je){return je.key+": "+je.message}).join(", "));return Q.value}else{var Te=v;return typeof v=="string"&&j.type==="color"&&(Te=Vl.parse(v)),{kind:"constant",evaluate:function(){return Te}}}}function pe(v){var j=null;if(v instanceof $h)j=pe(v.result);else if(v instanceof fh)for(var Q=0,Te=v.args;QTe.maximum?[new So(j,Q,Q+" is greater than the maximum value "+Te.maximum)]:[]}function er(v){var j=v.valueSpec,Q=is(v.value.type),Te,je={},Ye,st,Ut=Q!=="categorical"&&v.value.property===void 0,ir=!Ut,Tr=Is(v.value.stops)==="array"&&Is(v.value.stops[0])==="array"&&Is(v.value.stops[0][0])==="object",Br=qe({key:v.key,value:v.value,valueSpec:v.styleSpec.function,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:li,default:rn}});return Q==="identity"&&Ut&&Br.push(new So(v.key,v.value,'missing required property "property"')),Q!=="identity"&&!v.value.stops&&Br.push(new So(v.key,v.value,'missing required property "stops"')),Q==="exponential"&&v.valueSpec.expression&&!Ho(v.valueSpec)&&Br.push(new So(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(ir&&!$u(v.valueSpec)?Br.push(new So(v.key,v.value,"property functions not supported")):Ut&&!xu(v.valueSpec)&&Br.push(new So(v.key,v.value,"zoom functions not supported"))),(Q==="categorical"||Tr)&&v.value.property===void 0&&Br.push(new So(v.key,v.value,'"property" property is required')),Br;function li(Dn){if(Q==="identity")return[new So(Dn.key,Dn.value,'identity function may not have a "stops" property')];var ya=[],ma=Dn.value;return ya=ya.concat(Mt({key:Dn.key,value:ma,valueSpec:Dn.valueSpec,style:Dn.style,styleSpec:Dn.styleSpec,arrayElementValidator:gi})),Is(ma)==="array"&&ma.length===0&&ya.push(new So(Dn.key,ma,"array must have at least one stop")),ya}function gi(Dn){var ya=[],ma=Dn.value,za=Dn.key;if(Is(ma)!=="array")return[new So(za,ma,"array expected, "+Is(ma)+" found")];if(ma.length!==2)return[new So(za,ma,"array length 2 expected, length "+ma.length+" found")];if(Tr){if(Is(ma[0])!=="object")return[new So(za,ma,"object expected, "+Is(ma[0])+" found")];if(ma[0].zoom===void 0)return[new So(za,ma,"object stop key must have zoom")];if(ma[0].value===void 0)return[new So(za,ma,"object stop key must have value")];if(st&&st>is(ma[0].zoom))return[new So(za,ma[0].zoom,"stop zoom values must appear in ascending order")];is(ma[0].zoom)!==st&&(st=is(ma[0].zoom),Ye=void 0,je={}),ya=ya.concat(qe({key:za+"[0]",value:ma[0],valueSpec:{zoom:{}},style:Dn.style,styleSpec:Dn.styleSpec,objectElementValidators:{zoom:jt,value:Ii}}))}else ya=ya.concat(Ii({key:za+"[0]",value:ma[0],style:Dn.style,styleSpec:Dn.styleSpec},ma));return cs(tu(ma[1]))?ya.concat([new So(za+"[1]",ma[1],"expressions are not allowed in function stops.")]):ya.concat(Al({key:za+"[1]",value:ma[1],valueSpec:j,style:Dn.style,styleSpec:Dn.styleSpec}))}function Ii(Dn,ya){var ma=Is(Dn.value),za=is(Dn.value),Ga=Dn.value!==null?Dn.value:ya;if(!Te)Te=ma;else if(ma!==Te)return[new So(Dn.key,Ga,ma+" stop domain type must match previous stop domain type "+Te)];if(ma!=="number"&&ma!=="string"&&ma!=="boolean")return[new So(Dn.key,Ga,"stop domain value must be a number, string, or boolean")];if(ma!=="number"&&Q!=="categorical"){var Pa="number expected, "+ma+" found";return $u(j)&&Q===void 0&&(Pa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new So(Dn.key,Ga,Pa)]}return Q==="categorical"&&ma==="number"&&(!isFinite(za)||Math.floor(za)!==za)?[new So(Dn.key,Ga,"integer expected, found "+za)]:Q!=="categorical"&&ma==="number"&&Ye!==void 0&&za=2&&v[1]!=="$id"&&v[1]!=="$type";case"in":return v.length>=3&&(typeof v[1]!="string"||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return v.length!==3||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(var j=0,Q=v.slice(1);jj?1:0}function Lt(v){if(!Array.isArray(v))return!1;if(v[0]==="within")return!0;for(var j=1;j"||j==="<="||j===">="?Nt(v[1],v[2],j):j==="any"?Yt(v.slice(1)):j==="all"?["all"].concat(v.slice(1).map(Vt)):j==="none"?["all"].concat(v.slice(1).map(Vt).map(Zr)):j==="in"?Lr(v[1],v.slice(2)):j==="!in"?Zr(Lr(v[1],v.slice(2))):j==="has"?$r(v[1]):j==="!has"?Zr($r(v[1])):j==="within"?v:!0;return Q}function Nt(v,j,Q){switch(v){case"$type":return["filter-type-"+Q,j];case"$id":return["filter-id-"+Q,j];default:return["filter-"+Q,v,j]}}function Yt(v){return["any"].concat(v.map(Vt))}function Lr(v,j){if(j.length===0)return!1;switch(v){case"$type":return["filter-type-in",["literal",j]];case"$id":return["filter-id-in",["literal",j]];default:return j.length>200&&!j.some(function(Q){return typeof Q!=typeof j[0]})?["filter-in-large",v,["literal",j.sort(Tt)]]:["filter-in-small",v,["literal",j]]}}function $r(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function Zr(v){return["!",v]}function di(v){return Vi(tu(v.value))?kr(su({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):zi(v)}function zi(v){var j=v.value,Q=v.key;if(Is(j)!=="array")return[new So(Q,j,"array expected, "+Is(j)+" found")];var Te=v.styleSpec,je,Ye=[];if(j.length<1)return[new So(Q,j,"filter array must have at least 1 element")];switch(Ye=Ye.concat(ki({key:Q+"[0]",value:j[0],valueSpec:Te.filter_operator,style:v.style,styleSpec:v.styleSpec})),is(j[0])){case"<":case"<=":case">":case">=":j.length>=2&&is(j[1])==="$type"&&Ye.push(new So(Q,j,'"$type" cannot be use with operator "'+j[0]+'"'));case"==":case"!=":j.length!==3&&Ye.push(new So(Q,j,'filter array for operator "'+j[0]+'" must have 3 elements'));case"in":case"!in":j.length>=2&&(je=Is(j[1]),je!=="string"&&Ye.push(new So(Q+"[1]",j[1],"string expected, "+je+" found")));for(var st=2;st=Br[Ii+0]&&Te>=Br[Ii+1])?(st[gi]=!0,Ye.push(Tr[gi])):st[gi]=!1}}},ft.prototype._forEachCell=function(v,j,Q,Te,je,Ye,st,Ut){for(var ir=this._convertToCellCoord(v),Tr=this._convertToCellCoord(j),Br=this._convertToCellCoord(Q),li=this._convertToCellCoord(Te),gi=ir;gi<=Br;gi++)for(var Ii=Tr;Ii<=li;Ii++){var rn=this.d*Ii+gi;if(!(Ut&&!Ut(this._convertFromCellCoord(gi),this._convertFromCellCoord(Ii),this._convertFromCellCoord(gi+1),this._convertFromCellCoord(Ii+1)))&&je.call(this,v,j,Q,Te,rn,Ye,st,Ut))return}},ft.prototype._convertFromCellCoord=function(v){return(v-this.padding)/this.scale},ft.prototype._convertToCellCoord=function(v){return Math.max(0,Math.min(this.d-1,Math.floor(v*this.scale)+this.padding))},ft.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var v=this.cells,j=Ve+this.cells.length+1+1,Q=0,Te=0;Te=0)){var li=v[Br];Tr[Br]=Ht[ir].shallow.indexOf(Br)>=0?li:ci(li,j)}v instanceof Error&&(Tr.message=v.message)}if(Tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return ir!=="Object"&&(Tr.$name=ir),Tr}throw new Error("can't serialize object of type "+typeof v)}function Bi(v){if(v==null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||v instanceof Boolean||v instanceof Number||v instanceof String||v instanceof Date||v instanceof RegExp||Or(v)||pi(v)||ArrayBuffer.isView(v)||v instanceof Pt)return v;if(Array.isArray(v))return v.map(Bi);if(typeof v=="object"){var j=v.$name||"Object",Q=Ht[j],Te=Q.klass;if(!Te)throw new Error("can't deserialize unregistered class "+j);if(Te.deserialize)return Te.deserialize(v);for(var je=Object.create(Te.prototype),Ye=0,st=Object.keys(v);Ye=0?ir:Bi(ir)}}return je}throw new Error("can't deserialize object of type "+typeof v)}var Yi=function(){this.first=!0};Yi.prototype.update=function(v,j){var Q=Math.floor(v);return this.first?(this.first=!1,this.lastIntegerZoom=Q,this.lastIntegerZoomTime=0,this.lastZoom=v,this.lastFloorZoom=Q,!0):(this.lastFloorZoom>Q?(this.lastIntegerZoom=Q+1,this.lastIntegerZoomTime=j):this.lastFloorZoom=128&&v<=255},Arabic:function(v){return v>=1536&&v<=1791},"Arabic Supplement":function(v){return v>=1872&&v<=1919},"Arabic Extended-A":function(v){return v>=2208&&v<=2303},"Hangul Jamo":function(v){return v>=4352&&v<=4607},"Unified Canadian Aboriginal Syllabics":function(v){return v>=5120&&v<=5759},Khmer:function(v){return v>=6016&&v<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(v){return v>=6320&&v<=6399},"General Punctuation":function(v){return v>=8192&&v<=8303},"Letterlike Symbols":function(v){return v>=8448&&v<=8527},"Number Forms":function(v){return v>=8528&&v<=8591},"Miscellaneous Technical":function(v){return v>=8960&&v<=9215},"Control Pictures":function(v){return v>=9216&&v<=9279},"Optical Character Recognition":function(v){return v>=9280&&v<=9311},"Enclosed Alphanumerics":function(v){return v>=9312&&v<=9471},"Geometric Shapes":function(v){return v>=9632&&v<=9727},"Miscellaneous Symbols":function(v){return v>=9728&&v<=9983},"Miscellaneous Symbols and Arrows":function(v){return v>=11008&&v<=11263},"CJK Radicals Supplement":function(v){return v>=11904&&v<=12031},"Kangxi Radicals":function(v){return v>=12032&&v<=12255},"Ideographic Description Characters":function(v){return v>=12272&&v<=12287},"CJK Symbols and Punctuation":function(v){return v>=12288&&v<=12351},Hiragana:function(v){return v>=12352&&v<=12447},Katakana:function(v){return v>=12448&&v<=12543},Bopomofo:function(v){return v>=12544&&v<=12591},"Hangul Compatibility Jamo":function(v){return v>=12592&&v<=12687},Kanbun:function(v){return v>=12688&&v<=12703},"Bopomofo Extended":function(v){return v>=12704&&v<=12735},"CJK Strokes":function(v){return v>=12736&&v<=12783},"Katakana Phonetic Extensions":function(v){return v>=12784&&v<=12799},"Enclosed CJK Letters and Months":function(v){return v>=12800&&v<=13055},"CJK Compatibility":function(v){return v>=13056&&v<=13311},"CJK Unified Ideographs Extension A":function(v){return v>=13312&&v<=19903},"Yijing Hexagram Symbols":function(v){return v>=19904&&v<=19967},"CJK Unified Ideographs":function(v){return v>=19968&&v<=40959},"Yi Syllables":function(v){return v>=40960&&v<=42127},"Yi Radicals":function(v){return v>=42128&&v<=42191},"Hangul Jamo Extended-A":function(v){return v>=43360&&v<=43391},"Hangul Syllables":function(v){return v>=44032&&v<=55215},"Hangul Jamo Extended-B":function(v){return v>=55216&&v<=55295},"Private Use Area":function(v){return v>=57344&&v<=63743},"CJK Compatibility Ideographs":function(v){return v>=63744&&v<=64255},"Arabic Presentation Forms-A":function(v){return v>=64336&&v<=65023},"Vertical Forms":function(v){return v>=65040&&v<=65055},"CJK Compatibility Forms":function(v){return v>=65072&&v<=65103},"Small Form Variants":function(v){return v>=65104&&v<=65135},"Arabic Presentation Forms-B":function(v){return v>=65136&&v<=65279},"Halfwidth and Fullwidth Forms":function(v){return v>=65280&&v<=65519}};function ta(v){for(var j=0,Q=v;j=65097&&v<=65103)||Qi["CJK Compatibility Ideographs"](v)||Qi["CJK Compatibility"](v)||Qi["CJK Radicals Supplement"](v)||Qi["CJK Strokes"](v)||Qi["CJK Symbols and Punctuation"](v)&&!(v>=12296&&v<=12305)&&!(v>=12308&&v<=12319)&&v!==12336||Qi["CJK Unified Ideographs Extension A"](v)||Qi["CJK Unified Ideographs"](v)||Qi["Enclosed CJK Letters and Months"](v)||Qi["Hangul Compatibility Jamo"](v)||Qi["Hangul Jamo Extended-A"](v)||Qi["Hangul Jamo Extended-B"](v)||Qi["Hangul Jamo"](v)||Qi["Hangul Syllables"](v)||Qi.Hiragana(v)||Qi["Ideographic Description Characters"](v)||Qi.Kanbun(v)||Qi["Kangxi Radicals"](v)||Qi["Katakana Phonetic Extensions"](v)||Qi.Katakana(v)&&v!==12540||Qi["Halfwidth and Fullwidth Forms"](v)&&v!==65288&&v!==65289&&v!==65293&&!(v>=65306&&v<=65310)&&v!==65339&&v!==65341&&v!==65343&&!(v>=65371&&v<=65503)&&v!==65507&&!(v>=65512&&v<=65519)||Qi["Small Form Variants"](v)&&!(v>=65112&&v<=65118)&&!(v>=65123&&v<=65126)||Qi["Unified Canadian Aboriginal Syllabics"](v)||Qi["Unified Canadian Aboriginal Syllabics Extended"](v)||Qi["Vertical Forms"](v)||Qi["Yijing Hexagram Symbols"](v)||Qi["Yi Syllables"](v)||Qi["Yi Radicals"](v))}function aa(v){return!!(Qi["Latin-1 Supplement"](v)&&(v===167||v===169||v===174||v===177||v===188||v===189||v===190||v===215||v===247)||Qi["General Punctuation"](v)&&(v===8214||v===8224||v===8225||v===8240||v===8241||v===8251||v===8252||v===8258||v===8263||v===8264||v===8265||v===8273)||Qi["Letterlike Symbols"](v)||Qi["Number Forms"](v)||Qi["Miscellaneous Technical"](v)&&(v>=8960&&v<=8967||v>=8972&&v<=8991||v>=8996&&v<=9e3||v===9003||v>=9085&&v<=9114||v>=9150&&v<=9165||v===9167||v>=9169&&v<=9179||v>=9186&&v<=9215)||Qi["Control Pictures"](v)&&v!==9251||Qi["Optical Character Recognition"](v)||Qi["Enclosed Alphanumerics"](v)||Qi["Geometric Shapes"](v)||Qi["Miscellaneous Symbols"](v)&&!(v>=9754&&v<=9759)||Qi["Miscellaneous Symbols and Arrows"](v)&&(v>=11026&&v<=11055||v>=11088&&v<=11097||v>=11192&&v<=11243)||Qi["CJK Symbols and Punctuation"](v)||Qi.Katakana(v)||Qi["Private Use Area"](v)||Qi["CJK Compatibility Forms"](v)||Qi["Small Form Variants"](v)||Qi["Halfwidth and Fullwidth Forms"](v)||v===8734||v===8756||v===8757||v>=9984&&v<=10087||v>=10102&&v<=10131||v===65532||v===65533)}function gn(v){return!(Zn(v)||aa(v))}function Ja(v){return Qi.Arabic(v)||Qi["Arabic Supplement"](v)||Qi["Arabic Extended-A"](v)||Qi["Arabic Presentation Forms-A"](v)||Qi["Arabic Presentation Forms-B"](v)}function to(v){return v>=1424&&v<=2303||Qi["Arabic Presentation Forms-A"](v)||Qi["Arabic Presentation Forms-B"](v)}function yo(v,j){return!(!j&&to(v)||v>=2304&&v<=3583||v>=3840&&v<=4255||Qi.Khmer(v))}function jo(v){for(var j=0,Q=v;j-1&&(ts=Xo.error),ml&&ml(v)};function ac(){bu.fire(new ni("pluginStateChange",{pluginStatus:ts,pluginURL:ws}))}var bu=new Gr,Eo=function(){return ts},el=function(v){return v({pluginStatus:ts,pluginURL:ws}),bu.on("pluginStateChange",v),v},fl=function(v,j,Q){if(Q===void 0&&(Q=!1),ts===Xo.deferred||ts===Xo.loading||ts===Xo.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ws=Be.resolveURL(v),ts=Xo.deferred,ml=j,ac(),Q||vu()},vu=function(){if(ts!==Xo.deferred||!ws)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ts=Xo.loading,ac(),ws&&Ui({url:ws},function(v){v?Dl(v):(ts=Xo.loaded,ac())})},nu={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ts===Xo.loaded||nu.applyArabicShaping!=null},isLoading:function(){return ts===Xo.loading},setState:function(v){ts=v.pluginStatus,ws=v.pluginURL},isParsed:function(){return nu.applyArabicShaping!=null&&nu.processBidirectionalText!=null&&nu.processStyledBidirectionalText!=null},getPluginURL:function(){return ws}},dh=function(){!nu.isLoading()&&!nu.isLoaded()&&Eo()==="deferred"&&vu()},Zl=function(v,j){this.zoom=v,j?(this.now=j.now,this.fadeDuration=j.fadeDuration,this.zoomHistory=j.zoomHistory,this.transition=j.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yi,this.transition={})};Zl.prototype.isSupportedScript=function(v){return qo(v,nu.isLoaded())},Zl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Zl.prototype.getCrossfadeParameters=function(){var v=this.zoom,j=v-Math.floor(v),Q=this.crossFadingFactor();return v>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:j+(1-j)*Q}:{fromScale:.5,toScale:1,t:1-(1-Q)*j}};var cu=function(v,j){this.property=v,this.value=j,this.expression=O(j===void 0?v.specification.default:j,v.specification)};cu.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},cu.prototype.possiblyEvaluate=function(v,j,Q){return this.property.possiblyEvaluate(this,v,j,Q)};var zh=function(v){this.property=v,this.value=new cu(v,void 0)};zh.prototype.transitioned=function(v,j){return new Pr(this.property,this.value,j,I({},v.transition,this.transition),v.now)},zh.prototype.untransitioned=function(){return new Pr(this.property,this.value,null,{},0)};var St=function(v){this._properties=v,this._values=Object.create(v.defaultTransitionablePropertyValues)};St.prototype.getValue=function(v){return F(this._values[v].value.value)},St.prototype.setValue=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].value=new cu(this._values[v].property,j===null?void 0:F(j))},St.prototype.getTransition=function(v){return F(this._values[v].transition)},St.prototype.setTransition=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].transition=F(j)||void 0},St.prototype.serialize=function(){for(var v={},j=0,Q=Object.keys(this._values);jthis.end)return this.prior=null,je;if(this.value.isDataDriven())return this.prior=null,je;if(TeYe.zoomHistory.lastIntegerZoom?{from:Q,to:Te}:{from:je,to:Te}},j.prototype.interpolate=function(Q){return Q},j}(Tn),ia=function(v){this.specification=v};ia.prototype.possiblyEvaluate=function(v,j,Q,Te){if(v.value!==void 0)if(v.expression.kind==="constant"){var je=v.expression.evaluate(j,null,{},Q,Te);return this._calculate(je,je,je,j)}else return this._calculate(v.expression.evaluate(new Zl(Math.floor(j.zoom-1),j)),v.expression.evaluate(new Zl(Math.floor(j.zoom),j)),v.expression.evaluate(new Zl(Math.floor(j.zoom+1),j)),j)},ia.prototype._calculate=function(v,j,Q,Te){var je=Te.zoom;return je>Te.zoomHistory.lastIntegerZoom?{from:v,to:j}:{from:Q,to:j}},ia.prototype.interpolate=function(v){return v};var La=function(v){this.specification=v};La.prototype.possiblyEvaluate=function(v,j,Q,Te){return!!v.expression.evaluate(j,null,{},Q,Te)},La.prototype.interpolate=function(){return!1};var no=function(v){this.properties=v,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var j in v){var Q=v[j];Q.specification.overridable&&this.overridableProperties.push(j);var Te=this.defaultPropertyValues[j]=new cu(Q,void 0),je=this.defaultTransitionablePropertyValues[j]=new zh(Q);this.defaultTransitioningPropertyValues[j]=je.untransitioned(),this.defaultPossiblyEvaluatedValues[j]=Te.possiblyEvaluate({})}};fr("DataDrivenProperty",Tn),fr("DataConstantProperty",Oi),fr("CrossFadedDataDrivenProperty",ua),fr("CrossFadedProperty",ia),fr("ColorRampProperty",La);var Ka="-transition",da=function(v){function j(Q,Te){if(v.call(this),this.id=Q.id,this.type=Q.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},Q.type!=="custom"&&(Q=Q,this.metadata=Q.metadata,this.minzoom=Q.minzoom,this.maxzoom=Q.maxzoom,Q.type!=="background"&&(this.source=Q.source,this.sourceLayer=Q["source-layer"],this.filter=Q.filter),Te.layout&&(this._unevaluatedLayout=new en(Te.layout)),Te.paint)){this._transitionablePaint=new St(Te.paint);for(var je in Q.paint)this.setPaintProperty(je,Q.paint[je],{validate:!1});for(var Ye in Q.layout)this.setLayoutProperty(Ye,Q.layout[Ye],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new xn(Te.paint)}}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},j.prototype.getLayoutProperty=function(Q){return Q==="visibility"?this.visibility:this._unevaluatedLayout.getValue(Q)},j.prototype.setLayoutProperty=function(Q,Te,je){if(je===void 0&&(je={}),Te!=null){var Ye="layers."+this.id+".layout."+Q;if(this._validate(wc,Ye,Q,Te,je))return}if(Q==="visibility"){this.visibility=Te;return}this._unevaluatedLayout.setValue(Q,Te)},j.prototype.getPaintProperty=function(Q){return U(Q,Ka)?this._transitionablePaint.getTransition(Q.slice(0,-Ka.length)):this._transitionablePaint.getValue(Q)},j.prototype.setPaintProperty=function(Q,Te,je){if(je===void 0&&(je={}),Te!=null){var Ye="layers."+this.id+".paint."+Q;if(this._validate(nc,Ye,Q,Te,je))return!1}if(U(Q,Ka))return this._transitionablePaint.setTransition(Q.slice(0,-Ka.length),Te||void 0),!1;var st=this._transitionablePaint._values[Q],Ut=st.property.specification["property-type"]==="cross-faded-data-driven",ir=st.value.isDataDriven(),Tr=st.value;this._transitionablePaint.setValue(Q,Te),this._handleSpecialPaintPropertyUpdate(Q);var Br=this._transitionablePaint._values[Q].value,li=Br.isDataDriven();return li||ir||Ut||this._handleOverridablePaintPropertyUpdate(Q,Tr,Br)},j.prototype._handleSpecialPaintPropertyUpdate=function(Q){},j.prototype._handleOverridablePaintPropertyUpdate=function(Q,Te,je){return!1},j.prototype.isHidden=function(Q){return this.minzoom&&Q=this.maxzoom?!0:this.visibility==="none"},j.prototype.updateTransitions=function(Q){this._transitioningPaint=this._transitionablePaint.transitioned(Q,this._transitioningPaint)},j.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},j.prototype.recalculate=function(Q,Te){Q.getCrossfadeParameters&&(this._crossfadeParameters=Q.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(Q,void 0,Te)),this.paint=this._transitioningPaint.possiblyEvaluate(Q,void 0,Te)},j.prototype.serialize=function(){var Q={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(Q.layout=Q.layout||{},Q.layout.visibility=this.visibility),W(Q,function(Te,je){return Te!==void 0&&!(je==="layout"&&!Object.keys(Te).length)&&!(je==="paint"&&!Object.keys(Te).length)})},j.prototype._validate=function(Q,Te,je,Ye,st){return st===void 0&&(st={}),st&&st.validate===!1?!1:ih(this,Q.call(Js,{key:Te,layerType:this.type,objectKey:je,value:Ye,styleSpec:$a,style:{glyphs:!0,sprite:!0}}))},j.prototype.is3D=function(){return!1},j.prototype.isTileClipped=function(){return!1},j.prototype.hasOffscreenPass=function(){return!1},j.prototype.resize=function(){},j.prototype.isStateDependent=function(){for(var Q in this.paint._values){var Te=this.paint.get(Q);if(!(!(Te instanceof Cn)||!$u(Te.property.specification))&&(Te.value.kind==="source"||Te.value.kind==="composite")&&Te.value.isStateDependent)return!0}return!1},j}(Gr),Nn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=function(v,j){this._structArray=v,this._pos1=j*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},on=128,Kn=5,Fn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Fn.serialize=function(v,j){return v._trim(),j&&(v.isTransferred=!0,j.push(v.arrayBuffer)),{length:v.length,arrayBuffer:v.arrayBuffer}},Fn.deserialize=function(v){var j=Object.create(this.prototype);return j.arrayBuffer=v.arrayBuffer,j.length=v.length,j.capacity=v.arrayBuffer.byteLength/j.bytesPerElement,j._refreshViews(),j},Fn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Fn.prototype.clear=function(){this.length=0},Fn.prototype.resize=function(v){this.reserve(v),this.length=v},Fn.prototype.reserve=function(v){if(v>this.capacity){this.capacity=Math.max(v,Math.floor(this.capacity*Kn),on),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var j=this.uint8;this._refreshViews(),j&&this.uint8.set(j)}},Fn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function bn(v,j){j===void 0&&(j=1);var Q=0,Te=0,je=v.map(function(st){var Ut=Na(st.type),ir=Q=ba(Q,Math.max(j,Ut)),Tr=st.components||1;return Te=Math.max(Te,Ut),Q+=Ut*Tr,{name:st.name,type:st.type,components:Tr,offset:ir}}),Ye=ba(Q,Math.max(Te,j));return{members:je,size:Ye,alignment:j}}function Na(v){return Nn[v].BYTES_PER_ELEMENT}function ba(v,j){return Math.ceil(v/j)*j}var Qa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.int16[Ye+0]=Te,this.int16[Ye+1]=je,Q},j}(Fn);Qa.prototype.bytesPerElement=4,fr("StructArrayLayout2i4",Qa);var Bn=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*4;return this.int16[Ut+0]=Te,this.int16[Ut+1]=je,this.int16[Ut+2]=Ye,this.int16[Ut+3]=st,Q},j}(Fn);Bn.prototype.bytesPerElement=8,fr("StructArrayLayout4i8",Bn);var wn=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*6;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.int16[Tr+2]=Ye,this.int16[Tr+3]=st,this.int16[Tr+4]=Ut,this.int16[Tr+5]=ir,Q},j}(Fn);wn.prototype.bytesPerElement=12,fr("StructArrayLayout2i4i12",wn);var ja=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*4,Br=Q*8;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.uint8[Br+4]=Ye,this.uint8[Br+5]=st,this.uint8[Br+6]=Ut,this.uint8[Br+7]=ir,Q},j}(Fn);ja.prototype.bytesPerElement=8,fr("StructArrayLayout2i4ub8",ja);var Ca=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.float32[Ye+0]=Te,this.float32[Ye+1]=je,Q},j}(Fn);Ca.prototype.bytesPerElement=8,fr("StructArrayLayout2f8",Ca);var oa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li){var gi=this.length;return this.resize(gi+1),this.emplace(gi,Q,Te,je,Ye,st,Ut,ir,Tr,Br,li)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi){var Ii=Q*10;return this.uint16[Ii+0]=Te,this.uint16[Ii+1]=je,this.uint16[Ii+2]=Ye,this.uint16[Ii+3]=st,this.uint16[Ii+4]=Ut,this.uint16[Ii+5]=ir,this.uint16[Ii+6]=Tr,this.uint16[Ii+7]=Br,this.uint16[Ii+8]=li,this.uint16[Ii+9]=gi,Q},j}(Fn);oa.prototype.bytesPerElement=20,fr("StructArrayLayout10ui20",oa);var la=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii){var rn=this.length;return this.resize(rn+1),this.emplace(rn,Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn){var Dn=Q*12;return this.int16[Dn+0]=Te,this.int16[Dn+1]=je,this.int16[Dn+2]=Ye,this.int16[Dn+3]=st,this.uint16[Dn+4]=Ut,this.uint16[Dn+5]=ir,this.uint16[Dn+6]=Tr,this.uint16[Dn+7]=Br,this.int16[Dn+8]=li,this.int16[Dn+9]=gi,this.int16[Dn+10]=Ii,this.int16[Dn+11]=rn,Q},j}(Fn);la.prototype.bytesPerElement=24,fr("StructArrayLayout4i4ui4i24",la);var Da=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.float32[st+0]=Te,this.float32[st+1]=je,this.float32[st+2]=Ye,Q},j}(Fn);Da.prototype.bytesPerElement=12,fr("StructArrayLayout3f12",Da);var $o=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.uint32[je+0]=Te,Q},j}(Fn);$o.prototype.bytesPerElement=4,fr("StructArrayLayout1ul4",$o);var Io=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br){var li=this.length;return this.resize(li+1),this.emplace(li,Q,Te,je,Ye,st,Ut,ir,Tr,Br)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li){var gi=Q*10,Ii=Q*5;return this.int16[gi+0]=Te,this.int16[gi+1]=je,this.int16[gi+2]=Ye,this.int16[gi+3]=st,this.int16[gi+4]=Ut,this.int16[gi+5]=ir,this.uint32[Ii+3]=Tr,this.uint16[gi+8]=Br,this.uint16[gi+9]=li,Q},j}(Fn);Io.prototype.bytesPerElement=20,fr("StructArrayLayout6i1ul2ui20",Io);var Ia=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*6;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.int16[Tr+2]=Ye,this.int16[Tr+3]=st,this.int16[Tr+4]=Ut,this.int16[Tr+5]=ir,Q},j}(Fn);Ia.prototype.bytesPerElement=12,fr("StructArrayLayout2i2i2i12",Ia);var qa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st){var Ut=this.length;return this.resize(Ut+1),this.emplace(Ut,Q,Te,je,Ye,st)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut){var ir=Q*4,Tr=Q*8;return this.float32[ir+0]=Te,this.float32[ir+1]=je,this.float32[ir+2]=Ye,this.int16[Tr+6]=st,this.int16[Tr+7]=Ut,Q},j}(Fn);qa.prototype.bytesPerElement=16,fr("StructArrayLayout2f1f2i16",qa);var Co=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*12,ir=Q*3;return this.uint8[Ut+0]=Te,this.uint8[Ut+1]=je,this.float32[ir+1]=Ye,this.float32[ir+2]=st,Q},j}(Fn);Co.prototype.bytesPerElement=12,fr("StructArrayLayout2ub2f12",Co);var Ro=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.uint16[st+0]=Te,this.uint16[st+1]=je,this.uint16[st+2]=Ye,Q},j}(Fn);Ro.prototype.bytesPerElement=6,fr("StructArrayLayout3ui6",Ro);var us=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za){var Ga=this.length;return this.resize(Ga+1),this.emplace(Ga,Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za,Ga){var Pa=Q*24,co=Q*12,Lo=Q*48;return this.int16[Pa+0]=Te,this.int16[Pa+1]=je,this.uint16[Pa+2]=Ye,this.uint16[Pa+3]=st,this.uint32[co+2]=Ut,this.uint32[co+3]=ir,this.uint32[co+4]=Tr,this.uint16[Pa+10]=Br,this.uint16[Pa+11]=li,this.uint16[Pa+12]=gi,this.float32[co+7]=Ii,this.float32[co+8]=rn,this.uint8[Lo+36]=Dn,this.uint8[Lo+37]=ya,this.uint8[Lo+38]=ma,this.uint32[co+10]=za,this.int16[Pa+22]=Ga,Q},j}(Fn);us.prototype.bytesPerElement=48,fr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",us);var Kl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za,Ga,Pa,co,Lo,Ko,Yo,Cs,As,Hs,tl,yl){var Vs=this.length;return this.resize(Vs+1),this.emplace(Vs,Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za,Ga,Pa,co,Lo,Ko,Yo,Cs,As,Hs,tl,yl)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,li,gi,Ii,rn,Dn,ya,ma,za,Ga,Pa,co,Lo,Ko,Yo,Cs,As,Hs,tl,yl,Vs){var Ks=Q*34,Ku=Q*17;return this.int16[Ks+0]=Te,this.int16[Ks+1]=je,this.int16[Ks+2]=Ye,this.int16[Ks+3]=st,this.int16[Ks+4]=Ut,this.int16[Ks+5]=ir,this.int16[Ks+6]=Tr,this.int16[Ks+7]=Br,this.uint16[Ks+8]=li,this.uint16[Ks+9]=gi,this.uint16[Ks+10]=Ii,this.uint16[Ks+11]=rn,this.uint16[Ks+12]=Dn,this.uint16[Ks+13]=ya,this.uint16[Ks+14]=ma,this.uint16[Ks+15]=za,this.uint16[Ks+16]=Ga,this.uint16[Ks+17]=Pa,this.uint16[Ks+18]=co,this.uint16[Ks+19]=Lo,this.uint16[Ks+20]=Ko,this.uint16[Ks+21]=Yo,this.uint16[Ks+22]=Cs,this.uint32[Ku+12]=As,this.float32[Ku+13]=Hs,this.float32[Ku+14]=tl,this.float32[Ku+15]=yl,this.float32[Ku+16]=Vs,Q},j}(Fn);Kl.prototype.bytesPerElement=68,fr("StructArrayLayout8i15ui1ul4f68",Kl);var zl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.float32[je+0]=Te,Q},j}(Fn);zl.prototype.bytesPerElement=4,fr("StructArrayLayout1f4",zl);var gs=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.int16[st+0]=Te,this.int16[st+1]=je,this.int16[st+2]=Ye,Q},j}(Fn);gs.prototype.bytesPerElement=6,fr("StructArrayLayout3i6",gs);var Pu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*2,Ut=Q*4;return this.uint32[st+0]=Te,this.uint16[Ut+2]=je,this.uint16[Ut+3]=Ye,Q},j}(Fn);Pu.prototype.bytesPerElement=8,fr("StructArrayLayout1ul2ui8",Pu);var kl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.uint16[Ye+0]=Te,this.uint16[Ye+1]=je,Q},j}(Fn);kl.prototype.bytesPerElement=4,fr("StructArrayLayout2ui4",kl);var Fu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.uint16[je+0]=Te,Q},j}(Fn);Fu.prototype.bytesPerElement=2,fr("StructArrayLayout1ui2",Fu);var kc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*4;return this.float32[Ut+0]=Te,this.float32[Ut+1]=je,this.float32[Ut+2]=Ye,this.float32[Ut+3]=st,Q},j}(Fn);kc.prototype.bytesPerElement=16,fr("StructArrayLayout4f16",kc);var Ec=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return Q.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},Q.x1.get=function(){return this._structArray.int16[this._pos2+2]},Q.y1.get=function(){return this._structArray.int16[this._pos2+3]},Q.x2.get=function(){return this._structArray.int16[this._pos2+4]},Q.y2.get=function(){return this._structArray.int16[this._pos2+5]},Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.anchorPoint.get=function(){return new u(this.anchorPointX,this.anchorPointY)},Object.defineProperties(j.prototype,Q),j}(Ei);Ec.prototype.size=20;var Au=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Ec(this,Q)},j}(Io);fr("CollisionBoxArray",Au);var wu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},Q.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},Q.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},Q.segment.get=function(){return this._structArray.uint16[this._pos2+10]},Q.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},Q.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},Q.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},Q.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},Q.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},Q.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},Q.placedOrientation.set=function(Te){this._structArray.uint8[this._pos1+37]=Te},Q.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},Q.hidden.set=function(Te){this._structArray.uint8[this._pos1+38]=Te},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},Q.crossTileID.set=function(Te){this._structArray.uint32[this._pos4+10]=Te},Q.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(j.prototype,Q),j}(Ei);wu.prototype.size=48;var Iu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new wu(this,Q)},j}(us);fr("PlacedSymbolArray",Iu);var Zo=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},Q.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},Q.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},Q.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},Q.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},Q.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},Q.key.get=function(){return this._structArray.uint16[this._pos2+8]},Q.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},Q.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},Q.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},Q.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},Q.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},Q.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},Q.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},Q.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},Q.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},Q.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},Q.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},Q.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},Q.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},Q.crossTileID.set=function(Te){this._structArray.uint32[this._pos4+12]=Te},Q.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},Q.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},Q.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},Q.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(j.prototype,Q),j}(Ei);Zo.prototype.size=68;var Du=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Zo(this,Q)},j}(Kl);fr("SymbolInstanceArray",Du);var vl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getoffsetX=function(Q){return this.float32[Q*1+0]},j}(zl);fr("GlyphOffsetArray",vl);var Nu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getx=function(Q){return this.int16[Q*3+0]},j.prototype.gety=function(Q){return this.int16[Q*3+1]},j.prototype.gettileUnitDistanceFromAnchor=function(Q){return this.int16[Q*3+2]},j}(gs);fr("SymbolLineVertexArray",Nu);var Lc=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(j.prototype,Q),j}(Ei);Lc.prototype.size=8;var Fo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Lc(this,Q)},j}(Pu);fr("FeatureIndexArray",Fo);var Ds=bn([{name:"a_pos",components:2,type:"Int16"}],4),Ol=Ds.members,Ml=function(v){v===void 0&&(v=[]),this.segments=v};Ml.prototype.prepareSegment=function(v,j,Q,Te){var je=this.segments[this.segments.length-1];return v>Ml.MAX_VERTEX_ARRAY_LENGTH&&G("Max vertices per segment is "+Ml.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+v),(!je||je.vertexLength+v>Ml.MAX_VERTEX_ARRAY_LENGTH||je.sortKey!==Te)&&(je={vertexOffset:j.length,primitiveOffset:Q.length,vertexLength:0,primitiveLength:0},Te!==void 0&&(je.sortKey=Te),this.segments.push(je)),je},Ml.prototype.get=function(){return this.segments},Ml.prototype.destroy=function(){for(var v=0,j=this.segments;v>>16)*ir&65535)<<16)&4294967295,Br=Br<<15|Br>>>17,Br=(Br&65535)*Tr+(((Br>>>16)*Tr&65535)<<16)&4294967295,st^=Br,st=st<<13|st>>>19,Ut=(st&65535)*5+(((st>>>16)*5&65535)<<16)&4294967295,st=(Ut&65535)+27492+(((Ut>>>16)+58964&65535)<<16);switch(Br=0,je){case 3:Br^=(Q.charCodeAt(li+2)&255)<<16;case 2:Br^=(Q.charCodeAt(li+1)&255)<<8;case 1:Br^=Q.charCodeAt(li)&255,Br=(Br&65535)*ir+(((Br>>>16)*ir&65535)<<16)&4294967295,Br=Br<<15|Br>>>17,Br=(Br&65535)*Tr+(((Br>>>16)*Tr&65535)<<16)&4294967295,st^=Br}return st^=Q.length,st^=st>>>16,st=(st&65535)*2246822507+(((st>>>16)*2246822507&65535)<<16)&4294967295,st^=st>>>13,st=(st&65535)*3266489909+(((st>>>16)*3266489909&65535)<<16)&4294967295,st^=st>>>16,st>>>0}v.exports=j}),we=n(function(v){function j(Q,Te){for(var je=Q.length,Ye=Te^je,st=0,Ut;je>=4;)Ut=Q.charCodeAt(st)&255|(Q.charCodeAt(++st)&255)<<8|(Q.charCodeAt(++st)&255)<<16|(Q.charCodeAt(++st)&255)<<24,Ut=(Ut&65535)*1540483477+(((Ut>>>16)*1540483477&65535)<<16),Ut^=Ut>>>24,Ut=(Ut&65535)*1540483477+(((Ut>>>16)*1540483477&65535)<<16),Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16)^Ut,je-=4,++st;switch(je){case 3:Ye^=(Q.charCodeAt(st+2)&255)<<16;case 2:Ye^=(Q.charCodeAt(st+1)&255)<<8;case 1:Ye^=Q.charCodeAt(st)&255,Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16)}return Ye^=Ye>>>13,Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16),Ye^=Ye>>>15,Ye>>>0}v.exports=j}),We=ie,mt=ie,wt=we;We.murmur3=mt,We.murmur2=wt;var Qe=function(){this.ids=[],this.positions=[],this.indexed=!1};Qe.prototype.add=function(v,j,Q,Te){this.ids.push(It(v)),this.positions.push(j,Q,Te)},Qe.prototype.getPositions=function(v){for(var j=It(v),Q=0,Te=this.ids.length-1;Q>1;this.ids[je]>=j?Te=je:Q=je+1}for(var Ye=[];this.ids[Q]===j;){var st=this.positions[3*Q],Ut=this.positions[3*Q+1],ir=this.positions[3*Q+2];Ye.push({index:st,start:Ut,end:ir}),Q++}return Ye},Qe.serialize=function(v,j){var Q=new Float64Array(v.ids),Te=new Uint32Array(v.positions);return lr(Q,Te,0,Q.length-1),j&&j.push(Q.buffer,Te.buffer),{ids:Q,positions:Te}},Qe.deserialize=function(v){var j=new Qe;return j.ids=v.ids,j.positions=v.positions,j.indexed=!0,j};var dt=Math.pow(2,53)-1;function It(v){var j=+v;return!isNaN(j)&&j<=dt?j:We(String(v))}function lr(v,j,Q,Te){for(;Q>1],Ye=Q-1,st=Te+1;;){do Ye++;while(v[Ye]je);if(Ye>=st)break;Qt(v,Ye,st),Qt(j,3*Ye,3*st),Qt(j,3*Ye+1,3*st+1),Qt(j,3*Ye+2,3*st+2)}st-Qst.x+1||irst.y+1)&&G("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return Q}function Xl(v,j){return{type:v.type,id:v.id,properties:v.properties,geometry:j?Tl(v):[]}}function Pc(v,j,Q,Te,je){v.emplaceBack(j*2+(Te+1)/2,Q*2+(je+1)/2)}var $s=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new Qa,this.indexArray=new Ro,this.segments=new Ml,this.programConfigurations=new Vn(v.layers,v.zoom),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};$s.prototype.populate=function(v,j,Q){var Te=this.layers[0],je=[],Ye=null;Te.type==="circle"&&(Ye=Te.layout.get("circle-sort-key"));for(var st=0,Ut=v;st=Jo||li<0||li>=Jo)){var gi=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,v.sortKey),Ii=gi.vertexLength;Pc(this.layoutVertexArray,Br,li,-1,-1),Pc(this.layoutVertexArray,Br,li,1,-1),Pc(this.layoutVertexArray,Br,li,1,1),Pc(this.layoutVertexArray,Br,li,-1,1),this.indexArray.emplaceBack(Ii,Ii+1,Ii+2),this.indexArray.emplaceBack(Ii,Ii+3,Ii+2),gi.vertexLength+=4,gi.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,Q,{},Te)},fr("CircleBucket",$s,{omit:["layers"]});function zu(v,j){for(var Q=0;Q=3){for(var Ye=0;Ye1){if(l0(v,j))return!0;for(var Te=0;Te1?v.distSqr(Q):v.distSqr(Q.sub(j)._mult(je)._add(j))}function c0(v,j){for(var Q=!1,Te,je,Ye,st=0;stj.y!=Ye.y>j.y&&j.x<(Ye.x-je.x)*(j.y-je.y)/(Ye.y-je.y)+je.x&&(Q=!Q)}return Q}function fp(v,j){for(var Q=!1,Te=0,je=v.length-1;Tej.y!=st.y>j.y&&j.x<(st.x-Ye.x)*(j.y-Ye.y)/(st.y-Ye.y)+Ye.x&&(Q=!Q)}return Q}function tg(v,j,Q,Te,je){for(var Ye=0,st=v;Ye=Ut.x&&je>=Ut.y)return!0}var ir=[new u(j,Q),new u(j,je),new u(Te,je),new u(Te,Q)];if(v.length>2)for(var Tr=0,Br=ir;Trje.x&&j.x>je.x||v.yje.y&&j.y>je.y)return!1;var Ye=ee(v,j,Q[0]);return Ye!==ee(v,j,Q[1])||Ye!==ee(v,j,Q[2])||Ye!==ee(v,j,Q[3])}function h0(v,j,Q){var Te=j.paint.get(v).value;return Te.kind==="constant"?Te.value:Q.programConfigurations.get(j.id).getMaxValue(v)}function f0(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function Cp(v,j,Q,Te,je){if(!j[0]&&!j[1])return v;var Ye=u.convert(j)._mult(je);Q==="viewport"&&Ye._rotate(-Te);for(var st=[],Ut=0;Ut0&&(Ye=1/Math.sqrt(Ye)),v[0]=j[0]*Ye,v[1]=j[1]*Ye,v[2]=j[2]*Ye,v}function CA(v,j){return v[0]*j[0]+v[1]*j[1]+v[2]*j[2]}function AA(v,j,Q){var Te=j[0],je=j[1],Ye=j[2],st=Q[0],Ut=Q[1],ir=Q[2];return v[0]=je*ir-Ye*Ut,v[1]=Ye*st-Te*ir,v[2]=Te*Ut-je*st,v}function MA(v,j,Q){var Te=j[0],je=j[1],Ye=j[2];return v[0]=Te*Q[0]+je*Q[3]+Ye*Q[6],v[1]=Te*Q[1]+je*Q[4]+Ye*Q[7],v[2]=Te*Q[2]+je*Q[5]+Ye*Q[8],v}var EA=Gw;(function(){var v=Ob();return function(j,Q,Te,je,Ye,st){var Ut,ir;for(Q||(Q=3),Te||(Te=0),je?ir=Math.min(je*Q+Te,j.length):ir=j.length,Ut=Te;Utv.width||je.height>v.height||Q.x>v.width-je.width||Q.y>v.height-je.height)throw new RangeError("out of range source coordinates for image copy");if(je.width>j.width||je.height>j.height||Te.x>j.width-je.width||Te.y>j.height-je.height)throw new RangeError("out of range destination coordinates for image copy");for(var st=v.data,Ut=j.data,ir=0;ir80*Q){Ut=Tr=v[0],ir=Br=v[1];for(var rn=Q;rnTr&&(Tr=li),gi>Br&&(Br=gi);Ii=Math.max(Tr-Ut,Br-ir),Ii=Ii!==0?1/Ii:0}return s1(Ye,st,Q,Ut,ir,Ii),st}function Xw(v,j,Q,Te,je){var Ye,st;if(je===i3(v,j,Q,Te)>0)for(Ye=j;Ye=j;Ye-=Te)st=$6(Ye,v[Ye],v[Ye+1],st);return st&&_y(st,st.next)&&(Y_(st),st=st.next),st}function Og(v,j){if(!v)return v;j||(j=v);var Q=v,Te;do if(Te=!1,!Q.steiner&&(_y(Q,Q.next)||Sf(Q.prev,Q,Q.next)===0)){if(Y_(Q),Q=j=Q.prev,Q===Q.next)break;Te=!0}else Q=Q.next;while(Te||Q!==j);return j}function s1(v,j,Q,Te,je,Ye,st){if(v){!st&&Ye&&Qw(v,Te,je,Ye);for(var Ut=v,ir,Tr;v.prev!==v.next;){if(ir=v.prev,Tr=v.next,Ye?BA(v,Te,je,Ye):Jw(v)){j.push(ir.i/Q),j.push(v.i/Q),j.push(Tr.i/Q),Y_(v),v=Tr.next,Ut=Tr.next;continue}if(v=Tr,v===Ut){st?st===1?(v=RA(Og(v),j,Q),s1(v,j,Q,Te,je,Ye,2)):st===2&&N6(v,j,Q,Te,je,Ye):s1(Og(v),j,Q,Te,je,Ye,1);break}}}}function Jw(v){var j=v.prev,Q=v,Te=v.next;if(Sf(j,Q,Te)>=0)return!1;for(var je=v.next.next;je!==v.prev;){if(lv(j.x,j.y,Q.x,Q.y,Te.x,Te.y,je.x,je.y)&&Sf(je.prev,je,je.next)>=0)return!1;je=je.next}return!0}function BA(v,j,Q,Te){var je=v.prev,Ye=v,st=v.next;if(Sf(je,Ye,st)>=0)return!1;for(var Ut=je.xYe.x?je.x>st.x?je.x:st.x:Ye.x>st.x?Ye.x:st.x,Br=je.y>Ye.y?je.y>st.y?je.y:st.y:Ye.y>st.y?Ye.y:st.y,li=e3(Ut,ir,j,Q,Te),gi=e3(Tr,Br,j,Q,Te),Ii=v.prevZ,rn=v.nextZ;Ii&&Ii.z>=li&&rn&&rn.z<=gi;){if(Ii!==v.prev&&Ii!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,Ii.x,Ii.y)&&Sf(Ii.prev,Ii,Ii.next)>=0||(Ii=Ii.prevZ,rn!==v.prev&&rn!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,rn.x,rn.y)&&Sf(rn.prev,rn,rn.next)>=0))return!1;rn=rn.nextZ}for(;Ii&&Ii.z>=li;){if(Ii!==v.prev&&Ii!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,Ii.x,Ii.y)&&Sf(Ii.prev,Ii,Ii.next)>=0)return!1;Ii=Ii.prevZ}for(;rn&&rn.z<=gi;){if(rn!==v.prev&&rn!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,rn.x,rn.y)&&Sf(rn.prev,rn,rn.next)>=0)return!1;rn=rn.nextZ}return!0}function RA(v,j,Q){var Te=v;do{var je=Te.prev,Ye=Te.next.next;!_y(je,Ye)&&l1(je,Te,Te.next,Ye)&&xy(je,Ye)&&xy(Ye,je)&&(j.push(je.i/Q),j.push(Te.i/Q),j.push(Ye.i/Q),Y_(Te),Y_(Te.next),Te=v=Ye),Te=Te.next}while(Te!==v);return Og(Te)}function N6(v,j,Q,Te,je,Ye){var st=v;do{for(var Ut=st.next.next;Ut!==st.prev;){if(st.i!==Ut.i&&NA(st,Ut)){var ir=r3(st,Ut);st=Og(st,st.next),ir=Og(ir,ir.next),s1(st,j,Q,Te,je,Ye),s1(ir,j,Q,Te,je,Ye);return}Ut=Ut.next}st=st.next}while(st!==v)}function j6(v,j,Q,Te){var je=[],Ye,st,Ut,ir,Tr;for(Ye=0,st=j.length;Ye=Q.next.y&&Q.next.y!==Q.y){var Ut=Q.x+(je-Q.y)*(Q.next.x-Q.x)/(Q.next.y-Q.y);if(Ut<=Te&&Ut>Ye){if(Ye=Ut,Ut===Te){if(je===Q.y)return Q;if(je===Q.next.y)return Q.next}st=Q.x=Q.x&&Q.x>=Tr&&Te!==Q.x&&lv(jest.x||Q.x===st.x&&U6(st,Q)))&&(st=Q,li=gi)),Q=Q.next;while(Q!==ir);return st}function U6(v,j){return Sf(v.prev,v,j.prev)<0&&Sf(j.next,v,v.next)<0}function Qw(v,j,Q,Te){var je=v;do je.z===null&&(je.z=e3(je.x,je.y,j,Q,Te)),je.prevZ=je.prev,je.nextZ=je.next,je=je.next;while(je!==v);je.prevZ.nextZ=null,je.prevZ=null,FA(je)}function FA(v){var j,Q,Te,je,Ye,st,Ut,ir,Tr=1;do{for(Q=v,v=null,Ye=null,st=0;Q;){for(st++,Te=Q,Ut=0,j=0;j0||ir>0&&Te;)Ut!==0&&(ir===0||!Te||Q.z<=Te.z)?(je=Q,Q=Q.nextZ,Ut--):(je=Te,Te=Te.nextZ,ir--),Ye?Ye.nextZ=je:v=je,je.prevZ=Ye,Ye=je;Q=Te}Ye.nextZ=null,Tr*=2}while(st>1);return v}function e3(v,j,Q,Te,je){return v=32767*(v-Q)*je,j=32767*(j-Te)*je,v=(v|v<<8)&16711935,v=(v|v<<4)&252645135,v=(v|v<<2)&858993459,v=(v|v<<1)&1431655765,j=(j|j<<8)&16711935,j=(j|j<<4)&252645135,j=(j|j<<2)&858993459,j=(j|j<<1)&1431655765,v|j<<1}function Vb(v){var j=v,Q=v;do(j.x=0&&(v-st)*(Te-Ut)-(Q-st)*(j-Ut)>=0&&(Q-st)*(Ye-Ut)-(je-st)*(Te-Ut)>=0}function NA(v,j){return v.next.i!==j.i&&v.prev.i!==j.i&&!t3(v,j)&&(xy(v,j)&&xy(j,v)&&Wb(v,j)&&(Sf(v.prev,v,j.prev)||Sf(v,j.prev,j))||_y(v,j)&&Sf(v.prev,v,v.next)>0&&Sf(j.prev,j,j.next)>0)}function Sf(v,j,Q){return(j.y-v.y)*(Q.x-j.x)-(j.x-v.x)*(Q.y-j.y)}function _y(v,j){return v.x===j.x&&v.y===j.y}function l1(v,j,Q,Te){var je=K_(Sf(v,j,Q)),Ye=K_(Sf(v,j,Te)),st=K_(Sf(Q,Te,v)),Ut=K_(Sf(Q,Te,j));return!!(je!==Ye&&st!==Ut||je===0&&Z_(v,Q,j)||Ye===0&&Z_(v,Te,j)||st===0&&Z_(Q,v,Te)||Ut===0&&Z_(Q,j,Te))}function Z_(v,j,Q){return j.x<=Math.max(v.x,Q.x)&&j.x>=Math.min(v.x,Q.x)&&j.y<=Math.max(v.y,Q.y)&&j.y>=Math.min(v.y,Q.y)}function K_(v){return v>0?1:v<0?-1:0}function t3(v,j){var Q=v;do{if(Q.i!==v.i&&Q.next.i!==v.i&&Q.i!==j.i&&Q.next.i!==j.i&&l1(Q,Q.next,v,j))return!0;Q=Q.next}while(Q!==v);return!1}function xy(v,j){return Sf(v.prev,v,v.next)<0?Sf(v,j,v.next)>=0&&Sf(v,v.prev,j)>=0:Sf(v,j,v.prev)<0||Sf(v,v.next,j)<0}function Wb(v,j){var Q=v,Te=!1,je=(v.x+j.x)/2,Ye=(v.y+j.y)/2;do Q.y>Ye!=Q.next.y>Ye&&Q.next.y!==Q.y&&je<(Q.next.x-Q.x)*(Ye-Q.y)/(Q.next.y-Q.y)+Q.x&&(Te=!Te),Q=Q.next;while(Q!==v);return Te}function r3(v,j){var Q=new qb(v.i,v.x,v.y),Te=new qb(j.i,j.x,j.y),je=v.next,Ye=j.prev;return v.next=j,j.prev=v,Q.next=je,je.prev=Q,Te.next=Q,Q.prev=Te,Ye.next=Te,Te.prev=Ye,Te}function $6(v,j,Q,Te){var je=new qb(v,j,Q);return Te?(je.next=Te.next,je.prev=Te,Te.next.prev=je,Te.next=je):(je.prev=je,je.next=je),je}function Y_(v){v.next.prev=v.prev,v.prev.next=v.next,v.prevZ&&(v.prevZ.nextZ=v.nextZ),v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function qb(v,j,Q){this.i=v,this.x=j,this.y=Q,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Hb.deviation=function(v,j,Q,Te){var je=j&&j.length,Ye=je?j[0]*Q:v.length,st=Math.abs(i3(v,0,Ye,Q));if(je)for(var Ut=0,ir=j.length;Ut0&&(Te+=v[je-1].length,Q.holes.push(Te))}return Q},$b.default=F6;function jA(v,j,Q,Te,je){H6(v,j,Q,Te||v.length-1,je||n3)}function H6(v,j,Q,Te,je){for(;Te>Q;){if(Te-Q>600){var Ye=Te-Q+1,st=j-Q+1,Ut=Math.log(Ye),ir=.5*Math.exp(2*Ut/3),Tr=.5*Math.sqrt(Ut*ir*(Ye-ir)/Ye)*(st-Ye/2<0?-1:1),Br=Math.max(Q,Math.floor(j-st*ir/Ye+Tr)),li=Math.min(Te,Math.floor(j+(Ye-st)*ir/Ye+Tr));H6(v,j,Br,li,je)}var gi=v[j],Ii=Q,rn=Te;for(X_(v,Q,j),je(v[Te],gi)>0&&X_(v,Q,Te);Ii0;)rn--}je(v[Q],gi)===0?X_(v,Q,rn):(rn++,X_(v,rn,Te)),rn<=j&&(Q=rn+1),j<=rn&&(Te=rn-1)}}function X_(v,j,Q){var Te=v[j];v[j]=v[Q],v[Q]=Te}function n3(v,j){return vj?1:0}function ig(v,j){var Q=v.length;if(Q<=1)return[v];for(var Te=[],je,Ye,st=0;st1)for(var ir=0;ir>3}if(Te--,Q===1||Q===2)je+=v.readSVarint(),Ye+=v.readSVarint(),Q===1&&(Ut&&st.push(Ut),Ut=[]),Ut.push(new u(je,Ye));else if(Q===7)Ut&&Ut.push(Ut[0].clone());else throw new Error("unknown command "+Q)}return Ut&&st.push(Ut),st},u1.prototype.bbox=function(){var v=this._pbf;v.pos=this._geometry;for(var j=v.readVarint()+v.pos,Q=1,Te=0,je=0,Ye=0,st=1/0,Ut=-1/0,ir=1/0,Tr=-1/0;v.pos>3}if(Te--,Q===1||Q===2)je+=v.readSVarint(),Ye+=v.readSVarint(),jeUt&&(Ut=je),YeTr&&(Tr=Ye);else if(Q!==7)throw new Error("unknown command "+Q)}return[st,ir,Ut,Tr]},u1.prototype.toGeoJSON=function(v,j,Q){var Te=this.extent*Math.pow(2,Q),je=this.extent*v,Ye=this.extent*j,st=this.loadGeometry(),Ut=u1.types[this.type],ir,Tr;function Br(Ii){for(var rn=0;rn>3;j=Te===1?v.readString():Te===2?v.readFloat():Te===3?v.readDouble():Te===4?v.readVarint64():Te===5?v.readVarint():Te===6?v.readSVarint():Te===7?v.readBoolean():null}return j}J6.prototype.feature=function(v){if(v<0||v>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[v];var j=this._pbf.readVarint()+this._pbf.pos;return new by(this._pbf,j,this.extent,this._keys,this._values)};var ek=tk;function tk(v,j){this.layers=v.readFields(rk,{},j)}function rk(v,j,Q){if(v===3){var Te=new s3(Q,Q.readVarint()+Q.pos);Te.length&&(j[Te.name]=Te)}}var ik=ek,UA=by,$A=s3,c1={VectorTile:ik,VectorTileFeature:UA,VectorTileLayer:$A},wy=c1.VectorTileFeature.types,nk=500,ky=Math.pow(2,13);function Ty(v,j,Q,Te,je,Ye,st,Ut){v.emplaceBack(j,Q,Math.floor(Te*ky)*2+st,je*ky*2,Ye*ky*2,Math.round(Ut))}var E0=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new wn,this.indexArray=new Ro,this.programConfigurations=new Vn(v.layers,v.zoom),this.segments=new Ml,this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};E0.prototype.populate=function(v,j,Q){this.features=[],this.hasPattern=Gb("fill-extrusion",this.layers,j);for(var Te=0,je=v;Te=1){var Ga=Dn[ma-1];if(!Kb(za,Ga)){gi.vertexLength+4>Ml.MAX_VERTEX_ARRAY_LENGTH&&(gi=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Pa=za.sub(Ga)._perp()._unit(),co=Ga.dist(za);ya+co>32768&&(ya=0),Ty(this.layoutVertexArray,za.x,za.y,Pa.x,Pa.y,0,0,ya),Ty(this.layoutVertexArray,za.x,za.y,Pa.x,Pa.y,0,1,ya),ya+=co,Ty(this.layoutVertexArray,Ga.x,Ga.y,Pa.x,Pa.y,0,0,ya),Ty(this.layoutVertexArray,Ga.x,Ga.y,Pa.x,Pa.y,0,1,ya);var Lo=gi.vertexLength;this.indexArray.emplaceBack(Lo,Lo+2,Lo+1),this.indexArray.emplaceBack(Lo+1,Lo+2,Lo+3),gi.vertexLength+=4,gi.primitiveLength+=2}}}}if(gi.vertexLength+ir>Ml.MAX_VERTEX_ARRAY_LENGTH&&(gi=this.segments.prepareSegment(ir,this.layoutVertexArray,this.indexArray)),wy[v.type]==="Polygon"){for(var Ko=[],Yo=[],Cs=gi.vertexLength,As=0,Hs=Ut;AsJo)||v.y===j.y&&(v.y<0||v.y>Jo)}function Yb(v){return v.every(function(j){return j.x<0})||v.every(function(j){return j.x>Jo})||v.every(function(j){return j.y<0})||v.every(function(j){return j.y>Jo})}var HA=new no({"fill-extrusion-opacity":new Oi($a["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Tn($a["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Oi($a["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Oi($a["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ua($a["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Tn($a["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Tn($a["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Oi($a["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),VA={paint:HA},WA=function(v){function j(Q){v.call(this,Q,VA)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.createBucket=function(Q){return new E0(Q)},j.prototype.queryRadius=function(){return f0(this.paint.get("fill-extrusion-translate"))},j.prototype.is3D=function(){return!0},j.prototype.queryIntersectsFeature=function(Q,Te,je,Ye,st,Ut,ir,Tr){var Br=Cp(Q,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ut.angle,ir),li=this.paint.get("fill-extrusion-height").evaluate(Te,je),gi=this.paint.get("fill-extrusion-base").evaluate(Te,je),Ii=ak(Br,Tr,Ut,0),rn=l3(Ye,gi,li,Tr),Dn=rn[0],ya=rn[1];return cv(Dn,ya,Ii)},j}(da);function ng(v,j){return v.x*j.x+v.y*j.y}function ep(v,j){if(v.length===1){for(var Q=0,Te=j[Q++],je;!je||Te.equals(je);)if(je=j[Q++],!je)return 1/0;for(;Q=2&&v[ir-1].equals(v[ir-2]);)ir--;for(var Tr=0;Tr0;if(Ko&&ma>Tr){var Cs=gi.dist(Ii);if(Cs>2*Br){var As=gi.sub(gi.sub(Ii)._mult(Br/Cs)._round());this.updateDistance(Ii,As),this.addCurrentVertex(As,Dn,0,0,li),Ii=As}}var Hs=Ii&&rn,tl=Hs?Q:Ut?"butt":Te;if(Hs&&tl==="round"&&(coje&&(tl="bevel"),tl==="bevel"&&(co>2&&(tl="flipbevel"),co100)za=ya.mult(-1);else{var yl=co*Dn.add(ya).mag()/Dn.sub(ya).mag();za._perp()._mult(yl*(Yo?-1:1))}this.addCurrentVertex(gi,za,0,0,li),this.addCurrentVertex(gi,za.mult(-1),0,0,li)}else if(tl==="bevel"||tl==="fakeround"){var Vs=-Math.sqrt(co*co-1),Ks=Yo?Vs:0,Ku=Yo?0:Vs;if(Ii&&this.addCurrentVertex(gi,Dn,Ks,Ku,li),tl==="fakeround")for(var Vc=Math.round(Lo*180/Math.PI/h3),wh=1;wh2*Br){var bd=gi.add(rn.sub(gi)._mult(Br/vp)._round());this.updateDistance(gi,bd),this.addCurrentVertex(bd,ya,0,0,li),gi=bd}}}}},pp.prototype.addCurrentVertex=function(v,j,Q,Te,je,Ye){Ye===void 0&&(Ye=!1);var st=j.x+j.y*Q,Ut=j.y-j.x*Q,ir=-j.x+j.y*Te,Tr=-j.y-j.x*Te;this.addHalfVertex(v,st,Ut,Ye,!1,Q,je),this.addHalfVertex(v,ir,Tr,Ye,!0,-Te,je),this.distance>Xb/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(v,j,Q,Te,je,Ye))},pp.prototype.addHalfVertex=function(v,j,Q,Te,je,Ye,st){var Ut=v.x,ir=v.y,Tr=this.lineClips?this.scaledDistance*(Xb-1):this.scaledDistance,Br=Tr*Sy;if(this.layoutVertexArray.emplaceBack((Ut<<1)+(Te?1:0),(ir<<1)+(je?1:0),Math.round(uk*j)+128,Math.round(uk*Q)+128,(Ye===0?0:Ye<0?-1:1)+1|(Br&63)<<2,Br>>6),this.lineClips){var li=this.scaledDistance-this.lineClips.start,gi=this.lineClips.end-this.lineClips.start,Ii=li/gi;this.layoutVertexArray2.emplaceBack(Ii,this.lineClipsArray.length)}var rn=st.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,rn),st.primitiveLength++),je?this.e2=rn:this.e1=rn},pp.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},pp.prototype.updateDistance=function(v,j){this.distance+=v.dist(j),this.updateScaledDistance()},fr("LineBucket",pp,{omit:["layers","patternFeatures"]});var f3=new no({"line-cap":new Oi($a.layout_line["line-cap"]),"line-join":new Tn($a.layout_line["line-join"]),"line-miter-limit":new Oi($a.layout_line["line-miter-limit"]),"line-round-limit":new Oi($a.layout_line["line-round-limit"]),"line-sort-key":new Tn($a.layout_line["line-sort-key"])}),Jb=new no({"line-opacity":new Tn($a.paint_line["line-opacity"]),"line-color":new Tn($a.paint_line["line-color"]),"line-translate":new Oi($a.paint_line["line-translate"]),"line-translate-anchor":new Oi($a.paint_line["line-translate-anchor"]),"line-width":new Tn($a.paint_line["line-width"]),"line-gap-width":new Tn($a.paint_line["line-gap-width"]),"line-offset":new Tn($a.paint_line["line-offset"]),"line-blur":new Tn($a.paint_line["line-blur"]),"line-dasharray":new ia($a.paint_line["line-dasharray"]),"line-pattern":new ua($a.paint_line["line-pattern"]),"line-gradient":new La($a.paint_line["line-gradient"])}),Cy={paint:Jb,layout:f3},d3=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.possiblyEvaluate=function(Q,Te){return Te=new Zl(Math.floor(Te.zoom),{now:Te.now,fadeDuration:Te.fadeDuration,zoomHistory:Te.zoomHistory,transition:Te.transition}),v.prototype.possiblyEvaluate.call(this,Q,Te)},j.prototype.evaluate=function(Q,Te,je,Ye){return Te=I({},Te,{zoom:Math.floor(Te.zoom)}),v.prototype.evaluate.call(this,Q,Te,je,Ye)},j}(Tn),Qb=new d3(Cy.paint.properties["line-width"].specification);Qb.useIntegerZoom=!0;var p3=function(v){function j(Q){v.call(this,Q,Cy),this.gradientVersion=0}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._handleSpecialPaintPropertyUpdate=function(Q){if(Q==="line-gradient"){var Te=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Te._styleExpression.expression instanceof Jc,this.gradientVersion=(this.gradientVersion+1)%b}},j.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},j.prototype.recalculate=function(Q,Te){v.prototype.recalculate.call(this,Q,Te),this.paint._values["line-floorwidth"]=Qb.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,Q)},j.prototype.createBucket=function(Q){return new pp(Q)},j.prototype.queryRadius=function(Q){var Te=Q,je=fk(h0("line-width",this,Te),h0("line-gap-width",this,Te)),Ye=h0("line-offset",this,Te);return je/2+Math.abs(Ye)+f0(this.paint.get("line-translate"))},j.prototype.queryIntersectsFeature=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Cp(Q,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ut.angle,ir),Br=ir/2*fk(this.paint.get("line-width").evaluate(Te,je),this.paint.get("line-gap-width").evaluate(Te,je)),li=this.paint.get("line-offset").evaluate(Te,je);return li&&(Ye=X(Ye,li*ir)),M0(Tr,Ye,Br)},j.prototype.isTileClipped=function(){return!0},j}(da);function fk(v,j){return j>0?j+2*v:v}function X(v,j){for(var Q=[],Te=new u(0,0),je=0;je":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Sr(v){for(var j="",Q=0;Q>1,Br=-7,li=Q?je-1:0,gi=Q?-1:1,Ii=v[j+li];for(li+=gi,Ye=Ii&(1<<-Br)-1,Ii>>=-Br,Br+=Ut;Br>0;Ye=Ye*256+v[j+li],li+=gi,Br-=8);for(st=Ye&(1<<-Br)-1,Ye>>=-Br,Br+=Te;Br>0;st=st*256+v[j+li],li+=gi,Br-=8);if(Ye===0)Ye=1-Tr;else{if(Ye===ir)return st?NaN:(Ii?-1:1)*(1/0);st=st+Math.pow(2,Te),Ye=Ye-Tr}return(Ii?-1:1)*st*Math.pow(2,Ye-Te)},bi=function(v,j,Q,Te,je,Ye){var st,Ut,ir,Tr=Ye*8-je-1,Br=(1<>1,gi=je===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ii=Te?0:Ye-1,rn=Te?1:-1,Dn=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(Ut=isNaN(j)?1:0,st=Br):(st=Math.floor(Math.log(j)/Math.LN2),j*(ir=Math.pow(2,-st))<1&&(st--,ir*=2),st+li>=1?j+=gi/ir:j+=gi*Math.pow(2,1-li),j*ir>=2&&(st++,ir/=2),st+li>=Br?(Ut=0,st=Br):st+li>=1?(Ut=(j*ir-1)*Math.pow(2,je),st=st+li):(Ut=j*Math.pow(2,li-1)*Math.pow(2,je),st=0));je>=8;v[Q+Ii]=Ut&255,Ii+=rn,Ut/=256,je-=8);for(st=st<0;v[Q+Ii]=st&255,Ii+=rn,st/=256,Tr-=8);v[Q+Ii-rn]|=Dn*128},Fi={read:ai,write:bi},Gi=pn;function pn(v){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(v)?v:new Uint8Array(v||0),this.pos=0,this.type=0,this.length=this.buf.length}pn.Varint=0,pn.Fixed64=1,pn.Bytes=2,pn.Fixed32=5;var jn=65536*65536,Fa=1/jn,ha=12,Aa=typeof TextDecoder>"u"?null:new TextDecoder("utf8");pn.prototype={destroy:function(){this.buf=null},readFields:function(v,j,Q){for(Q=Q||this.length;this.pos>3,Ye=this.pos;this.type=Te&7,v(je,j,this),this.pos===Ye&&this.skip(Te)}return j},readMessage:function(v,j){return this.readFields(v,j,this.readVarint()+this.pos)},readFixed32:function(){var v=d0(this.buf,this.pos);return this.pos+=4,v},readSFixed32:function(){var v=vd(this.buf,this.pos);return this.pos+=4,v},readFixed64:function(){var v=d0(this.buf,this.pos)+d0(this.buf,this.pos+4)*jn;return this.pos+=8,v},readSFixed64:function(){var v=d0(this.buf,this.pos)+vd(this.buf,this.pos+4)*jn;return this.pos+=8,v},readFloat:function(){var v=Fi.read(this.buf,this.pos,!0,23,4);return this.pos+=4,v},readDouble:function(){var v=Fi.read(this.buf,this.pos,!0,52,8);return this.pos+=8,v},readVarint:function(v){var j=this.buf,Q,Te;return Te=j[this.pos++],Q=Te&127,Te<128||(Te=j[this.pos++],Q|=(Te&127)<<7,Te<128)||(Te=j[this.pos++],Q|=(Te&127)<<14,Te<128)||(Te=j[this.pos++],Q|=(Te&127)<<21,Te<128)?Q:(Te=j[this.pos],Q|=(Te&15)<<28,lo(Q,v,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var v=this.readVarint();return v%2===1?(v+1)/-2:v/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var v=this.readVarint()+this.pos,j=this.pos;return this.pos=v,v-j>=ha&&Aa?Vp(this.buf,j,v):Hp(this.buf,j,v)},readBytes:function(){var v=this.readVarint()+this.pos,j=this.buf.subarray(this.pos,v);return this.pos=v,j},readPackedVarint:function(v,j){if(this.type!==pn.Bytes)return v.push(this.readVarint(j));var Q=Oo(this);for(v=v||[];this.pos127;);else if(j===pn.Bytes)this.pos=this.readVarint()+this.pos;else if(j===pn.Fixed32)this.pos+=4;else if(j===pn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+j)},writeTag:function(v,j){this.writeVarint(v<<3|j)},realloc:function(v){for(var j=this.length||16;j268435455||v<0){Bl(v,this);return}this.realloc(4),this.buf[this.pos++]=v&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=v>>>7&127)))},writeSVarint:function(v){this.writeVarint(v<0?-v*2-1:v*2)},writeBoolean:function(v){this.writeVarint(!!v)},writeString:function(v){v=String(v),this.realloc(v.length*4),this.pos++;var j=this.pos;this.pos=Wp(this.buf,v,this.pos);var Q=this.pos-j;Q>=128&&nl(j,Q,this),this.pos=j-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(v){this.realloc(4),Fi.write(this.buf,v,this.pos,!0,23,4),this.pos+=4},writeDouble:function(v){this.realloc(8),Fi.write(this.buf,v,this.pos,!0,52,8),this.pos+=8},writeBytes:function(v){var j=v.length;this.writeVarint(j),this.realloc(j);for(var Q=0;Q=128&&nl(Q,Te,this),this.pos=Q-1,this.writeVarint(Te),this.pos+=Te},writeMessage:function(v,j,Q){this.writeTag(v,pn.Bytes),this.writeRawMessage(j,Q)},writePackedVarint:function(v,j){j.length&&this.writeMessage(v,qs,j)},writePackedSVarint:function(v,j){j.length&&this.writeMessage(v,Ns,j)},writePackedBoolean:function(v,j){j.length&&this.writeMessage(v,al,j)},writePackedFloat:function(v,j){j.length&&this.writeMessage(v,wo,j)},writePackedDouble:function(v,j){j.length&&this.writeMessage(v,dl,j)},writePackedFixed32:function(v,j){j.length&&this.writeMessage(v,eu,j)},writePackedSFixed32:function(v,j){j.length&&this.writeMessage(v,xh,j)},writePackedFixed64:function(v,j){j.length&&this.writeMessage(v,ph,j)},writePackedSFixed64:function(v,j){j.length&&this.writeMessage(v,Od,j)},writeBytesField:function(v,j){this.writeTag(v,pn.Bytes),this.writeBytes(j)},writeFixed32Field:function(v,j){this.writeTag(v,pn.Fixed32),this.writeFixed32(j)},writeSFixed32Field:function(v,j){this.writeTag(v,pn.Fixed32),this.writeSFixed32(j)},writeFixed64Field:function(v,j){this.writeTag(v,pn.Fixed64),this.writeFixed64(j)},writeSFixed64Field:function(v,j){this.writeTag(v,pn.Fixed64),this.writeSFixed64(j)},writeVarintField:function(v,j){this.writeTag(v,pn.Varint),this.writeVarint(j)},writeSVarintField:function(v,j){this.writeTag(v,pn.Varint),this.writeSVarint(j)},writeStringField:function(v,j){this.writeTag(v,pn.Bytes),this.writeString(j)},writeFloatField:function(v,j){this.writeTag(v,pn.Fixed32),this.writeFloat(j)},writeDoubleField:function(v,j){this.writeTag(v,pn.Fixed64),this.writeDouble(j)},writeBooleanField:function(v,j){this.writeVarintField(v,!!j)}};function lo(v,j,Q){var Te=Q.buf,je,Ye;if(Ye=Te[Q.pos++],je=(Ye&112)>>4,Ye<128||(Ye=Te[Q.pos++],je|=(Ye&127)<<3,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<10,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<17,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<24,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&1)<<31,Ye<128))return Ps(v,je,j);throw new Error("Expected varint not more than 10 bytes")}function Oo(v){return v.type===pn.Bytes?v.readVarint()+v.pos:v.pos+1}function Ps(v,j,Q){return Q?j*4294967296+(v>>>0):(j>>>0)*4294967296+(v>>>0)}function Bl(v,j){var Q,Te;if(v>=0?(Q=v%4294967296|0,Te=v/4294967296|0):(Q=~(-v%4294967296),Te=~(-v/4294967296),Q^4294967295?Q=Q+1|0:(Q=0,Te=Te+1|0)),v>=18446744073709552e3||v<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");j.realloc(10),Ss(Q,Te,j),vs(Te,j)}function Ss(v,j,Q){Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos]=v&127}function vs(v,j){var Q=(v&7)<<4;j.buf[j.pos++]|=Q|((v>>>=3)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127)))))}function nl(v,j,Q){var Te=j<=16383?1:j<=2097151?2:j<=268435455?3:Math.floor(Math.log(j)/(Math.LN2*7));Q.realloc(Te);for(var je=Q.pos-1;je>=v;je--)Q.buf[je+Te]=Q.buf[je]}function qs(v,j){for(var Q=0;Q>>8,v[Q+2]=j>>>16,v[Q+3]=j>>>24}function vd(v,j){return(v[j]|v[j+1]<<8|v[j+2]<<16)+(v[j+3]<<24)}function Hp(v,j,Q){for(var Te="",je=j;je239?4:Ye>223?3:Ye>191?2:1;if(je+Ut>Q)break;var ir,Tr,Br;Ut===1?Ye<128&&(st=Ye):Ut===2?(ir=v[je+1],(ir&192)===128&&(st=(Ye&31)<<6|ir&63,st<=127&&(st=null))):Ut===3?(ir=v[je+1],Tr=v[je+2],(ir&192)===128&&(Tr&192)===128&&(st=(Ye&15)<<12|(ir&63)<<6|Tr&63,(st<=2047||st>=55296&&st<=57343)&&(st=null))):Ut===4&&(ir=v[je+1],Tr=v[je+2],Br=v[je+3],(ir&192)===128&&(Tr&192)===128&&(Br&192)===128&&(st=(Ye&15)<<18|(ir&63)<<12|(Tr&63)<<6|Br&63,(st<=65535||st>=1114112)&&(st=null))),st===null?(st=65533,Ut=1):st>65535&&(st-=65536,Te+=String.fromCharCode(st>>>10&1023|55296),st=56320|st&1023),Te+=String.fromCharCode(st),je+=Ut}return Te}function Vp(v,j,Q){return Aa.decode(v.subarray(j,Q))}function Wp(v,j,Q){for(var Te=0,je,Ye;Te55295&&je<57344)if(Ye)if(je<56320){v[Q++]=239,v[Q++]=191,v[Q++]=189,Ye=je;continue}else je=Ye-55296<<10|je-56320|65536,Ye=null;else{je>56319||Te+1===j.length?(v[Q++]=239,v[Q++]=191,v[Q++]=189):Ye=je;continue}else Ye&&(v[Q++]=239,v[Q++]=191,v[Q++]=189,Ye=null);je<128?v[Q++]=je:(je<2048?v[Q++]=je>>6|192:(je<65536?v[Q++]=je>>12|224:(v[Q++]=je>>18|240,v[Q++]=je>>12&63|128),v[Q++]=je>>6&63|128),v[Q++]=je&63|128)}return Q}var vf=3;function Bd(v,j,Q){v===1&&Q.readMessage(Ap,j)}function Ap(v,j,Q){if(v===3){var Te=Q.readMessage(mp,{}),je=Te.id,Ye=Te.bitmap,st=Te.width,Ut=Te.height,ir=Te.left,Tr=Te.top,Br=Te.advance;j.push({id:je,bitmap:new gd({width:st+2*vf,height:Ut+2*vf},Ye),metrics:{width:st,height:Ut,left:ir,top:Tr,advance:Br}})}}function mp(v,j,Q){v===1?j.id=Q.readVarint():v===2?j.bitmap=Q.readBytes():v===3?j.width=Q.readVarint():v===4?j.height=Q.readVarint():v===5?j.left=Q.readSVarint():v===6?j.top=Q.readSVarint():v===7&&(j.advance=Q.readVarint())}function qp(v){return new Gi(v).readFields(Bd,[])}var tp=vf;function L0(v){for(var j=0,Q=0,Te=0,je=v;Te=0;Ii--){var rn=Ut[Ii];if(!(gi.w>rn.w||gi.h>rn.h)){if(gi.x=rn.x,gi.y=rn.y,Tr=Math.max(Tr,gi.y+gi.h),ir=Math.max(ir,gi.x+gi.w),gi.w===rn.w&&gi.h===rn.h){var Dn=Ut.pop();Ii=0&&Te>=v&&P0[this.text.charCodeAt(Te)];Te--)Q--;this.text=this.text.substring(v,Q),this.sectionIndex=this.sectionIndex.slice(v,Q)},bh.prototype.substring=function(v,j){var Q=new bh;return Q.text=this.text.substring(v,j),Q.sectionIndex=this.sectionIndex.slice(v,j),Q.sections=this.sections,Q},bh.prototype.toString=function(){return this.text},bh.prototype.getMaxScale=function(){var v=this;return this.sectionIndex.reduce(function(j,Q){return Math.max(j,v.sections[Q].scale)},0)},bh.prototype.addTextSection=function(v,j){this.text+=v.text,this.sections.push(Mp.forText(v.scale,v.fontStack||j));for(var Q=this.sections.length-1,Te=0;Te=Nm?null:++this.imageSectionID:(this.imageSectionID=Fm,this.imageSectionID)};function rp(v,j){for(var Q=[],Te=v.text,je=0,Ye=0,st=j;Ye=0,Br=0,li=0;li0&&mh>Cs&&(Cs=mh)}else{var Wf=Q[Hs.fontStack],vp=Wf&&Wf[yl];if(vp&&vp.rect)Ku=vp.rect,Ks=vp.metrics;else{var bd=j[Hs.fontStack],Zp=bd&&bd[yl];if(!Zp)continue;Ks=Zp.metrics}Vs=(co-Hs.scale)*Rr}oc?(v.verticalizable=!0,Yo.push({glyph:yl,imageName:Vc,x:gi,y:Ii+Vs,vertical:oc,scale:Hs.scale,fontStack:Hs.fontStack,sectionIndex:tl,metrics:Ks,rect:Ku}),gi+=wh*Hs.scale+Tr):(Yo.push({glyph:yl,imageName:Vc,x:gi,y:Ii+Vs,vertical:oc,scale:Hs.scale,fontStack:Hs.fontStack,sectionIndex:tl,metrics:Ks,rect:Ku}),gi+=Ks.advance*Hs.scale+Tr)}if(Yo.length!==0){var Kp=gi-Tr;rn=Math.max(Kp,rn),ZA(Yo,0,Yo.length-1,ya,Cs)}gi=0;var Yp=Ye*co+Cs;Ko.lineOffset=Math.max(Cs,Lo),Ii+=Yp,Dn=Math.max(Yp,Dn),++ma}var np=Ii-Bh,p0=x3(st),m0=p0.horizontalAlign,Rd=p0.verticalAlign;KA(v.positionedLines,ya,m0,Rd,rn,Dn,Ye,np,je.length),v.top+=-Rd*np,v.bottom=v.top+np,v.left+=-m0*rn,v.right=v.left+rn}function ZA(v,j,Q,Te,je){if(!(!Te&&!je))for(var Ye=v[Q],st=Ye.metrics.advance*Ye.scale,Ut=(v[Q].x+st)*Te,ir=j;ir<=Q;ir++)v[ir].x-=Ut,v[ir].y+=je}function KA(v,j,Q,Te,je,Ye,st,Ut,ir){var Tr=(j-Q)*je,Br=0;Ye!==st?Br=-Ut*Te-Bh:Br=(-Te*ir+.5)*st;for(var li=0,gi=v;li-Q/2;){if(st--,st<0)return!1;Ut-=v[st].dist(Ye),Ye=v[st]}Ut+=v[st].dist(v[st+1]),st++;for(var ir=[],Tr=0;UtTe;)Tr-=ir.shift().angleDelta;if(Tr>je)return!1;st++,Ut+=li.dist(gi)}return!0}function gp(v){for(var j=0,Q=0;QTr){var rn=(Tr-ir)/Ii,Dn=Eu(li.x,gi.x,rn),ya=Eu(li.y,gi.y,rn),ma=new My(Dn,ya,gi.angleTo(li),Br);return ma._round(),!st||mk(v,ma,Ut,st,j)?ma:void 0}ir+=Ii}}function h1(v,j,Q,Te,je,Ye,st,Ut,ir){var Tr=I0(Te,Ye,st),Br=hv(Te,je),li=Br*st,gi=v[0].x===0||v[0].x===ir||v[0].y===0||v[0].y===ir;j-li=0&&Pa=0&&co=0&&gi+Tr<=Br){var Lo=new My(Pa,co,za,rn);Lo._round(),(!Te||mk(v,Lo,Ye,Te,je))&&Ii.push(Lo)}}li+=ma}return!Ut&&!Ii.length&&!st&&(Ii=Um(v,li/2,Q,Te,je,Ye,st,!0,ir)),Ii}function Gz(v,j,Q,Te,je){for(var Ye=[],st=0;st=Te&&li.x>=Te)&&(Br.x>=Te?Br=new u(Te,Br.y+(li.y-Br.y)*((Te-Br.x)/(li.x-Br.x)))._round():li.x>=Te&&(li=new u(Te,Br.y+(li.y-Br.y)*((Te-Br.x)/(li.x-Br.x)))._round()),!(Br.y>=je&&li.y>=je)&&(Br.y>=je?Br=new u(Br.x+(li.x-Br.x)*((je-Br.y)/(li.y-Br.y)),je)._round():li.y>=je&&(li=new u(Br.x+(li.x-Br.x)*((je-Br.y)/(li.y-Br.y)),je)._round()),(!ir||!Br.equals(ir[ir.length-1]))&&(ir=[Br],Ye.push(ir)),ir.push(li)))))}return Ye}var t2=Oh;function Zz(v,j,Q,Te){var je=[],Ye=v.image,st=Ye.pixelRatio,Ut=Ye.paddedRect.w-2*t2,ir=Ye.paddedRect.h-2*t2,Tr=v.right-v.left,Br=v.bottom-v.top,li=Ye.stretchX||[[0,Ut]],gi=Ye.stretchY||[[0,ir]],Ii=function(Wc,Yu){return Wc+Yu[1]-Yu[0]},rn=li.reduce(Ii,0),Dn=gi.reduce(Ii,0),ya=Ut-rn,ma=ir-Dn,za=0,Ga=rn,Pa=0,co=Dn,Lo=0,Ko=ya,Yo=0,Cs=ma;if(Ye.content&&Te){var As=Ye.content;za=gk(li,0,As[0]),Pa=gk(gi,0,As[1]),Ga=gk(li,As[0],As[2]),co=gk(gi,As[1],As[3]),Lo=As[0]-za,Yo=As[1]-Pa,Ko=As[2]-As[0]-Ga,Cs=As[3]-As[1]-co}var Hs=function(Wc,Yu,qh,mh){var Wf=vk(Wc.stretch-za,Ga,Tr,v.left),vp=yk(Wc.fixed-Lo,Ko,Wc.stretch,rn),bd=vk(Yu.stretch-Pa,co,Br,v.top),Zp=yk(Yu.fixed-Yo,Cs,Yu.stretch,Dn),Kp=vk(qh.stretch-za,Ga,Tr,v.left),Yp=yk(qh.fixed-Lo,Ko,qh.stretch,rn),np=vk(mh.stretch-Pa,co,Br,v.top),p0=yk(mh.fixed-Yo,Cs,mh.stretch,Dn),m0=new u(Wf,bd),Rd=new u(Kp,bd),g0=new u(Kp,np),xm=new u(Wf,np),p1=new u(vp/st,Zp/st),Iy=new u(Yp/st,p0/st),Dy=j*Math.PI/180;if(Dy){var zy=Math.sin(Dy),u2=Math.cos(Dy),ag=[u2,-zy,zy,u2];m0._matMult(ag),Rd._matMult(ag),xm._matMult(ag),g0._matMult(ag)}var Tk=Wc.stretch+Wc.fixed,a7=qh.stretch+qh.fixed,Sk=Yu.stretch+Yu.fixed,o7=mh.stretch+mh.fixed,$m={x:Ye.paddedRect.x+t2+Tk,y:Ye.paddedRect.y+t2+Sk,w:a7-Tk,h:o7-Sk},c2=Ko/st/Tr,Ck=Cs/st/Br;return{tl:m0,tr:Rd,bl:xm,br:g0,tex:$m,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:p1,pixelOffsetBR:Iy,minFontScaleX:c2,minFontScaleY:Ck,isSDF:Q}};if(!Te||!Ye.stretchX&&!Ye.stretchY)je.push(Hs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Ut+1},{fixed:0,stretch:ir+1}));else for(var tl=Kz(li,ya,rn),yl=Kz(gi,ma,Dn),Vs=0;Vs0&&(Ii=Math.max(10,Ii),this.circleDiameter=Ii)}else{var rn=Ye.top*st-Ut,Dn=Ye.bottom*st+Ut,ya=Ye.left*st-Ut,ma=Ye.right*st+Ut,za=Ye.collisionPadding;if(za&&(ya-=za[0]*st,rn-=za[1]*st,ma+=za[2]*st,Dn+=za[3]*st),Tr){var Ga=new u(ya,rn),Pa=new u(ma,rn),co=new u(ya,Dn),Lo=new u(ma,Dn),Ko=Tr*Math.PI/180;Ga._rotate(Ko),Pa._rotate(Ko),co._rotate(Ko),Lo._rotate(Ko),ya=Math.min(Ga.x,Pa.x,co.x,Lo.x),ma=Math.max(Ga.x,Pa.x,co.x,Lo.x),rn=Math.min(Ga.y,Pa.y,co.y,Lo.y),Dn=Math.max(Ga.y,Pa.y,co.y,Lo.y)}v.emplaceBack(j.x,j.y,ya,rn,ma,Dn,Q,Te,je)}this.boxEndIndex=v.length},r2=function(v,j){if(v===void 0&&(v=[]),j===void 0&&(j=$re),this.data=v,this.length=this.data.length,this.compare=j,this.length>0)for(var Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)};r2.prototype.push=function(v){this.data.push(v),this.length++,this._up(this.length-1)},r2.prototype.pop=function(){if(this.length!==0){var v=this.data[0],j=this.data.pop();return this.length--,this.length>0&&(this.data[0]=j,this._down(0)),v}},r2.prototype.peek=function(){return this.data[0]},r2.prototype._up=function(v){for(var j=this,Q=j.data,Te=j.compare,je=Q[v];v>0;){var Ye=v-1>>1,st=Q[Ye];if(Te(je,st)>=0)break;Q[v]=st,v=Ye}Q[v]=je},r2.prototype._down=function(v){for(var j=this,Q=j.data,Te=j.compare,je=this.length>>1,Ye=Q[v];v=0)break;Q[v]=Ut,v=st}Q[v]=Ye};function $re(v,j){return vj?1:0}function Hre(v,j,Q){Q===void 0&&(Q=!1);for(var Te=1/0,je=1/0,Ye=-1/0,st=-1/0,Ut=v[0],ir=0;irYe)&&(Ye=Tr.x),(!ir||Tr.y>st)&&(st=Tr.y)}var Br=Ye-Te,li=st-je,gi=Math.min(Br,li),Ii=gi/2,rn=new r2([],Vre);if(gi===0)return new u(Te,je);for(var Dn=Te;Dnma.d||!ma.d)&&(ma=Ga,Q&&console.log("found best %d after %d probes",Math.round(1e4*Ga.d)/1e4,za)),!(Ga.max-ma.d<=j)&&(Ii=Ga.h/2,rn.push(new i2(Ga.p.x-Ii,Ga.p.y-Ii,Ii,v)),rn.push(new i2(Ga.p.x+Ii,Ga.p.y-Ii,Ii,v)),rn.push(new i2(Ga.p.x-Ii,Ga.p.y+Ii,Ii,v)),rn.push(new i2(Ga.p.x+Ii,Ga.p.y+Ii,Ii,v)),za+=4)}return Q&&(console.log("num probes: "+za),console.log("best distance: "+ma.d)),ma.p}function Vre(v,j){return j.max-v.max}function i2(v,j,Q,Te){this.p=new u(v,j),this.h=Q,this.d=Wre(this.p,Te),this.max=this.d+this.h*Math.SQRT2}function Wre(v,j){for(var Q=!1,Te=1/0,je=0;jev.y!=Br.y>v.y&&v.x<(Br.x-Tr.x)*(v.y-Tr.y)/(Br.y-Tr.y)+Tr.x&&(Q=!Q),Te=Math.min(Te,Sp(v,Tr,Br))}return(Q?1:-1)*Math.sqrt(Te)}function qre(v){for(var j=0,Q=0,Te=0,je=v[0],Ye=0,st=je.length,Ut=st-1;Ye=Jo||ag.y<0||ag.y>=Jo||Kre(v,ag,u2,Q,Te,je,yl,v.layers[0],v.collisionBoxArray,j.index,j.sourceLayerIndex,v.index,ma,co,Yo,ir,Ga,Lo,Cs,Ii,j,Ye,Tr,Br,st)};if(As==="line")for(var Ks=0,Ku=Gz(j.geometry,0,0,Jo,Jo);Ks1){var bd=jm(vp,Ko,Q.vertical||rn,Te,Dn,za);bd&&Vs(vp,bd)}}else if(j.type==="Polygon")for(var Zp=0,Kp=ig(j.geometry,0);ZpLy&&G(v.layerIds[0]+': Value for "text-size" is >= '+w3+'. Reduce your "text-size".')):ya.kind==="composite"&&(ma=[yd*Ii.compositeTextSizes[0].evaluate(st,{},rn),yd*Ii.compositeTextSizes[1].evaluate(st,{},rn)],(ma[0]>Ly||ma[1]>Ly)&&G(v.layerIds[0]+': Value for "text-size" is >= '+w3+'. Reduce your "text-size".')),v.addSymbols(v.text,Dn,ma,Ut,Ye,st,Tr,j,ir.lineStartIndex,ir.lineLength,gi,rn);for(var za=0,Ga=Br;zaLy&&G(v.layerIds[0]+': Value for "icon-size" is >= '+w3+'. Reduce your "icon-size".')):m0.kind==="composite"&&(Rd=[yd*co.compositeIconSizes[0].evaluate(Pa,{},Ko),yd*co.compositeIconSizes[1].evaluate(Pa,{},Ko)],(Rd[0]>Ly||Rd[1]>Ly)&&G(v.layerIds[0]+': Value for "icon-size" is >= '+w3+'. Reduce your "icon-size".')),v.addSymbols(v.icon,np,Rd,Ga,za,Pa,!1,j,As.lineStartIndex,As.lineLength,-1,Ko),oc=v.icon.placedSymbolArray.length-1,p0&&(Ku=p0.length*4,v.addSymbols(v.icon,p0,Rd,Ga,za,Pa,of.vertical,j,As.lineStartIndex,As.lineLength,-1,Ko),Wc=v.icon.placedSymbolArray.length-1)}for(var g0 in Te.horizontal){var xm=Te.horizontal[g0];if(!Hs){qh=We(xm.text);var p1=Ut.layout.get("text-rotate").evaluate(Pa,{},Ko);Hs=new _k(ir,j,Tr,Br,li,xm,gi,Ii,rn,p1)}var Iy=xm.positionedLines.length===1;if(Vc+=Xz(v,j,xm,Ye,Ut,rn,Pa,Dn,As,Te.vertical?of.horizontal:of.horizontalOnly,Iy?Object.keys(Te.horizontal):[g0],Yu,oc,co,Ko),Iy)break}Te.vertical&&(wh+=Xz(v,j,Te.vertical,Ye,Ut,rn,Pa,Dn,As,of.vertical,["vertical"],Yu,Wc,co,Ko));var Dy=Hs?Hs.boxStartIndex:v.collisionBoxArray.length,zy=Hs?Hs.boxEndIndex:v.collisionBoxArray.length,u2=yl?yl.boxStartIndex:v.collisionBoxArray.length,ag=yl?yl.boxEndIndex:v.collisionBoxArray.length,Tk=tl?tl.boxStartIndex:v.collisionBoxArray.length,a7=tl?tl.boxEndIndex:v.collisionBoxArray.length,Sk=Vs?Vs.boxStartIndex:v.collisionBoxArray.length,o7=Vs?Vs.boxEndIndex:v.collisionBoxArray.length,$m=-1,c2=function(S3,pO){return S3&&S3.circleDiameter?Math.max(S3.circleDiameter,pO):pO};$m=c2(Hs,$m),$m=c2(yl,$m),$m=c2(tl,$m),$m=c2(Vs,$m);var Ck=$m>-1?1:0;Ck&&($m*=Yo/Rr),v.glyphOffsetArray.length>=ah.MAX_GLYPHS&&G("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Pa.sortKey!==void 0&&v.addToSortKeyRanges(v.symbolInstances.length,Pa.sortKey),v.symbolInstances.emplaceBack(j.x,j.y,Yu.right>=0?Yu.right:-1,Yu.center>=0?Yu.center:-1,Yu.left>=0?Yu.left:-1,Yu.vertical||-1,oc,Wc,qh,Dy,zy,u2,ag,Tk,a7,Sk,o7,Tr,Vc,wh,Ks,Ku,Ck,0,gi,mh,Wf,$m)}function Yre(v,j,Q,Te){var je=v.compareText;if(!(j in je))je[j]=[];else for(var Ye=je[j],st=Ye.length-1;st>=0;st--)if(Te.dist(Ye[st])0)&&(Ye.value.kind!=="constant"||Ye.value.value.length>0),Tr=Ut.value.kind!=="constant"||!!Ut.value.value||Object.keys(Ut.parameters).length>0,Br=je.get("symbol-sort-key");if(this.features=[],!(!ir&&!Tr)){for(var li=j.iconDependencies,gi=j.glyphDependencies,Ii=j.availableImages,rn=new Zl(this.zoom),Dn=0,ya=v;Dn=0;for(var Vc=0,wh=Yo.sections;Vc=0;Ut--)Ye[Ut]={x:j[Ut].x,y:j[Ut].y,tileUnitDistanceFromAnchor:je},Ut>0&&(je+=j[Ut-1].dist(j[Ut]));for(var ir=0;ir0},ah.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ah.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ah.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ah.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ah.prototype.addIndicesForPlacedSymbol=function(v,j){for(var Q=v.placedSymbolArray.get(j),Te=Q.vertexStartIndex+Q.numGlyphs*4,je=Q.vertexStartIndex;je1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(v),this.sortedAngle=v,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var Q=0,Te=this.symbolInstanceIndexes;Q=0&&ir.indexOf(st)===Ut&&j.addIndicesForPlacedSymbol(j.text,st)}),Ye.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ye.verticalPlacedTextSymbolIndex),Ye.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ye.placedIconSymbolIndex),Ye.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ye.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},fr("SymbolBucket",ah,{omit:["layers","collisionBoxArray","features","compareText"]}),ah.MAX_GLYPHS=65535,ah.addDynamicAttributes=e7;function eie(v,j){return j.replace(/{([^{}]+)}/g,function(Q,Te){return Te in v?String(v[Te]):""})}var tie=new no({"symbol-placement":new Oi($a.layout_symbol["symbol-placement"]),"symbol-spacing":new Oi($a.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Oi($a.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Tn($a.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Oi($a.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Oi($a.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Oi($a.layout_symbol["icon-ignore-placement"]),"icon-optional":new Oi($a.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Oi($a.layout_symbol["icon-rotation-alignment"]),"icon-size":new Tn($a.layout_symbol["icon-size"]),"icon-text-fit":new Oi($a.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Oi($a.layout_symbol["icon-text-fit-padding"]),"icon-image":new Tn($a.layout_symbol["icon-image"]),"icon-rotate":new Tn($a.layout_symbol["icon-rotate"]),"icon-padding":new Oi($a.layout_symbol["icon-padding"]),"icon-keep-upright":new Oi($a.layout_symbol["icon-keep-upright"]),"icon-offset":new Tn($a.layout_symbol["icon-offset"]),"icon-anchor":new Tn($a.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Oi($a.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Oi($a.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Oi($a.layout_symbol["text-rotation-alignment"]),"text-field":new Tn($a.layout_symbol["text-field"]),"text-font":new Tn($a.layout_symbol["text-font"]),"text-size":new Tn($a.layout_symbol["text-size"]),"text-max-width":new Tn($a.layout_symbol["text-max-width"]),"text-line-height":new Oi($a.layout_symbol["text-line-height"]),"text-letter-spacing":new Tn($a.layout_symbol["text-letter-spacing"]),"text-justify":new Tn($a.layout_symbol["text-justify"]),"text-radial-offset":new Tn($a.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Oi($a.layout_symbol["text-variable-anchor"]),"text-anchor":new Tn($a.layout_symbol["text-anchor"]),"text-max-angle":new Oi($a.layout_symbol["text-max-angle"]),"text-writing-mode":new Oi($a.layout_symbol["text-writing-mode"]),"text-rotate":new Tn($a.layout_symbol["text-rotate"]),"text-padding":new Oi($a.layout_symbol["text-padding"]),"text-keep-upright":new Oi($a.layout_symbol["text-keep-upright"]),"text-transform":new Tn($a.layout_symbol["text-transform"]),"text-offset":new Tn($a.layout_symbol["text-offset"]),"text-allow-overlap":new Oi($a.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Oi($a.layout_symbol["text-ignore-placement"]),"text-optional":new Oi($a.layout_symbol["text-optional"])}),rie=new no({"icon-opacity":new Tn($a.paint_symbol["icon-opacity"]),"icon-color":new Tn($a.paint_symbol["icon-color"]),"icon-halo-color":new Tn($a.paint_symbol["icon-halo-color"]),"icon-halo-width":new Tn($a.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Tn($a.paint_symbol["icon-halo-blur"]),"icon-translate":new Oi($a.paint_symbol["icon-translate"]),"icon-translate-anchor":new Oi($a.paint_symbol["icon-translate-anchor"]),"text-opacity":new Tn($a.paint_symbol["text-opacity"]),"text-color":new Tn($a.paint_symbol["text-color"],{runtimeType:pu,getOverride:function(v){return v.textColor},hasOverride:function(v){return!!v.textColor}}),"text-halo-color":new Tn($a.paint_symbol["text-halo-color"]),"text-halo-width":new Tn($a.paint_symbol["text-halo-width"]),"text-halo-blur":new Tn($a.paint_symbol["text-halo-blur"]),"text-translate":new Oi($a.paint_symbol["text-translate"]),"text-translate-anchor":new Oi($a.paint_symbol["text-translate-anchor"])}),t7={paint:rie,layout:tie},o2=function(v){this.type=v.property.overrides?v.property.overrides.runtimeType:Gu,this.defaultValue=v};o2.prototype.evaluate=function(v){if(v.formattedSection){var j=this.defaultValue.property.overrides;if(j&&j.hasOverride(v.formattedSection))return j.getOverride(v.formattedSection)}return v.feature&&v.featureState?this.defaultValue.evaluate(v.feature,v.featureState):this.defaultValue.property.specification.default},o2.prototype.eachChild=function(v){if(!this.defaultValue.isConstant()){var j=this.defaultValue.value;v(j._styleExpression.expression)}},o2.prototype.outputDefined=function(){return!1},o2.prototype.serialize=function(){return null},fr("FormatSectionOverride",o2,{omit:["defaultValue"]});var iie=function(v){function j(Q){v.call(this,Q,t7)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.recalculate=function(Q,Te){if(v.prototype.recalculate.call(this,Q,Te),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var je=this.layout.get("text-writing-mode");if(je){for(var Ye=[],st=0,Ut=je;st",targetMapId:Te,sourceMapId:Ye.mapId})}}},s2.prototype.receive=function(v){var j=v.data,Q=j.id;if(Q&&!(j.targetMapId&&this.mapId!==j.targetMapId))if(j.type===""){delete this.tasks[Q];var Te=this.cancelCallbacks[Q];delete this.cancelCallbacks[Q],Te&&Te()}else ve()||j.mustQueue?(this.tasks[Q]=j,this.taskQueue.push(Q),this.invoker.trigger()):this.processTask(Q,j)},s2.prototype.process=function(){if(this.taskQueue.length){var v=this.taskQueue.shift(),j=this.tasks[v];delete this.tasks[v],this.taskQueue.length&&this.invoker.trigger(),j&&this.processTask(v,j)}},s2.prototype.processTask=function(v,j){var Q=this;if(j.type===""){var Te=this.callbacks[v];delete this.callbacks[v],Te&&(j.error?Te(Bi(j.error)):Te(null,Bi(j.data)))}else{var je=!1,Ye=ge(this.globalScope)?void 0:[],st=j.hasCallback?function(li,gi){je=!0,delete Q.cancelCallbacks[v],Q.target.postMessage({id:v,type:"",sourceMapId:Q.mapId,error:li?ci(li):null,data:ci(gi,Ye)},Ye)}:function(li){je=!0},Ut=null,ir=Bi(j.data);if(this.parent[j.type])Ut=this.parent[j.type](j.sourceMapId,ir,st);else if(this.parent.getWorkerSource){var Tr=j.type.split("."),Br=this.parent.getWorkerSource(j.sourceMapId,Tr[0],ir.source);Ut=Br[Tr[1]](ir,st)}else st(new Error("Could not find function "+j.type));!je&&Ut&&Ut.cancel&&(this.cancelCallbacks[v]=Ut.cancel)}},s2.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function pie(v,j,Q){j=Math.pow(2,Q)-j-1;var Te=iO(v*256,j*256,Q),je=iO((v+1)*256,(j+1)*256,Q);return Te[0]+","+Te[1]+","+je[0]+","+je[1]}function iO(v,j,Q){var Te=2*Math.PI*6378137/256/Math.pow(2,Q),je=v*Te-2*Math.PI*6378137/2,Ye=j*Te-2*Math.PI*6378137/2;return[je,Ye]}var _d=function(v,j){v&&(j?this.setSouthWest(v).setNorthEast(j):v.length===4?this.setSouthWest([v[0],v[1]]).setNorthEast([v[2],v[3]]):this.setSouthWest(v[0]).setNorthEast(v[1]))};_d.prototype.setNorthEast=function(v){return this._ne=v instanceof sf?new sf(v.lng,v.lat):sf.convert(v),this},_d.prototype.setSouthWest=function(v){return this._sw=v instanceof sf?new sf(v.lng,v.lat):sf.convert(v),this},_d.prototype.extend=function(v){var j=this._sw,Q=this._ne,Te,je;if(v instanceof sf)Te=v,je=v;else if(v instanceof _d){if(Te=v._sw,je=v._ne,!Te||!je)return this}else{if(Array.isArray(v))if(v.length===4||v.every(Array.isArray)){var Ye=v;return this.extend(_d.convert(Ye))}else{var st=v;return this.extend(sf.convert(st))}return this}return!j&&!Q?(this._sw=new sf(Te.lng,Te.lat),this._ne=new sf(je.lng,je.lat)):(j.lng=Math.min(Te.lng,j.lng),j.lat=Math.min(Te.lat,j.lat),Q.lng=Math.max(je.lng,Q.lng),Q.lat=Math.max(je.lat,Q.lat)),this},_d.prototype.getCenter=function(){return new sf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},_d.prototype.getSouthWest=function(){return this._sw},_d.prototype.getNorthEast=function(){return this._ne},_d.prototype.getNorthWest=function(){return new sf(this.getWest(),this.getNorth())},_d.prototype.getSouthEast=function(){return new sf(this.getEast(),this.getSouth())},_d.prototype.getWest=function(){return this._sw.lng},_d.prototype.getSouth=function(){return this._sw.lat},_d.prototype.getEast=function(){return this._ne.lng},_d.prototype.getNorth=function(){return this._ne.lat},_d.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},_d.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},_d.prototype.isEmpty=function(){return!(this._sw&&this._ne)},_d.prototype.contains=function(v){var j=sf.convert(v),Q=j.lng,Te=j.lat,je=this._sw.lat<=Te&&Te<=this._ne.lat,Ye=this._sw.lng<=Q&&Q<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ye=this._sw.lng>=Q&&Q>=this._ne.lng),je&&Ye},_d.convert=function(v){return!v||v instanceof _d?v:new _d(v)};var nO=63710088e-1,sf=function(v,j){if(isNaN(v)||isNaN(j))throw new Error("Invalid LngLat object: ("+v+", "+j+")");if(this.lng=+v,this.lat=+j,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};sf.prototype.wrap=function(){return new sf(k(this.lng,-180,180),this.lat)},sf.prototype.toArray=function(){return[this.lng,this.lat]},sf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},sf.prototype.distanceTo=function(v){var j=Math.PI/180,Q=this.lat*j,Te=v.lat*j,je=Math.sin(Q)*Math.sin(Te)+Math.cos(Q)*Math.cos(Te)*Math.cos((v.lng-this.lng)*j),Ye=nO*Math.acos(Math.min(je,1));return Ye},sf.prototype.toBounds=function(v){v===void 0&&(v=0);var j=40075017,Q=360*v/j,Te=Q/Math.cos(Math.PI/180*this.lat);return new _d(new sf(this.lng-Te,this.lat-Q),new sf(this.lng+Te,this.lat+Q))},sf.convert=function(v){if(v instanceof sf)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new sf(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&typeof v=="object"&&v!==null)return new sf(Number("lng"in v?v.lng:v.lon),Number(v.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var aO=2*Math.PI*nO;function oO(v){return aO*Math.cos(v*Math.PI/180)}function sO(v){return(180+v)/360}function lO(v){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v*Math.PI/360)))/360}function uO(v,j){return v/oO(j)}function mie(v){return v*360-180}function i7(v){var j=180-v*360;return 360/Math.PI*Math.atan(Math.exp(j*Math.PI/180))-90}function gie(v,j){return v*oO(i7(j))}function vie(v){return 1/Math.cos(v*Math.PI/180)}var ex=function(v,j,Q){Q===void 0&&(Q=0),this.x=+v,this.y=+j,this.z=+Q};ex.fromLngLat=function(v,j){j===void 0&&(j=0);var Q=sf.convert(v);return new ex(sO(Q.lng),lO(Q.lat),uO(j,Q.lat))},ex.prototype.toLngLat=function(){return new sf(mie(this.x),i7(this.y))},ex.prototype.toAltitude=function(){return gie(this.z,this.y)},ex.prototype.meterInMercatorCoordinateUnits=function(){return 1/aO*vie(i7(this.y))};var tx=function(v,j,Q){this.z=v,this.x=j,this.y=Q,this.key=T3(0,v,v,j,Q)};tx.prototype.equals=function(v){return this.z===v.z&&this.x===v.x&&this.y===v.y},tx.prototype.url=function(v,j){var Q=pie(this.x,this.y,this.z),Te=yie(this.z,this.x,this.y);return v[(this.x+this.y)%v.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(j==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Te).replace("{bbox-epsg-3857}",Q)},tx.prototype.getTilePoint=function(v){var j=Math.pow(2,this.z);return new u((v.x*j-this.x)*Jo,(v.y*j-this.y)*Jo)},tx.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var cO=function(v,j){this.wrap=v,this.canonical=j,this.key=T3(v,j.z,j.z,j.x,j.y)},xd=function(v,j,Q,Te,je){this.overscaledZ=v,this.wrap=j,this.canonical=new tx(Q,+Te,+je),this.key=T3(j,v,Q,Te,je)};xd.prototype.equals=function(v){return this.overscaledZ===v.overscaledZ&&this.wrap===v.wrap&&this.canonical.equals(v.canonical)},xd.prototype.scaledTo=function(v){var j=this.canonical.z-v;return v>this.canonical.z?new xd(v,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xd(v,this.wrap,v,this.canonical.x>>j,this.canonical.y>>j)},xd.prototype.calculateScaledKey=function(v,j){var Q=this.canonical.z-v;return v>this.canonical.z?T3(this.wrap*+j,v,this.canonical.z,this.canonical.x,this.canonical.y):T3(this.wrap*+j,v,v,this.canonical.x>>Q,this.canonical.y>>Q)},xd.prototype.isChildOf=function(v){if(v.wrap!==this.wrap)return!1;var j=this.canonical.z-v.canonical.z;return v.overscaledZ===0||v.overscaledZ>j&&v.canonical.y===this.canonical.y>>j},xd.prototype.children=function(v){if(this.overscaledZ>=v)return[new xd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var j=this.canonical.z+1,Q=this.canonical.x*2,Te=this.canonical.y*2;return[new xd(j,this.wrap,j,Q,Te),new xd(j,this.wrap,j,Q+1,Te),new xd(j,this.wrap,j,Q,Te+1),new xd(j,this.wrap,j,Q+1,Te+1)]},xd.prototype.isLessThan=function(v){return this.wrapv.wrap?!1:this.overscaledZv.overscaledZ?!1:this.canonical.xv.canonical.x?!1:this.canonical.y0;Ye--)je=1<=this.dim+1||j<-1||j>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(j+1)*this.stride+(v+1)},f1.prototype._unpackMapbox=function(v,j,Q){return(v*256*256+j*256+Q)/10-1e4},f1.prototype._unpackTerrarium=function(v,j,Q){return v*256+j+Q/256-32768},f1.prototype.getPixels=function(){return new dp({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},f1.prototype.backfillBorder=function(v,j,Q){if(this.dim!==v.dim)throw new Error("dem dimension mismatch");var Te=j*this.dim,je=j*this.dim+this.dim,Ye=Q*this.dim,st=Q*this.dim+this.dim;switch(j){case-1:Te=je-1;break;case 1:je=Te+1;break}switch(Q){case-1:Ye=st-1;break;case 1:st=Ye+1;break}for(var Ut=-j*this.dim,ir=-Q*this.dim,Tr=Ye;Tr=0&&Br[3]>=0&&Ut.insert(st,Br[0],Br[1],Br[2],Br[3])}},d1.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new c1.VectorTile(new Gi(this.rawTileData)).layers,this.sourceLayerCoder=new wk(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},d1.prototype.query=function(v,j,Q,Te){var je=this;this.loadVTLayers();for(var Ye=v.params||{},st=Jo/v.tileSize/v.scale,Ut=lt(Ye.filter),ir=v.queryGeometry,Tr=v.queryPadding*st,Br=fO(ir),li=this.grid.query(Br.minX-Tr,Br.minY-Tr,Br.maxX+Tr,Br.maxY+Tr),gi=fO(v.cameraQueryGeometry),Ii=this.grid3D.query(gi.minX-Tr,gi.minY-Tr,gi.maxX+Tr,gi.maxY+Tr,function(co,Lo,Ko,Yo){return tg(v.cameraQueryGeometry,co-Tr,Lo-Tr,Ko+Tr,Yo+Tr)}),rn=0,Dn=Ii;rnTe)je=!1;else if(!j)je=!0;else if(this.expirationTime=Gr.maxzoom)&&Gr.visibility!=="none"){m(oi,this.zoom,_r);var si=En[Gr.id]=Gr.createBucket({index:Hi.bucketLayerIDs.length,layers:oi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Mn,sourceID:this.source});si.populate(Ha,Rn,this.tileID.canonical),Hi.bucketLayerIDs.push(oi.map(function(Zi){return Zi.id}))}}}}var Pi,yi,zt,xr,Jr=i.mapObject(Rn.glyphDependencies,function(Zi){return Object.keys(Zi).map(Number)});Object.keys(Jr).length?Cr.send("getGlyphs",{uid:this.uid,stacks:Jr},function(Zi,Wi){Pi||(Pi=Zi,yi=Wi,_n.call(qi))}):yi={};var Ri=Object.keys(Rn.iconDependencies);Ri.length?Cr.send("getImages",{icons:Ri,source:this.source,tileID:this.tileID,type:"icons"},function(Zi,Wi){Pi||(Pi=Zi,zt=Wi,_n.call(qi))}):zt={};var tn=Object.keys(Rn.patternDependencies);tn.length?Cr.send("getImages",{icons:tn,source:this.source,tileID:this.tileID,type:"patterns"},function(Zi,Wi){Pi||(Pi=Zi,xr=Wi,_n.call(qi))}):xr={},_n.call(this);function _n(){if(Pi)return fi(Pi);if(yi&&zt&&xr){var Zi=new s(yi),Wi=new i.ImageAtlas(zt,xr);for(var dn in En){var Ua=En[dn];Ua instanceof i.SymbolBucket?(m(Ua.layers,this.zoom,_r),i.performSymbolLayout(Ua,yi,Zi.positions,zt,Wi.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ua.hasPattern&&(Ua instanceof i.LineBucket||Ua instanceof i.FillBucket||Ua instanceof i.FillExtrusionBucket)&&(m(Ua.layers,this.zoom,_r),Ua.addFeatures(Rn,this.tileID.canonical,Wi.patternPositions))}this.status="done",fi(null,{buckets:i.values(En).filter(function(ea){return!ea.isEmpty()}),featureIndex:Hi,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Zi.image,imageAtlas:Wi,glyphMap:this.returnDependencies?yi:null,iconMap:this.returnDependencies?zt:null,glyphPositions:this.returnDependencies?Zi.positions:null})}}};function m(Zt,sr,_r){for(var Cr=new i.EvaluationParameters(sr),fi=0,qi=Zt;fi=0!=!!sr&&Zt.reverse()}var E=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,I=function(Zt){this._feature=Zt,this.extent=i.EXTENT,this.type=Zt.type,this.properties=Zt.tags,"id"in Zt&&!isNaN(Zt.id)&&(this.id=parseInt(Zt.id,10))};I.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Zt=[],sr=0,_r=this._feature.geometry;sr<_r.length;sr+=1){var Cr=_r[sr];Zt.push([new i.Point$1(Cr[0],Cr[1])])}return Zt}else{for(var fi=[],qi=0,Ui=this._feature.geometry;qi"u"&&(Cr.push(Hi),En=Cr.length-1,qi[Hi]=En),sr.writeVarint(En);var Rn=_r.properties[Hi],Gn=typeof Rn;Gn!=="string"&&Gn!=="boolean"&&Gn!=="number"&&(Rn=JSON.stringify(Rn));var Xn=Gn+":"+Rn,sa=Ui[Xn];typeof sa>"u"&&(fi.push(Rn),sa=fi.length-1,Ui[Xn]=sa),sr.writeVarint(sa)}}function he(Zt,sr){return(sr<<3)+(Zt&7)}function xe(Zt){return Zt<<1^Zt>>31}function ve(Zt,sr){for(var _r=Zt.loadGeometry(),Cr=Zt.type,fi=0,qi=0,Ui=_r.length,Hi=0;Hi>1;ge(Zt,sr,Ui,Cr,fi,qi%2),re(Zt,sr,_r,Cr,Ui-1,qi+1),re(Zt,sr,_r,Ui+1,fi,qi+1)}}function ge(Zt,sr,_r,Cr,fi,qi){for(;fi>Cr;){if(fi-Cr>600){var Ui=fi-Cr+1,Hi=_r-Cr+1,En=Math.log(Ui),Rn=.5*Math.exp(2*En/3),Gn=.5*Math.sqrt(En*Rn*(Ui-Rn)/Ui)*(Hi-Ui/2<0?-1:1),Xn=Math.max(Cr,Math.floor(_r-Hi*Rn/Ui+Gn)),sa=Math.min(fi,Math.floor(_r+(Ui-Hi)*Rn/Ui+Gn));ge(Zt,sr,_r,Xn,sa,qi)}var Mn=sr[2*_r+qi],Ha=Cr,ro=fi;for(ne(Zt,sr,Cr,_r),sr[2*fi+qi]>Mn&&ne(Zt,sr,Cr,fi);HaMn;)ro--}sr[2*Cr+qi]===Mn?ne(Zt,sr,Cr,ro):(ro++,ne(Zt,sr,ro,fi)),ro<=_r&&(Cr=ro+1),_r<=ro&&(fi=ro-1)}}function ne(Zt,sr,_r,Cr){se(Zt,_r,Cr),se(sr,2*_r,2*Cr),se(sr,2*_r+1,2*Cr+1)}function se(Zt,sr,_r){var Cr=Zt[sr];Zt[sr]=Zt[_r],Zt[_r]=Cr}function _e(Zt,sr,_r,Cr,fi,qi,Ui){for(var Hi=[0,Zt.length-1,0],En=[],Rn,Gn;Hi.length;){var Xn=Hi.pop(),sa=Hi.pop(),Mn=Hi.pop();if(sa-Mn<=Ui){for(var Ha=Mn;Ha<=sa;Ha++)Rn=sr[2*Ha],Gn=sr[2*Ha+1],Rn>=_r&&Rn<=fi&&Gn>=Cr&&Gn<=qi&&En.push(Zt[Ha]);continue}var ro=Math.floor((Mn+sa)/2);Rn=sr[2*ro],Gn=sr[2*ro+1],Rn>=_r&&Rn<=fi&&Gn>=Cr&&Gn<=qi&&En.push(Zt[ro]);var Ft=(Xn+1)%2;(Xn===0?_r<=Rn:Cr<=Gn)&&(Hi.push(Mn),Hi.push(ro-1),Hi.push(Ft)),(Xn===0?fi>=Rn:qi>=Gn)&&(Hi.push(ro+1),Hi.push(sa),Hi.push(Ft))}return En}function oe(Zt,sr,_r,Cr,fi,qi){for(var Ui=[0,Zt.length-1,0],Hi=[],En=fi*fi;Ui.length;){var Rn=Ui.pop(),Gn=Ui.pop(),Xn=Ui.pop();if(Gn-Xn<=qi){for(var sa=Xn;sa<=Gn;sa++)J(sr[2*sa],sr[2*sa+1],_r,Cr)<=En&&Hi.push(Zt[sa]);continue}var Mn=Math.floor((Xn+Gn)/2),Ha=sr[2*Mn],ro=sr[2*Mn+1];J(Ha,ro,_r,Cr)<=En&&Hi.push(Zt[Mn]);var Ft=(Rn+1)%2;(Rn===0?_r-fi<=Ha:Cr-fi<=ro)&&(Ui.push(Xn),Ui.push(Mn-1),Ui.push(Ft)),(Rn===0?_r+fi>=Ha:Cr+fi>=ro)&&(Ui.push(Mn+1),Ui.push(Gn),Ui.push(Ft))}return Hi}function J(Zt,sr,_r,Cr){var fi=Zt-_r,qi=sr-Cr;return fi*fi+qi*qi}var me=function(Zt){return Zt[0]},fe=function(Zt){return Zt[1]},Ce=function(Zt,sr,_r,Cr,fi){sr===void 0&&(sr=me),_r===void 0&&(_r=fe),Cr===void 0&&(Cr=64),fi===void 0&&(fi=Float64Array),this.nodeSize=Cr,this.points=Zt;for(var qi=Zt.length<65536?Uint16Array:Uint32Array,Ui=this.ids=new qi(Zt.length),Hi=this.coords=new fi(Zt.length*2),En=0;En=Cr;Rn--){var Gn=+Date.now();Hi=this._cluster(Hi,Rn),this.trees[Rn]=new Ce(Hi,Ee,nt,qi,Float32Array),_r&&console.log("z%d: %d clusters in %dms",Rn,Hi.length,+Date.now()-Gn)}return _r&&console.timeEnd("total time"),this},Oe.prototype.getClusters=function(Zt,sr){var _r=((Zt[0]+180)%360+360)%360-180,Cr=Math.max(-90,Math.min(90,Zt[1])),fi=Zt[2]===180?180:((Zt[2]+180)%360+360)%360-180,qi=Math.max(-90,Math.min(90,Zt[3]));if(Zt[2]-Zt[0]>=360)_r=-180,fi=180;else if(_r>fi){var Ui=this.getClusters([_r,Cr,180,qi],sr),Hi=this.getClusters([-180,Cr,fi,qi],sr);return Ui.concat(Hi)}for(var En=this.trees[this._limitZoom(sr)],Rn=En.range(pt(_r),gt(qi),pt(fi),gt(Cr)),Gn=[],Xn=0,sa=Rn;Xnsr&&(Ha+=qr.numPoints||1)}if(Ha>=Hi){for(var ni=Gn.x*Mn,oi=Gn.y*Mn,Gr=Ui&&Mn>1?this._map(Gn,!0):null,si=(Rn<<5)+(sr+1)+this.points.length,Pi=0,yi=sa;Pi1)for(var Ri=0,tn=sa;Ri>5},Oe.prototype._getOriginZoom=function(Zt){return(Zt-this.points.length)%32},Oe.prototype._map=function(Zt,sr){if(Zt.numPoints)return sr?ze({},Zt.properties):Zt.properties;var _r=this.points[Zt.index].properties,Cr=this.options.map(_r);return sr&&Cr===_r?ze({},Cr):Cr};function Ze(Zt,sr,_r,Cr,fi){return{x:Zt,y:sr,zoom:1/0,id:_r,parentId:-1,numPoints:Cr,properties:fi}}function Ge(Zt,sr){var _r=Zt.geometry.coordinates,Cr=_r[0],fi=_r[1];return{x:pt(Cr),y:gt(fi),zoom:1/0,index:sr,parentId:-1}}function rt(Zt){return{type:"Feature",id:Zt.id,properties:_t(Zt),geometry:{type:"Point",coordinates:[ct(Zt.x),Ae(Zt.y)]}}}function _t(Zt){var sr=Zt.numPoints,_r=sr>=1e4?Math.round(sr/1e3)+"k":sr>=1e3?Math.round(sr/100)/10+"k":sr;return ze(ze({},Zt.properties),{cluster:!0,cluster_id:Zt.id,point_count:sr,point_count_abbreviated:_r})}function pt(Zt){return Zt/360+.5}function gt(Zt){var sr=Math.sin(Zt*Math.PI/180),_r=.5-.25*Math.log((1+sr)/(1-sr))/Math.PI;return _r<0?0:_r>1?1:_r}function ct(Zt){return(Zt-.5)*360}function Ae(Zt){var sr=(180-Zt*360)*Math.PI/180;return 360*Math.atan(Math.exp(sr))/Math.PI-90}function ze(Zt,sr){for(var _r in sr)Zt[_r]=sr[_r];return Zt}function Ee(Zt){return Zt.x}function nt(Zt){return Zt.y}function xt(Zt,sr,_r,Cr){for(var fi=Cr,qi=_r-sr>>1,Ui=_r-sr,Hi,En=Zt[sr],Rn=Zt[sr+1],Gn=Zt[_r],Xn=Zt[_r+1],sa=sr+3;sa<_r;sa+=3){var Mn=ut(Zt[sa],Zt[sa+1],En,Rn,Gn,Xn);if(Mn>fi)Hi=sa,fi=Mn;else if(Mn===fi){var Ha=Math.abs(sa-qi);HaCr&&(Hi-sr>3&&xt(Zt,sr,Hi,Cr),Zt[Hi+2]=fi,_r-Hi>3&&xt(Zt,Hi,_r,Cr))}function ut(Zt,sr,_r,Cr,fi,qi){var Ui=fi-_r,Hi=qi-Cr;if(Ui!==0||Hi!==0){var En=((Zt-_r)*Ui+(sr-Cr)*Hi)/(Ui*Ui+Hi*Hi);En>1?(_r=fi,Cr=qi):En>0&&(_r+=Ui*En,Cr+=Hi*En)}return Ui=Zt-_r,Hi=sr-Cr,Ui*Ui+Hi*Hi}function Et(Zt,sr,_r,Cr){var fi={id:typeof Zt>"u"?null:Zt,type:sr,geometry:_r,tags:Cr,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Gt(fi),fi}function Gt(Zt){var sr=Zt.geometry,_r=Zt.type;if(_r==="Point"||_r==="MultiPoint"||_r==="LineString")Jt(Zt,sr);else if(_r==="Polygon"||_r==="MultiLineString")for(var Cr=0;Cr0&&(Cr?Ui+=(fi*Rn-En*qi)/2:Ui+=Math.sqrt(Math.pow(En-fi,2)+Math.pow(Rn-qi,2))),fi=En,qi=Rn}var Gn=sr.length-3;sr[2]=1,xt(sr,0,Gn,_r),sr[Gn+2]=1,sr.size=Math.abs(Ui),sr.start=0,sr.end=sr.size}function Mr(Zt,sr,_r,Cr){for(var fi=0;fi1?1:_r}function Ot(Zt,sr,_r,Cr,fi,qi,Ui,Hi){if(_r/=sr,Cr/=sr,qi>=_r&&Ui=Cr)return null;for(var En=[],Rn=0;Rn=_r&&Ha=Cr)continue;var ro=[];if(sa==="Point"||sa==="MultiPoint")Je(Xn,ro,_r,Cr,fi);else if(sa==="LineString")ot(Xn,ro,_r,Cr,fi,!1,Hi.lineMetrics);else if(sa==="MultiLineString")ye(Xn,ro,_r,Cr,fi,!1);else if(sa==="Polygon")ye(Xn,ro,_r,Cr,fi,!0);else if(sa==="MultiPolygon")for(var Ft=0;Ft=_r&&Ui<=Cr&&(sr.push(Zt[qi]),sr.push(Zt[qi+1]),sr.push(Zt[qi+2]))}}function ot(Zt,sr,_r,Cr,fi,qi,Ui){for(var Hi=De(Zt),En=fi===0?He:at,Rn=Zt.start,Gn,Xn,sa=0;sa_r&&(Xn=En(Hi,Mn,Ha,Ft,Rt,_r),Ui&&(Hi.start=Rn+Gn*Xn)):qr>Cr?ni=_r&&(Xn=En(Hi,Mn,Ha,Ft,Rt,_r),oi=!0),ni>Cr&&qr<=Cr&&(Xn=En(Hi,Mn,Ha,Ft,Rt,Cr),oi=!0),!qi&&oi&&(Ui&&(Hi.end=Rn+Gn*Xn),sr.push(Hi),Hi=De(Zt)),Ui&&(Rn+=Gn)}var Gr=Zt.length-3;Mn=Zt[Gr],Ha=Zt[Gr+1],ro=Zt[Gr+2],qr=fi===0?Mn:Ha,qr>=_r&&qr<=Cr&&Pe(Hi,Mn,Ha,ro),Gr=Hi.length-3,qi&&Gr>=3&&(Hi[Gr]!==Hi[0]||Hi[Gr+1]!==Hi[1])&&Pe(Hi,Hi[0],Hi[1],Hi[2]),Hi.length&&sr.push(Hi)}function De(Zt){var sr=[];return sr.size=Zt.size,sr.start=Zt.start,sr.end=Zt.end,sr}function ye(Zt,sr,_r,Cr,fi,qi){for(var Ui=0;UiUi.maxX&&(Ui.maxX=Gn),Xn>Ui.maxY&&(Ui.maxY=Xn)}return Ui}function Dr(Zt,sr,_r,Cr){var fi=sr.geometry,qi=sr.type,Ui=[];if(qi==="Point"||qi==="MultiPoint")for(var Hi=0;Hi0&&sr.size<(fi?Ui:Cr)){_r.numPoints+=sr.length/3;return}for(var Hi=[],En=0;EnUi)&&(_r.numSimplified++,Hi.push(sr[En]),Hi.push(sr[En+1])),_r.numPoints++;fi&&hi(Hi,qi),Zt.push(Hi)}function hi(Zt,sr){for(var _r=0,Cr=0,fi=Zt.length,qi=fi-2;Cr0===sr)for(Cr=0,fi=Zt.length;Cr24)throw new Error("maxZoom should be in the 0-24 range");if(sr.promoteId&&sr.generateId)throw new Error("promoteId and generateId cannot be used together.");var Cr=gr(Zt,sr);this.tiles={},this.tileCoords=[],_r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",sr.indexMaxZoom,sr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Cr=ht(Cr,sr),Cr.length&&this.splitTile(Cr,0,0,0),_r&&(Cr.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}cn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},cn.prototype.splitTile=function(Zt,sr,_r,Cr,fi,qi,Ui){for(var Hi=[Zt,sr,_r,Cr],En=this.options,Rn=En.debug;Hi.length;){Cr=Hi.pop(),_r=Hi.pop(),sr=Hi.pop(),Zt=Hi.pop();var Gn=1<1&&console.time("creation"),sa=this.tiles[Xn]=zr(Zt,sr,_r,Cr,En),this.tileCoords.push({z:sr,x:_r,y:Cr}),Rn)){Rn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",sr,_r,Cr,sa.numFeatures,sa.numPoints,sa.numSimplified),console.timeEnd("creation"));var Mn="z"+sr;this.stats[Mn]=(this.stats[Mn]||0)+1,this.total++}if(sa.source=Zt,fi){if(sr===En.maxZoom||sr===fi)continue;var Ha=1<1&&console.time("clipping");var ro=.5*En.buffer/En.extent,Ft=.5-ro,Rt=.5+ro,qr=1+ro,ni,oi,Gr,si,Pi,yi;ni=oi=Gr=si=null,Pi=Ot(Zt,Gn,_r-ro,_r+Rt,0,sa.minX,sa.maxX,En),yi=Ot(Zt,Gn,_r+Ft,_r+qr,0,sa.minX,sa.maxX,En),Zt=null,Pi&&(ni=Ot(Pi,Gn,Cr-ro,Cr+Rt,1,sa.minY,sa.maxY,En),oi=Ot(Pi,Gn,Cr+Ft,Cr+qr,1,sa.minY,sa.maxY,En),Pi=null),yi&&(Gr=Ot(yi,Gn,Cr-ro,Cr+Rt,1,sa.minY,sa.maxY,En),si=Ot(yi,Gn,Cr+Ft,Cr+qr,1,sa.minY,sa.maxY,En),yi=null),Rn>1&&console.timeEnd("clipping"),Hi.push(ni||[],sr+1,_r*2,Cr*2),Hi.push(oi||[],sr+1,_r*2,Cr*2+1),Hi.push(Gr||[],sr+1,_r*2+1,Cr*2),Hi.push(si||[],sr+1,_r*2+1,Cr*2+1)}}},cn.prototype.getTile=function(Zt,sr,_r){var Cr=this.options,fi=Cr.extent,qi=Cr.debug;if(Zt<0||Zt>24)return null;var Ui=1<1&&console.log("drilling down to z%d-%d-%d",Zt,sr,_r);for(var En=Zt,Rn=sr,Gn=_r,Xn;!Xn&&En>0;)En--,Rn=Math.floor(Rn/2),Gn=Math.floor(Gn/2),Xn=this.tiles[yn(En,Rn,Gn)];return!Xn||!Xn.source?null:(qi>1&&console.log("found parent tile z%d-%d-%d",En,Rn,Gn),qi>1&&console.time("drilling down"),this.splitTile(Xn.source,En,Rn,Gn,Zt,sr,_r),qi>1&&console.timeEnd("drilling down"),this.tiles[Hi]?Kt(this.tiles[Hi],fi):null)};function yn(Zt,sr,_r){return((1<=0?0:K.button},a.remove=function(K){K.parentNode&&K.parentNode.removeChild(K)};function _(K,le,ie){var we,We,mt,wt=i.browser.devicePixelRatio>1?"@2x":"",Qe=i.getJSON(le.transformRequest(le.normalizeSpriteURL(K,wt,".json"),i.ResourceType.SpriteJSON),function(lr,Qt){Qe=null,mt||(mt=lr,we=Qt,It())}),dt=i.getImage(le.transformRequest(le.normalizeSpriteURL(K,wt,".png"),i.ResourceType.SpriteImage),function(lr,Qt){dt=null,mt||(mt=lr,We=Qt,It())});function It(){if(mt)ie(mt);else if(we&&We){var lr=i.browser.getImageData(We),Qt={};for(var ar in we){var pr=we[ar],yr=pr.width,qt=pr.height,tr=pr.x,Xt=pr.y,Fr=pr.sdf,xi=pr.pixelRatio,Li=pr.stretchX,Pn=pr.stretchY,An=pr.content,mn=new i.RGBAImage({width:yr,height:qt});i.RGBAImage.copy(lr,mn,{x:tr,y:Xt},{x:0,y:0},{width:yr,height:qt}),Qt[ar]={data:mn,pixelRatio:xi,sdf:Fr,stretchX:Li,stretchY:Pn,content:An}}ie(null,Qt)}}return{cancel:function(){Qe&&(Qe.cancel(),Qe=null),dt&&(dt.cancel(),dt=null)}}}function A(K){var le=K.userImage;if(le&&le.render){var ie=le.render();if(ie)return K.data.replace(new Uint8Array(le.data.buffer)),!0}return!1}var f=1,k=function(K){function le(){K.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.isLoaded=function(){return this.loaded},le.prototype.setLoaded=function(ie){if(this.loaded!==ie&&(this.loaded=ie,ie)){for(var we=0,We=this.requestors;we=0?1.2:1))}M.prototype.draw=function(K){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(K,this.buffer,this.middle);for(var le=this.ctx.getImageData(0,0,this.size,this.size),ie=new Uint8ClampedArray(this.size*this.size),we=0;we65535){It(new Error("glyphs > 65535 not supported"));return}if(ar.ranges[yr]){It(null,{stack:lr,id:Qt,glyph:pr});return}var qt=ar.requests[yr];qt||(qt=ar.requests[yr]=[],C.loadGlyphRange(lr,yr,ie.url,ie.requestManager,function(tr,Xt){if(Xt){for(var Fr in Xt)ie._doesCharSupportLocalGlyph(+Fr)||(ar.glyphs[+Fr]=Xt[+Fr]);ar.ranges[yr]=!0}for(var xi=0,Li=qt;xi1&&(dt=K[++Qe]);var lr=Math.abs(It-dt.left),Qt=Math.abs(It-dt.right),ar=Math.min(lr,Qt),pr=void 0,yr=We/ie*(we+1);if(dt.isDash){var qt=we-Math.abs(yr);pr=Math.sqrt(ar*ar+qt*qt)}else pr=we-Math.sqrt(ar*ar+yr*yr);this.data[wt+It]=Math.max(0,Math.min(255,pr+128))}},V.prototype.addRegularDash=function(K){for(var le=K.length-1;le>=0;--le){var ie=K[le],we=K[le+1];ie.zeroLength?K.splice(le,1):we&&we.isDash===ie.isDash&&(we.left=ie.left,K.splice(le,1))}var We=K[0],mt=K[K.length-1];We.isDash===mt.isDash&&(We.left=mt.left-this.width,mt.right=We.right+this.width);for(var wt=this.width*this.nextRow,Qe=0,dt=K[Qe],It=0;It1&&(dt=K[++Qe]);var lr=Math.abs(It-dt.left),Qt=Math.abs(It-dt.right),ar=Math.min(lr,Qt),pr=dt.isDash?ar:-ar;this.data[wt+It]=Math.max(0,Math.min(255,pr+128))}},V.prototype.addDash=function(K,le){var ie=le?7:0,we=2*ie+1;if(this.nextRow+we>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var We=0,mt=0;mt=ie.minX&&K.x=ie.minY&&K.y0&&(It[new i.OverscaledTileID(ie.overscaledZ,wt,we.z,mt,we.y-1).key]={backfilled:!1},It[new i.OverscaledTileID(ie.overscaledZ,ie.wrap,we.z,we.x,we.y-1).key]={backfilled:!1},It[new i.OverscaledTileID(ie.overscaledZ,dt,we.z,Qe,we.y-1).key]={backfilled:!1}),we.y+10&&(We.resourceTiming=ie._resourceTiming,ie._resourceTiming=[]),ie.fire(new i.Event("data",We))})},le.prototype.onAdd=function(ie){this.map=ie,this.load()},le.prototype.setData=function(ie){var we=this;return this._data=ie,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(We){if(We){we.fire(new i.ErrorEvent(We));return}var mt={dataType:"source",sourceDataType:"content"};we._collectResourceTiming&&we._resourceTiming&&we._resourceTiming.length>0&&(mt.resourceTiming=we._resourceTiming,we._resourceTiming=[]),we.fire(new i.Event("data",mt))}),this},le.prototype.getClusterExpansionZoom=function(ie,we){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:ie,source:this.id},we),this},le.prototype.getClusterChildren=function(ie,we){return this.actor.send("geojson.getClusterChildren",{clusterId:ie,source:this.id},we),this},le.prototype.getClusterLeaves=function(ie,we,We,mt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:ie,limit:we,offset:We},mt),this},le.prototype._updateWorkerData=function(ie){var we=this;this._loaded=!1;var We=i.extend({},this.workerOptions),mt=this._data;typeof mt=="string"?(We.request=this.map._requestManager.transformRequest(i.browser.resolveURL(mt),i.ResourceType.Source),We.request.collectResourceTiming=this._collectResourceTiming):We.data=JSON.stringify(mt),this.actor.send(this.type+".loadData",We,function(wt,Qe){we._removed||Qe&&Qe.abandoned||(we._loaded=!0,Qe&&Qe.resourceTiming&&Qe.resourceTiming[we.id]&&(we._resourceTiming=Qe.resourceTiming[we.id].slice(0)),we.actor.send(we.type+".coalesce",{source:We.source},null),ie(wt))})},le.prototype.loaded=function(){return this._loaded},le.prototype.loadTile=function(ie,we){var We=this,mt=ie.actor?"reloadTile":"loadTile";ie.actor=this.actor;var wt={type:this.type,uid:ie.uid,tileID:ie.tileID,zoom:ie.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};ie.request=this.actor.send(mt,wt,function(Qe,dt){return delete ie.request,ie.unloadVectorData(),ie.aborted?we(null):Qe?we(Qe):(ie.loadVectorData(dt,We.map.painter,mt==="reloadTile"),we(null))})},le.prototype.abortTile=function(ie){ie.request&&(ie.request.cancel(),delete ie.request),ie.aborted=!0},le.prototype.unloadTile=function(ie){ie.unloadVectorData(),this.actor.send("removeTile",{uid:ie.uid,type:this.type,source:this.id})},le.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},le.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},le.prototype.hasTransition=function(){return!1},le}(i.Evented),xe=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ve=function(K){function le(ie,we,We,mt){K.call(this),this.id=ie,this.dispatcher=We,this.coordinates=we.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(mt),this.options=we}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.load=function(ie,we){var We=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(mt,wt){We._loaded=!0,mt?We.fire(new i.ErrorEvent(mt)):wt&&(We.image=wt,ie&&(We.coordinates=ie),we&&we(),We._finishLoading())})},le.prototype.loaded=function(){return this._loaded},le.prototype.updateImage=function(ie){var we=this;return!this.image||!ie.url?this:(this.options.url=ie.url,this.load(ie.coordinates,function(){we.texture=null}),this)},le.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},le.prototype.onAdd=function(ie){this.map=ie,this.load()},le.prototype.setCoordinates=function(ie){var we=this;this.coordinates=ie;var We=ie.map(i.MercatorCoordinate.fromLngLat);this.tileID=ce(We),this.minzoom=this.maxzoom=this.tileID.z;var mt=We.map(function(wt){return we.tileID.getTilePoint(wt)._round()});return this._boundsArray=new i.StructArrayLayout4i8,this._boundsArray.emplaceBack(mt[0].x,mt[0].y,0,0),this._boundsArray.emplaceBack(mt[1].x,mt[1].y,i.EXTENT,0),this._boundsArray.emplaceBack(mt[3].x,mt[3].y,0,i.EXTENT),this._boundsArray.emplaceBack(mt[2].x,mt[2].y,i.EXTENT,i.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})),this},le.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var ie=this.map.painter.context,we=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new i.Texture(ie,this.image,we.RGBA),this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE));for(var We in this.tiles){var mt=this.tiles[We];mt.state!=="loaded"&&(mt.state="loaded",mt.texture=this.texture)}}},le.prototype.loadTile=function(ie,we){this.tileID&&this.tileID.equals(ie.tileID.canonical)?(this.tiles[String(ie.tileID.wrap)]=ie,ie.buckets={},we(null)):(ie.state="errored",we(null))},le.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},le.prototype.hasTransition=function(){return!1},le}(i.Evented);function ce(K){for(var le=1/0,ie=1/0,we=-1/0,We=-1/0,mt=0,wt=K;mtwe.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+we.start(0)+" and "+we.end(0)+"-second mark."))):this.video.currentTime=ie}},le.prototype.getVideo=function(){return this.video},le.prototype.onAdd=function(ie){this.map||(this.map=ie,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},le.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var ie=this.map.painter.context,we=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE),we.texSubImage2D(we.TEXTURE_2D,0,0,0,we.RGBA,we.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(ie,this.video,we.RGBA),this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE));for(var We in this.tiles){var mt=this.tiles[We];mt.state!=="loaded"&&(mt.state="loaded",mt.texture=this.texture)}}},le.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},le.prototype.hasTransition=function(){return this.video&&!this.video.paused},le}(ve),ge=function(K){function le(ie,we,We,mt){K.call(this,ie,we,We,mt),we.coordinates?(!Array.isArray(we.coordinates)||we.coordinates.length!==4||we.coordinates.some(function(wt){return!Array.isArray(wt)||wt.length!==2||wt.some(function(Qe){return typeof Qe!="number"})}))&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'missing required property "coordinates"'))),we.animate&&typeof we.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'optional "animate" property must be a boolean value'))),we.canvas?typeof we.canvas!="string"&&!(we.canvas instanceof i.window.HTMLCanvasElement)&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'missing required property "canvas"'))),this.options=we,this.animate=we.animate!==void 0?we.animate:!0}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new i.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},le.prototype.getCanvas=function(){return this.canvas},le.prototype.onAdd=function(ie){this.map=ie,this.load(),this.canvas&&this.animate&&this.play()},le.prototype.onRemove=function(){this.pause()},le.prototype.prepare=function(){var ie=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,ie=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,ie=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var we=this.map.painter.context,We=we.gl;this.boundsBuffer||(this.boundsBuffer=we.createVertexBuffer(this._boundsArray,xe.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(ie||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(we,this.canvas,We.RGBA,{premultiply:!0});for(var mt in this.tiles){var wt=this.tiles[mt];wt.state!=="loaded"&&(wt.state="loaded",wt.texture=this.texture)}}},le.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},le.prototype.hasTransition=function(){return this._playing},le.prototype._hasInvalidDimensions=function(){for(var ie=0,we=[this.canvas.width,this.canvas.height];iethis.max){var wt=this._getAndRemoveByKey(this.order[0]);wt&&this.onRemove(wt)}return this},Ge.prototype.has=function(K){return K.wrapped().key in this.data},Ge.prototype.getAndRemove=function(K){return this.has(K)?this._getAndRemoveByKey(K.wrapped().key):null},Ge.prototype._getAndRemoveByKey=function(K){var le=this.data[K].shift();return le.timeout&&clearTimeout(le.timeout),this.data[K].length===0&&delete this.data[K],this.order.splice(this.order.indexOf(K),1),le.value},Ge.prototype.getByKey=function(K){var le=this.data[K];return le?le[0].value:null},Ge.prototype.get=function(K){if(!this.has(K))return null;var le=this.data[K.wrapped().key][0];return le.value},Ge.prototype.remove=function(K,le){if(!this.has(K))return this;var ie=K.wrapped().key,we=le===void 0?0:this.data[ie].indexOf(le),We=this.data[ie][we];return this.data[ie].splice(we,1),We.timeout&&clearTimeout(We.timeout),this.data[ie].length===0&&delete this.data[ie],this.onRemove(We.value),this.order.splice(this.order.indexOf(ie),1),this},Ge.prototype.setMaxSize=function(K){for(this.max=K;this.order.length>this.max;){var le=this._getAndRemoveByKey(this.order[0]);le&&this.onRemove(le)}return this},Ge.prototype.filter=function(K){var le=[];for(var ie in this.data)for(var we=0,We=this.data[ie];we1||(Math.abs(lr)>1&&(Math.abs(lr+ar)===1?lr+=ar:Math.abs(lr-ar)===1&&(lr-=ar)),!(!It.dem||!dt.dem)&&(dt.dem.backfillBorder(It.dem,lr,Qt),dt.neighboringTiles&&dt.neighboringTiles[pr]&&(dt.neighboringTiles[pr].backfilled=!0)))}},le.prototype.getTile=function(ie){return this.getTileByID(ie.key)},le.prototype.getTileByID=function(ie){return this._tiles[ie]},le.prototype._retainLoadedChildren=function(ie,we,We,mt){for(var wt in this._tiles){var Qe=this._tiles[wt];if(!(mt[wt]||!Qe.hasData()||Qe.tileID.overscaledZ<=we||Qe.tileID.overscaledZ>We)){for(var dt=Qe.tileID;Qe&&Qe.tileID.overscaledZ>we+1;){var It=Qe.tileID.scaledTo(Qe.tileID.overscaledZ-1);Qe=this._tiles[It.key],Qe&&Qe.hasData()&&(dt=It)}for(var lr=dt;lr.overscaledZ>we;)if(lr=lr.scaledTo(lr.overscaledZ-1),ie[lr.key]){mt[dt.key]=dt;break}}}},le.prototype.findLoadedParent=function(ie,we){if(ie.key in this._loadedParentTiles){var We=this._loadedParentTiles[ie.key];return We&&We.tileID.overscaledZ>=we?We:null}for(var mt=ie.overscaledZ-1;mt>=we;mt--){var wt=ie.scaledTo(mt),Qe=this._getLoadedTile(wt);if(Qe)return Qe}},le.prototype._getLoadedTile=function(ie){var we=this._tiles[ie.key];if(we&&we.hasData())return we;var We=this._cache.getByKey(ie.wrapped().key);return We},le.prototype.updateCacheSize=function(ie){var we=Math.ceil(ie.width/this._source.tileSize)+1,We=Math.ceil(ie.height/this._source.tileSize)+1,mt=we*We,wt=5,Qe=Math.floor(mt*wt),dt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Qe):Qe;this._cache.setMaxSize(dt)},le.prototype.handleWrapJump=function(ie){var we=this._prevLng===void 0?ie:this._prevLng,We=ie-we,mt=We/360,wt=Math.round(mt);if(this._prevLng=ie,wt){var Qe={};for(var dt in this._tiles){var It=this._tiles[dt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+wt),Qe[It.tileID.key]=It}this._tiles=Qe;for(var lr in this._timers)clearTimeout(this._timers[lr]),delete this._timers[lr];for(var Qt in this._tiles){var ar=this._tiles[Qt];this._setTileReloadTimer(Qt,ar)}}},le.prototype.update=function(ie){var we=this;if(this.transform=ie,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(ie),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var We;this.used?this._source.tileID?We=ie.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(In){return new i.OverscaledTileID(In.canonical.z,In.wrap,In.canonical.z,In.canonical.x,In.canonical.y)}):(We=ie.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(We=We.filter(function(In){return we._source.hasTile(In)}))):We=[];var mt=ie.coveringZoomLevel(this._source),wt=Math.max(mt-le.maxOverzooming,this._source.minzoom),Qe=Math.max(mt+le.maxUnderzooming,this._source.minzoom),dt=this._updateRetainedTiles(We,mt);if(En(this._source.type)){for(var It={},lr={},Qt=Object.keys(dt),ar=0,pr=Qt;arthis._source.maxzoom){var Xt=qt.children(this._source.maxzoom)[0],Fr=this.getTile(Xt);if(Fr&&Fr.hasData()){We[Xt.key]=Xt;continue}}else{var xi=qt.children(this._source.maxzoom);if(We[xi[0].key]&&We[xi[1].key]&&We[xi[2].key]&&We[xi[3].key])continue}for(var Li=tr.wasRequested(),Pn=qt.overscaledZ-1;Pn>=wt;--Pn){var An=qt.scaledTo(Pn);if(mt[An.key]||(mt[An.key]=!0,tr=this.getTile(An),!tr&&Li&&(tr=this._addTile(An)),tr&&(We[An.key]=An,Li=tr.wasRequested(),tr.hasData())))break}}}return We},le.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var ie in this._tiles){for(var we=[],We=void 0,mt=this._tiles[ie].tileID;mt.overscaledZ>0;){if(mt.key in this._loadedParentTiles){We=this._loadedParentTiles[mt.key];break}we.push(mt.key);var wt=mt.scaledTo(mt.overscaledZ-1);if(We=this._getLoadedTile(wt),We)break;mt=wt}for(var Qe=0,dt=we;Qe0)&&(we.hasData()&&we.state!=="reloading"?this._cache.add(we.tileID,we,we.getExpiryTimeout()):(we.aborted=!0,this._abortTile(we),this._unloadTile(we))))},le.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var ie in this._tiles)this._removeTile(ie);this._cache.reset()},le.prototype.tilesIn=function(ie,we,We){var mt=this,wt=[],Qe=this.transform;if(!Qe)return wt;for(var dt=We?Qe.getCameraQueryGeometry(ie):ie,It=ie.map(function(Pn){return Qe.pointCoordinate(Pn)}),lr=dt.map(function(Pn){return Qe.pointCoordinate(Pn)}),Qt=this.getIds(),ar=1/0,pr=1/0,yr=-1/0,qt=-1/0,tr=0,Xt=lr;tr=0&&ca[1].y+In>=0){var $n=It.map(function(va){return mn.getTilePoint(va)}),Vn=lr.map(function(va){return mn.getTilePoint(va)});wt.push({tile:An,tileID:mn,queryGeometry:$n,cameraQueryGeometry:Vn,scale:Hn})}}},Li=0;Li=i.browser.now())return!0}return!1},le.prototype.setFeatureState=function(ie,we,We){ie=ie||"_geojsonTileLayer",this._state.updateState(ie,we,We)},le.prototype.removeFeatureState=function(ie,we,We){ie=ie||"_geojsonTileLayer",this._state.removeFeatureState(ie,we,We)},le.prototype.getFeatureState=function(ie,we){return ie=ie||"_geojsonTileLayer",this._state.getState(ie,we)},le.prototype.setDependencies=function(ie,we,We){var mt=this._tiles[ie];mt&&mt.setDependencies(we,We)},le.prototype.reloadTilesForDependencies=function(ie,we){for(var We in this._tiles){var mt=this._tiles[We];mt.hasDependency(ie,we)&&this._reloadTile(We,"reloading")}this._cache.filter(function(wt){return!wt.hasDependency(ie,we)})},le}(i.Evented);Ui.maxOverzooming=10,Ui.maxUnderzooming=3;function Hi(K,le){var ie=Math.abs(K.wrap*2)-+(K.wrap<0),we=Math.abs(le.wrap*2)-+(le.wrap<0);return K.overscaledZ-le.overscaledZ||we-ie||le.canonical.y-K.canonical.y||le.canonical.x-K.canonical.x}function En(K){return K==="raster"||K==="image"||K==="video"}function Rn(){return new i.window.Worker(Ml.workerUrl)}var Gn="mapboxgl_preloaded_worker_pool",Xn=function(){this.active={}};Xn.prototype.acquire=function(K){if(!this.workers)for(this.workers=[];this.workers.length0?(we-mt)/wt:0;return this.points[We].mult(1-Qe).add(this.points[le].mult(Qe))};var Wi=function(K,le,ie){var we=this.boxCells=[],We=this.circleCells=[];this.xCellCount=Math.ceil(K/ie),this.yCellCount=Math.ceil(le/ie);for(var mt=0;mtthis.width||we<0||le>this.height)return We?!1:[];var wt=[];if(K<=0&&le<=0&&this.width<=ie&&this.height<=we){if(We)return!0;for(var Qe=0;Qe0:wt}},Wi.prototype._queryCircle=function(K,le,ie,we,We){var mt=K-ie,wt=K+ie,Qe=le-ie,dt=le+ie;if(wt<0||mt>this.width||dt<0||Qe>this.height)return we?!1:[];var It=[],lr={hitTest:we,circle:{x:K,y:le,radius:ie},seenUids:{box:{},circle:{}}};return this._forEachCell(mt,Qe,wt,dt,this._queryCellCircle,It,lr,We),we?It.length>0:It},Wi.prototype.query=function(K,le,ie,we,We){return this._query(K,le,ie,we,!1,We)},Wi.prototype.hitTest=function(K,le,ie,we,We){return this._query(K,le,ie,we,!0,We)},Wi.prototype.hitTestCircle=function(K,le,ie,we){return this._queryCircle(K,le,ie,!0,we)},Wi.prototype._queryCell=function(K,le,ie,we,We,mt,wt,Qe){var dt=wt.seenUids,It=this.boxCells[We];if(It!==null)for(var lr=this.bboxes,Qt=0,ar=It;Qt=lr[yr+0]&&we>=lr[yr+1]&&(!Qe||Qe(this.boxKeys[pr]))){if(wt.hitTest)return mt.push(!0),!0;mt.push({key:this.boxKeys[pr],x1:lr[yr],y1:lr[yr+1],x2:lr[yr+2],y2:lr[yr+3]})}}}var qt=this.circleCells[We];if(qt!==null)for(var tr=this.circles,Xt=0,Fr=qt;Xtwt*wt+Qe*Qe},Wi.prototype._circleAndRectCollide=function(K,le,ie,we,We,mt,wt){var Qe=(mt-we)/2,dt=Math.abs(K-(we+Qe));if(dt>Qe+ie)return!1;var It=(wt-We)/2,lr=Math.abs(le-(We+It));if(lr>It+ie)return!1;if(dt<=Qe||lr<=It)return!0;var Qt=dt-Qe,ar=lr-It;return Qt*Qt+ar*ar<=ie*ie};function dn(K,le,ie,we,We){var mt=i.create();return le?(i.scale(mt,mt,[1/We,1/We,1]),ie||i.rotateZ(mt,mt,we.angle)):i.multiply(mt,we.labelPlaneMatrix,K),mt}function Ua(K,le,ie,we,We){if(le){var mt=i.clone(K);return i.scale(mt,mt,[We,We,1]),ie||i.rotateZ(mt,mt,-we.angle),mt}else return we.glCoordMatrix}function ea(K,le){var ie=[K.x,K.y,0,1];rl(ie,ie,le);var we=ie[3];return{point:new i.Point(ie[0]/we,ie[1]/we),signedDistanceFromCamera:we}}function fo(K,le){return .5+.5*(K/le)}function ho(K,le){var ie=K[0]/K[3],we=K[1]/K[3],We=ie>=-le[0]&&ie<=le[0]&&we>=-le[1]&&we<=le[1];return We}function Vo(K,le,ie,we,We,mt,wt,Qe){var dt=we?K.textSizeData:K.iconSizeData,It=i.evaluateSizeForZoom(dt,ie.transform.zoom),lr=[256/ie.width*2+1,256/ie.height*2+1],Qt=we?K.text.dynamicLayoutVertexArray:K.icon.dynamicLayoutVertexArray;Qt.clear();for(var ar=K.lineVertexArray,pr=we?K.text.placedSymbolArray:K.icon.placedSymbolArray,yr=ie.transform.width/ie.transform.height,qt=!1,tr=0;trmt)return{useVertical:!0}}return(K===i.WritingMode.vertical?le.yie.x)?{needsFlipping:!0}:null}function Wa(K,le,ie,we,We,mt,wt,Qe,dt,It,lr,Qt,ar,pr){var yr=le/24,qt=K.lineOffsetX*yr,tr=K.lineOffsetY*yr,Xt;if(K.numGlyphs>1){var Fr=K.glyphStartIndex+K.numGlyphs,xi=K.lineStartIndex,Li=K.lineStartIndex+K.lineLength,Pn=Ao(yr,Qe,qt,tr,ie,lr,Qt,K,dt,mt,ar);if(!Pn)return{notEnoughRoom:!0};var An=ea(Pn.first.point,wt).point,mn=ea(Pn.last.point,wt).point;if(we&&!ie){var Hn=Wo(K.writingMode,An,mn,pr);if(Hn)return Hn}Xt=[Pn.first];for(var In=K.glyphStartIndex+1;In0?va.point:ks(Qt,Vn,ca,1,We),To=Wo(K.writingMode,ca,po,pr);if(To)return To}var Jo=fs(yr*Qe.getoffsetX(K.glyphStartIndex),qt,tr,ie,lr,Qt,K.segment,K.lineStartIndex,K.lineStartIndex+K.lineLength,dt,mt,ar);if(!Jo)return{notEnoughRoom:!0};Xt=[Jo]}for(var Ts=0,$l=Xt;Ts<$l.length;Ts+=1){var Yl=$l[Ts];i.addDynamicAttributes(It,Yl.point,Yl.angle)}return{}}function ks(K,le,ie,we,We){var mt=ea(K.add(K.sub(le)._unit()),We).point,wt=ie.sub(mt);return ie.add(wt._mult(we/wt.mag()))}function fs(K,le,ie,we,We,mt,wt,Qe,dt,It,lr,Qt){var ar=we?K-le:K+le,pr=ar>0?1:-1,yr=0;we&&(pr*=-1,yr=Math.PI),pr<0&&(yr+=Math.PI);for(var qt=pr>0?Qe+wt:Qe+wt+1,tr=We,Xt=We,Fr=0,xi=0,Li=Math.abs(ar),Pn=[];Fr+xi<=Li;){if(qt+=pr,qt=dt)return null;if(Xt=tr,Pn.push(tr),tr=Qt[qt],tr===void 0){var An=new i.Point(It.getx(qt),It.gety(qt)),mn=ea(An,lr);if(mn.signedDistanceFromCamera>0)tr=Qt[qt]=mn.point;else{var Hn=qt-pr,In=Fr===0?mt:new i.Point(It.getx(Hn),It.gety(Hn));tr=ks(In,An,Xt,Li-Fr+1,lr)}}Fr+=xi,xi=Xt.dist(tr)}var ca=(Li-Fr)/xi,$n=tr.sub(Xt),Vn=$n.mult(ca)._add(Xt);Vn._add($n._unit()._perp()._mult(ie*pr));var va=yr+Math.atan2(tr.y-Xt.y,tr.x-Xt.x);return Pn.push(Vn),{point:Vn,angle:va,path:Pn}}var _l=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function es(K,le){for(var ie=0;ie=1;$l--)Ts.push(To.path[$l]);for(var Yl=1;Yl0){for(var $s=Ts[0].clone(),zu=Ts[0].clone(),mf=1;mf=Vn.x&&zu.x<=va.x&&$s.y>=Vn.y&&zu.y<=va.y?Pc=[Ts]:zu.xva.x||zu.yva.y?Pc=[]:Pc=i.clipLine([Ts],Vn.x,Vn.y,va.x,va.y)}for(var Hf=0,M0=Pc;Hf=this.screenRightBoundary||wethis.screenBottomBoundary},xl.prototype.isInsideGrid=function(K,le,ie,we){return ie>=0&&K=0&&le0){var xi;return this.prevPlacement&&this.prevPlacement.variableOffsets[Qt.crossTileID]&&this.prevPlacement.placements[Qt.crossTileID]&&this.prevPlacement.placements[Qt.crossTileID].text&&(xi=this.prevPlacement.variableOffsets[Qt.crossTileID].anchor),this.variableOffsets[Qt.crossTileID]={textOffset:qt,width:ie,height:we,anchor:K,textBoxScale:We,prevAnchor:xi},this.markUsedJustification(ar,K,Qt,pr),ar.allowVerticalPlacement&&(this.markUsedOrientation(ar,pr,Qt),this.placedOrientations[Qt.crossTileID]=pr),{shift:tr,placedGlyphBoxes:Xt}}},Gs.prototype.placeLayerBucketPart=function(K,le,ie){var we=this,We=K.parameters,mt=We.bucket,wt=We.layout,Qe=We.posMatrix,dt=We.textLabelPlaneMatrix,It=We.labelToScreenMatrix,lr=We.textPixelRatio,Qt=We.holdingForFade,ar=We.collisionBoxArray,pr=We.partiallyEvaluatedTextSize,yr=We.collisionGroup,qt=wt.get("text-optional"),tr=wt.get("icon-optional"),Xt=wt.get("text-allow-overlap"),Fr=wt.get("icon-allow-overlap"),xi=wt.get("text-rotation-alignment")==="map",Li=wt.get("text-pitch-alignment")==="map",Pn=wt.get("icon-text-fit")!=="none",An=wt.get("symbol-z-order")==="viewport-y",mn=Xt&&(Fr||!mt.hasIconData()||tr),Hn=Fr&&(Xt||!mt.hasTextData()||qt);!mt.collisionArrays&&ar&&mt.deserializeCollisionBoxes(ar);var In=function(To,Jo){if(!le[To.crossTileID]){if(Qt){we.placements[To.crossTileID]=new Bs(!1,!1,!1);return}var Ts=!1,$l=!1,Yl=!0,Tl=null,Xl={box:null,offscreen:null},Pc={box:null,offscreen:null},$s=null,zu=null,mf=null,Hf=0,M0=0,vm=0;Jo.textFeatureIndex?Hf=Jo.textFeatureIndex:To.useRuntimeCollisionCircles&&(Hf=To.featureIndex),Jo.verticalTextFeatureIndex&&(M0=Jo.verticalTextFeatureIndex);var l0=Jo.textBox;if(l0){var u0=function(gf){var zd=i.WritingMode.horizontal;if(mt.allowVerticalPlacement&&!gf&&we.prevPlacement){var Ic=we.prevPlacement.placedOrientations[To.crossTileID];Ic&&(we.placedOrientations[To.crossTileID]=Ic,zd=Ic,we.markUsedOrientation(mt,zd,To))}return zd},Om=function(gf,zd){if(mt.allowVerticalPlacement&&To.numVerticalGlyphVertices>0&&Jo.verticalTextBox)for(var Ic=0,a1=mt.writingModes;Ic0&&(Sp=Sp.filter(function(gf){return gf!==c0.anchor}),Sp.unshift(c0.anchor))}var fp=function(gf,zd,Ic){for(var a1=gf.x2-gf.x1,py=gf.y2-gf.y1,zb=To.textBoxScale,$c=Pn&&!Fr?zd:null,zg={box:[],offscreen:!1},Ob=Xt?Sp.length*2:Sp.length,o1=0;o1=Sp.length,my=we.attemptAnchorPlacement(Rm,gf,a1,py,zb,xi,Li,lr,Qe,yr,Gw,To,mt,Ic,$c);if(my&&(zg=my.placedGlyphBoxes,zg&&zg.box&&zg.box.length)){Ts=!0,Tl=my.shift;break}}return zg},tg=function(){return fp(l0,Jo.iconBox,i.WritingMode.horizontal)},rv=function(){var gf=Jo.verticalTextBox,zd=Xl&&Xl.box&&Xl.box.length;return mt.allowVerticalPlacement&&!zd&&To.numVerticalGlyphVertices>0&&gf?fp(gf,Jo.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}};Om(tg,rv),Xl&&(Ts=Xl.box,Yl=Xl.offscreen);var h0=u0(Xl&&Xl.box);if(!Ts&&we.prevPlacement){var f0=we.prevPlacement.variableOffsets[To.crossTileID];f0&&(we.variableOffsets[To.crossTileID]=f0,we.markUsedJustification(mt,f0.anchor,To,h0))}}else{var Cp=function(gf,zd){var Ic=we.collisionIndex.placeCollisionBox(gf,Xt,lr,Qe,yr.predicate);return Ic&&Ic.box&&Ic.box.length&&(we.markUsedOrientation(mt,zd,To),we.placedOrientations[To.crossTileID]=zd),Ic},iv=function(){return Cp(l0,i.WritingMode.horizontal)},r1=function(){var gf=Jo.verticalTextBox;return mt.allowVerticalPlacement&&To.numVerticalGlyphVertices>0&&gf?Cp(gf,i.WritingMode.vertical):{box:null,offscreen:null}};Om(iv,r1),u0(Xl&&Xl.box&&Xl.box.length)}}if($s=Xl,Ts=$s&&$s.box&&$s.box.length>0,Yl=$s&&$s.offscreen,To.useRuntimeCollisionCircles){var nv=mt.text.placedSymbolArray.get(To.centerJustifiedTextSymbolIndex),Id=i.evaluateSizeForFeature(mt.textSizeData,pr,nv),Dg=wt.get("text-padding"),i1=To.collisionCircleDiameter;zu=we.collisionIndex.placeCollisionCircles(Xt,nv,mt.lineVertexArray,mt.glyphOffsetArray,Id,Qe,dt,It,ie,Li,yr.predicate,i1,Dg),Ts=Xt||zu.circles.length>0&&!zu.collisionDetected,Yl=Yl&&zu.offscreen}if(Jo.iconFeatureIndex&&(vm=Jo.iconFeatureIndex),Jo.iconBox){var Dd=function(gf){var zd=Pn&&Tl?ou(gf,Tl.x,Tl.y,xi,Li,we.transform.angle):gf;return we.collisionIndex.placeCollisionBox(zd,Fr,lr,Qe,yr.predicate)};Pc&&Pc.box&&Pc.box.length&&Jo.verticalIconBox?(mf=Dd(Jo.verticalIconBox),$l=mf.box.length>0):(mf=Dd(Jo.iconBox),$l=mf.box.length>0),Yl=Yl&&mf.offscreen}var av=qt||To.numHorizontalGlyphVertices===0&&To.numVerticalGlyphVertices===0,fy=tr||To.numIconVertices===0;if(!av&&!fy?$l=Ts=$l&&Ts:fy?av||($l=$l&&Ts):Ts=$l&&Ts,Ts&&$s&&$s.box&&(Pc&&Pc.box&&M0?we.collisionIndex.insertCollisionBox($s.box,wt.get("text-ignore-placement"),mt.bucketInstanceId,M0,yr.ID):we.collisionIndex.insertCollisionBox($s.box,wt.get("text-ignore-placement"),mt.bucketInstanceId,Hf,yr.ID)),$l&&mf&&we.collisionIndex.insertCollisionBox(mf.box,wt.get("icon-ignore-placement"),mt.bucketInstanceId,vm,yr.ID),zu&&(Ts&&we.collisionIndex.insertCollisionCircles(zu.circles,wt.get("text-ignore-placement"),mt.bucketInstanceId,Hf,yr.ID),ie)){var dy=mt.bucketInstanceId,Bm=we.collisionCircleArrays[dy];Bm===void 0&&(Bm=we.collisionCircleArrays[dy]=new No);for(var n1=0;n1=0;--$n){var Vn=ca[$n];In(mt.symbolInstances.get(Vn),mt.collisionArrays[Vn])}else for(var va=K.symbolInstanceStart;va=0&&(mt>=0&&It!==mt?K.text.placedSymbolArray.get(It).crossTileID=0:K.text.placedSymbolArray.get(It).crossTileID=ie.crossTileID)}},Gs.prototype.markUsedOrientation=function(K,le,ie){for(var we=le===i.WritingMode.horizontal||le===i.WritingMode.horizontalOnly?le:0,We=le===i.WritingMode.vertical?le:0,mt=[ie.leftJustifiedTextSymbolIndex,ie.centerJustifiedTextSymbolIndex,ie.rightJustifiedTextSymbolIndex],wt=0,Qe=mt;wt0||Li>0,In=Fr.numIconVertices>0,ca=we.placedOrientations[Fr.crossTileID],$n=ca===i.WritingMode.vertical,Vn=ca===i.WritingMode.horizontal||ca===i.WritingMode.horizontalOnly;if(Hn){var va=Gu(mn.text),po=$n?bo:va;pr(K.text,xi,po);var To=Vn?bo:va;pr(K.text,Li,To);var Jo=mn.text.isHidden();[Fr.rightJustifiedTextSymbolIndex,Fr.centerJustifiedTextSymbolIndex,Fr.leftJustifiedTextSymbolIndex].forEach(function(vm){vm>=0&&(K.text.placedSymbolArray.get(vm).hidden=Jo||$n?1:0)}),Fr.verticalPlacedTextSymbolIndex>=0&&(K.text.placedSymbolArray.get(Fr.verticalPlacedTextSymbolIndex).hidden=Jo||Vn?1:0);var Ts=we.variableOffsets[Fr.crossTileID];Ts&&we.markUsedJustification(K,Ts.anchor,Fr,ca);var $l=we.placedOrientations[Fr.crossTileID];$l&&(we.markUsedJustification(K,"left",Fr,$l),we.markUsedOrientation(K,$l,Fr))}if(In){var Yl=Gu(mn.icon),Tl=!(Qt&&Fr.verticalPlacedIconSymbolIndex&&$n);if(Fr.placedIconSymbolIndex>=0){var Xl=Tl?Yl:bo;pr(K.icon,Fr.numIconVertices,Xl),K.icon.placedSymbolArray.get(Fr.placedIconSymbolIndex).hidden=mn.icon.isHidden()}if(Fr.verticalPlacedIconSymbolIndex>=0){var Pc=Tl?bo:Yl;pr(K.icon,Fr.numVerticalIconVertices,Pc),K.icon.placedSymbolArray.get(Fr.verticalPlacedIconSymbolIndex).hidden=mn.icon.isHidden()}}if(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData()){var $s=K.collisionArrays[Xt];if($s){var zu=new i.Point(0,0);if($s.textBox||$s.verticalTextBox){var mf=!0;if(dt){var Hf=we.variableOffsets[Pn];Hf?(zu=Jl(Hf.anchor,Hf.width,Hf.height,Hf.textOffset,Hf.textBoxScale),It&&zu._rotate(lr?we.transform.angle:-we.transform.angle)):mf=!1}$s.textBox&&$a(K.textCollisionBox.collisionVertexArray,mn.text.placed,!mf||$n,zu.x,zu.y),$s.verticalTextBox&&$a(K.textCollisionBox.collisionVertexArray,mn.text.placed,!mf||Vn,zu.x,zu.y)}var M0=!!(!Vn&&$s.verticalIconBox);$s.iconBox&&$a(K.iconCollisionBox.collisionVertexArray,mn.icon.placed,M0,Qt?zu.x:0,Qt?zu.y:0),$s.verticalIconBox&&$a(K.iconCollisionBox.collisionVertexArray,mn.icon.placed,!M0,Qt?zu.x:0,Qt?zu.y:0)}}},qt=0;qtK},Gs.prototype.setStale=function(){this.stale=!0};function $a(K,le,ie,we,We){K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0)}var So=Math.pow(2,25),Xs=Math.pow(2,24),su=Math.pow(2,17),is=Math.pow(2,16),tu=Math.pow(2,9),pl=Math.pow(2,8),Nl=Math.pow(2,1);function Gu(K){if(K.opacity===0&&!K.placed)return 0;if(K.opacity===1&&K.placed)return 4294967295;var le=K.placed?1:0,ie=Math.floor(K.opacity*127);return ie*So+le*Xs+ie*su+le*is+ie*tu+le*pl+ie*Nl+le}var bo=0,Ls=function(K){this._sortAcrossTiles=K.layout.get("symbol-z-order")!=="viewport-y"&&K.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ls.prototype.continuePlacement=function(K,le,ie,we,We){for(var mt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var wt=K[this._currentPlacementIndex],Qe=le[wt],dt=this.placement.collisionIndex.transform.zoom;if(Qe.type==="symbol"&&(!Qe.minzoom||Qe.minzoom<=dt)&&(!Qe.maxzoom||Qe.maxzoom>dt)){this._inProgressLayer||(this._inProgressLayer=new Ls(Qe));var It=this._inProgressLayer.continuePlacement(ie[Qe.source],this.placement,this._showCollisionBoxes,Qe,mt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Rs.prototype.commit=function(K){return this.placement.commit(K),this.placement};var pu=512/i.EXTENT/2,bl=function(K,le,ie){this.tileID=K,this.indexedSymbolInstances={},this.bucketInstanceId=ie;for(var we=0;weK.overscaledZ)for(var dt in Qe){var It=Qe[dt];It.tileID.isChildOf(K)&&It.findMatches(le.symbolInstances,K,mt)}else{var lr=K.scaledTo(Number(wt)),Qt=Qe[lr.key];Qt&&Qt.findMatches(le.symbolInstances,K,mt)}}for(var ar=0;ar0)throw new Error("Unimplemented: "+mt.map(function(wt){return wt.command}).join(", ")+".");return We.forEach(function(wt){wt.command!=="setTransition"&&we[wt.command].apply(we,wt.args)}),this.stylesheet=ie,!0},le.prototype.addImage=function(ie,we){if(this.getImage(ie))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(ie,we),this._afterImageUpdated(ie)},le.prototype.updateImage=function(ie,we){this.imageManager.updateImage(ie,we)},le.prototype.getImage=function(ie){return this.imageManager.getImage(ie)},le.prototype.removeImage=function(ie){if(!this.getImage(ie))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(ie),this._afterImageUpdated(ie)},le.prototype._afterImageUpdated=function(ie){this._availableImages=this.imageManager.listImages(),this._changedImages[ie]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new i.Event("data",{dataType:"style"}))},le.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},le.prototype.addSource=function(ie,we,We){var mt=this;if(We===void 0&&(We={}),this._checkLoaded(),this.sourceCaches[ie]!==void 0)throw new Error("There is already a source with this ID");if(!we.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(we).join(", ")+".");var wt=["vector","raster","geojson","video","image"],Qe=wt.indexOf(we.type)>=0;if(!(Qe&&this._validate(i.validateStyle.source,"sources."+ie,we,null,We))){this.map&&this.map._collectResourceTiming&&(we.collectResourceTiming=!0);var dt=this.sourceCaches[ie]=new Ui(ie,we,this.dispatcher);dt.style=this,dt.setEventedParent(this,function(){return{isSourceLoaded:mt.loaded(),source:dt.serialize(),sourceId:ie}}),dt.onAdd(this.map),this._changed=!0}},le.prototype.removeSource=function(ie){if(this._checkLoaded(),this.sourceCaches[ie]===void 0)throw new Error("There is no source with this ID");for(var we in this._layers)if(this._layers[we].source===ie)return this.fire(new i.ErrorEvent(new Error('Source "'+ie+'" cannot be removed while layer "'+we+'" is using it.')));var We=this.sourceCaches[ie];delete this.sourceCaches[ie],delete this._updatedSources[ie],We.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:ie})),We.setEventedParent(null),We.clearTiles(),We.onRemove&&We.onRemove(this.map),this._changed=!0},le.prototype.setGeoJSONSourceData=function(ie,we){this._checkLoaded();var We=this.sourceCaches[ie].getSource();We.setData(we),this._changed=!0},le.prototype.getSource=function(ie){return this.sourceCaches[ie]&&this.sourceCaches[ie].getSource()},le.prototype.addLayer=function(ie,we,We){We===void 0&&(We={}),this._checkLoaded();var mt=ie.id;if(this.getLayer(mt)){this.fire(new i.ErrorEvent(new Error('Layer with id "'+mt+'" already exists on this map')));return}var wt;if(ie.type==="custom"){if(Ll(this,i.validateCustomStyleLayer(ie)))return;wt=i.createStyleLayer(ie)}else{if(typeof ie.source=="object"&&(this.addSource(mt,ie.source),ie=i.clone$1(ie),ie=i.extend(ie,{source:mt})),this._validate(i.validateStyle.layer,"layers."+mt,ie,{arrayIndex:-1},We))return;wt=i.createStyleLayer(ie),this._validateLayer(wt),wt.setEventedParent(this,{layer:{id:mt}}),this._serializedLayers[wt.id]=wt.serialize()}var Qe=we?this._order.indexOf(we):this._order.length;if(we&&Qe===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+we+'" does not exist on this map.')));return}if(this._order.splice(Qe,0,mt),this._layerOrderChanged=!0,this._layers[mt]=wt,this._removedLayers[mt]&&wt.source&&wt.type!=="custom"){var dt=this._removedLayers[mt];delete this._removedLayers[mt],dt.type!==wt.type?this._updatedSources[wt.source]="clear":(this._updatedSources[wt.source]="reload",this.sourceCaches[wt.source].pause())}this._updateLayer(wt),wt.onAdd&&wt.onAdd(this.map)},le.prototype.moveLayer=function(ie,we){this._checkLoaded(),this._changed=!0;var We=this._layers[ie];if(!We){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be moved.")));return}if(ie!==we){var mt=this._order.indexOf(ie);this._order.splice(mt,1);var wt=we?this._order.indexOf(we):this._order.length;if(we&&wt===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+we+'" does not exist on this map.')));return}this._order.splice(wt,0,ie),this._layerOrderChanged=!0}},le.prototype.removeLayer=function(ie){this._checkLoaded();var we=this._layers[ie];if(!we){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be removed.")));return}we.setEventedParent(null);var We=this._order.indexOf(ie);this._order.splice(We,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[ie]=we,delete this._layers[ie],delete this._serializedLayers[ie],delete this._updatedLayers[ie],delete this._updatedPaintProps[ie],we.onRemove&&we.onRemove(this.map)},le.prototype.getLayer=function(ie){return this._layers[ie]},le.prototype.hasLayer=function(ie){return ie in this._layers},le.prototype.setLayerZoomRange=function(ie,we,We){this._checkLoaded();var mt=this.getLayer(ie);if(!mt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot have zoom extent.")));return}mt.minzoom===we&&mt.maxzoom===We||(we!=null&&(mt.minzoom=we),We!=null&&(mt.maxzoom=We),this._updateLayer(mt))},le.prototype.setFilter=function(ie,we,We){We===void 0&&(We={}),this._checkLoaded();var mt=this.getLayer(ie);if(!mt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be filtered.")));return}if(!i.deepEqual(mt.filter,we)){if(we==null){mt.filter=void 0,this._updateLayer(mt);return}this._validate(i.validateStyle.filter,"layers."+mt.id+".filter",we,null,We)||(mt.filter=i.clone$1(we),this._updateLayer(mt))}},le.prototype.getFilter=function(ie){return i.clone$1(this.getLayer(ie).filter)},le.prototype.setLayoutProperty=function(ie,we,We,mt){mt===void 0&&(mt={}),this._checkLoaded();var wt=this.getLayer(ie);if(!wt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}i.deepEqual(wt.getLayoutProperty(we),We)||(wt.setLayoutProperty(we,We,mt),this._updateLayer(wt))},le.prototype.getLayoutProperty=function(ie,we){var We=this.getLayer(ie);if(!We){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style.")));return}return We.getLayoutProperty(we)},le.prototype.setPaintProperty=function(ie,we,We,mt){mt===void 0&&(mt={}),this._checkLoaded();var wt=this.getLayer(ie);if(!wt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}if(!i.deepEqual(wt.getPaintProperty(we),We)){var Qe=wt.setPaintProperty(we,We,mt);Qe&&this._updateLayer(wt),this._changed=!0,this._updatedPaintProps[ie]=!0}},le.prototype.getPaintProperty=function(ie,we){return this.getLayer(ie).getPaintProperty(we)},le.prototype.setFeatureState=function(ie,we){this._checkLoaded();var We=ie.source,mt=ie.sourceLayer,wt=this.sourceCaches[We];if(wt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+We+"' does not exist in the map's style.")));return}var Qe=wt.getSource().type;if(Qe==="geojson"&&mt){this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Qe==="vector"&&!mt){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}ie.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),wt.setFeatureState(mt,ie.id,we)},le.prototype.removeFeatureState=function(ie,we){this._checkLoaded();var We=ie.source,mt=this.sourceCaches[We];if(mt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+We+"' does not exist in the map's style.")));return}var wt=mt.getSource().type,Qe=wt==="vector"?ie.sourceLayer:void 0;if(wt==="vector"&&!Qe){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(we&&typeof ie.id!="string"&&typeof ie.id!="number"){this.fire(new i.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}mt.removeFeatureState(Qe,ie.id,we)},le.prototype.getFeatureState=function(ie){this._checkLoaded();var we=ie.source,We=ie.sourceLayer,mt=this.sourceCaches[we];if(mt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+we+"' does not exist in the map's style.")));return}var wt=mt.getSource().type;if(wt==="vector"&&!We){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return ie.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),mt.getFeatureState(We,ie.id)},le.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},le.prototype.serialize=function(){return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(ie){return ie.serialize()}),layers:this._serializeLayers(this._order)},function(ie){return ie!==void 0})},le.prototype._updateLayer=function(ie){this._updatedLayers[ie.id]=!0,ie.source&&!this._updatedSources[ie.source]&&this.sourceCaches[ie.source].getSource().type!=="raster"&&(this._updatedSources[ie.source]="reload",this.sourceCaches[ie.source].pause()),this._changed=!0},le.prototype._flattenAndSortRenderedFeatures=function(ie){for(var we=this,We=function(Vn){return we._layers[Vn].type==="fill-extrusion"},mt={},wt=[],Qe=this._order.length-1;Qe>=0;Qe--){var dt=this._order[Qe];if(We(dt)){mt[dt]=Qe;for(var It=0,lr=ie;It=0;Xt--){var Fr=this._order[Xt];if(We(Fr))for(var xi=wt.length-1;xi>=0;xi--){var Li=wt[xi].feature;if(mt[Li.layer.id] .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}),z6=ze((te,Y)=>{var d=ji(),y=Xi().defaultLine,z=Xh().attributes,P=On(),i=ff().textposition,n=oh().overrideAll,a=ku().templatedArray,l=dy(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var u=Y.exports=n({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:z({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:l.styleValuesMapbox.concat(l.styleValuesNonMapbox),dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:d.extendFlat({},i,{arrayOk:!1})}})},"plot","from-root");u.uirevision={valType:"any",editType:"none"}}),hA=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=Lb(),n=ff(),a=z6(),l=xa(),o=Oc(),u=nn().extendFlat,s=oh().overrideAll,h=z6(),m=i.line,b=i.marker;Y.exports=s({lon:i.lon,lat:i.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},b.opacity,{dflt:1})},mode:u({},n.mode,{dflt:"markers"}),text:u({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:u({},n.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:n.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:i.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:n.selected.marker},unselected:{marker:n.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),az=ze((te,Y)=>{var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return d.indexOf(y)!==-1}}}),NQ=ze((te,Y)=>{var d=ji(),y=Bc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=hA(),l=az().isSupportedFont;Y.exports=function(u,s,h,m){function b(g,C){return d.coerce(u,s,a,g,C)}function x(g,C){return d.coerce2(u,s,a,g,C)}var _=o(u,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(u,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(d.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),d.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(u,s,h,m,b,{noDash:!0}),b("connectgaps"));var f=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=f!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;i(u,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&n(u,s,h,b),d.coerceSelectionMarkerOpacity(s,b)};function o(u,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),oz=ze((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),sz=ze((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=y.split(" "),i=P[0],n=P[1],a=d.isArrayOrTypedArray(z)?d.mean(z):z,l=.5+a/100,o=1.5+a/100,u=["",""],s=[0,0];switch(i){case"top":u[0]="top",s[1]=-o;break;case"bottom":u[0]="bottom",s[1]=o;break}switch(n){case"left":u[1]="right",s[0]=-l;break;case"right":u[1]="left",s[0]=l;break}var h;return u[0]&&u[1]?h=u.join("-"):u[0]?h=u[0]:u[1]?h=u[1]:h="center",{anchor:h,offset:s}}}),jQ=ze((te,Y)=>{var d=Sr(),y=ji(),z=ei().BADNUM,P=V_(),i=lh(),n=Zs(),a=$v(),l=Bc(),o=az().isSupportedFont,u=sz(),s=T0().appendArrayPointValue,h=cc().NEWLINES,m=cc().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),T=l.hasMarkers(M),N=l.hasText(M),B=T&&M.marker.symbol==="circle",U=T&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var ee;if((g||C)&&(ee=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(ee),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(ee),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var he=x(I);H.geojson=he.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":he.mcc,"circle-radius":he.mrc,"circle-opacity":he.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var be=(M.marker||{}).size,ve=u(M.textposition,be);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),T=y.isArrayOrTypedArray(M.opacity),N;function B(ve){return I.opacity*ve}function U(ve){return ve/2}var V;g&&(i.hasColorscale(I,"marker")?V=i.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;T&&(F=function(ve){var ce=d(ve)?+y.constrain(ve,0,1):0;return B(ce)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),T&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),UQ=ze((te,Y)=>{var d=ji(),y=jQ(),z=dy().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function i(a,l,o,u){this.type="scattermapbox",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=u,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var n=i.prototype;n.addSource=function(a,l,o){var u={type:"geojson",data:l.geojson};o&&o.enabled&&d.extendFlat(u,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],u)},n.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},n.addLayer=function(a,l,o){var u={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(u.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var T=g[C];u.removeLayer(x.layerIds[T])}p||u.removeSource(x.sourceIds.circle)}function f(p){for(var g=P.nonCluster,C=0;C=0;C--){var T=g[C];u.removeLayer(x.layerIds[T]),p||u.removeSource(x.sourceIds[T])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):f(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var u=l[o];a.removeLayer(this.layerIds[u]),a.removeSource(this.sourceIds[u])}},Y.exports=function(a,l){var o=l[0].trace,u=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new i(a,o.uid,u,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(u)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var d=hf(),y=ji(),z=qu(),P=y.fillText,i=ei().BADNUM,n=dy().traceLayerPrefix;function a(o,u,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],f=n+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[f]});A=w.map(function(W){return W.id})}var D=u>=0?Math.floor((u+180)/360):Math.ceil((u-180)/360),E=D*360,I=u-E;function M(W){var F=W.lonlat;if(F[0]===i||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),ee=G.x-b.c2p([I,q]),he=G.y-x.c2p([H,s]),be=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(ee*ee+he*he)-be,1-3/be)}if(d.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],T=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=T-B,o.x1=T+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,u,s){if(o.hovertemplate)return;var h=u.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=u.lonlat,f=[];function k(w){return w+"°"}return b||x&&_?f.push("("+k(A[1])+", "+k(A[0])+")"):x?f.push(s.lon+k(A[0])):_&&f.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(u,o,f),f.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),$Q=ze((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d}}),HQ=ze((te,Y)=>{var d=ji(),y=Bc(),z=ei().BADNUM;Y.exports=function(P,i){var n=P.cd,a=P.xaxis,l=P.yaxis,o=[],u=n[0].trace,s;if(!y.hasMarkers(u))return[];if(i===!1)for(s=0;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():(d=d||self,d.mapboxgl=y())})(te,function(){var d,y,z;function P(i,n){if(!d)d=n;else if(!y)y=n;else{var a="var sharedChunk = {}; ("+d+")(sharedChunk); ("+y+")(sharedChunk);",l={};d(l),z=n(l),typeof window<"u"&&(z.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}}return P(["exports"],function(i){function n(v,j){return j={exports:{}},v(j,j.exports),j.exports}var a="1.13.4",l=o;function o(v,j,Q,Te){this.cx=3*v,this.bx=3*(Q-v)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*j,this.by=3*(Te-j)-this.cy,this.ay=1-this.cy-this.by,this.p1x=v,this.p1y=Te,this.p2x=Q,this.p2y=Te}o.prototype.sampleCurveX=function(v){return((this.ax*v+this.bx)*v+this.cx)*v},o.prototype.sampleCurveY=function(v){return((this.ay*v+this.by)*v+this.cy)*v},o.prototype.sampleCurveDerivativeX=function(v){return(3*this.ax*v+2*this.bx)*v+this.cx},o.prototype.solveCurveX=function(v,j){typeof j>"u"&&(j=1e-6);var Q,Te,je,Ye,st;for(je=v,st=0;st<8;st++){if(Ye=this.sampleCurveX(je)-v,Math.abs(Ye)Te)return Te;for(;QYe?Q=je:Te=je,je=(Te-Q)*.5+Q}return je},o.prototype.solve=function(v,j){return this.sampleCurveY(this.solveCurveX(v,j))};var u=s;function s(v,j){this.x=v,this.y=j}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(v){return this.clone()._add(v)},sub:function(v){return this.clone()._sub(v)},multByPoint:function(v){return this.clone()._multByPoint(v)},divByPoint:function(v){return this.clone()._divByPoint(v)},mult:function(v){return this.clone()._mult(v)},div:function(v){return this.clone()._div(v)},rotate:function(v){return this.clone()._rotate(v)},rotateAround:function(v,j){return this.clone()._rotateAround(v,j)},matMult:function(v){return this.clone()._matMult(v)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(v){return this.x===v.x&&this.y===v.y},dist:function(v){return Math.sqrt(this.distSqr(v))},distSqr:function(v){var j=v.x-this.x,Q=v.y-this.y;return j*j+Q*Q},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(v){return Math.atan2(this.y-v.y,this.x-v.x)},angleWith:function(v){return this.angleWithSep(v.x,v.y)},angleWithSep:function(v,j){return Math.atan2(this.x*j-this.y*v,this.x*v+this.y*j)},_matMult:function(v){var j=v[0]*this.x+v[1]*this.y,Q=v[2]*this.x+v[3]*this.y;return this.x=j,this.y=Q,this},_add:function(v){return this.x+=v.x,this.y+=v.y,this},_sub:function(v){return this.x-=v.x,this.y-=v.y,this},_mult:function(v){return this.x*=v,this.y*=v,this},_div:function(v){return this.x/=v,this.y/=v,this},_multByPoint:function(v){return this.x*=v.x,this.y*=v.y,this},_divByPoint:function(v){return this.x/=v.x,this.y/=v.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var v=this.y;return this.y=this.x,this.x=-v,this},_rotate:function(v){var j=Math.cos(v),Q=Math.sin(v),Te=j*this.x-Q*this.y,je=Q*this.x+j*this.y;return this.x=Te,this.y=je,this},_rotateAround:function(v,j){var Q=Math.cos(v),Te=Math.sin(v),je=j.x+Q*(this.x-j.x)-Te*(this.y-j.y),Ye=j.y+Te*(this.x-j.x)+Q*(this.y-j.y);return this.x=je,this.y=Ye,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(v){return v instanceof s?v:Array.isArray(v)?new s(v[0],v[1]):v};var h=typeof self<"u"?self:{};function m(v,j){if(Array.isArray(v)){if(!Array.isArray(j)||v.length!==j.length)return!1;for(var Q=0;Q=1)return 1;var j=v*v,Q=j*v;return 4*(v<.5?Q:3*(v-j)+Q-.75)}function _(v,j,Q,Te){var je=new l(v,j,Q,Te);return function(Ye){return je.solve(Ye)}}var A=_(.25,.1,.25,1);function f(v,j,Q){return Math.min(Q,Math.max(j,v))}function k(v,j,Q){var Te=Q-j,je=((v-j)%Te+Te)%Te+j;return je===j?Q:je}function w(v,j,Q){if(!v.length)return Q(null,[]);var Te=v.length,je=new Array(v.length),Ye=null;v.forEach(function(st,Ut){j(st,function(ir,Tr){ir&&(Ye=ir),je[Ut]=Tr,--Te===0&&Q(Ye,je)})})}function D(v){var j=[];for(var Q in v)j.push(v[Q]);return j}function E(v,j){var Q=[];for(var Te in v)Te in j||Q.push(Te);return Q}function I(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Te=0,je=j;Te>j/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,v)}return v()}function T(v){return v<=1?1:Math.pow(2,Math.ceil(Math.log(v)/Math.LN2))}function N(v){return v?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(v):!1}function B(v,j){v.forEach(function(Q){j[Q]&&(j[Q]=j[Q].bind(j))})}function U(v,j){return v.indexOf(j,v.length-j.length)!==-1}function V(v,j,Q){var Te={};for(var je in v)Te[je]=j.call(Q||this,v[je],je,v);return Te}function W(v,j,Q){var Te={};for(var je in v)j.call(Q||this,v[je],je,v)&&(Te[je]=v[je]);return Te}function F(v){return Array.isArray(v)?v.map(F):typeof v=="object"&&v?V(v,F):v}function H(v,j){for(var Q=0;Q=0)return!0;return!1}var q={};function G(v){q[v]||(typeof console<"u"&&console.warn(v),q[v]=!0)}function ee(v,j,Q){return(Q.y-v.y)*(j.x-v.x)>(j.y-v.y)*(Q.x-v.x)}function he(v){for(var j=0,Q=0,Te=v.length,je=Te-1,Ye=void 0,st=void 0;Q@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,Q={};if(v.replace(j,function(je,Ye,st,Ut){var ir=st||Ut;return Q[Ye]=ir?ir.toLowerCase():!0,""}),Q["max-age"]){var Te=parseInt(Q["max-age"],10);isNaN(Te)?delete Q["max-age"]:Q["max-age"]=Te}return Q}var re=null;function ge(v){if(re==null){var j=v.navigator?v.navigator.userAgent:null;re=!!v.safari||!!(j&&(/\b(iPad|iPhone|iPod)\b/.test(j)||j.match("Safari")&&!j.match("Chrome")))}return re}function ne(v){try{var j=h[v];return j.setItem("_mapbox_test_",1),j.removeItem("_mapbox_test_"),!0}catch{return!1}}function se(v){return h.btoa(encodeURIComponent(v).replace(/%([0-9A-F]{2})/g,function(j,Q){return String.fromCharCode(+("0x"+Q))}))}function _e(v){return decodeURIComponent(h.atob(v).split("").map(function(j){return"%"+("00"+j.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var oe=h.performance&&h.performance.now?h.performance.now.bind(h.performance):Date.now.bind(Date),J=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame,me=h.cancelAnimationFrame||h.mozCancelAnimationFrame||h.webkitCancelAnimationFrame||h.msCancelAnimationFrame,fe,Ce,Re={now:oe,frame:function(v){var j=J(v);return{cancel:function(){return me(j)}}},getImageData:function(v,j){j===void 0&&(j=0);var Q=h.document.createElement("canvas"),Te=Q.getContext("2d");if(!Te)throw new Error("failed to create canvas 2d context");return Q.width=v.width,Q.height=v.height,Te.drawImage(v,0,0,v.width,v.height),Te.getImageData(-j,-j,v.width+2*j,v.height+2*j)},resolveURL:function(v){return fe||(fe=h.document.createElement("a")),fe.href=v,fe.href},hardwareConcurrency:h.navigator&&h.navigator.hardwareConcurrency||4,get devicePixelRatio(){return h.devicePixelRatio},get prefersReducedMotion(){return h.matchMedia?(Ce==null&&(Ce=h.matchMedia("(prefers-reduced-motion: reduce)")),Ce.matches):!1}},Be={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ze={supported:!1,testSupport:vt},Ge,tt=!1,_t,mt=!1;h.document&&(_t=h.document.createElement("img"),_t.onload=function(){Ge&&ct(Ge),Ge=null,mt=!0},_t.onerror=function(){tt=!0,Ge=null},_t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function vt(v){tt||!_t||(mt?ct(v):Ge=v)}function ct(v){var j=v.createTexture();v.bindTexture(v.TEXTURE_2D,j);try{if(v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,_t),v.isContextLost())return;Ze.supported=!0}catch{}v.deleteTexture(j),tt=!0}var Ae="01";function Oe(){for(var v="1",j="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Q="",Te=0;Te<10;Te++)Q+=j[Math.floor(Math.random()*62)];var je=720*60*1e3,Ye=[v,Ae,Q].join(""),st=Date.now()+je;return{token:Ye,tokenExpiresAt:st}}var Le=function(v,j){this._transformRequestFn=v,this._customAccessToken=j,this._createSkuToken()};Le.prototype._createSkuToken=function(){var v=Oe();this._skuToken=v.token,this._skuTokenExpiresAt=v.tokenExpiresAt},Le.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Le.prototype.transformRequest=function(v,j){return this._transformRequestFn?this._transformRequestFn(v,j)||{url:v}:{url:v}},Le.prototype.normalizeStyleURL=function(v,j){if(!nt(v))return v;var Q=vr(v);return Q.path="/styles/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Le.prototype.normalizeGlyphsURL=function(v,j){if(!nt(v))return v;var Q=vr(v);return Q.path="/fonts/v1"+Q.path,this._makeAPIURL(Q,this._customAccessToken||j)},Le.prototype.normalizeSourceURL=function(v,j){if(!nt(v))return v;var Q=vr(v);return Q.path="/v4/"+Q.authority+".json",Q.params.push("secure"),this._makeAPIURL(Q,this._customAccessToken||j)},Le.prototype.normalizeSpriteURL=function(v,j,Q,Te){var je=vr(v);return nt(v)?(je.path="/styles/v1"+je.path+"/sprite"+j+Q,this._makeAPIURL(je,this._customAccessToken||Te)):(je.path+=""+j+Q,mr(je))},Le.prototype.normalizeTileURL=function(v,j){if(this._isSkuTokenExpired()&&this._createSkuToken(),v&&!nt(v))return v;var Q=vr(v),Te=/(\.(png|jpg)\d*)(?=$)/,je=/^.+\/v4\//,Ye=Re.devicePixelRatio>=2||j===512?"@2x":"",st=Ze.supported?".webp":"$1";Q.path=Q.path.replace(Te,""+Ye+st),Q.path=Q.path.replace(je,"/"),Q.path="/v4"+Q.path;var Ut=this._customAccessToken||Gt(Q.params)||Be.ACCESS_TOKEN;return Be.REQUIRE_ACCESS_TOKEN&&Ut&&this._skuToken&&Q.params.push("sku="+this._skuToken),this._makeAPIURL(Q,Ut)},Le.prototype.canonicalizeTileURL=function(v,j){var Q="/v4/",Te=/\.[\w]+$/,je=vr(v);if(!je.path.match(/(^\/v4\/)/)||!je.path.match(Te))return v;var Ye="mapbox://tiles/";Ye+=je.path.replace(Q,"");var st=je.params;return j&&(st=st.filter(function(Ut){return!Ut.match(/^access_token=/)})),st.length&&(Ye+="?"+st.join("&")),Ye},Le.prototype.canonicalizeTileset=function(v,j){for(var Q=j?nt(j):!1,Te=[],je=0,Ye=v.tiles||[];je=0&&v.params.splice(je,1)}if(Te.path!=="/"&&(v.path=""+Te.path+v.path),!Be.REQUIRE_ACCESS_TOKEN)return mr(v);if(j=j||Be.ACCESS_TOKEN,!j)throw new Error("An API access token is required to use Mapbox GL. "+Q);if(j[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+Q);return v.params=v.params.filter(function(Ye){return Ye.indexOf("access_token")===-1}),v.params.push("access_token="+j),mr(v)};function nt(v){return v.indexOf("mapbox:")===0}var xt=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function ut(v){return xt.test(v)}function Et(v){return v.indexOf("sku=")>0&&ut(v)}function Gt(v){for(var j=0,Q=v;j=1&&h.localStorage.setItem(j,JSON.stringify(this.eventData))}catch{G("Unable to write to LocalStorage")}},Lr.prototype.processRequests=function(v){},Lr.prototype.postEvent=function(v,j,Q,Te){var je=this;if(Be.EVENTS_URL){var Ye=vr(Be.EVENTS_URL);Ye.params.push("access_token="+(Te||Be.ACCESS_TOKEN||""));var st={event:this.type,created:new Date(v).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:a,skuId:Ae,userId:this.anonId},Ut=j?I(st,j):st,ir={url:mr(Ye),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Ut])};this.pendingRequest=Hi(ir,function(Tr){je.pendingRequest=null,Q(Tr),je.saveEventData(),je.processRequests(Te)})}},Lr.prototype.queueRequest=function(v,j){this.queue.push(v),this.processRequests(j)};var ci=function(v){function j(){v.call(this,"map.load"),this.success={},this.skuToken=""}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postMapLoadEvent=function(Q,Te,je,Ye){this.skuToken=je,(Be.EVENTS_URL&&Ye||Be.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(st){return nt(st)||ut(st)}))&&this.queueRequest({id:Te,timestamp:Date.now()},Ye)},j.prototype.processRequests=function(Q){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){var je=this.queue.shift(),Ye=je.id,st=je.timestamp;Ye&&this.success[Ye]||(this.anonId||this.fetchEventData(),N(this.anonId)||(this.anonId=C()),this.postEvent(st,{skuToken:this.skuToken},function(Ut){Ut||Ye&&(Te.success[Ye]=!0)},Q))}},j}(Lr),vi=function(v){function j(Q){v.call(this,"appUserTurnstile"),this._customAccessToken=Q}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.postTurnstileEvent=function(Q,Te){Be.EVENTS_URL&&Be.ACCESS_TOKEN&&Array.isArray(Q)&&Q.some(function(je){return nt(je)||ut(je)})&&this.queueRequest(Date.now(),Te)},j.prototype.processRequests=function(Q){var Te=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var je=ii(Be.ACCESS_TOKEN),Ye=je?je.u:Be.ACCESS_TOKEN,st=Ye!==this.eventData.tokenU;N(this.anonId)||(this.anonId=C(),st=!0);var Ut=this.queue.shift();if(this.eventData.lastSuccess){var ir=new Date(this.eventData.lastSuccess),Tr=new Date(Ut),Br=(Ut-this.eventData.lastSuccess)/(1440*60*1e3);st=st||Br>=1||Br<-1||ir.getDate()!==Tr.getDate()}else st=!0;if(!st)return this.processRequests();this.postEvent(Ut,{"enabled.telemetry":!1},function(ui){ui||(Te.eventData.lastSuccess=Ut,Te.eventData.tokenU=Ye)},Q)}},j}(Lr),Ot=new vi,Xe=Ot.postTurnstileEvent.bind(Ot),ot=new ci,De=ot.postMapLoadEvent.bind(ot),ye="mapbox-tiles",Pe=500,He=50,at=1e3*60*7,ht;function At(){h.caches&&!ht&&(ht=h.caches.open(ye))}var Wt;function Yt(v,j){if(Wt===void 0)try{new Response(new ReadableStream),Wt=!0}catch{Wt=!1}Wt?j(v.body):v.blob().then(j)}function hr(v,j,Q){if(At(),!!ht){var Te={status:j.status,statusText:j.statusText,headers:new h.Headers};j.headers.forEach(function(st,Ut){return Te.headers.set(Ut,st)});var je=ce(j.headers.get("Cache-Control")||"");if(!je["no-store"]){je["max-age"]&&Te.headers.set("Expires",new Date(Q+je["max-age"]*1e3).toUTCString());var Ye=new Date(Te.headers.get("Expires")).getTime()-Q;YeDate.now()&&!Q["no-cache"]}var fi=1/0;function un(v){fi++,fi>He&&(v.getActor().send("enforceCacheSizeLimit",Pe),fi=0)}function cn(v){At(),ht&&ht.then(function(j){j.keys().then(function(Q){for(var Te=0;Te=200&&Q.status<300||Q.status===0)&&Q.response!==null){var je=Q.response;if(v.type==="json")try{je=JSON.parse(Q.response)}catch(Ye){return j(Ye)}j(null,je,Q.getResponseHeader("Cache-Control"),Q.getResponseHeader("Expires"))}else j(new na(Q.statusText,Q.status,v.url))},Q.send(v.body),{cancel:function(){return Q.abort()}}}var di=function(v,j){if(!lr(v.url)){if(h.fetch&&h.Request&&h.AbortController&&h.Request.prototype.hasOwnProperty("signal"))return _r(v,j);if(ve()&&self.worker&&self.worker.actor){var Q=!0;return self.worker.actor.send("getResource",v,j,void 0,Q)}}return Er(v,j)},qi=function(v,j){return di(I(v,{type:"json"}),j)},Ui=function(v,j){return di(I(v,{type:"arrayBuffer"}),j)},Hi=function(v,j){return di(I(v,{method:"POST"}),j)};function Ln(v){var j=h.document.createElement("a");return j.href=v,j.protocol===h.document.location.protocol&&j.host===h.document.location.host}var Fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Kn(v,j,Q,Te){var je=new h.Image,Ye=h.URL;je.onload=function(){j(null,je),Ye.revokeObjectURL(je.src),je.onload=null,h.requestAnimationFrame(function(){je.src=Fn})},je.onerror=function(){return j(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var st=new h.Blob([new Uint8Array(v)],{type:"image/png"});je.cacheControl=Q,je.expires=Te,je.src=v.byteLength?Ye.createObjectURL(st):Fn}function Jn(v,j){var Q=new h.Blob([new Uint8Array(v)],{type:"image/png"});h.createImageBitmap(Q).then(function(Te){j(null,Te)}).catch(function(Te){j(new Error("Could not load image because of "+Te.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var sa,Mn,Ha=function(){sa=[],Mn=0};Ha();var io=function(v,j){if(Ze.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),Mn>=Be.MAX_PARALLEL_IMAGE_REQUESTS){var Q={requestParameters:v,callback:j,cancelled:!1,cancel:function(){this.cancelled=!0}};return sa.push(Q),Q}Mn++;var Te=!1,je=function(){if(!Te)for(Te=!0,Mn--;sa.length&&Mn0||this._oneTimeListeners&&this._oneTimeListeners[v]&&this._oneTimeListeners[v].length>0||this._eventedParent&&this._eventedParent.listens(v)},Gr.prototype.setEventedParent=function(v,j){return this._eventedParent=v,this._eventedParentData=j,this};var li=8,Pi={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},xi={"*":{type:"source"}},zt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],xr={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Qr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ri={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},en={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},_n={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Zi={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Wi={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},pn=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Ua={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ea={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},fo={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ho={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vo={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ao={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wo={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wa={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ts={type:"array",value:"*"},fs={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},_l={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},es={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},rl={type:"array",value:"*",minimum:1},ds={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},xl=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],sl={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},Gl={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},ms={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Bs={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},No={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Ls={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Il={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Jl={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ou={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Gs={"*":{type:"string"}},$a={$version:li,$root:Pi,sources:xi,source:zt,source_vector:xr,source_raster:Qr,source_raster_dem:Ri,source_geojson:en,source_video:_n,source_image:Zi,layer:Wi,layout:pn,layout_background:Ua,layout_fill:ea,layout_circle:fo,layout_heatmap:ho,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Vo,layout_symbol:Ao,layout_raster:Wo,layout_hillshade:Wa,filter:Ts,filter_operator:fs,geometry_type:_l,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:es,expression:rl,light:ds,paint:xl,paint_fill:sl,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:Gl,paint_circle:ms,paint_heatmap:Bs,paint_symbol:No,paint_raster:Ls,paint_hillshade:Il,paint_background:Jl,transition:ou,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Gs},So=function(v,j,Q,Te){this.message=(v?v+": ":"")+Q,Te&&(this.identifier=Te),j!=null&&j.__line__&&(this.line=j.__line__)};function Xs(v){var j=v.key,Q=v.value;return Q?[new So(j,Q,"constants have been deprecated as of v8")]:[]}function su(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];for(var Te=0,je=j;Te":v.itemType.kind==="value"?"array":"array<"+j+">"}else return v.kind}var pc=[Gu,bo,Ps,Rs,pu,Ll,bl,lu(ls),Hl];function Ah(v,j){if(j.kind==="error")return null;if(v.kind==="array"){if(j.kind==="array"&&(j.N===0&&j.itemType.kind==="value"||!Ah(v.itemType,j.itemType))&&(typeof v.N!="number"||v.N===j.N))return null}else{if(v.kind===j.kind)return null;if(v.kind==="value")for(var Q=0,Te=pc;Q255?255:Tr}function je(Tr){return Tr<0?0:Tr>1?1:Tr}function Ye(Tr){return Tr[Tr.length-1]==="%"?Te(parseFloat(Tr)/100*255):Te(parseInt(Tr))}function st(Tr){return Tr[Tr.length-1]==="%"?je(parseFloat(Tr)/100):je(parseFloat(Tr))}function Ut(Tr,Br,ui){return ui<0?ui+=1:ui>1&&(ui-=1),ui*6<1?Tr+(Br-Tr)*ui*6:ui*2<1?Br:ui*3<2?Tr+(Br-Tr)*(2/3-ui)*6:Tr}function ir(Tr){var Br=Tr.replace(/ /g,"").toLowerCase();if(Br in Q)return Q[Br].slice();if(Br[0]==="#"){if(Br.length===4){var ui=parseInt(Br.substr(1),16);return ui>=0&&ui<=4095?[(ui&3840)>>4|(ui&3840)>>8,ui&240|(ui&240)>>4,ui&15|(ui&15)<<4,1]:null}else if(Br.length===7){var ui=parseInt(Br.substr(1),16);return ui>=0&&ui<=16777215?[(ui&16711680)>>16,(ui&65280)>>8,ui&255,1]:null}return null}var _i=Br.indexOf("("),Ii=Br.indexOf(")");if(_i!==-1&&Ii+1===Br.length){var tn=Br.substr(0,_i),zn=Br.substr(_i+1,Ii-(_i+1)).split(","),ba=1;switch(tn){case"rgba":if(zn.length!==4)return null;ba=st(zn.pop());case"rgb":return zn.length!==3?null:[Ye(zn[0]),Ye(zn[1]),Ye(zn[2]),ba];case"hsla":if(zn.length!==4)return null;ba=st(zn.pop());case"hsl":if(zn.length!==3)return null;var ma=(parseFloat(zn[0])%360+360)%360/360,za=st(zn[1]),Za=st(zn[2]),Pa=Za<=.5?Za*(za+1):Za+za-Za*za,co=Za*2-Pa;return[Te(Ut(co,Pa,ma+1/3)*255),Te(Ut(co,Pa,ma)*255),Te(Ut(co,Pa,ma-1/3)*255),ba];default:return null}}return null}try{j.parseCSSColor=ir}catch{}}),Nf=td.parseCSSColor,Vl=function(v,j,Q,Te){Te===void 0&&(Te=1),this.r=v,this.g=j,this.b=Q,this.a=Te};Vl.parse=function(v){if(v){if(v instanceof Vl)return v;if(typeof v=="string"){var j=Nf(v);if(j)return new Vl(j[0]/255*j[3],j[1]/255*j[3],j[2]/255*j[3],j[3])}}},Vl.prototype.toString=function(){var v=this.toArray(),j=v[0],Q=v[1],Te=v[2],je=v[3];return"rgba("+Math.round(j)+","+Math.round(Q)+","+Math.round(Te)+","+je+")"},Vl.prototype.toArray=function(){var v=this,j=v.r,Q=v.g,Te=v.b,je=v.a;return je===0?[0,0,0,0]:[j*255/je,Q*255/je,Te*255/je,je]},Vl.black=new Vl(0,0,0,1),Vl.white=new Vl(1,1,1,1),Vl.transparent=new Vl(0,0,0,0),Vl.red=new Vl(1,0,0,1);var Kc=function(v,j,Q){v?this.sensitivity=j?"variant":"case":this.sensitivity=j?"accent":"base",this.locale=Q,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Kc.prototype.compare=function(v,j){return this.collator.compare(v,j)},Kc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rd=function(v,j,Q,Te,je){this.text=v,this.image=j,this.scale=Q,this.fontStack=Te,this.textColor=je},xc=function(v){this.sections=v};xc.fromString=function(v){return new xc([new rd(v,null,null,null,null)])},xc.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(v){return v.text.length!==0||v.image&&v.image.name.length!==0})},xc.factory=function(v){return v instanceof xc?v:xc.fromString(v)},xc.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(v){return v.text}).join("")},xc.prototype.serialize=function(){for(var v=["format"],j=0,Q=this.sections;j=0&&v<=255&&typeof j=="number"&&j>=0&&j<=255&&typeof Q=="number"&&Q>=0&&Q<=255)){var je=typeof Te=="number"?[v,j,Q,Te]:[v,j,Q];return"Invalid rgba value ["+je.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof Te>"u"||typeof Te=="number"&&Te>=0&&Te<=1?null:"Invalid rgba value ["+[v,j,Q,Te].join(", ")+"]: 'a' must be between 0 and 1."}function vh(v){if(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number"||v instanceof Vl||v instanceof Kc||v instanceof xc||v instanceof mc)return!0;if(Array.isArray(v)){for(var j=0,Q=v;j2){var st=v[1];if(typeof st!="string"||!(st in Fh)||st==="object")return j.error('The item type argument of "array" must be one of string, number, boolean',1);Ye=Fh[st],Q++}else Ye=ls;var Ut;if(v.length>3){if(v[2]!==null&&(typeof v[2]!="number"||v[2]<0||v[2]!==Math.floor(v[2])))return j.error('The length argument to "array" must be a positive integer literal',2);Ut=v[2],Q++}Te=lu(Ye,Ut)}else Te=Fh[je];for(var ir=[];Q1)&&j.push(Te)}}return j.concat(this.args.map(function(je){return je.serialize()}))};var Jh=function(v){this.type=Ll,this.sections=v};Jh.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[1];if(!Array.isArray(Q)&&typeof Q=="object")return j.error("First argument must be an image or text section.");for(var Te=[],je=!1,Ye=1;Ye<=v.length-1;++Ye){var st=v[Ye];if(je&&typeof st=="object"&&!Array.isArray(st)){je=!1;var Ut=null;if(st["font-scale"]&&(Ut=j.parse(st["font-scale"],1,bo),!Ut))return null;var ir=null;if(st["text-font"]&&(ir=j.parse(st["text-font"],1,lu(Ps)),!ir))return null;var Tr=null;if(st["text-color"]&&(Tr=j.parse(st["text-color"],1,pu),!Tr))return null;var Br=Te[Te.length-1];Br.scale=Ut,Br.font=ir,Br.textColor=Tr}else{var ui=j.parse(v[Ye],1,ls);if(!ui)return null;var _i=ui.type.kind;if(_i!=="string"&&_i!=="value"&&_i!=="null"&&_i!=="resolvedImage")return j.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");je=!0,Te.push({content:ui,scale:null,font:null,textColor:null})}}return new Jh(Te)},Jh.prototype.evaluate=function(v){var j=function(Q){var Te=Q.content.evaluate(v);return yu(Te)===Hl?new rd("",Te,null,null,null):new rd(gc(Te),null,Q.scale?Q.scale.evaluate(v):null,Q.font?Q.font.evaluate(v).join(","):null,Q.textColor?Q.textColor.evaluate(v):null)};return new xc(this.sections.map(j))},Jh.prototype.eachChild=function(v){for(var j=0,Q=this.sections;j-1),Q},Mu.prototype.eachChild=function(v){v(this.input)},Mu.prototype.outputDefined=function(){return!1},Mu.prototype.serialize=function(){return["image",this.input.serialize()]};var Xd={"to-boolean":Rs,"to-color":pu,"to-number":bo,"to-string":Ps},ll=function(v,j){this.type=v,this.args=j};ll.parse=function(v,j){if(v.length<2)return j.error("Expected at least one argument.");var Q=v[0];if((Q==="to-boolean"||Q==="to-string")&&v.length!==2)return j.error("Expected one argument.");for(var Te=Xd[Q],je=[],Ye=1;Ye4?Q="Invalid rbga value "+JSON.stringify(j)+": expected an array containing either three or four numeric values.":Q=bc(j[0],j[1],j[2],j[3]),!Q))return new Vl(j[0]/255,j[1]/255,j[2]/255,j[3])}throw new ru(Q||"Could not parse color from value '"+(typeof j=="string"?j:String(JSON.stringify(j)))+"'")}else if(this.type.kind==="number"){for(var Ut=null,ir=0,Tr=this.args;ir=j[2]||v[1]<=j[1]||v[3]>=j[3])}function Pd(v,j){var Q=Qh(v[0]),Te=Lf(v[1]),je=Math.pow(2,j.z);return[Math.round(Q*je*hc),Math.round(Te*je*hc)]}function hd(v,j,Q){var Te=v[0]-j[0],je=v[1]-j[1],Ye=v[0]-Q[0],st=v[1]-Q[1];return Te*st-Ye*je===0&&Te*Ye<=0&&je*st<=0}function Pf(v,j,Q){return j[1]>v[1]!=Q[1]>v[1]&&v[0]<(Q[0]-j[0])*(v[1]-j[1])/(Q[1]-j[1])+j[0]}function ef(v,j){for(var Q=!1,Te=0,je=j.length;Te0&&ui<0||Br<0&&ui>0}function fd(v,j,Q,Te){var je=[j[0]-v[0],j[1]-v[1]],Ye=[Te[0]-Q[0],Te[1]-Q[1]];return ad(Ye,je)===0?!1:!!(_h(v,j,Q,Te)&&_h(Q,Te,v,j))}function Nh(v,j,Q){for(var Te=0,je=Q;TeQ[2]){var je=Te*.5,Ye=v[0]-Q[0]>je?-Te:Q[0]-v[0]>je?Te:0;Ye===0&&(Ye=v[0]-Q[2]>je?-Te:Q[2]-v[0]>je?Te:0),v[0]+=Ye}id(j,v)}function jf(v){v[0]=v[1]=1/0,v[2]=v[3]=-1/0}function Jd(v,j,Q,Te){for(var je=Math.pow(2,Te.z)*hc,Ye=[Te.x*hc,Te.y*hc],st=[],Ut=0,ir=v;Ut=0)return!1;var Q=!0;return v.eachChild(function(Te){Q&&!Xc(Te,j)&&(Q=!1)}),Q}var tf=function(v,j){this.type=j.type,this.name=v,this.boundExpression=j};tf.parse=function(v,j){if(v.length!==2||typeof v[1]!="string")return j.error("'var' expression requires exactly one string literal argument.");var Q=v[1];return j.scope.has(Q)?new tf(Q,j.scope.get(Q)):j.error('Unknown variable "'+Q+'". Make sure "'+Q+'" has been bound in an enclosing "let" expression before using it.',1)},tf.prototype.evaluate=function(v){return this.boundExpression.evaluate(v)},tf.prototype.eachChild=function(){},tf.prototype.outputDefined=function(){return!1},tf.prototype.serialize=function(){return["var",this.name]};var _u=function(v,j,Q,Te,je){j===void 0&&(j=[]),Te===void 0&&(Te=new Nl),je===void 0&&(je=[]),this.registry=v,this.path=j,this.key=j.map(function(Ye){return"["+Ye+"]"}).join(""),this.scope=Te,this.errors=je,this.expectedType=Q};_u.prototype.parse=function(v,j,Q,Te,je){return je===void 0&&(je={}),j?this.concat(j,Q,Te)._parse(v,je):this._parse(v,je)},_u.prototype._parse=function(v,j){(v===null||typeof v=="string"||typeof v=="boolean"||typeof v=="number")&&(v=["literal",v]);function Q(Tr,Br,ui){return ui==="assert"?new Uc(Br,[Tr]):ui==="coerce"?new ll(Br,[Tr]):Tr}if(Array.isArray(v)){if(v.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Te=v[0];if(typeof Te!="string")return this.error("Expression name must be a string, but found "+typeof Te+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var je=this.registry[Te];if(je){var Ye=je.parse(v,this);if(!Ye)return null;if(this.expectedType){var st=this.expectedType,Ut=Ye.type;if((st.kind==="string"||st.kind==="number"||st.kind==="boolean"||st.kind==="object"||st.kind==="array")&&Ut.kind==="value")Ye=Q(Ye,st,j.typeAnnotation||"assert");else if((st.kind==="color"||st.kind==="formatted"||st.kind==="resolvedImage")&&(Ut.kind==="value"||Ut.kind==="string"))Ye=Q(Ye,st,j.typeAnnotation||"coerce");else if(this.checkSubtype(st,Ut))return null}if(!(Ye instanceof hl)&&Ye.type.kind!=="resolvedImage"&&jh(Ye)){var ir=new jl;try{Ye=new hl(Ye.type,Ye.evaluate(ir))}catch(Tr){return this.error(Tr.message),null}}return Ye}return this.error('Unknown expression "'+Te+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof v>"u"?this.error("'undefined' value invalid. Use null instead."):typeof v=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof v+" instead.")},_u.prototype.concat=function(v,j,Q){var Te=typeof v=="number"?this.path.concat(v):this.path,je=Q?this.scope.concat(Q):this.scope;return new _u(this.registry,Te,j||null,je,this.errors)},_u.prototype.error=function(v){for(var j=[],Q=arguments.length-1;Q-- >0;)j[Q]=arguments[Q+1];var Te=""+this.key+j.map(function(je){return"["+je+"]"}).join("");this.errors.push(new pl(Te,v))},_u.prototype.checkSubtype=function(v,j){var Q=Ah(v,j);return Q&&this.error(Q),Q};function jh(v){if(v instanceof tf)return jh(v.boundExpression);if(v instanceof os&&v.name==="error"||v instanceof yh||v instanceof Yc)return!1;var j=v instanceof ll||v instanceof Uc,Q=!0;return v.eachChild(function(Te){j?Q=Q&&jh(Te):Q=Q&&Te instanceof hl}),Q?md(v)&&Xc(v,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Fc(v,j){for(var Q=v.length-1,Te=0,je=Q,Ye=0,st,Ut;Te<=je;)if(Ye=Math.floor((Te+je)/2),st=v[Ye],Ut=v[Ye+1],st<=j){if(Ye===Q||jj)je=Ye-1;else throw new ru("Input is not a number.");return 0}var Jc=function(v,j,Q){this.type=v,this.input=j,this.labels=[],this.outputs=[];for(var Te=0,je=Q;Te=st)return j.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',ir);var Br=j.parse(Ut,Tr,je);if(!Br)return null;je=je||Br.type,Te.push([st,Br])}return new Jc(je,Q,Te)},Jc.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Te=this.input.evaluate(v);if(Te<=j[0])return Q[0].evaluate(v);var je=j.length;if(Te>=j[je-1])return Q[je-1].evaluate(v);var Ye=Fc(j,Te);return Q[Ye].evaluate(v)},Jc.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j0&&v.push(this.labels[j]),v.push(this.outputs[j].serialize());return v};function Eu(v,j,Q){return v*(1-Q)+j*Q}function xf(v,j,Q){return new Vl(Eu(v.r,j.r,Q),Eu(v.g,j.g,Q),Eu(v.b,j.b,Q),Eu(v.a,j.a,Q))}function Eh(v,j,Q){return v.map(function(Te,je){return Eu(Te,j[je],Q)})}var rf=Object.freeze({__proto__:null,number:Eu,color:xf,array:Eh}),Uf=.95047,Qd=1,Sp=1.08883,bf=4/29,$f=6/29,zc=3*$f*$f,wf=$f*$f*$f,ch=Math.PI/180,kf=180/Math.PI;function Hf(v){return v>wf?Math.pow(v,1/3):v/zc+bf}function Lh(v){return v>$f?v*v*v:zc*(v-bf)}function Lu(v){return 255*(v<=.0031308?12.92*v:1.055*Math.pow(v,1/2.4)-.055)}function Uh(v){return v/=255,v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)}function Qc(v){var j=Uh(v.r),Q=Uh(v.g),Te=Uh(v.b),je=Hf((.4124564*j+.3575761*Q+.1804375*Te)/Uf),Ye=Hf((.2126729*j+.7151522*Q+.072175*Te)/Qd),st=Hf((.0193339*j+.119192*Q+.9503041*Te)/Sp);return{l:116*Ye-16,a:500*(je-Ye),b:200*(Ye-st),alpha:v.a}}function Id(v){var j=(v.l+16)/116,Q=isNaN(v.a)?j:j+v.a/500,Te=isNaN(v.b)?j:j-v.b/200;return j=Qd*Lh(j),Q=Uf*Lh(Q),Te=Sp*Lh(Te),new Vl(Lu(3.2404542*Q-1.5371385*j-.4985314*Te),Lu(-.969266*Q+1.8760108*j+.041556*Te),Lu(.0556434*Q-.2040259*j+1.0572252*Te),v.alpha)}function Cu(v,j,Q){return{l:Eu(v.l,j.l,Q),a:Eu(v.a,j.a,Q),b:Eu(v.b,j.b,Q),alpha:Eu(v.alpha,j.alpha,Q)}}function Df(v){var j=Qc(v),Q=j.l,Te=j.a,je=j.b,Ye=Math.atan2(je,Te)*kf;return{h:Ye<0?Ye+360:Ye,c:Math.sqrt(Te*Te+je*je),l:Q,alpha:v.a}}function nf(v){var j=v.h*ch,Q=v.c,Te=v.l;return Id({l:Te,a:Math.cos(j)*Q,b:Math.sin(j)*Q,alpha:v.alpha})}function hh(v,j,Q){var Te=j-v;return v+Q*(Te>180||Te<-180?Te-360*Math.round(Te/360):Te)}function pf(v,j,Q){return{h:hh(v.h,j.h,Q),c:Eu(v.c,j.c,Q),l:Eu(v.l,j.l,Q),alpha:Eu(v.alpha,j.alpha,Q)}}var af={forward:Qc,reverse:Id,interpolate:Cu},zf={forward:Df,reverse:nf,interpolate:pf},ep=Object.freeze({__proto__:null,lab:af,hcl:zf}),Ac=function(v,j,Q,Te,je){this.type=v,this.operator=j,this.interpolation=Q,this.input=Te,this.labels=[],this.outputs=[];for(var Ye=0,st=je;Ye1}))return j.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Te={name:"cubic-bezier",controlPoints:Ut}}else return j.error("Unknown interpolation type "+String(Te[0]),1,0);if(v.length-1<4)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if((v.length-1)%2!==0)return j.error("Expected an even number of arguments.");if(je=j.parse(je,2,bo),!je)return null;var ir=[],Tr=null;Q==="interpolate-hcl"||Q==="interpolate-lab"?Tr=pu:j.expectedType&&j.expectedType.kind!=="value"&&(Tr=j.expectedType);for(var Br=0;Br=ui)return j.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Ii);var zn=j.parse(_i,tn,Tr);if(!zn)return null;Tr=Tr||zn.type,ir.push([ui,zn])}return Tr.kind!=="number"&&Tr.kind!=="color"&&!(Tr.kind==="array"&&Tr.itemType.kind==="number"&&typeof Tr.N=="number")?j.error("Type "+hu(Tr)+" is not interpolatable."):new Ac(Tr,Q,Te,je,ir)},Ac.prototype.evaluate=function(v){var j=this.labels,Q=this.outputs;if(j.length===1)return Q[0].evaluate(v);var Te=this.input.evaluate(v);if(Te<=j[0])return Q[0].evaluate(v);var je=j.length;if(Te>=j[je-1])return Q[je-1].evaluate(v);var Ye=Fc(j,Te),st=j[Ye],Ut=j[Ye+1],ir=Ac.interpolationFactor(this.interpolation,Te,st,Ut),Tr=Q[Ye].evaluate(v),Br=Q[Ye+1].evaluate(v);return this.operator==="interpolate"?rf[this.type.kind.toLowerCase()](Tr,Br,ir):this.operator==="interpolate-hcl"?zf.reverse(zf.interpolate(zf.forward(Tr),zf.forward(Br),ir)):af.reverse(af.interpolate(af.forward(Tr),af.forward(Br),ir))},Ac.prototype.eachChild=function(v){v(this.input);for(var j=0,Q=this.outputs;j=Q.length)throw new ru("Array index out of bounds: "+j+" > "+(Q.length-1)+".");if(j!==Math.floor(j))throw new ru("Array index must be an integer, but found "+j+" instead.");return Q[j]},Ph.prototype.eachChild=function(v){v(this.index),v(this.input)},Ph.prototype.outputDefined=function(){return!1},Ph.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zu=function(v,j){this.type=Rs,this.needle=v,this.haystack=j};Zu.parse=function(v,j){if(v.length!==3)return j.error("Expected 2 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,ls);return!Q||!Te?null:uh(Q.type,[Rs,Ps,bo,Gu,ls])?new Zu(Q,Te):j.error("Expected first argument to be of type boolean, string, number or null, but found "+hu(Q.type)+" instead")},Zu.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!Q)return!1;if(!gh(j,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+hu(yu(j))+" instead.");if(!gh(Q,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+hu(yu(Q))+" instead.");return Q.indexOf(j)>=0},Zu.prototype.eachChild=function(v){v(this.needle),v(this.haystack)},Zu.prototype.outputDefined=function(){return!0},Zu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fu=function(v,j,Q){this.type=bo,this.needle=v,this.haystack=j,this.fromIndex=Q};fu.parse=function(v,j){if(v.length<=2||v.length>=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,ls);if(!Q||!Te)return null;if(!uh(Q.type,[Rs,Ps,bo,Gu,ls]))return j.error("Expected first argument to be of type boolean, string, number or null, but found "+hu(Q.type)+" instead");if(v.length===4){var je=j.parse(v[3],3,bo);return je?new fu(Q,Te,je):null}else return new fu(Q,Te)},fu.prototype.evaluate=function(v){var j=this.needle.evaluate(v),Q=this.haystack.evaluate(v);if(!gh(j,["boolean","string","number","null"]))throw new ru("Expected first argument to be of type boolean, string, number or null, but found "+hu(yu(j))+" instead.");if(!gh(Q,["string","array"]))throw new ru("Expected second argument to be of type array or string, but found "+hu(yu(Q))+" instead.");if(this.fromIndex){var Te=this.fromIndex.evaluate(v);return Q.indexOf(j,Te)}return Q.indexOf(j)},fu.prototype.eachChild=function(v){v(this.needle),v(this.haystack),this.fromIndex&&v(this.fromIndex)},fu.prototype.outputDefined=function(){return!1},fu.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var v=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),v]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ih=function(v,j,Q,Te,je,Ye){this.inputType=v,this.type=j,this.input=Q,this.cases=Te,this.outputs=je,this.otherwise=Ye};Ih.parse=function(v,j){if(v.length<5)return j.error("Expected at least 4 arguments, but found only "+(v.length-1)+".");if(v.length%2!==1)return j.error("Expected an even number of arguments.");var Q,Te;j.expectedType&&j.expectedType.kind!=="value"&&(Te=j.expectedType);for(var je={},Ye=[],st=2;stNumber.MAX_SAFE_INTEGER)return Tr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof _i=="number"&&Math.floor(_i)!==_i)return Tr.error("Numeric branch labels must be integer values.");if(!Q)Q=yu(_i);else if(Tr.checkSubtype(Q,yu(_i)))return null;if(typeof je[String(_i)]<"u")return Tr.error("Branch labels must be unique.");je[String(_i)]=Ye.length}var Ii=j.parse(ir,st,Te);if(!Ii)return null;Te=Te||Ii.type,Ye.push(Ii)}var tn=j.parse(v[1],1,ls);if(!tn)return null;var zn=j.parse(v[v.length-1],v.length-1,Te);return!zn||tn.type.kind!=="value"&&j.concat(1).checkSubtype(Q,tn.type)?null:new Ih(Q,Te,tn,je,Ye,zn)},Ih.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=yu(j)===this.inputType&&this.outputs[this.cases[j]]||this.otherwise;return Q.evaluate(v)},Ih.prototype.eachChild=function(v){v(this.input),this.outputs.forEach(v),v(this.otherwise)},Ih.prototype.outputDefined=function(){return this.outputs.every(function(v){return v.outputDefined()})&&this.otherwise.outputDefined()},Ih.prototype.serialize=function(){for(var v=this,j=["match",this.input.serialize()],Q=Object.keys(this.cases).sort(),Te=[],je={},Ye=0,st=Q;Ye=5)return j.error("Expected 3 or 4 arguments, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1,ls),Te=j.parse(v[2],2,bo);if(!Q||!Te)return null;if(!uh(Q.type,[lu(ls),Ps,ls]))return j.error("Expected first argument to be of type array or string, but found "+hu(Q.type)+" instead");if(v.length===4){var je=j.parse(v[3],3,bo);return je?new Dh(Q.type,Q,Te,je):null}else return new Dh(Q.type,Q,Te)},Dh.prototype.evaluate=function(v){var j=this.input.evaluate(v),Q=this.beginIndex.evaluate(v);if(!gh(j,["string","array"]))throw new ru("Expected first argument to be of type array or string, but found "+hu(yu(j))+" instead.");if(this.endIndex){var Te=this.endIndex.evaluate(v);return j.slice(Q,Te)}return j.slice(Q)},Dh.prototype.eachChild=function(v){v(this.input),v(this.beginIndex),this.endIndex&&v(this.endIndex)},Dh.prototype.outputDefined=function(){return!1},Dh.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var v=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),v]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function sd(v,j){return v==="=="||v==="!="?j.kind==="boolean"||j.kind==="string"||j.kind==="number"||j.kind==="null"||j.kind==="value":j.kind==="string"||j.kind==="number"||j.kind==="value"}function wr(v,j,Q){return j===Q}function Xr(v,j,Q){return j!==Q}function Ni(v,j,Q){return jQ}function hn(v,j,Q){return j<=Q}function Pn(v,j,Q){return j>=Q}function pa(v,j,Q,Te){return Te.compare(j,Q)===0}function Ea(v,j,Q,Te){return!pa(v,j,Q,Te)}function Ka(v,j,Q,Te){return Te.compare(j,Q)<0}function oo(v,j,Q,Te){return Te.compare(j,Q)>0}function wa(v,j,Q,Te){return Te.compare(j,Q)<=0}function Va(v,j,Q,Te){return Te.compare(j,Q)>=0}function Oa(v,j,Q){var Te=v!=="=="&&v!=="!=";return function(){function je(Ye,st,Ut){this.type=Rs,this.lhs=Ye,this.rhs=st,this.collator=Ut,this.hasUntypedArgument=Ye.type.kind==="value"||st.type.kind==="value"}return je.parse=function(Ye,st){if(Ye.length!==3&&Ye.length!==4)return st.error("Expected two or three arguments.");var Ut=Ye[0],ir=st.parse(Ye[1],1,ls);if(!ir)return null;if(!sd(Ut,ir.type))return st.concat(1).error('"'+Ut+`" comparisons are not supported for type '`+hu(ir.type)+"'.");var Tr=st.parse(Ye[2],2,ls);if(!Tr)return null;if(!sd(Ut,Tr.type))return st.concat(2).error('"'+Ut+`" comparisons are not supported for type '`+hu(Tr.type)+"'.");if(ir.type.kind!==Tr.type.kind&&ir.type.kind!=="value"&&Tr.type.kind!=="value")return st.error("Cannot compare types '"+hu(ir.type)+"' and '"+hu(Tr.type)+"'.");Te&&(ir.type.kind==="value"&&Tr.type.kind!=="value"?ir=new Uc(Tr.type,[ir]):ir.type.kind!=="value"&&Tr.type.kind==="value"&&(Tr=new Uc(ir.type,[Tr])));var Br=null;if(Ye.length===4){if(ir.type.kind!=="string"&&Tr.type.kind!=="string"&&ir.type.kind!=="value"&&Tr.type.kind!=="value")return st.error("Cannot use collator to compare non-string types.");if(Br=st.parse(Ye[3],3,ic),!Br)return null}return new je(ir,Tr,Br)},je.prototype.evaluate=function(Ye){var st=this.lhs.evaluate(Ye),Ut=this.rhs.evaluate(Ye);if(Te&&this.hasUntypedArgument){var ir=yu(st),Tr=yu(Ut);if(ir.kind!==Tr.kind||!(ir.kind==="string"||ir.kind==="number"))throw new ru('Expected arguments for "'+v+'" to be (string, string) or (number, number), but found ('+ir.kind+", "+Tr.kind+") instead.")}if(this.collator&&!Te&&this.hasUntypedArgument){var Br=yu(st),ui=yu(Ut);if(Br.kind!=="string"||ui.kind!=="string")return j(Ye,st,Ut)}return this.collator?Q(Ye,st,Ut,this.collator.evaluate(Ye)):j(Ye,st,Ut)},je.prototype.eachChild=function(Ye){Ye(this.lhs),Ye(this.rhs),this.collator&&Ye(this.collator)},je.prototype.outputDefined=function(){return!0},je.prototype.serialize=function(){var Ye=[v];return this.eachChild(function(st){Ye.push(st.serialize())}),Ye},je}()}var fa=Oa("==",wr,pa),vo=Oa("!=",Xr,Ea),hs=Oa("<",Ni,Ka),rs=Oa(">",Ai,oo),ps=Oa("<=",hn,wa),xs=Oa(">=",Pn,Va),_o=function(v,j,Q,Te,je){this.type=Ps,this.number=v,this.locale=j,this.currency=Q,this.minFractionDigits=Te,this.maxFractionDigits=je};_o.parse=function(v,j){if(v.length!==3)return j.error("Expected two arguments.");var Q=j.parse(v[1],1,bo);if(!Q)return null;var Te=v[2];if(typeof Te!="object"||Array.isArray(Te))return j.error("NumberFormat options argument must be an object.");var je=null;if(Te.locale&&(je=j.parse(Te.locale,1,Ps),!je))return null;var Ye=null;if(Te.currency&&(Ye=j.parse(Te.currency,1,Ps),!Ye))return null;var st=null;if(Te["min-fraction-digits"]&&(st=j.parse(Te["min-fraction-digits"],1,bo),!st))return null;var Ut=null;return Te["max-fraction-digits"]&&(Ut=j.parse(Te["max-fraction-digits"],1,bo),!Ut)?null:new _o(Q,je,Ye,st,Ut)},_o.prototype.evaluate=function(v){return new Intl.NumberFormat(this.locale?this.locale.evaluate(v):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(v):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(v):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(v):void 0}).format(this.number.evaluate(v))},_o.prototype.eachChild=function(v){v(this.number),this.locale&&v(this.locale),this.currency&&v(this.currency),this.minFractionDigits&&v(this.minFractionDigits),this.maxFractionDigits&&v(this.maxFractionDigits)},_o.prototype.outputDefined=function(){return!1},_o.prototype.serialize=function(){var v={};return this.locale&&(v.locale=this.locale.serialize()),this.currency&&(v.currency=this.currency.serialize()),this.minFractionDigits&&(v["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(v["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),v]};var no=function(v){this.type=bo,this.input=v};no.parse=function(v,j){if(v.length!==2)return j.error("Expected 1 argument, but found "+(v.length-1)+" instead.");var Q=j.parse(v[1],1);return Q?Q.type.kind!=="array"&&Q.type.kind!=="string"&&Q.type.kind!=="value"?j.error("Expected argument of type string or array, but found "+hu(Q.type)+" instead."):new no(Q):null},no.prototype.evaluate=function(v){var j=this.input.evaluate(v);if(typeof j=="string"||Array.isArray(j))return j.length;throw new ru("Expected value to be of type string or array, but found "+hu(yu(j))+" instead.")},no.prototype.eachChild=function(v){v(this.input)},no.prototype.outputDefined=function(){return!1},no.prototype.serialize=function(){var v=["length"];return this.eachChild(function(j){v.push(j.serialize())}),v};var ws={"==":fa,"!=":vo,">":rs,"<":hs,">=":xs,"<=":ps,array:Uc,at:Ph,boolean:Uc,case:Tf,coalesce:fh,collator:yh,format:Jh,image:Mu,in:Zu,"index-of":fu,interpolate:Ac,"interpolate-hcl":Ac,"interpolate-lab":Ac,length:no,let:$h,literal:hl,match:Ih,number:Uc,"number-format":_o,object:Uc,slice:Dh,step:Jc,string:Uc,"to-boolean":ll,"to-color":ll,"to-number":ll,"to-string":ll,var:tf,within:Yc};function ul(v,j){var Q=j[0],Te=j[1],je=j[2],Ye=j[3];Q=Q.evaluate(v),Te=Te.evaluate(v),je=je.evaluate(v);var st=Ye?Ye.evaluate(v):1,Ut=bc(Q,Te,je,st);if(Ut)throw new ru(Ut);return new Vl(Q/255*st,Te/255*st,je/255*st,st)}function Ul(v,j){return v in j}function mu(v,j){var Q=j[v];return typeof Q>"u"?null:Q}function Ql(v,j,Q,Te){for(;Q<=Te;){var je=Q+Te>>1;if(j[je]===v)return!0;j[je]>v?Te=je-1:Q=je+1}return!1}function gu(v){return{type:v}}os.register(ws,{error:[Ru,[Ps],function(v,j){var Q=j[0];throw new ru(Q.evaluate(v))}],typeof:[Ps,[ls],function(v,j){var Q=j[0];return hu(yu(Q.evaluate(v)))}],"to-rgba":[lu(bo,4),[pu],function(v,j){var Q=j[0];return Q.evaluate(v).toArray()}],rgb:[pu,[bo,bo,bo],ul],rgba:[pu,[bo,bo,bo,bo],ul],has:{type:Rs,overloads:[[[Ps],function(v,j){var Q=j[0];return Ul(Q.evaluate(v),v.properties())}],[[Ps,bl],function(v,j){var Q=j[0],Te=j[1];return Ul(Q.evaluate(v),Te.evaluate(v))}]]},get:{type:ls,overloads:[[[Ps],function(v,j){var Q=j[0];return mu(Q.evaluate(v),v.properties())}],[[Ps,bl],function(v,j){var Q=j[0],Te=j[1];return mu(Q.evaluate(v),Te.evaluate(v))}]]},"feature-state":[ls,[Ps],function(v,j){var Q=j[0];return mu(Q.evaluate(v),v.featureState||{})}],properties:[bl,[],function(v){return v.properties()}],"geometry-type":[Ps,[],function(v){return v.geometryType()}],id:[ls,[],function(v){return v.id()}],zoom:[bo,[],function(v){return v.globals.zoom}],"heatmap-density":[bo,[],function(v){return v.globals.heatmapDensity||0}],"line-progress":[bo,[],function(v){return v.globals.lineProgress||0}],accumulated:[ls,[],function(v){return v.globals.accumulated===void 0?null:v.globals.accumulated}],"+":[bo,gu(bo),function(v,j){for(var Q=0,Te=0,je=j;Te":[Rs,[Ps,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je>Ye}],"filter-id->":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te>je}],"filter-<=":[Rs,[Ps,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je<=Ye}],"filter-id-<=":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te<=je}],"filter->=":[Rs,[Ps,ls],function(v,j){var Q=j[0],Te=j[1],je=v.properties()[Q.value],Ye=Te.value;return typeof je==typeof Ye&&je>=Ye}],"filter-id->=":[Rs,[ls],function(v,j){var Q=j[0],Te=v.id(),je=Q.value;return typeof Te==typeof je&&Te>=je}],"filter-has":[Rs,[ls],function(v,j){var Q=j[0];return Q.value in v.properties()}],"filter-has-id":[Rs,[],function(v){return v.id()!==null&&v.id()!==void 0}],"filter-type-in":[Rs,[lu(Ps)],function(v,j){var Q=j[0];return Q.value.indexOf(v.geometryType())>=0}],"filter-id-in":[Rs,[lu(ls)],function(v,j){var Q=j[0];return Q.value.indexOf(v.id())>=0}],"filter-in-small":[Rs,[Ps,lu(ls)],function(v,j){var Q=j[0],Te=j[1];return Te.value.indexOf(v.properties()[Q.value])>=0}],"filter-in-large":[Rs,[Ps,lu(ls)],function(v,j){var Q=j[0],Te=j[1];return Ql(v.properties()[Q.value],Te.value,0,Te.value.length-1)}],all:{type:Rs,overloads:[[[Rs,Rs],function(v,j){var Q=j[0],Te=j[1];return Q.evaluate(v)&&Te.evaluate(v)}],[gu(Rs),function(v,j){for(var Q=0,Te=j;Q-1}function Ho(v){return!!v.expression&&v.expression.interpolated}function Ds(v){return v instanceof Number?"number":v instanceof String?"string":v instanceof Boolean?"boolean":Array.isArray(v)?"array":v===null?"null":typeof v}function iu(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function Wl(v){return v}function Mc(v,j){var Q=j.type==="color",Te=v.stops&&typeof v.stops[0][0]=="object",je=Te||v.property!==void 0,Ye=Te||!je,st=v.type||(Ho(j)?"exponential":"interval");if(Q&&(v=su({},v),v.stops&&(v.stops=v.stops.map(function(Yo){return[Yo[0],Vl.parse(Yo[1])]})),v.default?v.default=Vl.parse(v.default):v.default=Vl.parse(j.default)),v.colorSpace&&v.colorSpace!=="rgb"&&!ep[v.colorSpace])throw new Error("Unknown color space: "+v.colorSpace);var Ut,ir,Tr;if(st==="exponential")Ut=th;else if(st==="interval")Ut=Hh;else if(st==="categorical"){Ut=$c,ir=Object.create(null);for(var Br=0,ui=v.stops;Br=v.stops[Te-1][0])return v.stops[Te-1][1];var je=Fc(v.stops.map(function(Ye){return Ye[0]}),Q);return v.stops[je][1]}function th(v,j,Q){var Te=v.base!==void 0?v.base:1;if(Ds(Q)!=="number")return eh(v.default,j.default);var je=v.stops.length;if(je===1||Q<=v.stops[0][0])return v.stops[0][1];if(Q>=v.stops[je-1][0])return v.stops[je-1][1];var Ye=Fc(v.stops.map(function(ui){return ui[0]}),Q),st=Wu(Q,Te,v.stops[Ye][0],v.stops[Ye+1][0]),Ut=v.stops[Ye][1],ir=v.stops[Ye+1][1],Tr=rf[j.type]||Wl;if(v.colorSpace&&v.colorSpace!=="rgb"){var Br=ep[v.colorSpace];Tr=function(ui,_i){return Br.reverse(Br.interpolate(Br.forward(ui),Br.forward(_i),st))}}return typeof Ut.evaluate=="function"?{evaluate:function(){for(var ui=[],_i=arguments.length;_i--;)ui[_i]=arguments[_i];var Ii=Ut.evaluate.apply(void 0,ui),tn=ir.evaluate.apply(void 0,ui);if(!(Ii===void 0||tn===void 0))return Tr(Ii,tn,st)}}:Tr(Ut,ir,st)}function Vh(v,j,Q){return j.type==="color"?Q=Vl.parse(Q):j.type==="formatted"?Q=xc.fromString(Q.toString()):j.type==="resolvedImage"?Q=mc.fromString(Q.toString()):Ds(Q)!==j.type&&(j.type!=="enum"||!j.values[Q])&&(Q=void 0),eh(Q,v.default,j.default)}function Wu(v,j,Q,Te){var je=Te-Q,Ye=v-Q;return je===0?0:j===1?Ye/je:(Math.pow(j,Ye)-1)/(Math.pow(j,je)-1)}var Wh=function(v,j){this.expression=v,this._warningHistory={},this._evaluator=new jl,this._defaultValue=j?Fe(j):null,this._enumValues=j&&j.type==="enum"?j.values:null};Wh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._evaluator.globals=v,this._evaluator.feature=j,this._evaluator.featureState=Q,this._evaluator.canonical=Te,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ye,this.expression.evaluate(this._evaluator)},Wh.prototype.evaluate=function(v,j,Q,Te,je,Ye){this._evaluator.globals=v,this._evaluator.feature=j||null,this._evaluator.featureState=Q||null,this._evaluator.canonical=Te,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ye||null;try{var st=this.expression.evaluate(this._evaluator);if(st==null||typeof st=="number"&&st!==st)return this._defaultValue;if(this._enumValues&&!(st in this._enumValues))throw new ru("Expected value to be one of "+Object.keys(this._enumValues).map(function(Ut){return JSON.stringify(Ut)}).join(", ")+", but found "+JSON.stringify(st)+" instead.");return st}catch(Ut){return this._warningHistory[Ut.message]||(this._warningHistory[Ut.message]=!0,typeof console<"u"&&console.warn(Ut.message)),this._defaultValue}};function cs(v){return Array.isArray(v)&&v.length>0&&typeof v[0]=="string"&&v[0]in ws}function Fs(v,j){var Q=new _u(ws,[],j?Ie(j):void 0),Te=Q.parse(v,void 0,void 0,void 0,j&&j.type==="string"?{typeAnnotation:"coerce"}:void 0);return Te?Cl(new Wh(Te,j)):ec(Q.errors)}var rh=function(v,j){this.kind=v,this._styleExpression=j,this.isStateDependent=v!=="constant"&&!Vu(j.expression)};rh.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Te,je,Ye)},rh.prototype.evaluate=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluate(v,j,Q,Te,je,Ye)};var tc=function(v,j,Q,Te){this.kind=v,this.zoomStops=Q,this._styleExpression=j,this.isStateDependent=v!=="camera"&&!Vu(j.expression),this.interpolationType=Te};tc.prototype.evaluateWithoutErrorHandling=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluateWithoutErrorHandling(v,j,Q,Te,je,Ye)},tc.prototype.evaluate=function(v,j,Q,Te,je,Ye){return this._styleExpression.evaluate(v,j,Q,Te,je,Ye)},tc.prototype.interpolationFactor=function(v,j,Q){return this.interpolationType?Ac.interpolationFactor(this.interpolationType,v,j,Q):0};function ld(v,j){if(v=Fs(v,j),v.result==="error")return v;var Q=v.value.expression,Te=md(Q);if(!Te&&!$u(j))return ec([new pl("","data expressions not supported")]);var je=Xc(Q,["zoom"]);if(!je&&!xu(j))return ec([new pl("","zoom expressions not supported")]);var Ye=pe(Q);if(!Ye&&!je)return ec([new pl("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ye instanceof pl)return ec([Ye]);if(Ye instanceof Ac&&!Ho(j))return ec([new pl("",'"interpolate" expressions cannot be used with this property')]);if(!Ye)return Cl(Te?new rh("constant",v.value):new rh("source",v.value));var st=Ye instanceof Ac?Ye.interpolation:void 0;return Cl(Te?new tc("camera",v.value,Ye.labels,st):new tc("composite",v.value,Ye.labels,st))}var Ke=function(v,j){this._parameters=v,this._specification=j,su(this,Mc(this._parameters,this._specification))};Ke.deserialize=function(v){return new Ke(v._parameters,v._specification)},Ke.serialize=function(v){return{_parameters:v._parameters,_specification:v._specification}};function O(v,j){if(iu(v))return new Ke(v,j);if(cs(v)){var Q=ld(v,j);if(Q.result==="error")throw new Error(Q.value.map(function(je){return je.key+": "+je.message}).join(", "));return Q.value}else{var Te=v;return typeof v=="string"&&j.type==="color"&&(Te=Vl.parse(v)),{kind:"constant",evaluate:function(){return Te}}}}function pe(v){var j=null;if(v instanceof $h)j=pe(v.result);else if(v instanceof fh)for(var Q=0,Te=v.args;QTe.maximum?[new So(j,Q,Q+" is greater than the maximum value "+Te.maximum)]:[]}function tr(v){var j=v.valueSpec,Q=is(v.value.type),Te,je={},Ye,st,Ut=Q!=="categorical"&&v.value.property===void 0,ir=!Ut,Tr=Ds(v.value.stops)==="array"&&Ds(v.value.stops[0])==="array"&&Ds(v.value.stops[0][0])==="object",Br=qe({key:v.key,value:v.value,valueSpec:v.styleSpec.function,style:v.style,styleSpec:v.styleSpec,objectElementValidators:{stops:ui,default:tn}});return Q==="identity"&&Ut&&Br.push(new So(v.key,v.value,'missing required property "property"')),Q!=="identity"&&!v.value.stops&&Br.push(new So(v.key,v.value,'missing required property "stops"')),Q==="exponential"&&v.valueSpec.expression&&!Ho(v.valueSpec)&&Br.push(new So(v.key,v.value,"exponential functions not supported")),v.styleSpec.$version>=8&&(ir&&!$u(v.valueSpec)?Br.push(new So(v.key,v.value,"property functions not supported")):Ut&&!xu(v.valueSpec)&&Br.push(new So(v.key,v.value,"zoom functions not supported"))),(Q==="categorical"||Tr)&&v.value.property===void 0&&Br.push(new So(v.key,v.value,'"property" property is required')),Br;function ui(zn){if(Q==="identity")return[new So(zn.key,zn.value,'identity function may not have a "stops" property')];var ba=[],ma=zn.value;return ba=ba.concat(Mt({key:zn.key,value:ma,valueSpec:zn.valueSpec,style:zn.style,styleSpec:zn.styleSpec,arrayElementValidator:_i})),Ds(ma)==="array"&&ma.length===0&&ba.push(new So(zn.key,ma,"array must have at least one stop")),ba}function _i(zn){var ba=[],ma=zn.value,za=zn.key;if(Ds(ma)!=="array")return[new So(za,ma,"array expected, "+Ds(ma)+" found")];if(ma.length!==2)return[new So(za,ma,"array length 2 expected, length "+ma.length+" found")];if(Tr){if(Ds(ma[0])!=="object")return[new So(za,ma,"object expected, "+Ds(ma[0])+" found")];if(ma[0].zoom===void 0)return[new So(za,ma,"object stop key must have zoom")];if(ma[0].value===void 0)return[new So(za,ma,"object stop key must have value")];if(st&&st>is(ma[0].zoom))return[new So(za,ma[0].zoom,"stop zoom values must appear in ascending order")];is(ma[0].zoom)!==st&&(st=is(ma[0].zoom),Ye=void 0,je={}),ba=ba.concat(qe({key:za+"[0]",value:ma[0],valueSpec:{zoom:{}},style:zn.style,styleSpec:zn.styleSpec,objectElementValidators:{zoom:jt,value:Ii}}))}else ba=ba.concat(Ii({key:za+"[0]",value:ma[0],style:zn.style,styleSpec:zn.styleSpec},ma));return cs(tu(ma[1]))?ba.concat([new So(za+"[1]",ma[1],"expressions are not allowed in function stops.")]):ba.concat(Al({key:za+"[1]",value:ma[1],valueSpec:j,style:zn.style,styleSpec:zn.styleSpec}))}function Ii(zn,ba){var ma=Ds(zn.value),za=is(zn.value),Za=zn.value!==null?zn.value:ba;if(!Te)Te=ma;else if(ma!==Te)return[new So(zn.key,Za,ma+" stop domain type must match previous stop domain type "+Te)];if(ma!=="number"&&ma!=="string"&&ma!=="boolean")return[new So(zn.key,Za,"stop domain value must be a number, string, or boolean")];if(ma!=="number"&&Q!=="categorical"){var Pa="number expected, "+ma+" found";return $u(j)&&Q===void 0&&(Pa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new So(zn.key,Za,Pa)]}return Q==="categorical"&&ma==="number"&&(!isFinite(za)||Math.floor(za)!==za)?[new So(zn.key,Za,"integer expected, found "+za)]:Q!=="categorical"&&ma==="number"&&Ye!==void 0&&za=2&&v[1]!=="$id"&&v[1]!=="$type";case"in":return v.length>=3&&(typeof v[1]!="string"||Array.isArray(v[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return v.length!==3||Array.isArray(v[1])||Array.isArray(v[2]);case"any":case"all":for(var j=0,Q=v.slice(1);jj?1:0}function Lt(v){if(!Array.isArray(v))return!1;if(v[0]==="within")return!0;for(var j=1;j"||j==="<="||j===">="?Nt(v[1],v[2],j):j==="any"?Xt(v.slice(1)):j==="all"?["all"].concat(v.slice(1).map(Vt)):j==="none"?["all"].concat(v.slice(1).map(Vt).map(Zr)):j==="in"?Pr(v[1],v.slice(2)):j==="!in"?Zr(Pr(v[1],v.slice(2))):j==="has"?Hr(v[1]):j==="!has"?Zr(Hr(v[1])):j==="within"?v:!0;return Q}function Nt(v,j,Q){switch(v){case"$type":return["filter-type-"+Q,j];case"$id":return["filter-id-"+Q,j];default:return["filter-"+Q,v,j]}}function Xt(v){return["any"].concat(v.map(Vt))}function Pr(v,j){if(j.length===0)return!1;switch(v){case"$type":return["filter-type-in",["literal",j]];case"$id":return["filter-id-in",["literal",j]];default:return j.length>200&&!j.some(function(Q){return typeof Q!=typeof j[0]})?["filter-in-large",v,["literal",j.sort(Tt)]]:["filter-in-small",v,["literal",j]]}}function Hr(v){switch(v){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",v]}}function Zr(v){return["!",v]}function pi(v){return Vi(tu(v.value))?kr(su({},v,{expressionContext:"filter",valueSpec:{value:"boolean"}})):zi(v)}function zi(v){var j=v.value,Q=v.key;if(Ds(j)!=="array")return[new So(Q,j,"array expected, "+Ds(j)+" found")];var Te=v.styleSpec,je,Ye=[];if(j.length<1)return[new So(Q,j,"filter array must have at least 1 element")];switch(Ye=Ye.concat(Ti({key:Q+"[0]",value:j[0],valueSpec:Te.filter_operator,style:v.style,styleSpec:v.styleSpec})),is(j[0])){case"<":case"<=":case">":case">=":j.length>=2&&is(j[1])==="$type"&&Ye.push(new So(Q,j,'"$type" cannot be use with operator "'+j[0]+'"'));case"==":case"!=":j.length!==3&&Ye.push(new So(Q,j,'filter array for operator "'+j[0]+'" must have 3 elements'));case"in":case"!in":j.length>=2&&(je=Ds(j[1]),je!=="string"&&Ye.push(new So(Q+"[1]",j[1],"string expected, "+je+" found")));for(var st=2;st=Br[Ii+0]&&Te>=Br[Ii+1])?(st[_i]=!0,Ye.push(Tr[_i])):st[_i]=!1}}},ft.prototype._forEachCell=function(v,j,Q,Te,je,Ye,st,Ut){for(var ir=this._convertToCellCoord(v),Tr=this._convertToCellCoord(j),Br=this._convertToCellCoord(Q),ui=this._convertToCellCoord(Te),_i=ir;_i<=Br;_i++)for(var Ii=Tr;Ii<=ui;Ii++){var tn=this.d*Ii+_i;if(!(Ut&&!Ut(this._convertFromCellCoord(_i),this._convertFromCellCoord(Ii),this._convertFromCellCoord(_i+1),this._convertFromCellCoord(Ii+1)))&&je.call(this,v,j,Q,Te,tn,Ye,st,Ut))return}},ft.prototype._convertFromCellCoord=function(v){return(v-this.padding)/this.scale},ft.prototype._convertToCellCoord=function(v){return Math.max(0,Math.min(this.d-1,Math.floor(v*this.scale)+this.padding))},ft.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var v=this.cells,j=Ve+this.cells.length+1+1,Q=0,Te=0;Te=0)){var ui=v[Br];Tr[Br]=Ht[ir].shallow.indexOf(Br)>=0?ui:hi(ui,j)}v instanceof Error&&(Tr.message=v.message)}if(Tr.$name)throw new Error("$name property is reserved for worker serialization logic.");return ir!=="Object"&&(Tr.$name=ir),Tr}throw new Error("can't serialize object of type "+typeof v)}function Bi(v){if(v==null||typeof v=="boolean"||typeof v=="number"||typeof v=="string"||v instanceof Boolean||v instanceof Number||v instanceof String||v instanceof Date||v instanceof RegExp||Or(v)||mi(v)||ArrayBuffer.isView(v)||v instanceof Pt)return v;if(Array.isArray(v))return v.map(Bi);if(typeof v=="object"){var j=v.$name||"Object",Q=Ht[j],Te=Q.klass;if(!Te)throw new Error("can't deserialize unregistered class "+j);if(Te.deserialize)return Te.deserialize(v);for(var je=Object.create(Te.prototype),Ye=0,st=Object.keys(v);Ye=0?ir:Bi(ir)}}return je}throw new Error("can't deserialize object of type "+typeof v)}var Yi=function(){this.first=!0};Yi.prototype.update=function(v,j){var Q=Math.floor(v);return this.first?(this.first=!1,this.lastIntegerZoom=Q,this.lastIntegerZoomTime=0,this.lastZoom=v,this.lastFloorZoom=Q,!0):(this.lastFloorZoom>Q?(this.lastIntegerZoom=Q+1,this.lastIntegerZoomTime=j):this.lastFloorZoom=128&&v<=255},Arabic:function(v){return v>=1536&&v<=1791},"Arabic Supplement":function(v){return v>=1872&&v<=1919},"Arabic Extended-A":function(v){return v>=2208&&v<=2303},"Hangul Jamo":function(v){return v>=4352&&v<=4607},"Unified Canadian Aboriginal Syllabics":function(v){return v>=5120&&v<=5759},Khmer:function(v){return v>=6016&&v<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(v){return v>=6320&&v<=6399},"General Punctuation":function(v){return v>=8192&&v<=8303},"Letterlike Symbols":function(v){return v>=8448&&v<=8527},"Number Forms":function(v){return v>=8528&&v<=8591},"Miscellaneous Technical":function(v){return v>=8960&&v<=9215},"Control Pictures":function(v){return v>=9216&&v<=9279},"Optical Character Recognition":function(v){return v>=9280&&v<=9311},"Enclosed Alphanumerics":function(v){return v>=9312&&v<=9471},"Geometric Shapes":function(v){return v>=9632&&v<=9727},"Miscellaneous Symbols":function(v){return v>=9728&&v<=9983},"Miscellaneous Symbols and Arrows":function(v){return v>=11008&&v<=11263},"CJK Radicals Supplement":function(v){return v>=11904&&v<=12031},"Kangxi Radicals":function(v){return v>=12032&&v<=12255},"Ideographic Description Characters":function(v){return v>=12272&&v<=12287},"CJK Symbols and Punctuation":function(v){return v>=12288&&v<=12351},Hiragana:function(v){return v>=12352&&v<=12447},Katakana:function(v){return v>=12448&&v<=12543},Bopomofo:function(v){return v>=12544&&v<=12591},"Hangul Compatibility Jamo":function(v){return v>=12592&&v<=12687},Kanbun:function(v){return v>=12688&&v<=12703},"Bopomofo Extended":function(v){return v>=12704&&v<=12735},"CJK Strokes":function(v){return v>=12736&&v<=12783},"Katakana Phonetic Extensions":function(v){return v>=12784&&v<=12799},"Enclosed CJK Letters and Months":function(v){return v>=12800&&v<=13055},"CJK Compatibility":function(v){return v>=13056&&v<=13311},"CJK Unified Ideographs Extension A":function(v){return v>=13312&&v<=19903},"Yijing Hexagram Symbols":function(v){return v>=19904&&v<=19967},"CJK Unified Ideographs":function(v){return v>=19968&&v<=40959},"Yi Syllables":function(v){return v>=40960&&v<=42127},"Yi Radicals":function(v){return v>=42128&&v<=42191},"Hangul Jamo Extended-A":function(v){return v>=43360&&v<=43391},"Hangul Syllables":function(v){return v>=44032&&v<=55215},"Hangul Jamo Extended-B":function(v){return v>=55216&&v<=55295},"Private Use Area":function(v){return v>=57344&&v<=63743},"CJK Compatibility Ideographs":function(v){return v>=63744&&v<=64255},"Arabic Presentation Forms-A":function(v){return v>=64336&&v<=65023},"Vertical Forms":function(v){return v>=65040&&v<=65055},"CJK Compatibility Forms":function(v){return v>=65072&&v<=65103},"Small Form Variants":function(v){return v>=65104&&v<=65135},"Arabic Presentation Forms-B":function(v){return v>=65136&&v<=65279},"Halfwidth and Fullwidth Forms":function(v){return v>=65280&&v<=65519}};function ta(v){for(var j=0,Q=v;j=65097&&v<=65103)||Ji["CJK Compatibility Ideographs"](v)||Ji["CJK Compatibility"](v)||Ji["CJK Radicals Supplement"](v)||Ji["CJK Strokes"](v)||Ji["CJK Symbols and Punctuation"](v)&&!(v>=12296&&v<=12305)&&!(v>=12308&&v<=12319)&&v!==12336||Ji["CJK Unified Ideographs Extension A"](v)||Ji["CJK Unified Ideographs"](v)||Ji["Enclosed CJK Letters and Months"](v)||Ji["Hangul Compatibility Jamo"](v)||Ji["Hangul Jamo Extended-A"](v)||Ji["Hangul Jamo Extended-B"](v)||Ji["Hangul Jamo"](v)||Ji["Hangul Syllables"](v)||Ji.Hiragana(v)||Ji["Ideographic Description Characters"](v)||Ji.Kanbun(v)||Ji["Kangxi Radicals"](v)||Ji["Katakana Phonetic Extensions"](v)||Ji.Katakana(v)&&v!==12540||Ji["Halfwidth and Fullwidth Forms"](v)&&v!==65288&&v!==65289&&v!==65293&&!(v>=65306&&v<=65310)&&v!==65339&&v!==65341&&v!==65343&&!(v>=65371&&v<=65503)&&v!==65507&&!(v>=65512&&v<=65519)||Ji["Small Form Variants"](v)&&!(v>=65112&&v<=65118)&&!(v>=65123&&v<=65126)||Ji["Unified Canadian Aboriginal Syllabics"](v)||Ji["Unified Canadian Aboriginal Syllabics Extended"](v)||Ji["Vertical Forms"](v)||Ji["Yijing Hexagram Symbols"](v)||Ji["Yi Syllables"](v)||Ji["Yi Radicals"](v))}function aa(v){return!!(Ji["Latin-1 Supplement"](v)&&(v===167||v===169||v===174||v===177||v===188||v===189||v===190||v===215||v===247)||Ji["General Punctuation"](v)&&(v===8214||v===8224||v===8225||v===8240||v===8241||v===8251||v===8252||v===8258||v===8263||v===8264||v===8265||v===8273)||Ji["Letterlike Symbols"](v)||Ji["Number Forms"](v)||Ji["Miscellaneous Technical"](v)&&(v>=8960&&v<=8967||v>=8972&&v<=8991||v>=8996&&v<=9e3||v===9003||v>=9085&&v<=9114||v>=9150&&v<=9165||v===9167||v>=9169&&v<=9179||v>=9186&&v<=9215)||Ji["Control Pictures"](v)&&v!==9251||Ji["Optical Character Recognition"](v)||Ji["Enclosed Alphanumerics"](v)||Ji["Geometric Shapes"](v)||Ji["Miscellaneous Symbols"](v)&&!(v>=9754&&v<=9759)||Ji["Miscellaneous Symbols and Arrows"](v)&&(v>=11026&&v<=11055||v>=11088&&v<=11097||v>=11192&&v<=11243)||Ji["CJK Symbols and Punctuation"](v)||Ji.Katakana(v)||Ji["Private Use Area"](v)||Ji["CJK Compatibility Forms"](v)||Ji["Small Form Variants"](v)||Ji["Halfwidth and Fullwidth Forms"](v)||v===8734||v===8756||v===8757||v>=9984&&v<=10087||v>=10102&&v<=10131||v===65532||v===65533)}function vn(v){return!(Yn(v)||aa(v))}function Qa(v){return Ji.Arabic(v)||Ji["Arabic Supplement"](v)||Ji["Arabic Extended-A"](v)||Ji["Arabic Presentation Forms-A"](v)||Ji["Arabic Presentation Forms-B"](v)}function to(v){return v>=1424&&v<=2303||Ji["Arabic Presentation Forms-A"](v)||Ji["Arabic Presentation Forms-B"](v)}function yo(v,j){return!(!j&&to(v)||v>=2304&&v<=3583||v>=3840&&v<=4255||Ji.Khmer(v))}function jo(v){for(var j=0,Q=v;j-1&&(ts=Xo.error),ml&&ml(v)};function ac(){bu.fire(new ai("pluginStateChange",{pluginStatus:ts,pluginURL:ks}))}var bu=new Gr,Eo=function(){return ts},el=function(v){return v({pluginStatus:ts,pluginURL:ks}),bu.on("pluginStateChange",v),v},fl=function(v,j,Q){if(Q===void 0&&(Q=!1),ts===Xo.deferred||ts===Xo.loading||ts===Xo.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");ks=Re.resolveURL(v),ts=Xo.deferred,ml=j,ac(),Q||vu()},vu=function(){if(ts!==Xo.deferred||!ks)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ts=Xo.loading,ac(),ks&&Ui({url:ks},function(v){v?Dl(v):(ts=Xo.loaded,ac())})},nu={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ts===Xo.loaded||nu.applyArabicShaping!=null},isLoading:function(){return ts===Xo.loading},setState:function(v){ts=v.pluginStatus,ks=v.pluginURL},isParsed:function(){return nu.applyArabicShaping!=null&&nu.processBidirectionalText!=null&&nu.processStyledBidirectionalText!=null},getPluginURL:function(){return ks}},dh=function(){!nu.isLoading()&&!nu.isLoaded()&&Eo()==="deferred"&&vu()},Zl=function(v,j){this.zoom=v,j?(this.now=j.now,this.fadeDuration=j.fadeDuration,this.zoomHistory=j.zoomHistory,this.transition=j.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Yi,this.transition={})};Zl.prototype.isSupportedScript=function(v){return qo(v,nu.isLoaded())},Zl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Zl.prototype.getCrossfadeParameters=function(){var v=this.zoom,j=v-Math.floor(v),Q=this.crossFadingFactor();return v>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:j+(1-j)*Q}:{fromScale:.5,toScale:1,t:1-(1-Q)*j}};var cu=function(v,j){this.property=v,this.value=j,this.expression=O(j===void 0?v.specification.default:j,v.specification)};cu.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},cu.prototype.possiblyEvaluate=function(v,j,Q){return this.property.possiblyEvaluate(this,v,j,Q)};var zh=function(v){this.property=v,this.value=new cu(v,void 0)};zh.prototype.transitioned=function(v,j){return new Ir(this.property,this.value,j,I({},v.transition,this.transition),v.now)},zh.prototype.untransitioned=function(){return new Ir(this.property,this.value,null,{},0)};var St=function(v){this._properties=v,this._values=Object.create(v.defaultTransitionablePropertyValues)};St.prototype.getValue=function(v){return F(this._values[v].value.value)},St.prototype.setValue=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].value=new cu(this._values[v].property,j===null?void 0:F(j))},St.prototype.getTransition=function(v){return F(this._values[v].transition)},St.prototype.setTransition=function(v,j){this._values.hasOwnProperty(v)||(this._values[v]=new zh(this._values[v].property)),this._values[v].transition=F(j)||void 0},St.prototype.serialize=function(){for(var v={},j=0,Q=Object.keys(this._values);jthis.end)return this.prior=null,je;if(this.value.isDataDriven())return this.prior=null,je;if(TeYe.zoomHistory.lastIntegerZoom?{from:Q,to:Te}:{from:je,to:Te}},j.prototype.interpolate=function(Q){return Q},j}(Tn),ia=function(v){this.specification=v};ia.prototype.possiblyEvaluate=function(v,j,Q,Te){if(v.value!==void 0)if(v.expression.kind==="constant"){var je=v.expression.evaluate(j,null,{},Q,Te);return this._calculate(je,je,je,j)}else return this._calculate(v.expression.evaluate(new Zl(Math.floor(j.zoom-1),j)),v.expression.evaluate(new Zl(Math.floor(j.zoom),j)),v.expression.evaluate(new Zl(Math.floor(j.zoom+1),j)),j)},ia.prototype._calculate=function(v,j,Q,Te){var je=Te.zoom;return je>Te.zoomHistory.lastIntegerZoom?{from:v,to:j}:{from:Q,to:j}},ia.prototype.interpolate=function(v){return v};var La=function(v){this.specification=v};La.prototype.possiblyEvaluate=function(v,j,Q,Te){return!!v.expression.evaluate(j,null,{},Q,Te)},La.prototype.interpolate=function(){return!1};var ao=function(v){this.properties=v,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var j in v){var Q=v[j];Q.specification.overridable&&this.overridableProperties.push(j);var Te=this.defaultPropertyValues[j]=new cu(Q,void 0),je=this.defaultTransitionablePropertyValues[j]=new zh(Q);this.defaultTransitioningPropertyValues[j]=je.untransitioned(),this.defaultPossiblyEvaluatedValues[j]=Te.possiblyEvaluate({})}};dr("DataDrivenProperty",Tn),dr("DataConstantProperty",Oi),dr("CrossFadedDataDrivenProperty",ua),dr("CrossFadedProperty",ia),dr("ColorRampProperty",La);var Ya="-transition",da=function(v){function j(Q,Te){if(v.call(this),this.id=Q.id,this.type=Q.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},Q.type!=="custom"&&(Q=Q,this.metadata=Q.metadata,this.minzoom=Q.minzoom,this.maxzoom=Q.maxzoom,Q.type!=="background"&&(this.source=Q.source,this.sourceLayer=Q["source-layer"],this.filter=Q.filter),Te.layout&&(this._unevaluatedLayout=new Qi(Te.layout)),Te.paint)){this._transitionablePaint=new St(Te.paint);for(var je in Q.paint)this.setPaintProperty(je,Q.paint[je],{validate:!1});for(var Ye in Q.layout)this.setLayoutProperty(Ye,Q.layout[Ye],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new xn(Te.paint)}}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},j.prototype.getLayoutProperty=function(Q){return Q==="visibility"?this.visibility:this._unevaluatedLayout.getValue(Q)},j.prototype.setLayoutProperty=function(Q,Te,je){if(je===void 0&&(je={}),Te!=null){var Ye="layers."+this.id+".layout."+Q;if(this._validate(wc,Ye,Q,Te,je))return}if(Q==="visibility"){this.visibility=Te;return}this._unevaluatedLayout.setValue(Q,Te)},j.prototype.getPaintProperty=function(Q){return U(Q,Ya)?this._transitionablePaint.getTransition(Q.slice(0,-Ya.length)):this._transitionablePaint.getValue(Q)},j.prototype.setPaintProperty=function(Q,Te,je){if(je===void 0&&(je={}),Te!=null){var Ye="layers."+this.id+".paint."+Q;if(this._validate(nc,Ye,Q,Te,je))return!1}if(U(Q,Ya))return this._transitionablePaint.setTransition(Q.slice(0,-Ya.length),Te||void 0),!1;var st=this._transitionablePaint._values[Q],Ut=st.property.specification["property-type"]==="cross-faded-data-driven",ir=st.value.isDataDriven(),Tr=st.value;this._transitionablePaint.setValue(Q,Te),this._handleSpecialPaintPropertyUpdate(Q);var Br=this._transitionablePaint._values[Q].value,ui=Br.isDataDriven();return ui||ir||Ut||this._handleOverridablePaintPropertyUpdate(Q,Tr,Br)},j.prototype._handleSpecialPaintPropertyUpdate=function(Q){},j.prototype._handleOverridablePaintPropertyUpdate=function(Q,Te,je){return!1},j.prototype.isHidden=function(Q){return this.minzoom&&Q=this.maxzoom?!0:this.visibility==="none"},j.prototype.updateTransitions=function(Q){this._transitioningPaint=this._transitionablePaint.transitioned(Q,this._transitioningPaint)},j.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},j.prototype.recalculate=function(Q,Te){Q.getCrossfadeParameters&&(this._crossfadeParameters=Q.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(Q,void 0,Te)),this.paint=this._transitioningPaint.possiblyEvaluate(Q,void 0,Te)},j.prototype.serialize=function(){var Q={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(Q.layout=Q.layout||{},Q.layout.visibility=this.visibility),W(Q,function(Te,je){return Te!==void 0&&!(je==="layout"&&!Object.keys(Te).length)&&!(je==="paint"&&!Object.keys(Te).length)})},j.prototype._validate=function(Q,Te,je,Ye,st){return st===void 0&&(st={}),st&&st.validate===!1?!1:ih(this,Q.call(Js,{key:Te,layerType:this.type,objectKey:je,value:Ye,styleSpec:$a,style:{glyphs:!0,sprite:!0}}))},j.prototype.is3D=function(){return!1},j.prototype.isTileClipped=function(){return!1},j.prototype.hasOffscreenPass=function(){return!1},j.prototype.resize=function(){},j.prototype.isStateDependent=function(){for(var Q in this.paint._values){var Te=this.paint.get(Q);if(!(!(Te instanceof Cn)||!$u(Te.property.specification))&&(Te.value.kind==="source"||Te.value.kind==="composite")&&Te.value.isStateDependent)return!0}return!1},j}(Gr),jn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=function(v,j){this._structArray=v,this._pos1=j*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},an=128,Xn=5,Nn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Nn.serialize=function(v,j){return v._trim(),j&&(v.isTransferred=!0,j.push(v.arrayBuffer)),{length:v.length,arrayBuffer:v.arrayBuffer}},Nn.deserialize=function(v){var j=Object.create(this.prototype);return j.arrayBuffer=v.arrayBuffer,j.length=v.length,j.capacity=v.arrayBuffer.byteLength/j.bytesPerElement,j._refreshViews(),j},Nn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Nn.prototype.clear=function(){this.length=0},Nn.prototype.resize=function(v){this.reserve(v),this.length=v},Nn.prototype.reserve=function(v){if(v>this.capacity){this.capacity=Math.max(v,Math.floor(this.capacity*Xn),an),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var j=this.uint8;this._refreshViews(),j&&this.uint8.set(j)}},Nn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function bn(v,j){j===void 0&&(j=1);var Q=0,Te=0,je=v.map(function(st){var Ut=Na(st.type),ir=Q=ka(Q,Math.max(j,Ut)),Tr=st.components||1;return Te=Math.max(Te,Ut),Q+=Ut*Tr,{name:st.name,type:st.type,components:Tr,offset:ir}}),Ye=ka(Q,Math.max(Te,j));return{members:je,size:Ye,alignment:j}}function Na(v){return jn[v].BYTES_PER_ELEMENT}function ka(v,j){return Math.ceil(v/j)*j}var eo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.int16[Ye+0]=Te,this.int16[Ye+1]=je,Q},j}(Nn);eo.prototype.bytesPerElement=4,dr("StructArrayLayout2i4",eo);var Rn=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*4;return this.int16[Ut+0]=Te,this.int16[Ut+1]=je,this.int16[Ut+2]=Ye,this.int16[Ut+3]=st,Q},j}(Nn);Rn.prototype.bytesPerElement=8,dr("StructArrayLayout4i8",Rn);var wn=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*6;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.int16[Tr+2]=Ye,this.int16[Tr+3]=st,this.int16[Tr+4]=Ut,this.int16[Tr+5]=ir,Q},j}(Nn);wn.prototype.bytesPerElement=12,dr("StructArrayLayout2i4i12",wn);var ja=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*4,Br=Q*8;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.uint8[Br+4]=Ye,this.uint8[Br+5]=st,this.uint8[Br+6]=Ut,this.uint8[Br+7]=ir,Q},j}(Nn);ja.prototype.bytesPerElement=8,dr("StructArrayLayout2i4ub8",ja);var Aa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.float32[Ye+0]=Te,this.float32[Ye+1]=je,Q},j}(Nn);Aa.prototype.bytesPerElement=8,dr("StructArrayLayout2f8",Aa);var oa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui){var _i=this.length;return this.resize(_i+1),this.emplace(_i,Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i){var Ii=Q*10;return this.uint16[Ii+0]=Te,this.uint16[Ii+1]=je,this.uint16[Ii+2]=Ye,this.uint16[Ii+3]=st,this.uint16[Ii+4]=Ut,this.uint16[Ii+5]=ir,this.uint16[Ii+6]=Tr,this.uint16[Ii+7]=Br,this.uint16[Ii+8]=ui,this.uint16[Ii+9]=_i,Q},j}(Nn);oa.prototype.bytesPerElement=20,dr("StructArrayLayout10ui20",oa);var la=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii){var tn=this.length;return this.resize(tn+1),this.emplace(tn,Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn){var zn=Q*12;return this.int16[zn+0]=Te,this.int16[zn+1]=je,this.int16[zn+2]=Ye,this.int16[zn+3]=st,this.uint16[zn+4]=Ut,this.uint16[zn+5]=ir,this.uint16[zn+6]=Tr,this.uint16[zn+7]=Br,this.int16[zn+8]=ui,this.int16[zn+9]=_i,this.int16[zn+10]=Ii,this.int16[zn+11]=tn,Q},j}(Nn);la.prototype.bytesPerElement=24,dr("StructArrayLayout4i4ui4i24",la);var Da=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.float32[st+0]=Te,this.float32[st+1]=je,this.float32[st+2]=Ye,Q},j}(Nn);Da.prototype.bytesPerElement=12,dr("StructArrayLayout3f12",Da);var $o=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.uint32[je+0]=Te,Q},j}(Nn);$o.prototype.bytesPerElement=4,dr("StructArrayLayout1ul4",$o);var Do=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br){var ui=this.length;return this.resize(ui+1),this.emplace(ui,Q,Te,je,Ye,st,Ut,ir,Tr,Br)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui){var _i=Q*10,Ii=Q*5;return this.int16[_i+0]=Te,this.int16[_i+1]=je,this.int16[_i+2]=Ye,this.int16[_i+3]=st,this.int16[_i+4]=Ut,this.int16[_i+5]=ir,this.uint32[Ii+3]=Tr,this.uint16[_i+8]=Br,this.uint16[_i+9]=ui,Q},j}(Nn);Do.prototype.bytesPerElement=20,dr("StructArrayLayout6i1ul2ui20",Do);var Ia=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut){var ir=this.length;return this.resize(ir+1),this.emplace(ir,Q,Te,je,Ye,st,Ut)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Q*6;return this.int16[Tr+0]=Te,this.int16[Tr+1]=je,this.int16[Tr+2]=Ye,this.int16[Tr+3]=st,this.int16[Tr+4]=Ut,this.int16[Tr+5]=ir,Q},j}(Nn);Ia.prototype.bytesPerElement=12,dr("StructArrayLayout2i2i2i12",Ia);var qa=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st){var Ut=this.length;return this.resize(Ut+1),this.emplace(Ut,Q,Te,je,Ye,st)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut){var ir=Q*4,Tr=Q*8;return this.float32[ir+0]=Te,this.float32[ir+1]=je,this.float32[ir+2]=Ye,this.int16[Tr+6]=st,this.int16[Tr+7]=Ut,Q},j}(Nn);qa.prototype.bytesPerElement=16,dr("StructArrayLayout2f1f2i16",qa);var Co=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*12,ir=Q*3;return this.uint8[Ut+0]=Te,this.uint8[Ut+1]=je,this.float32[ir+1]=Ye,this.float32[ir+2]=st,Q},j}(Nn);Co.prototype.bytesPerElement=12,dr("StructArrayLayout2ub2f12",Co);var Ro=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.uint16[st+0]=Te,this.uint16[st+1]=je,this.uint16[st+2]=Ye,Q},j}(Nn);Ro.prototype.bytesPerElement=6,dr("StructArrayLayout3ui6",Ro);var us=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za){var Za=this.length;return this.resize(Za+1),this.emplace(Za,Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za,Za){var Pa=Q*24,co=Q*12,Lo=Q*48;return this.int16[Pa+0]=Te,this.int16[Pa+1]=je,this.uint16[Pa+2]=Ye,this.uint16[Pa+3]=st,this.uint32[co+2]=Ut,this.uint32[co+3]=ir,this.uint32[co+4]=Tr,this.uint16[Pa+10]=Br,this.uint16[Pa+11]=ui,this.uint16[Pa+12]=_i,this.float32[co+7]=Ii,this.float32[co+8]=tn,this.uint8[Lo+36]=zn,this.uint8[Lo+37]=ba,this.uint8[Lo+38]=ma,this.uint32[co+10]=za,this.int16[Pa+22]=Za,Q},j}(Nn);us.prototype.bytesPerElement=48,dr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",us);var Kl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za,Za,Pa,co,Lo,Ko,Yo,As,Ms,Hs,tl,yl){var Vs=this.length;return this.resize(Vs+1),this.emplace(Vs,Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za,Za,Pa,co,Lo,Ko,Yo,As,Ms,Hs,tl,yl)},j.prototype.emplace=function(Q,Te,je,Ye,st,Ut,ir,Tr,Br,ui,_i,Ii,tn,zn,ba,ma,za,Za,Pa,co,Lo,Ko,Yo,As,Ms,Hs,tl,yl,Vs){var Ks=Q*34,Ku=Q*17;return this.int16[Ks+0]=Te,this.int16[Ks+1]=je,this.int16[Ks+2]=Ye,this.int16[Ks+3]=st,this.int16[Ks+4]=Ut,this.int16[Ks+5]=ir,this.int16[Ks+6]=Tr,this.int16[Ks+7]=Br,this.uint16[Ks+8]=ui,this.uint16[Ks+9]=_i,this.uint16[Ks+10]=Ii,this.uint16[Ks+11]=tn,this.uint16[Ks+12]=zn,this.uint16[Ks+13]=ba,this.uint16[Ks+14]=ma,this.uint16[Ks+15]=za,this.uint16[Ks+16]=Za,this.uint16[Ks+17]=Pa,this.uint16[Ks+18]=co,this.uint16[Ks+19]=Lo,this.uint16[Ks+20]=Ko,this.uint16[Ks+21]=Yo,this.uint16[Ks+22]=As,this.uint32[Ku+12]=Ms,this.float32[Ku+13]=Hs,this.float32[Ku+14]=tl,this.float32[Ku+15]=yl,this.float32[Ku+16]=Vs,Q},j}(Nn);Kl.prototype.bytesPerElement=68,dr("StructArrayLayout8i15ui1ul4f68",Kl);var zl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.float32[je+0]=Te,Q},j}(Nn);zl.prototype.bytesPerElement=4,dr("StructArrayLayout1f4",zl);var gs=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*3;return this.int16[st+0]=Te,this.int16[st+1]=je,this.int16[st+2]=Ye,Q},j}(Nn);gs.prototype.bytesPerElement=6,dr("StructArrayLayout3i6",gs);var Pu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,Q,Te,je)},j.prototype.emplace=function(Q,Te,je,Ye){var st=Q*2,Ut=Q*4;return this.uint32[st+0]=Te,this.uint16[Ut+2]=je,this.uint16[Ut+3]=Ye,Q},j}(Nn);Pu.prototype.bytesPerElement=8,dr("StructArrayLayout1ul2ui8",Pu);var kl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te){var je=this.length;return this.resize(je+1),this.emplace(je,Q,Te)},j.prototype.emplace=function(Q,Te,je){var Ye=Q*2;return this.uint16[Ye+0]=Te,this.uint16[Ye+1]=je,Q},j}(Nn);kl.prototype.bytesPerElement=4,dr("StructArrayLayout2ui4",kl);var Nu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q){var Te=this.length;return this.resize(Te+1),this.emplace(Te,Q)},j.prototype.emplace=function(Q,Te){var je=Q*1;return this.uint16[je+0]=Te,Q},j}(Nn);Nu.prototype.bytesPerElement=2,dr("StructArrayLayout1ui2",Nu);var kc=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},j.prototype.emplaceBack=function(Q,Te,je,Ye){var st=this.length;return this.resize(st+1),this.emplace(st,Q,Te,je,Ye)},j.prototype.emplace=function(Q,Te,je,Ye,st){var Ut=Q*4;return this.float32[Ut+0]=Te,this.float32[Ut+1]=je,this.float32[Ut+2]=Ye,this.float32[Ut+3]=st,Q},j}(Nn);kc.prototype.bytesPerElement=16,dr("StructArrayLayout4f16",kc);var Ec=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return Q.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},Q.x1.get=function(){return this._structArray.int16[this._pos2+2]},Q.y1.get=function(){return this._structArray.int16[this._pos2+3]},Q.x2.get=function(){return this._structArray.int16[this._pos2+4]},Q.y2.get=function(){return this._structArray.int16[this._pos2+5]},Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.anchorPoint.get=function(){return new u(this.anchorPointX,this.anchorPointY)},Object.defineProperties(j.prototype,Q),j}(Ei);Ec.prototype.size=20;var Au=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Ec(this,Q)},j}(Do);dr("CollisionBoxArray",Au);var wu=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},Q.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},Q.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Q.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},Q.segment.get=function(){return this._structArray.uint16[this._pos2+10]},Q.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},Q.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},Q.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},Q.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},Q.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},Q.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},Q.placedOrientation.set=function(Te){this._structArray.uint8[this._pos1+37]=Te},Q.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},Q.hidden.set=function(Te){this._structArray.uint8[this._pos1+38]=Te},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},Q.crossTileID.set=function(Te){this._structArray.uint32[this._pos4+10]=Te},Q.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(j.prototype,Q),j}(Ei);wu.prototype.size=48;var Iu=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new wu(this,Q)},j}(us);dr("PlacedSymbolArray",Iu);var Zo=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return Q.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Q.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Q.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},Q.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},Q.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},Q.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},Q.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},Q.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},Q.key.get=function(){return this._structArray.uint16[this._pos2+8]},Q.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Q.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},Q.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},Q.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},Q.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},Q.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},Q.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},Q.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},Q.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},Q.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},Q.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},Q.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},Q.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},Q.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},Q.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},Q.crossTileID.set=function(Te){this._structArray.uint32[this._pos4+12]=Te},Q.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},Q.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},Q.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},Q.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(j.prototype,Q),j}(Ei);Zo.prototype.size=68;var Du=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Zo(this,Q)},j}(Kl);dr("SymbolInstanceArray",Du);var vl=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getoffsetX=function(Q){return this.float32[Q*1+0]},j}(zl);dr("GlyphOffsetArray",vl);var ju=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.getx=function(Q){return this.int16[Q*3+0]},j.prototype.gety=function(Q){return this.int16[Q*3+1]},j.prototype.gettileUnitDistanceFromAnchor=function(Q){return this.int16[Q*3+2]},j}(gs);dr("SymbolLineVertexArray",ju);var Lc=function(v){function j(){v.apply(this,arguments)}v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j;var Q={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return Q.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},Q.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Q.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(j.prototype,Q),j}(Ei);Lc.prototype.size=8;var Fo=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.get=function(Q){return new Lc(this,Q)},j}(Pu);dr("FeatureIndexArray",Fo);var zs=bn([{name:"a_pos",components:2,type:"Int16"}],4),Ol=zs.members,Ml=function(v){v===void 0&&(v=[]),this.segments=v};Ml.prototype.prepareSegment=function(v,j,Q,Te){var je=this.segments[this.segments.length-1];return v>Ml.MAX_VERTEX_ARRAY_LENGTH&&G("Max vertices per segment is "+Ml.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+v),(!je||je.vertexLength+v>Ml.MAX_VERTEX_ARRAY_LENGTH||je.sortKey!==Te)&&(je={vertexOffset:j.length,primitiveOffset:Q.length,vertexLength:0,primitiveLength:0},Te!==void 0&&(je.sortKey=Te),this.segments.push(je)),je},Ml.prototype.get=function(){return this.segments},Ml.prototype.destroy=function(){for(var v=0,j=this.segments;v>>16)*ir&65535)<<16)&4294967295,Br=Br<<15|Br>>>17,Br=(Br&65535)*Tr+(((Br>>>16)*Tr&65535)<<16)&4294967295,st^=Br,st=st<<13|st>>>19,Ut=(st&65535)*5+(((st>>>16)*5&65535)<<16)&4294967295,st=(Ut&65535)+27492+(((Ut>>>16)+58964&65535)<<16);switch(Br=0,je){case 3:Br^=(Q.charCodeAt(ui+2)&255)<<16;case 2:Br^=(Q.charCodeAt(ui+1)&255)<<8;case 1:Br^=Q.charCodeAt(ui)&255,Br=(Br&65535)*ir+(((Br>>>16)*ir&65535)<<16)&4294967295,Br=Br<<15|Br>>>17,Br=(Br&65535)*Tr+(((Br>>>16)*Tr&65535)<<16)&4294967295,st^=Br}return st^=Q.length,st^=st>>>16,st=(st&65535)*2246822507+(((st>>>16)*2246822507&65535)<<16)&4294967295,st^=st>>>13,st=(st&65535)*3266489909+(((st>>>16)*3266489909&65535)<<16)&4294967295,st^=st>>>16,st>>>0}v.exports=j}),we=n(function(v){function j(Q,Te){for(var je=Q.length,Ye=Te^je,st=0,Ut;je>=4;)Ut=Q.charCodeAt(st)&255|(Q.charCodeAt(++st)&255)<<8|(Q.charCodeAt(++st)&255)<<16|(Q.charCodeAt(++st)&255)<<24,Ut=(Ut&65535)*1540483477+(((Ut>>>16)*1540483477&65535)<<16),Ut^=Ut>>>24,Ut=(Ut&65535)*1540483477+(((Ut>>>16)*1540483477&65535)<<16),Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16)^Ut,je-=4,++st;switch(je){case 3:Ye^=(Q.charCodeAt(st+2)&255)<<16;case 2:Ye^=(Q.charCodeAt(st+1)&255)<<8;case 1:Ye^=Q.charCodeAt(st)&255,Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16)}return Ye^=Ye>>>13,Ye=(Ye&65535)*1540483477+(((Ye>>>16)*1540483477&65535)<<16),Ye^=Ye>>>15,Ye>>>0}v.exports=j}),We=ie,gt=ie,kt=we;We.murmur3=gt,We.murmur2=kt;var Je=function(){this.ids=[],this.positions=[],this.indexed=!1};Je.prototype.add=function(v,j,Q,Te){this.ids.push(It(v)),this.positions.push(j,Q,Te)},Je.prototype.getPositions=function(v){for(var j=It(v),Q=0,Te=this.ids.length-1;Q>1;this.ids[je]>=j?Te=je:Q=je+1}for(var Ye=[];this.ids[Q]===j;){var st=this.positions[3*Q],Ut=this.positions[3*Q+1],ir=this.positions[3*Q+2];Ye.push({index:st,start:Ut,end:ir}),Q++}return Ye},Je.serialize=function(v,j){var Q=new Float64Array(v.ids),Te=new Uint32Array(v.positions);return ur(Q,Te,0,Q.length-1),j&&j.push(Q.buffer,Te.buffer),{ids:Q,positions:Te}},Je.deserialize=function(v){var j=new Je;return j.ids=v.ids,j.positions=v.positions,j.indexed=!0,j};var dt=Math.pow(2,53)-1;function It(v){var j=+v;return!isNaN(j)&&j<=dt?j:We(String(v))}function ur(v,j,Q,Te){for(;Q>1],Ye=Q-1,st=Te+1;;){do Ye++;while(v[Ye]je);if(Ye>=st)break;er(v,Ye,st),er(j,3*Ye,3*st),er(j,3*Ye+1,3*st+1),er(j,3*Ye+2,3*st+2)}st-Qst.x+1||irst.y+1)&&G("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return Q}function Xl(v,j){return{type:v.type,id:v.id,properties:v.properties,geometry:j?Tl(v):[]}}function Pc(v,j,Q,Te,je){v.emplaceBack(j*2+(Te+1)/2,Q*2+(je+1)/2)}var $s=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new eo,this.indexArray=new Ro,this.segments=new Ml,this.programConfigurations=new Wn(v.layers,v.zoom),this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};$s.prototype.populate=function(v,j,Q){var Te=this.layers[0],je=[],Ye=null;Te.type==="circle"&&(Ye=Te.layout.get("circle-sort-key"));for(var st=0,Ut=v;st=Jo||ui<0||ui>=Jo)){var _i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,v.sortKey),Ii=_i.vertexLength;Pc(this.layoutVertexArray,Br,ui,-1,-1),Pc(this.layoutVertexArray,Br,ui,1,-1),Pc(this.layoutVertexArray,Br,ui,1,1),Pc(this.layoutVertexArray,Br,ui,-1,1),this.indexArray.emplaceBack(Ii,Ii+1,Ii+2),this.indexArray.emplaceBack(Ii,Ii+3,Ii+2),_i.vertexLength+=4,_i.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,v,Q,{},Te)},dr("CircleBucket",$s,{omit:["layers"]});function zu(v,j){for(var Q=0;Q=3){for(var Ye=0;Ye1){if(u0(v,j))return!0;for(var Te=0;Te1?v.distSqr(Q):v.distSqr(Q.sub(j)._mult(je)._add(j))}function h0(v,j){for(var Q=!1,Te,je,Ye,st=0;stj.y!=Ye.y>j.y&&j.x<(Ye.x-je.x)*(j.y-je.y)/(Ye.y-je.y)+je.x&&(Q=!Q)}return Q}function dp(v,j){for(var Q=!1,Te=0,je=v.length-1;Tej.y!=st.y>j.y&&j.x<(st.x-Ye.x)*(j.y-Ye.y)/(st.y-Ye.y)+Ye.x&&(Q=!Q)}return Q}function rg(v,j,Q,Te,je){for(var Ye=0,st=v;Ye=Ut.x&&je>=Ut.y)return!0}var ir=[new u(j,Q),new u(j,je),new u(Te,je),new u(Te,Q)];if(v.length>2)for(var Tr=0,Br=ir;Trje.x&&j.x>je.x||v.yje.y&&j.y>je.y)return!1;var Ye=ee(v,j,Q[0]);return Ye!==ee(v,j,Q[1])||Ye!==ee(v,j,Q[2])||Ye!==ee(v,j,Q[3])}function f0(v,j,Q){var Te=j.paint.get(v).value;return Te.kind==="constant"?Te.value:Q.programConfigurations.get(j.id).getMaxValue(v)}function d0(v){return Math.sqrt(v[0]*v[0]+v[1]*v[1])}function Ap(v,j,Q,Te,je){if(!j[0]&&!j[1])return v;var Ye=u.convert(j)._mult(je);Q==="viewport"&&Ye._rotate(-Te);for(var st=[],Ut=0;Ut0&&(Ye=1/Math.sqrt(Ye)),v[0]=j[0]*Ye,v[1]=j[1]*Ye,v[2]=j[2]*Ye,v}function MA(v,j){return v[0]*j[0]+v[1]*j[1]+v[2]*j[2]}function EA(v,j,Q){var Te=j[0],je=j[1],Ye=j[2],st=Q[0],Ut=Q[1],ir=Q[2];return v[0]=je*ir-Ye*Ut,v[1]=Ye*st-Te*ir,v[2]=Te*Ut-je*st,v}function LA(v,j,Q){var Te=j[0],je=j[1],Ye=j[2];return v[0]=Te*Q[0]+je*Q[3]+Ye*Q[6],v[1]=Te*Q[1]+je*Q[4]+Ye*Q[7],v[2]=Te*Q[2]+je*Q[5]+Ye*Q[8],v}var PA=Kw;(function(){var v=Bb();return function(j,Q,Te,je,Ye,st){var Ut,ir;for(Q||(Q=3),Te||(Te=0),je?ir=Math.min(je*Q+Te,j.length):ir=j.length,Ut=Te;Utv.width||je.height>v.height||Q.x>v.width-je.width||Q.y>v.height-je.height)throw new RangeError("out of range source coordinates for image copy");if(je.width>j.width||je.height>j.height||Te.x>j.width-je.width||Te.y>j.height-je.height)throw new RangeError("out of range destination coordinates for image copy");for(var st=v.data,Ut=j.data,ir=0;ir80*Q){Ut=Tr=v[0],ir=Br=v[1];for(var tn=Q;tnTr&&(Tr=ui),_i>Br&&(Br=_i);Ii=Math.max(Tr-Ut,Br-ir),Ii=Ii!==0?1/Ii:0}return o1(Ye,st,Q,Ut,ir,Ii),st}function Qw(v,j,Q,Te,je){var Ye,st;if(je===a3(v,j,Q,Te)>0)for(Ye=j;Ye=j;Ye-=Te)st=V6(Ye,v[Ye],v[Ye+1],st);return st&&by(st,st.next)&&(ex(st),st=st.next),st}function Og(v,j){if(!v)return v;j||(j=v);var Q=v,Te;do if(Te=!1,!Q.steiner&&(by(Q,Q.next)||Sf(Q.prev,Q,Q.next)===0)){if(ex(Q),Q=j=Q.prev,Q===Q.next)break;Te=!0}else Q=Q.next;while(Te||Q!==j);return j}function o1(v,j,Q,Te,je,Ye,st){if(v){!st&&Ye&&t3(v,Te,je,Ye);for(var Ut=v,ir,Tr;v.prev!==v.next;){if(ir=v.prev,Tr=v.next,Ye?FA(v,Te,je,Ye):e3(v)){j.push(ir.i/Q),j.push(v.i/Q),j.push(Tr.i/Q),ex(v),v=Tr.next,Ut=Tr.next;continue}if(v=Tr,v===Ut){st?st===1?(v=NA(Og(v),j,Q),o1(v,j,Q,Te,je,Ye,2)):st===2&&U6(v,j,Q,Te,je,Ye):o1(Og(v),j,Q,Te,je,Ye,1);break}}}}function e3(v){var j=v.prev,Q=v,Te=v.next;if(Sf(j,Q,Te)>=0)return!1;for(var je=v.next.next;je!==v.prev;){if(lv(j.x,j.y,Q.x,Q.y,Te.x,Te.y,je.x,je.y)&&Sf(je.prev,je,je.next)>=0)return!1;je=je.next}return!0}function FA(v,j,Q,Te){var je=v.prev,Ye=v,st=v.next;if(Sf(je,Ye,st)>=0)return!1;for(var Ut=je.xYe.x?je.x>st.x?je.x:st.x:Ye.x>st.x?Ye.x:st.x,Br=je.y>Ye.y?je.y>st.y?je.y:st.y:Ye.y>st.y?Ye.y:st.y,ui=r3(Ut,ir,j,Q,Te),_i=r3(Tr,Br,j,Q,Te),Ii=v.prevZ,tn=v.nextZ;Ii&&Ii.z>=ui&&tn&&tn.z<=_i;){if(Ii!==v.prev&&Ii!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,Ii.x,Ii.y)&&Sf(Ii.prev,Ii,Ii.next)>=0||(Ii=Ii.prevZ,tn!==v.prev&&tn!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,tn.x,tn.y)&&Sf(tn.prev,tn,tn.next)>=0))return!1;tn=tn.nextZ}for(;Ii&&Ii.z>=ui;){if(Ii!==v.prev&&Ii!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,Ii.x,Ii.y)&&Sf(Ii.prev,Ii,Ii.next)>=0)return!1;Ii=Ii.prevZ}for(;tn&&tn.z<=_i;){if(tn!==v.prev&&tn!==v.next&&lv(je.x,je.y,Ye.x,Ye.y,st.x,st.y,tn.x,tn.y)&&Sf(tn.prev,tn,tn.next)>=0)return!1;tn=tn.nextZ}return!0}function NA(v,j,Q){var Te=v;do{var je=Te.prev,Ye=Te.next.next;!by(je,Ye)&&s1(je,Te,Te.next,Ye)&&wy(je,Ye)&&wy(Ye,je)&&(j.push(je.i/Q),j.push(Te.i/Q),j.push(Ye.i/Q),ex(Te),ex(Te.next),Te=v=Ye),Te=Te.next}while(Te!==v);return Og(Te)}function U6(v,j,Q,Te,je,Ye){var st=v;do{for(var Ut=st.next.next;Ut!==st.prev;){if(st.i!==Ut.i&&UA(st,Ut)){var ir=n3(st,Ut);st=Og(st,st.next),ir=Og(ir,ir.next),o1(st,j,Q,Te,je,Ye),o1(ir,j,Q,Te,je,Ye);return}Ut=Ut.next}st=st.next}while(st!==v)}function $6(v,j,Q,Te){var je=[],Ye,st,Ut,ir,Tr;for(Ye=0,st=j.length;Ye=Q.next.y&&Q.next.y!==Q.y){var Ut=Q.x+(je-Q.y)*(Q.next.x-Q.x)/(Q.next.y-Q.y);if(Ut<=Te&&Ut>Ye){if(Ye=Ut,Ut===Te){if(je===Q.y)return Q;if(je===Q.next.y)return Q.next}st=Q.x=Q.x&&Q.x>=Tr&&Te!==Q.x&&lv(jest.x||Q.x===st.x&&H6(st,Q)))&&(st=Q,ui=_i)),Q=Q.next;while(Q!==ir);return st}function H6(v,j){return Sf(v.prev,v,j.prev)<0&&Sf(j.next,v,v.next)<0}function t3(v,j,Q,Te){var je=v;do je.z===null&&(je.z=r3(je.x,je.y,j,Q,Te)),je.prevZ=je.prev,je.nextZ=je.next,je=je.next;while(je!==v);je.prevZ.nextZ=null,je.prevZ=null,jA(je)}function jA(v){var j,Q,Te,je,Ye,st,Ut,ir,Tr=1;do{for(Q=v,v=null,Ye=null,st=0;Q;){for(st++,Te=Q,Ut=0,j=0;j0||ir>0&&Te;)Ut!==0&&(ir===0||!Te||Q.z<=Te.z)?(je=Q,Q=Q.nextZ,Ut--):(je=Te,Te=Te.nextZ,ir--),Ye?Ye.nextZ=je:v=je,je.prevZ=Ye,Ye=je;Q=Te}Ye.nextZ=null,Tr*=2}while(st>1);return v}function r3(v,j,Q,Te,je){return v=32767*(v-Q)*je,j=32767*(j-Te)*je,v=(v|v<<8)&16711935,v=(v|v<<4)&252645135,v=(v|v<<2)&858993459,v=(v|v<<1)&1431655765,j=(j|j<<8)&16711935,j=(j|j<<4)&252645135,j=(j|j<<2)&858993459,j=(j|j<<1)&1431655765,v|j<<1}function Wb(v){var j=v,Q=v;do(j.x=0&&(v-st)*(Te-Ut)-(Q-st)*(j-Ut)>=0&&(Q-st)*(Ye-Ut)-(je-st)*(Te-Ut)>=0}function UA(v,j){return v.next.i!==j.i&&v.prev.i!==j.i&&!i3(v,j)&&(wy(v,j)&&wy(j,v)&&qb(v,j)&&(Sf(v.prev,v,j.prev)||Sf(v,j.prev,j))||by(v,j)&&Sf(v.prev,v,v.next)>0&&Sf(j.prev,j,j.next)>0)}function Sf(v,j,Q){return(j.y-v.y)*(Q.x-j.x)-(j.x-v.x)*(Q.y-j.y)}function by(v,j){return v.x===j.x&&v.y===j.y}function s1(v,j,Q,Te){var je=Q_(Sf(v,j,Q)),Ye=Q_(Sf(v,j,Te)),st=Q_(Sf(Q,Te,v)),Ut=Q_(Sf(Q,Te,j));return!!(je!==Ye&&st!==Ut||je===0&&J_(v,Q,j)||Ye===0&&J_(v,Te,j)||st===0&&J_(Q,v,Te)||Ut===0&&J_(Q,j,Te))}function J_(v,j,Q){return j.x<=Math.max(v.x,Q.x)&&j.x>=Math.min(v.x,Q.x)&&j.y<=Math.max(v.y,Q.y)&&j.y>=Math.min(v.y,Q.y)}function Q_(v){return v>0?1:v<0?-1:0}function i3(v,j){var Q=v;do{if(Q.i!==v.i&&Q.next.i!==v.i&&Q.i!==j.i&&Q.next.i!==j.i&&s1(Q,Q.next,v,j))return!0;Q=Q.next}while(Q!==v);return!1}function wy(v,j){return Sf(v.prev,v,v.next)<0?Sf(v,j,v.next)>=0&&Sf(v,v.prev,j)>=0:Sf(v,j,v.prev)<0||Sf(v,v.next,j)<0}function qb(v,j){var Q=v,Te=!1,je=(v.x+j.x)/2,Ye=(v.y+j.y)/2;do Q.y>Ye!=Q.next.y>Ye&&Q.next.y!==Q.y&&je<(Q.next.x-Q.x)*(Ye-Q.y)/(Q.next.y-Q.y)+Q.x&&(Te=!Te),Q=Q.next;while(Q!==v);return Te}function n3(v,j){var Q=new Gb(v.i,v.x,v.y),Te=new Gb(j.i,j.x,j.y),je=v.next,Ye=j.prev;return v.next=j,j.prev=v,Q.next=je,je.prev=Q,Te.next=Q,Q.prev=Te,Ye.next=Te,Te.prev=Ye,Te}function V6(v,j,Q,Te){var je=new Gb(v,j,Q);return Te?(je.next=Te.next,je.prev=Te,Te.next.prev=je,Te.next=je):(je.prev=je,je.next=je),je}function ex(v){v.next.prev=v.prev,v.prev.next=v.next,v.prevZ&&(v.prevZ.nextZ=v.nextZ),v.nextZ&&(v.nextZ.prevZ=v.prevZ)}function Gb(v,j,Q){this.i=v,this.x=j,this.y=Q,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Vb.deviation=function(v,j,Q,Te){var je=j&&j.length,Ye=je?j[0]*Q:v.length,st=Math.abs(a3(v,0,Ye,Q));if(je)for(var Ut=0,ir=j.length;Ut0&&(Te+=v[je-1].length,Q.holes.push(Te))}return Q},Hb.default=j6;function $A(v,j,Q,Te,je){W6(v,j,Q,Te||v.length-1,je||o3)}function W6(v,j,Q,Te,je){for(;Te>Q;){if(Te-Q>600){var Ye=Te-Q+1,st=j-Q+1,Ut=Math.log(Ye),ir=.5*Math.exp(2*Ut/3),Tr=.5*Math.sqrt(Ut*ir*(Ye-ir)/Ye)*(st-Ye/2<0?-1:1),Br=Math.max(Q,Math.floor(j-st*ir/Ye+Tr)),ui=Math.min(Te,Math.floor(j+(Ye-st)*ir/Ye+Tr));W6(v,j,Br,ui,je)}var _i=v[j],Ii=Q,tn=Te;for(tx(v,Q,j),je(v[Te],_i)>0&&tx(v,Q,Te);Ii0;)tn--}je(v[Q],_i)===0?tx(v,Q,tn):(tn++,tx(v,tn,Te)),tn<=j&&(Q=tn+1),j<=tn&&(Te=tn-1)}}function tx(v,j,Q){var Te=v[j];v[j]=v[Q],v[Q]=Te}function o3(v,j){return vj?1:0}function ng(v,j){var Q=v.length;if(Q<=1)return[v];for(var Te=[],je,Ye,st=0;st1)for(var ir=0;ir>3}if(Te--,Q===1||Q===2)je+=v.readSVarint(),Ye+=v.readSVarint(),Q===1&&(Ut&&st.push(Ut),Ut=[]),Ut.push(new u(je,Ye));else if(Q===7)Ut&&Ut.push(Ut[0].clone());else throw new Error("unknown command "+Q)}return Ut&&st.push(Ut),st},l1.prototype.bbox=function(){var v=this._pbf;v.pos=this._geometry;for(var j=v.readVarint()+v.pos,Q=1,Te=0,je=0,Ye=0,st=1/0,Ut=-1/0,ir=1/0,Tr=-1/0;v.pos>3}if(Te--,Q===1||Q===2)je+=v.readSVarint(),Ye+=v.readSVarint(),jeUt&&(Ut=je),YeTr&&(Tr=Ye);else if(Q!==7)throw new Error("unknown command "+Q)}return[st,ir,Ut,Tr]},l1.prototype.toGeoJSON=function(v,j,Q){var Te=this.extent*Math.pow(2,Q),je=this.extent*v,Ye=this.extent*j,st=this.loadGeometry(),Ut=l1.types[this.type],ir,Tr;function Br(Ii){for(var tn=0;tn>3;j=Te===1?v.readString():Te===2?v.readFloat():Te===3?v.readDouble():Te===4?v.readVarint64():Te===5?v.readVarint():Te===6?v.readSVarint():Te===7?v.readBoolean():null}return j}ek.prototype.feature=function(v){if(v<0||v>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[v];var j=this._pbf.readVarint()+this._pbf.pos;return new ky(this._pbf,j,this.extent,this._keys,this._values)};var rk=ik;function ik(v,j){this.layers=v.readFields(nk,{},j)}function nk(v,j,Q){if(v===3){var Te=new u3(Q,Q.readVarint()+Q.pos);Te.length&&(j[Te.name]=Te)}}var ak=rk,HA=ky,VA=u3,u1={VectorTile:ak,VectorTileFeature:HA,VectorTileLayer:VA},Ty=u1.VectorTileFeature.types,ok=500,Sy=Math.pow(2,13);function Cy(v,j,Q,Te,je,Ye,st,Ut){v.emplaceBack(j,Q,Math.floor(Te*Sy)*2+st,je*Sy*2,Ye*Sy*2,Math.round(Ut))}var E0=function(v){this.zoom=v.zoom,this.overscaling=v.overscaling,this.layers=v.layers,this.layerIds=this.layers.map(function(j){return j.id}),this.index=v.index,this.hasPattern=!1,this.layoutVertexArray=new wn,this.indexArray=new Ro,this.programConfigurations=new Wn(v.layers,v.zoom),this.segments=new Ml,this.stateDependentLayerIds=this.layers.filter(function(j){return j.isStateDependent()}).map(function(j){return j.id})};E0.prototype.populate=function(v,j,Q){this.features=[],this.hasPattern=Zb("fill-extrusion",this.layers,j);for(var Te=0,je=v;Te=1){var Za=zn[ma-1];if(!Yb(za,Za)){_i.vertexLength+4>Ml.MAX_VERTEX_ARRAY_LENGTH&&(_i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Pa=za.sub(Za)._perp()._unit(),co=Za.dist(za);ba+co>32768&&(ba=0),Cy(this.layoutVertexArray,za.x,za.y,Pa.x,Pa.y,0,0,ba),Cy(this.layoutVertexArray,za.x,za.y,Pa.x,Pa.y,0,1,ba),ba+=co,Cy(this.layoutVertexArray,Za.x,Za.y,Pa.x,Pa.y,0,0,ba),Cy(this.layoutVertexArray,Za.x,Za.y,Pa.x,Pa.y,0,1,ba);var Lo=_i.vertexLength;this.indexArray.emplaceBack(Lo,Lo+2,Lo+1),this.indexArray.emplaceBack(Lo+1,Lo+2,Lo+3),_i.vertexLength+=4,_i.primitiveLength+=2}}}}if(_i.vertexLength+ir>Ml.MAX_VERTEX_ARRAY_LENGTH&&(_i=this.segments.prepareSegment(ir,this.layoutVertexArray,this.indexArray)),Ty[v.type]==="Polygon"){for(var Ko=[],Yo=[],As=_i.vertexLength,Ms=0,Hs=Ut;MsJo)||v.y===j.y&&(v.y<0||v.y>Jo)}function Xb(v){return v.every(function(j){return j.x<0})||v.every(function(j){return j.x>Jo})||v.every(function(j){return j.y<0})||v.every(function(j){return j.y>Jo})}var WA=new ao({"fill-extrusion-opacity":new Oi($a["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Tn($a["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Oi($a["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Oi($a["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ua($a["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Tn($a["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Tn($a["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Oi($a["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),qA={paint:WA},GA=function(v){function j(Q){v.call(this,Q,qA)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.createBucket=function(Q){return new E0(Q)},j.prototype.queryRadius=function(){return d0(this.paint.get("fill-extrusion-translate"))},j.prototype.is3D=function(){return!0},j.prototype.queryIntersectsFeature=function(Q,Te,je,Ye,st,Ut,ir,Tr){var Br=Ap(Q,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ut.angle,ir),ui=this.paint.get("fill-extrusion-height").evaluate(Te,je),_i=this.paint.get("fill-extrusion-base").evaluate(Te,je),Ii=sk(Br,Tr,Ut,0),tn=c3(Ye,_i,ui,Tr),zn=tn[0],ba=tn[1];return cv(zn,ba,Ii)},j}(da);function ag(v,j){return v.x*j.x+v.y*j.y}function tp(v,j){if(v.length===1){for(var Q=0,Te=j[Q++],je;!je||Te.equals(je);)if(je=j[Q++],!je)return 1/0;for(;Q=2&&v[ir-1].equals(v[ir-2]);)ir--;for(var Tr=0;Tr0;if(Ko&&ma>Tr){var As=_i.dist(Ii);if(As>2*Br){var Ms=_i.sub(_i.sub(Ii)._mult(Br/As)._round());this.updateDistance(Ii,Ms),this.addCurrentVertex(Ms,zn,0,0,ui),Ii=Ms}}var Hs=Ii&&tn,tl=Hs?Q:Ut?"butt":Te;if(Hs&&tl==="round"&&(coje&&(tl="bevel"),tl==="bevel"&&(co>2&&(tl="flipbevel"),co100)za=ba.mult(-1);else{var yl=co*zn.add(ba).mag()/zn.sub(ba).mag();za._perp()._mult(yl*(Yo?-1:1))}this.addCurrentVertex(_i,za,0,0,ui),this.addCurrentVertex(_i,za.mult(-1),0,0,ui)}else if(tl==="bevel"||tl==="fakeround"){var Vs=-Math.sqrt(co*co-1),Ks=Yo?Vs:0,Ku=Yo?0:Vs;if(Ii&&this.addCurrentVertex(_i,zn,Ks,Ku,ui),tl==="fakeround")for(var Wc=Math.round(Lo*180/Math.PI/d3),wh=1;wh2*Br){var wd=_i.add(tn.sub(_i)._mult(Br/yp)._round());this.updateDistance(_i,wd),this.addCurrentVertex(wd,ba,0,0,ui),_i=wd}}}}},mp.prototype.addCurrentVertex=function(v,j,Q,Te,je,Ye){Ye===void 0&&(Ye=!1);var st=j.x+j.y*Q,Ut=j.y-j.x*Q,ir=-j.x+j.y*Te,Tr=-j.y-j.x*Te;this.addHalfVertex(v,st,Ut,Ye,!1,Q,je),this.addHalfVertex(v,ir,Tr,Ye,!0,-Te,je),this.distance>Jb/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(v,j,Q,Te,je,Ye))},mp.prototype.addHalfVertex=function(v,j,Q,Te,je,Ye,st){var Ut=v.x,ir=v.y,Tr=this.lineClips?this.scaledDistance*(Jb-1):this.scaledDistance,Br=Tr*Ay;if(this.layoutVertexArray.emplaceBack((Ut<<1)+(Te?1:0),(ir<<1)+(je?1:0),Math.round(hk*j)+128,Math.round(hk*Q)+128,(Ye===0?0:Ye<0?-1:1)+1|(Br&63)<<2,Br>>6),this.lineClips){var ui=this.scaledDistance-this.lineClips.start,_i=this.lineClips.end-this.lineClips.start,Ii=ui/_i;this.layoutVertexArray2.emplaceBack(Ii,this.lineClipsArray.length)}var tn=st.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,tn),st.primitiveLength++),je?this.e2=tn:this.e1=tn},mp.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},mp.prototype.updateDistance=function(v,j){this.distance+=v.dist(j),this.updateScaledDistance()},dr("LineBucket",mp,{omit:["layers","patternFeatures"]});var p3=new ao({"line-cap":new Oi($a.layout_line["line-cap"]),"line-join":new Tn($a.layout_line["line-join"]),"line-miter-limit":new Oi($a.layout_line["line-miter-limit"]),"line-round-limit":new Oi($a.layout_line["line-round-limit"]),"line-sort-key":new Tn($a.layout_line["line-sort-key"])}),Qb=new ao({"line-opacity":new Tn($a.paint_line["line-opacity"]),"line-color":new Tn($a.paint_line["line-color"]),"line-translate":new Oi($a.paint_line["line-translate"]),"line-translate-anchor":new Oi($a.paint_line["line-translate-anchor"]),"line-width":new Tn($a.paint_line["line-width"]),"line-gap-width":new Tn($a.paint_line["line-gap-width"]),"line-offset":new Tn($a.paint_line["line-offset"]),"line-blur":new Tn($a.paint_line["line-blur"]),"line-dasharray":new ia($a.paint_line["line-dasharray"]),"line-pattern":new ua($a.paint_line["line-pattern"]),"line-gradient":new La($a.paint_line["line-gradient"])}),My={paint:Qb,layout:p3},m3=function(v){function j(){v.apply(this,arguments)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.possiblyEvaluate=function(Q,Te){return Te=new Zl(Math.floor(Te.zoom),{now:Te.now,fadeDuration:Te.fadeDuration,zoomHistory:Te.zoomHistory,transition:Te.transition}),v.prototype.possiblyEvaluate.call(this,Q,Te)},j.prototype.evaluate=function(Q,Te,je,Ye){return Te=I({},Te,{zoom:Math.floor(Te.zoom)}),v.prototype.evaluate.call(this,Q,Te,je,Ye)},j}(Tn),e2=new m3(My.paint.properties["line-width"].specification);e2.useIntegerZoom=!0;var g3=function(v){function j(Q){v.call(this,Q,My),this.gradientVersion=0}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype._handleSpecialPaintPropertyUpdate=function(Q){if(Q==="line-gradient"){var Te=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Te._styleExpression.expression instanceof Jc,this.gradientVersion=(this.gradientVersion+1)%b}},j.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},j.prototype.recalculate=function(Q,Te){v.prototype.recalculate.call(this,Q,Te),this.paint._values["line-floorwidth"]=e2.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,Q)},j.prototype.createBucket=function(Q){return new mp(Q)},j.prototype.queryRadius=function(Q){var Te=Q,je=pk(f0("line-width",this,Te),f0("line-gap-width",this,Te)),Ye=f0("line-offset",this,Te);return je/2+Math.abs(Ye)+d0(this.paint.get("line-translate"))},j.prototype.queryIntersectsFeature=function(Q,Te,je,Ye,st,Ut,ir){var Tr=Ap(Q,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ut.angle,ir),Br=ir/2*pk(this.paint.get("line-width").evaluate(Te,je),this.paint.get("line-gap-width").evaluate(Te,je)),ui=this.paint.get("line-offset").evaluate(Te,je);return ui&&(Ye=X(Ye,ui*ir)),M0(Tr,Ye,Br)},j.prototype.isTileClipped=function(){return!0},j}(da);function pk(v,j){return j>0?j+2*v:v}function X(v,j){for(var Q=[],Te=new u(0,0),je=0;je":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Ar(v){for(var j="",Q=0;Q>1,Br=-7,ui=Q?je-1:0,_i=Q?-1:1,Ii=v[j+ui];for(ui+=_i,Ye=Ii&(1<<-Br)-1,Ii>>=-Br,Br+=Ut;Br>0;Ye=Ye*256+v[j+ui],ui+=_i,Br-=8);for(st=Ye&(1<<-Br)-1,Ye>>=-Br,Br+=Te;Br>0;st=st*256+v[j+ui],ui+=_i,Br-=8);if(Ye===0)Ye=1-Tr;else{if(Ye===ir)return st?NaN:(Ii?-1:1)*(1/0);st=st+Math.pow(2,Te),Ye=Ye-Tr}return(Ii?-1:1)*st*Math.pow(2,Ye-Te)},wi=function(v,j,Q,Te,je,Ye){var st,Ut,ir,Tr=Ye*8-je-1,Br=(1<>1,_i=je===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ii=Te?0:Ye-1,tn=Te?1:-1,zn=j<0||j===0&&1/j<0?1:0;for(j=Math.abs(j),isNaN(j)||j===1/0?(Ut=isNaN(j)?1:0,st=Br):(st=Math.floor(Math.log(j)/Math.LN2),j*(ir=Math.pow(2,-st))<1&&(st--,ir*=2),st+ui>=1?j+=_i/ir:j+=_i*Math.pow(2,1-ui),j*ir>=2&&(st++,ir/=2),st+ui>=Br?(Ut=0,st=Br):st+ui>=1?(Ut=(j*ir-1)*Math.pow(2,je),st=st+ui):(Ut=j*Math.pow(2,ui-1)*Math.pow(2,je),st=0));je>=8;v[Q+Ii]=Ut&255,Ii+=tn,Ut/=256,je-=8);for(st=st<0;v[Q+Ii]=st&255,Ii+=tn,st/=256,Tr-=8);v[Q+Ii-tn]|=zn*128},Fi={read:oi,write:wi},Gi=mn;function mn(v){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(v)?v:new Uint8Array(v||0),this.pos=0,this.type=0,this.length=this.buf.length}mn.Varint=0,mn.Fixed64=1,mn.Bytes=2,mn.Fixed32=5;var Un=65536*65536,Fa=1/Un,ha=12,Ma=typeof TextDecoder>"u"?null:new TextDecoder("utf8");mn.prototype={destroy:function(){this.buf=null},readFields:function(v,j,Q){for(Q=Q||this.length;this.pos>3,Ye=this.pos;this.type=Te&7,v(je,j,this),this.pos===Ye&&this.skip(Te)}return j},readMessage:function(v,j){return this.readFields(v,j,this.readVarint()+this.pos)},readFixed32:function(){var v=p0(this.buf,this.pos);return this.pos+=4,v},readSFixed32:function(){var v=yd(this.buf,this.pos);return this.pos+=4,v},readFixed64:function(){var v=p0(this.buf,this.pos)+p0(this.buf,this.pos+4)*Un;return this.pos+=8,v},readSFixed64:function(){var v=p0(this.buf,this.pos)+yd(this.buf,this.pos+4)*Un;return this.pos+=8,v},readFloat:function(){var v=Fi.read(this.buf,this.pos,!0,23,4);return this.pos+=4,v},readDouble:function(){var v=Fi.read(this.buf,this.pos,!0,52,8);return this.pos+=8,v},readVarint:function(v){var j=this.buf,Q,Te;return Te=j[this.pos++],Q=Te&127,Te<128||(Te=j[this.pos++],Q|=(Te&127)<<7,Te<128)||(Te=j[this.pos++],Q|=(Te&127)<<14,Te<128)||(Te=j[this.pos++],Q|=(Te&127)<<21,Te<128)?Q:(Te=j[this.pos],Q|=(Te&15)<<28,lo(Q,v,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var v=this.readVarint();return v%2===1?(v+1)/-2:v/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var v=this.readVarint()+this.pos,j=this.pos;return this.pos=v,v-j>=ha&&Ma?Wp(this.buf,j,v):Vp(this.buf,j,v)},readBytes:function(){var v=this.readVarint()+this.pos,j=this.buf.subarray(this.pos,v);return this.pos=v,j},readPackedVarint:function(v,j){if(this.type!==mn.Bytes)return v.push(this.readVarint(j));var Q=Oo(this);for(v=v||[];this.pos127;);else if(j===mn.Bytes)this.pos=this.readVarint()+this.pos;else if(j===mn.Fixed32)this.pos+=4;else if(j===mn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+j)},writeTag:function(v,j){this.writeVarint(v<<3|j)},realloc:function(v){for(var j=this.length||16;j268435455||v<0){Bl(v,this);return}this.realloc(4),this.buf[this.pos++]=v&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=(v>>>=7)&127|(v>127?128:0),!(v<=127)&&(this.buf[this.pos++]=v>>>7&127)))},writeSVarint:function(v){this.writeVarint(v<0?-v*2-1:v*2)},writeBoolean:function(v){this.writeVarint(!!v)},writeString:function(v){v=String(v),this.realloc(v.length*4),this.pos++;var j=this.pos;this.pos=qp(this.buf,v,this.pos);var Q=this.pos-j;Q>=128&&al(j,Q,this),this.pos=j-1,this.writeVarint(Q),this.pos+=Q},writeFloat:function(v){this.realloc(4),Fi.write(this.buf,v,this.pos,!0,23,4),this.pos+=4},writeDouble:function(v){this.realloc(8),Fi.write(this.buf,v,this.pos,!0,52,8),this.pos+=8},writeBytes:function(v){var j=v.length;this.writeVarint(j),this.realloc(j);for(var Q=0;Q=128&&al(Q,Te,this),this.pos=Q-1,this.writeVarint(Te),this.pos+=Te},writeMessage:function(v,j,Q){this.writeTag(v,mn.Bytes),this.writeRawMessage(j,Q)},writePackedVarint:function(v,j){j.length&&this.writeMessage(v,qs,j)},writePackedSVarint:function(v,j){j.length&&this.writeMessage(v,Ns,j)},writePackedBoolean:function(v,j){j.length&&this.writeMessage(v,ol,j)},writePackedFloat:function(v,j){j.length&&this.writeMessage(v,wo,j)},writePackedDouble:function(v,j){j.length&&this.writeMessage(v,dl,j)},writePackedFixed32:function(v,j){j.length&&this.writeMessage(v,eu,j)},writePackedSFixed32:function(v,j){j.length&&this.writeMessage(v,xh,j)},writePackedFixed64:function(v,j){j.length&&this.writeMessage(v,ph,j)},writePackedSFixed64:function(v,j){j.length&&this.writeMessage(v,Bd,j)},writeBytesField:function(v,j){this.writeTag(v,mn.Bytes),this.writeBytes(j)},writeFixed32Field:function(v,j){this.writeTag(v,mn.Fixed32),this.writeFixed32(j)},writeSFixed32Field:function(v,j){this.writeTag(v,mn.Fixed32),this.writeSFixed32(j)},writeFixed64Field:function(v,j){this.writeTag(v,mn.Fixed64),this.writeFixed64(j)},writeSFixed64Field:function(v,j){this.writeTag(v,mn.Fixed64),this.writeSFixed64(j)},writeVarintField:function(v,j){this.writeTag(v,mn.Varint),this.writeVarint(j)},writeSVarintField:function(v,j){this.writeTag(v,mn.Varint),this.writeSVarint(j)},writeStringField:function(v,j){this.writeTag(v,mn.Bytes),this.writeString(j)},writeFloatField:function(v,j){this.writeTag(v,mn.Fixed32),this.writeFloat(j)},writeDoubleField:function(v,j){this.writeTag(v,mn.Fixed64),this.writeDouble(j)},writeBooleanField:function(v,j){this.writeVarintField(v,!!j)}};function lo(v,j,Q){var Te=Q.buf,je,Ye;if(Ye=Te[Q.pos++],je=(Ye&112)>>4,Ye<128||(Ye=Te[Q.pos++],je|=(Ye&127)<<3,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<10,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<17,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&127)<<24,Ye<128)||(Ye=Te[Q.pos++],je|=(Ye&1)<<31,Ye<128))return Is(v,je,j);throw new Error("Expected varint not more than 10 bytes")}function Oo(v){return v.type===mn.Bytes?v.readVarint()+v.pos:v.pos+1}function Is(v,j,Q){return Q?j*4294967296+(v>>>0):(j>>>0)*4294967296+(v>>>0)}function Bl(v,j){var Q,Te;if(v>=0?(Q=v%4294967296|0,Te=v/4294967296|0):(Q=~(-v%4294967296),Te=~(-v/4294967296),Q^4294967295?Q=Q+1|0:(Q=0,Te=Te+1|0)),v>=18446744073709552e3||v<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");j.realloc(10),Cs(Q,Te,j),vs(Te,j)}function Cs(v,j,Q){Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos++]=v&127|128,v>>>=7,Q.buf[Q.pos]=v&127}function vs(v,j){var Q=(v&7)<<4;j.buf[j.pos++]|=Q|((v>>>=3)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127|((v>>>=7)?128:0),v&&(j.buf[j.pos++]=v&127)))))}function al(v,j,Q){var Te=j<=16383?1:j<=2097151?2:j<=268435455?3:Math.floor(Math.log(j)/(Math.LN2*7));Q.realloc(Te);for(var je=Q.pos-1;je>=v;je--)Q.buf[je+Te]=Q.buf[je]}function qs(v,j){for(var Q=0;Q>>8,v[Q+2]=j>>>16,v[Q+3]=j>>>24}function yd(v,j){return(v[j]|v[j+1]<<8|v[j+2]<<16)+(v[j+3]<<24)}function Vp(v,j,Q){for(var Te="",je=j;je239?4:Ye>223?3:Ye>191?2:1;if(je+Ut>Q)break;var ir,Tr,Br;Ut===1?Ye<128&&(st=Ye):Ut===2?(ir=v[je+1],(ir&192)===128&&(st=(Ye&31)<<6|ir&63,st<=127&&(st=null))):Ut===3?(ir=v[je+1],Tr=v[je+2],(ir&192)===128&&(Tr&192)===128&&(st=(Ye&15)<<12|(ir&63)<<6|Tr&63,(st<=2047||st>=55296&&st<=57343)&&(st=null))):Ut===4&&(ir=v[je+1],Tr=v[je+2],Br=v[je+3],(ir&192)===128&&(Tr&192)===128&&(Br&192)===128&&(st=(Ye&15)<<18|(ir&63)<<12|(Tr&63)<<6|Br&63,(st<=65535||st>=1114112)&&(st=null))),st===null?(st=65533,Ut=1):st>65535&&(st-=65536,Te+=String.fromCharCode(st>>>10&1023|55296),st=56320|st&1023),Te+=String.fromCharCode(st),je+=Ut}return Te}function Wp(v,j,Q){return Ma.decode(v.subarray(j,Q))}function qp(v,j,Q){for(var Te=0,je,Ye;Te55295&&je<57344)if(Ye)if(je<56320){v[Q++]=239,v[Q++]=191,v[Q++]=189,Ye=je;continue}else je=Ye-55296<<10|je-56320|65536,Ye=null;else{je>56319||Te+1===j.length?(v[Q++]=239,v[Q++]=191,v[Q++]=189):Ye=je;continue}else Ye&&(v[Q++]=239,v[Q++]=191,v[Q++]=189,Ye=null);je<128?v[Q++]=je:(je<2048?v[Q++]=je>>6|192:(je<65536?v[Q++]=je>>12|224:(v[Q++]=je>>18|240,v[Q++]=je>>12&63|128),v[Q++]=je>>6&63|128),v[Q++]=je&63|128)}return Q}var vf=3;function Rd(v,j,Q){v===1&&Q.readMessage(Mp,j)}function Mp(v,j,Q){if(v===3){var Te=Q.readMessage(gp,{}),je=Te.id,Ye=Te.bitmap,st=Te.width,Ut=Te.height,ir=Te.left,Tr=Te.top,Br=Te.advance;j.push({id:je,bitmap:new vd({width:st+2*vf,height:Ut+2*vf},Ye),metrics:{width:st,height:Ut,left:ir,top:Tr,advance:Br}})}}function gp(v,j,Q){v===1?j.id=Q.readVarint():v===2?j.bitmap=Q.readBytes():v===3?j.width=Q.readVarint():v===4?j.height=Q.readVarint():v===5?j.left=Q.readSVarint():v===6?j.top=Q.readSVarint():v===7&&(j.advance=Q.readVarint())}function Gp(v){return new Gi(v).readFields(Rd,[])}var rp=vf;function L0(v){for(var j=0,Q=0,Te=0,je=v;Te=0;Ii--){var tn=Ut[Ii];if(!(_i.w>tn.w||_i.h>tn.h)){if(_i.x=tn.x,_i.y=tn.y,Tr=Math.max(Tr,_i.y+_i.h),ir=Math.max(ir,_i.x+_i.w),_i.w===tn.w&&_i.h===tn.h){var zn=Ut.pop();Ii=0&&Te>=v&&P0[this.text.charCodeAt(Te)];Te--)Q--;this.text=this.text.substring(v,Q),this.sectionIndex=this.sectionIndex.slice(v,Q)},bh.prototype.substring=function(v,j){var Q=new bh;return Q.text=this.text.substring(v,j),Q.sectionIndex=this.sectionIndex.slice(v,j),Q.sections=this.sections,Q},bh.prototype.toString=function(){return this.text},bh.prototype.getMaxScale=function(){var v=this;return this.sectionIndex.reduce(function(j,Q){return Math.max(j,v.sections[Q].scale)},0)},bh.prototype.addTextSection=function(v,j){this.text+=v.text,this.sections.push(Ep.forText(v.scale,v.fontStack||j));for(var Q=this.sections.length-1,Te=0;Te=Nm?null:++this.imageSectionID:(this.imageSectionID=Fm,this.imageSectionID)};function ip(v,j){for(var Q=[],Te=v.text,je=0,Ye=0,st=j;Ye=0,Br=0,ui=0;ui0&&mh>As&&(As=mh)}else{var qf=Q[Hs.fontStack],yp=qf&&qf[yl];if(yp&&yp.rect)Ku=yp.rect,Ks=yp.metrics;else{var wd=j[Hs.fontStack],Kp=wd&&wd[yl];if(!Kp)continue;Ks=Kp.metrics}Vs=(co-Hs.scale)*Rr}oc?(v.verticalizable=!0,Yo.push({glyph:yl,imageName:Wc,x:_i,y:Ii+Vs,vertical:oc,scale:Hs.scale,fontStack:Hs.fontStack,sectionIndex:tl,metrics:Ks,rect:Ku}),_i+=wh*Hs.scale+Tr):(Yo.push({glyph:yl,imageName:Wc,x:_i,y:Ii+Vs,vertical:oc,scale:Hs.scale,fontStack:Hs.fontStack,sectionIndex:tl,metrics:Ks,rect:Ku}),_i+=Ks.advance*Hs.scale+Tr)}if(Yo.length!==0){var Yp=_i-Tr;tn=Math.max(Yp,tn),YA(Yo,0,Yo.length-1,ba,As)}_i=0;var Xp=Ye*co+As;Ko.lineOffset=Math.max(As,Lo),Ii+=Xp,zn=Math.max(Xp,zn),++ma}var ap=Ii-Bh,m0=w3(st),g0=m0.horizontalAlign,Fd=m0.verticalAlign;XA(v.positionedLines,ba,g0,Fd,tn,zn,Ye,ap,je.length),v.top+=-Fd*ap,v.bottom=v.top+ap,v.left+=-g0*tn,v.right=v.left+tn}function YA(v,j,Q,Te,je){if(!(!Te&&!je))for(var Ye=v[Q],st=Ye.metrics.advance*Ye.scale,Ut=(v[Q].x+st)*Te,ir=j;ir<=Q;ir++)v[ir].x-=Ut,v[ir].y+=je}function XA(v,j,Q,Te,je,Ye,st,Ut,ir){var Tr=(j-Q)*je,Br=0;Ye!==st?Br=-Ut*Te-Bh:Br=(-Te*ir+.5)*st;for(var ui=0,_i=v;ui<_i.length;ui+=1)for(var Ii=_i[ui],tn=0,zn=Ii.positionedGlyphs;tn-Q/2;){if(st--,st<0)return!1;Ut-=v[st].dist(Ye),Ye=v[st]}Ut+=v[st].dist(v[st+1]),st++;for(var ir=[],Tr=0;UtTe;)Tr-=ir.shift().angleDelta;if(Tr>je)return!1;st++,Ut+=ui.dist(_i)}return!0}function vp(v){for(var j=0,Q=0;QTr){var tn=(Tr-ir)/Ii,zn=Eu(ui.x,_i.x,tn),ba=Eu(ui.y,_i.y,tn),ma=new Ly(zn,ba,_i.angleTo(ui),Br);return ma._round(),!st||vk(v,ma,Ut,st,j)?ma:void 0}ir+=Ii}}function c1(v,j,Q,Te,je,Ye,st,Ut,ir){var Tr=I0(Te,Ye,st),Br=hv(Te,je),ui=Br*st,_i=v[0].x===0||v[0].x===ir||v[0].y===0||v[0].y===ir;j-ui=0&&Pa=0&&co=0&&_i+Tr<=Br){var Lo=new Ly(Pa,co,za,tn);Lo._round(),(!Te||vk(v,Lo,Ye,Te,je))&&Ii.push(Lo)}}ui+=ma}return!Ut&&!Ii.length&&!st&&(Ii=Um(v,ui/2,Q,Te,je,Ye,st,!0,ir)),Ii}function Kz(v,j,Q,Te,je){for(var Ye=[],st=0;st=Te&&ui.x>=Te)&&(Br.x>=Te?Br=new u(Te,Br.y+(ui.y-Br.y)*((Te-Br.x)/(ui.x-Br.x)))._round():ui.x>=Te&&(ui=new u(Te,Br.y+(ui.y-Br.y)*((Te-Br.x)/(ui.x-Br.x)))._round()),!(Br.y>=je&&ui.y>=je)&&(Br.y>=je?Br=new u(Br.x+(ui.x-Br.x)*((je-Br.y)/(ui.y-Br.y)),je)._round():ui.y>=je&&(ui=new u(Br.x+(ui.x-Br.x)*((je-Br.y)/(ui.y-Br.y)),je)._round()),(!ir||!Br.equals(ir[ir.length-1]))&&(ir=[Br],Ye.push(ir)),ir.push(ui)))))}return Ye}var r2=Oh;function Yz(v,j,Q,Te){var je=[],Ye=v.image,st=Ye.pixelRatio,Ut=Ye.paddedRect.w-2*r2,ir=Ye.paddedRect.h-2*r2,Tr=v.right-v.left,Br=v.bottom-v.top,ui=Ye.stretchX||[[0,Ut]],_i=Ye.stretchY||[[0,ir]],Ii=function(qc,Yu){return qc+Yu[1]-Yu[0]},tn=ui.reduce(Ii,0),zn=_i.reduce(Ii,0),ba=Ut-tn,ma=ir-zn,za=0,Za=tn,Pa=0,co=zn,Lo=0,Ko=ba,Yo=0,As=ma;if(Ye.content&&Te){var Ms=Ye.content;za=yk(ui,0,Ms[0]),Pa=yk(_i,0,Ms[1]),Za=yk(ui,Ms[0],Ms[2]),co=yk(_i,Ms[1],Ms[3]),Lo=Ms[0]-za,Yo=Ms[1]-Pa,Ko=Ms[2]-Ms[0]-Za,As=Ms[3]-Ms[1]-co}var Hs=function(qc,Yu,qh,mh){var qf=_k(qc.stretch-za,Za,Tr,v.left),yp=xk(qc.fixed-Lo,Ko,qc.stretch,tn),wd=_k(Yu.stretch-Pa,co,Br,v.top),Kp=xk(Yu.fixed-Yo,As,Yu.stretch,zn),Yp=_k(qh.stretch-za,Za,Tr,v.left),Xp=xk(qh.fixed-Lo,Ko,qh.stretch,tn),ap=_k(mh.stretch-Pa,co,Br,v.top),m0=xk(mh.fixed-Yo,As,mh.stretch,zn),g0=new u(qf,wd),Fd=new u(Yp,wd),v0=new u(Yp,ap),xm=new u(qf,ap),d1=new u(yp/st,Kp/st),zy=new u(Xp/st,m0/st),Oy=j*Math.PI/180;if(Oy){var By=Math.sin(Oy),c2=Math.cos(Oy),og=[c2,-By,By,c2];g0._matMult(og),Fd._matMult(og),xm._matMult(og),v0._matMult(og)}var Ck=qc.stretch+qc.fixed,s7=qh.stretch+qh.fixed,Ak=Yu.stretch+Yu.fixed,l7=mh.stretch+mh.fixed,$m={x:Ye.paddedRect.x+r2+Ck,y:Ye.paddedRect.y+r2+Ak,w:s7-Ck,h:l7-Ak},h2=Ko/st/Tr,Mk=As/st/Br;return{tl:g0,tr:Fd,bl:xm,br:v0,tex:$m,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:d1,pixelOffsetBR:zy,minFontScaleX:h2,minFontScaleY:Mk,isSDF:Q}};if(!Te||!Ye.stretchX&&!Ye.stretchY)je.push(Hs({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Ut+1},{fixed:0,stretch:ir+1}));else for(var tl=Xz(ui,ba,tn),yl=Xz(_i,ma,zn),Vs=0;Vs0&&(Ii=Math.max(10,Ii),this.circleDiameter=Ii)}else{var tn=Ye.top*st-Ut,zn=Ye.bottom*st+Ut,ba=Ye.left*st-Ut,ma=Ye.right*st+Ut,za=Ye.collisionPadding;if(za&&(ba-=za[0]*st,tn-=za[1]*st,ma+=za[2]*st,zn+=za[3]*st),Tr){var Za=new u(ba,tn),Pa=new u(ma,tn),co=new u(ba,zn),Lo=new u(ma,zn),Ko=Tr*Math.PI/180;Za._rotate(Ko),Pa._rotate(Ko),co._rotate(Ko),Lo._rotate(Ko),ba=Math.min(Za.x,Pa.x,co.x,Lo.x),ma=Math.max(Za.x,Pa.x,co.x,Lo.x),tn=Math.min(Za.y,Pa.y,co.y,Lo.y),zn=Math.max(Za.y,Pa.y,co.y,Lo.y)}v.emplaceBack(j.x,j.y,ba,tn,ma,zn,Q,Te,je)}this.boxEndIndex=v.length},i2=function(v,j){if(v===void 0&&(v=[]),j===void 0&&(j=Wre),this.data=v,this.length=this.data.length,this.compare=j,this.length>0)for(var Q=(this.length>>1)-1;Q>=0;Q--)this._down(Q)};i2.prototype.push=function(v){this.data.push(v),this.length++,this._up(this.length-1)},i2.prototype.pop=function(){if(this.length!==0){var v=this.data[0],j=this.data.pop();return this.length--,this.length>0&&(this.data[0]=j,this._down(0)),v}},i2.prototype.peek=function(){return this.data[0]},i2.prototype._up=function(v){for(var j=this,Q=j.data,Te=j.compare,je=Q[v];v>0;){var Ye=v-1>>1,st=Q[Ye];if(Te(je,st)>=0)break;Q[v]=st,v=Ye}Q[v]=je},i2.prototype._down=function(v){for(var j=this,Q=j.data,Te=j.compare,je=this.length>>1,Ye=Q[v];v=0)break;Q[v]=Ut,v=st}Q[v]=Ye};function Wre(v,j){return vj?1:0}function qre(v,j,Q){Q===void 0&&(Q=!1);for(var Te=1/0,je=1/0,Ye=-1/0,st=-1/0,Ut=v[0],ir=0;irYe)&&(Ye=Tr.x),(!ir||Tr.y>st)&&(st=Tr.y)}var Br=Ye-Te,ui=st-je,_i=Math.min(Br,ui),Ii=_i/2,tn=new i2([],Gre);if(_i===0)return new u(Te,je);for(var zn=Te;znma.d||!ma.d)&&(ma=Za,Q&&console.log("found best %d after %d probes",Math.round(1e4*Za.d)/1e4,za)),!(Za.max-ma.d<=j)&&(Ii=Za.h/2,tn.push(new n2(Za.p.x-Ii,Za.p.y-Ii,Ii,v)),tn.push(new n2(Za.p.x+Ii,Za.p.y-Ii,Ii,v)),tn.push(new n2(Za.p.x-Ii,Za.p.y+Ii,Ii,v)),tn.push(new n2(Za.p.x+Ii,Za.p.y+Ii,Ii,v)),za+=4)}return Q&&(console.log("num probes: "+za),console.log("best distance: "+ma.d)),ma.p}function Gre(v,j){return j.max-v.max}function n2(v,j,Q,Te){this.p=new u(v,j),this.h=Q,this.d=Zre(this.p,Te),this.max=this.d+this.h*Math.SQRT2}function Zre(v,j){for(var Q=!1,Te=1/0,je=0;jev.y!=Br.y>v.y&&v.x<(Br.x-Tr.x)*(v.y-Tr.y)/(Br.y-Tr.y)+Tr.x&&(Q=!Q),Te=Math.min(Te,Cp(v,Tr,Br))}return(Q?1:-1)*Math.sqrt(Te)}function Kre(v){for(var j=0,Q=0,Te=0,je=v[0],Ye=0,st=je.length,Ut=st-1;Ye=Jo||og.y<0||og.y>=Jo||Jre(v,og,c2,Q,Te,je,yl,v.layers[0],v.collisionBoxArray,j.index,j.sourceLayerIndex,v.index,ma,co,Yo,ir,Za,Lo,As,Ii,j,Ye,Tr,Br,st)};if(Ms==="line")for(var Ks=0,Ku=Kz(j.geometry,0,0,Jo,Jo);Ks1){var wd=jm(yp,Ko,Q.vertical||tn,Te,zn,za);wd&&Vs(yp,wd)}}else if(j.type==="Polygon")for(var Kp=0,Yp=ng(j.geometry,0);KpIy&&G(v.layerIds[0]+': Value for "text-size" is >= '+T3+'. Reduce your "text-size".')):ba.kind==="composite"&&(ma=[_d*Ii.compositeTextSizes[0].evaluate(st,{},tn),_d*Ii.compositeTextSizes[1].evaluate(st,{},tn)],(ma[0]>Iy||ma[1]>Iy)&&G(v.layerIds[0]+': Value for "text-size" is >= '+T3+'. Reduce your "text-size".')),v.addSymbols(v.text,zn,ma,Ut,Ye,st,Tr,j,ir.lineStartIndex,ir.lineLength,_i,tn);for(var za=0,Za=Br;zaIy&&G(v.layerIds[0]+': Value for "icon-size" is >= '+T3+'. Reduce your "icon-size".')):g0.kind==="composite"&&(Fd=[_d*co.compositeIconSizes[0].evaluate(Pa,{},Ko),_d*co.compositeIconSizes[1].evaluate(Pa,{},Ko)],(Fd[0]>Iy||Fd[1]>Iy)&&G(v.layerIds[0]+': Value for "icon-size" is >= '+T3+'. Reduce your "icon-size".')),v.addSymbols(v.icon,ap,Fd,Za,za,Pa,!1,j,Ms.lineStartIndex,Ms.lineLength,-1,Ko),oc=v.icon.placedSymbolArray.length-1,m0&&(Ku=m0.length*4,v.addSymbols(v.icon,m0,Fd,Za,za,Pa,of.vertical,j,Ms.lineStartIndex,Ms.lineLength,-1,Ko),qc=v.icon.placedSymbolArray.length-1)}for(var v0 in Te.horizontal){var xm=Te.horizontal[v0];if(!Hs){qh=We(xm.text);var d1=Ut.layout.get("text-rotate").evaluate(Pa,{},Ko);Hs=new bk(ir,j,Tr,Br,ui,xm,_i,Ii,tn,d1)}var zy=xm.positionedLines.length===1;if(Wc+=Qz(v,j,xm,Ye,Ut,tn,Pa,zn,Ms,Te.vertical?of.horizontal:of.horizontalOnly,zy?Object.keys(Te.horizontal):[v0],Yu,oc,co,Ko),zy)break}Te.vertical&&(wh+=Qz(v,j,Te.vertical,Ye,Ut,tn,Pa,zn,Ms,of.vertical,["vertical"],Yu,qc,co,Ko));var Oy=Hs?Hs.boxStartIndex:v.collisionBoxArray.length,By=Hs?Hs.boxEndIndex:v.collisionBoxArray.length,c2=yl?yl.boxStartIndex:v.collisionBoxArray.length,og=yl?yl.boxEndIndex:v.collisionBoxArray.length,Ck=tl?tl.boxStartIndex:v.collisionBoxArray.length,s7=tl?tl.boxEndIndex:v.collisionBoxArray.length,Ak=Vs?Vs.boxStartIndex:v.collisionBoxArray.length,l7=Vs?Vs.boxEndIndex:v.collisionBoxArray.length,$m=-1,h2=function(A3,gO){return A3&&A3.circleDiameter?Math.max(A3.circleDiameter,gO):gO};$m=h2(Hs,$m),$m=h2(yl,$m),$m=h2(tl,$m),$m=h2(Vs,$m);var Mk=$m>-1?1:0;Mk&&($m*=Yo/Rr),v.glyphOffsetArray.length>=ah.MAX_GLYPHS&&G("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Pa.sortKey!==void 0&&v.addToSortKeyRanges(v.symbolInstances.length,Pa.sortKey),v.symbolInstances.emplaceBack(j.x,j.y,Yu.right>=0?Yu.right:-1,Yu.center>=0?Yu.center:-1,Yu.left>=0?Yu.left:-1,Yu.vertical||-1,oc,qc,qh,Oy,By,c2,og,Ck,s7,Ak,l7,Tr,Wc,wh,Ks,Ku,Mk,0,_i,mh,qf,$m)}function Qre(v,j,Q,Te){var je=v.compareText;if(!(j in je))je[j]=[];else for(var Ye=je[j],st=Ye.length-1;st>=0;st--)if(Te.dist(Ye[st])0)&&(Ye.value.kind!=="constant"||Ye.value.value.length>0),Tr=Ut.value.kind!=="constant"||!!Ut.value.value||Object.keys(Ut.parameters).length>0,Br=je.get("symbol-sort-key");if(this.features=[],!(!ir&&!Tr)){for(var ui=j.iconDependencies,_i=j.glyphDependencies,Ii=j.availableImages,tn=new Zl(this.zoom),zn=0,ba=v;zn=0;for(var Wc=0,wh=Yo.sections;Wc=0;Ut--)Ye[Ut]={x:j[Ut].x,y:j[Ut].y,tileUnitDistanceFromAnchor:je},Ut>0&&(je+=j[Ut-1].dist(j[Ut]));for(var ir=0;ir0},ah.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ah.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ah.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ah.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ah.prototype.addIndicesForPlacedSymbol=function(v,j){for(var Q=v.placedSymbolArray.get(j),Te=Q.vertexStartIndex+Q.numGlyphs*4,je=Q.vertexStartIndex;je1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(v),this.sortedAngle=v,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var Q=0,Te=this.symbolInstanceIndexes;Q=0&&ir.indexOf(st)===Ut&&j.addIndicesForPlacedSymbol(j.text,st)}),Ye.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ye.verticalPlacedTextSymbolIndex),Ye.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ye.placedIconSymbolIndex),Ye.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ye.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dr("SymbolBucket",ah,{omit:["layers","collisionBoxArray","features","compareText"]}),ah.MAX_GLYPHS=65535,ah.addDynamicAttributes=r7;function iie(v,j){return j.replace(/{([^{}]+)}/g,function(Q,Te){return Te in v?String(v[Te]):""})}var nie=new ao({"symbol-placement":new Oi($a.layout_symbol["symbol-placement"]),"symbol-spacing":new Oi($a.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Oi($a.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Tn($a.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Oi($a.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Oi($a.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Oi($a.layout_symbol["icon-ignore-placement"]),"icon-optional":new Oi($a.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Oi($a.layout_symbol["icon-rotation-alignment"]),"icon-size":new Tn($a.layout_symbol["icon-size"]),"icon-text-fit":new Oi($a.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Oi($a.layout_symbol["icon-text-fit-padding"]),"icon-image":new Tn($a.layout_symbol["icon-image"]),"icon-rotate":new Tn($a.layout_symbol["icon-rotate"]),"icon-padding":new Oi($a.layout_symbol["icon-padding"]),"icon-keep-upright":new Oi($a.layout_symbol["icon-keep-upright"]),"icon-offset":new Tn($a.layout_symbol["icon-offset"]),"icon-anchor":new Tn($a.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Oi($a.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Oi($a.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Oi($a.layout_symbol["text-rotation-alignment"]),"text-field":new Tn($a.layout_symbol["text-field"]),"text-font":new Tn($a.layout_symbol["text-font"]),"text-size":new Tn($a.layout_symbol["text-size"]),"text-max-width":new Tn($a.layout_symbol["text-max-width"]),"text-line-height":new Oi($a.layout_symbol["text-line-height"]),"text-letter-spacing":new Tn($a.layout_symbol["text-letter-spacing"]),"text-justify":new Tn($a.layout_symbol["text-justify"]),"text-radial-offset":new Tn($a.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Oi($a.layout_symbol["text-variable-anchor"]),"text-anchor":new Tn($a.layout_symbol["text-anchor"]),"text-max-angle":new Oi($a.layout_symbol["text-max-angle"]),"text-writing-mode":new Oi($a.layout_symbol["text-writing-mode"]),"text-rotate":new Tn($a.layout_symbol["text-rotate"]),"text-padding":new Oi($a.layout_symbol["text-padding"]),"text-keep-upright":new Oi($a.layout_symbol["text-keep-upright"]),"text-transform":new Tn($a.layout_symbol["text-transform"]),"text-offset":new Tn($a.layout_symbol["text-offset"]),"text-allow-overlap":new Oi($a.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Oi($a.layout_symbol["text-ignore-placement"]),"text-optional":new Oi($a.layout_symbol["text-optional"])}),aie=new ao({"icon-opacity":new Tn($a.paint_symbol["icon-opacity"]),"icon-color":new Tn($a.paint_symbol["icon-color"]),"icon-halo-color":new Tn($a.paint_symbol["icon-halo-color"]),"icon-halo-width":new Tn($a.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Tn($a.paint_symbol["icon-halo-blur"]),"icon-translate":new Oi($a.paint_symbol["icon-translate"]),"icon-translate-anchor":new Oi($a.paint_symbol["icon-translate-anchor"]),"text-opacity":new Tn($a.paint_symbol["text-opacity"]),"text-color":new Tn($a.paint_symbol["text-color"],{runtimeType:pu,getOverride:function(v){return v.textColor},hasOverride:function(v){return!!v.textColor}}),"text-halo-color":new Tn($a.paint_symbol["text-halo-color"]),"text-halo-width":new Tn($a.paint_symbol["text-halo-width"]),"text-halo-blur":new Tn($a.paint_symbol["text-halo-blur"]),"text-translate":new Oi($a.paint_symbol["text-translate"]),"text-translate-anchor":new Oi($a.paint_symbol["text-translate-anchor"])}),i7={paint:aie,layout:nie},s2=function(v){this.type=v.property.overrides?v.property.overrides.runtimeType:Gu,this.defaultValue=v};s2.prototype.evaluate=function(v){if(v.formattedSection){var j=this.defaultValue.property.overrides;if(j&&j.hasOverride(v.formattedSection))return j.getOverride(v.formattedSection)}return v.feature&&v.featureState?this.defaultValue.evaluate(v.feature,v.featureState):this.defaultValue.property.specification.default},s2.prototype.eachChild=function(v){if(!this.defaultValue.isConstant()){var j=this.defaultValue.value;v(j._styleExpression.expression)}},s2.prototype.outputDefined=function(){return!1},s2.prototype.serialize=function(){return null},dr("FormatSectionOverride",s2,{omit:["defaultValue"]});var oie=function(v){function j(Q){v.call(this,Q,i7)}return v&&(j.__proto__=v),j.prototype=Object.create(v&&v.prototype),j.prototype.constructor=j,j.prototype.recalculate=function(Q,Te){if(v.prototype.recalculate.call(this,Q,Te),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var je=this.layout.get("text-writing-mode");if(je){for(var Ye=[],st=0,Ut=je;st",targetMapId:Te,sourceMapId:Ye.mapId})}}},l2.prototype.receive=function(v){var j=v.data,Q=j.id;if(Q&&!(j.targetMapId&&this.mapId!==j.targetMapId))if(j.type===""){delete this.tasks[Q];var Te=this.cancelCallbacks[Q];delete this.cancelCallbacks[Q],Te&&Te()}else ve()||j.mustQueue?(this.tasks[Q]=j,this.taskQueue.push(Q),this.invoker.trigger()):this.processTask(Q,j)},l2.prototype.process=function(){if(this.taskQueue.length){var v=this.taskQueue.shift(),j=this.tasks[v];delete this.tasks[v],this.taskQueue.length&&this.invoker.trigger(),j&&this.processTask(v,j)}},l2.prototype.processTask=function(v,j){var Q=this;if(j.type===""){var Te=this.callbacks[v];delete this.callbacks[v],Te&&(j.error?Te(Bi(j.error)):Te(null,Bi(j.data)))}else{var je=!1,Ye=ge(this.globalScope)?void 0:[],st=j.hasCallback?function(ui,_i){je=!0,delete Q.cancelCallbacks[v],Q.target.postMessage({id:v,type:"",sourceMapId:Q.mapId,error:ui?hi(ui):null,data:hi(_i,Ye)},Ye)}:function(ui){je=!0},Ut=null,ir=Bi(j.data);if(this.parent[j.type])Ut=this.parent[j.type](j.sourceMapId,ir,st);else if(this.parent.getWorkerSource){var Tr=j.type.split("."),Br=this.parent.getWorkerSource(j.sourceMapId,Tr[0],ir.source);Ut=Br[Tr[1]](ir,st)}else st(new Error("Could not find function "+j.type));!je&&Ut&&Ut.cancel&&(this.cancelCallbacks[v]=Ut.cancel)}},l2.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function vie(v,j,Q){j=Math.pow(2,Q)-j-1;var Te=aO(v*256,j*256,Q),je=aO((v+1)*256,(j+1)*256,Q);return Te[0]+","+Te[1]+","+je[0]+","+je[1]}function aO(v,j,Q){var Te=2*Math.PI*6378137/256/Math.pow(2,Q),je=v*Te-2*Math.PI*6378137/2,Ye=j*Te-2*Math.PI*6378137/2;return[je,Ye]}var xd=function(v,j){v&&(j?this.setSouthWest(v).setNorthEast(j):v.length===4?this.setSouthWest([v[0],v[1]]).setNorthEast([v[2],v[3]]):this.setSouthWest(v[0]).setNorthEast(v[1]))};xd.prototype.setNorthEast=function(v){return this._ne=v instanceof sf?new sf(v.lng,v.lat):sf.convert(v),this},xd.prototype.setSouthWest=function(v){return this._sw=v instanceof sf?new sf(v.lng,v.lat):sf.convert(v),this},xd.prototype.extend=function(v){var j=this._sw,Q=this._ne,Te,je;if(v instanceof sf)Te=v,je=v;else if(v instanceof xd){if(Te=v._sw,je=v._ne,!Te||!je)return this}else{if(Array.isArray(v))if(v.length===4||v.every(Array.isArray)){var Ye=v;return this.extend(xd.convert(Ye))}else{var st=v;return this.extend(sf.convert(st))}return this}return!j&&!Q?(this._sw=new sf(Te.lng,Te.lat),this._ne=new sf(je.lng,je.lat)):(j.lng=Math.min(Te.lng,j.lng),j.lat=Math.min(Te.lat,j.lat),Q.lng=Math.max(je.lng,Q.lng),Q.lat=Math.max(je.lat,Q.lat)),this},xd.prototype.getCenter=function(){return new sf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xd.prototype.getSouthWest=function(){return this._sw},xd.prototype.getNorthEast=function(){return this._ne},xd.prototype.getNorthWest=function(){return new sf(this.getWest(),this.getNorth())},xd.prototype.getSouthEast=function(){return new sf(this.getEast(),this.getSouth())},xd.prototype.getWest=function(){return this._sw.lng},xd.prototype.getSouth=function(){return this._sw.lat},xd.prototype.getEast=function(){return this._ne.lng},xd.prototype.getNorth=function(){return this._ne.lat},xd.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},xd.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xd.prototype.isEmpty=function(){return!(this._sw&&this._ne)},xd.prototype.contains=function(v){var j=sf.convert(v),Q=j.lng,Te=j.lat,je=this._sw.lat<=Te&&Te<=this._ne.lat,Ye=this._sw.lng<=Q&&Q<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ye=this._sw.lng>=Q&&Q>=this._ne.lng),je&&Ye},xd.convert=function(v){return!v||v instanceof xd?v:new xd(v)};var oO=63710088e-1,sf=function(v,j){if(isNaN(v)||isNaN(j))throw new Error("Invalid LngLat object: ("+v+", "+j+")");if(this.lng=+v,this.lat=+j,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};sf.prototype.wrap=function(){return new sf(k(this.lng,-180,180),this.lat)},sf.prototype.toArray=function(){return[this.lng,this.lat]},sf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},sf.prototype.distanceTo=function(v){var j=Math.PI/180,Q=this.lat*j,Te=v.lat*j,je=Math.sin(Q)*Math.sin(Te)+Math.cos(Q)*Math.cos(Te)*Math.cos((v.lng-this.lng)*j),Ye=oO*Math.acos(Math.min(je,1));return Ye},sf.prototype.toBounds=function(v){v===void 0&&(v=0);var j=40075017,Q=360*v/j,Te=Q/Math.cos(Math.PI/180*this.lat);return new xd(new sf(this.lng-Te,this.lat-Q),new sf(this.lng+Te,this.lat+Q))},sf.convert=function(v){if(v instanceof sf)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new sf(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&typeof v=="object"&&v!==null)return new sf(Number("lng"in v?v.lng:v.lon),Number(v.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var sO=2*Math.PI*oO;function lO(v){return sO*Math.cos(v*Math.PI/180)}function uO(v){return(180+v)/360}function cO(v){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+v*Math.PI/360)))/360}function hO(v,j){return v/lO(j)}function yie(v){return v*360-180}function a7(v){var j=180-v*360;return 360/Math.PI*Math.atan(Math.exp(j*Math.PI/180))-90}function _ie(v,j){return v*lO(a7(j))}function xie(v){return 1/Math.cos(v*Math.PI/180)}var nx=function(v,j,Q){Q===void 0&&(Q=0),this.x=+v,this.y=+j,this.z=+Q};nx.fromLngLat=function(v,j){j===void 0&&(j=0);var Q=sf.convert(v);return new nx(uO(Q.lng),cO(Q.lat),hO(j,Q.lat))},nx.prototype.toLngLat=function(){return new sf(yie(this.x),a7(this.y))},nx.prototype.toAltitude=function(){return _ie(this.z,this.y)},nx.prototype.meterInMercatorCoordinateUnits=function(){return 1/sO*xie(a7(this.y))};var ax=function(v,j,Q){this.z=v,this.x=j,this.y=Q,this.key=C3(0,v,v,j,Q)};ax.prototype.equals=function(v){return this.z===v.z&&this.x===v.x&&this.y===v.y},ax.prototype.url=function(v,j){var Q=vie(this.x,this.y,this.z),Te=bie(this.z,this.x,this.y);return v[(this.x+this.y)%v.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(j==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Te).replace("{bbox-epsg-3857}",Q)},ax.prototype.getTilePoint=function(v){var j=Math.pow(2,this.z);return new u((v.x*j-this.x)*Jo,(v.y*j-this.y)*Jo)},ax.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var fO=function(v,j){this.wrap=v,this.canonical=j,this.key=C3(v,j.z,j.z,j.x,j.y)},bd=function(v,j,Q,Te,je){this.overscaledZ=v,this.wrap=j,this.canonical=new ax(Q,+Te,+je),this.key=C3(j,v,Q,Te,je)};bd.prototype.equals=function(v){return this.overscaledZ===v.overscaledZ&&this.wrap===v.wrap&&this.canonical.equals(v.canonical)},bd.prototype.scaledTo=function(v){var j=this.canonical.z-v;return v>this.canonical.z?new bd(v,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new bd(v,this.wrap,v,this.canonical.x>>j,this.canonical.y>>j)},bd.prototype.calculateScaledKey=function(v,j){var Q=this.canonical.z-v;return v>this.canonical.z?C3(this.wrap*+j,v,this.canonical.z,this.canonical.x,this.canonical.y):C3(this.wrap*+j,v,v,this.canonical.x>>Q,this.canonical.y>>Q)},bd.prototype.isChildOf=function(v){if(v.wrap!==this.wrap)return!1;var j=this.canonical.z-v.canonical.z;return v.overscaledZ===0||v.overscaledZ>j&&v.canonical.y===this.canonical.y>>j},bd.prototype.children=function(v){if(this.overscaledZ>=v)return[new bd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var j=this.canonical.z+1,Q=this.canonical.x*2,Te=this.canonical.y*2;return[new bd(j,this.wrap,j,Q,Te),new bd(j,this.wrap,j,Q+1,Te),new bd(j,this.wrap,j,Q,Te+1),new bd(j,this.wrap,j,Q+1,Te+1)]},bd.prototype.isLessThan=function(v){return this.wrapv.wrap?!1:this.overscaledZv.overscaledZ?!1:this.canonical.xv.canonical.x?!1:this.canonical.y0;Ye--)je=1<=this.dim+1||j<-1||j>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(j+1)*this.stride+(v+1)},h1.prototype._unpackMapbox=function(v,j,Q){return(v*256*256+j*256+Q)/10-1e4},h1.prototype._unpackTerrarium=function(v,j,Q){return v*256+j+Q/256-32768},h1.prototype.getPixels=function(){return new pp({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},h1.prototype.backfillBorder=function(v,j,Q){if(this.dim!==v.dim)throw new Error("dem dimension mismatch");var Te=j*this.dim,je=j*this.dim+this.dim,Ye=Q*this.dim,st=Q*this.dim+this.dim;switch(j){case-1:Te=je-1;break;case 1:je=Te+1;break}switch(Q){case-1:Ye=st-1;break;case 1:st=Ye+1;break}for(var Ut=-j*this.dim,ir=-Q*this.dim,Tr=Ye;Tr=0&&Br[3]>=0&&Ut.insert(st,Br[0],Br[1],Br[2],Br[3])}},f1.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new u1.VectorTile(new Gi(this.rawTileData)).layers,this.sourceLayerCoder=new Tk(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},f1.prototype.query=function(v,j,Q,Te){var je=this;this.loadVTLayers();for(var Ye=v.params||{},st=Jo/v.tileSize/v.scale,Ut=lt(Ye.filter),ir=v.queryGeometry,Tr=v.queryPadding*st,Br=pO(ir),ui=this.grid.query(Br.minX-Tr,Br.minY-Tr,Br.maxX+Tr,Br.maxY+Tr),_i=pO(v.cameraQueryGeometry),Ii=this.grid3D.query(_i.minX-Tr,_i.minY-Tr,_i.maxX+Tr,_i.maxY+Tr,function(co,Lo,Ko,Yo){return rg(v.cameraQueryGeometry,co-Tr,Lo-Tr,Ko+Tr,Yo+Tr)}),tn=0,zn=Ii;tnTe)je=!1;else if(!j)je=!0;else if(this.expirationTime=Gr.maxzoom)&&Gr.visibility!=="none"){m(si,this.zoom,_r);var li=Ln[Gr.id]=Gr.createBucket({index:Hi.bucketLayerIDs.length,layers:si,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Mn,sourceID:this.source});li.populate(Ha,Fn,this.tileID.canonical),Hi.bucketLayerIDs.push(si.map(function(Zi){return Zi.id}))}}}}var Pi,xi,zt,xr,Qr=i.mapObject(Fn.glyphDependencies,function(Zi){return Object.keys(Zi).map(Number)});Object.keys(Qr).length?Er.send("getGlyphs",{uid:this.uid,stacks:Qr},function(Zi,Wi){Pi||(Pi=Zi,xi=Wi,_n.call(qi))}):xi={};var Ri=Object.keys(Fn.iconDependencies);Ri.length?Er.send("getImages",{icons:Ri,source:this.source,tileID:this.tileID,type:"icons"},function(Zi,Wi){Pi||(Pi=Zi,zt=Wi,_n.call(qi))}):zt={};var en=Object.keys(Fn.patternDependencies);en.length?Er.send("getImages",{icons:en,source:this.source,tileID:this.tileID,type:"patterns"},function(Zi,Wi){Pi||(Pi=Zi,xr=Wi,_n.call(qi))}):xr={},_n.call(this);function _n(){if(Pi)return di(Pi);if(xi&&zt&&xr){var Zi=new s(xi),Wi=new i.ImageAtlas(zt,xr);for(var pn in Ln){var Ua=Ln[pn];Ua instanceof i.SymbolBucket?(m(Ua.layers,this.zoom,_r),i.performSymbolLayout(Ua,xi,Zi.positions,zt,Wi.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ua.hasPattern&&(Ua instanceof i.LineBucket||Ua instanceof i.FillBucket||Ua instanceof i.FillExtrusionBucket)&&(m(Ua.layers,this.zoom,_r),Ua.addFeatures(Fn,this.tileID.canonical,Wi.patternPositions))}this.status="done",di(null,{buckets:i.values(Ln).filter(function(ea){return!ea.isEmpty()}),featureIndex:Hi,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Zi.image,imageAtlas:Wi,glyphMap:this.returnDependencies?xi:null,iconMap:this.returnDependencies?zt:null,glyphPositions:this.returnDependencies?Zi.positions:null})}}};function m(Kt,lr,_r){for(var Er=new i.EvaluationParameters(lr),di=0,qi=Kt;di=0!=!!lr&&Kt.reverse()}var E=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,I=function(Kt){this._feature=Kt,this.extent=i.EXTENT,this.type=Kt.type,this.properties=Kt.tags,"id"in Kt&&!isNaN(Kt.id)&&(this.id=parseInt(Kt.id,10))};I.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Kt=[],lr=0,_r=this._feature.geometry;lr<_r.length;lr+=1){var Er=_r[lr];Kt.push([new i.Point$1(Er[0],Er[1])])}return Kt}else{for(var di=[],qi=0,Ui=this._feature.geometry;qi"u"&&(Er.push(Hi),Ln=Er.length-1,qi[Hi]=Ln),lr.writeVarint(Ln);var Fn=_r.properties[Hi],Kn=typeof Fn;Kn!=="string"&&Kn!=="boolean"&&Kn!=="number"&&(Fn=JSON.stringify(Fn));var Jn=Kn+":"+Fn,sa=Ui[Jn];typeof sa>"u"&&(di.push(Fn),sa=di.length-1,Ui[Jn]=sa),lr.writeVarint(sa)}}function he(Kt,lr){return(lr<<3)+(Kt&7)}function be(Kt){return Kt<<1^Kt>>31}function ve(Kt,lr){for(var _r=Kt.loadGeometry(),Er=Kt.type,di=0,qi=0,Ui=_r.length,Hi=0;Hi>1;ge(Kt,lr,Ui,Er,di,qi%2),re(Kt,lr,_r,Er,Ui-1,qi+1),re(Kt,lr,_r,Ui+1,di,qi+1)}}function ge(Kt,lr,_r,Er,di,qi){for(;di>Er;){if(di-Er>600){var Ui=di-Er+1,Hi=_r-Er+1,Ln=Math.log(Ui),Fn=.5*Math.exp(2*Ln/3),Kn=.5*Math.sqrt(Ln*Fn*(Ui-Fn)/Ui)*(Hi-Ui/2<0?-1:1),Jn=Math.max(Er,Math.floor(_r-Hi*Fn/Ui+Kn)),sa=Math.min(di,Math.floor(_r+(Ui-Hi)*Fn/Ui+Kn));ge(Kt,lr,_r,Jn,sa,qi)}var Mn=lr[2*_r+qi],Ha=Er,io=di;for(ne(Kt,lr,Er,_r),lr[2*di+qi]>Mn&&ne(Kt,lr,Er,di);HaMn;)io--}lr[2*Er+qi]===Mn?ne(Kt,lr,Er,io):(io++,ne(Kt,lr,io,di)),io<=_r&&(Er=io+1),_r<=io&&(di=io-1)}}function ne(Kt,lr,_r,Er){se(Kt,_r,Er),se(lr,2*_r,2*Er),se(lr,2*_r+1,2*Er+1)}function se(Kt,lr,_r){var Er=Kt[lr];Kt[lr]=Kt[_r],Kt[_r]=Er}function _e(Kt,lr,_r,Er,di,qi,Ui){for(var Hi=[0,Kt.length-1,0],Ln=[],Fn,Kn;Hi.length;){var Jn=Hi.pop(),sa=Hi.pop(),Mn=Hi.pop();if(sa-Mn<=Ui){for(var Ha=Mn;Ha<=sa;Ha++)Fn=lr[2*Ha],Kn=lr[2*Ha+1],Fn>=_r&&Fn<=di&&Kn>=Er&&Kn<=qi&&Ln.push(Kt[Ha]);continue}var io=Math.floor((Mn+sa)/2);Fn=lr[2*io],Kn=lr[2*io+1],Fn>=_r&&Fn<=di&&Kn>=Er&&Kn<=qi&&Ln.push(Kt[io]);var Ft=(Jn+1)%2;(Jn===0?_r<=Fn:Er<=Kn)&&(Hi.push(Mn),Hi.push(io-1),Hi.push(Ft)),(Jn===0?di>=Fn:qi>=Kn)&&(Hi.push(io+1),Hi.push(sa),Hi.push(Ft))}return Ln}function oe(Kt,lr,_r,Er,di,qi){for(var Ui=[0,Kt.length-1,0],Hi=[],Ln=di*di;Ui.length;){var Fn=Ui.pop(),Kn=Ui.pop(),Jn=Ui.pop();if(Kn-Jn<=qi){for(var sa=Jn;sa<=Kn;sa++)J(lr[2*sa],lr[2*sa+1],_r,Er)<=Ln&&Hi.push(Kt[sa]);continue}var Mn=Math.floor((Jn+Kn)/2),Ha=lr[2*Mn],io=lr[2*Mn+1];J(Ha,io,_r,Er)<=Ln&&Hi.push(Kt[Mn]);var Ft=(Fn+1)%2;(Fn===0?_r-di<=Ha:Er-di<=io)&&(Ui.push(Jn),Ui.push(Mn-1),Ui.push(Ft)),(Fn===0?_r+di>=Ha:Er+di>=io)&&(Ui.push(Mn+1),Ui.push(Kn),Ui.push(Ft))}return Hi}function J(Kt,lr,_r,Er){var di=Kt-_r,qi=lr-Er;return di*di+qi*qi}var me=function(Kt){return Kt[0]},fe=function(Kt){return Kt[1]},Ce=function(Kt,lr,_r,Er,di){lr===void 0&&(lr=me),_r===void 0&&(_r=fe),Er===void 0&&(Er=64),di===void 0&&(di=Float64Array),this.nodeSize=Er,this.points=Kt;for(var qi=Kt.length<65536?Uint16Array:Uint32Array,Ui=this.ids=new qi(Kt.length),Hi=this.coords=new di(Kt.length*2),Ln=0;Ln=Er;Fn--){var Kn=+Date.now();Hi=this._cluster(Hi,Fn),this.trees[Fn]=new Ce(Hi,Le,nt,qi,Float32Array),_r&&console.log("z%d: %d clusters in %dms",Fn,Hi.length,+Date.now()-Kn)}return _r&&console.timeEnd("total time"),this},Be.prototype.getClusters=function(Kt,lr){var _r=((Kt[0]+180)%360+360)%360-180,Er=Math.max(-90,Math.min(90,Kt[1])),di=Kt[2]===180?180:((Kt[2]+180)%360+360)%360-180,qi=Math.max(-90,Math.min(90,Kt[3]));if(Kt[2]-Kt[0]>=360)_r=-180,di=180;else if(_r>di){var Ui=this.getClusters([_r,Er,180,qi],lr),Hi=this.getClusters([-180,Er,di,qi],lr);return Ui.concat(Hi)}for(var Ln=this.trees[this._limitZoom(lr)],Fn=Ln.range(mt(_r),vt(qi),mt(di),vt(Er)),Kn=[],Jn=0,sa=Fn;Jnlr&&(Ha+=qr.numPoints||1)}if(Ha>=Hi){for(var ai=Kn.x*Mn,si=Kn.y*Mn,Gr=Ui&&Mn>1?this._map(Kn,!0):null,li=(Fn<<5)+(lr+1)+this.points.length,Pi=0,xi=sa;Pi1)for(var Ri=0,en=sa;Ri>5},Be.prototype._getOriginZoom=function(Kt){return(Kt-this.points.length)%32},Be.prototype._map=function(Kt,lr){if(Kt.numPoints)return lr?Oe({},Kt.properties):Kt.properties;var _r=this.points[Kt.index].properties,Er=this.options.map(_r);return lr&&Er===_r?Oe({},Er):Er};function Ze(Kt,lr,_r,Er,di){return{x:Kt,y:lr,zoom:1/0,id:_r,parentId:-1,numPoints:Er,properties:di}}function Ge(Kt,lr){var _r=Kt.geometry.coordinates,Er=_r[0],di=_r[1];return{x:mt(Er),y:vt(di),zoom:1/0,index:lr,parentId:-1}}function tt(Kt){return{type:"Feature",id:Kt.id,properties:_t(Kt),geometry:{type:"Point",coordinates:[ct(Kt.x),Ae(Kt.y)]}}}function _t(Kt){var lr=Kt.numPoints,_r=lr>=1e4?Math.round(lr/1e3)+"k":lr>=1e3?Math.round(lr/100)/10+"k":lr;return Oe(Oe({},Kt.properties),{cluster:!0,cluster_id:Kt.id,point_count:lr,point_count_abbreviated:_r})}function mt(Kt){return Kt/360+.5}function vt(Kt){var lr=Math.sin(Kt*Math.PI/180),_r=.5-.25*Math.log((1+lr)/(1-lr))/Math.PI;return _r<0?0:_r>1?1:_r}function ct(Kt){return(Kt-.5)*360}function Ae(Kt){var lr=(180-Kt*360)*Math.PI/180;return 360*Math.atan(Math.exp(lr))/Math.PI-90}function Oe(Kt,lr){for(var _r in lr)Kt[_r]=lr[_r];return Kt}function Le(Kt){return Kt.x}function nt(Kt){return Kt.y}function xt(Kt,lr,_r,Er){for(var di=Er,qi=_r-lr>>1,Ui=_r-lr,Hi,Ln=Kt[lr],Fn=Kt[lr+1],Kn=Kt[_r],Jn=Kt[_r+1],sa=lr+3;sa<_r;sa+=3){var Mn=ut(Kt[sa],Kt[sa+1],Ln,Fn,Kn,Jn);if(Mn>di)Hi=sa,di=Mn;else if(Mn===di){var Ha=Math.abs(sa-qi);HaEr&&(Hi-lr>3&&xt(Kt,lr,Hi,Er),Kt[Hi+2]=di,_r-Hi>3&&xt(Kt,Hi,_r,Er))}function ut(Kt,lr,_r,Er,di,qi){var Ui=di-_r,Hi=qi-Er;if(Ui!==0||Hi!==0){var Ln=((Kt-_r)*Ui+(lr-Er)*Hi)/(Ui*Ui+Hi*Hi);Ln>1?(_r=di,Er=qi):Ln>0&&(_r+=Ui*Ln,Er+=Hi*Ln)}return Ui=Kt-_r,Hi=lr-Er,Ui*Ui+Hi*Hi}function Et(Kt,lr,_r,Er){var di={id:typeof Kt>"u"?null:Kt,type:lr,geometry:_r,tags:Er,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Gt(di),di}function Gt(Kt){var lr=Kt.geometry,_r=Kt.type;if(_r==="Point"||_r==="MultiPoint"||_r==="LineString")Qt(Kt,lr);else if(_r==="Polygon"||_r==="MultiLineString")for(var Er=0;Er0&&(Er?Ui+=(di*Fn-Ln*qi)/2:Ui+=Math.sqrt(Math.pow(Ln-di,2)+Math.pow(Fn-qi,2))),di=Ln,qi=Fn}var Kn=lr.length-3;lr[2]=1,xt(lr,0,Kn,_r),lr[Kn+2]=1,lr.size=Math.abs(Ui),lr.start=0,lr.end=lr.size}function Lr(Kt,lr,_r,Er){for(var di=0;di1?1:_r}function Ot(Kt,lr,_r,Er,di,qi,Ui,Hi){if(_r/=lr,Er/=lr,qi>=_r&&Ui=Er)return null;for(var Ln=[],Fn=0;Fn=_r&&Ha=Er)continue;var io=[];if(sa==="Point"||sa==="MultiPoint")Xe(Jn,io,_r,Er,di);else if(sa==="LineString")ot(Jn,io,_r,Er,di,!1,Hi.lineMetrics);else if(sa==="MultiLineString")ye(Jn,io,_r,Er,di,!1);else if(sa==="Polygon")ye(Jn,io,_r,Er,di,!0);else if(sa==="MultiPolygon")for(var Ft=0;Ft=_r&&Ui<=Er&&(lr.push(Kt[qi]),lr.push(Kt[qi+1]),lr.push(Kt[qi+2]))}}function ot(Kt,lr,_r,Er,di,qi,Ui){for(var Hi=De(Kt),Ln=di===0?He:at,Fn=Kt.start,Kn,Jn,sa=0;sa_r&&(Jn=Ln(Hi,Mn,Ha,Ft,Rt,_r),Ui&&(Hi.start=Fn+Kn*Jn)):qr>Er?ai=_r&&(Jn=Ln(Hi,Mn,Ha,Ft,Rt,_r),si=!0),ai>Er&&qr<=Er&&(Jn=Ln(Hi,Mn,Ha,Ft,Rt,Er),si=!0),!qi&&si&&(Ui&&(Hi.end=Fn+Kn*Jn),lr.push(Hi),Hi=De(Kt)),Ui&&(Fn+=Kn)}var Gr=Kt.length-3;Mn=Kt[Gr],Ha=Kt[Gr+1],io=Kt[Gr+2],qr=di===0?Mn:Ha,qr>=_r&&qr<=Er&&Pe(Hi,Mn,Ha,io),Gr=Hi.length-3,qi&&Gr>=3&&(Hi[Gr]!==Hi[0]||Hi[Gr+1]!==Hi[1])&&Pe(Hi,Hi[0],Hi[1],Hi[2]),Hi.length&&lr.push(Hi)}function De(Kt){var lr=[];return lr.size=Kt.size,lr.start=Kt.start,lr.end=Kt.end,lr}function ye(Kt,lr,_r,Er,di,qi){for(var Ui=0;UiUi.maxX&&(Ui.maxX=Kn),Jn>Ui.maxY&&(Ui.maxY=Jn)}return Ui}function Dr(Kt,lr,_r,Er){var di=lr.geometry,qi=lr.type,Ui=[];if(qi==="Point"||qi==="MultiPoint")for(var Hi=0;Hi0&&lr.size<(di?Ui:Er)){_r.numPoints+=lr.length/3;return}for(var Hi=[],Ln=0;LnUi)&&(_r.numSimplified++,Hi.push(lr[Ln]),Hi.push(lr[Ln+1])),_r.numPoints++;di&&fi(Hi,qi),Kt.push(Hi)}function fi(Kt,lr){for(var _r=0,Er=0,di=Kt.length,qi=di-2;Er0===lr)for(Er=0,di=Kt.length;Er24)throw new Error("maxZoom should be in the 0-24 range");if(lr.promoteId&&lr.generateId)throw new Error("promoteId and generateId cannot be used together.");var Er=vr(Kt,lr);this.tiles={},this.tileCoords=[],_r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",lr.indexMaxZoom,lr.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Er=ht(Er,lr),Er.length&&this.splitTile(Er,0,0,0),_r&&(Er.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}cn.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},cn.prototype.splitTile=function(Kt,lr,_r,Er,di,qi,Ui){for(var Hi=[Kt,lr,_r,Er],Ln=this.options,Fn=Ln.debug;Hi.length;){Er=Hi.pop(),_r=Hi.pop(),lr=Hi.pop(),Kt=Hi.pop();var Kn=1<1&&console.time("creation"),sa=this.tiles[Jn]=zr(Kt,lr,_r,Er,Ln),this.tileCoords.push({z:lr,x:_r,y:Er}),Fn)){Fn>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",lr,_r,Er,sa.numFeatures,sa.numPoints,sa.numSimplified),console.timeEnd("creation"));var Mn="z"+lr;this.stats[Mn]=(this.stats[Mn]||0)+1,this.total++}if(sa.source=Kt,di){if(lr===Ln.maxZoom||lr===di)continue;var Ha=1<1&&console.time("clipping");var io=.5*Ln.buffer/Ln.extent,Ft=.5-io,Rt=.5+io,qr=1+io,ai,si,Gr,li,Pi,xi;ai=si=Gr=li=null,Pi=Ot(Kt,Kn,_r-io,_r+Rt,0,sa.minX,sa.maxX,Ln),xi=Ot(Kt,Kn,_r+Ft,_r+qr,0,sa.minX,sa.maxX,Ln),Kt=null,Pi&&(ai=Ot(Pi,Kn,Er-io,Er+Rt,1,sa.minY,sa.maxY,Ln),si=Ot(Pi,Kn,Er+Ft,Er+qr,1,sa.minY,sa.maxY,Ln),Pi=null),xi&&(Gr=Ot(xi,Kn,Er-io,Er+Rt,1,sa.minY,sa.maxY,Ln),li=Ot(xi,Kn,Er+Ft,Er+qr,1,sa.minY,sa.maxY,Ln),xi=null),Fn>1&&console.timeEnd("clipping"),Hi.push(ai||[],lr+1,_r*2,Er*2),Hi.push(si||[],lr+1,_r*2,Er*2+1),Hi.push(Gr||[],lr+1,_r*2+1,Er*2),Hi.push(li||[],lr+1,_r*2+1,Er*2+1)}}},cn.prototype.getTile=function(Kt,lr,_r){var Er=this.options,di=Er.extent,qi=Er.debug;if(Kt<0||Kt>24)return null;var Ui=1<1&&console.log("drilling down to z%d-%d-%d",Kt,lr,_r);for(var Ln=Kt,Fn=lr,Kn=_r,Jn;!Jn&&Ln>0;)Ln--,Fn=Math.floor(Fn/2),Kn=Math.floor(Kn/2),Jn=this.tiles[yn(Ln,Fn,Kn)];return!Jn||!Jn.source?null:(qi>1&&console.log("found parent tile z%d-%d-%d",Ln,Fn,Kn),qi>1&&console.time("drilling down"),this.splitTile(Jn.source,Ln,Fn,Kn,Kt,lr,_r),qi>1&&console.timeEnd("drilling down"),this.tiles[Hi]?Yt(this.tiles[Hi],di):null)};function yn(Kt,lr,_r){return((1<=0?0:K.button},a.remove=function(K){K.parentNode&&K.parentNode.removeChild(K)};function _(K,le,ie){var we,We,gt,kt=i.browser.devicePixelRatio>1?"@2x":"",Je=i.getJSON(le.transformRequest(le.normalizeSpriteURL(K,kt,".json"),i.ResourceType.SpriteJSON),function(ur,er){Je=null,gt||(gt=ur,we=er,It())}),dt=i.getImage(le.transformRequest(le.normalizeSpriteURL(K,kt,".png"),i.ResourceType.SpriteImage),function(ur,er){dt=null,gt||(gt=ur,We=er,It())});function It(){if(gt)ie(gt);else if(we&&We){var ur=i.browser.getImageData(We),er={};for(var ar in we){var pr=we[ar],yr=pr.width,qt=pr.height,rr=pr.x,Jt=pr.y,Fr=pr.sdf,bi=pr.pixelRatio,Li=pr.stretchX,In=pr.stretchY,An=pr.content,gn=new i.RGBAImage({width:yr,height:qt});i.RGBAImage.copy(ur,gn,{x:rr,y:Jt},{x:0,y:0},{width:yr,height:qt}),er[ar]={data:gn,pixelRatio:bi,sdf:Fr,stretchX:Li,stretchY:In,content:An}}ie(null,er)}}return{cancel:function(){Je&&(Je.cancel(),Je=null),dt&&(dt.cancel(),dt=null)}}}function A(K){var le=K.userImage;if(le&&le.render){var ie=le.render();if(ie)return K.data.replace(new Uint8Array(le.data.buffer)),!0}return!1}var f=1,k=function(K){function le(){K.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.isLoaded=function(){return this.loaded},le.prototype.setLoaded=function(ie){if(this.loaded!==ie&&(this.loaded=ie,ie)){for(var we=0,We=this.requestors;we=0?1.2:1))}M.prototype.draw=function(K){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(K,this.buffer,this.middle);for(var le=this.ctx.getImageData(0,0,this.size,this.size),ie=new Uint8ClampedArray(this.size*this.size),we=0;we65535){It(new Error("glyphs > 65535 not supported"));return}if(ar.ranges[yr]){It(null,{stack:ur,id:er,glyph:pr});return}var qt=ar.requests[yr];qt||(qt=ar.requests[yr]=[],C.loadGlyphRange(ur,yr,ie.url,ie.requestManager,function(rr,Jt){if(Jt){for(var Fr in Jt)ie._doesCharSupportLocalGlyph(+Fr)||(ar.glyphs[+Fr]=Jt[+Fr]);ar.ranges[yr]=!0}for(var bi=0,Li=qt;bi1&&(dt=K[++Je]);var ur=Math.abs(It-dt.left),er=Math.abs(It-dt.right),ar=Math.min(ur,er),pr=void 0,yr=We/ie*(we+1);if(dt.isDash){var qt=we-Math.abs(yr);pr=Math.sqrt(ar*ar+qt*qt)}else pr=we-Math.sqrt(ar*ar+yr*yr);this.data[kt+It]=Math.max(0,Math.min(255,pr+128))}},V.prototype.addRegularDash=function(K){for(var le=K.length-1;le>=0;--le){var ie=K[le],we=K[le+1];ie.zeroLength?K.splice(le,1):we&&we.isDash===ie.isDash&&(we.left=ie.left,K.splice(le,1))}var We=K[0],gt=K[K.length-1];We.isDash===gt.isDash&&(We.left=gt.left-this.width,gt.right=We.right+this.width);for(var kt=this.width*this.nextRow,Je=0,dt=K[Je],It=0;It1&&(dt=K[++Je]);var ur=Math.abs(It-dt.left),er=Math.abs(It-dt.right),ar=Math.min(ur,er),pr=dt.isDash?ar:-ar;this.data[kt+It]=Math.max(0,Math.min(255,pr+128))}},V.prototype.addDash=function(K,le){var ie=le?7:0,we=2*ie+1;if(this.nextRow+we>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var We=0,gt=0;gt=ie.minX&&K.x=ie.minY&&K.y0&&(It[new i.OverscaledTileID(ie.overscaledZ,kt,we.z,gt,we.y-1).key]={backfilled:!1},It[new i.OverscaledTileID(ie.overscaledZ,ie.wrap,we.z,we.x,we.y-1).key]={backfilled:!1},It[new i.OverscaledTileID(ie.overscaledZ,dt,we.z,Je,we.y-1).key]={backfilled:!1}),we.y+10&&(We.resourceTiming=ie._resourceTiming,ie._resourceTiming=[]),ie.fire(new i.Event("data",We))})},le.prototype.onAdd=function(ie){this.map=ie,this.load()},le.prototype.setData=function(ie){var we=this;return this._data=ie,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(We){if(We){we.fire(new i.ErrorEvent(We));return}var gt={dataType:"source",sourceDataType:"content"};we._collectResourceTiming&&we._resourceTiming&&we._resourceTiming.length>0&&(gt.resourceTiming=we._resourceTiming,we._resourceTiming=[]),we.fire(new i.Event("data",gt))}),this},le.prototype.getClusterExpansionZoom=function(ie,we){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:ie,source:this.id},we),this},le.prototype.getClusterChildren=function(ie,we){return this.actor.send("geojson.getClusterChildren",{clusterId:ie,source:this.id},we),this},le.prototype.getClusterLeaves=function(ie,we,We,gt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:ie,limit:we,offset:We},gt),this},le.prototype._updateWorkerData=function(ie){var we=this;this._loaded=!1;var We=i.extend({},this.workerOptions),gt=this._data;typeof gt=="string"?(We.request=this.map._requestManager.transformRequest(i.browser.resolveURL(gt),i.ResourceType.Source),We.request.collectResourceTiming=this._collectResourceTiming):We.data=JSON.stringify(gt),this.actor.send(this.type+".loadData",We,function(kt,Je){we._removed||Je&&Je.abandoned||(we._loaded=!0,Je&&Je.resourceTiming&&Je.resourceTiming[we.id]&&(we._resourceTiming=Je.resourceTiming[we.id].slice(0)),we.actor.send(we.type+".coalesce",{source:We.source},null),ie(kt))})},le.prototype.loaded=function(){return this._loaded},le.prototype.loadTile=function(ie,we){var We=this,gt=ie.actor?"reloadTile":"loadTile";ie.actor=this.actor;var kt={type:this.type,uid:ie.uid,tileID:ie.tileID,zoom:ie.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};ie.request=this.actor.send(gt,kt,function(Je,dt){return delete ie.request,ie.unloadVectorData(),ie.aborted?we(null):Je?we(Je):(ie.loadVectorData(dt,We.map.painter,gt==="reloadTile"),we(null))})},le.prototype.abortTile=function(ie){ie.request&&(ie.request.cancel(),delete ie.request),ie.aborted=!0},le.prototype.unloadTile=function(ie){ie.unloadVectorData(),this.actor.send("removeTile",{uid:ie.uid,type:this.type,source:this.id})},le.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},le.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},le.prototype.hasTransition=function(){return!1},le}(i.Evented),be=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),ve=function(K){function le(ie,we,We,gt){K.call(this),this.id=ie,this.dispatcher=We,this.coordinates=we.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(gt),this.options=we}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.load=function(ie,we){var We=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(gt,kt){We._loaded=!0,gt?We.fire(new i.ErrorEvent(gt)):kt&&(We.image=kt,ie&&(We.coordinates=ie),we&&we(),We._finishLoading())})},le.prototype.loaded=function(){return this._loaded},le.prototype.updateImage=function(ie){var we=this;return!this.image||!ie.url?this:(this.options.url=ie.url,this.load(ie.coordinates,function(){we.texture=null}),this)},le.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},le.prototype.onAdd=function(ie){this.map=ie,this.load()},le.prototype.setCoordinates=function(ie){var we=this;this.coordinates=ie;var We=ie.map(i.MercatorCoordinate.fromLngLat);this.tileID=ce(We),this.minzoom=this.maxzoom=this.tileID.z;var gt=We.map(function(kt){return we.tileID.getTilePoint(kt)._round()});return this._boundsArray=new i.StructArrayLayout4i8,this._boundsArray.emplaceBack(gt[0].x,gt[0].y,0,0),this._boundsArray.emplaceBack(gt[1].x,gt[1].y,i.EXTENT,0),this._boundsArray.emplaceBack(gt[3].x,gt[3].y,0,i.EXTENT),this._boundsArray.emplaceBack(gt[2].x,gt[2].y,i.EXTENT,i.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})),this},le.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var ie=this.map.painter.context,we=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,be.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new i.Texture(ie,this.image,we.RGBA),this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE));for(var We in this.tiles){var gt=this.tiles[We];gt.state!=="loaded"&&(gt.state="loaded",gt.texture=this.texture)}}},le.prototype.loadTile=function(ie,we){this.tileID&&this.tileID.equals(ie.tileID.canonical)?(this.tiles[String(ie.tileID.wrap)]=ie,ie.buckets={},we(null)):(ie.state="errored",we(null))},le.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},le.prototype.hasTransition=function(){return!1},le}(i.Evented);function ce(K){for(var le=1/0,ie=1/0,we=-1/0,We=-1/0,gt=0,kt=K;gtwe.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+we.start(0)+" and "+we.end(0)+"-second mark."))):this.video.currentTime=ie}},le.prototype.getVideo=function(){return this.video},le.prototype.onAdd=function(ie){this.map||(this.map=ie,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},le.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var ie=this.map.painter.context,we=ie.gl;this.boundsBuffer||(this.boundsBuffer=ie.createVertexBuffer(this._boundsArray,be.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE),we.texSubImage2D(we.TEXTURE_2D,0,0,0,we.RGBA,we.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(ie,this.video,we.RGBA),this.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE));for(var We in this.tiles){var gt=this.tiles[We];gt.state!=="loaded"&&(gt.state="loaded",gt.texture=this.texture)}}},le.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},le.prototype.hasTransition=function(){return this.video&&!this.video.paused},le}(ve),ge=function(K){function le(ie,we,We,gt){K.call(this,ie,we,We,gt),we.coordinates?(!Array.isArray(we.coordinates)||we.coordinates.length!==4||we.coordinates.some(function(kt){return!Array.isArray(kt)||kt.length!==2||kt.some(function(Je){return typeof Je!="number"})}))&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'missing required property "coordinates"'))),we.animate&&typeof we.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'optional "animate" property must be a boolean value'))),we.canvas?typeof we.canvas!="string"&&!(we.canvas instanceof i.window.HTMLCanvasElement)&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+ie,null,'missing required property "canvas"'))),this.options=we,this.animate=we.animate!==void 0?we.animate:!0}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new i.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},le.prototype.getCanvas=function(){return this.canvas},le.prototype.onAdd=function(ie){this.map=ie,this.load(),this.canvas&&this.animate&&this.play()},le.prototype.onRemove=function(){this.pause()},le.prototype.prepare=function(){var ie=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,ie=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,ie=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var we=this.map.painter.context,We=we.gl;this.boundsBuffer||(this.boundsBuffer=we.createVertexBuffer(this._boundsArray,be.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(ie||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(we,this.canvas,We.RGBA,{premultiply:!0});for(var gt in this.tiles){var kt=this.tiles[gt];kt.state!=="loaded"&&(kt.state="loaded",kt.texture=this.texture)}}},le.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},le.prototype.hasTransition=function(){return this._playing},le.prototype._hasInvalidDimensions=function(){for(var ie=0,we=[this.canvas.width,this.canvas.height];iethis.max){var kt=this._getAndRemoveByKey(this.order[0]);kt&&this.onRemove(kt)}return this},Ge.prototype.has=function(K){return K.wrapped().key in this.data},Ge.prototype.getAndRemove=function(K){return this.has(K)?this._getAndRemoveByKey(K.wrapped().key):null},Ge.prototype._getAndRemoveByKey=function(K){var le=this.data[K].shift();return le.timeout&&clearTimeout(le.timeout),this.data[K].length===0&&delete this.data[K],this.order.splice(this.order.indexOf(K),1),le.value},Ge.prototype.getByKey=function(K){var le=this.data[K];return le?le[0].value:null},Ge.prototype.get=function(K){if(!this.has(K))return null;var le=this.data[K.wrapped().key][0];return le.value},Ge.prototype.remove=function(K,le){if(!this.has(K))return this;var ie=K.wrapped().key,we=le===void 0?0:this.data[ie].indexOf(le),We=this.data[ie][we];return this.data[ie].splice(we,1),We.timeout&&clearTimeout(We.timeout),this.data[ie].length===0&&delete this.data[ie],this.onRemove(We.value),this.order.splice(this.order.indexOf(ie),1),this},Ge.prototype.setMaxSize=function(K){for(this.max=K;this.order.length>this.max;){var le=this._getAndRemoveByKey(this.order[0]);le&&this.onRemove(le)}return this},Ge.prototype.filter=function(K){var le=[];for(var ie in this.data)for(var we=0,We=this.data[ie];we1||(Math.abs(ur)>1&&(Math.abs(ur+ar)===1?ur+=ar:Math.abs(ur-ar)===1&&(ur-=ar)),!(!It.dem||!dt.dem)&&(dt.dem.backfillBorder(It.dem,ur,er),dt.neighboringTiles&&dt.neighboringTiles[pr]&&(dt.neighboringTiles[pr].backfilled=!0)))}},le.prototype.getTile=function(ie){return this.getTileByID(ie.key)},le.prototype.getTileByID=function(ie){return this._tiles[ie]},le.prototype._retainLoadedChildren=function(ie,we,We,gt){for(var kt in this._tiles){var Je=this._tiles[kt];if(!(gt[kt]||!Je.hasData()||Je.tileID.overscaledZ<=we||Je.tileID.overscaledZ>We)){for(var dt=Je.tileID;Je&&Je.tileID.overscaledZ>we+1;){var It=Je.tileID.scaledTo(Je.tileID.overscaledZ-1);Je=this._tiles[It.key],Je&&Je.hasData()&&(dt=It)}for(var ur=dt;ur.overscaledZ>we;)if(ur=ur.scaledTo(ur.overscaledZ-1),ie[ur.key]){gt[dt.key]=dt;break}}}},le.prototype.findLoadedParent=function(ie,we){if(ie.key in this._loadedParentTiles){var We=this._loadedParentTiles[ie.key];return We&&We.tileID.overscaledZ>=we?We:null}for(var gt=ie.overscaledZ-1;gt>=we;gt--){var kt=ie.scaledTo(gt),Je=this._getLoadedTile(kt);if(Je)return Je}},le.prototype._getLoadedTile=function(ie){var we=this._tiles[ie.key];if(we&&we.hasData())return we;var We=this._cache.getByKey(ie.wrapped().key);return We},le.prototype.updateCacheSize=function(ie){var we=Math.ceil(ie.width/this._source.tileSize)+1,We=Math.ceil(ie.height/this._source.tileSize)+1,gt=we*We,kt=5,Je=Math.floor(gt*kt),dt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Je):Je;this._cache.setMaxSize(dt)},le.prototype.handleWrapJump=function(ie){var we=this._prevLng===void 0?ie:this._prevLng,We=ie-we,gt=We/360,kt=Math.round(gt);if(this._prevLng=ie,kt){var Je={};for(var dt in this._tiles){var It=this._tiles[dt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+kt),Je[It.tileID.key]=It}this._tiles=Je;for(var ur in this._timers)clearTimeout(this._timers[ur]),delete this._timers[ur];for(var er in this._tiles){var ar=this._tiles[er];this._setTileReloadTimer(er,ar)}}},le.prototype.update=function(ie){var we=this;if(this.transform=ie,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(ie),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var We;this.used?this._source.tileID?We=ie.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Dn){return new i.OverscaledTileID(Dn.canonical.z,Dn.wrap,Dn.canonical.z,Dn.canonical.x,Dn.canonical.y)}):(We=ie.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(We=We.filter(function(Dn){return we._source.hasTile(Dn)}))):We=[];var gt=ie.coveringZoomLevel(this._source),kt=Math.max(gt-le.maxOverzooming,this._source.minzoom),Je=Math.max(gt+le.maxUnderzooming,this._source.minzoom),dt=this._updateRetainedTiles(We,gt);if(Ln(this._source.type)){for(var It={},ur={},er=Object.keys(dt),ar=0,pr=er;arthis._source.maxzoom){var Jt=qt.children(this._source.maxzoom)[0],Fr=this.getTile(Jt);if(Fr&&Fr.hasData()){We[Jt.key]=Jt;continue}}else{var bi=qt.children(this._source.maxzoom);if(We[bi[0].key]&&We[bi[1].key]&&We[bi[2].key]&&We[bi[3].key])continue}for(var Li=rr.wasRequested(),In=qt.overscaledZ-1;In>=kt;--In){var An=qt.scaledTo(In);if(gt[An.key]||(gt[An.key]=!0,rr=this.getTile(An),!rr&&Li&&(rr=this._addTile(An)),rr&&(We[An.key]=An,Li=rr.wasRequested(),rr.hasData())))break}}}return We},le.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var ie in this._tiles){for(var we=[],We=void 0,gt=this._tiles[ie].tileID;gt.overscaledZ>0;){if(gt.key in this._loadedParentTiles){We=this._loadedParentTiles[gt.key];break}we.push(gt.key);var kt=gt.scaledTo(gt.overscaledZ-1);if(We=this._getLoadedTile(kt),We)break;gt=kt}for(var Je=0,dt=we;Je0)&&(we.hasData()&&we.state!=="reloading"?this._cache.add(we.tileID,we,we.getExpiryTimeout()):(we.aborted=!0,this._abortTile(we),this._unloadTile(we))))},le.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var ie in this._tiles)this._removeTile(ie);this._cache.reset()},le.prototype.tilesIn=function(ie,we,We){var gt=this,kt=[],Je=this.transform;if(!Je)return kt;for(var dt=We?Je.getCameraQueryGeometry(ie):ie,It=ie.map(function(In){return Je.pointCoordinate(In)}),ur=dt.map(function(In){return Je.pointCoordinate(In)}),er=this.getIds(),ar=1/0,pr=1/0,yr=-1/0,qt=-1/0,rr=0,Jt=ur;rr=0&&ca[1].y+Dn>=0){var Hn=It.map(function(_a){return gn.getTilePoint(_a)}),Wn=ur.map(function(_a){return gn.getTilePoint(_a)});kt.push({tile:An,tileID:gn,queryGeometry:Hn,cameraQueryGeometry:Wn,scale:Vn})}}},Li=0;Li=i.browser.now())return!0}return!1},le.prototype.setFeatureState=function(ie,we,We){ie=ie||"_geojsonTileLayer",this._state.updateState(ie,we,We)},le.prototype.removeFeatureState=function(ie,we,We){ie=ie||"_geojsonTileLayer",this._state.removeFeatureState(ie,we,We)},le.prototype.getFeatureState=function(ie,we){return ie=ie||"_geojsonTileLayer",this._state.getState(ie,we)},le.prototype.setDependencies=function(ie,we,We){var gt=this._tiles[ie];gt&>.setDependencies(we,We)},le.prototype.reloadTilesForDependencies=function(ie,we){for(var We in this._tiles){var gt=this._tiles[We];gt.hasDependency(ie,we)&&this._reloadTile(We,"reloading")}this._cache.filter(function(kt){return!kt.hasDependency(ie,we)})},le}(i.Evented);Ui.maxOverzooming=10,Ui.maxUnderzooming=3;function Hi(K,le){var ie=Math.abs(K.wrap*2)-+(K.wrap<0),we=Math.abs(le.wrap*2)-+(le.wrap<0);return K.overscaledZ-le.overscaledZ||we-ie||le.canonical.y-K.canonical.y||le.canonical.x-K.canonical.x}function Ln(K){return K==="raster"||K==="image"||K==="video"}function Fn(){return new i.window.Worker(Ml.workerUrl)}var Kn="mapboxgl_preloaded_worker_pool",Jn=function(){this.active={}};Jn.prototype.acquire=function(K){if(!this.workers)for(this.workers=[];this.workers.length0?(we-gt)/kt:0;return this.points[We].mult(1-Je).add(this.points[le].mult(Je))};var Wi=function(K,le,ie){var we=this.boxCells=[],We=this.circleCells=[];this.xCellCount=Math.ceil(K/ie),this.yCellCount=Math.ceil(le/ie);for(var gt=0;gtthis.width||we<0||le>this.height)return We?!1:[];var kt=[];if(K<=0&&le<=0&&this.width<=ie&&this.height<=we){if(We)return!0;for(var Je=0;Je0:kt}},Wi.prototype._queryCircle=function(K,le,ie,we,We){var gt=K-ie,kt=K+ie,Je=le-ie,dt=le+ie;if(kt<0||gt>this.width||dt<0||Je>this.height)return we?!1:[];var It=[],ur={hitTest:we,circle:{x:K,y:le,radius:ie},seenUids:{box:{},circle:{}}};return this._forEachCell(gt,Je,kt,dt,this._queryCellCircle,It,ur,We),we?It.length>0:It},Wi.prototype.query=function(K,le,ie,we,We){return this._query(K,le,ie,we,!1,We)},Wi.prototype.hitTest=function(K,le,ie,we,We){return this._query(K,le,ie,we,!0,We)},Wi.prototype.hitTestCircle=function(K,le,ie,we){return this._queryCircle(K,le,ie,!0,we)},Wi.prototype._queryCell=function(K,le,ie,we,We,gt,kt,Je){var dt=kt.seenUids,It=this.boxCells[We];if(It!==null)for(var ur=this.bboxes,er=0,ar=It;er=ur[yr+0]&&we>=ur[yr+1]&&(!Je||Je(this.boxKeys[pr]))){if(kt.hitTest)return gt.push(!0),!0;gt.push({key:this.boxKeys[pr],x1:ur[yr],y1:ur[yr+1],x2:ur[yr+2],y2:ur[yr+3]})}}}var qt=this.circleCells[We];if(qt!==null)for(var rr=this.circles,Jt=0,Fr=qt;Jtkt*kt+Je*Je},Wi.prototype._circleAndRectCollide=function(K,le,ie,we,We,gt,kt){var Je=(gt-we)/2,dt=Math.abs(K-(we+Je));if(dt>Je+ie)return!1;var It=(kt-We)/2,ur=Math.abs(le-(We+It));if(ur>It+ie)return!1;if(dt<=Je||ur<=It)return!0;var er=dt-Je,ar=ur-It;return er*er+ar*ar<=ie*ie};function pn(K,le,ie,we,We){var gt=i.create();return le?(i.scale(gt,gt,[1/We,1/We,1]),ie||i.rotateZ(gt,gt,we.angle)):i.multiply(gt,we.labelPlaneMatrix,K),gt}function Ua(K,le,ie,we,We){if(le){var gt=i.clone(K);return i.scale(gt,gt,[We,We,1]),ie||i.rotateZ(gt,gt,-we.angle),gt}else return we.glCoordMatrix}function ea(K,le){var ie=[K.x,K.y,0,1];rl(ie,ie,le);var we=ie[3];return{point:new i.Point(ie[0]/we,ie[1]/we),signedDistanceFromCamera:we}}function fo(K,le){return .5+.5*(K/le)}function ho(K,le){var ie=K[0]/K[3],we=K[1]/K[3],We=ie>=-le[0]&&ie<=le[0]&&we>=-le[1]&&we<=le[1];return We}function Vo(K,le,ie,we,We,gt,kt,Je){var dt=we?K.textSizeData:K.iconSizeData,It=i.evaluateSizeForZoom(dt,ie.transform.zoom),ur=[256/ie.width*2+1,256/ie.height*2+1],er=we?K.text.dynamicLayoutVertexArray:K.icon.dynamicLayoutVertexArray;er.clear();for(var ar=K.lineVertexArray,pr=we?K.text.placedSymbolArray:K.icon.placedSymbolArray,yr=ie.transform.width/ie.transform.height,qt=!1,rr=0;rrgt)return{useVertical:!0}}return(K===i.WritingMode.vertical?le.yie.x)?{needsFlipping:!0}:null}function Wa(K,le,ie,we,We,gt,kt,Je,dt,It,ur,er,ar,pr){var yr=le/24,qt=K.lineOffsetX*yr,rr=K.lineOffsetY*yr,Jt;if(K.numGlyphs>1){var Fr=K.glyphStartIndex+K.numGlyphs,bi=K.lineStartIndex,Li=K.lineStartIndex+K.lineLength,In=Ao(yr,Je,qt,rr,ie,ur,er,K,dt,gt,ar);if(!In)return{notEnoughRoom:!0};var An=ea(In.first.point,kt).point,gn=ea(In.last.point,kt).point;if(we&&!ie){var Vn=Wo(K.writingMode,An,gn,pr);if(Vn)return Vn}Jt=[In.first];for(var Dn=K.glyphStartIndex+1;Dn0?_a.point:Ts(er,Wn,ca,1,We),To=Wo(K.writingMode,ca,po,pr);if(To)return To}var Jo=fs(yr*Je.getoffsetX(K.glyphStartIndex),qt,rr,ie,ur,er,K.segment,K.lineStartIndex,K.lineStartIndex+K.lineLength,dt,gt,ar);if(!Jo)return{notEnoughRoom:!0};Jt=[Jo]}for(var Ss=0,$l=Jt;Ss<$l.length;Ss+=1){var Yl=$l[Ss];i.addDynamicAttributes(It,Yl.point,Yl.angle)}return{}}function Ts(K,le,ie,we,We){var gt=ea(K.add(K.sub(le)._unit()),We).point,kt=ie.sub(gt);return ie.add(kt._mult(we/kt.mag()))}function fs(K,le,ie,we,We,gt,kt,Je,dt,It,ur,er){var ar=we?K-le:K+le,pr=ar>0?1:-1,yr=0;we&&(pr*=-1,yr=Math.PI),pr<0&&(yr+=Math.PI);for(var qt=pr>0?Je+kt:Je+kt+1,rr=We,Jt=We,Fr=0,bi=0,Li=Math.abs(ar),In=[];Fr+bi<=Li;){if(qt+=pr,qt=dt)return null;if(Jt=rr,In.push(rr),rr=er[qt],rr===void 0){var An=new i.Point(It.getx(qt),It.gety(qt)),gn=ea(An,ur);if(gn.signedDistanceFromCamera>0)rr=er[qt]=gn.point;else{var Vn=qt-pr,Dn=Fr===0?gt:new i.Point(It.getx(Vn),It.gety(Vn));rr=Ts(Dn,An,Jt,Li-Fr+1,ur)}}Fr+=bi,bi=Jt.dist(rr)}var ca=(Li-Fr)/bi,Hn=rr.sub(Jt),Wn=Hn.mult(ca)._add(Jt);Wn._add(Hn._unit()._perp()._mult(ie*pr));var _a=yr+Math.atan2(rr.y-Jt.y,rr.x-Jt.x);return In.push(Wn),{point:Wn,angle:_a,path:In}}var _l=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function es(K,le){for(var ie=0;ie=1;$l--)Ss.push(To.path[$l]);for(var Yl=1;Yl0){for(var $s=Ss[0].clone(),zu=Ss[0].clone(),mf=1;mf=Wn.x&&zu.x<=_a.x&&$s.y>=Wn.y&&zu.y<=_a.y?Pc=[Ss]:zu.x_a.x||zu.y_a.y?Pc=[]:Pc=i.clipLine([Ss],Wn.x,Wn.y,_a.x,_a.y)}for(var Vf=0,M0=Pc;Vf=this.screenRightBoundary||wethis.screenBottomBoundary},xl.prototype.isInsideGrid=function(K,le,ie,we){return ie>=0&&K=0&&le0){var bi;return this.prevPlacement&&this.prevPlacement.variableOffsets[er.crossTileID]&&this.prevPlacement.placements[er.crossTileID]&&this.prevPlacement.placements[er.crossTileID].text&&(bi=this.prevPlacement.variableOffsets[er.crossTileID].anchor),this.variableOffsets[er.crossTileID]={textOffset:qt,width:ie,height:we,anchor:K,textBoxScale:We,prevAnchor:bi},this.markUsedJustification(ar,K,er,pr),ar.allowVerticalPlacement&&(this.markUsedOrientation(ar,pr,er),this.placedOrientations[er.crossTileID]=pr),{shift:rr,placedGlyphBoxes:Jt}}},Gs.prototype.placeLayerBucketPart=function(K,le,ie){var we=this,We=K.parameters,gt=We.bucket,kt=We.layout,Je=We.posMatrix,dt=We.textLabelPlaneMatrix,It=We.labelToScreenMatrix,ur=We.textPixelRatio,er=We.holdingForFade,ar=We.collisionBoxArray,pr=We.partiallyEvaluatedTextSize,yr=We.collisionGroup,qt=kt.get("text-optional"),rr=kt.get("icon-optional"),Jt=kt.get("text-allow-overlap"),Fr=kt.get("icon-allow-overlap"),bi=kt.get("text-rotation-alignment")==="map",Li=kt.get("text-pitch-alignment")==="map",In=kt.get("icon-text-fit")!=="none",An=kt.get("symbol-z-order")==="viewport-y",gn=Jt&&(Fr||!gt.hasIconData()||rr),Vn=Fr&&(Jt||!gt.hasTextData()||qt);!gt.collisionArrays&&ar&>.deserializeCollisionBoxes(ar);var Dn=function(To,Jo){if(!le[To.crossTileID]){if(er){we.placements[To.crossTileID]=new Bs(!1,!1,!1);return}var Ss=!1,$l=!1,Yl=!0,Tl=null,Xl={box:null,offscreen:null},Pc={box:null,offscreen:null},$s=null,zu=null,mf=null,Vf=0,M0=0,vm=0;Jo.textFeatureIndex?Vf=Jo.textFeatureIndex:To.useRuntimeCollisionCircles&&(Vf=To.featureIndex),Jo.verticalTextFeatureIndex&&(M0=Jo.verticalTextFeatureIndex);var u0=Jo.textBox;if(u0){var c0=function(gf){var Od=i.WritingMode.horizontal;if(gt.allowVerticalPlacement&&!gf&&we.prevPlacement){var Ic=we.prevPlacement.placedOrientations[To.crossTileID];Ic&&(we.placedOrientations[To.crossTileID]=Ic,Od=Ic,we.markUsedOrientation(gt,Od,To))}return Od},Om=function(gf,Od){if(gt.allowVerticalPlacement&&To.numVerticalGlyphVertices>0&&Jo.verticalTextBox)for(var Ic=0,n1=gt.writingModes;Ic0&&(Cp=Cp.filter(function(gf){return gf!==h0.anchor}),Cp.unshift(h0.anchor))}var dp=function(gf,Od,Ic){for(var n1=gf.x2-gf.x1,gy=gf.y2-gf.y1,Ob=To.textBoxScale,Hc=In&&!Fr?Od:null,zg={box:[],offscreen:!1},Bb=Jt?Cp.length*2:Cp.length,a1=0;a1=Cp.length,vy=we.attemptAnchorPlacement(Rm,gf,n1,gy,Ob,bi,Li,ur,Je,yr,Kw,To,gt,Ic,Hc);if(vy&&(zg=vy.placedGlyphBoxes,zg&&zg.box&&zg.box.length)){Ss=!0,Tl=vy.shift;break}}return zg},rg=function(){return dp(u0,Jo.iconBox,i.WritingMode.horizontal)},rv=function(){var gf=Jo.verticalTextBox,Od=Xl&&Xl.box&&Xl.box.length;return gt.allowVerticalPlacement&&!Od&&To.numVerticalGlyphVertices>0&&gf?dp(gf,Jo.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}};Om(rg,rv),Xl&&(Ss=Xl.box,Yl=Xl.offscreen);var f0=c0(Xl&&Xl.box);if(!Ss&&we.prevPlacement){var d0=we.prevPlacement.variableOffsets[To.crossTileID];d0&&(we.variableOffsets[To.crossTileID]=d0,we.markUsedJustification(gt,d0.anchor,To,f0))}}else{var Ap=function(gf,Od){var Ic=we.collisionIndex.placeCollisionBox(gf,Jt,ur,Je,yr.predicate);return Ic&&Ic.box&&Ic.box.length&&(we.markUsedOrientation(gt,Od,To),we.placedOrientations[To.crossTileID]=Od),Ic},iv=function(){return Ap(u0,i.WritingMode.horizontal)},t1=function(){var gf=Jo.verticalTextBox;return gt.allowVerticalPlacement&&To.numVerticalGlyphVertices>0&&gf?Ap(gf,i.WritingMode.vertical):{box:null,offscreen:null}};Om(iv,t1),c0(Xl&&Xl.box&&Xl.box.length)}}if($s=Xl,Ss=$s&&$s.box&&$s.box.length>0,Yl=$s&&$s.offscreen,To.useRuntimeCollisionCircles){var nv=gt.text.placedSymbolArray.get(To.centerJustifiedTextSymbolIndex),Dd=i.evaluateSizeForFeature(gt.textSizeData,pr,nv),Dg=kt.get("text-padding"),r1=To.collisionCircleDiameter;zu=we.collisionIndex.placeCollisionCircles(Jt,nv,gt.lineVertexArray,gt.glyphOffsetArray,Dd,Je,dt,It,ie,Li,yr.predicate,r1,Dg),Ss=Jt||zu.circles.length>0&&!zu.collisionDetected,Yl=Yl&&zu.offscreen}if(Jo.iconFeatureIndex&&(vm=Jo.iconFeatureIndex),Jo.iconBox){var zd=function(gf){var Od=In&&Tl?ou(gf,Tl.x,Tl.y,bi,Li,we.transform.angle):gf;return we.collisionIndex.placeCollisionBox(Od,Fr,ur,Je,yr.predicate)};Pc&&Pc.box&&Pc.box.length&&Jo.verticalIconBox?(mf=zd(Jo.verticalIconBox),$l=mf.box.length>0):(mf=zd(Jo.iconBox),$l=mf.box.length>0),Yl=Yl&&mf.offscreen}var av=qt||To.numHorizontalGlyphVertices===0&&To.numVerticalGlyphVertices===0,py=rr||To.numIconVertices===0;if(!av&&!py?$l=Ss=$l&&Ss:py?av||($l=$l&&Ss):Ss=$l&&Ss,Ss&&$s&&$s.box&&(Pc&&Pc.box&&M0?we.collisionIndex.insertCollisionBox($s.box,kt.get("text-ignore-placement"),gt.bucketInstanceId,M0,yr.ID):we.collisionIndex.insertCollisionBox($s.box,kt.get("text-ignore-placement"),gt.bucketInstanceId,Vf,yr.ID)),$l&&mf&&we.collisionIndex.insertCollisionBox(mf.box,kt.get("icon-ignore-placement"),gt.bucketInstanceId,vm,yr.ID),zu&&(Ss&&we.collisionIndex.insertCollisionCircles(zu.circles,kt.get("text-ignore-placement"),gt.bucketInstanceId,Vf,yr.ID),ie)){var my=gt.bucketInstanceId,Bm=we.collisionCircleArrays[my];Bm===void 0&&(Bm=we.collisionCircleArrays[my]=new No);for(var i1=0;i1=0;--Hn){var Wn=ca[Hn];Dn(gt.symbolInstances.get(Wn),gt.collisionArrays[Wn])}else for(var _a=K.symbolInstanceStart;_a=0&&(gt>=0&&It!==gt?K.text.placedSymbolArray.get(It).crossTileID=0:K.text.placedSymbolArray.get(It).crossTileID=ie.crossTileID)}},Gs.prototype.markUsedOrientation=function(K,le,ie){for(var we=le===i.WritingMode.horizontal||le===i.WritingMode.horizontalOnly?le:0,We=le===i.WritingMode.vertical?le:0,gt=[ie.leftJustifiedTextSymbolIndex,ie.centerJustifiedTextSymbolIndex,ie.rightJustifiedTextSymbolIndex],kt=0,Je=gt;kt0||Li>0,Dn=Fr.numIconVertices>0,ca=we.placedOrientations[Fr.crossTileID],Hn=ca===i.WritingMode.vertical,Wn=ca===i.WritingMode.horizontal||ca===i.WritingMode.horizontalOnly;if(Vn){var _a=Gu(gn.text),po=Hn?bo:_a;pr(K.text,bi,po);var To=Wn?bo:_a;pr(K.text,Li,To);var Jo=gn.text.isHidden();[Fr.rightJustifiedTextSymbolIndex,Fr.centerJustifiedTextSymbolIndex,Fr.leftJustifiedTextSymbolIndex].forEach(function(vm){vm>=0&&(K.text.placedSymbolArray.get(vm).hidden=Jo||Hn?1:0)}),Fr.verticalPlacedTextSymbolIndex>=0&&(K.text.placedSymbolArray.get(Fr.verticalPlacedTextSymbolIndex).hidden=Jo||Wn?1:0);var Ss=we.variableOffsets[Fr.crossTileID];Ss&&we.markUsedJustification(K,Ss.anchor,Fr,ca);var $l=we.placedOrientations[Fr.crossTileID];$l&&(we.markUsedJustification(K,"left",Fr,$l),we.markUsedOrientation(K,$l,Fr))}if(Dn){var Yl=Gu(gn.icon),Tl=!(er&&Fr.verticalPlacedIconSymbolIndex&&Hn);if(Fr.placedIconSymbolIndex>=0){var Xl=Tl?Yl:bo;pr(K.icon,Fr.numIconVertices,Xl),K.icon.placedSymbolArray.get(Fr.placedIconSymbolIndex).hidden=gn.icon.isHidden()}if(Fr.verticalPlacedIconSymbolIndex>=0){var Pc=Tl?bo:Yl;pr(K.icon,Fr.numVerticalIconVertices,Pc),K.icon.placedSymbolArray.get(Fr.verticalPlacedIconSymbolIndex).hidden=gn.icon.isHidden()}}if(K.hasIconCollisionBoxData()||K.hasTextCollisionBoxData()){var $s=K.collisionArrays[Jt];if($s){var zu=new i.Point(0,0);if($s.textBox||$s.verticalTextBox){var mf=!0;if(dt){var Vf=we.variableOffsets[In];Vf?(zu=Jl(Vf.anchor,Vf.width,Vf.height,Vf.textOffset,Vf.textBoxScale),It&&zu._rotate(ur?we.transform.angle:-we.transform.angle)):mf=!1}$s.textBox&&$a(K.textCollisionBox.collisionVertexArray,gn.text.placed,!mf||Hn,zu.x,zu.y),$s.verticalTextBox&&$a(K.textCollisionBox.collisionVertexArray,gn.text.placed,!mf||Wn,zu.x,zu.y)}var M0=!!(!Wn&&$s.verticalIconBox);$s.iconBox&&$a(K.iconCollisionBox.collisionVertexArray,gn.icon.placed,M0,er?zu.x:0,er?zu.y:0),$s.verticalIconBox&&$a(K.iconCollisionBox.collisionVertexArray,gn.icon.placed,!M0,er?zu.x:0,er?zu.y:0)}}},qt=0;qtK},Gs.prototype.setStale=function(){this.stale=!0};function $a(K,le,ie,we,We){K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0),K.emplaceBack(le?1:0,ie?1:0,we||0,We||0)}var So=Math.pow(2,25),Xs=Math.pow(2,24),su=Math.pow(2,17),is=Math.pow(2,16),tu=Math.pow(2,9),pl=Math.pow(2,8),Nl=Math.pow(2,1);function Gu(K){if(K.opacity===0&&!K.placed)return 0;if(K.opacity===1&&K.placed)return 4294967295;var le=K.placed?1:0,ie=Math.floor(K.opacity*127);return ie*So+le*Xs+ie*su+le*is+ie*tu+le*pl+ie*Nl+le}var bo=0,Ps=function(K){this._sortAcrossTiles=K.layout.get("symbol-z-order")!=="viewport-y"&&K.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Ps.prototype.continuePlacement=function(K,le,ie,we,We){for(var gt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var kt=K[this._currentPlacementIndex],Je=le[kt],dt=this.placement.collisionIndex.transform.zoom;if(Je.type==="symbol"&&(!Je.minzoom||Je.minzoom<=dt)&&(!Je.maxzoom||Je.maxzoom>dt)){this._inProgressLayer||(this._inProgressLayer=new Ps(Je));var It=this._inProgressLayer.continuePlacement(ie[Je.source],this.placement,this._showCollisionBoxes,Je,gt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Rs.prototype.commit=function(K){return this.placement.commit(K),this.placement};var pu=512/i.EXTENT/2,bl=function(K,le,ie){this.tileID=K,this.indexedSymbolInstances={},this.bucketInstanceId=ie;for(var we=0;weK.overscaledZ)for(var dt in Je){var It=Je[dt];It.tileID.isChildOf(K)&&It.findMatches(le.symbolInstances,K,gt)}else{var ur=K.scaledTo(Number(kt)),er=Je[ur.key];er&&er.findMatches(le.symbolInstances,K,gt)}}for(var ar=0;ar0)throw new Error("Unimplemented: "+gt.map(function(kt){return kt.command}).join(", ")+".");return We.forEach(function(kt){kt.command!=="setTransition"&&we[kt.command].apply(we,kt.args)}),this.stylesheet=ie,!0},le.prototype.addImage=function(ie,we){if(this.getImage(ie))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(ie,we),this._afterImageUpdated(ie)},le.prototype.updateImage=function(ie,we){this.imageManager.updateImage(ie,we)},le.prototype.getImage=function(ie){return this.imageManager.getImage(ie)},le.prototype.removeImage=function(ie){if(!this.getImage(ie))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(ie),this._afterImageUpdated(ie)},le.prototype._afterImageUpdated=function(ie){this._availableImages=this.imageManager.listImages(),this._changedImages[ie]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new i.Event("data",{dataType:"style"}))},le.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},le.prototype.addSource=function(ie,we,We){var gt=this;if(We===void 0&&(We={}),this._checkLoaded(),this.sourceCaches[ie]!==void 0)throw new Error("There is already a source with this ID");if(!we.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(we).join(", ")+".");var kt=["vector","raster","geojson","video","image"],Je=kt.indexOf(we.type)>=0;if(!(Je&&this._validate(i.validateStyle.source,"sources."+ie,we,null,We))){this.map&&this.map._collectResourceTiming&&(we.collectResourceTiming=!0);var dt=this.sourceCaches[ie]=new Ui(ie,we,this.dispatcher);dt.style=this,dt.setEventedParent(this,function(){return{isSourceLoaded:gt.loaded(),source:dt.serialize(),sourceId:ie}}),dt.onAdd(this.map),this._changed=!0}},le.prototype.removeSource=function(ie){if(this._checkLoaded(),this.sourceCaches[ie]===void 0)throw new Error("There is no source with this ID");for(var we in this._layers)if(this._layers[we].source===ie)return this.fire(new i.ErrorEvent(new Error('Source "'+ie+'" cannot be removed while layer "'+we+'" is using it.')));var We=this.sourceCaches[ie];delete this.sourceCaches[ie],delete this._updatedSources[ie],We.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:ie})),We.setEventedParent(null),We.clearTiles(),We.onRemove&&We.onRemove(this.map),this._changed=!0},le.prototype.setGeoJSONSourceData=function(ie,we){this._checkLoaded();var We=this.sourceCaches[ie].getSource();We.setData(we),this._changed=!0},le.prototype.getSource=function(ie){return this.sourceCaches[ie]&&this.sourceCaches[ie].getSource()},le.prototype.addLayer=function(ie,we,We){We===void 0&&(We={}),this._checkLoaded();var gt=ie.id;if(this.getLayer(gt)){this.fire(new i.ErrorEvent(new Error('Layer with id "'+gt+'" already exists on this map')));return}var kt;if(ie.type==="custom"){if(Ll(this,i.validateCustomStyleLayer(ie)))return;kt=i.createStyleLayer(ie)}else{if(typeof ie.source=="object"&&(this.addSource(gt,ie.source),ie=i.clone$1(ie),ie=i.extend(ie,{source:gt})),this._validate(i.validateStyle.layer,"layers."+gt,ie,{arrayIndex:-1},We))return;kt=i.createStyleLayer(ie),this._validateLayer(kt),kt.setEventedParent(this,{layer:{id:gt}}),this._serializedLayers[kt.id]=kt.serialize()}var Je=we?this._order.indexOf(we):this._order.length;if(we&&Je===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+we+'" does not exist on this map.')));return}if(this._order.splice(Je,0,gt),this._layerOrderChanged=!0,this._layers[gt]=kt,this._removedLayers[gt]&&kt.source&&kt.type!=="custom"){var dt=this._removedLayers[gt];delete this._removedLayers[gt],dt.type!==kt.type?this._updatedSources[kt.source]="clear":(this._updatedSources[kt.source]="reload",this.sourceCaches[kt.source].pause())}this._updateLayer(kt),kt.onAdd&&kt.onAdd(this.map)},le.prototype.moveLayer=function(ie,we){this._checkLoaded(),this._changed=!0;var We=this._layers[ie];if(!We){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be moved.")));return}if(ie!==we){var gt=this._order.indexOf(ie);this._order.splice(gt,1);var kt=we?this._order.indexOf(we):this._order.length;if(we&&kt===-1){this.fire(new i.ErrorEvent(new Error('Layer with id "'+we+'" does not exist on this map.')));return}this._order.splice(kt,0,ie),this._layerOrderChanged=!0}},le.prototype.removeLayer=function(ie){this._checkLoaded();var we=this._layers[ie];if(!we){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be removed.")));return}we.setEventedParent(null);var We=this._order.indexOf(ie);this._order.splice(We,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[ie]=we,delete this._layers[ie],delete this._serializedLayers[ie],delete this._updatedLayers[ie],delete this._updatedPaintProps[ie],we.onRemove&&we.onRemove(this.map)},le.prototype.getLayer=function(ie){return this._layers[ie]},le.prototype.hasLayer=function(ie){return ie in this._layers},le.prototype.setLayerZoomRange=function(ie,we,We){this._checkLoaded();var gt=this.getLayer(ie);if(!gt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot have zoom extent.")));return}gt.minzoom===we&>.maxzoom===We||(we!=null&&(gt.minzoom=we),We!=null&&(gt.maxzoom=We),this._updateLayer(gt))},le.prototype.setFilter=function(ie,we,We){We===void 0&&(We={}),this._checkLoaded();var gt=this.getLayer(ie);if(!gt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be filtered.")));return}if(!i.deepEqual(gt.filter,we)){if(we==null){gt.filter=void 0,this._updateLayer(gt);return}this._validate(i.validateStyle.filter,"layers."+gt.id+".filter",we,null,We)||(gt.filter=i.clone$1(we),this._updateLayer(gt))}},le.prototype.getFilter=function(ie){return i.clone$1(this.getLayer(ie).filter)},le.prototype.setLayoutProperty=function(ie,we,We,gt){gt===void 0&&(gt={}),this._checkLoaded();var kt=this.getLayer(ie);if(!kt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}i.deepEqual(kt.getLayoutProperty(we),We)||(kt.setLayoutProperty(we,We,gt),this._updateLayer(kt))},le.prototype.getLayoutProperty=function(ie,we){var We=this.getLayer(ie);if(!We){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style.")));return}return We.getLayoutProperty(we)},le.prototype.setPaintProperty=function(ie,we,We,gt){gt===void 0&&(gt={}),this._checkLoaded();var kt=this.getLayer(ie);if(!kt){this.fire(new i.ErrorEvent(new Error("The layer '"+ie+"' does not exist in the map's style and cannot be styled.")));return}if(!i.deepEqual(kt.getPaintProperty(we),We)){var Je=kt.setPaintProperty(we,We,gt);Je&&this._updateLayer(kt),this._changed=!0,this._updatedPaintProps[ie]=!0}},le.prototype.getPaintProperty=function(ie,we){return this.getLayer(ie).getPaintProperty(we)},le.prototype.setFeatureState=function(ie,we){this._checkLoaded();var We=ie.source,gt=ie.sourceLayer,kt=this.sourceCaches[We];if(kt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+We+"' does not exist in the map's style.")));return}var Je=kt.getSource().type;if(Je==="geojson"&>){this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(Je==="vector"&&!gt){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}ie.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),kt.setFeatureState(gt,ie.id,we)},le.prototype.removeFeatureState=function(ie,we){this._checkLoaded();var We=ie.source,gt=this.sourceCaches[We];if(gt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+We+"' does not exist in the map's style.")));return}var kt=gt.getSource().type,Je=kt==="vector"?ie.sourceLayer:void 0;if(kt==="vector"&&!Je){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(we&&typeof ie.id!="string"&&typeof ie.id!="number"){this.fire(new i.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}gt.removeFeatureState(Je,ie.id,we)},le.prototype.getFeatureState=function(ie){this._checkLoaded();var we=ie.source,We=ie.sourceLayer,gt=this.sourceCaches[we];if(gt===void 0){this.fire(new i.ErrorEvent(new Error("The source '"+we+"' does not exist in the map's style.")));return}var kt=gt.getSource().type;if(kt==="vector"&&!We){this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return ie.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),gt.getFeatureState(We,ie.id)},le.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},le.prototype.serialize=function(){return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(ie){return ie.serialize()}),layers:this._serializeLayers(this._order)},function(ie){return ie!==void 0})},le.prototype._updateLayer=function(ie){this._updatedLayers[ie.id]=!0,ie.source&&!this._updatedSources[ie.source]&&this.sourceCaches[ie.source].getSource().type!=="raster"&&(this._updatedSources[ie.source]="reload",this.sourceCaches[ie.source].pause()),this._changed=!0},le.prototype._flattenAndSortRenderedFeatures=function(ie){for(var we=this,We=function(Wn){return we._layers[Wn].type==="fill-extrusion"},gt={},kt=[],Je=this._order.length-1;Je>=0;Je--){var dt=this._order[Je];if(We(dt)){gt[dt]=Je;for(var It=0,ur=ie;It=0;Jt--){var Fr=this._order[Jt];if(We(Fr))for(var bi=kt.length-1;bi>=0;bi--){var Li=kt[bi].feature;if(gt[Li.layer.id] 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos -: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,cd=`#ifdef GL_ES +: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`,hd=`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Lf="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",ef=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; +}`,Pf="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}",ef=`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,rd="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",id=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +}`,nd="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}",ad=`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity @@ -3091,7 +3091,7 @@ void main() { #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width -float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,hd=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,fd=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { @@ -3174,7 +3174,7 @@ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_rati #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,nd=` +}`,od=` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; @@ -3197,7 +3197,7 @@ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;f #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,Nf="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",Xd=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +}`,jf="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}",Jd=`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity @@ -3205,13 +3205,13 @@ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)* #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,fd=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; +}`,dd=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,Pf=`#define SDF_PX 8.0 +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`,If=`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color @@ -3228,7 +3228,7 @@ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scal #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,dd=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; +}`,pd=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3265,7 +3265,7 @@ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float ga #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif -}`,pd=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; +}`,md=`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity @@ -3279,58 +3279,58 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,Vu=Cu(uh,gh),Xc=Cu(Qf,Ff),tf=Cu(Vl,Kc),_u=Cu(ed,xc),jh=Cu(mc,bc),Rc=Cu(vh,yu),Jc=Cu(gc,hl),Eu=Cu(ru,Fh),xf=Cu(jc,Jh),Eh=Cu(Mu,Yd),rf=Cu(sl,hp),jf=Cu(jl,os),Jd=Cu(_f,yh),Tp=Cu(hc,td),bf=Cu(Qh,Ef),Uf=Cu(vc,Ld),Dc=Cu(cd,Lf),wf=Cu(ef,rd),ch=Cu(id,_h),kf=Cu(hd,Nh),$f=Cu(Mh,yc),Lh=Cu(df,nd),Lu=Cu(uu,Nf),Uh=Cu(Xd,fd),Qc=Cu(Pf,dd),Pd=Cu(Yc,pd);function Cu(K,le){var ie=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,we=le.match(/attribute ([\w]+) ([\w]+)/g),We=K.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),mt=le.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),wt=mt?mt.concat(We):We,Qe={};return K=K.replace(ie,function(dt,It,lr,Qt,ar){return Qe[ar]=!0,It==="define"?` +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`,Vu=Cu(uh,gh),Xc=Cu(td,Nf),tf=Cu(Vl,Kc),_u=Cu(rd,xc),jh=Cu(mc,bc),Fc=Cu(vh,yu),Jc=Cu(gc,hl),Eu=Cu(ru,Fh),xf=Cu(Uc,Jh),Eh=Cu(Mu,Xd),rf=Cu(ll,fp),Uf=Cu(jl,os),Qd=Cu(_f,yh),Sp=Cu(hc,id),bf=Cu(Qh,Lf),$f=Cu(vc,Pd),zc=Cu(hd,Pf),wf=Cu(ef,nd),ch=Cu(ad,_h),kf=Cu(fd,Nh),Hf=Cu(Mh,yc),Lh=Cu(df,od),Lu=Cu(uu,jf),Uh=Cu(Jd,dd),Qc=Cu(If,pd),Id=Cu(Yc,md);function Cu(K,le){var ie=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,we=le.match(/attribute ([\w]+) ([\w]+)/g),We=K.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),gt=le.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),kt=gt?gt.concat(We):We,Je={};return K=K.replace(ie,function(dt,It,ur,er,ar){return Je[ar]=!0,It==="define"?` #ifndef HAS_UNIFORM_u_`+ar+` -varying `+lr+" "+Qt+" "+ar+`; +varying `+ur+" "+er+" "+ar+`; #else -uniform `+lr+" "+Qt+" u_"+ar+`; +uniform `+ur+" "+er+" u_"+ar+`; #endif `:` #ifdef HAS_UNIFORM_u_`+ar+` - `+lr+" "+Qt+" "+ar+" = u_"+ar+`; + `+ur+" "+er+" "+ar+" = u_"+ar+`; #endif -`}),le=le.replace(ie,function(dt,It,lr,Qt,ar){var pr=Qt==="float"?"vec2":"vec4",yr=ar.match(/color/)?"color":pr;return Qe[ar]?It==="define"?` +`}),le=le.replace(ie,function(dt,It,ur,er,ar){var pr=er==="float"?"vec2":"vec4",yr=ar.match(/color/)?"color":pr;return Je[ar]?It==="define"?` #ifndef HAS_UNIFORM_u_`+ar+` uniform lowp float u_`+ar+`_t; -attribute `+lr+" "+pr+" a_"+ar+`; -varying `+lr+" "+Qt+" "+ar+`; +attribute `+ur+" "+pr+" a_"+ar+`; +varying `+ur+" "+er+" "+ar+`; #else -uniform `+lr+" "+Qt+" u_"+ar+`; +uniform `+ur+" "+er+" u_"+ar+`; #endif `:yr==="vec4"?` #ifndef HAS_UNIFORM_u_`+ar+` `+ar+" = a_"+ar+`; #else - `+lr+" "+Qt+" "+ar+" = u_"+ar+`; + `+ur+" "+er+" "+ar+" = u_"+ar+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ar+` `+ar+" = unpack_mix_"+yr+"(a_"+ar+", u_"+ar+`_t); #else - `+lr+" "+Qt+" "+ar+" = u_"+ar+`; + `+ur+" "+er+" "+ar+" = u_"+ar+`; #endif `:It==="define"?` #ifndef HAS_UNIFORM_u_`+ar+` uniform lowp float u_`+ar+`_t; -attribute `+lr+" "+pr+" a_"+ar+`; +attribute `+ur+" "+pr+" a_"+ar+`; #else -uniform `+lr+" "+Qt+" u_"+ar+`; +uniform `+ur+" "+er+" u_"+ar+`; #endif `:yr==="vec4"?` #ifndef HAS_UNIFORM_u_`+ar+` - `+lr+" "+Qt+" "+ar+" = a_"+ar+`; + `+ur+" "+er+" "+ar+" = a_"+ar+`; #else - `+lr+" "+Qt+" "+ar+" = u_"+ar+`; + `+ur+" "+er+" "+ar+" = u_"+ar+`; #endif `:` #ifndef HAS_UNIFORM_u_`+ar+` - `+lr+" "+Qt+" "+ar+" = unpack_mix_"+yr+"(a_"+ar+", u_"+ar+`_t); + `+ur+" "+er+" "+ar+" = unpack_mix_"+yr+"(a_"+ar+", u_"+ar+`_t); #else - `+lr+" "+Qt+" "+ar+" = u_"+ar+`; + `+ur+" "+er+" "+ar+" = u_"+ar+`; #endif -`}),{fragmentSource:K,vertexSource:le,staticAttributes:we,staticUniforms:wt}}var If=Object.freeze({__proto__:null,prelude:Vu,background:Xc,backgroundPattern:tf,circle:_u,clippingMask:jh,heatmap:Rc,heatmapTexture:Jc,collisionBox:Eu,collisionCircle:xf,debug:Eh,fill:rf,fillOutline:jf,fillOutlinePattern:Jd,fillPattern:Tp,fillExtrusion:bf,fillExtrusionPattern:Uf,hillshadePrepare:Dc,hillshade:wf,line:ch,lineGradient:kf,linePattern:$f,lineSDF:Lh,raster:Lu,symbolIcon:Uh,symbolSDF:Qc,symbolTextAndIcon:Pd}),nf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};nf.prototype.bind=function(K,le,ie,we,We,mt,wt,Qe){this.context=K;for(var dt=this.boundPaintVertexBuffers.length!==we.length,It=0;!dt&&It>16,Qe>>16],u_pixel_coord_lower:[wt&65535,Qe&65535]}}function Df(K,le,ie,we){var We=ie.imageManager.getPattern(K.from.toString()),mt=ie.imageManager.getPattern(K.to.toString()),wt=ie.imageManager.getPixelSize(),Qe=wt.width,dt=wt.height,It=Math.pow(2,we.tileID.overscaledZ),lr=we.tileSize*Math.pow(2,ie.transform.tileZoom)/It,Qt=lr*(we.tileID.canonical.x+we.tileID.wrap*It),ar=lr*we.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:We.tl,u_pattern_br_a:We.br,u_pattern_tl_b:mt.tl,u_pattern_br_b:mt.br,u_texsize:[Qe,dt],u_mix:le.t,u_pattern_size_a:We.displaySize,u_pattern_size_b:mt.displaySize,u_scale_a:le.fromScale,u_scale_b:le.toScale,u_tile_units_to_pixels:1/ol(we,1,ie.transform.tileZoom),u_pixel_coord_upper:[Qt>>16,ar>>16],u_pixel_coord_lower:[Qt&65535,ar&65535]}}var Qd=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_lightpos:new i.Uniform3f(K,le.u_lightpos),u_lightintensity:new i.Uniform1f(K,le.u_lightintensity),u_lightcolor:new i.Uniform3f(K,le.u_lightcolor),u_vertical_gradient:new i.Uniform1f(K,le.u_vertical_gradient),u_opacity:new i.Uniform1f(K,le.u_opacity)}},Ac=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_lightpos:new i.Uniform3f(K,le.u_lightpos),u_lightintensity:new i.Uniform1f(K,le.u_lightintensity),u_lightcolor:new i.Uniform3f(K,le.u_lightcolor),u_vertical_gradient:new i.Uniform1f(K,le.u_vertical_gradient),u_height_factor:new i.Uniform1f(K,le.u_height_factor),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade),u_opacity:new i.Uniform1f(K,le.u_opacity)}},md=function(K,le,ie,we){var We=le.style.light,mt=We.properties.get("position"),wt=[mt.x,mt.y,mt.z],Qe=i.create$1();We.properties.get("anchor")==="viewport"&&i.fromRotation(Qe,-le.transform.angle),i.transformMat3(wt,wt,Qe);var dt=We.properties.get("color");return{u_matrix:K,u_lightpos:wt,u_lightintensity:We.properties.get("intensity"),u_lightcolor:[dt.r,dt.g,dt.b],u_vertical_gradient:+ie,u_opacity:we}},fh=function(K,le,ie,we,We,mt,wt){return i.extend(md(K,le,ie,we),af(mt,le,wt),{u_height_factor:-Math.pow(2,We.overscaledZ)/wt.tileSize/8})},$h=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Ph=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},Zu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world)}},fu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},Ih=function(K){return{u_matrix:K}},Tf=function(K,le,ie,we){return i.extend(Ih(K),af(ie,le,we))},Dh=function(K,le){return{u_matrix:K,u_world:le}},ad=function(K,le,ie,we,We){return i.extend(Tf(K,le,ie,we),{u_world:We})},wr=function(K,le){return{u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_scale_with_map:new i.Uniform1i(K,le.u_scale_with_map),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_extrude_scale:new i.Uniform2f(K,le.u_extrude_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Yr=function(K,le,ie,we){var We=K.transform,mt,wt;if(we.paint.get("circle-pitch-alignment")==="map"){var Qe=ol(ie,1,We.zoom);mt=!0,wt=[Qe,Qe]}else mt=!1,wt=We.pixelsToGLUnits;return{u_camera_to_center_distance:We.cameraToCenterDistance,u_scale_with_map:+(we.paint.get("circle-pitch-scale")==="map"),u_matrix:K.translatePosMatrix(le.posMatrix,ie,we.paint.get("circle-translate"),we.paint.get("circle-translate-anchor")),u_pitch_with_map:+mt,u_device_pixel_ratio:i.browser.devicePixelRatio,u_extrude_scale:wt}},Ni=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pixels_to_tile_units:new i.Uniform1f(K,le.u_pixels_to_tile_units),u_extrude_scale:new i.Uniform2f(K,le.u_extrude_scale),u_overscale_factor:new i.Uniform1f(K,le.u_overscale_factor)}},Ai=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_inv_matrix:new i.UniformMatrix4f(K,le.u_inv_matrix),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_viewport_size:new i.Uniform2f(K,le.u_viewport_size)}},hn=function(K,le,ie){var we=ol(ie,1,le.zoom),We=Math.pow(2,le.zoom-ie.tileID.overscaledZ),mt=ie.tileID.overscaleFactor();return{u_matrix:K,u_camera_to_center_distance:le.cameraToCenterDistance,u_pixels_to_tile_units:we,u_extrude_scale:[le.pixelsToGLUnits[0]/(we*We),le.pixelsToGLUnits[1]/(we*We)],u_overscale_factor:mt}},Ln=function(K,le,ie){return{u_matrix:K,u_inv_matrix:le,u_camera_to_center_distance:ie.cameraToCenterDistance,u_viewport_size:[ie.width,ie.height]}},pa=function(K,le){return{u_color:new i.UniformColor(K,le.u_color),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_overlay:new i.Uniform1i(K,le.u_overlay),u_overlay_scale:new i.Uniform1f(K,le.u_overlay_scale)}},Ea=function(K,le,ie){return ie===void 0&&(ie=1),{u_matrix:K,u_color:le,u_overlay:0,u_overlay_scale:ie}},Za=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},ao=function(K){return{u_matrix:K}},xa=function(K,le){return{u_extrude_scale:new i.Uniform1f(K,le.u_extrude_scale),u_intensity:new i.Uniform1f(K,le.u_intensity),u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Va=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world),u_image:new i.Uniform1i(K,le.u_image),u_color_ramp:new i.Uniform1i(K,le.u_color_ramp),u_opacity:new i.Uniform1f(K,le.u_opacity)}},Oa=function(K,le,ie,we){return{u_matrix:K,u_extrude_scale:ol(le,1,ie),u_intensity:we}},fa=function(K,le,ie,we){var We=i.create();i.ortho(We,0,K.width,K.height,0,0,1);var mt=K.context.gl;return{u_matrix:We,u_world:[mt.drawingBufferWidth,mt.drawingBufferHeight],u_image:ie,u_color_ramp:we,u_opacity:le.paint.get("heatmap-opacity")}},vo=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_latrange:new i.Uniform2f(K,le.u_latrange),u_light:new i.Uniform2f(K,le.u_light),u_shadow:new i.UniformColor(K,le.u_shadow),u_highlight:new i.UniformColor(K,le.u_highlight),u_accent:new i.UniformColor(K,le.u_accent)}},hs=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_dimension:new i.Uniform2f(K,le.u_dimension),u_zoom:new i.Uniform1f(K,le.u_zoom),u_unpack:new i.Uniform4f(K,le.u_unpack)}},rs=function(K,le,ie){var we=ie.paint.get("hillshade-shadow-color"),We=ie.paint.get("hillshade-highlight-color"),mt=ie.paint.get("hillshade-accent-color"),wt=ie.paint.get("hillshade-illumination-direction")*(Math.PI/180);ie.paint.get("hillshade-illumination-anchor")==="viewport"&&(wt-=K.transform.angle);var Qe=!K.options.moving;return{u_matrix:K.transform.calculatePosMatrix(le.tileID.toUnwrapped(),Qe),u_image:0,u_latrange:xs(K,le.tileID),u_light:[ie.paint.get("hillshade-exaggeration"),wt],u_shadow:we,u_highlight:We,u_accent:mt}},ps=function(K,le){var ie=le.stride,we=i.create();return i.ortho(we,0,i.EXTENT,-i.EXTENT,0,0,1),i.translate(we,we,[0,-i.EXTENT,0]),{u_matrix:we,u_image:1,u_dimension:[ie,ie],u_zoom:K.overscaledZ,u_unpack:le.getUnpackVector()}};function xs(K,le){var ie=Math.pow(2,le.canonical.z),we=le.canonical.y;return[new i.MercatorCoordinate(0,we/ie).toLngLat().lat,new i.MercatorCoordinate(0,(we+1)/ie).toLngLat().lat]}var _o=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels)}},io=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_image:new i.Uniform1i(K,le.u_image),u_image_height:new i.Uniform1f(K,le.u_image_height)}},bs=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_texsize:new i.Uniform2f(K,le.u_texsize),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_image:new i.Uniform1i(K,le.u_image),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},ll=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_patternscale_a:new i.Uniform2f(K,le.u_patternscale_a),u_patternscale_b:new i.Uniform2f(K,le.u_patternscale_b),u_sdfgamma:new i.Uniform1f(K,le.u_sdfgamma),u_image:new i.Uniform1i(K,le.u_image),u_tex_y_a:new i.Uniform1f(K,le.u_tex_y_a),u_tex_y_b:new i.Uniform1f(K,le.u_tex_y_b),u_mix:new i.Uniform1f(K,le.u_mix)}},Ul=function(K,le,ie){var we=K.transform;return{u_matrix:ec(K,le,ie),u_ratio:1/ol(le,1,we.zoom),u_device_pixel_ratio:i.browser.devicePixelRatio,u_units_to_pixels:[1/we.pixelsToGLUnits[0],1/we.pixelsToGLUnits[1]]}},mu=function(K,le,ie,we){return i.extend(Ul(K,le,ie),{u_image:0,u_image_height:we})},Ql=function(K,le,ie,we){var We=K.transform,mt=Cl(le,We);return{u_matrix:ec(K,le,ie),u_texsize:le.imageAtlasTexture.size,u_ratio:1/ol(le,1,We.zoom),u_device_pixel_ratio:i.browser.devicePixelRatio,u_image:0,u_scale:[mt,we.fromScale,we.toScale],u_fade:we.t,u_units_to_pixels:[1/We.pixelsToGLUnits[0],1/We.pixelsToGLUnits[1]]}},gu=function(K,le,ie,we,We){var mt=K.transform,wt=K.lineAtlas,Qe=Cl(le,mt),dt=ie.layout.get("line-cap")==="round",It=wt.getDash(we.from,dt),lr=wt.getDash(we.to,dt),Qt=It.width*We.fromScale,ar=lr.width*We.toScale;return i.extend(Ul(K,le,ie),{u_patternscale_a:[Qe/Qt,-It.height/2],u_patternscale_b:[Qe/ar,-lr.height/2],u_sdfgamma:wt.width/(Math.min(Qt,ar)*256*i.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:It.y,u_tex_y_b:lr.y,u_mix:We.t})};function Cl(K,le){return 1/ol(K,1,le.tileZoom)}function ec(K,le,ie){return K.translatePosMatrix(le.tileID.posMatrix,le,ie.paint.get("line-translate"),ie.paint.get("line-translate-anchor"))}var $u=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_tl_parent:new i.Uniform2f(K,le.u_tl_parent),u_scale_parent:new i.Uniform1f(K,le.u_scale_parent),u_buffer_scale:new i.Uniform1f(K,le.u_buffer_scale),u_fade_t:new i.Uniform1f(K,le.u_fade_t),u_opacity:new i.Uniform1f(K,le.u_opacity),u_image0:new i.Uniform1i(K,le.u_image0),u_image1:new i.Uniform1i(K,le.u_image1),u_brightness_low:new i.Uniform1f(K,le.u_brightness_low),u_brightness_high:new i.Uniform1f(K,le.u_brightness_high),u_saturation_factor:new i.Uniform1f(K,le.u_saturation_factor),u_contrast_factor:new i.Uniform1f(K,le.u_contrast_factor),u_spin_weights:new i.Uniform3f(K,le.u_spin_weights)}},xu=function(K,le,ie,we,We){return{u_matrix:K,u_tl_parent:le,u_scale_parent:ie,u_buffer_scale:1,u_fade_t:we.mix,u_opacity:we.opacity*We.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:We.paint.get("raster-brightness-min"),u_brightness_high:We.paint.get("raster-brightness-max"),u_saturation_factor:iu(We.paint.get("raster-saturation")),u_contrast_factor:Is(We.paint.get("raster-contrast")),u_spin_weights:Ho(We.paint.get("raster-hue-rotate"))}};function Ho(K){K*=Math.PI/180;var le=Math.sin(K),ie=Math.cos(K);return[(2*ie+1)/3,(-Math.sqrt(3)*le-ie+1)/3,(Math.sqrt(3)*le-ie+1)/3]}function Is(K){return K>0?1/(1-K):1+K}function iu(K){return K>0?1-1/(1.001-K):-K}var Wl=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texture:new i.Uniform1i(K,le.u_texture)}},Mc=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texture:new i.Uniform1i(K,le.u_texture),u_gamma_scale:new i.Uniform1f(K,le.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(K,le.u_is_halo)}},eh=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texsize_icon:new i.Uniform2f(K,le.u_texsize_icon),u_texture:new i.Uniform1i(K,le.u_texture),u_texture_icon:new i.Uniform1i(K,le.u_texture_icon),u_gamma_scale:new i.Uniform1f(K,le.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(K,le.u_is_halo)}},Uc=function(K,le,ie,we,We,mt,wt,Qe,dt,It){var lr=We.transform;return{u_is_size_zoom_constant:+(K==="constant"||K==="source"),u_is_size_feature_constant:+(K==="constant"||K==="camera"),u_size_t:le?le.uSizeT:0,u_size:le?le.uSize:0,u_camera_to_center_distance:lr.cameraToCenterDistance,u_pitch:lr.pitch/360*2*Math.PI,u_rotate_symbol:+ie,u_aspect_ratio:lr.width/lr.height,u_fade_change:We.options.fadeDuration?We.symbolFadeChange:1,u_matrix:mt,u_label_plane_matrix:wt,u_coord_matrix:Qe,u_is_text:+dt,u_pitch_with_map:+we,u_texsize:It,u_texture:0}},Hh=function(K,le,ie,we,We,mt,wt,Qe,dt,It,lr){var Qt=We.transform;return i.extend(Uc(K,le,ie,we,We,mt,wt,Qe,dt,It),{u_gamma_scale:we?Math.cos(Qt._pitch)*Qt.cameraToCenterDistance:1,u_device_pixel_ratio:i.browser.devicePixelRatio,u_is_halo:1})},th=function(K,le,ie,we,We,mt,wt,Qe,dt,It){return i.extend(Hh(K,le,ie,we,We,mt,wt,Qe,!0,dt),{u_texsize_icon:It,u_texture_icon:1})},Vh=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_opacity:new i.Uniform1f(K,le.u_opacity),u_color:new i.UniformColor(K,le.u_color)}},Wu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_opacity:new i.Uniform1f(K,le.u_opacity),u_image:new i.Uniform1i(K,le.u_image),u_pattern_tl_a:new i.Uniform2f(K,le.u_pattern_tl_a),u_pattern_br_a:new i.Uniform2f(K,le.u_pattern_br_a),u_pattern_tl_b:new i.Uniform2f(K,le.u_pattern_tl_b),u_pattern_br_b:new i.Uniform2f(K,le.u_pattern_br_b),u_texsize:new i.Uniform2f(K,le.u_texsize),u_mix:new i.Uniform1f(K,le.u_mix),u_pattern_size_a:new i.Uniform2f(K,le.u_pattern_size_a),u_pattern_size_b:new i.Uniform2f(K,le.u_pattern_size_b),u_scale_a:new i.Uniform1f(K,le.u_scale_a),u_scale_b:new i.Uniform1f(K,le.u_scale_b),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_tile_units_to_pixels:new i.Uniform1f(K,le.u_tile_units_to_pixels)}},Wh=function(K,le,ie){return{u_matrix:K,u_opacity:le,u_color:ie}},cs=function(K,le,ie,we,We,mt){return i.extend(Df(we,mt,ie,We),{u_matrix:K,u_opacity:le})},Fs={fillExtrusion:Qd,fillExtrusionPattern:Ac,fill:$h,fillPattern:Ph,fillOutline:Zu,fillOutlinePattern:fu,circle:wr,collisionBox:Ni,collisionCircle:Ai,debug:pa,clippingMask:Za,heatmap:xa,heatmapTexture:Va,hillshade:vo,hillshadePrepare:hs,line:_o,lineGradient:io,linePattern:bs,lineSDF:ll,raster:$u,symbolIcon:Wl,symbolSDF:Mc,symbolTextAndIcon:eh,background:Vh,backgroundPattern:Wu},rh;function tc(K,le,ie,we,We,mt,wt){for(var Qe=K.context,dt=Qe.gl,It=K.useProgram("collisionBox"),lr=[],Qt=0,ar=0,pr=0;pr0){var Li=i.create(),Pn=Xt;i.mul(Li,tr.placementInvProjMatrix,K.transform.glCoordMatrix),i.mul(Li,Li,tr.placementViewportMatrix),lr.push({circleArray:xi,circleOffset:ar,transform:Pn,invTransform:Li}),Qt+=xi.length/4,ar=Qt}Fr&&It.draw(Qe,dt.LINES,yn.disabled,fn.disabled,K.colorModeForRenderPass(),fi.disabled,hn(Xt,K.transform,qt),ie.id,Fr.layoutVertexBuffer,Fr.indexBuffer,Fr.segments,null,K.transform.zoom,null,null,Fr.collisionVertexBuffer)}}if(!(!wt||!lr.length)){var An=K.useProgram("collisionCircle"),mn=new i.StructArrayLayout2f1f2i16;mn.resize(Qt*4),mn._trim();for(var Hn=0,In=0,ca=lr;In=0&&(yr[tr.associatedIconIndex]={shiftedAnchor:va,angle:po})}}if(lr){pr.clear();for(var Jo=K.icon.placedSymbolArray,Ts=0;Ts0){var wt=i.browser.now(),Qe=(wt-K.timeAdded)/mt,dt=le?(wt-le.timeAdded)/mt:-1,It=ie.getSource(),lr=We.coveringZoomLevel({tileSize:It.tileSize,roundZoom:It.roundZoom}),Qt=!le||Math.abs(le.tileID.overscaledZ-lr)>Math.abs(K.tileID.overscaledZ-lr),ar=Qt&&K.refreshedUponExpiration?1:i.clamp(Qt?Qe:1-dt,0,1);return K.refreshedUponExpiration&&Qe>=1&&(K.refreshedUponExpiration=!1),le?{opacity:1,mix:1-ar}:{opacity:ar,mix:0}}else return{opacity:1,mix:0}}function Zr(K,le,ie){var we=ie.paint.get("background-color"),We=ie.paint.get("background-opacity");if(We!==0){var mt=K.context,wt=mt.gl,Qe=K.transform,dt=Qe.tileSize,It=ie.paint.get("background-pattern");if(!K.isPatternMissing(It)){var lr=!It&&we.a===1&&We===1&&K.opaquePassEnabledForLayer()?"opaque":"translucent";if(K.renderPass===lr){var Qt=fn.disabled,ar=K.depthModeForSublayer(0,lr==="opaque"?yn.ReadWrite:yn.ReadOnly),pr=K.colorModeForRenderPass(),yr=K.useProgram(It?"backgroundPattern":"background"),qt=Qe.coveringTiles({tileSize:dt});It&&(mt.activeTexture.set(wt.TEXTURE0),K.imageManager.bind(K.context));for(var tr=ie.getCrossfadeParameters(),Xt=0,Fr=qt;Xt "+ie.overscaledZ);var Xt=tr+" "+pr+"kb";_s(K,Xt),wt.draw(we,We.TRIANGLES,Qe,dt,sr.alphaBlended,fi.disabled,Ea(mt,i.Color.transparent,qt),lr,K.debugBuffer,K.quadTriangleIndexBuffer,K.debugSegments)}function _s(K,le){K.initDebugOverlayCanvas();var ie=K.debugOverlayCanvas,we=K.context.gl,We=K.debugOverlayCanvas.getContext("2d");We.clearRect(0,0,ie.width,ie.height),We.shadowColor="white",We.shadowBlur=2,We.lineWidth=1.5,We.strokeStyle="white",We.textBaseline="top",We.font="bold 36px Open Sans, sans-serif",We.fillText(le,5,5),We.strokeText(le,5,5),K.debugOverlayTexture.update(ie),K.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}function wl(K,le,ie){var we=K.context,We=ie.implementation;if(K.renderPass==="offscreen"){var mt=We.prerender;mt&&(K.setCustomLayerDefaults(),we.setColorMode(K.colorModeForRenderPass()),mt.call(We,we.gl,K.transform.customLayerMatrix()),we.setDirty(),K.setBaseState())}else if(K.renderPass==="translucent"){K.setCustomLayerDefaults(),we.setColorMode(K.colorModeForRenderPass()),we.setStencilMode(fn.disabled);var wt=We.renderingMode==="3d"?new yn(K.context.gl.LEQUAL,yn.ReadWrite,K.depthRangeFor3D):K.depthModeForSublayer(0,yn.ReadOnly);we.setDepthMode(wt),We.render(we.gl,K.transform.customLayerMatrix()),we.setDirty(),K.setBaseState(),we.bindFramebuffer.set(null)}}var Al={symbol:O,circle:er,heatmap:kr,line:Vi,fill:tt,"fill-extrusion":Tt,hillshade:Vt,raster:Lr,background:Zr,debug:Go,custom:wl},Us=function(K,le){this.context=new qi(K),this.transform=le,this._tileTextures={},this.setup(),this.numSublayers=Ui.maxUnderzooming+Ui.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ic,this.gpuTimers={}};Us.prototype.resize=function(K,le){if(this.width=K*i.browser.devicePixelRatio,this.height=le*i.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var ie=0,we=this.style._order;ie256&&this.clearStencil(),ie.setColorMode(sr.disabled),ie.setDepthMode(yn.disabled);var We=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var mt=0,wt=le;mt256&&this.clearStencil();var K=this.nextStencilID++,le=this.context.gl;return new fn({func:le.NOTEQUAL,mask:255},K,255,le.KEEP,le.KEEP,le.REPLACE)},Us.prototype.stencilModeForClipping=function(K){var le=this.context.gl;return new fn({func:le.EQUAL,mask:255},this._tileClippingMaskIDs[K.key],0,le.KEEP,le.KEEP,le.REPLACE)},Us.prototype.stencilConfigForOverlap=function(K){var le,ie=this.context.gl,we=K.sort(function(dt,It){return It.overscaledZ-dt.overscaledZ}),We=we[we.length-1].overscaledZ,mt=we[0].overscaledZ-We+1;if(mt>1){this.currentStencilSource=void 0,this.nextStencilID+mt>256&&this.clearStencil();for(var wt={},Qe=0;Qe=0;this.currentLayer--){var xi=this.style._layers[we[this.currentLayer]],Li=We[xi.source],Pn=Qe[xi.source];this._renderTileClippingMasks(xi,Pn),this.renderLayer(this,Li,xi,Pn)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?le.pop():null},Us.prototype.isPatternMissing=function(K){if(!K)return!1;if(!K.from||!K.to)return!0;var le=this.imageManager.getPattern(K.from.toString()),ie=this.imageManager.getPattern(K.to.toString());return!le||!ie},Us.prototype.useProgram=function(K,le){this.cache=this.cache||{};var ie=""+K+(le?le.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[ie]||(this.cache[ie]=new pf(this.context,K,If[K],le,Fs[K],this._showOverdrawInspector)),this.cache[ie]},Us.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Us.prototype.setBaseState=function(){var K=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(K.FUNC_ADD)},Us.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=i.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var K=this.context.gl;this.debugOverlayTexture=new i.Texture(this.context,this.debugOverlayCanvas,K.RGBA)}},Us.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Pl=function(K,le){this.points=K,this.planes=le};Pl.fromInvProjectionMatrix=function(K,le,ie){var we=[[-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]],We=Math.pow(2,ie),mt=we.map(function(dt){return i.transformMat4([],dt,K)}).map(function(dt){return i.scale$1([],dt,1/dt[3]/le*We)}),wt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Qe=wt.map(function(dt){var It=i.sub([],mt[dt[0]],mt[dt[1]]),lr=i.sub([],mt[dt[2]],mt[dt[1]]),Qt=i.normalize([],i.cross([],It,lr)),ar=-i.dot(Qt,mt[dt[1]]);return Qt.concat(ar)});return new Pl(mt,Qe)};var Ru=function(K,le){this.min=K,this.max=le,this.center=i.scale$2([],i.add([],this.min,this.max),.5)};Ru.prototype.quadrant=function(K){for(var le=[K%2===0,K<2],ie=i.clone$2(this.min),we=i.clone$2(this.max),We=0;We=0;if(mt===0)return 0;mt!==le.length&&(ie=!1)}if(ie)return 2;for(var Qe=0;Qe<3;Qe++){for(var dt=Number.MAX_VALUE,It=-Number.MAX_VALUE,lr=0;lrthis.max[Qe]-this.min[Qe])return 0}return 1};var Tu=function(K,le,ie,we){if(K===void 0&&(K=0),le===void 0&&(le=0),ie===void 0&&(ie=0),we===void 0&&(we=0),isNaN(K)||K<0||isNaN(le)||le<0||isNaN(ie)||ie<0||isNaN(we)||we<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=K,this.bottom=le,this.left=ie,this.right=we};Tu.prototype.interpolate=function(K,le,ie){return le.top!=null&&K.top!=null&&(this.top=i.number(K.top,le.top,ie)),le.bottom!=null&&K.bottom!=null&&(this.bottom=i.number(K.bottom,le.bottom,ie)),le.left!=null&&K.left!=null&&(this.left=i.number(K.left,le.left,ie)),le.right!=null&&K.right!=null&&(this.right=i.number(K.right,le.right,ie)),this},Tu.prototype.getCenter=function(K,le){var ie=i.clamp((this.left+K-this.right)/2,0,K),we=i.clamp((this.top+le-this.bottom)/2,0,le);return new i.Point(ie,we)},Tu.prototype.equals=function(K){return this.top===K.top&&this.bottom===K.bottom&&this.left===K.left&&this.right===K.right},Tu.prototype.clone=function(){return new Tu(this.top,this.bottom,this.left,this.right)},Tu.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Js=function(K,le,ie,we,We){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=We===void 0?!0:We,this._minZoom=K||0,this._maxZoom=le||22,this._minPitch=ie??0,this._maxPitch=we??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new i.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tu,this._posMatrixCache={},this._alignedPosMatrixCache={}},Qs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Js.prototype.clone=function(){var K=new Js(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return K.tileSize=this.tileSize,K.latRange=this.latRange,K.width=this.width,K.height=this.height,K._center=this._center,K.zoom=this.zoom,K.angle=this.angle,K._fov=this._fov,K._pitch=this._pitch,K._unmodified=this._unmodified,K._edgeInsets=this._edgeInsets.clone(),K._calcMatrices(),K},Qs.minZoom.get=function(){return this._minZoom},Qs.minZoom.set=function(K){this._minZoom!==K&&(this._minZoom=K,this.zoom=Math.max(this.zoom,K))},Qs.maxZoom.get=function(){return this._maxZoom},Qs.maxZoom.set=function(K){this._maxZoom!==K&&(this._maxZoom=K,this.zoom=Math.min(this.zoom,K))},Qs.minPitch.get=function(){return this._minPitch},Qs.minPitch.set=function(K){this._minPitch!==K&&(this._minPitch=K,this.pitch=Math.max(this.pitch,K))},Qs.maxPitch.get=function(){return this._maxPitch},Qs.maxPitch.set=function(K){this._maxPitch!==K&&(this._maxPitch=K,this.pitch=Math.min(this.pitch,K))},Qs.renderWorldCopies.get=function(){return this._renderWorldCopies},Qs.renderWorldCopies.set=function(K){K===void 0?K=!0:K===null&&(K=!1),this._renderWorldCopies=K},Qs.worldSize.get=function(){return this.tileSize*this.scale},Qs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Qs.size.get=function(){return new i.Point(this.width,this.height)},Qs.bearing.get=function(){return-this.angle/Math.PI*180},Qs.bearing.set=function(K){var le=-i.wrap(K,-180,180)*Math.PI/180;this.angle!==le&&(this._unmodified=!1,this.angle=le,this._calcMatrices(),this.rotationMatrix=i.create$2(),i.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Qs.pitch.get=function(){return this._pitch/Math.PI*180},Qs.pitch.set=function(K){var le=i.clamp(K,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==le&&(this._unmodified=!1,this._pitch=le,this._calcMatrices())},Qs.fov.get=function(){return this._fov/Math.PI*180},Qs.fov.set=function(K){K=Math.max(.01,Math.min(60,K)),this._fov!==K&&(this._unmodified=!1,this._fov=K/180*Math.PI,this._calcMatrices())},Qs.zoom.get=function(){return this._zoom},Qs.zoom.set=function(K){var le=Math.min(Math.max(K,this.minZoom),this.maxZoom);this._zoom!==le&&(this._unmodified=!1,this._zoom=le,this.scale=this.zoomScale(le),this.tileZoom=Math.floor(le),this.zoomFraction=le-this.tileZoom,this._constrain(),this._calcMatrices())},Qs.center.get=function(){return this._center},Qs.center.set=function(K){K.lat===this._center.lat&&K.lng===this._center.lng||(this._unmodified=!1,this._center=K,this._constrain(),this._calcMatrices())},Qs.padding.get=function(){return this._edgeInsets.toJSON()},Qs.padding.set=function(K){this._edgeInsets.equals(K)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,K,1),this._calcMatrices())},Qs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Js.prototype.isPaddingEqual=function(K){return this._edgeInsets.equals(K)},Js.prototype.interpolatePadding=function(K,le,ie){this._unmodified=!1,this._edgeInsets.interpolate(K,le,ie),this._constrain(),this._calcMatrices()},Js.prototype.coveringZoomLevel=function(K){var le=(K.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/K.tileSize));return Math.max(0,le)},Js.prototype.getVisibleUnwrappedCoordinates=function(K){var le=[new i.UnwrappedTileID(0,K)];if(this._renderWorldCopies)for(var ie=this.pointCoordinate(new i.Point(0,0)),we=this.pointCoordinate(new i.Point(this.width,0)),We=this.pointCoordinate(new i.Point(this.width,this.height)),mt=this.pointCoordinate(new i.Point(0,this.height)),wt=Math.floor(Math.min(ie.x,we.x,We.x,mt.x)),Qe=Math.floor(Math.max(ie.x,we.x,We.x,mt.x)),dt=1,It=wt-dt;It<=Qe+dt;It++)It!==0&&le.push(new i.UnwrappedTileID(It,K));return le},Js.prototype.coveringTiles=function(K){var le=this.coveringZoomLevel(K),ie=le;if(K.minzoom!==void 0&&leK.maxzoom&&(le=K.maxzoom);var we=i.MercatorCoordinate.fromLngLat(this.center),We=Math.pow(2,le),mt=[We*we.x,We*we.y,0],wt=Pl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,le),Qe=K.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Qe=le);var dt=3,It=function($n){return{aabb:new Ru([$n*We,0,0],[($n+1)*We,We,0]),zoom:0,x:0,y:0,wrap:$n,fullyVisible:!1}},lr=[],Qt=[],ar=le,pr=K.reparseOverscaled?ie:le;if(this._renderWorldCopies)for(var yr=1;yr<=3;yr++)lr.push(It(-yr)),lr.push(It(yr));for(lr.push(It(0));lr.length>0;){var qt=lr.pop(),tr=qt.x,Xt=qt.y,Fr=qt.fullyVisible;if(!Fr){var xi=qt.aabb.intersects(wt);if(xi===0)continue;Fr=xi===2}var Li=qt.aabb.distanceX(mt),Pn=qt.aabb.distanceY(mt),An=Math.max(Math.abs(Li),Math.abs(Pn)),mn=dt+(1<mn&&qt.zoom>=Qe){Qt.push({tileID:new i.OverscaledTileID(qt.zoom===ar?pr:qt.zoom,qt.wrap,qt.zoom,tr,Xt),distanceSq:i.sqrLen([mt[0]-.5-tr,mt[1]-.5-Xt])});continue}for(var Hn=0;Hn<4;Hn++){var In=(tr<<1)+Hn%2,ca=(Xt<<1)+(Hn>>1);lr.push({aabb:qt.aabb.quadrant(Hn),zoom:qt.zoom+1,x:In,y:ca,wrap:qt.wrap,fullyVisible:Fr})}}return Qt.sort(function($n,Vn){return $n.distanceSq-Vn.distanceSq}).map(function($n){return $n.tileID})},Js.prototype.resize=function(K,le){this.width=K,this.height=le,this.pixelsToGLUnits=[2/K,-2/le],this._constrain(),this._calcMatrices()},Qs.unmodified.get=function(){return this._unmodified},Js.prototype.zoomScale=function(K){return Math.pow(2,K)},Js.prototype.scaleZoom=function(K){return Math.log(K)/Math.LN2},Js.prototype.project=function(K){var le=i.clamp(K.lat,-this.maxValidLatitude,this.maxValidLatitude);return new i.Point(i.mercatorXfromLng(K.lng)*this.worldSize,i.mercatorYfromLat(le)*this.worldSize)},Js.prototype.unproject=function(K){return new i.MercatorCoordinate(K.x/this.worldSize,K.y/this.worldSize).toLngLat()},Qs.point.get=function(){return this.project(this.center)},Js.prototype.setLocationAtPoint=function(K,le){var ie=this.pointCoordinate(le),we=this.pointCoordinate(this.centerPoint),We=this.locationCoordinate(K),mt=new i.MercatorCoordinate(We.x-(ie.x-we.x),We.y-(ie.y-we.y));this.center=this.coordinateLocation(mt),this._renderWorldCopies&&(this.center=this.center.wrap())},Js.prototype.locationPoint=function(K){return this.coordinatePoint(this.locationCoordinate(K))},Js.prototype.pointLocation=function(K){return this.coordinateLocation(this.pointCoordinate(K))},Js.prototype.locationCoordinate=function(K){return i.MercatorCoordinate.fromLngLat(K)},Js.prototype.coordinateLocation=function(K){return K.toLngLat()},Js.prototype.pointCoordinate=function(K){var le=0,ie=[K.x,K.y,0,1],we=[K.x,K.y,1,1];i.transformMat4(ie,ie,this.pixelMatrixInverse),i.transformMat4(we,we,this.pixelMatrixInverse);var We=ie[3],mt=we[3],wt=ie[0]/We,Qe=we[0]/mt,dt=ie[1]/We,It=we[1]/mt,lr=ie[2]/We,Qt=we[2]/mt,ar=lr===Qt?0:(le-lr)/(Qt-lr);return new i.MercatorCoordinate(i.number(wt,Qe,ar)/this.worldSize,i.number(dt,It,ar)/this.worldSize)},Js.prototype.coordinatePoint=function(K){var le=[K.x*this.worldSize,K.y*this.worldSize,0,1];return i.transformMat4(le,le,this.pixelMatrix),new i.Point(le[0]/le[3],le[1]/le[3])},Js.prototype.getBounds=function(){return new i.LngLatBounds().extend(this.pointLocation(new i.Point(0,0))).extend(this.pointLocation(new i.Point(this.width,0))).extend(this.pointLocation(new i.Point(this.width,this.height))).extend(this.pointLocation(new i.Point(0,this.height)))},Js.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new i.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Js.prototype.setMaxBounds=function(K){K?(this.lngRange=[K.getWest(),K.getEast()],this.latRange=[K.getSouth(),K.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Js.prototype.calculatePosMatrix=function(K,le){le===void 0&&(le=!1);var ie=K.key,we=le?this._alignedPosMatrixCache:this._posMatrixCache;if(we[ie])return we[ie];var We=K.canonical,mt=this.worldSize/this.zoomScale(We.z),wt=We.x+Math.pow(2,We.z)*K.wrap,Qe=i.identity(new Float64Array(16));return i.translate(Qe,Qe,[wt*mt,We.y*mt,0]),i.scale(Qe,Qe,[mt/i.EXTENT,mt/i.EXTENT,1]),i.multiply(Qe,le?this.alignedProjMatrix:this.projMatrix,Qe),we[ie]=new Float32Array(Qe),we[ie]},Js.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Js.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var K=-90,le=90,ie=-180,we=180,We,mt,wt,Qe,dt=this.size,It=this._unmodified;if(this.latRange){var lr=this.latRange;K=i.mercatorYfromLat(lr[1])*this.worldSize,le=i.mercatorYfromLat(lr[0])*this.worldSize,We=le-Kle&&(Qe=le-qt)}if(this.lngRange){var tr=ar.x,Xt=dt.x/2;tr-Xtwe&&(wt=we-Xt)}(wt!==void 0||Qe!==void 0)&&(this.center=this.unproject(new i.Point(wt!==void 0?wt:ar.x,Qe!==void 0?Qe:ar.y))),this._unmodified=It,this._constraining=!1}},Js.prototype._calcMatrices=function(){if(this.height){var K=this._fov/2,le=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(K)*this.height;var ie=Math.PI/2+this._pitch,we=this._fov*(.5+le.y/this.height),We=Math.sin(we)*this.cameraToCenterDistance/Math.sin(i.clamp(Math.PI-ie-we,.01,Math.PI-.01)),mt=this.point,wt=mt.x,Qe=mt.y,dt=Math.cos(Math.PI/2-this._pitch)*We+this.cameraToCenterDistance,It=dt*1.01,lr=this.height/50,Qt=new Float64Array(16);i.perspective(Qt,this._fov,this.width/this.height,lr,It),Qt[8]=-le.x*2/this.width,Qt[9]=le.y*2/this.height,i.scale(Qt,Qt,[1,-1,1]),i.translate(Qt,Qt,[0,0,-this.cameraToCenterDistance]),i.rotateX(Qt,Qt,this._pitch),i.rotateZ(Qt,Qt,this.angle),i.translate(Qt,Qt,[-wt,-Qe,0]),this.mercatorMatrix=i.scale([],Qt,[this.worldSize,this.worldSize,this.worldSize]),i.scale(Qt,Qt,[1,1,i.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Qt,this.invProjMatrix=i.invert([],this.projMatrix);var ar=this.width%2/2,pr=this.height%2/2,yr=Math.cos(this.angle),qt=Math.sin(this.angle),tr=wt-Math.round(wt)+yr*ar+qt*pr,Xt=Qe-Math.round(Qe)+yr*pr+qt*ar,Fr=new Float64Array(Qt);if(i.translate(Fr,Fr,[tr>.5?tr-1:tr,Xt>.5?Xt-1:Xt,0]),this.alignedProjMatrix=Fr,Qt=i.create(),i.scale(Qt,Qt,[this.width/2,-this.height/2,1]),i.translate(Qt,Qt,[1,-1,0]),this.labelPlaneMatrix=Qt,Qt=i.create(),i.scale(Qt,Qt,[1,-1,1]),i.translate(Qt,Qt,[-1,-1,0]),i.scale(Qt,Qt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Qt,this.pixelMatrix=i.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Qt=i.invert(new Float64Array(16),this.pixelMatrix),!Qt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Qt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Js.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var K=this.pointCoordinate(new i.Point(0,0)),le=[K.x*this.worldSize,K.y*this.worldSize,0,1],ie=i.transformMat4(le,le,this.pixelMatrix);return ie[3]/this.cameraToCenterDistance},Js.prototype.getCameraPoint=function(){var K=this._pitch,le=Math.tan(K)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.Point(0,le))},Js.prototype.getCameraQueryGeometry=function(K){var le=this.getCameraPoint();if(K.length===1)return[K[0],le];for(var ie=le.x,we=le.y,We=le.x,mt=le.y,wt=0,Qe=K;wt=3&&!K.some(function(ie){return isNaN(ie)})){var le=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(K[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+K[2],+K[1]],zoom:+K[0],bearing:le,pitch:+(K[4]||0)}),!0}return!1},wc.prototype._updateHashUnthrottled=function(){var K=i.window.location.href.replace(/(#.+)?$/,this.getHashString());try{i.window.history.replaceState(i.window.history.state,null,K)}catch{}};var ih={linearity:.3,easing:i.bezier(0,0,.3,1)},Me=i.extend({deceleration:2500,maxSpeed:1400},ih),Ve=i.extend({deceleration:20,maxSpeed:1400},ih),ft=i.extend({deceleration:1e3,maxSpeed:360},ih),Pt=i.extend({deceleration:1e3,maxSpeed:90},ih),Bt=function(K){this._map=K,this.clear()};Bt.prototype.clear=function(){this._inertiaBuffer=[]},Bt.prototype.record=function(K){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.browser.now(),settings:K})},Bt.prototype._drainInertiaBuffer=function(){for(var K=this._inertiaBuffer,le=i.browser.now(),ie=160;K.length>0&&le-K[0].time>ie;)K.shift()},Bt.prototype._onMoveEnd=function(K){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var le={zoom:0,bearing:0,pitch:0,pan:new i.Point(0,0),pinchAround:void 0,around:void 0},ie=0,we=this._inertiaBuffer;ie=this._clickTolerance||this._map.fire(new cr(K.type,this._map,K))},ci.prototype.dblclick=function(K){return this._firePreventable(new cr(K.type,this._map,K))},ci.prototype.mouseover=function(K){this._map.fire(new cr(K.type,this._map,K))},ci.prototype.mouseout=function(K){this._map.fire(new cr(K.type,this._map,K))},ci.prototype.touchstart=function(K){return this._firePreventable(new Or(K.type,this._map,K))},ci.prototype.touchmove=function(K){this._map.fire(new Or(K.type,this._map,K))},ci.prototype.touchend=function(K){this._map.fire(new Or(K.type,this._map,K))},ci.prototype.touchcancel=function(K){this._map.fire(new Or(K.type,this._map,K))},ci.prototype._firePreventable=function(K){if(this._map.fire(K),K.defaultPrevented)return{}},ci.prototype.isEnabled=function(){return!0},ci.prototype.isActive=function(){return!1},ci.prototype.enable=function(){},ci.prototype.disable=function(){};var Bi=function(K){this._map=K};Bi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bi.prototype.mousemove=function(K){this._map.fire(new cr(K.type,this._map,K))},Bi.prototype.mousedown=function(){this._delayContextMenu=!0},Bi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bi.prototype.contextmenu=function(K){this._delayContextMenu?this._contextMenuEvent=K:this._map.fire(new cr(K.type,this._map,K)),this._map.listens("contextmenu")&&K.preventDefault()},Bi.prototype.isEnabled=function(){return!0},Bi.prototype.isActive=function(){return!1},Bi.prototype.enable=function(){},Bi.prototype.disable=function(){};var Yi=function(K,le){this._map=K,this._el=K.getCanvasContainer(),this._container=K.getContainer(),this._clickTolerance=le.clickTolerance||1};Yi.prototype.isEnabled=function(){return!!this._enabled},Yi.prototype.isActive=function(){return!!this._active},Yi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Yi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Yi.prototype.mousedown=function(K,le){this.isEnabled()&&K.shiftKey&&K.button===0&&(a.disableDrag(),this._startPos=this._lastPos=le,this._active=!0)},Yi.prototype.mousemoveWindow=function(K,le){if(this._active){var ie=le;if(!(this._lastPos.equals(ie)||!this._box&&ie.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=K.timeStamp),ie.length===this.numTouches&&(this.centroid=ta(le),this.touches=Qi(ie,le)))},Zn.prototype.touchmove=function(K,le,ie){if(!(this.aborted||!this.centroid)){var we=Qi(ie,le);for(var We in this.touches){var mt=this.touches[We],wt=we[We];(!wt||wt.dist(mt)>Un)&&(this.aborted=!0)}}},Zn.prototype.touchend=function(K,le,ie){if((!this.centroid||K.timeStamp-this.startTime>On)&&(this.aborted=!0),ie.length===0){var we=!this.aborted&&this.centroid;if(this.reset(),we)return we}};var aa=function(K){this.singleTap=new Zn(K),this.numTaps=K.numTaps,this.reset()};aa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},aa.prototype.touchstart=function(K,le,ie){this.singleTap.touchstart(K,le,ie)},aa.prototype.touchmove=function(K,le,ie){this.singleTap.touchmove(K,le,ie)},aa.prototype.touchend=function(K,le,ie){var we=this.singleTap.touchend(K,le,ie);if(we){var We=K.timeStamp-this.lastTime0&&(this._active=!0);var we=Qi(ie,le),We=new i.Point(0,0),mt=new i.Point(0,0),wt=0;for(var Qe in we){var dt=we[Qe],It=this._touches[Qe];It&&(We._add(dt),mt._add(dt.sub(It)),wt++,we[Qe]=dt)}if(this._touches=we,!(wtMath.abs(K.x)}var Zl=100,cu=function(K){function le(){K.apply(this,arguments)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.reset=function(){K.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},le.prototype._start=function(ie){this._lastPoints=ie,dh(ie[0].sub(ie[1]))&&(this._valid=!1)},le.prototype._move=function(ie,we,We){var mt=ie[0].sub(this._lastPoints[0]),wt=ie[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(mt,wt,We.timeStamp),!!this._valid){this._lastPoints=ie,this._active=!0;var Qe=(mt.y+wt.y)/2,dt=-.5;return{pitchDelta:Qe*dt}}},le.prototype.gestureBeginsVertically=function(ie,we,We){if(this._valid!==void 0)return this._valid;var mt=2,wt=ie.mag()>=mt,Qe=we.mag()>=mt;if(!(!wt&&!Qe)){if(!wt||!Qe)return this._firstMove===void 0&&(this._firstMove=We),We-this._firstMove0==we.y>0;return dh(ie)&&dh(we)&&dt}},le}(Dl),zh={panStep:100,bearingStep:15,pitchStep:10},St=function(){var K=zh;this._panStep=K.panStep,this._bearingStep=K.bearingStep,this._pitchStep=K.pitchStep,this._rotationDisabled=!1};St.prototype.reset=function(){this._active=!1},St.prototype.keydown=function(K){var le=this;if(!(K.altKey||K.ctrlKey||K.metaKey)){var ie=0,we=0,We=0,mt=0,wt=0;switch(K.keyCode){case 61:case 107:case 171:case 187:ie=1;break;case 189:case 109:case 173:ie=-1;break;case 37:K.shiftKey?we=-1:(K.preventDefault(),mt=-1);break;case 39:K.shiftKey?we=1:(K.preventDefault(),mt=1);break;case 38:K.shiftKey?We=1:(K.preventDefault(),wt=-1);break;case 40:K.shiftKey?We=-1:(K.preventDefault(),wt=1);break;default:return}return this._rotationDisabled&&(we=0,We=0),{cameraAnimation:function(Qe){var dt=Qe.getZoom();Qe.easeTo({duration:300,easeId:"keyboardHandler",easing:Pr,zoom:ie?Math.round(dt)+ie*(K.shiftKey?2:1):dt,bearing:Qe.getBearing()+we*le._bearingStep,pitch:Qe.getPitch()+We*le._pitchStep,offset:[-mt*le._panStep,-wt*le._panStep],center:Qe.getCenter()},{originalEvent:K})}}}},St.prototype.enable=function(){this._enabled=!0},St.prototype.disable=function(){this._enabled=!1,this.reset()},St.prototype.isEnabled=function(){return this._enabled},St.prototype.isActive=function(){return this._active},St.prototype.disableRotation=function(){this._rotationDisabled=!0},St.prototype.enableRotation=function(){this._rotationDisabled=!1};function Pr(K){return K*(2-K)}var Nr=4.000244140625,en=1/100,Cn=1/450,xn=2,Oi=function(K,le){this._map=K,this._el=K.getCanvasContainer(),this._handler=le,this._delta=0,this._defaultZoomRate=en,this._wheelZoomRate=Cn,i.bindAll(["_onTimeout"],this)};Oi.prototype.setZoomRate=function(K){this._defaultZoomRate=K},Oi.prototype.setWheelZoomRate=function(K){this._wheelZoomRate=K},Oi.prototype.isEnabled=function(){return!!this._enabled},Oi.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Oi.prototype.isZooming=function(){return!!this._zooming},Oi.prototype.enable=function(K){this.isEnabled()||(this._enabled=!0,this._aroundCenter=K&&K.around==="center")},Oi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Oi.prototype.wheel=function(K){if(this.isEnabled()){var le=K.deltaMode===i.window.WheelEvent.DOM_DELTA_LINE?K.deltaY*40:K.deltaY,ie=i.browser.now(),we=ie-(this._lastWheelEventTime||0);this._lastWheelEventTime=ie,le!==0&&le%Nr===0?this._type="wheel":le!==0&&Math.abs(le)<4?this._type="trackpad":we>400?(this._type=null,this._lastValue=le,this._timeout=setTimeout(this._onTimeout,40,K)):this._type||(this._type=Math.abs(we*le)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,le+=this._lastValue)),K.shiftKey&&le&&(le=le/4),this._type&&(this._lastWheelEvent=K,this._delta-=le,this._active||this._start(K)),K.preventDefault()}},Oi.prototype._onTimeout=function(K){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(K)},Oi.prototype._start=function(K){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var le=a.mousePos(this._el,K);this._around=i.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(le)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Oi.prototype.renderFrame=function(){var K=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var le=this._map.transform;if(this._delta!==0){var ie=this._type==="wheel"&&Math.abs(this._delta)>Nr?this._wheelZoomRate:this._defaultZoomRate,we=xn/(1+Math.exp(-Math.abs(this._delta*ie)));this._delta<0&&we!==0&&(we=1/we);var We=typeof this._targetZoom=="number"?le.zoomScale(this._targetZoom):le.scale;this._targetZoom=Math.min(le.maxZoom,Math.max(le.minZoom,le.scaleZoom(We*we))),this._type==="wheel"&&(this._startZoom=le.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var mt=typeof this._targetZoom=="number"?this._targetZoom:le.zoom,wt=this._startZoom,Qe=this._easing,dt=!1,It;if(this._type==="wheel"&&wt&&Qe){var lr=Math.min((i.browser.now()-this._lastWheelEventTime)/200,1),Qt=Qe(lr);It=i.number(wt,mt,Qt),lr<1?this._frameId||(this._frameId=!0):dt=!0}else It=mt,dt=!0;return this._active=!0,dt&&(this._active=!1,this._finishTimeout=setTimeout(function(){K._zooming=!1,K._handler._triggerRenderFrame(),delete K._targetZoom,delete K._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!dt,zoomDelta:It-le.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Oi.prototype._smoothOutEasing=function(K){var le=i.ease;if(this._prevEase){var ie=this._prevEase,we=(i.browser.now()-ie.start)/ie.duration,We=ie.easing(we+.01)-ie.easing(we),mt=.27/Math.sqrt(We*We+1e-4)*.01,wt=Math.sqrt(.27*.27-mt*mt);le=i.bezier(mt,wt,.25,1)}return this._prevEase={start:i.browser.now(),duration:K,easing:le},le},Oi.prototype.reset=function(){this._active=!1};var Tn=function(K,le){this._clickZoom=K,this._tapZoom=le};Tn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Tn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Tn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Tn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ua=function(){this.reset()};ua.prototype.reset=function(){this._active=!1},ua.prototype.dblclick=function(K,le){return K.preventDefault(),{cameraAnimation:function(ie){ie.easeTo({duration:300,zoom:ie.getZoom()+(K.shiftKey?-1:1),around:ie.unproject(le)},{originalEvent:K})}}},ua.prototype.enable=function(){this._enabled=!0},ua.prototype.disable=function(){this._enabled=!1,this.reset()},ua.prototype.isEnabled=function(){return this._enabled},ua.prototype.isActive=function(){return this._active};var ia=function(){this._tap=new aa({numTouches:1,numTaps:1}),this.reset()};ia.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ia.prototype.touchstart=function(K,le,ie){this._swipePoint||(this._tapTime&&K.timeStamp-this._tapTime>ln&&this.reset(),this._tapTime?ie.length>0&&(this._swipePoint=le[0],this._swipeTouch=ie[0].identifier):this._tap.touchstart(K,le,ie))},ia.prototype.touchmove=function(K,le,ie){if(!this._tapTime)this._tap.touchmove(K,le,ie);else if(this._swipePoint){if(ie[0].identifier!==this._swipeTouch)return;var we=le[0],We=we.y-this._swipePoint.y;return this._swipePoint=we,K.preventDefault(),this._active=!0,{zoomDelta:We/128}}},ia.prototype.touchend=function(K,le,ie){if(this._tapTime)this._swipePoint&&ie.length===0&&this.reset();else{var we=this._tap.touchend(K,le,ie);we&&(this._tapTime=K.timeStamp)}},ia.prototype.touchcancel=function(){this.reset()},ia.prototype.enable=function(){this._enabled=!0},ia.prototype.disable=function(){this._enabled=!1,this.reset()},ia.prototype.isEnabled=function(){return this._enabled},ia.prototype.isActive=function(){return this._active};var La=function(K,le,ie){this._el=K,this._mousePan=le,this._touchPan=ie};La.prototype.enable=function(K){this._inertiaOptions=K||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},La.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},La.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},La.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var no=function(K,le,ie){this._pitchWithRotate=K.pitchWithRotate,this._mouseRotate=le,this._mousePitch=ie};no.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},no.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},no.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},no.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ka=function(K,le,ie,we){this._el=K,this._touchZoom=le,this._touchRotate=ie,this._tapDragZoom=we,this._rotationDisabled=!1,this._enabled=!0};Ka.prototype.enable=function(K){this._touchZoom.enable(K),this._rotationDisabled||this._touchRotate.enable(K),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ka.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ka.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ka.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ka.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ka.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var da=function(K){return K.zoom||K.drag||K.pitch||K.rotate},Nn=function(K){function le(){K.apply(this,arguments)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le}(i.Event);function Ei(K){return K.panDelta&&K.panDelta.mag()||K.zoomDelta||K.bearingDelta||K.pitchDelta}var on=function(K,le){this._map=K,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Bt(K),this._bearingSnap=le.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(le),i.bindAll(["handleEvent","handleWindowEvent"],this);var ie=this._el;this._listeners=[[ie,"touchstart",{passive:!0}],[ie,"touchmove",{passive:!1}],[ie,"touchend",void 0],[ie,"touchcancel",void 0],[ie,"mousedown",void 0],[ie,"mousemove",void 0],[ie,"mouseup",void 0],[i.window.document,"mousemove",{capture:!0}],[i.window.document,"mouseup",void 0],[ie,"mouseover",void 0],[ie,"mouseout",void 0],[ie,"dblclick",void 0],[ie,"click",void 0],[ie,"keydown",{capture:!1}],[ie,"keyup",void 0],[ie,"wheel",{passive:!1}],[ie,"contextmenu",void 0],[i.window,"blur",void 0]];for(var we=0,We=this._listeners;wewt?Math.min(2,Li):Math.max(.5,Li),$n=Math.pow(ca,1-Hn),Vn=mt.unproject(Fr.add(xi.mult(Hn*$n)).mult(In));mt.setLocationAtPoint(mt.renderWorldCopies?Vn.wrap():Vn,qt)}We._fireMoveEvents(we)},function(Hn){We._afterEase(we,Hn)},ie),this},le.prototype._prepareEase=function(ie,we,We){We===void 0&&(We={}),this._moving=!0,!we&&!We.moving&&this.fire(new i.Event("movestart",ie)),this._zooming&&!We.zooming&&this.fire(new i.Event("zoomstart",ie)),this._rotating&&!We.rotating&&this.fire(new i.Event("rotatestart",ie)),this._pitching&&!We.pitching&&this.fire(new i.Event("pitchstart",ie))},le.prototype._fireMoveEvents=function(ie){this.fire(new i.Event("move",ie)),this._zooming&&this.fire(new i.Event("zoom",ie)),this._rotating&&this.fire(new i.Event("rotate",ie)),this._pitching&&this.fire(new i.Event("pitch",ie))},le.prototype._afterEase=function(ie,we){if(!(this._easeId&&we&&this._easeId===we)){delete this._easeId;var We=this._zooming,mt=this._rotating,wt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,We&&this.fire(new i.Event("zoomend",ie)),mt&&this.fire(new i.Event("rotateend",ie)),wt&&this.fire(new i.Event("pitchend",ie)),this.fire(new i.Event("moveend",ie))}},le.prototype.flyTo=function(ie,we){var We=this;if(!ie.essential&&i.browser.prefersReducedMotion){var mt=i.pick(ie,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mt,we)}this.stop(),ie=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},ie);var wt=this.transform,Qe=this.getZoom(),dt=this.getBearing(),It=this.getPitch(),lr=this.getPadding(),Qt="zoom"in ie?i.clamp(+ie.zoom,wt.minZoom,wt.maxZoom):Qe,ar="bearing"in ie?this._normalizeBearing(ie.bearing,dt):dt,pr="pitch"in ie?+ie.pitch:It,yr="padding"in ie?ie.padding:wt.padding,qt=wt.zoomScale(Qt-Qe),tr=i.Point.convert(ie.offset),Xt=wt.centerPoint.add(tr),Fr=wt.pointLocation(Xt),xi=i.LngLat.convert(ie.center||Fr);this._normalizeCenter(xi);var Li=wt.project(Fr),Pn=wt.project(xi).sub(Li),An=ie.curve,mn=Math.max(wt.width,wt.height),Hn=mn/qt,In=Pn.mag();if("minZoom"in ie){var ca=i.clamp(Math.min(ie.minZoom,Qe,Qt),wt.minZoom,wt.maxZoom),$n=mn/wt.zoomScale(ca-Qe);An=Math.sqrt($n/In*2)}var Vn=An*An;function va($s){var zu=(Hn*Hn-mn*mn+($s?-1:1)*Vn*Vn*In*In)/(2*($s?Hn:mn)*Vn*In);return Math.log(Math.sqrt(zu*zu+1)-zu)}function po($s){return(Math.exp($s)-Math.exp(-$s))/2}function To($s){return(Math.exp($s)+Math.exp(-$s))/2}function Jo($s){return po($s)/To($s)}var Ts=va(0),$l=function($s){return To(Ts)/To(Ts+An*$s)},Yl=function($s){return mn*((To(Ts)*Jo(Ts+An*$s)-po(Ts))/Vn)/In},Tl=(va(1)-Ts)/An;if(Math.abs(In)<1e-6||!isFinite(Tl)){if(Math.abs(mn-Hn)<1e-6)return this.easeTo(ie,we);var Xl=Hnie.maxDuration&&(ie.duration=0),this._zooming=!0,this._rotating=dt!==ar,this._pitching=pr!==It,this._padding=!wt.isPaddingEqual(yr),this._prepareEase(we,!1),this._ease(function($s){var zu=$s*Tl,mf=1/$l(zu);wt.zoom=$s===1?Qt:Qe+wt.scaleZoom(mf),We._rotating&&(wt.bearing=i.number(dt,ar,$s)),We._pitching&&(wt.pitch=i.number(It,pr,$s)),We._padding&&(wt.interpolatePadding(lr,yr,$s),Xt=wt.centerPoint.add(tr));var Hf=$s===1?xi:wt.unproject(Li.add(Pn.mult(Yl(zu))).mult(mf));wt.setLocationAtPoint(wt.renderWorldCopies?Hf.wrap():Hf,Xt),We._fireMoveEvents(we)},function(){return We._afterEase(we)},ie),this},le.prototype.isEasing=function(){return!!this._easeFrameId},le.prototype.stop=function(){return this._stop()},le.prototype._stop=function(ie,we){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var We=this._onEaseEnd;delete this._onEaseEnd,We.call(this,we)}if(!ie){var mt=this.handlers;mt&&mt.stop(!1)}return this},le.prototype._ease=function(ie,we,We){We.animate===!1||We.duration===0?(ie(1),we()):(this._easeStart=i.browser.now(),this._easeOptions=We,this._onEaseFrame=ie,this._onEaseEnd=we,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},le.prototype._renderFrameCallback=function(){var ie=Math.min((i.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(ie)),ie<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},le.prototype._normalizeBearing=function(ie,we){ie=i.wrap(ie,-180,180);var We=Math.abs(ie-we);return Math.abs(ie-360-we)180?-360:We<-180?360:0}},le}(i.Evented),Fn=function(K){K===void 0&&(K={}),this.options=K,i.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Fn.prototype.getDefaultPosition=function(){return"bottom-right"},Fn.prototype.onAdd=function(K){var le=this.options&&this.options.compact;return this._map=K,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),le&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),le===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Fn.prototype.onRemove=function(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Fn.prototype._setElementTitle=function(K,le){var ie=this._map._getUIString("AttributionControl."+le);K.title=ie,K.setAttribute("aria-label",ie)},Fn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Fn.prototype._updateEditLink=function(){var K=this._editLink;K||(K=this._editLink=this._container.querySelector(".mapbox-improve-map"));var le=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||i.config.ACCESS_TOKEN}];if(K){var ie=le.reduce(function(we,We,mt){return We.value&&(we+=We.key+"="+We.value+(mt=0)return!1;return!0});var wt=K.join(" | ");wt!==this._attribHTML&&(this._attribHTML=wt,K.length?(this._innerContainer.innerHTML=wt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Fn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bn=function(){i.bindAll(["_updateLogo"],this),i.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(K){this._map=K,this._container=a.create("div","mapboxgl-ctrl");var le=a.create("a","mapboxgl-ctrl-logo");return le.target="_blank",le.rel="noopener nofollow",le.href="https://www.mapbox.com/",le.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),le.setAttribute("rel","noopener nofollow"),this._container.appendChild(le),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bn.prototype.onRemove=function(){a.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(K){(!K||K.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var K=this._map.style.sourceCaches;for(var le in K){var ie=K[le].getSource();if(ie.mapbox_logo)return!0}return!1}},bn.prototype._updateCompact=function(){var K=this._container.children;if(K.length){var le=K[0];this._map.getCanvasContainer().offsetWidth<250?le.classList.add("mapboxgl-compact"):le.classList.remove("mapboxgl-compact")}};var Na=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Na.prototype.add=function(K){var le=++this._id,ie=this._queue;return ie.push({callback:K,id:le,cancelled:!1}),le},Na.prototype.remove=function(K){for(var le=this._currentlyRunning,ie=le?this._queue.concat(le):this._queue,we=0,We=ie;wewe.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(we.minPitch!=null&&we.maxPitch!=null&&we.minPitch>we.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(we.minPitch!=null&&we.minPitchla)throw new Error("maxPitch must be less than or equal to "+la);var mt=new Js(we.minZoom,we.maxZoom,we.minPitch,we.maxPitch,we.renderWorldCopies);if(K.call(this,mt,we),this._interactive=we.interactive,this._maxTileCacheSize=we.maxTileCacheSize,this._failIfMajorPerformanceCaveat=we.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=we.preserveDrawingBuffer,this._antialias=we.antialias,this._trackResize=we.trackResize,this._bearingSnap=we.bearingSnap,this._refreshExpiredTiles=we.refreshExpiredTiles,this._fadeDuration=we.fadeDuration,this._crossSourceCollisions=we.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=we.collectResourceTiming,this._renderTaskQueue=new Na,this._controls=[],this._mapId=i.uniqueId(),this._locale=i.extend({},ba,we.locale),this._clickTolerance=we.clickTolerance,this._requestManager=new i.RequestManager(we.transformRequest,we.accessToken),typeof we.container=="string"){if(this._container=i.window.document.getElementById(we.container),!this._container)throw new Error("Container '"+we.container+"' not found.")}else if(we.container instanceof Bn)this._container=we.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(we.maxBounds&&this.setMaxBounds(we.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return We._update(!1)}),this.on("moveend",function(){return We._update(!1)}),this.on("zoom",function(){return We._update(!0)}),typeof i.window<"u"&&(i.window.addEventListener("online",this._onWindowOnline,!1),i.window.addEventListener("resize",this._onWindowResize,!1),i.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new on(this,we);var wt=typeof we.hash=="string"&&we.hash||void 0;this._hash=we.hash&&new wc(wt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:we.center,zoom:we.zoom,bearing:we.bearing,pitch:we.pitch}),we.bounds&&(this.resize(),this.fitBounds(we.bounds,i.extend({},we.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=we.localIdeographFontFamily,we.style&&this.setStyle(we.style,{localIdeographFontFamily:we.localIdeographFontFamily}),we.attributionControl&&this.addControl(new Fn({customAttribution:we.customAttribution})),this.addControl(new bn,we.logoPosition),this.on("style.load",function(){We.transform.unmodified&&We.jumpTo(We.style.stylesheet)}),this.on("data",function(Qe){We._update(Qe.dataType==="style"),We.fire(new i.Event(Qe.dataType+"data",Qe))}),this.on("dataloading",function(Qe){We.fire(new i.Event(Qe.dataType+"dataloading",Qe))})}K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le;var ie={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return le.prototype._getMapId=function(){return this._mapId},le.prototype.addControl=function(we,We){if(We===void 0&&(we.getDefaultPosition?We=we.getDefaultPosition():We="top-right"),!we||!we.onAdd)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var mt=we.onAdd(this);this._controls.push(we);var wt=this._controlPositions[We];return We.indexOf("bottom")!==-1?wt.insertBefore(mt,wt.firstChild):wt.appendChild(mt),this},le.prototype.removeControl=function(we){if(!we||!we.onRemove)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var We=this._controls.indexOf(we);return We>-1&&this._controls.splice(We,1),we.onRemove(this),this},le.prototype.hasControl=function(we){return this._controls.indexOf(we)>-1},le.prototype.resize=function(we){var We=this._containerDimensions(),mt=We[0],wt=We[1];this._resizeCanvas(mt,wt),this.transform.resize(mt,wt),this.painter.resize(mt,wt);var Qe=!this._moving;return Qe&&(this.stop(),this.fire(new i.Event("movestart",we)).fire(new i.Event("move",we))),this.fire(new i.Event("resize",we)),Qe&&this.fire(new i.Event("moveend",we)),this},le.prototype.getBounds=function(){return this.transform.getBounds()},le.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},le.prototype.setMaxBounds=function(we){return this.transform.setMaxBounds(i.LngLatBounds.convert(we)),this._update()},le.prototype.setMinZoom=function(we){if(we=we??ja,we>=ja&&we<=this.transform.maxZoom)return this.transform.minZoom=we,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=we,this._update(),this.getZoom()>we&&this.setZoom(we),this;throw new Error("maxZoom must be greater than the current minZoom")},le.prototype.getMaxZoom=function(){return this.transform.maxZoom},le.prototype.setMinPitch=function(we){if(we=we??oa,we=oa&&we<=this.transform.maxPitch)return this.transform.minPitch=we,this._update(),this.getPitch()la)throw new Error("maxPitch must be less than or equal to "+la);if(we>=this.transform.minPitch)return this.transform.maxPitch=we,this._update(),this.getPitch()>we&&this.setPitch(we),this;throw new Error("maxPitch must be greater than the current minPitch")},le.prototype.getMaxPitch=function(){return this.transform.maxPitch},le.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},le.prototype.setRenderWorldCopies=function(we){return this.transform.renderWorldCopies=we,this._update()},le.prototype.project=function(we){return this.transform.locationPoint(i.LngLat.convert(we))},le.prototype.unproject=function(we){return this.transform.pointLocation(i.Point.convert(we))},le.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},le.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},le.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},le.prototype._createDelegatedListener=function(we,We,mt){var wt=this,Qe;if(we==="mouseenter"||we==="mouseover"){var dt=!1,It=function(qt){var tr=wt.getLayer(We)?wt.queryRenderedFeatures(qt.point,{layers:[We]}):[];tr.length?dt||(dt=!0,mt.call(wt,new cr(we,wt,qt.originalEvent,{features:tr}))):dt=!1},lr=function(){dt=!1};return{layer:We,listener:mt,delegates:{mousemove:It,mouseout:lr}}}else if(we==="mouseleave"||we==="mouseout"){var Qt=!1,ar=function(qt){var tr=wt.getLayer(We)?wt.queryRenderedFeatures(qt.point,{layers:[We]}):[];tr.length?Qt=!0:Qt&&(Qt=!1,mt.call(wt,new cr(we,wt,qt.originalEvent)))},pr=function(qt){Qt&&(Qt=!1,mt.call(wt,new cr(we,wt,qt.originalEvent)))};return{layer:We,listener:mt,delegates:{mousemove:ar,mouseout:pr}}}else{var yr=function(qt){var tr=wt.getLayer(We)?wt.queryRenderedFeatures(qt.point,{layers:[We]}):[];tr.length&&(qt.features=tr,mt.call(wt,qt),delete qt.features)};return{layer:We,listener:mt,delegates:(Qe={},Qe[we]=yr,Qe)}}},le.prototype.on=function(we,We,mt){if(mt===void 0)return K.prototype.on.call(this,we,We);var wt=this._createDelegatedListener(we,We,mt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[we]=this._delegatedListeners[we]||[],this._delegatedListeners[we].push(wt);for(var Qe in wt.delegates)this.on(Qe,wt.delegates[Qe]);return this},le.prototype.once=function(we,We,mt){if(mt===void 0)return K.prototype.once.call(this,we,We);var wt=this._createDelegatedListener(we,We,mt);for(var Qe in wt.delegates)this.once(Qe,wt.delegates[Qe]);return this},le.prototype.off=function(we,We,mt){var wt=this;if(mt===void 0)return K.prototype.off.call(this,we,We);var Qe=function(dt){for(var It=dt[we],lr=0;lr180;){var wt=ie.locationPoint(K);if(wt.x>=0&&wt.y>=0&&wt.x<=ie.width&&wt.y<=ie.height)break;K.lng>ie.center.lng?K.lng-=360:K.lng+=360}return K}var us={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Kl(K,le,ie){var we=K.classList;for(var We in us)we.remove("mapboxgl-"+ie+"-anchor-"+We);we.add("mapboxgl-"+ie+"-anchor-"+le)}var zl=function(K){function le(ie,we){if(K.call(this),(ie instanceof i.window.HTMLElement||we)&&(ie=i.extend({element:ie},we)),i.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=ie&&ie.anchor||"center",this._color=ie&&ie.color||"#3FB1CE",this._scale=ie&&ie.scale||1,this._draggable=ie&&ie.draggable||!1,this._clickTolerance=ie&&ie.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=ie&&ie.rotation||0,this._rotationAlignment=ie&&ie.rotationAlignment||"auto",this._pitchAlignment=ie&&ie.pitchAlignment&&ie.pitchAlignment!=="auto"?ie.pitchAlignment:this._rotationAlignment,!ie||!ie.element){this._defaultMarker=!0,this._element=a.create("div"),this._element.setAttribute("aria-label","Map marker");var We=a.createNS("http://www.w3.org/2000/svg","svg"),mt=41,wt=27;We.setAttributeNS(null,"display","block"),We.setAttributeNS(null,"height",mt+"px"),We.setAttributeNS(null,"width",wt+"px"),We.setAttributeNS(null,"viewBox","0 0 "+wt+" "+mt);var Qe=a.createNS("http://www.w3.org/2000/svg","g");Qe.setAttributeNS(null,"stroke","none"),Qe.setAttributeNS(null,"stroke-width","1"),Qe.setAttributeNS(null,"fill","none"),Qe.setAttributeNS(null,"fill-rule","evenodd");var dt=a.createNS("http://www.w3.org/2000/svg","g");dt.setAttributeNS(null,"fill-rule","nonzero");var It=a.createNS("http://www.w3.org/2000/svg","g");It.setAttributeNS(null,"transform","translate(3.0, 29.0)"),It.setAttributeNS(null,"fill","#000000");for(var lr=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Qt=0,ar=lr;Qt=we}this._isDragging&&(this._pos=ie.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new i.Event("dragstart"))),this.fire(new i.Event("drag")))},le.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new i.Event("dragend")),this._state="inactive"},le.prototype._addDragHandler=function(ie){this._element.contains(ie.originalEvent.target)&&(ie.preventDefault(),this._positionDelta=ie.point.sub(this._pos).add(this._offset),this._pointerdownPos=ie.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},le.prototype.setDraggable=function(ie){return this._draggable=!!ie,this._map&&(ie?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},le.prototype.isDraggable=function(){return this._draggable},le.prototype.setRotation=function(ie){return this._rotation=ie||0,this._update(),this},le.prototype.getRotation=function(){return this._rotation},le.prototype.setRotationAlignment=function(ie){return this._rotationAlignment=ie||"auto",this._update(),this},le.prototype.getRotationAlignment=function(){return this._rotationAlignment},le.prototype.setPitchAlignment=function(ie){return this._pitchAlignment=ie&&ie!=="auto"?ie:this._rotationAlignment,this._update(),this},le.prototype.getPitchAlignment=function(){return this._pitchAlignment},le}(i.Evented),gs={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Pu;function kl(K){Pu!==void 0?K(Pu):i.window.navigator.permissions!==void 0?i.window.navigator.permissions.query({name:"geolocation"}).then(function(le){Pu=le.state!=="denied",K(Pu)}):(Pu=!!i.window.navigator.geolocation,K(Pu))}var Fu=0,kc=!1,Ec=function(K){function le(ie){K.call(this),this.options=i.extend({},gs,ie),i.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.onAdd=function(ie){return this._map=ie,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),kl(this._setupUI),this._container},le.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(i.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fu=0,kc=!1},le.prototype._isOutOfMapMaxBounds=function(ie){var we=this._map.getMaxBounds(),We=ie.coords;return we&&(We.longitudewe.getEast()||We.latitudewe.getNorth())},le.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},le.prototype._onSuccess=function(ie){if(this._map){if(this._isOutOfMapMaxBounds(ie)){this._setErrorState(),this.fire(new i.Event("outofmaxbounds",ie)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=ie,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(ie),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(ie),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("geolocate",ie)),this._finish()}},le.prototype._updateCamera=function(ie){var we=new i.LngLat(ie.coords.longitude,ie.coords.latitude),We=ie.coords.accuracy,mt=this._map.getBearing(),wt=i.extend({bearing:mt},this.options.fitBoundsOptions);this._map.fitBounds(we.toBounds(We),wt,{geolocateSource:!0})},le.prototype._updateMarker=function(ie){if(ie){var we=new i.LngLat(ie.coords.longitude,ie.coords.latitude);this._accuracyCircleMarker.setLngLat(we).addTo(this._map),this._userLocationDotMarker.setLngLat(we).addTo(this._map),this._accuracy=ie.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},le.prototype._updateCircleRadius=function(){var ie=this._map._container.clientHeight/2,we=this._map.unproject([0,ie]),We=this._map.unproject([1,ie]),mt=we.distanceTo(We),wt=Math.ceil(2*this._accuracy/mt);this._circleElement.style.width=wt+"px",this._circleElement.style.height=wt+"px"},le.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},le.prototype._onError=function(ie){if(this._map){if(this.options.trackUserLocation)if(ie.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var we=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=we,this._geolocateButton.setAttribute("aria-label",we),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(ie.code===3&&kc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("error",ie)),this._finish()}},le.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},le.prototype._setupUI=function(ie){var we=this;if(this._container.addEventListener("contextmenu",function(wt){return wt.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",ie===!1){i.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var We=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=We,this._geolocateButton.setAttribute("aria-label",We)}else{var mt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=mt,this._geolocateButton.setAttribute("aria-label",mt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new zl(this._dotElement),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(wt){var Qe=wt.originalEvent&&wt.originalEvent.type==="resize";!wt.geolocateSource&&we._watchState==="ACTIVE_LOCK"&&!Qe&&(we._watchState="BACKGROUND",we._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),we._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),we.fire(new i.Event("trackuserlocationend")))})},le.prototype.trigger=function(){if(!this._setup)return i.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new i.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fu--,kc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new i.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new i.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Fu++;var ie;Fu>1?(ie={maximumAge:6e5,timeout:0},kc=!0):(ie=this.options.positionOptions,kc=!1),this._geolocationWatchID=i.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,ie)}}else i.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},le.prototype._clearWatch=function(){i.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},le}(i.Evented),Au={maxWidth:100,unit:"metric"},wu=function(K){this.options=i.extend({},Au,K),i.bindAll(["_onMove","setUnit"],this)};wu.prototype.getDefaultPosition=function(){return"bottom-left"},wu.prototype._onMove=function(){Iu(this._map,this._container,this.options)},wu.prototype.onAdd=function(K){return this._map=K,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",K.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},wu.prototype.onRemove=function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},wu.prototype.setUnit=function(K){this.options.unit=K,Iu(this._map,this._container,this.options)};function Iu(K,le,ie){var we=ie&&ie.maxWidth||100,We=K._container.clientHeight/2,mt=K.unproject([0,We]),wt=K.unproject([we,We]),Qe=mt.distanceTo(wt);if(ie&&ie.unit==="imperial"){var dt=3.2808*Qe;if(dt>5280){var It=dt/5280;Zo(le,we,It,K._getUIString("ScaleControl.Miles"))}else Zo(le,we,dt,K._getUIString("ScaleControl.Feet"))}else if(ie&&ie.unit==="nautical"){var lr=Qe/1852;Zo(le,we,lr,K._getUIString("ScaleControl.NauticalMiles"))}else Qe>=1e3?Zo(le,we,Qe/1e3,K._getUIString("ScaleControl.Kilometers")):Zo(le,we,Qe,K._getUIString("ScaleControl.Meters"))}function Zo(K,le,ie,we){var We=vl(ie),mt=We/ie;K.style.width=le*mt+"px",K.innerHTML=We+" "+we}function Du(K){var le=Math.pow(10,Math.ceil(-Math.log(K)/Math.LN10));return Math.round(K*le)/le}function vl(K){var le=Math.pow(10,(""+Math.floor(K)).length-1),ie=K/le;return ie=ie>=10?10:ie>=5?5:ie>=3?3:ie>=2?2:ie>=1?1:Du(ie),le*ie}var Nu=function(K){this._fullscreen=!1,K&&K.container&&(K.container instanceof i.window.HTMLElement?this._container=K.container:i.warnOnce("Full screen control 'container' must be a DOM element.")),i.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in i.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in i.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in i.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in i.window.document&&(this._fullscreenchange="MSFullscreenChange")};Nu.prototype.onAdd=function(K){return this._map=K,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",i.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Nu.prototype.onRemove=function(){a.remove(this._controlContainer),this._map=null,i.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Nu.prototype._checkFullscreenSupport=function(){return!!(i.window.document.fullscreenEnabled||i.window.document.mozFullScreenEnabled||i.window.document.msFullscreenEnabled||i.window.document.webkitFullscreenEnabled)},Nu.prototype._setupUI=function(){var K=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",K).setAttribute("aria-hidden",!0),K.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),i.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Nu.prototype._updateTitle=function(){var K=this._getTitle();this._fullscreenButton.setAttribute("aria-label",K),this._fullscreenButton.title=K},Nu.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Nu.prototype._isFullscreen=function(){return this._fullscreen},Nu.prototype._changeIcon=function(){var K=i.window.document.fullscreenElement||i.window.document.mozFullScreenElement||i.window.document.webkitFullscreenElement||i.window.document.msFullscreenElement;K===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Nu.prototype._onClickFullscreen=function(){this._isFullscreen()?i.window.document.exitFullscreen?i.window.document.exitFullscreen():i.window.document.mozCancelFullScreen?i.window.document.mozCancelFullScreen():i.window.document.msExitFullscreen?i.window.document.msExitFullscreen():i.window.document.webkitCancelFullScreen&&i.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Lc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Ds=function(K){function le(ie){K.call(this),this.options=i.extend(Object.create(Lc),ie),i.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.addTo=function(ie){return this._map&&this.remove(),this._map=ie,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new i.Event("open")),this},le.prototype.isOpen=function(){return!!this._map},le.prototype.remove=function(){return this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new i.Event("close")),this},le.prototype.getLngLat=function(){return this._lngLat},le.prototype.setLngLat=function(ie){return this._lngLat=i.LngLat.convert(ie),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},le.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},le.prototype.getElement=function(){return this._container},le.prototype.setText=function(ie){return this.setDOMContent(i.window.document.createTextNode(ie))},le.prototype.setHTML=function(ie){var we=i.window.document.createDocumentFragment(),We=i.window.document.createElement("body"),mt;for(We.innerHTML=ie;mt=We.firstChild,!!mt;)we.appendChild(mt);return this.setDOMContent(we)},le.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},le.prototype.setMaxWidth=function(ie){return this.options.maxWidth=ie,this._update(),this},le.prototype.setDOMContent=function(ie){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(ie),this._createCloseButton(),this._update(),this._focusFirstElement(),this},le.prototype.addClassName=function(ie){this._container&&this._container.classList.add(ie)},le.prototype.removeClassName=function(ie){this._container&&this._container.classList.remove(ie)},le.prototype.setOffset=function(ie){return this.options.offset=ie,this._update(),this},le.prototype.toggleClassName=function(ie){if(this._container)return this._container.classList.toggle(ie)},le.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},le.prototype._onMouseUp=function(ie){this._update(ie.point)},le.prototype._onMouseMove=function(ie){this._update(ie.point)},le.prototype._onDrag=function(ie){this._update(ie.point)},le.prototype._update=function(ie){var we=this,We=this._lngLat||this._trackPointer;if(!(!this._map||!We||!this._content)&&(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(ar){return we._container.classList.add(ar)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ro(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!ie))){var mt=this._pos=this._trackPointer&&ie?ie:this._map.project(this._lngLat),wt=this.options.anchor,Qe=Ol(this.options.offset);if(!wt){var dt=this._container.offsetWidth,It=this._container.offsetHeight,lr;mt.y+Qe.bottom.ythis._map.transform.height-It?lr=["bottom"]:lr=[],mt.x
this._map.transform.width-dt/2&&lr.push("right"),lr.length===0?wt="bottom":wt=lr.join("-")}var Qt=mt.add(Qe[wt]).round();a.setTransform(this._container,us[wt]+" translate("+Qt.x+"px,"+Qt.y+"px)"),Kl(this._container,wt,"popup")}},le.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var ie=this._container.querySelector(Fo);ie&&ie.focus()}},le.prototype._onClose=function(){this.remove()},le}(i.Evented);function Ol(K){if(K)if(typeof K=="number"){var le=Math.round(Math.sqrt(.5*Math.pow(K,2)));return{center:new i.Point(0,0),top:new i.Point(0,K),"top-left":new i.Point(le,le),"top-right":new i.Point(-le,le),bottom:new i.Point(0,-K),"bottom-left":new i.Point(le,-le),"bottom-right":new i.Point(-le,-le),left:new i.Point(K,0),right:new i.Point(-K,0)}}else if(K instanceof i.Point||Array.isArray(K)){var ie=i.Point.convert(K);return{center:ie,top:ie,"top-left":ie,"top-right":ie,bottom:ie,"bottom-left":ie,"bottom-right":ie,left:ie,right:ie}}else return{center:i.Point.convert(K.center||[0,0]),top:i.Point.convert(K.top||[0,0]),"top-left":i.Point.convert(K["top-left"]||[0,0]),"top-right":i.Point.convert(K["top-right"]||[0,0]),bottom:i.Point.convert(K.bottom||[0,0]),"bottom-left":i.Point.convert(K["bottom-left"]||[0,0]),"bottom-right":i.Point.convert(K["bottom-right"]||[0,0]),left:i.Point.convert(K.left||[0,0]),right:i.Point.convert(K.right||[0,0])};else return Ol(new i.Point(0,0))}var Ml={version:i.version,supported:n,setRTLTextPlugin:i.setRTLTextPlugin,getRTLTextPluginStatus:i.getRTLTextPluginStatus,Map:$o,NavigationControl:qa,GeolocateControl:Ec,AttributionControl:Fn,ScaleControl:wu,FullscreenControl:Nu,Popup:Ds,Marker:zl,Style:pc,LngLat:i.LngLat,LngLatBounds:i.LngLatBounds,Point:i.Point,MercatorCoordinate:i.MercatorCoordinate,Evented:i.Evented,config:i.config,prewarm:ro,clearPrewarmedResources:Ft,get accessToken(){return i.config.ACCESS_TOKEN},set accessToken(K){i.config.ACCESS_TOKEN=K},get baseApiUrl(){return i.config.API_URL},set baseApiUrl(K){i.config.API_URL=K},get workerCount(){return Xn.workerCount},set workerCount(K){Xn.workerCount=K},get maxParallelImageRequests(){return i.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(K){i.config.MAX_PARALLEL_IMAGE_REQUESTS=K},clearStorage:function(K){i.clearTileCache(K)},workerUrl:""};return Ml}),z})}),UQ=Fe((te,Y)=>{var d=ji(),y=cc().sanitizeHTML,z=az(),P=hy();function i(u,s){this.subplot=u,this.uid=u.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var n=i.prototype;n.update=function(u){this.visible?this.needsNewImage(u)?this.updateImage(u):this.needsNewSource(u)?(this.removeLayer(),this.updateSource(u),this.updateLayer(u)):this.needsNewLayer(u)?this.updateLayer(u):this.updateStyle(u):(this.updateSource(u),this.updateLayer(u)),this.visible=a(u)},n.needsNewImage=function(u){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&u.sourcetype==="image"&&(this.source!==u.source||JSON.stringify(this.coordinates)!==JSON.stringify(u.coordinates))},n.needsNewSource=function(u){return this.sourceType!==u.sourcetype||JSON.stringify(this.source)!==JSON.stringify(u.source)||this.layerType!==u.type},n.needsNewLayer=function(u){return this.layerType!==u.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},n.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},n.updateImage=function(u){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:u.source,coordinates:u.coordinates});var h=this.findFollowingMapboxLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},n.updateSource=function(u){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=u.sourcetype,this.source=u.source,!!a(u)){var h=o(u);s.addSource(this.idSource,h)}},n.findFollowingMapboxLayerId=function(u){if(u==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(u){var s={},h={};switch(u.type){case"circle":d.extendFlat(h,{"circle-radius":u.circle.radius,"circle-color":u.color,"circle-opacity":u.opacity});break;case"line":d.extendFlat(h,{"line-width":u.line.width,"line-color":u.color,"line-opacity":u.opacity,"line-dasharray":u.line.dash});break;case"fill":d.extendFlat(h,{"fill-color":u.color,"fill-outline-color":u.fill.outlinecolor,"fill-opacity":u.opacity});break;case"symbol":var m=u.symbol,b=z(m.textposition,m.iconsize);d.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),d.extendFlat(h,{"icon-color":u.color,"text-color":m.textfont.color,"text-opacity":u.opacity});break;case"raster":d.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":u.opacity});break}return{layout:s,paint:h}}function o(u){var s=u.sourcetype,h=u.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=u.coordinates),m[b]=h,u.sourceattribution&&(m.attribution=y(u.sourceattribution)),m}Y.exports=function(u,s,h){var m=new i(u,s);return m.update(h),m}}),$Q=Fe((te,Y)=>{var d=oz(),y=ji(),z=U_(),P=as(),i=Os(),n=Np(),a=hf(),l=dm(),o=l.drawMode,u=l.selectMode,s=Mf().prepSelect,h=Mf().clearOutline,m=Mf().clearSelectionsCache,b=Mf().selectOnClick,x=hy(),_=UQ();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=A.prototype;f.plot=function(I,M,p){var g=this,C=M[g.id];g.map&&C.accesstoken!==g.accessToken&&(g.map.remove(),g.map=null,g.styleObj=null,g.traceHash={},g.layerList=[]);var T;g.map?T=new Promise(function(N,B){g.updateMap(I,M,N,B)}):T=new Promise(function(N,B){g.createMap(I,M,N,B)}),p.push(T)},f.createMap=function(I,M,p,g){var C=this,T=M[C.id],N=C.styleObj=w(T.style,M);C.accessToken=T.accesstoken;var B=T.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new d.Map({container:C.div,style:N.style,center:E(T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var W=[];W.push(new Promise(function(F){V.once("load",F)})),W=W.concat(z.fetchTraceGeoData(I)),Promise.all(W).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.updateMap=function(I,M,p,g){var C=this,T=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style,M);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,T.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){T.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,T,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},f.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var T=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),u(T)||o(T)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,T)},n.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},f.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},f.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var d=ji(),y=L_(),z=Gd(),P=I6();Y.exports=function(a,l,o){y(a,l,o,{type:"mapbox",attributes:P,handleDefaults:i,partition:"y",accessToken:l._mapboxAccessToken})};function i(a,l,o,u){o("accesstoken",u.accessToken),o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var s=o("bounds.west"),h=o("bounds.east"),m=o("bounds.south"),b=o("bounds.north");(s===void 0||h===void 0||m===void 0||b===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:n}),l._input=a}function n(a,l){function o(x,_){return d.coerce(a,l,P.layers,x,_)}var u=o("visible");if(u){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",d.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),d.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),hA=Fe(te=>{var Y=oz(),d=ji(),y=d.strTranslate,z=d.strScale,P=Md().getSubplotCalcData,i=k0(),n=ii(),a=Zs(),l=cc(),o=$Q(),u="mapbox",s=te.constants=hy();te.name=u,te.attr="subplot",te.idRoot=u,te.idRegex=te.attrRegex=d.counterRegex(u);var h=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");te.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},te.layoutAttributes=I6(),te.supplyLayoutDefaults=HQ();var m=!0;te.plot=function(_){m&&(m=!1,d.warn(h));var A=_._fullLayout,f=_.calcdata,k=A._subplots[u];if(Y.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var w=b(_,k);Y.accessToken=w;for(var D=0;DW/2){var F=N.split("|").join("
");U.text(F).attr("data-unformatted",F).call(l.convertToTspans,_),V=a.bBox(U.node())}U.attr("transform",y(-3,-V.height+8)),B.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var $=1;V.width+6>W&&($=W/(V.width+6));var q=[k.l+k.w*E.x[1],k.t+k.h*(1-E.y[0])];B.attr("transform",y(q[0],q[1])+z($))}};function b(_,A){var f=_._fullLayout,k=_._context;if(k.mapboxAccessToken==="")return"";for(var w=[],D=[],E=!1,I=!1,M=0;M1&&d.warn(s.multipleTokensErrorMsg),w[0]):(D.length&&d.log(["Listed mapbox access token(s)",D.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function x(_){return typeof _=="string"&&(s.styleValuesMapbox.indexOf(_)!==-1||_.indexOf("mapbox://")===0||_.indexOf("stamen")===0)}te.updateFx=function(_){for(var A=_._fullLayout,f=A._subplots[u],k=0;k{Y.exports={attributes:uA(),supplyDefaults:BQ(),colorbar:Mo(),formatLabels:nz(),calc:HC(),plot:FQ(),hoverPoints:cA().hoverPoints,eventData:NQ(),selectPoints:jQ(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermapbox",basePlotModule:hA(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),WQ=Fe((te,Y)=>{Y.exports=VQ()}),sz=Fe((te,Y)=>{var d=Vw(),y=zc(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=_a(),n=an().extendFlat;Y.exports=n({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:n({},d.featureidkey,{}),below:{valType:"string",editType:"plot"},text:d.text,hovertext:d.hovertext,marker:{line:{color:n({},d.marker.line.color,{editType:"plot"}),width:n({},d.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:n({},d.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:n({},d.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n({},d.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:d.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:n({},i.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),qQ=Fe((te,Y)=>{var d=ji(),y=Cc(),z=sz();Y.exports=function(P,i,n,a){function l(m,b){return d.coerce(P,i,z,m,b)}var o=l("locations"),u=l("z"),s=l("geojson");if(!d.isArrayOrTypedArray(o)||!o.length||!d.isArrayOrTypedArray(u)||!u.length||!(typeof s=="string"&&s!==""||d.isPlainObject(s))){i.visible=!1;return}l("featureidkey"),i._length=Math.min(o.length,u.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,i,a,l,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(i,l)}}),lz=Fe((te,Y)=>{var d=Ar(),y=ji(),z=lh(),P=Zs(),i=j_().makeBlank,n=U_();function a(o){var u=o[0].trace,s=u.visible===!0&&u._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=u._opts={fill:h,line:m,geojson:i()};if(!s)return b;var x=n.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(u),A=u.marker,f=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var T=C.mo;return d(T)?+y.constrain(T,0,1):0});var w;y.isArrayOrTypedArray(f.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(f.width)&&(D=function(C){return C.mlw});for(var E=0;E{var d=lz().convert,y=lz().convertOnSelect,z=hy().traceLayerPrefix;function P(n,a){this.type="choroplethmapbox",this.subplot=n,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var i=P.prototype;i.update=function(n){this._update(d(n)),n[0].trace._glTrace=this},i.updateOnSelect=function(n){this._update(y(n))},i._update=function(n){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(n.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(n,o),this.below=o);for(var u=0;u=0;l--)n.removeLayer(a[l][1])},i.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,a){var l=a[0].trace,o=new P(n,l.uid),u=o.sourceId,s=d(a),h=o.below=n.belowLookup["trace-"+l.uid];return n.map.addSource(u,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),ZQ=Fe((te,Y)=>{Y.exports={attributes:sz(),supplyDefaults:qQ(),colorbar:E_(),calc:GC(),plot:GQ(),hoverPoints:KC(),eventData:YC(),selectPoints:XC(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(d,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var i=z[P].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var n=P+1;n{Y.exports=ZQ()}),uz=Fe((te,Y)=>{var d=zc(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=_a(),i=uA(),n=an().extendFlat;Y.exports=n({lon:i.lon,lat:i.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:i.text,hovertext:i.hovertext,hoverinfo:n({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:n({},P.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),YQ=Fe((te,Y)=>{var d=ji(),y=Cc(),z=uz();Y.exports=function(P,i,n,a){function l(h,m){return d.coerce(P,i,z,h,m)}var o=l("lon")||[],u=l("lat")||[],s=Math.min(o.length,u.length);if(!s){i.visible=!1;return}i._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,i,a,l,{prefix:"",cLetter:"z"})}}),XQ=Fe((te,Y)=>{var d=Ar(),y=ji().isArrayOrTypedArray,z=ti().BADNUM,P=kp(),i=ji()._;Y.exports=function(n,a){for(var l=a._length,o=new Array(l),u=a.z,s=y(u)&&u.length,h=0;h{var d=Ar(),y=ji(),z=Xi(),P=lh(),i=ti().BADNUM,n=j_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,u={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:u,geojson:n()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var d=JQ(),y=hy().traceLayerPrefix;function z(i,n){this.type="densitymapbox",this.subplot=i,this.uid=n,this.sourceId="source-"+n,this.layerList=[["heatmap",y+n+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(i){var n=this.subplot,a=this.layerList,l=d(i),o=n.belowLookup["trace-"+this.uid];n.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var u=0;u=0;a--)i.removeLayer(n[a][1])},P.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,n){var a=n[0].trace,l=new z(i,a.uid),o=l.sourceId,u=d(n),s=l.below=i.belowLookup["trace-"+a.uid];return i.map.addSource(o,{type:"geojson",data:u.geojson}),l._addLayers(u,s),l}}),eee=Fe((te,Y)=>{var d=Os(),y=cA().hoverPoints,z=cA().getExtraText;Y.exports=function(P,i,n){var a=y(P,i,n);if(a){var l=a[0],o=l.cd,u=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(u,s,o[0].t.labels),[l]}}}),tee=Fe((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d.z=y.z,d}}),ree=Fe((te,Y)=>{Y.exports={attributes:uz(),supplyDefaults:YQ(),colorbar:E_(),formatLabels:nz(),calc:XQ(),plot:QQ(),hoverPoints:eee(),eventData:tee(),getBelow:function(d,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=ree()}),nee=Fe((te,Y)=>{Y.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +`}),{fragmentSource:K,vertexSource:le,staticAttributes:we,staticUniforms:kt}}var Df=Object.freeze({__proto__:null,prelude:Vu,background:Xc,backgroundPattern:tf,circle:_u,clippingMask:jh,heatmap:Fc,heatmapTexture:Jc,collisionBox:Eu,collisionCircle:xf,debug:Eh,fill:rf,fillOutline:Uf,fillOutlinePattern:Qd,fillPattern:Sp,fillExtrusion:bf,fillExtrusionPattern:$f,hillshadePrepare:zc,hillshade:wf,line:ch,lineGradient:kf,linePattern:Hf,lineSDF:Lh,raster:Lu,symbolIcon:Uh,symbolSDF:Qc,symbolTextAndIcon:Id}),nf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};nf.prototype.bind=function(K,le,ie,we,We,gt,kt,Je){this.context=K;for(var dt=this.boundPaintVertexBuffers.length!==we.length,It=0;!dt&&It>16,Je>>16],u_pixel_coord_lower:[kt&65535,Je&65535]}}function zf(K,le,ie,we){var We=ie.imageManager.getPattern(K.from.toString()),gt=ie.imageManager.getPattern(K.to.toString()),kt=ie.imageManager.getPixelSize(),Je=kt.width,dt=kt.height,It=Math.pow(2,we.tileID.overscaledZ),ur=we.tileSize*Math.pow(2,ie.transform.tileZoom)/It,er=ur*(we.tileID.canonical.x+we.tileID.wrap*It),ar=ur*we.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:We.tl,u_pattern_br_a:We.br,u_pattern_tl_b:gt.tl,u_pattern_br_b:gt.br,u_texsize:[Je,dt],u_mix:le.t,u_pattern_size_a:We.displaySize,u_pattern_size_b:gt.displaySize,u_scale_a:le.fromScale,u_scale_b:le.toScale,u_tile_units_to_pixels:1/sl(we,1,ie.transform.tileZoom),u_pixel_coord_upper:[er>>16,ar>>16],u_pixel_coord_lower:[er&65535,ar&65535]}}var ep=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_lightpos:new i.Uniform3f(K,le.u_lightpos),u_lightintensity:new i.Uniform1f(K,le.u_lightintensity),u_lightcolor:new i.Uniform3f(K,le.u_lightcolor),u_vertical_gradient:new i.Uniform1f(K,le.u_vertical_gradient),u_opacity:new i.Uniform1f(K,le.u_opacity)}},Ac=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_lightpos:new i.Uniform3f(K,le.u_lightpos),u_lightintensity:new i.Uniform1f(K,le.u_lightintensity),u_lightcolor:new i.Uniform3f(K,le.u_lightcolor),u_vertical_gradient:new i.Uniform1f(K,le.u_vertical_gradient),u_height_factor:new i.Uniform1f(K,le.u_height_factor),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade),u_opacity:new i.Uniform1f(K,le.u_opacity)}},gd=function(K,le,ie,we){var We=le.style.light,gt=We.properties.get("position"),kt=[gt.x,gt.y,gt.z],Je=i.create$1();We.properties.get("anchor")==="viewport"&&i.fromRotation(Je,-le.transform.angle),i.transformMat3(kt,kt,Je);var dt=We.properties.get("color");return{u_matrix:K,u_lightpos:kt,u_lightintensity:We.properties.get("intensity"),u_lightcolor:[dt.r,dt.g,dt.b],u_vertical_gradient:+ie,u_opacity:we}},fh=function(K,le,ie,we,We,gt,kt){return i.extend(gd(K,le,ie,we),af(gt,le,kt),{u_height_factor:-Math.pow(2,We.overscaledZ)/kt.tileSize/8})},$h=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Ph=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},Zu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world)}},fu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world),u_image:new i.Uniform1i(K,le.u_image),u_texsize:new i.Uniform2f(K,le.u_texsize),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},Ih=function(K){return{u_matrix:K}},Tf=function(K,le,ie,we){return i.extend(Ih(K),af(ie,le,we))},Dh=function(K,le){return{u_matrix:K,u_world:le}},sd=function(K,le,ie,we,We){return i.extend(Tf(K,le,ie,we),{u_world:We})},wr=function(K,le){return{u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_scale_with_map:new i.Uniform1i(K,le.u_scale_with_map),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_extrude_scale:new i.Uniform2f(K,le.u_extrude_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Xr=function(K,le,ie,we){var We=K.transform,gt,kt;if(we.paint.get("circle-pitch-alignment")==="map"){var Je=sl(ie,1,We.zoom);gt=!0,kt=[Je,Je]}else gt=!1,kt=We.pixelsToGLUnits;return{u_camera_to_center_distance:We.cameraToCenterDistance,u_scale_with_map:+(we.paint.get("circle-pitch-scale")==="map"),u_matrix:K.translatePosMatrix(le.posMatrix,ie,we.paint.get("circle-translate"),we.paint.get("circle-translate-anchor")),u_pitch_with_map:+gt,u_device_pixel_ratio:i.browser.devicePixelRatio,u_extrude_scale:kt}},Ni=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pixels_to_tile_units:new i.Uniform1f(K,le.u_pixels_to_tile_units),u_extrude_scale:new i.Uniform2f(K,le.u_extrude_scale),u_overscale_factor:new i.Uniform1f(K,le.u_overscale_factor)}},Ai=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_inv_matrix:new i.UniformMatrix4f(K,le.u_inv_matrix),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_viewport_size:new i.Uniform2f(K,le.u_viewport_size)}},hn=function(K,le,ie){var we=sl(ie,1,le.zoom),We=Math.pow(2,le.zoom-ie.tileID.overscaledZ),gt=ie.tileID.overscaleFactor();return{u_matrix:K,u_camera_to_center_distance:le.cameraToCenterDistance,u_pixels_to_tile_units:we,u_extrude_scale:[le.pixelsToGLUnits[0]/(we*We),le.pixelsToGLUnits[1]/(we*We)],u_overscale_factor:gt}},Pn=function(K,le,ie){return{u_matrix:K,u_inv_matrix:le,u_camera_to_center_distance:ie.cameraToCenterDistance,u_viewport_size:[ie.width,ie.height]}},pa=function(K,le){return{u_color:new i.UniformColor(K,le.u_color),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_overlay:new i.Uniform1i(K,le.u_overlay),u_overlay_scale:new i.Uniform1f(K,le.u_overlay_scale)}},Ea=function(K,le,ie){return ie===void 0&&(ie=1),{u_matrix:K,u_color:le,u_overlay:0,u_overlay_scale:ie}},Ka=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},oo=function(K){return{u_matrix:K}},wa=function(K,le){return{u_extrude_scale:new i.Uniform1f(K,le.u_extrude_scale),u_intensity:new i.Uniform1f(K,le.u_intensity),u_matrix:new i.UniformMatrix4f(K,le.u_matrix)}},Va=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_world:new i.Uniform2f(K,le.u_world),u_image:new i.Uniform1i(K,le.u_image),u_color_ramp:new i.Uniform1i(K,le.u_color_ramp),u_opacity:new i.Uniform1f(K,le.u_opacity)}},Oa=function(K,le,ie,we){return{u_matrix:K,u_extrude_scale:sl(le,1,ie),u_intensity:we}},fa=function(K,le,ie,we){var We=i.create();i.ortho(We,0,K.width,K.height,0,0,1);var gt=K.context.gl;return{u_matrix:We,u_world:[gt.drawingBufferWidth,gt.drawingBufferHeight],u_image:ie,u_color_ramp:we,u_opacity:le.paint.get("heatmap-opacity")}},vo=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_latrange:new i.Uniform2f(K,le.u_latrange),u_light:new i.Uniform2f(K,le.u_light),u_shadow:new i.UniformColor(K,le.u_shadow),u_highlight:new i.UniformColor(K,le.u_highlight),u_accent:new i.UniformColor(K,le.u_accent)}},hs=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_image:new i.Uniform1i(K,le.u_image),u_dimension:new i.Uniform2f(K,le.u_dimension),u_zoom:new i.Uniform1f(K,le.u_zoom),u_unpack:new i.Uniform4f(K,le.u_unpack)}},rs=function(K,le,ie){var we=ie.paint.get("hillshade-shadow-color"),We=ie.paint.get("hillshade-highlight-color"),gt=ie.paint.get("hillshade-accent-color"),kt=ie.paint.get("hillshade-illumination-direction")*(Math.PI/180);ie.paint.get("hillshade-illumination-anchor")==="viewport"&&(kt-=K.transform.angle);var Je=!K.options.moving;return{u_matrix:K.transform.calculatePosMatrix(le.tileID.toUnwrapped(),Je),u_image:0,u_latrange:xs(K,le.tileID),u_light:[ie.paint.get("hillshade-exaggeration"),kt],u_shadow:we,u_highlight:We,u_accent:gt}},ps=function(K,le){var ie=le.stride,we=i.create();return i.ortho(we,0,i.EXTENT,-i.EXTENT,0,0,1),i.translate(we,we,[0,-i.EXTENT,0]),{u_matrix:we,u_image:1,u_dimension:[ie,ie],u_zoom:K.overscaledZ,u_unpack:le.getUnpackVector()}};function xs(K,le){var ie=Math.pow(2,le.canonical.z),we=le.canonical.y;return[new i.MercatorCoordinate(0,we/ie).toLngLat().lat,new i.MercatorCoordinate(0,(we+1)/ie).toLngLat().lat]}var _o=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels)}},no=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_image:new i.Uniform1i(K,le.u_image),u_image_height:new i.Uniform1f(K,le.u_image_height)}},ws=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_texsize:new i.Uniform2f(K,le.u_texsize),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_image:new i.Uniform1i(K,le.u_image),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_scale:new i.Uniform3f(K,le.u_scale),u_fade:new i.Uniform1f(K,le.u_fade)}},ul=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_ratio:new i.Uniform1f(K,le.u_ratio),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_units_to_pixels:new i.Uniform2f(K,le.u_units_to_pixels),u_patternscale_a:new i.Uniform2f(K,le.u_patternscale_a),u_patternscale_b:new i.Uniform2f(K,le.u_patternscale_b),u_sdfgamma:new i.Uniform1f(K,le.u_sdfgamma),u_image:new i.Uniform1i(K,le.u_image),u_tex_y_a:new i.Uniform1f(K,le.u_tex_y_a),u_tex_y_b:new i.Uniform1f(K,le.u_tex_y_b),u_mix:new i.Uniform1f(K,le.u_mix)}},Ul=function(K,le,ie){var we=K.transform;return{u_matrix:ec(K,le,ie),u_ratio:1/sl(le,1,we.zoom),u_device_pixel_ratio:i.browser.devicePixelRatio,u_units_to_pixels:[1/we.pixelsToGLUnits[0],1/we.pixelsToGLUnits[1]]}},mu=function(K,le,ie,we){return i.extend(Ul(K,le,ie),{u_image:0,u_image_height:we})},Ql=function(K,le,ie,we){var We=K.transform,gt=Cl(le,We);return{u_matrix:ec(K,le,ie),u_texsize:le.imageAtlasTexture.size,u_ratio:1/sl(le,1,We.zoom),u_device_pixel_ratio:i.browser.devicePixelRatio,u_image:0,u_scale:[gt,we.fromScale,we.toScale],u_fade:we.t,u_units_to_pixels:[1/We.pixelsToGLUnits[0],1/We.pixelsToGLUnits[1]]}},gu=function(K,le,ie,we,We){var gt=K.transform,kt=K.lineAtlas,Je=Cl(le,gt),dt=ie.layout.get("line-cap")==="round",It=kt.getDash(we.from,dt),ur=kt.getDash(we.to,dt),er=It.width*We.fromScale,ar=ur.width*We.toScale;return i.extend(Ul(K,le,ie),{u_patternscale_a:[Je/er,-It.height/2],u_patternscale_b:[Je/ar,-ur.height/2],u_sdfgamma:kt.width/(Math.min(er,ar)*256*i.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:It.y,u_tex_y_b:ur.y,u_mix:We.t})};function Cl(K,le){return 1/sl(K,1,le.tileZoom)}function ec(K,le,ie){return K.translatePosMatrix(le.tileID.posMatrix,le,ie.paint.get("line-translate"),ie.paint.get("line-translate-anchor"))}var $u=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_tl_parent:new i.Uniform2f(K,le.u_tl_parent),u_scale_parent:new i.Uniform1f(K,le.u_scale_parent),u_buffer_scale:new i.Uniform1f(K,le.u_buffer_scale),u_fade_t:new i.Uniform1f(K,le.u_fade_t),u_opacity:new i.Uniform1f(K,le.u_opacity),u_image0:new i.Uniform1i(K,le.u_image0),u_image1:new i.Uniform1i(K,le.u_image1),u_brightness_low:new i.Uniform1f(K,le.u_brightness_low),u_brightness_high:new i.Uniform1f(K,le.u_brightness_high),u_saturation_factor:new i.Uniform1f(K,le.u_saturation_factor),u_contrast_factor:new i.Uniform1f(K,le.u_contrast_factor),u_spin_weights:new i.Uniform3f(K,le.u_spin_weights)}},xu=function(K,le,ie,we,We){return{u_matrix:K,u_tl_parent:le,u_scale_parent:ie,u_buffer_scale:1,u_fade_t:we.mix,u_opacity:we.opacity*We.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:We.paint.get("raster-brightness-min"),u_brightness_high:We.paint.get("raster-brightness-max"),u_saturation_factor:iu(We.paint.get("raster-saturation")),u_contrast_factor:Ds(We.paint.get("raster-contrast")),u_spin_weights:Ho(We.paint.get("raster-hue-rotate"))}};function Ho(K){K*=Math.PI/180;var le=Math.sin(K),ie=Math.cos(K);return[(2*ie+1)/3,(-Math.sqrt(3)*le-ie+1)/3,(Math.sqrt(3)*le-ie+1)/3]}function Ds(K){return K>0?1/(1-K):1+K}function iu(K){return K>0?1-1/(1.001-K):-K}var Wl=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texture:new i.Uniform1i(K,le.u_texture)}},Mc=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texture:new i.Uniform1i(K,le.u_texture),u_gamma_scale:new i.Uniform1f(K,le.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(K,le.u_is_halo)}},eh=function(K,le){return{u_is_size_zoom_constant:new i.Uniform1i(K,le.u_is_size_zoom_constant),u_is_size_feature_constant:new i.Uniform1i(K,le.u_is_size_feature_constant),u_size_t:new i.Uniform1f(K,le.u_size_t),u_size:new i.Uniform1f(K,le.u_size),u_camera_to_center_distance:new i.Uniform1f(K,le.u_camera_to_center_distance),u_pitch:new i.Uniform1f(K,le.u_pitch),u_rotate_symbol:new i.Uniform1i(K,le.u_rotate_symbol),u_aspect_ratio:new i.Uniform1f(K,le.u_aspect_ratio),u_fade_change:new i.Uniform1f(K,le.u_fade_change),u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_label_plane_matrix:new i.UniformMatrix4f(K,le.u_label_plane_matrix),u_coord_matrix:new i.UniformMatrix4f(K,le.u_coord_matrix),u_is_text:new i.Uniform1i(K,le.u_is_text),u_pitch_with_map:new i.Uniform1i(K,le.u_pitch_with_map),u_texsize:new i.Uniform2f(K,le.u_texsize),u_texsize_icon:new i.Uniform2f(K,le.u_texsize_icon),u_texture:new i.Uniform1i(K,le.u_texture),u_texture_icon:new i.Uniform1i(K,le.u_texture_icon),u_gamma_scale:new i.Uniform1f(K,le.u_gamma_scale),u_device_pixel_ratio:new i.Uniform1f(K,le.u_device_pixel_ratio),u_is_halo:new i.Uniform1i(K,le.u_is_halo)}},$c=function(K,le,ie,we,We,gt,kt,Je,dt,It){var ur=We.transform;return{u_is_size_zoom_constant:+(K==="constant"||K==="source"),u_is_size_feature_constant:+(K==="constant"||K==="camera"),u_size_t:le?le.uSizeT:0,u_size:le?le.uSize:0,u_camera_to_center_distance:ur.cameraToCenterDistance,u_pitch:ur.pitch/360*2*Math.PI,u_rotate_symbol:+ie,u_aspect_ratio:ur.width/ur.height,u_fade_change:We.options.fadeDuration?We.symbolFadeChange:1,u_matrix:gt,u_label_plane_matrix:kt,u_coord_matrix:Je,u_is_text:+dt,u_pitch_with_map:+we,u_texsize:It,u_texture:0}},Hh=function(K,le,ie,we,We,gt,kt,Je,dt,It,ur){var er=We.transform;return i.extend($c(K,le,ie,we,We,gt,kt,Je,dt,It),{u_gamma_scale:we?Math.cos(er._pitch)*er.cameraToCenterDistance:1,u_device_pixel_ratio:i.browser.devicePixelRatio,u_is_halo:1})},th=function(K,le,ie,we,We,gt,kt,Je,dt,It){return i.extend(Hh(K,le,ie,we,We,gt,kt,Je,!0,dt),{u_texsize_icon:It,u_texture_icon:1})},Vh=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_opacity:new i.Uniform1f(K,le.u_opacity),u_color:new i.UniformColor(K,le.u_color)}},Wu=function(K,le){return{u_matrix:new i.UniformMatrix4f(K,le.u_matrix),u_opacity:new i.Uniform1f(K,le.u_opacity),u_image:new i.Uniform1i(K,le.u_image),u_pattern_tl_a:new i.Uniform2f(K,le.u_pattern_tl_a),u_pattern_br_a:new i.Uniform2f(K,le.u_pattern_br_a),u_pattern_tl_b:new i.Uniform2f(K,le.u_pattern_tl_b),u_pattern_br_b:new i.Uniform2f(K,le.u_pattern_br_b),u_texsize:new i.Uniform2f(K,le.u_texsize),u_mix:new i.Uniform1f(K,le.u_mix),u_pattern_size_a:new i.Uniform2f(K,le.u_pattern_size_a),u_pattern_size_b:new i.Uniform2f(K,le.u_pattern_size_b),u_scale_a:new i.Uniform1f(K,le.u_scale_a),u_scale_b:new i.Uniform1f(K,le.u_scale_b),u_pixel_coord_upper:new i.Uniform2f(K,le.u_pixel_coord_upper),u_pixel_coord_lower:new i.Uniform2f(K,le.u_pixel_coord_lower),u_tile_units_to_pixels:new i.Uniform1f(K,le.u_tile_units_to_pixels)}},Wh=function(K,le,ie){return{u_matrix:K,u_opacity:le,u_color:ie}},cs=function(K,le,ie,we,We,gt){return i.extend(zf(we,gt,ie,We),{u_matrix:K,u_opacity:le})},Fs={fillExtrusion:ep,fillExtrusionPattern:Ac,fill:$h,fillPattern:Ph,fillOutline:Zu,fillOutlinePattern:fu,circle:wr,collisionBox:Ni,collisionCircle:Ai,debug:pa,clippingMask:Ka,heatmap:wa,heatmapTexture:Va,hillshade:vo,hillshadePrepare:hs,line:_o,lineGradient:no,linePattern:ws,lineSDF:ul,raster:$u,symbolIcon:Wl,symbolSDF:Mc,symbolTextAndIcon:eh,background:Vh,backgroundPattern:Wu},rh;function tc(K,le,ie,we,We,gt,kt){for(var Je=K.context,dt=Je.gl,It=K.useProgram("collisionBox"),ur=[],er=0,ar=0,pr=0;pr0){var Li=i.create(),In=Jt;i.mul(Li,rr.placementInvProjMatrix,K.transform.glCoordMatrix),i.mul(Li,Li,rr.placementViewportMatrix),ur.push({circleArray:bi,circleOffset:ar,transform:In,invTransform:Li}),er+=bi.length/4,ar=er}Fr&&It.draw(Je,dt.LINES,yn.disabled,dn.disabled,K.colorModeForRenderPass(),di.disabled,hn(Jt,K.transform,qt),ie.id,Fr.layoutVertexBuffer,Fr.indexBuffer,Fr.segments,null,K.transform.zoom,null,null,Fr.collisionVertexBuffer)}}if(!(!kt||!ur.length)){var An=K.useProgram("collisionCircle"),gn=new i.StructArrayLayout2f1f2i16;gn.resize(er*4),gn._trim();for(var Vn=0,Dn=0,ca=ur;Dn=0&&(yr[rr.associatedIconIndex]={shiftedAnchor:_a,angle:po})}}if(ur){pr.clear();for(var Jo=K.icon.placedSymbolArray,Ss=0;Ss0){var kt=i.browser.now(),Je=(kt-K.timeAdded)/gt,dt=le?(kt-le.timeAdded)/gt:-1,It=ie.getSource(),ur=We.coveringZoomLevel({tileSize:It.tileSize,roundZoom:It.roundZoom}),er=!le||Math.abs(le.tileID.overscaledZ-ur)>Math.abs(K.tileID.overscaledZ-ur),ar=er&&K.refreshedUponExpiration?1:i.clamp(er?Je:1-dt,0,1);return K.refreshedUponExpiration&&Je>=1&&(K.refreshedUponExpiration=!1),le?{opacity:1,mix:1-ar}:{opacity:ar,mix:0}}else return{opacity:1,mix:0}}function Zr(K,le,ie){var we=ie.paint.get("background-color"),We=ie.paint.get("background-opacity");if(We!==0){var gt=K.context,kt=gt.gl,Je=K.transform,dt=Je.tileSize,It=ie.paint.get("background-pattern");if(!K.isPatternMissing(It)){var ur=!It&&we.a===1&&We===1&&K.opaquePassEnabledForLayer()?"opaque":"translucent";if(K.renderPass===ur){var er=dn.disabled,ar=K.depthModeForSublayer(0,ur==="opaque"?yn.ReadWrite:yn.ReadOnly),pr=K.colorModeForRenderPass(),yr=K.useProgram(It?"backgroundPattern":"background"),qt=Je.coveringTiles({tileSize:dt});It&&(gt.activeTexture.set(kt.TEXTURE0),K.imageManager.bind(K.context));for(var rr=ie.getCrossfadeParameters(),Jt=0,Fr=qt;Jt "+ie.overscaledZ);var Jt=rr+" "+pr+"kb";_s(K,Jt),kt.draw(we,We.TRIANGLES,Je,dt,lr.alphaBlended,di.disabled,Ea(gt,i.Color.transparent,qt),ur,K.debugBuffer,K.quadTriangleIndexBuffer,K.debugSegments)}function _s(K,le){K.initDebugOverlayCanvas();var ie=K.debugOverlayCanvas,we=K.context.gl,We=K.debugOverlayCanvas.getContext("2d");We.clearRect(0,0,ie.width,ie.height),We.shadowColor="white",We.shadowBlur=2,We.lineWidth=1.5,We.strokeStyle="white",We.textBaseline="top",We.font="bold 36px Open Sans, sans-serif",We.fillText(le,5,5),We.strokeText(le,5,5),K.debugOverlayTexture.update(ie),K.debugOverlayTexture.bind(we.LINEAR,we.CLAMP_TO_EDGE)}function wl(K,le,ie){var we=K.context,We=ie.implementation;if(K.renderPass==="offscreen"){var gt=We.prerender;gt&&(K.setCustomLayerDefaults(),we.setColorMode(K.colorModeForRenderPass()),gt.call(We,we.gl,K.transform.customLayerMatrix()),we.setDirty(),K.setBaseState())}else if(K.renderPass==="translucent"){K.setCustomLayerDefaults(),we.setColorMode(K.colorModeForRenderPass()),we.setStencilMode(dn.disabled);var kt=We.renderingMode==="3d"?new yn(K.context.gl.LEQUAL,yn.ReadWrite,K.depthRangeFor3D):K.depthModeForSublayer(0,yn.ReadOnly);we.setDepthMode(kt),We.render(we.gl,K.transform.customLayerMatrix()),we.setDirty(),K.setBaseState(),we.bindFramebuffer.set(null)}}var Al={symbol:O,circle:tr,heatmap:kr,line:Vi,fill:et,"fill-extrusion":Tt,hillshade:Vt,raster:Pr,background:Zr,debug:Go,custom:wl},Us=function(K,le){this.context=new qi(K),this.transform=le,this._tileTextures={},this.setup(),this.numSublayers=Ui.maxUnderzooming+Ui.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ic,this.gpuTimers={}};Us.prototype.resize=function(K,le){if(this.width=K*i.browser.devicePixelRatio,this.height=le*i.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var ie=0,we=this.style._order;ie256&&this.clearStencil(),ie.setColorMode(lr.disabled),ie.setDepthMode(yn.disabled);var We=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var gt=0,kt=le;gt256&&this.clearStencil();var K=this.nextStencilID++,le=this.context.gl;return new dn({func:le.NOTEQUAL,mask:255},K,255,le.KEEP,le.KEEP,le.REPLACE)},Us.prototype.stencilModeForClipping=function(K){var le=this.context.gl;return new dn({func:le.EQUAL,mask:255},this._tileClippingMaskIDs[K.key],0,le.KEEP,le.KEEP,le.REPLACE)},Us.prototype.stencilConfigForOverlap=function(K){var le,ie=this.context.gl,we=K.sort(function(dt,It){return It.overscaledZ-dt.overscaledZ}),We=we[we.length-1].overscaledZ,gt=we[0].overscaledZ-We+1;if(gt>1){this.currentStencilSource=void 0,this.nextStencilID+gt>256&&this.clearStencil();for(var kt={},Je=0;Je=0;this.currentLayer--){var bi=this.style._layers[we[this.currentLayer]],Li=We[bi.source],In=Je[bi.source];this._renderTileClippingMasks(bi,In),this.renderLayer(this,Li,bi,In)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?le.pop():null},Us.prototype.isPatternMissing=function(K){if(!K)return!1;if(!K.from||!K.to)return!0;var le=this.imageManager.getPattern(K.from.toString()),ie=this.imageManager.getPattern(K.to.toString());return!le||!ie},Us.prototype.useProgram=function(K,le){this.cache=this.cache||{};var ie=""+K+(le?le.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[ie]||(this.cache[ie]=new pf(this.context,K,Df[K],le,Fs[K],this._showOverdrawInspector)),this.cache[ie]},Us.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Us.prototype.setBaseState=function(){var K=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(K.FUNC_ADD)},Us.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=i.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var K=this.context.gl;this.debugOverlayTexture=new i.Texture(this.context,this.debugOverlayCanvas,K.RGBA)}},Us.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Pl=function(K,le){this.points=K,this.planes=le};Pl.fromInvProjectionMatrix=function(K,le,ie){var we=[[-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]],We=Math.pow(2,ie),gt=we.map(function(dt){return i.transformMat4([],dt,K)}).map(function(dt){return i.scale$1([],dt,1/dt[3]/le*We)}),kt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],Je=kt.map(function(dt){var It=i.sub([],gt[dt[0]],gt[dt[1]]),ur=i.sub([],gt[dt[2]],gt[dt[1]]),er=i.normalize([],i.cross([],It,ur)),ar=-i.dot(er,gt[dt[1]]);return er.concat(ar)});return new Pl(gt,Je)};var Fu=function(K,le){this.min=K,this.max=le,this.center=i.scale$2([],i.add([],this.min,this.max),.5)};Fu.prototype.quadrant=function(K){for(var le=[K%2===0,K<2],ie=i.clone$2(this.min),we=i.clone$2(this.max),We=0;We=0;if(gt===0)return 0;gt!==le.length&&(ie=!1)}if(ie)return 2;for(var Je=0;Je<3;Je++){for(var dt=Number.MAX_VALUE,It=-Number.MAX_VALUE,ur=0;urthis.max[Je]-this.min[Je])return 0}return 1};var Tu=function(K,le,ie,we){if(K===void 0&&(K=0),le===void 0&&(le=0),ie===void 0&&(ie=0),we===void 0&&(we=0),isNaN(K)||K<0||isNaN(le)||le<0||isNaN(ie)||ie<0||isNaN(we)||we<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=K,this.bottom=le,this.left=ie,this.right=we};Tu.prototype.interpolate=function(K,le,ie){return le.top!=null&&K.top!=null&&(this.top=i.number(K.top,le.top,ie)),le.bottom!=null&&K.bottom!=null&&(this.bottom=i.number(K.bottom,le.bottom,ie)),le.left!=null&&K.left!=null&&(this.left=i.number(K.left,le.left,ie)),le.right!=null&&K.right!=null&&(this.right=i.number(K.right,le.right,ie)),this},Tu.prototype.getCenter=function(K,le){var ie=i.clamp((this.left+K-this.right)/2,0,K),we=i.clamp((this.top+le-this.bottom)/2,0,le);return new i.Point(ie,we)},Tu.prototype.equals=function(K){return this.top===K.top&&this.bottom===K.bottom&&this.left===K.left&&this.right===K.right},Tu.prototype.clone=function(){return new Tu(this.top,this.bottom,this.left,this.right)},Tu.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Js=function(K,le,ie,we,We){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=We===void 0?!0:We,this._minZoom=K||0,this._maxZoom=le||22,this._minPitch=ie??0,this._maxPitch=we??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new i.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tu,this._posMatrixCache={},this._alignedPosMatrixCache={}},Qs={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Js.prototype.clone=function(){var K=new Js(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return K.tileSize=this.tileSize,K.latRange=this.latRange,K.width=this.width,K.height=this.height,K._center=this._center,K.zoom=this.zoom,K.angle=this.angle,K._fov=this._fov,K._pitch=this._pitch,K._unmodified=this._unmodified,K._edgeInsets=this._edgeInsets.clone(),K._calcMatrices(),K},Qs.minZoom.get=function(){return this._minZoom},Qs.minZoom.set=function(K){this._minZoom!==K&&(this._minZoom=K,this.zoom=Math.max(this.zoom,K))},Qs.maxZoom.get=function(){return this._maxZoom},Qs.maxZoom.set=function(K){this._maxZoom!==K&&(this._maxZoom=K,this.zoom=Math.min(this.zoom,K))},Qs.minPitch.get=function(){return this._minPitch},Qs.minPitch.set=function(K){this._minPitch!==K&&(this._minPitch=K,this.pitch=Math.max(this.pitch,K))},Qs.maxPitch.get=function(){return this._maxPitch},Qs.maxPitch.set=function(K){this._maxPitch!==K&&(this._maxPitch=K,this.pitch=Math.min(this.pitch,K))},Qs.renderWorldCopies.get=function(){return this._renderWorldCopies},Qs.renderWorldCopies.set=function(K){K===void 0?K=!0:K===null&&(K=!1),this._renderWorldCopies=K},Qs.worldSize.get=function(){return this.tileSize*this.scale},Qs.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Qs.size.get=function(){return new i.Point(this.width,this.height)},Qs.bearing.get=function(){return-this.angle/Math.PI*180},Qs.bearing.set=function(K){var le=-i.wrap(K,-180,180)*Math.PI/180;this.angle!==le&&(this._unmodified=!1,this.angle=le,this._calcMatrices(),this.rotationMatrix=i.create$2(),i.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Qs.pitch.get=function(){return this._pitch/Math.PI*180},Qs.pitch.set=function(K){var le=i.clamp(K,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==le&&(this._unmodified=!1,this._pitch=le,this._calcMatrices())},Qs.fov.get=function(){return this._fov/Math.PI*180},Qs.fov.set=function(K){K=Math.max(.01,Math.min(60,K)),this._fov!==K&&(this._unmodified=!1,this._fov=K/180*Math.PI,this._calcMatrices())},Qs.zoom.get=function(){return this._zoom},Qs.zoom.set=function(K){var le=Math.min(Math.max(K,this.minZoom),this.maxZoom);this._zoom!==le&&(this._unmodified=!1,this._zoom=le,this.scale=this.zoomScale(le),this.tileZoom=Math.floor(le),this.zoomFraction=le-this.tileZoom,this._constrain(),this._calcMatrices())},Qs.center.get=function(){return this._center},Qs.center.set=function(K){K.lat===this._center.lat&&K.lng===this._center.lng||(this._unmodified=!1,this._center=K,this._constrain(),this._calcMatrices())},Qs.padding.get=function(){return this._edgeInsets.toJSON()},Qs.padding.set=function(K){this._edgeInsets.equals(K)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,K,1),this._calcMatrices())},Qs.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Js.prototype.isPaddingEqual=function(K){return this._edgeInsets.equals(K)},Js.prototype.interpolatePadding=function(K,le,ie){this._unmodified=!1,this._edgeInsets.interpolate(K,le,ie),this._constrain(),this._calcMatrices()},Js.prototype.coveringZoomLevel=function(K){var le=(K.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/K.tileSize));return Math.max(0,le)},Js.prototype.getVisibleUnwrappedCoordinates=function(K){var le=[new i.UnwrappedTileID(0,K)];if(this._renderWorldCopies)for(var ie=this.pointCoordinate(new i.Point(0,0)),we=this.pointCoordinate(new i.Point(this.width,0)),We=this.pointCoordinate(new i.Point(this.width,this.height)),gt=this.pointCoordinate(new i.Point(0,this.height)),kt=Math.floor(Math.min(ie.x,we.x,We.x,gt.x)),Je=Math.floor(Math.max(ie.x,we.x,We.x,gt.x)),dt=1,It=kt-dt;It<=Je+dt;It++)It!==0&&le.push(new i.UnwrappedTileID(It,K));return le},Js.prototype.coveringTiles=function(K){var le=this.coveringZoomLevel(K),ie=le;if(K.minzoom!==void 0&&leK.maxzoom&&(le=K.maxzoom);var we=i.MercatorCoordinate.fromLngLat(this.center),We=Math.pow(2,le),gt=[We*we.x,We*we.y,0],kt=Pl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,le),Je=K.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(Je=le);var dt=3,It=function(Hn){return{aabb:new Fu([Hn*We,0,0],[(Hn+1)*We,We,0]),zoom:0,x:0,y:0,wrap:Hn,fullyVisible:!1}},ur=[],er=[],ar=le,pr=K.reparseOverscaled?ie:le;if(this._renderWorldCopies)for(var yr=1;yr<=3;yr++)ur.push(It(-yr)),ur.push(It(yr));for(ur.push(It(0));ur.length>0;){var qt=ur.pop(),rr=qt.x,Jt=qt.y,Fr=qt.fullyVisible;if(!Fr){var bi=qt.aabb.intersects(kt);if(bi===0)continue;Fr=bi===2}var Li=qt.aabb.distanceX(gt),In=qt.aabb.distanceY(gt),An=Math.max(Math.abs(Li),Math.abs(In)),gn=dt+(1<gn&&qt.zoom>=Je){er.push({tileID:new i.OverscaledTileID(qt.zoom===ar?pr:qt.zoom,qt.wrap,qt.zoom,rr,Jt),distanceSq:i.sqrLen([gt[0]-.5-rr,gt[1]-.5-Jt])});continue}for(var Vn=0;Vn<4;Vn++){var Dn=(rr<<1)+Vn%2,ca=(Jt<<1)+(Vn>>1);ur.push({aabb:qt.aabb.quadrant(Vn),zoom:qt.zoom+1,x:Dn,y:ca,wrap:qt.wrap,fullyVisible:Fr})}}return er.sort(function(Hn,Wn){return Hn.distanceSq-Wn.distanceSq}).map(function(Hn){return Hn.tileID})},Js.prototype.resize=function(K,le){this.width=K,this.height=le,this.pixelsToGLUnits=[2/K,-2/le],this._constrain(),this._calcMatrices()},Qs.unmodified.get=function(){return this._unmodified},Js.prototype.zoomScale=function(K){return Math.pow(2,K)},Js.prototype.scaleZoom=function(K){return Math.log(K)/Math.LN2},Js.prototype.project=function(K){var le=i.clamp(K.lat,-this.maxValidLatitude,this.maxValidLatitude);return new i.Point(i.mercatorXfromLng(K.lng)*this.worldSize,i.mercatorYfromLat(le)*this.worldSize)},Js.prototype.unproject=function(K){return new i.MercatorCoordinate(K.x/this.worldSize,K.y/this.worldSize).toLngLat()},Qs.point.get=function(){return this.project(this.center)},Js.prototype.setLocationAtPoint=function(K,le){var ie=this.pointCoordinate(le),we=this.pointCoordinate(this.centerPoint),We=this.locationCoordinate(K),gt=new i.MercatorCoordinate(We.x-(ie.x-we.x),We.y-(ie.y-we.y));this.center=this.coordinateLocation(gt),this._renderWorldCopies&&(this.center=this.center.wrap())},Js.prototype.locationPoint=function(K){return this.coordinatePoint(this.locationCoordinate(K))},Js.prototype.pointLocation=function(K){return this.coordinateLocation(this.pointCoordinate(K))},Js.prototype.locationCoordinate=function(K){return i.MercatorCoordinate.fromLngLat(K)},Js.prototype.coordinateLocation=function(K){return K.toLngLat()},Js.prototype.pointCoordinate=function(K){var le=0,ie=[K.x,K.y,0,1],we=[K.x,K.y,1,1];i.transformMat4(ie,ie,this.pixelMatrixInverse),i.transformMat4(we,we,this.pixelMatrixInverse);var We=ie[3],gt=we[3],kt=ie[0]/We,Je=we[0]/gt,dt=ie[1]/We,It=we[1]/gt,ur=ie[2]/We,er=we[2]/gt,ar=ur===er?0:(le-ur)/(er-ur);return new i.MercatorCoordinate(i.number(kt,Je,ar)/this.worldSize,i.number(dt,It,ar)/this.worldSize)},Js.prototype.coordinatePoint=function(K){var le=[K.x*this.worldSize,K.y*this.worldSize,0,1];return i.transformMat4(le,le,this.pixelMatrix),new i.Point(le[0]/le[3],le[1]/le[3])},Js.prototype.getBounds=function(){return new i.LngLatBounds().extend(this.pointLocation(new i.Point(0,0))).extend(this.pointLocation(new i.Point(this.width,0))).extend(this.pointLocation(new i.Point(this.width,this.height))).extend(this.pointLocation(new i.Point(0,this.height)))},Js.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new i.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},Js.prototype.setMaxBounds=function(K){K?(this.lngRange=[K.getWest(),K.getEast()],this.latRange=[K.getSouth(),K.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Js.prototype.calculatePosMatrix=function(K,le){le===void 0&&(le=!1);var ie=K.key,we=le?this._alignedPosMatrixCache:this._posMatrixCache;if(we[ie])return we[ie];var We=K.canonical,gt=this.worldSize/this.zoomScale(We.z),kt=We.x+Math.pow(2,We.z)*K.wrap,Je=i.identity(new Float64Array(16));return i.translate(Je,Je,[kt*gt,We.y*gt,0]),i.scale(Je,Je,[gt/i.EXTENT,gt/i.EXTENT,1]),i.multiply(Je,le?this.alignedProjMatrix:this.projMatrix,Je),we[ie]=new Float32Array(Je),we[ie]},Js.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Js.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var K=-90,le=90,ie=-180,we=180,We,gt,kt,Je,dt=this.size,It=this._unmodified;if(this.latRange){var ur=this.latRange;K=i.mercatorYfromLat(ur[1])*this.worldSize,le=i.mercatorYfromLat(ur[0])*this.worldSize,We=le-Kle&&(Je=le-qt)}if(this.lngRange){var rr=ar.x,Jt=dt.x/2;rr-Jtwe&&(kt=we-Jt)}(kt!==void 0||Je!==void 0)&&(this.center=this.unproject(new i.Point(kt!==void 0?kt:ar.x,Je!==void 0?Je:ar.y))),this._unmodified=It,this._constraining=!1}},Js.prototype._calcMatrices=function(){if(this.height){var K=this._fov/2,le=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(K)*this.height;var ie=Math.PI/2+this._pitch,we=this._fov*(.5+le.y/this.height),We=Math.sin(we)*this.cameraToCenterDistance/Math.sin(i.clamp(Math.PI-ie-we,.01,Math.PI-.01)),gt=this.point,kt=gt.x,Je=gt.y,dt=Math.cos(Math.PI/2-this._pitch)*We+this.cameraToCenterDistance,It=dt*1.01,ur=this.height/50,er=new Float64Array(16);i.perspective(er,this._fov,this.width/this.height,ur,It),er[8]=-le.x*2/this.width,er[9]=le.y*2/this.height,i.scale(er,er,[1,-1,1]),i.translate(er,er,[0,0,-this.cameraToCenterDistance]),i.rotateX(er,er,this._pitch),i.rotateZ(er,er,this.angle),i.translate(er,er,[-kt,-Je,0]),this.mercatorMatrix=i.scale([],er,[this.worldSize,this.worldSize,this.worldSize]),i.scale(er,er,[1,1,i.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=er,this.invProjMatrix=i.invert([],this.projMatrix);var ar=this.width%2/2,pr=this.height%2/2,yr=Math.cos(this.angle),qt=Math.sin(this.angle),rr=kt-Math.round(kt)+yr*ar+qt*pr,Jt=Je-Math.round(Je)+yr*pr+qt*ar,Fr=new Float64Array(er);if(i.translate(Fr,Fr,[rr>.5?rr-1:rr,Jt>.5?Jt-1:Jt,0]),this.alignedProjMatrix=Fr,er=i.create(),i.scale(er,er,[this.width/2,-this.height/2,1]),i.translate(er,er,[1,-1,0]),this.labelPlaneMatrix=er,er=i.create(),i.scale(er,er,[1,-1,1]),i.translate(er,er,[-1,-1,0]),i.scale(er,er,[2/this.width,2/this.height,1]),this.glCoordMatrix=er,this.pixelMatrix=i.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),er=i.invert(new Float64Array(16),this.pixelMatrix),!er)throw new Error("failed to invert matrix");this.pixelMatrixInverse=er,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Js.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var K=this.pointCoordinate(new i.Point(0,0)),le=[K.x*this.worldSize,K.y*this.worldSize,0,1],ie=i.transformMat4(le,le,this.pixelMatrix);return ie[3]/this.cameraToCenterDistance},Js.prototype.getCameraPoint=function(){var K=this._pitch,le=Math.tan(K)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new i.Point(0,le))},Js.prototype.getCameraQueryGeometry=function(K){var le=this.getCameraPoint();if(K.length===1)return[K[0],le];for(var ie=le.x,we=le.y,We=le.x,gt=le.y,kt=0,Je=K;kt=3&&!K.some(function(ie){return isNaN(ie)})){var le=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(K[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+K[2],+K[1]],zoom:+K[0],bearing:le,pitch:+(K[4]||0)}),!0}return!1},wc.prototype._updateHashUnthrottled=function(){var K=i.window.location.href.replace(/(#.+)?$/,this.getHashString());try{i.window.history.replaceState(i.window.history.state,null,K)}catch{}};var ih={linearity:.3,easing:i.bezier(0,0,.3,1)},Me=i.extend({deceleration:2500,maxSpeed:1400},ih),Ve=i.extend({deceleration:20,maxSpeed:1400},ih),ft=i.extend({deceleration:1e3,maxSpeed:360},ih),Pt=i.extend({deceleration:1e3,maxSpeed:90},ih),Bt=function(K){this._map=K,this.clear()};Bt.prototype.clear=function(){this._inertiaBuffer=[]},Bt.prototype.record=function(K){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.browser.now(),settings:K})},Bt.prototype._drainInertiaBuffer=function(){for(var K=this._inertiaBuffer,le=i.browser.now(),ie=160;K.length>0&&le-K[0].time>ie;)K.shift()},Bt.prototype._onMoveEnd=function(K){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var le={zoom:0,bearing:0,pitch:0,pan:new i.Point(0,0),pinchAround:void 0,around:void 0},ie=0,we=this._inertiaBuffer;ie=this._clickTolerance||this._map.fire(new cr(K.type,this._map,K))},hi.prototype.dblclick=function(K){return this._firePreventable(new cr(K.type,this._map,K))},hi.prototype.mouseover=function(K){this._map.fire(new cr(K.type,this._map,K))},hi.prototype.mouseout=function(K){this._map.fire(new cr(K.type,this._map,K))},hi.prototype.touchstart=function(K){return this._firePreventable(new Or(K.type,this._map,K))},hi.prototype.touchmove=function(K){this._map.fire(new Or(K.type,this._map,K))},hi.prototype.touchend=function(K){this._map.fire(new Or(K.type,this._map,K))},hi.prototype.touchcancel=function(K){this._map.fire(new Or(K.type,this._map,K))},hi.prototype._firePreventable=function(K){if(this._map.fire(K),K.defaultPrevented)return{}},hi.prototype.isEnabled=function(){return!0},hi.prototype.isActive=function(){return!1},hi.prototype.enable=function(){},hi.prototype.disable=function(){};var Bi=function(K){this._map=K};Bi.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bi.prototype.mousemove=function(K){this._map.fire(new cr(K.type,this._map,K))},Bi.prototype.mousedown=function(){this._delayContextMenu=!0},Bi.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new cr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bi.prototype.contextmenu=function(K){this._delayContextMenu?this._contextMenuEvent=K:this._map.fire(new cr(K.type,this._map,K)),this._map.listens("contextmenu")&&K.preventDefault()},Bi.prototype.isEnabled=function(){return!0},Bi.prototype.isActive=function(){return!1},Bi.prototype.enable=function(){},Bi.prototype.disable=function(){};var Yi=function(K,le){this._map=K,this._el=K.getCanvasContainer(),this._container=K.getContainer(),this._clickTolerance=le.clickTolerance||1};Yi.prototype.isEnabled=function(){return!!this._enabled},Yi.prototype.isActive=function(){return!!this._active},Yi.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Yi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Yi.prototype.mousedown=function(K,le){this.isEnabled()&&K.shiftKey&&K.button===0&&(a.disableDrag(),this._startPos=this._lastPos=le,this._active=!0)},Yi.prototype.mousemoveWindow=function(K,le){if(this._active){var ie=le;if(!(this._lastPos.equals(ie)||!this._box&&ie.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=K.timeStamp),ie.length===this.numTouches&&(this.centroid=ta(le),this.touches=Ji(ie,le)))},Yn.prototype.touchmove=function(K,le,ie){if(!(this.aborted||!this.centroid)){var we=Ji(ie,le);for(var We in this.touches){var gt=this.touches[We],kt=we[We];(!kt||kt.dist(gt)>$n)&&(this.aborted=!0)}}},Yn.prototype.touchend=function(K,le,ie){if((!this.centroid||K.timeStamp-this.startTime>Bn)&&(this.aborted=!0),ie.length===0){var we=!this.aborted&&this.centroid;if(this.reset(),we)return we}};var aa=function(K){this.singleTap=new Yn(K),this.numTaps=K.numTaps,this.reset()};aa.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},aa.prototype.touchstart=function(K,le,ie){this.singleTap.touchstart(K,le,ie)},aa.prototype.touchmove=function(K,le,ie){this.singleTap.touchmove(K,le,ie)},aa.prototype.touchend=function(K,le,ie){var we=this.singleTap.touchend(K,le,ie);if(we){var We=K.timeStamp-this.lastTime0&&(this._active=!0);var we=Ji(ie,le),We=new i.Point(0,0),gt=new i.Point(0,0),kt=0;for(var Je in we){var dt=we[Je],It=this._touches[Je];It&&(We._add(dt),gt._add(dt.sub(It)),kt++,we[Je]=dt)}if(this._touches=we,!(ktMath.abs(K.x)}var Zl=100,cu=function(K){function le(){K.apply(this,arguments)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.reset=function(){K.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},le.prototype._start=function(ie){this._lastPoints=ie,dh(ie[0].sub(ie[1]))&&(this._valid=!1)},le.prototype._move=function(ie,we,We){var gt=ie[0].sub(this._lastPoints[0]),kt=ie[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(gt,kt,We.timeStamp),!!this._valid){this._lastPoints=ie,this._active=!0;var Je=(gt.y+kt.y)/2,dt=-.5;return{pitchDelta:Je*dt}}},le.prototype.gestureBeginsVertically=function(ie,we,We){if(this._valid!==void 0)return this._valid;var gt=2,kt=ie.mag()>=gt,Je=we.mag()>=gt;if(!(!kt&&!Je)){if(!kt||!Je)return this._firstMove===void 0&&(this._firstMove=We),We-this._firstMove0==we.y>0;return dh(ie)&&dh(we)&&dt}},le}(Dl),zh={panStep:100,bearingStep:15,pitchStep:10},St=function(){var K=zh;this._panStep=K.panStep,this._bearingStep=K.bearingStep,this._pitchStep=K.pitchStep,this._rotationDisabled=!1};St.prototype.reset=function(){this._active=!1},St.prototype.keydown=function(K){var le=this;if(!(K.altKey||K.ctrlKey||K.metaKey)){var ie=0,we=0,We=0,gt=0,kt=0;switch(K.keyCode){case 61:case 107:case 171:case 187:ie=1;break;case 189:case 109:case 173:ie=-1;break;case 37:K.shiftKey?we=-1:(K.preventDefault(),gt=-1);break;case 39:K.shiftKey?we=1:(K.preventDefault(),gt=1);break;case 38:K.shiftKey?We=1:(K.preventDefault(),kt=-1);break;case 40:K.shiftKey?We=-1:(K.preventDefault(),kt=1);break;default:return}return this._rotationDisabled&&(we=0,We=0),{cameraAnimation:function(Je){var dt=Je.getZoom();Je.easeTo({duration:300,easeId:"keyboardHandler",easing:Ir,zoom:ie?Math.round(dt)+ie*(K.shiftKey?2:1):dt,bearing:Je.getBearing()+we*le._bearingStep,pitch:Je.getPitch()+We*le._pitchStep,offset:[-gt*le._panStep,-kt*le._panStep],center:Je.getCenter()},{originalEvent:K})}}}},St.prototype.enable=function(){this._enabled=!0},St.prototype.disable=function(){this._enabled=!1,this.reset()},St.prototype.isEnabled=function(){return this._enabled},St.prototype.isActive=function(){return this._active},St.prototype.disableRotation=function(){this._rotationDisabled=!0},St.prototype.enableRotation=function(){this._rotationDisabled=!1};function Ir(K){return K*(2-K)}var Nr=4.000244140625,Qi=1/100,Cn=1/450,xn=2,Oi=function(K,le){this._map=K,this._el=K.getCanvasContainer(),this._handler=le,this._delta=0,this._defaultZoomRate=Qi,this._wheelZoomRate=Cn,i.bindAll(["_onTimeout"],this)};Oi.prototype.setZoomRate=function(K){this._defaultZoomRate=K},Oi.prototype.setWheelZoomRate=function(K){this._wheelZoomRate=K},Oi.prototype.isEnabled=function(){return!!this._enabled},Oi.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Oi.prototype.isZooming=function(){return!!this._zooming},Oi.prototype.enable=function(K){this.isEnabled()||(this._enabled=!0,this._aroundCenter=K&&K.around==="center")},Oi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Oi.prototype.wheel=function(K){if(this.isEnabled()){var le=K.deltaMode===i.window.WheelEvent.DOM_DELTA_LINE?K.deltaY*40:K.deltaY,ie=i.browser.now(),we=ie-(this._lastWheelEventTime||0);this._lastWheelEventTime=ie,le!==0&&le%Nr===0?this._type="wheel":le!==0&&Math.abs(le)<4?this._type="trackpad":we>400?(this._type=null,this._lastValue=le,this._timeout=setTimeout(this._onTimeout,40,K)):this._type||(this._type=Math.abs(we*le)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,le+=this._lastValue)),K.shiftKey&&le&&(le=le/4),this._type&&(this._lastWheelEvent=K,this._delta-=le,this._active||this._start(K)),K.preventDefault()}},Oi.prototype._onTimeout=function(K){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(K)},Oi.prototype._start=function(K){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var le=a.mousePos(this._el,K);this._around=i.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(le)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Oi.prototype.renderFrame=function(){var K=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var le=this._map.transform;if(this._delta!==0){var ie=this._type==="wheel"&&Math.abs(this._delta)>Nr?this._wheelZoomRate:this._defaultZoomRate,we=xn/(1+Math.exp(-Math.abs(this._delta*ie)));this._delta<0&&we!==0&&(we=1/we);var We=typeof this._targetZoom=="number"?le.zoomScale(this._targetZoom):le.scale;this._targetZoom=Math.min(le.maxZoom,Math.max(le.minZoom,le.scaleZoom(We*we))),this._type==="wheel"&&(this._startZoom=le.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var gt=typeof this._targetZoom=="number"?this._targetZoom:le.zoom,kt=this._startZoom,Je=this._easing,dt=!1,It;if(this._type==="wheel"&&kt&&Je){var ur=Math.min((i.browser.now()-this._lastWheelEventTime)/200,1),er=Je(ur);It=i.number(kt,gt,er),ur<1?this._frameId||(this._frameId=!0):dt=!0}else It=gt,dt=!0;return this._active=!0,dt&&(this._active=!1,this._finishTimeout=setTimeout(function(){K._zooming=!1,K._handler._triggerRenderFrame(),delete K._targetZoom,delete K._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!dt,zoomDelta:It-le.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Oi.prototype._smoothOutEasing=function(K){var le=i.ease;if(this._prevEase){var ie=this._prevEase,we=(i.browser.now()-ie.start)/ie.duration,We=ie.easing(we+.01)-ie.easing(we),gt=.27/Math.sqrt(We*We+1e-4)*.01,kt=Math.sqrt(.27*.27-gt*gt);le=i.bezier(gt,kt,.25,1)}return this._prevEase={start:i.browser.now(),duration:K,easing:le},le},Oi.prototype.reset=function(){this._active=!1};var Tn=function(K,le){this._clickZoom=K,this._tapZoom=le};Tn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Tn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Tn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Tn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ua=function(){this.reset()};ua.prototype.reset=function(){this._active=!1},ua.prototype.dblclick=function(K,le){return K.preventDefault(),{cameraAnimation:function(ie){ie.easeTo({duration:300,zoom:ie.getZoom()+(K.shiftKey?-1:1),around:ie.unproject(le)},{originalEvent:K})}}},ua.prototype.enable=function(){this._enabled=!0},ua.prototype.disable=function(){this._enabled=!1,this.reset()},ua.prototype.isEnabled=function(){return this._enabled},ua.prototype.isActive=function(){return this._active};var ia=function(){this._tap=new aa({numTouches:1,numTaps:1}),this.reset()};ia.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ia.prototype.touchstart=function(K,le,ie){this._swipePoint||(this._tapTime&&K.timeStamp-this._tapTime>sn&&this.reset(),this._tapTime?ie.length>0&&(this._swipePoint=le[0],this._swipeTouch=ie[0].identifier):this._tap.touchstart(K,le,ie))},ia.prototype.touchmove=function(K,le,ie){if(!this._tapTime)this._tap.touchmove(K,le,ie);else if(this._swipePoint){if(ie[0].identifier!==this._swipeTouch)return;var we=le[0],We=we.y-this._swipePoint.y;return this._swipePoint=we,K.preventDefault(),this._active=!0,{zoomDelta:We/128}}},ia.prototype.touchend=function(K,le,ie){if(this._tapTime)this._swipePoint&&ie.length===0&&this.reset();else{var we=this._tap.touchend(K,le,ie);we&&(this._tapTime=K.timeStamp)}},ia.prototype.touchcancel=function(){this.reset()},ia.prototype.enable=function(){this._enabled=!0},ia.prototype.disable=function(){this._enabled=!1,this.reset()},ia.prototype.isEnabled=function(){return this._enabled},ia.prototype.isActive=function(){return this._active};var La=function(K,le,ie){this._el=K,this._mousePan=le,this._touchPan=ie};La.prototype.enable=function(K){this._inertiaOptions=K||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},La.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},La.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},La.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ao=function(K,le,ie){this._pitchWithRotate=K.pitchWithRotate,this._mouseRotate=le,this._mousePitch=ie};ao.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ao.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ao.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ao.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Ya=function(K,le,ie,we){this._el=K,this._touchZoom=le,this._touchRotate=ie,this._tapDragZoom=we,this._rotationDisabled=!1,this._enabled=!0};Ya.prototype.enable=function(K){this._touchZoom.enable(K),this._rotationDisabled||this._touchRotate.enable(K),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Ya.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Ya.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Ya.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Ya.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Ya.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var da=function(K){return K.zoom||K.drag||K.pitch||K.rotate},jn=function(K){function le(){K.apply(this,arguments)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le}(i.Event);function Ei(K){return K.panDelta&&K.panDelta.mag()||K.zoomDelta||K.bearingDelta||K.pitchDelta}var an=function(K,le){this._map=K,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Bt(K),this._bearingSnap=le.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(le),i.bindAll(["handleEvent","handleWindowEvent"],this);var ie=this._el;this._listeners=[[ie,"touchstart",{passive:!0}],[ie,"touchmove",{passive:!1}],[ie,"touchend",void 0],[ie,"touchcancel",void 0],[ie,"mousedown",void 0],[ie,"mousemove",void 0],[ie,"mouseup",void 0],[i.window.document,"mousemove",{capture:!0}],[i.window.document,"mouseup",void 0],[ie,"mouseover",void 0],[ie,"mouseout",void 0],[ie,"dblclick",void 0],[ie,"click",void 0],[ie,"keydown",{capture:!1}],[ie,"keyup",void 0],[ie,"wheel",{passive:!1}],[ie,"contextmenu",void 0],[i.window,"blur",void 0]];for(var we=0,We=this._listeners;wekt?Math.min(2,Li):Math.max(.5,Li),Hn=Math.pow(ca,1-Vn),Wn=gt.unproject(Fr.add(bi.mult(Vn*Hn)).mult(Dn));gt.setLocationAtPoint(gt.renderWorldCopies?Wn.wrap():Wn,qt)}We._fireMoveEvents(we)},function(Vn){We._afterEase(we,Vn)},ie),this},le.prototype._prepareEase=function(ie,we,We){We===void 0&&(We={}),this._moving=!0,!we&&!We.moving&&this.fire(new i.Event("movestart",ie)),this._zooming&&!We.zooming&&this.fire(new i.Event("zoomstart",ie)),this._rotating&&!We.rotating&&this.fire(new i.Event("rotatestart",ie)),this._pitching&&!We.pitching&&this.fire(new i.Event("pitchstart",ie))},le.prototype._fireMoveEvents=function(ie){this.fire(new i.Event("move",ie)),this._zooming&&this.fire(new i.Event("zoom",ie)),this._rotating&&this.fire(new i.Event("rotate",ie)),this._pitching&&this.fire(new i.Event("pitch",ie))},le.prototype._afterEase=function(ie,we){if(!(this._easeId&&we&&this._easeId===we)){delete this._easeId;var We=this._zooming,gt=this._rotating,kt=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,We&&this.fire(new i.Event("zoomend",ie)),gt&&this.fire(new i.Event("rotateend",ie)),kt&&this.fire(new i.Event("pitchend",ie)),this.fire(new i.Event("moveend",ie))}},le.prototype.flyTo=function(ie,we){var We=this;if(!ie.essential&&i.browser.prefersReducedMotion){var gt=i.pick(ie,["center","zoom","bearing","pitch","around"]);return this.jumpTo(gt,we)}this.stop(),ie=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},ie);var kt=this.transform,Je=this.getZoom(),dt=this.getBearing(),It=this.getPitch(),ur=this.getPadding(),er="zoom"in ie?i.clamp(+ie.zoom,kt.minZoom,kt.maxZoom):Je,ar="bearing"in ie?this._normalizeBearing(ie.bearing,dt):dt,pr="pitch"in ie?+ie.pitch:It,yr="padding"in ie?ie.padding:kt.padding,qt=kt.zoomScale(er-Je),rr=i.Point.convert(ie.offset),Jt=kt.centerPoint.add(rr),Fr=kt.pointLocation(Jt),bi=i.LngLat.convert(ie.center||Fr);this._normalizeCenter(bi);var Li=kt.project(Fr),In=kt.project(bi).sub(Li),An=ie.curve,gn=Math.max(kt.width,kt.height),Vn=gn/qt,Dn=In.mag();if("minZoom"in ie){var ca=i.clamp(Math.min(ie.minZoom,Je,er),kt.minZoom,kt.maxZoom),Hn=gn/kt.zoomScale(ca-Je);An=Math.sqrt(Hn/Dn*2)}var Wn=An*An;function _a($s){var zu=(Vn*Vn-gn*gn+($s?-1:1)*Wn*Wn*Dn*Dn)/(2*($s?Vn:gn)*Wn*Dn);return Math.log(Math.sqrt(zu*zu+1)-zu)}function po($s){return(Math.exp($s)-Math.exp(-$s))/2}function To($s){return(Math.exp($s)+Math.exp(-$s))/2}function Jo($s){return po($s)/To($s)}var Ss=_a(0),$l=function($s){return To(Ss)/To(Ss+An*$s)},Yl=function($s){return gn*((To(Ss)*Jo(Ss+An*$s)-po(Ss))/Wn)/Dn},Tl=(_a(1)-Ss)/An;if(Math.abs(Dn)<1e-6||!isFinite(Tl)){if(Math.abs(gn-Vn)<1e-6)return this.easeTo(ie,we);var Xl=Vnie.maxDuration&&(ie.duration=0),this._zooming=!0,this._rotating=dt!==ar,this._pitching=pr!==It,this._padding=!kt.isPaddingEqual(yr),this._prepareEase(we,!1),this._ease(function($s){var zu=$s*Tl,mf=1/$l(zu);kt.zoom=$s===1?er:Je+kt.scaleZoom(mf),We._rotating&&(kt.bearing=i.number(dt,ar,$s)),We._pitching&&(kt.pitch=i.number(It,pr,$s)),We._padding&&(kt.interpolatePadding(ur,yr,$s),Jt=kt.centerPoint.add(rr));var Vf=$s===1?bi:kt.unproject(Li.add(In.mult(Yl(zu))).mult(mf));kt.setLocationAtPoint(kt.renderWorldCopies?Vf.wrap():Vf,Jt),We._fireMoveEvents(we)},function(){return We._afterEase(we)},ie),this},le.prototype.isEasing=function(){return!!this._easeFrameId},le.prototype.stop=function(){return this._stop()},le.prototype._stop=function(ie,we){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var We=this._onEaseEnd;delete this._onEaseEnd,We.call(this,we)}if(!ie){var gt=this.handlers;gt&>.stop(!1)}return this},le.prototype._ease=function(ie,we,We){We.animate===!1||We.duration===0?(ie(1),we()):(this._easeStart=i.browser.now(),this._easeOptions=We,this._onEaseFrame=ie,this._onEaseEnd=we,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},le.prototype._renderFrameCallback=function(){var ie=Math.min((i.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(ie)),ie<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},le.prototype._normalizeBearing=function(ie,we){ie=i.wrap(ie,-180,180);var We=Math.abs(ie-we);return Math.abs(ie-360-we)180?-360:We<-180?360:0}},le}(i.Evented),Nn=function(K){K===void 0&&(K={}),this.options=K,i.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Nn.prototype.getDefaultPosition=function(){return"bottom-right"},Nn.prototype.onAdd=function(K){var le=this.options&&this.options.compact;return this._map=K,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=a.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),le&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),le===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Nn.prototype.onRemove=function(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Nn.prototype._setElementTitle=function(K,le){var ie=this._map._getUIString("AttributionControl."+le);K.title=ie,K.setAttribute("aria-label",ie)},Nn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Nn.prototype._updateEditLink=function(){var K=this._editLink;K||(K=this._editLink=this._container.querySelector(".mapbox-improve-map"));var le=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||i.config.ACCESS_TOKEN}];if(K){var ie=le.reduce(function(we,We,gt){return We.value&&(we+=We.key+"="+We.value+(gt=0)return!1;return!0});var kt=K.join(" | ");kt!==this._attribHTML&&(this._attribHTML=kt,K.length?(this._innerContainer.innerHTML=kt,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Nn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bn=function(){i.bindAll(["_updateLogo"],this),i.bindAll(["_updateCompact"],this)};bn.prototype.onAdd=function(K){this._map=K,this._container=a.create("div","mapboxgl-ctrl");var le=a.create("a","mapboxgl-ctrl-logo");return le.target="_blank",le.rel="noopener nofollow",le.href="https://www.mapbox.com/",le.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),le.setAttribute("rel","noopener nofollow"),this._container.appendChild(le),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bn.prototype.onRemove=function(){a.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bn.prototype.getDefaultPosition=function(){return"bottom-left"},bn.prototype._updateLogo=function(K){(!K||K.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},bn.prototype._logoRequired=function(){if(this._map.style){var K=this._map.style.sourceCaches;for(var le in K){var ie=K[le].getSource();if(ie.mapbox_logo)return!0}return!1}},bn.prototype._updateCompact=function(){var K=this._container.children;if(K.length){var le=K[0];this._map.getCanvasContainer().offsetWidth<250?le.classList.add("mapboxgl-compact"):le.classList.remove("mapboxgl-compact")}};var Na=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Na.prototype.add=function(K){var le=++this._id,ie=this._queue;return ie.push({callback:K,id:le,cancelled:!1}),le},Na.prototype.remove=function(K){for(var le=this._currentlyRunning,ie=le?this._queue.concat(le):this._queue,we=0,We=ie;wewe.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(we.minPitch!=null&&we.maxPitch!=null&&we.minPitch>we.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(we.minPitch!=null&&we.minPitchla)throw new Error("maxPitch must be less than or equal to "+la);var gt=new Js(we.minZoom,we.maxZoom,we.minPitch,we.maxPitch,we.renderWorldCopies);if(K.call(this,gt,we),this._interactive=we.interactive,this._maxTileCacheSize=we.maxTileCacheSize,this._failIfMajorPerformanceCaveat=we.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=we.preserveDrawingBuffer,this._antialias=we.antialias,this._trackResize=we.trackResize,this._bearingSnap=we.bearingSnap,this._refreshExpiredTiles=we.refreshExpiredTiles,this._fadeDuration=we.fadeDuration,this._crossSourceCollisions=we.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=we.collectResourceTiming,this._renderTaskQueue=new Na,this._controls=[],this._mapId=i.uniqueId(),this._locale=i.extend({},ka,we.locale),this._clickTolerance=we.clickTolerance,this._requestManager=new i.RequestManager(we.transformRequest,we.accessToken),typeof we.container=="string"){if(this._container=i.window.document.getElementById(we.container),!this._container)throw new Error("Container '"+we.container+"' not found.")}else if(we.container instanceof Rn)this._container=we.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(we.maxBounds&&this.setMaxBounds(we.maxBounds),i.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return We._update(!1)}),this.on("moveend",function(){return We._update(!1)}),this.on("zoom",function(){return We._update(!0)}),typeof i.window<"u"&&(i.window.addEventListener("online",this._onWindowOnline,!1),i.window.addEventListener("resize",this._onWindowResize,!1),i.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new an(this,we);var kt=typeof we.hash=="string"&&we.hash||void 0;this._hash=we.hash&&new wc(kt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:we.center,zoom:we.zoom,bearing:we.bearing,pitch:we.pitch}),we.bounds&&(this.resize(),this.fitBounds(we.bounds,i.extend({},we.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=we.localIdeographFontFamily,we.style&&this.setStyle(we.style,{localIdeographFontFamily:we.localIdeographFontFamily}),we.attributionControl&&this.addControl(new Nn({customAttribution:we.customAttribution})),this.addControl(new bn,we.logoPosition),this.on("style.load",function(){We.transform.unmodified&&We.jumpTo(We.style.stylesheet)}),this.on("data",function(Je){We._update(Je.dataType==="style"),We.fire(new i.Event(Je.dataType+"data",Je))}),this.on("dataloading",function(Je){We.fire(new i.Event(Je.dataType+"dataloading",Je))})}K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le;var ie={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return le.prototype._getMapId=function(){return this._mapId},le.prototype.addControl=function(we,We){if(We===void 0&&(we.getDefaultPosition?We=we.getDefaultPosition():We="top-right"),!we||!we.onAdd)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var gt=we.onAdd(this);this._controls.push(we);var kt=this._controlPositions[We];return We.indexOf("bottom")!==-1?kt.insertBefore(gt,kt.firstChild):kt.appendChild(gt),this},le.prototype.removeControl=function(we){if(!we||!we.onRemove)return this.fire(new i.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var We=this._controls.indexOf(we);return We>-1&&this._controls.splice(We,1),we.onRemove(this),this},le.prototype.hasControl=function(we){return this._controls.indexOf(we)>-1},le.prototype.resize=function(we){var We=this._containerDimensions(),gt=We[0],kt=We[1];this._resizeCanvas(gt,kt),this.transform.resize(gt,kt),this.painter.resize(gt,kt);var Je=!this._moving;return Je&&(this.stop(),this.fire(new i.Event("movestart",we)).fire(new i.Event("move",we))),this.fire(new i.Event("resize",we)),Je&&this.fire(new i.Event("moveend",we)),this},le.prototype.getBounds=function(){return this.transform.getBounds()},le.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},le.prototype.setMaxBounds=function(we){return this.transform.setMaxBounds(i.LngLatBounds.convert(we)),this._update()},le.prototype.setMinZoom=function(we){if(we=we??ja,we>=ja&&we<=this.transform.maxZoom)return this.transform.minZoom=we,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=we,this._update(),this.getZoom()>we&&this.setZoom(we),this;throw new Error("maxZoom must be greater than the current minZoom")},le.prototype.getMaxZoom=function(){return this.transform.maxZoom},le.prototype.setMinPitch=function(we){if(we=we??oa,we=oa&&we<=this.transform.maxPitch)return this.transform.minPitch=we,this._update(),this.getPitch()la)throw new Error("maxPitch must be less than or equal to "+la);if(we>=this.transform.minPitch)return this.transform.maxPitch=we,this._update(),this.getPitch()>we&&this.setPitch(we),this;throw new Error("maxPitch must be greater than the current minPitch")},le.prototype.getMaxPitch=function(){return this.transform.maxPitch},le.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},le.prototype.setRenderWorldCopies=function(we){return this.transform.renderWorldCopies=we,this._update()},le.prototype.project=function(we){return this.transform.locationPoint(i.LngLat.convert(we))},le.prototype.unproject=function(we){return this.transform.pointLocation(i.Point.convert(we))},le.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},le.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},le.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},le.prototype._createDelegatedListener=function(we,We,gt){var kt=this,Je;if(we==="mouseenter"||we==="mouseover"){var dt=!1,It=function(qt){var rr=kt.getLayer(We)?kt.queryRenderedFeatures(qt.point,{layers:[We]}):[];rr.length?dt||(dt=!0,gt.call(kt,new cr(we,kt,qt.originalEvent,{features:rr}))):dt=!1},ur=function(){dt=!1};return{layer:We,listener:gt,delegates:{mousemove:It,mouseout:ur}}}else if(we==="mouseleave"||we==="mouseout"){var er=!1,ar=function(qt){var rr=kt.getLayer(We)?kt.queryRenderedFeatures(qt.point,{layers:[We]}):[];rr.length?er=!0:er&&(er=!1,gt.call(kt,new cr(we,kt,qt.originalEvent)))},pr=function(qt){er&&(er=!1,gt.call(kt,new cr(we,kt,qt.originalEvent)))};return{layer:We,listener:gt,delegates:{mousemove:ar,mouseout:pr}}}else{var yr=function(qt){var rr=kt.getLayer(We)?kt.queryRenderedFeatures(qt.point,{layers:[We]}):[];rr.length&&(qt.features=rr,gt.call(kt,qt),delete qt.features)};return{layer:We,listener:gt,delegates:(Je={},Je[we]=yr,Je)}}},le.prototype.on=function(we,We,gt){if(gt===void 0)return K.prototype.on.call(this,we,We);var kt=this._createDelegatedListener(we,We,gt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[we]=this._delegatedListeners[we]||[],this._delegatedListeners[we].push(kt);for(var Je in kt.delegates)this.on(Je,kt.delegates[Je]);return this},le.prototype.once=function(we,We,gt){if(gt===void 0)return K.prototype.once.call(this,we,We);var kt=this._createDelegatedListener(we,We,gt);for(var Je in kt.delegates)this.once(Je,kt.delegates[Je]);return this},le.prototype.off=function(we,We,gt){var kt=this;if(gt===void 0)return K.prototype.off.call(this,we,We);var Je=function(dt){for(var It=dt[we],ur=0;ur180;){var kt=ie.locationPoint(K);if(kt.x>=0&&kt.y>=0&&kt.x<=ie.width&&kt.y<=ie.height)break;K.lng>ie.center.lng?K.lng-=360:K.lng+=360}return K}var us={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Kl(K,le,ie){var we=K.classList;for(var We in us)we.remove("mapboxgl-"+ie+"-anchor-"+We);we.add("mapboxgl-"+ie+"-anchor-"+le)}var zl=function(K){function le(ie,we){if(K.call(this),(ie instanceof i.window.HTMLElement||we)&&(ie=i.extend({element:ie},we)),i.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=ie&&ie.anchor||"center",this._color=ie&&ie.color||"#3FB1CE",this._scale=ie&&ie.scale||1,this._draggable=ie&&ie.draggable||!1,this._clickTolerance=ie&&ie.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=ie&&ie.rotation||0,this._rotationAlignment=ie&&ie.rotationAlignment||"auto",this._pitchAlignment=ie&&ie.pitchAlignment&&ie.pitchAlignment!=="auto"?ie.pitchAlignment:this._rotationAlignment,!ie||!ie.element){this._defaultMarker=!0,this._element=a.create("div"),this._element.setAttribute("aria-label","Map marker");var We=a.createNS("http://www.w3.org/2000/svg","svg"),gt=41,kt=27;We.setAttributeNS(null,"display","block"),We.setAttributeNS(null,"height",gt+"px"),We.setAttributeNS(null,"width",kt+"px"),We.setAttributeNS(null,"viewBox","0 0 "+kt+" "+gt);var Je=a.createNS("http://www.w3.org/2000/svg","g");Je.setAttributeNS(null,"stroke","none"),Je.setAttributeNS(null,"stroke-width","1"),Je.setAttributeNS(null,"fill","none"),Je.setAttributeNS(null,"fill-rule","evenodd");var dt=a.createNS("http://www.w3.org/2000/svg","g");dt.setAttributeNS(null,"fill-rule","nonzero");var It=a.createNS("http://www.w3.org/2000/svg","g");It.setAttributeNS(null,"transform","translate(3.0, 29.0)"),It.setAttributeNS(null,"fill","#000000");for(var ur=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],er=0,ar=ur;er=we}this._isDragging&&(this._pos=ie.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new i.Event("dragstart"))),this.fire(new i.Event("drag")))},le.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new i.Event("dragend")),this._state="inactive"},le.prototype._addDragHandler=function(ie){this._element.contains(ie.originalEvent.target)&&(ie.preventDefault(),this._positionDelta=ie.point.sub(this._pos).add(this._offset),this._pointerdownPos=ie.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},le.prototype.setDraggable=function(ie){return this._draggable=!!ie,this._map&&(ie?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},le.prototype.isDraggable=function(){return this._draggable},le.prototype.setRotation=function(ie){return this._rotation=ie||0,this._update(),this},le.prototype.getRotation=function(){return this._rotation},le.prototype.setRotationAlignment=function(ie){return this._rotationAlignment=ie||"auto",this._update(),this},le.prototype.getRotationAlignment=function(){return this._rotationAlignment},le.prototype.setPitchAlignment=function(ie){return this._pitchAlignment=ie&&ie!=="auto"?ie:this._rotationAlignment,this._update(),this},le.prototype.getPitchAlignment=function(){return this._pitchAlignment},le}(i.Evented),gs={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Pu;function kl(K){Pu!==void 0?K(Pu):i.window.navigator.permissions!==void 0?i.window.navigator.permissions.query({name:"geolocation"}).then(function(le){Pu=le.state!=="denied",K(Pu)}):(Pu=!!i.window.navigator.geolocation,K(Pu))}var Nu=0,kc=!1,Ec=function(K){function le(ie){K.call(this),this.options=i.extend({},gs,ie),i.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.onAdd=function(ie){return this._map=ie,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),kl(this._setupUI),this._container},le.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(i.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Nu=0,kc=!1},le.prototype._isOutOfMapMaxBounds=function(ie){var we=this._map.getMaxBounds(),We=ie.coords;return we&&(We.longitudewe.getEast()||We.latitudewe.getNorth())},le.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break}},le.prototype._onSuccess=function(ie){if(this._map){if(this._isOutOfMapMaxBounds(ie)){this._setErrorState(),this.fire(new i.Event("outofmaxbounds",ie)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=ie,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(ie),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(ie),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("geolocate",ie)),this._finish()}},le.prototype._updateCamera=function(ie){var we=new i.LngLat(ie.coords.longitude,ie.coords.latitude),We=ie.coords.accuracy,gt=this._map.getBearing(),kt=i.extend({bearing:gt},this.options.fitBoundsOptions);this._map.fitBounds(we.toBounds(We),kt,{geolocateSource:!0})},le.prototype._updateMarker=function(ie){if(ie){var we=new i.LngLat(ie.coords.longitude,ie.coords.latitude);this._accuracyCircleMarker.setLngLat(we).addTo(this._map),this._userLocationDotMarker.setLngLat(we).addTo(this._map),this._accuracy=ie.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},le.prototype._updateCircleRadius=function(){var ie=this._map._container.clientHeight/2,we=this._map.unproject([0,ie]),We=this._map.unproject([1,ie]),gt=we.distanceTo(We),kt=Math.ceil(2*this._accuracy/gt);this._circleElement.style.width=kt+"px",this._circleElement.style.height=kt+"px"},le.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},le.prototype._onError=function(ie){if(this._map){if(this.options.trackUserLocation)if(ie.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var we=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=we,this._geolocateButton.setAttribute("aria-label",we),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(ie.code===3&&kc)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new i.Event("error",ie)),this._finish()}},le.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},le.prototype._setupUI=function(ie){var we=this;if(this._container.addEventListener("contextmenu",function(kt){return kt.preventDefault()}),this._geolocateButton=a.create("button","mapboxgl-ctrl-geolocate",this._container),a.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",ie===!1){i.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var We=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=We,this._geolocateButton.setAttribute("aria-label",We)}else{var gt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=gt,this._geolocateButton.setAttribute("aria-label",gt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new zl(this._dotElement),this._circleElement=a.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new zl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(kt){var Je=kt.originalEvent&&kt.originalEvent.type==="resize";!kt.geolocateSource&&we._watchState==="ACTIVE_LOCK"&&!Je&&(we._watchState="BACKGROUND",we._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),we._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),we.fire(new i.Event("trackuserlocationend")))})},le.prototype.trigger=function(){if(!this._setup)return i.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new i.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Nu--,kc=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new i.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new i.Event("trackuserlocationstart"));break}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Nu++;var ie;Nu>1?(ie={maximumAge:6e5,timeout:0},kc=!0):(ie=this.options.positionOptions,kc=!1),this._geolocationWatchID=i.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,ie)}}else i.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},le.prototype._clearWatch=function(){i.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},le}(i.Evented),Au={maxWidth:100,unit:"metric"},wu=function(K){this.options=i.extend({},Au,K),i.bindAll(["_onMove","setUnit"],this)};wu.prototype.getDefaultPosition=function(){return"bottom-left"},wu.prototype._onMove=function(){Iu(this._map,this._container,this.options)},wu.prototype.onAdd=function(K){return this._map=K,this._container=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",K.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},wu.prototype.onRemove=function(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},wu.prototype.setUnit=function(K){this.options.unit=K,Iu(this._map,this._container,this.options)};function Iu(K,le,ie){var we=ie&&ie.maxWidth||100,We=K._container.clientHeight/2,gt=K.unproject([0,We]),kt=K.unproject([we,We]),Je=gt.distanceTo(kt);if(ie&&ie.unit==="imperial"){var dt=3.2808*Je;if(dt>5280){var It=dt/5280;Zo(le,we,It,K._getUIString("ScaleControl.Miles"))}else Zo(le,we,dt,K._getUIString("ScaleControl.Feet"))}else if(ie&&ie.unit==="nautical"){var ur=Je/1852;Zo(le,we,ur,K._getUIString("ScaleControl.NauticalMiles"))}else Je>=1e3?Zo(le,we,Je/1e3,K._getUIString("ScaleControl.Kilometers")):Zo(le,we,Je,K._getUIString("ScaleControl.Meters"))}function Zo(K,le,ie,we){var We=vl(ie),gt=We/ie;K.style.width=le*gt+"px",K.innerHTML=We+" "+we}function Du(K){var le=Math.pow(10,Math.ceil(-Math.log(K)/Math.LN10));return Math.round(K*le)/le}function vl(K){var le=Math.pow(10,(""+Math.floor(K)).length-1),ie=K/le;return ie=ie>=10?10:ie>=5?5:ie>=3?3:ie>=2?2:ie>=1?1:Du(ie),le*ie}var ju=function(K){this._fullscreen=!1,K&&K.container&&(K.container instanceof i.window.HTMLElement?this._container=K.container:i.warnOnce("Full screen control 'container' must be a DOM element.")),i.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in i.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in i.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in i.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in i.window.document&&(this._fullscreenchange="MSFullscreenChange")};ju.prototype.onAdd=function(K){return this._map=K,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",i.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ju.prototype.onRemove=function(){a.remove(this._controlContainer),this._map=null,i.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ju.prototype._checkFullscreenSupport=function(){return!!(i.window.document.fullscreenEnabled||i.window.document.mozFullScreenEnabled||i.window.document.msFullscreenEnabled||i.window.document.webkitFullscreenEnabled)},ju.prototype._setupUI=function(){var K=this._fullscreenButton=a.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);a.create("span","mapboxgl-ctrl-icon",K).setAttribute("aria-hidden",!0),K.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),i.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ju.prototype._updateTitle=function(){var K=this._getTitle();this._fullscreenButton.setAttribute("aria-label",K),this._fullscreenButton.title=K},ju.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ju.prototype._isFullscreen=function(){return this._fullscreen},ju.prototype._changeIcon=function(){var K=i.window.document.fullscreenElement||i.window.document.mozFullScreenElement||i.window.document.webkitFullscreenElement||i.window.document.msFullscreenElement;K===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ju.prototype._onClickFullscreen=function(){this._isFullscreen()?i.window.document.exitFullscreen?i.window.document.exitFullscreen():i.window.document.mozCancelFullScreen?i.window.document.mozCancelFullScreen():i.window.document.msExitFullscreen?i.window.document.msExitFullscreen():i.window.document.webkitCancelFullScreen&&i.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Lc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),zs=function(K){function le(ie){K.call(this),this.options=i.extend(Object.create(Lc),ie),i.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return K&&(le.__proto__=K),le.prototype=Object.create(K&&K.prototype),le.prototype.constructor=le,le.prototype.addTo=function(ie){return this._map&&this.remove(),this._map=ie,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new i.Event("open")),this},le.prototype.isOpen=function(){return!!this._map},le.prototype.remove=function(){return this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new i.Event("close")),this},le.prototype.getLngLat=function(){return this._lngLat},le.prototype.setLngLat=function(ie){return this._lngLat=i.LngLat.convert(ie),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},le.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},le.prototype.getElement=function(){return this._container},le.prototype.setText=function(ie){return this.setDOMContent(i.window.document.createTextNode(ie))},le.prototype.setHTML=function(ie){var we=i.window.document.createDocumentFragment(),We=i.window.document.createElement("body"),gt;for(We.innerHTML=ie;gt=We.firstChild,!!gt;)we.appendChild(gt);return this.setDOMContent(we)},le.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},le.prototype.setMaxWidth=function(ie){return this.options.maxWidth=ie,this._update(),this},le.prototype.setDOMContent=function(ie){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(ie),this._createCloseButton(),this._update(),this._focusFirstElement(),this},le.prototype.addClassName=function(ie){this._container&&this._container.classList.add(ie)},le.prototype.removeClassName=function(ie){this._container&&this._container.classList.remove(ie)},le.prototype.setOffset=function(ie){return this.options.offset=ie,this._update(),this},le.prototype.toggleClassName=function(ie){if(this._container)return this._container.classList.toggle(ie)},le.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=a.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},le.prototype._onMouseUp=function(ie){this._update(ie.point)},le.prototype._onMouseMove=function(ie){this._update(ie.point)},le.prototype._onDrag=function(ie){this._update(ie.point)},le.prototype._update=function(ie){var we=this,We=this._lngLat||this._trackPointer;if(!(!this._map||!We||!this._content)&&(this._container||(this._container=a.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=a.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(ar){return we._container.classList.add(ar)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ro(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!ie))){var gt=this._pos=this._trackPointer&&ie?ie:this._map.project(this._lngLat),kt=this.options.anchor,Je=Ol(this.options.offset);if(!kt){var dt=this._container.offsetWidth,It=this._container.offsetHeight,ur;gt.y+Je.bottom.ythis._map.transform.height-It?ur=["bottom"]:ur=[],gt.x
this._map.transform.width-dt/2&&ur.push("right"),ur.length===0?kt="bottom":kt=ur.join("-")}var er=gt.add(Je[kt]).round();a.setTransform(this._container,us[kt]+" translate("+er.x+"px,"+er.y+"px)"),Kl(this._container,kt,"popup")}},le.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var ie=this._container.querySelector(Fo);ie&&ie.focus()}},le.prototype._onClose=function(){this.remove()},le}(i.Evented);function Ol(K){if(K)if(typeof K=="number"){var le=Math.round(Math.sqrt(.5*Math.pow(K,2)));return{center:new i.Point(0,0),top:new i.Point(0,K),"top-left":new i.Point(le,le),"top-right":new i.Point(-le,le),bottom:new i.Point(0,-K),"bottom-left":new i.Point(le,-le),"bottom-right":new i.Point(-le,-le),left:new i.Point(K,0),right:new i.Point(-K,0)}}else if(K instanceof i.Point||Array.isArray(K)){var ie=i.Point.convert(K);return{center:ie,top:ie,"top-left":ie,"top-right":ie,bottom:ie,"bottom-left":ie,"bottom-right":ie,left:ie,right:ie}}else return{center:i.Point.convert(K.center||[0,0]),top:i.Point.convert(K.top||[0,0]),"top-left":i.Point.convert(K["top-left"]||[0,0]),"top-right":i.Point.convert(K["top-right"]||[0,0]),bottom:i.Point.convert(K.bottom||[0,0]),"bottom-left":i.Point.convert(K["bottom-left"]||[0,0]),"bottom-right":i.Point.convert(K["bottom-right"]||[0,0]),left:i.Point.convert(K.left||[0,0]),right:i.Point.convert(K.right||[0,0])};else return Ol(new i.Point(0,0))}var Ml={version:i.version,supported:n,setRTLTextPlugin:i.setRTLTextPlugin,getRTLTextPluginStatus:i.getRTLTextPluginStatus,Map:$o,NavigationControl:qa,GeolocateControl:Ec,AttributionControl:Nn,ScaleControl:wu,FullscreenControl:ju,Popup:zs,Marker:zl,Style:pc,LngLat:i.LngLat,LngLatBounds:i.LngLatBounds,Point:i.Point,MercatorCoordinate:i.MercatorCoordinate,Evented:i.Evented,config:i.config,prewarm:io,clearPrewarmedResources:Ft,get accessToken(){return i.config.ACCESS_TOKEN},set accessToken(K){i.config.ACCESS_TOKEN=K},get baseApiUrl(){return i.config.API_URL},set baseApiUrl(K){i.config.API_URL=K},get workerCount(){return Jn.workerCount},set workerCount(K){Jn.workerCount=K},get maxParallelImageRequests(){return i.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(K){i.config.MAX_PARALLEL_IMAGE_REQUESTS=K},clearStorage:function(K){i.clearTileCache(K)},workerUrl:""};return Ml}),z})}),VQ=ze((te,Y)=>{var d=ji(),y=cc().sanitizeHTML,z=sz(),P=dy();function i(u,s){this.subplot=u,this.uid=u.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var n=i.prototype;n.update=function(u){this.visible?this.needsNewImage(u)?this.updateImage(u):this.needsNewSource(u)?(this.removeLayer(),this.updateSource(u),this.updateLayer(u)):this.needsNewLayer(u)?this.updateLayer(u):this.updateStyle(u):(this.updateSource(u),this.updateLayer(u)),this.visible=a(u)},n.needsNewImage=function(u){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&u.sourcetype==="image"&&(this.source!==u.source||JSON.stringify(this.coordinates)!==JSON.stringify(u.coordinates))},n.needsNewSource=function(u){return this.sourceType!==u.sourcetype||JSON.stringify(this.source)!==JSON.stringify(u.source)||this.layerType!==u.type},n.needsNewLayer=function(u){return this.layerType!==u.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},n.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},n.updateImage=function(u){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:u.source,coordinates:u.coordinates});var h=this.findFollowingMapboxLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},n.updateSource=function(u){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=u.sourcetype,this.source=u.source,!!a(u)){var h=o(u);s.addSource(this.idSource,h)}},n.findFollowingMapboxLayerId=function(u){if(u==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(u){var s={},h={};switch(u.type){case"circle":d.extendFlat(h,{"circle-radius":u.circle.radius,"circle-color":u.color,"circle-opacity":u.opacity});break;case"line":d.extendFlat(h,{"line-width":u.line.width,"line-color":u.color,"line-opacity":u.opacity,"line-dasharray":u.line.dash});break;case"fill":d.extendFlat(h,{"fill-color":u.color,"fill-outline-color":u.fill.outlinecolor,"fill-opacity":u.opacity});break;case"symbol":var m=u.symbol,b=z(m.textposition,m.iconsize);d.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),d.extendFlat(h,{"icon-color":u.color,"text-color":m.textfont.color,"text-opacity":u.opacity});break;case"raster":d.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":u.opacity});break}return{layout:s,paint:h}}function o(u){var s=u.sourcetype,h=u.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=u.coordinates),m[b]=h,u.sourceattribution&&(m.attribution=y(u.sourceattribution)),m}Y.exports=function(u,s,h){var m=new i(u,s);return m.update(h),m}}),WQ=ze((te,Y)=>{var d=lz(),y=ji(),z=W_(),P=as(),i=Os(),n=jp(),a=hf(),l=dm(),o=l.drawMode,u=l.selectMode,s=Ef().prepSelect,h=Ef().clearOutline,m=Ef().clearSelectionsCache,b=Ef().selectOnClick,x=dy(),_=VQ();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=A.prototype;f.plot=function(I,M,p){var g=this,C=M[g.id];g.map&&C.accesstoken!==g.accessToken&&(g.map.remove(),g.map=null,g.styleObj=null,g.traceHash={},g.layerList=[]);var T;g.map?T=new Promise(function(N,B){g.updateMap(I,M,N,B)}):T=new Promise(function(N,B){g.createMap(I,M,N,B)}),p.push(T)},f.createMap=function(I,M,p,g){var C=this,T=M[C.id],N=C.styleObj=w(T.style,M);C.accessToken=T.accesstoken;var B=T.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new d.Map({container:C.div,style:N.style,center:E(T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var W=[];W.push(new Promise(function(F){V.once("load",F)})),W=W.concat(z.fetchTraceGeoData(I)),Promise.all(W).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.updateMap=function(I,M,p,g){var C=this,T=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style,M);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,T.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){T.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,T,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},f.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var T=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),u(T)||o(T)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,T)},n.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},f.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},f.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var d=ji(),y=z_(),z=Zd(),P=z6();Y.exports=function(a,l,o){y(a,l,o,{type:"mapbox",attributes:P,handleDefaults:i,partition:"y",accessToken:l._mapboxAccessToken})};function i(a,l,o,u){o("accesstoken",u.accessToken),o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var s=o("bounds.west"),h=o("bounds.east"),m=o("bounds.south"),b=o("bounds.north");(s===void 0||h===void 0||m===void 0||b===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:n}),l._input=a}function n(a,l){function o(x,_){return d.coerce(a,l,P.layers,x,_)}var u=o("visible");if(u){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",d.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),d.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),dA=ze(te=>{var Y=lz(),d=ji(),y=d.strTranslate,z=d.strScale,P=Ed().getSubplotCalcData,i=k0(),n=ri(),a=Zs(),l=cc(),o=WQ(),u="mapbox",s=te.constants=dy();te.name=u,te.attr="subplot",te.idRoot=u,te.idRegex=te.attrRegex=d.counterRegex(u);var h=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");te.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},te.layoutAttributes=z6(),te.supplyLayoutDefaults=qQ();var m=!0;te.plot=function(_){m&&(m=!1,d.warn(h));var A=_._fullLayout,f=_.calcdata,k=A._subplots[u];if(Y.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var w=b(_,k);Y.accessToken=w;for(var D=0;DW/2){var F=N.split("|").join("
");U.text(F).attr("data-unformatted",F).call(l.convertToTspans,_),V=a.bBox(U.node())}U.attr("transform",y(-3,-V.height+8)),B.insert("rect",".static-attribution").attr({x:-V.width-6,y:-V.height-3,width:V.width+6,height:V.height+3,fill:"rgba(255, 255, 255, 0.75)"});var H=1;V.width+6>W&&(H=W/(V.width+6));var q=[k.l+k.w*E.x[1],k.t+k.h*(1-E.y[0])];B.attr("transform",y(q[0],q[1])+z(H))}};function b(_,A){var f=_._fullLayout,k=_._context;if(k.mapboxAccessToken==="")return"";for(var w=[],D=[],E=!1,I=!1,M=0;M1&&d.warn(s.multipleTokensErrorMsg),w[0]):(D.length&&d.log(["Listed mapbox access token(s)",D.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function x(_){return typeof _=="string"&&(s.styleValuesMapbox.indexOf(_)!==-1||_.indexOf("mapbox://")===0||_.indexOf("stamen")===0)}te.updateFx=function(_){for(var A=_._fullLayout,f=A._subplots[u],k=0;k{Y.exports={attributes:hA(),supplyDefaults:NQ(),colorbar:Mo(),formatLabels:oz(),calc:WC(),plot:UQ(),hoverPoints:fA().hoverPoints,eventData:$Q(),selectPoints:HQ(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermapbox",basePlotModule:dA(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}),ZQ=ze((te,Y)=>{Y.exports=GQ()}),uz=ze((te,Y)=>{var d=qw(),y=Oc(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=xa(),n=nn().extendFlat;Y.exports=n({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:n({},d.featureidkey,{}),below:{valType:"string",editType:"plot"},text:d.text,hovertext:d.hovertext,marker:{line:{color:n({},d.marker.line.color,{editType:"plot"}),width:n({},d.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:n({},d.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:n({},d.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n({},d.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:d.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:n({},i.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),KQ=ze((te,Y)=>{var d=ji(),y=Cc(),z=uz();Y.exports=function(P,i,n,a){function l(m,b){return d.coerce(P,i,z,m,b)}var o=l("locations"),u=l("z"),s=l("geojson");if(!d.isArrayOrTypedArray(o)||!o.length||!d.isArrayOrTypedArray(u)||!u.length||!(typeof s=="string"&&s!==""||d.isPlainObject(s))){i.visible=!1;return}l("featureidkey"),i._length=Math.min(o.length,u.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,i,a,l,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(i,l)}}),cz=ze((te,Y)=>{var d=Sr(),y=ji(),z=lh(),P=Zs(),i=V_().makeBlank,n=W_();function a(o){var u=o[0].trace,s=u.visible===!0&&u._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=u._opts={fill:h,line:m,geojson:i()};if(!s)return b;var x=n.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(u),A=u.marker,f=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var T=C.mo;return d(T)?+y.constrain(T,0,1):0});var w;y.isArrayOrTypedArray(f.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(f.width)&&(D=function(C){return C.mlw});for(var E=0;E{var d=cz().convert,y=cz().convertOnSelect,z=dy().traceLayerPrefix;function P(n,a){this.type="choroplethmapbox",this.subplot=n,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var i=P.prototype;i.update=function(n){this._update(d(n)),n[0].trace._glTrace=this},i.updateOnSelect=function(n){this._update(y(n))},i._update=function(n){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(n.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(n,o),this.below=o);for(var u=0;u=0;l--)n.removeLayer(a[l][1])},i.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,a){var l=a[0].trace,o=new P(n,l.uid),u=o.sourceId,s=d(a),h=o.below=n.belowLookup["trace-"+l.uid];return n.map.addSource(u,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),XQ=ze((te,Y)=>{Y.exports={attributes:uz(),supplyDefaults:KQ(),colorbar:D_(),calc:KC(),plot:YQ(),hoverPoints:XC(),eventData:JC(),selectPoints:QC(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(d,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var i=z[P].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var n=P+1;n{Y.exports=XQ()}),hz=ze((te,Y)=>{var d=Oc(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=xa(),i=hA(),n=nn().extendFlat;Y.exports=n({lon:i.lon,lat:i.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:i.text,hovertext:i.hovertext,hoverinfo:n({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:n({},P.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),QQ=ze((te,Y)=>{var d=ji(),y=Cc(),z=hz();Y.exports=function(P,i,n,a){function l(h,m){return d.coerce(P,i,z,h,m)}var o=l("lon")||[],u=l("lat")||[],s=Math.min(o.length,u.length);if(!s){i.visible=!1;return}i._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,i,a,l,{prefix:"",cLetter:"z"})}}),eee=ze((te,Y)=>{var d=Sr(),y=ji().isArrayOrTypedArray,z=ei().BADNUM,P=Tp(),i=ji()._;Y.exports=function(n,a){for(var l=a._length,o=new Array(l),u=a.z,s=y(u)&&u.length,h=0;h{var d=Sr(),y=ji(),z=Xi(),P=lh(),i=ei().BADNUM,n=V_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,u={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:u,geojson:n()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var d=tee(),y=dy().traceLayerPrefix;function z(i,n){this.type="densitymapbox",this.subplot=i,this.uid=n,this.sourceId="source-"+n,this.layerList=[["heatmap",y+n+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(i){var n=this.subplot,a=this.layerList,l=d(i),o=n.belowLookup["trace-"+this.uid];n.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var u=0;u=0;a--)i.removeLayer(n[a][1])},P.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,n){var a=n[0].trace,l=new z(i,a.uid),o=l.sourceId,u=d(n),s=l.below=i.belowLookup["trace-"+a.uid];return i.map.addSource(o,{type:"geojson",data:u.geojson}),l._addLayers(u,s),l}}),iee=ze((te,Y)=>{var d=Os(),y=fA().hoverPoints,z=fA().getExtraText;Y.exports=function(P,i,n){var a=y(P,i,n);if(a){var l=a[0],o=l.cd,u=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(u,s,o[0].t.labels),[l]}}}),nee=ze((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d.z=y.z,d}}),aee=ze((te,Y)=>{Y.exports={attributes:hz(),supplyDefaults:QQ(),colorbar:D_(),formatLabels:oz(),calc:eee(),plot:ree(),hoverPoints:iee(),eventData:nee(),getBelow:function(d,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=aee()}),see=ze((te,Y)=>{Y.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} {name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} @@ -3341,10 +3341,10 @@ uniform `+lr+" "+Qt+" u_"+ar+`; {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} {name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} -{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),aee=Fe((te,Y)=>{Y.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),W_=Fe((te,Y)=>{var d=Ym(),y=nee(),z=aee(),P='© OpenStreetMap contributors',i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",u="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",s={basic:a,streets:a,outdoors:a,light:i,dark:n,satellite:z,"satellite-streets":y,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:P,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":n,"carto-voyager":a,"carto-positron-nolabels":l,"carto-darkmatter-nolabels":o,"carto-voyager-nolabels":u},h=d(s);Y.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:h,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",h.join(", "),"or use a tile service."].join(` -`),mapOnErrorMsg:"Map error."}}),D6=Fe((te,Y)=>{var d=ji(),y=Xi().defaultLine,z=Xh().attributes,P=zn(),i=ff().textposition,n=oh().overrideAll,a=ku().templatedArray,l=W_(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var u=Y.exports=n({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:z({name:"map"}),style:{valType:"any",values:l.styleValuesMap,dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:d.extendFlat({},i,{arrayOk:!1})}})},"plot","from-root");u.uirevision={valType:"any",editType:"none"}}),fA=Fe((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=Eb(),n=ff(),a=D6(),l=_a(),o=zc(),u=an().extendFlat,s=oh().overrideAll,h=D6(),m=i.line,b=i.marker;Y.exports=s({lon:i.lon,lat:i.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},b.opacity,{dflt:1})},mode:u({},n.mode,{dflt:"markers"}),text:u({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:u({},n.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:n.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:i.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:n.selected.marker},unselected:{marker:n.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),cz=Fe((te,Y)=>{var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return d.indexOf(y)!==-1}}}),oee=Fe((te,Y)=>{var d=ji(),y=Oc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=fA(),l=cz().isSupportedFont;Y.exports=function(u,s,h,m){function b(g,C){return d.coerce(u,s,a,g,C)}function x(g,C){return d.coerce2(u,s,a,g,C)}var _=o(u,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(u,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(d.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),d.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(u,s,h,m,b,{noDash:!0}),b("connectgaps"));var f=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=f!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;i(u,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&n(u,s,h,b),d.coerceSelectionMarkerOpacity(s,b)};function o(u,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),hz=Fe((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),fz=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=y.split(" "),i=P[0],n=P[1],a=d.isArrayOrTypedArray(z)?d.mean(z):z,l=.5+a/100,o=1.5+a/100,u=["",""],s=[0,0];switch(i){case"top":u[0]="top",s[1]=-o;break;case"bottom":u[0]="bottom",s[1]=o;break}switch(n){case"left":u[1]="right",s[0]=-l;break;case"right":u[1]="left",s[0]=l;break}var h;return u[0]&&u[1]?h=u.join("-"):u[0]?h=u[0]:u[1]?h=u[1]:h="center",{anchor:h,offset:s}}}),see=Fe((te,Y)=>{var d=Ar(),y=ji(),z=ti().BADNUM,P=j_(),i=lh(),n=Zs(),a=Hv(),l=Oc(),o=cz().isSupportedFont,u=fz(),s=T0().appendArrayPointValue,h=cc().NEWLINES,m=cc().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),T=l.hasMarkers(M),N=l.hasText(M),B=T&&M.marker.symbol==="circle",U=T&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),$=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:$,symbol:q};if(!p)return G;var ee;if((g||C)&&(ee=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(ee),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(ee),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var he=x(I);$.geojson=he.geojson,$.layout.visibility="visible",V&&($.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat($.paint,{"circle-color":he.mcc,"circle-radius":he.mrc,"circle-opacity":he.mo})}if(B&&V&&($.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var xe=(M.marker||{}).size,ve=u(M.textposition,xe);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),T=y.isArrayOrTypedArray(M.opacity),N;function B(ve){return I.opacity*ve}function U(ve){return ve/2}var V;g&&(i.hasColorscale(I,"marker")?V=i.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;T&&(F=function(ve){var ce=d(ve)?+y.constrain(ve,0,1):0;return B(ce)});var $=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),T&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),lee=Fe((te,Y)=>{var d=ji(),y=see(),z=W_().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function i(a,l,o,u){this.type="scattermap",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=u,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var n=i.prototype;n.addSource=function(a,l,o){var u={type:"geojson",data:l.geojson};o&&o.enabled&&d.extendFlat(u,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],u)},n.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},n.addLayer=function(a,l,o){var u={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(u.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var T=g[C];u.removeLayer(x.layerIds[T])}p||u.removeSource(x.sourceIds.circle)}function f(p){for(var g=P.nonCluster,C=0;C=0;C--){var T=g[C];u.removeLayer(x.layerIds[T]),p||u.removeSource(x.sourceIds[T])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):f(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var u=l[o];a.removeLayer(this.layerIds[u]),a.removeSource(this.sourceIds[u])}},Y.exports=function(a,l){var o=l[0].trace,u=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new i(a,o.uid,u,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(u)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var d=hf(),y=ji(),z=qu(),P=y.fillText,i=ti().BADNUM,n=W_().traceLayerPrefix;function a(o,u,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],f=n+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[f]});A=w.map(function(W){return W.id})}var D=u>=0?Math.floor((u+180)/360):Math.ceil((u-180)/360),E=D*360,I=u-E;function M(W){var F=W.lonlat;if(F[0]===i||k&&A.indexOf(W.i+1)===-1)return 1/0;var $=y.modHalf(F[0],360),q=F[1],G=_.project([$,q]),ee=G.x-b.c2p([I,q]),he=G.y-x.c2p([$,s]),xe=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(ee*ee+he*he)-xe,1-3/xe)}if(d.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],T=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=T-B,o.x1=T+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,u,s){if(o.hovertemplate)return;var h=u.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=u.lonlat,f=[];function k(w){return w+"°"}return b||x&&_?f.push("("+k(A[1])+", "+k(A[0])+")"):x?f.push(s.lon+k(A[0])):_&&f.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(u,o,f),f.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),uee=Fe((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d}}),cee=Fe((te,Y)=>{var d=ji(),y=Oc(),z=ti().BADNUM;Y.exports=function(P,i){var n=P.cd,a=P.xaxis,l=P.yaxis,o=[],u=n[0].trace,s;if(!y.hasMarkers(u))return[];if(i===!1)for(s=0;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():(d=typeof globalThis<"u"?globalThis:d||self,d.maplibregl=y())})(te,function(){var d={},y={};function z(i,n,a){if(y[i]=a,i==="index"){var l="var sharedModule = {}; ("+y.shared+")(sharedModule); ("+y.worker+")(sharedModule);",o={};return y.shared(o),y.index(d,o),typeof window<"u"&&d.setWorkerUrl(window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))),d}}z("shared",["exports"],function(i){function n(X,R,ae,ke){return new(ae||(ae=Promise))(function(Ue,et){function it(or){try{$t(ke.next(or))}catch(Sr){et(Sr)}}function Ct(or){try{$t(ke.throw(or))}catch(Sr){et(Sr)}}function $t(or){var Sr;or.done?Ue(or.value):(Sr=or.value,Sr instanceof ae?Sr:new ae(function(Rr){Rr(Sr)})).then(it,Ct)}$t((ke=ke.apply(X,R||[])).next())})}function a(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}typeof SuppressedError=="function"&&SuppressedError;var l=o;function o(X,R){this.x=X,this.y=R}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(X){return this.clone()._add(X)},sub:function(X){return this.clone()._sub(X)},multByPoint:function(X){return this.clone()._multByPoint(X)},divByPoint:function(X){return this.clone()._divByPoint(X)},mult:function(X){return this.clone()._mult(X)},div:function(X){return this.clone()._div(X)},rotate:function(X){return this.clone()._rotate(X)},rotateAround:function(X,R){return this.clone()._rotateAround(X,R)},matMult:function(X){return this.clone()._matMult(X)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(X){return this.x===X.x&&this.y===X.y},dist:function(X){return Math.sqrt(this.distSqr(X))},distSqr:function(X){var R=X.x-this.x,ae=X.y-this.y;return R*R+ae*ae},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(X){return Math.atan2(this.y-X.y,this.x-X.x)},angleWith:function(X){return this.angleWithSep(X.x,X.y)},angleWithSep:function(X,R){return Math.atan2(this.x*R-this.y*X,this.x*X+this.y*R)},_matMult:function(X){var R=X[2]*this.x+X[3]*this.y;return this.x=X[0]*this.x+X[1]*this.y,this.y=R,this},_add:function(X){return this.x+=X.x,this.y+=X.y,this},_sub:function(X){return this.x-=X.x,this.y-=X.y,this},_mult:function(X){return this.x*=X,this.y*=X,this},_div:function(X){return this.x/=X,this.y/=X,this},_multByPoint:function(X){return this.x*=X.x,this.y*=X.y,this},_divByPoint:function(X){return this.x/=X.x,this.y/=X.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var X=this.y;return this.y=this.x,this.x=-X,this},_rotate:function(X){var R=Math.cos(X),ae=Math.sin(X),ke=ae*this.x+R*this.y;return this.x=R*this.x-ae*this.y,this.y=ke,this},_rotateAround:function(X,R){var ae=Math.cos(X),ke=Math.sin(X),Ue=R.y+ke*(this.x-R.x)+ae*(this.y-R.y);return this.x=R.x+ae*(this.x-R.x)-ke*(this.y-R.y),this.y=Ue,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(X){return X instanceof o?X:Array.isArray(X)?new o(X[0],X[1]):X};var u=a(l),s=h;function h(X,R,ae,ke){this.cx=3*X,this.bx=3*(ae-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(ke-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=ae,this.p2y=ke}h.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var ae=X,ke=0;ke<8;ke++){var Ue=this.sampleCurveX(ae)-X;if(Math.abs(Ue)Ue?it=ae:Ct=ae,ae=.5*(Ct-it)+it;return ae},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var m=a(s);let b,x;function _(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function A(){if(x==null&&(x=!1,_())){let X=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(X){for(let ae=0;ae<25;ae++){let ke=4*ae;X.fillStyle=`rgb(${ke},${ke+1},${ke+2})`,X.fillRect(ae%5,Math.floor(ae/5),1,1)}let R=X.getImageData(0,0,5,5).data;for(let ae=0;ae<100;ae++)if(ae%4!=3&&R[ae]!==ae){x=!0;break}}}return x||!1}function f(X,R,ae,ke){let Ue=new m(X,R,ae,ke);return et=>Ue.solve(et)}let k=f(.25,.1,.25,1);function w(X,R,ae){return Math.min(ae,Math.max(R,X))}function D(X,R,ae){let ke=ae-R,Ue=((X-R)%ke+ke)%ke+R;return Ue===R?ae:Ue}function E(X,...R){for(let ae of R)for(let ke in ae)X[ke]=ae[ke];return X}let I=1;function M(X,R,ae){let ke={};for(let Ue in X)ke[Ue]=R.call(this,X[Ue],Ue,X);return ke}function p(X,R,ae){let ke={};for(let Ue in X)R.call(this,X[Ue],Ue,X)&&(ke[Ue]=X[Ue]);return ke}function g(X){return Array.isArray(X)?X.map(g):typeof X=="object"&&X?M(X,g):X}let C={};function T(X){C[X]||(typeof console<"u"&&console.warn(X),C[X]=!0)}function N(X,R,ae){return(ae.y-X.y)*(R.x-X.x)>(R.y-X.y)*(ae.x-X.x)}function B(X){return typeof WorkerGlobalScope<"u"&&X!==void 0&&X instanceof WorkerGlobalScope}let U=null;function V(X){return typeof ImageBitmap<"u"&&X instanceof ImageBitmap}let W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function F(X,R,ae,ke,Ue){return n(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let et=new VideoFrame(X,{timestamp:0});try{let it=et?.format;if(!it||!it.startsWith("BGR")&&!it.startsWith("RGB"))throw new Error(`Unrecognized format ${it}`);let Ct=it.startsWith("BGR"),$t=new Uint8ClampedArray(ke*Ue*4);if(yield et.copyTo($t,function(or,Sr,Rr,ai,bi){let Fi=4*Math.max(-Sr,0),Gi=(Math.max(0,Rr)-Rr)*ai*4+Fi,pn=4*ai,jn=Math.max(0,Sr),Fa=Math.max(0,Rr);return{rect:{x:jn,y:Fa,width:Math.min(or.width,Sr+ai)-jn,height:Math.min(or.height,Rr+bi)-Fa},layout:[{offset:Gi,stride:pn}]}}(X,R,ae,ke,Ue)),Ct)for(let or=0;or<$t.length;or+=4){let Sr=$t[or];$t[or]=$t[or+2],$t[or+2]=Sr}return $t}finally{et.close()}})}let $,q,G="AbortError";function ee(){return new Error(G)}let he={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function xe(X){return he.REGISTERED_PROTOCOLS[X.substring(0,X.indexOf("://"))]}let ve="global-dispatcher";class ce extends Error{constructor(R,ae,ke,Ue){super(`AJAXError: ${ae} (${R}): ${ke}`),this.status=R,this.statusText=ae,this.url=ke,this.body=Ue}}let re=()=>B(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ge=function(X,R){if(/:\/\//.test(X.url)&&!/^https?:|^file:/.test(X.url)){let ke=xe(X.url);if(ke)return ke(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,targetMapId:ve},R)}if(!(/^file:/.test(ae=X.url)||/^file:/.test(re())&&!/^\w+:/.test(ae))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(ke,Ue){return n(this,void 0,void 0,function*(){let et=new Request(ke.url,{method:ke.method||"GET",body:ke.body,credentials:ke.credentials,headers:ke.headers,cache:ke.cache,referrer:re(),signal:Ue.signal});ke.type!=="json"||et.headers.has("Accept")||et.headers.set("Accept","application/json");let it=yield fetch(et);if(!it.ok){let or=yield it.blob();throw new ce(it.status,it.statusText,ke.url,or)}let Ct;Ct=ke.type==="arrayBuffer"||ke.type==="image"?it.arrayBuffer():ke.type==="json"?it.json():it.text();let $t=yield Ct;if(Ue.signal.aborted)throw ee();return{data:$t,cacheControl:it.headers.get("Cache-Control"),expires:it.headers.get("Expires")}})}(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,mustQueue:!0,targetMapId:ve},R)}var ae;return function(ke,Ue){return new Promise((et,it)=>{var Ct;let $t=new XMLHttpRequest;$t.open(ke.method||"GET",ke.url,!0),ke.type!=="arrayBuffer"&&ke.type!=="image"||($t.responseType="arraybuffer");for(let or in ke.headers)$t.setRequestHeader(or,ke.headers[or]);ke.type==="json"&&($t.responseType="text",!((Ct=ke.headers)===null||Ct===void 0)&&Ct.Accept||$t.setRequestHeader("Accept","application/json")),$t.withCredentials=ke.credentials==="include",$t.onerror=()=>{it(new Error($t.statusText))},$t.onload=()=>{if(!Ue.signal.aborted)if(($t.status>=200&&$t.status<300||$t.status===0)&&$t.response!==null){let or=$t.response;if(ke.type==="json")try{or=JSON.parse($t.response)}catch(Sr){return void it(Sr)}et({data:or,cacheControl:$t.getResponseHeader("Cache-Control"),expires:$t.getResponseHeader("Expires")})}else{let or=new Blob([$t.response],{type:$t.getResponseHeader("Content-Type")});it(new ce($t.status,$t.statusText,ke.url,or))}},Ue.signal.addEventListener("abort",()=>{$t.abort(),it(ee())}),$t.send(ke.body)})}(X,R)};function ne(X){if(!X||X.indexOf("://")<=0||X.indexOf("data:image/")===0||X.indexOf("blob:")===0)return!0;let R=new URL(X),ae=window.location;return R.protocol===ae.protocol&&R.host===ae.host}function se(X,R,ae){ae[X]&&ae[X].indexOf(R)!==-1||(ae[X]=ae[X]||[],ae[X].push(R))}function _e(X,R,ae){if(ae&&ae[X]){let ke=ae[X].indexOf(R);ke!==-1&&ae[X].splice(ke,1)}}class oe{constructor(R,ae={}){E(this,ae),this.type=R}}class J extends oe{constructor(R,ae={}){super("error",E({error:R},ae))}}class me{on(R,ae){return this._listeners=this._listeners||{},se(R,ae,this._listeners),this}off(R,ae){return _e(R,ae,this._listeners),_e(R,ae,this._oneTimeListeners),this}once(R,ae){return ae?(this._oneTimeListeners=this._oneTimeListeners||{},se(R,ae,this._oneTimeListeners),this):new Promise(ke=>this.once(R,ke))}fire(R,ae){typeof R=="string"&&(R=new oe(R,ae||{}));let ke=R.type;if(this.listens(ke)){R.target=this;let Ue=this._listeners&&this._listeners[ke]?this._listeners[ke].slice():[];for(let Ct of Ue)Ct.call(this,R);let et=this._oneTimeListeners&&this._oneTimeListeners[ke]?this._oneTimeListeners[ke].slice():[];for(let Ct of et)_e(ke,Ct,this._oneTimeListeners),Ct.call(this,R);let it=this._eventedParent;it&&(E(R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),it.fire(R))}else R instanceof J&&console.error(R.error);return this}listens(R){return this._listeners&&this._listeners[R]&&this._listeners[R].length>0||this._oneTimeListeners&&this._oneTimeListeners[R]&&this._oneTimeListeners[R].length>0||this._eventedParent&&this._eventedParent.listens(R)}setEventedParent(R,ae){return this._eventedParent=R,this._eventedParentData=ae,this}}var fe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let Ce=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Be(X,R){let ae={};for(let ke in X)ke!=="ref"&&(ae[ke]=X[ke]);return Ce.forEach(ke=>{ke in R&&(ae[ke]=R[ke])}),ae}function Oe(X,R){if(Array.isArray(X)){if(!Array.isArray(R)||X.length!==R.length)return!1;for(let ae=0;ae`:X.itemType.kind==="value"?"array":`array<${R}>`}return X.kind}let De=[ut,Et,Gt,Jt,gr,Mr,mr,Je(Kr),ui,mi,Ot];function ye(X,R){if(R.kind==="error")return null;if(X.kind==="array"){if(R.kind==="array"&&(R.N===0&&R.itemType.kind==="value"||!ye(X.itemType,R.itemType))&&(typeof X.N!="number"||X.N===R.N))return null}else{if(X.kind===R.kind)return null;if(X.kind==="value"){for(let ae of De)if(!ye(ae,R))return null}}return`Expected ${ot(X)} but found ${ot(R)} instead.`}function Pe(X,R){return R.some(ae=>ae.kind===X.kind)}function He(X,R){return R.some(ae=>ae==="null"?X===null:ae==="array"?Array.isArray(X):ae==="object"?X&&!Array.isArray(X)&&typeof X=="object":ae===typeof X)}function at(X,R){return X.kind==="array"&&R.kind==="array"?X.itemType.kind===R.itemType.kind&&typeof X.N=="number":X.kind===R.kind}let ht=.96422,At=.82521,Wt=4/29,Kt=6/29,hr=3*Kt*Kt,zr=Kt*Kt*Kt,Dr=Math.PI/180,br=180/Math.PI;function hi(X){return(X%=360)<0&&(X+=360),X}function un([X,R,ae,ke]){let Ue,et,it=yn((.2225045*(X=cn(X))+.7168786*(R=cn(R))+.0606169*(ae=cn(ae)))/1);X===R&&R===ae?Ue=et=it:(Ue=yn((.4360747*X+.3850649*R+.1430804*ae)/ht),et=yn((.0139322*X+.0971045*R+.7141733*ae)/At));let Ct=116*it-16;return[Ct<0?0:Ct,500*(Ue-it),200*(it-et),ke]}function cn(X){return X<=.04045?X/12.92:Math.pow((X+.055)/1.055,2.4)}function yn(X){return X>zr?Math.pow(X,1/3):X/hr+Wt}function Wn([X,R,ae,ke]){let Ue=(X+16)/116,et=isNaN(R)?Ue:Ue+R/500,it=isNaN(ae)?Ue:Ue-ae/200;return Ue=1*fn(Ue),et=ht*fn(et),it=At*fn(it),[Sn(3.1338561*et-1.6168667*Ue-.4906146*it),Sn(-.9787684*et+1.9161415*Ue+.033454*it),Sn(.0719453*et-.2289914*Ue+1.4052427*it),ke]}function Sn(X){return(X=X<=.00304?12.92*X:1.055*Math.pow(X,1/2.4)-.055)<0?0:X>1?1:X}function fn(X){return X>Kt?X*X*X:hr*(X-Wt)}function ga(X){return parseInt(X.padEnd(2,X),16)/255}function na(X,R){return Zt(R?X/100:X,0,1)}function Zt(X,R,ae){return Math.min(Math.max(R,X),ae)}function sr(X){return!X.some(Number.isNaN)}let _r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Cr{constructor(R,ae,ke,Ue=1,et=!0){this.r=R,this.g=ae,this.b=ke,this.a=Ue,et||(this.r*=Ue,this.g*=Ue,this.b*=Ue,Ue||this.overwriteGetter("rgb",[R,ae,ke,Ue]))}static parse(R){if(R instanceof Cr)return R;if(typeof R!="string")return;let ae=function(ke){if((ke=ke.toLowerCase().trim())==="transparent")return[0,0,0,0];let Ue=_r[ke];if(Ue){let[it,Ct,$t]=Ue;return[it/255,Ct/255,$t/255,1]}if(ke.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(ke)){let it=ke.length<6?1:2,Ct=1;return[ga(ke.slice(Ct,Ct+=it)),ga(ke.slice(Ct,Ct+=it)),ga(ke.slice(Ct,Ct+=it)),ga(ke.slice(Ct,Ct+it)||"ff")]}if(ke.startsWith("rgb")){let it=ke.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(it){let[Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn,Fa]=it,ha=[Sr||" ",bi||" ",pn].join("");if(ha===" "||ha===" /"||ha===",,"||ha===",,,"){let Aa=[or,ai,Gi].join(""),lo=Aa==="%%%"?100:Aa===""?255:0;if(lo){let Oo=[Zt(+$t/lo,0,1),Zt(+Rr/lo,0,1),Zt(+Fi/lo,0,1),jn?na(+jn,Fa):1];if(sr(Oo))return Oo}}return}}let et=ke.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(et){let[it,Ct,$t,or,Sr,Rr,ai,bi,Fi]=et,Gi=[$t||" ",Sr||" ",ai].join("");if(Gi===" "||Gi===" /"||Gi===",,"||Gi===",,,"){let pn=[+Ct,Zt(+or,0,100),Zt(+Rr,0,100),bi?na(+bi,Fi):1];if(sr(pn))return function([jn,Fa,ha,Aa]){function lo(Oo){let Ps=(Oo+jn/30)%12,Bl=Fa*Math.min(ha,1-ha);return ha-Bl*Math.max(-1,Math.min(Ps-3,9-Ps,1))}return jn=hi(jn),Fa/=100,ha/=100,[lo(0),lo(8),lo(4),Aa]}(pn)}}}(R);return ae?new Cr(...ae,!1):void 0}get rgb(){let{r:R,g:ae,b:ke,a:Ue}=this,et=Ue||1/0;return this.overwriteGetter("rgb",[R/et,ae/et,ke/et,Ue])}get hcl(){return this.overwriteGetter("hcl",function(R){let[ae,ke,Ue,et]=un(R),it=Math.sqrt(ke*ke+Ue*Ue);return[Math.round(1e4*it)?hi(Math.atan2(Ue,ke)*br):NaN,it,ae,et]}(this.rgb))}get lab(){return this.overwriteGetter("lab",un(this.rgb))}overwriteGetter(R,ae){return Object.defineProperty(this,R,{value:ae}),ae}toString(){let[R,ae,ke,Ue]=this.rgb;return`rgba(${[R,ae,ke].map(et=>Math.round(255*et)).join(",")},${Ue})`}}Cr.black=new Cr(0,0,0,1),Cr.white=new Cr(1,1,1,1),Cr.transparent=new Cr(0,0,0,0),Cr.red=new Cr(1,0,0,1);class fi{constructor(R,ae,ke){this.sensitivity=R?ae?"variant":"case":ae?"accent":"base",this.locale=ke,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(R,ae){return this.collator.compare(R,ae)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class qi{constructor(R,ae,ke,Ue,et){this.text=R,this.image=ae,this.scale=ke,this.fontStack=Ue,this.textColor=et}}class Ui{constructor(R){this.sections=R}static fromString(R){return new Ui([new qi(R,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(R=>R.text.length!==0||R.image&&R.image.name.length!==0)}static factory(R){return R instanceof Ui?R:Ui.fromString(R)}toString(){return this.sections.length===0?"":this.sections.map(R=>R.text).join("")}}class Hi{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Hi)return R;if(typeof R=="number")return new Hi([R,R,R,R]);if(Array.isArray(R)&&!(R.length<1||R.length>4)){for(let ae of R)if(typeof ae!="number")return;switch(R.length){case 1:R=[R[0],R[0],R[0],R[0]];break;case 2:R=[R[0],R[1],R[0],R[1]];break;case 3:R=[R[0],R[1],R[2],R[1]]}return new Hi(R)}}toString(){return JSON.stringify(this.values)}}let En=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Rn{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Rn)return R;if(Array.isArray(R)&&!(R.length<1)&&R.length%2==0){for(let ae=0;ae=0&&X<=255&&typeof R=="number"&&R>=0&&R<=255&&typeof ae=="number"&&ae>=0&&ae<=255?ke===void 0||typeof ke=="number"&&ke>=0&&ke<=1?null:`Invalid rgba value [${[X,R,ae,ke].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof ke=="number"?[X,R,ae,ke]:[X,R,ae]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sa(X){if(X===null||typeof X=="string"||typeof X=="boolean"||typeof X=="number"||X instanceof Cr||X instanceof fi||X instanceof Ui||X instanceof Hi||X instanceof Rn||X instanceof Gn)return!0;if(Array.isArray(X)){for(let R of X)if(!sa(R))return!1;return!0}if(typeof X=="object"){for(let R in X)if(!sa(X[R]))return!1;return!0}return!1}function Mn(X){if(X===null)return ut;if(typeof X=="string")return Gt;if(typeof X=="boolean")return Jt;if(typeof X=="number")return Et;if(X instanceof Cr)return gr;if(X instanceof fi)return ri;if(X instanceof Ui)return Mr;if(X instanceof Hi)return ui;if(X instanceof Rn)return Ot;if(X instanceof Gn)return mi;if(Array.isArray(X)){let R=X.length,ae;for(let ke of X){let Ue=Mn(ke);if(ae){if(ae===Ue)continue;ae=Kr;break}ae=Ue}return Je(ae||Kr,R)}return mr}function Ha(X){let R=typeof X;return X===null?"":R==="string"||R==="number"||R==="boolean"?String(X):X instanceof Cr||X instanceof Ui||X instanceof Hi||X instanceof Rn||X instanceof Gn?X.toString():JSON.stringify(X)}class ro{constructor(R,ae){this.type=R,this.value=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'literal' expression requires exactly one argument, but found ${R.length-1} instead.`);if(!sa(R[1]))return ae.error("invalid value");let ke=R[1],Ue=Mn(ke),et=ae.expectedType;return Ue.kind!=="array"||Ue.N!==0||!et||et.kind!=="array"||typeof et.N=="number"&&et.N!==0||(Ue=et),new ro(Ue,ke)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ft{constructor(R){this.name="ExpressionEvaluationError",this.message=R}toJSON(){return this.message}}let Rt={string:Gt,number:Et,boolean:Jt,object:mr};class qr{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke,Ue=1,et=R[0];if(et==="array"){let Ct,$t;if(R.length>2){let or=R[1];if(typeof or!="string"||!(or in Rt)||or==="object")return ae.error('The item type argument of "array" must be one of string, number, boolean',1);Ct=Rt[or],Ue++}else Ct=Kr;if(R.length>3){if(R[2]!==null&&(typeof R[2]!="number"||R[2]<0||R[2]!==Math.floor(R[2])))return ae.error('The length argument to "array" must be a positive integer literal',2);$t=R[2],Ue++}ke=Je(Ct,$t)}else{if(!Rt[et])throw new Error(`Types doesn't contain name = ${et}`);ke=Rt[et]}let it=[];for(;UeR.outputDefined())}}let ni={"to-boolean":Jt,"to-color":gr,"to-number":Et,"to-string":Gt};class oi{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke=R[0];if(!ni[ke])throw new Error(`Can't parse ${ke} as it is not part of the known types`);if((ke==="to-boolean"||ke==="to-string")&&R.length!==2)return ae.error("Expected one argument.");let Ue=ni[ke],et=[];for(let it=1;it4?`Invalid rbga value ${JSON.stringify(ae)}: expected an array containing either three or four numeric values.`:Xn(ae[0],ae[1],ae[2],ae[3]),!ke))return new Cr(ae[0]/255,ae[1]/255,ae[2]/255,ae[3])}throw new Ft(ke||`Could not parse color from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"padding":{let ae;for(let ke of this.args){ae=ke.evaluate(R);let Ue=Hi.parse(ae);if(Ue)return Ue}throw new Ft(`Could not parse padding from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"variableAnchorOffsetCollection":{let ae;for(let ke of this.args){ae=ke.evaluate(R);let Ue=Rn.parse(ae);if(Ue)return Ue}throw new Ft(`Could not parse variableAnchorOffsetCollection from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"number":{let ae=null;for(let ke of this.args){if(ae=ke.evaluate(R),ae===null)return 0;let Ue=Number(ae);if(!isNaN(Ue))return Ue}throw new Ft(`Could not convert ${JSON.stringify(ae)} to number.`)}case"formatted":return Ui.fromString(Ha(this.args[0].evaluate(R)));case"resolvedImage":return Gn.fromString(Ha(this.args[0].evaluate(R)));default:return Ha(this.args[0].evaluate(R))}}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}let Gr=["Unknown","Point","LineString","Polygon"];class si{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Gr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(R){let ae=this._parseColorCache[R];return ae||(ae=this._parseColorCache[R]=Cr.parse(R)),ae}}class Pi{constructor(R,ae,ke=[],Ue,et=new xt,it=[]){this.registry=R,this.path=ke,this.key=ke.map(Ct=>`[${Ct}]`).join(""),this.scope=et,this.errors=it,this.expectedType=Ue,this._isConstant=ae}parse(R,ae,ke,Ue,et={}){return ae?this.concat(ae,ke,Ue)._parse(R,et):this._parse(R,et)}_parse(R,ae){function ke(Ue,et,it){return it==="assert"?new qr(et,[Ue]):it==="coerce"?new oi(et,[Ue]):Ue}if(R!==null&&typeof R!="string"&&typeof R!="boolean"&&typeof R!="number"||(R=["literal",R]),Array.isArray(R)){if(R.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Ue=R[0];if(typeof Ue!="string")return this.error(`Expression name must be a string, but found ${typeof Ue} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let et=this.registry[Ue];if(et){let it=et.parse(R,this);if(!it)return null;if(this.expectedType){let Ct=this.expectedType,$t=it.type;if(Ct.kind!=="string"&&Ct.kind!=="number"&&Ct.kind!=="boolean"&&Ct.kind!=="object"&&Ct.kind!=="array"||$t.kind!=="value")if(Ct.kind!=="color"&&Ct.kind!=="formatted"&&Ct.kind!=="resolvedImage"||$t.kind!=="value"&&$t.kind!=="string")if(Ct.kind!=="padding"||$t.kind!=="value"&&$t.kind!=="number"&&$t.kind!=="array")if(Ct.kind!=="variableAnchorOffsetCollection"||$t.kind!=="value"&&$t.kind!=="array"){if(this.checkSubtype(Ct,$t))return null}else it=ke(it,Ct,ae.typeAnnotation||"coerce");else it=ke(it,Ct,ae.typeAnnotation||"coerce");else it=ke(it,Ct,ae.typeAnnotation||"coerce");else it=ke(it,Ct,ae.typeAnnotation||"assert")}if(!(it instanceof ro)&&it.type.kind!=="resolvedImage"&&this._isConstant(it)){let Ct=new si;try{it=new ro(it.type,it.evaluate(Ct))}catch($t){return this.error($t.message),null}}return it}return this.error(`Unknown expression "${Ue}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(R===void 0?"'undefined' value invalid. Use null instead.":typeof R=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof R} instead.`)}concat(R,ae,ke){let Ue=typeof R=="number"?this.path.concat(R):this.path,et=ke?this.scope.concat(ke):this.scope;return new Pi(this.registry,this._isConstant,Ue,ae||null,et,this.errors)}error(R,...ae){let ke=`${this.key}${ae.map(Ue=>`[${Ue}]`).join("")}`;this.errors.push(new nt(ke,R))}checkSubtype(R,ae){let ke=ye(R,ae);return ke&&this.error(ke),ke}}class yi{constructor(R,ae){this.type=ae.type,this.bindings=[].concat(R),this.result=ae}evaluate(R){return this.result.evaluate(R)}eachChild(R){for(let ae of this.bindings)R(ae[1]);R(this.result)}static parse(R,ae){if(R.length<4)return ae.error(`Expected at least 3 arguments, but found ${R.length-1} instead.`);let ke=[];for(let et=1;et=ke.length)throw new Ft(`Array index out of bounds: ${ae} > ${ke.length-1}.`);if(ae!==Math.floor(ae))throw new Ft(`Array index must be an integer, but found ${ae} instead.`);return ke[ae]}eachChild(R){R(this.index),R(this.input)}outputDefined(){return!1}}class Jr{constructor(R,ae){this.type=Jt,this.needle=R,this.haystack=ae}static parse(R,ae){if(R.length!==3)return ae.error(`Expected 2 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Kr),Ue=ae.parse(R[2],2,Kr);return ke&&Ue?Pe(ke.type,[Jt,Gt,Et,ut,Kr])?new Jr(ke,Ue):ae.error(`Expected first argument to be of type boolean, string, number or null, but found ${ot(ke.type)} instead`):null}evaluate(R){let ae=this.needle.evaluate(R),ke=this.haystack.evaluate(R);if(!ke)return!1;if(!He(ae,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${ot(Mn(ae))} instead.`);if(!He(ke,["string","array"]))throw new Ft(`Expected second argument to be of type array or string, but found ${ot(Mn(ke))} instead.`);return ke.indexOf(ae)>=0}eachChild(R){R(this.needle),R(this.haystack)}outputDefined(){return!0}}class Ri{constructor(R,ae,ke){this.type=Et,this.needle=R,this.haystack=ae,this.fromIndex=ke}static parse(R,ae){if(R.length<=2||R.length>=5)return ae.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Kr),Ue=ae.parse(R[2],2,Kr);if(!ke||!Ue)return null;if(!Pe(ke.type,[Jt,Gt,Et,ut,Kr]))return ae.error(`Expected first argument to be of type boolean, string, number or null, but found ${ot(ke.type)} instead`);if(R.length===4){let et=ae.parse(R[3],3,Et);return et?new Ri(ke,Ue,et):null}return new Ri(ke,Ue)}evaluate(R){let ae=this.needle.evaluate(R),ke=this.haystack.evaluate(R);if(!He(ae,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${ot(Mn(ae))} instead.`);let Ue;if(this.fromIndex&&(Ue=this.fromIndex.evaluate(R)),He(ke,["string"])){let et=ke.indexOf(ae,Ue);return et===-1?-1:[...ke.slice(0,et)].length}if(He(ke,["array"]))return ke.indexOf(ae,Ue);throw new Ft(`Expected second argument to be of type array or string, but found ${ot(Mn(ke))} instead.`)}eachChild(R){R(this.needle),R(this.haystack),this.fromIndex&&R(this.fromIndex)}outputDefined(){return!1}}class tn{constructor(R,ae,ke,Ue,et,it){this.inputType=R,this.type=ae,this.input=ke,this.cases=Ue,this.outputs=et,this.otherwise=it}static parse(R,ae){if(R.length<5)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if(R.length%2!=1)return ae.error("Expected an even number of arguments.");let ke,Ue;ae.expectedType&&ae.expectedType.kind!=="value"&&(Ue=ae.expectedType);let et={},it=[];for(let or=2;orNumber.MAX_SAFE_INTEGER)return ai.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Fi=="number"&&Math.floor(Fi)!==Fi)return ai.error("Numeric branch labels must be integer values.");if(ke){if(ai.checkSubtype(ke,Mn(Fi)))return null}else ke=Mn(Fi);if(et[String(Fi)]!==void 0)return ai.error("Branch labels must be unique.");et[String(Fi)]=it.length}let bi=ae.parse(Rr,or,Ue);if(!bi)return null;Ue=Ue||bi.type,it.push(bi)}let Ct=ae.parse(R[1],1,Kr);if(!Ct)return null;let $t=ae.parse(R[R.length-1],R.length-1,Ue);return $t?Ct.type.kind!=="value"&&ae.concat(1).checkSubtype(ke,Ct.type)?null:new tn(ke,Ue,Ct,et,it,$t):null}evaluate(R){let ae=this.input.evaluate(R);return(Mn(ae)===this.inputType&&this.outputs[this.cases[ae]]||this.otherwise).evaluate(R)}eachChild(R){R(this.input),this.outputs.forEach(R),R(this.otherwise)}outputDefined(){return this.outputs.every(R=>R.outputDefined())&&this.otherwise.outputDefined()}}class _n{constructor(R,ae,ke){this.type=R,this.branches=ae,this.otherwise=ke}static parse(R,ae){if(R.length<4)return ae.error(`Expected at least 3 arguments, but found only ${R.length-1}.`);if(R.length%2!=0)return ae.error("Expected an odd number of arguments.");let ke;ae.expectedType&&ae.expectedType.kind!=="value"&&(ke=ae.expectedType);let Ue=[];for(let it=1;itae.outputDefined())&&this.otherwise.outputDefined()}}class Zi{constructor(R,ae,ke,Ue){this.type=R,this.input=ae,this.beginIndex=ke,this.endIndex=Ue}static parse(R,ae){if(R.length<=2||R.length>=5)return ae.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Kr),Ue=ae.parse(R[2],2,Et);if(!ke||!Ue)return null;if(!Pe(ke.type,[Je(Kr),Gt,Kr]))return ae.error(`Expected first argument to be of type array or string, but found ${ot(ke.type)} instead`);if(R.length===4){let et=ae.parse(R[3],3,Et);return et?new Zi(ke.type,ke,Ue,et):null}return new Zi(ke.type,ke,Ue)}evaluate(R){let ae=this.input.evaluate(R),ke=this.beginIndex.evaluate(R),Ue;if(this.endIndex&&(Ue=this.endIndex.evaluate(R)),He(ae,["string"]))return[...ae].slice(ke,Ue).join("");if(He(ae,["array"]))return ae.slice(ke,Ue);throw new Ft(`Expected first argument to be of type array or string, but found ${ot(Mn(ae))} instead.`)}eachChild(R){R(this.input),R(this.beginIndex),this.endIndex&&R(this.endIndex)}outputDefined(){return!1}}function Wi(X,R){let ae=X.length-1,ke,Ue,et=0,it=ae,Ct=0;for(;et<=it;)if(Ct=Math.floor((et+it)/2),ke=X[Ct],Ue=X[Ct+1],ke<=R){if(Ct===ae||RR))throw new Ft("Input is not a number.");it=Ct-1}return 0}class dn{constructor(R,ae,ke){this.type=R,this.input=ae,this.labels=[],this.outputs=[];for(let[Ue,et]of ke)this.labels.push(Ue),this.outputs.push(et)}static parse(R,ae){if(R.length-1<4)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return ae.error("Expected an even number of arguments.");let ke=ae.parse(R[1],1,Et);if(!ke)return null;let Ue=[],et=null;ae.expectedType&&ae.expectedType.kind!=="value"&&(et=ae.expectedType);for(let it=1;it=Ct)return ae.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',or);let Rr=ae.parse($t,Sr,et);if(!Rr)return null;et=et||Rr.type,Ue.push([Ct,Rr])}return new dn(et,ke,Ue)}evaluate(R){let ae=this.labels,ke=this.outputs;if(ae.length===1)return ke[0].evaluate(R);let Ue=this.input.evaluate(R);if(Ue<=ae[0])return ke[0].evaluate(R);let et=ae.length;return Ue>=ae[et-1]?ke[et-1].evaluate(R):ke[Wi(ae,Ue)].evaluate(R)}eachChild(R){R(this.input);for(let ae of this.outputs)R(ae)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Ua(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}var ea=fo;function fo(X,R,ae,ke){this.cx=3*X,this.bx=3*(ae-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(ke-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=ae,this.p2y=ke}fo.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var ae=X,ke=0;ke<8;ke++){var Ue=this.sampleCurveX(ae)-X;if(Math.abs(Ue)Ue?it=ae:Ct=ae,ae=.5*(Ct-it)+it;return ae},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var ho=Ua(ea);function Vo(X,R,ae){return X+ae*(R-X)}function Ao(X,R,ae){return X.map((ke,Ue)=>Vo(ke,R[Ue],ae))}let Wo={number:Vo,color:function(X,R,ae,ke="rgb"){switch(ke){case"rgb":{let[Ue,et,it,Ct]=Ao(X.rgb,R.rgb,ae);return new Cr(Ue,et,it,Ct,!1)}case"hcl":{let[Ue,et,it,Ct]=X.hcl,[$t,or,Sr,Rr]=R.hcl,ai,bi;if(isNaN(Ue)||isNaN($t))isNaN(Ue)?isNaN($t)?ai=NaN:(ai=$t,it!==1&&it!==0||(bi=or)):(ai=Ue,Sr!==1&&Sr!==0||(bi=et));else{let Fa=$t-Ue;$t>Ue&&Fa>180?Fa-=360:$t180&&(Fa+=360),ai=Ue+ae*Fa}let[Fi,Gi,pn,jn]=function([Fa,ha,Aa,lo]){return Fa=isNaN(Fa)?0:Fa*Dr,Wn([Aa,Math.cos(Fa)*ha,Math.sin(Fa)*ha,lo])}([ai,bi??Vo(et,or,ae),Vo(it,Sr,ae),Vo(Ct,Rr,ae)]);return new Cr(Fi,Gi,pn,jn,!1)}case"lab":{let[Ue,et,it,Ct]=Wn(Ao(X.lab,R.lab,ae));return new Cr(Ue,et,it,Ct,!1)}}},array:Ao,padding:function(X,R,ae){return new Hi(Ao(X.values,R.values,ae))},variableAnchorOffsetCollection:function(X,R,ae){let ke=X.values,Ue=R.values;if(ke.length!==Ue.length)throw new Ft(`Cannot interpolate values of different length. from: ${X.toString()}, to: ${R.toString()}`);let et=[];for(let it=0;ittypeof Sr!="number"||Sr<0||Sr>1))return ae.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ue={name:"cubic-bezier",controlPoints:or}}}if(R.length-1<4)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return ae.error("Expected an even number of arguments.");if(et=ae.parse(et,2,Et),!et)return null;let Ct=[],$t=null;ke==="interpolate-hcl"||ke==="interpolate-lab"?$t=gr:ae.expectedType&&ae.expectedType.kind!=="value"&&($t=ae.expectedType);for(let or=0;or=Sr)return ae.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ai);let Fi=ae.parse(Rr,bi,$t);if(!Fi)return null;$t=$t||Fi.type,Ct.push([Sr,Fi])}return at($t,Et)||at($t,gr)||at($t,ui)||at($t,Ot)||at($t,Je(Et))?new Wa($t,ke,Ue,et,Ct):ae.error(`Type ${ot($t)} is not interpolatable.`)}evaluate(R){let ae=this.labels,ke=this.outputs;if(ae.length===1)return ke[0].evaluate(R);let Ue=this.input.evaluate(R);if(Ue<=ae[0])return ke[0].evaluate(R);let et=ae.length;if(Ue>=ae[et-1])return ke[et-1].evaluate(R);let it=Wi(ae,Ue),Ct=Wa.interpolationFactor(this.interpolation,Ue,ae[it],ae[it+1]),$t=ke[it].evaluate(R),or=ke[it+1].evaluate(R);switch(this.operator){case"interpolate":return Wo[this.type.kind]($t,or,Ct);case"interpolate-hcl":return Wo.color($t,or,Ct,"hcl");case"interpolate-lab":return Wo.color($t,or,Ct,"lab")}}eachChild(R){R(this.input);for(let ae of this.outputs)R(ae)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function ks(X,R,ae,ke){let Ue=ke-ae,et=X-ae;return Ue===0?0:R===1?et/Ue:(Math.pow(R,et)-1)/(Math.pow(R,Ue)-1)}class fs{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expectected at least one argument.");let ke=null,Ue=ae.expectedType;Ue&&Ue.kind!=="value"&&(ke=Ue);let et=[];for(let Ct of R.slice(1)){let $t=ae.parse(Ct,1+et.length,ke,void 0,{typeAnnotation:"omit"});if(!$t)return null;ke=ke||$t.type,et.push($t)}if(!ke)throw new Error("No output type");let it=Ue&&et.some(Ct=>ye(Ue,Ct.type));return new fs(it?Kr:ke,et)}evaluate(R){let ae,ke=null,Ue=0;for(let et of this.args)if(Ue++,ke=et.evaluate(R),ke&&ke instanceof Gn&&!ke.available&&(ae||(ae=ke.name),ke=null,Ue===this.args.length&&(ke=ae)),ke!==null)break;return ke}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}function _l(X,R){return X==="=="||X==="!="?R.kind==="boolean"||R.kind==="string"||R.kind==="number"||R.kind==="null"||R.kind==="value":R.kind==="string"||R.kind==="number"||R.kind==="value"}function es(X,R,ae,ke){return ke.compare(R,ae)===0}function rl(X,R,ae){let ke=X!=="=="&&X!=="!=";return class LH{constructor(et,it,Ct){this.type=Jt,this.lhs=et,this.rhs=it,this.collator=Ct,this.hasUntypedArgument=et.type.kind==="value"||it.type.kind==="value"}static parse(et,it){if(et.length!==3&&et.length!==4)return it.error("Expected two or three arguments.");let Ct=et[0],$t=it.parse(et[1],1,Kr);if(!$t)return null;if(!_l(Ct,$t.type))return it.concat(1).error(`"${Ct}" comparisons are not supported for type '${ot($t.type)}'.`);let or=it.parse(et[2],2,Kr);if(!or)return null;if(!_l(Ct,or.type))return it.concat(2).error(`"${Ct}" comparisons are not supported for type '${ot(or.type)}'.`);if($t.type.kind!==or.type.kind&&$t.type.kind!=="value"&&or.type.kind!=="value")return it.error(`Cannot compare types '${ot($t.type)}' and '${ot(or.type)}'.`);ke&&($t.type.kind==="value"&&or.type.kind!=="value"?$t=new qr(or.type,[$t]):$t.type.kind!=="value"&&or.type.kind==="value"&&(or=new qr($t.type,[or])));let Sr=null;if(et.length===4){if($t.type.kind!=="string"&&or.type.kind!=="string"&&$t.type.kind!=="value"&&or.type.kind!=="value")return it.error("Cannot use collator to compare non-string types.");if(Sr=it.parse(et[3],3,ri),!Sr)return null}return new LH($t,or,Sr)}evaluate(et){let it=this.lhs.evaluate(et),Ct=this.rhs.evaluate(et);if(ke&&this.hasUntypedArgument){let $t=Mn(it),or=Mn(Ct);if($t.kind!==or.kind||$t.kind!=="string"&&$t.kind!=="number")throw new Ft(`Expected arguments for "${X}" to be (string, string) or (number, number), but found (${$t.kind}, ${or.kind}) instead.`)}if(this.collator&&!ke&&this.hasUntypedArgument){let $t=Mn(it),or=Mn(Ct);if($t.kind!=="string"||or.kind!=="string")return R(et,it,Ct)}return this.collator?ae(et,it,Ct,this.collator.evaluate(et)):R(et,it,Ct)}eachChild(et){et(this.lhs),et(this.rhs),this.collator&&et(this.collator)}outputDefined(){return!0}}}let ds=rl("==",function(X,R,ae){return R===ae},es),xl=rl("!=",function(X,R,ae){return R!==ae},function(X,R,ae,ke){return!es(0,R,ae,ke)}),ol=rl("<",function(X,R,ae){return R",function(X,R,ae){return R>ae},function(X,R,ae,ke){return ke.compare(R,ae)>0}),ms=rl("<=",function(X,R,ae){return R<=ae},function(X,R,ae,ke){return ke.compare(R,ae)<=0}),Bs=rl(">=",function(X,R,ae){return R>=ae},function(X,R,ae,ke){return ke.compare(R,ae)>=0});class No{constructor(R,ae,ke){this.type=ri,this.locale=ke,this.caseSensitive=R,this.diacriticSensitive=ae}static parse(R,ae){if(R.length!==2)return ae.error("Expected one argument.");let ke=R[1];if(typeof ke!="object"||Array.isArray(ke))return ae.error("Collator options argument must be an object.");let Ue=ae.parse(ke["case-sensitive"]!==void 0&&ke["case-sensitive"],1,Jt);if(!Ue)return null;let et=ae.parse(ke["diacritic-sensitive"]!==void 0&&ke["diacritic-sensitive"],1,Jt);if(!et)return null;let it=null;return ke.locale&&(it=ae.parse(ke.locale,1,Gt),!it)?null:new No(Ue,et,it)}evaluate(R){return new fi(this.caseSensitive.evaluate(R),this.diacriticSensitive.evaluate(R),this.locale?this.locale.evaluate(R):null)}eachChild(R){R(this.caseSensitive),R(this.diacriticSensitive),this.locale&&R(this.locale)}outputDefined(){return!1}}class Es{constructor(R,ae,ke,Ue,et){this.type=Gt,this.number=R,this.locale=ae,this.currency=ke,this.minFractionDigits=Ue,this.maxFractionDigits=et}static parse(R,ae){if(R.length!==3)return ae.error("Expected two arguments.");let ke=ae.parse(R[1],1,Et);if(!ke)return null;let Ue=R[2];if(typeof Ue!="object"||Array.isArray(Ue))return ae.error("NumberFormat options argument must be an object.");let et=null;if(Ue.locale&&(et=ae.parse(Ue.locale,1,Gt),!et))return null;let it=null;if(Ue.currency&&(it=ae.parse(Ue.currency,1,Gt),!it))return null;let Ct=null;if(Ue["min-fraction-digits"]&&(Ct=ae.parse(Ue["min-fraction-digits"],1,Et),!Ct))return null;let $t=null;return Ue["max-fraction-digits"]&&($t=ae.parse(Ue["max-fraction-digits"],1,Et),!$t)?null:new Es(ke,et,it,Ct,$t)}evaluate(R){return new Intl.NumberFormat(this.locale?this.locale.evaluate(R):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(R):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(R):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(R):void 0}).format(this.number.evaluate(R))}eachChild(R){R(this.number),this.locale&&R(this.locale),this.currency&&R(this.currency),this.minFractionDigits&&R(this.minFractionDigits),this.maxFractionDigits&&R(this.maxFractionDigits)}outputDefined(){return!1}}class Il{constructor(R){this.type=Mr,this.sections=R}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke=R[1];if(!Array.isArray(ke)&&typeof ke=="object")return ae.error("First argument must be an image or text section.");let Ue=[],et=!1;for(let it=1;it<=R.length-1;++it){let Ct=R[it];if(et&&typeof Ct=="object"&&!Array.isArray(Ct)){et=!1;let $t=null;if(Ct["font-scale"]&&($t=ae.parse(Ct["font-scale"],1,Et),!$t))return null;let or=null;if(Ct["text-font"]&&(or=ae.parse(Ct["text-font"],1,Je(Gt)),!or))return null;let Sr=null;if(Ct["text-color"]&&(Sr=ae.parse(Ct["text-color"],1,gr),!Sr))return null;let Rr=Ue[Ue.length-1];Rr.scale=$t,Rr.font=or,Rr.textColor=Sr}else{let $t=ae.parse(R[it],1,Kr);if(!$t)return null;let or=$t.type.kind;if(or!=="string"&&or!=="value"&&or!=="null"&&or!=="resolvedImage")return ae.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");et=!0,Ue.push({content:$t,scale:null,font:null,textColor:null})}}return new Il(Ue)}evaluate(R){return new Ui(this.sections.map(ae=>{let ke=ae.content.evaluate(R);return Mn(ke)===mi?new qi("",ke,null,null,null):new qi(Ha(ke),null,ae.scale?ae.scale.evaluate(R):null,ae.font?ae.font.evaluate(R).join(","):null,ae.textColor?ae.textColor.evaluate(R):null)}))}eachChild(R){for(let ae of this.sections)R(ae.content),ae.scale&&R(ae.scale),ae.font&&R(ae.font),ae.textColor&&R(ae.textColor)}outputDefined(){return!1}}class Jl{constructor(R){this.type=mi,this.input=R}static parse(R,ae){if(R.length!==2)return ae.error("Expected two arguments.");let ke=ae.parse(R[1],1,Gt);return ke?new Jl(ke):ae.error("No image name provided.")}evaluate(R){let ae=this.input.evaluate(R),ke=Gn.fromString(ae);return ke&&R.availableImages&&(ke.available=R.availableImages.indexOf(ae)>-1),ke}eachChild(R){R(this.input)}outputDefined(){return!1}}class ou{constructor(R){this.type=Et,this.input=R}static parse(R,ae){if(R.length!==2)return ae.error(`Expected 1 argument, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1);return ke?ke.type.kind!=="array"&&ke.type.kind!=="string"&&ke.type.kind!=="value"?ae.error(`Expected argument of type string or array, but found ${ot(ke.type)} instead.`):new ou(ke):null}evaluate(R){let ae=this.input.evaluate(R);if(typeof ae=="string")return[...ae].length;if(Array.isArray(ae))return ae.length;throw new Ft(`Expected value to be of type string or array, but found ${ot(Mn(ae))} instead.`)}eachChild(R){R(this.input)}outputDefined(){return!1}}let Gs=8192;function $a(X,R){let ae=(180+X[0])/360,ke=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X[1]*Math.PI/360)))/360,Ue=Math.pow(2,R.z);return[Math.round(ae*Ue*Gs),Math.round(ke*Ue*Gs)]}function So(X,R){let ae=Math.pow(2,R.z);return[(Ue=(X[0]/Gs+R.x)/ae,360*Ue-180),(ke=(X[1]/Gs+R.y)/ae,360/Math.PI*Math.atan(Math.exp((180-360*ke)*Math.PI/180))-90)];var ke,Ue}function Xs(X,R){X[0]=Math.min(X[0],R[0]),X[1]=Math.min(X[1],R[1]),X[2]=Math.max(X[2],R[0]),X[3]=Math.max(X[3],R[1])}function su(X,R){return!(X[0]<=R[0]||X[2]>=R[2]||X[1]<=R[1]||X[3]>=R[3])}function is(X,R,ae){let ke=X[0]-R[0],Ue=X[1]-R[1],et=X[0]-ae[0],it=X[1]-ae[1];return ke*it-et*Ue==0&&ke*et<=0&&Ue*it<=0}function tu(X,R,ae,ke){return(Ue=[ke[0]-ae[0],ke[1]-ae[1]])[0]*(et=[R[0]-X[0],R[1]-X[1]])[1]-Ue[1]*et[0]!=0&&!(!Rs(X,R,ae,ke)||!Rs(ae,ke,X,R));var Ue,et}function pl(X,R,ae){for(let ke of ae)for(let Ue=0;Ue(Ue=X)[1]!=(it=Ct[$t+1])[1]>Ue[1]&&Ue[0]<(it[0]-et[0])*(Ue[1]-et[1])/(it[1]-et[1])+et[0]&&(ke=!ke)}var Ue,et,it;return ke}function Gu(X,R){for(let ae of R)if(Nl(X,ae))return!0;return!1}function bo(X,R){for(let ae of X)if(!Nl(ae,R))return!1;for(let ae=0;ae0&&Ct<0||it<0&&Ct>0}function pu(X,R,ae){let ke=[];for(let Ue=0;Ueae[2]){let Ue=.5*ke,et=X[0]-ae[0]>Ue?-ke:ae[0]-X[0]>Ue?ke:0;et===0&&(et=X[0]-ae[2]>Ue?-ke:ae[2]-X[0]>Ue?ke:0),X[0]+=et}Xs(R,X)}function Bu(X,R,ae,ke){let Ue=Math.pow(2,ke.z)*Gs,et=[ke.x*Gs,ke.y*Gs],it=[];for(let Ct of X)for(let $t of Ct){let or=[$t.x+et[0],$t.y+et[1]];ls(or,R,ae,Ue),it.push(or)}return it}function ic(X,R,ae,ke){let Ue=Math.pow(2,ke.z)*Gs,et=[ke.x*Gs,ke.y*Gs],it=[];for(let $t of X){let or=[];for(let Sr of $t){let Rr=[Sr.x+et[0],Sr.y+et[1]];Xs(R,Rr),or.push(Rr)}it.push(or)}if(R[2]-R[0]<=Ue/2){(Ct=R)[0]=Ct[1]=1/0,Ct[2]=Ct[3]=-1/0;for(let $t of it)for(let or of $t)ls(or,R,ae,Ue)}var Ct;return it}class Ll{constructor(R,ae){this.type=Jt,this.geojson=R,this.geometries=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'within' expression requires exactly one argument, but found ${R.length-1} instead.`);if(sa(R[1])){let ke=R[1];if(ke.type==="FeatureCollection"){let Ue=[];for(let et of ke.features){let{type:it,coordinates:Ct}=et.geometry;it==="Polygon"&&Ue.push(Ct),it==="MultiPolygon"&&Ue.push(...Ct)}if(Ue.length)return new Ll(ke,{type:"MultiPolygon",coordinates:Ue})}else if(ke.type==="Feature"){let Ue=ke.geometry.type;if(Ue==="Polygon"||Ue==="MultiPolygon")return new Ll(ke,ke.geometry)}else if(ke.type==="Polygon"||ke.type==="MultiPolygon")return new Ll(ke,ke)}return ae.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(ae,ke){let Ue=[1/0,1/0,-1/0,-1/0],et=[1/0,1/0,-1/0,-1/0],it=ae.canonicalID();if(ke.type==="Polygon"){let Ct=pu(ke.coordinates,et,it),$t=Bu(ae.geometry(),Ue,et,it);if(!su(Ue,et))return!1;for(let or of $t)if(!Nl(or,Ct))return!1}if(ke.type==="MultiPolygon"){let Ct=bl(ke.coordinates,et,it),$t=Bu(ae.geometry(),Ue,et,it);if(!su(Ue,et))return!1;for(let or of $t)if(!Gu(or,Ct))return!1}return!0}(R,this.geometries);if(R.geometryType()==="LineString")return function(ae,ke){let Ue=[1/0,1/0,-1/0,-1/0],et=[1/0,1/0,-1/0,-1/0],it=ae.canonicalID();if(ke.type==="Polygon"){let Ct=pu(ke.coordinates,et,it),$t=ic(ae.geometry(),Ue,et,it);if(!su(Ue,et))return!1;for(let or of $t)if(!bo(or,Ct))return!1}if(ke.type==="MultiPolygon"){let Ct=bl(ke.coordinates,et,it),$t=ic(ae.geometry(),Ue,et,it);if(!su(Ue,et))return!1;for(let or of $t)if(!Ls(or,Ct))return!1}return!0}(R,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Hl=class{constructor(X=[],R=(ae,ke)=>aeke?1:0){if(this.data=X,this.length=this.data.length,this.compare=R,this.length>0)for(let ae=(this.length>>1)-1;ae>=0;ae--)this._down(ae)}push(X){this.data.push(X),this._up(this.length++)}pop(){if(this.length===0)return;let X=this.data[0],R=this.data.pop();return--this.length>0&&(this.data[0]=R,this._down(0)),X}peek(){return this.data[0]}_up(X){let{data:R,compare:ae}=this,ke=R[X];for(;X>0;){let Ue=X-1>>1,et=R[Ue];if(ae(ke,et)>=0)break;R[X]=et,X=Ue}R[X]=ke}_down(X){let{data:R,compare:ae}=this,ke=this.length>>1,Ue=R[X];for(;X=0)break;R[X]=R[et],X=et}R[X]=Ue}};function lu(X,R,ae,ke,Ue){hu(X,R,ae,ke||X.length-1,Ue||Ah)}function hu(X,R,ae,ke,Ue){for(;ke>ae;){if(ke-ae>600){var et=ke-ae+1,it=R-ae+1,Ct=Math.log(et),$t=.5*Math.exp(2*Ct/3),or=.5*Math.sqrt(Ct*$t*(et-$t)/et)*(it-et/2<0?-1:1);hu(X,R,Math.max(ae,Math.floor(R-it*$t/et+or)),Math.min(ke,Math.floor(R+(et-it)*$t/et+or)),Ue)}var Sr=X[R],Rr=ae,ai=ke;for(pc(X,ae,R),Ue(X[ke],Sr)>0&&pc(X,ae,ke);Rr0;)ai--}Ue(X[ae],Sr)===0?pc(X,ae,ai):pc(X,++ai,ke),ai<=R&&(ae=ai+1),R<=ai&&(ke=ai-1)}}function pc(X,R,ae){var ke=X[R];X[R]=X[ae],X[ae]=ke}function Ah(X,R){return XR?1:0}function uh(X,R){if(X.length<=1)return[X];let ae=[],ke,Ue;for(let et of X){let it=Qf(et);it!==0&&(et.area=Math.abs(it),Ue===void 0&&(Ue=it<0),Ue===it<0?(ke&&ae.push(ke),ke=[et]):ke.push(et))}if(ke&&ae.push(ke),R>1)for(let et=0;et1?(or=R[$t+1][0],Sr=R[$t+1][1]):bi>0&&(or+=Rr/this.kx*bi,Sr+=ai/this.ky*bi)),Rr=this.wrap(ae[0]-or)*this.kx,ai=(ae[1]-Sr)*this.ky;let Fi=Rr*Rr+ai*ai;Fi180;)R-=360;return R}}function xc(X,R){return R[0]-X[0]}function mc(X){return X[1]-X[0]+1}function bc(X,R){return X[1]>=X[0]&&X[1]X[1])return[null,null];let ae=mc(X);if(R){if(ae===2)return[X,null];let Ue=Math.floor(ae/2);return[[X[0],X[0]+Ue],[X[0]+Ue,X[1]]]}if(ae===1)return[X,null];let ke=Math.floor(ae/2)-1;return[[X[0],X[0]+ke],[X[0]+ke+1,X[1]]]}function yu(X,R){if(!bc(R,X.length))return[1/0,1/0,-1/0,-1/0];let ae=[1/0,1/0,-1/0,-1/0];for(let ke=R[0];ke<=R[1];++ke)Xs(ae,X[ke]);return ae}function gc(X){let R=[1/0,1/0,-1/0,-1/0];for(let ae of X)for(let ke of ae)Xs(R,ke);return R}function hl(X){return X[0]!==-1/0&&X[1]!==-1/0&&X[2]!==1/0&&X[3]!==1/0}function ru(X,R,ae){if(!hl(X)||!hl(R))return NaN;let ke=0,Ue=0;return X[2]R[2]&&(ke=X[0]-R[2]),X[1]>R[3]&&(Ue=X[1]-R[3]),X[3]=ke)return ke;if(su(Ue,et)){if(hp(X,R))return 0}else if(hp(R,X))return 0;let it=1/0;for(let Ct of X)for(let $t=0,or=Ct.length,Sr=or-1;$t0;){let $t=it.pop();if($t[0]>=et)continue;let or=$t[1],Sr=R?50:100;if(mc(or)<=Sr){if(!bc(or,X.length))return NaN;if(R){let Rr=sl(X,or,ae,ke);if(isNaN(Rr)||Rr===0)return Rr;et=Math.min(et,Rr)}else for(let Rr=or[0];Rr<=or[1];++Rr){let ai=Yd(X[Rr],ae,ke);if(et=Math.min(et,ai),et===0)return 0}}else{let Rr=vh(or,R);os(it,et,ke,X,Ct,Rr[0]),os(it,et,ke,X,Ct,Rr[1])}}return et}function hc(X,R,ae,ke,Ue,et=1/0){let it=Math.min(et,Ue.distance(X[0],ae[0]));if(it===0)return it;let Ct=new Hl([[0,[0,X.length-1],[0,ae.length-1]]],xc);for(;Ct.length>0;){let $t=Ct.pop();if($t[0]>=it)continue;let or=$t[1],Sr=$t[2],Rr=R?50:100,ai=ke?50:100;if(mc(or)<=Rr&&mc(Sr)<=ai){if(!bc(or,X.length)&&bc(Sr,ae.length))return NaN;let bi;if(R&&ke)bi=Jh(X,or,ae,Sr,Ue),it=Math.min(it,bi);else if(R&&!ke){let Fi=X.slice(or[0],or[1]+1);for(let Gi=Sr[0];Gi<=Sr[1];++Gi)if(bi=Fh(ae[Gi],Fi,Ue),it=Math.min(it,bi),it===0)return it}else if(!R&&ke){let Fi=ae.slice(Sr[0],Sr[1]+1);for(let Gi=or[0];Gi<=or[1];++Gi)if(bi=Fh(X[Gi],Fi,Ue),it=Math.min(it,bi),it===0)return it}else bi=Mu(X,or,ae,Sr,Ue),it=Math.min(it,bi)}else{let bi=vh(or,R),Fi=vh(Sr,ke);_f(Ct,it,Ue,X,ae,bi[0],Fi[0]),_f(Ct,it,Ue,X,ae,bi[0],Fi[1]),_f(Ct,it,Ue,X,ae,bi[1],Fi[0]),_f(Ct,it,Ue,X,ae,bi[1],Fi[1])}}return it}function td(X){return X.type==="MultiPolygon"?X.coordinates.map(R=>({type:"Polygon",coordinates:R})):X.type==="MultiLineString"?X.coordinates.map(R=>({type:"LineString",coordinates:R})):X.type==="MultiPoint"?X.coordinates.map(R=>({type:"Point",coordinates:R})):[X]}class Qh{constructor(R,ae){this.type=Et,this.geojson=R,this.geometries=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'distance' expression requires exactly one argument, but found ${R.length-1} instead.`);if(sa(R[1])){let ke=R[1];if(ke.type==="FeatureCollection")return new Qh(ke,ke.features.map(Ue=>td(Ue.geometry)).flat());if(ke.type==="Feature")return new Qh(ke,td(ke.geometry));if("type"in ke&&"coordinates"in ke)return new Qh(ke,td(ke))}return ae.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(ae,ke){let Ue=ae.geometry(),et=Ue.flat().map($t=>So([$t.x,$t.y],ae.canonical));if(Ue.length===0)return NaN;let it=new ed(et[0][1]),Ct=1/0;for(let $t of ke){switch($t.type){case"Point":Ct=Math.min(Ct,hc(et,!1,[$t.coordinates],!1,it,Ct));break;case"LineString":Ct=Math.min(Ct,hc(et,!1,$t.coordinates,!0,it,Ct));break;case"Polygon":Ct=Math.min(Ct,yh(et,!1,$t.coordinates,it,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries);if(R.geometryType()==="LineString")return function(ae,ke){let Ue=ae.geometry(),et=Ue.flat().map($t=>So([$t.x,$t.y],ae.canonical));if(Ue.length===0)return NaN;let it=new ed(et[0][1]),Ct=1/0;for(let $t of ke){switch($t.type){case"Point":Ct=Math.min(Ct,hc(et,!0,[$t.coordinates],!1,it,Ct));break;case"LineString":Ct=Math.min(Ct,hc(et,!0,$t.coordinates,!0,it,Ct));break;case"Polygon":Ct=Math.min(Ct,yh(et,!0,$t.coordinates,it,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries);if(R.geometryType()==="Polygon")return function(ae,ke){let Ue=ae.geometry();if(Ue.length===0||Ue[0].length===0)return NaN;let et=uh(Ue,0).map($t=>$t.map(or=>or.map(Sr=>So([Sr.x,Sr.y],ae.canonical)))),it=new ed(et[0][0][0][1]),Ct=1/0;for(let $t of ke)for(let or of et){switch($t.type){case"Point":Ct=Math.min(Ct,yh([$t.coordinates],!1,or,it,Ct));break;case"LineString":Ct=Math.min(Ct,yh($t.coordinates,!0,or,it,Ct));break;case"Polygon":Ct=Math.min(Ct,jl(or,$t.coordinates,it,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Ef={"==":ds,"!=":xl,">":Gl,"<":ol,">=":Bs,"<=":ms,array:qr,at:xr,boolean:qr,case:_n,coalesce:fs,collator:No,format:Il,image:Jl,in:Jr,"index-of":Ri,interpolate:Wa,"interpolate-hcl":Wa,"interpolate-lab":Wa,length:ou,let:yi,literal:ro,match:tn,number:qr,"number-format":Es,object:qr,slice:Zi,step:dn,string:qr,"to-boolean":oi,"to-color":oi,"to-number":oi,"to-string":oi,var:zt,within:Ll,distance:Qh};class vc{constructor(R,ae,ke,Ue){this.name=R,this.type=ae,this._evaluate=ke,this.args=Ue}evaluate(R){return this._evaluate(R,this.args)}eachChild(R){this.args.forEach(R)}outputDefined(){return!1}static parse(R,ae){let ke=R[0],Ue=vc.definitions[ke];if(!Ue)return ae.error(`Unknown expression "${ke}". If you wanted a literal array, use ["literal", [...]].`,0);let et=Array.isArray(Ue)?Ue[0]:Ue.type,it=Array.isArray(Ue)?[[Ue[1],Ue[2]]]:Ue.overloads,Ct=it.filter(([or])=>!Array.isArray(or)||or.length===R.length-1),$t=null;for(let[or,Sr]of Ct){$t=new Pi(ae.registry,rd,ae.path,null,ae.scope);let Rr=[],ai=!1;for(let bi=1;bi{return ai=Rr,Array.isArray(ai)?`(${ai.map(ot).join(", ")})`:`(${ot(ai.type)}...)`;var ai}).join(" | "),Sr=[];for(let Rr=1;Rr{ae=R?ae&&rd(ke):ae&&ke instanceof ro}),!!ae&&id(X)&&hd(X,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function id(X){if(X instanceof vc&&(X.name==="get"&&X.args.length===1||X.name==="feature-state"||X.name==="has"&&X.args.length===1||X.name==="properties"||X.name==="geometry-type"||X.name==="id"||/^filter-/.test(X.name))||X instanceof Ll||X instanceof Qh)return!1;let R=!0;return X.eachChild(ae=>{R&&!id(ae)&&(R=!1)}),R}function _h(X){if(X instanceof vc&&X.name==="feature-state")return!1;let R=!0;return X.eachChild(ae=>{R&&!_h(ae)&&(R=!1)}),R}function hd(X,R){if(X instanceof vc&&R.indexOf(X.name)>=0)return!1;let ae=!0;return X.eachChild(ke=>{ae&&!hd(ke,R)&&(ae=!1)}),ae}function Nh(X){return{result:"success",value:X}}function Mh(X){return{result:"error",value:X}}function yc(X){return X["property-type"]==="data-driven"||X["property-type"]==="cross-faded-data-driven"}function df(X){return!!X.expression&&X.expression.parameters.indexOf("zoom")>-1}function nd(X){return!!X.expression&&X.expression.interpolated}function uu(X){return X instanceof Number?"number":X instanceof String?"string":X instanceof Boolean?"boolean":Array.isArray(X)?"array":X===null?"null":typeof X}function Nf(X){return typeof X=="object"&&X!==null&&!Array.isArray(X)}function Xd(X){return X}function fd(X,R){let ae=R.type==="color",ke=X.stops&&typeof X.stops[0][0]=="object",Ue=ke||!(ke||X.property!==void 0),et=X.type||(nd(R)?"exponential":"interval");if(ae||R.type==="padding"){let Sr=ae?Cr.parse:Hi.parse;(X=Ee({},X)).stops&&(X.stops=X.stops.map(Rr=>[Rr[0],Sr(Rr[1])])),X.default=Sr(X.default?X.default:R.default)}if(X.colorSpace&&(it=X.colorSpace)!=="rgb"&&it!=="hcl"&&it!=="lab")throw new Error(`Unknown color space: "${X.colorSpace}"`);var it;let Ct,$t,or;if(et==="exponential")Ct=pd;else if(et==="interval")Ct=Yc;else if(et==="categorical"){Ct=dd,$t=Object.create(null);for(let Sr of X.stops)$t[Sr[0]]=Sr[1];or=typeof X.stops[0][0]}else{if(et!=="identity")throw new Error(`Unknown function type "${et}"`);Ct=Vu}if(ke){let Sr={},Rr=[];for(let Fi=0;FiFi[0]),evaluate:({zoom:Fi},Gi)=>pd({stops:ai,base:X.base},R,Fi).evaluate(Fi,Gi)}}if(Ue){let Sr=et==="exponential"?{name:"exponential",base:X.base!==void 0?X.base:1}:null;return{kind:"camera",interpolationType:Sr,interpolationFactor:Wa.interpolationFactor.bind(void 0,Sr),zoomStops:X.stops.map(Rr=>Rr[0]),evaluate:({zoom:Rr})=>Ct(X,R,Rr,$t,or)}}return{kind:"source",evaluate(Sr,Rr){let ai=Rr&&Rr.properties?Rr.properties[X.property]:void 0;return ai===void 0?Pf(X.default,R.default):Ct(X,R,ai,$t,or)}}}function Pf(X,R,ae){return X!==void 0?X:R!==void 0?R:ae!==void 0?ae:void 0}function dd(X,R,ae,ke,Ue){return Pf(typeof ae===Ue?ke[ae]:void 0,X.default,R.default)}function Yc(X,R,ae){if(uu(ae)!=="number")return Pf(X.default,R.default);let ke=X.stops.length;if(ke===1||ae<=X.stops[0][0])return X.stops[0][1];if(ae>=X.stops[ke-1][0])return X.stops[ke-1][1];let Ue=Wi(X.stops.map(et=>et[0]),ae);return X.stops[Ue][1]}function pd(X,R,ae){let ke=X.base!==void 0?X.base:1;if(uu(ae)!=="number")return Pf(X.default,R.default);let Ue=X.stops.length;if(Ue===1||ae<=X.stops[0][0])return X.stops[0][1];if(ae>=X.stops[Ue-1][0])return X.stops[Ue-1][1];let et=Wi(X.stops.map(Sr=>Sr[0]),ae),it=function(Sr,Rr,ai,bi){let Fi=bi-ai,Gi=Sr-ai;return Fi===0?0:Rr===1?Gi/Fi:(Math.pow(Rr,Gi)-1)/(Math.pow(Rr,Fi)-1)}(ae,ke,X.stops[et][0],X.stops[et+1][0]),Ct=X.stops[et][1],$t=X.stops[et+1][1],or=Wo[R.type]||Xd;return typeof Ct.evaluate=="function"?{evaluate(...Sr){let Rr=Ct.evaluate.apply(void 0,Sr),ai=$t.evaluate.apply(void 0,Sr);if(Rr!==void 0&&ai!==void 0)return or(Rr,ai,it,X.colorSpace)}}:or(Ct,$t,it,X.colorSpace)}function Vu(X,R,ae){switch(R.type){case"color":ae=Cr.parse(ae);break;case"formatted":ae=Ui.fromString(ae.toString());break;case"resolvedImage":ae=Gn.fromString(ae.toString());break;case"padding":ae=Hi.parse(ae);break;default:uu(ae)===R.type||R.type==="enum"&&R.values[ae]||(ae=void 0)}return Pf(ae,X.default,R.default)}vc.register(Ef,{error:[{kind:"error"},[Gt],(X,[R])=>{throw new Ft(R.evaluate(X))}],typeof:[Gt,[Kr],(X,[R])=>ot(Mn(R.evaluate(X)))],"to-rgba":[Je(Et,4),[gr],(X,[R])=>{let[ae,ke,Ue,et]=R.evaluate(X).rgb;return[255*ae,255*ke,255*Ue,et]}],rgb:[gr,[Et,Et,Et],Ld],rgba:[gr,[Et,Et,Et,Et],Ld],has:{type:Jt,overloads:[[[Gt],(X,[R])=>cd(R.evaluate(X),X.properties())],[[Gt,mr],(X,[R,ae])=>cd(R.evaluate(X),ae.evaluate(X))]]},get:{type:Kr,overloads:[[[Gt],(X,[R])=>Lf(R.evaluate(X),X.properties())],[[Gt,mr],(X,[R,ae])=>Lf(R.evaluate(X),ae.evaluate(X))]]},"feature-state":[Kr,[Gt],(X,[R])=>Lf(R.evaluate(X),X.featureState||{})],properties:[mr,[],X=>X.properties()],"geometry-type":[Gt,[],X=>X.geometryType()],id:[Kr,[],X=>X.id()],zoom:[Et,[],X=>X.globals.zoom],"heatmap-density":[Et,[],X=>X.globals.heatmapDensity||0],"line-progress":[Et,[],X=>X.globals.lineProgress||0],accumulated:[Kr,[],X=>X.globals.accumulated===void 0?null:X.globals.accumulated],"+":[Et,ef(Et),(X,R)=>{let ae=0;for(let ke of R)ae+=ke.evaluate(X);return ae}],"*":[Et,ef(Et),(X,R)=>{let ae=1;for(let ke of R)ae*=ke.evaluate(X);return ae}],"-":{type:Et,overloads:[[[Et,Et],(X,[R,ae])=>R.evaluate(X)-ae.evaluate(X)],[[Et],(X,[R])=>-R.evaluate(X)]]},"/":[Et,[Et,Et],(X,[R,ae])=>R.evaluate(X)/ae.evaluate(X)],"%":[Et,[Et,Et],(X,[R,ae])=>R.evaluate(X)%ae.evaluate(X)],ln2:[Et,[],()=>Math.LN2],pi:[Et,[],()=>Math.PI],e:[Et,[],()=>Math.E],"^":[Et,[Et,Et],(X,[R,ae])=>Math.pow(R.evaluate(X),ae.evaluate(X))],sqrt:[Et,[Et],(X,[R])=>Math.sqrt(R.evaluate(X))],log10:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))/Math.LN10],ln:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))],log2:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))/Math.LN2],sin:[Et,[Et],(X,[R])=>Math.sin(R.evaluate(X))],cos:[Et,[Et],(X,[R])=>Math.cos(R.evaluate(X))],tan:[Et,[Et],(X,[R])=>Math.tan(R.evaluate(X))],asin:[Et,[Et],(X,[R])=>Math.asin(R.evaluate(X))],acos:[Et,[Et],(X,[R])=>Math.acos(R.evaluate(X))],atan:[Et,[Et],(X,[R])=>Math.atan(R.evaluate(X))],min:[Et,ef(Et),(X,R)=>Math.min(...R.map(ae=>ae.evaluate(X)))],max:[Et,ef(Et),(X,R)=>Math.max(...R.map(ae=>ae.evaluate(X)))],abs:[Et,[Et],(X,[R])=>Math.abs(R.evaluate(X))],round:[Et,[Et],(X,[R])=>{let ae=R.evaluate(X);return ae<0?-Math.round(-ae):Math.round(ae)}],floor:[Et,[Et],(X,[R])=>Math.floor(R.evaluate(X))],ceil:[Et,[Et],(X,[R])=>Math.ceil(R.evaluate(X))],"filter-==":[Jt,[Gt,Kr],(X,[R,ae])=>X.properties()[R.value]===ae.value],"filter-id-==":[Jt,[Kr],(X,[R])=>X.id()===R.value],"filter-type-==":[Jt,[Gt],(X,[R])=>X.geometryType()===R.value],"filter-<":[Jt,[Gt,Kr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae":[Jt,[Gt,Kr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke>Ue}],"filter-id->":[Jt,[Kr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae>ke}],"filter-<=":[Jt,[Gt,Kr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke<=Ue}],"filter-id-<=":[Jt,[Kr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae<=ke}],"filter->=":[Jt,[Gt,Kr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke>=Ue}],"filter-id->=":[Jt,[Kr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae>=ke}],"filter-has":[Jt,[Kr],(X,[R])=>R.value in X.properties()],"filter-has-id":[Jt,[],X=>X.id()!==null&&X.id()!==void 0],"filter-type-in":[Jt,[Je(Gt)],(X,[R])=>R.value.indexOf(X.geometryType())>=0],"filter-id-in":[Jt,[Je(Kr)],(X,[R])=>R.value.indexOf(X.id())>=0],"filter-in-small":[Jt,[Gt,Je(Kr)],(X,[R,ae])=>ae.value.indexOf(X.properties()[R.value])>=0],"filter-in-large":[Jt,[Gt,Je(Kr)],(X,[R,ae])=>function(ke,Ue,et,it){for(;et<=it;){let Ct=et+it>>1;if(Ue[Ct]===ke)return!0;Ue[Ct]>ke?it=Ct-1:et=Ct+1}return!1}(X.properties()[R.value],ae.value,0,ae.value.length-1)],all:{type:Jt,overloads:[[[Jt,Jt],(X,[R,ae])=>R.evaluate(X)&&ae.evaluate(X)],[ef(Jt),(X,R)=>{for(let ae of R)if(!ae.evaluate(X))return!1;return!0}]]},any:{type:Jt,overloads:[[[Jt,Jt],(X,[R,ae])=>R.evaluate(X)||ae.evaluate(X)],[ef(Jt),(X,R)=>{for(let ae of R)if(ae.evaluate(X))return!0;return!1}]]},"!":[Jt,[Jt],(X,[R])=>!R.evaluate(X)],"is-supported-script":[Jt,[Gt],(X,[R])=>{let ae=X.globals&&X.globals.isSupportedScript;return!ae||ae(R.evaluate(X))}],upcase:[Gt,[Gt],(X,[R])=>R.evaluate(X).toUpperCase()],downcase:[Gt,[Gt],(X,[R])=>R.evaluate(X).toLowerCase()],concat:[Gt,ef(Kr),(X,R)=>R.map(ae=>Ha(ae.evaluate(X))).join("")],"resolved-locale":[Gt,[ri],(X,[R])=>R.evaluate(X).resolvedLocale()]});class Xc{constructor(R,ae){var ke;this.expression=R,this._warningHistory={},this._evaluator=new si,this._defaultValue=ae?(ke=ae).type==="color"&&Nf(ke.default)?new Cr(0,0,0,0):ke.type==="color"?Cr.parse(ke.default)||null:ke.type==="padding"?Hi.parse(ke.default)||null:ke.type==="variableAnchorOffsetCollection"?Rn.parse(ke.default)||null:ke.default===void 0?null:ke.default:null,this._enumValues=ae&&ae.type==="enum"?ae.values:null}evaluateWithoutErrorHandling(R,ae,ke,Ue,et,it){return this._evaluator.globals=R,this._evaluator.feature=ae,this._evaluator.featureState=ke,this._evaluator.canonical=Ue,this._evaluator.availableImages=et||null,this._evaluator.formattedSection=it,this.expression.evaluate(this._evaluator)}evaluate(R,ae,ke,Ue,et,it){this._evaluator.globals=R,this._evaluator.feature=ae||null,this._evaluator.featureState=ke||null,this._evaluator.canonical=Ue,this._evaluator.availableImages=et||null,this._evaluator.formattedSection=it||null;try{let Ct=this.expression.evaluate(this._evaluator);if(Ct==null||typeof Ct=="number"&&Ct!=Ct)return this._defaultValue;if(this._enumValues&&!(Ct in this._enumValues))throw new Ft(`Expected value to be one of ${Object.keys(this._enumValues).map($t=>JSON.stringify($t)).join(", ")}, but found ${JSON.stringify(Ct)} instead.`);return Ct}catch(Ct){return this._warningHistory[Ct.message]||(this._warningHistory[Ct.message]=!0,typeof console<"u"&&console.warn(Ct.message)),this._defaultValue}}}function tf(X){return Array.isArray(X)&&X.length>0&&typeof X[0]=="string"&&X[0]in Ef}function _u(X,R){let ae=new Pi(Ef,rd,[],R?function(Ue){let et={color:gr,string:Gt,number:Et,enum:Gt,boolean:Jt,formatted:Mr,padding:ui,resolvedImage:mi,variableAnchorOffsetCollection:Ot};return Ue.type==="array"?Je(et[Ue.value]||Kr,Ue.length):et[Ue.type]}(R):void 0),ke=ae.parse(X,void 0,void 0,void 0,R&&R.type==="string"?{typeAnnotation:"coerce"}:void 0);return ke?Nh(new Xc(ke,R)):Mh(ae.errors)}class jh{constructor(R,ae){this.kind=R,this._styleExpression=ae,this.isStateDependent=R!=="constant"&&!_h(ae.expression)}evaluateWithoutErrorHandling(R,ae,ke,Ue,et,it){return this._styleExpression.evaluateWithoutErrorHandling(R,ae,ke,Ue,et,it)}evaluate(R,ae,ke,Ue,et,it){return this._styleExpression.evaluate(R,ae,ke,Ue,et,it)}}class Rc{constructor(R,ae,ke,Ue){this.kind=R,this.zoomStops=ke,this._styleExpression=ae,this.isStateDependent=R!=="camera"&&!_h(ae.expression),this.interpolationType=Ue}evaluateWithoutErrorHandling(R,ae,ke,Ue,et,it){return this._styleExpression.evaluateWithoutErrorHandling(R,ae,ke,Ue,et,it)}evaluate(R,ae,ke,Ue,et,it){return this._styleExpression.evaluate(R,ae,ke,Ue,et,it)}interpolationFactor(R,ae,ke){return this.interpolationType?Wa.interpolationFactor(this.interpolationType,R,ae,ke):0}}function Jc(X,R){let ae=_u(X,R);if(ae.result==="error")return ae;let ke=ae.value.expression,Ue=id(ke);if(!Ue&&!yc(R))return Mh([new nt("","data expressions not supported")]);let et=hd(ke,["zoom"]);if(!et&&!df(R))return Mh([new nt("","zoom expressions not supported")]);let it=xf(ke);return it||et?it instanceof nt?Mh([it]):it instanceof Wa&&!nd(R)?Mh([new nt("",'"interpolate" expressions cannot be used with this property')]):Nh(it?new Rc(Ue?"camera":"composite",ae.value,it.labels,it instanceof Wa?it.interpolation:void 0):new jh(Ue?"constant":"source",ae.value)):Mh([new nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Eu{constructor(R,ae){this._parameters=R,this._specification=ae,Ee(this,fd(this._parameters,this._specification))}static deserialize(R){return new Eu(R._parameters,R._specification)}static serialize(R){return{_parameters:R._parameters,_specification:R._specification}}}function xf(X){let R=null;if(X instanceof yi)R=xf(X.result);else if(X instanceof fs){for(let ae of X.args)if(R=xf(ae),R)break}else(X instanceof dn||X instanceof Wa)&&X.input instanceof vc&&X.input.name==="zoom"&&(R=X);return R instanceof nt||X.eachChild(ae=>{let ke=xf(ae);ke instanceof nt?R=ke:!R&&ke?R=new nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):R&&ke&&R!==ke&&(R=new nt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),R}function Eh(X){if(X===!0||X===!1)return!0;if(!Array.isArray(X)||X.length===0)return!1;switch(X[0]){case"has":return X.length>=2&&X[1]!=="$id"&&X[1]!=="$type";case"in":return X.length>=3&&(typeof X[1]!="string"||Array.isArray(X[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return X.length!==3||Array.isArray(X[1])||Array.isArray(X[2]);case"any":case"all":for(let R of X.slice(1))if(!Eh(R)&&typeof R!="boolean")return!1;return!0;default:return!0}}let rf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jf(X){if(X==null)return{filter:()=>!0,needGeometry:!1};Eh(X)||(X=bf(X));let R=_u(X,rf);if(R.result==="error")throw new Error(R.value.map(ae=>`${ae.key}: ${ae.message}`).join(", "));return{filter:(ae,ke,Ue)=>R.value.evaluate(ae,ke,{},Ue),needGeometry:Tp(X)}}function Jd(X,R){return XR?1:0}function Tp(X){if(!Array.isArray(X))return!1;if(X[0]==="within"||X[0]==="distance")return!0;for(let R=1;R"||R==="<="||R===">="?Uf(X[1],X[2],R):R==="any"?(ae=X.slice(1),["any"].concat(ae.map(bf))):R==="all"?["all"].concat(X.slice(1).map(bf)):R==="none"?["all"].concat(X.slice(1).map(bf).map(ch)):R==="in"?Dc(X[1],X.slice(2)):R==="!in"?ch(Dc(X[1],X.slice(2))):R==="has"?wf(X[1]):R!=="!has"||ch(wf(X[1]));var ae}function Uf(X,R,ae){switch(X){case"$type":return[`filter-type-${ae}`,R];case"$id":return[`filter-id-${ae}`,R];default:return[`filter-${ae}`,X,R]}}function Dc(X,R){if(R.length===0)return!1;switch(X){case"$type":return["filter-type-in",["literal",R]];case"$id":return["filter-id-in",["literal",R]];default:return R.length>200&&!R.some(ae=>typeof ae!=typeof R[0])?["filter-in-large",X,["literal",R.sort(Jd)]]:["filter-in-small",X,["literal",R]]}}function wf(X){switch(X){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",X]}}function ch(X){return["!",X]}function kf(X){let R=typeof X;if(R==="number"||R==="boolean"||R==="string"||X==null)return JSON.stringify(X);if(Array.isArray(X)){let Ue="[";for(let et of X)Ue+=`${kf(et)},`;return`${Ue}]`}let ae=Object.keys(X).sort(),ke="{";for(let Ue=0;Ueke.maximum?[new ze(R,ae,`${ae} is greater than the maximum value ${ke.maximum}`)]:[]}function If(X){let R=X.valueSpec,ae=Lu(X.value.type),ke,Ue,et,it={},Ct=ae!=="categorical"&&X.value.property===void 0,$t=!Ct,or=uu(X.value.stops)==="array"&&uu(X.value.stops[0])==="array"&&uu(X.value.stops[0][0])==="object",Sr=Qc({key:X.key,value:X.value,valueSpec:X.styleSpec.function,validateSpec:X.validateSpec,style:X.style,styleSpec:X.styleSpec,objectElementValidators:{stops:function(bi){if(ae==="identity")return[new ze(bi.key,bi.value,'identity function may not have a "stops" property')];let Fi=[],Gi=bi.value;return Fi=Fi.concat(Pd({key:bi.key,value:Gi,valueSpec:bi.valueSpec,validateSpec:bi.validateSpec,style:bi.style,styleSpec:bi.styleSpec,arrayElementValidator:Rr})),uu(Gi)==="array"&&Gi.length===0&&Fi.push(new ze(bi.key,Gi,"array must have at least one stop")),Fi},default:function(bi){return bi.validateSpec({key:bi.key,value:bi.value,valueSpec:R,validateSpec:bi.validateSpec,style:bi.style,styleSpec:bi.styleSpec})}}});return ae==="identity"&&Ct&&Sr.push(new ze(X.key,X.value,'missing required property "property"')),ae==="identity"||X.value.stops||Sr.push(new ze(X.key,X.value,'missing required property "stops"')),ae==="exponential"&&X.valueSpec.expression&&!nd(X.valueSpec)&&Sr.push(new ze(X.key,X.value,"exponential functions not supported")),X.styleSpec.$version>=8&&($t&&!yc(X.valueSpec)?Sr.push(new ze(X.key,X.value,"property functions not supported")):Ct&&!df(X.valueSpec)&&Sr.push(new ze(X.key,X.value,"zoom functions not supported"))),ae!=="categorical"&&!or||X.value.property!==void 0||Sr.push(new ze(X.key,X.value,'"property" property is required')),Sr;function Rr(bi){let Fi=[],Gi=bi.value,pn=bi.key;if(uu(Gi)!=="array")return[new ze(pn,Gi,`array expected, ${uu(Gi)} found`)];if(Gi.length!==2)return[new ze(pn,Gi,`array length 2 expected, length ${Gi.length} found`)];if(or){if(uu(Gi[0])!=="object")return[new ze(pn,Gi,`object expected, ${uu(Gi[0])} found`)];if(Gi[0].zoom===void 0)return[new ze(pn,Gi,"object stop key must have zoom")];if(Gi[0].value===void 0)return[new ze(pn,Gi,"object stop key must have value")];if(et&&et>Lu(Gi[0].zoom))return[new ze(pn,Gi[0].zoom,"stop zoom values must appear in ascending order")];Lu(Gi[0].zoom)!==et&&(et=Lu(Gi[0].zoom),Ue=void 0,it={}),Fi=Fi.concat(Qc({key:`${pn}[0]`,value:Gi[0],valueSpec:{zoom:{}},validateSpec:bi.validateSpec,style:bi.style,styleSpec:bi.styleSpec,objectElementValidators:{zoom:Cu,value:ai}}))}else Fi=Fi.concat(ai({key:`${pn}[0]`,value:Gi[0],validateSpec:bi.validateSpec,style:bi.style,styleSpec:bi.styleSpec},Gi));return tf(Uh(Gi[1]))?Fi.concat([new ze(`${pn}[1]`,Gi[1],"expressions are not allowed in function stops.")]):Fi.concat(bi.validateSpec({key:`${pn}[1]`,value:Gi[1],valueSpec:R,validateSpec:bi.validateSpec,style:bi.style,styleSpec:bi.styleSpec}))}function ai(bi,Fi){let Gi=uu(bi.value),pn=Lu(bi.value),jn=bi.value!==null?bi.value:Fi;if(ke){if(Gi!==ke)return[new ze(bi.key,jn,`${Gi} stop domain type must match previous stop domain type ${ke}`)]}else ke=Gi;if(Gi!=="number"&&Gi!=="string"&&Gi!=="boolean")return[new ze(bi.key,jn,"stop domain value must be a number, string, or boolean")];if(Gi!=="number"&&ae!=="categorical"){let Fa=`number expected, ${Gi} found`;return yc(R)&&ae===void 0&&(Fa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(bi.key,jn,Fa)]}return ae!=="categorical"||Gi!=="number"||isFinite(pn)&&Math.floor(pn)===pn?ae!=="categorical"&&Gi==="number"&&Ue!==void 0&&pnnew ze(`${X.key}${ke.key}`,X.value,ke.message));let ae=R.value.expression||R.value._styleExpression.expression;if(X.expressionContext==="property"&&X.propertyKey==="text-font"&&!ae.outputDefined())return[new ze(X.key,X.value,`Invalid data expression for "${X.propertyKey}". Output values must be contained as literals within the expression.`)];if(X.expressionContext==="property"&&X.propertyType==="layout"&&!_h(ae))return[new ze(X.key,X.value,'"feature-state" data expressions are not supported with layout properties.')];if(X.expressionContext==="filter"&&!_h(ae))return[new ze(X.key,X.value,'"feature-state" data expressions are not supported with filters.')];if(X.expressionContext&&X.expressionContext.indexOf("cluster")===0){if(!hd(ae,["zoom","feature-state"]))return[new ze(X.key,X.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(X.expressionContext==="cluster-initial"&&!id(ae))return[new ze(X.key,X.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function hh(X){let R=X.key,ae=X.value,ke=X.valueSpec,Ue=[];return Array.isArray(ke.values)?ke.values.indexOf(Lu(ae))===-1&&Ue.push(new ze(R,ae,`expected one of [${ke.values.join(", ")}], ${JSON.stringify(ae)} found`)):Object.keys(ke.values).indexOf(Lu(ae))===-1&&Ue.push(new ze(R,ae,`expected one of [${Object.keys(ke.values).join(", ")}], ${JSON.stringify(ae)} found`)),Ue}function pf(X){return Eh(Uh(X.value))?nf(Ee({},X,{expressionContext:"filter",valueSpec:{value:"boolean"}})):af(X)}function af(X){let R=X.value,ae=X.key;if(uu(R)!=="array")return[new ze(ae,R,`array expected, ${uu(R)} found`)];let ke=X.styleSpec,Ue,et=[];if(R.length<1)return[new ze(ae,R,"filter array must have at least 1 element")];switch(et=et.concat(hh({key:`${ae}[0]`,value:R[0],valueSpec:ke.filter_operator,style:X.style,styleSpec:X.styleSpec})),Lu(R[0])){case"<":case"<=":case">":case">=":R.length>=2&&Lu(R[1])==="$type"&&et.push(new ze(ae,R,`"$type" cannot be use with operator "${R[0]}"`));case"==":case"!=":R.length!==3&&et.push(new ze(ae,R,`filter array for operator "${R[0]}" must have 3 elements`));case"in":case"!in":R.length>=2&&(Ue=uu(R[1]),Ue!=="string"&&et.push(new ze(`${ae}[1]`,R[1],`string expected, ${Ue} found`)));for(let it=2;it{or in ae&&R.push(new ze(ke,ae[or],`"${or}" is prohibited for ref layers`))}),Ue.layers.forEach(or=>{Lu(or.id)===Ct&&($t=or)}),$t?$t.ref?R.push(new ze(ke,ae.ref,"ref cannot reference another ref layer")):it=Lu($t.type):R.push(new ze(ke,ae.ref,`ref layer "${Ct}" not found`))}else if(it!=="background")if(ae.source){let $t=Ue.sources&&Ue.sources[ae.source],or=$t&&Lu($t.type);$t?or==="vector"&&it==="raster"?R.push(new ze(ke,ae.source,`layer "${ae.id}" requires a raster source`)):or!=="raster-dem"&&it==="hillshade"?R.push(new ze(ke,ae.source,`layer "${ae.id}" requires a raster-dem source`)):or==="raster"&&it!=="raster"?R.push(new ze(ke,ae.source,`layer "${ae.id}" requires a vector source`)):or!=="vector"||ae["source-layer"]?or==="raster-dem"&&it!=="hillshade"?R.push(new ze(ke,ae.source,"raster-dem source can only be used with layer type 'hillshade'.")):it!=="line"||!ae.paint||!ae.paint["line-gradient"]||or==="geojson"&&$t.lineMetrics||R.push(new ze(ke,ae,`layer "${ae.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):R.push(new ze(ke,ae,`layer "${ae.id}" must specify a "source-layer"`)):R.push(new ze(ke,ae.source,`source "${ae.source}" not found`))}else R.push(new ze(ke,ae,'missing required property "source"'));return R=R.concat(Qc({key:ke,value:ae,valueSpec:et.layer,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,objectElementValidators:{"*":()=>[],type:()=>X.validateSpec({key:`${ke}.type`,value:ae.type,valueSpec:et.layer.type,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,object:ae,objectKey:"type"}),filter:pf,layout:$t=>Qc({layer:ae,key:$t.key,value:$t.value,style:$t.style,styleSpec:$t.styleSpec,validateSpec:$t.validateSpec,objectElementValidators:{"*":or=>Ac(Ee({layerType:it},or))}}),paint:$t=>Qc({layer:ae,key:$t.key,value:$t.value,style:$t.style,styleSpec:$t.styleSpec,validateSpec:$t.validateSpec,objectElementValidators:{"*":or=>Qd(Ee({layerType:it},or))}})}})),R}function fh(X){let R=X.value,ae=X.key,ke=uu(R);return ke!=="string"?[new ze(ae,R,`string expected, ${ke} found`)]:[]}let $h={promoteId:function({key:X,value:R}){if(uu(R)==="string")return fh({key:X,value:R});{let ae=[];for(let ke in R)ae.push(...fh({key:`${X}.${ke}`,value:R[ke]}));return ae}}};function Ph(X){let R=X.value,ae=X.key,ke=X.styleSpec,Ue=X.style,et=X.validateSpec;if(!R.type)return[new ze(ae,R,'"type" is required')];let it=Lu(R.type),Ct;switch(it){case"vector":case"raster":return Ct=Qc({key:ae,value:R,valueSpec:ke[`source_${it.replace("-","_")}`],style:X.style,styleSpec:ke,objectElementValidators:$h,validateSpec:et}),Ct;case"raster-dem":return Ct=function($t){var or;let Sr=(or=$t.sourceName)!==null&&or!==void 0?or:"",Rr=$t.value,ai=$t.styleSpec,bi=ai.source_raster_dem,Fi=$t.style,Gi=[],pn=uu(Rr);if(Rr===void 0)return Gi;if(pn!=="object")return Gi.push(new ze("source_raster_dem",Rr,`object expected, ${pn} found`)),Gi;let jn=Lu(Rr.encoding)==="custom",Fa=["redFactor","greenFactor","blueFactor","baseShift"],ha=$t.value.encoding?`"${$t.value.encoding}"`:"Default";for(let Aa in Rr)!jn&&Fa.includes(Aa)?Gi.push(new ze(Aa,Rr[Aa],`In "${Sr}": "${Aa}" is only valid when "encoding" is set to "custom". ${ha} encoding found`)):bi[Aa]?Gi=Gi.concat($t.validateSpec({key:Aa,value:Rr[Aa],valueSpec:bi[Aa],validateSpec:$t.validateSpec,style:Fi,styleSpec:ai})):Gi.push(new ze(Aa,Rr[Aa],`unknown property "${Aa}"`));return Gi}({sourceName:ae,value:R,style:X.style,styleSpec:ke,validateSpec:et}),Ct;case"geojson":if(Ct=Qc({key:ae,value:R,valueSpec:ke.source_geojson,style:Ue,styleSpec:ke,validateSpec:et,objectElementValidators:$h}),R.cluster)for(let $t in R.clusterProperties){let[or,Sr]=R.clusterProperties[$t],Rr=typeof or=="string"?[or,["accumulated"],["get",$t]]:or;Ct.push(...nf({key:`${ae}.${$t}.map`,value:Sr,expressionContext:"cluster-map"})),Ct.push(...nf({key:`${ae}.${$t}.reduce`,value:Rr,expressionContext:"cluster-reduce"}))}return Ct;case"video":return Qc({key:ae,value:R,valueSpec:ke.source_video,style:Ue,validateSpec:et,styleSpec:ke});case"image":return Qc({key:ae,value:R,valueSpec:ke.source_image,style:Ue,validateSpec:et,styleSpec:ke});case"canvas":return[new ze(ae,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return hh({key:`${ae}.type`,value:R.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zu(X){let R=X.value,ae=X.styleSpec,ke=ae.light,Ue=X.style,et=[],it=uu(R);if(R===void 0)return et;if(it!=="object")return et=et.concat([new ze("light",R,`object expected, ${it} found`)]),et;for(let Ct in R){let $t=Ct.match(/^(.*)-transition$/);et=et.concat($t&&ke[$t[1]]&&ke[$t[1]].transition?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ae.transition,validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):[new ze(Ct,R[Ct],`unknown property "${Ct}"`)])}return et}function fu(X){let R=X.value,ae=X.styleSpec,ke=ae.sky,Ue=X.style,et=uu(R);if(R===void 0)return[];if(et!=="object")return[new ze("sky",R,`object expected, ${et} found`)];let it=[];for(let Ct in R)it=it.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],style:Ue,styleSpec:ae}):[new ze(Ct,R[Ct],`unknown property "${Ct}"`)]);return it}function Ih(X){let R=X.value,ae=X.styleSpec,ke=ae.terrain,Ue=X.style,et=[],it=uu(R);if(R===void 0)return et;if(it!=="object")return et=et.concat([new ze("terrain",R,`object expected, ${it} found`)]),et;for(let Ct in R)et=et.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):[new ze(Ct,R[Ct],`unknown property "${Ct}"`)]);return et}function Tf(X){let R=[],ae=X.value,ke=X.key;if(Array.isArray(ae)){let Ue=[],et=[];for(let it in ae)ae[it].id&&Ue.includes(ae[it].id)&&R.push(new ze(ke,ae,`all the sprites' ids must be unique, but ${ae[it].id} is duplicated`)),Ue.push(ae[it].id),ae[it].url&&et.includes(ae[it].url)&&R.push(new ze(ke,ae,`all the sprites' URLs must be unique, but ${ae[it].url} is duplicated`)),et.push(ae[it].url),R=R.concat(Qc({key:`${ke}[${it}]`,value:ae[it],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:X.validateSpec}));return R}return fh({key:ke,value:ae})}let Dh={"*":()=>[],array:Pd,boolean:function(X){let R=X.value,ae=X.key,ke=uu(R);return ke!=="boolean"?[new ze(ae,R,`boolean expected, ${ke} found`)]:[]},number:Cu,color:function(X){let R=X.key,ae=X.value,ke=uu(ae);return ke!=="string"?[new ze(R,ae,`color expected, ${ke} found`)]:Cr.parse(String(ae))?[]:[new ze(R,ae,`color expected, "${ae}" found`)]},constants:Lh,enum:hh,filter:pf,function:If,layer:md,object:Qc,source:Ph,light:Zu,sky:fu,terrain:Ih,projection:function(X){let R=X.value,ae=X.styleSpec,ke=ae.projection,Ue=X.style,et=uu(R);if(R===void 0)return[];if(et!=="object")return[new ze("projection",R,`object expected, ${et} found`)];let it=[];for(let Ct in R)it=it.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],style:Ue,styleSpec:ae}):[new ze(Ct,R[Ct],`unknown property "${Ct}"`)]);return it},string:fh,formatted:function(X){return fh(X).length===0?[]:nf(X)},resolvedImage:function(X){return fh(X).length===0?[]:nf(X)},padding:function(X){let R=X.key,ae=X.value;if(uu(ae)==="array"){if(ae.length<1||ae.length>4)return[new ze(R,ae,`padding requires 1 to 4 values; ${ae.length} values found`)];let ke={type:"number"},Ue=[];for(let et=0;et[]}})),X.constants&&(ae=ae.concat(Lh({key:"constants",value:X.constants}))),Ai(ae)}function Ni(X){return function(R){return X(Dt(kt({},R),{validateSpec:ad}))}}function Ai(X){return[].concat(X).sort((R,ae)=>R.line-ae.line)}function hn(X){return function(...R){return Ai(X.apply(this,R))}}Yr.source=hn(Ni(Ph)),Yr.sprite=hn(Ni(Tf)),Yr.glyphs=hn(Ni(wr)),Yr.light=hn(Ni(Zu)),Yr.sky=hn(Ni(fu)),Yr.terrain=hn(Ni(Ih)),Yr.layer=hn(Ni(md)),Yr.filter=hn(Ni(pf)),Yr.paintProperty=hn(Ni(Qd)),Yr.layoutProperty=hn(Ni(Ac));let Ln=Yr,pa=Ln.light,Ea=Ln.sky,Za=Ln.paintProperty,ao=Ln.layoutProperty;function xa(X,R){let ae=!1;if(R&&R.length)for(let ke of R)X.fire(new J(new Error(ke.message))),ae=!0;return ae}class Va{constructor(R,ae,ke){let Ue=this.cells=[];if(R instanceof ArrayBuffer){this.arrayBuffer=R;let it=new Int32Array(this.arrayBuffer);R=it[0],this.d=(ae=it[1])+2*(ke=it[2]);for(let $t=0;$t=Rr[Fi+0]&&Ue>=Rr[Fi+1])?(Ct[bi]=!0,it.push(Sr[bi])):Ct[bi]=!1}}}}_forEachCell(R,ae,ke,Ue,et,it,Ct,$t){let or=this._convertToCellCoord(R),Sr=this._convertToCellCoord(ae),Rr=this._convertToCellCoord(ke),ai=this._convertToCellCoord(Ue);for(let bi=or;bi<=Rr;bi++)for(let Fi=Sr;Fi<=ai;Fi++){let Gi=this.d*Fi+bi;if((!$t||$t(this._convertFromCellCoord(bi),this._convertFromCellCoord(Fi),this._convertFromCellCoord(bi+1),this._convertFromCellCoord(Fi+1)))&&et.call(this,R,ae,ke,Ue,Gi,it,Ct,$t))return}}_convertFromCellCoord(R){return(R-this.padding)/this.scale}_convertToCellCoord(R){return Math.max(0,Math.min(this.d-1,Math.floor(R*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let R=this.cells,ae=3+this.cells.length+1+1,ke=0;for(let it=0;it=0)continue;let it=X[et];Ue[et]=Oa[ae].shallow.indexOf(et)>=0?it:ps(it,R)}X instanceof Error&&(Ue.message=X.message)}if(Ue.$name)throw new Error("$name property is reserved for worker serialization logic.");return ae!=="Object"&&(Ue.$name=ae),Ue}function xs(X){if(rs(X))return X;if(Array.isArray(X))return X.map(xs);if(typeof X!="object")throw new Error("can't deserialize object of type "+typeof X);let R=hs(X)||"Object";if(!Oa[R])throw new Error(`can't deserialize unregistered class ${R}`);let{klass:ae}=Oa[R];if(!ae)throw new Error(`can't deserialize unregistered class ${R}`);if(ae.deserialize)return ae.deserialize(X);let ke=Object.create(ae.prototype);for(let Ue of Object.keys(X)){if(Ue==="$name")continue;let et=X[Ue];ke[Ue]=Oa[R].shallow.indexOf(Ue)>=0?et:xs(et)}return ke}class _o{constructor(){this.first=!0}update(R,ae){let ke=Math.floor(R);return this.first?(this.first=!1,this.lastIntegerZoom=ke,this.lastIntegerZoomTime=0,this.lastZoom=R,this.lastFloorZoom=ke,!0):(this.lastFloorZoom>ke?(this.lastIntegerZoom=ke+1,this.lastIntegerZoomTime=ae):this.lastFloorZoomX>=128&&X<=255,"Hangul Jamo":X=>X>=4352&&X<=4607,Khmer:X=>X>=6016&&X<=6143,"General Punctuation":X=>X>=8192&&X<=8303,"Letterlike Symbols":X=>X>=8448&&X<=8527,"Number Forms":X=>X>=8528&&X<=8591,"Miscellaneous Technical":X=>X>=8960&&X<=9215,"Control Pictures":X=>X>=9216&&X<=9279,"Optical Character Recognition":X=>X>=9280&&X<=9311,"Enclosed Alphanumerics":X=>X>=9312&&X<=9471,"Geometric Shapes":X=>X>=9632&&X<=9727,"Miscellaneous Symbols":X=>X>=9728&&X<=9983,"Miscellaneous Symbols and Arrows":X=>X>=11008&&X<=11263,"Ideographic Description Characters":X=>X>=12272&&X<=12287,"CJK Symbols and Punctuation":X=>X>=12288&&X<=12351,Katakana:X=>X>=12448&&X<=12543,Kanbun:X=>X>=12688&&X<=12703,"CJK Strokes":X=>X>=12736&&X<=12783,"Enclosed CJK Letters and Months":X=>X>=12800&&X<=13055,"CJK Compatibility":X=>X>=13056&&X<=13311,"Yijing Hexagram Symbols":X=>X>=19904&&X<=19967,"Private Use Area":X=>X>=57344&&X<=63743,"Vertical Forms":X=>X>=65040&&X<=65055,"CJK Compatibility Forms":X=>X>=65072&&X<=65103,"Small Form Variants":X=>X>=65104&&X<=65135,"Halfwidth and Fullwidth Forms":X=>X>=65280&&X<=65519};function bs(X){for(let R of X)if(Cl(R.charCodeAt(0)))return!0;return!1}function ll(X){for(let R of X)if(!Ql(R.charCodeAt(0)))return!1;return!0}function Ul(X){let R=X.map(ae=>{try{return new RegExp(`\\p{sc=${ae}}`,"u").source}catch{return null}}).filter(ae=>ae);return new RegExp(R.join("|"),"u")}let mu=Ul(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ql(X){return!mu.test(String.fromCodePoint(X))}let gu=Ul(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Cl(X){return!(X!==746&&X!==747&&(X<4352||!(io["CJK Compatibility Forms"](X)&&!(X>=65097&&X<=65103)||io["CJK Compatibility"](X)||io["CJK Strokes"](X)||!(!io["CJK Symbols and Punctuation"](X)||X>=12296&&X<=12305||X>=12308&&X<=12319||X===12336)||io["Enclosed CJK Letters and Months"](X)||io["Ideographic Description Characters"](X)||io.Kanbun(X)||io.Katakana(X)&&X!==12540||!(!io["Halfwidth and Fullwidth Forms"](X)||X===65288||X===65289||X===65293||X>=65306&&X<=65310||X===65339||X===65341||X===65343||X>=65371&&X<=65503||X===65507||X>=65512&&X<=65519)||!(!io["Small Form Variants"](X)||X>=65112&&X<=65118||X>=65123&&X<=65126)||io["Vertical Forms"](X)||io["Yijing Hexagram Symbols"](X)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(X))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(X))||gu.test(String.fromCodePoint(X)))))}function ec(X){return!(Cl(X)||function(R){return!!(io["Latin-1 Supplement"](R)&&(R===167||R===169||R===174||R===177||R===188||R===189||R===190||R===215||R===247)||io["General Punctuation"](R)&&(R===8214||R===8224||R===8225||R===8240||R===8241||R===8251||R===8252||R===8258||R===8263||R===8264||R===8265||R===8273)||io["Letterlike Symbols"](R)||io["Number Forms"](R)||io["Miscellaneous Technical"](R)&&(R>=8960&&R<=8967||R>=8972&&R<=8991||R>=8996&&R<=9e3||R===9003||R>=9085&&R<=9114||R>=9150&&R<=9165||R===9167||R>=9169&&R<=9179||R>=9186&&R<=9215)||io["Control Pictures"](R)&&R!==9251||io["Optical Character Recognition"](R)||io["Enclosed Alphanumerics"](R)||io["Geometric Shapes"](R)||io["Miscellaneous Symbols"](R)&&!(R>=9754&&R<=9759)||io["Miscellaneous Symbols and Arrows"](R)&&(R>=11026&&R<=11055||R>=11088&&R<=11097||R>=11192&&R<=11243)||io["CJK Symbols and Punctuation"](R)||io.Katakana(R)||io["Private Use Area"](R)||io["CJK Compatibility Forms"](R)||io["Small Form Variants"](R)||io["Halfwidth and Fullwidth Forms"](R)||R===8734||R===8756||R===8757||R>=9984&&R<=10087||R>=10102&&R<=10131||R===65532||R===65533)}(X))}let $u=Ul(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function xu(X){return $u.test(String.fromCodePoint(X))}function Ho(X,R){return!(!R&&xu(X)||X>=2304&&X<=3583||X>=3840&&X<=4255||io.Khmer(X))}function Is(X){for(let R of X)if(xu(R.charCodeAt(0)))return!0;return!1}let iu=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(X){this.pluginStatus=X.pluginStatus,this.pluginURL=X.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(X){this.applyArabicShaping=X.applyArabicShaping,this.processBidirectionalText=X.processBidirectionalText,this.processStyledBidirectionalText=X.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Wl{constructor(R,ae){this.zoom=R,ae?(this.now=ae.now,this.fadeDuration=ae.fadeDuration,this.zoomHistory=ae.zoomHistory,this.transition=ae.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _o,this.transition={})}isSupportedScript(R){return function(ae,ke){for(let Ue of ae)if(!Ho(Ue.charCodeAt(0),ke))return!1;return!0}(R,iu.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let R=this.zoom,ae=R-Math.floor(R),ke=this.crossFadingFactor();return R>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:ae+(1-ae)*ke}:{fromScale:.5,toScale:1,t:1-(1-ke)*ae}}}class Mc{constructor(R,ae){this.property=R,this.value=ae,this.expression=function(ke,Ue){if(Nf(ke))return new Eu(ke,Ue);if(tf(ke)){let et=Jc(ke,Ue);if(et.result==="error")throw new Error(et.value.map(it=>`${it.key}: ${it.message}`).join(", "));return et.value}{let et=ke;return Ue.type==="color"&&typeof ke=="string"?et=Cr.parse(ke):Ue.type!=="padding"||typeof ke!="number"&&!Array.isArray(ke)?Ue.type==="variableAnchorOffsetCollection"&&Array.isArray(ke)&&(et=Rn.parse(ke)):et=Hi.parse(ke),{kind:"constant",evaluate:()=>et}}}(ae===void 0?R.specification.default:ae,R.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(R,ae,ke){return this.property.possiblyEvaluate(this,R,ae,ke)}}class eh{constructor(R){this.property=R,this.value=new Mc(R,void 0)}transitioned(R,ae){return new Hh(this.property,this.value,ae,E({},R.transition,this.transition),R.now)}untransitioned(){return new Hh(this.property,this.value,null,{},0)}}class Uc{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitionablePropertyValues)}getValue(R){return g(this._values[R].value.value)}setValue(R,ae){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].value=new Mc(this._values[R].property,ae===null?void 0:g(ae))}getTransition(R){return g(this._values[R].transition)}setTransition(R,ae){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].transition=g(ae)||void 0}serialize(){let R={};for(let ae of Object.keys(this._values)){let ke=this.getValue(ae);ke!==void 0&&(R[ae]=ke);let Ue=this.getTransition(ae);Ue!==void 0&&(R[`${ae}-transition`]=Ue)}return R}transitioned(R,ae){let ke=new th(this._properties);for(let Ue of Object.keys(this._values))ke._values[Ue]=this._values[Ue].transitioned(R,ae._values[Ue]);return ke}untransitioned(){let R=new th(this._properties);for(let ae of Object.keys(this._values))R._values[ae]=this._values[ae].untransitioned();return R}}class Hh{constructor(R,ae,ke,Ue,et){this.property=R,this.value=ae,this.begin=et+Ue.delay||0,this.end=this.begin+Ue.duration||0,R.specification.transition&&(Ue.delay||Ue.duration)&&(this.prior=ke)}possiblyEvaluate(R,ae,ke){let Ue=R.now||0,et=this.value.possiblyEvaluate(R,ae,ke),it=this.prior;if(it){if(Ue>this.end)return this.prior=null,et;if(this.value.isDataDriven())return this.prior=null,et;if(Ue=1)return 1;let or=$t*$t,Sr=or*$t;return 4*($t<.5?Sr:3*($t-or)+Sr-.75)}(Ct))}}return et}}class th{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitioningPropertyValues)}possiblyEvaluate(R,ae,ke){let Ue=new Wh(this._properties);for(let et of Object.keys(this._values))Ue._values[et]=this._values[et].possiblyEvaluate(R,ae,ke);return Ue}hasTransition(){for(let R of Object.keys(this._values))if(this._values[R].prior)return!0;return!1}}class Vh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPropertyValues)}hasValue(R){return this._values[R].value!==void 0}getValue(R){return g(this._values[R].value)}setValue(R,ae){this._values[R]=new Mc(this._values[R].property,ae===null?void 0:g(ae))}serialize(){let R={};for(let ae of Object.keys(this._values)){let ke=this.getValue(ae);ke!==void 0&&(R[ae]=ke)}return R}possiblyEvaluate(R,ae,ke){let Ue=new Wh(this._properties);for(let et of Object.keys(this._values))Ue._values[et]=this._values[et].possiblyEvaluate(R,ae,ke);return Ue}}class Wu{constructor(R,ae,ke){this.property=R,this.value=ae,this.parameters=ke}isConstant(){return this.value.kind==="constant"}constantOr(R){return this.value.kind==="constant"?this.value.value:R}evaluate(R,ae,ke,Ue){return this.property.evaluate(this.value,this.parameters,R,ae,ke,Ue)}}class Wh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPossiblyEvaluatedValues)}get(R){return this._values[R]}}class cs{constructor(R){this.specification=R}possiblyEvaluate(R,ae){if(R.isDataDriven())throw new Error("Value should not be data driven");return R.expression.evaluate(ae)}interpolate(R,ae,ke){let Ue=Wo[this.specification.type];return Ue?Ue(R,ae,ke):R}}class Fs{constructor(R,ae){this.specification=R,this.overrides=ae}possiblyEvaluate(R,ae,ke,Ue){return new Wu(this,R.expression.kind==="constant"||R.expression.kind==="camera"?{kind:"constant",value:R.expression.evaluate(ae,null,{},ke,Ue)}:R.expression,ae)}interpolate(R,ae,ke){if(R.value.kind!=="constant"||ae.value.kind!=="constant")return R;if(R.value.value===void 0||ae.value.value===void 0)return new Wu(this,{kind:"constant",value:void 0},R.parameters);let Ue=Wo[this.specification.type];if(Ue){let et=Ue(R.value.value,ae.value.value,ke);return new Wu(this,{kind:"constant",value:et},R.parameters)}return R}evaluate(R,ae,ke,Ue,et,it){return R.kind==="constant"?R.value:R.evaluate(ae,ke,Ue,et,it)}}class rh extends Fs{possiblyEvaluate(R,ae,ke,Ue){if(R.value===void 0)return new Wu(this,{kind:"constant",value:void 0},ae);if(R.expression.kind==="constant"){let et=R.expression.evaluate(ae,null,{},ke,Ue),it=R.property.specification.type==="resolvedImage"&&typeof et!="string"?et.name:et,Ct=this._calculate(it,it,it,ae);return new Wu(this,{kind:"constant",value:Ct},ae)}if(R.expression.kind==="camera"){let et=this._calculate(R.expression.evaluate({zoom:ae.zoom-1}),R.expression.evaluate({zoom:ae.zoom}),R.expression.evaluate({zoom:ae.zoom+1}),ae);return new Wu(this,{kind:"constant",value:et},ae)}return new Wu(this,R.expression,ae)}evaluate(R,ae,ke,Ue,et,it){if(R.kind==="source"){let Ct=R.evaluate(ae,ke,Ue,et,it);return this._calculate(Ct,Ct,Ct,ae)}return R.kind==="composite"?this._calculate(R.evaluate({zoom:Math.floor(ae.zoom)-1},ke,Ue),R.evaluate({zoom:Math.floor(ae.zoom)},ke,Ue),R.evaluate({zoom:Math.floor(ae.zoom)+1},ke,Ue),ae):R.value}_calculate(R,ae,ke,Ue){return Ue.zoom>Ue.zoomHistory.lastIntegerZoom?{from:R,to:ae}:{from:ke,to:ae}}interpolate(R){return R}}class tc{constructor(R){this.specification=R}possiblyEvaluate(R,ae,ke,Ue){if(R.value!==void 0){if(R.expression.kind==="constant"){let et=R.expression.evaluate(ae,null,{},ke,Ue);return this._calculate(et,et,et,ae)}return this._calculate(R.expression.evaluate(new Wl(Math.floor(ae.zoom-1),ae)),R.expression.evaluate(new Wl(Math.floor(ae.zoom),ae)),R.expression.evaluate(new Wl(Math.floor(ae.zoom+1),ae)),ae)}}_calculate(R,ae,ke,Ue){return Ue.zoom>Ue.zoomHistory.lastIntegerZoom?{from:R,to:ae}:{from:ke,to:ae}}interpolate(R){return R}}class od{constructor(R){this.specification=R}possiblyEvaluate(R,ae,ke,Ue){return!!R.expression.evaluate(ae,null,{},ke,Ue)}interpolate(){return!1}}class Ke{constructor(R){this.properties=R,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let ae in R){let ke=R[ae];ke.specification.overridable&&this.overridableProperties.push(ae);let Ue=this.defaultPropertyValues[ae]=new Mc(ke,void 0),et=this.defaultTransitionablePropertyValues[ae]=new eh(ke);this.defaultTransitioningPropertyValues[ae]=et.untransitioned(),this.defaultPossiblyEvaluatedValues[ae]=Ue.possiblyEvaluate({})}}}fa("DataDrivenProperty",Fs),fa("DataConstantProperty",cs),fa("CrossFadedDataDrivenProperty",rh),fa("CrossFadedProperty",tc),fa("ColorRampProperty",od);let O="-transition";class pe extends me{constructor(R,ae){if(super(),this.id=R.id,this.type=R.type,this._featureFilter={filter:()=>!0,needGeometry:!1},R.type!=="custom"&&(this.metadata=R.metadata,this.minzoom=R.minzoom,this.maxzoom=R.maxzoom,R.type!=="background"&&(this.source=R.source,this.sourceLayer=R["source-layer"],this.filter=R.filter),ae.layout&&(this._unevaluatedLayout=new Vh(ae.layout)),ae.paint)){this._transitionablePaint=new Uc(ae.paint);for(let ke in R.paint)this.setPaintProperty(ke,R.paint[ke],{validate:!1});for(let ke in R.layout)this.setLayoutProperty(ke,R.layout[ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Wh(ae.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(R){return R==="visibility"?this.visibility:this._unevaluatedLayout.getValue(R)}setLayoutProperty(R,ae,ke={}){ae!=null&&this._validate(ao,`layers.${this.id}.layout.${R}`,R,ae,ke)||(R!=="visibility"?this._unevaluatedLayout.setValue(R,ae):this.visibility=ae)}getPaintProperty(R){return R.endsWith(O)?this._transitionablePaint.getTransition(R.slice(0,-11)):this._transitionablePaint.getValue(R)}setPaintProperty(R,ae,ke={}){if(ae!=null&&this._validate(Za,`layers.${this.id}.paint.${R}`,R,ae,ke))return!1;if(R.endsWith(O))return this._transitionablePaint.setTransition(R.slice(0,-11),ae||void 0),!1;{let Ue=this._transitionablePaint._values[R],et=Ue.property.specification["property-type"]==="cross-faded-data-driven",it=Ue.value.isDataDriven(),Ct=Ue.value;this._transitionablePaint.setValue(R,ae),this._handleSpecialPaintPropertyUpdate(R);let $t=this._transitionablePaint._values[R].value;return $t.isDataDriven()||it||et||this._handleOverridablePaintPropertyUpdate(R,Ct,$t)}}_handleSpecialPaintPropertyUpdate(R){}_handleOverridablePaintPropertyUpdate(R,ae,ke){return!1}isHidden(R){return!!(this.minzoom&&R=this.maxzoom)||this.visibility==="none"}updateTransitions(R){this._transitioningPaint=this._transitionablePaint.transitioned(R,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(R,ae){R.getCrossfadeParameters&&(this._crossfadeParameters=R.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(R,void 0,ae)),this.paint=this._transitioningPaint.possiblyEvaluate(R,void 0,ae)}serialize(){let R={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(R.layout=R.layout||{},R.layout.visibility=this.visibility),p(R,(ae,ke)=>!(ae===void 0||ke==="layout"&&!Object.keys(ae).length||ke==="paint"&&!Object.keys(ae).length))}_validate(R,ae,ke,Ue,et={}){return(!et||et.validate!==!1)&&xa(this,R.call(Ln,{key:ae,layerType:this.type,objectKey:ke,value:Ue,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let R in this.paint._values){let ae=this.paint.get(R);if(ae instanceof Wu&&yc(ae.property.specification)&&(ae.value.kind==="source"||ae.value.kind==="composite")&&ae.value.isStateDependent)return!0}return!1}}let Ie={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Ne{constructor(R,ae){this._structArray=R,this._pos1=ae*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class qe{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(R,ae){return R._trim(),ae&&(R.isTransferred=!0,ae.push(R.arrayBuffer)),{length:R.length,arrayBuffer:R.arrayBuffer}}static deserialize(R){let ae=Object.create(this.prototype);return ae.arrayBuffer=R.arrayBuffer,ae.length=R.length,ae.capacity=R.arrayBuffer.byteLength/ae.bytesPerElement,ae._refreshViews(),ae}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(R){this.reserve(R),this.length=R}reserve(R){if(R>this.capacity){this.capacity=Math.max(R,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let ae=this.uint8;this._refreshViews(),ae&&this.uint8.set(ae)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Mt(X,R=1){let ae=0,ke=0;return{members:X.map(Ue=>{let et=Ie[Ue.type].BYTES_PER_ELEMENT,it=ae=jt(ae,Math.max(R,et)),Ct=Ue.components||1;return ke=Math.max(ke,et),ae+=et*Ct,{name:Ue.name,type:Ue.type,components:Ct,offset:it}}),size:jt(ae,Math.max(ke,R)),alignment:R}}function jt(X,R){return Math.ceil(X/R)*R}class er extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.int16[Ue+0]=ae,this.int16[Ue+1]=ke,R}}er.prototype.bytesPerElement=4,fa("StructArrayLayout2i4",er);class kr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let et=3*R;return this.int16[et+0]=ae,this.int16[et+1]=ke,this.int16[et+2]=Ue,R}}kr.prototype.bytesPerElement=6,fa("StructArrayLayout3i6",kr);class Hr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue){let et=this.length;return this.resize(et+1),this.emplace(et,R,ae,ke,Ue)}emplace(R,ae,ke,Ue,et){let it=4*R;return this.int16[it+0]=ae,this.int16[it+1]=ke,this.int16[it+2]=Ue,this.int16[it+3]=et,R}}Hr.prototype.bytesPerElement=8,fa("StructArrayLayout4i8",Hr);class Vr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,et,it)}emplace(R,ae,ke,Ue,et,it,Ct){let $t=6*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.int16[$t+2]=Ue,this.int16[$t+3]=et,this.int16[$t+4]=it,this.int16[$t+5]=Ct,R}}Vr.prototype.bytesPerElement=12,fa("StructArrayLayout2i4i12",Vr);class ki extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,et,it)}emplace(R,ae,ke,Ue,et,it,Ct){let $t=4*R,or=8*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.uint8[or+4]=Ue,this.uint8[or+5]=et,this.uint8[or+6]=it,this.uint8[or+7]=Ct,R}}ki.prototype.bytesPerElement=8,fa("StructArrayLayout2i4ub8",ki);class Vi extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.float32[Ue+0]=ae,this.float32[Ue+1]=ke,R}}Vi.prototype.bytesPerElement=8,fa("StructArrayLayout2f8",Vi);class tt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it,Ct,$t,or,Sr){let Rr=this.length;return this.resize(Rr+1),this.emplace(Rr,R,ae,ke,Ue,et,it,Ct,$t,or,Sr)}emplace(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr){let ai=10*R;return this.uint16[ai+0]=ae,this.uint16[ai+1]=ke,this.uint16[ai+2]=Ue,this.uint16[ai+3]=et,this.uint16[ai+4]=it,this.uint16[ai+5]=Ct,this.uint16[ai+6]=$t,this.uint16[ai+7]=or,this.uint16[ai+8]=Sr,this.uint16[ai+9]=Rr,R}}tt.prototype.bytesPerElement=20,fa("StructArrayLayout10ui20",tt);class lt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai){let bi=this.length;return this.resize(bi+1),this.emplace(bi,R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai)}emplace(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi){let Fi=12*R;return this.int16[Fi+0]=ae,this.int16[Fi+1]=ke,this.int16[Fi+2]=Ue,this.int16[Fi+3]=et,this.uint16[Fi+4]=it,this.uint16[Fi+5]=Ct,this.uint16[Fi+6]=$t,this.uint16[Fi+7]=or,this.int16[Fi+8]=Sr,this.int16[Fi+9]=Rr,this.int16[Fi+10]=ai,this.int16[Fi+11]=bi,R}}lt.prototype.bytesPerElement=24,fa("StructArrayLayout4i4ui4i24",lt);class Tt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let et=3*R;return this.float32[et+0]=ae,this.float32[et+1]=ke,this.float32[et+2]=Ue,R}}Tt.prototype.bytesPerElement=12,fa("StructArrayLayout3f12",Tt);class Lt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.uint32[1*R+0]=ae,R}}Lt.prototype.bytesPerElement=4,fa("StructArrayLayout1ul4",Lt);class Vt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it,Ct,$t,or){let Sr=this.length;return this.resize(Sr+1),this.emplace(Sr,R,ae,ke,Ue,et,it,Ct,$t,or)}emplace(R,ae,ke,Ue,et,it,Ct,$t,or,Sr){let Rr=10*R,ai=5*R;return this.int16[Rr+0]=ae,this.int16[Rr+1]=ke,this.int16[Rr+2]=Ue,this.int16[Rr+3]=et,this.int16[Rr+4]=it,this.int16[Rr+5]=Ct,this.uint32[ai+3]=$t,this.uint16[Rr+8]=or,this.uint16[Rr+9]=Sr,R}}Vt.prototype.bytesPerElement=20,fa("StructArrayLayout6i1ul2ui20",Vt);class Nt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,et,it)}emplace(R,ae,ke,Ue,et,it,Ct){let $t=6*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.int16[$t+2]=Ue,this.int16[$t+3]=et,this.int16[$t+4]=it,this.int16[$t+5]=Ct,R}}Nt.prototype.bytesPerElement=12,fa("StructArrayLayout2i2i2i12",Nt);class Yt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et){let it=this.length;return this.resize(it+1),this.emplace(it,R,ae,ke,Ue,et)}emplace(R,ae,ke,Ue,et,it){let Ct=4*R,$t=8*R;return this.float32[Ct+0]=ae,this.float32[Ct+1]=ke,this.float32[Ct+2]=Ue,this.int16[$t+6]=et,this.int16[$t+7]=it,R}}Yt.prototype.bytesPerElement=16,fa("StructArrayLayout2f1f2i16",Yt);class Lr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,et,it)}emplace(R,ae,ke,Ue,et,it,Ct){let $t=16*R,or=4*R,Sr=8*R;return this.uint8[$t+0]=ae,this.uint8[$t+1]=ke,this.float32[or+1]=Ue,this.float32[or+2]=et,this.int16[Sr+6]=it,this.int16[Sr+7]=Ct,R}}Lr.prototype.bytesPerElement=16,fa("StructArrayLayout2ub2f2i16",Lr);class $r extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let et=3*R;return this.uint16[et+0]=ae,this.uint16[et+1]=ke,this.uint16[et+2]=Ue,R}}$r.prototype.bytesPerElement=6,fa("StructArrayLayout3ui6",$r);class Zr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn){let Fa=this.length;return this.resize(Fa+1),this.emplace(Fa,R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn)}emplace(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn,Fa){let ha=24*R,Aa=12*R,lo=48*R;return this.int16[ha+0]=ae,this.int16[ha+1]=ke,this.uint16[ha+2]=Ue,this.uint16[ha+3]=et,this.uint32[Aa+2]=it,this.uint32[Aa+3]=Ct,this.uint32[Aa+4]=$t,this.uint16[ha+10]=or,this.uint16[ha+11]=Sr,this.uint16[ha+12]=Rr,this.float32[Aa+7]=ai,this.float32[Aa+8]=bi,this.uint8[lo+36]=Fi,this.uint8[lo+37]=Gi,this.uint8[lo+38]=pn,this.uint32[Aa+10]=jn,this.int16[ha+22]=Fa,R}}Zr.prototype.bytesPerElement=48,fa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zr);class di extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn,Fa,ha,Aa,lo,Oo,Ps,Bl,Ss,vs,nl,qs){let Ns=this.length;return this.resize(Ns+1),this.emplace(Ns,R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn,Fa,ha,Aa,lo,Oo,Ps,Bl,Ss,vs,nl,qs)}emplace(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi,pn,jn,Fa,ha,Aa,lo,Oo,Ps,Bl,Ss,vs,nl,qs,Ns){let wo=32*R,dl=16*R;return this.int16[wo+0]=ae,this.int16[wo+1]=ke,this.int16[wo+2]=Ue,this.int16[wo+3]=et,this.int16[wo+4]=it,this.int16[wo+5]=Ct,this.int16[wo+6]=$t,this.int16[wo+7]=or,this.uint16[wo+8]=Sr,this.uint16[wo+9]=Rr,this.uint16[wo+10]=ai,this.uint16[wo+11]=bi,this.uint16[wo+12]=Fi,this.uint16[wo+13]=Gi,this.uint16[wo+14]=pn,this.uint16[wo+15]=jn,this.uint16[wo+16]=Fa,this.uint16[wo+17]=ha,this.uint16[wo+18]=Aa,this.uint16[wo+19]=lo,this.uint16[wo+20]=Oo,this.uint16[wo+21]=Ps,this.uint16[wo+22]=Bl,this.uint32[dl+12]=Ss,this.float32[dl+13]=vs,this.float32[dl+14]=nl,this.uint16[wo+30]=qs,this.uint16[wo+31]=Ns,R}}di.prototype.bytesPerElement=64,fa("StructArrayLayout8i15ui1ul2f2ui64",di);class zi extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.float32[1*R+0]=ae,R}}zi.prototype.bytesPerElement=4,fa("StructArrayLayout1f4",zi);class Ki extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let et=3*R;return this.uint16[6*R+0]=ae,this.float32[et+1]=ke,this.float32[et+2]=Ue,R}}Ki.prototype.bytesPerElement=12,fa("StructArrayLayout1ui2f12",Ki);class nn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let et=4*R;return this.uint32[2*R+0]=ae,this.uint16[et+2]=ke,this.uint16[et+3]=Ue,R}}nn.prototype.bytesPerElement=8,fa("StructArrayLayout1ul2ui8",nn);class kn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.uint16[Ue+0]=ae,this.uint16[Ue+1]=ke,R}}kn.prototype.bytesPerElement=4,fa("StructArrayLayout2ui4",kn);class Jn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.uint16[1*R+0]=ae,R}}Jn.prototype.bytesPerElement=2,fa("StructArrayLayout1ui2",Jn);class Sa extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue){let et=this.length;return this.resize(et+1),this.emplace(et,R,ae,ke,Ue)}emplace(R,ae,ke,Ue,et){let it=4*R;return this.float32[it+0]=ae,this.float32[it+1]=ke,this.float32[it+2]=Ue,this.float32[it+3]=et,R}}Sa.prototype.bytesPerElement=16,fa("StructArrayLayout4f16",Sa);class wa extends Ne{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new u(this.anchorPointX,this.anchorPointY)}}wa.prototype.size=20;class Ba extends Vt{get(R){return new wa(this,R)}}fa("CollisionBoxArray",Ba);class xo extends Ne{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(R){this._structArray.uint8[this._pos1+37]=R}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(R){this._structArray.uint8[this._pos1+38]=R}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(R){this._structArray.uint32[this._pos4+10]=R}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}xo.prototype.size=48;class Go extends Zr{get(R){return new xo(this,R)}}fa("PlacedSymbolArray",Go);class Bo extends Ne{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(R){this._structArray.uint32[this._pos4+12]=R}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Bo.prototype.size=64;class _s extends di{get(R){return new Bo(this,R)}}fa("SymbolInstanceArray",_s);class wl extends zi{getoffsetX(R){return this.float32[1*R+0]}}fa("GlyphOffsetArray",wl);class Al extends kr{getx(R){return this.int16[3*R+0]}gety(R){return this.int16[3*R+1]}gettileUnitDistanceFromAnchor(R){return this.int16[3*R+2]}}fa("SymbolLineVertexArray",Al);class Us extends Ne{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Us.prototype.size=12;class Pl extends Ki{get(R){return new Us(this,R)}}fa("TextAnchorOffsetArray",Pl);class Ru extends Ne{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ru.prototype.size=8;class Tu extends nn{get(R){return new Ru(this,R)}}fa("FeatureIndexArray",Tu);class Js extends er{}class Qs extends er{}class nc extends er{}class wc extends Vr{}class ih extends ki{}class Me extends Vi{}class Ve extends tt{}class ft extends lt{}class Pt extends Tt{}class Bt extends Lt{}class Ht extends Nt{}class fr extends Lr{}class cr extends $r{}class Or extends kn{}let pi=Mt([{name:"a_pos",components:2,type:"Int16"}],4),{members:ci}=pi;class Bi{constructor(R=[]){this.segments=R}prepareSegment(R,ae,ke,Ue){let et=this.segments[this.segments.length-1];return R>Bi.MAX_VERTEX_ARRAY_LENGTH&&T(`Max vertices per segment is ${Bi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${R}`),(!et||et.vertexLength+R>Bi.MAX_VERTEX_ARRAY_LENGTH||et.sortKey!==Ue)&&(et={vertexOffset:ae.length,primitiveOffset:ke.length,vertexLength:0,primitiveLength:0},Ue!==void 0&&(et.sortKey=Ue),this.segments.push(et)),et}get(){return this.segments}destroy(){for(let R of this.segments)for(let ae in R.vaos)R.vaos[ae].destroy()}static simpleSegment(R,ae,ke,Ue){return new Bi([{vertexOffset:R,primitiveOffset:ae,vertexLength:ke,primitiveLength:Ue,vaos:{},sortKey:0}])}}function Yi(X,R){return 256*(X=w(Math.floor(X),0,255))+w(Math.floor(R),0,255)}Bi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa("SegmentVector",Bi);let Qi=Mt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ta={exports:{}},ln={exports:{}};ln.exports=function(X,R){var ae,ke,Ue,et,it,Ct,$t,or;for(ke=X.length-(ae=3&X.length),Ue=R,it=3432918353,Ct=461845907,or=0;or>>16)*it&65535)<<16)&4294967295)<<15|$t>>>17))*Ct+((($t>>>16)*Ct&65535)<<16)&4294967295)<<13|Ue>>>19))+((5*(Ue>>>16)&65535)<<16)&4294967295))+((58964+(et>>>16)&65535)<<16);switch($t=0,ae){case 3:$t^=(255&X.charCodeAt(or+2))<<16;case 2:$t^=(255&X.charCodeAt(or+1))<<8;case 1:Ue^=$t=(65535&($t=($t=(65535&($t^=255&X.charCodeAt(or)))*it+((($t>>>16)*it&65535)<<16)&4294967295)<<15|$t>>>17))*Ct+((($t>>>16)*Ct&65535)<<16)&4294967295}return Ue^=X.length,Ue=2246822507*(65535&(Ue^=Ue>>>16))+((2246822507*(Ue>>>16)&65535)<<16)&4294967295,Ue=3266489909*(65535&(Ue^=Ue>>>13))+((3266489909*(Ue>>>16)&65535)<<16)&4294967295,(Ue^=Ue>>>16)>>>0};var On=ln.exports,Un={exports:{}};Un.exports=function(X,R){for(var ae,ke=X.length,Ue=R^ke,et=0;ke>=4;)ae=1540483477*(65535&(ae=255&X.charCodeAt(et)|(255&X.charCodeAt(++et))<<8|(255&X.charCodeAt(++et))<<16|(255&X.charCodeAt(++et))<<24))+((1540483477*(ae>>>16)&65535)<<16),Ue=1540483477*(65535&Ue)+((1540483477*(Ue>>>16)&65535)<<16)^(ae=1540483477*(65535&(ae^=ae>>>24))+((1540483477*(ae>>>16)&65535)<<16)),ke-=4,++et;switch(ke){case 3:Ue^=(255&X.charCodeAt(et+2))<<16;case 2:Ue^=(255&X.charCodeAt(et+1))<<8;case 1:Ue=1540483477*(65535&(Ue^=255&X.charCodeAt(et)))+((1540483477*(Ue>>>16)&65535)<<16)}return Ue=1540483477*(65535&(Ue^=Ue>>>13))+((1540483477*(Ue>>>16)&65535)<<16),(Ue^=Ue>>>15)>>>0};var Zn=On,aa=Un.exports;ta.exports=Zn,ta.exports.murmur3=Zn,ta.exports.murmur2=aa;var gn=a(ta.exports);class Ja{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(R,ae,ke,Ue){this.ids.push(to(R)),this.positions.push(ae,ke,Ue)}getPositions(R){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let ae=to(R),ke=0,Ue=this.ids.length-1;for(;ke>1;this.ids[it]>=ae?Ue=it:ke=it+1}let et=[];for(;this.ids[ke]===ae;)et.push({index:this.positions[3*ke],start:this.positions[3*ke+1],end:this.positions[3*ke+2]}),ke++;return et}static serialize(R,ae){let ke=new Float64Array(R.ids),Ue=new Uint32Array(R.positions);return yo(ke,Ue,0,ke.length-1),ae&&ae.push(ke.buffer,Ue.buffer),{ids:ke,positions:Ue}}static deserialize(R){let ae=new Ja;return ae.ids=R.ids,ae.positions=R.positions,ae.indexed=!0,ae}}function to(X){let R=+X;return!isNaN(R)&&R<=Number.MAX_SAFE_INTEGER?R:gn(String(X))}function yo(X,R,ae,ke){for(;ae>1],et=ae-1,it=ke+1;for(;;){do et++;while(X[et]Ue);if(et>=it)break;jo(X,et,it),jo(R,3*et,3*it),jo(R,3*et+1,3*it+1),jo(R,3*et+2,3*it+2)}it-ae`u_${Ue}`),this.type=ke}setUniform(R,ae,ke){R.set(ke.constantOr(this.value))}getBinding(R,ae,ke){return this.type==="color"?new ts(R,ae):new Xo(R,ae)}}class bu{constructor(R,ae){this.uniformNames=ae.map(ke=>`u_${ke}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(R,ae){this.pixelRatioFrom=ae.pixelRatio,this.pixelRatioTo=R.pixelRatio,this.patternFrom=ae.tlbr,this.patternTo=R.tlbr}setUniform(R,ae,ke,Ue){let et=Ue==="u_pattern_to"?this.patternTo:Ue==="u_pattern_from"?this.patternFrom:Ue==="u_pixel_ratio_to"?this.pixelRatioTo:Ue==="u_pixel_ratio_from"?this.pixelRatioFrom:null;et&&R.set(et)}getBinding(R,ae,ke){return ke.substr(0,9)==="u_pattern"?new ml(R,ae):new Xo(R,ae)}}class Eo{constructor(R,ae,ke,Ue){this.expression=R,this.type=ke,this.maxValue=0,this.paintVertexAttributes=ae.map(et=>({name:`a_${et}`,type:"Float32",components:ke==="color"?2:1,offset:0})),this.paintVertexArray=new Ue}populatePaintArray(R,ae,ke,Ue,et){let it=this.paintVertexArray.length,Ct=this.expression.evaluate(new Wl(0),ae,{},Ue,[],et);this.paintVertexArray.resize(R),this._setPaintValue(it,R,Ct)}updatePaintArray(R,ae,ke,Ue){let et=this.expression.evaluate({zoom:0},ke,Ue);this._setPaintValue(R,ae,et)}_setPaintValue(R,ae,ke){if(this.type==="color"){let Ue=Dl(ke);for(let et=R;et`u_${Ct}_t`),this.type=ke,this.useIntegerZoom=Ue,this.zoom=et,this.maxValue=0,this.paintVertexAttributes=ae.map(Ct=>({name:`a_${Ct}`,type:"Float32",components:ke==="color"?4:2,offset:0})),this.paintVertexArray=new it}populatePaintArray(R,ae,ke,Ue,et){let it=this.expression.evaluate(new Wl(this.zoom),ae,{},Ue,[],et),Ct=this.expression.evaluate(new Wl(this.zoom+1),ae,{},Ue,[],et),$t=this.paintVertexArray.length;this.paintVertexArray.resize(R),this._setPaintValue($t,R,it,Ct)}updatePaintArray(R,ae,ke,Ue){let et=this.expression.evaluate({zoom:this.zoom},ke,Ue),it=this.expression.evaluate({zoom:this.zoom+1},ke,Ue);this._setPaintValue(R,ae,et,it)}_setPaintValue(R,ae,ke,Ue){if(this.type==="color"){let et=Dl(ke),it=Dl(Ue);for(let Ct=R;Ct`#define HAS_UNIFORM_${Ue}`))}return R}getBinderAttributes(){let R=[];for(let ae in this.binders){let ke=this.binders[ae];if(ke instanceof Eo||ke instanceof el)for(let Ue=0;Ue!0){this.programConfigurations={};for(let Ue of R)this.programConfigurations[Ue.id]=new vu(Ue,ae,ke);this.needsUpload=!1,this._featureMap=new Ja,this._bufferOffset=0}populatePaintArrays(R,ae,ke,Ue,et,it){for(let Ct in this.programConfigurations)this.programConfigurations[Ct].populatePaintArrays(R,ae,Ue,et,it);ae.id!==void 0&&this._featureMap.add(ae.id,ke,this._bufferOffset,R),this._bufferOffset=R,this.needsUpload=!0}updatePaintArrays(R,ae,ke,Ue){for(let et of ke)this.needsUpload=this.programConfigurations[et.id].updatePaintArrays(R,this._featureMap,ae,et,Ue)||this.needsUpload}get(R){return this.programConfigurations[R]}upload(R){if(this.needsUpload){for(let ae in this.programConfigurations)this.programConfigurations[ae].upload(R);this.needsUpload=!1}}destroy(){for(let R in this.programConfigurations)this.programConfigurations[R].destroy()}}function dh(X,R){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[X]||[X.replace(`${R}-`,"").replace(/-/g,"_")]}function Zl(X,R,ae){let ke={color:{source:Vi,composite:Sa},number:{source:zi,composite:Vi}},Ue=function(et){return{"line-pattern":{source:Ve,composite:Ve},"fill-pattern":{source:Ve,composite:Ve},"fill-extrusion-pattern":{source:Ve,composite:Ve}}[et]}(X);return Ue&&Ue[ae]||ke[R][ae]}fa("ConstantBinder",ac),fa("CrossFadedConstantBinder",bu),fa("SourceExpressionBinder",Eo),fa("CrossFadedCompositeBinder",fl),fa("CompositeExpressionBinder",el),fa("ProgramConfiguration",vu,{omit:["_buffers"]}),fa("ProgramConfigurationSet",nu);let cu=8192,zh=Math.pow(2,14)-1,St=-zh-1;function Pr(X){let R=cu/X.extent,ae=X.loadGeometry();for(let ke=0;keit.x+1||$tit.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return ae}function Nr(X,R){return{type:X.type,id:X.id,properties:X.properties,geometry:R?Pr(X):[]}}function en(X,R,ae,ke,Ue){X.emplaceBack(2*R+(ke+1)/2,2*ae+(Ue+1)/2)}class Cn{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new Qs,this.indexArray=new cr,this.segments=new Bi,this.programConfigurations=new nu(R.layers,R.zoom),this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){let Ue=this.layers[0],et=[],it=null,Ct=!1;Ue.type==="circle"&&(it=Ue.layout.get("circle-sort-key"),Ct=!it.isConstant());for(let{feature:$t,id:or,index:Sr,sourceLayerIndex:Rr}of R){let ai=this.layers[0]._featureFilter.needGeometry,bi=Nr($t,ai);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),bi,ke))continue;let Fi=Ct?it.evaluate(bi,{},ke):void 0,Gi={id:or,properties:$t.properties,type:$t.type,sourceLayerIndex:Rr,index:Sr,geometry:ai?bi.geometry:Pr($t),patterns:{},sortKey:Fi};et.push(Gi)}Ct&&et.sort(($t,or)=>$t.sortKey-or.sortKey);for(let $t of et){let{geometry:or,index:Sr,sourceLayerIndex:Rr}=$t,ai=R[Sr].feature;this.addFeature($t,or,Sr,ke),ae.featureIndex.insert(ai,or,Sr,Rr,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,ci),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(R,ae,ke,Ue){for(let et of ae)for(let it of et){let Ct=it.x,$t=it.y;if(Ct<0||Ct>=cu||$t<0||$t>=cu)continue;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,R.sortKey),Sr=or.vertexLength;en(this.layoutVertexArray,Ct,$t,-1,-1),en(this.layoutVertexArray,Ct,$t,1,-1),en(this.layoutVertexArray,Ct,$t,1,1),en(this.layoutVertexArray,Ct,$t,-1,1),this.indexArray.emplaceBack(Sr,Sr+1,Sr+2),this.indexArray.emplaceBack(Sr,Sr+3,Sr+2),or.vertexLength+=4,or.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,ke,{},Ue)}}function xn(X,R){for(let ae=0;ae1){if(ia(X,R))return!0;for(let ke=0;ke1?ae:ae.sub(R)._mult(Ue)._add(R))}function da(X,R){let ae,ke,Ue,et=!1;for(let it=0;itR.y!=Ue.y>R.y&&R.x<(Ue.x-ke.x)*(R.y-ke.y)/(Ue.y-ke.y)+ke.x&&(et=!et)}return et}function Nn(X,R){let ae=!1;for(let ke=0,Ue=X.length-1;keR.y!=it.y>R.y&&R.x<(it.x-et.x)*(R.y-et.y)/(it.y-et.y)+et.x&&(ae=!ae)}return ae}function Ei(X,R,ae){let ke=ae[0],Ue=ae[2];if(X.xUe.x&&R.x>Ue.x||X.yUe.y&&R.y>Ue.y)return!1;let et=N(X,R,ae[0]);return et!==N(X,R,ae[1])||et!==N(X,R,ae[2])||et!==N(X,R,ae[3])}function on(X,R,ae){let ke=R.paint.get(X).value;return ke.kind==="constant"?ke.value:ae.programConfigurations.get(R.id).getMaxValue(X)}function Kn(X){return Math.sqrt(X[0]*X[0]+X[1]*X[1])}function Fn(X,R,ae,ke,Ue){if(!R[0]&&!R[1])return X;let et=u.convert(R)._mult(Ue);ae==="viewport"&&et._rotate(-ke);let it=[];for(let Ct=0;Ct$o(pn,Gi))}(or,$t),bi=Rr?Sr*Ct:Sr;for(let Fi of Ue)for(let Gi of Fi){let pn=Rr?Gi:$o(Gi,$t),jn=bi,Fa=la([],[Gi.x,Gi.y,0,1],$t);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?jn*=Fa[3]/it.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(jn*=it.cameraToCenterDistance/Fa[3]),Oi(ai,pn,jn))return!0}return!1}}function $o(X,R){let ae=la([],[X.x,X.y,0,1],R);return new u(ae[0]/ae[3],ae[1]/ae[3])}class Io extends Cn{}let Ia;fa("HeatmapBucket",Io,{omit:["layers"]});var qa={get paint(){return Ia=Ia||new Ke({"heatmap-radius":new Fs(fe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Fs(fe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new cs(fe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new od(fe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new cs(fe.paint_heatmap["heatmap-opacity"])})}};function Co(X,{width:R,height:ae},ke,Ue){if(Ue){if(Ue instanceof Uint8ClampedArray)Ue=new Uint8Array(Ue.buffer);else if(Ue.length!==R*ae*ke)throw new RangeError(`mismatched image size. expected: ${Ue.length} but got: ${R*ae*ke}`)}else Ue=new Uint8Array(R*ae*ke);return X.width=R,X.height=ae,X.data=Ue,X}function Ro(X,{width:R,height:ae},ke){if(R===X.width&&ae===X.height)return;let Ue=Co({},{width:R,height:ae},ke);us(X,Ue,{x:0,y:0},{x:0,y:0},{width:Math.min(X.width,R),height:Math.min(X.height,ae)},ke),X.width=R,X.height=ae,X.data=Ue.data}function us(X,R,ae,ke,Ue,et){if(Ue.width===0||Ue.height===0)return R;if(Ue.width>X.width||Ue.height>X.height||ae.x>X.width-Ue.width||ae.y>X.height-Ue.height)throw new RangeError("out of range source coordinates for image copy");if(Ue.width>R.width||Ue.height>R.height||ke.x>R.width-Ue.width||ke.y>R.height-Ue.height)throw new RangeError("out of range destination coordinates for image copy");let it=X.data,Ct=R.data;if(it===Ct)throw new Error("srcData equals dstData, so image is already copied");for(let $t=0;$t{R[X.evaluationKey]=$t;let or=X.expression.evaluate(R);Ue.data[it+Ct+0]=Math.floor(255*or.r/or.a),Ue.data[it+Ct+1]=Math.floor(255*or.g/or.a),Ue.data[it+Ct+2]=Math.floor(255*or.b/or.a),Ue.data[it+Ct+3]=Math.floor(255*or.a)};if(X.clips)for(let it=0,Ct=0;it80*ae){Ct=1/0,$t=1/0;let Sr=-1/0,Rr=-1/0;for(let ai=ae;aiSr&&(Sr=bi),Fi>Rr&&(Rr=Fi)}or=Math.max(Sr-Ct,Rr-$t),or=or!==0?32767/or:0}return vl(et,it,ae,Ct,$t,or,0),it}function Zo(X,R,ae,ke,Ue){let et;if(Ue===function(it,Ct,$t,or){let Sr=0;for(let Rr=Ct,ai=$t-or;Rr<$t;Rr+=or)Sr+=(it[ai]-it[Rr])*(it[Rr+1]+it[ai+1]),ai=Rr;return Sr}(X,R,ae,ke)>0)for(let it=R;it=R;it-=ke)et=ar(it/ke|0,X[it],X[it+1],et);return et&&wt(et,et.next)&&(pr(et),et=et.next),et}function Du(X,R){if(!X)return X;R||(R=X);let ae,ke=X;do if(ae=!1,ke.steiner||!wt(ke,ke.next)&&mt(ke.prev,ke,ke.next)!==0)ke=ke.next;else{if(pr(ke),ke=R=ke.prev,ke===ke.next)break;ae=!0}while(ae||ke!==R);return R}function vl(X,R,ae,ke,Ue,et,it){if(!X)return;!it&&et&&function($t,or,Sr,Rr){let ai=$t;do ai.z===0&&(ai.z=le(ai.x,ai.y,or,Sr,Rr)),ai.prevZ=ai.prev,ai.nextZ=ai.next,ai=ai.next;while(ai!==$t);ai.prevZ.nextZ=null,ai.prevZ=null,function(bi){let Fi,Gi=1;do{let pn,jn=bi;bi=null;let Fa=null;for(Fi=0;jn;){Fi++;let ha=jn,Aa=0;for(let Oo=0;Oo0||lo>0&&ha;)Aa!==0&&(lo===0||!ha||jn.z<=ha.z)?(pn=jn,jn=jn.nextZ,Aa--):(pn=ha,ha=ha.nextZ,lo--),Fa?Fa.nextZ=pn:bi=pn,pn.prevZ=Fa,Fa=pn;jn=ha}Fa.nextZ=null,Gi*=2}while(Fi>1)}(ai)}(X,ke,Ue,et);let Ct=X;for(;X.prev!==X.next;){let $t=X.prev,or=X.next;if(et?Lc(X,ke,Ue,et):Nu(X))R.push($t.i,X.i,or.i),pr(X),X=or.next,Ct=or.next;else if((X=or)===Ct){it?it===1?vl(X=Fo(Du(X),R),R,ae,ke,Ue,et,2):it===2&&Ds(X,R,ae,ke,Ue,et):vl(Du(X),R,ae,ke,Ue,et,1);break}}}function Nu(X){let R=X.prev,ae=X,ke=X.next;if(mt(R,ae,ke)>=0)return!1;let Ue=R.x,et=ae.x,it=ke.x,Ct=R.y,$t=ae.y,or=ke.y,Sr=Ueet?Ue>it?Ue:it:et>it?et:it,bi=Ct>$t?Ct>or?Ct:or:$t>or?$t:or,Fi=ke.next;for(;Fi!==R;){if(Fi.x>=Sr&&Fi.x<=ai&&Fi.y>=Rr&&Fi.y<=bi&&we(Ue,Ct,et,$t,it,or,Fi.x,Fi.y)&&mt(Fi.prev,Fi,Fi.next)>=0)return!1;Fi=Fi.next}return!0}function Lc(X,R,ae,ke){let Ue=X.prev,et=X,it=X.next;if(mt(Ue,et,it)>=0)return!1;let Ct=Ue.x,$t=et.x,or=it.x,Sr=Ue.y,Rr=et.y,ai=it.y,bi=Ct<$t?Ct$t?Ct>or?Ct:or:$t>or?$t:or,pn=Sr>Rr?Sr>ai?Sr:ai:Rr>ai?Rr:ai,jn=le(bi,Fi,R,ae,ke),Fa=le(Gi,pn,R,ae,ke),ha=X.prevZ,Aa=X.nextZ;for(;ha&&ha.z>=jn&&Aa&&Aa.z<=Fa;){if(ha.x>=bi&&ha.x<=Gi&&ha.y>=Fi&&ha.y<=pn&&ha!==Ue&&ha!==it&&we(Ct,Sr,$t,Rr,or,ai,ha.x,ha.y)&&mt(ha.prev,ha,ha.next)>=0||(ha=ha.prevZ,Aa.x>=bi&&Aa.x<=Gi&&Aa.y>=Fi&&Aa.y<=pn&&Aa!==Ue&&Aa!==it&&we(Ct,Sr,$t,Rr,or,ai,Aa.x,Aa.y)&&mt(Aa.prev,Aa,Aa.next)>=0))return!1;Aa=Aa.nextZ}for(;ha&&ha.z>=jn;){if(ha.x>=bi&&ha.x<=Gi&&ha.y>=Fi&&ha.y<=pn&&ha!==Ue&&ha!==it&&we(Ct,Sr,$t,Rr,or,ai,ha.x,ha.y)&&mt(ha.prev,ha,ha.next)>=0)return!1;ha=ha.prevZ}for(;Aa&&Aa.z<=Fa;){if(Aa.x>=bi&&Aa.x<=Gi&&Aa.y>=Fi&&Aa.y<=pn&&Aa!==Ue&&Aa!==it&&we(Ct,Sr,$t,Rr,or,ai,Aa.x,Aa.y)&&mt(Aa.prev,Aa,Aa.next)>=0)return!1;Aa=Aa.nextZ}return!0}function Fo(X,R){let ae=X;do{let ke=ae.prev,Ue=ae.next.next;!wt(ke,Ue)&&Qe(ke,ae,ae.next,Ue)&&lr(ke,Ue)&&lr(Ue,ke)&&(R.push(ke.i,ae.i,Ue.i),pr(ae),pr(ae.next),ae=X=Ue),ae=ae.next}while(ae!==X);return Du(ae)}function Ds(X,R,ae,ke,Ue,et){let it=X;do{let Ct=it.next.next;for(;Ct!==it.prev;){if(it.i!==Ct.i&&We(it,Ct)){let $t=Qt(it,Ct);return it=Du(it,it.next),$t=Du($t,$t.next),vl(it,R,ae,ke,Ue,et,0),void vl($t,R,ae,ke,Ue,et,0)}Ct=Ct.next}it=it.next}while(it!==X)}function Ol(X,R){return X.x-R.x}function Ml(X,R){let ae=function(Ue,et){let it=et,Ct=Ue.x,$t=Ue.y,or,Sr=-1/0;do{if($t<=it.y&&$t>=it.next.y&&it.next.y!==it.y){let Gi=it.x+($t-it.y)*(it.next.x-it.x)/(it.next.y-it.y);if(Gi<=Ct&&Gi>Sr&&(Sr=Gi,or=it.x=it.x&&it.x>=ai&&Ct!==it.x&&we($tor.x||it.x===or.x&&K(or,it)))&&(or=it,Fi=Gi)}it=it.next}while(it!==Rr);return or}(X,R);if(!ae)return R;let ke=Qt(ae,X);return Du(ke,ke.next),Du(ae,ae.next)}function K(X,R){return mt(X.prev,X,R.prev)<0&&mt(R.next,X,X.next)<0}function le(X,R,ae,ke,Ue){return(X=1431655765&((X=858993459&((X=252645135&((X=16711935&((X=(X-ae)*Ue|0)|X<<8))|X<<4))|X<<2))|X<<1))|(R=1431655765&((R=858993459&((R=252645135&((R=16711935&((R=(R-ke)*Ue|0)|R<<8))|R<<4))|R<<2))|R<<1))<<1}function ie(X){let R=X,ae=X;do(R.x=(X-it)*(et-Ct)&&(X-it)*(ke-Ct)>=(ae-it)*(R-Ct)&&(ae-it)*(et-Ct)>=(Ue-it)*(ke-Ct)}function We(X,R){return X.next.i!==R.i&&X.prev.i!==R.i&&!function(ae,ke){let Ue=ae;do{if(Ue.i!==ae.i&&Ue.next.i!==ae.i&&Ue.i!==ke.i&&Ue.next.i!==ke.i&&Qe(Ue,Ue.next,ae,ke))return!0;Ue=Ue.next}while(Ue!==ae);return!1}(X,R)&&(lr(X,R)&&lr(R,X)&&function(ae,ke){let Ue=ae,et=!1,it=(ae.x+ke.x)/2,Ct=(ae.y+ke.y)/2;do Ue.y>Ct!=Ue.next.y>Ct&&Ue.next.y!==Ue.y&&it<(Ue.next.x-Ue.x)*(Ct-Ue.y)/(Ue.next.y-Ue.y)+Ue.x&&(et=!et),Ue=Ue.next;while(Ue!==ae);return et}(X,R)&&(mt(X.prev,X,R.prev)||mt(X,R.prev,R))||wt(X,R)&&mt(X.prev,X,X.next)>0&&mt(R.prev,R,R.next)>0)}function mt(X,R,ae){return(R.y-X.y)*(ae.x-R.x)-(R.x-X.x)*(ae.y-R.y)}function wt(X,R){return X.x===R.x&&X.y===R.y}function Qe(X,R,ae,ke){let Ue=It(mt(X,R,ae)),et=It(mt(X,R,ke)),it=It(mt(ae,ke,X)),Ct=It(mt(ae,ke,R));return Ue!==et&&it!==Ct||!(Ue!==0||!dt(X,ae,R))||!(et!==0||!dt(X,ke,R))||!(it!==0||!dt(ae,X,ke))||!(Ct!==0||!dt(ae,R,ke))}function dt(X,R,ae){return R.x<=Math.max(X.x,ae.x)&&R.x>=Math.min(X.x,ae.x)&&R.y<=Math.max(X.y,ae.y)&&R.y>=Math.min(X.y,ae.y)}function It(X){return X>0?1:X<0?-1:0}function lr(X,R){return mt(X.prev,X,X.next)<0?mt(X,R,X.next)>=0&&mt(X,X.prev,R)>=0:mt(X,R,X.prev)<0||mt(X,X.next,R)<0}function Qt(X,R){let ae=yr(X.i,X.x,X.y),ke=yr(R.i,R.x,R.y),Ue=X.next,et=R.prev;return X.next=R,R.prev=X,ae.next=Ue,Ue.prev=ae,ke.next=ae,ae.prev=ke,et.next=ke,ke.prev=et,ke}function ar(X,R,ae,ke){let Ue=yr(X,R,ae);return ke?(Ue.next=ke.next,Ue.prev=ke,ke.next.prev=Ue,ke.next=Ue):(Ue.prev=Ue,Ue.next=Ue),Ue}function pr(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function yr(X,R,ae){return{i:X,x:R,y:ae,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qt(X,R,ae){let ke=ae.patternDependencies,Ue=!1;for(let et of R){let it=et.paint.get(`${X}-pattern`);it.isConstant()||(Ue=!0);let Ct=it.constantOr(null);Ct&&(Ue=!0,ke[Ct.to]=!0,ke[Ct.from]=!0)}return Ue}function tr(X,R,ae,ke,Ue){let et=Ue.patternDependencies;for(let it of R){let Ct=it.paint.get(`${X}-pattern`).value;if(Ct.kind!=="constant"){let $t=Ct.evaluate({zoom:ke-1},ae,{},Ue.availableImages),or=Ct.evaluate({zoom:ke},ae,{},Ue.availableImages),Sr=Ct.evaluate({zoom:ke+1},ae,{},Ue.availableImages);$t=$t&&$t.name?$t.name:$t,or=or&&or.name?or.name:or,Sr=Sr&&Sr.name?Sr.name:Sr,et[$t]=!0,et[or]=!0,et[Sr]=!0,ae.patterns[it.id]={min:$t,mid:or,max:Sr}}}return ae}class Xt{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new nc,this.indexArray=new cr,this.indexArray2=new Or,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.segments2=new Bi,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.hasPattern=qt("fill",this.layers,ae);let Ue=this.layers[0].layout.get("fill-sort-key"),et=!Ue.isConstant(),it=[];for(let{feature:Ct,id:$t,index:or,sourceLayerIndex:Sr}of R){let Rr=this.layers[0]._featureFilter.needGeometry,ai=Nr(Ct,Rr);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),ai,ke))continue;let bi=et?Ue.evaluate(ai,{},ke,ae.availableImages):void 0,Fi={id:$t,properties:Ct.properties,type:Ct.type,sourceLayerIndex:Sr,index:or,geometry:Rr?ai.geometry:Pr(Ct),patterns:{},sortKey:bi};it.push(Fi)}et&&it.sort((Ct,$t)=>Ct.sortKey-$t.sortKey);for(let Ct of it){let{geometry:$t,index:or,sourceLayerIndex:Sr}=Ct;if(this.hasPattern){let Rr=tr("fill",this.layers,Ct,this.zoom,ae);this.patternFeatures.push(Rr)}else this.addFeature(Ct,$t,or,ke,{});ae.featureIndex.insert(R[or].feature,$t,or,Sr,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}addFeatures(R,ae,ke){for(let Ue of this.patternFeatures)this.addFeature(Ue,Ue.geometry,Ue.index,ae,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,wu),this.indexBuffer=R.createIndexBuffer(this.indexArray),this.indexBuffer2=R.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(R,ae,ke,Ue,et){for(let it of uh(ae,500)){let Ct=0;for(let bi of it)Ct+=bi.length;let $t=this.segments.prepareSegment(Ct,this.layoutVertexArray,this.indexArray),or=$t.vertexLength,Sr=[],Rr=[];for(let bi of it){if(bi.length===0)continue;bi!==it[0]&&Rr.push(Sr.length/2);let Fi=this.segments2.prepareSegment(bi.length,this.layoutVertexArray,this.indexArray2),Gi=Fi.vertexLength;this.layoutVertexArray.emplaceBack(bi[0].x,bi[0].y),this.indexArray2.emplaceBack(Gi+bi.length-1,Gi),Sr.push(bi[0].x),Sr.push(bi[0].y);for(let pn=1;pn>3}if(Ue--,ke===1||ke===2)et+=X.readSVarint(),it+=X.readSVarint(),ke===1&&(R&&Ct.push(R),R=[]),R.push(new ca(et,it));else{if(ke!==7)throw new Error("unknown command "+ke);R&&R.push(R[0].clone())}}return R&&Ct.push(R),Ct},Vn.prototype.bbox=function(){var X=this._pbf;X.pos=this._geometry;for(var R=X.readVarint()+X.pos,ae=1,ke=0,Ue=0,et=0,it=1/0,Ct=-1/0,$t=1/0,or=-1/0;X.pos>3}if(ke--,ae===1||ae===2)(Ue+=X.readSVarint())Ct&&(Ct=Ue),(et+=X.readSVarint())<$t&&($t=et),et>or&&(or=et);else if(ae!==7)throw new Error("unknown command "+ae)}return[it,$t,Ct,or]},Vn.prototype.toGeoJSON=function(X,R,ae){var ke,Ue,et=this.extent*Math.pow(2,ae),it=this.extent*X,Ct=this.extent*R,$t=this.loadGeometry(),or=Vn.types[this.type];function Sr(bi){for(var Fi=0;Fi>3;Ue=it===1?ke.readString():it===2?ke.readFloat():it===3?ke.readDouble():it===4?ke.readVarint64():it===5?ke.readVarint():it===6?ke.readSVarint():it===7?ke.readBoolean():null}return Ue}(ae))}Ts.prototype.feature=function(X){if(X<0||X>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[X];var R=this._pbf.readVarint()+this._pbf.pos;return new To(this._pbf,R,this.extent,this._keys,this._values)};var Yl=Jo;function Tl(X,R,ae){if(X===3){var ke=new Yl(ae,ae.readVarint()+ae.pos);ke.length&&(R[ke.name]=ke)}}In.VectorTile=function(X,R){this.layers=X.readFields(Tl,{},R)},In.VectorTileFeature=$n,In.VectorTileLayer=Jo;let Xl=In.VectorTileFeature.types,Pc=Math.pow(2,13);function $s(X,R,ae,ke,Ue,et,it,Ct){X.emplaceBack(R,ae,2*Math.floor(ke*Pc)+it,Ue*Pc*2,et*Pc*2,Math.round(Ct))}class zu{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new wc,this.centroidVertexArray=new Js,this.indexArray=new cr,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.features=[],this.hasPattern=qt("fill-extrusion",this.layers,ae);for(let{feature:Ue,id:et,index:it,sourceLayerIndex:Ct}of R){let $t=this.layers[0]._featureFilter.needGeometry,or=Nr(Ue,$t);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),or,ke))continue;let Sr={id:et,sourceLayerIndex:Ct,index:it,geometry:$t?or.geometry:Pr(Ue),properties:Ue.properties,type:Ue.type,patterns:{}};this.hasPattern?this.features.push(tr("fill-extrusion",this.layers,Sr,this.zoom,ae)):this.addFeature(Sr,Sr.geometry,it,ke,{}),ae.featureIndex.insert(Ue,Sr.geometry,it,Ct,this.index,!0)}}addFeatures(R,ae,ke){for(let Ue of this.features){let{geometry:et}=Ue;this.addFeature(Ue,et,Ue.index,ae,ke)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,Hn),this.centroidVertexBuffer=R.createVertexBuffer(this.centroidVertexArray,mn.members,!0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(R,ae,ke,Ue,et){for(let it of uh(ae,500)){let Ct={x:0,y:0,vertexCount:0},$t=0;for(let Fi of it)$t+=Fi.length;let or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Fi of it){if(Fi.length===0||Hf(Fi))continue;let Gi=0;for(let pn=0;pn=1){let Fa=Fi[pn-1];if(!mf(jn,Fa)){or.vertexLength+4>Bi.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let ha=jn.sub(Fa)._perp()._unit(),Aa=Fa.dist(jn);Gi+Aa>32768&&(Gi=0),$s(this.layoutVertexArray,jn.x,jn.y,ha.x,ha.y,0,0,Gi),$s(this.layoutVertexArray,jn.x,jn.y,ha.x,ha.y,0,1,Gi),Ct.x+=2*jn.x,Ct.y+=2*jn.y,Ct.vertexCount+=2,Gi+=Aa,$s(this.layoutVertexArray,Fa.x,Fa.y,ha.x,ha.y,0,0,Gi),$s(this.layoutVertexArray,Fa.x,Fa.y,ha.x,ha.y,0,1,Gi),Ct.x+=2*Fa.x,Ct.y+=2*Fa.y,Ct.vertexCount+=2;let lo=or.vertexLength;this.indexArray.emplaceBack(lo,lo+2,lo+1),this.indexArray.emplaceBack(lo+1,lo+2,lo+3),or.vertexLength+=4,or.primitiveLength+=2}}}}if(or.vertexLength+$t>Bi.MAX_VERTEX_ARRAY_LENGTH&&(or=this.segments.prepareSegment($t,this.layoutVertexArray,this.indexArray)),Xl[R.type]!=="Polygon")continue;let Sr=[],Rr=[],ai=or.vertexLength;for(let Fi of it)if(Fi.length!==0){Fi!==it[0]&&Rr.push(Sr.length/2);for(let Gi=0;Gicu)||X.y===R.y&&(X.y<0||X.y>cu)}function Hf(X){return X.every(R=>R.x<0)||X.every(R=>R.x>cu)||X.every(R=>R.y<0)||X.every(R=>R.y>cu)}let M0;fa("FillExtrusionBucket",zu,{omit:["layers","features"]});var vm={get paint(){return M0=M0||new Ke({"fill-extrusion-opacity":new cs(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new cs(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new cs(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new rh(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new cs(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class l0 extends pe{constructor(R){super(R,vm)}createBucket(R){return new zu(R)}queryRadius(){return Kn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(R,ae,ke,Ue,et,it,Ct,$t){let or=Fn(R,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),it.angle,Ct),Sr=this.paint.get("fill-extrusion-height").evaluate(ae,ke),Rr=this.paint.get("fill-extrusion-base").evaluate(ae,ke),ai=function(Fi,Gi,pn,jn){let Fa=[];for(let ha of Fi){let Aa=[ha.x,ha.y,0,1];la(Aa,Aa,Gi),Fa.push(new u(Aa[0]/Aa[3],Aa[1]/Aa[3]))}return Fa}(or,$t),bi=function(Fi,Gi,pn,jn){let Fa=[],ha=[],Aa=jn[8]*Gi,lo=jn[9]*Gi,Oo=jn[10]*Gi,Ps=jn[11]*Gi,Bl=jn[8]*pn,Ss=jn[9]*pn,vs=jn[10]*pn,nl=jn[11]*pn;for(let qs of Fi){let Ns=[],wo=[];for(let dl of qs){let al=dl.x,eu=dl.y,xh=jn[0]*al+jn[4]*eu+jn[12],ph=jn[1]*al+jn[5]*eu+jn[13],Od=jn[2]*al+jn[6]*eu+jn[14],d0=jn[3]*al+jn[7]*eu+jn[15],Vf=Od+Oo,vd=d0+Ps,Hp=xh+Bl,Vp=ph+Ss,Wp=Od+vs,vf=d0+nl,Bd=new u((xh+Aa)/vd,(ph+lo)/vd);Bd.z=Vf/vd,Ns.push(Bd);let Ap=new u(Hp/vf,Vp/vf);Ap.z=Wp/vf,wo.push(Ap)}Fa.push(Ns),ha.push(wo)}return[Fa,ha]}(Ue,Rr,Sr,$t);return function(Fi,Gi,pn){let jn=1/0;Tn(pn,Gi)&&(jn=Om(pn,Gi[0]));for(let Fa=0;Faae.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ae=>{this.gradients[ae.id]={}}),this.layoutVertexArray=new ih,this.layoutVertexArray2=new Me,this.indexArray=new cr,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.hasPattern=qt("line",this.layers,ae);let Ue=this.layers[0].layout.get("line-sort-key"),et=!Ue.isConstant(),it=[];for(let{feature:Ct,id:$t,index:or,sourceLayerIndex:Sr}of R){let Rr=this.layers[0]._featureFilter.needGeometry,ai=Nr(Ct,Rr);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),ai,ke))continue;let bi=et?Ue.evaluate(ai,{},ke):void 0,Fi={id:$t,properties:Ct.properties,type:Ct.type,sourceLayerIndex:Sr,index:or,geometry:Rr?ai.geometry:Pr(Ct),patterns:{},sortKey:bi};it.push(Fi)}et&&it.sort((Ct,$t)=>Ct.sortKey-$t.sortKey);for(let Ct of it){let{geometry:$t,index:or,sourceLayerIndex:Sr}=Ct;if(this.hasPattern){let Rr=tr("line",this.layers,Ct,this.zoom,ae);this.patternFeatures.push(Rr)}else this.addFeature(Ct,$t,or,ke,{});ae.featureIndex.insert(R[or].feature,$t,or,Sr,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}addFeatures(R,ae,ke){for(let Ue of this.patternFeatures)this.addFeature(Ue,Ue.geometry,Ue.index,ae,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=R.createVertexBuffer(this.layoutVertexArray2,tg)),this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,c0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(R){if(R.properties&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_end"))return{start:+R.properties.mapbox_clip_start,end:+R.properties.mapbox_clip_end}}addFeature(R,ae,ke,Ue,et){let it=this.layers[0].layout,Ct=it.get("line-join").evaluate(R,{}),$t=it.get("line-cap"),or=it.get("line-miter-limit"),Sr=it.get("line-round-limit");this.lineClips=this.lineFeatureClips(R);for(let Rr of ae)this.addLine(Rr,R,Ct,$t,or,Sr);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,ke,et,Ue)}addLine(R,ae,ke,Ue,et,it){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let jn=0;jn=2&&R[$t-1].equals(R[$t-2]);)$t--;let or=0;for(;or<$t-1&&R[or].equals(R[or+1]);)or++;if($t<(Ct?3:2))return;ke==="bevel"&&(et=1.05);let Sr=this.overscaling<=16?15*cu/(512*this.overscaling):0,Rr=this.segments.prepareSegment(10*$t,this.layoutVertexArray,this.indexArray),ai,bi,Fi,Gi,pn;this.e1=this.e2=-1,Ct&&(ai=R[$t-2],pn=R[or].sub(ai)._unit()._perp());for(let jn=or;jn<$t;jn++){if(Fi=jn===$t-1?Ct?R[or+1]:void 0:R[jn+1],Fi&&R[jn].equals(Fi))continue;pn&&(Gi=pn),ai&&(bi=ai),ai=R[jn],pn=Fi?Fi.sub(ai)._unit()._perp():Gi,Gi=Gi||pn;let Fa=Gi.add(pn);Fa.x===0&&Fa.y===0||Fa._unit();let ha=Gi.x*pn.x+Gi.y*pn.y,Aa=Fa.x*pn.x+Fa.y*pn.y,lo=Aa!==0?1/Aa:1/0,Oo=2*Math.sqrt(2-2*Aa),Ps=Aa0;if(Ps&&jn>or){let nl=ai.dist(bi);if(nl>2*Sr){let qs=ai.sub(ai.sub(bi)._mult(Sr/nl)._round());this.updateDistance(bi,qs),this.addCurrentVertex(qs,Gi,0,0,Rr),bi=qs}}let Ss=bi&&Fi,vs=Ss?ke:Ct?"butt":Ue;if(Ss&&vs==="round"&&(loet&&(vs="bevel"),vs==="bevel"&&(lo>2&&(vs="flipbevel"),lo100)Fa=pn.mult(-1);else{let nl=lo*Gi.add(pn).mag()/Gi.sub(pn).mag();Fa._perp()._mult(nl*(Bl?-1:1))}this.addCurrentVertex(ai,Fa,0,0,Rr),this.addCurrentVertex(ai,Fa.mult(-1),0,0,Rr)}else if(vs==="bevel"||vs==="fakeround"){let nl=-Math.sqrt(lo*lo-1),qs=Bl?nl:0,Ns=Bl?0:nl;if(bi&&this.addCurrentVertex(ai,Gi,qs,Ns,Rr),vs==="fakeround"){let wo=Math.round(180*Oo/Math.PI/20);for(let dl=1;dl2*Sr){let qs=ai.add(Fi.sub(ai)._mult(Sr/nl)._round());this.updateDistance(ai,qs),this.addCurrentVertex(qs,pn,0,0,Rr),ai=qs}}}}addCurrentVertex(R,ae,ke,Ue,et,it=!1){let Ct=ae.y*Ue-ae.x,$t=-ae.y-ae.x*Ue;this.addHalfVertex(R,ae.x+ae.y*ke,ae.y-ae.x*ke,it,!1,ke,et),this.addHalfVertex(R,Ct,$t,it,!0,-Ue,et),this.distance>f0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(R,ae,ke,Ue,et,it))}addHalfVertex({x:R,y:ae},ke,Ue,et,it,Ct,$t){let or=.5*(this.lineClips?this.scaledDistance*(f0-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((R<<1)+(et?1:0),(ae<<1)+(it?1:0),Math.round(63*ke)+128,Math.round(63*Ue)+128,1+(Ct===0?0:Ct<0?-1:1)|(63&or)<<2,or>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Sr=$t.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Sr),$t.primitiveLength++),it?this.e2=Sr:this.e1=Sr}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(R,ae){this.distance+=R.dist(ae),this.updateScaledDistance()}}let iv,r1;fa("LineBucket",Cp,{omit:["layers","patternFeatures"]});var nv={get paint(){return r1=r1||new Ke({"line-opacity":new Fs(fe.paint_line["line-opacity"]),"line-color":new Fs(fe.paint_line["line-color"]),"line-translate":new cs(fe.paint_line["line-translate"]),"line-translate-anchor":new cs(fe.paint_line["line-translate-anchor"]),"line-width":new Fs(fe.paint_line["line-width"]),"line-gap-width":new Fs(fe.paint_line["line-gap-width"]),"line-offset":new Fs(fe.paint_line["line-offset"]),"line-blur":new Fs(fe.paint_line["line-blur"]),"line-dasharray":new tc(fe.paint_line["line-dasharray"]),"line-pattern":new rh(fe.paint_line["line-pattern"]),"line-gradient":new od(fe.paint_line["line-gradient"])})},get layout(){return iv=iv||new Ke({"line-cap":new cs(fe.layout_line["line-cap"]),"line-join":new Fs(fe.layout_line["line-join"]),"line-miter-limit":new cs(fe.layout_line["line-miter-limit"]),"line-round-limit":new cs(fe.layout_line["line-round-limit"]),"line-sort-key":new Fs(fe.layout_line["line-sort-key"])})}};class Id extends Fs{possiblyEvaluate(R,ae){return ae=new Wl(Math.floor(ae.zoom),{now:ae.now,fadeDuration:ae.fadeDuration,zoomHistory:ae.zoomHistory,transition:ae.transition}),super.possiblyEvaluate(R,ae)}evaluate(R,ae,ke,Ue){return ae=E({},ae,{zoom:Math.floor(ae.zoom)}),super.evaluate(R,ae,ke,Ue)}}let Dg;class i1 extends pe{constructor(R){super(R,nv),this.gradientVersion=0,Dg||(Dg=new Id(nv.paint.properties["line-width"].specification),Dg.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(R){if(R==="line-gradient"){let ae=this.gradientExpression();this.stepInterpolant=!!function(ke){return ke._styleExpression!==void 0}(ae)&&ae._styleExpression.expression instanceof dn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(R,ae){super.recalculate(R,ae),this.paint._values["line-floorwidth"]=Dg.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,R)}createBucket(R){return new Cp(R)}queryRadius(R){let ae=R,ke=Dd(on("line-width",this,ae),on("line-gap-width",this,ae)),Ue=on("line-offset",this,ae);return ke/2+Math.abs(Ue)+Kn(this.paint.get("line-translate"))}queryIntersectsFeature(R,ae,ke,Ue,et,it,Ct){let $t=Fn(R,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),it.angle,Ct),or=Ct/2*Dd(this.paint.get("line-width").evaluate(ae,ke),this.paint.get("line-gap-width").evaluate(ae,ke)),Sr=this.paint.get("line-offset").evaluate(ae,ke);return Sr&&(Ue=function(Rr,ai){let bi=[];for(let Fi=0;Fi=3){for(let pn=0;pn0?R+2*X:X}let av=Mt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),fy=Mt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Mt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let dy=Mt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Mt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Bm=Mt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),n1=Mt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gf(X,R,ae){return X.sections.forEach(ke=>{ke.text=function(Ue,et,it){let Ct=et.layout.get("text-transform").evaluate(it,{});return Ct==="uppercase"?Ue=Ue.toLocaleUpperCase():Ct==="lowercase"&&(Ue=Ue.toLocaleLowerCase()),iu.applyArabicShaping&&(Ue=iu.applyArabicShaping(Ue)),Ue}(ke.text,R,ae)}),X}Mt([{name:"triangle",components:3,type:"Uint16"}]),Mt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Mt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Mt([{type:"Float32",name:"offsetX"}]),Mt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Mt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let zd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ic=24,a1=$c,py=function(X,R,ae,ke,Ue){var et,it,Ct=8*Ue-ke-1,$t=(1<>1,Sr=-7,Rr=Ue-1,ai=-1,bi=X[R+Rr];for(Rr+=ai,et=bi&(1<<-Sr)-1,bi>>=-Sr,Sr+=Ct;Sr>0;et=256*et+X[R+Rr],Rr+=ai,Sr-=8);for(it=et&(1<<-Sr)-1,et>>=-Sr,Sr+=ke;Sr>0;it=256*it+X[R+Rr],Rr+=ai,Sr-=8);if(et===0)et=1-or;else{if(et===$t)return it?NaN:1/0*(bi?-1:1);it+=Math.pow(2,ke),et-=or}return(bi?-1:1)*it*Math.pow(2,et-ke)},zb=function(X,R,ae,ke,Ue,et){var it,Ct,$t,or=8*et-Ue-1,Sr=(1<>1,ai=Ue===23?Math.pow(2,-24)-Math.pow(2,-77):0,bi=0,Fi=1,Gi=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(Ct=isNaN(R)?1:0,it=Sr):(it=Math.floor(Math.log(R)/Math.LN2),R*($t=Math.pow(2,-it))<1&&(it--,$t*=2),(R+=it+Rr>=1?ai/$t:ai*Math.pow(2,1-Rr))*$t>=2&&(it++,$t/=2),it+Rr>=Sr?(Ct=0,it=Sr):it+Rr>=1?(Ct=(R*$t-1)*Math.pow(2,Ue),it+=Rr):(Ct=R*Math.pow(2,Rr-1)*Math.pow(2,Ue),it=0));Ue>=8;X[ae+bi]=255&Ct,bi+=Fi,Ct/=256,Ue-=8);for(it=it<0;X[ae+bi]=255&it,bi+=Fi,it/=256,or-=8);X[ae+bi-Fi]|=128*Gi};function $c(X){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(X)?X:new Uint8Array(X||0),this.pos=0,this.type=0,this.length=this.buf.length}$c.Varint=0,$c.Fixed64=1,$c.Bytes=2,$c.Fixed32=5;var zg=4294967296,Ob=1/zg,o1=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Rm(X){return X.type===$c.Bytes?X.readVarint()+X.pos:X.pos+1}function Gw(X,R,ae){return ae?4294967296*R+(X>>>0):4294967296*(R>>>0)+(X>>>0)}function my(X,R,ae){var ke=R<=16383?1:R<=2097151?2:R<=268435455?3:Math.floor(Math.log(R)/(7*Math.LN2));ae.realloc(ke);for(var Ue=ae.pos-1;Ue>=X;Ue--)ae.buf[Ue+ke]=ae.buf[Ue]}function SA(X,R){for(var ae=0;ae>>8,X[ae+2]=R>>>16,X[ae+3]=R>>>24}function O6(X,R){return(X[R]|X[R+1]<<8|X[R+2]<<16)+(X[R+3]<<24)}$c.prototype={destroy:function(){this.buf=null},readFields:function(X,R,ae){for(ae=ae||this.length;this.pos>3,et=this.pos;this.type=7&ke,X(Ue,R,this),this.pos===et&&this.skip(ke)}return R},readMessage:function(X,R){return this.readFields(X,R,this.readVarint()+this.pos)},readFixed32:function(){var X=Rb(this.buf,this.pos);return this.pos+=4,X},readSFixed32:function(){var X=O6(this.buf,this.pos);return this.pos+=4,X},readFixed64:function(){var X=Rb(this.buf,this.pos)+Rb(this.buf,this.pos+4)*zg;return this.pos+=8,X},readSFixed64:function(){var X=Rb(this.buf,this.pos)+O6(this.buf,this.pos+4)*zg;return this.pos+=8,X},readFloat:function(){var X=py(this.buf,this.pos,!0,23,4);return this.pos+=4,X},readDouble:function(){var X=py(this.buf,this.pos,!0,52,8);return this.pos+=8,X},readVarint:function(X){var R,ae,ke=this.buf;return R=127&(ae=ke[this.pos++]),ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<7,ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<14,ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<21,ae<128?R:function(Ue,et,it){var Ct,$t,or=it.buf;if(Ct=(112&($t=or[it.pos++]))>>4,$t<128||(Ct|=(127&($t=or[it.pos++]))<<3,$t<128)||(Ct|=(127&($t=or[it.pos++]))<<10,$t<128)||(Ct|=(127&($t=or[it.pos++]))<<17,$t<128)||(Ct|=(127&($t=or[it.pos++]))<<24,$t<128)||(Ct|=(1&($t=or[it.pos++]))<<31,$t<128))return Gw(Ue,Ct,et);throw new Error("Expected varint not more than 10 bytes")}(R|=(15&(ae=ke[this.pos]))<<28,X,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var X=this.readVarint();return X%2==1?(X+1)/-2:X/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var X=this.readVarint()+this.pos,R=this.pos;return this.pos=X,X-R>=12&&o1?function(ae,ke,Ue){return o1.decode(ae.subarray(ke,Ue))}(this.buf,R,X):function(ae,ke,Ue){for(var et="",it=ke;it239?4:Sr>223?3:Sr>191?2:1;if(it+ai>Ue)break;ai===1?Sr<128&&(Rr=Sr):ai===2?(192&(Ct=ae[it+1]))==128&&(Rr=(31&Sr)<<6|63&Ct)<=127&&(Rr=null):ai===3?($t=ae[it+2],(192&(Ct=ae[it+1]))==128&&(192&$t)==128&&((Rr=(15&Sr)<<12|(63&Ct)<<6|63&$t)<=2047||Rr>=55296&&Rr<=57343)&&(Rr=null)):ai===4&&($t=ae[it+2],or=ae[it+3],(192&(Ct=ae[it+1]))==128&&(192&$t)==128&&(192&or)==128&&((Rr=(15&Sr)<<18|(63&Ct)<<12|(63&$t)<<6|63&or)<=65535||Rr>=1114112)&&(Rr=null)),Rr===null?(Rr=65533,ai=1):Rr>65535&&(Rr-=65536,et+=String.fromCharCode(Rr>>>10&1023|55296),Rr=56320|1023&Rr),et+=String.fromCharCode(Rr),it+=ai}return et}(this.buf,R,X)},readBytes:function(){var X=this.readVarint()+this.pos,R=this.buf.subarray(this.pos,X);return this.pos=X,R},readPackedVarint:function(X,R){if(this.type!==$c.Bytes)return X.push(this.readVarint(R));var ae=Rm(this);for(X=X||[];this.pos127;);else if(R===$c.Bytes)this.pos=this.readVarint()+this.pos;else if(R===$c.Fixed32)this.pos+=4;else{if(R!==$c.Fixed64)throw new Error("Unimplemented type: "+R);this.pos+=8}},writeTag:function(X,R){this.writeVarint(X<<3|R)},realloc:function(X){for(var R=this.length||16;R268435455||X<0?function(R,ae){var ke,Ue;if(R>=0?(ke=R%4294967296|0,Ue=R/4294967296|0):(Ue=~(-R/4294967296),4294967295^(ke=~(-R%4294967296))?ke=ke+1|0:(ke=0,Ue=Ue+1|0)),R>=18446744073709552e3||R<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ae.realloc(10),function(et,it,Ct){Ct.buf[Ct.pos++]=127&et|128,et>>>=7,Ct.buf[Ct.pos++]=127&et|128,et>>>=7,Ct.buf[Ct.pos++]=127&et|128,et>>>=7,Ct.buf[Ct.pos++]=127&et|128,Ct.buf[Ct.pos]=127&(et>>>=7)}(ke,0,ae),function(et,it){var Ct=(7&et)<<4;it.buf[it.pos++]|=Ct|((et>>>=3)?128:0),et&&(it.buf[it.pos++]=127&et|((et>>>=7)?128:0),et&&(it.buf[it.pos++]=127&et|((et>>>=7)?128:0),et&&(it.buf[it.pos++]=127&et|((et>>>=7)?128:0),et&&(it.buf[it.pos++]=127&et|((et>>>=7)?128:0),et&&(it.buf[it.pos++]=127&et)))))}(Ue,ae)}(X,this):(this.realloc(4),this.buf[this.pos++]=127&X|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=X>>>7&127))))},writeSVarint:function(X){this.writeVarint(X<0?2*-X-1:2*X)},writeBoolean:function(X){this.writeVarint(!!X)},writeString:function(X){X=String(X),this.realloc(4*X.length),this.pos++;var R=this.pos;this.pos=function(ke,Ue,et){for(var it,Ct,$t=0;$t55295&&it<57344){if(!Ct){it>56319||$t+1===Ue.length?(ke[et++]=239,ke[et++]=191,ke[et++]=189):Ct=it;continue}if(it<56320){ke[et++]=239,ke[et++]=191,ke[et++]=189,Ct=it;continue}it=Ct-55296<<10|it-56320|65536,Ct=null}else Ct&&(ke[et++]=239,ke[et++]=191,ke[et++]=189,Ct=null);it<128?ke[et++]=it:(it<2048?ke[et++]=it>>6|192:(it<65536?ke[et++]=it>>12|224:(ke[et++]=it>>18|240,ke[et++]=it>>12&63|128),ke[et++]=it>>6&63|128),ke[et++]=63&it|128)}return et}(this.buf,X,this.pos);var ae=this.pos-R;ae>=128&&my(R,ae,this),this.pos=R-1,this.writeVarint(ae),this.pos+=ae},writeFloat:function(X){this.realloc(4),zb(this.buf,X,this.pos,!0,23,4),this.pos+=4},writeDouble:function(X){this.realloc(8),zb(this.buf,X,this.pos,!0,52,8),this.pos+=8},writeBytes:function(X){var R=X.length;this.writeVarint(R),this.realloc(R);for(var ae=0;ae=128&&my(ae,ke,this),this.pos=ae-1,this.writeVarint(ke),this.pos+=ke},writeMessage:function(X,R,ae){this.writeTag(X,$c.Bytes),this.writeRawMessage(R,ae)},writePackedVarint:function(X,R){R.length&&this.writeMessage(X,SA,R)},writePackedSVarint:function(X,R){R.length&&this.writeMessage(X,CA,R)},writePackedBoolean:function(X,R){R.length&&this.writeMessage(X,EA,R)},writePackedFloat:function(X,R){R.length&&this.writeMessage(X,AA,R)},writePackedDouble:function(X,R){R.length&&this.writeMessage(X,MA,R)},writePackedFixed32:function(X,R){R.length&&this.writeMessage(X,LA,R)},writePackedSFixed32:function(X,R){R.length&&this.writeMessage(X,PA,R)},writePackedFixed64:function(X,R){R.length&&this.writeMessage(X,IA,R)},writePackedSFixed64:function(X,R){R.length&&this.writeMessage(X,Bb,R)},writeBytesField:function(X,R){this.writeTag(X,$c.Bytes),this.writeBytes(R)},writeFixed32Field:function(X,R){this.writeTag(X,$c.Fixed32),this.writeFixed32(R)},writeSFixed32Field:function(X,R){this.writeTag(X,$c.Fixed32),this.writeSFixed32(R)},writeFixed64Field:function(X,R){this.writeTag(X,$c.Fixed64),this.writeFixed64(R)},writeSFixed64Field:function(X,R){this.writeTag(X,$c.Fixed64),this.writeSFixed64(R)},writeVarintField:function(X,R){this.writeTag(X,$c.Varint),this.writeVarint(R)},writeSVarintField:function(X,R){this.writeTag(X,$c.Varint),this.writeSVarint(R)},writeStringField:function(X,R){this.writeTag(X,$c.Bytes),this.writeString(R)},writeFloatField:function(X,R){this.writeTag(X,$c.Fixed32),this.writeFloat(R)},writeDoubleField:function(X,R){this.writeTag(X,$c.Fixed64),this.writeDouble(R)},writeBooleanField:function(X,R){this.writeVarintField(X,!!R)}};var Zw=a(a1);let Fb=3;function DA(X,R,ae){X===1&&ae.readMessage(B6,R)}function B6(X,R,ae){if(X===3){let{id:ke,bitmap:Ue,width:et,height:it,left:Ct,top:$t,advance:or}=ae.readMessage(Kw,{});R.push({id:ke,bitmap:new Kl({width:et+2*Fb,height:it+2*Fb},Ue),metrics:{width:et,height:it,left:Ct,top:$t,advance:or}})}}function Kw(X,R,ae){X===1?R.id=ae.readVarint():X===2?R.bitmap=ae.readBytes():X===3?R.width=ae.readVarint():X===4?R.height=ae.readVarint():X===5?R.left=ae.readSVarint():X===6?R.top=ae.readSVarint():X===7&&(R.advance=ae.readVarint())}let Yw=Fb;function Nb(X){let R=0,ae=0;for(let it of X)R+=it.w*it.h,ae=Math.max(ae,it.w);X.sort((it,Ct)=>Ct.h-it.h);let ke=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(R/.95)),ae),h:1/0}],Ue=0,et=0;for(let it of X)for(let Ct=ke.length-1;Ct>=0;Ct--){let $t=ke[Ct];if(!(it.w>$t.w||it.h>$t.h)){if(it.x=$t.x,it.y=$t.y,et=Math.max(et,it.y+it.h),Ue=Math.max(Ue,it.x+it.w),it.w===$t.w&&it.h===$t.h){let or=ke.pop();Ct=0&&ke>=R&&Ub[this.text.charCodeAt(ke)];ke--)ae--;this.text=this.text.substring(R,ae),this.sectionIndex=this.sectionIndex.slice(R,ae)}substring(R,ae){let ke=new yy;return ke.text=this.text.substring(R,ae),ke.sectionIndex=this.sectionIndex.slice(R,ae),ke.sections=this.sections,ke}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((R,ae)=>Math.max(R,this.sections[ae].scale),0)}addTextSection(R,ae){this.text+=R.text,this.sections.push(q_.forText(R.scale,R.fontStack||ae));let ke=this.sections.length-1;for(let Ue=0;Ue=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function jb(X,R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi){let Gi=yy.fromFeature(X,Ue),pn;Rr===i.ah.vertical&&Gi.verticalizePunctuation();let{processBidirectionalText:jn,processStyledBidirectionalText:Fa}=iu;if(jn&&Gi.sections.length===1){pn=[];let lo=jn(Gi.toString(),s1(Gi,or,et,R,ke,bi));for(let Oo of lo){let Ps=new yy;Ps.text=Oo,Ps.sections=Gi.sections;for(let Bl=0;Bl0&&_m>tp&&(tp=_m)}else{let bh=Ps[fc.fontStack],rp=bh&&bh[nh];if(rp&&rp.rect)Ay=rp.rect,Bh=rp.metrics;else{let _m=Oo[fc.fontStack],P0=_m&&_m[nh];if(!P0)continue;Bh=P0.metrics}of=(Bd-fc.scale)*Ic}Mp?(lo.verticalizable=!0,qp.push({glyph:nh,imageName:Fm,x:eu,y:xh+of,vertical:Mp,scale:fc.scale,fontStack:fc.fontStack,sectionIndex:Hc,metrics:Bh,rect:Ay}),eu+=Nm*fc.scale+wo):(qp.push({glyph:nh,imageName:Fm,x:eu,y:xh+of,vertical:Mp,scale:fc.scale,fontStack:fc.fontStack,sectionIndex:Hc,metrics:Bh,rect:Ay}),eu+=Bh.advance*fc.scale+wo)}qp.length!==0&&(ph=Math.max(eu-wo,ph),BA(qp,0,qp.length-1,d0,tp)),eu=0;let L0=vs*Bd+tp;mp.lineOffset=Math.max(tp,Ap),xh+=L0,Od=Math.max(L0,Od),++Vf}var vd;let Hp=xh-vy,{horizontalAlign:Vp,verticalAlign:Wp}=Jw(nl);(function(vf,Bd,Ap,mp,qp,tp,L0,Oh,fc){let Hc=(Bd-Ap)*qp,nh=0;nh=tp!==L0?-Oh*mp-vy:(-mp*fc+.5)*L0;for(let of of vf)for(let Bh of of.positionedGlyphs)Bh.x+=Hc,Bh.y+=nh})(lo.positionedLines,d0,Vp,Wp,ph,Od,vs,Hp,Ss.length),lo.top+=-Wp*Hp,lo.bottom=lo.top+Hp,lo.left+=-Vp*ph,lo.right=lo.left+ph}(Aa,R,ae,ke,pn,it,Ct,$t,Rr,or,ai,Fi),!function(lo){for(let Oo of lo)if(Oo.positionedGlyphs.length!==0)return!1;return!0}(ha)&&Aa}let Ub={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},zA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},OA={40:!0};function $b(X,R,ae,ke,Ue,et){if(R.imageName){let it=ke[R.imageName];return it?it.displaySize[0]*R.scale*Ic/et+Ue:0}{let it=ae[R.fontStack],Ct=it&&it[X];return Ct?Ct.metrics.advance*R.scale+Ue:0}}function F6(X,R,ae,ke){let Ue=Math.pow(X-R,2);return ke?X=0,or=0;for(let Rr=0;Rror){let Sr=Math.ceil(et/or);Ue*=Sr/it,it=Sr}return{x1:ke,y1:Ue,x2:ke+et,y2:Ue+it}}function j6(X,R,ae,ke,Ue,et){let it=X.image,Ct;if(it.content){let pn=it.content,jn=it.pixelRatio||1;Ct=[pn[0]/jn,pn[1]/jn,it.displaySize[0]-pn[2]/jn,it.displaySize[1]-pn[3]/jn]}let $t=R.left*et,or=R.right*et,Sr,Rr,ai,bi;ae==="width"||ae==="both"?(bi=Ue[0]+$t-ke[3],Rr=Ue[0]+or+ke[1]):(bi=Ue[0]+($t+or-it.displaySize[0])/2,Rr=bi+it.displaySize[0]);let Fi=R.top*et,Gi=R.bottom*et;return ae==="height"||ae==="both"?(Sr=Ue[1]+Fi-ke[0],ai=Ue[1]+Gi+ke[2]):(Sr=Ue[1]+(Fi+Gi-it.displaySize[1])/2,ai=Sr+it.displaySize[1]),{image:it,top:Sr,right:Rr,bottom:ai,left:bi,collisionPadding:Ct}}let G_=255,rg=128,sv=G_*rg;function U6(X,R){let{expression:ae}=R;if(ae.kind==="constant")return{kind:"constant",layoutSize:ae.evaluate(new Wl(X+1))};if(ae.kind==="source")return{kind:"source"};{let{zoomStops:ke,interpolationType:Ue}=ae,et=0;for(;etit.id),this.index=R.index,this.pixelRatio=R.pixelRatio,this.sourceLayerIndex=R.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=wn([]),this.placementViewportMatrix=wn([]);let ae=this.layers[0]._unevaluatedLayout._values;this.textSizeData=U6(this.zoom,ae["text-size"]),this.iconSizeData=U6(this.zoom,ae["icon-size"]);let ke=this.layers[0].layout,Ue=ke.get("symbol-sort-key"),et=ke.get("symbol-z-order");this.canOverlap=Qw(ke,"text-overlap","text-allow-overlap")!=="never"||Qw(ke,"icon-overlap","icon-allow-overlap")!=="never"||ke.get("text-ignore-placement")||ke.get("icon-ignore-placement"),this.sortFeaturesByKey=et!=="viewport-y"&&!Ue.isConstant(),this.sortFeaturesByY=(et==="viewport-y"||et==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,ke.get("symbol-placement")==="point"&&(this.writingModes=ke.get("text-writing-mode").map(it=>i.ah[it])),this.stateDependentLayerIds=this.layers.filter(it=>it.isStateDependent()).map(it=>it.id),this.sourceID=R.sourceID}createArrays(){this.text=new Sf(new nu(this.layers,this.zoom,R=>/^text/.test(R))),this.icon=new Sf(new nu(this.layers,this.zoom,R=>/^icon/.test(R))),this.glyphOffsetArray=new wl,this.lineVertexArray=new Al,this.symbolInstances=new _s,this.textAnchorOffsets=new Pl}calculateGlyphDependencies(R,ae,ke,Ue,et){for(let it=0;it0)&&(it.value.kind!=="constant"||it.value.value.length>0),Sr=$t.value.kind!=="constant"||!!$t.value.value||Object.keys($t.parameters).length>0,Rr=et.get("symbol-sort-key");if(this.features=[],!or&&!Sr)return;let ai=ae.iconDependencies,bi=ae.glyphDependencies,Fi=ae.availableImages,Gi=new Wl(this.zoom);for(let{feature:pn,id:jn,index:Fa,sourceLayerIndex:ha}of R){let Aa=Ue._featureFilter.needGeometry,lo=Nr(pn,Aa);if(!Ue._featureFilter.filter(Gi,lo,ke))continue;let Oo,Ps;if(Aa||(lo.geometry=Pr(pn)),or){let Ss=Ue.getValueAndResolveTokens("text-field",lo,ke,Fi),vs=Ui.factory(Ss),nl=this.hasRTLText=this.hasRTLText||NA(vs);(!nl||iu.getRTLTextPluginStatus()==="unavailable"||nl&&iu.isParsed())&&(Oo=gf(vs,Ue,lo))}if(Sr){let Ss=Ue.getValueAndResolveTokens("icon-image",lo,ke,Fi);Ps=Ss instanceof Gn?Ss:Gn.fromString(Ss)}if(!Oo&&!Ps)continue;let Bl=this.sortFeaturesByKey?Rr.evaluate(lo,{},ke):void 0;if(this.features.push({id:jn,text:Oo,icon:Ps,index:Fa,sourceLayerIndex:ha,geometry:lo.geometry,properties:pn.properties,type:FA[pn.type],sortKey:Bl}),Ps&&(ai[Ps.name]=!0),Oo){let Ss=it.evaluate(lo,{},ke).join(","),vs=et.get("text-rotation-alignment")!=="viewport"&&et.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(i.ah.vertical)>=0;for(let nl of Oo.sections)if(nl.image)ai[nl.image.name]=!0;else{let qs=bs(Oo.toString()),Ns=nl.fontStack||Ss,wo=bi[Ns]=bi[Ns]||{};this.calculateGlyphDependencies(nl.text,wo,vs,this.allowVerticalPlacement,qs)}}}et.get("symbol-placement")==="line"&&(this.features=function(pn){let jn={},Fa={},ha=[],Aa=0;function lo(Ss){ha.push(pn[Ss]),Aa++}function Oo(Ss,vs,nl){let qs=Fa[Ss];return delete Fa[Ss],Fa[vs]=qs,ha[qs].geometry[0].pop(),ha[qs].geometry[0]=ha[qs].geometry[0].concat(nl[0]),qs}function Ps(Ss,vs,nl){let qs=jn[vs];return delete jn[vs],jn[Ss]=qs,ha[qs].geometry[0].shift(),ha[qs].geometry[0]=nl[0].concat(ha[qs].geometry[0]),qs}function Bl(Ss,vs,nl){let qs=nl?vs[0][vs[0].length-1]:vs[0][0];return`${Ss}:${qs.x}:${qs.y}`}for(let Ss=0;SsSs.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((pn,jn)=>pn.sortKey-jn.sortKey)}update(R,ae,ke){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(R,ae,this.layers,ke),this.icon.programConfigurations.updatePaintArrays(R,ae,this.layers,ke))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(R){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(R),this.iconCollisionBox.upload(R)),this.text.upload(R,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(R,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(R,ae){let ke=this.lineVertexArray.length;if(R.segment!==void 0){let Ue=R.dist(ae[R.segment+1]),et=R.dist(ae[R.segment]),it={};for(let Ct=R.segment+1;Ct=0;Ct--)it[Ct]={x:ae[Ct].x,y:ae[Ct].y,tileUnitDistanceFromAnchor:et},Ct>0&&(et+=ae[Ct-1].dist(ae[Ct]));for(let Ct=0;Ct0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(R,ae){let ke=R.placedSymbolArray.get(ae),Ue=ke.vertexStartIndex+4*ke.numGlyphs;for(let et=ke.vertexStartIndex;etUe[Ct]-Ue[$t]||et[$t]-et[Ct]),it}addToSortKeyRanges(R,ae){let ke=this.sortKeyRanges[this.sortKeyRanges.length-1];ke&&ke.sortKey===ae?ke.symbolInstanceEnd=R+1:this.sortKeyRanges.push({sortKey:ae,symbolInstanceStart:R,symbolInstanceEnd:R+1})}sortFeatures(R){if(this.sortFeaturesByY&&this.sortedAngle!==R&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(R),this.sortedAngle=R,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let ae of this.symbolInstanceIndexes){let ke=this.symbolInstances.get(ae);this.featureSortOrder.push(ke.featureIndex),[ke.rightJustifiedTextSymbolIndex,ke.centerJustifiedTextSymbolIndex,ke.leftJustifiedTextSymbolIndex].forEach((Ue,et,it)=>{Ue>=0&&it.indexOf(Ue)===et&&this.addIndicesForPlacedSymbol(this.text,Ue)}),ke.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,ke.verticalPlacedTextSymbolIndex),ke.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ke.placedIconSymbolIndex),ke.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ke.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Z_,K_;fa("SymbolBucket",l1,{omit:["layers","collisionBoxArray","features","compareText"]}),l1.MAX_GLYPHS=65535,l1.addDynamicAttributes=lv;var t3={get paint(){return K_=K_||new Ke({"icon-opacity":new Fs(fe.paint_symbol["icon-opacity"]),"icon-color":new Fs(fe.paint_symbol["icon-color"]),"icon-halo-color":new Fs(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fs(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fs(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new cs(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new cs(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fs(fe.paint_symbol["text-opacity"]),"text-color":new Fs(fe.paint_symbol["text-color"],{runtimeType:gr,getOverride:X=>X.textColor,hasOverride:X=>!!X.textColor}),"text-halo-color":new Fs(fe.paint_symbol["text-halo-color"]),"text-halo-width":new Fs(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new Fs(fe.paint_symbol["text-halo-blur"]),"text-translate":new cs(fe.paint_symbol["text-translate"]),"text-translate-anchor":new cs(fe.paint_symbol["text-translate-anchor"])})},get layout(){return Z_=Z_||new Ke({"symbol-placement":new cs(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new cs(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new cs(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fs(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new cs(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new cs(fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new cs(fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new cs(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new cs(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new cs(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fs(fe.layout_symbol["icon-size"]),"icon-text-fit":new cs(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new cs(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fs(fe.layout_symbol["icon-image"]),"icon-rotate":new Fs(fe.layout_symbol["icon-rotate"]),"icon-padding":new Fs(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new cs(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new Fs(fe.layout_symbol["icon-offset"]),"icon-anchor":new Fs(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new cs(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new cs(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new cs(fe.layout_symbol["text-rotation-alignment"]),"text-field":new Fs(fe.layout_symbol["text-field"]),"text-font":new Fs(fe.layout_symbol["text-font"]),"text-size":new Fs(fe.layout_symbol["text-size"]),"text-max-width":new Fs(fe.layout_symbol["text-max-width"]),"text-line-height":new cs(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new Fs(fe.layout_symbol["text-letter-spacing"]),"text-justify":new Fs(fe.layout_symbol["text-justify"]),"text-radial-offset":new Fs(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new cs(fe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Fs(fe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Fs(fe.layout_symbol["text-anchor"]),"text-max-angle":new cs(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new cs(fe.layout_symbol["text-writing-mode"]),"text-rotate":new Fs(fe.layout_symbol["text-rotate"]),"text-padding":new cs(fe.layout_symbol["text-padding"]),"text-keep-upright":new cs(fe.layout_symbol["text-keep-upright"]),"text-transform":new Fs(fe.layout_symbol["text-transform"]),"text-offset":new Fs(fe.layout_symbol["text-offset"]),"text-allow-overlap":new cs(fe.layout_symbol["text-allow-overlap"]),"text-overlap":new cs(fe.layout_symbol["text-overlap"]),"text-ignore-placement":new cs(fe.layout_symbol["text-ignore-placement"]),"text-optional":new cs(fe.layout_symbol["text-optional"])})}};class xy{constructor(R){if(R.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=R.property.overrides?R.property.overrides.runtimeType:ut,this.defaultValue=R}evaluate(R){if(R.formattedSection){let ae=this.defaultValue.property.overrides;if(ae&&ae.hasOverride(R.formattedSection))return ae.getOverride(R.formattedSection)}return R.feature&&R.featureState?this.defaultValue.evaluate(R.feature,R.featureState):this.defaultValue.property.specification.default}eachChild(R){this.defaultValue.isConstant()||R(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}fa("FormatSectionOverride",xy,{omit:["defaultValue"]});class Wb extends pe{constructor(R){super(R,t3)}recalculate(R,ae){if(super.recalculate(R,ae),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let ke=this.layout.get("text-writing-mode");if(ke){let Ue=[];for(let et of ke)Ue.indexOf(et)<0&&Ue.push(et);this.layout._values["text-writing-mode"]=Ue}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(R,ae,ke,Ue){let et=this.layout.get(R).evaluate(ae,{},ke,Ue),it=this._unevaluatedLayout._values[R];return it.isDataDriven()||tf(it.value)||!et?et:function(Ct,$t){return $t.replace(/{([^{}]+)}/g,(or,Sr)=>Ct&&Sr in Ct?String(Ct[Sr]):"")}(ae.properties,et)}createBucket(R){return new l1(R)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let R of t3.paint.overridableProperties){if(!Wb.hasPaintOverride(this.layout,R))continue;let ae=this.paint.get(R),ke=new xy(ae),Ue=new Xc(ke,ae.property.specification),et=null;et=ae.value.kind==="constant"||ae.value.kind==="source"?new jh("source",Ue):new Rc("composite",Ue,ae.value.zoomStops),this.paint._values[R]=new Wu(ae.property,et,ae.parameters)}}_handleOverridablePaintPropertyUpdate(R,ae,ke){return!(!this.layout||ae.isDataDriven()||ke.isDataDriven())&&Wb.hasPaintOverride(this.layout,R)}static hasPaintOverride(R,ae){let ke=R.get("text-field"),Ue=t3.paint.properties[ae],et=!1,it=Ct=>{for(let $t of Ct)if(Ue.overrides&&Ue.overrides.hasOverride($t))return void(et=!0)};if(ke.value.kind==="constant"&&ke.value.value instanceof Ui)it(ke.value.value.sections);else if(ke.value.kind==="source"){let Ct=or=>{et||(or instanceof ro&&Mn(or.value)===Mr?it(or.value.sections):or instanceof Il?it(or.sections):or.eachChild(Ct))},$t=ke.value;$t._styleExpression&&Ct($t._styleExpression.expression)}return et}}let r3;var $6={get paint(){return r3=r3||new Ke({"background-color":new cs(fe.paint_background["background-color"]),"background-pattern":new tc(fe.paint_background["background-pattern"]),"background-opacity":new cs(fe.paint_background["background-opacity"])})}};class Y_ extends pe{constructor(R){super(R,$6)}}let qb;var i3={get paint(){return qb=qb||new Ke({"raster-opacity":new cs(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new cs(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new cs(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new cs(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new cs(fe.paint_raster["raster-saturation"]),"raster-contrast":new cs(fe.paint_raster["raster-contrast"]),"raster-resampling":new cs(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new cs(fe.paint_raster["raster-fade-duration"])})}};class jA extends pe{constructor(R){super(R,i3)}}class H6 extends pe{constructor(R){super(R,{}),this.onAdd=ae=>{this.implementation.onAdd&&this.implementation.onAdd(ae,ae.painter.context.gl)},this.onRemove=ae=>{this.implementation.onRemove&&this.implementation.onRemove(ae,ae.painter.context.gl)},this.implementation=R}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class X_{constructor(R){this._methodToThrottle=R,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let n3=63710088e-1;class ig{constructor(R,ae){if(isNaN(R)||isNaN(ae))throw new Error(`Invalid LngLat object: (${R}, ${ae})`);if(this.lng=+R,this.lat=+ae,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ig(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(R){let ae=Math.PI/180,ke=this.lat*ae,Ue=R.lat*ae,et=Math.sin(ke)*Math.sin(Ue)+Math.cos(ke)*Math.cos(Ue)*Math.cos((R.lng-this.lng)*ae);return n3*Math.acos(Math.min(et,1))}static convert(R){if(R instanceof ig)return R;if(Array.isArray(R)&&(R.length===2||R.length===3))return new ig(Number(R[0]),Number(R[1]));if(!Array.isArray(R)&&typeof R=="object"&&R!==null)return new ig(Number("lng"in R?R.lng:R.lon),Number(R.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let V6=2*Math.PI*n3;function Gb(X){return V6*Math.cos(X*Math.PI/180)}function Zb(X){return(180+X)/360}function W6(X){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X*Math.PI/360)))/360}function ym(X,R){return X/Gb(R)}function a3(X){return 360/Math.PI*Math.atan(Math.exp((180-360*X)*Math.PI/180))-90}class J_{constructor(R,ae,ke=0){this.x=+R,this.y=+ae,this.z=+ke}static fromLngLat(R,ae=0){let ke=ig.convert(R);return new J_(Zb(ke.lng),W6(ke.lat),ym(ae,ke.lat))}toLngLat(){return new ig(360*this.x-180,a3(this.y))}toAltitude(){return this.z*Gb(a3(this.y))}meterInMercatorCoordinateUnits(){return 1/V6*(R=a3(this.y),1/Math.cos(R*Math.PI/180));var R}}function q6(X,R,ae){var ke=2*Math.PI*6378137/256/Math.pow(2,ae);return[X*ke-2*Math.PI*6378137/2,R*ke-2*Math.PI*6378137/2]}class o3{constructor(R,ae,ke){if(!function(Ue,et,it){return!(Ue<0||Ue>25||it<0||it>=Math.pow(2,Ue)||et<0||et>=Math.pow(2,Ue))}(R,ae,ke))throw new Error(`x=${ae}, y=${ke}, z=${R} outside of bounds. 0<=x<${Math.pow(2,R)}, 0<=y<${Math.pow(2,R)} 0<=z<=25 `);this.z=R,this.x=ae,this.y=ke,this.key=by(0,R,R,ae,ke)}equals(R){return this.z===R.z&&this.x===R.x&&this.y===R.y}url(R,ae,ke){let Ue=(it=this.y,Ct=this.z,$t=q6(256*(et=this.x),256*(it=Math.pow(2,Ct)-it-1),Ct),or=q6(256*(et+1),256*(it+1),Ct),$t[0]+","+$t[1]+","+or[0]+","+or[1]);var et,it,Ct,$t,or;let Sr=function(Rr,ai,bi){let Fi,Gi="";for(let pn=Rr;pn>0;pn--)Fi=1<1?"@2x":"").replace(/{quadkey}/g,Sr).replace(/{bbox-epsg-3857}/g,Ue)}isChildOf(R){let ae=this.z-R.z;return ae>0&&R.x===this.x>>ae&&R.y===this.y>>ae}getTilePoint(R){let ae=Math.pow(2,this.z);return new u((R.x*ae-this.x)*cu,(R.y*ae-this.y)*cu)}toString(){return`${this.z}/${this.x}/${this.y}`}}class G6{constructor(R,ae){this.wrap=R,this.canonical=ae,this.key=by(R,ae.z,ae.z,ae.x,ae.y)}}class J0{constructor(R,ae,ke,Ue,et){if(R= z; overscaledZ = ${R}; z = ${ke}`);this.overscaledZ=R,this.wrap=ae,this.canonical=new o3(ke,+Ue,+et),this.key=by(ae,R,ke,Ue,et)}clone(){return new J0(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(R){return this.overscaledZ===R.overscaledZ&&this.wrap===R.wrap&&this.canonical.equals(R.canonical)}scaledTo(R){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let ae=this.canonical.z-R;return R>this.canonical.z?new J0(R,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new J0(R,this.wrap,R,this.canonical.x>>ae,this.canonical.y>>ae)}calculateScaledKey(R,ae){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let ke=this.canonical.z-R;return R>this.canonical.z?by(this.wrap*+ae,R,this.canonical.z,this.canonical.x,this.canonical.y):by(this.wrap*+ae,R,R,this.canonical.x>>ke,this.canonical.y>>ke)}isChildOf(R){if(R.wrap!==this.wrap)return!1;let ae=this.canonical.z-R.canonical.z;return R.overscaledZ===0||R.overscaledZ>ae&&R.canonical.y===this.canonical.y>>ae}children(R){if(this.overscaledZ>=R)return[new J0(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let ae=this.canonical.z+1,ke=2*this.canonical.x,Ue=2*this.canonical.y;return[new J0(ae,this.wrap,ae,ke,Ue),new J0(ae,this.wrap,ae,ke+1,Ue),new J0(ae,this.wrap,ae,ke,Ue+1),new J0(ae,this.wrap,ae,ke+1,Ue+1)]}isLessThan(R){return this.wrapR.wrap)&&(this.overscaledZR.overscaledZ)&&(this.canonical.xR.canonical.x)&&this.canonical.ythis.max&&(this.max=Rr),Rr=this.dim+1||ae<-1||ae>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(ae+1)*this.stride+(R+1)}unpack(R,ae,ke){return R*this.redFactor+ae*this.greenFactor+ke*this.blueFactor-this.baseShift}getPixels(){return new zl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(R,ae,ke){if(this.dim!==R.dim)throw new Error("dem dimension mismatch");let Ue=ae*this.dim,et=ae*this.dim+this.dim,it=ke*this.dim,Ct=ke*this.dim+this.dim;switch(ae){case-1:Ue=et-1;break;case 1:et=Ue+1}switch(ke){case-1:it=Ct-1;break;case 1:Ct=it+1}let $t=-ae*this.dim,or=-ke*this.dim;for(let Sr=it;Sr=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${R} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[R]}}class K6{constructor(R,ae,ke,Ue,et){this.type="Feature",this._vectorTileFeature=R,R._z=ae,R._x=ke,R._y=Ue,this.properties=R.properties,this.id=et}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(R){this._geometry=R}toJSON(){let R={geometry:this.geometry};for(let ae in this)ae!=="_geometry"&&ae!=="_vectorTileFeature"&&(R[ae]=this[ae]);return R}}class Y6{constructor(R,ae){this.tileID=R,this.x=R.canonical.x,this.y=R.canonical.y,this.z=R.canonical.z,this.grid=new Va(cu,16,0),this.grid3D=new Va(cu,16,0),this.featureIndexArray=new Tu,this.promoteId=ae}insert(R,ae,ke,Ue,et,it){let Ct=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ke,Ue,et);let $t=it?this.grid3D:this.grid;for(let or=0;or=0&&Rr[3]>=0&&$t.insert(Ct,Rr[0],Rr[1],Rr[2],Rr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new In.VectorTile(new Zw(this.rawTileData)).layers,this.sourceLayerCoder=new Z6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(R,ae,ke,Ue){this.loadVTLayers();let et=R.params||{},it=cu/R.tileSize/R.scale,Ct=jf(et.filter),$t=R.queryGeometry,or=R.queryPadding*it,Sr=s3($t),Rr=this.grid.query(Sr.minX-or,Sr.minY-or,Sr.maxX+or,Sr.maxY+or),ai=s3(R.cameraQueryGeometry),bi=this.grid3D.query(ai.minX-or,ai.minY-or,ai.maxX+or,ai.maxY+or,(pn,jn,Fa,ha)=>function(Aa,lo,Oo,Ps,Bl){for(let vs of Aa)if(lo<=vs.x&&Oo<=vs.y&&Ps>=vs.x&&Bl>=vs.y)return!0;let Ss=[new u(lo,Oo),new u(lo,Bl),new u(Ps,Bl),new u(Ps,Oo)];if(Aa.length>2){for(let vs of Ss)if(Nn(Aa,vs))return!0}for(let vs=0;vs(ha||(ha=Pr(Aa)),lo.queryIntersectsFeature($t,Aa,Oo,ha,this.z,R.transform,it,R.pixelPosMatrix)))}return Fi}loadMatchingFeature(R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr){let ai=this.bucketLayerIDs[ae];if(it&&!function(pn,jn){for(let Fa=0;Fa=0)return!0;return!1}(it,ai))return;let bi=this.sourceLayerCoder.decode(ke),Fi=this.vtLayers[bi].feature(Ue);if(et.needGeometry){let pn=Nr(Fi,!0);if(!et.filter(new Wl(this.tileID.overscaledZ),pn,this.tileID.canonical))return}else if(!et.filter(new Wl(this.tileID.overscaledZ),Fi))return;let Gi=this.getId(Fi,bi);for(let pn=0;pn{let Ct=R instanceof Wh?R.get(it):null;return Ct&&Ct.evaluate?Ct.evaluate(ae,ke,Ue):Ct})}function s3(X){let R=1/0,ae=1/0,ke=-1/0,Ue=-1/0;for(let et of X)R=Math.min(R,et.x),ae=Math.min(ae,et.y),ke=Math.max(ke,et.x),Ue=Math.max(Ue,et.y);return{minX:R,minY:ae,maxX:ke,maxY:Ue}}function J6(X,R){return R-X}function Q6(X,R,ae,ke,Ue){let et=[];for(let it=0;it=ke&&Rr.x>=ke||(Sr.x>=ke?Sr=new u(ke,Sr.y+(ke-Sr.x)/(Rr.x-Sr.x)*(Rr.y-Sr.y))._round():Rr.x>=ke&&(Rr=new u(ke,Sr.y+(ke-Sr.x)/(Rr.x-Sr.x)*(Rr.y-Sr.y))._round()),Sr.y>=Ue&&Rr.y>=Ue||(Sr.y>=Ue?Sr=new u(Sr.x+(Ue-Sr.y)/(Rr.y-Sr.y)*(Rr.x-Sr.x),Ue)._round():Rr.y>=Ue&&(Rr=new u(Sr.x+(Ue-Sr.y)/(Rr.y-Sr.y)*(Rr.x-Sr.x),Ue)._round()),$t&&Sr.equals($t[$t.length-1])||($t=[Sr],et.push($t)),$t.push(Rr)))))}}return et}fa("FeatureIndex",Y6,{omit:["rawTileData","sourceLayerCoder"]});class uv extends u{constructor(R,ae,ke,Ue){super(R,ae),this.angle=ke,Ue!==void 0&&(this.segment=Ue)}clone(){return new uv(this.x,this.y,this.angle,this.segment)}}function ek(X,R,ae,ke,Ue){if(R.segment===void 0||ae===0)return!0;let et=R,it=R.segment+1,Ct=0;for(;Ct>-ae/2;){if(it--,it<0)return!1;Ct-=X[it].dist(et),et=X[it]}Ct+=X[it].dist(X[it+1]),it++;let $t=[],or=0;for(;Ctke;)or-=$t.shift().angleDelta;if(or>Ue)return!1;it++,Ct+=Sr.dist(Rr)}return!0}function tk(X){let R=0;for(let ae=0;aeor){let Fi=(or-$t)/bi,Gi=Wo.number(Rr.x,ai.x,Fi),pn=Wo.number(Rr.y,ai.y,Fi),jn=new uv(Gi,pn,ai.angleTo(Rr),Sr);return jn._round(),!it||ek(X,jn,Ct,it,R)?jn:void 0}$t+=bi}}function $A(X,R,ae,ke,Ue,et,it,Ct,$t){let or=rk(ke,et,it),Sr=ik(ke,Ue),Rr=Sr*it,ai=X[0].x===0||X[0].x===$t||X[0].y===0||X[0].y===$t;return R-Rr=0&&Aa<$t&&lo>=0&&lo<$t&&ai-or>=0&&ai+or<=Sr){let Oo=new uv(Aa,lo,Fa,Fi);Oo._round(),ke&&!ek(X,Oo,et,ke,Ue)||bi.push(Oo)}}Rr+=jn}return Ct||bi.length||it||(bi=c1(X,Rr/2,ae,ke,Ue,et,it,!0,$t)),bi}fa("Anchor",uv);let wy=gd;function nk(X,R,ae,ke){let Ue=[],et=X.image,it=et.pixelRatio,Ct=et.paddedRect.w-2*wy,$t=et.paddedRect.h-2*wy,or={x1:X.left,y1:X.top,x2:X.right,y2:X.bottom},Sr=et.stretchX||[[0,Ct]],Rr=et.stretchY||[[0,$t]],ai=(wo,dl)=>wo+dl[1]-dl[0],bi=Sr.reduce(ai,0),Fi=Rr.reduce(ai,0),Gi=Ct-bi,pn=$t-Fi,jn=0,Fa=bi,ha=0,Aa=Fi,lo=0,Oo=Gi,Ps=0,Bl=pn;if(et.content&&ke){let wo=et.content,dl=wo[2]-wo[0],al=wo[3]-wo[1];(et.textFitWidth||et.textFitHeight)&&(or=N6(X)),jn=ky(Sr,0,wo[0]),ha=ky(Rr,0,wo[1]),Fa=ky(Sr,wo[0],wo[2]),Aa=ky(Rr,wo[1],wo[3]),lo=wo[0]-jn,Ps=wo[1]-ha,Oo=dl-Fa,Bl=al-Aa}let Ss=or.x1,vs=or.y1,nl=or.x2-Ss,qs=or.y2-vs,Ns=(wo,dl,al,eu)=>{let xh=E0(wo.stretch-jn,Fa,nl,Ss),ph=Kb(wo.fixed-lo,Oo,wo.stretch,bi),Od=E0(dl.stretch-ha,Aa,qs,vs),d0=Kb(dl.fixed-Ps,Bl,dl.stretch,Fi),Vf=E0(al.stretch-jn,Fa,nl,Ss),vd=Kb(al.fixed-lo,Oo,al.stretch,bi),Hp=E0(eu.stretch-ha,Aa,qs,vs),Vp=Kb(eu.fixed-Ps,Bl,eu.stretch,Fi),Wp=new u(xh,Od),vf=new u(Vf,Od),Bd=new u(Vf,Hp),Ap=new u(xh,Hp),mp=new u(ph/it,d0/it),qp=new u(vd/it,Vp/it),tp=R*Math.PI/180;if(tp){let fc=Math.sin(tp),Hc=Math.cos(tp),nh=[Hc,-fc,fc,Hc];Wp._matMult(nh),vf._matMult(nh),Ap._matMult(nh),Bd._matMult(nh)}let L0=wo.stretch+wo.fixed,Oh=dl.stretch+dl.fixed;return{tl:Wp,tr:vf,bl:Ap,br:Bd,tex:{x:et.paddedRect.x+wy+L0,y:et.paddedRect.y+wy+Oh,w:al.stretch+al.fixed-L0,h:eu.stretch+eu.fixed-Oh},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:mp,pixelOffsetBR:qp,minFontScaleX:Oo/it/nl,minFontScaleY:Bl/it/qs,isSDF:ae}};if(ke&&(et.stretchX||et.stretchY)){let wo=Ty(Sr,Gi,bi),dl=Ty(Rr,pn,Fi);for(let al=0;al0&&(Gi=Math.max(10,Gi),this.circleDiameter=Gi)}else{let ai=!((Rr=it.image)===null||Rr===void 0)&&Rr.content&&(it.image.textFitWidth||it.image.textFitHeight)?N6(it):{x1:it.left,y1:it.top,x2:it.right,y2:it.bottom};ai.y1=ai.y1*Ct-$t[0],ai.y2=ai.y2*Ct+$t[2],ai.x1=ai.x1*Ct-$t[3],ai.x2=ai.x2*Ct+$t[1];let bi=it.collisionPadding;if(bi&&(ai.x1-=bi[0]*Ct,ai.y1-=bi[1]*Ct,ai.x2+=bi[2]*Ct,ai.y2+=bi[3]*Ct),Sr){let Fi=new u(ai.x1,ai.y1),Gi=new u(ai.x2,ai.y1),pn=new u(ai.x1,ai.y2),jn=new u(ai.x2,ai.y2),Fa=Sr*Math.PI/180;Fi._rotate(Fa),Gi._rotate(Fa),pn._rotate(Fa),jn._rotate(Fa),ai.x1=Math.min(Fi.x,Gi.x,pn.x,jn.x),ai.x2=Math.max(Fi.x,Gi.x,pn.x,jn.x),ai.y1=Math.min(Fi.y,Gi.y,pn.y,jn.y),ai.y2=Math.max(Fi.y,Gi.y,pn.y,jn.y)}R.emplaceBack(ae.x,ae.y,ai.x1,ai.y1,ai.x2,ai.y2,ke,Ue,et)}this.boxEndIndex=R.length}}class HA{constructor(R=[],ae=(ke,Ue)=>keUe?1:0){if(this.data=R,this.length=this.data.length,this.compare=ae,this.length>0)for(let ke=(this.length>>1)-1;ke>=0;ke--)this._down(ke)}push(R){this.data.push(R),this._up(this.length++)}pop(){if(this.length===0)return;let R=this.data[0],ae=this.data.pop();return--this.length>0&&(this.data[0]=ae,this._down(0)),R}peek(){return this.data[0]}_up(R){let{data:ae,compare:ke}=this,Ue=ae[R];for(;R>0;){let et=R-1>>1,it=ae[et];if(ke(Ue,it)>=0)break;ae[R]=it,R=et}ae[R]=Ue}_down(R){let{data:ae,compare:ke}=this,Ue=this.length>>1,et=ae[R];for(;R=0)break;ae[R]=ae[it],R=it}ae[R]=et}}function VA(X,R=1,ae=!1){let ke=1/0,Ue=1/0,et=-1/0,it=-1/0,Ct=X[0];for(let bi=0;biet)&&(et=Fi.x),(!bi||Fi.y>it)&&(it=Fi.y)}let $t=Math.min(et-ke,it-Ue),or=$t/2,Sr=new HA([],WA);if($t===0)return new u(ke,Ue);for(let bi=ke;biRr.d||!Rr.d)&&(Rr=bi,ae&&console.log("found best %d after %d probes",Math.round(1e4*bi.d)/1e4,ai)),bi.max-Rr.d<=R||(or=bi.h/2,Sr.push(new ng(bi.p.x-or,bi.p.y-or,or,X)),Sr.push(new ng(bi.p.x+or,bi.p.y-or,or,X)),Sr.push(new ng(bi.p.x-or,bi.p.y+or,or,X)),Sr.push(new ng(bi.p.x+or,bi.p.y+or,or,X)),ai+=4)}return ae&&(console.log(`num probes: ${ai}`),console.log(`best distance: ${Rr.d}`)),Rr.p}function WA(X,R){return R.max-X.max}function ng(X,R,ae,ke){this.p=new u(X,R),this.h=ae,this.d=function(Ue,et){let it=!1,Ct=1/0;for(let $t=0;$tUe.y!=Fi.y>Ue.y&&Ue.x<(Fi.x-bi.x)*(Ue.y-bi.y)/(Fi.y-bi.y)+bi.x&&(it=!it),Ct=Math.min(Ct,Ka(Ue,bi,Fi))}}return(it?1:-1)*Math.sqrt(Ct)}(this.p,ke),this.max=this.d+this.h*Math.SQRT2}var ep;i.aq=void 0,(ep=i.aq||(i.aq={}))[ep.center=1]="center",ep[ep.left=2]="left",ep[ep.right=3]="right",ep[ep.top=4]="top",ep[ep.bottom=5]="bottom",ep[ep["top-left"]=6]="top-left",ep[ep["top-right"]=7]="top-right",ep[ep["bottom-left"]=8]="bottom-left",ep[ep["bottom-right"]=9]="bottom-right";let cv=7,l3=Number.POSITIVE_INFINITY;function ak(X,R){return R[1]!==l3?function(ae,ke,Ue){let et=0,it=0;switch(ke=Math.abs(ke),Ue=Math.abs(Ue),ae){case"top-right":case"top-left":case"top":it=Ue-cv;break;case"bottom-right":case"bottom-left":case"bottom":it=-Ue+cv}switch(ae){case"top-right":case"bottom-right":case"right":et=-ke;break;case"top-left":case"bottom-left":case"left":et=ke}return[et,it]}(X,R[0],R[1]):function(ae,ke){let Ue=0,et=0;ke<0&&(ke=0);let it=ke/Math.SQRT2;switch(ae){case"top-right":case"top-left":et=it-cv;break;case"bottom-right":case"bottom-left":et=-it+cv;break;case"bottom":et=-ke+cv;break;case"top":et=ke-cv}switch(ae){case"top-right":case"bottom-right":Ue=-it;break;case"top-left":case"bottom-left":Ue=it;break;case"left":Ue=ke;break;case"right":Ue=-ke}return[Ue,et]}(X,R[0])}function ok(X,R,ae){var ke;let Ue=X.layout,et=(ke=Ue.get("text-variable-anchor-offset"))===null||ke===void 0?void 0:ke.evaluate(R,{},ae);if(et){let Ct=et.values,$t=[];for(let or=0;orai*Ic);Sr.startsWith("top")?Rr[1]-=cv:Sr.startsWith("bottom")&&(Rr[1]+=cv),$t[or+1]=Rr}return new Rn($t)}let it=Ue.get("text-variable-anchor");if(it){let Ct;Ct=X._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ue.get("text-radial-offset").evaluate(R,{},ae)*Ic,l3]:Ue.get("text-offset").evaluate(R,{},ae).map(or=>or*Ic);let $t=[];for(let or of it)$t.push(or,ak(or,Ct));return new Rn($t)}return null}function u3(X){switch(X){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qA(X,R,ae,ke,Ue,et,it,Ct,$t,or,Sr){let Rr=et.textMaxSize.evaluate(R,{});Rr===void 0&&(Rr=it);let ai=X.layers[0].layout,bi=ai.get("icon-offset").evaluate(R,{},Sr),Fi=lk(ae.horizontal),Gi=it/24,pn=X.tilePixelRatio*Gi,jn=X.tilePixelRatio*Rr/24,Fa=X.tilePixelRatio*Ct,ha=X.tilePixelRatio*ai.get("symbol-spacing"),Aa=ai.get("text-padding")*X.tilePixelRatio,lo=function(wo,dl,al,eu=1){let xh=wo.get("icon-padding").evaluate(dl,{},al),ph=xh&&xh.values;return[ph[0]*eu,ph[1]*eu,ph[2]*eu,ph[3]*eu]}(ai,R,Sr,X.tilePixelRatio),Oo=ai.get("text-max-angle")/180*Math.PI,Ps=ai.get("text-rotation-alignment")!=="viewport"&&ai.get("symbol-placement")!=="point",Bl=ai.get("icon-rotation-alignment")==="map"&&ai.get("symbol-placement")!=="point",Ss=ai.get("symbol-placement"),vs=ha/2,nl=ai.get("icon-text-fit"),qs;ke&&nl!=="none"&&(X.allowVerticalPlacement&&ae.vertical&&(qs=j6(ke,ae.vertical,nl,ai.get("icon-text-fit-padding"),bi,Gi)),Fi&&(ke=j6(ke,Fi,nl,ai.get("icon-text-fit-padding"),bi,Gi)));let Ns=(wo,dl)=>{dl.x<0||dl.x>=cu||dl.y<0||dl.y>=cu||function(al,eu,xh,ph,Od,d0,Vf,vd,Hp,Vp,Wp,vf,Bd,Ap,mp,qp,tp,L0,Oh,fc,Hc,nh,of,Bh,Ay){let Fm=al.addToLineVertexArray(eu,xh),Nm,Mp,bh,rp,_m=0,P0=0,Gp=0,m3=0,g3=-1,e2=-1,Bg={},v3=gn("");if(al.allowVerticalPlacement&&ph.vertical){let gp=vd.layout.get("text-rotate").evaluate(Hc,{},Bh)+90;bh=new Yb(Hp,eu,Vp,Wp,vf,ph.vertical,Bd,Ap,mp,gp),Vf&&(rp=new Yb(Hp,eu,Vp,Wp,vf,Vf,tp,L0,mp,gp))}if(Od){let gp=vd.layout.get("icon-rotate").evaluate(Hc,{}),I0=vd.layout.get("icon-text-fit")!=="none",hv=nk(Od,gp,of,I0),jm=Vf?nk(Vf,gp,of,I0):void 0;Mp=new Yb(Hp,eu,Vp,Wp,vf,Od,tp,L0,!1,gp),_m=4*hv.length;let h1=al.iconSizeData,Um=null;h1.kind==="source"?(Um=[rg*vd.layout.get("icon-size").evaluate(Hc,{})],Um[0]>sv&&T(`${al.layerIds[0]}: Value for "icon-size" is >= ${G_}. Reduce your "icon-size".`)):h1.kind==="composite"&&(Um=[rg*nh.compositeIconSizes[0].evaluate(Hc,{},Bh),rg*nh.compositeIconSizes[1].evaluate(Hc,{},Bh)],(Um[0]>sv||Um[1]>sv)&&T(`${al.layerIds[0]}: Value for "icon-size" is >= ${G_}. Reduce your "icon-size".`)),al.addSymbols(al.icon,hv,Um,fc,Oh,Hc,i.ah.none,eu,Fm.lineStartIndex,Fm.lineLength,-1,Bh),g3=al.icon.placedSymbolArray.length-1,jm&&(P0=4*jm.length,al.addSymbols(al.icon,jm,Um,fc,Oh,Hc,i.ah.vertical,eu,Fm.lineStartIndex,Fm.lineLength,-1,Bh),e2=al.icon.placedSymbolArray.length-1)}let y3=Object.keys(ph.horizontal);for(let gp of y3){let I0=ph.horizontal[gp];if(!Nm){v3=gn(I0.text);let jm=vd.layout.get("text-rotate").evaluate(Hc,{},Bh);Nm=new Yb(Hp,eu,Vp,Wp,vf,I0,Bd,Ap,mp,jm)}let hv=I0.positionedLines.length===1;if(Gp+=sk(al,eu,I0,d0,vd,mp,Hc,qp,Fm,ph.vertical?i.ah.horizontal:i.ah.horizontalOnly,hv?y3:[gp],Bg,g3,nh,Bh),hv)break}ph.vertical&&(m3+=sk(al,eu,ph.vertical,d0,vd,mp,Hc,qp,Fm,i.ah.vertical,["vertical"],Bg,e2,nh,Bh));let _3=Nm?Nm.boxStartIndex:al.collisionBoxArray.length,x3=Nm?Nm.boxEndIndex:al.collisionBoxArray.length,GA=bh?bh.boxStartIndex:al.collisionBoxArray.length,ZA=bh?bh.boxEndIndex:al.collisionBoxArray.length,KA=Mp?Mp.boxStartIndex:al.collisionBoxArray.length,YA=Mp?Mp.boxEndIndex:al.collisionBoxArray.length,dk=rp?rp.boxStartIndex:al.collisionBoxArray.length,My=rp?rp.boxEndIndex:al.collisionBoxArray.length,yd=-1,Ey=(gp,I0)=>gp&&gp.circleDiameter?Math.max(gp.circleDiameter,I0):I0;yd=Ey(Nm,yd),yd=Ey(bh,yd),yd=Ey(Mp,yd),yd=Ey(rp,yd);let b3=yd>-1?1:0;b3&&(yd*=Ay/Ic),al.glyphOffsetArray.length>=l1.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Hc.sortKey!==void 0&&al.addToSortKeyRanges(al.symbolInstances.length,Hc.sortKey);let pk=ok(vd,Hc,Bh),[XA,mk]=function(gp,I0){let hv=gp.length,jm=I0?.values;if(jm?.length>0)for(let h1=0;h1=0?Bg.right:-1,Bg.center>=0?Bg.center:-1,Bg.left>=0?Bg.left:-1,Bg.vertical||-1,g3,e2,v3,_3,x3,GA,ZA,KA,YA,dk,My,Vp,Gp,m3,_m,P0,b3,0,Bd,yd,XA,mk)}(X,dl,wo,ae,ke,Ue,qs,X.layers[0],X.collisionBoxArray,R.index,R.sourceLayerIndex,X.index,pn,[Aa,Aa,Aa,Aa],Ps,$t,Fa,lo,Bl,bi,R,et,or,Sr,it)};if(Ss==="line")for(let wo of Q6(R.geometry,0,0,cu,cu)){let dl=$A(wo,ha,Oo,ae.vertical||Fi,ke,24,jn,X.overscaling,cu);for(let al of dl)Fi&&uk(X,Fi.text,vs,al)||Ns(wo,al)}else if(Ss==="line-center"){for(let wo of R.geometry)if(wo.length>1){let dl=UA(wo,Oo,ae.vertical||Fi,ke,24,jn);dl&&Ns(wo,dl)}}else if(R.type==="Polygon")for(let wo of uh(R.geometry,0)){let dl=VA(wo,16);Ns(wo[0],new uv(dl.x,dl.y,0))}else if(R.type==="LineString")for(let wo of R.geometry)Ns(wo,new uv(wo[0].x,wo[0].y,0));else if(R.type==="Point")for(let wo of R.geometry)for(let dl of wo)Ns([dl],new uv(dl.x,dl.y,0))}function sk(X,R,ae,ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi){let Gi=function(Fa,ha,Aa,lo,Oo,Ps,Bl,Ss){let vs=lo.layout.get("text-rotate").evaluate(Ps,{})*Math.PI/180,nl=[];for(let qs of ha.positionedLines)for(let Ns of qs.positionedGlyphs){if(!Ns.rect)continue;let wo=Ns.rect||{},dl=Yw+1,al=!0,eu=1,xh=0,ph=(Oo||Ss)&&Ns.vertical,Od=Ns.metrics.advance*Ns.scale/2;if(Ss&&ha.verticalizable&&(xh=qs.lineOffset/2-(Ns.imageName?-(Ic-Ns.metrics.width*Ns.scale)/2:(Ns.scale-1)*Ic)),Ns.imageName){let fc=Bl[Ns.imageName];al=fc.sdf,eu=fc.pixelRatio,dl=gd/eu}let d0=Oo?[Ns.x+Od,Ns.y]:[0,0],Vf=Oo?[0,0]:[Ns.x+Od+Aa[0],Ns.y+Aa[1]-xh],vd=[0,0];ph&&(vd=Vf,Vf=[0,0]);let Hp=Ns.metrics.isDoubleResolution?2:1,Vp=(Ns.metrics.left-dl)*Ns.scale-Od+Vf[0],Wp=(-Ns.metrics.top-dl)*Ns.scale+Vf[1],vf=Vp+wo.w/Hp*Ns.scale/eu,Bd=Wp+wo.h/Hp*Ns.scale/eu,Ap=new u(Vp,Wp),mp=new u(vf,Wp),qp=new u(Vp,Bd),tp=new u(vf,Bd);if(ph){let fc=new u(-Od,Od-vy),Hc=-Math.PI/2,nh=Ic/2-Od,of=new u(5-vy-nh,-(Ns.imageName?nh:0)),Bh=new u(...vd);Ap._rotateAround(Hc,fc)._add(of)._add(Bh),mp._rotateAround(Hc,fc)._add(of)._add(Bh),qp._rotateAround(Hc,fc)._add(of)._add(Bh),tp._rotateAround(Hc,fc)._add(of)._add(Bh)}if(vs){let fc=Math.sin(vs),Hc=Math.cos(vs),nh=[Hc,-fc,fc,Hc];Ap._matMult(nh),mp._matMult(nh),qp._matMult(nh),tp._matMult(nh)}let L0=new u(0,0),Oh=new u(0,0);nl.push({tl:Ap,tr:mp,bl:qp,br:tp,tex:wo,writingMode:ha.writingMode,glyphOffset:d0,sectionIndex:Ns.sectionIndex,isSDF:al,pixelOffsetTL:L0,pixelOffsetBR:Oh,minFontScaleX:0,minFontScaleY:0})}return nl}(0,ae,Ct,Ue,et,it,ke,X.allowVerticalPlacement),pn=X.textSizeData,jn=null;pn.kind==="source"?(jn=[rg*Ue.layout.get("text-size").evaluate(it,{})],jn[0]>sv&&T(`${X.layerIds[0]}: Value for "text-size" is >= ${G_}. Reduce your "text-size".`)):pn.kind==="composite"&&(jn=[rg*bi.compositeTextSizes[0].evaluate(it,{},Fi),rg*bi.compositeTextSizes[1].evaluate(it,{},Fi)],(jn[0]>sv||jn[1]>sv)&&T(`${X.layerIds[0]}: Value for "text-size" is >= ${G_}. Reduce your "text-size".`)),X.addSymbols(X.text,Gi,jn,Ct,et,it,or,R,$t.lineStartIndex,$t.lineLength,ai,Fi);for(let Fa of Sr)Rr[Fa]=X.text.placedSymbolArray.length-1;return 4*Gi.length}function lk(X){for(let R in X)return X[R];return null}function uk(X,R,ae,ke){let Ue=X.compareText;if(R in Ue){let et=Ue[R];for(let it=et.length-1;it>=0;it--)if(ke.dist(et[it])>4;if(Ue!==1)throw new Error(`Got v${Ue} data when expected v1.`);let et=ck[15&ke];if(!et)throw new Error("Unrecognized array type.");let[it]=new Uint16Array(R,2,1),[Ct]=new Uint32Array(R,4,1);return new c3(Ct,it,et,R)}constructor(R,ae=64,ke=Float64Array,Ue){if(isNaN(R)||R<0)throw new Error(`Unpexpected numItems value: ${R}.`);this.numItems=+R,this.nodeSize=Math.min(Math.max(+ae,2),65535),this.ArrayType=ke,this.IndexArrayType=R<65536?Uint16Array:Uint32Array;let et=ck.indexOf(this.ArrayType),it=2*R*this.ArrayType.BYTES_PER_ELEMENT,Ct=R*this.IndexArrayType.BYTES_PER_ELEMENT,$t=(8-Ct%8)%8;if(et<0)throw new Error(`Unexpected typed array class: ${ke}.`);Ue&&Ue instanceof ArrayBuffer?(this.data=Ue,this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ct+$t,2*R),this._pos=2*R,this._finished=!0):(this.data=new ArrayBuffer(8+it+Ct+$t),this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ct+$t,2*R),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+et]),new Uint16Array(this.data,2,1)[0]=ae,new Uint32Array(this.data,4,1)[0]=R)}add(R,ae){let ke=this._pos>>1;return this.ids[ke]=ke,this.coords[this._pos++]=R,this.coords[this._pos++]=ae,ke}finish(){let R=this._pos>>1;if(R!==this.numItems)throw new Error(`Added ${R} items when expected ${this.numItems}.`);return h3(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(R,ae,ke,Ue){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:et,coords:it,nodeSize:Ct}=this,$t=[0,et.length-1,0],or=[];for(;$t.length;){let Sr=$t.pop()||0,Rr=$t.pop()||0,ai=$t.pop()||0;if(Rr-ai<=Ct){for(let pn=ai;pn<=Rr;pn++){let jn=it[2*pn],Fa=it[2*pn+1];jn>=R&&jn<=ke&&Fa>=ae&&Fa<=Ue&&or.push(et[pn])}continue}let bi=ai+Rr>>1,Fi=it[2*bi],Gi=it[2*bi+1];Fi>=R&&Fi<=ke&&Gi>=ae&&Gi<=Ue&&or.push(et[bi]),(Sr===0?R<=Fi:ae<=Gi)&&($t.push(ai),$t.push(bi-1),$t.push(1-Sr)),(Sr===0?ke>=Fi:Ue>=Gi)&&($t.push(bi+1),$t.push(Rr),$t.push(1-Sr))}return or}within(R,ae,ke){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Ue,coords:et,nodeSize:it}=this,Ct=[0,Ue.length-1,0],$t=[],or=ke*ke;for(;Ct.length;){let Sr=Ct.pop()||0,Rr=Ct.pop()||0,ai=Ct.pop()||0;if(Rr-ai<=it){for(let pn=ai;pn<=Rr;pn++)pp(et[2*pn],et[2*pn+1],R,ae)<=or&&$t.push(Ue[pn]);continue}let bi=ai+Rr>>1,Fi=et[2*bi],Gi=et[2*bi+1];pp(Fi,Gi,R,ae)<=or&&$t.push(Ue[bi]),(Sr===0?R-ke<=Fi:ae-ke<=Gi)&&(Ct.push(ai),Ct.push(bi-1),Ct.push(1-Sr)),(Sr===0?R+ke>=Fi:ae+ke>=Gi)&&(Ct.push(bi+1),Ct.push(Rr),Ct.push(1-Sr))}return $t}}function h3(X,R,ae,ke,Ue,et){if(Ue-ke<=ae)return;let it=ke+Ue>>1;hk(X,R,it,ke,Ue,et),h3(X,R,ae,ke,it-1,1-et),h3(X,R,ae,it+1,Ue,1-et)}function hk(X,R,ae,ke,Ue,et){for(;Ue>ke;){if(Ue-ke>600){let or=Ue-ke+1,Sr=ae-ke+1,Rr=Math.log(or),ai=.5*Math.exp(2*Rr/3),bi=.5*Math.sqrt(Rr*ai*(or-ai)/or)*(Sr-or/2<0?-1:1);hk(X,R,ae,Math.max(ke,Math.floor(ae-Sr*ai/or+bi)),Math.min(Ue,Math.floor(ae+(or-Sr)*ai/or+bi)),et)}let it=R[2*ae+et],Ct=ke,$t=Ue;for(Sy(X,R,ke,ae),R[2*Ue+et]>it&&Sy(X,R,ke,Ue);Ct<$t;){for(Sy(X,R,Ct,$t),Ct++,$t--;R[2*Ct+et]it;)$t--}R[2*ke+et]===it?Sy(X,R,ke,$t):($t++,Sy(X,R,$t,Ue)),$t<=ae&&(ke=$t+1),ae<=$t&&(Ue=$t-1)}}function Sy(X,R,ae,ke){Xb(X,ae,ke),Xb(R,2*ae,2*ke),Xb(R,2*ae+1,2*ke+1)}function Xb(X,R,ae){let ke=X[R];X[R]=X[ae],X[ae]=ke}function pp(X,R,ae,ke){let Ue=X-ae,et=R-ke;return Ue*Ue+et*et}var f3;i.bg=void 0,(f3=i.bg||(i.bg={})).create="create",f3.load="load",f3.fullLoad="fullLoad";let Jb=null,Cy=[],d3=1e3/60,Qb="loadTime",p3="fullLoadTime",fk={mark(X){performance.mark(X)},frame(X){let R=X;Jb!=null&&Cy.push(R-Jb),Jb=R},clearMetrics(){Jb=null,Cy=[],performance.clearMeasures(Qb),performance.clearMeasures(p3);for(let X in i.bg)performance.clearMarks(i.bg[X])},getPerformanceMetrics(){performance.measure(Qb,i.bg.create,i.bg.load),performance.measure(p3,i.bg.create,i.bg.fullLoad);let X=performance.getEntriesByName(Qb)[0].duration,R=performance.getEntriesByName(p3)[0].duration,ae=Cy.length,ke=1/(Cy.reduce((et,it)=>et+it,0)/ae/1e3),Ue=Cy.filter(et=>et>d3).reduce((et,it)=>et+(it-d3)/d3,0);return{loadTime:X,fullLoadTime:R,fps:ke,percentDroppedFrames:Ue/(ae+Ue)*100,totalFrames:ae}}};i.$=class extends Hr{},i.A=Bn,i.B=Ea,i.C=function(X){if(U==null){let R=X.navigator?X.navigator.userAgent:null;U=!!X.safari||!(!R||!(/\b(iPad|iPhone|iPod)\b/.test(R)||R.match("Safari")&&!R.match("Chrome")))}return U},i.D=cs,i.E=me,i.F=class{constructor(X,R){this.target=X,this.mapId=R,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new X_(()=>this.process()),this.subscription=function(ae,ke,Ue,et){return ae.addEventListener(ke,Ue,!1),{unsubscribe:()=>{ae.removeEventListener(ke,Ue,!1)}}}(this.target,"message",ae=>this.receive(ae)),this.globalScope=B(self)?X:window}registerMessageHandler(X,R){this.messageHandlers[X]=R}sendAsync(X,R){return new Promise((ae,ke)=>{let Ue=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ue]={resolve:ae,reject:ke},R&&R.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ue];let Ct={id:Ue,type:"",origin:location.origin,targetMapId:X.targetMapId,sourceMapId:this.mapId};this.target.postMessage(Ct)},{once:!0});let et=[],it=Object.assign(Object.assign({},X),{id:Ue,sourceMapId:this.mapId,origin:location.origin,data:ps(X.data,et)});this.target.postMessage(it,{transfer:et})})}receive(X){let R=X.data,ae=R.id;if(!(R.origin!=="file://"&&location.origin!=="file://"&&R.origin!=="resource://android"&&location.origin!=="resource://android"&&R.origin!==location.origin||R.targetMapId&&this.mapId!==R.targetMapId)){if(R.type===""){delete this.tasks[ae];let ke=this.abortControllers[ae];return delete this.abortControllers[ae],void(ke&&ke.abort())}if(B(self)||R.mustQueue)return this.tasks[ae]=R,this.taskQueue.push(ae),void this.invoker.trigger();this.processTask(ae,R)}}process(){if(this.taskQueue.length===0)return;let X=this.taskQueue.shift(),R=this.tasks[X];delete this.tasks[X],this.taskQueue.length>0&&this.invoker.trigger(),R&&this.processTask(X,R)}processTask(X,R){return n(this,void 0,void 0,function*(){if(R.type===""){let Ue=this.resolveRejects[X];return delete this.resolveRejects[X],Ue?void(R.error?Ue.reject(xs(R.error)):Ue.resolve(xs(R.data))):void 0}if(!this.messageHandlers[R.type])return void this.completeTask(X,new Error(`Could not find a registered handler for ${R.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let ae=xs(R.data),ke=new AbortController;this.abortControllers[X]=ke;try{let Ue=yield this.messageHandlers[R.type](R.sourceMapId,ae,ke);this.completeTask(X,null,Ue)}catch(Ue){this.completeTask(X,Ue)}})}completeTask(X,R,ae){let ke=[];delete this.abortControllers[X];let Ue={id:X,type:"",sourceMapId:this.mapId,origin:location.origin,error:R?ps(R):null,data:ps(ae,ke)};this.target.postMessage(Ue,{transfer:ke})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},i.G=ve,i.H=function(){var X=new Bn(16);return Bn!=Float32Array&&(X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[11]=0,X[12]=0,X[13]=0,X[14]=0),X[0]=1,X[5]=1,X[10]=1,X[15]=1,X},i.I=dp,i.J=function(X,R,ae){var ke,Ue,et,it,Ct,$t,or,Sr,Rr,ai,bi,Fi,Gi=ae[0],pn=ae[1],jn=ae[2];return R===X?(X[12]=R[0]*Gi+R[4]*pn+R[8]*jn+R[12],X[13]=R[1]*Gi+R[5]*pn+R[9]*jn+R[13],X[14]=R[2]*Gi+R[6]*pn+R[10]*jn+R[14],X[15]=R[3]*Gi+R[7]*pn+R[11]*jn+R[15]):(Ue=R[1],et=R[2],it=R[3],Ct=R[4],$t=R[5],or=R[6],Sr=R[7],Rr=R[8],ai=R[9],bi=R[10],Fi=R[11],X[0]=ke=R[0],X[1]=Ue,X[2]=et,X[3]=it,X[4]=Ct,X[5]=$t,X[6]=or,X[7]=Sr,X[8]=Rr,X[9]=ai,X[10]=bi,X[11]=Fi,X[12]=ke*Gi+Ct*pn+Rr*jn+R[12],X[13]=Ue*Gi+$t*pn+ai*jn+R[13],X[14]=et*Gi+or*pn+bi*jn+R[14],X[15]=it*Gi+Sr*pn+Fi*jn+R[15]),X},i.K=function(X,R,ae){var ke=ae[0],Ue=ae[1],et=ae[2];return X[0]=R[0]*ke,X[1]=R[1]*ke,X[2]=R[2]*ke,X[3]=R[3]*ke,X[4]=R[4]*Ue,X[5]=R[5]*Ue,X[6]=R[6]*Ue,X[7]=R[7]*Ue,X[8]=R[8]*et,X[9]=R[9]*et,X[10]=R[10]*et,X[11]=R[11]*et,X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15],X},i.L=ja,i.M=function(X,R){let ae={};for(let ke=0;ke{let R=window.document.createElement("video");return R.muted=!0,new Promise(ae=>{R.onloadstart=()=>{ae(R)};for(let ke of X){let Ue=window.document.createElement("source");ne(ke)||(R.crossOrigin="Anonymous"),Ue.src=ke,R.appendChild(Ue)}})},i.a4=function(){return I++},i.a5=Ba,i.a6=l1,i.a7=jf,i.a8=Nr,i.a9=K6,i.aA=function(X){if(X.type==="custom")return new H6(X);switch(X.type){case"background":return new Y_(X);case"circle":return new Da(X);case"fill":return new Pn(X);case"fill-extrusion":return new l0(X);case"heatmap":return new kl(X);case"hillshade":return new Ec(X);case"line":return new i1(X);case"raster":return new jA(X);case"symbol":return new Wb(X)}},i.aB=g,i.aC=function(X,R){if(!X)return[{command:"setStyle",args:[R]}];let ae=[];try{if(!Oe(X.version,R.version))return[{command:"setStyle",args:[R]}];Oe(X.center,R.center)||ae.push({command:"setCenter",args:[R.center]}),Oe(X.zoom,R.zoom)||ae.push({command:"setZoom",args:[R.zoom]}),Oe(X.bearing,R.bearing)||ae.push({command:"setBearing",args:[R.bearing]}),Oe(X.pitch,R.pitch)||ae.push({command:"setPitch",args:[R.pitch]}),Oe(X.sprite,R.sprite)||ae.push({command:"setSprite",args:[R.sprite]}),Oe(X.glyphs,R.glyphs)||ae.push({command:"setGlyphs",args:[R.glyphs]}),Oe(X.transition,R.transition)||ae.push({command:"setTransition",args:[R.transition]}),Oe(X.light,R.light)||ae.push({command:"setLight",args:[R.light]}),Oe(X.terrain,R.terrain)||ae.push({command:"setTerrain",args:[R.terrain]}),Oe(X.sky,R.sky)||ae.push({command:"setSky",args:[R.sky]}),Oe(X.projection,R.projection)||ae.push({command:"setProjection",args:[R.projection]});let ke={},Ue=[];(function(it,Ct,$t,or){let Sr;for(Sr in Ct=Ct||{},it=it||{})Object.prototype.hasOwnProperty.call(it,Sr)&&(Object.prototype.hasOwnProperty.call(Ct,Sr)||rt(Sr,$t,or));for(Sr in Ct)Object.prototype.hasOwnProperty.call(Ct,Sr)&&(Object.prototype.hasOwnProperty.call(it,Sr)?Oe(it[Sr],Ct[Sr])||(it[Sr].type==="geojson"&&Ct[Sr].type==="geojson"&&pt(it,Ct,Sr)?Ze($t,{command:"setGeoJSONSourceData",args:[Sr,Ct[Sr].data]}):_t(Sr,Ct,$t,or)):Ge(Sr,Ct,$t))})(X.sources,R.sources,Ue,ke);let et=[];X.layers&&X.layers.forEach(it=>{"source"in it&&ke[it.source]?ae.push({command:"removeLayer",args:[it.id]}):et.push(it)}),ae=ae.concat(Ue),function(it,Ct,$t){Ct=Ct||[];let or=(it=it||[]).map(ct),Sr=Ct.map(ct),Rr=it.reduce(Ae,{}),ai=Ct.reduce(Ae,{}),bi=or.slice(),Fi=Object.create(null),Gi,pn,jn,Fa,ha;for(let Aa=0,lo=0;Aa@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ae,ke,Ue,et)=>{let it=Ue||et;return R[ke]=!it||it.toLowerCase(),""}),R["max-age"]){let ae=parseInt(R["max-age"],10);isNaN(ae)?delete R["max-age"]:R["max-age"]=ae}return R},i.ab=function(X,R){let ae=[];for(let ke in X)ke in R||ae.push(ke);return ae},i.ac=w,i.ad=function(X,R,ae){var ke=Math.sin(ae),Ue=Math.cos(ae),et=R[0],it=R[1],Ct=R[2],$t=R[3],or=R[4],Sr=R[5],Rr=R[6],ai=R[7];return R!==X&&(X[8]=R[8],X[9]=R[9],X[10]=R[10],X[11]=R[11],X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15]),X[0]=et*Ue+or*ke,X[1]=it*Ue+Sr*ke,X[2]=Ct*Ue+Rr*ke,X[3]=$t*Ue+ai*ke,X[4]=or*Ue-et*ke,X[5]=Sr*Ue-it*ke,X[6]=Rr*Ue-Ct*ke,X[7]=ai*Ue-$t*ke,X},i.ae=function(X){var R=new Bn(16);return R[0]=X[0],R[1]=X[1],R[2]=X[2],R[3]=X[3],R[4]=X[4],R[5]=X[5],R[6]=X[6],R[7]=X[7],R[8]=X[8],R[9]=X[9],R[10]=X[10],R[11]=X[11],R[12]=X[12],R[13]=X[13],R[14]=X[14],R[15]=X[15],R},i.af=la,i.ag=function(X,R){let ae=0,ke=0;if(X.kind==="constant")ke=X.layoutSize;else if(X.kind!=="source"){let{interpolationType:Ue,minZoom:et,maxZoom:it}=X,Ct=Ue?w(Wa.interpolationFactor(Ue,R,et,it),0,1):0;X.kind==="camera"?ke=Wo.number(X.minSize,X.maxSize,Ct):ae=Ct}return{uSizeT:ae,uSize:ke}},i.ai=function(X,{uSize:R,uSizeT:ae},{lowerSize:ke,upperSize:Ue}){return X.kind==="source"?ke/rg:X.kind==="composite"?Wo.number(ke/rg,Ue/rg,ae):R},i.aj=lv,i.ak=function(X,R,ae,ke){let Ue=R.y-X.y,et=R.x-X.x,it=ke.y-ae.y,Ct=ke.x-ae.x,$t=it*et-Ct*Ue;if($t===0)return null;let or=(Ct*(X.y-ae.y)-it*(X.x-ae.x))/$t;return new u(X.x+or*et,X.y+or*Ue)},i.al=Q6,i.am=xn,i.an=wn,i.ao=function(X){let R=1/0,ae=1/0,ke=-1/0,Ue=-1/0;for(let et of X)R=Math.min(R,et.x),ae=Math.min(ae,et.y),ke=Math.max(ke,et.x),Ue=Math.max(Ue,et.y);return[R,ae,ke,Ue]},i.ap=Ic,i.ar=Qw,i.as=function(X,R){var ae=R[0],ke=R[1],Ue=R[2],et=R[3],it=R[4],Ct=R[5],$t=R[6],or=R[7],Sr=R[8],Rr=R[9],ai=R[10],bi=R[11],Fi=R[12],Gi=R[13],pn=R[14],jn=R[15],Fa=ae*Ct-ke*it,ha=ae*$t-Ue*it,Aa=ae*or-et*it,lo=ke*$t-Ue*Ct,Oo=ke*or-et*Ct,Ps=Ue*or-et*$t,Bl=Sr*Gi-Rr*Fi,Ss=Sr*pn-ai*Fi,vs=Sr*jn-bi*Fi,nl=Rr*pn-ai*Gi,qs=Rr*jn-bi*Gi,Ns=ai*jn-bi*pn,wo=Fa*Ns-ha*qs+Aa*nl+lo*vs-Oo*Ss+Ps*Bl;return wo?(X[0]=(Ct*Ns-$t*qs+or*nl)*(wo=1/wo),X[1]=(Ue*qs-ke*Ns-et*nl)*wo,X[2]=(Gi*Ps-pn*Oo+jn*lo)*wo,X[3]=(ai*Oo-Rr*Ps-bi*lo)*wo,X[4]=($t*vs-it*Ns-or*Ss)*wo,X[5]=(ae*Ns-Ue*vs+et*Ss)*wo,X[6]=(pn*Aa-Fi*Ps-jn*ha)*wo,X[7]=(Sr*Ps-ai*Aa+bi*ha)*wo,X[8]=(it*qs-Ct*vs+or*Bl)*wo,X[9]=(ke*vs-ae*qs-et*Bl)*wo,X[10]=(Fi*Oo-Gi*Aa+jn*Fa)*wo,X[11]=(Rr*Aa-Sr*Oo-bi*Fa)*wo,X[12]=(Ct*Ss-it*nl-$t*Bl)*wo,X[13]=(ae*nl-ke*Ss+Ue*Bl)*wo,X[14]=(Gi*ha-Fi*lo-pn*Fa)*wo,X[15]=(Sr*lo-Rr*ha+ai*Fa)*wo,X):null},i.at=u3,i.au=Jw,i.av=c3,i.aw=function(){let X={},R=fe.$version;for(let ae in fe.$root){let ke=fe.$root[ae];if(ke.required){let Ue=null;Ue=ae==="version"?R:ke.type==="array"?[]:{},Ue!=null&&(X[ae]=Ue)}}return X},i.ax=_o,i.ay=re,i.az=function(X){X=X.slice();let R=Object.create(null);for(let ae=0;ae25||ke<0||ke>=1||ae<0||ae>=1)},i.bc=function(X,R){return X[0]=R[0],X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[5]=R[1],X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[10]=R[2],X[11]=0,X[12]=0,X[13]=0,X[14]=0,X[15]=1,X},i.bd=class extends kr{},i.be=n3,i.bf=fk,i.bh=ce,i.bi=function(X,R){he.REGISTERED_PROTOCOLS[X]=R},i.bj=function(X){delete he.REGISTERED_PROTOCOLS[X]},i.bk=function(X,R){let ae={};for(let Ue=0;UeNs*Ic)}let Ss=it?"center":ae.get("text-justify").evaluate(or,{},X.canonical),vs=ae.get("symbol-placement")==="point"?ae.get("text-max-width").evaluate(or,{},X.canonical)*Ic:1/0,nl=()=>{X.bucket.allowVerticalPlacement&&bs(Aa)&&(Fi.vertical=jb(Gi,X.glyphMap,X.glyphPositions,X.imagePositions,Sr,vs,et,Ps,"left",Oo,jn,i.ah.vertical,!0,ai,Rr))};if(!it&&Bl){let qs=new Set;if(Ss==="auto")for(let wo=0;won(void 0,void 0,void 0,function*(){if(X.byteLength===0)return createImageBitmap(new ImageData(1,1));let R=new Blob([new Uint8Array(X)],{type:"image/png"});try{return createImageBitmap(R)}catch(ae){throw new Error(`Could not load image because of ${ae.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),i.e=E,i.f=X=>new Promise((R,ae)=>{let ke=new Image;ke.onload=()=>{R(ke),URL.revokeObjectURL(ke.src),ke.onload=null,window.requestAnimationFrame(()=>{ke.src=W})},ke.onerror=()=>ae(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Ue=new Blob([new Uint8Array(X)],{type:"image/png"});ke.src=X.byteLength?URL.createObjectURL(Ue):W}),i.g=xe,i.h=(X,R)=>ge(E(X,{type:"json"}),R),i.i=B,i.j=J,i.k=oe,i.l=(X,R)=>ge(E(X,{type:"arrayBuffer"}),R),i.m=ge,i.n=function(X){return new Zw(X).readFields(DA,[])},i.o=Kl,i.p=Nb,i.q=Ke,i.r=pa,i.s=ne,i.t=xa,i.u=Ln,i.v=fe,i.w=T,i.x=function([X,R,ae]){return R+=90,R*=Math.PI/180,ae*=Math.PI/180,{x:X*Math.cos(R)*Math.sin(ae),y:X*Math.sin(R)*Math.sin(ae),z:X*Math.cos(ae)}},i.y=Wo,i.z=Wl}),z("worker",["./shared"],function(i){class n{constructor(Je){this.keyCache={},Je&&this.replace(Je)}replace(Je){this._layerConfigs={},this._layers={},this.update(Je,[])}update(Je,ot){for(let ye of Je){this._layerConfigs[ye.id]=ye;let Pe=this._layers[ye.id]=i.aA(ye);Pe._featureFilter=i.a7(Pe.filter),this.keyCache[ye.id]&&delete this.keyCache[ye.id]}for(let ye of ot)delete this.keyCache[ye],delete this._layerConfigs[ye],delete this._layers[ye];this.familiesBySource={};let De=i.bk(Object.values(this._layerConfigs),this.keyCache);for(let ye of De){let Pe=ye.map(Kt=>this._layers[Kt.id]),He=Pe[0];if(He.visibility==="none")continue;let at=He.source||"",ht=this.familiesBySource[at];ht||(ht=this.familiesBySource[at]={});let At=He.sourceLayer||"_geojsonTileLayer",Wt=ht[At];Wt||(Wt=ht[At]=[]),Wt.push(Pe)}}}class a{constructor(Je){let ot={},De=[];for(let at in Je){let ht=Je[at],At=ot[at]={};for(let Wt in ht){let Kt=ht[+Wt];if(!Kt||Kt.bitmap.width===0||Kt.bitmap.height===0)continue;let hr={x:0,y:0,w:Kt.bitmap.width+2,h:Kt.bitmap.height+2};De.push(hr),At[Wt]={rect:hr,metrics:Kt.metrics}}}let{w:ye,h:Pe}=i.p(De),He=new i.o({width:ye||1,height:Pe||1});for(let at in Je){let ht=Je[at];for(let At in ht){let Wt=ht[+At];if(!Wt||Wt.bitmap.width===0||Wt.bitmap.height===0)continue;let Kt=ot[at][At].rect;i.o.copy(Wt.bitmap,He,{x:0,y:0},{x:Kt.x+1,y:Kt.y+1},Wt.bitmap)}}this.image=He,this.positions=ot}}i.bl("GlyphAtlas",a);class l{constructor(Je){this.tileID=new i.S(Je.tileID.overscaledZ,Je.tileID.wrap,Je.tileID.canonical.z,Je.tileID.canonical.x,Je.tileID.canonical.y),this.uid=Je.uid,this.zoom=Je.zoom,this.pixelRatio=Je.pixelRatio,this.tileSize=Je.tileSize,this.source=Je.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Je.showCollisionBoxes,this.collectResourceTiming=!!Je.collectResourceTiming,this.returnDependencies=!!Je.returnDependencies,this.promoteId=Je.promoteId,this.inFlightDependencies=[]}parse(Je,ot,De,ye){return i._(this,void 0,void 0,function*(){this.status="parsing",this.data=Je,this.collisionBoxArray=new i.a5;let Pe=new i.bm(Object.keys(Je.layers).sort()),He=new i.bn(this.tileID,this.promoteId);He.bucketLayerIDs=[];let at={},ht={featureIndex:He,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:De},At=ot.familiesBySource[this.source];for(let Sn in At){let fn=Je.layers[Sn];if(!fn)continue;fn.version===1&&i.w(`Vector tile source "${this.source}" layer "${Sn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let ga=Pe.encode(Sn),na=[];for(let Zt=0;Zt=sr.maxzoom||sr.visibility!=="none"&&(o(Zt,this.zoom,De),(at[sr.id]=sr.createBucket({index:He.bucketLayerIDs.length,layers:Zt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ga,sourceID:this.source})).populate(na,ht,this.tileID.canonical),He.bucketLayerIDs.push(Zt.map(_r=>_r.id)))}}let Wt=i.aF(ht.glyphDependencies,Sn=>Object.keys(Sn).map(Number));this.inFlightDependencies.forEach(Sn=>Sn?.abort()),this.inFlightDependencies=[];let Kt=Promise.resolve({});if(Object.keys(Wt).length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),Kt=ye.sendAsync({type:"GG",data:{stacks:Wt,source:this.source,tileID:this.tileID,type:"glyphs"}},Sn)}let hr=Object.keys(ht.iconDependencies),zr=Promise.resolve({});if(hr.length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),zr=ye.sendAsync({type:"GI",data:{icons:hr,source:this.source,tileID:this.tileID,type:"icons"}},Sn)}let Dr=Object.keys(ht.patternDependencies),br=Promise.resolve({});if(Dr.length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),br=ye.sendAsync({type:"GI",data:{icons:Dr,source:this.source,tileID:this.tileID,type:"patterns"}},Sn)}let[hi,un,cn]=yield Promise.all([Kt,zr,br]),yn=new a(hi),Wn=new i.bo(un,cn);for(let Sn in at){let fn=at[Sn];fn instanceof i.a6?(o(fn.layers,this.zoom,De),i.bp({bucket:fn,glyphMap:hi,glyphPositions:yn.positions,imageMap:un,imagePositions:Wn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):fn.hasPattern&&(fn instanceof i.bq||fn instanceof i.br||fn instanceof i.bs)&&(o(fn.layers,this.zoom,De),fn.addFeatures(ht,this.tileID.canonical,Wn.patternPositions))}return this.status="done",{buckets:Object.values(at).filter(Sn=>!Sn.isEmpty()),featureIndex:He,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:yn.image,imageAtlas:Wn,glyphMap:this.returnDependencies?hi:null,iconMap:this.returnDependencies?un:null,glyphPositions:this.returnDependencies?yn.positions:null}})}}function o(Ot,Je,ot){let De=new i.z(Je);for(let ye of Ot)ye.recalculate(De,ot)}class u{constructor(Je,ot,De){this.actor=Je,this.layerIndex=ot,this.availableImages=De,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Je,ot){return i._(this,void 0,void 0,function*(){let De=yield i.l(Je.request,ot);try{return{vectorTile:new i.bt.VectorTile(new i.bu(De.data)),rawData:De.data,cacheControl:De.cacheControl,expires:De.expires}}catch(ye){let Pe=new Uint8Array(De.data),He=`Unable to parse the tile at ${Je.request.url}, `;throw He+=Pe[0]===31&&Pe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ye.message}`,new Error(He)}})}loadTile(Je){return i._(this,void 0,void 0,function*(){let ot=Je.uid,De=!!(Je&&Je.request&&Je.request.collectResourceTiming)&&new i.bv(Je.request),ye=new l(Je);this.loading[ot]=ye;let Pe=new AbortController;ye.abort=Pe;try{let He=yield this.loadVectorTile(Je,Pe);if(delete this.loading[ot],!He)return null;let at=He.rawData,ht={};He.expires&&(ht.expires=He.expires),He.cacheControl&&(ht.cacheControl=He.cacheControl);let At={};if(De){let Kt=De.finish();Kt&&(At.resourceTiming=JSON.parse(JSON.stringify(Kt)))}ye.vectorTile=He.vectorTile;let Wt=ye.parse(He.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ot]=ye,this.fetching[ot]={rawTileData:at,cacheControl:ht,resourceTiming:At};try{let Kt=yield Wt;return i.e({rawTileData:at.slice(0)},Kt,ht,At)}finally{delete this.fetching[ot]}}catch(He){throw delete this.loading[ot],ye.status="done",this.loaded[ot]=ye,He}})}reloadTile(Je){return i._(this,void 0,void 0,function*(){let ot=Je.uid;if(!this.loaded||!this.loaded[ot])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let De=this.loaded[ot];if(De.showCollisionBoxes=Je.showCollisionBoxes,De.status==="parsing"){let ye=yield De.parse(De.vectorTile,this.layerIndex,this.availableImages,this.actor),Pe;if(this.fetching[ot]){let{rawTileData:He,cacheControl:at,resourceTiming:ht}=this.fetching[ot];delete this.fetching[ot],Pe=i.e({rawTileData:He.slice(0)},ye,at,ht)}else Pe=ye;return Pe}if(De.status==="done"&&De.vectorTile)return De.parse(De.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Je){return i._(this,void 0,void 0,function*(){let ot=this.loading,De=Je.uid;ot&&ot[De]&&ot[De].abort&&(ot[De].abort.abort(),delete ot[De])})}removeTile(Je){return i._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Je.uid]&&delete this.loaded[Je.uid]})}}class s{constructor(){this.loaded={}}loadTile(Je){return i._(this,void 0,void 0,function*(){let{uid:ot,encoding:De,rawImageData:ye,redFactor:Pe,greenFactor:He,blueFactor:at,baseShift:ht}=Je,At=ye.width+2,Wt=ye.height+2,Kt=i.b(ye)?new i.R({width:At,height:Wt},yield i.bw(ye,-1,-1,At,Wt)):ye,hr=new i.bx(ot,Kt,De,Pe,He,at,ht);return this.loaded=this.loaded||{},this.loaded[ot]=hr,hr})}removeTile(Je){let ot=this.loaded,De=Je.uid;ot&&ot[De]&&delete ot[De]}}function h(Ot,Je){if(Ot.length!==0){m(Ot[0],Je);for(var ot=1;ot=Math.abs(at)?ot-ht+at:at-ht+ot,ot=ht}ot+De>=0!=!!Je&&Ot.reverse()}var b=i.by(function Ot(Je,ot){var De,ye=Je&&Je.type;if(ye==="FeatureCollection")for(De=0;De>31}function B(Ot,Je){for(var ot=Ot.loadGeometry(),De=Ot.type,ye=0,Pe=0,He=ot.length,at=0;atOt},F=Math.fround||($=new Float32Array(1),Ot=>($[0]=+Ot,$[0]));var $;let q=3,G=5,ee=6;class he{constructor(Je){this.options=Object.assign(Object.create(W),Je),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Je){let{log:ot,minZoom:De,maxZoom:ye}=this.options;ot&&console.time("total time");let Pe=`prepare ${Je.length} points`;ot&&console.time(Pe),this.points=Je;let He=[];for(let ht=0;ht=De;ht--){let At=+Date.now();at=this.trees[ht]=this._createTree(this._cluster(at,ht)),ot&&console.log("z%d: %d clusters in %dms",ht,at.numItems,+Date.now()-At)}return ot&&console.timeEnd("total time"),this}getClusters(Je,ot){let De=((Je[0]+180)%360+360)%360-180,ye=Math.max(-90,Math.min(90,Je[1])),Pe=Je[2]===180?180:((Je[2]+180)%360+360)%360-180,He=Math.max(-90,Math.min(90,Je[3]));if(Je[2]-Je[0]>=360)De=-180,Pe=180;else if(De>Pe){let Kt=this.getClusters([De,ye,180,He],ot),hr=this.getClusters([-180,ye,Pe,He],ot);return Kt.concat(hr)}let at=this.trees[this._limitZoom(ot)],ht=at.range(ce(De),re(He),ce(Pe),re(ye)),At=at.data,Wt=[];for(let Kt of ht){let hr=this.stride*Kt;Wt.push(At[hr+G]>1?xe(At,hr,this.clusterProps):this.points[At[hr+q]])}return Wt}getChildren(Je){let ot=this._getOriginId(Je),De=this._getOriginZoom(Je),ye="No cluster with the specified id.",Pe=this.trees[De];if(!Pe)throw new Error(ye);let He=Pe.data;if(ot*this.stride>=He.length)throw new Error(ye);let at=this.options.radius/(this.options.extent*Math.pow(2,De-1)),ht=Pe.within(He[ot*this.stride],He[ot*this.stride+1],at),At=[];for(let Wt of ht){let Kt=Wt*this.stride;He[Kt+4]===Je&&At.push(He[Kt+G]>1?xe(He,Kt,this.clusterProps):this.points[He[Kt+q]])}if(At.length===0)throw new Error(ye);return At}getLeaves(Je,ot,De){let ye=[];return this._appendLeaves(ye,Je,ot=ot||10,De=De||0,0),ye}getTile(Je,ot,De){let ye=this.trees[this._limitZoom(Je)],Pe=Math.pow(2,Je),{extent:He,radius:at}=this.options,ht=at/He,At=(De-ht)/Pe,Wt=(De+1+ht)/Pe,Kt={features:[]};return this._addTileFeatures(ye.range((ot-ht)/Pe,At,(ot+1+ht)/Pe,Wt),ye.data,ot,De,Pe,Kt),ot===0&&this._addTileFeatures(ye.range(1-ht/Pe,At,1,Wt),ye.data,Pe,De,Pe,Kt),ot===Pe-1&&this._addTileFeatures(ye.range(0,At,ht/Pe,Wt),ye.data,-1,De,Pe,Kt),Kt.features.length?Kt:null}getClusterExpansionZoom(Je){let ot=this._getOriginZoom(Je)-1;for(;ot<=this.options.maxZoom;){let De=this.getChildren(Je);if(ot++,De.length!==1)break;Je=De[0].properties.cluster_id}return ot}_appendLeaves(Je,ot,De,ye,Pe){let He=this.getChildren(ot);for(let at of He){let ht=at.properties;if(ht&&ht.cluster?Pe+ht.point_count<=ye?Pe+=ht.point_count:Pe=this._appendLeaves(Je,ht.cluster_id,De,ye,Pe):Pe1,Wt,Kt,hr;if(At)Wt=ve(ot,ht,this.clusterProps),Kt=ot[ht],hr=ot[ht+1];else{let br=this.points[ot[ht+q]];Wt=br.properties;let[hi,un]=br.geometry.coordinates;Kt=ce(hi),hr=re(un)}let zr={type:1,geometry:[[Math.round(this.options.extent*(Kt*Pe-De)),Math.round(this.options.extent*(hr*Pe-ye))]],tags:Wt},Dr;Dr=At||this.options.generateId?ot[ht+q]:this.points[ot[ht+q]].id,Dr!==void 0&&(zr.id=Dr),He.features.push(zr)}}_limitZoom(Je){return Math.max(this.options.minZoom,Math.min(Math.floor(+Je),this.options.maxZoom+1))}_cluster(Je,ot){let{radius:De,extent:ye,reduce:Pe,minPoints:He}=this.options,at=De/(ye*Math.pow(2,ot)),ht=Je.data,At=[],Wt=this.stride;for(let Kt=0;Ktot&&(hi+=ht[cn+G])}if(hi>br&&hi>=He){let un,cn=hr*br,yn=zr*br,Wn=-1,Sn=((Kt/Wt|0)<<5)+(ot+1)+this.points.length;for(let fn of Dr){let ga=fn*Wt;if(ht[ga+2]<=ot)continue;ht[ga+2]=ot;let na=ht[ga+G];cn+=ht[ga]*na,yn+=ht[ga+1]*na,ht[ga+4]=Sn,Pe&&(un||(un=this._map(ht,Kt,!0),Wn=this.clusterProps.length,this.clusterProps.push(un)),Pe(un,this._map(ht,ga)))}ht[Kt+4]=Sn,At.push(cn/hi,yn/hi,1/0,Sn,-1,hi),Pe&&At.push(Wn)}else{for(let un=0;un1)for(let un of Dr){let cn=un*Wt;if(!(ht[cn+2]<=ot)){ht[cn+2]=ot;for(let yn=0;yn>5}_getOriginZoom(Je){return(Je-this.points.length)%32}_map(Je,ot,De){if(Je[ot+G]>1){let He=this.clusterProps[Je[ot+ee]];return De?Object.assign({},He):He}let ye=this.points[Je[ot+q]].properties,Pe=this.options.map(ye);return De&&Pe===ye?Object.assign({},Pe):Pe}}function xe(Ot,Je,ot){return{type:"Feature",id:Ot[Je+q],properties:ve(Ot,Je,ot),geometry:{type:"Point",coordinates:[(De=Ot[Je],360*(De-.5)),ge(Ot[Je+1])]}};var De}function ve(Ot,Je,ot){let De=Ot[Je+G],ye=De>=1e4?`${Math.round(De/1e3)}k`:De>=1e3?Math.round(De/100)/10+"k":De,Pe=Ot[Je+ee],He=Pe===-1?{}:Object.assign({},ot[Pe]);return Object.assign(He,{cluster:!0,cluster_id:Ot[Je+q],point_count:De,point_count_abbreviated:ye})}function ce(Ot){return Ot/360+.5}function re(Ot){let Je=Math.sin(Ot*Math.PI/180),ot=.5-.25*Math.log((1+Je)/(1-Je))/Math.PI;return ot<0?0:ot>1?1:ot}function ge(Ot){let Je=(180-360*Ot)*Math.PI/180;return 360*Math.atan(Math.exp(Je))/Math.PI-90}function ne(Ot,Je,ot,De){let ye=De,Pe=Je+(ot-Je>>1),He,at=ot-Je,ht=Ot[Je],At=Ot[Je+1],Wt=Ot[ot],Kt=Ot[ot+1];for(let hr=Je+3;hrye)He=hr,ye=zr;else if(zr===ye){let Dr=Math.abs(hr-Pe);DrDe&&(He-Je>3&&ne(Ot,Je,He,De),Ot[He+2]=ye,ot-He>3&&ne(Ot,He,ot,De))}function se(Ot,Je,ot,De,ye,Pe){let He=ye-ot,at=Pe-De;if(He!==0||at!==0){let ht=((Ot-ot)*He+(Je-De)*at)/(He*He+at*at);ht>1?(ot=ye,De=Pe):ht>0&&(ot+=He*ht,De+=at*ht)}return He=Ot-ot,at=Je-De,He*He+at*at}function _e(Ot,Je,ot,De){let ye={id:Ot??null,type:Je,geometry:ot,tags:De,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Je==="Point"||Je==="MultiPoint"||Je==="LineString")oe(ye,ot);else if(Je==="Polygon")oe(ye,ot[0]);else if(Je==="MultiLineString")for(let Pe of ot)oe(ye,Pe);else if(Je==="MultiPolygon")for(let Pe of ot)oe(ye,Pe[0]);return ye}function oe(Ot,Je){for(let ot=0;ot0&&(He+=De?(ye*Wt-At*Pe)/2:Math.sqrt(Math.pow(At-ye,2)+Math.pow(Wt-Pe,2))),ye=At,Pe=Wt}let at=Je.length-3;Je[2]=1,ne(Je,0,at,ot),Je[at+2]=1,Je.size=Math.abs(He),Je.start=0,Je.end=Je.size}function Ce(Ot,Je,ot,De){for(let ye=0;ye1?1:ot}function Ze(Ot,Je,ot,De,ye,Pe,He,at){if(De/=Je,Pe>=(ot/=Je)&&He=De)return null;let ht=[];for(let At of Ot){let Wt=At.geometry,Kt=At.type,hr=ye===0?At.minX:At.minY,zr=ye===0?At.maxX:At.maxY;if(hr>=ot&&zr=De)continue;let Dr=[];if(Kt==="Point"||Kt==="MultiPoint")Ge(Wt,Dr,ot,De,ye);else if(Kt==="LineString")rt(Wt,Dr,ot,De,ye,!1,at.lineMetrics);else if(Kt==="MultiLineString")pt(Wt,Dr,ot,De,ye,!1);else if(Kt==="Polygon")pt(Wt,Dr,ot,De,ye,!0);else if(Kt==="MultiPolygon")for(let br of Wt){let hi=[];pt(br,hi,ot,De,ye,!0),hi.length&&Dr.push(hi)}if(Dr.length){if(at.lineMetrics&&Kt==="LineString"){for(let br of Dr)ht.push(_e(At.id,Kt,br,At.tags));continue}Kt!=="LineString"&&Kt!=="MultiLineString"||(Dr.length===1?(Kt="LineString",Dr=Dr[0]):Kt="MultiLineString"),Kt!=="Point"&&Kt!=="MultiPoint"||(Kt=Dr.length===3?"Point":"MultiPoint"),ht.push(_e(At.id,Kt,Dr,At.tags))}}return ht.length?ht:null}function Ge(Ot,Je,ot,De,ye){for(let Pe=0;Pe=ot&&He<=De&>(Je,Ot[Pe],Ot[Pe+1],Ot[Pe+2])}}function rt(Ot,Je,ot,De,ye,Pe,He){let at=_t(Ot),ht=ye===0?ct:Ae,At,Wt,Kt=Ot.start;for(let hi=0;hiot&&(Wt=ht(at,un,cn,Wn,Sn,ot),He&&(at.start=Kt+At*Wt)):fn>De?ga=ot&&(Wt=ht(at,un,cn,Wn,Sn,ot),na=!0),ga>De&&fn<=De&&(Wt=ht(at,un,cn,Wn,Sn,De),na=!0),!Pe&&na&&(He&&(at.end=Kt+At*Wt),Je.push(at),at=_t(Ot)),He&&(Kt+=At)}let hr=Ot.length-3,zr=Ot[hr],Dr=Ot[hr+1],br=ye===0?zr:Dr;br>=ot&&br<=De&>(at,zr,Dr,Ot[hr+2]),hr=at.length-3,Pe&&hr>=3&&(at[hr]!==at[0]||at[hr+1]!==at[1])&>(at,at[0],at[1],at[2]),at.length&&Je.push(at)}function _t(Ot){let Je=[];return Je.size=Ot.size,Je.start=Ot.start,Je.end=Ot.end,Je}function pt(Ot,Je,ot,De,ye,Pe){for(let He of Ot)rt(He,Je,ot,De,ye,Pe,!1)}function gt(Ot,Je,ot,De){Ot.push(Je,ot,De)}function ct(Ot,Je,ot,De,ye,Pe){let He=(Pe-Je)/(De-Je);return gt(Ot,Pe,ot+(ye-ot)*He,1),He}function Ae(Ot,Je,ot,De,ye,Pe){let He=(Pe-ot)/(ye-ot);return gt(Ot,Je+(De-Je)*He,Pe,1),He}function ze(Ot,Je){let ot=[];for(let De=0;De0&&Je.size<(ye?He:De))return void(ot.numPoints+=Je.length/3);let at=[];for(let ht=0;htHe)&&(ot.numSimplified++,at.push(Je[ht],Je[ht+1])),ot.numPoints++;ye&&function(ht,At){let Wt=0;for(let Kt=0,hr=ht.length,zr=hr-2;Kt0===At)for(let Kt=0,hr=ht.length;Kt
24)throw new Error("maxZoom should be in the 0-24 range");if(ot.promoteId&&ot.generateId)throw new Error("promoteId and generateId cannot be used together.");let ye=function(Pe,He){let at=[];if(Pe.type==="FeatureCollection")for(let ht=0;ht1&&console.time("creation"),zr=this.tiles[hr]=ut(Je,ot,De,ye,At),this.tileCoords.push({z:ot,x:De,y:ye}),Wt)){Wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ot,De,ye,zr.numFeatures,zr.numPoints,zr.numSimplified),console.timeEnd("creation"));let na=`z${ot}`;this.stats[na]=(this.stats[na]||0)+1,this.total++}if(zr.source=Je,Pe==null){if(ot===At.indexMaxZoom||zr.numPoints<=At.indexMaxPoints)continue}else{if(ot===At.maxZoom||ot===Pe)continue;if(Pe!=null){let na=Pe-ot;if(De!==He>>na||ye!==at>>na)continue}}if(zr.source=null,Je.length===0)continue;Wt>1&&console.time("clipping");let Dr=.5*At.buffer/At.extent,br=.5-Dr,hi=.5+Dr,un=1+Dr,cn=null,yn=null,Wn=null,Sn=null,fn=Ze(Je,Kt,De-Dr,De+hi,0,zr.minX,zr.maxX,At),ga=Ze(Je,Kt,De+br,De+un,0,zr.minX,zr.maxX,At);Je=null,fn&&(cn=Ze(fn,Kt,ye-Dr,ye+hi,1,zr.minY,zr.maxY,At),yn=Ze(fn,Kt,ye+br,ye+un,1,zr.minY,zr.maxY,At),fn=null),ga&&(Wn=Ze(ga,Kt,ye-Dr,ye+hi,1,zr.minY,zr.maxY,At),Sn=Ze(ga,Kt,ye+br,ye+un,1,zr.minY,zr.maxY,At),ga=null),Wt>1&&console.timeEnd("clipping"),ht.push(cn||[],ot+1,2*De,2*ye),ht.push(yn||[],ot+1,2*De,2*ye+1),ht.push(Wn||[],ot+1,2*De+1,2*ye),ht.push(Sn||[],ot+1,2*De+1,2*ye+1)}}getTile(Je,ot,De){Je=+Je,ot=+ot,De=+De;let ye=this.options,{extent:Pe,debug:He}=ye;if(Je<0||Je>24)return null;let at=1<1&&console.log("drilling down to z%d-%d-%d",Je,ot,De);let At,Wt=Je,Kt=ot,hr=De;for(;!At&&Wt>0;)Wt--,Kt>>=1,hr>>=1,At=this.tiles[mr(Wt,Kt,hr)];return At&&At.source?(He>1&&(console.log("found parent tile z%d-%d-%d",Wt,Kt,hr),console.time("drilling down")),this.splitTile(At.source,Wt,Kt,hr,Je,ot,De),He>1&&console.timeEnd("drilling down"),this.tiles[ht]?nt(this.tiles[ht],Pe):null):null}}function mr(Ot,Je,ot){return 32*((1<{Kt.properties=zr;let Dr={};for(let br of hr)Dr[br]=ht[br].evaluate(Wt,Kt);return Dr},He.reduce=(zr,Dr)=>{Kt.properties=Dr;for(let br of hr)Wt.accumulated=zr[br],zr[br]=At[br].evaluate(Wt,Kt)},He}(Je)).load((yield this._pendingData).features):(ye=yield this._pendingData,new gr(ye,Je.geojsonVtOptions)),this.loaded={};let Pe={};if(De){let He=De.finish();He&&(Pe.resourceTiming={},Pe.resourceTiming[Je.source]=JSON.parse(JSON.stringify(He)))}return Pe}catch(Pe){if(delete this._pendingRequest,i.bB(Pe))return{abandoned:!0};throw Pe}var ye})}getData(){return i._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Je){let ot=this.loaded;return ot&&ot[Je.uid]?super.reloadTile(Je):this.loadTile(Je)}loadAndProcessGeoJSON(Je,ot){return i._(this,void 0,void 0,function*(){let De=yield this.loadGeoJSON(Je,ot);if(delete this._pendingRequest,typeof De!="object")throw new Error(`Input data given to '${Je.source}' is not a valid GeoJSON object.`);if(b(De,!0),Je.filter){let ye=i.bC(Je.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ye.result==="error")throw new Error(ye.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));De={type:"FeatureCollection",features:De.features.filter(Pe=>ye.value.evaluate({zoom:0},Pe))}}return De})}loadGeoJSON(Je,ot){return i._(this,void 0,void 0,function*(){let{promoteId:De}=Je;if(Je.request){let ye=yield i.h(Je.request,ot);return this._dataUpdateable=ri(ye.data,De)?Mr(ye.data,De):void 0,ye.data}if(typeof Je.data=="string")try{let ye=JSON.parse(Je.data);return this._dataUpdateable=ri(ye,De)?Mr(ye,De):void 0,ye}catch{throw new Error(`Input data given to '${Je.source}' is not a valid GeoJSON object.`)}if(!Je.dataDiff)throw new Error(`Input data given to '${Je.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Je.source}`);return function(ye,Pe,He){var at,ht,At,Wt;if(Pe.removeAll&&ye.clear(),Pe.remove)for(let Kt of Pe.remove)ye.delete(Kt);if(Pe.add)for(let Kt of Pe.add){let hr=Kr(Kt,He);hr!=null&&ye.set(hr,Kt)}if(Pe.update)for(let Kt of Pe.update){let hr=ye.get(Kt.id);if(hr==null)continue;let zr=!Kt.removeAllProperties&&(((at=Kt.removeProperties)===null||at===void 0?void 0:at.length)>0||((ht=Kt.addOrUpdateProperties)===null||ht===void 0?void 0:ht.length)>0);if((Kt.newGeometry||Kt.removeAllProperties||zr)&&(hr=Object.assign({},hr),ye.set(Kt.id,hr),zr&&(hr.properties=Object.assign({},hr.properties))),Kt.newGeometry&&(hr.geometry=Kt.newGeometry),Kt.removeAllProperties)hr.properties={};else if(((At=Kt.removeProperties)===null||At===void 0?void 0:At.length)>0)for(let Dr of Kt.removeProperties)Object.prototype.hasOwnProperty.call(hr.properties,Dr)&&delete hr.properties[Dr];if(((Wt=Kt.addOrUpdateProperties)===null||Wt===void 0?void 0:Wt.length)>0)for(let{key:Dr,value:br}of Kt.addOrUpdateProperties)hr.properties[Dr]=br}}(this._dataUpdateable,Je.dataDiff,De),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Je){return i._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Je){return this._geoJSONIndex.getClusterExpansionZoom(Je.clusterId)}getClusterChildren(Je){return this._geoJSONIndex.getChildren(Je.clusterId)}getClusterLeaves(Je){return this._geoJSONIndex.getLeaves(Je.clusterId,Je.limit,Je.offset)}}class mi{constructor(Je){this.self=Je,this.actor=new i.F(Je),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ot,De)=>{if(this.externalWorkerSourceTypes[ot])throw new Error(`Worker source with name "${ot}" already registered.`);this.externalWorkerSourceTypes[ot]=De},this.self.addProtocol=i.bi,this.self.removeProtocol=i.bj,this.self.registerRTLTextPlugin=ot=>{if(i.bD.isParsed())throw new Error("RTL text plugin already registered.");i.bD.setMethods(ot)},this.actor.registerMessageHandler("LDT",(ot,De)=>this._getDEMWorkerSource(ot,De.source).loadTile(De)),this.actor.registerMessageHandler("RDT",(ot,De)=>i._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ot,De.source).removeTile(De)})),this.actor.registerMessageHandler("GCEZ",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterExpansionZoom(De)})),this.actor.registerMessageHandler("GCC",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterChildren(De)})),this.actor.registerMessageHandler("GCL",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterLeaves(De)})),this.actor.registerMessageHandler("LD",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).loadData(De)),this.actor.registerMessageHandler("GD",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).getData()),this.actor.registerMessageHandler("LT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).loadTile(De)),this.actor.registerMessageHandler("RT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).reloadTile(De)),this.actor.registerMessageHandler("AT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).abortTile(De)),this.actor.registerMessageHandler("RMT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).removeTile(De)),this.actor.registerMessageHandler("RS",(ot,De)=>i._(this,void 0,void 0,function*(){if(!this.workerSources[ot]||!this.workerSources[ot][De.type]||!this.workerSources[ot][De.type][De.source])return;let ye=this.workerSources[ot][De.type][De.source];delete this.workerSources[ot][De.type][De.source],ye.removeSource!==void 0&&ye.removeSource(De)})),this.actor.registerMessageHandler("RM",ot=>i._(this,void 0,void 0,function*(){delete this.layerIndexes[ot],delete this.availableImages[ot],delete this.workerSources[ot],delete this.demWorkerSources[ot]})),this.actor.registerMessageHandler("SR",(ot,De)=>i._(this,void 0,void 0,function*(){this.referrer=De})),this.actor.registerMessageHandler("SRPS",(ot,De)=>this._syncRTLPluginState(ot,De)),this.actor.registerMessageHandler("IS",(ot,De)=>i._(this,void 0,void 0,function*(){this.self.importScripts(De)})),this.actor.registerMessageHandler("SI",(ot,De)=>this._setImages(ot,De)),this.actor.registerMessageHandler("UL",(ot,De)=>i._(this,void 0,void 0,function*(){this._getLayerIndex(ot).update(De.layers,De.removedIds)})),this.actor.registerMessageHandler("SL",(ot,De)=>i._(this,void 0,void 0,function*(){this._getLayerIndex(ot).replace(De)}))}_setImages(Je,ot){return i._(this,void 0,void 0,function*(){this.availableImages[Je]=ot;for(let De in this.workerSources[Je]){let ye=this.workerSources[Je][De];for(let Pe in ye)ye[Pe].availableImages=ot}})}_syncRTLPluginState(Je,ot){return i._(this,void 0,void 0,function*(){if(i.bD.isParsed())return i.bD.getState();if(ot.pluginStatus!=="loading")return i.bD.setState(ot),ot;let De=ot.pluginURL;if(this.self.importScripts(De),i.bD.isParsed()){let ye={pluginStatus:"loaded",pluginURL:De};return i.bD.setState(ye),ye}throw i.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${De}`)})}_getAvailableImages(Je){let ot=this.availableImages[Je];return ot||(ot=[]),ot}_getLayerIndex(Je){let ot=this.layerIndexes[Je];return ot||(ot=this.layerIndexes[Je]=new n),ot}_getWorkerSource(Je,ot,De){if(this.workerSources[Je]||(this.workerSources[Je]={}),this.workerSources[Je][ot]||(this.workerSources[Je][ot]={}),!this.workerSources[Je][ot][De]){let ye={sendAsync:(Pe,He)=>(Pe.targetMapId=Je,this.actor.sendAsync(Pe,He))};switch(ot){case"vector":this.workerSources[Je][ot][De]=new u(ye,this._getLayerIndex(Je),this._getAvailableImages(Je));break;case"geojson":this.workerSources[Je][ot][De]=new ui(ye,this._getLayerIndex(Je),this._getAvailableImages(Je));break;default:this.workerSources[Je][ot][De]=new this.externalWorkerSourceTypes[ot](ye,this._getLayerIndex(Je),this._getAvailableImages(Je))}}return this.workerSources[Je][ot][De]}_getDEMWorkerSource(Je,ot){return this.demWorkerSources[Je]||(this.demWorkerSources[Je]={}),this.demWorkerSources[Je][ot]||(this.demWorkerSources[Je][ot]=new s),this.demWorkerSources[Je][ot]}}return i.i(self)&&(self.worker=new mi(self)),mi}),z("index",["exports","./shared"],function(i,n){var a="4.7.1";let l,o,u={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ke=>new Promise((O,pe)=>{let Ie=requestAnimationFrame(O);Ke.signal.addEventListener("abort",()=>{cancelAnimationFrame(Ie),pe(n.c())})}),getImageData(Ke,O=0){return this.getImageCanvasContext(Ke).getImageData(-O,-O,Ke.width+2*O,Ke.height+2*O)},getImageCanvasContext(Ke){let O=window.document.createElement("canvas"),pe=O.getContext("2d",{willReadFrequently:!0});if(!pe)throw new Error("failed to create canvas 2d context");return O.width=Ke.width,O.height=Ke.height,pe.drawImage(Ke,0,0,Ke.width,Ke.height),pe},resolveURL:Ke=>(l||(l=document.createElement("a")),l.href=Ke,l.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(o==null&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)}};class s{static testProp(O){if(!s.docStyle)return O[0];for(let pe=0;pe{window.removeEventListener("click",s.suppressClickInternal,!0)},0)}static getScale(O){let pe=O.getBoundingClientRect();return{x:pe.width/O.offsetWidth||1,y:pe.height/O.offsetHeight||1,boundingClientRect:pe}}static getPoint(O,pe,Ie){let Ne=pe.boundingClientRect;return new n.P((Ie.clientX-Ne.left)/pe.x-O.clientLeft,(Ie.clientY-Ne.top)/pe.y-O.clientTop)}static mousePos(O,pe){let Ie=s.getScale(O);return s.getPoint(O,Ie,pe)}static touchPos(O,pe){let Ie=[],Ne=s.getScale(O);for(let qe=0;qe{m&&A(m),m=null,_=!0},b.onerror=()=>{x=!0,m=null},b.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Ke){let O,pe,Ie,Ne;Ke.resetRequestQueue=()=>{O=[],pe=0,Ie=0,Ne={}},Ke.addThrottleControl=er=>{let kr=Ie++;return Ne[kr]=er,kr},Ke.removeThrottleControl=er=>{delete Ne[er],Mt()},Ke.getImage=(er,kr,Hr=!0)=>new Promise((Vr,ki)=>{h.supported&&(er.headers||(er.headers={}),er.headers.accept="image/webp,*/*"),n.e(er,{type:"image"}),O.push({abortController:kr,requestParameters:er,supportImageRefresh:Hr,state:"queued",onError:Vi=>{ki(Vi)},onSuccess:Vi=>{Vr(Vi)}}),Mt()});let qe=er=>n._(this,void 0,void 0,function*(){er.state="running";let{requestParameters:kr,supportImageRefresh:Hr,onError:Vr,onSuccess:ki,abortController:Vi}=er,tt=Hr===!1&&!n.i(self)&&!n.g(kr.url)&&(!kr.headers||Object.keys(kr.headers).reduce((Lt,Vt)=>Lt&&Vt==="accept",!0));pe++;let lt=tt?jt(kr,Vi):n.m(kr,Vi);try{let Lt=yield lt;delete er.abortController,er.state="completed",Lt.data instanceof HTMLImageElement||n.b(Lt.data)?ki(Lt):Lt.data&&ki({data:yield(Tt=Lt.data,typeof createImageBitmap=="function"?n.d(Tt):n.f(Tt)),cacheControl:Lt.cacheControl,expires:Lt.expires})}catch(Lt){delete er.abortController,Vr(Lt)}finally{pe--,Mt()}var Tt}),Mt=()=>{let er=(()=>{for(let kr of Object.keys(Ne))if(Ne[kr]())return!0;return!1})()?n.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:n.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let kr=pe;kr0;kr++){let Hr=O.shift();Hr.abortController.signal.aborted?kr--:qe(Hr)}},jt=(er,kr)=>new Promise((Hr,Vr)=>{let ki=new Image,Vi=er.url,tt=er.credentials;tt&&tt==="include"?ki.crossOrigin="use-credentials":(tt&&tt==="same-origin"||!n.s(Vi))&&(ki.crossOrigin="anonymous"),kr.signal.addEventListener("abort",()=>{ki.src="",Vr(n.c())}),ki.fetchPriority="high",ki.onload=()=>{ki.onerror=ki.onload=null,Hr({data:ki})},ki.onerror=()=>{ki.onerror=ki.onload=null,kr.signal.aborted||Vr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},ki.src=Vi})}(f||(f={})),f.resetRequestQueue();class k{constructor(O){this._transformRequestFn=O}transformRequest(O,pe){return this._transformRequestFn&&this._transformRequestFn(O,pe)||{url:O}}setTransformRequest(O){this._transformRequestFn=O}}function w(Ke){var O=new n.A(3);return O[0]=Ke[0],O[1]=Ke[1],O[2]=Ke[2],O}var D,E=function(Ke,O,pe){return Ke[0]=O[0]-pe[0],Ke[1]=O[1]-pe[1],Ke[2]=O[2]-pe[2],Ke};D=new n.A(3),n.A!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0);var I=function(Ke){var O=Ke[0],pe=Ke[1];return O*O+pe*pe};function M(Ke){let O=[];if(typeof Ke=="string")O.push({id:"default",url:Ke});else if(Ke&&Ke.length>0){let pe=[];for(let{id:Ie,url:Ne}of Ke){let qe=`${Ie}${Ne}`;pe.indexOf(qe)===-1&&(pe.push(qe),O.push({id:Ie,url:Ne}))}}return O}function p(Ke,O,pe){let Ie=Ke.split("?");return Ie[0]+=`${O}${pe}`,Ie.join("?")}(function(){var Ke=new n.A(2);n.A!=Float32Array&&(Ke[0]=0,Ke[1]=0)})();class g{constructor(O,pe,Ie,Ne){this.context=O,this.format=Ie,this.texture=O.gl.createTexture(),this.update(pe,Ne)}update(O,pe,Ie){let{width:Ne,height:qe}=O,Mt=!(this.size&&this.size[0]===Ne&&this.size[1]===qe||Ie),{context:jt}=this,{gl:er}=jt;if(this.useMipmap=!!(pe&&pe.useMipmap),er.bindTexture(er.TEXTURE_2D,this.texture),jt.pixelStoreUnpackFlipY.set(!1),jt.pixelStoreUnpack.set(1),jt.pixelStoreUnpackPremultiplyAlpha.set(this.format===er.RGBA&&(!pe||pe.premultiply!==!1)),Mt)this.size=[Ne,qe],O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||n.b(O)?er.texImage2D(er.TEXTURE_2D,0,this.format,this.format,er.UNSIGNED_BYTE,O):er.texImage2D(er.TEXTURE_2D,0,this.format,Ne,qe,0,this.format,er.UNSIGNED_BYTE,O.data);else{let{x:kr,y:Hr}=Ie||{x:0,y:0};O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||n.b(O)?er.texSubImage2D(er.TEXTURE_2D,0,kr,Hr,er.RGBA,er.UNSIGNED_BYTE,O):er.texSubImage2D(er.TEXTURE_2D,0,kr,Hr,Ne,qe,er.RGBA,er.UNSIGNED_BYTE,O.data)}this.useMipmap&&this.isSizePowerOfTwo()&&er.generateMipmap(er.TEXTURE_2D)}bind(O,pe,Ie){let{context:Ne}=this,{gl:qe}=Ne;qe.bindTexture(qe.TEXTURE_2D,this.texture),Ie!==qe.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Ie=qe.LINEAR),O!==this.filter&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,O),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,Ie||O),this.filter=O),pe!==this.wrap&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,pe),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,pe),this.wrap=pe)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:O}=this.context;O.deleteTexture(this.texture),this.texture=null}}function C(Ke){let{userImage:O}=Ke;return!!(O&&O.render&&O.render())&&(Ke.data.replace(new Uint8Array(O.data.buffer)),!0)}class T extends n.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(O){if(this.loaded!==O&&(this.loaded=O,O)){for(let{ids:pe,promiseResolve:Ie}of this.requestors)Ie(this._getImagesForIds(pe));this.requestors=[]}}getImage(O){let pe=this.images[O];if(pe&&!pe.data&&pe.spriteData){let Ie=pe.spriteData;pe.data=new n.R({width:Ie.width,height:Ie.height},Ie.context.getImageData(Ie.x,Ie.y,Ie.width,Ie.height).data),pe.spriteData=null}return pe}addImage(O,pe){if(this.images[O])throw new Error(`Image id ${O} already exist, use updateImage instead`);this._validate(O,pe)&&(this.images[O]=pe)}_validate(O,pe){let Ie=!0,Ne=pe.data||pe.spriteData;return this._validateStretch(pe.stretchX,Ne&&Ne.width)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "stretchX" value`))),Ie=!1),this._validateStretch(pe.stretchY,Ne&&Ne.height)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "stretchY" value`))),Ie=!1),this._validateContent(pe.content,pe)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "content" value`))),Ie=!1),Ie}_validateStretch(O,pe){if(!O)return!0;let Ie=0;for(let Ne of O){if(Ne[0]{let Ne=!0;if(!this.isLoaded())for(let qe of O)this.images[qe]||(Ne=!1);this.isLoaded()||Ne?pe(this._getImagesForIds(O)):this.requestors.push({ids:O,promiseResolve:pe})})}_getImagesForIds(O){let pe={};for(let Ie of O){let Ne=this.getImage(Ie);Ne||(this.fire(new n.k("styleimagemissing",{id:Ie})),Ne=this.getImage(Ie)),Ne?pe[Ie]={data:Ne.data.clone(),pixelRatio:Ne.pixelRatio,sdf:Ne.sdf,version:Ne.version,stretchX:Ne.stretchX,stretchY:Ne.stretchY,content:Ne.content,textFitWidth:Ne.textFitWidth,textFitHeight:Ne.textFitHeight,hasRenderCallback:!!(Ne.userImage&&Ne.userImage.render)}:n.w(`Image "${Ie}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return pe}getPixelSize(){let{width:O,height:pe}=this.atlasImage;return{width:O,height:pe}}getPattern(O){let pe=this.patterns[O],Ie=this.getImage(O);if(!Ie)return null;if(pe&&pe.position.version===Ie.version)return pe.position;if(pe)pe.position.version=Ie.version;else{let Ne={w:Ie.data.width+2,h:Ie.data.height+2,x:0,y:0},qe=new n.I(Ne,Ie);this.patterns[O]={bin:Ne,position:qe}}return this._updatePatternAtlas(),this.patterns[O].position}bind(O){let pe=O.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new g(O,this.atlasImage,pe.RGBA),this.atlasTexture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE)}_updatePatternAtlas(){let O=[];for(let qe in this.patterns)O.push(this.patterns[qe].bin);let{w:pe,h:Ie}=n.p(O),Ne=this.atlasImage;Ne.resize({width:pe||1,height:Ie||1});for(let qe in this.patterns){let{bin:Mt}=this.patterns[qe],jt=Mt.x+1,er=Mt.y+1,kr=this.getImage(qe).data,Hr=kr.width,Vr=kr.height;n.R.copy(kr,Ne,{x:0,y:0},{x:jt,y:er},{width:Hr,height:Vr}),n.R.copy(kr,Ne,{x:0,y:Vr-1},{x:jt,y:er-1},{width:Hr,height:1}),n.R.copy(kr,Ne,{x:0,y:0},{x:jt,y:er+Vr},{width:Hr,height:1}),n.R.copy(kr,Ne,{x:Hr-1,y:0},{x:jt-1,y:er},{width:1,height:Vr}),n.R.copy(kr,Ne,{x:0,y:0},{x:jt+Hr,y:er},{width:1,height:Vr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(O){for(let pe of O){if(this.callbackDispatchedThisFrame[pe])continue;this.callbackDispatchedThisFrame[pe]=!0;let Ie=this.getImage(pe);Ie||n.w(`Image with ID: "${pe}" was not found`),C(Ie)&&this.updateImage(pe,Ie)}}}let N=1e20;function B(Ke,O,pe,Ie,Ne,qe,Mt,jt,er){for(let kr=O;kr-1);er++,qe[er]=jt,Mt[er]=kr,Mt[er+1]=N}for(let jt=0,er=0;jt65535)throw new Error("glyphs > 65535 not supported");if(Ie.ranges[qe])return{stack:O,id:pe,glyph:Ne};if(!this.url)throw new Error("glyphsUrl is not set");if(!Ie.requests[qe]){let jt=V.loadGlyphRange(O,qe,this.url,this.requestManager);Ie.requests[qe]=jt}let Mt=yield Ie.requests[qe];for(let jt in Mt)this._doesCharSupportLocalGlyph(+jt)||(Ie.glyphs[+jt]=Mt[+jt]);return Ie.ranges[qe]=!0,{stack:O,id:pe,glyph:Mt[pe]||null}})}_doesCharSupportLocalGlyph(O){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(O))}_tinySDF(O,pe,Ie){let Ne=this.localIdeographFontFamily;if(!Ne||!this._doesCharSupportLocalGlyph(Ie))return;let qe=O.tinySDF;if(!qe){let jt="400";/bold/i.test(pe)?jt="900":/medium/i.test(pe)?jt="500":/light/i.test(pe)&&(jt="200"),qe=O.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Ne,fontWeight:jt})}let Mt=qe.draw(String.fromCharCode(Ie));return{id:Ie,bitmap:new n.o({width:Mt.width||60,height:Mt.height||60},Mt.data),metrics:{width:Mt.glyphWidth/2||24,height:Mt.glyphHeight/2||24,left:Mt.glyphLeft/2+.5||0,top:Mt.glyphTop/2-27.5||-8,advance:Mt.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(Ke,O,pe,Ie){return n._(this,void 0,void 0,function*(){let Ne=256*O,qe=Ne+255,Mt=Ie.transformRequest(pe.replace("{fontstack}",Ke).replace("{range}",`${Ne}-${qe}`),"Glyphs"),jt=yield n.l(Mt,new AbortController);if(!jt||!jt.data)throw new Error(`Could not load glyph range. range: ${O}, ${Ne}-${qe}`);let er={};for(let kr of n.n(jt.data))er[kr.id]=kr;return er})},V.TinySDF=class{constructor({fontSize:Ke=24,buffer:O=3,radius:pe=8,cutoff:Ie=.25,fontFamily:Ne="sans-serif",fontWeight:qe="normal",fontStyle:Mt="normal"}={}){this.buffer=O,this.cutoff=Ie,this.radius=pe;let jt=this.size=Ke+4*O,er=this._createCanvas(jt),kr=this.ctx=er.getContext("2d",{willReadFrequently:!0});kr.font=`${Mt} ${qe} ${Ke}px ${Ne}`,kr.textBaseline="alphabetic",kr.textAlign="left",kr.fillStyle="black",this.gridOuter=new Float64Array(jt*jt),this.gridInner=new Float64Array(jt*jt),this.f=new Float64Array(jt),this.z=new Float64Array(jt+1),this.v=new Uint16Array(jt)}_createCanvas(Ke){let O=document.createElement("canvas");return O.width=O.height=Ke,O}draw(Ke){let{width:O,actualBoundingBoxAscent:pe,actualBoundingBoxDescent:Ie,actualBoundingBoxLeft:Ne,actualBoundingBoxRight:qe}=this.ctx.measureText(Ke),Mt=Math.ceil(pe),jt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(qe-Ne))),er=Math.min(this.size-this.buffer,Mt+Math.ceil(Ie)),kr=jt+2*this.buffer,Hr=er+2*this.buffer,Vr=Math.max(kr*Hr,0),ki=new Uint8ClampedArray(Vr),Vi={data:ki,width:kr,height:Hr,glyphWidth:jt,glyphHeight:er,glyphTop:Mt,glyphLeft:0,glyphAdvance:O};if(jt===0||er===0)return Vi;let{ctx:tt,buffer:lt,gridInner:Tt,gridOuter:Lt}=this;tt.clearRect(lt,lt,jt,er),tt.fillText(Ke,lt,lt+Mt);let Vt=tt.getImageData(lt,lt,jt,er);Lt.fill(N,0,Vr),Tt.fill(0,0,Vr);for(let Nt=0;Nt0?Zr*Zr:0,Tt[$r]=Zr<0?Zr*Zr:0}}B(Lt,0,0,kr,Hr,kr,this.f,this.v,this.z),B(Tt,lt,lt,jt,er,kr,this.f,this.v,this.z);for(let Nt=0;Nt1&&(er=O[++jt]);let Hr=Math.abs(kr-er.left),Vr=Math.abs(kr-er.right),ki=Math.min(Hr,Vr),Vi,tt=qe/Ie*(Ne+1);if(er.isDash){let lt=Ne-Math.abs(tt);Vi=Math.sqrt(ki*ki+lt*lt)}else Vi=Ne-Math.sqrt(ki*ki+tt*tt);this.data[Mt+kr]=Math.max(0,Math.min(255,Vi+128))}}}addRegularDash(O){for(let jt=O.length-1;jt>=0;--jt){let er=O[jt],kr=O[jt+1];er.zeroLength?O.splice(jt,1):kr&&kr.isDash===er.isDash&&(kr.left=er.left,O.splice(jt,1))}let pe=O[0],Ie=O[O.length-1];pe.isDash===Ie.isDash&&(pe.left=Ie.left-this.width,Ie.right=pe.right+this.width);let Ne=this.width*this.nextRow,qe=0,Mt=O[qe];for(let jt=0;jt1&&(Mt=O[++qe]);let er=Math.abs(jt-Mt.left),kr=Math.abs(jt-Mt.right),Hr=Math.min(er,kr);this.data[Ne+jt]=Math.max(0,Math.min(255,(Mt.isDash?Hr:-Hr)+128))}}addDash(O,pe){let Ie=pe?7:0,Ne=2*Ie+1;if(this.nextRow+Ne>this.height)return n.w("LineAtlas out of space"),null;let qe=0;for(let jt=0;jt{pe.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[he]}numActive(){return Object.keys(this.active).length}}let ve=Math.floor(u.hardwareConcurrency/2),ce,re;function ge(){return ce||(ce=new xe),ce}xe.workerCount=n.C(globalThis)?Math.max(Math.min(ve,3),1):1;class ne{constructor(O,pe){this.workerPool=O,this.actors=[],this.currentActor=0,this.id=pe;let Ie=this.workerPool.acquire(pe);for(let Ne=0;Ne{pe.remove()}),this.actors=[],O&&this.workerPool.release(this.id)}registerMessageHandler(O,pe){for(let Ie of this.actors)Ie.registerMessageHandler(O,pe)}}function se(){return re||(re=new ne(ge(),n.G),re.registerMessageHandler("GR",(Ke,O,pe)=>n.m(O,pe))),re}function _e(Ke,O){let pe=n.H();return n.J(pe,pe,[1,1,0]),n.K(pe,pe,[.5*Ke.width,.5*Ke.height,1]),n.L(pe,pe,Ke.calculatePosMatrix(O.toUnwrapped()))}function oe(Ke,O,pe,Ie,Ne,qe){let Mt=function(Vr,ki,Vi){if(Vr)for(let tt of Vr){let lt=ki[tt];if(lt&<.source===Vi&<.type==="fill-extrusion")return!0}else for(let tt in ki){let lt=ki[tt];if(lt.source===Vi&<.type==="fill-extrusion")return!0}return!1}(Ne&&Ne.layers,O,Ke.id),jt=qe.maxPitchScaleFactor(),er=Ke.tilesIn(Ie,jt,Mt);er.sort(J);let kr=[];for(let Vr of er)kr.push({wrappedTileID:Vr.tileID.wrapped().key,queryResults:Vr.tile.queryRenderedFeatures(O,pe,Ke._state,Vr.queryGeometry,Vr.cameraQueryGeometry,Vr.scale,Ne,qe,jt,_e(Ke.transform,Vr.tileID))});let Hr=function(Vr){let ki={},Vi={};for(let tt of Vr){let lt=tt.queryResults,Tt=tt.wrappedTileID,Lt=Vi[Tt]=Vi[Tt]||{};for(let Vt in lt){let Nt=lt[Vt],Yt=Lt[Vt]=Lt[Vt]||{},Lr=ki[Vt]=ki[Vt]||[];for(let $r of Nt)Yt[$r.featureIndex]||(Yt[$r.featureIndex]=!0,Lr.push($r))}}return ki}(kr);for(let Vr in Hr)Hr[Vr].forEach(ki=>{let Vi=ki.feature,tt=Ke.getFeatureState(Vi.layer["source-layer"],Vi.id);Vi.source=Vi.layer.source,Vi.layer["source-layer"]&&(Vi.sourceLayer=Vi.layer["source-layer"]),Vi.state=tt});return Hr}function J(Ke,O){let pe=Ke.tileID,Ie=O.tileID;return pe.overscaledZ-Ie.overscaledZ||pe.canonical.y-Ie.canonical.y||pe.wrap-Ie.wrap||pe.canonical.x-Ie.canonical.x}function me(Ke,O,pe){return n._(this,void 0,void 0,function*(){let Ie=Ke;if(Ke.url?Ie=(yield n.h(O.transformRequest(Ke.url,"Source"),pe)).data:yield u.frameAsync(pe),!Ie)return null;let Ne=n.M(n.e(Ie,Ke),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Ie&&Ie.vector_layers&&(Ne.vectorLayerIds=Ie.vector_layers.map(qe=>qe.id)),Ne})}class fe{constructor(O,pe){O&&(pe?this.setSouthWest(O).setNorthEast(pe):Array.isArray(O)&&(O.length===4?this.setSouthWest([O[0],O[1]]).setNorthEast([O[2],O[3]]):this.setSouthWest(O[0]).setNorthEast(O[1])))}setNorthEast(O){return this._ne=O instanceof n.N?new n.N(O.lng,O.lat):n.N.convert(O),this}setSouthWest(O){return this._sw=O instanceof n.N?new n.N(O.lng,O.lat):n.N.convert(O),this}extend(O){let pe=this._sw,Ie=this._ne,Ne,qe;if(O instanceof n.N)Ne=O,qe=O;else{if(!(O instanceof fe))return Array.isArray(O)?O.length===4||O.every(Array.isArray)?this.extend(fe.convert(O)):this.extend(n.N.convert(O)):O&&("lng"in O||"lon"in O)&&"lat"in O?this.extend(n.N.convert(O)):this;if(Ne=O._sw,qe=O._ne,!Ne||!qe)return this}return pe||Ie?(pe.lng=Math.min(Ne.lng,pe.lng),pe.lat=Math.min(Ne.lat,pe.lat),Ie.lng=Math.max(qe.lng,Ie.lng),Ie.lat=Math.max(qe.lat,Ie.lat)):(this._sw=new n.N(Ne.lng,Ne.lat),this._ne=new n.N(qe.lng,qe.lat)),this}getCenter(){return new n.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new n.N(this.getWest(),this.getNorth())}getSouthEast(){return new n.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(O){let{lng:pe,lat:Ie}=n.N.convert(O),Ne=this._sw.lng<=pe&&pe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ne=this._sw.lng>=pe&&pe>=this._ne.lng),this._sw.lat<=Ie&&Ie<=this._ne.lat&&Ne}static convert(O){return O instanceof fe?O:O&&new fe(O)}static fromLngLat(O,pe=0){let Ie=360*pe/40075017,Ne=Ie/Math.cos(Math.PI/180*O.lat);return new fe(new n.N(O.lng-Ne,O.lat-Ie),new n.N(O.lng+Ne,O.lat+Ie))}adjustAntiMeridian(){let O=new n.N(this._sw.lng,this._sw.lat),pe=new n.N(this._ne.lng,this._ne.lat);return new fe(O,O.lng>pe.lng?new n.N(pe.lng+360,pe.lat):pe)}}class Ce{constructor(O,pe,Ie){this.bounds=fe.convert(this.validateBounds(O)),this.minzoom=pe||0,this.maxzoom=Ie||24}validateBounds(O){return Array.isArray(O)&&O.length===4?[Math.max(-180,O[0]),Math.max(-90,O[1]),Math.min(180,O[2]),Math.min(90,O[3])]:[-180,-90,180,90]}contains(O){let pe=Math.pow(2,O.z),Ie=Math.floor(n.O(this.bounds.getWest())*pe),Ne=Math.floor(n.Q(this.bounds.getNorth())*pe),qe=Math.ceil(n.O(this.bounds.getEast())*pe),Mt=Math.ceil(n.Q(this.bounds.getSouth())*pe);return O.x>=Ie&&O.x=Ne&&O.y{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return n.e({},this._options)}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ie={request:this.map._requestManager.transformRequest(pe,"Tile"),uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,tileSize:this.tileSize*O.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Ie.request.collectResourceTiming=this._collectResourceTiming;let Ne="RT";if(O.actor&&O.state!=="expired"){if(O.state==="loading")return new Promise((qe,Mt)=>{O.reloadPromise={resolve:qe,reject:Mt}})}else O.actor=this.dispatcher.getActor(),Ne="LT";O.abortController=new AbortController;try{let qe=yield O.actor.sendAsync({type:Ne,data:Ie},O.abortController);if(delete O.abortController,O.aborted)return;this._afterTileLoadWorkerResponse(O,qe)}catch(qe){if(delete O.abortController,O.aborted)return;if(qe&&qe.status!==404)throw qe;this._afterTileLoadWorkerResponse(O,null)}})}_afterTileLoadWorkerResponse(O,pe){if(pe&&pe.resourceTiming&&(O.resourceTiming=pe.resourceTiming),pe&&this.map._refreshExpiredTiles&&O.setExpiryData(pe),O.loadVectorData(pe,this.map.painter),O.reloadPromise){let Ie=O.reloadPromise;O.reloadPromise=null,this.loadTile(O).then(Ie.resolve).catch(Ie.reject)}}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.actor&&(yield O.actor.sendAsync({type:"AT",data:{uid:O.uid,type:this.type,source:this.id}}))})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.unloadVectorData(),O.actor&&(yield O.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Oe extends n.E{constructor(O,pe,Ie,Ne){super(),this.id=O,this.dispatcher=Ie,this.setEventedParent(Ne),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=n.e({type:"raster"},pe),n.e(this,n.M(pe,["url","scheme","tileSize"]))}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let O=yield me(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,O&&(n.e(this,O),O.bounds&&(this.tileBounds=new Ce(O.bounds,this.minzoom,this.maxzoom)),this.fire(new n.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.k("data",{dataType:"source",sourceDataType:"content"})))}catch(O){this._tileJSONRequest=null,this.fire(new n.j(O))}})}loaded(){return this._loaded}onAdd(O){this.map=O,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(O){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),O(),this.load()}setTiles(O){return this.setSourceProperty(()=>{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}serialize(){return n.e({},this._options)}hasTile(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);O.abortController=new AbortController;try{let Ie=yield f.getImage(this.map._requestManager.transformRequest(pe,"Tile"),O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Ie&&Ie.data){this.map._refreshExpiredTiles&&Ie.cacheControl&&Ie.expires&&O.setExpiryData({cacheControl:Ie.cacheControl,expires:Ie.expires});let Ne=this.map.painter.context,qe=Ne.gl,Mt=Ie.data;O.texture=this.map.painter.getTileTexture(Mt.width),O.texture?O.texture.update(Mt,{useMipmap:!0}):(O.texture=new g(Ne,Mt,qe.RGBA,{useMipmap:!0}),O.texture.bind(qe.LINEAR,qe.CLAMP_TO_EDGE,qe.LINEAR_MIPMAP_NEAREST)),O.state="loaded"}}catch(Ie){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Ie)throw O.state="errored",Ie}})}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController)})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.texture&&this.map.painter.saveTileTexture(O.texture)})}hasTransition(){return!1}}class Ze extends Oe{constructor(O,pe,Ie,Ne){super(O,pe,Ie,Ne),this.type="raster-dem",this.maxzoom=22,this._options=n.e({type:"raster-dem"},pe),this.encoding=pe.encoding||"mapbox",this.redFactor=pe.redFactor,this.greenFactor=pe.greenFactor,this.blueFactor=pe.blueFactor,this.baseShift=pe.baseShift}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ie=this.map._requestManager.transformRequest(pe,"Tile");O.neighboringTiles=this._getNeighboringTiles(O.tileID),O.abortController=new AbortController;try{let Ne=yield f.getImage(Ie,O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Ne&&Ne.data){let qe=Ne.data;this.map._refreshExpiredTiles&&Ne.cacheControl&&Ne.expires&&O.setExpiryData({cacheControl:Ne.cacheControl,expires:Ne.expires});let Mt=n.b(qe)&&n.U()?qe:yield this.readImageNow(qe),jt={type:this.type,uid:O.uid,source:this.id,rawImageData:Mt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!O.actor||O.state==="expired"){O.actor=this.dispatcher.getActor();let er=yield O.actor.sendAsync({type:"LDT",data:jt});O.dem=er,O.needsHillshadePrepare=!0,O.needsTerrainPrepare=!0,O.state="loaded"}}}catch(Ne){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Ne)throw O.state="errored",Ne}})}readImageNow(O){return n._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&n.V()){let pe=O.width+2,Ie=O.height+2;try{return new n.R({width:pe,height:Ie},yield n.W(O,-1,-1,pe,Ie))}catch{}}return u.getImageData(O,1)})}_getNeighboringTiles(O){let pe=O.canonical,Ie=Math.pow(2,pe.z),Ne=(pe.x-1+Ie)%Ie,qe=pe.x===0?O.wrap-1:O.wrap,Mt=(pe.x+1+Ie)%Ie,jt=pe.x+1===Ie?O.wrap+1:O.wrap,er={};return er[new n.S(O.overscaledZ,qe,pe.z,Ne,pe.y).key]={backfilled:!1},er[new n.S(O.overscaledZ,jt,pe.z,Mt,pe.y).key]={backfilled:!1},pe.y>0&&(er[new n.S(O.overscaledZ,qe,pe.z,Ne,pe.y-1).key]={backfilled:!1},er[new n.S(O.overscaledZ,O.wrap,pe.z,pe.x,pe.y-1).key]={backfilled:!1},er[new n.S(O.overscaledZ,jt,pe.z,Mt,pe.y-1).key]={backfilled:!1}),pe.y+10&&n.e(qe,{resourceTiming:Ne}),this.fire(new n.k("data",Object.assign(Object.assign({},qe),{sourceDataType:"metadata"}))),this.fire(new n.k("data",Object.assign(Object.assign({},qe),{sourceDataType:"content"})))}catch(Ie){if(this._pendingLoads--,this._removed)return void this.fire(new n.k("dataabort",{dataType:"source"}));this.fire(new n.j(Ie))}})}loaded(){return this._pendingLoads===0}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.actor?"RT":"LT";O.actor=this.actor;let Ie={type:this.type,uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};O.abortController=new AbortController;let Ne=yield this.actor.sendAsync({type:pe,data:Ie},O.abortController);delete O.abortController,O.unloadVectorData(),O.aborted||O.loadVectorData(Ne,this.map.painter,pe==="RT")})}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.aborted=!0})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return n.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var rt=n.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class _t extends n.E{constructor(O,pe,Ie,Ne){super(),this.id=O,this.dispatcher=Ie,this.coordinates=pe.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ne),this.options=pe}load(O){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let pe=yield f.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,pe&&pe.data&&(this.image=pe.data,O&&(this.coordinates=O),this._finishLoading())}catch(pe){this._request=null,this._loaded=!0,this.fire(new n.j(pe))}})}loaded(){return this._loaded}updateImage(O){return O.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=O.url,this.load(O.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(O){this.map=O,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(O){this.coordinates=O;let pe=O.map(n.Z.fromLngLat);this.tileID=function(Ne){let qe=1/0,Mt=1/0,jt=-1/0,er=-1/0;for(let ki of Ne)qe=Math.min(qe,ki.x),Mt=Math.min(Mt,ki.y),jt=Math.max(jt,ki.x),er=Math.max(er,ki.y);let kr=Math.max(jt-qe,er-Mt),Hr=Math.max(0,Math.floor(-Math.log(kr)/Math.LN2)),Vr=Math.pow(2,Hr);return new n.a1(Hr,Math.floor((qe+jt)/2*Vr),Math.floor((Mt+er)/2*Vr))}(pe),this.minzoom=this.maxzoom=this.tileID.z;let Ie=pe.map(Ne=>this.tileID.getTilePoint(Ne)._round());return this._boundsArray=new n.$,this._boundsArray.emplaceBack(Ie[0].x,Ie[0].y,0,0),this._boundsArray.emplaceBack(Ie[1].x,Ie[1].y,n.X,0),this._boundsArray.emplaceBack(Ie[3].x,Ie[3].y,0,n.X),this._boundsArray.emplaceBack(Ie[2].x,Ie[2].y,n.X,n.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new n.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let O=this.map.painter.context,pe=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,rt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new g(O,this.image,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));let Ie=!1;for(let Ne in this.tiles){let qe=this.tiles[Ne];qe.state!=="loaded"&&(qe.state="loaded",qe.texture=this.texture,Ie=!0)}Ie&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(O){return n._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(O.tileID.canonical)?(this.tiles[String(O.tileID.wrap)]=O,O.buckets={}):O.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class pt extends _t{constructor(O,pe,Ie,Ne){super(O,pe,Ie,Ne),this.roundZoom=!0,this.type="video",this.options=pe}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1;let O=this.options;this.urls=[];for(let pe of O.urls)this.urls.push(this.map._requestManager.transformRequest(pe,"Source").url);try{let pe=yield n.a3(this.urls);if(this._loaded=!0,!pe)return;this.video=pe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(pe){this.fire(new n.j(pe))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(O){if(this.video){let pe=this.video.seekable;Ope.end(0)?this.fire(new n.j(new n.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${pe.start(0)} and ${pe.end(0)}-second mark.`))):this.video.currentTime=O}}getVideo(){return this.video}onAdd(O){this.map||(this.map=O,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let O=this.map.painter.context,pe=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,rt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),pe.texSubImage2D(pe.TEXTURE_2D,0,0,0,pe.RGBA,pe.UNSIGNED_BYTE,this.video)):(this.texture=new g(O,this.video,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));let Ie=!1;for(let Ne in this.tiles){let qe=this.tiles[Ne];qe.state!=="loaded"&&(qe.state="loaded",qe.texture=this.texture,Ie=!0)}Ie&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class gt extends _t{constructor(O,pe,Ie,Ne){super(O,pe,Ie,Ne),pe.coordinates?Array.isArray(pe.coordinates)&&pe.coordinates.length===4&&!pe.coordinates.some(qe=>!Array.isArray(qe)||qe.length!==2||qe.some(Mt=>typeof Mt!="number"))||this.fire(new n.j(new n.a2(`sources.${O}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.j(new n.a2(`sources.${O}`,null,'missing required property "coordinates"'))),pe.animate&&typeof pe.animate!="boolean"&&this.fire(new n.j(new n.a2(`sources.${O}`,null,'optional "animate" property must be a boolean value'))),pe.canvas?typeof pe.canvas=="string"||pe.canvas instanceof HTMLCanvasElement||this.fire(new n.j(new n.a2(`sources.${O}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new n.j(new n.a2(`sources.${O}`,null,'missing required property "canvas"'))),this.options=pe,this.animate=pe.animate===void 0||pe.animate}load(){return n._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new n.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(O){this.map=O,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let O=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,O=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,O=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let pe=this.map.painter.context,Ie=pe.gl;this.boundsBuffer||(this.boundsBuffer=pe.createVertexBuffer(this._boundsArray,rt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture?(O||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new g(pe,this.canvas,Ie.RGBA,{premultiply:!0});let Ne=!1;for(let qe in this.tiles){let Mt=this.tiles[qe];Mt.state!=="loaded"&&(Mt.state="loaded",Mt.texture=this.texture,Ne=!0)}Ne&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let O of[this.canvas.width,this.canvas.height])if(isNaN(O)||O<=0)return!0;return!1}}let ct={},Ae=Ke=>{switch(Ke){case"geojson":return Ge;case"image":return _t;case"raster":return Oe;case"raster-dem":return Ze;case"vector":return Be;case"video":return pt;case"canvas":return gt}return ct[Ke]},ze="RTLPluginLoaded";class Ee extends n.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=se()}_syncState(O){return this.status=O,this.dispatcher.broadcast("SRPS",{pluginStatus:O,pluginURL:this.url}).catch(pe=>{throw this.status="error",pe})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(O){return n._(this,arguments,void 0,function*(pe,Ie=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=u.resolveURL(pe),!this.url)throw new Error(`requested url ${pe} is invalid`);if(this.status==="unavailable"){if(!Ie)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return n._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new n.k(ze))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let nt=null;function xt(){return nt||(nt=new Ee),nt}class ut{constructor(O,pe){this.timeAdded=0,this.fadeEndTime=0,this.tileID=O,this.uid=n.a4(),this.uses=0,this.tileSize=pe,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(O){let pe=O+this.timeAdded;peqe.getLayer(kr)).filter(Boolean);if(er.length!==0){jt.layers=er,jt.stateDependentLayerIds&&(jt.stateDependentLayers=jt.stateDependentLayerIds.map(kr=>er.filter(Hr=>Hr.id===kr)[0]));for(let kr of er)Mt[kr.id]=jt}}return Mt}(O.buckets,pe.style),this.hasSymbolBuckets=!1;for(let Ne in this.buckets){let qe=this.buckets[Ne];if(qe instanceof n.a6){if(this.hasSymbolBuckets=!0,!Ie)break;qe.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Ne in this.buckets){let qe=this.buckets[Ne];if(qe instanceof n.a6&&qe.hasRTLText){this.hasRTLText=!0,xt().lazyLoad();break}}this.queryPadding=0;for(let Ne in this.buckets){let qe=this.buckets[Ne];this.queryPadding=Math.max(this.queryPadding,pe.style.getLayer(Ne).queryRadius(qe))}O.imageAtlas&&(this.imageAtlas=O.imageAtlas),O.glyphAtlasImage&&(this.glyphAtlasImage=O.glyphAtlasImage)}else this.collisionBoxArray=new n.a5}unloadVectorData(){for(let O in this.buckets)this.buckets[O].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(O){return this.buckets[O.id]}upload(O){for(let Ie in this.buckets){let Ne=this.buckets[Ie];Ne.uploadPending()&&Ne.upload(O)}let pe=O.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new g(O,this.imageAtlas.image,pe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new g(O,this.glyphAtlasImage,pe.ALPHA),this.glyphAtlasImage=null)}prepare(O){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(O,this.imageAtlasTexture)}queryRenderedFeatures(O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Ne,cameraQueryGeometry:qe,scale:Mt,tileSize:this.tileSize,pixelPosMatrix:Hr,transform:er,params:jt,queryPadding:this.queryPadding*kr},O,pe,Ie):{}}querySourceFeatures(O,pe){let Ie=this.latestFeatureIndex;if(!Ie||!Ie.rawTileData)return;let Ne=Ie.loadVTLayers(),qe=pe&&pe.sourceLayer?pe.sourceLayer:"",Mt=Ne._geojsonTileLayer||Ne[qe];if(!Mt)return;let jt=n.a7(pe&&pe.filter),{z:er,x:kr,y:Hr}=this.tileID.canonical,Vr={z:er,x:kr,y:Hr};for(let ki=0;kiIe)Ne=!1;else if(pe)if(this.expirationTime{this.remove(O,qe)},Ie)),this.data[Ne].push(qe),this.order.push(Ne),this.order.length>this.max){let Mt=this._getAndRemoveByKey(this.order[0]);Mt&&this.onRemove(Mt)}return this}has(O){return O.wrapped().key in this.data}getAndRemove(O){return this.has(O)?this._getAndRemoveByKey(O.wrapped().key):null}_getAndRemoveByKey(O){let pe=this.data[O].shift();return pe.timeout&&clearTimeout(pe.timeout),this.data[O].length===0&&delete this.data[O],this.order.splice(this.order.indexOf(O),1),pe.value}getByKey(O){let pe=this.data[O];return pe?pe[0].value:null}get(O){return this.has(O)?this.data[O.wrapped().key][0].value:null}remove(O,pe){if(!this.has(O))return this;let Ie=O.wrapped().key,Ne=pe===void 0?0:this.data[Ie].indexOf(pe),qe=this.data[Ie][Ne];return this.data[Ie].splice(Ne,1),qe.timeout&&clearTimeout(qe.timeout),this.data[Ie].length===0&&delete this.data[Ie],this.onRemove(qe.value),this.order.splice(this.order.indexOf(Ie),1),this}setMaxSize(O){for(this.max=O;this.order.length>this.max;){let pe=this._getAndRemoveByKey(this.order[0]);pe&&this.onRemove(pe)}return this}filter(O){let pe=[];for(let Ie in this.data)for(let Ne of this.data[Ie])O(Ne.value)||pe.push(Ne);for(let Ie of pe)this.remove(Ie.value.tileID,Ie)}}class Gt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(O,pe,Ie){let Ne=String(pe);if(this.stateChanges[O]=this.stateChanges[O]||{},this.stateChanges[O][Ne]=this.stateChanges[O][Ne]||{},n.e(this.stateChanges[O][Ne],Ie),this.deletedStates[O]===null){this.deletedStates[O]={};for(let qe in this.state[O])qe!==Ne&&(this.deletedStates[O][qe]=null)}else if(this.deletedStates[O]&&this.deletedStates[O][Ne]===null){this.deletedStates[O][Ne]={};for(let qe in this.state[O][Ne])Ie[qe]||(this.deletedStates[O][Ne][qe]=null)}else for(let qe in Ie)this.deletedStates[O]&&this.deletedStates[O][Ne]&&this.deletedStates[O][Ne][qe]===null&&delete this.deletedStates[O][Ne][qe]}removeFeatureState(O,pe,Ie){if(this.deletedStates[O]===null)return;let Ne=String(pe);if(this.deletedStates[O]=this.deletedStates[O]||{},Ie&&pe!==void 0)this.deletedStates[O][Ne]!==null&&(this.deletedStates[O][Ne]=this.deletedStates[O][Ne]||{},this.deletedStates[O][Ne][Ie]=null);else if(pe!==void 0)if(this.stateChanges[O]&&this.stateChanges[O][Ne])for(Ie in this.deletedStates[O][Ne]={},this.stateChanges[O][Ne])this.deletedStates[O][Ne][Ie]=null;else this.deletedStates[O][Ne]=null;else this.deletedStates[O]=null}getState(O,pe){let Ie=String(pe),Ne=n.e({},(this.state[O]||{})[Ie],(this.stateChanges[O]||{})[Ie]);if(this.deletedStates[O]===null)return{};if(this.deletedStates[O]){let qe=this.deletedStates[O][pe];if(qe===null)return{};for(let Mt in qe)delete Ne[Mt]}return Ne}initializeTileState(O,pe){O.setFeatureState(this.state,pe)}coalesceChanges(O,pe){let Ie={};for(let Ne in this.stateChanges){this.state[Ne]=this.state[Ne]||{};let qe={};for(let Mt in this.stateChanges[Ne])this.state[Ne][Mt]||(this.state[Ne][Mt]={}),n.e(this.state[Ne][Mt],this.stateChanges[Ne][Mt]),qe[Mt]=this.state[Ne][Mt];Ie[Ne]=qe}for(let Ne in this.deletedStates){this.state[Ne]=this.state[Ne]||{};let qe={};if(this.deletedStates[Ne]===null)for(let Mt in this.state[Ne])qe[Mt]={},this.state[Ne][Mt]={};else for(let Mt in this.deletedStates[Ne]){if(this.deletedStates[Ne][Mt]===null)this.state[Ne][Mt]={};else for(let jt of Object.keys(this.deletedStates[Ne][Mt]))delete this.state[Ne][Mt][jt];qe[Mt]=this.state[Ne][Mt]}Ie[Ne]=Ie[Ne]||{},n.e(Ie[Ne],qe)}if(this.stateChanges={},this.deletedStates={},Object.keys(Ie).length!==0)for(let Ne in O)O[Ne].setFeatureState(Ie,pe)}}class Jt extends n.E{constructor(O,pe,Ie){super(),this.id=O,this.dispatcher=Ie,this.on("data",Ne=>this._dataHandler(Ne)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Ne,qe,Mt,jt)=>{let er=new(Ae(qe.type))(Ne,qe,Mt,jt);if(er.id!==Ne)throw new Error(`Expected Source id to be ${Ne} instead of ${er.id}`);return er})(O,pe,Ie,this),this._tiles={},this._cache=new Et(0,Ne=>this._unloadTile(Ne)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Gt,this._didEmitContent=!1,this._updated=!1}onAdd(O){this.map=O,this._maxTileCacheSize=O?O._maxTileCacheSize:null,this._maxTileCacheZoomLevels=O?O._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(O)}onRemove(O){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(O)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let O in this._tiles){let pe=this._tiles[O];if(pe.state!=="loaded"&&pe.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let O=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,O&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(O,pe,Ie){return n._(this,void 0,void 0,function*(){try{yield this._source.loadTile(O),this._tileLoaded(O,pe,Ie)}catch(Ne){O.state="errored",Ne.status!==404?this._source.fire(new n.j(Ne,{tile:O})):this.update(this.transform,this.terrain)}})}_unloadTile(O){this._source.unloadTile&&this._source.unloadTile(O)}_abortTile(O){this._source.abortTile&&this._source.abortTile(O),this._source.fire(new n.k("dataabort",{tile:O,coord:O.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(O){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let pe in this._tiles){let Ie=this._tiles[pe];Ie.upload(O),Ie.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(O=>O.tileID).sort(gr).map(O=>O.key)}getRenderableIds(O){let pe=[];for(let Ie in this._tiles)this._isIdRenderable(Ie,O)&&pe.push(this._tiles[Ie]);return O?pe.sort((Ie,Ne)=>{let qe=Ie.tileID,Mt=Ne.tileID,jt=new n.P(qe.canonical.x,qe.canonical.y)._rotate(this.transform.angle),er=new n.P(Mt.canonical.x,Mt.canonical.y)._rotate(this.transform.angle);return qe.overscaledZ-Mt.overscaledZ||er.y-jt.y||er.x-jt.x}).map(Ie=>Ie.tileID.key):pe.map(Ie=>Ie.tileID).sort(gr).map(Ie=>Ie.key)}hasRenderableParent(O){let pe=this.findLoadedParent(O,0);return!!pe&&this._isIdRenderable(pe.tileID.key)}_isIdRenderable(O,pe){return this._tiles[O]&&this._tiles[O].hasData()&&!this._coveredTiles[O]&&(pe||!this._tiles[O].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let O in this._tiles)this._tiles[O].state!=="errored"&&this._reloadTile(O,"reloading")}}_reloadTile(O,pe){return n._(this,void 0,void 0,function*(){let Ie=this._tiles[O];Ie&&(Ie.state!=="loading"&&(Ie.state=pe),yield this._loadTile(Ie,O,pe))})}_tileLoaded(O,pe,Ie){O.timeAdded=u.now(),Ie==="expired"&&(O.refreshedUponExpiration=!0),this._setTileReloadTimer(pe,O),this.getSource().type==="raster-dem"&&O.dem&&this._backfillDEM(O),this._state.initializeTileState(O,this.map?this.map.painter:null),O.aborted||this._source.fire(new n.k("data",{dataType:"source",tile:O,coord:O.tileID}))}_backfillDEM(O){let pe=this.getRenderableIds();for(let Ne=0;Ne1||(Math.abs(Mt)>1&&(Math.abs(Mt+er)===1?Mt+=er:Math.abs(Mt-er)===1&&(Mt-=er)),qe.dem&&Ne.dem&&(Ne.dem.backfillBorder(qe.dem,Mt,jt),Ne.neighboringTiles&&Ne.neighboringTiles[kr]&&(Ne.neighboringTiles[kr].backfilled=!0)))}}getTile(O){return this.getTileByID(O.key)}getTileByID(O){return this._tiles[O]}_retainLoadedChildren(O,pe,Ie,Ne){for(let qe in this._tiles){let Mt=this._tiles[qe];if(Ne[qe]||!Mt.hasData()||Mt.tileID.overscaledZ<=pe||Mt.tileID.overscaledZ>Ie)continue;let jt=Mt.tileID;for(;Mt&&Mt.tileID.overscaledZ>pe+1;){let kr=Mt.tileID.scaledTo(Mt.tileID.overscaledZ-1);Mt=this._tiles[kr.key],Mt&&Mt.hasData()&&(jt=kr)}let er=jt;for(;er.overscaledZ>pe;)if(er=er.scaledTo(er.overscaledZ-1),O[er.key]){Ne[jt.key]=jt;break}}}findLoadedParent(O,pe){if(O.key in this._loadedParentTiles){let Ie=this._loadedParentTiles[O.key];return Ie&&Ie.tileID.overscaledZ>=pe?Ie:null}for(let Ie=O.overscaledZ-1;Ie>=pe;Ie--){let Ne=O.scaledTo(Ie),qe=this._getLoadedTile(Ne);if(qe)return qe}}findLoadedSibling(O){return this._getLoadedTile(O)}_getLoadedTile(O){let pe=this._tiles[O.key];return pe&&pe.hasData()?pe:this._cache.getByKey(O.wrapped().key)}updateCacheSize(O){let pe=Math.ceil(O.width/this._source.tileSize)+1,Ie=Math.ceil(O.height/this._source.tileSize)+1,Ne=Math.floor(pe*Ie*(this._maxTileCacheZoomLevels===null?n.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),qe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Ne):Ne;this._cache.setMaxSize(qe)}handleWrapJump(O){let pe=Math.round((O-(this._prevLng===void 0?O:this._prevLng))/360);if(this._prevLng=O,pe){let Ie={};for(let Ne in this._tiles){let qe=this._tiles[Ne];qe.tileID=qe.tileID.unwrapTo(qe.tileID.wrap+pe),Ie[qe.tileID.key]=qe}this._tiles=Ie;for(let Ne in this._timers)clearTimeout(this._timers[Ne]),delete this._timers[Ne];for(let Ne in this._tiles)this._setTileReloadTimer(Ne,this._tiles[Ne])}}_updateCoveredAndRetainedTiles(O,pe,Ie,Ne,qe,Mt){let jt={},er={},kr=Object.keys(O),Hr=u.now();for(let Vr of kr){let ki=O[Vr],Vi=this._tiles[Vr];if(!Vi||Vi.fadeEndTime!==0&&Vi.fadeEndTime<=Hr)continue;let tt=this.findLoadedParent(ki,pe),lt=this.findLoadedSibling(ki),Tt=tt||lt||null;Tt&&(this._addTile(Tt.tileID),jt[Tt.tileID.key]=Tt.tileID),er[Vr]=ki}this._retainLoadedChildren(er,Ne,Ie,O);for(let Vr in jt)O[Vr]||(this._coveredTiles[Vr]=!0,O[Vr]=jt[Vr]);if(Mt){let Vr={},ki={};for(let Vi of qe)this._tiles[Vi.key].hasData()?Vr[Vi.key]=Vi:ki[Vi.key]=Vi;for(let Vi in ki){let tt=ki[Vi].children(this._source.maxzoom);this._tiles[tt[0].key]&&this._tiles[tt[1].key]&&this._tiles[tt[2].key]&&this._tiles[tt[3].key]&&(Vr[tt[0].key]=O[tt[0].key]=tt[0],Vr[tt[1].key]=O[tt[1].key]=tt[1],Vr[tt[2].key]=O[tt[2].key]=tt[2],Vr[tt[3].key]=O[tt[3].key]=tt[3],delete ki[Vi])}for(let Vi in ki){let tt=ki[Vi],lt=this.findLoadedParent(tt,this._source.minzoom),Tt=this.findLoadedSibling(tt),Lt=lt||Tt||null;if(Lt){Vr[Lt.tileID.key]=O[Lt.tileID.key]=Lt.tileID;for(let Vt in Vr)Vr[Vt].isChildOf(Lt.tileID)&&delete Vr[Vt]}}for(let Vi in this._tiles)Vr[Vi]||(this._coveredTiles[Vi]=!0)}}update(O,pe){if(!this._sourceLoaded||this._paused)return;let Ie;this.transform=O,this.terrain=pe,this.updateCacheSize(O),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Ie=O.getVisibleUnwrappedCoordinates(this._source.tileID).map(Hr=>new n.S(Hr.canonical.z,Hr.wrap,Hr.canonical.z,Hr.canonical.x,Hr.canonical.y)):(Ie=O.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:pe}),this._source.hasTile&&(Ie=Ie.filter(Hr=>this._source.hasTile(Hr)))):Ie=[];let Ne=O.coveringZoomLevel(this._source),qe=Math.max(Ne-Jt.maxOverzooming,this._source.minzoom),Mt=Math.max(Ne+Jt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Hr={};for(let Vr of Ie)if(Vr.canonical.z>this._source.minzoom){let ki=Vr.scaledTo(Vr.canonical.z-1);Hr[ki.key]=ki;let Vi=Vr.scaledTo(Math.max(this._source.minzoom,Math.min(Vr.canonical.z,5)));Hr[Vi.key]=Vi}Ie=Ie.concat(Object.values(Hr))}let jt=Ie.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,jt&&this.fire(new n.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let er=this._updateRetainedTiles(Ie,Ne);mr(this._source.type)&&this._updateCoveredAndRetainedTiles(er,qe,Mt,Ne,Ie,pe);for(let Hr in er)this._tiles[Hr].clearFadeHold();let kr=n.ab(this._tiles,er);for(let Hr of kr){let Vr=this._tiles[Hr];Vr.hasSymbolBuckets&&!Vr.holdingForFade()?Vr.setHoldDuration(this.map._fadeDuration):Vr.hasSymbolBuckets&&!Vr.symbolFadeFinished()||this._removeTile(Hr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let O in this._tiles)this._tiles[O].holdingForFade()&&this._removeTile(O)}_updateRetainedTiles(O,pe){var Ie;let Ne={},qe={},Mt=Math.max(pe-Jt.maxOverzooming,this._source.minzoom),jt=Math.max(pe+Jt.maxUnderzooming,this._source.minzoom),er={};for(let kr of O){let Hr=this._addTile(kr);Ne[kr.key]=kr,Hr.hasData()||pethis._source.maxzoom){let ki=kr.children(this._source.maxzoom)[0],Vi=this.getTile(ki);if(Vi&&Vi.hasData()){Ne[ki.key]=ki;continue}}else{let ki=kr.children(this._source.maxzoom);if(Ne[ki[0].key]&&Ne[ki[1].key]&&Ne[ki[2].key]&&Ne[ki[3].key])continue}let Vr=Hr.wasRequested();for(let ki=kr.overscaledZ-1;ki>=Mt;--ki){let Vi=kr.scaledTo(ki);if(qe[Vi.key])break;if(qe[Vi.key]=!0,Hr=this.getTile(Vi),!Hr&&Vr&&(Hr=this._addTile(Vi)),Hr){let tt=Hr.hasData();if((tt||!(!((Ie=this.map)===null||Ie===void 0)&&Ie.cancelPendingTileRequestsWhileZooming)||Vr)&&(Ne[Vi.key]=Vi),Vr=Hr.wasRequested(),tt)break}}}return Ne}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let O in this._tiles){let pe=[],Ie,Ne=this._tiles[O].tileID;for(;Ne.overscaledZ>0;){if(Ne.key in this._loadedParentTiles){Ie=this._loadedParentTiles[Ne.key];break}pe.push(Ne.key);let qe=Ne.scaledTo(Ne.overscaledZ-1);if(Ie=this._getLoadedTile(qe),Ie)break;Ne=qe}for(let qe of pe)this._loadedParentTiles[qe]=Ie}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let O in this._tiles){let pe=this._tiles[O].tileID,Ie=this._getLoadedTile(pe);this._loadedSiblingTiles[pe.key]=Ie}}_addTile(O){let pe=this._tiles[O.key];if(pe)return pe;pe=this._cache.getAndRemove(O),pe&&(this._setTileReloadTimer(O.key,pe),pe.tileID=O,this._state.initializeTileState(pe,this.map?this.map.painter:null),this._cacheTimers[O.key]&&(clearTimeout(this._cacheTimers[O.key]),delete this._cacheTimers[O.key],this._setTileReloadTimer(O.key,pe)));let Ie=pe;return pe||(pe=new ut(O,this._source.tileSize*O.overscaleFactor()),this._loadTile(pe,O.key,pe.state)),pe.uses++,this._tiles[O.key]=pe,Ie||this._source.fire(new n.k("dataloading",{tile:pe,coord:pe.tileID,dataType:"source"})),pe}_setTileReloadTimer(O,pe){O in this._timers&&(clearTimeout(this._timers[O]),delete this._timers[O]);let Ie=pe.getExpiryTimeout();Ie&&(this._timers[O]=setTimeout(()=>{this._reloadTile(O,"expired"),delete this._timers[O]},Ie))}_removeTile(O){let pe=this._tiles[O];pe&&(pe.uses--,delete this._tiles[O],this._timers[O]&&(clearTimeout(this._timers[O]),delete this._timers[O]),pe.uses>0||(pe.hasData()&&pe.state!=="reloading"?this._cache.add(pe.tileID,pe,pe.getExpiryTimeout()):(pe.aborted=!0,this._abortTile(pe),this._unloadTile(pe))))}_dataHandler(O){let pe=O.sourceDataType;O.dataType==="source"&&pe==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&O.dataType==="source"&&pe==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let O in this._tiles)this._removeTile(O);this._cache.reset()}tilesIn(O,pe,Ie){let Ne=[],qe=this.transform;if(!qe)return Ne;let Mt=Ie?qe.getCameraQueryGeometry(O):O,jt=O.map(tt=>qe.pointCoordinate(tt,this.terrain)),er=Mt.map(tt=>qe.pointCoordinate(tt,this.terrain)),kr=this.getIds(),Hr=1/0,Vr=1/0,ki=-1/0,Vi=-1/0;for(let tt of er)Hr=Math.min(Hr,tt.x),Vr=Math.min(Vr,tt.y),ki=Math.max(ki,tt.x),Vi=Math.max(Vi,tt.y);for(let tt=0;tt=0&&Nt[1].y+Vt>=0){let Yt=jt.map($r=>Tt.getTilePoint($r)),Lr=er.map($r=>Tt.getTilePoint($r));Ne.push({tile:lt,tileID:Tt,queryGeometry:Yt,cameraQueryGeometry:Lr,scale:Lt})}}return Ne}getVisibleCoordinates(O){let pe=this.getRenderableIds(O).map(Ie=>this._tiles[Ie].tileID);for(let Ie of pe)Ie.posMatrix=this.transform.calculatePosMatrix(Ie.toUnwrapped());return pe}hasTransition(){if(this._source.hasTransition())return!0;if(mr(this._source.type)){let O=u.now();for(let pe in this._tiles)if(this._tiles[pe].fadeEndTime>=O)return!0}return!1}setFeatureState(O,pe,Ie){this._state.updateState(O=O||"_geojsonTileLayer",pe,Ie)}removeFeatureState(O,pe,Ie){this._state.removeFeatureState(O=O||"_geojsonTileLayer",pe,Ie)}getFeatureState(O,pe){return this._state.getState(O=O||"_geojsonTileLayer",pe)}setDependencies(O,pe,Ie){let Ne=this._tiles[O];Ne&&Ne.setDependencies(pe,Ie)}reloadTilesForDependencies(O,pe){for(let Ie in this._tiles)this._tiles[Ie].hasDependency(O,pe)&&this._reloadTile(Ie,"reloading");this._cache.filter(Ie=>!Ie.hasDependency(O,pe))}}function gr(Ke,O){let pe=Math.abs(2*Ke.wrap)-+(Ke.wrap<0),Ie=Math.abs(2*O.wrap)-+(O.wrap<0);return Ke.overscaledZ-O.overscaledZ||Ie-pe||O.canonical.y-Ke.canonical.y||O.canonical.x-Ke.canonical.x}function mr(Ke){return Ke==="raster"||Ke==="image"||Ke==="video"}Jt.maxOverzooming=10,Jt.maxUnderzooming=3;class Kr{constructor(O,pe){this.reset(O,pe)}reset(O,pe){this.points=O||[],this._distances=[0];for(let Ie=1;Ie0?(Ne-Mt)/jt:0;return this.points[qe].mult(1-er).add(this.points[pe].mult(er))}}function ri(Ke,O){let pe=!0;return Ke==="always"||Ke!=="never"&&O!=="never"||(pe=!1),pe}class Mr{constructor(O,pe,Ie){let Ne=this.boxCells=[],qe=this.circleCells=[];this.xCellCount=Math.ceil(O/Ie),this.yCellCount=Math.ceil(pe/Ie);for(let Mt=0;Mtthis.width||Ne<0||pe>this.height)return[];let er=[];if(O<=0&&pe<=0&&this.width<=Ie&&this.height<=Ne){if(qe)return[{key:null,x1:O,y1:pe,x2:Ie,y2:Ne}];for(let kr=0;kr0}hitTestCircle(O,pe,Ie,Ne,qe){let Mt=O-Ie,jt=O+Ie,er=pe-Ie,kr=pe+Ie;if(jt<0||Mt>this.width||kr<0||er>this.height)return!1;let Hr=[];return this._forEachCell(Mt,er,jt,kr,this._queryCellCircle,Hr,{hitTest:!0,overlapMode:Ne,circle:{x:O,y:pe,radius:Ie},seenUids:{box:{},circle:{}}},qe),Hr.length>0}_queryCell(O,pe,Ie,Ne,qe,Mt,jt,er){let{seenUids:kr,hitTest:Hr,overlapMode:Vr}=jt,ki=this.boxCells[qe];if(ki!==null){let tt=this.bboxes;for(let lt of ki)if(!kr.box[lt]){kr.box[lt]=!0;let Tt=4*lt,Lt=this.boxKeys[lt];if(O<=tt[Tt+2]&&pe<=tt[Tt+3]&&Ie>=tt[Tt+0]&&Ne>=tt[Tt+1]&&(!er||er(Lt))&&(!Hr||!ri(Vr,Lt.overlapMode))&&(Mt.push({key:Lt,x1:tt[Tt],y1:tt[Tt+1],x2:tt[Tt+2],y2:tt[Tt+3]}),Hr))return!0}}let Vi=this.circleCells[qe];if(Vi!==null){let tt=this.circles;for(let lt of Vi)if(!kr.circle[lt]){kr.circle[lt]=!0;let Tt=3*lt,Lt=this.circleKeys[lt];if(this._circleAndRectCollide(tt[Tt],tt[Tt+1],tt[Tt+2],O,pe,Ie,Ne)&&(!er||er(Lt))&&(!Hr||!ri(Vr,Lt.overlapMode))){let Vt=tt[Tt],Nt=tt[Tt+1],Yt=tt[Tt+2];if(Mt.push({key:Lt,x1:Vt-Yt,y1:Nt-Yt,x2:Vt+Yt,y2:Nt+Yt}),Hr)return!0}}}return!1}_queryCellCircle(O,pe,Ie,Ne,qe,Mt,jt,er){let{circle:kr,seenUids:Hr,overlapMode:Vr}=jt,ki=this.boxCells[qe];if(ki!==null){let tt=this.bboxes;for(let lt of ki)if(!Hr.box[lt]){Hr.box[lt]=!0;let Tt=4*lt,Lt=this.boxKeys[lt];if(this._circleAndRectCollide(kr.x,kr.y,kr.radius,tt[Tt+0],tt[Tt+1],tt[Tt+2],tt[Tt+3])&&(!er||er(Lt))&&!ri(Vr,Lt.overlapMode))return Mt.push(!0),!0}}let Vi=this.circleCells[qe];if(Vi!==null){let tt=this.circles;for(let lt of Vi)if(!Hr.circle[lt]){Hr.circle[lt]=!0;let Tt=3*lt,Lt=this.circleKeys[lt];if(this._circlesCollide(tt[Tt],tt[Tt+1],tt[Tt+2],kr.x,kr.y,kr.radius)&&(!er||er(Lt))&&!ri(Vr,Lt.overlapMode))return Mt.push(!0),!0}}}_forEachCell(O,pe,Ie,Ne,qe,Mt,jt,er){let kr=this._convertToXCellCoord(O),Hr=this._convertToYCellCoord(pe),Vr=this._convertToXCellCoord(Ie),ki=this._convertToYCellCoord(Ne);for(let Vi=kr;Vi<=Vr;Vi++)for(let tt=Hr;tt<=ki;tt++)if(qe.call(this,O,pe,Ie,Ne,this.xCellCount*tt+Vi,Mt,jt,er))return}_convertToXCellCoord(O){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(O*this.xScale)))}_convertToYCellCoord(O){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(O*this.yScale)))}_circlesCollide(O,pe,Ie,Ne,qe,Mt){let jt=Ne-O,er=qe-pe,kr=Ie+Mt;return kr*kr>jt*jt+er*er}_circleAndRectCollide(O,pe,Ie,Ne,qe,Mt,jt){let er=(Mt-Ne)/2,kr=Math.abs(O-(Ne+er));if(kr>er+Ie)return!1;let Hr=(jt-qe)/2,Vr=Math.abs(pe-(qe+Hr));if(Vr>Hr+Ie)return!1;if(kr<=er||Vr<=Hr)return!0;let ki=kr-er,Vi=Vr-Hr;return ki*ki+Vi*Vi<=Ie*Ie}}function ui(Ke,O,pe,Ie,Ne){let qe=n.H();return O?(n.K(qe,qe,[1/Ne,1/Ne,1]),pe||n.ad(qe,qe,Ie.angle)):n.L(qe,Ie.labelPlaneMatrix,Ke),qe}function mi(Ke,O,pe,Ie,Ne){if(O){let qe=n.ae(Ke);return n.K(qe,qe,[Ne,Ne,1]),pe||n.ad(qe,qe,-Ie.angle),qe}return Ie.glCoordMatrix}function Ot(Ke,O,pe,Ie){let Ne;Ie?(Ne=[Ke,O,Ie(Ke,O),1],n.af(Ne,Ne,pe)):(Ne=[Ke,O,0,1],br(Ne,Ne,pe));let qe=Ne[3];return{point:new n.P(Ne[0]/qe,Ne[1]/qe),signedDistanceFromCamera:qe,isOccluded:!1}}function Je(Ke,O){return .5+Ke/O*.5}function ot(Ke,O){return Ke.x>=-O[0]&&Ke.x<=O[0]&&Ke.y>=-O[1]&&Ke.y<=O[1]}function De(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi,tt){let lt=Ie?Ke.textSizeData:Ke.iconSizeData,Tt=n.ag(lt,pe.transform.zoom),Lt=[256/pe.width*2+1,256/pe.height*2+1],Vt=Ie?Ke.text.dynamicLayoutVertexArray:Ke.icon.dynamicLayoutVertexArray;Vt.clear();let Nt=Ke.lineVertexArray,Yt=Ie?Ke.text.placedSymbolArray:Ke.icon.placedSymbolArray,Lr=pe.transform.width/pe.transform.height,$r=!1;for(let Zr=0;ZrMath.abs(pe.x-O.x)*Ie?{useVertical:!0}:(Ke===n.ah.vertical?O.ype.x)?{needsFlipping:!0}:null}function He(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr){let Vr=pe/24,ki=O.lineOffsetX*Vr,Vi=O.lineOffsetY*Vr,tt;if(O.numGlyphs>1){let lt=O.glyphStartIndex+O.numGlyphs,Tt=O.lineStartIndex,Lt=O.lineStartIndex+O.lineLength,Vt=ye(Vr,jt,ki,Vi,Ie,O,Hr,Ke);if(!Vt)return{notEnoughRoom:!0};let Nt=Ot(Vt.first.point.x,Vt.first.point.y,Mt,Ke.getElevation).point,Yt=Ot(Vt.last.point.x,Vt.last.point.y,Mt,Ke.getElevation).point;if(Ne&&!Ie){let Lr=Pe(O.writingMode,Nt,Yt,kr);if(Lr)return Lr}tt=[Vt.first];for(let Lr=O.glyphStartIndex+1;Lr0?Nt.point:function($r,Zr,di,zi,Ki,nn){return at($r,Zr,di,1,Ki,nn)}(Ke.tileAnchorPoint,Vt,Tt,0,qe,Ke),Lr=Pe(O.writingMode,Tt,Yt,kr);if(Lr)return Lr}let lt=hr(Vr*jt.getoffsetX(O.glyphStartIndex),ki,Vi,Ie,O.segment,O.lineStartIndex,O.lineStartIndex+O.lineLength,Ke,Hr);if(!lt||Ke.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};tt=[lt]}for(let lt of tt)n.aj(er,lt.point,lt.angle);return{}}function at(Ke,O,pe,Ie,Ne,qe){let Mt=Ke.add(Ke.sub(O)._unit()),jt=Ne!==void 0?Ot(Mt.x,Mt.y,Ne,qe.getElevation).point:At(Mt.x,Mt.y,qe).point,er=pe.sub(jt);return pe.add(er._mult(Ie/er.mag()))}function ht(Ke,O,pe){let Ie=O.projectionCache;if(Ie.projections[Ke])return Ie.projections[Ke];let Ne=new n.P(O.lineVertexArray.getx(Ke),O.lineVertexArray.gety(Ke)),qe=At(Ne.x,Ne.y,O);if(qe.signedDistanceFromCamera>0)return Ie.projections[Ke]=qe.point,Ie.anyProjectionOccluded=Ie.anyProjectionOccluded||qe.isOccluded,qe.point;let Mt=Ke-pe.direction;return function(jt,er,kr,Hr,Vr){return at(jt,er,kr,Hr,void 0,Vr)}(pe.distanceFromAnchor===0?O.tileAnchorPoint:new n.P(O.lineVertexArray.getx(Mt),O.lineVertexArray.gety(Mt)),Ne,pe.previousVertex,pe.absOffsetX-pe.distanceFromAnchor+1,O)}function At(Ke,O,pe){let Ie=Ke+pe.translation[0],Ne=O+pe.translation[1],qe;return!pe.pitchWithMap&&pe.projection.useSpecialProjectionForSymbols?(qe=pe.projection.projectTileCoordinates(Ie,Ne,pe.unwrappedTileID,pe.getElevation),qe.point.x=(.5*qe.point.x+.5)*pe.width,qe.point.y=(.5*-qe.point.y+.5)*pe.height):(qe=Ot(Ie,Ne,pe.labelPlaneMatrix,pe.getElevation),qe.isOccluded=!1),qe}function Wt(Ke,O,pe){return Ke._unit()._perp()._mult(O*pe)}function Kt(Ke,O,pe,Ie,Ne,qe,Mt,jt,er){if(jt.projectionCache.offsets[Ke])return jt.projectionCache.offsets[Ke];let kr=pe.add(O);if(Ke+er.direction=Ne)return jt.projectionCache.offsets[Ke]=kr,kr;let Hr=ht(Ke+er.direction,jt,er),Vr=Wt(Hr.sub(pe),Mt,er.direction),ki=pe.add(Vr),Vi=Hr.add(Vr);return jt.projectionCache.offsets[Ke]=n.ak(qe,kr,ki,Vi)||kr,jt.projectionCache.offsets[Ke]}function hr(Ke,O,pe,Ie,Ne,qe,Mt,jt,er){let kr=Ie?Ke-O:Ke+O,Hr=kr>0?1:-1,Vr=0;Ie&&(Hr*=-1,Vr=Math.PI),Hr<0&&(Vr+=Math.PI);let ki,Vi=Hr>0?qe+Ne:qe+Ne+1;jt.projectionCache.cachedAnchorPoint?ki=jt.projectionCache.cachedAnchorPoint:(ki=At(jt.tileAnchorPoint.x,jt.tileAnchorPoint.y,jt).point,jt.projectionCache.cachedAnchorPoint=ki);let tt,lt,Tt=ki,Lt=ki,Vt=0,Nt=0,Yt=Math.abs(kr),Lr=[],$r;for(;Vt+Nt<=Yt;){if(Vi+=Hr,Vi=Mt)return null;Vt+=Nt,Lt=Tt,lt=tt;let zi={absOffsetX:Yt,direction:Hr,distanceFromAnchor:Vt,previousVertex:Lt};if(Tt=ht(Vi,jt,zi),pe===0)Lr.push(Lt),$r=Tt.sub(Lt);else{let Ki,nn=Tt.sub(Lt);Ki=nn.mag()===0?Wt(ht(Vi+Hr,jt,zi).sub(Tt),pe,Hr):Wt(nn,pe,Hr),lt||(lt=Lt.add(Ki)),tt=Kt(Vi,Ki,Tt,qe,Mt,lt,pe,jt,zi),Lr.push(lt),$r=tt.sub(lt)}Nt=$r.mag()}let Zr=$r._mult((Yt-Vt)/Nt)._add(lt||Lt),di=Vr+Math.atan2(Tt.y-Lt.y,Tt.x-Lt.x);return Lr.push(Zr),{point:Zr,angle:er?di:0,path:Lr}}let zr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dr(Ke,O){for(let pe=0;pe=1;Bo--)Ba.push(Sa.path[Bo]);for(let Bo=1;Bo_s.signedDistanceFromCamera<=0)?[]:Bo.map(_s=>_s.point)}let Go=[];if(Ba.length>0){let Bo=Ba[0].clone(),_s=Ba[0].clone();for(let wl=1;wl=nn.x&&_s.x<=kn.x&&Bo.y>=nn.y&&_s.y<=kn.y?[Ba]:_s.xkn.x||_s.ykn.y?[]:n.al([Ba],nn.x,nn.y,kn.x,kn.y)}for(let Bo of Go){Jn.reset(Bo,.25*Ki);let _s=0;_s=Jn.length<=.5*Ki?1:Math.ceil(Jn.paddedLength/xo)+1;for(let wl=0;wl<_s;wl++){let Al=wl/Math.max(_s-1,1),Us=Jn.lerp(Al),Pl=Us.x+hi,Ru=Us.y+hi;Lt.push(Pl,Ru,Ki,0);let Tu=Pl-Ki,Js=Ru-Ki,Qs=Pl+Ki,nc=Ru+Ki;if(zi=zi&&this.isOffscreen(Tu,Js,Qs,nc),di=di||this.isInsideGrid(Tu,Js,Qs,nc),O!=="always"&&this.grid.hitTestCircle(Pl,Ru,Ki,O,ki)&&(Zr=!0,!Hr))return{circles:[],offscreen:!1,collisionDetected:Zr}}}}return{circles:!Hr&&Zr||!di||NtOt(Ne.x,Ne.y,Ie,pe.getElevation))}queryRenderedSymbols(O){if(O.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let pe=[],Ie=1/0,Ne=1/0,qe=-1/0,Mt=-1/0;for(let Hr of O){let Vr=new n.P(Hr.x+hi,Hr.y+hi);Ie=Math.min(Ie,Vr.x),Ne=Math.min(Ne,Vr.y),qe=Math.max(qe,Vr.x),Mt=Math.max(Mt,Vr.y),pe.push(Vr)}let jt=this.grid.query(Ie,Ne,qe,Mt).concat(this.ignoredGrid.query(Ie,Ne,qe,Mt)),er={},kr={};for(let Hr of jt){let Vr=Hr.key;if(er[Vr.bucketInstanceId]===void 0&&(er[Vr.bucketInstanceId]={}),er[Vr.bucketInstanceId][Vr.featureIndex])continue;let ki=[new n.P(Hr.x1,Hr.y1),new n.P(Hr.x2,Hr.y1),new n.P(Hr.x2,Hr.y2),new n.P(Hr.x1,Hr.y2)];n.am(pe,ki)&&(er[Vr.bucketInstanceId][Vr.featureIndex]=!0,kr[Vr.bucketInstanceId]===void 0&&(kr[Vr.bucketInstanceId]=[]),kr[Vr.bucketInstanceId].push(Vr.featureIndex))}return kr}insertCollisionBox(O,pe,Ie,Ne,qe,Mt){(Ie?this.ignoredGrid:this.grid).insert({bucketInstanceId:Ne,featureIndex:qe,collisionGroupID:Mt,overlapMode:pe},O[0],O[1],O[2],O[3])}insertCollisionCircles(O,pe,Ie,Ne,qe,Mt){let jt=Ie?this.ignoredGrid:this.grid,er={bucketInstanceId:Ne,featureIndex:qe,collisionGroupID:Mt,overlapMode:pe};for(let kr=0;kr=this.screenRightBoundary||Nethis.screenBottomBoundary}isInsideGrid(O,pe,Ie,Ne){return Ie>=0&&O=0&&pethis.projectAndGetPerspectiveRatio(Ie,Ki.x,Ki.y,Ne,kr));di=zi.some(Ki=>!Ki.isOccluded),Zr=zi.map(Ki=>Ki.point)}else di=!0;return{box:n.ao(Zr),allPointsOccluded:!di}}}function cn(Ke,O,pe){return O*(n.X/(Ke.tileSize*Math.pow(2,pe-Ke.tileID.overscaledZ)))}class yn{constructor(O,pe,Ie,Ne){this.opacity=O?Math.max(0,Math.min(1,O.opacity+(O.placed?pe:-pe))):Ne&&Ie?1:0,this.placed=Ie}isHidden(){return this.opacity===0&&!this.placed}}class Wn{constructor(O,pe,Ie,Ne,qe){this.text=new yn(O?O.text:null,pe,Ie,qe),this.icon=new yn(O?O.icon:null,pe,Ne,qe)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Sn{constructor(O,pe,Ie){this.text=O,this.icon=pe,this.skipFade=Ie}}class fn{constructor(){this.invProjMatrix=n.H(),this.viewportMatrix=n.H(),this.circles=[]}}class ga{constructor(O,pe,Ie,Ne,qe){this.bucketInstanceId=O,this.featureIndex=pe,this.sourceLayerIndex=Ie,this.bucketIndex=Ne,this.tileID=qe}}class na{constructor(O){this.crossSourceCollisions=O,this.maxGroupID=0,this.collisionGroups={}}get(O){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[O]){let pe=++this.maxGroupID;this.collisionGroups[O]={ID:pe,predicate:Ie=>Ie.collisionGroupID===pe}}return this.collisionGroups[O]}}function Zt(Ke,O,pe,Ie,Ne){let{horizontalAlign:qe,verticalAlign:Mt}=n.au(Ke);return new n.P(-(qe-.5)*O+Ie[0]*Ne,-(Mt-.5)*pe+Ie[1]*Ne)}class sr{constructor(O,pe,Ie,Ne,qe,Mt){this.transform=O.clone(),this.terrain=Ie,this.collisionIndex=new un(this.transform,pe),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Ne,this.retainedQueryData={},this.collisionGroups=new na(qe),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=Mt,Mt&&(Mt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(O){let pe=this.terrain;return pe?(Ie,Ne)=>pe.getElevation(O,Ie,Ne):null}getBucketParts(O,pe,Ie,Ne){let qe=Ie.getBucket(pe),Mt=Ie.latestFeatureIndex;if(!qe||!Mt||pe.id!==qe.layerIds[0])return;let jt=Ie.collisionBoxArray,er=qe.layers[0].layout,kr=qe.layers[0].paint,Hr=Math.pow(2,this.transform.zoom-Ie.tileID.overscaledZ),Vr=Ie.tileSize/n.X,ki=Ie.tileID.toUnwrapped(),Vi=this.transform.calculatePosMatrix(ki),tt=er.get("text-pitch-alignment")==="map",lt=er.get("text-rotation-alignment")==="map",Tt=cn(Ie,1,this.transform.zoom),Lt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ie,kr.get("text-translate"),kr.get("text-translate-anchor")),Vt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ie,kr.get("icon-translate"),kr.get("icon-translate-anchor")),Nt=ui(Vi,tt,lt,this.transform,Tt),Yt=null;if(tt){let $r=mi(Vi,tt,lt,this.transform,Tt);Yt=n.L([],this.transform.labelPlaneMatrix,$r)}this.retainedQueryData[qe.bucketInstanceId]=new ga(qe.bucketInstanceId,Mt,qe.sourceLayerIndex,qe.index,Ie.tileID);let Lr={bucket:qe,layout:er,translationText:Lt,translationIcon:Vt,posMatrix:Vi,unwrappedTileID:ki,textLabelPlaneMatrix:Nt,labelToScreenMatrix:Yt,scale:Hr,textPixelRatio:Vr,holdingForFade:Ie.holdingForFade(),collisionBoxArray:jt,partiallyEvaluatedTextSize:n.ag(qe.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(qe.sourceID)};if(Ne)for(let $r of qe.sortKeyRanges){let{sortKey:Zr,symbolInstanceStart:di,symbolInstanceEnd:zi}=$r;O.push({sortKey:Zr,symbolInstanceStart:di,symbolInstanceEnd:zi,parameters:Lr})}else O.push({symbolInstanceStart:0,symbolInstanceEnd:qe.symbolInstances.length,parameters:Lr})}attemptAnchorPlacement(O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi,tt,lt,Tt,Lt,Vt,Nt){let Yt=n.aq[O.textAnchor],Lr=[O.textOffset0,O.textOffset1],$r=Zt(Yt,Ie,Ne,Lr,qe),Zr=this.collisionIndex.placeCollisionBox(pe,ki,er,kr,Hr,jt,Mt,Tt,Vr.predicate,Nt,$r);if((!Vt||this.collisionIndex.placeCollisionBox(Vt,ki,er,kr,Hr,jt,Mt,Lt,Vr.predicate,Nt,$r).placeable)&&Zr.placeable){let di;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Vi.crossTileID]&&this.prevPlacement.placements[Vi.crossTileID]&&this.prevPlacement.placements[Vi.crossTileID].text&&(di=this.prevPlacement.variableOffsets[Vi.crossTileID].anchor),Vi.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Vi.crossTileID]={textOffset:Lr,width:Ie,height:Ne,anchor:Yt,textBoxScale:qe,prevAnchor:di},this.markUsedJustification(tt,Yt,Vi,lt),tt.allowVerticalPlacement&&(this.markUsedOrientation(tt,lt,Vi),this.placedOrientations[Vi.crossTileID]=lt),{shift:$r,placedGlyphBoxes:Zr}}}placeLayerBucketPart(O,pe,Ie){let{bucket:Ne,layout:qe,translationText:Mt,translationIcon:jt,posMatrix:er,unwrappedTileID:kr,textLabelPlaneMatrix:Hr,labelToScreenMatrix:Vr,textPixelRatio:ki,holdingForFade:Vi,collisionBoxArray:tt,partiallyEvaluatedTextSize:lt,collisionGroup:Tt}=O.parameters,Lt=qe.get("text-optional"),Vt=qe.get("icon-optional"),Nt=n.ar(qe,"text-overlap","text-allow-overlap"),Yt=Nt==="always",Lr=n.ar(qe,"icon-overlap","icon-allow-overlap"),$r=Lr==="always",Zr=qe.get("text-rotation-alignment")==="map",di=qe.get("text-pitch-alignment")==="map",zi=qe.get("icon-text-fit")!=="none",Ki=qe.get("symbol-z-order")==="viewport-y",nn=Yt&&($r||!Ne.hasIconData()||Vt),kn=$r&&(Yt||!Ne.hasTextData()||Lt);!Ne.collisionArrays&&tt&&Ne.deserializeCollisionBoxes(tt);let Jn=this._getTerrainElevationFunc(this.retainedQueryData[Ne.bucketInstanceId].tileID),Sa=(wa,Ba,xo)=>{var Go,Bo;if(pe[wa.crossTileID])return;if(Vi)return void(this.placements[wa.crossTileID]=new Sn(!1,!1,!1));let _s=!1,wl=!1,Al=!0,Us=null,Pl={box:null,placeable:!1,offscreen:null},Ru={placeable:!1},Tu=null,Js=null,Qs=null,nc=0,wc=0,ih=0;Ba.textFeatureIndex?nc=Ba.textFeatureIndex:wa.useRuntimeCollisionCircles&&(nc=wa.featureIndex),Ba.verticalTextFeatureIndex&&(wc=Ba.verticalTextFeatureIndex);let Me=Ba.textBox;if(Me){let Bt=Or=>{let pi=n.ah.horizontal;if(Ne.allowVerticalPlacement&&!Or&&this.prevPlacement){let ci=this.prevPlacement.placedOrientations[wa.crossTileID];ci&&(this.placedOrientations[wa.crossTileID]=ci,pi=ci,this.markUsedOrientation(Ne,pi,wa))}return pi},Ht=(Or,pi)=>{if(Ne.allowVerticalPlacement&&wa.numVerticalGlyphVertices>0&&Ba.verticalTextBox){for(let ci of Ne.writingModes)if(ci===n.ah.vertical?(Pl=pi(),Ru=Pl):Pl=Or(),Pl&&Pl.placeable)break}else Pl=Or()},fr=wa.textAnchorOffsetStartIndex,cr=wa.textAnchorOffsetEndIndex;if(cr===fr){let Or=(pi,ci)=>{let Bi=this.collisionIndex.placeCollisionBox(pi,Nt,ki,er,kr,di,Zr,Mt,Tt.predicate,Jn);return Bi&&Bi.placeable&&(this.markUsedOrientation(Ne,ci,wa),this.placedOrientations[wa.crossTileID]=ci),Bi};Ht(()=>Or(Me,n.ah.horizontal),()=>{let pi=Ba.verticalTextBox;return Ne.allowVerticalPlacement&&wa.numVerticalGlyphVertices>0&&pi?Or(pi,n.ah.vertical):{box:null,offscreen:null}}),Bt(Pl&&Pl.placeable)}else{let Or=n.aq[(Bo=(Go=this.prevPlacement)===null||Go===void 0?void 0:Go.variableOffsets[wa.crossTileID])===null||Bo===void 0?void 0:Bo.anchor],pi=(Bi,Yi,Qi)=>{let ta=Bi.x2-Bi.x1,ln=Bi.y2-Bi.y1,On=wa.textBoxScale,Un=zi&&Lr==="never"?Yi:null,Zn=null,aa=Nt==="never"?1:2,gn="never";Or&&aa++;for(let Ja=0;Japi(Me,Ba.iconBox,n.ah.horizontal),()=>{let Bi=Ba.verticalTextBox;return Ne.allowVerticalPlacement&&(!Pl||!Pl.placeable)&&wa.numVerticalGlyphVertices>0&&Bi?pi(Bi,Ba.verticalIconBox,n.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Pl&&(_s=Pl.placeable,Al=Pl.offscreen);let ci=Bt(Pl&&Pl.placeable);if(!_s&&this.prevPlacement){let Bi=this.prevPlacement.variableOffsets[wa.crossTileID];Bi&&(this.variableOffsets[wa.crossTileID]=Bi,this.markUsedJustification(Ne,Bi.anchor,wa,ci))}}}if(Tu=Pl,_s=Tu&&Tu.placeable,Al=Tu&&Tu.offscreen,wa.useRuntimeCollisionCircles){let Bt=Ne.text.placedSymbolArray.get(wa.centerJustifiedTextSymbolIndex),Ht=n.ai(Ne.textSizeData,lt,Bt),fr=qe.get("text-padding");Js=this.collisionIndex.placeCollisionCircles(Nt,Bt,Ne.lineVertexArray,Ne.glyphOffsetArray,Ht,er,kr,Hr,Vr,Ie,di,Tt.predicate,wa.collisionCircleDiameter,fr,Mt,Jn),Js.circles.length&&Js.collisionDetected&&!Ie&&n.w("Collisions detected, but collision boxes are not shown"),_s=Yt||Js.circles.length>0&&!Js.collisionDetected,Al=Al&&Js.offscreen}if(Ba.iconFeatureIndex&&(ih=Ba.iconFeatureIndex),Ba.iconBox){let Bt=Ht=>this.collisionIndex.placeCollisionBox(Ht,Lr,ki,er,kr,di,Zr,jt,Tt.predicate,Jn,zi&&Us?Us:void 0);Ru&&Ru.placeable&&Ba.verticalIconBox?(Qs=Bt(Ba.verticalIconBox),wl=Qs.placeable):(Qs=Bt(Ba.iconBox),wl=Qs.placeable),Al=Al&&Qs.offscreen}let Ve=Lt||wa.numHorizontalGlyphVertices===0&&wa.numVerticalGlyphVertices===0,ft=Vt||wa.numIconVertices===0;Ve||ft?ft?Ve||(wl=wl&&_s):_s=wl&&_s:wl=_s=wl&&_s;let Pt=wl&&Qs.placeable;if(_s&&Tu.placeable&&this.collisionIndex.insertCollisionBox(Tu.box,Nt,qe.get("text-ignore-placement"),Ne.bucketInstanceId,Ru&&Ru.placeable&&wc?wc:nc,Tt.ID),Pt&&this.collisionIndex.insertCollisionBox(Qs.box,Lr,qe.get("icon-ignore-placement"),Ne.bucketInstanceId,ih,Tt.ID),Js&&_s&&this.collisionIndex.insertCollisionCircles(Js.circles,Nt,qe.get("text-ignore-placement"),Ne.bucketInstanceId,nc,Tt.ID),Ie&&this.storeCollisionData(Ne.bucketInstanceId,xo,Ba,Tu,Qs,Js),wa.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Ne.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[wa.crossTileID]=new Sn(_s||nn,wl||kn,Al||Ne.justReloaded),pe[wa.crossTileID]=!0};if(Ki){if(O.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let wa=Ne.getSortedSymbolIndexes(this.transform.angle);for(let Ba=wa.length-1;Ba>=0;--Ba){let xo=wa[Ba];Sa(Ne.symbolInstances.get(xo),Ne.collisionArrays[xo],xo)}}else for(let wa=O.symbolInstanceStart;wa=0&&(O.text.placedSymbolArray.get(jt).crossTileID=qe>=0&&jt!==qe?0:Ie.crossTileID)}markUsedOrientation(O,pe,Ie){let Ne=pe===n.ah.horizontal||pe===n.ah.horizontalOnly?pe:0,qe=pe===n.ah.vertical?pe:0,Mt=[Ie.leftJustifiedTextSymbolIndex,Ie.centerJustifiedTextSymbolIndex,Ie.rightJustifiedTextSymbolIndex];for(let jt of Mt)O.text.placedSymbolArray.get(jt).placedOrientation=Ne;Ie.verticalPlacedTextSymbolIndex&&(O.text.placedSymbolArray.get(Ie.verticalPlacedTextSymbolIndex).placedOrientation=qe)}commit(O){this.commitTime=O,this.zoomAtLastRecencyCheck=this.transform.zoom;let pe=this.prevPlacement,Ie=!1;this.prevZoomAdjustment=pe?pe.zoomAdjustment(this.transform.zoom):0;let Ne=pe?pe.symbolFadeChange(O):1,qe=pe?pe.opacities:{},Mt=pe?pe.variableOffsets:{},jt=pe?pe.placedOrientations:{};for(let er in this.placements){let kr=this.placements[er],Hr=qe[er];Hr?(this.opacities[er]=new Wn(Hr,Ne,kr.text,kr.icon),Ie=Ie||kr.text!==Hr.text.placed||kr.icon!==Hr.icon.placed):(this.opacities[er]=new Wn(null,Ne,kr.text,kr.icon,kr.skipFade),Ie=Ie||kr.text||kr.icon)}for(let er in qe){let kr=qe[er];if(!this.opacities[er]){let Hr=new Wn(kr,Ne,!1,!1);Hr.isHidden()||(this.opacities[er]=Hr,Ie=Ie||kr.text.placed||kr.icon.placed)}}for(let er in Mt)this.variableOffsets[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.variableOffsets[er]=Mt[er]);for(let er in jt)this.placedOrientations[er]||!this.opacities[er]||this.opacities[er].isHidden()||(this.placedOrientations[er]=jt[er]);if(pe&&pe.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Ie?this.lastPlacementChangeTime=O:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=pe?pe.lastPlacementChangeTime:O)}updateLayerOpacities(O,pe){let Ie={};for(let Ne of pe){let qe=Ne.getBucket(O);qe&&Ne.latestFeatureIndex&&O.id===qe.layerIds[0]&&this.updateBucketOpacities(qe,Ne.tileID,Ie,Ne.collisionBoxArray)}}updateBucketOpacities(O,pe,Ie,Ne){O.hasTextData()&&(O.text.opacityVertexArray.clear(),O.text.hasVisibleVertices=!1),O.hasIconData()&&(O.icon.opacityVertexArray.clear(),O.icon.hasVisibleVertices=!1),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexArray.clear(),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexArray.clear();let qe=O.layers[0],Mt=qe.layout,jt=new Wn(null,0,!1,!1,!0),er=Mt.get("text-allow-overlap"),kr=Mt.get("icon-allow-overlap"),Hr=qe._unevaluatedLayout.hasValue("text-variable-anchor")||qe._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Vr=Mt.get("text-rotation-alignment")==="map",ki=Mt.get("text-pitch-alignment")==="map",Vi=Mt.get("icon-text-fit")!=="none",tt=new Wn(null,0,er&&(kr||!O.hasIconData()||Mt.get("icon-optional")),kr&&(er||!O.hasTextData()||Mt.get("text-optional")),!0);!O.collisionArrays&&Ne&&(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData())&&O.deserializeCollisionBoxes(Ne);let lt=(Lt,Vt,Nt)=>{for(let Yt=0;Yt0,di=this.placedOrientations[Vt.crossTileID],zi=di===n.ah.vertical,Ki=di===n.ah.horizontal||di===n.ah.horizontalOnly;if(Nt>0||Yt>0){let kn=Gn($r.text);lt(O.text,Nt,zi?Xn:kn),lt(O.text,Yt,Ki?Xn:kn);let Jn=$r.text.isHidden();[Vt.rightJustifiedTextSymbolIndex,Vt.centerJustifiedTextSymbolIndex,Vt.leftJustifiedTextSymbolIndex].forEach(Ba=>{Ba>=0&&(O.text.placedSymbolArray.get(Ba).hidden=Jn||zi?1:0)}),Vt.verticalPlacedTextSymbolIndex>=0&&(O.text.placedSymbolArray.get(Vt.verticalPlacedTextSymbolIndex).hidden=Jn||Ki?1:0);let Sa=this.variableOffsets[Vt.crossTileID];Sa&&this.markUsedJustification(O,Sa.anchor,Vt,di);let wa=this.placedOrientations[Vt.crossTileID];wa&&(this.markUsedJustification(O,"left",Vt,wa),this.markUsedOrientation(O,wa,Vt))}if(Zr){let kn=Gn($r.icon),Jn=!(Vi&&Vt.verticalPlacedIconSymbolIndex&&zi);Vt.placedIconSymbolIndex>=0&&(lt(O.icon,Vt.numIconVertices,Jn?kn:Xn),O.icon.placedSymbolArray.get(Vt.placedIconSymbolIndex).hidden=$r.icon.isHidden()),Vt.verticalPlacedIconSymbolIndex>=0&&(lt(O.icon,Vt.numVerticalIconVertices,Jn?Xn:kn),O.icon.placedSymbolArray.get(Vt.verticalPlacedIconSymbolIndex).hidden=$r.icon.isHidden())}let nn=Tt&&Tt.has(Lt)?Tt.get(Lt):{text:null,icon:null};if(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData()){let kn=O.collisionArrays[Lt];if(kn){let Jn=new n.P(0,0);if(kn.textBox||kn.verticalTextBox){let Sa=!0;if(Hr){let wa=this.variableOffsets[Lr];wa?(Jn=Zt(wa.anchor,wa.width,wa.height,wa.textOffset,wa.textBoxScale),Vr&&Jn._rotate(ki?this.transform.angle:-this.transform.angle)):Sa=!1}if(kn.textBox||kn.verticalTextBox){let wa;kn.textBox&&(wa=zi),kn.verticalTextBox&&(wa=Ki),_r(O.textCollisionBox.collisionVertexArray,$r.text.placed,!Sa||wa,nn.text,Jn.x,Jn.y)}}if(kn.iconBox||kn.verticalIconBox){let Sa=!!(!Ki&&kn.verticalIconBox),wa;kn.iconBox&&(wa=Sa),kn.verticalIconBox&&(wa=!Sa),_r(O.iconCollisionBox.collisionVertexArray,$r.icon.placed,wa,nn.icon,Vi?Jn.x:0,Vi?Jn.y:0)}}}}if(O.sortFeatures(this.transform.angle),this.retainedQueryData[O.bucketInstanceId]&&(this.retainedQueryData[O.bucketInstanceId].featureSortOrder=O.featureSortOrder),O.hasTextData()&&O.text.opacityVertexBuffer&&O.text.opacityVertexBuffer.updateData(O.text.opacityVertexArray),O.hasIconData()&&O.icon.opacityVertexBuffer&&O.icon.opacityVertexBuffer.updateData(O.icon.opacityVertexArray),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexBuffer&&O.iconCollisionBox.collisionVertexBuffer.updateData(O.iconCollisionBox.collisionVertexArray),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexBuffer&&O.textCollisionBox.collisionVertexBuffer.updateData(O.textCollisionBox.collisionVertexArray),O.text.opacityVertexArray.length!==O.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${O.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${O.text.layoutVertexArray.length}) / 4`);if(O.icon.opacityVertexArray.length!==O.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${O.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${O.icon.layoutVertexArray.length}) / 4`);if(O.bucketInstanceId in this.collisionCircleArrays){let Lt=this.collisionCircleArrays[O.bucketInstanceId];O.placementInvProjMatrix=Lt.invProjMatrix,O.placementViewportMatrix=Lt.viewportMatrix,O.collisionCircleArray=Lt.circles,delete this.collisionCircleArrays[O.bucketInstanceId]}}symbolFadeChange(O){return this.fadeDuration===0?1:(O-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(O){return Math.max(0,(this.transform.zoom-O)/1.5)}hasTransitions(O){return this.stale||O-this.lastPlacementChangeTimeO}setStale(){this.stale=!0}}function _r(Ke,O,pe,Ie,Ne,qe){Ie&&Ie.length!==0||(Ie=[0,0,0,0]);let Mt=Ie[0]-hi,jt=Ie[1]-hi,er=Ie[2]-hi,kr=Ie[3]-hi;Ke.emplaceBack(O?1:0,pe?1:0,Ne||0,qe||0,Mt,jt),Ke.emplaceBack(O?1:0,pe?1:0,Ne||0,qe||0,er,jt),Ke.emplaceBack(O?1:0,pe?1:0,Ne||0,qe||0,er,kr),Ke.emplaceBack(O?1:0,pe?1:0,Ne||0,qe||0,Mt,kr)}let Cr=Math.pow(2,25),fi=Math.pow(2,24),qi=Math.pow(2,17),Ui=Math.pow(2,16),Hi=Math.pow(2,9),En=Math.pow(2,8),Rn=Math.pow(2,1);function Gn(Ke){if(Ke.opacity===0&&!Ke.placed)return 0;if(Ke.opacity===1&&Ke.placed)return 4294967295;let O=Ke.placed?1:0,pe=Math.floor(127*Ke.opacity);return pe*Cr+O*fi+pe*qi+O*Ui+pe*Hi+O*En+pe*Rn+O}let Xn=0;function sa(){return{isOccluded:(Ke,O,pe)=>!1,getPitchedTextCorrection:(Ke,O,pe)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ke,O,pe,Ie){throw new Error("Not implemented.")},translatePosition:(Ke,O,pe,Ie)=>function(Ne,qe,Mt,jt,er=!1){if(!Mt[0]&&!Mt[1])return[0,0];let kr=er?jt==="map"?Ne.angle:0:jt==="viewport"?-Ne.angle:0;if(kr){let Hr=Math.sin(kr),Vr=Math.cos(kr);Mt=[Mt[0]*Vr-Mt[1]*Hr,Mt[0]*Hr+Mt[1]*Vr]}return[er?Mt[0]:cn(qe,Mt[0],Ne.zoom),er?Mt[1]:cn(qe,Mt[1],Ne.zoom)]}(Ke,O,pe,Ie),getCircleRadiusCorrection:Ke=>1}}class Mn{constructor(O){this._sortAcrossTiles=O.layout.get("symbol-z-order")!=="viewport-y"&&!O.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(O,pe,Ie,Ne,qe){let Mt=this._bucketParts;for(;this._currentTileIndexjt.sortKey-er.sortKey));this._currentPartIndex!this._forceFullPlacement&&u.now()-Ne>2;for(;this._currentPlacementIndex>=0;){let Mt=pe[O[this._currentPlacementIndex]],jt=this.placement.collisionIndex.transform.zoom;if(Mt.type==="symbol"&&(!Mt.minzoom||Mt.minzoom<=jt)&&(!Mt.maxzoom||Mt.maxzoom>jt)){if(this._inProgressLayer||(this._inProgressLayer=new Mn(Mt)),this._inProgressLayer.continuePlacement(Ie[Mt.source],this.placement,this._showCollisionBoxes,Mt,qe))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(O){return this.placement.commit(O),this.placement}}let ro=512/n.X/2;class Ft{constructor(O,pe,Ie){this.tileID=O,this.bucketInstanceId=Ie,this._symbolsByKey={};let Ne=new Map;for(let qe=0;qe({x:Math.floor(er.anchorX*ro),y:Math.floor(er.anchorY*ro)})),crossTileIDs:Mt.map(er=>er.crossTileID)};if(jt.positions.length>128){let er=new n.av(jt.positions.length,16,Uint16Array);for(let{x:kr,y:Hr}of jt.positions)er.add(kr,Hr);er.finish(),delete jt.positions,jt.index=er}this._symbolsByKey[qe]=jt}}getScaledCoordinates(O,pe){let{x:Ie,y:Ne,z:qe}=this.tileID.canonical,{x:Mt,y:jt,z:er}=pe.canonical,kr=ro/Math.pow(2,er-qe),Hr=(jt*n.X+O.anchorY)*kr,Vr=Ne*n.X*ro;return{x:Math.floor((Mt*n.X+O.anchorX)*kr-Ie*n.X*ro),y:Math.floor(Hr-Vr)}}findMatches(O,pe,Ie){let Ne=this.tileID.canonical.zO)}}class Rt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class qr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(O){let pe=Math.round((O-this.lng)/360);if(pe!==0)for(let Ie in this.indexes){let Ne=this.indexes[Ie],qe={};for(let Mt in Ne){let jt=Ne[Mt];jt.tileID=jt.tileID.unwrapTo(jt.tileID.wrap+pe),qe[jt.tileID.key]=jt}this.indexes[Ie]=qe}this.lng=O}addBucket(O,pe,Ie){if(this.indexes[O.overscaledZ]&&this.indexes[O.overscaledZ][O.key]){if(this.indexes[O.overscaledZ][O.key].bucketInstanceId===pe.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(O.overscaledZ,this.indexes[O.overscaledZ][O.key])}for(let qe=0;qeO.overscaledZ)for(let jt in Mt){let er=Mt[jt];er.tileID.isChildOf(O)&&er.findMatches(pe.symbolInstances,O,Ne)}else{let jt=Mt[O.scaledTo(Number(qe)).key];jt&&jt.findMatches(pe.symbolInstances,O,Ne)}}for(let qe=0;qe{pe[Ie]=!0});for(let Ie in this.layerIndexes)pe[Ie]||delete this.layerIndexes[Ie]}}let oi=(Ke,O)=>n.t(Ke,O&&O.filter(pe=>pe.identifier!=="source.canvas")),Gr=n.aw();class si extends n.E{constructor(O,pe={}){super(),this._rtlPluginLoaded=()=>{for(let Ie in this.sourceCaches){let Ne=this.sourceCaches[Ie].getSource().type;Ne!=="vector"&&Ne!=="geojson"||this.sourceCaches[Ie].reload()}},this.map=O,this.dispatcher=new ne(ge(),O._getMapId()),this.dispatcher.registerMessageHandler("GG",(Ie,Ne)=>this.getGlyphs(Ie,Ne)),this.dispatcher.registerMessageHandler("GI",(Ie,Ne)=>this.getImages(Ie,Ne)),this.imageManager=new T,this.imageManager.setEventedParent(this),this.glyphManager=new V(O._requestManager,pe.localIdeographFontFamily),this.lineAtlas=new ee(256,512),this.crossTileSymbolIndex=new ni,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new n.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",n.ay()),xt().on(ze,this._rtlPluginLoaded),this.on("data",Ie=>{if(Ie.dataType!=="source"||Ie.sourceDataType!=="metadata")return;let Ne=this.sourceCaches[Ie.sourceId];if(!Ne)return;let qe=Ne.getSource();if(qe&&qe.vectorLayerIds)for(let Mt in this._layers){let jt=this._layers[Mt];jt.source===qe.id&&this._validateLayer(jt)}})}loadURL(O,pe={},Ie){this.fire(new n.k("dataloading",{dataType:"style"})),pe.validate=typeof pe.validate!="boolean"||pe.validate;let Ne=this.map._requestManager.transformRequest(O,"Style");this._loadStyleRequest=new AbortController;let qe=this._loadStyleRequest;n.h(Ne,this._loadStyleRequest).then(Mt=>{this._loadStyleRequest=null,this._load(Mt.data,pe,Ie)}).catch(Mt=>{this._loadStyleRequest=null,Mt&&!qe.signal.aborted&&this.fire(new n.j(Mt))})}loadJSON(O,pe={},Ie){this.fire(new n.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,pe.validate=pe.validate!==!1,this._load(O,pe,Ie)}).catch(()=>{})}loadEmpty(){this.fire(new n.k("dataloading",{dataType:"style"})),this._load(Gr,{validate:!1})}_load(O,pe,Ie){var Ne;let qe=pe.transformStyle?pe.transformStyle(Ie,O):O;if(!pe.validate||!oi(this,n.u(qe))){this._loaded=!0,this.stylesheet=qe;for(let Mt in qe.sources)this.addSource(Mt,qe.sources[Mt],{validate:!1});qe.sprite?this._loadSprite(qe.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(qe.glyphs),this._createLayers(),this.light=new $(this.stylesheet.light),this.sky=new G(this.stylesheet.sky),this.map.setTerrain((Ne=this.stylesheet.terrain)!==null&&Ne!==void 0?Ne:null),this.fire(new n.k("data",{dataType:"style"})),this.fire(new n.k("style.load"))}}_createLayers(){let O=n.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",O),this._order=O.map(pe=>pe.id),this._layers={},this._serializedLayers=null;for(let pe of O){let Ie=n.aA(pe);Ie.setEventedParent(this,{layer:{id:pe.id}}),this._layers[pe.id]=Ie}}_loadSprite(O,pe=!1,Ie=void 0){let Ne;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(qe,Mt,jt,er){return n._(this,void 0,void 0,function*(){let kr=M(qe),Hr=jt>1?"@2x":"",Vr={},ki={};for(let{id:Vi,url:tt}of kr){let lt=Mt.transformRequest(p(tt,Hr,".json"),"SpriteJSON");Vr[Vi]=n.h(lt,er);let Tt=Mt.transformRequest(p(tt,Hr,".png"),"SpriteImage");ki[Vi]=f.getImage(Tt,er)}return yield Promise.all([...Object.values(Vr),...Object.values(ki)]),function(Vi,tt){return n._(this,void 0,void 0,function*(){let lt={};for(let Tt in Vi){lt[Tt]={};let Lt=u.getImageCanvasContext((yield tt[Tt]).data),Vt=(yield Vi[Tt]).data;for(let Nt in Vt){let{width:Yt,height:Lr,x:$r,y:Zr,sdf:di,pixelRatio:zi,stretchX:Ki,stretchY:nn,content:kn,textFitWidth:Jn,textFitHeight:Sa}=Vt[Nt];lt[Tt][Nt]={data:null,pixelRatio:zi,sdf:di,stretchX:Ki,stretchY:nn,content:kn,textFitWidth:Jn,textFitHeight:Sa,spriteData:{width:Yt,height:Lr,x:$r,y:Zr,context:Lt}}}}return lt})}(Vr,ki)})}(O,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(qe=>{if(this._spriteRequest=null,qe)for(let Mt in qe){this._spritesImagesIds[Mt]=[];let jt=this._spritesImagesIds[Mt]?this._spritesImagesIds[Mt].filter(er=>!(er in qe)):[];for(let er of jt)this.imageManager.removeImage(er),this._changedImages[er]=!0;for(let er in qe[Mt]){let kr=Mt==="default"?er:`${Mt}:${er}`;this._spritesImagesIds[Mt].push(kr),kr in this.imageManager.images?this.imageManager.updateImage(kr,qe[Mt][er],!1):this.imageManager.addImage(kr,qe[Mt][er]),pe&&(this._changedImages[kr]=!0)}}}).catch(qe=>{this._spriteRequest=null,Ne=qe,this.fire(new n.j(Ne))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),pe&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"})),Ie&&Ie(Ne)})}_unloadSprite(){for(let O of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(O),this._changedImages[O]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}_validateLayer(O){let pe=this.sourceCaches[O.source];if(!pe)return;let Ie=O.sourceLayer;if(!Ie)return;let Ne=pe.getSource();(Ne.type==="geojson"||Ne.vectorLayerIds&&Ne.vectorLayerIds.indexOf(Ie)===-1)&&this.fire(new n.j(new Error(`Source layer "${Ie}" does not exist on source "${Ne.id}" as specified by style layer "${O.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let O in this.sourceCaches)if(!this.sourceCaches[O].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(O,pe=!1){let Ie=this._serializedAllLayers();if(!O||O.length===0)return Object.values(pe?n.aB(Ie):Ie);let Ne=[];for(let qe of O)if(Ie[qe]){let Mt=pe?n.aB(Ie[qe]):Ie[qe];Ne.push(Mt)}return Ne}_serializedAllLayers(){let O=this._serializedLayers;if(O)return O;O=this._serializedLayers={};let pe=Object.keys(this._layers);for(let Ie of pe){let Ne=this._layers[Ie];Ne.type!=="custom"&&(O[Ie]=Ne.serialize())}return O}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let O in this.sourceCaches)if(this.sourceCaches[O].hasTransition())return!0;for(let O in this._layers)if(this._layers[O].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(O){if(!this._loaded)return;let pe=this._changed;if(pe){let Ne=Object.keys(this._updatedLayers),qe=Object.keys(this._removedLayers);(Ne.length||qe.length)&&this._updateWorkerLayers(Ne,qe);for(let Mt in this._updatedSources){let jt=this._updatedSources[Mt];if(jt==="reload")this._reloadSource(Mt);else{if(jt!=="clear")throw new Error(`Invalid action ${jt}`);this._clearSource(Mt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let Mt in this._updatedPaintProps)this._layers[Mt].updateTransitions(O);this.light.updateTransitions(O),this.sky.updateTransitions(O),this._resetUpdates()}let Ie={};for(let Ne in this.sourceCaches){let qe=this.sourceCaches[Ne];Ie[Ne]=qe.used,qe.used=!1}for(let Ne of this._order){let qe=this._layers[Ne];qe.recalculate(O,this._availableImages),!qe.isHidden(O.zoom)&&qe.source&&(this.sourceCaches[qe.source].used=!0)}for(let Ne in Ie){let qe=this.sourceCaches[Ne];!!Ie[Ne]!=!!qe.used&&qe.fire(new n.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Ne}))}this.light.recalculate(O),this.sky.recalculate(O),this.z=O.zoom,pe&&this.fire(new n.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let O=Object.keys(this._changedImages);if(O.length){for(let pe in this.sourceCaches)this.sourceCaches[pe].reloadTilesForDependencies(["icons","patterns"],O);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let O in this.sourceCaches)this.sourceCaches[O].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(O,pe){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(O,!1),removedIds:pe})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(O,pe={}){var Ie;this._checkLoaded();let Ne=this.serialize();if(O=pe.transformStyle?pe.transformStyle(Ne,O):O,((Ie=pe.validate)===null||Ie===void 0||Ie)&&oi(this,n.u(O)))return!1;(O=n.aB(O)).layers=n.az(O.layers);let qe=n.aC(Ne,O),Mt=this._getOperationsToPerform(qe);if(Mt.unimplemented.length>0)throw new Error(`Unimplemented: ${Mt.unimplemented.join(", ")}.`);if(Mt.operations.length===0)return!1;for(let jt of Mt.operations)jt();return this.stylesheet=O,this._serializedLayers=null,!0}_getOperationsToPerform(O){let pe=[],Ie=[];for(let Ne of O)switch(Ne.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":pe.push(()=>this.addLayer.apply(this,Ne.args));break;case"removeLayer":pe.push(()=>this.removeLayer.apply(this,Ne.args));break;case"setPaintProperty":pe.push(()=>this.setPaintProperty.apply(this,Ne.args));break;case"setLayoutProperty":pe.push(()=>this.setLayoutProperty.apply(this,Ne.args));break;case"setFilter":pe.push(()=>this.setFilter.apply(this,Ne.args));break;case"addSource":pe.push(()=>this.addSource.apply(this,Ne.args));break;case"removeSource":pe.push(()=>this.removeSource.apply(this,Ne.args));break;case"setLayerZoomRange":pe.push(()=>this.setLayerZoomRange.apply(this,Ne.args));break;case"setLight":pe.push(()=>this.setLight.apply(this,Ne.args));break;case"setGeoJSONSourceData":pe.push(()=>this.setGeoJSONSourceData.apply(this,Ne.args));break;case"setGlyphs":pe.push(()=>this.setGlyphs.apply(this,Ne.args));break;case"setSprite":pe.push(()=>this.setSprite.apply(this,Ne.args));break;case"setSky":pe.push(()=>this.setSky.apply(this,Ne.args));break;case"setTerrain":pe.push(()=>this.map.setTerrain.apply(this,Ne.args));break;case"setTransition":pe.push(()=>{});break;default:Ie.push(Ne.command)}return{operations:pe,unimplemented:Ie}}addImage(O,pe){if(this.getImage(O))return this.fire(new n.j(new Error(`An image named "${O}" already exists.`)));this.imageManager.addImage(O,pe),this._afterImageUpdated(O)}updateImage(O,pe){this.imageManager.updateImage(O,pe)}getImage(O){return this.imageManager.getImage(O)}removeImage(O){if(!this.getImage(O))return this.fire(new n.j(new Error(`An image named "${O}" does not exist.`)));this.imageManager.removeImage(O),this._afterImageUpdated(O)}_afterImageUpdated(O){this._availableImages=this.imageManager.listImages(),this._changedImages[O]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(O,pe,Ie={}){if(this._checkLoaded(),this.sourceCaches[O]!==void 0)throw new Error(`Source "${O}" already exists.`);if(!pe.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(pe).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(pe.type)>=0&&this._validate(n.u.source,`sources.${O}`,pe,null,Ie))return;this.map&&this.map._collectResourceTiming&&(pe.collectResourceTiming=!0);let Ne=this.sourceCaches[O]=new Jt(O,pe,this.dispatcher);Ne.style=this,Ne.setEventedParent(this,()=>({isSourceLoaded:Ne.loaded(),source:Ne.serialize(),sourceId:O})),Ne.onAdd(this.map),this._changed=!0}removeSource(O){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error("There is no source with this ID");for(let Ie in this._layers)if(this._layers[Ie].source===O)return this.fire(new n.j(new Error(`Source "${O}" cannot be removed while layer "${Ie}" is using it.`)));let pe=this.sourceCaches[O];delete this.sourceCaches[O],delete this._updatedSources[O],pe.fire(new n.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:O})),pe.setEventedParent(null),pe.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(O,pe){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error(`There is no source with this ID=${O}`);let Ie=this.sourceCaches[O].getSource();if(Ie.type!=="geojson")throw new Error(`geojsonSource.type is ${Ie.type}, which is !== 'geojson`);Ie.setData(pe),this._changed=!0}getSource(O){return this.sourceCaches[O]&&this.sourceCaches[O].getSource()}addLayer(O,pe,Ie={}){this._checkLoaded();let Ne=O.id;if(this.getLayer(Ne))return void this.fire(new n.j(new Error(`Layer "${Ne}" already exists on this map.`)));let qe;if(O.type==="custom"){if(oi(this,n.aD(O)))return;qe=n.aA(O)}else{if("source"in O&&typeof O.source=="object"&&(this.addSource(Ne,O.source),O=n.aB(O),O=n.e(O,{source:Ne})),this._validate(n.u.layer,`layers.${Ne}`,O,{arrayIndex:-1},Ie))return;qe=n.aA(O),this._validateLayer(qe),qe.setEventedParent(this,{layer:{id:Ne}})}let Mt=pe?this._order.indexOf(pe):this._order.length;if(pe&&Mt===-1)this.fire(new n.j(new Error(`Cannot add layer "${Ne}" before non-existing layer "${pe}".`)));else{if(this._order.splice(Mt,0,Ne),this._layerOrderChanged=!0,this._layers[Ne]=qe,this._removedLayers[Ne]&&qe.source&&qe.type!=="custom"){let jt=this._removedLayers[Ne];delete this._removedLayers[Ne],jt.type!==qe.type?this._updatedSources[qe.source]="clear":(this._updatedSources[qe.source]="reload",this.sourceCaches[qe.source].pause())}this._updateLayer(qe),qe.onAdd&&qe.onAdd(this.map)}}moveLayer(O,pe){if(this._checkLoaded(),this._changed=!0,!this._layers[O])return void this.fire(new n.j(new Error(`The layer '${O}' does not exist in the map's style and cannot be moved.`)));if(O===pe)return;let Ie=this._order.indexOf(O);this._order.splice(Ie,1);let Ne=pe?this._order.indexOf(pe):this._order.length;pe&&Ne===-1?this.fire(new n.j(new Error(`Cannot move layer "${O}" before non-existing layer "${pe}".`))):(this._order.splice(Ne,0,O),this._layerOrderChanged=!0)}removeLayer(O){this._checkLoaded();let pe=this._layers[O];if(!pe)return void this.fire(new n.j(new Error(`Cannot remove non-existing layer "${O}".`)));pe.setEventedParent(null);let Ie=this._order.indexOf(O);this._order.splice(Ie,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[O]=pe,delete this._layers[O],this._serializedLayers&&delete this._serializedLayers[O],delete this._updatedLayers[O],delete this._updatedPaintProps[O],pe.onRemove&&pe.onRemove(this.map)}getLayer(O){return this._layers[O]}getLayersOrder(){return[...this._order]}hasLayer(O){return O in this._layers}setLayerZoomRange(O,pe,Ie){this._checkLoaded();let Ne=this.getLayer(O);Ne?Ne.minzoom===pe&&Ne.maxzoom===Ie||(pe!=null&&(Ne.minzoom=pe),Ie!=null&&(Ne.maxzoom=Ie),this._updateLayer(Ne)):this.fire(new n.j(new Error(`Cannot set the zoom range of non-existing layer "${O}".`)))}setFilter(O,pe,Ie={}){this._checkLoaded();let Ne=this.getLayer(O);if(Ne){if(!n.aE(Ne.filter,pe))return pe==null?(Ne.filter=void 0,void this._updateLayer(Ne)):void(this._validate(n.u.filter,`layers.${Ne.id}.filter`,pe,null,Ie)||(Ne.filter=n.aB(pe),this._updateLayer(Ne)))}else this.fire(new n.j(new Error(`Cannot filter non-existing layer "${O}".`)))}getFilter(O){return n.aB(this.getLayer(O).filter)}setLayoutProperty(O,pe,Ie,Ne={}){this._checkLoaded();let qe=this.getLayer(O);qe?n.aE(qe.getLayoutProperty(pe),Ie)||(qe.setLayoutProperty(pe,Ie,Ne),this._updateLayer(qe)):this.fire(new n.j(new Error(`Cannot style non-existing layer "${O}".`)))}getLayoutProperty(O,pe){let Ie=this.getLayer(O);if(Ie)return Ie.getLayoutProperty(pe);this.fire(new n.j(new Error(`Cannot get style of non-existing layer "${O}".`)))}setPaintProperty(O,pe,Ie,Ne={}){this._checkLoaded();let qe=this.getLayer(O);qe?n.aE(qe.getPaintProperty(pe),Ie)||(qe.setPaintProperty(pe,Ie,Ne)&&this._updateLayer(qe),this._changed=!0,this._updatedPaintProps[O]=!0,this._serializedLayers=null):this.fire(new n.j(new Error(`Cannot style non-existing layer "${O}".`)))}getPaintProperty(O,pe){return this.getLayer(O).getPaintProperty(pe)}setFeatureState(O,pe){this._checkLoaded();let Ie=O.source,Ne=O.sourceLayer,qe=this.sourceCaches[Ie];if(qe===void 0)return void this.fire(new n.j(new Error(`The source '${Ie}' does not exist in the map's style.`)));let Mt=qe.getSource().type;Mt==="geojson"&&Ne?this.fire(new n.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):Mt!=="vector"||Ne?(O.id===void 0&&this.fire(new n.j(new Error("The feature id parameter must be provided."))),qe.setFeatureState(Ne,O.id,pe)):this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(O,pe){this._checkLoaded();let Ie=O.source,Ne=this.sourceCaches[Ie];if(Ne===void 0)return void this.fire(new n.j(new Error(`The source '${Ie}' does not exist in the map's style.`)));let qe=Ne.getSource().type,Mt=qe==="vector"?O.sourceLayer:void 0;qe!=="vector"||Mt?pe&&typeof O.id!="string"&&typeof O.id!="number"?this.fire(new n.j(new Error("A feature id is required to remove its specific state property."))):Ne.removeFeatureState(Mt,O.id,pe):this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(O){this._checkLoaded();let pe=O.source,Ie=O.sourceLayer,Ne=this.sourceCaches[pe];if(Ne!==void 0)return Ne.getSource().type!=="vector"||Ie?(O.id===void 0&&this.fire(new n.j(new Error("The feature id parameter must be provided."))),Ne.getFeatureState(Ie,O.id)):void this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new n.j(new Error(`The source '${pe}' does not exist in the map's style.`)))}getTransition(){return n.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let O=n.aF(this.sourceCaches,qe=>qe.serialize()),pe=this._serializeByIds(this._order,!0),Ie=this.map.getTerrain()||void 0,Ne=this.stylesheet;return n.aG({version:Ne.version,name:Ne.name,metadata:Ne.metadata,light:Ne.light,sky:Ne.sky,center:Ne.center,zoom:Ne.zoom,bearing:Ne.bearing,pitch:Ne.pitch,sprite:Ne.sprite,glyphs:Ne.glyphs,transition:Ne.transition,sources:O,layers:pe,terrain:Ie},qe=>qe!==void 0)}_updateLayer(O){this._updatedLayers[O.id]=!0,O.source&&!this._updatedSources[O.source]&&this.sourceCaches[O.source].getSource().type!=="raster"&&(this._updatedSources[O.source]="reload",this.sourceCaches[O.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(O){let pe=Mt=>this._layers[Mt].type==="fill-extrusion",Ie={},Ne=[];for(let Mt=this._order.length-1;Mt>=0;Mt--){let jt=this._order[Mt];if(pe(jt)){Ie[jt]=Mt;for(let er of O){let kr=er[jt];if(kr)for(let Hr of kr)Ne.push(Hr)}}}Ne.sort((Mt,jt)=>jt.intersectionZ-Mt.intersectionZ);let qe=[];for(let Mt=this._order.length-1;Mt>=0;Mt--){let jt=this._order[Mt];if(pe(jt))for(let er=Ne.length-1;er>=0;er--){let kr=Ne[er].feature;if(Ie[kr.layer.id]{let di=Lt.featureSortOrder;if(di){let zi=di.indexOf($r.featureIndex);return di.indexOf(Zr.featureIndex)-zi}return Zr.featureIndex-$r.featureIndex});for(let $r of Lr)Yt.push($r)}}for(let Lt in tt)tt[Lt].forEach(Vt=>{let Nt=Vt.feature,Yt=kr[jt[Lt].source].getFeatureState(Nt.layer["source-layer"],Nt.id);Nt.source=Nt.layer.source,Nt.layer["source-layer"]&&(Nt.sourceLayer=Nt.layer["source-layer"]),Nt.state=Yt});return tt}(this._layers,Mt,this.sourceCaches,O,pe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(qe)}querySourceFeatures(O,pe){pe&&pe.filter&&this._validate(n.u.filter,"querySourceFeatures.filter",pe.filter,null,pe);let Ie=this.sourceCaches[O];return Ie?function(Ne,qe){let Mt=Ne.getRenderableIds().map(kr=>Ne.getTileByID(kr)),jt=[],er={};for(let kr=0;krki.getTileByID(Vi)).sort((Vi,tt)=>tt.tileID.overscaledZ-Vi.tileID.overscaledZ||(Vi.tileID.isLessThan(tt.tileID)?-1:1))}let Vr=this.crossTileSymbolIndex.addLayer(Hr,er[Hr.source],O.center.lng);Mt=Mt||Vr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((qe=qe||this._layerOrderChanged||Ie===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.now(),O.zoom))&&(this.pauseablePlacement=new Ha(O,this.map.terrain,this._order,qe,pe,Ie,Ne,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,er),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.now()),jt=!0),Mt&&this.pauseablePlacement.placement.setStale()),jt||Mt)for(let kr of this._order){let Hr=this._layers[kr];Hr.type==="symbol"&&this.placement.updateLayerOpacities(Hr,er[Hr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.now())}_releaseSymbolFadeTiles(){for(let O in this.sourceCaches)this.sourceCaches[O].releaseSymbolFadeTiles()}getImages(O,pe){return n._(this,void 0,void 0,function*(){let Ie=yield this.imageManager.getImages(pe.icons);this._updateTilesForChangedImages();let Ne=this.sourceCaches[pe.source];return Ne&&Ne.setDependencies(pe.tileID.key,pe.type,pe.icons),Ie})}getGlyphs(O,pe){return n._(this,void 0,void 0,function*(){let Ie=yield this.glyphManager.getGlyphs(pe.stacks),Ne=this.sourceCaches[pe.source];return Ne&&Ne.setDependencies(pe.tileID.key,pe.type,[""]),Ie})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(O,pe={}){this._checkLoaded(),O&&this._validate(n.u.glyphs,"glyphs",O,null,pe)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=O,this.glyphManager.entries={},this.glyphManager.setURL(O))}addSprite(O,pe,Ie={},Ne){this._checkLoaded();let qe=[{id:O,url:pe}],Mt=[...M(this.stylesheet.sprite),...qe];this._validate(n.u.sprite,"sprite",Mt,null,Ie)||(this.stylesheet.sprite=Mt,this._loadSprite(qe,!0,Ne))}removeSprite(O){this._checkLoaded();let pe=M(this.stylesheet.sprite);if(pe.find(Ie=>Ie.id===O)){if(this._spritesImagesIds[O])for(let Ie of this._spritesImagesIds[O])this.imageManager.removeImage(Ie),this._changedImages[Ie]=!0;pe.splice(pe.findIndex(Ie=>Ie.id===O),1),this.stylesheet.sprite=pe.length>0?pe:void 0,delete this._spritesImagesIds[O],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}else this.fire(new n.j(new Error(`Sprite "${O}" doesn't exists on this map.`)))}getSprite(){return M(this.stylesheet.sprite)}setSprite(O,pe={},Ie){this._checkLoaded(),O&&this._validate(n.u.sprite,"sprite",O,null,pe)||(this.stylesheet.sprite=O,O?this._loadSprite(O,!0,Ie):(this._unloadSprite(),Ie&&Ie(null)))}}var Pi=n.Y([{name:"a_pos",type:"Int16",components:2}]);let yi={prelude:zt(`#ifdef GL_ES +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}),lee=ze((te,Y)=>{Y.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}),K_=ze((te,Y)=>{var d=Xm(),y=see(),z=lee(),P='© OpenStreetMap contributors',i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",n="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",l="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",u="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",s={basic:a,streets:a,outdoors:a,light:i,dark:n,satellite:z,"satellite-streets":y,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:P,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":n,"carto-voyager":a,"carto-positron-nolabels":l,"carto-darkmatter-nolabels":o,"carto-voyager-nolabels":u},h=d(s);Y.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:h,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",h.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}),O6=ze((te,Y)=>{var d=ji(),y=Xi().defaultLine,z=Xh().attributes,P=On(),i=ff().textposition,n=oh().overrideAll,a=ku().templatedArray,l=K_(),o=P({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});o.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var u=Y.exports=n({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:z({name:"map"}),style:{valType:"any",values:l.styleValuesMap,dflt:l.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:a("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:y},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:y}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:o,textposition:d.extendFlat({},i,{arrayOk:!1})}})},"plot","from-root");u.uirevision={valType:"any",editType:"none"}}),pA=ze((te,Y)=>{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=Lm(),i=Lb(),n=ff(),a=O6(),l=xa(),o=Oc(),u=nn().extendFlat,s=oh().overrideAll,h=O6(),m=i.line,b=i.marker;Y.exports=s({lon:i.lon,lat:i.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},h.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},b.opacity,{dflt:1})},mode:u({},n.mode,{dflt:"markers"}),text:u({},n.text,{}),texttemplate:y({editType:"plot"},{keys:["lat","lon","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:u({},n.hovertext,{}),line:{color:m.color,width:m.width},connectgaps:n.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:b.opacity,size:b.size,sizeref:b.sizeref,sizemin:b.sizemin,sizemode:b.sizemode},o("marker")),fill:i.fill,fillcolor:P(),textfont:a.layers.symbol.textfont,textposition:a.layers.symbol.textposition,below:{valType:"string"},selected:{marker:n.selected.marker},unselected:{marker:n.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d(),hovertemplatefallback:z()},"calc","nested")}),fz=ze((te,Y)=>{var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];Y.exports={isSupportedFont:function(y){return d.indexOf(y)!==-1}}}),uee=ze((te,Y)=>{var d=ji(),y=Bc(),z=X0(),P=Pm(),i=mm(),n=Im(),a=pA(),l=fz().isSupportedFont;Y.exports=function(u,s,h,m){function b(g,C){return d.coerce(u,s,a,g,C)}function x(g,C){return d.coerce2(u,s,a,g,C)}var _=o(u,s,b);if(!_){s.visible=!1;return}if(b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext"),b("hovertemplate"),b("hovertemplatefallback"),b("mode"),b("below"),y.hasMarkers(s)){z(u,s,h,m,b,{noLine:!0,noAngle:!0}),b("marker.allowoverlap"),b("marker.angle");var A=s.marker;A.symbol!=="circle"&&(d.isArrayOrTypedArray(A.size)&&(A.size=A.size[0]),d.isArrayOrTypedArray(A.color)&&(A.color=A.color[0]))}y.hasLines(s)&&(P(u,s,h,m,b,{noDash:!0}),b("connectgaps"));var f=x("cluster.maxzoom"),k=x("cluster.step"),w=x("cluster.color",s.marker&&s.marker.color||h),D=x("cluster.size"),E=x("cluster.opacity"),I=f!==!1||k!==!1||w!==!1||D!==!1||E!==!1,M=b("cluster.enabled",I);if(M||y.hasText(s)){var p=m.font.family;i(u,s,m,b,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:l(p)?p:"Open Sans Regular",weight:m.font.weight,style:m.font.style,size:m.font.size,color:m.font.color}})}b("fill"),s.fill!=="none"&&n(u,s,h,b),d.coerceSelectionMarkerOpacity(s,b)};function o(u,s,h){var m=h("lon")||[],b=h("lat")||[],x=Math.min(m.length,b.length);return s._length=x,x}}),dz=ze((te,Y)=>{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot,a=n.mockAxis,l=y.lonlat;return i.lonLabel=d.tickText(a,a.c2l(l[0]),!0).text,i.latLabel=d.tickText(a,a.c2l(l[1]),!0).text,i}}),pz=ze((te,Y)=>{var d=ji();Y.exports=function(y,z){var P=y.split(" "),i=P[0],n=P[1],a=d.isArrayOrTypedArray(z)?d.mean(z):z,l=.5+a/100,o=1.5+a/100,u=["",""],s=[0,0];switch(i){case"top":u[0]="top",s[1]=-o;break;case"bottom":u[0]="bottom",s[1]=o;break}switch(n){case"left":u[1]="right",s[0]=-l;break;case"right":u[1]="left",s[0]=l;break}var h;return u[0]&&u[1]?h=u.join("-"):u[0]?h=u[0]:u[1]?h=u[1]:h="center",{anchor:h,offset:s}}}),cee=ze((te,Y)=>{var d=Sr(),y=ji(),z=ei().BADNUM,P=V_(),i=lh(),n=Zs(),a=$v(),l=Bc(),o=fz().isSupportedFont,u=pz(),s=T0().appendArrayPointValue,h=cc().NEWLINES,m=cc().BR_TAG_ALL;Y.exports=function(E,I){var M=I[0].trace,p=M.visible===!0&&M._length!==0,g=M.fill!=="none",C=l.hasLines(M),T=l.hasMarkers(M),N=l.hasText(M),B=T&&M.marker.symbol==="circle",U=T&&M.marker.symbol!=="circle",V=M.cluster&&M.cluster.enabled,W=b("fill"),F=b("line"),H=b("circle"),q=b("symbol"),G={fill:W,line:F,circle:H,symbol:q};if(!p)return G;var ee;if((g||C)&&(ee=P.calcTraceToLineCoords(I)),g&&(W.geojson=P.makePolygon(ee),W.layout.visibility="visible",y.extendFlat(W.paint,{"fill-color":M.fillcolor})),C&&(F.geojson=P.makeLine(ee),F.layout.visibility="visible",y.extendFlat(F.paint,{"line-width":M.line.width,"line-color":M.line.color,"line-opacity":M.opacity})),B){var he=x(I);H.geojson=he.geojson,H.layout.visibility="visible",V&&(H.filter=["!",["has","point_count"]],G.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":w(M.cluster.color,M.cluster.step),"circle-radius":w(M.cluster.size,M.cluster.step),"circle-opacity":w(M.cluster.opacity,M.cluster.step)}},G.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":D(M),"text-size":12}}),y.extendFlat(H.paint,{"circle-color":he.mcc,"circle-radius":he.mrc,"circle-opacity":he.mo})}if(B&&V&&(H.filter=["!",["has","point_count"]]),(U||N)&&(q.geojson=_(I,E),y.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),U&&(y.extendFlat(q.layout,{"icon-size":M.marker.size/10}),"angle"in M.marker&&M.marker.angle!=="auto"&&y.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=M.marker.allowoverlap,y.extendFlat(q.paint,{"icon-opacity":M.opacity*M.marker.opacity,"icon-color":M.marker.color})),N)){var be=(M.marker||{}).size,ve=u(M.textposition,be);y.extendFlat(q.layout,{"text-size":M.textfont.size,"text-anchor":ve.anchor,"text-offset":ve.offset,"text-font":D(M)}),y.extendFlat(q.paint,{"text-color":M.textfont.color,"text-opacity":M.opacity})}return G};function b(E){return{type:E,geojson:P.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function x(E){var I=E[0].trace,M=I.marker,p=I.selectedpoints,g=y.isArrayOrTypedArray(M.color),C=y.isArrayOrTypedArray(M.size),T=y.isArrayOrTypedArray(M.opacity),N;function B(ve){return I.opacity*ve}function U(ve){return ve/2}var V;g&&(i.hasColorscale(I,"marker")?V=i.makeColorScaleFuncFromTrace(M):V=y.identity);var W;C&&(W=a(I));var F;T&&(F=function(ve){var ce=d(ve)?+y.constrain(ve,0,1):0;return B(ce)});var H=[];for(N=0;N850?N+=" Black":g>750?N+=" Extra Bold":g>650?N+=" Bold":g>550?N+=" Semi Bold":g>450?N+=" Medium":g>350?N+=" Regular":g>250?N+=" Light":g>150?N+=" Extra Light":N+=" Thin"):C.slice(0,2).join(" ")==="Open Sans"?(N="Open Sans",g>750?N+=" Extrabold":g>650?N+=" Bold":g>550?N+=" Semibold":g>350?N+=" Regular":N+=" Light"):C.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(N="Klokantech Noto Sans",C[3]==="CJK"&&(N+=" CJK"),N+=g>500?" Bold":" Regular")),T&&(N+=" Italic"),N==="Open Sans Regular Italic"?N="Open Sans Italic":N==="Open Sans Regular Bold"?N="Open Sans Bold":N==="Open Sans Regular Bold Italic"?N="Open Sans Bold Italic":N==="Klokantech Noto Sans Regular Italic"&&(N="Klokantech Noto Sans Italic"),o(N)||(N=M);var B=N.split(", ");return B}}),hee=ze((te,Y)=>{var d=ji(),y=cee(),z=K_().traceLayerPrefix,P={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function i(a,l,o,u){this.type="scattermap",this.subplot=a,this.uid=l,this.clusterEnabled=o,this.isHidden=u,this.sourceIds={fill:"source-"+l+"-fill",line:"source-"+l+"-line",circle:"source-"+l+"-circle",symbol:"source-"+l+"-symbol",cluster:"source-"+l+"-circle",clusterCount:"source-"+l+"-circle"},this.layerIds={fill:z+l+"-fill",line:z+l+"-line",circle:z+l+"-circle",symbol:z+l+"-symbol",cluster:z+l+"-cluster",clusterCount:z+l+"-cluster-count"},this.below=null}var n=i.prototype;n.addSource=function(a,l,o){var u={type:"geojson",data:l.geojson};o&&o.enabled&&d.extendFlat(u,{cluster:!0,clusterMaxZoom:o.maxzoom});var s=this.subplot.map.getSource(this.sourceIds[a]);s?s.setData(l.geojson):this.subplot.map.addSource(this.sourceIds[a],u)},n.setSourceData=function(a,l){this.subplot.map.getSource(this.sourceIds[a]).setData(l.geojson)},n.addLayer=function(a,l,o){var u={type:l.type,id:this.layerIds[a],source:this.sourceIds[a],layout:l.layout,paint:l.paint};l.filter&&(u.filter=l.filter);for(var s=this.layerIds[a],h,m=this.subplot.getMapLayers(),b=0;b=0;C--){var T=g[C];u.removeLayer(x.layerIds[T])}p||u.removeSource(x.sourceIds.circle)}function f(p){for(var g=P.nonCluster,C=0;C=0;C--){var T=g[C];u.removeLayer(x.layerIds[T]),p||u.removeSource(x.sourceIds[T])}}function w(p){b?A(p):k(p)}function D(p){m?_(p):f(p)}function E(){for(var p=m?P.cluster:P.nonCluster,g=0;g=0;o--){var u=l[o];a.removeLayer(this.layerIds[u]),a.removeSource(this.sourceIds[u])}},Y.exports=function(a,l){var o=l[0].trace,u=o.cluster&&o.cluster.enabled,s=o.visible!==!0,h=new i(a,o.uid,u,s),m=y(a.gd,l),b=h.below=a.belowLookup["trace-"+o.uid],x,_,A;if(u)for(h.addSource("circle",m.circle,o.cluster),x=0;x{var d=hf(),y=ji(),z=qu(),P=y.fillText,i=ei().BADNUM,n=K_().traceLayerPrefix;function a(o,u,s){var h=o.cd,m=h[0].trace,b=o.xa,x=o.ya,_=o.subplot,A=[],f=n+m.uid+"-circle",k=m.cluster&&m.cluster.enabled;if(k){var w=_.map.queryRenderedFeatures(null,{layers:[f]});A=w.map(function(W){return W.id})}var D=u>=0?Math.floor((u+180)/360):Math.ceil((u-180)/360),E=D*360,I=u-E;function M(W){var F=W.lonlat;if(F[0]===i||k&&A.indexOf(W.i+1)===-1)return 1/0;var H=y.modHalf(F[0],360),q=F[1],G=_.project([H,q]),ee=G.x-b.c2p([I,q]),he=G.y-x.c2p([H,s]),be=Math.max(3,W.mrc||0);return Math.max(Math.sqrt(ee*ee+he*he)-be,1-3/be)}if(d.getClosest(h,M,o),o.index!==!1){var p=h[o.index],g=p.lonlat,C=[y.modHalf(g[0],360)+E,g[1]],T=b.c2p(C),N=x.c2p(C),B=p.mrc||1;o.x0=T-B,o.x1=T+B,o.y0=N-B,o.y1=N+B;var U={};U[m.subplot]={_subplot:_};var V=m._module.formatLabels(p,m,U);return o.lonLabel=V.lonLabel,o.latLabel=V.latLabel,o.color=z(m,p),o.extraText=l(m,p,h[0].t.labels),o.hovertemplate=m.hovertemplate,[o]}}function l(o,u,s){if(o.hovertemplate)return;var h=u.hi||o.hoverinfo,m=h.split("+"),b=m.indexOf("all")!==-1,x=m.indexOf("lon")!==-1,_=m.indexOf("lat")!==-1,A=u.lonlat,f=[];function k(w){return w+"°"}return b||x&&_?f.push("("+k(A[1])+", "+k(A[0])+")"):x?f.push(s.lon+k(A[0])):_&&f.push(s.lat+k(A[1])),(b||m.indexOf("text")!==-1)&&P(u,o,f),f.join("
")}Y.exports={hoverPoints:a,getExtraText:l}}),fee=ze((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d}}),dee=ze((te,Y)=>{var d=ji(),y=Bc(),z=ei().BADNUM;Y.exports=function(P,i){var n=P.cd,a=P.xaxis,l=P.yaxis,o=[],u=n[0].trace,s;if(!y.hasMarkers(u))return[];if(i===!1)for(s=0;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?Y.exports=y():(d=typeof globalThis<"u"?globalThis:d||self,d.maplibregl=y())})(te,function(){var d={},y={};function z(i,n,a){if(y[i]=a,i==="index"){var l="var sharedModule = {}; ("+y.shared+")(sharedModule); ("+y.worker+")(sharedModule);",o={};return y.shared(o),y.index(d,o),typeof window<"u"&&d.setWorkerUrl(window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}))),d}}z("shared",["exports"],function(i){function n(X,R,ae,ke){return new(ae||(ae=Promise))(function(Ue,Qe){function rt(sr){try{$t(ke.next(sr))}catch(Ar){Qe(Ar)}}function Ct(sr){try{$t(ke.throw(sr))}catch(Ar){Qe(Ar)}}function $t(sr){var Ar;sr.done?Ue(sr.value):(Ar=sr.value,Ar instanceof ae?Ar:new ae(function(Rr){Rr(Ar)})).then(rt,Ct)}$t((ke=ke.apply(X,R||[])).next())})}function a(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}typeof SuppressedError=="function"&&SuppressedError;var l=o;function o(X,R){this.x=X,this.y=R}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(X){return this.clone()._add(X)},sub:function(X){return this.clone()._sub(X)},multByPoint:function(X){return this.clone()._multByPoint(X)},divByPoint:function(X){return this.clone()._divByPoint(X)},mult:function(X){return this.clone()._mult(X)},div:function(X){return this.clone()._div(X)},rotate:function(X){return this.clone()._rotate(X)},rotateAround:function(X,R){return this.clone()._rotateAround(X,R)},matMult:function(X){return this.clone()._matMult(X)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(X){return this.x===X.x&&this.y===X.y},dist:function(X){return Math.sqrt(this.distSqr(X))},distSqr:function(X){var R=X.x-this.x,ae=X.y-this.y;return R*R+ae*ae},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(X){return Math.atan2(this.y-X.y,this.x-X.x)},angleWith:function(X){return this.angleWithSep(X.x,X.y)},angleWithSep:function(X,R){return Math.atan2(this.x*R-this.y*X,this.x*X+this.y*R)},_matMult:function(X){var R=X[2]*this.x+X[3]*this.y;return this.x=X[0]*this.x+X[1]*this.y,this.y=R,this},_add:function(X){return this.x+=X.x,this.y+=X.y,this},_sub:function(X){return this.x-=X.x,this.y-=X.y,this},_mult:function(X){return this.x*=X,this.y*=X,this},_div:function(X){return this.x/=X,this.y/=X,this},_multByPoint:function(X){return this.x*=X.x,this.y*=X.y,this},_divByPoint:function(X){return this.x/=X.x,this.y/=X.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var X=this.y;return this.y=this.x,this.x=-X,this},_rotate:function(X){var R=Math.cos(X),ae=Math.sin(X),ke=ae*this.x+R*this.y;return this.x=R*this.x-ae*this.y,this.y=ke,this},_rotateAround:function(X,R){var ae=Math.cos(X),ke=Math.sin(X),Ue=R.y+ke*(this.x-R.x)+ae*(this.y-R.y);return this.x=R.x+ae*(this.x-R.x)-ke*(this.y-R.y),this.y=Ue,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(X){return X instanceof o?X:Array.isArray(X)?new o(X[0],X[1]):X};var u=a(l),s=h;function h(X,R,ae,ke){this.cx=3*X,this.bx=3*(ae-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(ke-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=ae,this.p2y=ke}h.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var ae=X,ke=0;ke<8;ke++){var Ue=this.sampleCurveX(ae)-X;if(Math.abs(Ue)Ue?rt=ae:Ct=ae,ae=.5*(Ct-rt)+rt;return ae},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var m=a(s);let b,x;function _(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function A(){if(x==null&&(x=!1,_())){let X=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(X){for(let ae=0;ae<25;ae++){let ke=4*ae;X.fillStyle=`rgb(${ke},${ke+1},${ke+2})`,X.fillRect(ae%5,Math.floor(ae/5),1,1)}let R=X.getImageData(0,0,5,5).data;for(let ae=0;ae<100;ae++)if(ae%4!=3&&R[ae]!==ae){x=!0;break}}}return x||!1}function f(X,R,ae,ke){let Ue=new m(X,R,ae,ke);return Qe=>Ue.solve(Qe)}let k=f(.25,.1,.25,1);function w(X,R,ae){return Math.min(ae,Math.max(R,X))}function D(X,R,ae){let ke=ae-R,Ue=((X-R)%ke+ke)%ke+R;return Ue===R?ae:Ue}function E(X,...R){for(let ae of R)for(let ke in ae)X[ke]=ae[ke];return X}let I=1;function M(X,R,ae){let ke={};for(let Ue in X)ke[Ue]=R.call(this,X[Ue],Ue,X);return ke}function p(X,R,ae){let ke={};for(let Ue in X)R.call(this,X[Ue],Ue,X)&&(ke[Ue]=X[Ue]);return ke}function g(X){return Array.isArray(X)?X.map(g):typeof X=="object"&&X?M(X,g):X}let C={};function T(X){C[X]||(typeof console<"u"&&console.warn(X),C[X]=!0)}function N(X,R,ae){return(ae.y-X.y)*(R.x-X.x)>(R.y-X.y)*(ae.x-X.x)}function B(X){return typeof WorkerGlobalScope<"u"&&X!==void 0&&X instanceof WorkerGlobalScope}let U=null;function V(X){return typeof ImageBitmap<"u"&&X instanceof ImageBitmap}let W="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function F(X,R,ae,ke,Ue){return n(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let Qe=new VideoFrame(X,{timestamp:0});try{let rt=Qe?.format;if(!rt||!rt.startsWith("BGR")&&!rt.startsWith("RGB"))throw new Error(`Unrecognized format ${rt}`);let Ct=rt.startsWith("BGR"),$t=new Uint8ClampedArray(ke*Ue*4);if(yield Qe.copyTo($t,function(sr,Ar,Rr,oi,wi){let Fi=4*Math.max(-Ar,0),Gi=(Math.max(0,Rr)-Rr)*oi*4+Fi,mn=4*oi,Un=Math.max(0,Ar),Fa=Math.max(0,Rr);return{rect:{x:Un,y:Fa,width:Math.min(sr.width,Ar+oi)-Un,height:Math.min(sr.height,Rr+wi)-Fa},layout:[{offset:Gi,stride:mn}]}}(X,R,ae,ke,Ue)),Ct)for(let sr=0;sr<$t.length;sr+=4){let Ar=$t[sr];$t[sr]=$t[sr+2],$t[sr+2]=Ar}return $t}finally{Qe.close()}})}let H,q,G="AbortError";function ee(){return new Error(G)}let he={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function be(X){return he.REGISTERED_PROTOCOLS[X.substring(0,X.indexOf("://"))]}let ve="global-dispatcher";class ce extends Error{constructor(R,ae,ke,Ue){super(`AJAXError: ${ae} (${R}): ${ke}`),this.status=R,this.statusText=ae,this.url=ke,this.body=Ue}}let re=()=>B(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ge=function(X,R){if(/:\/\//.test(X.url)&&!/^https?:|^file:/.test(X.url)){let ke=be(X.url);if(ke)return ke(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,targetMapId:ve},R)}if(!(/^file:/.test(ae=X.url)||/^file:/.test(re())&&!/^\w+:/.test(ae))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(ke,Ue){return n(this,void 0,void 0,function*(){let Qe=new Request(ke.url,{method:ke.method||"GET",body:ke.body,credentials:ke.credentials,headers:ke.headers,cache:ke.cache,referrer:re(),signal:Ue.signal});ke.type!=="json"||Qe.headers.has("Accept")||Qe.headers.set("Accept","application/json");let rt=yield fetch(Qe);if(!rt.ok){let sr=yield rt.blob();throw new ce(rt.status,rt.statusText,ke.url,sr)}let Ct;Ct=ke.type==="arrayBuffer"||ke.type==="image"?rt.arrayBuffer():ke.type==="json"?rt.json():rt.text();let $t=yield Ct;if(Ue.signal.aborted)throw ee();return{data:$t,cacheControl:rt.headers.get("Cache-Control"),expires:rt.headers.get("Expires")}})}(X,R);if(B(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:X,mustQueue:!0,targetMapId:ve},R)}var ae;return function(ke,Ue){return new Promise((Qe,rt)=>{var Ct;let $t=new XMLHttpRequest;$t.open(ke.method||"GET",ke.url,!0),ke.type!=="arrayBuffer"&&ke.type!=="image"||($t.responseType="arraybuffer");for(let sr in ke.headers)$t.setRequestHeader(sr,ke.headers[sr]);ke.type==="json"&&($t.responseType="text",!((Ct=ke.headers)===null||Ct===void 0)&&Ct.Accept||$t.setRequestHeader("Accept","application/json")),$t.withCredentials=ke.credentials==="include",$t.onerror=()=>{rt(new Error($t.statusText))},$t.onload=()=>{if(!Ue.signal.aborted)if(($t.status>=200&&$t.status<300||$t.status===0)&&$t.response!==null){let sr=$t.response;if(ke.type==="json")try{sr=JSON.parse($t.response)}catch(Ar){return void rt(Ar)}Qe({data:sr,cacheControl:$t.getResponseHeader("Cache-Control"),expires:$t.getResponseHeader("Expires")})}else{let sr=new Blob([$t.response],{type:$t.getResponseHeader("Content-Type")});rt(new ce($t.status,$t.statusText,ke.url,sr))}},Ue.signal.addEventListener("abort",()=>{$t.abort(),rt(ee())}),$t.send(ke.body)})}(X,R)};function ne(X){if(!X||X.indexOf("://")<=0||X.indexOf("data:image/")===0||X.indexOf("blob:")===0)return!0;let R=new URL(X),ae=window.location;return R.protocol===ae.protocol&&R.host===ae.host}function se(X,R,ae){ae[X]&&ae[X].indexOf(R)!==-1||(ae[X]=ae[X]||[],ae[X].push(R))}function _e(X,R,ae){if(ae&&ae[X]){let ke=ae[X].indexOf(R);ke!==-1&&ae[X].splice(ke,1)}}class oe{constructor(R,ae={}){E(this,ae),this.type=R}}class J extends oe{constructor(R,ae={}){super("error",E({error:R},ae))}}class me{on(R,ae){return this._listeners=this._listeners||{},se(R,ae,this._listeners),this}off(R,ae){return _e(R,ae,this._listeners),_e(R,ae,this._oneTimeListeners),this}once(R,ae){return ae?(this._oneTimeListeners=this._oneTimeListeners||{},se(R,ae,this._oneTimeListeners),this):new Promise(ke=>this.once(R,ke))}fire(R,ae){typeof R=="string"&&(R=new oe(R,ae||{}));let ke=R.type;if(this.listens(ke)){R.target=this;let Ue=this._listeners&&this._listeners[ke]?this._listeners[ke].slice():[];for(let Ct of Ue)Ct.call(this,R);let Qe=this._oneTimeListeners&&this._oneTimeListeners[ke]?this._oneTimeListeners[ke].slice():[];for(let Ct of Qe)_e(ke,Ct,this._oneTimeListeners),Ct.call(this,R);let rt=this._eventedParent;rt&&(E(R,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),rt.fire(R))}else R instanceof J&&console.error(R.error);return this}listens(R){return this._listeners&&this._listeners[R]&&this._listeners[R].length>0||this._oneTimeListeners&&this._oneTimeListeners[R]&&this._oneTimeListeners[R].length>0||this._eventedParent&&this._eventedParent.listens(R)}setEventedParent(R,ae){return this._eventedParent=R,this._eventedParentData=ae,this}}var fe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};let Ce=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Re(X,R){let ae={};for(let ke in X)ke!=="ref"&&(ae[ke]=X[ke]);return Ce.forEach(ke=>{ke in R&&(ae[ke]=R[ke])}),ae}function Be(X,R){if(Array.isArray(X)){if(!Array.isArray(R)||X.length!==R.length)return!1;for(let ae=0;ae`:X.itemType.kind==="value"?"array":`array<${R}>`}return X.kind}let De=[ut,Et,Gt,Qt,vr,Lr,mr,Xe(Yr),ci,vi,Ot];function ye(X,R){if(R.kind==="error")return null;if(X.kind==="array"){if(R.kind==="array"&&(R.N===0&&R.itemType.kind==="value"||!ye(X.itemType,R.itemType))&&(typeof X.N!="number"||X.N===R.N))return null}else{if(X.kind===R.kind)return null;if(X.kind==="value"){for(let ae of De)if(!ye(ae,R))return null}}return`Expected ${ot(X)} but found ${ot(R)} instead.`}function Pe(X,R){return R.some(ae=>ae.kind===X.kind)}function He(X,R){return R.some(ae=>ae==="null"?X===null:ae==="array"?Array.isArray(X):ae==="object"?X&&!Array.isArray(X)&&typeof X=="object":ae===typeof X)}function at(X,R){return X.kind==="array"&&R.kind==="array"?X.itemType.kind===R.itemType.kind&&typeof X.N=="number":X.kind===R.kind}let ht=.96422,At=.82521,Wt=4/29,Yt=6/29,hr=3*Yt*Yt,zr=Yt*Yt*Yt,Dr=Math.PI/180,br=180/Math.PI;function fi(X){return(X%=360)<0&&(X+=360),X}function un([X,R,ae,ke]){let Ue,Qe,rt=yn((.2225045*(X=cn(X))+.7168786*(R=cn(R))+.0606169*(ae=cn(ae)))/1);X===R&&R===ae?Ue=Qe=rt:(Ue=yn((.4360747*X+.3850649*R+.1430804*ae)/ht),Qe=yn((.0139322*X+.0971045*R+.7141733*ae)/At));let Ct=116*rt-16;return[Ct<0?0:Ct,500*(Ue-rt),200*(rt-Qe),ke]}function cn(X){return X<=.04045?X/12.92:Math.pow((X+.055)/1.055,2.4)}function yn(X){return X>zr?Math.pow(X,1/3):X/hr+Wt}function Gn([X,R,ae,ke]){let Ue=(X+16)/116,Qe=isNaN(R)?Ue:Ue+R/500,rt=isNaN(ae)?Ue:Ue-ae/200;return Ue=1*dn(Ue),Qe=ht*dn(Qe),rt=At*dn(rt),[Sn(3.1338561*Qe-1.6168667*Ue-.4906146*rt),Sn(-.9787684*Qe+1.9161415*Ue+.033454*rt),Sn(.0719453*Qe-.2289914*Ue+1.4052427*rt),ke]}function Sn(X){return(X=X<=.00304?12.92*X:1.055*Math.pow(X,1/2.4)-.055)<0?0:X>1?1:X}function dn(X){return X>Yt?X*X*X:hr*(X-Wt)}function va(X){return parseInt(X.padEnd(2,X),16)/255}function na(X,R){return Kt(R?X/100:X,0,1)}function Kt(X,R,ae){return Math.min(Math.max(R,X),ae)}function lr(X){return!X.some(Number.isNaN)}let _r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Er{constructor(R,ae,ke,Ue=1,Qe=!0){this.r=R,this.g=ae,this.b=ke,this.a=Ue,Qe||(this.r*=Ue,this.g*=Ue,this.b*=Ue,Ue||this.overwriteGetter("rgb",[R,ae,ke,Ue]))}static parse(R){if(R instanceof Er)return R;if(typeof R!="string")return;let ae=function(ke){if((ke=ke.toLowerCase().trim())==="transparent")return[0,0,0,0];let Ue=_r[ke];if(Ue){let[rt,Ct,$t]=Ue;return[rt/255,Ct/255,$t/255,1]}if(ke.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(ke)){let rt=ke.length<6?1:2,Ct=1;return[va(ke.slice(Ct,Ct+=rt)),va(ke.slice(Ct,Ct+=rt)),va(ke.slice(Ct,Ct+=rt)),va(ke.slice(Ct,Ct+rt)||"ff")]}if(ke.startsWith("rgb")){let rt=ke.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(rt){let[Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un,Fa]=rt,ha=[Ar||" ",wi||" ",mn].join("");if(ha===" "||ha===" /"||ha===",,"||ha===",,,"){let Ma=[sr,oi,Gi].join(""),lo=Ma==="%%%"?100:Ma===""?255:0;if(lo){let Oo=[Kt(+$t/lo,0,1),Kt(+Rr/lo,0,1),Kt(+Fi/lo,0,1),Un?na(+Un,Fa):1];if(lr(Oo))return Oo}}return}}let Qe=ke.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Qe){let[rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi]=Qe,Gi=[$t||" ",Ar||" ",oi].join("");if(Gi===" "||Gi===" /"||Gi===",,"||Gi===",,,"){let mn=[+Ct,Kt(+sr,0,100),Kt(+Rr,0,100),wi?na(+wi,Fi):1];if(lr(mn))return function([Un,Fa,ha,Ma]){function lo(Oo){let Is=(Oo+Un/30)%12,Bl=Fa*Math.min(ha,1-ha);return ha-Bl*Math.max(-1,Math.min(Is-3,9-Is,1))}return Un=fi(Un),Fa/=100,ha/=100,[lo(0),lo(8),lo(4),Ma]}(mn)}}}(R);return ae?new Er(...ae,!1):void 0}get rgb(){let{r:R,g:ae,b:ke,a:Ue}=this,Qe=Ue||1/0;return this.overwriteGetter("rgb",[R/Qe,ae/Qe,ke/Qe,Ue])}get hcl(){return this.overwriteGetter("hcl",function(R){let[ae,ke,Ue,Qe]=un(R),rt=Math.sqrt(ke*ke+Ue*Ue);return[Math.round(1e4*rt)?fi(Math.atan2(Ue,ke)*br):NaN,rt,ae,Qe]}(this.rgb))}get lab(){return this.overwriteGetter("lab",un(this.rgb))}overwriteGetter(R,ae){return Object.defineProperty(this,R,{value:ae}),ae}toString(){let[R,ae,ke,Ue]=this.rgb;return`rgba(${[R,ae,ke].map(Qe=>Math.round(255*Qe)).join(",")},${Ue})`}}Er.black=new Er(0,0,0,1),Er.white=new Er(1,1,1,1),Er.transparent=new Er(0,0,0,0),Er.red=new Er(1,0,0,1);class di{constructor(R,ae,ke){this.sensitivity=R?ae?"variant":"case":ae?"accent":"base",this.locale=ke,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(R,ae){return this.collator.compare(R,ae)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class qi{constructor(R,ae,ke,Ue,Qe){this.text=R,this.image=ae,this.scale=ke,this.fontStack=Ue,this.textColor=Qe}}class Ui{constructor(R){this.sections=R}static fromString(R){return new Ui([new qi(R,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(R=>R.text.length!==0||R.image&&R.image.name.length!==0)}static factory(R){return R instanceof Ui?R:Ui.fromString(R)}toString(){return this.sections.length===0?"":this.sections.map(R=>R.text).join("")}}class Hi{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Hi)return R;if(typeof R=="number")return new Hi([R,R,R,R]);if(Array.isArray(R)&&!(R.length<1||R.length>4)){for(let ae of R)if(typeof ae!="number")return;switch(R.length){case 1:R=[R[0],R[0],R[0],R[0]];break;case 2:R=[R[0],R[1],R[0],R[1]];break;case 3:R=[R[0],R[1],R[2],R[1]]}return new Hi(R)}}toString(){return JSON.stringify(this.values)}}let Ln=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fn{constructor(R){this.values=R.slice()}static parse(R){if(R instanceof Fn)return R;if(Array.isArray(R)&&!(R.length<1)&&R.length%2==0){for(let ae=0;ae=0&&X<=255&&typeof R=="number"&&R>=0&&R<=255&&typeof ae=="number"&&ae>=0&&ae<=255?ke===void 0||typeof ke=="number"&&ke>=0&&ke<=1?null:`Invalid rgba value [${[X,R,ae,ke].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof ke=="number"?[X,R,ae,ke]:[X,R,ae]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function sa(X){if(X===null||typeof X=="string"||typeof X=="boolean"||typeof X=="number"||X instanceof Er||X instanceof di||X instanceof Ui||X instanceof Hi||X instanceof Fn||X instanceof Kn)return!0;if(Array.isArray(X)){for(let R of X)if(!sa(R))return!1;return!0}if(typeof X=="object"){for(let R in X)if(!sa(X[R]))return!1;return!0}return!1}function Mn(X){if(X===null)return ut;if(typeof X=="string")return Gt;if(typeof X=="boolean")return Qt;if(typeof X=="number")return Et;if(X instanceof Er)return vr;if(X instanceof di)return ii;if(X instanceof Ui)return Lr;if(X instanceof Hi)return ci;if(X instanceof Fn)return Ot;if(X instanceof Kn)return vi;if(Array.isArray(X)){let R=X.length,ae;for(let ke of X){let Ue=Mn(ke);if(ae){if(ae===Ue)continue;ae=Yr;break}ae=Ue}return Xe(ae||Yr,R)}return mr}function Ha(X){let R=typeof X;return X===null?"":R==="string"||R==="number"||R==="boolean"?String(X):X instanceof Er||X instanceof Ui||X instanceof Hi||X instanceof Fn||X instanceof Kn?X.toString():JSON.stringify(X)}class io{constructor(R,ae){this.type=R,this.value=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'literal' expression requires exactly one argument, but found ${R.length-1} instead.`);if(!sa(R[1]))return ae.error("invalid value");let ke=R[1],Ue=Mn(ke),Qe=ae.expectedType;return Ue.kind!=="array"||Ue.N!==0||!Qe||Qe.kind!=="array"||typeof Qe.N=="number"&&Qe.N!==0||(Ue=Qe),new io(Ue,ke)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ft{constructor(R){this.name="ExpressionEvaluationError",this.message=R}toJSON(){return this.message}}let Rt={string:Gt,number:Et,boolean:Qt,object:mr};class qr{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke,Ue=1,Qe=R[0];if(Qe==="array"){let Ct,$t;if(R.length>2){let sr=R[1];if(typeof sr!="string"||!(sr in Rt)||sr==="object")return ae.error('The item type argument of "array" must be one of string, number, boolean',1);Ct=Rt[sr],Ue++}else Ct=Yr;if(R.length>3){if(R[2]!==null&&(typeof R[2]!="number"||R[2]<0||R[2]!==Math.floor(R[2])))return ae.error('The length argument to "array" must be a positive integer literal',2);$t=R[2],Ue++}ke=Xe(Ct,$t)}else{if(!Rt[Qe])throw new Error(`Types doesn't contain name = ${Qe}`);ke=Rt[Qe]}let rt=[];for(;UeR.outputDefined())}}let ai={"to-boolean":Qt,"to-color":vr,"to-number":Et,"to-string":Gt};class si{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke=R[0];if(!ai[ke])throw new Error(`Can't parse ${ke} as it is not part of the known types`);if((ke==="to-boolean"||ke==="to-string")&&R.length!==2)return ae.error("Expected one argument.");let Ue=ai[ke],Qe=[];for(let rt=1;rt4?`Invalid rbga value ${JSON.stringify(ae)}: expected an array containing either three or four numeric values.`:Jn(ae[0],ae[1],ae[2],ae[3]),!ke))return new Er(ae[0]/255,ae[1]/255,ae[2]/255,ae[3])}throw new Ft(ke||`Could not parse color from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"padding":{let ae;for(let ke of this.args){ae=ke.evaluate(R);let Ue=Hi.parse(ae);if(Ue)return Ue}throw new Ft(`Could not parse padding from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"variableAnchorOffsetCollection":{let ae;for(let ke of this.args){ae=ke.evaluate(R);let Ue=Fn.parse(ae);if(Ue)return Ue}throw new Ft(`Could not parse variableAnchorOffsetCollection from value '${typeof ae=="string"?ae:JSON.stringify(ae)}'`)}case"number":{let ae=null;for(let ke of this.args){if(ae=ke.evaluate(R),ae===null)return 0;let Ue=Number(ae);if(!isNaN(Ue))return Ue}throw new Ft(`Could not convert ${JSON.stringify(ae)} to number.`)}case"formatted":return Ui.fromString(Ha(this.args[0].evaluate(R)));case"resolvedImage":return Kn.fromString(Ha(this.args[0].evaluate(R)));default:return Ha(this.args[0].evaluate(R))}}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}let Gr=["Unknown","Point","LineString","Polygon"];class li{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Gr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(R){let ae=this._parseColorCache[R];return ae||(ae=this._parseColorCache[R]=Er.parse(R)),ae}}class Pi{constructor(R,ae,ke=[],Ue,Qe=new xt,rt=[]){this.registry=R,this.path=ke,this.key=ke.map(Ct=>`[${Ct}]`).join(""),this.scope=Qe,this.errors=rt,this.expectedType=Ue,this._isConstant=ae}parse(R,ae,ke,Ue,Qe={}){return ae?this.concat(ae,ke,Ue)._parse(R,Qe):this._parse(R,Qe)}_parse(R,ae){function ke(Ue,Qe,rt){return rt==="assert"?new qr(Qe,[Ue]):rt==="coerce"?new si(Qe,[Ue]):Ue}if(R!==null&&typeof R!="string"&&typeof R!="boolean"&&typeof R!="number"||(R=["literal",R]),Array.isArray(R)){if(R.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let Ue=R[0];if(typeof Ue!="string")return this.error(`Expression name must be a string, but found ${typeof Ue} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let Qe=this.registry[Ue];if(Qe){let rt=Qe.parse(R,this);if(!rt)return null;if(this.expectedType){let Ct=this.expectedType,$t=rt.type;if(Ct.kind!=="string"&&Ct.kind!=="number"&&Ct.kind!=="boolean"&&Ct.kind!=="object"&&Ct.kind!=="array"||$t.kind!=="value")if(Ct.kind!=="color"&&Ct.kind!=="formatted"&&Ct.kind!=="resolvedImage"||$t.kind!=="value"&&$t.kind!=="string")if(Ct.kind!=="padding"||$t.kind!=="value"&&$t.kind!=="number"&&$t.kind!=="array")if(Ct.kind!=="variableAnchorOffsetCollection"||$t.kind!=="value"&&$t.kind!=="array"){if(this.checkSubtype(Ct,$t))return null}else rt=ke(rt,Ct,ae.typeAnnotation||"coerce");else rt=ke(rt,Ct,ae.typeAnnotation||"coerce");else rt=ke(rt,Ct,ae.typeAnnotation||"coerce");else rt=ke(rt,Ct,ae.typeAnnotation||"assert")}if(!(rt instanceof io)&&rt.type.kind!=="resolvedImage"&&this._isConstant(rt)){let Ct=new li;try{rt=new io(rt.type,rt.evaluate(Ct))}catch($t){return this.error($t.message),null}}return rt}return this.error(`Unknown expression "${Ue}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(R===void 0?"'undefined' value invalid. Use null instead.":typeof R=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof R} instead.`)}concat(R,ae,ke){let Ue=typeof R=="number"?this.path.concat(R):this.path,Qe=ke?this.scope.concat(ke):this.scope;return new Pi(this.registry,this._isConstant,Ue,ae||null,Qe,this.errors)}error(R,...ae){let ke=`${this.key}${ae.map(Ue=>`[${Ue}]`).join("")}`;this.errors.push(new nt(ke,R))}checkSubtype(R,ae){let ke=ye(R,ae);return ke&&this.error(ke),ke}}class xi{constructor(R,ae){this.type=ae.type,this.bindings=[].concat(R),this.result=ae}evaluate(R){return this.result.evaluate(R)}eachChild(R){for(let ae of this.bindings)R(ae[1]);R(this.result)}static parse(R,ae){if(R.length<4)return ae.error(`Expected at least 3 arguments, but found ${R.length-1} instead.`);let ke=[];for(let Qe=1;Qe=ke.length)throw new Ft(`Array index out of bounds: ${ae} > ${ke.length-1}.`);if(ae!==Math.floor(ae))throw new Ft(`Array index must be an integer, but found ${ae} instead.`);return ke[ae]}eachChild(R){R(this.index),R(this.input)}outputDefined(){return!1}}class Qr{constructor(R,ae){this.type=Qt,this.needle=R,this.haystack=ae}static parse(R,ae){if(R.length!==3)return ae.error(`Expected 2 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Yr),Ue=ae.parse(R[2],2,Yr);return ke&&Ue?Pe(ke.type,[Qt,Gt,Et,ut,Yr])?new Qr(ke,Ue):ae.error(`Expected first argument to be of type boolean, string, number or null, but found ${ot(ke.type)} instead`):null}evaluate(R){let ae=this.needle.evaluate(R),ke=this.haystack.evaluate(R);if(!ke)return!1;if(!He(ae,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${ot(Mn(ae))} instead.`);if(!He(ke,["string","array"]))throw new Ft(`Expected second argument to be of type array or string, but found ${ot(Mn(ke))} instead.`);return ke.indexOf(ae)>=0}eachChild(R){R(this.needle),R(this.haystack)}outputDefined(){return!0}}class Ri{constructor(R,ae,ke){this.type=Et,this.needle=R,this.haystack=ae,this.fromIndex=ke}static parse(R,ae){if(R.length<=2||R.length>=5)return ae.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Yr),Ue=ae.parse(R[2],2,Yr);if(!ke||!Ue)return null;if(!Pe(ke.type,[Qt,Gt,Et,ut,Yr]))return ae.error(`Expected first argument to be of type boolean, string, number or null, but found ${ot(ke.type)} instead`);if(R.length===4){let Qe=ae.parse(R[3],3,Et);return Qe?new Ri(ke,Ue,Qe):null}return new Ri(ke,Ue)}evaluate(R){let ae=this.needle.evaluate(R),ke=this.haystack.evaluate(R);if(!He(ae,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${ot(Mn(ae))} instead.`);let Ue;if(this.fromIndex&&(Ue=this.fromIndex.evaluate(R)),He(ke,["string"])){let Qe=ke.indexOf(ae,Ue);return Qe===-1?-1:[...ke.slice(0,Qe)].length}if(He(ke,["array"]))return ke.indexOf(ae,Ue);throw new Ft(`Expected second argument to be of type array or string, but found ${ot(Mn(ke))} instead.`)}eachChild(R){R(this.needle),R(this.haystack),this.fromIndex&&R(this.fromIndex)}outputDefined(){return!1}}class en{constructor(R,ae,ke,Ue,Qe,rt){this.inputType=R,this.type=ae,this.input=ke,this.cases=Ue,this.outputs=Qe,this.otherwise=rt}static parse(R,ae){if(R.length<5)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if(R.length%2!=1)return ae.error("Expected an even number of arguments.");let ke,Ue;ae.expectedType&&ae.expectedType.kind!=="value"&&(Ue=ae.expectedType);let Qe={},rt=[];for(let sr=2;srNumber.MAX_SAFE_INTEGER)return oi.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Fi=="number"&&Math.floor(Fi)!==Fi)return oi.error("Numeric branch labels must be integer values.");if(ke){if(oi.checkSubtype(ke,Mn(Fi)))return null}else ke=Mn(Fi);if(Qe[String(Fi)]!==void 0)return oi.error("Branch labels must be unique.");Qe[String(Fi)]=rt.length}let wi=ae.parse(Rr,sr,Ue);if(!wi)return null;Ue=Ue||wi.type,rt.push(wi)}let Ct=ae.parse(R[1],1,Yr);if(!Ct)return null;let $t=ae.parse(R[R.length-1],R.length-1,Ue);return $t?Ct.type.kind!=="value"&&ae.concat(1).checkSubtype(ke,Ct.type)?null:new en(ke,Ue,Ct,Qe,rt,$t):null}evaluate(R){let ae=this.input.evaluate(R);return(Mn(ae)===this.inputType&&this.outputs[this.cases[ae]]||this.otherwise).evaluate(R)}eachChild(R){R(this.input),this.outputs.forEach(R),R(this.otherwise)}outputDefined(){return this.outputs.every(R=>R.outputDefined())&&this.otherwise.outputDefined()}}class _n{constructor(R,ae,ke){this.type=R,this.branches=ae,this.otherwise=ke}static parse(R,ae){if(R.length<4)return ae.error(`Expected at least 3 arguments, but found only ${R.length-1}.`);if(R.length%2!=0)return ae.error("Expected an odd number of arguments.");let ke;ae.expectedType&&ae.expectedType.kind!=="value"&&(ke=ae.expectedType);let Ue=[];for(let rt=1;rtae.outputDefined())&&this.otherwise.outputDefined()}}class Zi{constructor(R,ae,ke,Ue){this.type=R,this.input=ae,this.beginIndex=ke,this.endIndex=Ue}static parse(R,ae){if(R.length<=2||R.length>=5)return ae.error(`Expected 3 or 4 arguments, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1,Yr),Ue=ae.parse(R[2],2,Et);if(!ke||!Ue)return null;if(!Pe(ke.type,[Xe(Yr),Gt,Yr]))return ae.error(`Expected first argument to be of type array or string, but found ${ot(ke.type)} instead`);if(R.length===4){let Qe=ae.parse(R[3],3,Et);return Qe?new Zi(ke.type,ke,Ue,Qe):null}return new Zi(ke.type,ke,Ue)}evaluate(R){let ae=this.input.evaluate(R),ke=this.beginIndex.evaluate(R),Ue;if(this.endIndex&&(Ue=this.endIndex.evaluate(R)),He(ae,["string"]))return[...ae].slice(ke,Ue).join("");if(He(ae,["array"]))return ae.slice(ke,Ue);throw new Ft(`Expected first argument to be of type array or string, but found ${ot(Mn(ae))} instead.`)}eachChild(R){R(this.input),R(this.beginIndex),this.endIndex&&R(this.endIndex)}outputDefined(){return!1}}function Wi(X,R){let ae=X.length-1,ke,Ue,Qe=0,rt=ae,Ct=0;for(;Qe<=rt;)if(Ct=Math.floor((Qe+rt)/2),ke=X[Ct],Ue=X[Ct+1],ke<=R){if(Ct===ae||RR))throw new Ft("Input is not a number.");rt=Ct-1}return 0}class pn{constructor(R,ae,ke){this.type=R,this.input=ae,this.labels=[],this.outputs=[];for(let[Ue,Qe]of ke)this.labels.push(Ue),this.outputs.push(Qe)}static parse(R,ae){if(R.length-1<4)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return ae.error("Expected an even number of arguments.");let ke=ae.parse(R[1],1,Et);if(!ke)return null;let Ue=[],Qe=null;ae.expectedType&&ae.expectedType.kind!=="value"&&(Qe=ae.expectedType);for(let rt=1;rt=Ct)return ae.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',sr);let Rr=ae.parse($t,Ar,Qe);if(!Rr)return null;Qe=Qe||Rr.type,Ue.push([Ct,Rr])}return new pn(Qe,ke,Ue)}evaluate(R){let ae=this.labels,ke=this.outputs;if(ae.length===1)return ke[0].evaluate(R);let Ue=this.input.evaluate(R);if(Ue<=ae[0])return ke[0].evaluate(R);let Qe=ae.length;return Ue>=ae[Qe-1]?ke[Qe-1].evaluate(R):ke[Wi(ae,Ue)].evaluate(R)}eachChild(R){R(this.input);for(let ae of this.outputs)R(ae)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Ua(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}var ea=fo;function fo(X,R,ae,ke){this.cx=3*X,this.bx=3*(ae-X)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*R,this.by=3*(ke-R)-this.cy,this.ay=1-this.cy-this.by,this.p1x=X,this.p1y=R,this.p2x=ae,this.p2y=ke}fo.prototype={sampleCurveX:function(X){return((this.ax*X+this.bx)*X+this.cx)*X},sampleCurveY:function(X){return((this.ay*X+this.by)*X+this.cy)*X},sampleCurveDerivativeX:function(X){return(3*this.ax*X+2*this.bx)*X+this.cx},solveCurveX:function(X,R){if(R===void 0&&(R=1e-6),X<0)return 0;if(X>1)return 1;for(var ae=X,ke=0;ke<8;ke++){var Ue=this.sampleCurveX(ae)-X;if(Math.abs(Ue)Ue?rt=ae:Ct=ae,ae=.5*(Ct-rt)+rt;return ae},solve:function(X,R){return this.sampleCurveY(this.solveCurveX(X,R))}};var ho=Ua(ea);function Vo(X,R,ae){return X+ae*(R-X)}function Ao(X,R,ae){return X.map((ke,Ue)=>Vo(ke,R[Ue],ae))}let Wo={number:Vo,color:function(X,R,ae,ke="rgb"){switch(ke){case"rgb":{let[Ue,Qe,rt,Ct]=Ao(X.rgb,R.rgb,ae);return new Er(Ue,Qe,rt,Ct,!1)}case"hcl":{let[Ue,Qe,rt,Ct]=X.hcl,[$t,sr,Ar,Rr]=R.hcl,oi,wi;if(isNaN(Ue)||isNaN($t))isNaN(Ue)?isNaN($t)?oi=NaN:(oi=$t,rt!==1&&rt!==0||(wi=sr)):(oi=Ue,Ar!==1&&Ar!==0||(wi=Qe));else{let Fa=$t-Ue;$t>Ue&&Fa>180?Fa-=360:$t180&&(Fa+=360),oi=Ue+ae*Fa}let[Fi,Gi,mn,Un]=function([Fa,ha,Ma,lo]){return Fa=isNaN(Fa)?0:Fa*Dr,Gn([Ma,Math.cos(Fa)*ha,Math.sin(Fa)*ha,lo])}([oi,wi??Vo(Qe,sr,ae),Vo(rt,Ar,ae),Vo(Ct,Rr,ae)]);return new Er(Fi,Gi,mn,Un,!1)}case"lab":{let[Ue,Qe,rt,Ct]=Gn(Ao(X.lab,R.lab,ae));return new Er(Ue,Qe,rt,Ct,!1)}}},array:Ao,padding:function(X,R,ae){return new Hi(Ao(X.values,R.values,ae))},variableAnchorOffsetCollection:function(X,R,ae){let ke=X.values,Ue=R.values;if(ke.length!==Ue.length)throw new Ft(`Cannot interpolate values of different length. from: ${X.toString()}, to: ${R.toString()}`);let Qe=[];for(let rt=0;rttypeof Ar!="number"||Ar<0||Ar>1))return ae.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ue={name:"cubic-bezier",controlPoints:sr}}}if(R.length-1<4)return ae.error(`Expected at least 4 arguments, but found only ${R.length-1}.`);if((R.length-1)%2!=0)return ae.error("Expected an even number of arguments.");if(Qe=ae.parse(Qe,2,Et),!Qe)return null;let Ct=[],$t=null;ke==="interpolate-hcl"||ke==="interpolate-lab"?$t=vr:ae.expectedType&&ae.expectedType.kind!=="value"&&($t=ae.expectedType);for(let sr=0;sr=Ar)return ae.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',oi);let Fi=ae.parse(Rr,wi,$t);if(!Fi)return null;$t=$t||Fi.type,Ct.push([Ar,Fi])}return at($t,Et)||at($t,vr)||at($t,ci)||at($t,Ot)||at($t,Xe(Et))?new Wa($t,ke,Ue,Qe,Ct):ae.error(`Type ${ot($t)} is not interpolatable.`)}evaluate(R){let ae=this.labels,ke=this.outputs;if(ae.length===1)return ke[0].evaluate(R);let Ue=this.input.evaluate(R);if(Ue<=ae[0])return ke[0].evaluate(R);let Qe=ae.length;if(Ue>=ae[Qe-1])return ke[Qe-1].evaluate(R);let rt=Wi(ae,Ue),Ct=Wa.interpolationFactor(this.interpolation,Ue,ae[rt],ae[rt+1]),$t=ke[rt].evaluate(R),sr=ke[rt+1].evaluate(R);switch(this.operator){case"interpolate":return Wo[this.type.kind]($t,sr,Ct);case"interpolate-hcl":return Wo.color($t,sr,Ct,"hcl");case"interpolate-lab":return Wo.color($t,sr,Ct,"lab")}}eachChild(R){R(this.input);for(let ae of this.outputs)R(ae)}outputDefined(){return this.outputs.every(R=>R.outputDefined())}}function Ts(X,R,ae,ke){let Ue=ke-ae,Qe=X-ae;return Ue===0?0:R===1?Qe/Ue:(Math.pow(R,Qe)-1)/(Math.pow(R,Ue)-1)}class fs{constructor(R,ae){this.type=R,this.args=ae}static parse(R,ae){if(R.length<2)return ae.error("Expectected at least one argument.");let ke=null,Ue=ae.expectedType;Ue&&Ue.kind!=="value"&&(ke=Ue);let Qe=[];for(let Ct of R.slice(1)){let $t=ae.parse(Ct,1+Qe.length,ke,void 0,{typeAnnotation:"omit"});if(!$t)return null;ke=ke||$t.type,Qe.push($t)}if(!ke)throw new Error("No output type");let rt=Ue&&Qe.some(Ct=>ye(Ue,Ct.type));return new fs(rt?Yr:ke,Qe)}evaluate(R){let ae,ke=null,Ue=0;for(let Qe of this.args)if(Ue++,ke=Qe.evaluate(R),ke&&ke instanceof Kn&&!ke.available&&(ae||(ae=ke.name),ke=null,Ue===this.args.length&&(ke=ae)),ke!==null)break;return ke}eachChild(R){this.args.forEach(R)}outputDefined(){return this.args.every(R=>R.outputDefined())}}function _l(X,R){return X==="=="||X==="!="?R.kind==="boolean"||R.kind==="string"||R.kind==="number"||R.kind==="null"||R.kind==="value":R.kind==="string"||R.kind==="number"||R.kind==="value"}function es(X,R,ae,ke){return ke.compare(R,ae)===0}function rl(X,R,ae){let ke=X!=="=="&&X!=="!=";return class DH{constructor(Qe,rt,Ct){this.type=Qt,this.lhs=Qe,this.rhs=rt,this.collator=Ct,this.hasUntypedArgument=Qe.type.kind==="value"||rt.type.kind==="value"}static parse(Qe,rt){if(Qe.length!==3&&Qe.length!==4)return rt.error("Expected two or three arguments.");let Ct=Qe[0],$t=rt.parse(Qe[1],1,Yr);if(!$t)return null;if(!_l(Ct,$t.type))return rt.concat(1).error(`"${Ct}" comparisons are not supported for type '${ot($t.type)}'.`);let sr=rt.parse(Qe[2],2,Yr);if(!sr)return null;if(!_l(Ct,sr.type))return rt.concat(2).error(`"${Ct}" comparisons are not supported for type '${ot(sr.type)}'.`);if($t.type.kind!==sr.type.kind&&$t.type.kind!=="value"&&sr.type.kind!=="value")return rt.error(`Cannot compare types '${ot($t.type)}' and '${ot(sr.type)}'.`);ke&&($t.type.kind==="value"&&sr.type.kind!=="value"?$t=new qr(sr.type,[$t]):$t.type.kind!=="value"&&sr.type.kind==="value"&&(sr=new qr($t.type,[sr])));let Ar=null;if(Qe.length===4){if($t.type.kind!=="string"&&sr.type.kind!=="string"&&$t.type.kind!=="value"&&sr.type.kind!=="value")return rt.error("Cannot use collator to compare non-string types.");if(Ar=rt.parse(Qe[3],3,ii),!Ar)return null}return new DH($t,sr,Ar)}evaluate(Qe){let rt=this.lhs.evaluate(Qe),Ct=this.rhs.evaluate(Qe);if(ke&&this.hasUntypedArgument){let $t=Mn(rt),sr=Mn(Ct);if($t.kind!==sr.kind||$t.kind!=="string"&&$t.kind!=="number")throw new Ft(`Expected arguments for "${X}" to be (string, string) or (number, number), but found (${$t.kind}, ${sr.kind}) instead.`)}if(this.collator&&!ke&&this.hasUntypedArgument){let $t=Mn(rt),sr=Mn(Ct);if($t.kind!=="string"||sr.kind!=="string")return R(Qe,rt,Ct)}return this.collator?ae(Qe,rt,Ct,this.collator.evaluate(Qe)):R(Qe,rt,Ct)}eachChild(Qe){Qe(this.lhs),Qe(this.rhs),this.collator&&Qe(this.collator)}outputDefined(){return!0}}}let ds=rl("==",function(X,R,ae){return R===ae},es),xl=rl("!=",function(X,R,ae){return R!==ae},function(X,R,ae,ke){return!es(0,R,ae,ke)}),sl=rl("<",function(X,R,ae){return R",function(X,R,ae){return R>ae},function(X,R,ae,ke){return ke.compare(R,ae)>0}),ms=rl("<=",function(X,R,ae){return R<=ae},function(X,R,ae,ke){return ke.compare(R,ae)<=0}),Bs=rl(">=",function(X,R,ae){return R>=ae},function(X,R,ae,ke){return ke.compare(R,ae)>=0});class No{constructor(R,ae,ke){this.type=ii,this.locale=ke,this.caseSensitive=R,this.diacriticSensitive=ae}static parse(R,ae){if(R.length!==2)return ae.error("Expected one argument.");let ke=R[1];if(typeof ke!="object"||Array.isArray(ke))return ae.error("Collator options argument must be an object.");let Ue=ae.parse(ke["case-sensitive"]!==void 0&&ke["case-sensitive"],1,Qt);if(!Ue)return null;let Qe=ae.parse(ke["diacritic-sensitive"]!==void 0&&ke["diacritic-sensitive"],1,Qt);if(!Qe)return null;let rt=null;return ke.locale&&(rt=ae.parse(ke.locale,1,Gt),!rt)?null:new No(Ue,Qe,rt)}evaluate(R){return new di(this.caseSensitive.evaluate(R),this.diacriticSensitive.evaluate(R),this.locale?this.locale.evaluate(R):null)}eachChild(R){R(this.caseSensitive),R(this.diacriticSensitive),this.locale&&R(this.locale)}outputDefined(){return!1}}class Ls{constructor(R,ae,ke,Ue,Qe){this.type=Gt,this.number=R,this.locale=ae,this.currency=ke,this.minFractionDigits=Ue,this.maxFractionDigits=Qe}static parse(R,ae){if(R.length!==3)return ae.error("Expected two arguments.");let ke=ae.parse(R[1],1,Et);if(!ke)return null;let Ue=R[2];if(typeof Ue!="object"||Array.isArray(Ue))return ae.error("NumberFormat options argument must be an object.");let Qe=null;if(Ue.locale&&(Qe=ae.parse(Ue.locale,1,Gt),!Qe))return null;let rt=null;if(Ue.currency&&(rt=ae.parse(Ue.currency,1,Gt),!rt))return null;let Ct=null;if(Ue["min-fraction-digits"]&&(Ct=ae.parse(Ue["min-fraction-digits"],1,Et),!Ct))return null;let $t=null;return Ue["max-fraction-digits"]&&($t=ae.parse(Ue["max-fraction-digits"],1,Et),!$t)?null:new Ls(ke,Qe,rt,Ct,$t)}evaluate(R){return new Intl.NumberFormat(this.locale?this.locale.evaluate(R):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(R):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(R):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(R):void 0}).format(this.number.evaluate(R))}eachChild(R){R(this.number),this.locale&&R(this.locale),this.currency&&R(this.currency),this.minFractionDigits&&R(this.minFractionDigits),this.maxFractionDigits&&R(this.maxFractionDigits)}outputDefined(){return!1}}class Il{constructor(R){this.type=Lr,this.sections=R}static parse(R,ae){if(R.length<2)return ae.error("Expected at least one argument.");let ke=R[1];if(!Array.isArray(ke)&&typeof ke=="object")return ae.error("First argument must be an image or text section.");let Ue=[],Qe=!1;for(let rt=1;rt<=R.length-1;++rt){let Ct=R[rt];if(Qe&&typeof Ct=="object"&&!Array.isArray(Ct)){Qe=!1;let $t=null;if(Ct["font-scale"]&&($t=ae.parse(Ct["font-scale"],1,Et),!$t))return null;let sr=null;if(Ct["text-font"]&&(sr=ae.parse(Ct["text-font"],1,Xe(Gt)),!sr))return null;let Ar=null;if(Ct["text-color"]&&(Ar=ae.parse(Ct["text-color"],1,vr),!Ar))return null;let Rr=Ue[Ue.length-1];Rr.scale=$t,Rr.font=sr,Rr.textColor=Ar}else{let $t=ae.parse(R[rt],1,Yr);if(!$t)return null;let sr=$t.type.kind;if(sr!=="string"&&sr!=="value"&&sr!=="null"&&sr!=="resolvedImage")return ae.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Qe=!0,Ue.push({content:$t,scale:null,font:null,textColor:null})}}return new Il(Ue)}evaluate(R){return new Ui(this.sections.map(ae=>{let ke=ae.content.evaluate(R);return Mn(ke)===vi?new qi("",ke,null,null,null):new qi(Ha(ke),null,ae.scale?ae.scale.evaluate(R):null,ae.font?ae.font.evaluate(R).join(","):null,ae.textColor?ae.textColor.evaluate(R):null)}))}eachChild(R){for(let ae of this.sections)R(ae.content),ae.scale&&R(ae.scale),ae.font&&R(ae.font),ae.textColor&&R(ae.textColor)}outputDefined(){return!1}}class Jl{constructor(R){this.type=vi,this.input=R}static parse(R,ae){if(R.length!==2)return ae.error("Expected two arguments.");let ke=ae.parse(R[1],1,Gt);return ke?new Jl(ke):ae.error("No image name provided.")}evaluate(R){let ae=this.input.evaluate(R),ke=Kn.fromString(ae);return ke&&R.availableImages&&(ke.available=R.availableImages.indexOf(ae)>-1),ke}eachChild(R){R(this.input)}outputDefined(){return!1}}class ou{constructor(R){this.type=Et,this.input=R}static parse(R,ae){if(R.length!==2)return ae.error(`Expected 1 argument, but found ${R.length-1} instead.`);let ke=ae.parse(R[1],1);return ke?ke.type.kind!=="array"&&ke.type.kind!=="string"&&ke.type.kind!=="value"?ae.error(`Expected argument of type string or array, but found ${ot(ke.type)} instead.`):new ou(ke):null}evaluate(R){let ae=this.input.evaluate(R);if(typeof ae=="string")return[...ae].length;if(Array.isArray(ae))return ae.length;throw new Ft(`Expected value to be of type string or array, but found ${ot(Mn(ae))} instead.`)}eachChild(R){R(this.input)}outputDefined(){return!1}}let Gs=8192;function $a(X,R){let ae=(180+X[0])/360,ke=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X[1]*Math.PI/360)))/360,Ue=Math.pow(2,R.z);return[Math.round(ae*Ue*Gs),Math.round(ke*Ue*Gs)]}function So(X,R){let ae=Math.pow(2,R.z);return[(Ue=(X[0]/Gs+R.x)/ae,360*Ue-180),(ke=(X[1]/Gs+R.y)/ae,360/Math.PI*Math.atan(Math.exp((180-360*ke)*Math.PI/180))-90)];var ke,Ue}function Xs(X,R){X[0]=Math.min(X[0],R[0]),X[1]=Math.min(X[1],R[1]),X[2]=Math.max(X[2],R[0]),X[3]=Math.max(X[3],R[1])}function su(X,R){return!(X[0]<=R[0]||X[2]>=R[2]||X[1]<=R[1]||X[3]>=R[3])}function is(X,R,ae){let ke=X[0]-R[0],Ue=X[1]-R[1],Qe=X[0]-ae[0],rt=X[1]-ae[1];return ke*rt-Qe*Ue==0&&ke*Qe<=0&&Ue*rt<=0}function tu(X,R,ae,ke){return(Ue=[ke[0]-ae[0],ke[1]-ae[1]])[0]*(Qe=[R[0]-X[0],R[1]-X[1]])[1]-Ue[1]*Qe[0]!=0&&!(!Rs(X,R,ae,ke)||!Rs(ae,ke,X,R));var Ue,Qe}function pl(X,R,ae){for(let ke of ae)for(let Ue=0;Ue(Ue=X)[1]!=(rt=Ct[$t+1])[1]>Ue[1]&&Ue[0]<(rt[0]-Qe[0])*(Ue[1]-Qe[1])/(rt[1]-Qe[1])+Qe[0]&&(ke=!ke)}var Ue,Qe,rt;return ke}function Gu(X,R){for(let ae of R)if(Nl(X,ae))return!0;return!1}function bo(X,R){for(let ae of X)if(!Nl(ae,R))return!1;for(let ae=0;ae0&&Ct<0||rt<0&&Ct>0}function pu(X,R,ae){let ke=[];for(let Ue=0;Ueae[2]){let Ue=.5*ke,Qe=X[0]-ae[0]>Ue?-ke:ae[0]-X[0]>Ue?ke:0;Qe===0&&(Qe=X[0]-ae[2]>Ue?-ke:ae[2]-X[0]>Ue?ke:0),X[0]+=Qe}Xs(R,X)}function Ru(X,R,ae,ke){let Ue=Math.pow(2,ke.z)*Gs,Qe=[ke.x*Gs,ke.y*Gs],rt=[];for(let Ct of X)for(let $t of Ct){let sr=[$t.x+Qe[0],$t.y+Qe[1]];ls(sr,R,ae,Ue),rt.push(sr)}return rt}function ic(X,R,ae,ke){let Ue=Math.pow(2,ke.z)*Gs,Qe=[ke.x*Gs,ke.y*Gs],rt=[];for(let $t of X){let sr=[];for(let Ar of $t){let Rr=[Ar.x+Qe[0],Ar.y+Qe[1]];Xs(R,Rr),sr.push(Rr)}rt.push(sr)}if(R[2]-R[0]<=Ue/2){(Ct=R)[0]=Ct[1]=1/0,Ct[2]=Ct[3]=-1/0;for(let $t of rt)for(let sr of $t)ls(sr,R,ae,Ue)}var Ct;return rt}class Ll{constructor(R,ae){this.type=Qt,this.geojson=R,this.geometries=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'within' expression requires exactly one argument, but found ${R.length-1} instead.`);if(sa(R[1])){let ke=R[1];if(ke.type==="FeatureCollection"){let Ue=[];for(let Qe of ke.features){let{type:rt,coordinates:Ct}=Qe.geometry;rt==="Polygon"&&Ue.push(Ct),rt==="MultiPolygon"&&Ue.push(...Ct)}if(Ue.length)return new Ll(ke,{type:"MultiPolygon",coordinates:Ue})}else if(ke.type==="Feature"){let Ue=ke.geometry.type;if(Ue==="Polygon"||Ue==="MultiPolygon")return new Ll(ke,ke.geometry)}else if(ke.type==="Polygon"||ke.type==="MultiPolygon")return new Ll(ke,ke)}return ae.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(ae,ke){let Ue=[1/0,1/0,-1/0,-1/0],Qe=[1/0,1/0,-1/0,-1/0],rt=ae.canonicalID();if(ke.type==="Polygon"){let Ct=pu(ke.coordinates,Qe,rt),$t=Ru(ae.geometry(),Ue,Qe,rt);if(!su(Ue,Qe))return!1;for(let sr of $t)if(!Nl(sr,Ct))return!1}if(ke.type==="MultiPolygon"){let Ct=bl(ke.coordinates,Qe,rt),$t=Ru(ae.geometry(),Ue,Qe,rt);if(!su(Ue,Qe))return!1;for(let sr of $t)if(!Gu(sr,Ct))return!1}return!0}(R,this.geometries);if(R.geometryType()==="LineString")return function(ae,ke){let Ue=[1/0,1/0,-1/0,-1/0],Qe=[1/0,1/0,-1/0,-1/0],rt=ae.canonicalID();if(ke.type==="Polygon"){let Ct=pu(ke.coordinates,Qe,rt),$t=ic(ae.geometry(),Ue,Qe,rt);if(!su(Ue,Qe))return!1;for(let sr of $t)if(!bo(sr,Ct))return!1}if(ke.type==="MultiPolygon"){let Ct=bl(ke.coordinates,Qe,rt),$t=ic(ae.geometry(),Ue,Qe,rt);if(!su(Ue,Qe))return!1;for(let sr of $t)if(!Ps(sr,Ct))return!1}return!0}(R,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Hl=class{constructor(X=[],R=(ae,ke)=>aeke?1:0){if(this.data=X,this.length=this.data.length,this.compare=R,this.length>0)for(let ae=(this.length>>1)-1;ae>=0;ae--)this._down(ae)}push(X){this.data.push(X),this._up(this.length++)}pop(){if(this.length===0)return;let X=this.data[0],R=this.data.pop();return--this.length>0&&(this.data[0]=R,this._down(0)),X}peek(){return this.data[0]}_up(X){let{data:R,compare:ae}=this,ke=R[X];for(;X>0;){let Ue=X-1>>1,Qe=R[Ue];if(ae(ke,Qe)>=0)break;R[X]=Qe,X=Ue}R[X]=ke}_down(X){let{data:R,compare:ae}=this,ke=this.length>>1,Ue=R[X];for(;X=0)break;R[X]=R[Qe],X=Qe}R[X]=Ue}};function lu(X,R,ae,ke,Ue){hu(X,R,ae,ke||X.length-1,Ue||Ah)}function hu(X,R,ae,ke,Ue){for(;ke>ae;){if(ke-ae>600){var Qe=ke-ae+1,rt=R-ae+1,Ct=Math.log(Qe),$t=.5*Math.exp(2*Ct/3),sr=.5*Math.sqrt(Ct*$t*(Qe-$t)/Qe)*(rt-Qe/2<0?-1:1);hu(X,R,Math.max(ae,Math.floor(R-rt*$t/Qe+sr)),Math.min(ke,Math.floor(R+(Qe-rt)*$t/Qe+sr)),Ue)}var Ar=X[R],Rr=ae,oi=ke;for(pc(X,ae,R),Ue(X[ke],Ar)>0&&pc(X,ae,ke);Rr0;)oi--}Ue(X[ae],Ar)===0?pc(X,ae,oi):pc(X,++oi,ke),oi<=R&&(ae=oi+1),R<=oi&&(ke=oi-1)}}function pc(X,R,ae){var ke=X[R];X[R]=X[ae],X[ae]=ke}function Ah(X,R){return XR?1:0}function uh(X,R){if(X.length<=1)return[X];let ae=[],ke,Ue;for(let Qe of X){let rt=td(Qe);rt!==0&&(Qe.area=Math.abs(rt),Ue===void 0&&(Ue=rt<0),Ue===rt<0?(ke&&ae.push(ke),ke=[Qe]):ke.push(Qe))}if(ke&&ae.push(ke),R>1)for(let Qe=0;Qe1?(sr=R[$t+1][0],Ar=R[$t+1][1]):wi>0&&(sr+=Rr/this.kx*wi,Ar+=oi/this.ky*wi)),Rr=this.wrap(ae[0]-sr)*this.kx,oi=(ae[1]-Ar)*this.ky;let Fi=Rr*Rr+oi*oi;Fi180;)R-=360;return R}}function xc(X,R){return R[0]-X[0]}function mc(X){return X[1]-X[0]+1}function bc(X,R){return X[1]>=X[0]&&X[1]X[1])return[null,null];let ae=mc(X);if(R){if(ae===2)return[X,null];let Ue=Math.floor(ae/2);return[[X[0],X[0]+Ue],[X[0]+Ue,X[1]]]}if(ae===1)return[X,null];let ke=Math.floor(ae/2)-1;return[[X[0],X[0]+ke],[X[0]+ke+1,X[1]]]}function yu(X,R){if(!bc(R,X.length))return[1/0,1/0,-1/0,-1/0];let ae=[1/0,1/0,-1/0,-1/0];for(let ke=R[0];ke<=R[1];++ke)Xs(ae,X[ke]);return ae}function gc(X){let R=[1/0,1/0,-1/0,-1/0];for(let ae of X)for(let ke of ae)Xs(R,ke);return R}function hl(X){return X[0]!==-1/0&&X[1]!==-1/0&&X[2]!==1/0&&X[3]!==1/0}function ru(X,R,ae){if(!hl(X)||!hl(R))return NaN;let ke=0,Ue=0;return X[2]R[2]&&(ke=X[0]-R[2]),X[1]>R[3]&&(Ue=X[1]-R[3]),X[3]=ke)return ke;if(su(Ue,Qe)){if(fp(X,R))return 0}else if(fp(R,X))return 0;let rt=1/0;for(let Ct of X)for(let $t=0,sr=Ct.length,Ar=sr-1;$t0;){let $t=rt.pop();if($t[0]>=Qe)continue;let sr=$t[1],Ar=R?50:100;if(mc(sr)<=Ar){if(!bc(sr,X.length))return NaN;if(R){let Rr=ll(X,sr,ae,ke);if(isNaN(Rr)||Rr===0)return Rr;Qe=Math.min(Qe,Rr)}else for(let Rr=sr[0];Rr<=sr[1];++Rr){let oi=Xd(X[Rr],ae,ke);if(Qe=Math.min(Qe,oi),Qe===0)return 0}}else{let Rr=vh(sr,R);os(rt,Qe,ke,X,Ct,Rr[0]),os(rt,Qe,ke,X,Ct,Rr[1])}}return Qe}function hc(X,R,ae,ke,Ue,Qe=1/0){let rt=Math.min(Qe,Ue.distance(X[0],ae[0]));if(rt===0)return rt;let Ct=new Hl([[0,[0,X.length-1],[0,ae.length-1]]],xc);for(;Ct.length>0;){let $t=Ct.pop();if($t[0]>=rt)continue;let sr=$t[1],Ar=$t[2],Rr=R?50:100,oi=ke?50:100;if(mc(sr)<=Rr&&mc(Ar)<=oi){if(!bc(sr,X.length)&&bc(Ar,ae.length))return NaN;let wi;if(R&&ke)wi=Jh(X,sr,ae,Ar,Ue),rt=Math.min(rt,wi);else if(R&&!ke){let Fi=X.slice(sr[0],sr[1]+1);for(let Gi=Ar[0];Gi<=Ar[1];++Gi)if(wi=Fh(ae[Gi],Fi,Ue),rt=Math.min(rt,wi),rt===0)return rt}else if(!R&&ke){let Fi=ae.slice(Ar[0],Ar[1]+1);for(let Gi=sr[0];Gi<=sr[1];++Gi)if(wi=Fh(X[Gi],Fi,Ue),rt=Math.min(rt,wi),rt===0)return rt}else wi=Mu(X,sr,ae,Ar,Ue),rt=Math.min(rt,wi)}else{let wi=vh(sr,R),Fi=vh(Ar,ke);_f(Ct,rt,Ue,X,ae,wi[0],Fi[0]),_f(Ct,rt,Ue,X,ae,wi[0],Fi[1]),_f(Ct,rt,Ue,X,ae,wi[1],Fi[0]),_f(Ct,rt,Ue,X,ae,wi[1],Fi[1])}}return rt}function id(X){return X.type==="MultiPolygon"?X.coordinates.map(R=>({type:"Polygon",coordinates:R})):X.type==="MultiLineString"?X.coordinates.map(R=>({type:"LineString",coordinates:R})):X.type==="MultiPoint"?X.coordinates.map(R=>({type:"Point",coordinates:R})):[X]}class Qh{constructor(R,ae){this.type=Et,this.geojson=R,this.geometries=ae}static parse(R,ae){if(R.length!==2)return ae.error(`'distance' expression requires exactly one argument, but found ${R.length-1} instead.`);if(sa(R[1])){let ke=R[1];if(ke.type==="FeatureCollection")return new Qh(ke,ke.features.map(Ue=>id(Ue.geometry)).flat());if(ke.type==="Feature")return new Qh(ke,id(ke.geometry));if("type"in ke&&"coordinates"in ke)return new Qh(ke,id(ke))}return ae.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(R){if(R.geometry()!=null&&R.canonicalID()!=null){if(R.geometryType()==="Point")return function(ae,ke){let Ue=ae.geometry(),Qe=Ue.flat().map($t=>So([$t.x,$t.y],ae.canonical));if(Ue.length===0)return NaN;let rt=new rd(Qe[0][1]),Ct=1/0;for(let $t of ke){switch($t.type){case"Point":Ct=Math.min(Ct,hc(Qe,!1,[$t.coordinates],!1,rt,Ct));break;case"LineString":Ct=Math.min(Ct,hc(Qe,!1,$t.coordinates,!0,rt,Ct));break;case"Polygon":Ct=Math.min(Ct,yh(Qe,!1,$t.coordinates,rt,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries);if(R.geometryType()==="LineString")return function(ae,ke){let Ue=ae.geometry(),Qe=Ue.flat().map($t=>So([$t.x,$t.y],ae.canonical));if(Ue.length===0)return NaN;let rt=new rd(Qe[0][1]),Ct=1/0;for(let $t of ke){switch($t.type){case"Point":Ct=Math.min(Ct,hc(Qe,!0,[$t.coordinates],!1,rt,Ct));break;case"LineString":Ct=Math.min(Ct,hc(Qe,!0,$t.coordinates,!0,rt,Ct));break;case"Polygon":Ct=Math.min(Ct,yh(Qe,!0,$t.coordinates,rt,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries);if(R.geometryType()==="Polygon")return function(ae,ke){let Ue=ae.geometry();if(Ue.length===0||Ue[0].length===0)return NaN;let Qe=uh(Ue,0).map($t=>$t.map(sr=>sr.map(Ar=>So([Ar.x,Ar.y],ae.canonical)))),rt=new rd(Qe[0][0][0][1]),Ct=1/0;for(let $t of ke)for(let sr of Qe){switch($t.type){case"Point":Ct=Math.min(Ct,yh([$t.coordinates],!1,sr,rt,Ct));break;case"LineString":Ct=Math.min(Ct,yh($t.coordinates,!0,sr,rt,Ct));break;case"Polygon":Ct=Math.min(Ct,jl(sr,$t.coordinates,rt,Ct))}if(Ct===0)return Ct}return Ct}(R,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}let Lf={"==":ds,"!=":xl,">":Gl,"<":sl,">=":Bs,"<=":ms,array:qr,at:xr,boolean:qr,case:_n,coalesce:fs,collator:No,format:Il,image:Jl,in:Qr,"index-of":Ri,interpolate:Wa,"interpolate-hcl":Wa,"interpolate-lab":Wa,length:ou,let:xi,literal:io,match:en,number:qr,"number-format":Ls,object:qr,slice:Zi,step:pn,string:qr,"to-boolean":si,"to-color":si,"to-number":si,"to-string":si,var:zt,within:Ll,distance:Qh};class vc{constructor(R,ae,ke,Ue){this.name=R,this.type=ae,this._evaluate=ke,this.args=Ue}evaluate(R){return this._evaluate(R,this.args)}eachChild(R){this.args.forEach(R)}outputDefined(){return!1}static parse(R,ae){let ke=R[0],Ue=vc.definitions[ke];if(!Ue)return ae.error(`Unknown expression "${ke}". If you wanted a literal array, use ["literal", [...]].`,0);let Qe=Array.isArray(Ue)?Ue[0]:Ue.type,rt=Array.isArray(Ue)?[[Ue[1],Ue[2]]]:Ue.overloads,Ct=rt.filter(([sr])=>!Array.isArray(sr)||sr.length===R.length-1),$t=null;for(let[sr,Ar]of Ct){$t=new Pi(ae.registry,nd,ae.path,null,ae.scope);let Rr=[],oi=!1;for(let wi=1;wi{return oi=Rr,Array.isArray(oi)?`(${oi.map(ot).join(", ")})`:`(${ot(oi.type)}...)`;var oi}).join(" | "),Ar=[];for(let Rr=1;Rr{ae=R?ae&&nd(ke):ae&&ke instanceof io}),!!ae&&ad(X)&&fd(X,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ad(X){if(X instanceof vc&&(X.name==="get"&&X.args.length===1||X.name==="feature-state"||X.name==="has"&&X.args.length===1||X.name==="properties"||X.name==="geometry-type"||X.name==="id"||/^filter-/.test(X.name))||X instanceof Ll||X instanceof Qh)return!1;let R=!0;return X.eachChild(ae=>{R&&!ad(ae)&&(R=!1)}),R}function _h(X){if(X instanceof vc&&X.name==="feature-state")return!1;let R=!0;return X.eachChild(ae=>{R&&!_h(ae)&&(R=!1)}),R}function fd(X,R){if(X instanceof vc&&R.indexOf(X.name)>=0)return!1;let ae=!0;return X.eachChild(ke=>{ae&&!fd(ke,R)&&(ae=!1)}),ae}function Nh(X){return{result:"success",value:X}}function Mh(X){return{result:"error",value:X}}function yc(X){return X["property-type"]==="data-driven"||X["property-type"]==="cross-faded-data-driven"}function df(X){return!!X.expression&&X.expression.parameters.indexOf("zoom")>-1}function od(X){return!!X.expression&&X.expression.interpolated}function uu(X){return X instanceof Number?"number":X instanceof String?"string":X instanceof Boolean?"boolean":Array.isArray(X)?"array":X===null?"null":typeof X}function jf(X){return typeof X=="object"&&X!==null&&!Array.isArray(X)}function Jd(X){return X}function dd(X,R){let ae=R.type==="color",ke=X.stops&&typeof X.stops[0][0]=="object",Ue=ke||!(ke||X.property!==void 0),Qe=X.type||(od(R)?"exponential":"interval");if(ae||R.type==="padding"){let Ar=ae?Er.parse:Hi.parse;(X=Le({},X)).stops&&(X.stops=X.stops.map(Rr=>[Rr[0],Ar(Rr[1])])),X.default=Ar(X.default?X.default:R.default)}if(X.colorSpace&&(rt=X.colorSpace)!=="rgb"&&rt!=="hcl"&&rt!=="lab")throw new Error(`Unknown color space: "${X.colorSpace}"`);var rt;let Ct,$t,sr;if(Qe==="exponential")Ct=md;else if(Qe==="interval")Ct=Yc;else if(Qe==="categorical"){Ct=pd,$t=Object.create(null);for(let Ar of X.stops)$t[Ar[0]]=Ar[1];sr=typeof X.stops[0][0]}else{if(Qe!=="identity")throw new Error(`Unknown function type "${Qe}"`);Ct=Vu}if(ke){let Ar={},Rr=[];for(let Fi=0;FiFi[0]),evaluate:({zoom:Fi},Gi)=>md({stops:oi,base:X.base},R,Fi).evaluate(Fi,Gi)}}if(Ue){let Ar=Qe==="exponential"?{name:"exponential",base:X.base!==void 0?X.base:1}:null;return{kind:"camera",interpolationType:Ar,interpolationFactor:Wa.interpolationFactor.bind(void 0,Ar),zoomStops:X.stops.map(Rr=>Rr[0]),evaluate:({zoom:Rr})=>Ct(X,R,Rr,$t,sr)}}return{kind:"source",evaluate(Ar,Rr){let oi=Rr&&Rr.properties?Rr.properties[X.property]:void 0;return oi===void 0?If(X.default,R.default):Ct(X,R,oi,$t,sr)}}}function If(X,R,ae){return X!==void 0?X:R!==void 0?R:ae!==void 0?ae:void 0}function pd(X,R,ae,ke,Ue){return If(typeof ae===Ue?ke[ae]:void 0,X.default,R.default)}function Yc(X,R,ae){if(uu(ae)!=="number")return If(X.default,R.default);let ke=X.stops.length;if(ke===1||ae<=X.stops[0][0])return X.stops[0][1];if(ae>=X.stops[ke-1][0])return X.stops[ke-1][1];let Ue=Wi(X.stops.map(Qe=>Qe[0]),ae);return X.stops[Ue][1]}function md(X,R,ae){let ke=X.base!==void 0?X.base:1;if(uu(ae)!=="number")return If(X.default,R.default);let Ue=X.stops.length;if(Ue===1||ae<=X.stops[0][0])return X.stops[0][1];if(ae>=X.stops[Ue-1][0])return X.stops[Ue-1][1];let Qe=Wi(X.stops.map(Ar=>Ar[0]),ae),rt=function(Ar,Rr,oi,wi){let Fi=wi-oi,Gi=Ar-oi;return Fi===0?0:Rr===1?Gi/Fi:(Math.pow(Rr,Gi)-1)/(Math.pow(Rr,Fi)-1)}(ae,ke,X.stops[Qe][0],X.stops[Qe+1][0]),Ct=X.stops[Qe][1],$t=X.stops[Qe+1][1],sr=Wo[R.type]||Jd;return typeof Ct.evaluate=="function"?{evaluate(...Ar){let Rr=Ct.evaluate.apply(void 0,Ar),oi=$t.evaluate.apply(void 0,Ar);if(Rr!==void 0&&oi!==void 0)return sr(Rr,oi,rt,X.colorSpace)}}:sr(Ct,$t,rt,X.colorSpace)}function Vu(X,R,ae){switch(R.type){case"color":ae=Er.parse(ae);break;case"formatted":ae=Ui.fromString(ae.toString());break;case"resolvedImage":ae=Kn.fromString(ae.toString());break;case"padding":ae=Hi.parse(ae);break;default:uu(ae)===R.type||R.type==="enum"&&R.values[ae]||(ae=void 0)}return If(ae,X.default,R.default)}vc.register(Lf,{error:[{kind:"error"},[Gt],(X,[R])=>{throw new Ft(R.evaluate(X))}],typeof:[Gt,[Yr],(X,[R])=>ot(Mn(R.evaluate(X)))],"to-rgba":[Xe(Et,4),[vr],(X,[R])=>{let[ae,ke,Ue,Qe]=R.evaluate(X).rgb;return[255*ae,255*ke,255*Ue,Qe]}],rgb:[vr,[Et,Et,Et],Pd],rgba:[vr,[Et,Et,Et,Et],Pd],has:{type:Qt,overloads:[[[Gt],(X,[R])=>hd(R.evaluate(X),X.properties())],[[Gt,mr],(X,[R,ae])=>hd(R.evaluate(X),ae.evaluate(X))]]},get:{type:Yr,overloads:[[[Gt],(X,[R])=>Pf(R.evaluate(X),X.properties())],[[Gt,mr],(X,[R,ae])=>Pf(R.evaluate(X),ae.evaluate(X))]]},"feature-state":[Yr,[Gt],(X,[R])=>Pf(R.evaluate(X),X.featureState||{})],properties:[mr,[],X=>X.properties()],"geometry-type":[Gt,[],X=>X.geometryType()],id:[Yr,[],X=>X.id()],zoom:[Et,[],X=>X.globals.zoom],"heatmap-density":[Et,[],X=>X.globals.heatmapDensity||0],"line-progress":[Et,[],X=>X.globals.lineProgress||0],accumulated:[Yr,[],X=>X.globals.accumulated===void 0?null:X.globals.accumulated],"+":[Et,ef(Et),(X,R)=>{let ae=0;for(let ke of R)ae+=ke.evaluate(X);return ae}],"*":[Et,ef(Et),(X,R)=>{let ae=1;for(let ke of R)ae*=ke.evaluate(X);return ae}],"-":{type:Et,overloads:[[[Et,Et],(X,[R,ae])=>R.evaluate(X)-ae.evaluate(X)],[[Et],(X,[R])=>-R.evaluate(X)]]},"/":[Et,[Et,Et],(X,[R,ae])=>R.evaluate(X)/ae.evaluate(X)],"%":[Et,[Et,Et],(X,[R,ae])=>R.evaluate(X)%ae.evaluate(X)],ln2:[Et,[],()=>Math.LN2],pi:[Et,[],()=>Math.PI],e:[Et,[],()=>Math.E],"^":[Et,[Et,Et],(X,[R,ae])=>Math.pow(R.evaluate(X),ae.evaluate(X))],sqrt:[Et,[Et],(X,[R])=>Math.sqrt(R.evaluate(X))],log10:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))/Math.LN10],ln:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))],log2:[Et,[Et],(X,[R])=>Math.log(R.evaluate(X))/Math.LN2],sin:[Et,[Et],(X,[R])=>Math.sin(R.evaluate(X))],cos:[Et,[Et],(X,[R])=>Math.cos(R.evaluate(X))],tan:[Et,[Et],(X,[R])=>Math.tan(R.evaluate(X))],asin:[Et,[Et],(X,[R])=>Math.asin(R.evaluate(X))],acos:[Et,[Et],(X,[R])=>Math.acos(R.evaluate(X))],atan:[Et,[Et],(X,[R])=>Math.atan(R.evaluate(X))],min:[Et,ef(Et),(X,R)=>Math.min(...R.map(ae=>ae.evaluate(X)))],max:[Et,ef(Et),(X,R)=>Math.max(...R.map(ae=>ae.evaluate(X)))],abs:[Et,[Et],(X,[R])=>Math.abs(R.evaluate(X))],round:[Et,[Et],(X,[R])=>{let ae=R.evaluate(X);return ae<0?-Math.round(-ae):Math.round(ae)}],floor:[Et,[Et],(X,[R])=>Math.floor(R.evaluate(X))],ceil:[Et,[Et],(X,[R])=>Math.ceil(R.evaluate(X))],"filter-==":[Qt,[Gt,Yr],(X,[R,ae])=>X.properties()[R.value]===ae.value],"filter-id-==":[Qt,[Yr],(X,[R])=>X.id()===R.value],"filter-type-==":[Qt,[Gt],(X,[R])=>X.geometryType()===R.value],"filter-<":[Qt,[Gt,Yr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae":[Qt,[Gt,Yr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke>Ue}],"filter-id->":[Qt,[Yr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae>ke}],"filter-<=":[Qt,[Gt,Yr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke<=Ue}],"filter-id-<=":[Qt,[Yr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae<=ke}],"filter->=":[Qt,[Gt,Yr],(X,[R,ae])=>{let ke=X.properties()[R.value],Ue=ae.value;return typeof ke==typeof Ue&&ke>=Ue}],"filter-id->=":[Qt,[Yr],(X,[R])=>{let ae=X.id(),ke=R.value;return typeof ae==typeof ke&&ae>=ke}],"filter-has":[Qt,[Yr],(X,[R])=>R.value in X.properties()],"filter-has-id":[Qt,[],X=>X.id()!==null&&X.id()!==void 0],"filter-type-in":[Qt,[Xe(Gt)],(X,[R])=>R.value.indexOf(X.geometryType())>=0],"filter-id-in":[Qt,[Xe(Yr)],(X,[R])=>R.value.indexOf(X.id())>=0],"filter-in-small":[Qt,[Gt,Xe(Yr)],(X,[R,ae])=>ae.value.indexOf(X.properties()[R.value])>=0],"filter-in-large":[Qt,[Gt,Xe(Yr)],(X,[R,ae])=>function(ke,Ue,Qe,rt){for(;Qe<=rt;){let Ct=Qe+rt>>1;if(Ue[Ct]===ke)return!0;Ue[Ct]>ke?rt=Ct-1:Qe=Ct+1}return!1}(X.properties()[R.value],ae.value,0,ae.value.length-1)],all:{type:Qt,overloads:[[[Qt,Qt],(X,[R,ae])=>R.evaluate(X)&&ae.evaluate(X)],[ef(Qt),(X,R)=>{for(let ae of R)if(!ae.evaluate(X))return!1;return!0}]]},any:{type:Qt,overloads:[[[Qt,Qt],(X,[R,ae])=>R.evaluate(X)||ae.evaluate(X)],[ef(Qt),(X,R)=>{for(let ae of R)if(ae.evaluate(X))return!0;return!1}]]},"!":[Qt,[Qt],(X,[R])=>!R.evaluate(X)],"is-supported-script":[Qt,[Gt],(X,[R])=>{let ae=X.globals&&X.globals.isSupportedScript;return!ae||ae(R.evaluate(X))}],upcase:[Gt,[Gt],(X,[R])=>R.evaluate(X).toUpperCase()],downcase:[Gt,[Gt],(X,[R])=>R.evaluate(X).toLowerCase()],concat:[Gt,ef(Yr),(X,R)=>R.map(ae=>Ha(ae.evaluate(X))).join("")],"resolved-locale":[Gt,[ii],(X,[R])=>R.evaluate(X).resolvedLocale()]});class Xc{constructor(R,ae){var ke;this.expression=R,this._warningHistory={},this._evaluator=new li,this._defaultValue=ae?(ke=ae).type==="color"&&jf(ke.default)?new Er(0,0,0,0):ke.type==="color"?Er.parse(ke.default)||null:ke.type==="padding"?Hi.parse(ke.default)||null:ke.type==="variableAnchorOffsetCollection"?Fn.parse(ke.default)||null:ke.default===void 0?null:ke.default:null,this._enumValues=ae&&ae.type==="enum"?ae.values:null}evaluateWithoutErrorHandling(R,ae,ke,Ue,Qe,rt){return this._evaluator.globals=R,this._evaluator.feature=ae,this._evaluator.featureState=ke,this._evaluator.canonical=Ue,this._evaluator.availableImages=Qe||null,this._evaluator.formattedSection=rt,this.expression.evaluate(this._evaluator)}evaluate(R,ae,ke,Ue,Qe,rt){this._evaluator.globals=R,this._evaluator.feature=ae||null,this._evaluator.featureState=ke||null,this._evaluator.canonical=Ue,this._evaluator.availableImages=Qe||null,this._evaluator.formattedSection=rt||null;try{let Ct=this.expression.evaluate(this._evaluator);if(Ct==null||typeof Ct=="number"&&Ct!=Ct)return this._defaultValue;if(this._enumValues&&!(Ct in this._enumValues))throw new Ft(`Expected value to be one of ${Object.keys(this._enumValues).map($t=>JSON.stringify($t)).join(", ")}, but found ${JSON.stringify(Ct)} instead.`);return Ct}catch(Ct){return this._warningHistory[Ct.message]||(this._warningHistory[Ct.message]=!0,typeof console<"u"&&console.warn(Ct.message)),this._defaultValue}}}function tf(X){return Array.isArray(X)&&X.length>0&&typeof X[0]=="string"&&X[0]in Lf}function _u(X,R){let ae=new Pi(Lf,nd,[],R?function(Ue){let Qe={color:vr,string:Gt,number:Et,enum:Gt,boolean:Qt,formatted:Lr,padding:ci,resolvedImage:vi,variableAnchorOffsetCollection:Ot};return Ue.type==="array"?Xe(Qe[Ue.value]||Yr,Ue.length):Qe[Ue.type]}(R):void 0),ke=ae.parse(X,void 0,void 0,void 0,R&&R.type==="string"?{typeAnnotation:"coerce"}:void 0);return ke?Nh(new Xc(ke,R)):Mh(ae.errors)}class jh{constructor(R,ae){this.kind=R,this._styleExpression=ae,this.isStateDependent=R!=="constant"&&!_h(ae.expression)}evaluateWithoutErrorHandling(R,ae,ke,Ue,Qe,rt){return this._styleExpression.evaluateWithoutErrorHandling(R,ae,ke,Ue,Qe,rt)}evaluate(R,ae,ke,Ue,Qe,rt){return this._styleExpression.evaluate(R,ae,ke,Ue,Qe,rt)}}class Fc{constructor(R,ae,ke,Ue){this.kind=R,this.zoomStops=ke,this._styleExpression=ae,this.isStateDependent=R!=="camera"&&!_h(ae.expression),this.interpolationType=Ue}evaluateWithoutErrorHandling(R,ae,ke,Ue,Qe,rt){return this._styleExpression.evaluateWithoutErrorHandling(R,ae,ke,Ue,Qe,rt)}evaluate(R,ae,ke,Ue,Qe,rt){return this._styleExpression.evaluate(R,ae,ke,Ue,Qe,rt)}interpolationFactor(R,ae,ke){return this.interpolationType?Wa.interpolationFactor(this.interpolationType,R,ae,ke):0}}function Jc(X,R){let ae=_u(X,R);if(ae.result==="error")return ae;let ke=ae.value.expression,Ue=ad(ke);if(!Ue&&!yc(R))return Mh([new nt("","data expressions not supported")]);let Qe=fd(ke,["zoom"]);if(!Qe&&!df(R))return Mh([new nt("","zoom expressions not supported")]);let rt=xf(ke);return rt||Qe?rt instanceof nt?Mh([rt]):rt instanceof Wa&&!od(R)?Mh([new nt("",'"interpolate" expressions cannot be used with this property')]):Nh(rt?new Fc(Ue?"camera":"composite",ae.value,rt.labels,rt instanceof Wa?rt.interpolation:void 0):new jh(Ue?"constant":"source",ae.value)):Mh([new nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Eu{constructor(R,ae){this._parameters=R,this._specification=ae,Le(this,dd(this._parameters,this._specification))}static deserialize(R){return new Eu(R._parameters,R._specification)}static serialize(R){return{_parameters:R._parameters,_specification:R._specification}}}function xf(X){let R=null;if(X instanceof xi)R=xf(X.result);else if(X instanceof fs){for(let ae of X.args)if(R=xf(ae),R)break}else(X instanceof pn||X instanceof Wa)&&X.input instanceof vc&&X.input.name==="zoom"&&(R=X);return R instanceof nt||X.eachChild(ae=>{let ke=xf(ae);ke instanceof nt?R=ke:!R&&ke?R=new nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):R&&ke&&R!==ke&&(R=new nt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),R}function Eh(X){if(X===!0||X===!1)return!0;if(!Array.isArray(X)||X.length===0)return!1;switch(X[0]){case"has":return X.length>=2&&X[1]!=="$id"&&X[1]!=="$type";case"in":return X.length>=3&&(typeof X[1]!="string"||Array.isArray(X[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return X.length!==3||Array.isArray(X[1])||Array.isArray(X[2]);case"any":case"all":for(let R of X.slice(1))if(!Eh(R)&&typeof R!="boolean")return!1;return!0;default:return!0}}let rf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Uf(X){if(X==null)return{filter:()=>!0,needGeometry:!1};Eh(X)||(X=bf(X));let R=_u(X,rf);if(R.result==="error")throw new Error(R.value.map(ae=>`${ae.key}: ${ae.message}`).join(", "));return{filter:(ae,ke,Ue)=>R.value.evaluate(ae,ke,{},Ue),needGeometry:Sp(X)}}function Qd(X,R){return XR?1:0}function Sp(X){if(!Array.isArray(X))return!1;if(X[0]==="within"||X[0]==="distance")return!0;for(let R=1;R"||R==="<="||R===">="?$f(X[1],X[2],R):R==="any"?(ae=X.slice(1),["any"].concat(ae.map(bf))):R==="all"?["all"].concat(X.slice(1).map(bf)):R==="none"?["all"].concat(X.slice(1).map(bf).map(ch)):R==="in"?zc(X[1],X.slice(2)):R==="!in"?ch(zc(X[1],X.slice(2))):R==="has"?wf(X[1]):R!=="!has"||ch(wf(X[1]));var ae}function $f(X,R,ae){switch(X){case"$type":return[`filter-type-${ae}`,R];case"$id":return[`filter-id-${ae}`,R];default:return[`filter-${ae}`,X,R]}}function zc(X,R){if(R.length===0)return!1;switch(X){case"$type":return["filter-type-in",["literal",R]];case"$id":return["filter-id-in",["literal",R]];default:return R.length>200&&!R.some(ae=>typeof ae!=typeof R[0])?["filter-in-large",X,["literal",R.sort(Qd)]]:["filter-in-small",X,["literal",R]]}}function wf(X){switch(X){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",X]}}function ch(X){return["!",X]}function kf(X){let R=typeof X;if(R==="number"||R==="boolean"||R==="string"||X==null)return JSON.stringify(X);if(Array.isArray(X)){let Ue="[";for(let Qe of X)Ue+=`${kf(Qe)},`;return`${Ue}]`}let ae=Object.keys(X).sort(),ke="{";for(let Ue=0;Ueke.maximum?[new Oe(R,ae,`${ae} is greater than the maximum value ${ke.maximum}`)]:[]}function Df(X){let R=X.valueSpec,ae=Lu(X.value.type),ke,Ue,Qe,rt={},Ct=ae!=="categorical"&&X.value.property===void 0,$t=!Ct,sr=uu(X.value.stops)==="array"&&uu(X.value.stops[0])==="array"&&uu(X.value.stops[0][0])==="object",Ar=Qc({key:X.key,value:X.value,valueSpec:X.styleSpec.function,validateSpec:X.validateSpec,style:X.style,styleSpec:X.styleSpec,objectElementValidators:{stops:function(wi){if(ae==="identity")return[new Oe(wi.key,wi.value,'identity function may not have a "stops" property')];let Fi=[],Gi=wi.value;return Fi=Fi.concat(Id({key:wi.key,value:Gi,valueSpec:wi.valueSpec,validateSpec:wi.validateSpec,style:wi.style,styleSpec:wi.styleSpec,arrayElementValidator:Rr})),uu(Gi)==="array"&&Gi.length===0&&Fi.push(new Oe(wi.key,Gi,"array must have at least one stop")),Fi},default:function(wi){return wi.validateSpec({key:wi.key,value:wi.value,valueSpec:R,validateSpec:wi.validateSpec,style:wi.style,styleSpec:wi.styleSpec})}}});return ae==="identity"&&Ct&&Ar.push(new Oe(X.key,X.value,'missing required property "property"')),ae==="identity"||X.value.stops||Ar.push(new Oe(X.key,X.value,'missing required property "stops"')),ae==="exponential"&&X.valueSpec.expression&&!od(X.valueSpec)&&Ar.push(new Oe(X.key,X.value,"exponential functions not supported")),X.styleSpec.$version>=8&&($t&&!yc(X.valueSpec)?Ar.push(new Oe(X.key,X.value,"property functions not supported")):Ct&&!df(X.valueSpec)&&Ar.push(new Oe(X.key,X.value,"zoom functions not supported"))),ae!=="categorical"&&!sr||X.value.property!==void 0||Ar.push(new Oe(X.key,X.value,'"property" property is required')),Ar;function Rr(wi){let Fi=[],Gi=wi.value,mn=wi.key;if(uu(Gi)!=="array")return[new Oe(mn,Gi,`array expected, ${uu(Gi)} found`)];if(Gi.length!==2)return[new Oe(mn,Gi,`array length 2 expected, length ${Gi.length} found`)];if(sr){if(uu(Gi[0])!=="object")return[new Oe(mn,Gi,`object expected, ${uu(Gi[0])} found`)];if(Gi[0].zoom===void 0)return[new Oe(mn,Gi,"object stop key must have zoom")];if(Gi[0].value===void 0)return[new Oe(mn,Gi,"object stop key must have value")];if(Qe&&Qe>Lu(Gi[0].zoom))return[new Oe(mn,Gi[0].zoom,"stop zoom values must appear in ascending order")];Lu(Gi[0].zoom)!==Qe&&(Qe=Lu(Gi[0].zoom),Ue=void 0,rt={}),Fi=Fi.concat(Qc({key:`${mn}[0]`,value:Gi[0],valueSpec:{zoom:{}},validateSpec:wi.validateSpec,style:wi.style,styleSpec:wi.styleSpec,objectElementValidators:{zoom:Cu,value:oi}}))}else Fi=Fi.concat(oi({key:`${mn}[0]`,value:Gi[0],validateSpec:wi.validateSpec,style:wi.style,styleSpec:wi.styleSpec},Gi));return tf(Uh(Gi[1]))?Fi.concat([new Oe(`${mn}[1]`,Gi[1],"expressions are not allowed in function stops.")]):Fi.concat(wi.validateSpec({key:`${mn}[1]`,value:Gi[1],valueSpec:R,validateSpec:wi.validateSpec,style:wi.style,styleSpec:wi.styleSpec}))}function oi(wi,Fi){let Gi=uu(wi.value),mn=Lu(wi.value),Un=wi.value!==null?wi.value:Fi;if(ke){if(Gi!==ke)return[new Oe(wi.key,Un,`${Gi} stop domain type must match previous stop domain type ${ke}`)]}else ke=Gi;if(Gi!=="number"&&Gi!=="string"&&Gi!=="boolean")return[new Oe(wi.key,Un,"stop domain value must be a number, string, or boolean")];if(Gi!=="number"&&ae!=="categorical"){let Fa=`number expected, ${Gi} found`;return yc(R)&&ae===void 0&&(Fa+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Oe(wi.key,Un,Fa)]}return ae!=="categorical"||Gi!=="number"||isFinite(mn)&&Math.floor(mn)===mn?ae!=="categorical"&&Gi==="number"&&Ue!==void 0&&mnnew Oe(`${X.key}${ke.key}`,X.value,ke.message));let ae=R.value.expression||R.value._styleExpression.expression;if(X.expressionContext==="property"&&X.propertyKey==="text-font"&&!ae.outputDefined())return[new Oe(X.key,X.value,`Invalid data expression for "${X.propertyKey}". Output values must be contained as literals within the expression.`)];if(X.expressionContext==="property"&&X.propertyType==="layout"&&!_h(ae))return[new Oe(X.key,X.value,'"feature-state" data expressions are not supported with layout properties.')];if(X.expressionContext==="filter"&&!_h(ae))return[new Oe(X.key,X.value,'"feature-state" data expressions are not supported with filters.')];if(X.expressionContext&&X.expressionContext.indexOf("cluster")===0){if(!fd(ae,["zoom","feature-state"]))return[new Oe(X.key,X.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(X.expressionContext==="cluster-initial"&&!ad(ae))return[new Oe(X.key,X.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function hh(X){let R=X.key,ae=X.value,ke=X.valueSpec,Ue=[];return Array.isArray(ke.values)?ke.values.indexOf(Lu(ae))===-1&&Ue.push(new Oe(R,ae,`expected one of [${ke.values.join(", ")}], ${JSON.stringify(ae)} found`)):Object.keys(ke.values).indexOf(Lu(ae))===-1&&Ue.push(new Oe(R,ae,`expected one of [${Object.keys(ke.values).join(", ")}], ${JSON.stringify(ae)} found`)),Ue}function pf(X){return Eh(Uh(X.value))?nf(Le({},X,{expressionContext:"filter",valueSpec:{value:"boolean"}})):af(X)}function af(X){let R=X.value,ae=X.key;if(uu(R)!=="array")return[new Oe(ae,R,`array expected, ${uu(R)} found`)];let ke=X.styleSpec,Ue,Qe=[];if(R.length<1)return[new Oe(ae,R,"filter array must have at least 1 element")];switch(Qe=Qe.concat(hh({key:`${ae}[0]`,value:R[0],valueSpec:ke.filter_operator,style:X.style,styleSpec:X.styleSpec})),Lu(R[0])){case"<":case"<=":case">":case">=":R.length>=2&&Lu(R[1])==="$type"&&Qe.push(new Oe(ae,R,`"$type" cannot be use with operator "${R[0]}"`));case"==":case"!=":R.length!==3&&Qe.push(new Oe(ae,R,`filter array for operator "${R[0]}" must have 3 elements`));case"in":case"!in":R.length>=2&&(Ue=uu(R[1]),Ue!=="string"&&Qe.push(new Oe(`${ae}[1]`,R[1],`string expected, ${Ue} found`)));for(let rt=2;rt{sr in ae&&R.push(new Oe(ke,ae[sr],`"${sr}" is prohibited for ref layers`))}),Ue.layers.forEach(sr=>{Lu(sr.id)===Ct&&($t=sr)}),$t?$t.ref?R.push(new Oe(ke,ae.ref,"ref cannot reference another ref layer")):rt=Lu($t.type):R.push(new Oe(ke,ae.ref,`ref layer "${Ct}" not found`))}else if(rt!=="background")if(ae.source){let $t=Ue.sources&&Ue.sources[ae.source],sr=$t&&Lu($t.type);$t?sr==="vector"&&rt==="raster"?R.push(new Oe(ke,ae.source,`layer "${ae.id}" requires a raster source`)):sr!=="raster-dem"&&rt==="hillshade"?R.push(new Oe(ke,ae.source,`layer "${ae.id}" requires a raster-dem source`)):sr==="raster"&&rt!=="raster"?R.push(new Oe(ke,ae.source,`layer "${ae.id}" requires a vector source`)):sr!=="vector"||ae["source-layer"]?sr==="raster-dem"&&rt!=="hillshade"?R.push(new Oe(ke,ae.source,"raster-dem source can only be used with layer type 'hillshade'.")):rt!=="line"||!ae.paint||!ae.paint["line-gradient"]||sr==="geojson"&&$t.lineMetrics||R.push(new Oe(ke,ae,`layer "${ae.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):R.push(new Oe(ke,ae,`layer "${ae.id}" must specify a "source-layer"`)):R.push(new Oe(ke,ae.source,`source "${ae.source}" not found`))}else R.push(new Oe(ke,ae,'missing required property "source"'));return R=R.concat(Qc({key:ke,value:ae,valueSpec:Qe.layer,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,objectElementValidators:{"*":()=>[],type:()=>X.validateSpec({key:`${ke}.type`,value:ae.type,valueSpec:Qe.layer.type,style:X.style,styleSpec:X.styleSpec,validateSpec:X.validateSpec,object:ae,objectKey:"type"}),filter:pf,layout:$t=>Qc({layer:ae,key:$t.key,value:$t.value,style:$t.style,styleSpec:$t.styleSpec,validateSpec:$t.validateSpec,objectElementValidators:{"*":sr=>Ac(Le({layerType:rt},sr))}}),paint:$t=>Qc({layer:ae,key:$t.key,value:$t.value,style:$t.style,styleSpec:$t.styleSpec,validateSpec:$t.validateSpec,objectElementValidators:{"*":sr=>ep(Le({layerType:rt},sr))}})}})),R}function fh(X){let R=X.value,ae=X.key,ke=uu(R);return ke!=="string"?[new Oe(ae,R,`string expected, ${ke} found`)]:[]}let $h={promoteId:function({key:X,value:R}){if(uu(R)==="string")return fh({key:X,value:R});{let ae=[];for(let ke in R)ae.push(...fh({key:`${X}.${ke}`,value:R[ke]}));return ae}}};function Ph(X){let R=X.value,ae=X.key,ke=X.styleSpec,Ue=X.style,Qe=X.validateSpec;if(!R.type)return[new Oe(ae,R,'"type" is required')];let rt=Lu(R.type),Ct;switch(rt){case"vector":case"raster":return Ct=Qc({key:ae,value:R,valueSpec:ke[`source_${rt.replace("-","_")}`],style:X.style,styleSpec:ke,objectElementValidators:$h,validateSpec:Qe}),Ct;case"raster-dem":return Ct=function($t){var sr;let Ar=(sr=$t.sourceName)!==null&&sr!==void 0?sr:"",Rr=$t.value,oi=$t.styleSpec,wi=oi.source_raster_dem,Fi=$t.style,Gi=[],mn=uu(Rr);if(Rr===void 0)return Gi;if(mn!=="object")return Gi.push(new Oe("source_raster_dem",Rr,`object expected, ${mn} found`)),Gi;let Un=Lu(Rr.encoding)==="custom",Fa=["redFactor","greenFactor","blueFactor","baseShift"],ha=$t.value.encoding?`"${$t.value.encoding}"`:"Default";for(let Ma in Rr)!Un&&Fa.includes(Ma)?Gi.push(new Oe(Ma,Rr[Ma],`In "${Ar}": "${Ma}" is only valid when "encoding" is set to "custom". ${ha} encoding found`)):wi[Ma]?Gi=Gi.concat($t.validateSpec({key:Ma,value:Rr[Ma],valueSpec:wi[Ma],validateSpec:$t.validateSpec,style:Fi,styleSpec:oi})):Gi.push(new Oe(Ma,Rr[Ma],`unknown property "${Ma}"`));return Gi}({sourceName:ae,value:R,style:X.style,styleSpec:ke,validateSpec:Qe}),Ct;case"geojson":if(Ct=Qc({key:ae,value:R,valueSpec:ke.source_geojson,style:Ue,styleSpec:ke,validateSpec:Qe,objectElementValidators:$h}),R.cluster)for(let $t in R.clusterProperties){let[sr,Ar]=R.clusterProperties[$t],Rr=typeof sr=="string"?[sr,["accumulated"],["get",$t]]:sr;Ct.push(...nf({key:`${ae}.${$t}.map`,value:Ar,expressionContext:"cluster-map"})),Ct.push(...nf({key:`${ae}.${$t}.reduce`,value:Rr,expressionContext:"cluster-reduce"}))}return Ct;case"video":return Qc({key:ae,value:R,valueSpec:ke.source_video,style:Ue,validateSpec:Qe,styleSpec:ke});case"image":return Qc({key:ae,value:R,valueSpec:ke.source_image,style:Ue,validateSpec:Qe,styleSpec:ke});case"canvas":return[new Oe(ae,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return hh({key:`${ae}.type`,value:R.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zu(X){let R=X.value,ae=X.styleSpec,ke=ae.light,Ue=X.style,Qe=[],rt=uu(R);if(R===void 0)return Qe;if(rt!=="object")return Qe=Qe.concat([new Oe("light",R,`object expected, ${rt} found`)]),Qe;for(let Ct in R){let $t=Ct.match(/^(.*)-transition$/);Qe=Qe.concat($t&&ke[$t[1]]&&ke[$t[1]].transition?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ae.transition,validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):[new Oe(Ct,R[Ct],`unknown property "${Ct}"`)])}return Qe}function fu(X){let R=X.value,ae=X.styleSpec,ke=ae.sky,Ue=X.style,Qe=uu(R);if(R===void 0)return[];if(Qe!=="object")return[new Oe("sky",R,`object expected, ${Qe} found`)];let rt=[];for(let Ct in R)rt=rt.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],style:Ue,styleSpec:ae}):[new Oe(Ct,R[Ct],`unknown property "${Ct}"`)]);return rt}function Ih(X){let R=X.value,ae=X.styleSpec,ke=ae.terrain,Ue=X.style,Qe=[],rt=uu(R);if(R===void 0)return Qe;if(rt!=="object")return Qe=Qe.concat([new Oe("terrain",R,`object expected, ${rt} found`)]),Qe;for(let Ct in R)Qe=Qe.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],validateSpec:X.validateSpec,style:Ue,styleSpec:ae}):[new Oe(Ct,R[Ct],`unknown property "${Ct}"`)]);return Qe}function Tf(X){let R=[],ae=X.value,ke=X.key;if(Array.isArray(ae)){let Ue=[],Qe=[];for(let rt in ae)ae[rt].id&&Ue.includes(ae[rt].id)&&R.push(new Oe(ke,ae,`all the sprites' ids must be unique, but ${ae[rt].id} is duplicated`)),Ue.push(ae[rt].id),ae[rt].url&&Qe.includes(ae[rt].url)&&R.push(new Oe(ke,ae,`all the sprites' URLs must be unique, but ${ae[rt].url} is duplicated`)),Qe.push(ae[rt].url),R=R.concat(Qc({key:`${ke}[${rt}]`,value:ae[rt],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:X.validateSpec}));return R}return fh({key:ke,value:ae})}let Dh={"*":()=>[],array:Id,boolean:function(X){let R=X.value,ae=X.key,ke=uu(R);return ke!=="boolean"?[new Oe(ae,R,`boolean expected, ${ke} found`)]:[]},number:Cu,color:function(X){let R=X.key,ae=X.value,ke=uu(ae);return ke!=="string"?[new Oe(R,ae,`color expected, ${ke} found`)]:Er.parse(String(ae))?[]:[new Oe(R,ae,`color expected, "${ae}" found`)]},constants:Lh,enum:hh,filter:pf,function:Df,layer:gd,object:Qc,source:Ph,light:Zu,sky:fu,terrain:Ih,projection:function(X){let R=X.value,ae=X.styleSpec,ke=ae.projection,Ue=X.style,Qe=uu(R);if(R===void 0)return[];if(Qe!=="object")return[new Oe("projection",R,`object expected, ${Qe} found`)];let rt=[];for(let Ct in R)rt=rt.concat(ke[Ct]?X.validateSpec({key:Ct,value:R[Ct],valueSpec:ke[Ct],style:Ue,styleSpec:ae}):[new Oe(Ct,R[Ct],`unknown property "${Ct}"`)]);return rt},string:fh,formatted:function(X){return fh(X).length===0?[]:nf(X)},resolvedImage:function(X){return fh(X).length===0?[]:nf(X)},padding:function(X){let R=X.key,ae=X.value;if(uu(ae)==="array"){if(ae.length<1||ae.length>4)return[new Oe(R,ae,`padding requires 1 to 4 values; ${ae.length} values found`)];let ke={type:"number"},Ue=[];for(let Qe=0;Qe[]}})),X.constants&&(ae=ae.concat(Lh({key:"constants",value:X.constants}))),Ai(ae)}function Ni(X){return function(R){return X(Dt(wt({},R),{validateSpec:sd}))}}function Ai(X){return[].concat(X).sort((R,ae)=>R.line-ae.line)}function hn(X){return function(...R){return Ai(X.apply(this,R))}}Xr.source=hn(Ni(Ph)),Xr.sprite=hn(Ni(Tf)),Xr.glyphs=hn(Ni(wr)),Xr.light=hn(Ni(Zu)),Xr.sky=hn(Ni(fu)),Xr.terrain=hn(Ni(Ih)),Xr.layer=hn(Ni(gd)),Xr.filter=hn(Ni(pf)),Xr.paintProperty=hn(Ni(ep)),Xr.layoutProperty=hn(Ni(Ac));let Pn=Xr,pa=Pn.light,Ea=Pn.sky,Ka=Pn.paintProperty,oo=Pn.layoutProperty;function wa(X,R){let ae=!1;if(R&&R.length)for(let ke of R)X.fire(new J(new Error(ke.message))),ae=!0;return ae}class Va{constructor(R,ae,ke){let Ue=this.cells=[];if(R instanceof ArrayBuffer){this.arrayBuffer=R;let rt=new Int32Array(this.arrayBuffer);R=rt[0],this.d=(ae=rt[1])+2*(ke=rt[2]);for(let $t=0;$t=Rr[Fi+0]&&Ue>=Rr[Fi+1])?(Ct[wi]=!0,rt.push(Ar[wi])):Ct[wi]=!1}}}}_forEachCell(R,ae,ke,Ue,Qe,rt,Ct,$t){let sr=this._convertToCellCoord(R),Ar=this._convertToCellCoord(ae),Rr=this._convertToCellCoord(ke),oi=this._convertToCellCoord(Ue);for(let wi=sr;wi<=Rr;wi++)for(let Fi=Ar;Fi<=oi;Fi++){let Gi=this.d*Fi+wi;if((!$t||$t(this._convertFromCellCoord(wi),this._convertFromCellCoord(Fi),this._convertFromCellCoord(wi+1),this._convertFromCellCoord(Fi+1)))&&Qe.call(this,R,ae,ke,Ue,Gi,rt,Ct,$t))return}}_convertFromCellCoord(R){return(R-this.padding)/this.scale}_convertToCellCoord(R){return Math.max(0,Math.min(this.d-1,Math.floor(R*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let R=this.cells,ae=3+this.cells.length+1+1,ke=0;for(let rt=0;rt=0)continue;let rt=X[Qe];Ue[Qe]=Oa[ae].shallow.indexOf(Qe)>=0?rt:ps(rt,R)}X instanceof Error&&(Ue.message=X.message)}if(Ue.$name)throw new Error("$name property is reserved for worker serialization logic.");return ae!=="Object"&&(Ue.$name=ae),Ue}function xs(X){if(rs(X))return X;if(Array.isArray(X))return X.map(xs);if(typeof X!="object")throw new Error("can't deserialize object of type "+typeof X);let R=hs(X)||"Object";if(!Oa[R])throw new Error(`can't deserialize unregistered class ${R}`);let{klass:ae}=Oa[R];if(!ae)throw new Error(`can't deserialize unregistered class ${R}`);if(ae.deserialize)return ae.deserialize(X);let ke=Object.create(ae.prototype);for(let Ue of Object.keys(X)){if(Ue==="$name")continue;let Qe=X[Ue];ke[Ue]=Oa[R].shallow.indexOf(Ue)>=0?Qe:xs(Qe)}return ke}class _o{constructor(){this.first=!0}update(R,ae){let ke=Math.floor(R);return this.first?(this.first=!1,this.lastIntegerZoom=ke,this.lastIntegerZoomTime=0,this.lastZoom=R,this.lastFloorZoom=ke,!0):(this.lastFloorZoom>ke?(this.lastIntegerZoom=ke+1,this.lastIntegerZoomTime=ae):this.lastFloorZoomX>=128&&X<=255,"Hangul Jamo":X=>X>=4352&&X<=4607,Khmer:X=>X>=6016&&X<=6143,"General Punctuation":X=>X>=8192&&X<=8303,"Letterlike Symbols":X=>X>=8448&&X<=8527,"Number Forms":X=>X>=8528&&X<=8591,"Miscellaneous Technical":X=>X>=8960&&X<=9215,"Control Pictures":X=>X>=9216&&X<=9279,"Optical Character Recognition":X=>X>=9280&&X<=9311,"Enclosed Alphanumerics":X=>X>=9312&&X<=9471,"Geometric Shapes":X=>X>=9632&&X<=9727,"Miscellaneous Symbols":X=>X>=9728&&X<=9983,"Miscellaneous Symbols and Arrows":X=>X>=11008&&X<=11263,"Ideographic Description Characters":X=>X>=12272&&X<=12287,"CJK Symbols and Punctuation":X=>X>=12288&&X<=12351,Katakana:X=>X>=12448&&X<=12543,Kanbun:X=>X>=12688&&X<=12703,"CJK Strokes":X=>X>=12736&&X<=12783,"Enclosed CJK Letters and Months":X=>X>=12800&&X<=13055,"CJK Compatibility":X=>X>=13056&&X<=13311,"Yijing Hexagram Symbols":X=>X>=19904&&X<=19967,"Private Use Area":X=>X>=57344&&X<=63743,"Vertical Forms":X=>X>=65040&&X<=65055,"CJK Compatibility Forms":X=>X>=65072&&X<=65103,"Small Form Variants":X=>X>=65104&&X<=65135,"Halfwidth and Fullwidth Forms":X=>X>=65280&&X<=65519};function ws(X){for(let R of X)if(Cl(R.charCodeAt(0)))return!0;return!1}function ul(X){for(let R of X)if(!Ql(R.charCodeAt(0)))return!1;return!0}function Ul(X){let R=X.map(ae=>{try{return new RegExp(`\\p{sc=${ae}}`,"u").source}catch{return null}}).filter(ae=>ae);return new RegExp(R.join("|"),"u")}let mu=Ul(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ql(X){return!mu.test(String.fromCodePoint(X))}let gu=Ul(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Cl(X){return!(X!==746&&X!==747&&(X<4352||!(no["CJK Compatibility Forms"](X)&&!(X>=65097&&X<=65103)||no["CJK Compatibility"](X)||no["CJK Strokes"](X)||!(!no["CJK Symbols and Punctuation"](X)||X>=12296&&X<=12305||X>=12308&&X<=12319||X===12336)||no["Enclosed CJK Letters and Months"](X)||no["Ideographic Description Characters"](X)||no.Kanbun(X)||no.Katakana(X)&&X!==12540||!(!no["Halfwidth and Fullwidth Forms"](X)||X===65288||X===65289||X===65293||X>=65306&&X<=65310||X===65339||X===65341||X===65343||X>=65371&&X<=65503||X===65507||X>=65512&&X<=65519)||!(!no["Small Form Variants"](X)||X>=65112&&X<=65118||X>=65123&&X<=65126)||no["Vertical Forms"](X)||no["Yijing Hexagram Symbols"](X)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(X))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(X))||gu.test(String.fromCodePoint(X)))))}function ec(X){return!(Cl(X)||function(R){return!!(no["Latin-1 Supplement"](R)&&(R===167||R===169||R===174||R===177||R===188||R===189||R===190||R===215||R===247)||no["General Punctuation"](R)&&(R===8214||R===8224||R===8225||R===8240||R===8241||R===8251||R===8252||R===8258||R===8263||R===8264||R===8265||R===8273)||no["Letterlike Symbols"](R)||no["Number Forms"](R)||no["Miscellaneous Technical"](R)&&(R>=8960&&R<=8967||R>=8972&&R<=8991||R>=8996&&R<=9e3||R===9003||R>=9085&&R<=9114||R>=9150&&R<=9165||R===9167||R>=9169&&R<=9179||R>=9186&&R<=9215)||no["Control Pictures"](R)&&R!==9251||no["Optical Character Recognition"](R)||no["Enclosed Alphanumerics"](R)||no["Geometric Shapes"](R)||no["Miscellaneous Symbols"](R)&&!(R>=9754&&R<=9759)||no["Miscellaneous Symbols and Arrows"](R)&&(R>=11026&&R<=11055||R>=11088&&R<=11097||R>=11192&&R<=11243)||no["CJK Symbols and Punctuation"](R)||no.Katakana(R)||no["Private Use Area"](R)||no["CJK Compatibility Forms"](R)||no["Small Form Variants"](R)||no["Halfwidth and Fullwidth Forms"](R)||R===8734||R===8756||R===8757||R>=9984&&R<=10087||R>=10102&&R<=10131||R===65532||R===65533)}(X))}let $u=Ul(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function xu(X){return $u.test(String.fromCodePoint(X))}function Ho(X,R){return!(!R&&xu(X)||X>=2304&&X<=3583||X>=3840&&X<=4255||no.Khmer(X))}function Ds(X){for(let R of X)if(xu(R.charCodeAt(0)))return!0;return!1}let iu=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(X){this.pluginStatus=X.pluginStatus,this.pluginURL=X.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(X){this.applyArabicShaping=X.applyArabicShaping,this.processBidirectionalText=X.processBidirectionalText,this.processStyledBidirectionalText=X.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Wl{constructor(R,ae){this.zoom=R,ae?(this.now=ae.now,this.fadeDuration=ae.fadeDuration,this.zoomHistory=ae.zoomHistory,this.transition=ae.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _o,this.transition={})}isSupportedScript(R){return function(ae,ke){for(let Ue of ae)if(!Ho(Ue.charCodeAt(0),ke))return!1;return!0}(R,iu.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let R=this.zoom,ae=R-Math.floor(R),ke=this.crossFadingFactor();return R>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:ae+(1-ae)*ke}:{fromScale:.5,toScale:1,t:1-(1-ke)*ae}}}class Mc{constructor(R,ae){this.property=R,this.value=ae,this.expression=function(ke,Ue){if(jf(ke))return new Eu(ke,Ue);if(tf(ke)){let Qe=Jc(ke,Ue);if(Qe.result==="error")throw new Error(Qe.value.map(rt=>`${rt.key}: ${rt.message}`).join(", "));return Qe.value}{let Qe=ke;return Ue.type==="color"&&typeof ke=="string"?Qe=Er.parse(ke):Ue.type!=="padding"||typeof ke!="number"&&!Array.isArray(ke)?Ue.type==="variableAnchorOffsetCollection"&&Array.isArray(ke)&&(Qe=Fn.parse(ke)):Qe=Hi.parse(ke),{kind:"constant",evaluate:()=>Qe}}}(ae===void 0?R.specification.default:ae,R.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(R,ae,ke){return this.property.possiblyEvaluate(this,R,ae,ke)}}class eh{constructor(R){this.property=R,this.value=new Mc(R,void 0)}transitioned(R,ae){return new Hh(this.property,this.value,ae,E({},R.transition,this.transition),R.now)}untransitioned(){return new Hh(this.property,this.value,null,{},0)}}class $c{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitionablePropertyValues)}getValue(R){return g(this._values[R].value.value)}setValue(R,ae){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].value=new Mc(this._values[R].property,ae===null?void 0:g(ae))}getTransition(R){return g(this._values[R].transition)}setTransition(R,ae){Object.prototype.hasOwnProperty.call(this._values,R)||(this._values[R]=new eh(this._values[R].property)),this._values[R].transition=g(ae)||void 0}serialize(){let R={};for(let ae of Object.keys(this._values)){let ke=this.getValue(ae);ke!==void 0&&(R[ae]=ke);let Ue=this.getTransition(ae);Ue!==void 0&&(R[`${ae}-transition`]=Ue)}return R}transitioned(R,ae){let ke=new th(this._properties);for(let Ue of Object.keys(this._values))ke._values[Ue]=this._values[Ue].transitioned(R,ae._values[Ue]);return ke}untransitioned(){let R=new th(this._properties);for(let ae of Object.keys(this._values))R._values[ae]=this._values[ae].untransitioned();return R}}class Hh{constructor(R,ae,ke,Ue,Qe){this.property=R,this.value=ae,this.begin=Qe+Ue.delay||0,this.end=this.begin+Ue.duration||0,R.specification.transition&&(Ue.delay||Ue.duration)&&(this.prior=ke)}possiblyEvaluate(R,ae,ke){let Ue=R.now||0,Qe=this.value.possiblyEvaluate(R,ae,ke),rt=this.prior;if(rt){if(Ue>this.end)return this.prior=null,Qe;if(this.value.isDataDriven())return this.prior=null,Qe;if(Ue=1)return 1;let sr=$t*$t,Ar=sr*$t;return 4*($t<.5?Ar:3*($t-sr)+Ar-.75)}(Ct))}}return Qe}}class th{constructor(R){this._properties=R,this._values=Object.create(R.defaultTransitioningPropertyValues)}possiblyEvaluate(R,ae,ke){let Ue=new Wh(this._properties);for(let Qe of Object.keys(this._values))Ue._values[Qe]=this._values[Qe].possiblyEvaluate(R,ae,ke);return Ue}hasTransition(){for(let R of Object.keys(this._values))if(this._values[R].prior)return!0;return!1}}class Vh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPropertyValues)}hasValue(R){return this._values[R].value!==void 0}getValue(R){return g(this._values[R].value)}setValue(R,ae){this._values[R]=new Mc(this._values[R].property,ae===null?void 0:g(ae))}serialize(){let R={};for(let ae of Object.keys(this._values)){let ke=this.getValue(ae);ke!==void 0&&(R[ae]=ke)}return R}possiblyEvaluate(R,ae,ke){let Ue=new Wh(this._properties);for(let Qe of Object.keys(this._values))Ue._values[Qe]=this._values[Qe].possiblyEvaluate(R,ae,ke);return Ue}}class Wu{constructor(R,ae,ke){this.property=R,this.value=ae,this.parameters=ke}isConstant(){return this.value.kind==="constant"}constantOr(R){return this.value.kind==="constant"?this.value.value:R}evaluate(R,ae,ke,Ue){return this.property.evaluate(this.value,this.parameters,R,ae,ke,Ue)}}class Wh{constructor(R){this._properties=R,this._values=Object.create(R.defaultPossiblyEvaluatedValues)}get(R){return this._values[R]}}class cs{constructor(R){this.specification=R}possiblyEvaluate(R,ae){if(R.isDataDriven())throw new Error("Value should not be data driven");return R.expression.evaluate(ae)}interpolate(R,ae,ke){let Ue=Wo[this.specification.type];return Ue?Ue(R,ae,ke):R}}class Fs{constructor(R,ae){this.specification=R,this.overrides=ae}possiblyEvaluate(R,ae,ke,Ue){return new Wu(this,R.expression.kind==="constant"||R.expression.kind==="camera"?{kind:"constant",value:R.expression.evaluate(ae,null,{},ke,Ue)}:R.expression,ae)}interpolate(R,ae,ke){if(R.value.kind!=="constant"||ae.value.kind!=="constant")return R;if(R.value.value===void 0||ae.value.value===void 0)return new Wu(this,{kind:"constant",value:void 0},R.parameters);let Ue=Wo[this.specification.type];if(Ue){let Qe=Ue(R.value.value,ae.value.value,ke);return new Wu(this,{kind:"constant",value:Qe},R.parameters)}return R}evaluate(R,ae,ke,Ue,Qe,rt){return R.kind==="constant"?R.value:R.evaluate(ae,ke,Ue,Qe,rt)}}class rh extends Fs{possiblyEvaluate(R,ae,ke,Ue){if(R.value===void 0)return new Wu(this,{kind:"constant",value:void 0},ae);if(R.expression.kind==="constant"){let Qe=R.expression.evaluate(ae,null,{},ke,Ue),rt=R.property.specification.type==="resolvedImage"&&typeof Qe!="string"?Qe.name:Qe,Ct=this._calculate(rt,rt,rt,ae);return new Wu(this,{kind:"constant",value:Ct},ae)}if(R.expression.kind==="camera"){let Qe=this._calculate(R.expression.evaluate({zoom:ae.zoom-1}),R.expression.evaluate({zoom:ae.zoom}),R.expression.evaluate({zoom:ae.zoom+1}),ae);return new Wu(this,{kind:"constant",value:Qe},ae)}return new Wu(this,R.expression,ae)}evaluate(R,ae,ke,Ue,Qe,rt){if(R.kind==="source"){let Ct=R.evaluate(ae,ke,Ue,Qe,rt);return this._calculate(Ct,Ct,Ct,ae)}return R.kind==="composite"?this._calculate(R.evaluate({zoom:Math.floor(ae.zoom)-1},ke,Ue),R.evaluate({zoom:Math.floor(ae.zoom)},ke,Ue),R.evaluate({zoom:Math.floor(ae.zoom)+1},ke,Ue),ae):R.value}_calculate(R,ae,ke,Ue){return Ue.zoom>Ue.zoomHistory.lastIntegerZoom?{from:R,to:ae}:{from:ke,to:ae}}interpolate(R){return R}}class tc{constructor(R){this.specification=R}possiblyEvaluate(R,ae,ke,Ue){if(R.value!==void 0){if(R.expression.kind==="constant"){let Qe=R.expression.evaluate(ae,null,{},ke,Ue);return this._calculate(Qe,Qe,Qe,ae)}return this._calculate(R.expression.evaluate(new Wl(Math.floor(ae.zoom-1),ae)),R.expression.evaluate(new Wl(Math.floor(ae.zoom),ae)),R.expression.evaluate(new Wl(Math.floor(ae.zoom+1),ae)),ae)}}_calculate(R,ae,ke,Ue){return Ue.zoom>Ue.zoomHistory.lastIntegerZoom?{from:R,to:ae}:{from:ke,to:ae}}interpolate(R){return R}}class ld{constructor(R){this.specification=R}possiblyEvaluate(R,ae,ke,Ue){return!!R.expression.evaluate(ae,null,{},ke,Ue)}interpolate(){return!1}}class Ke{constructor(R){this.properties=R,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let ae in R){let ke=R[ae];ke.specification.overridable&&this.overridableProperties.push(ae);let Ue=this.defaultPropertyValues[ae]=new Mc(ke,void 0),Qe=this.defaultTransitionablePropertyValues[ae]=new eh(ke);this.defaultTransitioningPropertyValues[ae]=Qe.untransitioned(),this.defaultPossiblyEvaluatedValues[ae]=Ue.possiblyEvaluate({})}}}fa("DataDrivenProperty",Fs),fa("DataConstantProperty",cs),fa("CrossFadedDataDrivenProperty",rh),fa("CrossFadedProperty",tc),fa("ColorRampProperty",ld);let O="-transition";class pe extends me{constructor(R,ae){if(super(),this.id=R.id,this.type=R.type,this._featureFilter={filter:()=>!0,needGeometry:!1},R.type!=="custom"&&(this.metadata=R.metadata,this.minzoom=R.minzoom,this.maxzoom=R.maxzoom,R.type!=="background"&&(this.source=R.source,this.sourceLayer=R["source-layer"],this.filter=R.filter),ae.layout&&(this._unevaluatedLayout=new Vh(ae.layout)),ae.paint)){this._transitionablePaint=new $c(ae.paint);for(let ke in R.paint)this.setPaintProperty(ke,R.paint[ke],{validate:!1});for(let ke in R.layout)this.setLayoutProperty(ke,R.layout[ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Wh(ae.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(R){return R==="visibility"?this.visibility:this._unevaluatedLayout.getValue(R)}setLayoutProperty(R,ae,ke={}){ae!=null&&this._validate(oo,`layers.${this.id}.layout.${R}`,R,ae,ke)||(R!=="visibility"?this._unevaluatedLayout.setValue(R,ae):this.visibility=ae)}getPaintProperty(R){return R.endsWith(O)?this._transitionablePaint.getTransition(R.slice(0,-11)):this._transitionablePaint.getValue(R)}setPaintProperty(R,ae,ke={}){if(ae!=null&&this._validate(Ka,`layers.${this.id}.paint.${R}`,R,ae,ke))return!1;if(R.endsWith(O))return this._transitionablePaint.setTransition(R.slice(0,-11),ae||void 0),!1;{let Ue=this._transitionablePaint._values[R],Qe=Ue.property.specification["property-type"]==="cross-faded-data-driven",rt=Ue.value.isDataDriven(),Ct=Ue.value;this._transitionablePaint.setValue(R,ae),this._handleSpecialPaintPropertyUpdate(R);let $t=this._transitionablePaint._values[R].value;return $t.isDataDriven()||rt||Qe||this._handleOverridablePaintPropertyUpdate(R,Ct,$t)}}_handleSpecialPaintPropertyUpdate(R){}_handleOverridablePaintPropertyUpdate(R,ae,ke){return!1}isHidden(R){return!!(this.minzoom&&R=this.maxzoom)||this.visibility==="none"}updateTransitions(R){this._transitioningPaint=this._transitionablePaint.transitioned(R,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(R,ae){R.getCrossfadeParameters&&(this._crossfadeParameters=R.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(R,void 0,ae)),this.paint=this._transitioningPaint.possiblyEvaluate(R,void 0,ae)}serialize(){let R={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(R.layout=R.layout||{},R.layout.visibility=this.visibility),p(R,(ae,ke)=>!(ae===void 0||ke==="layout"&&!Object.keys(ae).length||ke==="paint"&&!Object.keys(ae).length))}_validate(R,ae,ke,Ue,Qe={}){return(!Qe||Qe.validate!==!1)&&wa(this,R.call(Pn,{key:ae,layerType:this.type,objectKey:ke,value:Ue,styleSpec:fe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let R in this.paint._values){let ae=this.paint.get(R);if(ae instanceof Wu&&yc(ae.property.specification)&&(ae.value.kind==="source"||ae.value.kind==="composite")&&ae.value.isStateDependent)return!0}return!1}}let Ie={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Fe{constructor(R,ae){this._structArray=R,this._pos1=ae*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class qe{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(R,ae){return R._trim(),ae&&(R.isTransferred=!0,ae.push(R.arrayBuffer)),{length:R.length,arrayBuffer:R.arrayBuffer}}static deserialize(R){let ae=Object.create(this.prototype);return ae.arrayBuffer=R.arrayBuffer,ae.length=R.length,ae.capacity=R.arrayBuffer.byteLength/ae.bytesPerElement,ae._refreshViews(),ae}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(R){this.reserve(R),this.length=R}reserve(R){if(R>this.capacity){this.capacity=Math.max(R,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let ae=this.uint8;this._refreshViews(),ae&&this.uint8.set(ae)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Mt(X,R=1){let ae=0,ke=0;return{members:X.map(Ue=>{let Qe=Ie[Ue.type].BYTES_PER_ELEMENT,rt=ae=jt(ae,Math.max(R,Qe)),Ct=Ue.components||1;return ke=Math.max(ke,Qe),ae+=Qe*Ct,{name:Ue.name,type:Ue.type,components:Ct,offset:rt}}),size:jt(ae,Math.max(ke,R)),alignment:R}}function jt(X,R){return Math.ceil(X/R)*R}class tr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.int16[Ue+0]=ae,this.int16[Ue+1]=ke,R}}tr.prototype.bytesPerElement=4,fa("StructArrayLayout2i4",tr);class kr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let Qe=3*R;return this.int16[Qe+0]=ae,this.int16[Qe+1]=ke,this.int16[Qe+2]=Ue,R}}kr.prototype.bytesPerElement=6,fa("StructArrayLayout3i6",kr);class Vr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue){let Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,R,ae,ke,Ue)}emplace(R,ae,ke,Ue,Qe){let rt=4*R;return this.int16[rt+0]=ae,this.int16[rt+1]=ke,this.int16[rt+2]=Ue,this.int16[rt+3]=Qe,R}}Vr.prototype.bytesPerElement=8,fa("StructArrayLayout4i8",Vr);class Wr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,Qe,rt)}emplace(R,ae,ke,Ue,Qe,rt,Ct){let $t=6*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.int16[$t+2]=Ue,this.int16[$t+3]=Qe,this.int16[$t+4]=rt,this.int16[$t+5]=Ct,R}}Wr.prototype.bytesPerElement=12,fa("StructArrayLayout2i4i12",Wr);class Ti extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,Qe,rt)}emplace(R,ae,ke,Ue,Qe,rt,Ct){let $t=4*R,sr=8*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.uint8[sr+4]=Ue,this.uint8[sr+5]=Qe,this.uint8[sr+6]=rt,this.uint8[sr+7]=Ct,R}}Ti.prototype.bytesPerElement=8,fa("StructArrayLayout2i4ub8",Ti);class Vi extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.float32[Ue+0]=ae,this.float32[Ue+1]=ke,R}}Vi.prototype.bytesPerElement=8,fa("StructArrayLayout2f8",Vi);class et extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar){let Rr=this.length;return this.resize(Rr+1),this.emplace(Rr,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar)}emplace(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr){let oi=10*R;return this.uint16[oi+0]=ae,this.uint16[oi+1]=ke,this.uint16[oi+2]=Ue,this.uint16[oi+3]=Qe,this.uint16[oi+4]=rt,this.uint16[oi+5]=Ct,this.uint16[oi+6]=$t,this.uint16[oi+7]=sr,this.uint16[oi+8]=Ar,this.uint16[oi+9]=Rr,R}}et.prototype.bytesPerElement=20,fa("StructArrayLayout10ui20",et);class lt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi){let wi=this.length;return this.resize(wi+1),this.emplace(wi,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi)}emplace(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi){let Fi=12*R;return this.int16[Fi+0]=ae,this.int16[Fi+1]=ke,this.int16[Fi+2]=Ue,this.int16[Fi+3]=Qe,this.uint16[Fi+4]=rt,this.uint16[Fi+5]=Ct,this.uint16[Fi+6]=$t,this.uint16[Fi+7]=sr,this.int16[Fi+8]=Ar,this.int16[Fi+9]=Rr,this.int16[Fi+10]=oi,this.int16[Fi+11]=wi,R}}lt.prototype.bytesPerElement=24,fa("StructArrayLayout4i4ui4i24",lt);class Tt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let Qe=3*R;return this.float32[Qe+0]=ae,this.float32[Qe+1]=ke,this.float32[Qe+2]=Ue,R}}Tt.prototype.bytesPerElement=12,fa("StructArrayLayout3f12",Tt);class Lt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.uint32[1*R+0]=ae,R}}Lt.prototype.bytesPerElement=4,fa("StructArrayLayout1ul4",Lt);class Vt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt,Ct,$t,sr){let Ar=this.length;return this.resize(Ar+1),this.emplace(Ar,R,ae,ke,Ue,Qe,rt,Ct,$t,sr)}emplace(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar){let Rr=10*R,oi=5*R;return this.int16[Rr+0]=ae,this.int16[Rr+1]=ke,this.int16[Rr+2]=Ue,this.int16[Rr+3]=Qe,this.int16[Rr+4]=rt,this.int16[Rr+5]=Ct,this.uint32[oi+3]=$t,this.uint16[Rr+8]=sr,this.uint16[Rr+9]=Ar,R}}Vt.prototype.bytesPerElement=20,fa("StructArrayLayout6i1ul2ui20",Vt);class Nt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,Qe,rt)}emplace(R,ae,ke,Ue,Qe,rt,Ct){let $t=6*R;return this.int16[$t+0]=ae,this.int16[$t+1]=ke,this.int16[$t+2]=Ue,this.int16[$t+3]=Qe,this.int16[$t+4]=rt,this.int16[$t+5]=Ct,R}}Nt.prototype.bytesPerElement=12,fa("StructArrayLayout2i2i2i12",Nt);class Xt extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe){let rt=this.length;return this.resize(rt+1),this.emplace(rt,R,ae,ke,Ue,Qe)}emplace(R,ae,ke,Ue,Qe,rt){let Ct=4*R,$t=8*R;return this.float32[Ct+0]=ae,this.float32[Ct+1]=ke,this.float32[Ct+2]=Ue,this.int16[$t+6]=Qe,this.int16[$t+7]=rt,R}}Xt.prototype.bytesPerElement=16,fa("StructArrayLayout2f1f2i16",Xt);class Pr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt){let Ct=this.length;return this.resize(Ct+1),this.emplace(Ct,R,ae,ke,Ue,Qe,rt)}emplace(R,ae,ke,Ue,Qe,rt,Ct){let $t=16*R,sr=4*R,Ar=8*R;return this.uint8[$t+0]=ae,this.uint8[$t+1]=ke,this.float32[sr+1]=Ue,this.float32[sr+2]=Qe,this.int16[Ar+6]=rt,this.int16[Ar+7]=Ct,R}}Pr.prototype.bytesPerElement=16,fa("StructArrayLayout2ub2f2i16",Pr);class Hr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let Qe=3*R;return this.uint16[Qe+0]=ae,this.uint16[Qe+1]=ke,this.uint16[Qe+2]=Ue,R}}Hr.prototype.bytesPerElement=6,fa("StructArrayLayout3ui6",Hr);class Zr extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un){let Fa=this.length;return this.resize(Fa+1),this.emplace(Fa,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un)}emplace(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un,Fa){let ha=24*R,Ma=12*R,lo=48*R;return this.int16[ha+0]=ae,this.int16[ha+1]=ke,this.uint16[ha+2]=Ue,this.uint16[ha+3]=Qe,this.uint32[Ma+2]=rt,this.uint32[Ma+3]=Ct,this.uint32[Ma+4]=$t,this.uint16[ha+10]=sr,this.uint16[ha+11]=Ar,this.uint16[ha+12]=Rr,this.float32[Ma+7]=oi,this.float32[Ma+8]=wi,this.uint8[lo+36]=Fi,this.uint8[lo+37]=Gi,this.uint8[lo+38]=mn,this.uint32[Ma+10]=Un,this.int16[ha+22]=Fa,R}}Zr.prototype.bytesPerElement=48,fa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zr);class pi extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un,Fa,ha,Ma,lo,Oo,Is,Bl,Cs,vs,al,qs){let Ns=this.length;return this.resize(Ns+1),this.emplace(Ns,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un,Fa,ha,Ma,lo,Oo,Is,Bl,Cs,vs,al,qs)}emplace(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi,mn,Un,Fa,ha,Ma,lo,Oo,Is,Bl,Cs,vs,al,qs,Ns){let wo=32*R,dl=16*R;return this.int16[wo+0]=ae,this.int16[wo+1]=ke,this.int16[wo+2]=Ue,this.int16[wo+3]=Qe,this.int16[wo+4]=rt,this.int16[wo+5]=Ct,this.int16[wo+6]=$t,this.int16[wo+7]=sr,this.uint16[wo+8]=Ar,this.uint16[wo+9]=Rr,this.uint16[wo+10]=oi,this.uint16[wo+11]=wi,this.uint16[wo+12]=Fi,this.uint16[wo+13]=Gi,this.uint16[wo+14]=mn,this.uint16[wo+15]=Un,this.uint16[wo+16]=Fa,this.uint16[wo+17]=ha,this.uint16[wo+18]=Ma,this.uint16[wo+19]=lo,this.uint16[wo+20]=Oo,this.uint16[wo+21]=Is,this.uint16[wo+22]=Bl,this.uint32[dl+12]=Cs,this.float32[dl+13]=vs,this.float32[dl+14]=al,this.uint16[wo+30]=qs,this.uint16[wo+31]=Ns,R}}pi.prototype.bytesPerElement=64,fa("StructArrayLayout8i15ui1ul2f2ui64",pi);class zi extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.float32[1*R+0]=ae,R}}zi.prototype.bytesPerElement=4,fa("StructArrayLayout1f4",zi);class Ki extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let Qe=3*R;return this.uint16[6*R+0]=ae,this.float32[Qe+1]=ke,this.float32[Qe+2]=Ue,R}}Ki.prototype.bytesPerElement=12,fa("StructArrayLayout1ui2f12",Ki);class rn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae,ke){let Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,R,ae,ke)}emplace(R,ae,ke,Ue){let Qe=4*R;return this.uint32[2*R+0]=ae,this.uint16[Qe+2]=ke,this.uint16[Qe+3]=Ue,R}}rn.prototype.bytesPerElement=8,fa("StructArrayLayout1ul2ui8",rn);class kn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R,ae){let ke=this.length;return this.resize(ke+1),this.emplace(ke,R,ae)}emplace(R,ae,ke){let Ue=2*R;return this.uint16[Ue+0]=ae,this.uint16[Ue+1]=ke,R}}kn.prototype.bytesPerElement=4,fa("StructArrayLayout2ui4",kn);class Qn extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(R){let ae=this.length;return this.resize(ae+1),this.emplace(ae,R)}emplace(R,ae){return this.uint16[1*R+0]=ae,R}}Qn.prototype.bytesPerElement=2,fa("StructArrayLayout1ui2",Qn);class Ca extends qe{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(R,ae,ke,Ue){let Qe=this.length;return this.resize(Qe+1),this.emplace(Qe,R,ae,ke,Ue)}emplace(R,ae,ke,Ue,Qe){let rt=4*R;return this.float32[rt+0]=ae,this.float32[rt+1]=ke,this.float32[rt+2]=Ue,this.float32[rt+3]=Qe,R}}Ca.prototype.bytesPerElement=16,fa("StructArrayLayout4f16",Ca);class Ta extends Fe{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new u(this.anchorPointX,this.anchorPointY)}}Ta.prototype.size=20;class Ba extends Vt{get(R){return new Ta(this,R)}}fa("CollisionBoxArray",Ba);class xo extends Fe{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(R){this._structArray.uint8[this._pos1+37]=R}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(R){this._structArray.uint8[this._pos1+38]=R}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(R){this._structArray.uint32[this._pos4+10]=R}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}xo.prototype.size=48;class Go extends Zr{get(R){return new xo(this,R)}}fa("PlacedSymbolArray",Go);class Bo extends Fe{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(R){this._structArray.uint32[this._pos4+12]=R}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Bo.prototype.size=64;class _s extends pi{get(R){return new Bo(this,R)}}fa("SymbolInstanceArray",_s);class wl extends zi{getoffsetX(R){return this.float32[1*R+0]}}fa("GlyphOffsetArray",wl);class Al extends kr{getx(R){return this.int16[3*R+0]}gety(R){return this.int16[3*R+1]}gettileUnitDistanceFromAnchor(R){return this.int16[3*R+2]}}fa("SymbolLineVertexArray",Al);class Us extends Fe{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Us.prototype.size=12;class Pl extends Ki{get(R){return new Us(this,R)}}fa("TextAnchorOffsetArray",Pl);class Fu extends Fe{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Fu.prototype.size=8;class Tu extends rn{get(R){return new Fu(this,R)}}fa("FeatureIndexArray",Tu);class Js extends tr{}class Qs extends tr{}class nc extends tr{}class wc extends Wr{}class ih extends Ti{}class Me extends Vi{}class Ve extends et{}class ft extends lt{}class Pt extends Tt{}class Bt extends Lt{}class Ht extends Nt{}class dr extends Pr{}class cr extends Hr{}class Or extends kn{}let mi=Mt([{name:"a_pos",components:2,type:"Int16"}],4),{members:hi}=mi;class Bi{constructor(R=[]){this.segments=R}prepareSegment(R,ae,ke,Ue){let Qe=this.segments[this.segments.length-1];return R>Bi.MAX_VERTEX_ARRAY_LENGTH&&T(`Max vertices per segment is ${Bi.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${R}`),(!Qe||Qe.vertexLength+R>Bi.MAX_VERTEX_ARRAY_LENGTH||Qe.sortKey!==Ue)&&(Qe={vertexOffset:ae.length,primitiveOffset:ke.length,vertexLength:0,primitiveLength:0},Ue!==void 0&&(Qe.sortKey=Ue),this.segments.push(Qe)),Qe}get(){return this.segments}destroy(){for(let R of this.segments)for(let ae in R.vaos)R.vaos[ae].destroy()}static simpleSegment(R,ae,ke,Ue){return new Bi([{vertexOffset:R,primitiveOffset:ae,vertexLength:ke,primitiveLength:Ue,vaos:{},sortKey:0}])}}function Yi(X,R){return 256*(X=w(Math.floor(X),0,255))+w(Math.floor(R),0,255)}Bi.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,fa("SegmentVector",Bi);let Ji=Mt([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ta={exports:{}},sn={exports:{}};sn.exports=function(X,R){var ae,ke,Ue,Qe,rt,Ct,$t,sr;for(ke=X.length-(ae=3&X.length),Ue=R,rt=3432918353,Ct=461845907,sr=0;sr>>16)*rt&65535)<<16)&4294967295)<<15|$t>>>17))*Ct+((($t>>>16)*Ct&65535)<<16)&4294967295)<<13|Ue>>>19))+((5*(Ue>>>16)&65535)<<16)&4294967295))+((58964+(Qe>>>16)&65535)<<16);switch($t=0,ae){case 3:$t^=(255&X.charCodeAt(sr+2))<<16;case 2:$t^=(255&X.charCodeAt(sr+1))<<8;case 1:Ue^=$t=(65535&($t=($t=(65535&($t^=255&X.charCodeAt(sr)))*rt+((($t>>>16)*rt&65535)<<16)&4294967295)<<15|$t>>>17))*Ct+((($t>>>16)*Ct&65535)<<16)&4294967295}return Ue^=X.length,Ue=2246822507*(65535&(Ue^=Ue>>>16))+((2246822507*(Ue>>>16)&65535)<<16)&4294967295,Ue=3266489909*(65535&(Ue^=Ue>>>13))+((3266489909*(Ue>>>16)&65535)<<16)&4294967295,(Ue^=Ue>>>16)>>>0};var Bn=sn.exports,$n={exports:{}};$n.exports=function(X,R){for(var ae,ke=X.length,Ue=R^ke,Qe=0;ke>=4;)ae=1540483477*(65535&(ae=255&X.charCodeAt(Qe)|(255&X.charCodeAt(++Qe))<<8|(255&X.charCodeAt(++Qe))<<16|(255&X.charCodeAt(++Qe))<<24))+((1540483477*(ae>>>16)&65535)<<16),Ue=1540483477*(65535&Ue)+((1540483477*(Ue>>>16)&65535)<<16)^(ae=1540483477*(65535&(ae^=ae>>>24))+((1540483477*(ae>>>16)&65535)<<16)),ke-=4,++Qe;switch(ke){case 3:Ue^=(255&X.charCodeAt(Qe+2))<<16;case 2:Ue^=(255&X.charCodeAt(Qe+1))<<8;case 1:Ue=1540483477*(65535&(Ue^=255&X.charCodeAt(Qe)))+((1540483477*(Ue>>>16)&65535)<<16)}return Ue=1540483477*(65535&(Ue^=Ue>>>13))+((1540483477*(Ue>>>16)&65535)<<16),(Ue^=Ue>>>15)>>>0};var Yn=Bn,aa=$n.exports;ta.exports=Yn,ta.exports.murmur3=Yn,ta.exports.murmur2=aa;var vn=a(ta.exports);class Qa{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(R,ae,ke,Ue){this.ids.push(to(R)),this.positions.push(ae,ke,Ue)}getPositions(R){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let ae=to(R),ke=0,Ue=this.ids.length-1;for(;ke>1;this.ids[rt]>=ae?Ue=rt:ke=rt+1}let Qe=[];for(;this.ids[ke]===ae;)Qe.push({index:this.positions[3*ke],start:this.positions[3*ke+1],end:this.positions[3*ke+2]}),ke++;return Qe}static serialize(R,ae){let ke=new Float64Array(R.ids),Ue=new Uint32Array(R.positions);return yo(ke,Ue,0,ke.length-1),ae&&ae.push(ke.buffer,Ue.buffer),{ids:ke,positions:Ue}}static deserialize(R){let ae=new Qa;return ae.ids=R.ids,ae.positions=R.positions,ae.indexed=!0,ae}}function to(X){let R=+X;return!isNaN(R)&&R<=Number.MAX_SAFE_INTEGER?R:vn(String(X))}function yo(X,R,ae,ke){for(;ae>1],Qe=ae-1,rt=ke+1;for(;;){do Qe++;while(X[Qe]Ue);if(Qe>=rt)break;jo(X,Qe,rt),jo(R,3*Qe,3*rt),jo(R,3*Qe+1,3*rt+1),jo(R,3*Qe+2,3*rt+2)}rt-ae`u_${Ue}`),this.type=ke}setUniform(R,ae,ke){R.set(ke.constantOr(this.value))}getBinding(R,ae,ke){return this.type==="color"?new ts(R,ae):new Xo(R,ae)}}class bu{constructor(R,ae){this.uniformNames=ae.map(ke=>`u_${ke}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(R,ae){this.pixelRatioFrom=ae.pixelRatio,this.pixelRatioTo=R.pixelRatio,this.patternFrom=ae.tlbr,this.patternTo=R.tlbr}setUniform(R,ae,ke,Ue){let Qe=Ue==="u_pattern_to"?this.patternTo:Ue==="u_pattern_from"?this.patternFrom:Ue==="u_pixel_ratio_to"?this.pixelRatioTo:Ue==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Qe&&R.set(Qe)}getBinding(R,ae,ke){return ke.substr(0,9)==="u_pattern"?new ml(R,ae):new Xo(R,ae)}}class Eo{constructor(R,ae,ke,Ue){this.expression=R,this.type=ke,this.maxValue=0,this.paintVertexAttributes=ae.map(Qe=>({name:`a_${Qe}`,type:"Float32",components:ke==="color"?2:1,offset:0})),this.paintVertexArray=new Ue}populatePaintArray(R,ae,ke,Ue,Qe){let rt=this.paintVertexArray.length,Ct=this.expression.evaluate(new Wl(0),ae,{},Ue,[],Qe);this.paintVertexArray.resize(R),this._setPaintValue(rt,R,Ct)}updatePaintArray(R,ae,ke,Ue){let Qe=this.expression.evaluate({zoom:0},ke,Ue);this._setPaintValue(R,ae,Qe)}_setPaintValue(R,ae,ke){if(this.type==="color"){let Ue=Dl(ke);for(let Qe=R;Qe`u_${Ct}_t`),this.type=ke,this.useIntegerZoom=Ue,this.zoom=Qe,this.maxValue=0,this.paintVertexAttributes=ae.map(Ct=>({name:`a_${Ct}`,type:"Float32",components:ke==="color"?4:2,offset:0})),this.paintVertexArray=new rt}populatePaintArray(R,ae,ke,Ue,Qe){let rt=this.expression.evaluate(new Wl(this.zoom),ae,{},Ue,[],Qe),Ct=this.expression.evaluate(new Wl(this.zoom+1),ae,{},Ue,[],Qe),$t=this.paintVertexArray.length;this.paintVertexArray.resize(R),this._setPaintValue($t,R,rt,Ct)}updatePaintArray(R,ae,ke,Ue){let Qe=this.expression.evaluate({zoom:this.zoom},ke,Ue),rt=this.expression.evaluate({zoom:this.zoom+1},ke,Ue);this._setPaintValue(R,ae,Qe,rt)}_setPaintValue(R,ae,ke,Ue){if(this.type==="color"){let Qe=Dl(ke),rt=Dl(Ue);for(let Ct=R;Ct`#define HAS_UNIFORM_${Ue}`))}return R}getBinderAttributes(){let R=[];for(let ae in this.binders){let ke=this.binders[ae];if(ke instanceof Eo||ke instanceof el)for(let Ue=0;Ue!0){this.programConfigurations={};for(let Ue of R)this.programConfigurations[Ue.id]=new vu(Ue,ae,ke);this.needsUpload=!1,this._featureMap=new Qa,this._bufferOffset=0}populatePaintArrays(R,ae,ke,Ue,Qe,rt){for(let Ct in this.programConfigurations)this.programConfigurations[Ct].populatePaintArrays(R,ae,Ue,Qe,rt);ae.id!==void 0&&this._featureMap.add(ae.id,ke,this._bufferOffset,R),this._bufferOffset=R,this.needsUpload=!0}updatePaintArrays(R,ae,ke,Ue){for(let Qe of ke)this.needsUpload=this.programConfigurations[Qe.id].updatePaintArrays(R,this._featureMap,ae,Qe,Ue)||this.needsUpload}get(R){return this.programConfigurations[R]}upload(R){if(this.needsUpload){for(let ae in this.programConfigurations)this.programConfigurations[ae].upload(R);this.needsUpload=!1}}destroy(){for(let R in this.programConfigurations)this.programConfigurations[R].destroy()}}function dh(X,R){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[X]||[X.replace(`${R}-`,"").replace(/-/g,"_")]}function Zl(X,R,ae){let ke={color:{source:Vi,composite:Ca},number:{source:zi,composite:Vi}},Ue=function(Qe){return{"line-pattern":{source:Ve,composite:Ve},"fill-pattern":{source:Ve,composite:Ve},"fill-extrusion-pattern":{source:Ve,composite:Ve}}[Qe]}(X);return Ue&&Ue[ae]||ke[R][ae]}fa("ConstantBinder",ac),fa("CrossFadedConstantBinder",bu),fa("SourceExpressionBinder",Eo),fa("CrossFadedCompositeBinder",fl),fa("CompositeExpressionBinder",el),fa("ProgramConfiguration",vu,{omit:["_buffers"]}),fa("ProgramConfigurationSet",nu);let cu=8192,zh=Math.pow(2,14)-1,St=-zh-1;function Ir(X){let R=cu/X.extent,ae=X.loadGeometry();for(let ke=0;kert.x+1||$trt.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return ae}function Nr(X,R){return{type:X.type,id:X.id,properties:X.properties,geometry:R?Ir(X):[]}}function Qi(X,R,ae,ke,Ue){X.emplaceBack(2*R+(ke+1)/2,2*ae+(Ue+1)/2)}class Cn{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new Qs,this.indexArray=new cr,this.segments=new Bi,this.programConfigurations=new nu(R.layers,R.zoom),this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){let Ue=this.layers[0],Qe=[],rt=null,Ct=!1;Ue.type==="circle"&&(rt=Ue.layout.get("circle-sort-key"),Ct=!rt.isConstant());for(let{feature:$t,id:sr,index:Ar,sourceLayerIndex:Rr}of R){let oi=this.layers[0]._featureFilter.needGeometry,wi=Nr($t,oi);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),wi,ke))continue;let Fi=Ct?rt.evaluate(wi,{},ke):void 0,Gi={id:sr,properties:$t.properties,type:$t.type,sourceLayerIndex:Rr,index:Ar,geometry:oi?wi.geometry:Ir($t),patterns:{},sortKey:Fi};Qe.push(Gi)}Ct&&Qe.sort(($t,sr)=>$t.sortKey-sr.sortKey);for(let $t of Qe){let{geometry:sr,index:Ar,sourceLayerIndex:Rr}=$t,oi=R[Ar].feature;this.addFeature($t,sr,Ar,ke),ae.featureIndex.insert(oi,sr,Ar,Rr,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,hi),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(R,ae,ke,Ue){for(let Qe of ae)for(let rt of Qe){let Ct=rt.x,$t=rt.y;if(Ct<0||Ct>=cu||$t<0||$t>=cu)continue;let sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,R.sortKey),Ar=sr.vertexLength;Qi(this.layoutVertexArray,Ct,$t,-1,-1),Qi(this.layoutVertexArray,Ct,$t,1,-1),Qi(this.layoutVertexArray,Ct,$t,1,1),Qi(this.layoutVertexArray,Ct,$t,-1,1),this.indexArray.emplaceBack(Ar,Ar+1,Ar+2),this.indexArray.emplaceBack(Ar,Ar+3,Ar+2),sr.vertexLength+=4,sr.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,ke,{},Ue)}}function xn(X,R){for(let ae=0;ae1){if(ia(X,R))return!0;for(let ke=0;ke1?ae:ae.sub(R)._mult(Ue)._add(R))}function da(X,R){let ae,ke,Ue,Qe=!1;for(let rt=0;rtR.y!=Ue.y>R.y&&R.x<(Ue.x-ke.x)*(R.y-ke.y)/(Ue.y-ke.y)+ke.x&&(Qe=!Qe)}return Qe}function jn(X,R){let ae=!1;for(let ke=0,Ue=X.length-1;keR.y!=rt.y>R.y&&R.x<(rt.x-Qe.x)*(R.y-Qe.y)/(rt.y-Qe.y)+Qe.x&&(ae=!ae)}return ae}function Ei(X,R,ae){let ke=ae[0],Ue=ae[2];if(X.xUe.x&&R.x>Ue.x||X.yUe.y&&R.y>Ue.y)return!1;let Qe=N(X,R,ae[0]);return Qe!==N(X,R,ae[1])||Qe!==N(X,R,ae[2])||Qe!==N(X,R,ae[3])}function an(X,R,ae){let ke=R.paint.get(X).value;return ke.kind==="constant"?ke.value:ae.programConfigurations.get(R.id).getMaxValue(X)}function Xn(X){return Math.sqrt(X[0]*X[0]+X[1]*X[1])}function Nn(X,R,ae,ke,Ue){if(!R[0]&&!R[1])return X;let Qe=u.convert(R)._mult(Ue);ae==="viewport"&&Qe._rotate(-ke);let rt=[];for(let Ct=0;Ct$o(mn,Gi))}(sr,$t),wi=Rr?Ar*Ct:Ar;for(let Fi of Ue)for(let Gi of Fi){let mn=Rr?Gi:$o(Gi,$t),Un=wi,Fa=la([],[Gi.x,Gi.y,0,1],$t);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Un*=Fa[3]/rt.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Un*=rt.cameraToCenterDistance/Fa[3]),Oi(oi,mn,Un))return!0}return!1}}function $o(X,R){let ae=la([],[X.x,X.y,0,1],R);return new u(ae[0]/ae[3],ae[1]/ae[3])}class Do extends Cn{}let Ia;fa("HeatmapBucket",Do,{omit:["layers"]});var qa={get paint(){return Ia=Ia||new Ke({"heatmap-radius":new Fs(fe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Fs(fe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new cs(fe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ld(fe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new cs(fe.paint_heatmap["heatmap-opacity"])})}};function Co(X,{width:R,height:ae},ke,Ue){if(Ue){if(Ue instanceof Uint8ClampedArray)Ue=new Uint8Array(Ue.buffer);else if(Ue.length!==R*ae*ke)throw new RangeError(`mismatched image size. expected: ${Ue.length} but got: ${R*ae*ke}`)}else Ue=new Uint8Array(R*ae*ke);return X.width=R,X.height=ae,X.data=Ue,X}function Ro(X,{width:R,height:ae},ke){if(R===X.width&&ae===X.height)return;let Ue=Co({},{width:R,height:ae},ke);us(X,Ue,{x:0,y:0},{x:0,y:0},{width:Math.min(X.width,R),height:Math.min(X.height,ae)},ke),X.width=R,X.height=ae,X.data=Ue.data}function us(X,R,ae,ke,Ue,Qe){if(Ue.width===0||Ue.height===0)return R;if(Ue.width>X.width||Ue.height>X.height||ae.x>X.width-Ue.width||ae.y>X.height-Ue.height)throw new RangeError("out of range source coordinates for image copy");if(Ue.width>R.width||Ue.height>R.height||ke.x>R.width-Ue.width||ke.y>R.height-Ue.height)throw new RangeError("out of range destination coordinates for image copy");let rt=X.data,Ct=R.data;if(rt===Ct)throw new Error("srcData equals dstData, so image is already copied");for(let $t=0;$t{R[X.evaluationKey]=$t;let sr=X.expression.evaluate(R);Ue.data[rt+Ct+0]=Math.floor(255*sr.r/sr.a),Ue.data[rt+Ct+1]=Math.floor(255*sr.g/sr.a),Ue.data[rt+Ct+2]=Math.floor(255*sr.b/sr.a),Ue.data[rt+Ct+3]=Math.floor(255*sr.a)};if(X.clips)for(let rt=0,Ct=0;rt80*ae){Ct=1/0,$t=1/0;let Ar=-1/0,Rr=-1/0;for(let oi=ae;oiAr&&(Ar=wi),Fi>Rr&&(Rr=Fi)}sr=Math.max(Ar-Ct,Rr-$t),sr=sr!==0?32767/sr:0}return vl(Qe,rt,ae,Ct,$t,sr,0),rt}function Zo(X,R,ae,ke,Ue){let Qe;if(Ue===function(rt,Ct,$t,sr){let Ar=0;for(let Rr=Ct,oi=$t-sr;Rr<$t;Rr+=sr)Ar+=(rt[oi]-rt[Rr])*(rt[Rr+1]+rt[oi+1]),oi=Rr;return Ar}(X,R,ae,ke)>0)for(let rt=R;rt=R;rt-=ke)Qe=ar(rt/ke|0,X[rt],X[rt+1],Qe);return Qe&&kt(Qe,Qe.next)&&(pr(Qe),Qe=Qe.next),Qe}function Du(X,R){if(!X)return X;R||(R=X);let ae,ke=X;do if(ae=!1,ke.steiner||!kt(ke,ke.next)&>(ke.prev,ke,ke.next)!==0)ke=ke.next;else{if(pr(ke),ke=R=ke.prev,ke===ke.next)break;ae=!0}while(ae||ke!==R);return R}function vl(X,R,ae,ke,Ue,Qe,rt){if(!X)return;!rt&&Qe&&function($t,sr,Ar,Rr){let oi=$t;do oi.z===0&&(oi.z=le(oi.x,oi.y,sr,Ar,Rr)),oi.prevZ=oi.prev,oi.nextZ=oi.next,oi=oi.next;while(oi!==$t);oi.prevZ.nextZ=null,oi.prevZ=null,function(wi){let Fi,Gi=1;do{let mn,Un=wi;wi=null;let Fa=null;for(Fi=0;Un;){Fi++;let ha=Un,Ma=0;for(let Oo=0;Oo0||lo>0&&ha;)Ma!==0&&(lo===0||!ha||Un.z<=ha.z)?(mn=Un,Un=Un.nextZ,Ma--):(mn=ha,ha=ha.nextZ,lo--),Fa?Fa.nextZ=mn:wi=mn,mn.prevZ=Fa,Fa=mn;Un=ha}Fa.nextZ=null,Gi*=2}while(Fi>1)}(oi)}(X,ke,Ue,Qe);let Ct=X;for(;X.prev!==X.next;){let $t=X.prev,sr=X.next;if(Qe?Lc(X,ke,Ue,Qe):ju(X))R.push($t.i,X.i,sr.i),pr(X),X=sr.next,Ct=sr.next;else if((X=sr)===Ct){rt?rt===1?vl(X=Fo(Du(X),R),R,ae,ke,Ue,Qe,2):rt===2&&zs(X,R,ae,ke,Ue,Qe):vl(Du(X),R,ae,ke,Ue,Qe,1);break}}}function ju(X){let R=X.prev,ae=X,ke=X.next;if(gt(R,ae,ke)>=0)return!1;let Ue=R.x,Qe=ae.x,rt=ke.x,Ct=R.y,$t=ae.y,sr=ke.y,Ar=UeQe?Ue>rt?Ue:rt:Qe>rt?Qe:rt,wi=Ct>$t?Ct>sr?Ct:sr:$t>sr?$t:sr,Fi=ke.next;for(;Fi!==R;){if(Fi.x>=Ar&&Fi.x<=oi&&Fi.y>=Rr&&Fi.y<=wi&&we(Ue,Ct,Qe,$t,rt,sr,Fi.x,Fi.y)&>(Fi.prev,Fi,Fi.next)>=0)return!1;Fi=Fi.next}return!0}function Lc(X,R,ae,ke){let Ue=X.prev,Qe=X,rt=X.next;if(gt(Ue,Qe,rt)>=0)return!1;let Ct=Ue.x,$t=Qe.x,sr=rt.x,Ar=Ue.y,Rr=Qe.y,oi=rt.y,wi=Ct<$t?Ct$t?Ct>sr?Ct:sr:$t>sr?$t:sr,mn=Ar>Rr?Ar>oi?Ar:oi:Rr>oi?Rr:oi,Un=le(wi,Fi,R,ae,ke),Fa=le(Gi,mn,R,ae,ke),ha=X.prevZ,Ma=X.nextZ;for(;ha&&ha.z>=Un&&Ma&&Ma.z<=Fa;){if(ha.x>=wi&&ha.x<=Gi&&ha.y>=Fi&&ha.y<=mn&&ha!==Ue&&ha!==rt&&we(Ct,Ar,$t,Rr,sr,oi,ha.x,ha.y)&>(ha.prev,ha,ha.next)>=0||(ha=ha.prevZ,Ma.x>=wi&&Ma.x<=Gi&&Ma.y>=Fi&&Ma.y<=mn&&Ma!==Ue&&Ma!==rt&&we(Ct,Ar,$t,Rr,sr,oi,Ma.x,Ma.y)&>(Ma.prev,Ma,Ma.next)>=0))return!1;Ma=Ma.nextZ}for(;ha&&ha.z>=Un;){if(ha.x>=wi&&ha.x<=Gi&&ha.y>=Fi&&ha.y<=mn&&ha!==Ue&&ha!==rt&&we(Ct,Ar,$t,Rr,sr,oi,ha.x,ha.y)&>(ha.prev,ha,ha.next)>=0)return!1;ha=ha.prevZ}for(;Ma&&Ma.z<=Fa;){if(Ma.x>=wi&&Ma.x<=Gi&&Ma.y>=Fi&&Ma.y<=mn&&Ma!==Ue&&Ma!==rt&&we(Ct,Ar,$t,Rr,sr,oi,Ma.x,Ma.y)&>(Ma.prev,Ma,Ma.next)>=0)return!1;Ma=Ma.nextZ}return!0}function Fo(X,R){let ae=X;do{let ke=ae.prev,Ue=ae.next.next;!kt(ke,Ue)&&Je(ke,ae,ae.next,Ue)&&ur(ke,Ue)&&ur(Ue,ke)&&(R.push(ke.i,ae.i,Ue.i),pr(ae),pr(ae.next),ae=X=Ue),ae=ae.next}while(ae!==X);return Du(ae)}function zs(X,R,ae,ke,Ue,Qe){let rt=X;do{let Ct=rt.next.next;for(;Ct!==rt.prev;){if(rt.i!==Ct.i&&We(rt,Ct)){let $t=er(rt,Ct);return rt=Du(rt,rt.next),$t=Du($t,$t.next),vl(rt,R,ae,ke,Ue,Qe,0),void vl($t,R,ae,ke,Ue,Qe,0)}Ct=Ct.next}rt=rt.next}while(rt!==X)}function Ol(X,R){return X.x-R.x}function Ml(X,R){let ae=function(Ue,Qe){let rt=Qe,Ct=Ue.x,$t=Ue.y,sr,Ar=-1/0;do{if($t<=rt.y&&$t>=rt.next.y&&rt.next.y!==rt.y){let Gi=rt.x+($t-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(Gi<=Ct&&Gi>Ar&&(Ar=Gi,sr=rt.x=rt.x&&rt.x>=oi&&Ct!==rt.x&&we($tsr.x||rt.x===sr.x&&K(sr,rt)))&&(sr=rt,Fi=Gi)}rt=rt.next}while(rt!==Rr);return sr}(X,R);if(!ae)return R;let ke=er(ae,X);return Du(ke,ke.next),Du(ae,ae.next)}function K(X,R){return gt(X.prev,X,R.prev)<0&>(R.next,X,X.next)<0}function le(X,R,ae,ke,Ue){return(X=1431655765&((X=858993459&((X=252645135&((X=16711935&((X=(X-ae)*Ue|0)|X<<8))|X<<4))|X<<2))|X<<1))|(R=1431655765&((R=858993459&((R=252645135&((R=16711935&((R=(R-ke)*Ue|0)|R<<8))|R<<4))|R<<2))|R<<1))<<1}function ie(X){let R=X,ae=X;do(R.x=(X-rt)*(Qe-Ct)&&(X-rt)*(ke-Ct)>=(ae-rt)*(R-Ct)&&(ae-rt)*(Qe-Ct)>=(Ue-rt)*(ke-Ct)}function We(X,R){return X.next.i!==R.i&&X.prev.i!==R.i&&!function(ae,ke){let Ue=ae;do{if(Ue.i!==ae.i&&Ue.next.i!==ae.i&&Ue.i!==ke.i&&Ue.next.i!==ke.i&&Je(Ue,Ue.next,ae,ke))return!0;Ue=Ue.next}while(Ue!==ae);return!1}(X,R)&&(ur(X,R)&&ur(R,X)&&function(ae,ke){let Ue=ae,Qe=!1,rt=(ae.x+ke.x)/2,Ct=(ae.y+ke.y)/2;do Ue.y>Ct!=Ue.next.y>Ct&&Ue.next.y!==Ue.y&&rt<(Ue.next.x-Ue.x)*(Ct-Ue.y)/(Ue.next.y-Ue.y)+Ue.x&&(Qe=!Qe),Ue=Ue.next;while(Ue!==ae);return Qe}(X,R)&&(gt(X.prev,X,R.prev)||gt(X,R.prev,R))||kt(X,R)&>(X.prev,X,X.next)>0&>(R.prev,R,R.next)>0)}function gt(X,R,ae){return(R.y-X.y)*(ae.x-R.x)-(R.x-X.x)*(ae.y-R.y)}function kt(X,R){return X.x===R.x&&X.y===R.y}function Je(X,R,ae,ke){let Ue=It(gt(X,R,ae)),Qe=It(gt(X,R,ke)),rt=It(gt(ae,ke,X)),Ct=It(gt(ae,ke,R));return Ue!==Qe&&rt!==Ct||!(Ue!==0||!dt(X,ae,R))||!(Qe!==0||!dt(X,ke,R))||!(rt!==0||!dt(ae,X,ke))||!(Ct!==0||!dt(ae,R,ke))}function dt(X,R,ae){return R.x<=Math.max(X.x,ae.x)&&R.x>=Math.min(X.x,ae.x)&&R.y<=Math.max(X.y,ae.y)&&R.y>=Math.min(X.y,ae.y)}function It(X){return X>0?1:X<0?-1:0}function ur(X,R){return gt(X.prev,X,X.next)<0?gt(X,R,X.next)>=0&>(X,X.prev,R)>=0:gt(X,R,X.prev)<0||gt(X,X.next,R)<0}function er(X,R){let ae=yr(X.i,X.x,X.y),ke=yr(R.i,R.x,R.y),Ue=X.next,Qe=R.prev;return X.next=R,R.prev=X,ae.next=Ue,Ue.prev=ae,ke.next=ae,ae.prev=ke,Qe.next=ke,ke.prev=Qe,ke}function ar(X,R,ae,ke){let Ue=yr(X,R,ae);return ke?(Ue.next=ke.next,Ue.prev=ke,ke.next.prev=Ue,ke.next=Ue):(Ue.prev=Ue,Ue.next=Ue),Ue}function pr(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function yr(X,R,ae){return{i:X,x:R,y:ae,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qt(X,R,ae){let ke=ae.patternDependencies,Ue=!1;for(let Qe of R){let rt=Qe.paint.get(`${X}-pattern`);rt.isConstant()||(Ue=!0);let Ct=rt.constantOr(null);Ct&&(Ue=!0,ke[Ct.to]=!0,ke[Ct.from]=!0)}return Ue}function rr(X,R,ae,ke,Ue){let Qe=Ue.patternDependencies;for(let rt of R){let Ct=rt.paint.get(`${X}-pattern`).value;if(Ct.kind!=="constant"){let $t=Ct.evaluate({zoom:ke-1},ae,{},Ue.availableImages),sr=Ct.evaluate({zoom:ke},ae,{},Ue.availableImages),Ar=Ct.evaluate({zoom:ke+1},ae,{},Ue.availableImages);$t=$t&&$t.name?$t.name:$t,sr=sr&&sr.name?sr.name:sr,Ar=Ar&&Ar.name?Ar.name:Ar,Qe[$t]=!0,Qe[sr]=!0,Qe[Ar]=!0,ae.patterns[rt.id]={min:$t,mid:sr,max:Ar}}}return ae}class Jt{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new nc,this.indexArray=new cr,this.indexArray2=new Or,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.segments2=new Bi,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.hasPattern=qt("fill",this.layers,ae);let Ue=this.layers[0].layout.get("fill-sort-key"),Qe=!Ue.isConstant(),rt=[];for(let{feature:Ct,id:$t,index:sr,sourceLayerIndex:Ar}of R){let Rr=this.layers[0]._featureFilter.needGeometry,oi=Nr(Ct,Rr);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),oi,ke))continue;let wi=Qe?Ue.evaluate(oi,{},ke,ae.availableImages):void 0,Fi={id:$t,properties:Ct.properties,type:Ct.type,sourceLayerIndex:Ar,index:sr,geometry:Rr?oi.geometry:Ir(Ct),patterns:{},sortKey:wi};rt.push(Fi)}Qe&&rt.sort((Ct,$t)=>Ct.sortKey-$t.sortKey);for(let Ct of rt){let{geometry:$t,index:sr,sourceLayerIndex:Ar}=Ct;if(this.hasPattern){let Rr=rr("fill",this.layers,Ct,this.zoom,ae);this.patternFeatures.push(Rr)}else this.addFeature(Ct,$t,sr,ke,{});ae.featureIndex.insert(R[sr].feature,$t,sr,Ar,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}addFeatures(R,ae,ke){for(let Ue of this.patternFeatures)this.addFeature(Ue,Ue.geometry,Ue.index,ae,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,wu),this.indexBuffer=R.createIndexBuffer(this.indexArray),this.indexBuffer2=R.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(R,ae,ke,Ue,Qe){for(let rt of uh(ae,500)){let Ct=0;for(let wi of rt)Ct+=wi.length;let $t=this.segments.prepareSegment(Ct,this.layoutVertexArray,this.indexArray),sr=$t.vertexLength,Ar=[],Rr=[];for(let wi of rt){if(wi.length===0)continue;wi!==rt[0]&&Rr.push(Ar.length/2);let Fi=this.segments2.prepareSegment(wi.length,this.layoutVertexArray,this.indexArray2),Gi=Fi.vertexLength;this.layoutVertexArray.emplaceBack(wi[0].x,wi[0].y),this.indexArray2.emplaceBack(Gi+wi.length-1,Gi),Ar.push(wi[0].x),Ar.push(wi[0].y);for(let mn=1;mn>3}if(Ue--,ke===1||ke===2)Qe+=X.readSVarint(),rt+=X.readSVarint(),ke===1&&(R&&Ct.push(R),R=[]),R.push(new ca(Qe,rt));else{if(ke!==7)throw new Error("unknown command "+ke);R&&R.push(R[0].clone())}}return R&&Ct.push(R),Ct},Wn.prototype.bbox=function(){var X=this._pbf;X.pos=this._geometry;for(var R=X.readVarint()+X.pos,ae=1,ke=0,Ue=0,Qe=0,rt=1/0,Ct=-1/0,$t=1/0,sr=-1/0;X.pos>3}if(ke--,ae===1||ae===2)(Ue+=X.readSVarint())Ct&&(Ct=Ue),(Qe+=X.readSVarint())<$t&&($t=Qe),Qe>sr&&(sr=Qe);else if(ae!==7)throw new Error("unknown command "+ae)}return[rt,$t,Ct,sr]},Wn.prototype.toGeoJSON=function(X,R,ae){var ke,Ue,Qe=this.extent*Math.pow(2,ae),rt=this.extent*X,Ct=this.extent*R,$t=this.loadGeometry(),sr=Wn.types[this.type];function Ar(wi){for(var Fi=0;Fi>3;Ue=rt===1?ke.readString():rt===2?ke.readFloat():rt===3?ke.readDouble():rt===4?ke.readVarint64():rt===5?ke.readVarint():rt===6?ke.readSVarint():rt===7?ke.readBoolean():null}return Ue}(ae))}Ss.prototype.feature=function(X){if(X<0||X>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[X];var R=this._pbf.readVarint()+this._pbf.pos;return new To(this._pbf,R,this.extent,this._keys,this._values)};var Yl=Jo;function Tl(X,R,ae){if(X===3){var ke=new Yl(ae,ae.readVarint()+ae.pos);ke.length&&(R[ke.name]=ke)}}Dn.VectorTile=function(X,R){this.layers=X.readFields(Tl,{},R)},Dn.VectorTileFeature=Hn,Dn.VectorTileLayer=Jo;let Xl=Dn.VectorTileFeature.types,Pc=Math.pow(2,13);function $s(X,R,ae,ke,Ue,Qe,rt,Ct){X.emplaceBack(R,ae,2*Math.floor(ke*Pc)+rt,Ue*Pc*2,Qe*Pc*2,Math.round(Ct))}class zu{constructor(R){this.zoom=R.zoom,this.overscaling=R.overscaling,this.layers=R.layers,this.layerIds=this.layers.map(ae=>ae.id),this.index=R.index,this.hasPattern=!1,this.layoutVertexArray=new wc,this.centroidVertexArray=new Js,this.indexArray=new cr,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.features=[],this.hasPattern=qt("fill-extrusion",this.layers,ae);for(let{feature:Ue,id:Qe,index:rt,sourceLayerIndex:Ct}of R){let $t=this.layers[0]._featureFilter.needGeometry,sr=Nr(Ue,$t);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),sr,ke))continue;let Ar={id:Qe,sourceLayerIndex:Ct,index:rt,geometry:$t?sr.geometry:Ir(Ue),properties:Ue.properties,type:Ue.type,patterns:{}};this.hasPattern?this.features.push(rr("fill-extrusion",this.layers,Ar,this.zoom,ae)):this.addFeature(Ar,Ar.geometry,rt,ke,{}),ae.featureIndex.insert(Ue,Ar.geometry,rt,Ct,this.index,!0)}}addFeatures(R,ae,ke){for(let Ue of this.features){let{geometry:Qe}=Ue;this.addFeature(Ue,Qe,Ue.index,ae,ke)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,Vn),this.centroidVertexBuffer=R.createVertexBuffer(this.centroidVertexArray,gn.members,!0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(R,ae,ke,Ue,Qe){for(let rt of uh(ae,500)){let Ct={x:0,y:0,vertexCount:0},$t=0;for(let Fi of rt)$t+=Fi.length;let sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let Fi of rt){if(Fi.length===0||Vf(Fi))continue;let Gi=0;for(let mn=0;mn=1){let Fa=Fi[mn-1];if(!mf(Un,Fa)){sr.vertexLength+4>Bi.MAX_VERTEX_ARRAY_LENGTH&&(sr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let ha=Un.sub(Fa)._perp()._unit(),Ma=Fa.dist(Un);Gi+Ma>32768&&(Gi=0),$s(this.layoutVertexArray,Un.x,Un.y,ha.x,ha.y,0,0,Gi),$s(this.layoutVertexArray,Un.x,Un.y,ha.x,ha.y,0,1,Gi),Ct.x+=2*Un.x,Ct.y+=2*Un.y,Ct.vertexCount+=2,Gi+=Ma,$s(this.layoutVertexArray,Fa.x,Fa.y,ha.x,ha.y,0,0,Gi),$s(this.layoutVertexArray,Fa.x,Fa.y,ha.x,ha.y,0,1,Gi),Ct.x+=2*Fa.x,Ct.y+=2*Fa.y,Ct.vertexCount+=2;let lo=sr.vertexLength;this.indexArray.emplaceBack(lo,lo+2,lo+1),this.indexArray.emplaceBack(lo+1,lo+2,lo+3),sr.vertexLength+=4,sr.primitiveLength+=2}}}}if(sr.vertexLength+$t>Bi.MAX_VERTEX_ARRAY_LENGTH&&(sr=this.segments.prepareSegment($t,this.layoutVertexArray,this.indexArray)),Xl[R.type]!=="Polygon")continue;let Ar=[],Rr=[],oi=sr.vertexLength;for(let Fi of rt)if(Fi.length!==0){Fi!==rt[0]&&Rr.push(Ar.length/2);for(let Gi=0;Gicu)||X.y===R.y&&(X.y<0||X.y>cu)}function Vf(X){return X.every(R=>R.x<0)||X.every(R=>R.x>cu)||X.every(R=>R.y<0)||X.every(R=>R.y>cu)}let M0;fa("FillExtrusionBucket",zu,{omit:["layers","features"]});var vm={get paint(){return M0=M0||new Ke({"fill-extrusion-opacity":new cs(fe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new cs(fe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new cs(fe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new rh(fe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Fs(fe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new cs(fe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class u0 extends pe{constructor(R){super(R,vm)}createBucket(R){return new zu(R)}queryRadius(){return Xn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(R,ae,ke,Ue,Qe,rt,Ct,$t){let sr=Nn(R,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),rt.angle,Ct),Ar=this.paint.get("fill-extrusion-height").evaluate(ae,ke),Rr=this.paint.get("fill-extrusion-base").evaluate(ae,ke),oi=function(Fi,Gi,mn,Un){let Fa=[];for(let ha of Fi){let Ma=[ha.x,ha.y,0,1];la(Ma,Ma,Gi),Fa.push(new u(Ma[0]/Ma[3],Ma[1]/Ma[3]))}return Fa}(sr,$t),wi=function(Fi,Gi,mn,Un){let Fa=[],ha=[],Ma=Un[8]*Gi,lo=Un[9]*Gi,Oo=Un[10]*Gi,Is=Un[11]*Gi,Bl=Un[8]*mn,Cs=Un[9]*mn,vs=Un[10]*mn,al=Un[11]*mn;for(let qs of Fi){let Ns=[],wo=[];for(let dl of qs){let ol=dl.x,eu=dl.y,xh=Un[0]*ol+Un[4]*eu+Un[12],ph=Un[1]*ol+Un[5]*eu+Un[13],Bd=Un[2]*ol+Un[6]*eu+Un[14],p0=Un[3]*ol+Un[7]*eu+Un[15],Wf=Bd+Oo,yd=p0+Is,Vp=xh+Bl,Wp=ph+Cs,qp=Bd+vs,vf=p0+al,Rd=new u((xh+Ma)/yd,(ph+lo)/yd);Rd.z=Wf/yd,Ns.push(Rd);let Mp=new u(Vp/vf,Wp/vf);Mp.z=qp/vf,wo.push(Mp)}Fa.push(Ns),ha.push(wo)}return[Fa,ha]}(Ue,Rr,Ar,$t);return function(Fi,Gi,mn){let Un=1/0;Tn(mn,Gi)&&(Un=Om(mn,Gi[0]));for(let Fa=0;Faae.id),this.index=R.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ae=>{this.gradients[ae.id]={}}),this.layoutVertexArray=new ih,this.layoutVertexArray2=new Me,this.indexArray=new cr,this.programConfigurations=new nu(R.layers,R.zoom),this.segments=new Bi,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ae=>ae.isStateDependent()).map(ae=>ae.id)}populate(R,ae,ke){this.hasPattern=qt("line",this.layers,ae);let Ue=this.layers[0].layout.get("line-sort-key"),Qe=!Ue.isConstant(),rt=[];for(let{feature:Ct,id:$t,index:sr,sourceLayerIndex:Ar}of R){let Rr=this.layers[0]._featureFilter.needGeometry,oi=Nr(Ct,Rr);if(!this.layers[0]._featureFilter.filter(new Wl(this.zoom),oi,ke))continue;let wi=Qe?Ue.evaluate(oi,{},ke):void 0,Fi={id:$t,properties:Ct.properties,type:Ct.type,sourceLayerIndex:Ar,index:sr,geometry:Rr?oi.geometry:Ir(Ct),patterns:{},sortKey:wi};rt.push(Fi)}Qe&&rt.sort((Ct,$t)=>Ct.sortKey-$t.sortKey);for(let Ct of rt){let{geometry:$t,index:sr,sourceLayerIndex:Ar}=Ct;if(this.hasPattern){let Rr=rr("line",this.layers,Ct,this.zoom,ae);this.patternFeatures.push(Rr)}else this.addFeature(Ct,$t,sr,ke,{});ae.featureIndex.insert(R[sr].feature,$t,sr,Ar,this.index)}}update(R,ae,ke){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(R,ae,this.stateDependentLayers,ke)}addFeatures(R,ae,ke){for(let Ue of this.patternFeatures)this.addFeature(Ue,Ue.geometry,Ue.index,ae,ke)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(R){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=R.createVertexBuffer(this.layoutVertexArray2,rg)),this.layoutVertexBuffer=R.createVertexBuffer(this.layoutVertexArray,h0),this.indexBuffer=R.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(R),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(R){if(R.properties&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(R.properties,"mapbox_clip_end"))return{start:+R.properties.mapbox_clip_start,end:+R.properties.mapbox_clip_end}}addFeature(R,ae,ke,Ue,Qe){let rt=this.layers[0].layout,Ct=rt.get("line-join").evaluate(R,{}),$t=rt.get("line-cap"),sr=rt.get("line-miter-limit"),Ar=rt.get("line-round-limit");this.lineClips=this.lineFeatureClips(R);for(let Rr of ae)this.addLine(Rr,R,Ct,$t,sr,Ar);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,R,ke,Qe,Ue)}addLine(R,ae,ke,Ue,Qe,rt){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Un=0;Un=2&&R[$t-1].equals(R[$t-2]);)$t--;let sr=0;for(;sr<$t-1&&R[sr].equals(R[sr+1]);)sr++;if($t<(Ct?3:2))return;ke==="bevel"&&(Qe=1.05);let Ar=this.overscaling<=16?15*cu/(512*this.overscaling):0,Rr=this.segments.prepareSegment(10*$t,this.layoutVertexArray,this.indexArray),oi,wi,Fi,Gi,mn;this.e1=this.e2=-1,Ct&&(oi=R[$t-2],mn=R[sr].sub(oi)._unit()._perp());for(let Un=sr;Un<$t;Un++){if(Fi=Un===$t-1?Ct?R[sr+1]:void 0:R[Un+1],Fi&&R[Un].equals(Fi))continue;mn&&(Gi=mn),oi&&(wi=oi),oi=R[Un],mn=Fi?Fi.sub(oi)._unit()._perp():Gi,Gi=Gi||mn;let Fa=Gi.add(mn);Fa.x===0&&Fa.y===0||Fa._unit();let ha=Gi.x*mn.x+Gi.y*mn.y,Ma=Fa.x*mn.x+Fa.y*mn.y,lo=Ma!==0?1/Ma:1/0,Oo=2*Math.sqrt(2-2*Ma),Is=Ma0;if(Is&&Un>sr){let al=oi.dist(wi);if(al>2*Ar){let qs=oi.sub(oi.sub(wi)._mult(Ar/al)._round());this.updateDistance(wi,qs),this.addCurrentVertex(qs,Gi,0,0,Rr),wi=qs}}let Cs=wi&&Fi,vs=Cs?ke:Ct?"butt":Ue;if(Cs&&vs==="round"&&(loQe&&(vs="bevel"),vs==="bevel"&&(lo>2&&(vs="flipbevel"),lo100)Fa=mn.mult(-1);else{let al=lo*Gi.add(mn).mag()/Gi.sub(mn).mag();Fa._perp()._mult(al*(Bl?-1:1))}this.addCurrentVertex(oi,Fa,0,0,Rr),this.addCurrentVertex(oi,Fa.mult(-1),0,0,Rr)}else if(vs==="bevel"||vs==="fakeround"){let al=-Math.sqrt(lo*lo-1),qs=Bl?al:0,Ns=Bl?0:al;if(wi&&this.addCurrentVertex(oi,Gi,qs,Ns,Rr),vs==="fakeround"){let wo=Math.round(180*Oo/Math.PI/20);for(let dl=1;dl2*Ar){let qs=oi.add(Fi.sub(oi)._mult(Ar/al)._round());this.updateDistance(oi,qs),this.addCurrentVertex(qs,mn,0,0,Rr),oi=qs}}}}addCurrentVertex(R,ae,ke,Ue,Qe,rt=!1){let Ct=ae.y*Ue-ae.x,$t=-ae.y-ae.x*Ue;this.addHalfVertex(R,ae.x+ae.y*ke,ae.y-ae.x*ke,rt,!1,ke,Qe),this.addHalfVertex(R,Ct,$t,rt,!0,-Ue,Qe),this.distance>d0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(R,ae,ke,Ue,Qe,rt))}addHalfVertex({x:R,y:ae},ke,Ue,Qe,rt,Ct,$t){let sr=.5*(this.lineClips?this.scaledDistance*(d0-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((R<<1)+(Qe?1:0),(ae<<1)+(rt?1:0),Math.round(63*ke)+128,Math.round(63*Ue)+128,1+(Ct===0?0:Ct<0?-1:1)|(63&sr)<<2,sr>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let Ar=$t.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Ar),$t.primitiveLength++),rt?this.e2=Ar:this.e1=Ar}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(R,ae){this.distance+=R.dist(ae),this.updateScaledDistance()}}let iv,t1;fa("LineBucket",Ap,{omit:["layers","patternFeatures"]});var nv={get paint(){return t1=t1||new Ke({"line-opacity":new Fs(fe.paint_line["line-opacity"]),"line-color":new Fs(fe.paint_line["line-color"]),"line-translate":new cs(fe.paint_line["line-translate"]),"line-translate-anchor":new cs(fe.paint_line["line-translate-anchor"]),"line-width":new Fs(fe.paint_line["line-width"]),"line-gap-width":new Fs(fe.paint_line["line-gap-width"]),"line-offset":new Fs(fe.paint_line["line-offset"]),"line-blur":new Fs(fe.paint_line["line-blur"]),"line-dasharray":new tc(fe.paint_line["line-dasharray"]),"line-pattern":new rh(fe.paint_line["line-pattern"]),"line-gradient":new ld(fe.paint_line["line-gradient"])})},get layout(){return iv=iv||new Ke({"line-cap":new cs(fe.layout_line["line-cap"]),"line-join":new Fs(fe.layout_line["line-join"]),"line-miter-limit":new cs(fe.layout_line["line-miter-limit"]),"line-round-limit":new cs(fe.layout_line["line-round-limit"]),"line-sort-key":new Fs(fe.layout_line["line-sort-key"])})}};class Dd extends Fs{possiblyEvaluate(R,ae){return ae=new Wl(Math.floor(ae.zoom),{now:ae.now,fadeDuration:ae.fadeDuration,zoomHistory:ae.zoomHistory,transition:ae.transition}),super.possiblyEvaluate(R,ae)}evaluate(R,ae,ke,Ue){return ae=E({},ae,{zoom:Math.floor(ae.zoom)}),super.evaluate(R,ae,ke,Ue)}}let Dg;class r1 extends pe{constructor(R){super(R,nv),this.gradientVersion=0,Dg||(Dg=new Dd(nv.paint.properties["line-width"].specification),Dg.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(R){if(R==="line-gradient"){let ae=this.gradientExpression();this.stepInterpolant=!!function(ke){return ke._styleExpression!==void 0}(ae)&&ae._styleExpression.expression instanceof pn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(R,ae){super.recalculate(R,ae),this.paint._values["line-floorwidth"]=Dg.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,R)}createBucket(R){return new Ap(R)}queryRadius(R){let ae=R,ke=zd(an("line-width",this,ae),an("line-gap-width",this,ae)),Ue=an("line-offset",this,ae);return ke/2+Math.abs(Ue)+Xn(this.paint.get("line-translate"))}queryIntersectsFeature(R,ae,ke,Ue,Qe,rt,Ct){let $t=Nn(R,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),rt.angle,Ct),sr=Ct/2*zd(this.paint.get("line-width").evaluate(ae,ke),this.paint.get("line-gap-width").evaluate(ae,ke)),Ar=this.paint.get("line-offset").evaluate(ae,ke);return Ar&&(Ue=function(Rr,oi){let wi=[];for(let Fi=0;Fi=3){for(let mn=0;mn0?R+2*X:X}let av=Mt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),py=Mt([{name:"a_projected_pos",components:3,type:"Float32"}],4);Mt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let my=Mt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Mt([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let Bm=Mt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),i1=Mt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function gf(X,R,ae){return X.sections.forEach(ke=>{ke.text=function(Ue,Qe,rt){let Ct=Qe.layout.get("text-transform").evaluate(rt,{});return Ct==="uppercase"?Ue=Ue.toLocaleUpperCase():Ct==="lowercase"&&(Ue=Ue.toLocaleLowerCase()),iu.applyArabicShaping&&(Ue=iu.applyArabicShaping(Ue)),Ue}(ke.text,R,ae)}),X}Mt([{name:"triangle",components:3,type:"Uint16"}]),Mt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Mt([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Mt([{type:"Float32",name:"offsetX"}]),Mt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Mt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let Od={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ic=24,n1=Hc,gy=function(X,R,ae,ke,Ue){var Qe,rt,Ct=8*Ue-ke-1,$t=(1<>1,Ar=-7,Rr=Ue-1,oi=-1,wi=X[R+Rr];for(Rr+=oi,Qe=wi&(1<<-Ar)-1,wi>>=-Ar,Ar+=Ct;Ar>0;Qe=256*Qe+X[R+Rr],Rr+=oi,Ar-=8);for(rt=Qe&(1<<-Ar)-1,Qe>>=-Ar,Ar+=ke;Ar>0;rt=256*rt+X[R+Rr],Rr+=oi,Ar-=8);if(Qe===0)Qe=1-sr;else{if(Qe===$t)return rt?NaN:1/0*(wi?-1:1);rt+=Math.pow(2,ke),Qe-=sr}return(wi?-1:1)*rt*Math.pow(2,Qe-ke)},Ob=function(X,R,ae,ke,Ue,Qe){var rt,Ct,$t,sr=8*Qe-Ue-1,Ar=(1<>1,oi=Ue===23?Math.pow(2,-24)-Math.pow(2,-77):0,wi=0,Fi=1,Gi=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(Ct=isNaN(R)?1:0,rt=Ar):(rt=Math.floor(Math.log(R)/Math.LN2),R*($t=Math.pow(2,-rt))<1&&(rt--,$t*=2),(R+=rt+Rr>=1?oi/$t:oi*Math.pow(2,1-Rr))*$t>=2&&(rt++,$t/=2),rt+Rr>=Ar?(Ct=0,rt=Ar):rt+Rr>=1?(Ct=(R*$t-1)*Math.pow(2,Ue),rt+=Rr):(Ct=R*Math.pow(2,Rr-1)*Math.pow(2,Ue),rt=0));Ue>=8;X[ae+wi]=255&Ct,wi+=Fi,Ct/=256,Ue-=8);for(rt=rt<0;X[ae+wi]=255&rt,wi+=Fi,rt/=256,sr-=8);X[ae+wi-Fi]|=128*Gi};function Hc(X){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(X)?X:new Uint8Array(X||0),this.pos=0,this.type=0,this.length=this.buf.length}Hc.Varint=0,Hc.Fixed64=1,Hc.Bytes=2,Hc.Fixed32=5;var zg=4294967296,Bb=1/zg,a1=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Rm(X){return X.type===Hc.Bytes?X.readVarint()+X.pos:X.pos+1}function Kw(X,R,ae){return ae?4294967296*R+(X>>>0):4294967296*(R>>>0)+(X>>>0)}function vy(X,R,ae){var ke=R<=16383?1:R<=2097151?2:R<=268435455?3:Math.floor(Math.log(R)/(7*Math.LN2));ae.realloc(ke);for(var Ue=ae.pos-1;Ue>=X;Ue--)ae.buf[Ue+ke]=ae.buf[Ue]}function AA(X,R){for(var ae=0;ae>>8,X[ae+2]=R>>>16,X[ae+3]=R>>>24}function R6(X,R){return(X[R]|X[R+1]<<8|X[R+2]<<16)+(X[R+3]<<24)}Hc.prototype={destroy:function(){this.buf=null},readFields:function(X,R,ae){for(ae=ae||this.length;this.pos>3,Qe=this.pos;this.type=7&ke,X(Ue,R,this),this.pos===Qe&&this.skip(ke)}return R},readMessage:function(X,R){return this.readFields(X,R,this.readVarint()+this.pos)},readFixed32:function(){var X=Fb(this.buf,this.pos);return this.pos+=4,X},readSFixed32:function(){var X=R6(this.buf,this.pos);return this.pos+=4,X},readFixed64:function(){var X=Fb(this.buf,this.pos)+Fb(this.buf,this.pos+4)*zg;return this.pos+=8,X},readSFixed64:function(){var X=Fb(this.buf,this.pos)+R6(this.buf,this.pos+4)*zg;return this.pos+=8,X},readFloat:function(){var X=gy(this.buf,this.pos,!0,23,4);return this.pos+=4,X},readDouble:function(){var X=gy(this.buf,this.pos,!0,52,8);return this.pos+=8,X},readVarint:function(X){var R,ae,ke=this.buf;return R=127&(ae=ke[this.pos++]),ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<7,ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<14,ae<128?R:(R|=(127&(ae=ke[this.pos++]))<<21,ae<128?R:function(Ue,Qe,rt){var Ct,$t,sr=rt.buf;if(Ct=(112&($t=sr[rt.pos++]))>>4,$t<128||(Ct|=(127&($t=sr[rt.pos++]))<<3,$t<128)||(Ct|=(127&($t=sr[rt.pos++]))<<10,$t<128)||(Ct|=(127&($t=sr[rt.pos++]))<<17,$t<128)||(Ct|=(127&($t=sr[rt.pos++]))<<24,$t<128)||(Ct|=(1&($t=sr[rt.pos++]))<<31,$t<128))return Kw(Ue,Ct,Qe);throw new Error("Expected varint not more than 10 bytes")}(R|=(15&(ae=ke[this.pos]))<<28,X,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var X=this.readVarint();return X%2==1?(X+1)/-2:X/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var X=this.readVarint()+this.pos,R=this.pos;return this.pos=X,X-R>=12&&a1?function(ae,ke,Ue){return a1.decode(ae.subarray(ke,Ue))}(this.buf,R,X):function(ae,ke,Ue){for(var Qe="",rt=ke;rt239?4:Ar>223?3:Ar>191?2:1;if(rt+oi>Ue)break;oi===1?Ar<128&&(Rr=Ar):oi===2?(192&(Ct=ae[rt+1]))==128&&(Rr=(31&Ar)<<6|63&Ct)<=127&&(Rr=null):oi===3?($t=ae[rt+2],(192&(Ct=ae[rt+1]))==128&&(192&$t)==128&&((Rr=(15&Ar)<<12|(63&Ct)<<6|63&$t)<=2047||Rr>=55296&&Rr<=57343)&&(Rr=null)):oi===4&&($t=ae[rt+2],sr=ae[rt+3],(192&(Ct=ae[rt+1]))==128&&(192&$t)==128&&(192&sr)==128&&((Rr=(15&Ar)<<18|(63&Ct)<<12|(63&$t)<<6|63&sr)<=65535||Rr>=1114112)&&(Rr=null)),Rr===null?(Rr=65533,oi=1):Rr>65535&&(Rr-=65536,Qe+=String.fromCharCode(Rr>>>10&1023|55296),Rr=56320|1023&Rr),Qe+=String.fromCharCode(Rr),rt+=oi}return Qe}(this.buf,R,X)},readBytes:function(){var X=this.readVarint()+this.pos,R=this.buf.subarray(this.pos,X);return this.pos=X,R},readPackedVarint:function(X,R){if(this.type!==Hc.Bytes)return X.push(this.readVarint(R));var ae=Rm(this);for(X=X||[];this.pos127;);else if(R===Hc.Bytes)this.pos=this.readVarint()+this.pos;else if(R===Hc.Fixed32)this.pos+=4;else{if(R!==Hc.Fixed64)throw new Error("Unimplemented type: "+R);this.pos+=8}},writeTag:function(X,R){this.writeVarint(X<<3|R)},realloc:function(X){for(var R=this.length||16;R268435455||X<0?function(R,ae){var ke,Ue;if(R>=0?(ke=R%4294967296|0,Ue=R/4294967296|0):(Ue=~(-R/4294967296),4294967295^(ke=~(-R%4294967296))?ke=ke+1|0:(ke=0,Ue=Ue+1|0)),R>=18446744073709552e3||R<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ae.realloc(10),function(Qe,rt,Ct){Ct.buf[Ct.pos++]=127&Qe|128,Qe>>>=7,Ct.buf[Ct.pos++]=127&Qe|128,Qe>>>=7,Ct.buf[Ct.pos++]=127&Qe|128,Qe>>>=7,Ct.buf[Ct.pos++]=127&Qe|128,Ct.buf[Ct.pos]=127&(Qe>>>=7)}(ke,0,ae),function(Qe,rt){var Ct=(7&Qe)<<4;rt.buf[rt.pos++]|=Ct|((Qe>>>=3)?128:0),Qe&&(rt.buf[rt.pos++]=127&Qe|((Qe>>>=7)?128:0),Qe&&(rt.buf[rt.pos++]=127&Qe|((Qe>>>=7)?128:0),Qe&&(rt.buf[rt.pos++]=127&Qe|((Qe>>>=7)?128:0),Qe&&(rt.buf[rt.pos++]=127&Qe|((Qe>>>=7)?128:0),Qe&&(rt.buf[rt.pos++]=127&Qe)))))}(Ue,ae)}(X,this):(this.realloc(4),this.buf[this.pos++]=127&X|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=127&(X>>>=7)|(X>127?128:0),X<=127||(this.buf[this.pos++]=X>>>7&127))))},writeSVarint:function(X){this.writeVarint(X<0?2*-X-1:2*X)},writeBoolean:function(X){this.writeVarint(!!X)},writeString:function(X){X=String(X),this.realloc(4*X.length),this.pos++;var R=this.pos;this.pos=function(ke,Ue,Qe){for(var rt,Ct,$t=0;$t55295&&rt<57344){if(!Ct){rt>56319||$t+1===Ue.length?(ke[Qe++]=239,ke[Qe++]=191,ke[Qe++]=189):Ct=rt;continue}if(rt<56320){ke[Qe++]=239,ke[Qe++]=191,ke[Qe++]=189,Ct=rt;continue}rt=Ct-55296<<10|rt-56320|65536,Ct=null}else Ct&&(ke[Qe++]=239,ke[Qe++]=191,ke[Qe++]=189,Ct=null);rt<128?ke[Qe++]=rt:(rt<2048?ke[Qe++]=rt>>6|192:(rt<65536?ke[Qe++]=rt>>12|224:(ke[Qe++]=rt>>18|240,ke[Qe++]=rt>>12&63|128),ke[Qe++]=rt>>6&63|128),ke[Qe++]=63&rt|128)}return Qe}(this.buf,X,this.pos);var ae=this.pos-R;ae>=128&&vy(R,ae,this),this.pos=R-1,this.writeVarint(ae),this.pos+=ae},writeFloat:function(X){this.realloc(4),Ob(this.buf,X,this.pos,!0,23,4),this.pos+=4},writeDouble:function(X){this.realloc(8),Ob(this.buf,X,this.pos,!0,52,8),this.pos+=8},writeBytes:function(X){var R=X.length;this.writeVarint(R),this.realloc(R);for(var ae=0;ae=128&&vy(ae,ke,this),this.pos=ae-1,this.writeVarint(ke),this.pos+=ke},writeMessage:function(X,R,ae){this.writeTag(X,Hc.Bytes),this.writeRawMessage(R,ae)},writePackedVarint:function(X,R){R.length&&this.writeMessage(X,AA,R)},writePackedSVarint:function(X,R){R.length&&this.writeMessage(X,MA,R)},writePackedBoolean:function(X,R){R.length&&this.writeMessage(X,PA,R)},writePackedFloat:function(X,R){R.length&&this.writeMessage(X,EA,R)},writePackedDouble:function(X,R){R.length&&this.writeMessage(X,LA,R)},writePackedFixed32:function(X,R){R.length&&this.writeMessage(X,IA,R)},writePackedSFixed32:function(X,R){R.length&&this.writeMessage(X,DA,R)},writePackedFixed64:function(X,R){R.length&&this.writeMessage(X,zA,R)},writePackedSFixed64:function(X,R){R.length&&this.writeMessage(X,Rb,R)},writeBytesField:function(X,R){this.writeTag(X,Hc.Bytes),this.writeBytes(R)},writeFixed32Field:function(X,R){this.writeTag(X,Hc.Fixed32),this.writeFixed32(R)},writeSFixed32Field:function(X,R){this.writeTag(X,Hc.Fixed32),this.writeSFixed32(R)},writeFixed64Field:function(X,R){this.writeTag(X,Hc.Fixed64),this.writeFixed64(R)},writeSFixed64Field:function(X,R){this.writeTag(X,Hc.Fixed64),this.writeSFixed64(R)},writeVarintField:function(X,R){this.writeTag(X,Hc.Varint),this.writeVarint(R)},writeSVarintField:function(X,R){this.writeTag(X,Hc.Varint),this.writeSVarint(R)},writeStringField:function(X,R){this.writeTag(X,Hc.Bytes),this.writeString(R)},writeFloatField:function(X,R){this.writeTag(X,Hc.Fixed32),this.writeFloat(R)},writeDoubleField:function(X,R){this.writeTag(X,Hc.Fixed64),this.writeDouble(R)},writeBooleanField:function(X,R){this.writeVarintField(X,!!R)}};var Yw=a(n1);let Nb=3;function OA(X,R,ae){X===1&&ae.readMessage(F6,R)}function F6(X,R,ae){if(X===3){let{id:ke,bitmap:Ue,width:Qe,height:rt,left:Ct,top:$t,advance:sr}=ae.readMessage(Xw,{});R.push({id:ke,bitmap:new Kl({width:Qe+2*Nb,height:rt+2*Nb},Ue),metrics:{width:Qe,height:rt,left:Ct,top:$t,advance:sr}})}}function Xw(X,R,ae){X===1?R.id=ae.readVarint():X===2?R.bitmap=ae.readBytes():X===3?R.width=ae.readVarint():X===4?R.height=ae.readVarint():X===5?R.left=ae.readSVarint():X===6?R.top=ae.readSVarint():X===7&&(R.advance=ae.readVarint())}let Jw=Nb;function jb(X){let R=0,ae=0;for(let rt of X)R+=rt.w*rt.h,ae=Math.max(ae,rt.w);X.sort((rt,Ct)=>Ct.h-rt.h);let ke=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(R/.95)),ae),h:1/0}],Ue=0,Qe=0;for(let rt of X)for(let Ct=ke.length-1;Ct>=0;Ct--){let $t=ke[Ct];if(!(rt.w>$t.w||rt.h>$t.h)){if(rt.x=$t.x,rt.y=$t.y,Qe=Math.max(Qe,rt.y+rt.h),Ue=Math.max(Ue,rt.x+rt.w),rt.w===$t.w&&rt.h===$t.h){let sr=ke.pop();Ct=0&&ke>=R&&$b[this.text.charCodeAt(ke)];ke--)ae--;this.text=this.text.substring(R,ae),this.sectionIndex=this.sectionIndex.slice(R,ae)}substring(R,ae){let ke=new xy;return ke.text=this.text.substring(R,ae),ke.sectionIndex=this.sectionIndex.slice(R,ae),ke.sections=this.sections,ke}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((R,ae)=>Math.max(R,this.sections[ae].scale),0)}addTextSection(R,ae){this.text+=R.text,this.sections.push(Y_.forText(R.scale,R.fontStack||ae));let ke=this.sections.length-1;for(let Ue=0;Ue=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ub(X,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi){let Gi=xy.fromFeature(X,Ue),mn;Rr===i.ah.vertical&&Gi.verticalizePunctuation();let{processBidirectionalText:Un,processStyledBidirectionalText:Fa}=iu;if(Un&&Gi.sections.length===1){mn=[];let lo=Un(Gi.toString(),o1(Gi,sr,Qe,R,ke,wi));for(let Oo of lo){let Is=new xy;Is.text=Oo,Is.sections=Gi.sections;for(let Bl=0;Bl0&&_m>rp&&(rp=_m)}else{let bh=Is[fc.fontStack],ip=bh&&bh[nh];if(ip&&ip.rect)Ey=ip.rect,Bh=ip.metrics;else{let _m=Oo[fc.fontStack],P0=_m&&_m[nh];if(!P0)continue;Bh=P0.metrics}of=(Rd-fc.scale)*Ic}Ep?(lo.verticalizable=!0,Gp.push({glyph:nh,imageName:Fm,x:eu,y:xh+of,vertical:Ep,scale:fc.scale,fontStack:fc.fontStack,sectionIndex:Vc,metrics:Bh,rect:Ey}),eu+=Nm*fc.scale+wo):(Gp.push({glyph:nh,imageName:Fm,x:eu,y:xh+of,vertical:Ep,scale:fc.scale,fontStack:fc.fontStack,sectionIndex:Vc,metrics:Bh,rect:Ey}),eu+=Bh.advance*fc.scale+wo)}Gp.length!==0&&(ph=Math.max(eu-wo,ph),FA(Gp,0,Gp.length-1,p0,rp)),eu=0;let L0=vs*Rd+rp;gp.lineOffset=Math.max(rp,Mp),xh+=L0,Bd=Math.max(L0,Bd),++Wf}var yd;let Vp=xh-_y,{horizontalAlign:Wp,verticalAlign:qp}=e3(al);(function(vf,Rd,Mp,gp,Gp,rp,L0,Oh,fc){let Vc=(Rd-Mp)*Gp,nh=0;nh=rp!==L0?-Oh*gp-_y:(-gp*fc+.5)*L0;for(let of of vf)for(let Bh of of.positionedGlyphs)Bh.x+=Vc,Bh.y+=nh})(lo.positionedLines,p0,Wp,qp,ph,Bd,vs,Vp,Cs.length),lo.top+=-qp*Vp,lo.bottom=lo.top+Vp,lo.left+=-Wp*ph,lo.right=lo.left+ph}(Ma,R,ae,ke,mn,rt,Ct,$t,Rr,sr,oi,Fi),!function(lo){for(let Oo of lo)if(Oo.positionedGlyphs.length!==0)return!1;return!0}(ha)&&Ma}let $b={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},BA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},RA={40:!0};function Hb(X,R,ae,ke,Ue,Qe){if(R.imageName){let rt=ke[R.imageName];return rt?rt.displaySize[0]*R.scale*Ic/Qe+Ue:0}{let rt=ae[R.fontStack],Ct=rt&&rt[X];return Ct?Ct.metrics.advance*R.scale+Ue:0}}function j6(X,R,ae,ke){let Ue=Math.pow(X-R,2);return ke?X=0,sr=0;for(let Rr=0;Rrsr){let Ar=Math.ceil(Qe/sr);Ue*=Ar/rt,rt=Ar}return{x1:ke,y1:Ue,x2:ke+Qe,y2:Ue+rt}}function $6(X,R,ae,ke,Ue,Qe){let rt=X.image,Ct;if(rt.content){let mn=rt.content,Un=rt.pixelRatio||1;Ct=[mn[0]/Un,mn[1]/Un,rt.displaySize[0]-mn[2]/Un,rt.displaySize[1]-mn[3]/Un]}let $t=R.left*Qe,sr=R.right*Qe,Ar,Rr,oi,wi;ae==="width"||ae==="both"?(wi=Ue[0]+$t-ke[3],Rr=Ue[0]+sr+ke[1]):(wi=Ue[0]+($t+sr-rt.displaySize[0])/2,Rr=wi+rt.displaySize[0]);let Fi=R.top*Qe,Gi=R.bottom*Qe;return ae==="height"||ae==="both"?(Ar=Ue[1]+Fi-ke[0],oi=Ue[1]+Gi+ke[2]):(Ar=Ue[1]+(Fi+Gi-rt.displaySize[1])/2,oi=Ar+rt.displaySize[1]),{image:rt,top:Ar,right:Rr,bottom:oi,left:wi,collisionPadding:Ct}}let X_=255,ig=128,sv=X_*ig;function H6(X,R){let{expression:ae}=R;if(ae.kind==="constant")return{kind:"constant",layoutSize:ae.evaluate(new Wl(X+1))};if(ae.kind==="source")return{kind:"source"};{let{zoomStops:ke,interpolationType:Ue}=ae,Qe=0;for(;Qert.id),this.index=R.index,this.pixelRatio=R.pixelRatio,this.sourceLayerIndex=R.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=wn([]),this.placementViewportMatrix=wn([]);let ae=this.layers[0]._unevaluatedLayout._values;this.textSizeData=H6(this.zoom,ae["text-size"]),this.iconSizeData=H6(this.zoom,ae["icon-size"]);let ke=this.layers[0].layout,Ue=ke.get("symbol-sort-key"),Qe=ke.get("symbol-z-order");this.canOverlap=t3(ke,"text-overlap","text-allow-overlap")!=="never"||t3(ke,"icon-overlap","icon-allow-overlap")!=="never"||ke.get("text-ignore-placement")||ke.get("icon-ignore-placement"),this.sortFeaturesByKey=Qe!=="viewport-y"&&!Ue.isConstant(),this.sortFeaturesByY=(Qe==="viewport-y"||Qe==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,ke.get("symbol-placement")==="point"&&(this.writingModes=ke.get("text-writing-mode").map(rt=>i.ah[rt])),this.stateDependentLayerIds=this.layers.filter(rt=>rt.isStateDependent()).map(rt=>rt.id),this.sourceID=R.sourceID}createArrays(){this.text=new Sf(new nu(this.layers,this.zoom,R=>/^text/.test(R))),this.icon=new Sf(new nu(this.layers,this.zoom,R=>/^icon/.test(R))),this.glyphOffsetArray=new wl,this.lineVertexArray=new Al,this.symbolInstances=new _s,this.textAnchorOffsets=new Pl}calculateGlyphDependencies(R,ae,ke,Ue,Qe){for(let rt=0;rt0)&&(rt.value.kind!=="constant"||rt.value.value.length>0),Ar=$t.value.kind!=="constant"||!!$t.value.value||Object.keys($t.parameters).length>0,Rr=Qe.get("symbol-sort-key");if(this.features=[],!sr&&!Ar)return;let oi=ae.iconDependencies,wi=ae.glyphDependencies,Fi=ae.availableImages,Gi=new Wl(this.zoom);for(let{feature:mn,id:Un,index:Fa,sourceLayerIndex:ha}of R){let Ma=Ue._featureFilter.needGeometry,lo=Nr(mn,Ma);if(!Ue._featureFilter.filter(Gi,lo,ke))continue;let Oo,Is;if(Ma||(lo.geometry=Ir(mn)),sr){let Cs=Ue.getValueAndResolveTokens("text-field",lo,ke,Fi),vs=Ui.factory(Cs),al=this.hasRTLText=this.hasRTLText||UA(vs);(!al||iu.getRTLTextPluginStatus()==="unavailable"||al&&iu.isParsed())&&(Oo=gf(vs,Ue,lo))}if(Ar){let Cs=Ue.getValueAndResolveTokens("icon-image",lo,ke,Fi);Is=Cs instanceof Kn?Cs:Kn.fromString(Cs)}if(!Oo&&!Is)continue;let Bl=this.sortFeaturesByKey?Rr.evaluate(lo,{},ke):void 0;if(this.features.push({id:Un,text:Oo,icon:Is,index:Fa,sourceLayerIndex:ha,geometry:lo.geometry,properties:mn.properties,type:jA[mn.type],sortKey:Bl}),Is&&(oi[Is.name]=!0),Oo){let Cs=rt.evaluate(lo,{},ke).join(","),vs=Qe.get("text-rotation-alignment")!=="viewport"&&Qe.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(i.ah.vertical)>=0;for(let al of Oo.sections)if(al.image)oi[al.image.name]=!0;else{let qs=ws(Oo.toString()),Ns=al.fontStack||Cs,wo=wi[Ns]=wi[Ns]||{};this.calculateGlyphDependencies(al.text,wo,vs,this.allowVerticalPlacement,qs)}}}Qe.get("symbol-placement")==="line"&&(this.features=function(mn){let Un={},Fa={},ha=[],Ma=0;function lo(Cs){ha.push(mn[Cs]),Ma++}function Oo(Cs,vs,al){let qs=Fa[Cs];return delete Fa[Cs],Fa[vs]=qs,ha[qs].geometry[0].pop(),ha[qs].geometry[0]=ha[qs].geometry[0].concat(al[0]),qs}function Is(Cs,vs,al){let qs=Un[vs];return delete Un[vs],Un[Cs]=qs,ha[qs].geometry[0].shift(),ha[qs].geometry[0]=al[0].concat(ha[qs].geometry[0]),qs}function Bl(Cs,vs,al){let qs=al?vs[0][vs[0].length-1]:vs[0][0];return`${Cs}:${qs.x}:${qs.y}`}for(let Cs=0;CsCs.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((mn,Un)=>mn.sortKey-Un.sortKey)}update(R,ae,ke){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(R,ae,this.layers,ke),this.icon.programConfigurations.updatePaintArrays(R,ae,this.layers,ke))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(R){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(R),this.iconCollisionBox.upload(R)),this.text.upload(R,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(R,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(R,ae){let ke=this.lineVertexArray.length;if(R.segment!==void 0){let Ue=R.dist(ae[R.segment+1]),Qe=R.dist(ae[R.segment]),rt={};for(let Ct=R.segment+1;Ct=0;Ct--)rt[Ct]={x:ae[Ct].x,y:ae[Ct].y,tileUnitDistanceFromAnchor:Qe},Ct>0&&(Qe+=ae[Ct-1].dist(ae[Ct]));for(let Ct=0;Ct0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(R,ae){let ke=R.placedSymbolArray.get(ae),Ue=ke.vertexStartIndex+4*ke.numGlyphs;for(let Qe=ke.vertexStartIndex;QeUe[Ct]-Ue[$t]||Qe[$t]-Qe[Ct]),rt}addToSortKeyRanges(R,ae){let ke=this.sortKeyRanges[this.sortKeyRanges.length-1];ke&&ke.sortKey===ae?ke.symbolInstanceEnd=R+1:this.sortKeyRanges.push({sortKey:ae,symbolInstanceStart:R,symbolInstanceEnd:R+1})}sortFeatures(R){if(this.sortFeaturesByY&&this.sortedAngle!==R&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(R),this.sortedAngle=R,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let ae of this.symbolInstanceIndexes){let ke=this.symbolInstances.get(ae);this.featureSortOrder.push(ke.featureIndex),[ke.rightJustifiedTextSymbolIndex,ke.centerJustifiedTextSymbolIndex,ke.leftJustifiedTextSymbolIndex].forEach((Ue,Qe,rt)=>{Ue>=0&&rt.indexOf(Ue)===Qe&&this.addIndicesForPlacedSymbol(this.text,Ue)}),ke.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,ke.verticalPlacedTextSymbolIndex),ke.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ke.placedIconSymbolIndex),ke.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,ke.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let J_,Q_;fa("SymbolBucket",s1,{omit:["layers","collisionBoxArray","features","compareText"]}),s1.MAX_GLYPHS=65535,s1.addDynamicAttributes=lv;var i3={get paint(){return Q_=Q_||new Ke({"icon-opacity":new Fs(fe.paint_symbol["icon-opacity"]),"icon-color":new Fs(fe.paint_symbol["icon-color"]),"icon-halo-color":new Fs(fe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fs(fe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fs(fe.paint_symbol["icon-halo-blur"]),"icon-translate":new cs(fe.paint_symbol["icon-translate"]),"icon-translate-anchor":new cs(fe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fs(fe.paint_symbol["text-opacity"]),"text-color":new Fs(fe.paint_symbol["text-color"],{runtimeType:vr,getOverride:X=>X.textColor,hasOverride:X=>!!X.textColor}),"text-halo-color":new Fs(fe.paint_symbol["text-halo-color"]),"text-halo-width":new Fs(fe.paint_symbol["text-halo-width"]),"text-halo-blur":new Fs(fe.paint_symbol["text-halo-blur"]),"text-translate":new cs(fe.paint_symbol["text-translate"]),"text-translate-anchor":new cs(fe.paint_symbol["text-translate-anchor"])})},get layout(){return J_=J_||new Ke({"symbol-placement":new cs(fe.layout_symbol["symbol-placement"]),"symbol-spacing":new cs(fe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new cs(fe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fs(fe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new cs(fe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new cs(fe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new cs(fe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new cs(fe.layout_symbol["icon-ignore-placement"]),"icon-optional":new cs(fe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new cs(fe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fs(fe.layout_symbol["icon-size"]),"icon-text-fit":new cs(fe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new cs(fe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fs(fe.layout_symbol["icon-image"]),"icon-rotate":new Fs(fe.layout_symbol["icon-rotate"]),"icon-padding":new Fs(fe.layout_symbol["icon-padding"]),"icon-keep-upright":new cs(fe.layout_symbol["icon-keep-upright"]),"icon-offset":new Fs(fe.layout_symbol["icon-offset"]),"icon-anchor":new Fs(fe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new cs(fe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new cs(fe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new cs(fe.layout_symbol["text-rotation-alignment"]),"text-field":new Fs(fe.layout_symbol["text-field"]),"text-font":new Fs(fe.layout_symbol["text-font"]),"text-size":new Fs(fe.layout_symbol["text-size"]),"text-max-width":new Fs(fe.layout_symbol["text-max-width"]),"text-line-height":new cs(fe.layout_symbol["text-line-height"]),"text-letter-spacing":new Fs(fe.layout_symbol["text-letter-spacing"]),"text-justify":new Fs(fe.layout_symbol["text-justify"]),"text-radial-offset":new Fs(fe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new cs(fe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Fs(fe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Fs(fe.layout_symbol["text-anchor"]),"text-max-angle":new cs(fe.layout_symbol["text-max-angle"]),"text-writing-mode":new cs(fe.layout_symbol["text-writing-mode"]),"text-rotate":new Fs(fe.layout_symbol["text-rotate"]),"text-padding":new cs(fe.layout_symbol["text-padding"]),"text-keep-upright":new cs(fe.layout_symbol["text-keep-upright"]),"text-transform":new Fs(fe.layout_symbol["text-transform"]),"text-offset":new Fs(fe.layout_symbol["text-offset"]),"text-allow-overlap":new cs(fe.layout_symbol["text-allow-overlap"]),"text-overlap":new cs(fe.layout_symbol["text-overlap"]),"text-ignore-placement":new cs(fe.layout_symbol["text-ignore-placement"]),"text-optional":new cs(fe.layout_symbol["text-optional"])})}};class wy{constructor(R){if(R.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=R.property.overrides?R.property.overrides.runtimeType:ut,this.defaultValue=R}evaluate(R){if(R.formattedSection){let ae=this.defaultValue.property.overrides;if(ae&&ae.hasOverride(R.formattedSection))return ae.getOverride(R.formattedSection)}return R.feature&&R.featureState?this.defaultValue.evaluate(R.feature,R.featureState):this.defaultValue.property.specification.default}eachChild(R){this.defaultValue.isConstant()||R(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}fa("FormatSectionOverride",wy,{omit:["defaultValue"]});class qb extends pe{constructor(R){super(R,i3)}recalculate(R,ae){if(super.recalculate(R,ae),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let ke=this.layout.get("text-writing-mode");if(ke){let Ue=[];for(let Qe of ke)Ue.indexOf(Qe)<0&&Ue.push(Qe);this.layout._values["text-writing-mode"]=Ue}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(R,ae,ke,Ue){let Qe=this.layout.get(R).evaluate(ae,{},ke,Ue),rt=this._unevaluatedLayout._values[R];return rt.isDataDriven()||tf(rt.value)||!Qe?Qe:function(Ct,$t){return $t.replace(/{([^{}]+)}/g,(sr,Ar)=>Ct&&Ar in Ct?String(Ct[Ar]):"")}(ae.properties,Qe)}createBucket(R){return new s1(R)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let R of i3.paint.overridableProperties){if(!qb.hasPaintOverride(this.layout,R))continue;let ae=this.paint.get(R),ke=new wy(ae),Ue=new Xc(ke,ae.property.specification),Qe=null;Qe=ae.value.kind==="constant"||ae.value.kind==="source"?new jh("source",Ue):new Fc("composite",Ue,ae.value.zoomStops),this.paint._values[R]=new Wu(ae.property,Qe,ae.parameters)}}_handleOverridablePaintPropertyUpdate(R,ae,ke){return!(!this.layout||ae.isDataDriven()||ke.isDataDriven())&&qb.hasPaintOverride(this.layout,R)}static hasPaintOverride(R,ae){let ke=R.get("text-field"),Ue=i3.paint.properties[ae],Qe=!1,rt=Ct=>{for(let $t of Ct)if(Ue.overrides&&Ue.overrides.hasOverride($t))return void(Qe=!0)};if(ke.value.kind==="constant"&&ke.value.value instanceof Ui)rt(ke.value.value.sections);else if(ke.value.kind==="source"){let Ct=sr=>{Qe||(sr instanceof io&&Mn(sr.value)===Lr?rt(sr.value.sections):sr instanceof Il?rt(sr.sections):sr.eachChild(Ct))},$t=ke.value;$t._styleExpression&&Ct($t._styleExpression.expression)}return Qe}}let n3;var V6={get paint(){return n3=n3||new Ke({"background-color":new cs(fe.paint_background["background-color"]),"background-pattern":new tc(fe.paint_background["background-pattern"]),"background-opacity":new cs(fe.paint_background["background-opacity"])})}};class ex extends pe{constructor(R){super(R,V6)}}let Gb;var a3={get paint(){return Gb=Gb||new Ke({"raster-opacity":new cs(fe.paint_raster["raster-opacity"]),"raster-hue-rotate":new cs(fe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new cs(fe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new cs(fe.paint_raster["raster-brightness-max"]),"raster-saturation":new cs(fe.paint_raster["raster-saturation"]),"raster-contrast":new cs(fe.paint_raster["raster-contrast"]),"raster-resampling":new cs(fe.paint_raster["raster-resampling"]),"raster-fade-duration":new cs(fe.paint_raster["raster-fade-duration"])})}};class $A extends pe{constructor(R){super(R,a3)}}class W6 extends pe{constructor(R){super(R,{}),this.onAdd=ae=>{this.implementation.onAdd&&this.implementation.onAdd(ae,ae.painter.context.gl)},this.onRemove=ae=>{this.implementation.onRemove&&this.implementation.onRemove(ae,ae.painter.context.gl)},this.implementation=R}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class tx{constructor(R){this._methodToThrottle=R,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let o3=63710088e-1;class ng{constructor(R,ae){if(isNaN(R)||isNaN(ae))throw new Error(`Invalid LngLat object: (${R}, ${ae})`);if(this.lng=+R,this.lat=+ae,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new ng(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(R){let ae=Math.PI/180,ke=this.lat*ae,Ue=R.lat*ae,Qe=Math.sin(ke)*Math.sin(Ue)+Math.cos(ke)*Math.cos(Ue)*Math.cos((R.lng-this.lng)*ae);return o3*Math.acos(Math.min(Qe,1))}static convert(R){if(R instanceof ng)return R;if(Array.isArray(R)&&(R.length===2||R.length===3))return new ng(Number(R[0]),Number(R[1]));if(!Array.isArray(R)&&typeof R=="object"&&R!==null)return new ng(Number("lng"in R?R.lng:R.lon),Number(R.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let q6=2*Math.PI*o3;function Zb(X){return q6*Math.cos(X*Math.PI/180)}function Kb(X){return(180+X)/360}function G6(X){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+X*Math.PI/360)))/360}function ym(X,R){return X/Zb(R)}function s3(X){return 360/Math.PI*Math.atan(Math.exp((180-360*X)*Math.PI/180))-90}class rx{constructor(R,ae,ke=0){this.x=+R,this.y=+ae,this.z=+ke}static fromLngLat(R,ae=0){let ke=ng.convert(R);return new rx(Kb(ke.lng),G6(ke.lat),ym(ae,ke.lat))}toLngLat(){return new ng(360*this.x-180,s3(this.y))}toAltitude(){return this.z*Zb(s3(this.y))}meterInMercatorCoordinateUnits(){return 1/q6*(R=s3(this.y),1/Math.cos(R*Math.PI/180));var R}}function Z6(X,R,ae){var ke=2*Math.PI*6378137/256/Math.pow(2,ae);return[X*ke-2*Math.PI*6378137/2,R*ke-2*Math.PI*6378137/2]}class l3{constructor(R,ae,ke){if(!function(Ue,Qe,rt){return!(Ue<0||Ue>25||rt<0||rt>=Math.pow(2,Ue)||Qe<0||Qe>=Math.pow(2,Ue))}(R,ae,ke))throw new Error(`x=${ae}, y=${ke}, z=${R} outside of bounds. 0<=x<${Math.pow(2,R)}, 0<=y<${Math.pow(2,R)} 0<=z<=25 `);this.z=R,this.x=ae,this.y=ke,this.key=ky(0,R,R,ae,ke)}equals(R){return this.z===R.z&&this.x===R.x&&this.y===R.y}url(R,ae,ke){let Ue=(rt=this.y,Ct=this.z,$t=Z6(256*(Qe=this.x),256*(rt=Math.pow(2,Ct)-rt-1),Ct),sr=Z6(256*(Qe+1),256*(rt+1),Ct),$t[0]+","+$t[1]+","+sr[0]+","+sr[1]);var Qe,rt,Ct,$t,sr;let Ar=function(Rr,oi,wi){let Fi,Gi="";for(let mn=Rr;mn>0;mn--)Fi=1<1?"@2x":"").replace(/{quadkey}/g,Ar).replace(/{bbox-epsg-3857}/g,Ue)}isChildOf(R){let ae=this.z-R.z;return ae>0&&R.x===this.x>>ae&&R.y===this.y>>ae}getTilePoint(R){let ae=Math.pow(2,this.z);return new u((R.x*ae-this.x)*cu,(R.y*ae-this.y)*cu)}toString(){return`${this.z}/${this.x}/${this.y}`}}class K6{constructor(R,ae){this.wrap=R,this.canonical=ae,this.key=ky(R,ae.z,ae.z,ae.x,ae.y)}}class J0{constructor(R,ae,ke,Ue,Qe){if(R= z; overscaledZ = ${R}; z = ${ke}`);this.overscaledZ=R,this.wrap=ae,this.canonical=new l3(ke,+Ue,+Qe),this.key=ky(ae,R,ke,Ue,Qe)}clone(){return new J0(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(R){return this.overscaledZ===R.overscaledZ&&this.wrap===R.wrap&&this.canonical.equals(R.canonical)}scaledTo(R){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let ae=this.canonical.z-R;return R>this.canonical.z?new J0(R,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new J0(R,this.wrap,R,this.canonical.x>>ae,this.canonical.y>>ae)}calculateScaledKey(R,ae){if(R>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${R}; overscaledZ = ${this.overscaledZ}`);let ke=this.canonical.z-R;return R>this.canonical.z?ky(this.wrap*+ae,R,this.canonical.z,this.canonical.x,this.canonical.y):ky(this.wrap*+ae,R,R,this.canonical.x>>ke,this.canonical.y>>ke)}isChildOf(R){if(R.wrap!==this.wrap)return!1;let ae=this.canonical.z-R.canonical.z;return R.overscaledZ===0||R.overscaledZ>ae&&R.canonical.y===this.canonical.y>>ae}children(R){if(this.overscaledZ>=R)return[new J0(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let ae=this.canonical.z+1,ke=2*this.canonical.x,Ue=2*this.canonical.y;return[new J0(ae,this.wrap,ae,ke,Ue),new J0(ae,this.wrap,ae,ke+1,Ue),new J0(ae,this.wrap,ae,ke,Ue+1),new J0(ae,this.wrap,ae,ke+1,Ue+1)]}isLessThan(R){return this.wrapR.wrap)&&(this.overscaledZR.overscaledZ)&&(this.canonical.xR.canonical.x)&&this.canonical.ythis.max&&(this.max=Rr),Rr=this.dim+1||ae<-1||ae>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(ae+1)*this.stride+(R+1)}unpack(R,ae,ke){return R*this.redFactor+ae*this.greenFactor+ke*this.blueFactor-this.baseShift}getPixels(){return new zl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(R,ae,ke){if(this.dim!==R.dim)throw new Error("dem dimension mismatch");let Ue=ae*this.dim,Qe=ae*this.dim+this.dim,rt=ke*this.dim,Ct=ke*this.dim+this.dim;switch(ae){case-1:Ue=Qe-1;break;case 1:Qe=Ue+1}switch(ke){case-1:rt=Ct-1;break;case 1:Ct=rt+1}let $t=-ae*this.dim,sr=-ke*this.dim;for(let Ar=rt;Ar=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${R} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[R]}}class X6{constructor(R,ae,ke,Ue,Qe){this.type="Feature",this._vectorTileFeature=R,R._z=ae,R._x=ke,R._y=Ue,this.properties=R.properties,this.id=Qe}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(R){this._geometry=R}toJSON(){let R={geometry:this.geometry};for(let ae in this)ae!=="_geometry"&&ae!=="_vectorTileFeature"&&(R[ae]=this[ae]);return R}}class J6{constructor(R,ae){this.tileID=R,this.x=R.canonical.x,this.y=R.canonical.y,this.z=R.canonical.z,this.grid=new Va(cu,16,0),this.grid3D=new Va(cu,16,0),this.featureIndexArray=new Tu,this.promoteId=ae}insert(R,ae,ke,Ue,Qe,rt){let Ct=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(ke,Ue,Qe);let $t=rt?this.grid3D:this.grid;for(let sr=0;sr=0&&Rr[3]>=0&&$t.insert(Ct,Rr[0],Rr[1],Rr[2],Rr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Dn.VectorTile(new Yw(this.rawTileData)).layers,this.sourceLayerCoder=new Y6(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(R,ae,ke,Ue){this.loadVTLayers();let Qe=R.params||{},rt=cu/R.tileSize/R.scale,Ct=Uf(Qe.filter),$t=R.queryGeometry,sr=R.queryPadding*rt,Ar=u3($t),Rr=this.grid.query(Ar.minX-sr,Ar.minY-sr,Ar.maxX+sr,Ar.maxY+sr),oi=u3(R.cameraQueryGeometry),wi=this.grid3D.query(oi.minX-sr,oi.minY-sr,oi.maxX+sr,oi.maxY+sr,(mn,Un,Fa,ha)=>function(Ma,lo,Oo,Is,Bl){for(let vs of Ma)if(lo<=vs.x&&Oo<=vs.y&&Is>=vs.x&&Bl>=vs.y)return!0;let Cs=[new u(lo,Oo),new u(lo,Bl),new u(Is,Bl),new u(Is,Oo)];if(Ma.length>2){for(let vs of Cs)if(jn(Ma,vs))return!0}for(let vs=0;vs(ha||(ha=Ir(Ma)),lo.queryIntersectsFeature($t,Ma,Oo,ha,this.z,R.transform,rt,R.pixelPosMatrix)))}return Fi}loadMatchingFeature(R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr){let oi=this.bucketLayerIDs[ae];if(rt&&!function(mn,Un){for(let Fa=0;Fa=0)return!0;return!1}(rt,oi))return;let wi=this.sourceLayerCoder.decode(ke),Fi=this.vtLayers[wi].feature(Ue);if(Qe.needGeometry){let mn=Nr(Fi,!0);if(!Qe.filter(new Wl(this.tileID.overscaledZ),mn,this.tileID.canonical))return}else if(!Qe.filter(new Wl(this.tileID.overscaledZ),Fi))return;let Gi=this.getId(Fi,wi);for(let mn=0;mn{let Ct=R instanceof Wh?R.get(rt):null;return Ct&&Ct.evaluate?Ct.evaluate(ae,ke,Ue):Ct})}function u3(X){let R=1/0,ae=1/0,ke=-1/0,Ue=-1/0;for(let Qe of X)R=Math.min(R,Qe.x),ae=Math.min(ae,Qe.y),ke=Math.max(ke,Qe.x),Ue=Math.max(Ue,Qe.y);return{minX:R,minY:ae,maxX:ke,maxY:Ue}}function ek(X,R){return R-X}function tk(X,R,ae,ke,Ue){let Qe=[];for(let rt=0;rt=ke&&Rr.x>=ke||(Ar.x>=ke?Ar=new u(ke,Ar.y+(ke-Ar.x)/(Rr.x-Ar.x)*(Rr.y-Ar.y))._round():Rr.x>=ke&&(Rr=new u(ke,Ar.y+(ke-Ar.x)/(Rr.x-Ar.x)*(Rr.y-Ar.y))._round()),Ar.y>=Ue&&Rr.y>=Ue||(Ar.y>=Ue?Ar=new u(Ar.x+(Ue-Ar.y)/(Rr.y-Ar.y)*(Rr.x-Ar.x),Ue)._round():Rr.y>=Ue&&(Rr=new u(Ar.x+(Ue-Ar.y)/(Rr.y-Ar.y)*(Rr.x-Ar.x),Ue)._round()),$t&&Ar.equals($t[$t.length-1])||($t=[Ar],Qe.push($t)),$t.push(Rr)))))}}return Qe}fa("FeatureIndex",J6,{omit:["rawTileData","sourceLayerCoder"]});class uv extends u{constructor(R,ae,ke,Ue){super(R,ae),this.angle=ke,Ue!==void 0&&(this.segment=Ue)}clone(){return new uv(this.x,this.y,this.angle,this.segment)}}function rk(X,R,ae,ke,Ue){if(R.segment===void 0||ae===0)return!0;let Qe=R,rt=R.segment+1,Ct=0;for(;Ct>-ae/2;){if(rt--,rt<0)return!1;Ct-=X[rt].dist(Qe),Qe=X[rt]}Ct+=X[rt].dist(X[rt+1]),rt++;let $t=[],sr=0;for(;Ctke;)sr-=$t.shift().angleDelta;if(sr>Ue)return!1;rt++,Ct+=Ar.dist(Rr)}return!0}function ik(X){let R=0;for(let ae=0;aesr){let Fi=(sr-$t)/wi,Gi=Wo.number(Rr.x,oi.x,Fi),mn=Wo.number(Rr.y,oi.y,Fi),Un=new uv(Gi,mn,oi.angleTo(Rr),Ar);return Un._round(),!rt||rk(X,Un,Ct,rt,R)?Un:void 0}$t+=wi}}function VA(X,R,ae,ke,Ue,Qe,rt,Ct,$t){let sr=nk(ke,Qe,rt),Ar=ak(ke,Ue),Rr=Ar*rt,oi=X[0].x===0||X[0].x===$t||X[0].y===0||X[0].y===$t;return R-Rr=0&&Ma<$t&&lo>=0&&lo<$t&&oi-sr>=0&&oi+sr<=Ar){let Oo=new uv(Ma,lo,Fa,Fi);Oo._round(),ke&&!rk(X,Oo,Qe,ke,Ue)||wi.push(Oo)}}Rr+=Un}return Ct||wi.length||rt||(wi=u1(X,Rr/2,ae,ke,Ue,Qe,rt,!0,$t)),wi}fa("Anchor",uv);let Ty=vd;function ok(X,R,ae,ke){let Ue=[],Qe=X.image,rt=Qe.pixelRatio,Ct=Qe.paddedRect.w-2*Ty,$t=Qe.paddedRect.h-2*Ty,sr={x1:X.left,y1:X.top,x2:X.right,y2:X.bottom},Ar=Qe.stretchX||[[0,Ct]],Rr=Qe.stretchY||[[0,$t]],oi=(wo,dl)=>wo+dl[1]-dl[0],wi=Ar.reduce(oi,0),Fi=Rr.reduce(oi,0),Gi=Ct-wi,mn=$t-Fi,Un=0,Fa=wi,ha=0,Ma=Fi,lo=0,Oo=Gi,Is=0,Bl=mn;if(Qe.content&&ke){let wo=Qe.content,dl=wo[2]-wo[0],ol=wo[3]-wo[1];(Qe.textFitWidth||Qe.textFitHeight)&&(sr=U6(X)),Un=Sy(Ar,0,wo[0]),ha=Sy(Rr,0,wo[1]),Fa=Sy(Ar,wo[0],wo[2]),Ma=Sy(Rr,wo[1],wo[3]),lo=wo[0]-Un,Is=wo[1]-ha,Oo=dl-Fa,Bl=ol-Ma}let Cs=sr.x1,vs=sr.y1,al=sr.x2-Cs,qs=sr.y2-vs,Ns=(wo,dl,ol,eu)=>{let xh=E0(wo.stretch-Un,Fa,al,Cs),ph=Yb(wo.fixed-lo,Oo,wo.stretch,wi),Bd=E0(dl.stretch-ha,Ma,qs,vs),p0=Yb(dl.fixed-Is,Bl,dl.stretch,Fi),Wf=E0(ol.stretch-Un,Fa,al,Cs),yd=Yb(ol.fixed-lo,Oo,ol.stretch,wi),Vp=E0(eu.stretch-ha,Ma,qs,vs),Wp=Yb(eu.fixed-Is,Bl,eu.stretch,Fi),qp=new u(xh,Bd),vf=new u(Wf,Bd),Rd=new u(Wf,Vp),Mp=new u(xh,Vp),gp=new u(ph/rt,p0/rt),Gp=new u(yd/rt,Wp/rt),rp=R*Math.PI/180;if(rp){let fc=Math.sin(rp),Vc=Math.cos(rp),nh=[Vc,-fc,fc,Vc];qp._matMult(nh),vf._matMult(nh),Mp._matMult(nh),Rd._matMult(nh)}let L0=wo.stretch+wo.fixed,Oh=dl.stretch+dl.fixed;return{tl:qp,tr:vf,bl:Mp,br:Rd,tex:{x:Qe.paddedRect.x+Ty+L0,y:Qe.paddedRect.y+Ty+Oh,w:ol.stretch+ol.fixed-L0,h:eu.stretch+eu.fixed-Oh},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:gp,pixelOffsetBR:Gp,minFontScaleX:Oo/rt/al,minFontScaleY:Bl/rt/qs,isSDF:ae}};if(ke&&(Qe.stretchX||Qe.stretchY)){let wo=Cy(Ar,Gi,wi),dl=Cy(Rr,mn,Fi);for(let ol=0;ol0&&(Gi=Math.max(10,Gi),this.circleDiameter=Gi)}else{let oi=!((Rr=rt.image)===null||Rr===void 0)&&Rr.content&&(rt.image.textFitWidth||rt.image.textFitHeight)?U6(rt):{x1:rt.left,y1:rt.top,x2:rt.right,y2:rt.bottom};oi.y1=oi.y1*Ct-$t[0],oi.y2=oi.y2*Ct+$t[2],oi.x1=oi.x1*Ct-$t[3],oi.x2=oi.x2*Ct+$t[1];let wi=rt.collisionPadding;if(wi&&(oi.x1-=wi[0]*Ct,oi.y1-=wi[1]*Ct,oi.x2+=wi[2]*Ct,oi.y2+=wi[3]*Ct),Ar){let Fi=new u(oi.x1,oi.y1),Gi=new u(oi.x2,oi.y1),mn=new u(oi.x1,oi.y2),Un=new u(oi.x2,oi.y2),Fa=Ar*Math.PI/180;Fi._rotate(Fa),Gi._rotate(Fa),mn._rotate(Fa),Un._rotate(Fa),oi.x1=Math.min(Fi.x,Gi.x,mn.x,Un.x),oi.x2=Math.max(Fi.x,Gi.x,mn.x,Un.x),oi.y1=Math.min(Fi.y,Gi.y,mn.y,Un.y),oi.y2=Math.max(Fi.y,Gi.y,mn.y,Un.y)}R.emplaceBack(ae.x,ae.y,oi.x1,oi.y1,oi.x2,oi.y2,ke,Ue,Qe)}this.boxEndIndex=R.length}}class WA{constructor(R=[],ae=(ke,Ue)=>keUe?1:0){if(this.data=R,this.length=this.data.length,this.compare=ae,this.length>0)for(let ke=(this.length>>1)-1;ke>=0;ke--)this._down(ke)}push(R){this.data.push(R),this._up(this.length++)}pop(){if(this.length===0)return;let R=this.data[0],ae=this.data.pop();return--this.length>0&&(this.data[0]=ae,this._down(0)),R}peek(){return this.data[0]}_up(R){let{data:ae,compare:ke}=this,Ue=ae[R];for(;R>0;){let Qe=R-1>>1,rt=ae[Qe];if(ke(Ue,rt)>=0)break;ae[R]=rt,R=Qe}ae[R]=Ue}_down(R){let{data:ae,compare:ke}=this,Ue=this.length>>1,Qe=ae[R];for(;R=0)break;ae[R]=ae[rt],R=rt}ae[R]=Qe}}function qA(X,R=1,ae=!1){let ke=1/0,Ue=1/0,Qe=-1/0,rt=-1/0,Ct=X[0];for(let wi=0;wiQe)&&(Qe=Fi.x),(!wi||Fi.y>rt)&&(rt=Fi.y)}let $t=Math.min(Qe-ke,rt-Ue),sr=$t/2,Ar=new WA([],GA);if($t===0)return new u(ke,Ue);for(let wi=ke;wiRr.d||!Rr.d)&&(Rr=wi,ae&&console.log("found best %d after %d probes",Math.round(1e4*wi.d)/1e4,oi)),wi.max-Rr.d<=R||(sr=wi.h/2,Ar.push(new ag(wi.p.x-sr,wi.p.y-sr,sr,X)),Ar.push(new ag(wi.p.x+sr,wi.p.y-sr,sr,X)),Ar.push(new ag(wi.p.x-sr,wi.p.y+sr,sr,X)),Ar.push(new ag(wi.p.x+sr,wi.p.y+sr,sr,X)),oi+=4)}return ae&&(console.log(`num probes: ${oi}`),console.log(`best distance: ${Rr.d}`)),Rr.p}function GA(X,R){return R.max-X.max}function ag(X,R,ae,ke){this.p=new u(X,R),this.h=ae,this.d=function(Ue,Qe){let rt=!1,Ct=1/0;for(let $t=0;$tUe.y!=Fi.y>Ue.y&&Ue.x<(Fi.x-wi.x)*(Ue.y-wi.y)/(Fi.y-wi.y)+wi.x&&(rt=!rt),Ct=Math.min(Ct,Ya(Ue,wi,Fi))}}return(rt?1:-1)*Math.sqrt(Ct)}(this.p,ke),this.max=this.d+this.h*Math.SQRT2}var tp;i.aq=void 0,(tp=i.aq||(i.aq={}))[tp.center=1]="center",tp[tp.left=2]="left",tp[tp.right=3]="right",tp[tp.top=4]="top",tp[tp.bottom=5]="bottom",tp[tp["top-left"]=6]="top-left",tp[tp["top-right"]=7]="top-right",tp[tp["bottom-left"]=8]="bottom-left",tp[tp["bottom-right"]=9]="bottom-right";let cv=7,c3=Number.POSITIVE_INFINITY;function sk(X,R){return R[1]!==c3?function(ae,ke,Ue){let Qe=0,rt=0;switch(ke=Math.abs(ke),Ue=Math.abs(Ue),ae){case"top-right":case"top-left":case"top":rt=Ue-cv;break;case"bottom-right":case"bottom-left":case"bottom":rt=-Ue+cv}switch(ae){case"top-right":case"bottom-right":case"right":Qe=-ke;break;case"top-left":case"bottom-left":case"left":Qe=ke}return[Qe,rt]}(X,R[0],R[1]):function(ae,ke){let Ue=0,Qe=0;ke<0&&(ke=0);let rt=ke/Math.SQRT2;switch(ae){case"top-right":case"top-left":Qe=rt-cv;break;case"bottom-right":case"bottom-left":Qe=-rt+cv;break;case"bottom":Qe=-ke+cv;break;case"top":Qe=ke-cv}switch(ae){case"top-right":case"bottom-right":Ue=-rt;break;case"top-left":case"bottom-left":Ue=rt;break;case"left":Ue=ke;break;case"right":Ue=-ke}return[Ue,Qe]}(X,R[0])}function lk(X,R,ae){var ke;let Ue=X.layout,Qe=(ke=Ue.get("text-variable-anchor-offset"))===null||ke===void 0?void 0:ke.evaluate(R,{},ae);if(Qe){let Ct=Qe.values,$t=[];for(let sr=0;sroi*Ic);Ar.startsWith("top")?Rr[1]-=cv:Ar.startsWith("bottom")&&(Rr[1]+=cv),$t[sr+1]=Rr}return new Fn($t)}let rt=Ue.get("text-variable-anchor");if(rt){let Ct;Ct=X._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ue.get("text-radial-offset").evaluate(R,{},ae)*Ic,c3]:Ue.get("text-offset").evaluate(R,{},ae).map(sr=>sr*Ic);let $t=[];for(let sr of rt)$t.push(sr,sk(sr,Ct));return new Fn($t)}return null}function h3(X){switch(X){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ZA(X,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar){let Rr=Qe.textMaxSize.evaluate(R,{});Rr===void 0&&(Rr=rt);let oi=X.layers[0].layout,wi=oi.get("icon-offset").evaluate(R,{},Ar),Fi=ck(ae.horizontal),Gi=rt/24,mn=X.tilePixelRatio*Gi,Un=X.tilePixelRatio*Rr/24,Fa=X.tilePixelRatio*Ct,ha=X.tilePixelRatio*oi.get("symbol-spacing"),Ma=oi.get("text-padding")*X.tilePixelRatio,lo=function(wo,dl,ol,eu=1){let xh=wo.get("icon-padding").evaluate(dl,{},ol),ph=xh&&xh.values;return[ph[0]*eu,ph[1]*eu,ph[2]*eu,ph[3]*eu]}(oi,R,Ar,X.tilePixelRatio),Oo=oi.get("text-max-angle")/180*Math.PI,Is=oi.get("text-rotation-alignment")!=="viewport"&&oi.get("symbol-placement")!=="point",Bl=oi.get("icon-rotation-alignment")==="map"&&oi.get("symbol-placement")!=="point",Cs=oi.get("symbol-placement"),vs=ha/2,al=oi.get("icon-text-fit"),qs;ke&&al!=="none"&&(X.allowVerticalPlacement&&ae.vertical&&(qs=$6(ke,ae.vertical,al,oi.get("icon-text-fit-padding"),wi,Gi)),Fi&&(ke=$6(ke,Fi,al,oi.get("icon-text-fit-padding"),wi,Gi)));let Ns=(wo,dl)=>{dl.x<0||dl.x>=cu||dl.y<0||dl.y>=cu||function(ol,eu,xh,ph,Bd,p0,Wf,yd,Vp,Wp,qp,vf,Rd,Mp,gp,Gp,rp,L0,Oh,fc,Vc,nh,of,Bh,Ey){let Fm=ol.addToLineVertexArray(eu,xh),Nm,Ep,bh,ip,_m=0,P0=0,Zp=0,v3=0,y3=-1,t2=-1,Bg={},_3=vn("");if(ol.allowVerticalPlacement&&ph.vertical){let vp=yd.layout.get("text-rotate").evaluate(Vc,{},Bh)+90;bh=new Xb(Vp,eu,Wp,qp,vf,ph.vertical,Rd,Mp,gp,vp),Wf&&(ip=new Xb(Vp,eu,Wp,qp,vf,Wf,rp,L0,gp,vp))}if(Bd){let vp=yd.layout.get("icon-rotate").evaluate(Vc,{}),I0=yd.layout.get("icon-text-fit")!=="none",hv=ok(Bd,vp,of,I0),jm=Wf?ok(Wf,vp,of,I0):void 0;Ep=new Xb(Vp,eu,Wp,qp,vf,Bd,rp,L0,!1,vp),_m=4*hv.length;let c1=ol.iconSizeData,Um=null;c1.kind==="source"?(Um=[ig*yd.layout.get("icon-size").evaluate(Vc,{})],Um[0]>sv&&T(`${ol.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)):c1.kind==="composite"&&(Um=[ig*nh.compositeIconSizes[0].evaluate(Vc,{},Bh),ig*nh.compositeIconSizes[1].evaluate(Vc,{},Bh)],(Um[0]>sv||Um[1]>sv)&&T(`${ol.layerIds[0]}: Value for "icon-size" is >= ${X_}. Reduce your "icon-size".`)),ol.addSymbols(ol.icon,hv,Um,fc,Oh,Vc,i.ah.none,eu,Fm.lineStartIndex,Fm.lineLength,-1,Bh),y3=ol.icon.placedSymbolArray.length-1,jm&&(P0=4*jm.length,ol.addSymbols(ol.icon,jm,Um,fc,Oh,Vc,i.ah.vertical,eu,Fm.lineStartIndex,Fm.lineLength,-1,Bh),t2=ol.icon.placedSymbolArray.length-1)}let x3=Object.keys(ph.horizontal);for(let vp of x3){let I0=ph.horizontal[vp];if(!Nm){_3=vn(I0.text);let jm=yd.layout.get("text-rotate").evaluate(Vc,{},Bh);Nm=new Xb(Vp,eu,Wp,qp,vf,I0,Rd,Mp,gp,jm)}let hv=I0.positionedLines.length===1;if(Zp+=uk(ol,eu,I0,p0,yd,gp,Vc,Gp,Fm,ph.vertical?i.ah.horizontal:i.ah.horizontalOnly,hv?x3:[vp],Bg,y3,nh,Bh),hv)break}ph.vertical&&(v3+=uk(ol,eu,ph.vertical,p0,yd,gp,Vc,Gp,Fm,i.ah.vertical,["vertical"],Bg,t2,nh,Bh));let b3=Nm?Nm.boxStartIndex:ol.collisionBoxArray.length,w3=Nm?Nm.boxEndIndex:ol.collisionBoxArray.length,KA=bh?bh.boxStartIndex:ol.collisionBoxArray.length,YA=bh?bh.boxEndIndex:ol.collisionBoxArray.length,XA=Ep?Ep.boxStartIndex:ol.collisionBoxArray.length,JA=Ep?Ep.boxEndIndex:ol.collisionBoxArray.length,mk=ip?ip.boxStartIndex:ol.collisionBoxArray.length,Ly=ip?ip.boxEndIndex:ol.collisionBoxArray.length,_d=-1,Py=(vp,I0)=>vp&&vp.circleDiameter?Math.max(vp.circleDiameter,I0):I0;_d=Py(Nm,_d),_d=Py(bh,_d),_d=Py(Ep,_d),_d=Py(ip,_d);let k3=_d>-1?1:0;k3&&(_d*=Ey/Ic),ol.glyphOffsetArray.length>=s1.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Vc.sortKey!==void 0&&ol.addToSortKeyRanges(ol.symbolInstances.length,Vc.sortKey);let gk=lk(yd,Vc,Bh),[QA,vk]=function(vp,I0){let hv=vp.length,jm=I0?.values;if(jm?.length>0)for(let c1=0;c1=0?Bg.right:-1,Bg.center>=0?Bg.center:-1,Bg.left>=0?Bg.left:-1,Bg.vertical||-1,y3,t2,_3,b3,w3,KA,YA,XA,JA,mk,Ly,Wp,Zp,v3,_m,P0,k3,0,Rd,_d,QA,vk)}(X,dl,wo,ae,ke,Ue,qs,X.layers[0],X.collisionBoxArray,R.index,R.sourceLayerIndex,X.index,mn,[Ma,Ma,Ma,Ma],Is,$t,Fa,lo,Bl,wi,R,Qe,sr,Ar,rt)};if(Cs==="line")for(let wo of tk(R.geometry,0,0,cu,cu)){let dl=VA(wo,ha,Oo,ae.vertical||Fi,ke,24,Un,X.overscaling,cu);for(let ol of dl)Fi&&hk(X,Fi.text,vs,ol)||Ns(wo,ol)}else if(Cs==="line-center"){for(let wo of R.geometry)if(wo.length>1){let dl=HA(wo,Oo,ae.vertical||Fi,ke,24,Un);dl&&Ns(wo,dl)}}else if(R.type==="Polygon")for(let wo of uh(R.geometry,0)){let dl=qA(wo,16);Ns(wo[0],new uv(dl.x,dl.y,0))}else if(R.type==="LineString")for(let wo of R.geometry)Ns(wo,new uv(wo[0].x,wo[0].y,0));else if(R.type==="Point")for(let wo of R.geometry)for(let dl of wo)Ns([dl],new uv(dl.x,dl.y,0))}function uk(X,R,ae,ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi){let Gi=function(Fa,ha,Ma,lo,Oo,Is,Bl,Cs){let vs=lo.layout.get("text-rotate").evaluate(Is,{})*Math.PI/180,al=[];for(let qs of ha.positionedLines)for(let Ns of qs.positionedGlyphs){if(!Ns.rect)continue;let wo=Ns.rect||{},dl=Jw+1,ol=!0,eu=1,xh=0,ph=(Oo||Cs)&&Ns.vertical,Bd=Ns.metrics.advance*Ns.scale/2;if(Cs&&ha.verticalizable&&(xh=qs.lineOffset/2-(Ns.imageName?-(Ic-Ns.metrics.width*Ns.scale)/2:(Ns.scale-1)*Ic)),Ns.imageName){let fc=Bl[Ns.imageName];ol=fc.sdf,eu=fc.pixelRatio,dl=vd/eu}let p0=Oo?[Ns.x+Bd,Ns.y]:[0,0],Wf=Oo?[0,0]:[Ns.x+Bd+Ma[0],Ns.y+Ma[1]-xh],yd=[0,0];ph&&(yd=Wf,Wf=[0,0]);let Vp=Ns.metrics.isDoubleResolution?2:1,Wp=(Ns.metrics.left-dl)*Ns.scale-Bd+Wf[0],qp=(-Ns.metrics.top-dl)*Ns.scale+Wf[1],vf=Wp+wo.w/Vp*Ns.scale/eu,Rd=qp+wo.h/Vp*Ns.scale/eu,Mp=new u(Wp,qp),gp=new u(vf,qp),Gp=new u(Wp,Rd),rp=new u(vf,Rd);if(ph){let fc=new u(-Bd,Bd-_y),Vc=-Math.PI/2,nh=Ic/2-Bd,of=new u(5-_y-nh,-(Ns.imageName?nh:0)),Bh=new u(...yd);Mp._rotateAround(Vc,fc)._add(of)._add(Bh),gp._rotateAround(Vc,fc)._add(of)._add(Bh),Gp._rotateAround(Vc,fc)._add(of)._add(Bh),rp._rotateAround(Vc,fc)._add(of)._add(Bh)}if(vs){let fc=Math.sin(vs),Vc=Math.cos(vs),nh=[Vc,-fc,fc,Vc];Mp._matMult(nh),gp._matMult(nh),Gp._matMult(nh),rp._matMult(nh)}let L0=new u(0,0),Oh=new u(0,0);al.push({tl:Mp,tr:gp,bl:Gp,br:rp,tex:wo,writingMode:ha.writingMode,glyphOffset:p0,sectionIndex:Ns.sectionIndex,isSDF:ol,pixelOffsetTL:L0,pixelOffsetBR:Oh,minFontScaleX:0,minFontScaleY:0})}return al}(0,ae,Ct,Ue,Qe,rt,ke,X.allowVerticalPlacement),mn=X.textSizeData,Un=null;mn.kind==="source"?(Un=[ig*Ue.layout.get("text-size").evaluate(rt,{})],Un[0]>sv&&T(`${X.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)):mn.kind==="composite"&&(Un=[ig*wi.compositeTextSizes[0].evaluate(rt,{},Fi),ig*wi.compositeTextSizes[1].evaluate(rt,{},Fi)],(Un[0]>sv||Un[1]>sv)&&T(`${X.layerIds[0]}: Value for "text-size" is >= ${X_}. Reduce your "text-size".`)),X.addSymbols(X.text,Gi,Un,Ct,Qe,rt,sr,R,$t.lineStartIndex,$t.lineLength,oi,Fi);for(let Fa of Ar)Rr[Fa]=X.text.placedSymbolArray.length-1;return 4*Gi.length}function ck(X){for(let R in X)return X[R];return null}function hk(X,R,ae,ke){let Ue=X.compareText;if(R in Ue){let Qe=Ue[R];for(let rt=Qe.length-1;rt>=0;rt--)if(ke.dist(Qe[rt])>4;if(Ue!==1)throw new Error(`Got v${Ue} data when expected v1.`);let Qe=fk[15&ke];if(!Qe)throw new Error("Unrecognized array type.");let[rt]=new Uint16Array(R,2,1),[Ct]=new Uint32Array(R,4,1);return new f3(Ct,rt,Qe,R)}constructor(R,ae=64,ke=Float64Array,Ue){if(isNaN(R)||R<0)throw new Error(`Unpexpected numItems value: ${R}.`);this.numItems=+R,this.nodeSize=Math.min(Math.max(+ae,2),65535),this.ArrayType=ke,this.IndexArrayType=R<65536?Uint16Array:Uint32Array;let Qe=fk.indexOf(this.ArrayType),rt=2*R*this.ArrayType.BYTES_PER_ELEMENT,Ct=R*this.IndexArrayType.BYTES_PER_ELEMENT,$t=(8-Ct%8)%8;if(Qe<0)throw new Error(`Unexpected typed array class: ${ke}.`);Ue&&Ue instanceof ArrayBuffer?(this.data=Ue,this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ct+$t,2*R),this._pos=2*R,this._finished=!0):(this.data=new ArrayBuffer(8+rt+Ct+$t),this.ids=new this.IndexArrayType(this.data,8,R),this.coords=new this.ArrayType(this.data,8+Ct+$t,2*R),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Qe]),new Uint16Array(this.data,2,1)[0]=ae,new Uint32Array(this.data,4,1)[0]=R)}add(R,ae){let ke=this._pos>>1;return this.ids[ke]=ke,this.coords[this._pos++]=R,this.coords[this._pos++]=ae,ke}finish(){let R=this._pos>>1;if(R!==this.numItems)throw new Error(`Added ${R} items when expected ${this.numItems}.`);return d3(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(R,ae,ke,Ue){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Qe,coords:rt,nodeSize:Ct}=this,$t=[0,Qe.length-1,0],sr=[];for(;$t.length;){let Ar=$t.pop()||0,Rr=$t.pop()||0,oi=$t.pop()||0;if(Rr-oi<=Ct){for(let mn=oi;mn<=Rr;mn++){let Un=rt[2*mn],Fa=rt[2*mn+1];Un>=R&&Un<=ke&&Fa>=ae&&Fa<=Ue&&sr.push(Qe[mn])}continue}let wi=oi+Rr>>1,Fi=rt[2*wi],Gi=rt[2*wi+1];Fi>=R&&Fi<=ke&&Gi>=ae&&Gi<=Ue&&sr.push(Qe[wi]),(Ar===0?R<=Fi:ae<=Gi)&&($t.push(oi),$t.push(wi-1),$t.push(1-Ar)),(Ar===0?ke>=Fi:Ue>=Gi)&&($t.push(wi+1),$t.push(Rr),$t.push(1-Ar))}return sr}within(R,ae,ke){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:Ue,coords:Qe,nodeSize:rt}=this,Ct=[0,Ue.length-1,0],$t=[],sr=ke*ke;for(;Ct.length;){let Ar=Ct.pop()||0,Rr=Ct.pop()||0,oi=Ct.pop()||0;if(Rr-oi<=rt){for(let mn=oi;mn<=Rr;mn++)mp(Qe[2*mn],Qe[2*mn+1],R,ae)<=sr&&$t.push(Ue[mn]);continue}let wi=oi+Rr>>1,Fi=Qe[2*wi],Gi=Qe[2*wi+1];mp(Fi,Gi,R,ae)<=sr&&$t.push(Ue[wi]),(Ar===0?R-ke<=Fi:ae-ke<=Gi)&&(Ct.push(oi),Ct.push(wi-1),Ct.push(1-Ar)),(Ar===0?R+ke>=Fi:ae+ke>=Gi)&&(Ct.push(wi+1),Ct.push(Rr),Ct.push(1-Ar))}return $t}}function d3(X,R,ae,ke,Ue,Qe){if(Ue-ke<=ae)return;let rt=ke+Ue>>1;dk(X,R,rt,ke,Ue,Qe),d3(X,R,ae,ke,rt-1,1-Qe),d3(X,R,ae,rt+1,Ue,1-Qe)}function dk(X,R,ae,ke,Ue,Qe){for(;Ue>ke;){if(Ue-ke>600){let sr=Ue-ke+1,Ar=ae-ke+1,Rr=Math.log(sr),oi=.5*Math.exp(2*Rr/3),wi=.5*Math.sqrt(Rr*oi*(sr-oi)/sr)*(Ar-sr/2<0?-1:1);dk(X,R,ae,Math.max(ke,Math.floor(ae-Ar*oi/sr+wi)),Math.min(Ue,Math.floor(ae+(sr-Ar)*oi/sr+wi)),Qe)}let rt=R[2*ae+Qe],Ct=ke,$t=Ue;for(Ay(X,R,ke,ae),R[2*Ue+Qe]>rt&&Ay(X,R,ke,Ue);Ct<$t;){for(Ay(X,R,Ct,$t),Ct++,$t--;R[2*Ct+Qe]rt;)$t--}R[2*ke+Qe]===rt?Ay(X,R,ke,$t):($t++,Ay(X,R,$t,Ue)),$t<=ae&&(ke=$t+1),ae<=$t&&(Ue=$t-1)}}function Ay(X,R,ae,ke){Jb(X,ae,ke),Jb(R,2*ae,2*ke),Jb(R,2*ae+1,2*ke+1)}function Jb(X,R,ae){let ke=X[R];X[R]=X[ae],X[ae]=ke}function mp(X,R,ae,ke){let Ue=X-ae,Qe=R-ke;return Ue*Ue+Qe*Qe}var p3;i.bg=void 0,(p3=i.bg||(i.bg={})).create="create",p3.load="load",p3.fullLoad="fullLoad";let Qb=null,My=[],m3=1e3/60,e2="loadTime",g3="fullLoadTime",pk={mark(X){performance.mark(X)},frame(X){let R=X;Qb!=null&&My.push(R-Qb),Qb=R},clearMetrics(){Qb=null,My=[],performance.clearMeasures(e2),performance.clearMeasures(g3);for(let X in i.bg)performance.clearMarks(i.bg[X])},getPerformanceMetrics(){performance.measure(e2,i.bg.create,i.bg.load),performance.measure(g3,i.bg.create,i.bg.fullLoad);let X=performance.getEntriesByName(e2)[0].duration,R=performance.getEntriesByName(g3)[0].duration,ae=My.length,ke=1/(My.reduce((Qe,rt)=>Qe+rt,0)/ae/1e3),Ue=My.filter(Qe=>Qe>m3).reduce((Qe,rt)=>Qe+(rt-m3)/m3,0);return{loadTime:X,fullLoadTime:R,fps:ke,percentDroppedFrames:Ue/(ae+Ue)*100,totalFrames:ae}}};i.$=class extends Vr{},i.A=Rn,i.B=Ea,i.C=function(X){if(U==null){let R=X.navigator?X.navigator.userAgent:null;U=!!X.safari||!(!R||!(/\b(iPad|iPhone|iPod)\b/.test(R)||R.match("Safari")&&!R.match("Chrome")))}return U},i.D=cs,i.E=me,i.F=class{constructor(X,R){this.target=X,this.mapId=R,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new tx(()=>this.process()),this.subscription=function(ae,ke,Ue,Qe){return ae.addEventListener(ke,Ue,!1),{unsubscribe:()=>{ae.removeEventListener(ke,Ue,!1)}}}(this.target,"message",ae=>this.receive(ae)),this.globalScope=B(self)?X:window}registerMessageHandler(X,R){this.messageHandlers[X]=R}sendAsync(X,R){return new Promise((ae,ke)=>{let Ue=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ue]={resolve:ae,reject:ke},R&&R.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ue];let Ct={id:Ue,type:"",origin:location.origin,targetMapId:X.targetMapId,sourceMapId:this.mapId};this.target.postMessage(Ct)},{once:!0});let Qe=[],rt=Object.assign(Object.assign({},X),{id:Ue,sourceMapId:this.mapId,origin:location.origin,data:ps(X.data,Qe)});this.target.postMessage(rt,{transfer:Qe})})}receive(X){let R=X.data,ae=R.id;if(!(R.origin!=="file://"&&location.origin!=="file://"&&R.origin!=="resource://android"&&location.origin!=="resource://android"&&R.origin!==location.origin||R.targetMapId&&this.mapId!==R.targetMapId)){if(R.type===""){delete this.tasks[ae];let ke=this.abortControllers[ae];return delete this.abortControllers[ae],void(ke&&ke.abort())}if(B(self)||R.mustQueue)return this.tasks[ae]=R,this.taskQueue.push(ae),void this.invoker.trigger();this.processTask(ae,R)}}process(){if(this.taskQueue.length===0)return;let X=this.taskQueue.shift(),R=this.tasks[X];delete this.tasks[X],this.taskQueue.length>0&&this.invoker.trigger(),R&&this.processTask(X,R)}processTask(X,R){return n(this,void 0,void 0,function*(){if(R.type===""){let Ue=this.resolveRejects[X];return delete this.resolveRejects[X],Ue?void(R.error?Ue.reject(xs(R.error)):Ue.resolve(xs(R.data))):void 0}if(!this.messageHandlers[R.type])return void this.completeTask(X,new Error(`Could not find a registered handler for ${R.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let ae=xs(R.data),ke=new AbortController;this.abortControllers[X]=ke;try{let Ue=yield this.messageHandlers[R.type](R.sourceMapId,ae,ke);this.completeTask(X,null,Ue)}catch(Ue){this.completeTask(X,Ue)}})}completeTask(X,R,ae){let ke=[];delete this.abortControllers[X];let Ue={id:X,type:"",sourceMapId:this.mapId,origin:location.origin,error:R?ps(R):null,data:ps(ae,ke)};this.target.postMessage(Ue,{transfer:ke})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},i.G=ve,i.H=function(){var X=new Rn(16);return Rn!=Float32Array&&(X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[11]=0,X[12]=0,X[13]=0,X[14]=0),X[0]=1,X[5]=1,X[10]=1,X[15]=1,X},i.I=pp,i.J=function(X,R,ae){var ke,Ue,Qe,rt,Ct,$t,sr,Ar,Rr,oi,wi,Fi,Gi=ae[0],mn=ae[1],Un=ae[2];return R===X?(X[12]=R[0]*Gi+R[4]*mn+R[8]*Un+R[12],X[13]=R[1]*Gi+R[5]*mn+R[9]*Un+R[13],X[14]=R[2]*Gi+R[6]*mn+R[10]*Un+R[14],X[15]=R[3]*Gi+R[7]*mn+R[11]*Un+R[15]):(Ue=R[1],Qe=R[2],rt=R[3],Ct=R[4],$t=R[5],sr=R[6],Ar=R[7],Rr=R[8],oi=R[9],wi=R[10],Fi=R[11],X[0]=ke=R[0],X[1]=Ue,X[2]=Qe,X[3]=rt,X[4]=Ct,X[5]=$t,X[6]=sr,X[7]=Ar,X[8]=Rr,X[9]=oi,X[10]=wi,X[11]=Fi,X[12]=ke*Gi+Ct*mn+Rr*Un+R[12],X[13]=Ue*Gi+$t*mn+oi*Un+R[13],X[14]=Qe*Gi+sr*mn+wi*Un+R[14],X[15]=rt*Gi+Ar*mn+Fi*Un+R[15]),X},i.K=function(X,R,ae){var ke=ae[0],Ue=ae[1],Qe=ae[2];return X[0]=R[0]*ke,X[1]=R[1]*ke,X[2]=R[2]*ke,X[3]=R[3]*ke,X[4]=R[4]*Ue,X[5]=R[5]*Ue,X[6]=R[6]*Ue,X[7]=R[7]*Ue,X[8]=R[8]*Qe,X[9]=R[9]*Qe,X[10]=R[10]*Qe,X[11]=R[11]*Qe,X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15],X},i.L=ja,i.M=function(X,R){let ae={};for(let ke=0;ke{let R=window.document.createElement("video");return R.muted=!0,new Promise(ae=>{R.onloadstart=()=>{ae(R)};for(let ke of X){let Ue=window.document.createElement("source");ne(ke)||(R.crossOrigin="Anonymous"),Ue.src=ke,R.appendChild(Ue)}})},i.a4=function(){return I++},i.a5=Ba,i.a6=s1,i.a7=Uf,i.a8=Nr,i.a9=X6,i.aA=function(X){if(X.type==="custom")return new W6(X);switch(X.type){case"background":return new ex(X);case"circle":return new Da(X);case"fill":return new In(X);case"fill-extrusion":return new u0(X);case"heatmap":return new kl(X);case"hillshade":return new Ec(X);case"line":return new r1(X);case"raster":return new $A(X);case"symbol":return new qb(X)}},i.aB=g,i.aC=function(X,R){if(!X)return[{command:"setStyle",args:[R]}];let ae=[];try{if(!Be(X.version,R.version))return[{command:"setStyle",args:[R]}];Be(X.center,R.center)||ae.push({command:"setCenter",args:[R.center]}),Be(X.zoom,R.zoom)||ae.push({command:"setZoom",args:[R.zoom]}),Be(X.bearing,R.bearing)||ae.push({command:"setBearing",args:[R.bearing]}),Be(X.pitch,R.pitch)||ae.push({command:"setPitch",args:[R.pitch]}),Be(X.sprite,R.sprite)||ae.push({command:"setSprite",args:[R.sprite]}),Be(X.glyphs,R.glyphs)||ae.push({command:"setGlyphs",args:[R.glyphs]}),Be(X.transition,R.transition)||ae.push({command:"setTransition",args:[R.transition]}),Be(X.light,R.light)||ae.push({command:"setLight",args:[R.light]}),Be(X.terrain,R.terrain)||ae.push({command:"setTerrain",args:[R.terrain]}),Be(X.sky,R.sky)||ae.push({command:"setSky",args:[R.sky]}),Be(X.projection,R.projection)||ae.push({command:"setProjection",args:[R.projection]});let ke={},Ue=[];(function(rt,Ct,$t,sr){let Ar;for(Ar in Ct=Ct||{},rt=rt||{})Object.prototype.hasOwnProperty.call(rt,Ar)&&(Object.prototype.hasOwnProperty.call(Ct,Ar)||tt(Ar,$t,sr));for(Ar in Ct)Object.prototype.hasOwnProperty.call(Ct,Ar)&&(Object.prototype.hasOwnProperty.call(rt,Ar)?Be(rt[Ar],Ct[Ar])||(rt[Ar].type==="geojson"&&Ct[Ar].type==="geojson"&&mt(rt,Ct,Ar)?Ze($t,{command:"setGeoJSONSourceData",args:[Ar,Ct[Ar].data]}):_t(Ar,Ct,$t,sr)):Ge(Ar,Ct,$t))})(X.sources,R.sources,Ue,ke);let Qe=[];X.layers&&X.layers.forEach(rt=>{"source"in rt&&ke[rt.source]?ae.push({command:"removeLayer",args:[rt.id]}):Qe.push(rt)}),ae=ae.concat(Ue),function(rt,Ct,$t){Ct=Ct||[];let sr=(rt=rt||[]).map(ct),Ar=Ct.map(ct),Rr=rt.reduce(Ae,{}),oi=Ct.reduce(Ae,{}),wi=sr.slice(),Fi=Object.create(null),Gi,mn,Un,Fa,ha;for(let Ma=0,lo=0;Ma@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ae,ke,Ue,Qe)=>{let rt=Ue||Qe;return R[ke]=!rt||rt.toLowerCase(),""}),R["max-age"]){let ae=parseInt(R["max-age"],10);isNaN(ae)?delete R["max-age"]:R["max-age"]=ae}return R},i.ab=function(X,R){let ae=[];for(let ke in X)ke in R||ae.push(ke);return ae},i.ac=w,i.ad=function(X,R,ae){var ke=Math.sin(ae),Ue=Math.cos(ae),Qe=R[0],rt=R[1],Ct=R[2],$t=R[3],sr=R[4],Ar=R[5],Rr=R[6],oi=R[7];return R!==X&&(X[8]=R[8],X[9]=R[9],X[10]=R[10],X[11]=R[11],X[12]=R[12],X[13]=R[13],X[14]=R[14],X[15]=R[15]),X[0]=Qe*Ue+sr*ke,X[1]=rt*Ue+Ar*ke,X[2]=Ct*Ue+Rr*ke,X[3]=$t*Ue+oi*ke,X[4]=sr*Ue-Qe*ke,X[5]=Ar*Ue-rt*ke,X[6]=Rr*Ue-Ct*ke,X[7]=oi*Ue-$t*ke,X},i.ae=function(X){var R=new Rn(16);return R[0]=X[0],R[1]=X[1],R[2]=X[2],R[3]=X[3],R[4]=X[4],R[5]=X[5],R[6]=X[6],R[7]=X[7],R[8]=X[8],R[9]=X[9],R[10]=X[10],R[11]=X[11],R[12]=X[12],R[13]=X[13],R[14]=X[14],R[15]=X[15],R},i.af=la,i.ag=function(X,R){let ae=0,ke=0;if(X.kind==="constant")ke=X.layoutSize;else if(X.kind!=="source"){let{interpolationType:Ue,minZoom:Qe,maxZoom:rt}=X,Ct=Ue?w(Wa.interpolationFactor(Ue,R,Qe,rt),0,1):0;X.kind==="camera"?ke=Wo.number(X.minSize,X.maxSize,Ct):ae=Ct}return{uSizeT:ae,uSize:ke}},i.ai=function(X,{uSize:R,uSizeT:ae},{lowerSize:ke,upperSize:Ue}){return X.kind==="source"?ke/ig:X.kind==="composite"?Wo.number(ke/ig,Ue/ig,ae):R},i.aj=lv,i.ak=function(X,R,ae,ke){let Ue=R.y-X.y,Qe=R.x-X.x,rt=ke.y-ae.y,Ct=ke.x-ae.x,$t=rt*Qe-Ct*Ue;if($t===0)return null;let sr=(Ct*(X.y-ae.y)-rt*(X.x-ae.x))/$t;return new u(X.x+sr*Qe,X.y+sr*Ue)},i.al=tk,i.am=xn,i.an=wn,i.ao=function(X){let R=1/0,ae=1/0,ke=-1/0,Ue=-1/0;for(let Qe of X)R=Math.min(R,Qe.x),ae=Math.min(ae,Qe.y),ke=Math.max(ke,Qe.x),Ue=Math.max(Ue,Qe.y);return[R,ae,ke,Ue]},i.ap=Ic,i.ar=t3,i.as=function(X,R){var ae=R[0],ke=R[1],Ue=R[2],Qe=R[3],rt=R[4],Ct=R[5],$t=R[6],sr=R[7],Ar=R[8],Rr=R[9],oi=R[10],wi=R[11],Fi=R[12],Gi=R[13],mn=R[14],Un=R[15],Fa=ae*Ct-ke*rt,ha=ae*$t-Ue*rt,Ma=ae*sr-Qe*rt,lo=ke*$t-Ue*Ct,Oo=ke*sr-Qe*Ct,Is=Ue*sr-Qe*$t,Bl=Ar*Gi-Rr*Fi,Cs=Ar*mn-oi*Fi,vs=Ar*Un-wi*Fi,al=Rr*mn-oi*Gi,qs=Rr*Un-wi*Gi,Ns=oi*Un-wi*mn,wo=Fa*Ns-ha*qs+Ma*al+lo*vs-Oo*Cs+Is*Bl;return wo?(X[0]=(Ct*Ns-$t*qs+sr*al)*(wo=1/wo),X[1]=(Ue*qs-ke*Ns-Qe*al)*wo,X[2]=(Gi*Is-mn*Oo+Un*lo)*wo,X[3]=(oi*Oo-Rr*Is-wi*lo)*wo,X[4]=($t*vs-rt*Ns-sr*Cs)*wo,X[5]=(ae*Ns-Ue*vs+Qe*Cs)*wo,X[6]=(mn*Ma-Fi*Is-Un*ha)*wo,X[7]=(Ar*Is-oi*Ma+wi*ha)*wo,X[8]=(rt*qs-Ct*vs+sr*Bl)*wo,X[9]=(ke*vs-ae*qs-Qe*Bl)*wo,X[10]=(Fi*Oo-Gi*Ma+Un*Fa)*wo,X[11]=(Rr*Ma-Ar*Oo-wi*Fa)*wo,X[12]=(Ct*Cs-rt*al-$t*Bl)*wo,X[13]=(ae*al-ke*Cs+Ue*Bl)*wo,X[14]=(Gi*ha-Fi*lo-mn*Fa)*wo,X[15]=(Ar*lo-Rr*ha+oi*Fa)*wo,X):null},i.at=h3,i.au=e3,i.av=f3,i.aw=function(){let X={},R=fe.$version;for(let ae in fe.$root){let ke=fe.$root[ae];if(ke.required){let Ue=null;Ue=ae==="version"?R:ke.type==="array"?[]:{},Ue!=null&&(X[ae]=Ue)}}return X},i.ax=_o,i.ay=re,i.az=function(X){X=X.slice();let R=Object.create(null);for(let ae=0;ae25||ke<0||ke>=1||ae<0||ae>=1)},i.bc=function(X,R){return X[0]=R[0],X[1]=0,X[2]=0,X[3]=0,X[4]=0,X[5]=R[1],X[6]=0,X[7]=0,X[8]=0,X[9]=0,X[10]=R[2],X[11]=0,X[12]=0,X[13]=0,X[14]=0,X[15]=1,X},i.bd=class extends kr{},i.be=o3,i.bf=pk,i.bh=ce,i.bi=function(X,R){he.REGISTERED_PROTOCOLS[X]=R},i.bj=function(X){delete he.REGISTERED_PROTOCOLS[X]},i.bk=function(X,R){let ae={};for(let Ue=0;UeNs*Ic)}let Cs=rt?"center":ae.get("text-justify").evaluate(sr,{},X.canonical),vs=ae.get("symbol-placement")==="point"?ae.get("text-max-width").evaluate(sr,{},X.canonical)*Ic:1/0,al=()=>{X.bucket.allowVerticalPlacement&&ws(Ma)&&(Fi.vertical=Ub(Gi,X.glyphMap,X.glyphPositions,X.imagePositions,Ar,vs,Qe,Is,"left",Oo,Un,i.ah.vertical,!0,oi,Rr))};if(!rt&&Bl){let qs=new Set;if(Cs==="auto")for(let wo=0;won(void 0,void 0,void 0,function*(){if(X.byteLength===0)return createImageBitmap(new ImageData(1,1));let R=new Blob([new Uint8Array(X)],{type:"image/png"});try{return createImageBitmap(R)}catch(ae){throw new Error(`Could not load image because of ${ae.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),i.e=E,i.f=X=>new Promise((R,ae)=>{let ke=new Image;ke.onload=()=>{R(ke),URL.revokeObjectURL(ke.src),ke.onload=null,window.requestAnimationFrame(()=>{ke.src=W})},ke.onerror=()=>ae(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let Ue=new Blob([new Uint8Array(X)],{type:"image/png"});ke.src=X.byteLength?URL.createObjectURL(Ue):W}),i.g=be,i.h=(X,R)=>ge(E(X,{type:"json"}),R),i.i=B,i.j=J,i.k=oe,i.l=(X,R)=>ge(E(X,{type:"arrayBuffer"}),R),i.m=ge,i.n=function(X){return new Yw(X).readFields(OA,[])},i.o=Kl,i.p=jb,i.q=Ke,i.r=pa,i.s=ne,i.t=wa,i.u=Pn,i.v=fe,i.w=T,i.x=function([X,R,ae]){return R+=90,R*=Math.PI/180,ae*=Math.PI/180,{x:X*Math.cos(R)*Math.sin(ae),y:X*Math.sin(R)*Math.sin(ae),z:X*Math.cos(ae)}},i.y=Wo,i.z=Wl}),z("worker",["./shared"],function(i){class n{constructor(Xe){this.keyCache={},Xe&&this.replace(Xe)}replace(Xe){this._layerConfigs={},this._layers={},this.update(Xe,[])}update(Xe,ot){for(let ye of Xe){this._layerConfigs[ye.id]=ye;let Pe=this._layers[ye.id]=i.aA(ye);Pe._featureFilter=i.a7(Pe.filter),this.keyCache[ye.id]&&delete this.keyCache[ye.id]}for(let ye of ot)delete this.keyCache[ye],delete this._layerConfigs[ye],delete this._layers[ye];this.familiesBySource={};let De=i.bk(Object.values(this._layerConfigs),this.keyCache);for(let ye of De){let Pe=ye.map(Yt=>this._layers[Yt.id]),He=Pe[0];if(He.visibility==="none")continue;let at=He.source||"",ht=this.familiesBySource[at];ht||(ht=this.familiesBySource[at]={});let At=He.sourceLayer||"_geojsonTileLayer",Wt=ht[At];Wt||(Wt=ht[At]=[]),Wt.push(Pe)}}}class a{constructor(Xe){let ot={},De=[];for(let at in Xe){let ht=Xe[at],At=ot[at]={};for(let Wt in ht){let Yt=ht[+Wt];if(!Yt||Yt.bitmap.width===0||Yt.bitmap.height===0)continue;let hr={x:0,y:0,w:Yt.bitmap.width+2,h:Yt.bitmap.height+2};De.push(hr),At[Wt]={rect:hr,metrics:Yt.metrics}}}let{w:ye,h:Pe}=i.p(De),He=new i.o({width:ye||1,height:Pe||1});for(let at in Xe){let ht=Xe[at];for(let At in ht){let Wt=ht[+At];if(!Wt||Wt.bitmap.width===0||Wt.bitmap.height===0)continue;let Yt=ot[at][At].rect;i.o.copy(Wt.bitmap,He,{x:0,y:0},{x:Yt.x+1,y:Yt.y+1},Wt.bitmap)}}this.image=He,this.positions=ot}}i.bl("GlyphAtlas",a);class l{constructor(Xe){this.tileID=new i.S(Xe.tileID.overscaledZ,Xe.tileID.wrap,Xe.tileID.canonical.z,Xe.tileID.canonical.x,Xe.tileID.canonical.y),this.uid=Xe.uid,this.zoom=Xe.zoom,this.pixelRatio=Xe.pixelRatio,this.tileSize=Xe.tileSize,this.source=Xe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Xe.showCollisionBoxes,this.collectResourceTiming=!!Xe.collectResourceTiming,this.returnDependencies=!!Xe.returnDependencies,this.promoteId=Xe.promoteId,this.inFlightDependencies=[]}parse(Xe,ot,De,ye){return i._(this,void 0,void 0,function*(){this.status="parsing",this.data=Xe,this.collisionBoxArray=new i.a5;let Pe=new i.bm(Object.keys(Xe.layers).sort()),He=new i.bn(this.tileID,this.promoteId);He.bucketLayerIDs=[];let at={},ht={featureIndex:He,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:De},At=ot.familiesBySource[this.source];for(let Sn in At){let dn=Xe.layers[Sn];if(!dn)continue;dn.version===1&&i.w(`Vector tile source "${this.source}" layer "${Sn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let va=Pe.encode(Sn),na=[];for(let Kt=0;Kt=lr.maxzoom||lr.visibility!=="none"&&(o(Kt,this.zoom,De),(at[lr.id]=lr.createBucket({index:He.bucketLayerIDs.length,layers:Kt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:va,sourceID:this.source})).populate(na,ht,this.tileID.canonical),He.bucketLayerIDs.push(Kt.map(_r=>_r.id)))}}let Wt=i.aF(ht.glyphDependencies,Sn=>Object.keys(Sn).map(Number));this.inFlightDependencies.forEach(Sn=>Sn?.abort()),this.inFlightDependencies=[];let Yt=Promise.resolve({});if(Object.keys(Wt).length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),Yt=ye.sendAsync({type:"GG",data:{stacks:Wt,source:this.source,tileID:this.tileID,type:"glyphs"}},Sn)}let hr=Object.keys(ht.iconDependencies),zr=Promise.resolve({});if(hr.length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),zr=ye.sendAsync({type:"GI",data:{icons:hr,source:this.source,tileID:this.tileID,type:"icons"}},Sn)}let Dr=Object.keys(ht.patternDependencies),br=Promise.resolve({});if(Dr.length){let Sn=new AbortController;this.inFlightDependencies.push(Sn),br=ye.sendAsync({type:"GI",data:{icons:Dr,source:this.source,tileID:this.tileID,type:"patterns"}},Sn)}let[fi,un,cn]=yield Promise.all([Yt,zr,br]),yn=new a(fi),Gn=new i.bo(un,cn);for(let Sn in at){let dn=at[Sn];dn instanceof i.a6?(o(dn.layers,this.zoom,De),i.bp({bucket:dn,glyphMap:fi,glyphPositions:yn.positions,imageMap:un,imagePositions:Gn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):dn.hasPattern&&(dn instanceof i.bq||dn instanceof i.br||dn instanceof i.bs)&&(o(dn.layers,this.zoom,De),dn.addFeatures(ht,this.tileID.canonical,Gn.patternPositions))}return this.status="done",{buckets:Object.values(at).filter(Sn=>!Sn.isEmpty()),featureIndex:He,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:yn.image,imageAtlas:Gn,glyphMap:this.returnDependencies?fi:null,iconMap:this.returnDependencies?un:null,glyphPositions:this.returnDependencies?yn.positions:null}})}}function o(Ot,Xe,ot){let De=new i.z(Xe);for(let ye of Ot)ye.recalculate(De,ot)}class u{constructor(Xe,ot,De){this.actor=Xe,this.layerIndex=ot,this.availableImages=De,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Xe,ot){return i._(this,void 0,void 0,function*(){let De=yield i.l(Xe.request,ot);try{return{vectorTile:new i.bt.VectorTile(new i.bu(De.data)),rawData:De.data,cacheControl:De.cacheControl,expires:De.expires}}catch(ye){let Pe=new Uint8Array(De.data),He=`Unable to parse the tile at ${Xe.request.url}, `;throw He+=Pe[0]===31&&Pe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ye.message}`,new Error(He)}})}loadTile(Xe){return i._(this,void 0,void 0,function*(){let ot=Xe.uid,De=!!(Xe&&Xe.request&&Xe.request.collectResourceTiming)&&new i.bv(Xe.request),ye=new l(Xe);this.loading[ot]=ye;let Pe=new AbortController;ye.abort=Pe;try{let He=yield this.loadVectorTile(Xe,Pe);if(delete this.loading[ot],!He)return null;let at=He.rawData,ht={};He.expires&&(ht.expires=He.expires),He.cacheControl&&(ht.cacheControl=He.cacheControl);let At={};if(De){let Yt=De.finish();Yt&&(At.resourceTiming=JSON.parse(JSON.stringify(Yt)))}ye.vectorTile=He.vectorTile;let Wt=ye.parse(He.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ot]=ye,this.fetching[ot]={rawTileData:at,cacheControl:ht,resourceTiming:At};try{let Yt=yield Wt;return i.e({rawTileData:at.slice(0)},Yt,ht,At)}finally{delete this.fetching[ot]}}catch(He){throw delete this.loading[ot],ye.status="done",this.loaded[ot]=ye,He}})}reloadTile(Xe){return i._(this,void 0,void 0,function*(){let ot=Xe.uid;if(!this.loaded||!this.loaded[ot])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let De=this.loaded[ot];if(De.showCollisionBoxes=Xe.showCollisionBoxes,De.status==="parsing"){let ye=yield De.parse(De.vectorTile,this.layerIndex,this.availableImages,this.actor),Pe;if(this.fetching[ot]){let{rawTileData:He,cacheControl:at,resourceTiming:ht}=this.fetching[ot];delete this.fetching[ot],Pe=i.e({rawTileData:He.slice(0)},ye,at,ht)}else Pe=ye;return Pe}if(De.status==="done"&&De.vectorTile)return De.parse(De.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Xe){return i._(this,void 0,void 0,function*(){let ot=this.loading,De=Xe.uid;ot&&ot[De]&&ot[De].abort&&(ot[De].abort.abort(),delete ot[De])})}removeTile(Xe){return i._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Xe.uid]&&delete this.loaded[Xe.uid]})}}class s{constructor(){this.loaded={}}loadTile(Xe){return i._(this,void 0,void 0,function*(){let{uid:ot,encoding:De,rawImageData:ye,redFactor:Pe,greenFactor:He,blueFactor:at,baseShift:ht}=Xe,At=ye.width+2,Wt=ye.height+2,Yt=i.b(ye)?new i.R({width:At,height:Wt},yield i.bw(ye,-1,-1,At,Wt)):ye,hr=new i.bx(ot,Yt,De,Pe,He,at,ht);return this.loaded=this.loaded||{},this.loaded[ot]=hr,hr})}removeTile(Xe){let ot=this.loaded,De=Xe.uid;ot&&ot[De]&&delete ot[De]}}function h(Ot,Xe){if(Ot.length!==0){m(Ot[0],Xe);for(var ot=1;ot=Math.abs(at)?ot-ht+at:at-ht+ot,ot=ht}ot+De>=0!=!!Xe&&Ot.reverse()}var b=i.by(function Ot(Xe,ot){var De,ye=Xe&&Xe.type;if(ye==="FeatureCollection")for(De=0;De>31}function B(Ot,Xe){for(var ot=Ot.loadGeometry(),De=Ot.type,ye=0,Pe=0,He=ot.length,at=0;atOt},F=Math.fround||(H=new Float32Array(1),Ot=>(H[0]=+Ot,H[0]));var H;let q=3,G=5,ee=6;class he{constructor(Xe){this.options=Object.assign(Object.create(W),Xe),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Xe){let{log:ot,minZoom:De,maxZoom:ye}=this.options;ot&&console.time("total time");let Pe=`prepare ${Xe.length} points`;ot&&console.time(Pe),this.points=Xe;let He=[];for(let ht=0;ht=De;ht--){let At=+Date.now();at=this.trees[ht]=this._createTree(this._cluster(at,ht)),ot&&console.log("z%d: %d clusters in %dms",ht,at.numItems,+Date.now()-At)}return ot&&console.timeEnd("total time"),this}getClusters(Xe,ot){let De=((Xe[0]+180)%360+360)%360-180,ye=Math.max(-90,Math.min(90,Xe[1])),Pe=Xe[2]===180?180:((Xe[2]+180)%360+360)%360-180,He=Math.max(-90,Math.min(90,Xe[3]));if(Xe[2]-Xe[0]>=360)De=-180,Pe=180;else if(De>Pe){let Yt=this.getClusters([De,ye,180,He],ot),hr=this.getClusters([-180,ye,Pe,He],ot);return Yt.concat(hr)}let at=this.trees[this._limitZoom(ot)],ht=at.range(ce(De),re(He),ce(Pe),re(ye)),At=at.data,Wt=[];for(let Yt of ht){let hr=this.stride*Yt;Wt.push(At[hr+G]>1?be(At,hr,this.clusterProps):this.points[At[hr+q]])}return Wt}getChildren(Xe){let ot=this._getOriginId(Xe),De=this._getOriginZoom(Xe),ye="No cluster with the specified id.",Pe=this.trees[De];if(!Pe)throw new Error(ye);let He=Pe.data;if(ot*this.stride>=He.length)throw new Error(ye);let at=this.options.radius/(this.options.extent*Math.pow(2,De-1)),ht=Pe.within(He[ot*this.stride],He[ot*this.stride+1],at),At=[];for(let Wt of ht){let Yt=Wt*this.stride;He[Yt+4]===Xe&&At.push(He[Yt+G]>1?be(He,Yt,this.clusterProps):this.points[He[Yt+q]])}if(At.length===0)throw new Error(ye);return At}getLeaves(Xe,ot,De){let ye=[];return this._appendLeaves(ye,Xe,ot=ot||10,De=De||0,0),ye}getTile(Xe,ot,De){let ye=this.trees[this._limitZoom(Xe)],Pe=Math.pow(2,Xe),{extent:He,radius:at}=this.options,ht=at/He,At=(De-ht)/Pe,Wt=(De+1+ht)/Pe,Yt={features:[]};return this._addTileFeatures(ye.range((ot-ht)/Pe,At,(ot+1+ht)/Pe,Wt),ye.data,ot,De,Pe,Yt),ot===0&&this._addTileFeatures(ye.range(1-ht/Pe,At,1,Wt),ye.data,Pe,De,Pe,Yt),ot===Pe-1&&this._addTileFeatures(ye.range(0,At,ht/Pe,Wt),ye.data,-1,De,Pe,Yt),Yt.features.length?Yt:null}getClusterExpansionZoom(Xe){let ot=this._getOriginZoom(Xe)-1;for(;ot<=this.options.maxZoom;){let De=this.getChildren(Xe);if(ot++,De.length!==1)break;Xe=De[0].properties.cluster_id}return ot}_appendLeaves(Xe,ot,De,ye,Pe){let He=this.getChildren(ot);for(let at of He){let ht=at.properties;if(ht&&ht.cluster?Pe+ht.point_count<=ye?Pe+=ht.point_count:Pe=this._appendLeaves(Xe,ht.cluster_id,De,ye,Pe):Pe1,Wt,Yt,hr;if(At)Wt=ve(ot,ht,this.clusterProps),Yt=ot[ht],hr=ot[ht+1];else{let br=this.points[ot[ht+q]];Wt=br.properties;let[fi,un]=br.geometry.coordinates;Yt=ce(fi),hr=re(un)}let zr={type:1,geometry:[[Math.round(this.options.extent*(Yt*Pe-De)),Math.round(this.options.extent*(hr*Pe-ye))]],tags:Wt},Dr;Dr=At||this.options.generateId?ot[ht+q]:this.points[ot[ht+q]].id,Dr!==void 0&&(zr.id=Dr),He.features.push(zr)}}_limitZoom(Xe){return Math.max(this.options.minZoom,Math.min(Math.floor(+Xe),this.options.maxZoom+1))}_cluster(Xe,ot){let{radius:De,extent:ye,reduce:Pe,minPoints:He}=this.options,at=De/(ye*Math.pow(2,ot)),ht=Xe.data,At=[],Wt=this.stride;for(let Yt=0;Ytot&&(fi+=ht[cn+G])}if(fi>br&&fi>=He){let un,cn=hr*br,yn=zr*br,Gn=-1,Sn=((Yt/Wt|0)<<5)+(ot+1)+this.points.length;for(let dn of Dr){let va=dn*Wt;if(ht[va+2]<=ot)continue;ht[va+2]=ot;let na=ht[va+G];cn+=ht[va]*na,yn+=ht[va+1]*na,ht[va+4]=Sn,Pe&&(un||(un=this._map(ht,Yt,!0),Gn=this.clusterProps.length,this.clusterProps.push(un)),Pe(un,this._map(ht,va)))}ht[Yt+4]=Sn,At.push(cn/fi,yn/fi,1/0,Sn,-1,fi),Pe&&At.push(Gn)}else{for(let un=0;un1)for(let un of Dr){let cn=un*Wt;if(!(ht[cn+2]<=ot)){ht[cn+2]=ot;for(let yn=0;yn>5}_getOriginZoom(Xe){return(Xe-this.points.length)%32}_map(Xe,ot,De){if(Xe[ot+G]>1){let He=this.clusterProps[Xe[ot+ee]];return De?Object.assign({},He):He}let ye=this.points[Xe[ot+q]].properties,Pe=this.options.map(ye);return De&&Pe===ye?Object.assign({},Pe):Pe}}function be(Ot,Xe,ot){return{type:"Feature",id:Ot[Xe+q],properties:ve(Ot,Xe,ot),geometry:{type:"Point",coordinates:[(De=Ot[Xe],360*(De-.5)),ge(Ot[Xe+1])]}};var De}function ve(Ot,Xe,ot){let De=Ot[Xe+G],ye=De>=1e4?`${Math.round(De/1e3)}k`:De>=1e3?Math.round(De/100)/10+"k":De,Pe=Ot[Xe+ee],He=Pe===-1?{}:Object.assign({},ot[Pe]);return Object.assign(He,{cluster:!0,cluster_id:Ot[Xe+q],point_count:De,point_count_abbreviated:ye})}function ce(Ot){return Ot/360+.5}function re(Ot){let Xe=Math.sin(Ot*Math.PI/180),ot=.5-.25*Math.log((1+Xe)/(1-Xe))/Math.PI;return ot<0?0:ot>1?1:ot}function ge(Ot){let Xe=(180-360*Ot)*Math.PI/180;return 360*Math.atan(Math.exp(Xe))/Math.PI-90}function ne(Ot,Xe,ot,De){let ye=De,Pe=Xe+(ot-Xe>>1),He,at=ot-Xe,ht=Ot[Xe],At=Ot[Xe+1],Wt=Ot[ot],Yt=Ot[ot+1];for(let hr=Xe+3;hrye)He=hr,ye=zr;else if(zr===ye){let Dr=Math.abs(hr-Pe);DrDe&&(He-Xe>3&&ne(Ot,Xe,He,De),Ot[He+2]=ye,ot-He>3&&ne(Ot,He,ot,De))}function se(Ot,Xe,ot,De,ye,Pe){let He=ye-ot,at=Pe-De;if(He!==0||at!==0){let ht=((Ot-ot)*He+(Xe-De)*at)/(He*He+at*at);ht>1?(ot=ye,De=Pe):ht>0&&(ot+=He*ht,De+=at*ht)}return He=Ot-ot,at=Xe-De,He*He+at*at}function _e(Ot,Xe,ot,De){let ye={id:Ot??null,type:Xe,geometry:ot,tags:De,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Xe==="Point"||Xe==="MultiPoint"||Xe==="LineString")oe(ye,ot);else if(Xe==="Polygon")oe(ye,ot[0]);else if(Xe==="MultiLineString")for(let Pe of ot)oe(ye,Pe);else if(Xe==="MultiPolygon")for(let Pe of ot)oe(ye,Pe[0]);return ye}function oe(Ot,Xe){for(let ot=0;ot0&&(He+=De?(ye*Wt-At*Pe)/2:Math.sqrt(Math.pow(At-ye,2)+Math.pow(Wt-Pe,2))),ye=At,Pe=Wt}let at=Xe.length-3;Xe[2]=1,ne(Xe,0,at,ot),Xe[at+2]=1,Xe.size=Math.abs(He),Xe.start=0,Xe.end=Xe.size}function Ce(Ot,Xe,ot,De){for(let ye=0;ye1?1:ot}function Ze(Ot,Xe,ot,De,ye,Pe,He,at){if(De/=Xe,Pe>=(ot/=Xe)&&He=De)return null;let ht=[];for(let At of Ot){let Wt=At.geometry,Yt=At.type,hr=ye===0?At.minX:At.minY,zr=ye===0?At.maxX:At.maxY;if(hr>=ot&&zr=De)continue;let Dr=[];if(Yt==="Point"||Yt==="MultiPoint")Ge(Wt,Dr,ot,De,ye);else if(Yt==="LineString")tt(Wt,Dr,ot,De,ye,!1,at.lineMetrics);else if(Yt==="MultiLineString")mt(Wt,Dr,ot,De,ye,!1);else if(Yt==="Polygon")mt(Wt,Dr,ot,De,ye,!0);else if(Yt==="MultiPolygon")for(let br of Wt){let fi=[];mt(br,fi,ot,De,ye,!0),fi.length&&Dr.push(fi)}if(Dr.length){if(at.lineMetrics&&Yt==="LineString"){for(let br of Dr)ht.push(_e(At.id,Yt,br,At.tags));continue}Yt!=="LineString"&&Yt!=="MultiLineString"||(Dr.length===1?(Yt="LineString",Dr=Dr[0]):Yt="MultiLineString"),Yt!=="Point"&&Yt!=="MultiPoint"||(Yt=Dr.length===3?"Point":"MultiPoint"),ht.push(_e(At.id,Yt,Dr,At.tags))}}return ht.length?ht:null}function Ge(Ot,Xe,ot,De,ye){for(let Pe=0;Pe=ot&&He<=De&&vt(Xe,Ot[Pe],Ot[Pe+1],Ot[Pe+2])}}function tt(Ot,Xe,ot,De,ye,Pe,He){let at=_t(Ot),ht=ye===0?ct:Ae,At,Wt,Yt=Ot.start;for(let fi=0;fiot&&(Wt=ht(at,un,cn,Gn,Sn,ot),He&&(at.start=Yt+At*Wt)):dn>De?va=ot&&(Wt=ht(at,un,cn,Gn,Sn,ot),na=!0),va>De&&dn<=De&&(Wt=ht(at,un,cn,Gn,Sn,De),na=!0),!Pe&&na&&(He&&(at.end=Yt+At*Wt),Xe.push(at),at=_t(Ot)),He&&(Yt+=At)}let hr=Ot.length-3,zr=Ot[hr],Dr=Ot[hr+1],br=ye===0?zr:Dr;br>=ot&&br<=De&&vt(at,zr,Dr,Ot[hr+2]),hr=at.length-3,Pe&&hr>=3&&(at[hr]!==at[0]||at[hr+1]!==at[1])&&vt(at,at[0],at[1],at[2]),at.length&&Xe.push(at)}function _t(Ot){let Xe=[];return Xe.size=Ot.size,Xe.start=Ot.start,Xe.end=Ot.end,Xe}function mt(Ot,Xe,ot,De,ye,Pe){for(let He of Ot)tt(He,Xe,ot,De,ye,Pe,!1)}function vt(Ot,Xe,ot,De){Ot.push(Xe,ot,De)}function ct(Ot,Xe,ot,De,ye,Pe){let He=(Pe-Xe)/(De-Xe);return vt(Ot,Pe,ot+(ye-ot)*He,1),He}function Ae(Ot,Xe,ot,De,ye,Pe){let He=(Pe-ot)/(ye-ot);return vt(Ot,Xe+(De-Xe)*He,Pe,1),He}function Oe(Ot,Xe){let ot=[];for(let De=0;De0&&Xe.size<(ye?He:De))return void(ot.numPoints+=Xe.length/3);let at=[];for(let ht=0;htHe)&&(ot.numSimplified++,at.push(Xe[ht],Xe[ht+1])),ot.numPoints++;ye&&function(ht,At){let Wt=0;for(let Yt=0,hr=ht.length,zr=hr-2;Yt0===At)for(let Yt=0,hr=ht.length;Yt
24)throw new Error("maxZoom should be in the 0-24 range");if(ot.promoteId&&ot.generateId)throw new Error("promoteId and generateId cannot be used together.");let ye=function(Pe,He){let at=[];if(Pe.type==="FeatureCollection")for(let ht=0;ht1&&console.time("creation"),zr=this.tiles[hr]=ut(Xe,ot,De,ye,At),this.tileCoords.push({z:ot,x:De,y:ye}),Wt)){Wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ot,De,ye,zr.numFeatures,zr.numPoints,zr.numSimplified),console.timeEnd("creation"));let na=`z${ot}`;this.stats[na]=(this.stats[na]||0)+1,this.total++}if(zr.source=Xe,Pe==null){if(ot===At.indexMaxZoom||zr.numPoints<=At.indexMaxPoints)continue}else{if(ot===At.maxZoom||ot===Pe)continue;if(Pe!=null){let na=Pe-ot;if(De!==He>>na||ye!==at>>na)continue}}if(zr.source=null,Xe.length===0)continue;Wt>1&&console.time("clipping");let Dr=.5*At.buffer/At.extent,br=.5-Dr,fi=.5+Dr,un=1+Dr,cn=null,yn=null,Gn=null,Sn=null,dn=Ze(Xe,Yt,De-Dr,De+fi,0,zr.minX,zr.maxX,At),va=Ze(Xe,Yt,De+br,De+un,0,zr.minX,zr.maxX,At);Xe=null,dn&&(cn=Ze(dn,Yt,ye-Dr,ye+fi,1,zr.minY,zr.maxY,At),yn=Ze(dn,Yt,ye+br,ye+un,1,zr.minY,zr.maxY,At),dn=null),va&&(Gn=Ze(va,Yt,ye-Dr,ye+fi,1,zr.minY,zr.maxY,At),Sn=Ze(va,Yt,ye+br,ye+un,1,zr.minY,zr.maxY,At),va=null),Wt>1&&console.timeEnd("clipping"),ht.push(cn||[],ot+1,2*De,2*ye),ht.push(yn||[],ot+1,2*De,2*ye+1),ht.push(Gn||[],ot+1,2*De+1,2*ye),ht.push(Sn||[],ot+1,2*De+1,2*ye+1)}}getTile(Xe,ot,De){Xe=+Xe,ot=+ot,De=+De;let ye=this.options,{extent:Pe,debug:He}=ye;if(Xe<0||Xe>24)return null;let at=1<1&&console.log("drilling down to z%d-%d-%d",Xe,ot,De);let At,Wt=Xe,Yt=ot,hr=De;for(;!At&&Wt>0;)Wt--,Yt>>=1,hr>>=1,At=this.tiles[mr(Wt,Yt,hr)];return At&&At.source?(He>1&&(console.log("found parent tile z%d-%d-%d",Wt,Yt,hr),console.time("drilling down")),this.splitTile(At.source,Wt,Yt,hr,Xe,ot,De),He>1&&console.timeEnd("drilling down"),this.tiles[ht]?nt(this.tiles[ht],Pe):null):null}}function mr(Ot,Xe,ot){return 32*((1<{Yt.properties=zr;let Dr={};for(let br of hr)Dr[br]=ht[br].evaluate(Wt,Yt);return Dr},He.reduce=(zr,Dr)=>{Yt.properties=Dr;for(let br of hr)Wt.accumulated=zr[br],zr[br]=At[br].evaluate(Wt,Yt)},He}(Xe)).load((yield this._pendingData).features):(ye=yield this._pendingData,new vr(ye,Xe.geojsonVtOptions)),this.loaded={};let Pe={};if(De){let He=De.finish();He&&(Pe.resourceTiming={},Pe.resourceTiming[Xe.source]=JSON.parse(JSON.stringify(He)))}return Pe}catch(Pe){if(delete this._pendingRequest,i.bB(Pe))return{abandoned:!0};throw Pe}var ye})}getData(){return i._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Xe){let ot=this.loaded;return ot&&ot[Xe.uid]?super.reloadTile(Xe):this.loadTile(Xe)}loadAndProcessGeoJSON(Xe,ot){return i._(this,void 0,void 0,function*(){let De=yield this.loadGeoJSON(Xe,ot);if(delete this._pendingRequest,typeof De!="object")throw new Error(`Input data given to '${Xe.source}' is not a valid GeoJSON object.`);if(b(De,!0),Xe.filter){let ye=i.bC(Xe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ye.result==="error")throw new Error(ye.value.map(Pe=>`${Pe.key}: ${Pe.message}`).join(", "));De={type:"FeatureCollection",features:De.features.filter(Pe=>ye.value.evaluate({zoom:0},Pe))}}return De})}loadGeoJSON(Xe,ot){return i._(this,void 0,void 0,function*(){let{promoteId:De}=Xe;if(Xe.request){let ye=yield i.h(Xe.request,ot);return this._dataUpdateable=ii(ye.data,De)?Lr(ye.data,De):void 0,ye.data}if(typeof Xe.data=="string")try{let ye=JSON.parse(Xe.data);return this._dataUpdateable=ii(ye,De)?Lr(ye,De):void 0,ye}catch{throw new Error(`Input data given to '${Xe.source}' is not a valid GeoJSON object.`)}if(!Xe.dataDiff)throw new Error(`Input data given to '${Xe.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Xe.source}`);return function(ye,Pe,He){var at,ht,At,Wt;if(Pe.removeAll&&ye.clear(),Pe.remove)for(let Yt of Pe.remove)ye.delete(Yt);if(Pe.add)for(let Yt of Pe.add){let hr=Yr(Yt,He);hr!=null&&ye.set(hr,Yt)}if(Pe.update)for(let Yt of Pe.update){let hr=ye.get(Yt.id);if(hr==null)continue;let zr=!Yt.removeAllProperties&&(((at=Yt.removeProperties)===null||at===void 0?void 0:at.length)>0||((ht=Yt.addOrUpdateProperties)===null||ht===void 0?void 0:ht.length)>0);if((Yt.newGeometry||Yt.removeAllProperties||zr)&&(hr=Object.assign({},hr),ye.set(Yt.id,hr),zr&&(hr.properties=Object.assign({},hr.properties))),Yt.newGeometry&&(hr.geometry=Yt.newGeometry),Yt.removeAllProperties)hr.properties={};else if(((At=Yt.removeProperties)===null||At===void 0?void 0:At.length)>0)for(let Dr of Yt.removeProperties)Object.prototype.hasOwnProperty.call(hr.properties,Dr)&&delete hr.properties[Dr];if(((Wt=Yt.addOrUpdateProperties)===null||Wt===void 0?void 0:Wt.length)>0)for(let{key:Dr,value:br}of Yt.addOrUpdateProperties)hr.properties[Dr]=br}}(this._dataUpdateable,Xe.dataDiff,De),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Xe){return i._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Xe){return this._geoJSONIndex.getClusterExpansionZoom(Xe.clusterId)}getClusterChildren(Xe){return this._geoJSONIndex.getChildren(Xe.clusterId)}getClusterLeaves(Xe){return this._geoJSONIndex.getLeaves(Xe.clusterId,Xe.limit,Xe.offset)}}class vi{constructor(Xe){this.self=Xe,this.actor=new i.F(Xe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ot,De)=>{if(this.externalWorkerSourceTypes[ot])throw new Error(`Worker source with name "${ot}" already registered.`);this.externalWorkerSourceTypes[ot]=De},this.self.addProtocol=i.bi,this.self.removeProtocol=i.bj,this.self.registerRTLTextPlugin=ot=>{if(i.bD.isParsed())throw new Error("RTL text plugin already registered.");i.bD.setMethods(ot)},this.actor.registerMessageHandler("LDT",(ot,De)=>this._getDEMWorkerSource(ot,De.source).loadTile(De)),this.actor.registerMessageHandler("RDT",(ot,De)=>i._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ot,De.source).removeTile(De)})),this.actor.registerMessageHandler("GCEZ",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterExpansionZoom(De)})),this.actor.registerMessageHandler("GCC",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterChildren(De)})),this.actor.registerMessageHandler("GCL",(ot,De)=>i._(this,void 0,void 0,function*(){return this._getWorkerSource(ot,De.type,De.source).getClusterLeaves(De)})),this.actor.registerMessageHandler("LD",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).loadData(De)),this.actor.registerMessageHandler("GD",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).getData()),this.actor.registerMessageHandler("LT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).loadTile(De)),this.actor.registerMessageHandler("RT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).reloadTile(De)),this.actor.registerMessageHandler("AT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).abortTile(De)),this.actor.registerMessageHandler("RMT",(ot,De)=>this._getWorkerSource(ot,De.type,De.source).removeTile(De)),this.actor.registerMessageHandler("RS",(ot,De)=>i._(this,void 0,void 0,function*(){if(!this.workerSources[ot]||!this.workerSources[ot][De.type]||!this.workerSources[ot][De.type][De.source])return;let ye=this.workerSources[ot][De.type][De.source];delete this.workerSources[ot][De.type][De.source],ye.removeSource!==void 0&&ye.removeSource(De)})),this.actor.registerMessageHandler("RM",ot=>i._(this,void 0,void 0,function*(){delete this.layerIndexes[ot],delete this.availableImages[ot],delete this.workerSources[ot],delete this.demWorkerSources[ot]})),this.actor.registerMessageHandler("SR",(ot,De)=>i._(this,void 0,void 0,function*(){this.referrer=De})),this.actor.registerMessageHandler("SRPS",(ot,De)=>this._syncRTLPluginState(ot,De)),this.actor.registerMessageHandler("IS",(ot,De)=>i._(this,void 0,void 0,function*(){this.self.importScripts(De)})),this.actor.registerMessageHandler("SI",(ot,De)=>this._setImages(ot,De)),this.actor.registerMessageHandler("UL",(ot,De)=>i._(this,void 0,void 0,function*(){this._getLayerIndex(ot).update(De.layers,De.removedIds)})),this.actor.registerMessageHandler("SL",(ot,De)=>i._(this,void 0,void 0,function*(){this._getLayerIndex(ot).replace(De)}))}_setImages(Xe,ot){return i._(this,void 0,void 0,function*(){this.availableImages[Xe]=ot;for(let De in this.workerSources[Xe]){let ye=this.workerSources[Xe][De];for(let Pe in ye)ye[Pe].availableImages=ot}})}_syncRTLPluginState(Xe,ot){return i._(this,void 0,void 0,function*(){if(i.bD.isParsed())return i.bD.getState();if(ot.pluginStatus!=="loading")return i.bD.setState(ot),ot;let De=ot.pluginURL;if(this.self.importScripts(De),i.bD.isParsed()){let ye={pluginStatus:"loaded",pluginURL:De};return i.bD.setState(ye),ye}throw i.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${De}`)})}_getAvailableImages(Xe){let ot=this.availableImages[Xe];return ot||(ot=[]),ot}_getLayerIndex(Xe){let ot=this.layerIndexes[Xe];return ot||(ot=this.layerIndexes[Xe]=new n),ot}_getWorkerSource(Xe,ot,De){if(this.workerSources[Xe]||(this.workerSources[Xe]={}),this.workerSources[Xe][ot]||(this.workerSources[Xe][ot]={}),!this.workerSources[Xe][ot][De]){let ye={sendAsync:(Pe,He)=>(Pe.targetMapId=Xe,this.actor.sendAsync(Pe,He))};switch(ot){case"vector":this.workerSources[Xe][ot][De]=new u(ye,this._getLayerIndex(Xe),this._getAvailableImages(Xe));break;case"geojson":this.workerSources[Xe][ot][De]=new ci(ye,this._getLayerIndex(Xe),this._getAvailableImages(Xe));break;default:this.workerSources[Xe][ot][De]=new this.externalWorkerSourceTypes[ot](ye,this._getLayerIndex(Xe),this._getAvailableImages(Xe))}}return this.workerSources[Xe][ot][De]}_getDEMWorkerSource(Xe,ot){return this.demWorkerSources[Xe]||(this.demWorkerSources[Xe]={}),this.demWorkerSources[Xe][ot]||(this.demWorkerSources[Xe][ot]=new s),this.demWorkerSources[Xe][ot]}}return i.i(self)&&(self.worker=new vi(self)),vi}),z("index",["exports","./shared"],function(i,n){var a="4.7.1";let l,o,u={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:Ke=>new Promise((O,pe)=>{let Ie=requestAnimationFrame(O);Ke.signal.addEventListener("abort",()=>{cancelAnimationFrame(Ie),pe(n.c())})}),getImageData(Ke,O=0){return this.getImageCanvasContext(Ke).getImageData(-O,-O,Ke.width+2*O,Ke.height+2*O)},getImageCanvasContext(Ke){let O=window.document.createElement("canvas"),pe=O.getContext("2d",{willReadFrequently:!0});if(!pe)throw new Error("failed to create canvas 2d context");return O.width=Ke.width,O.height=Ke.height,pe.drawImage(Ke,0,0,Ke.width,Ke.height),pe},resolveURL:Ke=>(l||(l=document.createElement("a")),l.href=Ke,l.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(o==null&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)}};class s{static testProp(O){if(!s.docStyle)return O[0];for(let pe=0;pe{window.removeEventListener("click",s.suppressClickInternal,!0)},0)}static getScale(O){let pe=O.getBoundingClientRect();return{x:pe.width/O.offsetWidth||1,y:pe.height/O.offsetHeight||1,boundingClientRect:pe}}static getPoint(O,pe,Ie){let Fe=pe.boundingClientRect;return new n.P((Ie.clientX-Fe.left)/pe.x-O.clientLeft,(Ie.clientY-Fe.top)/pe.y-O.clientTop)}static mousePos(O,pe){let Ie=s.getScale(O);return s.getPoint(O,Ie,pe)}static touchPos(O,pe){let Ie=[],Fe=s.getScale(O);for(let qe=0;qe{m&&A(m),m=null,_=!0},b.onerror=()=>{x=!0,m=null},b.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Ke){let O,pe,Ie,Fe;Ke.resetRequestQueue=()=>{O=[],pe=0,Ie=0,Fe={}},Ke.addThrottleControl=tr=>{let kr=Ie++;return Fe[kr]=tr,kr},Ke.removeThrottleControl=tr=>{delete Fe[tr],Mt()},Ke.getImage=(tr,kr,Vr=!0)=>new Promise((Wr,Ti)=>{h.supported&&(tr.headers||(tr.headers={}),tr.headers.accept="image/webp,*/*"),n.e(tr,{type:"image"}),O.push({abortController:kr,requestParameters:tr,supportImageRefresh:Vr,state:"queued",onError:Vi=>{Ti(Vi)},onSuccess:Vi=>{Wr(Vi)}}),Mt()});let qe=tr=>n._(this,void 0,void 0,function*(){tr.state="running";let{requestParameters:kr,supportImageRefresh:Vr,onError:Wr,onSuccess:Ti,abortController:Vi}=tr,et=Vr===!1&&!n.i(self)&&!n.g(kr.url)&&(!kr.headers||Object.keys(kr.headers).reduce((Lt,Vt)=>Lt&&Vt==="accept",!0));pe++;let lt=et?jt(kr,Vi):n.m(kr,Vi);try{let Lt=yield lt;delete tr.abortController,tr.state="completed",Lt.data instanceof HTMLImageElement||n.b(Lt.data)?Ti(Lt):Lt.data&&Ti({data:yield(Tt=Lt.data,typeof createImageBitmap=="function"?n.d(Tt):n.f(Tt)),cacheControl:Lt.cacheControl,expires:Lt.expires})}catch(Lt){delete tr.abortController,Wr(Lt)}finally{pe--,Mt()}var Tt}),Mt=()=>{let tr=(()=>{for(let kr of Object.keys(Fe))if(Fe[kr]())return!0;return!1})()?n.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:n.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let kr=pe;kr0;kr++){let Vr=O.shift();Vr.abortController.signal.aborted?kr--:qe(Vr)}},jt=(tr,kr)=>new Promise((Vr,Wr)=>{let Ti=new Image,Vi=tr.url,et=tr.credentials;et&&et==="include"?Ti.crossOrigin="use-credentials":(et&&et==="same-origin"||!n.s(Vi))&&(Ti.crossOrigin="anonymous"),kr.signal.addEventListener("abort",()=>{Ti.src="",Wr(n.c())}),Ti.fetchPriority="high",Ti.onload=()=>{Ti.onerror=Ti.onload=null,Vr({data:Ti})},Ti.onerror=()=>{Ti.onerror=Ti.onload=null,kr.signal.aborted||Wr(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},Ti.src=Vi})}(f||(f={})),f.resetRequestQueue();class k{constructor(O){this._transformRequestFn=O}transformRequest(O,pe){return this._transformRequestFn&&this._transformRequestFn(O,pe)||{url:O}}setTransformRequest(O){this._transformRequestFn=O}}function w(Ke){var O=new n.A(3);return O[0]=Ke[0],O[1]=Ke[1],O[2]=Ke[2],O}var D,E=function(Ke,O,pe){return Ke[0]=O[0]-pe[0],Ke[1]=O[1]-pe[1],Ke[2]=O[2]-pe[2],Ke};D=new n.A(3),n.A!=Float32Array&&(D[0]=0,D[1]=0,D[2]=0);var I=function(Ke){var O=Ke[0],pe=Ke[1];return O*O+pe*pe};function M(Ke){let O=[];if(typeof Ke=="string")O.push({id:"default",url:Ke});else if(Ke&&Ke.length>0){let pe=[];for(let{id:Ie,url:Fe}of Ke){let qe=`${Ie}${Fe}`;pe.indexOf(qe)===-1&&(pe.push(qe),O.push({id:Ie,url:Fe}))}}return O}function p(Ke,O,pe){let Ie=Ke.split("?");return Ie[0]+=`${O}${pe}`,Ie.join("?")}(function(){var Ke=new n.A(2);n.A!=Float32Array&&(Ke[0]=0,Ke[1]=0)})();class g{constructor(O,pe,Ie,Fe){this.context=O,this.format=Ie,this.texture=O.gl.createTexture(),this.update(pe,Fe)}update(O,pe,Ie){let{width:Fe,height:qe}=O,Mt=!(this.size&&this.size[0]===Fe&&this.size[1]===qe||Ie),{context:jt}=this,{gl:tr}=jt;if(this.useMipmap=!!(pe&&pe.useMipmap),tr.bindTexture(tr.TEXTURE_2D,this.texture),jt.pixelStoreUnpackFlipY.set(!1),jt.pixelStoreUnpack.set(1),jt.pixelStoreUnpackPremultiplyAlpha.set(this.format===tr.RGBA&&(!pe||pe.premultiply!==!1)),Mt)this.size=[Fe,qe],O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||n.b(O)?tr.texImage2D(tr.TEXTURE_2D,0,this.format,this.format,tr.UNSIGNED_BYTE,O):tr.texImage2D(tr.TEXTURE_2D,0,this.format,Fe,qe,0,this.format,tr.UNSIGNED_BYTE,O.data);else{let{x:kr,y:Vr}=Ie||{x:0,y:0};O instanceof HTMLImageElement||O instanceof HTMLCanvasElement||O instanceof HTMLVideoElement||O instanceof ImageData||n.b(O)?tr.texSubImage2D(tr.TEXTURE_2D,0,kr,Vr,tr.RGBA,tr.UNSIGNED_BYTE,O):tr.texSubImage2D(tr.TEXTURE_2D,0,kr,Vr,Fe,qe,tr.RGBA,tr.UNSIGNED_BYTE,O.data)}this.useMipmap&&this.isSizePowerOfTwo()&&tr.generateMipmap(tr.TEXTURE_2D)}bind(O,pe,Ie){let{context:Fe}=this,{gl:qe}=Fe;qe.bindTexture(qe.TEXTURE_2D,this.texture),Ie!==qe.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Ie=qe.LINEAR),O!==this.filter&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,O),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,Ie||O),this.filter=O),pe!==this.wrap&&(qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,pe),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,pe),this.wrap=pe)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:O}=this.context;O.deleteTexture(this.texture),this.texture=null}}function C(Ke){let{userImage:O}=Ke;return!!(O&&O.render&&O.render())&&(Ke.data.replace(new Uint8Array(O.data.buffer)),!0)}class T extends n.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new n.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(O){if(this.loaded!==O&&(this.loaded=O,O)){for(let{ids:pe,promiseResolve:Ie}of this.requestors)Ie(this._getImagesForIds(pe));this.requestors=[]}}getImage(O){let pe=this.images[O];if(pe&&!pe.data&&pe.spriteData){let Ie=pe.spriteData;pe.data=new n.R({width:Ie.width,height:Ie.height},Ie.context.getImageData(Ie.x,Ie.y,Ie.width,Ie.height).data),pe.spriteData=null}return pe}addImage(O,pe){if(this.images[O])throw new Error(`Image id ${O} already exist, use updateImage instead`);this._validate(O,pe)&&(this.images[O]=pe)}_validate(O,pe){let Ie=!0,Fe=pe.data||pe.spriteData;return this._validateStretch(pe.stretchX,Fe&&Fe.width)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "stretchX" value`))),Ie=!1),this._validateStretch(pe.stretchY,Fe&&Fe.height)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "stretchY" value`))),Ie=!1),this._validateContent(pe.content,pe)||(this.fire(new n.j(new Error(`Image "${O}" has invalid "content" value`))),Ie=!1),Ie}_validateStretch(O,pe){if(!O)return!0;let Ie=0;for(let Fe of O){if(Fe[0]{let Fe=!0;if(!this.isLoaded())for(let qe of O)this.images[qe]||(Fe=!1);this.isLoaded()||Fe?pe(this._getImagesForIds(O)):this.requestors.push({ids:O,promiseResolve:pe})})}_getImagesForIds(O){let pe={};for(let Ie of O){let Fe=this.getImage(Ie);Fe||(this.fire(new n.k("styleimagemissing",{id:Ie})),Fe=this.getImage(Ie)),Fe?pe[Ie]={data:Fe.data.clone(),pixelRatio:Fe.pixelRatio,sdf:Fe.sdf,version:Fe.version,stretchX:Fe.stretchX,stretchY:Fe.stretchY,content:Fe.content,textFitWidth:Fe.textFitWidth,textFitHeight:Fe.textFitHeight,hasRenderCallback:!!(Fe.userImage&&Fe.userImage.render)}:n.w(`Image "${Ie}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return pe}getPixelSize(){let{width:O,height:pe}=this.atlasImage;return{width:O,height:pe}}getPattern(O){let pe=this.patterns[O],Ie=this.getImage(O);if(!Ie)return null;if(pe&&pe.position.version===Ie.version)return pe.position;if(pe)pe.position.version=Ie.version;else{let Fe={w:Ie.data.width+2,h:Ie.data.height+2,x:0,y:0},qe=new n.I(Fe,Ie);this.patterns[O]={bin:Fe,position:qe}}return this._updatePatternAtlas(),this.patterns[O].position}bind(O){let pe=O.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new g(O,this.atlasImage,pe.RGBA),this.atlasTexture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE)}_updatePatternAtlas(){let O=[];for(let qe in this.patterns)O.push(this.patterns[qe].bin);let{w:pe,h:Ie}=n.p(O),Fe=this.atlasImage;Fe.resize({width:pe||1,height:Ie||1});for(let qe in this.patterns){let{bin:Mt}=this.patterns[qe],jt=Mt.x+1,tr=Mt.y+1,kr=this.getImage(qe).data,Vr=kr.width,Wr=kr.height;n.R.copy(kr,Fe,{x:0,y:0},{x:jt,y:tr},{width:Vr,height:Wr}),n.R.copy(kr,Fe,{x:0,y:Wr-1},{x:jt,y:tr-1},{width:Vr,height:1}),n.R.copy(kr,Fe,{x:0,y:0},{x:jt,y:tr+Wr},{width:Vr,height:1}),n.R.copy(kr,Fe,{x:Vr-1,y:0},{x:jt-1,y:tr},{width:1,height:Wr}),n.R.copy(kr,Fe,{x:0,y:0},{x:jt+Vr,y:tr},{width:1,height:Wr})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(O){for(let pe of O){if(this.callbackDispatchedThisFrame[pe])continue;this.callbackDispatchedThisFrame[pe]=!0;let Ie=this.getImage(pe);Ie||n.w(`Image with ID: "${pe}" was not found`),C(Ie)&&this.updateImage(pe,Ie)}}}let N=1e20;function B(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr){for(let kr=O;kr-1);tr++,qe[tr]=jt,Mt[tr]=kr,Mt[tr+1]=N}for(let jt=0,tr=0;jt65535)throw new Error("glyphs > 65535 not supported");if(Ie.ranges[qe])return{stack:O,id:pe,glyph:Fe};if(!this.url)throw new Error("glyphsUrl is not set");if(!Ie.requests[qe]){let jt=V.loadGlyphRange(O,qe,this.url,this.requestManager);Ie.requests[qe]=jt}let Mt=yield Ie.requests[qe];for(let jt in Mt)this._doesCharSupportLocalGlyph(+jt)||(Ie.glyphs[+jt]=Mt[+jt]);return Ie.ranges[qe]=!0,{stack:O,id:pe,glyph:Mt[pe]||null}})}_doesCharSupportLocalGlyph(O){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(O))}_tinySDF(O,pe,Ie){let Fe=this.localIdeographFontFamily;if(!Fe||!this._doesCharSupportLocalGlyph(Ie))return;let qe=O.tinySDF;if(!qe){let jt="400";/bold/i.test(pe)?jt="900":/medium/i.test(pe)?jt="500":/light/i.test(pe)&&(jt="200"),qe=O.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Fe,fontWeight:jt})}let Mt=qe.draw(String.fromCharCode(Ie));return{id:Ie,bitmap:new n.o({width:Mt.width||60,height:Mt.height||60},Mt.data),metrics:{width:Mt.glyphWidth/2||24,height:Mt.glyphHeight/2||24,left:Mt.glyphLeft/2+.5||0,top:Mt.glyphTop/2-27.5||-8,advance:Mt.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(Ke,O,pe,Ie){return n._(this,void 0,void 0,function*(){let Fe=256*O,qe=Fe+255,Mt=Ie.transformRequest(pe.replace("{fontstack}",Ke).replace("{range}",`${Fe}-${qe}`),"Glyphs"),jt=yield n.l(Mt,new AbortController);if(!jt||!jt.data)throw new Error(`Could not load glyph range. range: ${O}, ${Fe}-${qe}`);let tr={};for(let kr of n.n(jt.data))tr[kr.id]=kr;return tr})},V.TinySDF=class{constructor({fontSize:Ke=24,buffer:O=3,radius:pe=8,cutoff:Ie=.25,fontFamily:Fe="sans-serif",fontWeight:qe="normal",fontStyle:Mt="normal"}={}){this.buffer=O,this.cutoff=Ie,this.radius=pe;let jt=this.size=Ke+4*O,tr=this._createCanvas(jt),kr=this.ctx=tr.getContext("2d",{willReadFrequently:!0});kr.font=`${Mt} ${qe} ${Ke}px ${Fe}`,kr.textBaseline="alphabetic",kr.textAlign="left",kr.fillStyle="black",this.gridOuter=new Float64Array(jt*jt),this.gridInner=new Float64Array(jt*jt),this.f=new Float64Array(jt),this.z=new Float64Array(jt+1),this.v=new Uint16Array(jt)}_createCanvas(Ke){let O=document.createElement("canvas");return O.width=O.height=Ke,O}draw(Ke){let{width:O,actualBoundingBoxAscent:pe,actualBoundingBoxDescent:Ie,actualBoundingBoxLeft:Fe,actualBoundingBoxRight:qe}=this.ctx.measureText(Ke),Mt=Math.ceil(pe),jt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(qe-Fe))),tr=Math.min(this.size-this.buffer,Mt+Math.ceil(Ie)),kr=jt+2*this.buffer,Vr=tr+2*this.buffer,Wr=Math.max(kr*Vr,0),Ti=new Uint8ClampedArray(Wr),Vi={data:Ti,width:kr,height:Vr,glyphWidth:jt,glyphHeight:tr,glyphTop:Mt,glyphLeft:0,glyphAdvance:O};if(jt===0||tr===0)return Vi;let{ctx:et,buffer:lt,gridInner:Tt,gridOuter:Lt}=this;et.clearRect(lt,lt,jt,tr),et.fillText(Ke,lt,lt+Mt);let Vt=et.getImageData(lt,lt,jt,tr);Lt.fill(N,0,Wr),Tt.fill(0,0,Wr);for(let Nt=0;Nt0?Zr*Zr:0,Tt[Hr]=Zr<0?Zr*Zr:0}}B(Lt,0,0,kr,Vr,kr,this.f,this.v,this.z),B(Tt,lt,lt,jt,tr,kr,this.f,this.v,this.z);for(let Nt=0;Nt1&&(tr=O[++jt]);let Vr=Math.abs(kr-tr.left),Wr=Math.abs(kr-tr.right),Ti=Math.min(Vr,Wr),Vi,et=qe/Ie*(Fe+1);if(tr.isDash){let lt=Fe-Math.abs(et);Vi=Math.sqrt(Ti*Ti+lt*lt)}else Vi=Fe-Math.sqrt(Ti*Ti+et*et);this.data[Mt+kr]=Math.max(0,Math.min(255,Vi+128))}}}addRegularDash(O){for(let jt=O.length-1;jt>=0;--jt){let tr=O[jt],kr=O[jt+1];tr.zeroLength?O.splice(jt,1):kr&&kr.isDash===tr.isDash&&(kr.left=tr.left,O.splice(jt,1))}let pe=O[0],Ie=O[O.length-1];pe.isDash===Ie.isDash&&(pe.left=Ie.left-this.width,Ie.right=pe.right+this.width);let Fe=this.width*this.nextRow,qe=0,Mt=O[qe];for(let jt=0;jt1&&(Mt=O[++qe]);let tr=Math.abs(jt-Mt.left),kr=Math.abs(jt-Mt.right),Vr=Math.min(tr,kr);this.data[Fe+jt]=Math.max(0,Math.min(255,(Mt.isDash?Vr:-Vr)+128))}}addDash(O,pe){let Ie=pe?7:0,Fe=2*Ie+1;if(this.nextRow+Fe>this.height)return n.w("LineAtlas out of space"),null;let qe=0;for(let jt=0;jt{pe.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[he]}numActive(){return Object.keys(this.active).length}}let ve=Math.floor(u.hardwareConcurrency/2),ce,re;function ge(){return ce||(ce=new be),ce}be.workerCount=n.C(globalThis)?Math.max(Math.min(ve,3),1):1;class ne{constructor(O,pe){this.workerPool=O,this.actors=[],this.currentActor=0,this.id=pe;let Ie=this.workerPool.acquire(pe);for(let Fe=0;Fe{pe.remove()}),this.actors=[],O&&this.workerPool.release(this.id)}registerMessageHandler(O,pe){for(let Ie of this.actors)Ie.registerMessageHandler(O,pe)}}function se(){return re||(re=new ne(ge(),n.G),re.registerMessageHandler("GR",(Ke,O,pe)=>n.m(O,pe))),re}function _e(Ke,O){let pe=n.H();return n.J(pe,pe,[1,1,0]),n.K(pe,pe,[.5*Ke.width,.5*Ke.height,1]),n.L(pe,pe,Ke.calculatePosMatrix(O.toUnwrapped()))}function oe(Ke,O,pe,Ie,Fe,qe){let Mt=function(Wr,Ti,Vi){if(Wr)for(let et of Wr){let lt=Ti[et];if(lt&<.source===Vi&<.type==="fill-extrusion")return!0}else for(let et in Ti){let lt=Ti[et];if(lt.source===Vi&<.type==="fill-extrusion")return!0}return!1}(Fe&&Fe.layers,O,Ke.id),jt=qe.maxPitchScaleFactor(),tr=Ke.tilesIn(Ie,jt,Mt);tr.sort(J);let kr=[];for(let Wr of tr)kr.push({wrappedTileID:Wr.tileID.wrapped().key,queryResults:Wr.tile.queryRenderedFeatures(O,pe,Ke._state,Wr.queryGeometry,Wr.cameraQueryGeometry,Wr.scale,Fe,qe,jt,_e(Ke.transform,Wr.tileID))});let Vr=function(Wr){let Ti={},Vi={};for(let et of Wr){let lt=et.queryResults,Tt=et.wrappedTileID,Lt=Vi[Tt]=Vi[Tt]||{};for(let Vt in lt){let Nt=lt[Vt],Xt=Lt[Vt]=Lt[Vt]||{},Pr=Ti[Vt]=Ti[Vt]||[];for(let Hr of Nt)Xt[Hr.featureIndex]||(Xt[Hr.featureIndex]=!0,Pr.push(Hr))}}return Ti}(kr);for(let Wr in Vr)Vr[Wr].forEach(Ti=>{let Vi=Ti.feature,et=Ke.getFeatureState(Vi.layer["source-layer"],Vi.id);Vi.source=Vi.layer.source,Vi.layer["source-layer"]&&(Vi.sourceLayer=Vi.layer["source-layer"]),Vi.state=et});return Vr}function J(Ke,O){let pe=Ke.tileID,Ie=O.tileID;return pe.overscaledZ-Ie.overscaledZ||pe.canonical.y-Ie.canonical.y||pe.wrap-Ie.wrap||pe.canonical.x-Ie.canonical.x}function me(Ke,O,pe){return n._(this,void 0,void 0,function*(){let Ie=Ke;if(Ke.url?Ie=(yield n.h(O.transformRequest(Ke.url,"Source"),pe)).data:yield u.frameAsync(pe),!Ie)return null;let Fe=n.M(n.e(Ie,Ke),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Ie&&Ie.vector_layers&&(Fe.vectorLayerIds=Ie.vector_layers.map(qe=>qe.id)),Fe})}class fe{constructor(O,pe){O&&(pe?this.setSouthWest(O).setNorthEast(pe):Array.isArray(O)&&(O.length===4?this.setSouthWest([O[0],O[1]]).setNorthEast([O[2],O[3]]):this.setSouthWest(O[0]).setNorthEast(O[1])))}setNorthEast(O){return this._ne=O instanceof n.N?new n.N(O.lng,O.lat):n.N.convert(O),this}setSouthWest(O){return this._sw=O instanceof n.N?new n.N(O.lng,O.lat):n.N.convert(O),this}extend(O){let pe=this._sw,Ie=this._ne,Fe,qe;if(O instanceof n.N)Fe=O,qe=O;else{if(!(O instanceof fe))return Array.isArray(O)?O.length===4||O.every(Array.isArray)?this.extend(fe.convert(O)):this.extend(n.N.convert(O)):O&&("lng"in O||"lon"in O)&&"lat"in O?this.extend(n.N.convert(O)):this;if(Fe=O._sw,qe=O._ne,!Fe||!qe)return this}return pe||Ie?(pe.lng=Math.min(Fe.lng,pe.lng),pe.lat=Math.min(Fe.lat,pe.lat),Ie.lng=Math.max(qe.lng,Ie.lng),Ie.lat=Math.max(qe.lat,Ie.lat)):(this._sw=new n.N(Fe.lng,Fe.lat),this._ne=new n.N(qe.lng,qe.lat)),this}getCenter(){return new n.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new n.N(this.getWest(),this.getNorth())}getSouthEast(){return new n.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(O){let{lng:pe,lat:Ie}=n.N.convert(O),Fe=this._sw.lng<=pe&&pe<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Fe=this._sw.lng>=pe&&pe>=this._ne.lng),this._sw.lat<=Ie&&Ie<=this._ne.lat&&Fe}static convert(O){return O instanceof fe?O:O&&new fe(O)}static fromLngLat(O,pe=0){let Ie=360*pe/40075017,Fe=Ie/Math.cos(Math.PI/180*O.lat);return new fe(new n.N(O.lng-Fe,O.lat-Ie),new n.N(O.lng+Fe,O.lat+Ie))}adjustAntiMeridian(){let O=new n.N(this._sw.lng,this._sw.lat),pe=new n.N(this._ne.lng,this._ne.lat);return new fe(O,O.lng>pe.lng?new n.N(pe.lng+360,pe.lat):pe)}}class Ce{constructor(O,pe,Ie){this.bounds=fe.convert(this.validateBounds(O)),this.minzoom=pe||0,this.maxzoom=Ie||24}validateBounds(O){return Array.isArray(O)&&O.length===4?[Math.max(-180,O[0]),Math.max(-90,O[1]),Math.min(180,O[2]),Math.min(90,O[3])]:[-180,-90,180,90]}contains(O){let pe=Math.pow(2,O.z),Ie=Math.floor(n.O(this.bounds.getWest())*pe),Fe=Math.floor(n.Q(this.bounds.getNorth())*pe),qe=Math.ceil(n.O(this.bounds.getEast())*pe),Mt=Math.ceil(n.Q(this.bounds.getSouth())*pe);return O.x>=Ie&&O.x=Fe&&O.y{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return n.e({},this._options)}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ie={request:this.map._requestManager.transformRequest(pe,"Tile"),uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,tileSize:this.tileSize*O.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Ie.request.collectResourceTiming=this._collectResourceTiming;let Fe="RT";if(O.actor&&O.state!=="expired"){if(O.state==="loading")return new Promise((qe,Mt)=>{O.reloadPromise={resolve:qe,reject:Mt}})}else O.actor=this.dispatcher.getActor(),Fe="LT";O.abortController=new AbortController;try{let qe=yield O.actor.sendAsync({type:Fe,data:Ie},O.abortController);if(delete O.abortController,O.aborted)return;this._afterTileLoadWorkerResponse(O,qe)}catch(qe){if(delete O.abortController,O.aborted)return;if(qe&&qe.status!==404)throw qe;this._afterTileLoadWorkerResponse(O,null)}})}_afterTileLoadWorkerResponse(O,pe){if(pe&&pe.resourceTiming&&(O.resourceTiming=pe.resourceTiming),pe&&this.map._refreshExpiredTiles&&O.setExpiryData(pe),O.loadVectorData(pe,this.map.painter),O.reloadPromise){let Ie=O.reloadPromise;O.reloadPromise=null,this.loadTile(O).then(Ie.resolve).catch(Ie.reject)}}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.actor&&(yield O.actor.sendAsync({type:"AT",data:{uid:O.uid,type:this.type,source:this.id}}))})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.unloadVectorData(),O.actor&&(yield O.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Be extends n.E{constructor(O,pe,Ie,Fe){super(),this.id=O,this.dispatcher=Ie,this.setEventedParent(Fe),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=n.e({type:"raster"},pe),n.e(this,n.M(pe,["url","scheme","tileSize"]))}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let O=yield me(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,O&&(n.e(this,O),O.bounds&&(this.tileBounds=new Ce(O.bounds,this.minzoom,this.maxzoom)),this.fire(new n.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new n.k("data",{dataType:"source",sourceDataType:"content"})))}catch(O){this._tileJSONRequest=null,this.fire(new n.j(O))}})}loaded(){return this._loaded}onAdd(O){this.map=O,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(O){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),O(),this.load()}setTiles(O){return this.setSourceProperty(()=>{this._options.tiles=O}),this}setUrl(O){return this.setSourceProperty(()=>{this.url=O,this._options.url=O}),this}serialize(){return n.e({},this._options)}hasTile(O){return!this.tileBounds||this.tileBounds.contains(O.canonical)}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);O.abortController=new AbortController;try{let Ie=yield f.getImage(this.map._requestManager.transformRequest(pe,"Tile"),O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Ie&&Ie.data){this.map._refreshExpiredTiles&&Ie.cacheControl&&Ie.expires&&O.setExpiryData({cacheControl:Ie.cacheControl,expires:Ie.expires});let Fe=this.map.painter.context,qe=Fe.gl,Mt=Ie.data;O.texture=this.map.painter.getTileTexture(Mt.width),O.texture?O.texture.update(Mt,{useMipmap:!0}):(O.texture=new g(Fe,Mt,qe.RGBA,{useMipmap:!0}),O.texture.bind(qe.LINEAR,qe.CLAMP_TO_EDGE,qe.LINEAR_MIPMAP_NEAREST)),O.state="loaded"}}catch(Ie){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Ie)throw O.state="errored",Ie}})}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController)})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.texture&&this.map.painter.saveTileTexture(O.texture)})}hasTransition(){return!1}}class Ze extends Be{constructor(O,pe,Ie,Fe){super(O,pe,Ie,Fe),this.type="raster-dem",this.maxzoom=22,this._options=n.e({type:"raster-dem"},pe),this.encoding=pe.encoding||"mapbox",this.redFactor=pe.redFactor,this.greenFactor=pe.greenFactor,this.blueFactor=pe.blueFactor,this.baseShift=pe.baseShift}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ie=this.map._requestManager.transformRequest(pe,"Tile");O.neighboringTiles=this._getNeighboringTiles(O.tileID),O.abortController=new AbortController;try{let Fe=yield f.getImage(Ie,O.abortController,this.map._refreshExpiredTiles);if(delete O.abortController,O.aborted)return void(O.state="unloaded");if(Fe&&Fe.data){let qe=Fe.data;this.map._refreshExpiredTiles&&Fe.cacheControl&&Fe.expires&&O.setExpiryData({cacheControl:Fe.cacheControl,expires:Fe.expires});let Mt=n.b(qe)&&n.U()?qe:yield this.readImageNow(qe),jt={type:this.type,uid:O.uid,source:this.id,rawImageData:Mt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!O.actor||O.state==="expired"){O.actor=this.dispatcher.getActor();let tr=yield O.actor.sendAsync({type:"LDT",data:jt});O.dem=tr,O.needsHillshadePrepare=!0,O.needsTerrainPrepare=!0,O.state="loaded"}}}catch(Fe){if(delete O.abortController,O.aborted)O.state="unloaded";else if(Fe)throw O.state="errored",Fe}})}readImageNow(O){return n._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&n.V()){let pe=O.width+2,Ie=O.height+2;try{return new n.R({width:pe,height:Ie},yield n.W(O,-1,-1,pe,Ie))}catch{}}return u.getImageData(O,1)})}_getNeighboringTiles(O){let pe=O.canonical,Ie=Math.pow(2,pe.z),Fe=(pe.x-1+Ie)%Ie,qe=pe.x===0?O.wrap-1:O.wrap,Mt=(pe.x+1+Ie)%Ie,jt=pe.x+1===Ie?O.wrap+1:O.wrap,tr={};return tr[new n.S(O.overscaledZ,qe,pe.z,Fe,pe.y).key]={backfilled:!1},tr[new n.S(O.overscaledZ,jt,pe.z,Mt,pe.y).key]={backfilled:!1},pe.y>0&&(tr[new n.S(O.overscaledZ,qe,pe.z,Fe,pe.y-1).key]={backfilled:!1},tr[new n.S(O.overscaledZ,O.wrap,pe.z,pe.x,pe.y-1).key]={backfilled:!1},tr[new n.S(O.overscaledZ,jt,pe.z,Mt,pe.y-1).key]={backfilled:!1}),pe.y+10&&n.e(qe,{resourceTiming:Fe}),this.fire(new n.k("data",Object.assign(Object.assign({},qe),{sourceDataType:"metadata"}))),this.fire(new n.k("data",Object.assign(Object.assign({},qe),{sourceDataType:"content"})))}catch(Ie){if(this._pendingLoads--,this._removed)return void this.fire(new n.k("dataabort",{dataType:"source"}));this.fire(new n.j(Ie))}})}loaded(){return this._pendingLoads===0}loadTile(O){return n._(this,void 0,void 0,function*(){let pe=O.actor?"RT":"LT";O.actor=this.actor;let Ie={type:this.type,uid:O.uid,tileID:O.tileID,zoom:O.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};O.abortController=new AbortController;let Fe=yield this.actor.sendAsync({type:pe,data:Ie},O.abortController);delete O.abortController,O.unloadVectorData(),O.aborted||O.loadVectorData(Fe,this.map.painter,pe==="RT")})}abortTile(O){return n._(this,void 0,void 0,function*(){O.abortController&&(O.abortController.abort(),delete O.abortController),O.aborted=!0})}unloadTile(O){return n._(this,void 0,void 0,function*(){O.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:O.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return n.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var tt=n.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class _t extends n.E{constructor(O,pe,Ie,Fe){super(),this.id=O,this.dispatcher=Ie,this.coordinates=pe.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Fe),this.options=pe}load(O){return n._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new n.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let pe=yield f.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,pe&&pe.data&&(this.image=pe.data,O&&(this.coordinates=O),this._finishLoading())}catch(pe){this._request=null,this._loaded=!0,this.fire(new n.j(pe))}})}loaded(){return this._loaded}updateImage(O){return O.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=O.url,this.load(O.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new n.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(O){this.map=O,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(O){this.coordinates=O;let pe=O.map(n.Z.fromLngLat);this.tileID=function(Fe){let qe=1/0,Mt=1/0,jt=-1/0,tr=-1/0;for(let Ti of Fe)qe=Math.min(qe,Ti.x),Mt=Math.min(Mt,Ti.y),jt=Math.max(jt,Ti.x),tr=Math.max(tr,Ti.y);let kr=Math.max(jt-qe,tr-Mt),Vr=Math.max(0,Math.floor(-Math.log(kr)/Math.LN2)),Wr=Math.pow(2,Vr);return new n.a1(Vr,Math.floor((qe+jt)/2*Wr),Math.floor((Mt+tr)/2*Wr))}(pe),this.minzoom=this.maxzoom=this.tileID.z;let Ie=pe.map(Fe=>this.tileID.getTilePoint(Fe)._round());return this._boundsArray=new n.$,this._boundsArray.emplaceBack(Ie[0].x,Ie[0].y,0,0),this._boundsArray.emplaceBack(Ie[1].x,Ie[1].y,n.X,0),this._boundsArray.emplaceBack(Ie[3].x,Ie[3].y,0,n.X),this._boundsArray.emplaceBack(Ie[2].x,Ie[2].y,n.X,n.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new n.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let O=this.map.painter.context,pe=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,tt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new g(O,this.image,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));let Ie=!1;for(let Fe in this.tiles){let qe=this.tiles[Fe];qe.state!=="loaded"&&(qe.state="loaded",qe.texture=this.texture,Ie=!0)}Ie&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(O){return n._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(O.tileID.canonical)?(this.tiles[String(O.tileID.wrap)]=O,O.buckets={}):O.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class mt extends _t{constructor(O,pe,Ie,Fe){super(O,pe,Ie,Fe),this.roundZoom=!0,this.type="video",this.options=pe}load(){return n._(this,void 0,void 0,function*(){this._loaded=!1;let O=this.options;this.urls=[];for(let pe of O.urls)this.urls.push(this.map._requestManager.transformRequest(pe,"Source").url);try{let pe=yield n.a3(this.urls);if(this._loaded=!0,!pe)return;this.video=pe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(pe){this.fire(new n.j(pe))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(O){if(this.video){let pe=this.video.seekable;Ope.end(0)?this.fire(new n.j(new n.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${pe.start(0)} and ${pe.end(0)}-second mark.`))):this.video.currentTime=O}}getVideo(){return this.video}onAdd(O){this.map||(this.map=O,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let O=this.map.painter.context,pe=O.gl;this.boundsBuffer||(this.boundsBuffer=O.createVertexBuffer(this._boundsArray,tt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE),pe.texSubImage2D(pe.TEXTURE_2D,0,0,0,pe.RGBA,pe.UNSIGNED_BYTE,this.video)):(this.texture=new g(O,this.video,pe.RGBA),this.texture.bind(pe.LINEAR,pe.CLAMP_TO_EDGE));let Ie=!1;for(let Fe in this.tiles){let qe=this.tiles[Fe];qe.state!=="loaded"&&(qe.state="loaded",qe.texture=this.texture,Ie=!0)}Ie&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class vt extends _t{constructor(O,pe,Ie,Fe){super(O,pe,Ie,Fe),pe.coordinates?Array.isArray(pe.coordinates)&&pe.coordinates.length===4&&!pe.coordinates.some(qe=>!Array.isArray(qe)||qe.length!==2||qe.some(Mt=>typeof Mt!="number"))||this.fire(new n.j(new n.a2(`sources.${O}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new n.j(new n.a2(`sources.${O}`,null,'missing required property "coordinates"'))),pe.animate&&typeof pe.animate!="boolean"&&this.fire(new n.j(new n.a2(`sources.${O}`,null,'optional "animate" property must be a boolean value'))),pe.canvas?typeof pe.canvas=="string"||pe.canvas instanceof HTMLCanvasElement||this.fire(new n.j(new n.a2(`sources.${O}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new n.j(new n.a2(`sources.${O}`,null,'missing required property "canvas"'))),this.options=pe,this.animate=pe.animate===void 0||pe.animate}load(){return n._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new n.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(O){this.map=O,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let O=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,O=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,O=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let pe=this.map.painter.context,Ie=pe.gl;this.boundsBuffer||(this.boundsBuffer=pe.createVertexBuffer(this._boundsArray,tt.members)),this.boundsSegments||(this.boundsSegments=n.a0.simpleSegment(0,0,4,2)),this.texture?(O||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new g(pe,this.canvas,Ie.RGBA,{premultiply:!0});let Fe=!1;for(let qe in this.tiles){let Mt=this.tiles[qe];Mt.state!=="loaded"&&(Mt.state="loaded",Mt.texture=this.texture,Fe=!0)}Fe&&this.fire(new n.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let O of[this.canvas.width,this.canvas.height])if(isNaN(O)||O<=0)return!0;return!1}}let ct={},Ae=Ke=>{switch(Ke){case"geojson":return Ge;case"image":return _t;case"raster":return Be;case"raster-dem":return Ze;case"vector":return Re;case"video":return mt;case"canvas":return vt}return ct[Ke]},Oe="RTLPluginLoaded";class Le extends n.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=se()}_syncState(O){return this.status=O,this.dispatcher.broadcast("SRPS",{pluginStatus:O,pluginURL:this.url}).catch(pe=>{throw this.status="error",pe})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(O){return n._(this,arguments,void 0,function*(pe,Ie=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=u.resolveURL(pe),!this.url)throw new Error(`requested url ${pe} is invalid`);if(this.status==="unavailable"){if(!Ie)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return n._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new n.k(Oe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let nt=null;function xt(){return nt||(nt=new Le),nt}class ut{constructor(O,pe){this.timeAdded=0,this.fadeEndTime=0,this.tileID=O,this.uid=n.a4(),this.uses=0,this.tileSize=pe,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(O){let pe=O+this.timeAdded;peqe.getLayer(kr)).filter(Boolean);if(tr.length!==0){jt.layers=tr,jt.stateDependentLayerIds&&(jt.stateDependentLayers=jt.stateDependentLayerIds.map(kr=>tr.filter(Vr=>Vr.id===kr)[0]));for(let kr of tr)Mt[kr.id]=jt}}return Mt}(O.buckets,pe.style),this.hasSymbolBuckets=!1;for(let Fe in this.buckets){let qe=this.buckets[Fe];if(qe instanceof n.a6){if(this.hasSymbolBuckets=!0,!Ie)break;qe.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let Fe in this.buckets){let qe=this.buckets[Fe];if(qe instanceof n.a6&&qe.hasRTLText){this.hasRTLText=!0,xt().lazyLoad();break}}this.queryPadding=0;for(let Fe in this.buckets){let qe=this.buckets[Fe];this.queryPadding=Math.max(this.queryPadding,pe.style.getLayer(Fe).queryRadius(qe))}O.imageAtlas&&(this.imageAtlas=O.imageAtlas),O.glyphAtlasImage&&(this.glyphAtlasImage=O.glyphAtlasImage)}else this.collisionBoxArray=new n.a5}unloadVectorData(){for(let O in this.buckets)this.buckets[O].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(O){return this.buckets[O.id]}upload(O){for(let Ie in this.buckets){let Fe=this.buckets[Ie];Fe.uploadPending()&&Fe.upload(O)}let pe=O.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new g(O,this.imageAtlas.image,pe.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new g(O,this.glyphAtlasImage,pe.ALPHA),this.glyphAtlasImage=null)}prepare(O){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(O,this.imageAtlasTexture)}queryRenderedFeatures(O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Fe,cameraQueryGeometry:qe,scale:Mt,tileSize:this.tileSize,pixelPosMatrix:Vr,transform:tr,params:jt,queryPadding:this.queryPadding*kr},O,pe,Ie):{}}querySourceFeatures(O,pe){let Ie=this.latestFeatureIndex;if(!Ie||!Ie.rawTileData)return;let Fe=Ie.loadVTLayers(),qe=pe&&pe.sourceLayer?pe.sourceLayer:"",Mt=Fe._geojsonTileLayer||Fe[qe];if(!Mt)return;let jt=n.a7(pe&&pe.filter),{z:tr,x:kr,y:Vr}=this.tileID.canonical,Wr={z:tr,x:kr,y:Vr};for(let Ti=0;TiIe)Fe=!1;else if(pe)if(this.expirationTime{this.remove(O,qe)},Ie)),this.data[Fe].push(qe),this.order.push(Fe),this.order.length>this.max){let Mt=this._getAndRemoveByKey(this.order[0]);Mt&&this.onRemove(Mt)}return this}has(O){return O.wrapped().key in this.data}getAndRemove(O){return this.has(O)?this._getAndRemoveByKey(O.wrapped().key):null}_getAndRemoveByKey(O){let pe=this.data[O].shift();return pe.timeout&&clearTimeout(pe.timeout),this.data[O].length===0&&delete this.data[O],this.order.splice(this.order.indexOf(O),1),pe.value}getByKey(O){let pe=this.data[O];return pe?pe[0].value:null}get(O){return this.has(O)?this.data[O.wrapped().key][0].value:null}remove(O,pe){if(!this.has(O))return this;let Ie=O.wrapped().key,Fe=pe===void 0?0:this.data[Ie].indexOf(pe),qe=this.data[Ie][Fe];return this.data[Ie].splice(Fe,1),qe.timeout&&clearTimeout(qe.timeout),this.data[Ie].length===0&&delete this.data[Ie],this.onRemove(qe.value),this.order.splice(this.order.indexOf(Ie),1),this}setMaxSize(O){for(this.max=O;this.order.length>this.max;){let pe=this._getAndRemoveByKey(this.order[0]);pe&&this.onRemove(pe)}return this}filter(O){let pe=[];for(let Ie in this.data)for(let Fe of this.data[Ie])O(Fe.value)||pe.push(Fe);for(let Ie of pe)this.remove(Ie.value.tileID,Ie)}}class Gt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(O,pe,Ie){let Fe=String(pe);if(this.stateChanges[O]=this.stateChanges[O]||{},this.stateChanges[O][Fe]=this.stateChanges[O][Fe]||{},n.e(this.stateChanges[O][Fe],Ie),this.deletedStates[O]===null){this.deletedStates[O]={};for(let qe in this.state[O])qe!==Fe&&(this.deletedStates[O][qe]=null)}else if(this.deletedStates[O]&&this.deletedStates[O][Fe]===null){this.deletedStates[O][Fe]={};for(let qe in this.state[O][Fe])Ie[qe]||(this.deletedStates[O][Fe][qe]=null)}else for(let qe in Ie)this.deletedStates[O]&&this.deletedStates[O][Fe]&&this.deletedStates[O][Fe][qe]===null&&delete this.deletedStates[O][Fe][qe]}removeFeatureState(O,pe,Ie){if(this.deletedStates[O]===null)return;let Fe=String(pe);if(this.deletedStates[O]=this.deletedStates[O]||{},Ie&&pe!==void 0)this.deletedStates[O][Fe]!==null&&(this.deletedStates[O][Fe]=this.deletedStates[O][Fe]||{},this.deletedStates[O][Fe][Ie]=null);else if(pe!==void 0)if(this.stateChanges[O]&&this.stateChanges[O][Fe])for(Ie in this.deletedStates[O][Fe]={},this.stateChanges[O][Fe])this.deletedStates[O][Fe][Ie]=null;else this.deletedStates[O][Fe]=null;else this.deletedStates[O]=null}getState(O,pe){let Ie=String(pe),Fe=n.e({},(this.state[O]||{})[Ie],(this.stateChanges[O]||{})[Ie]);if(this.deletedStates[O]===null)return{};if(this.deletedStates[O]){let qe=this.deletedStates[O][pe];if(qe===null)return{};for(let Mt in qe)delete Fe[Mt]}return Fe}initializeTileState(O,pe){O.setFeatureState(this.state,pe)}coalesceChanges(O,pe){let Ie={};for(let Fe in this.stateChanges){this.state[Fe]=this.state[Fe]||{};let qe={};for(let Mt in this.stateChanges[Fe])this.state[Fe][Mt]||(this.state[Fe][Mt]={}),n.e(this.state[Fe][Mt],this.stateChanges[Fe][Mt]),qe[Mt]=this.state[Fe][Mt];Ie[Fe]=qe}for(let Fe in this.deletedStates){this.state[Fe]=this.state[Fe]||{};let qe={};if(this.deletedStates[Fe]===null)for(let Mt in this.state[Fe])qe[Mt]={},this.state[Fe][Mt]={};else for(let Mt in this.deletedStates[Fe]){if(this.deletedStates[Fe][Mt]===null)this.state[Fe][Mt]={};else for(let jt of Object.keys(this.deletedStates[Fe][Mt]))delete this.state[Fe][Mt][jt];qe[Mt]=this.state[Fe][Mt]}Ie[Fe]=Ie[Fe]||{},n.e(Ie[Fe],qe)}if(this.stateChanges={},this.deletedStates={},Object.keys(Ie).length!==0)for(let Fe in O)O[Fe].setFeatureState(Ie,pe)}}class Qt extends n.E{constructor(O,pe,Ie){super(),this.id=O,this.dispatcher=Ie,this.on("data",Fe=>this._dataHandler(Fe)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Fe,qe,Mt,jt)=>{let tr=new(Ae(qe.type))(Fe,qe,Mt,jt);if(tr.id!==Fe)throw new Error(`Expected Source id to be ${Fe} instead of ${tr.id}`);return tr})(O,pe,Ie,this),this._tiles={},this._cache=new Et(0,Fe=>this._unloadTile(Fe)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Gt,this._didEmitContent=!1,this._updated=!1}onAdd(O){this.map=O,this._maxTileCacheSize=O?O._maxTileCacheSize:null,this._maxTileCacheZoomLevels=O?O._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(O)}onRemove(O){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(O)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let O in this._tiles){let pe=this._tiles[O];if(pe.state!=="loaded"&&pe.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let O=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,O&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(O,pe,Ie){return n._(this,void 0,void 0,function*(){try{yield this._source.loadTile(O),this._tileLoaded(O,pe,Ie)}catch(Fe){O.state="errored",Fe.status!==404?this._source.fire(new n.j(Fe,{tile:O})):this.update(this.transform,this.terrain)}})}_unloadTile(O){this._source.unloadTile&&this._source.unloadTile(O)}_abortTile(O){this._source.abortTile&&this._source.abortTile(O),this._source.fire(new n.k("dataabort",{tile:O,coord:O.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(O){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let pe in this._tiles){let Ie=this._tiles[pe];Ie.upload(O),Ie.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(O=>O.tileID).sort(vr).map(O=>O.key)}getRenderableIds(O){let pe=[];for(let Ie in this._tiles)this._isIdRenderable(Ie,O)&&pe.push(this._tiles[Ie]);return O?pe.sort((Ie,Fe)=>{let qe=Ie.tileID,Mt=Fe.tileID,jt=new n.P(qe.canonical.x,qe.canonical.y)._rotate(this.transform.angle),tr=new n.P(Mt.canonical.x,Mt.canonical.y)._rotate(this.transform.angle);return qe.overscaledZ-Mt.overscaledZ||tr.y-jt.y||tr.x-jt.x}).map(Ie=>Ie.tileID.key):pe.map(Ie=>Ie.tileID).sort(vr).map(Ie=>Ie.key)}hasRenderableParent(O){let pe=this.findLoadedParent(O,0);return!!pe&&this._isIdRenderable(pe.tileID.key)}_isIdRenderable(O,pe){return this._tiles[O]&&this._tiles[O].hasData()&&!this._coveredTiles[O]&&(pe||!this._tiles[O].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let O in this._tiles)this._tiles[O].state!=="errored"&&this._reloadTile(O,"reloading")}}_reloadTile(O,pe){return n._(this,void 0,void 0,function*(){let Ie=this._tiles[O];Ie&&(Ie.state!=="loading"&&(Ie.state=pe),yield this._loadTile(Ie,O,pe))})}_tileLoaded(O,pe,Ie){O.timeAdded=u.now(),Ie==="expired"&&(O.refreshedUponExpiration=!0),this._setTileReloadTimer(pe,O),this.getSource().type==="raster-dem"&&O.dem&&this._backfillDEM(O),this._state.initializeTileState(O,this.map?this.map.painter:null),O.aborted||this._source.fire(new n.k("data",{dataType:"source",tile:O,coord:O.tileID}))}_backfillDEM(O){let pe=this.getRenderableIds();for(let Fe=0;Fe1||(Math.abs(Mt)>1&&(Math.abs(Mt+tr)===1?Mt+=tr:Math.abs(Mt-tr)===1&&(Mt-=tr)),qe.dem&&Fe.dem&&(Fe.dem.backfillBorder(qe.dem,Mt,jt),Fe.neighboringTiles&&Fe.neighboringTiles[kr]&&(Fe.neighboringTiles[kr].backfilled=!0)))}}getTile(O){return this.getTileByID(O.key)}getTileByID(O){return this._tiles[O]}_retainLoadedChildren(O,pe,Ie,Fe){for(let qe in this._tiles){let Mt=this._tiles[qe];if(Fe[qe]||!Mt.hasData()||Mt.tileID.overscaledZ<=pe||Mt.tileID.overscaledZ>Ie)continue;let jt=Mt.tileID;for(;Mt&&Mt.tileID.overscaledZ>pe+1;){let kr=Mt.tileID.scaledTo(Mt.tileID.overscaledZ-1);Mt=this._tiles[kr.key],Mt&&Mt.hasData()&&(jt=kr)}let tr=jt;for(;tr.overscaledZ>pe;)if(tr=tr.scaledTo(tr.overscaledZ-1),O[tr.key]){Fe[jt.key]=jt;break}}}findLoadedParent(O,pe){if(O.key in this._loadedParentTiles){let Ie=this._loadedParentTiles[O.key];return Ie&&Ie.tileID.overscaledZ>=pe?Ie:null}for(let Ie=O.overscaledZ-1;Ie>=pe;Ie--){let Fe=O.scaledTo(Ie),qe=this._getLoadedTile(Fe);if(qe)return qe}}findLoadedSibling(O){return this._getLoadedTile(O)}_getLoadedTile(O){let pe=this._tiles[O.key];return pe&&pe.hasData()?pe:this._cache.getByKey(O.wrapped().key)}updateCacheSize(O){let pe=Math.ceil(O.width/this._source.tileSize)+1,Ie=Math.ceil(O.height/this._source.tileSize)+1,Fe=Math.floor(pe*Ie*(this._maxTileCacheZoomLevels===null?n.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),qe=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Fe):Fe;this._cache.setMaxSize(qe)}handleWrapJump(O){let pe=Math.round((O-(this._prevLng===void 0?O:this._prevLng))/360);if(this._prevLng=O,pe){let Ie={};for(let Fe in this._tiles){let qe=this._tiles[Fe];qe.tileID=qe.tileID.unwrapTo(qe.tileID.wrap+pe),Ie[qe.tileID.key]=qe}this._tiles=Ie;for(let Fe in this._timers)clearTimeout(this._timers[Fe]),delete this._timers[Fe];for(let Fe in this._tiles)this._setTileReloadTimer(Fe,this._tiles[Fe])}}_updateCoveredAndRetainedTiles(O,pe,Ie,Fe,qe,Mt){let jt={},tr={},kr=Object.keys(O),Vr=u.now();for(let Wr of kr){let Ti=O[Wr],Vi=this._tiles[Wr];if(!Vi||Vi.fadeEndTime!==0&&Vi.fadeEndTime<=Vr)continue;let et=this.findLoadedParent(Ti,pe),lt=this.findLoadedSibling(Ti),Tt=et||lt||null;Tt&&(this._addTile(Tt.tileID),jt[Tt.tileID.key]=Tt.tileID),tr[Wr]=Ti}this._retainLoadedChildren(tr,Fe,Ie,O);for(let Wr in jt)O[Wr]||(this._coveredTiles[Wr]=!0,O[Wr]=jt[Wr]);if(Mt){let Wr={},Ti={};for(let Vi of qe)this._tiles[Vi.key].hasData()?Wr[Vi.key]=Vi:Ti[Vi.key]=Vi;for(let Vi in Ti){let et=Ti[Vi].children(this._source.maxzoom);this._tiles[et[0].key]&&this._tiles[et[1].key]&&this._tiles[et[2].key]&&this._tiles[et[3].key]&&(Wr[et[0].key]=O[et[0].key]=et[0],Wr[et[1].key]=O[et[1].key]=et[1],Wr[et[2].key]=O[et[2].key]=et[2],Wr[et[3].key]=O[et[3].key]=et[3],delete Ti[Vi])}for(let Vi in Ti){let et=Ti[Vi],lt=this.findLoadedParent(et,this._source.minzoom),Tt=this.findLoadedSibling(et),Lt=lt||Tt||null;if(Lt){Wr[Lt.tileID.key]=O[Lt.tileID.key]=Lt.tileID;for(let Vt in Wr)Wr[Vt].isChildOf(Lt.tileID)&&delete Wr[Vt]}}for(let Vi in this._tiles)Wr[Vi]||(this._coveredTiles[Vi]=!0)}}update(O,pe){if(!this._sourceLoaded||this._paused)return;let Ie;this.transform=O,this.terrain=pe,this.updateCacheSize(O),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Ie=O.getVisibleUnwrappedCoordinates(this._source.tileID).map(Vr=>new n.S(Vr.canonical.z,Vr.wrap,Vr.canonical.z,Vr.canonical.x,Vr.canonical.y)):(Ie=O.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:pe}),this._source.hasTile&&(Ie=Ie.filter(Vr=>this._source.hasTile(Vr)))):Ie=[];let Fe=O.coveringZoomLevel(this._source),qe=Math.max(Fe-Qt.maxOverzooming,this._source.minzoom),Mt=Math.max(Fe+Qt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let Vr={};for(let Wr of Ie)if(Wr.canonical.z>this._source.minzoom){let Ti=Wr.scaledTo(Wr.canonical.z-1);Vr[Ti.key]=Ti;let Vi=Wr.scaledTo(Math.max(this._source.minzoom,Math.min(Wr.canonical.z,5)));Vr[Vi.key]=Vi}Ie=Ie.concat(Object.values(Vr))}let jt=Ie.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,jt&&this.fire(new n.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let tr=this._updateRetainedTiles(Ie,Fe);mr(this._source.type)&&this._updateCoveredAndRetainedTiles(tr,qe,Mt,Fe,Ie,pe);for(let Vr in tr)this._tiles[Vr].clearFadeHold();let kr=n.ab(this._tiles,tr);for(let Vr of kr){let Wr=this._tiles[Vr];Wr.hasSymbolBuckets&&!Wr.holdingForFade()?Wr.setHoldDuration(this.map._fadeDuration):Wr.hasSymbolBuckets&&!Wr.symbolFadeFinished()||this._removeTile(Vr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(let O in this._tiles)this._tiles[O].holdingForFade()&&this._removeTile(O)}_updateRetainedTiles(O,pe){var Ie;let Fe={},qe={},Mt=Math.max(pe-Qt.maxOverzooming,this._source.minzoom),jt=Math.max(pe+Qt.maxUnderzooming,this._source.minzoom),tr={};for(let kr of O){let Vr=this._addTile(kr);Fe[kr.key]=kr,Vr.hasData()||pethis._source.maxzoom){let Ti=kr.children(this._source.maxzoom)[0],Vi=this.getTile(Ti);if(Vi&&Vi.hasData()){Fe[Ti.key]=Ti;continue}}else{let Ti=kr.children(this._source.maxzoom);if(Fe[Ti[0].key]&&Fe[Ti[1].key]&&Fe[Ti[2].key]&&Fe[Ti[3].key])continue}let Wr=Vr.wasRequested();for(let Ti=kr.overscaledZ-1;Ti>=Mt;--Ti){let Vi=kr.scaledTo(Ti);if(qe[Vi.key])break;if(qe[Vi.key]=!0,Vr=this.getTile(Vi),!Vr&&Wr&&(Vr=this._addTile(Vi)),Vr){let et=Vr.hasData();if((et||!(!((Ie=this.map)===null||Ie===void 0)&&Ie.cancelPendingTileRequestsWhileZooming)||Wr)&&(Fe[Vi.key]=Vi),Wr=Vr.wasRequested(),et)break}}}return Fe}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let O in this._tiles){let pe=[],Ie,Fe=this._tiles[O].tileID;for(;Fe.overscaledZ>0;){if(Fe.key in this._loadedParentTiles){Ie=this._loadedParentTiles[Fe.key];break}pe.push(Fe.key);let qe=Fe.scaledTo(Fe.overscaledZ-1);if(Ie=this._getLoadedTile(qe),Ie)break;Fe=qe}for(let qe of pe)this._loadedParentTiles[qe]=Ie}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let O in this._tiles){let pe=this._tiles[O].tileID,Ie=this._getLoadedTile(pe);this._loadedSiblingTiles[pe.key]=Ie}}_addTile(O){let pe=this._tiles[O.key];if(pe)return pe;pe=this._cache.getAndRemove(O),pe&&(this._setTileReloadTimer(O.key,pe),pe.tileID=O,this._state.initializeTileState(pe,this.map?this.map.painter:null),this._cacheTimers[O.key]&&(clearTimeout(this._cacheTimers[O.key]),delete this._cacheTimers[O.key],this._setTileReloadTimer(O.key,pe)));let Ie=pe;return pe||(pe=new ut(O,this._source.tileSize*O.overscaleFactor()),this._loadTile(pe,O.key,pe.state)),pe.uses++,this._tiles[O.key]=pe,Ie||this._source.fire(new n.k("dataloading",{tile:pe,coord:pe.tileID,dataType:"source"})),pe}_setTileReloadTimer(O,pe){O in this._timers&&(clearTimeout(this._timers[O]),delete this._timers[O]);let Ie=pe.getExpiryTimeout();Ie&&(this._timers[O]=setTimeout(()=>{this._reloadTile(O,"expired"),delete this._timers[O]},Ie))}_removeTile(O){let pe=this._tiles[O];pe&&(pe.uses--,delete this._tiles[O],this._timers[O]&&(clearTimeout(this._timers[O]),delete this._timers[O]),pe.uses>0||(pe.hasData()&&pe.state!=="reloading"?this._cache.add(pe.tileID,pe,pe.getExpiryTimeout()):(pe.aborted=!0,this._abortTile(pe),this._unloadTile(pe))))}_dataHandler(O){let pe=O.sourceDataType;O.dataType==="source"&&pe==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&O.dataType==="source"&&pe==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let O in this._tiles)this._removeTile(O);this._cache.reset()}tilesIn(O,pe,Ie){let Fe=[],qe=this.transform;if(!qe)return Fe;let Mt=Ie?qe.getCameraQueryGeometry(O):O,jt=O.map(et=>qe.pointCoordinate(et,this.terrain)),tr=Mt.map(et=>qe.pointCoordinate(et,this.terrain)),kr=this.getIds(),Vr=1/0,Wr=1/0,Ti=-1/0,Vi=-1/0;for(let et of tr)Vr=Math.min(Vr,et.x),Wr=Math.min(Wr,et.y),Ti=Math.max(Ti,et.x),Vi=Math.max(Vi,et.y);for(let et=0;et=0&&Nt[1].y+Vt>=0){let Xt=jt.map(Hr=>Tt.getTilePoint(Hr)),Pr=tr.map(Hr=>Tt.getTilePoint(Hr));Fe.push({tile:lt,tileID:Tt,queryGeometry:Xt,cameraQueryGeometry:Pr,scale:Lt})}}return Fe}getVisibleCoordinates(O){let pe=this.getRenderableIds(O).map(Ie=>this._tiles[Ie].tileID);for(let Ie of pe)Ie.posMatrix=this.transform.calculatePosMatrix(Ie.toUnwrapped());return pe}hasTransition(){if(this._source.hasTransition())return!0;if(mr(this._source.type)){let O=u.now();for(let pe in this._tiles)if(this._tiles[pe].fadeEndTime>=O)return!0}return!1}setFeatureState(O,pe,Ie){this._state.updateState(O=O||"_geojsonTileLayer",pe,Ie)}removeFeatureState(O,pe,Ie){this._state.removeFeatureState(O=O||"_geojsonTileLayer",pe,Ie)}getFeatureState(O,pe){return this._state.getState(O=O||"_geojsonTileLayer",pe)}setDependencies(O,pe,Ie){let Fe=this._tiles[O];Fe&&Fe.setDependencies(pe,Ie)}reloadTilesForDependencies(O,pe){for(let Ie in this._tiles)this._tiles[Ie].hasDependency(O,pe)&&this._reloadTile(Ie,"reloading");this._cache.filter(Ie=>!Ie.hasDependency(O,pe))}}function vr(Ke,O){let pe=Math.abs(2*Ke.wrap)-+(Ke.wrap<0),Ie=Math.abs(2*O.wrap)-+(O.wrap<0);return Ke.overscaledZ-O.overscaledZ||Ie-pe||O.canonical.y-Ke.canonical.y||O.canonical.x-Ke.canonical.x}function mr(Ke){return Ke==="raster"||Ke==="image"||Ke==="video"}Qt.maxOverzooming=10,Qt.maxUnderzooming=3;class Yr{constructor(O,pe){this.reset(O,pe)}reset(O,pe){this.points=O||[],this._distances=[0];for(let Ie=1;Ie0?(Fe-Mt)/jt:0;return this.points[qe].mult(1-tr).add(this.points[pe].mult(tr))}}function ii(Ke,O){let pe=!0;return Ke==="always"||Ke!=="never"&&O!=="never"||(pe=!1),pe}class Lr{constructor(O,pe,Ie){let Fe=this.boxCells=[],qe=this.circleCells=[];this.xCellCount=Math.ceil(O/Ie),this.yCellCount=Math.ceil(pe/Ie);for(let Mt=0;Mtthis.width||Fe<0||pe>this.height)return[];let tr=[];if(O<=0&&pe<=0&&this.width<=Ie&&this.height<=Fe){if(qe)return[{key:null,x1:O,y1:pe,x2:Ie,y2:Fe}];for(let kr=0;kr0}hitTestCircle(O,pe,Ie,Fe,qe){let Mt=O-Ie,jt=O+Ie,tr=pe-Ie,kr=pe+Ie;if(jt<0||Mt>this.width||kr<0||tr>this.height)return!1;let Vr=[];return this._forEachCell(Mt,tr,jt,kr,this._queryCellCircle,Vr,{hitTest:!0,overlapMode:Fe,circle:{x:O,y:pe,radius:Ie},seenUids:{box:{},circle:{}}},qe),Vr.length>0}_queryCell(O,pe,Ie,Fe,qe,Mt,jt,tr){let{seenUids:kr,hitTest:Vr,overlapMode:Wr}=jt,Ti=this.boxCells[qe];if(Ti!==null){let et=this.bboxes;for(let lt of Ti)if(!kr.box[lt]){kr.box[lt]=!0;let Tt=4*lt,Lt=this.boxKeys[lt];if(O<=et[Tt+2]&&pe<=et[Tt+3]&&Ie>=et[Tt+0]&&Fe>=et[Tt+1]&&(!tr||tr(Lt))&&(!Vr||!ii(Wr,Lt.overlapMode))&&(Mt.push({key:Lt,x1:et[Tt],y1:et[Tt+1],x2:et[Tt+2],y2:et[Tt+3]}),Vr))return!0}}let Vi=this.circleCells[qe];if(Vi!==null){let et=this.circles;for(let lt of Vi)if(!kr.circle[lt]){kr.circle[lt]=!0;let Tt=3*lt,Lt=this.circleKeys[lt];if(this._circleAndRectCollide(et[Tt],et[Tt+1],et[Tt+2],O,pe,Ie,Fe)&&(!tr||tr(Lt))&&(!Vr||!ii(Wr,Lt.overlapMode))){let Vt=et[Tt],Nt=et[Tt+1],Xt=et[Tt+2];if(Mt.push({key:Lt,x1:Vt-Xt,y1:Nt-Xt,x2:Vt+Xt,y2:Nt+Xt}),Vr)return!0}}}return!1}_queryCellCircle(O,pe,Ie,Fe,qe,Mt,jt,tr){let{circle:kr,seenUids:Vr,overlapMode:Wr}=jt,Ti=this.boxCells[qe];if(Ti!==null){let et=this.bboxes;for(let lt of Ti)if(!Vr.box[lt]){Vr.box[lt]=!0;let Tt=4*lt,Lt=this.boxKeys[lt];if(this._circleAndRectCollide(kr.x,kr.y,kr.radius,et[Tt+0],et[Tt+1],et[Tt+2],et[Tt+3])&&(!tr||tr(Lt))&&!ii(Wr,Lt.overlapMode))return Mt.push(!0),!0}}let Vi=this.circleCells[qe];if(Vi!==null){let et=this.circles;for(let lt of Vi)if(!Vr.circle[lt]){Vr.circle[lt]=!0;let Tt=3*lt,Lt=this.circleKeys[lt];if(this._circlesCollide(et[Tt],et[Tt+1],et[Tt+2],kr.x,kr.y,kr.radius)&&(!tr||tr(Lt))&&!ii(Wr,Lt.overlapMode))return Mt.push(!0),!0}}}_forEachCell(O,pe,Ie,Fe,qe,Mt,jt,tr){let kr=this._convertToXCellCoord(O),Vr=this._convertToYCellCoord(pe),Wr=this._convertToXCellCoord(Ie),Ti=this._convertToYCellCoord(Fe);for(let Vi=kr;Vi<=Wr;Vi++)for(let et=Vr;et<=Ti;et++)if(qe.call(this,O,pe,Ie,Fe,this.xCellCount*et+Vi,Mt,jt,tr))return}_convertToXCellCoord(O){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(O*this.xScale)))}_convertToYCellCoord(O){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(O*this.yScale)))}_circlesCollide(O,pe,Ie,Fe,qe,Mt){let jt=Fe-O,tr=qe-pe,kr=Ie+Mt;return kr*kr>jt*jt+tr*tr}_circleAndRectCollide(O,pe,Ie,Fe,qe,Mt,jt){let tr=(Mt-Fe)/2,kr=Math.abs(O-(Fe+tr));if(kr>tr+Ie)return!1;let Vr=(jt-qe)/2,Wr=Math.abs(pe-(qe+Vr));if(Wr>Vr+Ie)return!1;if(kr<=tr||Wr<=Vr)return!0;let Ti=kr-tr,Vi=Wr-Vr;return Ti*Ti+Vi*Vi<=Ie*Ie}}function ci(Ke,O,pe,Ie,Fe){let qe=n.H();return O?(n.K(qe,qe,[1/Fe,1/Fe,1]),pe||n.ad(qe,qe,Ie.angle)):n.L(qe,Ie.labelPlaneMatrix,Ke),qe}function vi(Ke,O,pe,Ie,Fe){if(O){let qe=n.ae(Ke);return n.K(qe,qe,[Fe,Fe,1]),pe||n.ad(qe,qe,-Ie.angle),qe}return Ie.glCoordMatrix}function Ot(Ke,O,pe,Ie){let Fe;Ie?(Fe=[Ke,O,Ie(Ke,O),1],n.af(Fe,Fe,pe)):(Fe=[Ke,O,0,1],br(Fe,Fe,pe));let qe=Fe[3];return{point:new n.P(Fe[0]/qe,Fe[1]/qe),signedDistanceFromCamera:qe,isOccluded:!1}}function Xe(Ke,O){return .5+Ke/O*.5}function ot(Ke,O){return Ke.x>=-O[0]&&Ke.x<=O[0]&&Ke.y>=-O[1]&&Ke.y<=O[1]}function De(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi,et){let lt=Ie?Ke.textSizeData:Ke.iconSizeData,Tt=n.ag(lt,pe.transform.zoom),Lt=[256/pe.width*2+1,256/pe.height*2+1],Vt=Ie?Ke.text.dynamicLayoutVertexArray:Ke.icon.dynamicLayoutVertexArray;Vt.clear();let Nt=Ke.lineVertexArray,Xt=Ie?Ke.text.placedSymbolArray:Ke.icon.placedSymbolArray,Pr=pe.transform.width/pe.transform.height,Hr=!1;for(let Zr=0;ZrMath.abs(pe.x-O.x)*Ie?{useVertical:!0}:(Ke===n.ah.vertical?O.ype.x)?{needsFlipping:!0}:null}function He(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr){let Wr=pe/24,Ti=O.lineOffsetX*Wr,Vi=O.lineOffsetY*Wr,et;if(O.numGlyphs>1){let lt=O.glyphStartIndex+O.numGlyphs,Tt=O.lineStartIndex,Lt=O.lineStartIndex+O.lineLength,Vt=ye(Wr,jt,Ti,Vi,Ie,O,Vr,Ke);if(!Vt)return{notEnoughRoom:!0};let Nt=Ot(Vt.first.point.x,Vt.first.point.y,Mt,Ke.getElevation).point,Xt=Ot(Vt.last.point.x,Vt.last.point.y,Mt,Ke.getElevation).point;if(Fe&&!Ie){let Pr=Pe(O.writingMode,Nt,Xt,kr);if(Pr)return Pr}et=[Vt.first];for(let Pr=O.glyphStartIndex+1;Pr0?Nt.point:function(Hr,Zr,pi,zi,Ki,rn){return at(Hr,Zr,pi,1,Ki,rn)}(Ke.tileAnchorPoint,Vt,Tt,0,qe,Ke),Pr=Pe(O.writingMode,Tt,Xt,kr);if(Pr)return Pr}let lt=hr(Wr*jt.getoffsetX(O.glyphStartIndex),Ti,Vi,Ie,O.segment,O.lineStartIndex,O.lineStartIndex+O.lineLength,Ke,Vr);if(!lt||Ke.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};et=[lt]}for(let lt of et)n.aj(tr,lt.point,lt.angle);return{}}function at(Ke,O,pe,Ie,Fe,qe){let Mt=Ke.add(Ke.sub(O)._unit()),jt=Fe!==void 0?Ot(Mt.x,Mt.y,Fe,qe.getElevation).point:At(Mt.x,Mt.y,qe).point,tr=pe.sub(jt);return pe.add(tr._mult(Ie/tr.mag()))}function ht(Ke,O,pe){let Ie=O.projectionCache;if(Ie.projections[Ke])return Ie.projections[Ke];let Fe=new n.P(O.lineVertexArray.getx(Ke),O.lineVertexArray.gety(Ke)),qe=At(Fe.x,Fe.y,O);if(qe.signedDistanceFromCamera>0)return Ie.projections[Ke]=qe.point,Ie.anyProjectionOccluded=Ie.anyProjectionOccluded||qe.isOccluded,qe.point;let Mt=Ke-pe.direction;return function(jt,tr,kr,Vr,Wr){return at(jt,tr,kr,Vr,void 0,Wr)}(pe.distanceFromAnchor===0?O.tileAnchorPoint:new n.P(O.lineVertexArray.getx(Mt),O.lineVertexArray.gety(Mt)),Fe,pe.previousVertex,pe.absOffsetX-pe.distanceFromAnchor+1,O)}function At(Ke,O,pe){let Ie=Ke+pe.translation[0],Fe=O+pe.translation[1],qe;return!pe.pitchWithMap&&pe.projection.useSpecialProjectionForSymbols?(qe=pe.projection.projectTileCoordinates(Ie,Fe,pe.unwrappedTileID,pe.getElevation),qe.point.x=(.5*qe.point.x+.5)*pe.width,qe.point.y=(.5*-qe.point.y+.5)*pe.height):(qe=Ot(Ie,Fe,pe.labelPlaneMatrix,pe.getElevation),qe.isOccluded=!1),qe}function Wt(Ke,O,pe){return Ke._unit()._perp()._mult(O*pe)}function Yt(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr){if(jt.projectionCache.offsets[Ke])return jt.projectionCache.offsets[Ke];let kr=pe.add(O);if(Ke+tr.direction=Fe)return jt.projectionCache.offsets[Ke]=kr,kr;let Vr=ht(Ke+tr.direction,jt,tr),Wr=Wt(Vr.sub(pe),Mt,tr.direction),Ti=pe.add(Wr),Vi=Vr.add(Wr);return jt.projectionCache.offsets[Ke]=n.ak(qe,kr,Ti,Vi)||kr,jt.projectionCache.offsets[Ke]}function hr(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr){let kr=Ie?Ke-O:Ke+O,Vr=kr>0?1:-1,Wr=0;Ie&&(Vr*=-1,Wr=Math.PI),Vr<0&&(Wr+=Math.PI);let Ti,Vi=Vr>0?qe+Fe:qe+Fe+1;jt.projectionCache.cachedAnchorPoint?Ti=jt.projectionCache.cachedAnchorPoint:(Ti=At(jt.tileAnchorPoint.x,jt.tileAnchorPoint.y,jt).point,jt.projectionCache.cachedAnchorPoint=Ti);let et,lt,Tt=Ti,Lt=Ti,Vt=0,Nt=0,Xt=Math.abs(kr),Pr=[],Hr;for(;Vt+Nt<=Xt;){if(Vi+=Vr,Vi=Mt)return null;Vt+=Nt,Lt=Tt,lt=et;let zi={absOffsetX:Xt,direction:Vr,distanceFromAnchor:Vt,previousVertex:Lt};if(Tt=ht(Vi,jt,zi),pe===0)Pr.push(Lt),Hr=Tt.sub(Lt);else{let Ki,rn=Tt.sub(Lt);Ki=rn.mag()===0?Wt(ht(Vi+Vr,jt,zi).sub(Tt),pe,Vr):Wt(rn,pe,Vr),lt||(lt=Lt.add(Ki)),et=Yt(Vi,Ki,Tt,qe,Mt,lt,pe,jt,zi),Pr.push(lt),Hr=et.sub(lt)}Nt=Hr.mag()}let Zr=Hr._mult((Xt-Vt)/Nt)._add(lt||Lt),pi=Wr+Math.atan2(Tt.y-Lt.y,Tt.x-Lt.x);return Pr.push(Zr),{point:Zr,angle:tr?pi:0,path:Pr}}let zr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dr(Ke,O){for(let pe=0;pe=1;Bo--)Ba.push(Ca.path[Bo]);for(let Bo=1;Bo_s.signedDistanceFromCamera<=0)?[]:Bo.map(_s=>_s.point)}let Go=[];if(Ba.length>0){let Bo=Ba[0].clone(),_s=Ba[0].clone();for(let wl=1;wl=rn.x&&_s.x<=kn.x&&Bo.y>=rn.y&&_s.y<=kn.y?[Ba]:_s.xkn.x||_s.ykn.y?[]:n.al([Ba],rn.x,rn.y,kn.x,kn.y)}for(let Bo of Go){Qn.reset(Bo,.25*Ki);let _s=0;_s=Qn.length<=.5*Ki?1:Math.ceil(Qn.paddedLength/xo)+1;for(let wl=0;wl<_s;wl++){let Al=wl/Math.max(_s-1,1),Us=Qn.lerp(Al),Pl=Us.x+fi,Fu=Us.y+fi;Lt.push(Pl,Fu,Ki,0);let Tu=Pl-Ki,Js=Fu-Ki,Qs=Pl+Ki,nc=Fu+Ki;if(zi=zi&&this.isOffscreen(Tu,Js,Qs,nc),pi=pi||this.isInsideGrid(Tu,Js,Qs,nc),O!=="always"&&this.grid.hitTestCircle(Pl,Fu,Ki,O,Ti)&&(Zr=!0,!Vr))return{circles:[],offscreen:!1,collisionDetected:Zr}}}}return{circles:!Vr&&Zr||!pi||NtOt(Fe.x,Fe.y,Ie,pe.getElevation))}queryRenderedSymbols(O){if(O.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let pe=[],Ie=1/0,Fe=1/0,qe=-1/0,Mt=-1/0;for(let Vr of O){let Wr=new n.P(Vr.x+fi,Vr.y+fi);Ie=Math.min(Ie,Wr.x),Fe=Math.min(Fe,Wr.y),qe=Math.max(qe,Wr.x),Mt=Math.max(Mt,Wr.y),pe.push(Wr)}let jt=this.grid.query(Ie,Fe,qe,Mt).concat(this.ignoredGrid.query(Ie,Fe,qe,Mt)),tr={},kr={};for(let Vr of jt){let Wr=Vr.key;if(tr[Wr.bucketInstanceId]===void 0&&(tr[Wr.bucketInstanceId]={}),tr[Wr.bucketInstanceId][Wr.featureIndex])continue;let Ti=[new n.P(Vr.x1,Vr.y1),new n.P(Vr.x2,Vr.y1),new n.P(Vr.x2,Vr.y2),new n.P(Vr.x1,Vr.y2)];n.am(pe,Ti)&&(tr[Wr.bucketInstanceId][Wr.featureIndex]=!0,kr[Wr.bucketInstanceId]===void 0&&(kr[Wr.bucketInstanceId]=[]),kr[Wr.bucketInstanceId].push(Wr.featureIndex))}return kr}insertCollisionBox(O,pe,Ie,Fe,qe,Mt){(Ie?this.ignoredGrid:this.grid).insert({bucketInstanceId:Fe,featureIndex:qe,collisionGroupID:Mt,overlapMode:pe},O[0],O[1],O[2],O[3])}insertCollisionCircles(O,pe,Ie,Fe,qe,Mt){let jt=Ie?this.ignoredGrid:this.grid,tr={bucketInstanceId:Fe,featureIndex:qe,collisionGroupID:Mt,overlapMode:pe};for(let kr=0;kr=this.screenRightBoundary||Fethis.screenBottomBoundary}isInsideGrid(O,pe,Ie,Fe){return Ie>=0&&O=0&&pethis.projectAndGetPerspectiveRatio(Ie,Ki.x,Ki.y,Fe,kr));pi=zi.some(Ki=>!Ki.isOccluded),Zr=zi.map(Ki=>Ki.point)}else pi=!0;return{box:n.ao(Zr),allPointsOccluded:!pi}}}function cn(Ke,O,pe){return O*(n.X/(Ke.tileSize*Math.pow(2,pe-Ke.tileID.overscaledZ)))}class yn{constructor(O,pe,Ie,Fe){this.opacity=O?Math.max(0,Math.min(1,O.opacity+(O.placed?pe:-pe))):Fe&&Ie?1:0,this.placed=Ie}isHidden(){return this.opacity===0&&!this.placed}}class Gn{constructor(O,pe,Ie,Fe,qe){this.text=new yn(O?O.text:null,pe,Ie,qe),this.icon=new yn(O?O.icon:null,pe,Fe,qe)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Sn{constructor(O,pe,Ie){this.text=O,this.icon=pe,this.skipFade=Ie}}class dn{constructor(){this.invProjMatrix=n.H(),this.viewportMatrix=n.H(),this.circles=[]}}class va{constructor(O,pe,Ie,Fe,qe){this.bucketInstanceId=O,this.featureIndex=pe,this.sourceLayerIndex=Ie,this.bucketIndex=Fe,this.tileID=qe}}class na{constructor(O){this.crossSourceCollisions=O,this.maxGroupID=0,this.collisionGroups={}}get(O){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[O]){let pe=++this.maxGroupID;this.collisionGroups[O]={ID:pe,predicate:Ie=>Ie.collisionGroupID===pe}}return this.collisionGroups[O]}}function Kt(Ke,O,pe,Ie,Fe){let{horizontalAlign:qe,verticalAlign:Mt}=n.au(Ke);return new n.P(-(qe-.5)*O+Ie[0]*Fe,-(Mt-.5)*pe+Ie[1]*Fe)}class lr{constructor(O,pe,Ie,Fe,qe,Mt){this.transform=O.clone(),this.terrain=Ie,this.collisionIndex=new un(this.transform,pe),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Fe,this.retainedQueryData={},this.collisionGroups=new na(qe),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=Mt,Mt&&(Mt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(O){let pe=this.terrain;return pe?(Ie,Fe)=>pe.getElevation(O,Ie,Fe):null}getBucketParts(O,pe,Ie,Fe){let qe=Ie.getBucket(pe),Mt=Ie.latestFeatureIndex;if(!qe||!Mt||pe.id!==qe.layerIds[0])return;let jt=Ie.collisionBoxArray,tr=qe.layers[0].layout,kr=qe.layers[0].paint,Vr=Math.pow(2,this.transform.zoom-Ie.tileID.overscaledZ),Wr=Ie.tileSize/n.X,Ti=Ie.tileID.toUnwrapped(),Vi=this.transform.calculatePosMatrix(Ti),et=tr.get("text-pitch-alignment")==="map",lt=tr.get("text-rotation-alignment")==="map",Tt=cn(Ie,1,this.transform.zoom),Lt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ie,kr.get("text-translate"),kr.get("text-translate-anchor")),Vt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ie,kr.get("icon-translate"),kr.get("icon-translate-anchor")),Nt=ci(Vi,et,lt,this.transform,Tt),Xt=null;if(et){let Hr=vi(Vi,et,lt,this.transform,Tt);Xt=n.L([],this.transform.labelPlaneMatrix,Hr)}this.retainedQueryData[qe.bucketInstanceId]=new va(qe.bucketInstanceId,Mt,qe.sourceLayerIndex,qe.index,Ie.tileID);let Pr={bucket:qe,layout:tr,translationText:Lt,translationIcon:Vt,posMatrix:Vi,unwrappedTileID:Ti,textLabelPlaneMatrix:Nt,labelToScreenMatrix:Xt,scale:Vr,textPixelRatio:Wr,holdingForFade:Ie.holdingForFade(),collisionBoxArray:jt,partiallyEvaluatedTextSize:n.ag(qe.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(qe.sourceID)};if(Fe)for(let Hr of qe.sortKeyRanges){let{sortKey:Zr,symbolInstanceStart:pi,symbolInstanceEnd:zi}=Hr;O.push({sortKey:Zr,symbolInstanceStart:pi,symbolInstanceEnd:zi,parameters:Pr})}else O.push({symbolInstanceStart:0,symbolInstanceEnd:qe.symbolInstances.length,parameters:Pr})}attemptAnchorPlacement(O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi,et,lt,Tt,Lt,Vt,Nt){let Xt=n.aq[O.textAnchor],Pr=[O.textOffset0,O.textOffset1],Hr=Kt(Xt,Ie,Fe,Pr,qe),Zr=this.collisionIndex.placeCollisionBox(pe,Ti,tr,kr,Vr,jt,Mt,Tt,Wr.predicate,Nt,Hr);if((!Vt||this.collisionIndex.placeCollisionBox(Vt,Ti,tr,kr,Vr,jt,Mt,Lt,Wr.predicate,Nt,Hr).placeable)&&Zr.placeable){let pi;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Vi.crossTileID]&&this.prevPlacement.placements[Vi.crossTileID]&&this.prevPlacement.placements[Vi.crossTileID].text&&(pi=this.prevPlacement.variableOffsets[Vi.crossTileID].anchor),Vi.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Vi.crossTileID]={textOffset:Pr,width:Ie,height:Fe,anchor:Xt,textBoxScale:qe,prevAnchor:pi},this.markUsedJustification(et,Xt,Vi,lt),et.allowVerticalPlacement&&(this.markUsedOrientation(et,lt,Vi),this.placedOrientations[Vi.crossTileID]=lt),{shift:Hr,placedGlyphBoxes:Zr}}}placeLayerBucketPart(O,pe,Ie){let{bucket:Fe,layout:qe,translationText:Mt,translationIcon:jt,posMatrix:tr,unwrappedTileID:kr,textLabelPlaneMatrix:Vr,labelToScreenMatrix:Wr,textPixelRatio:Ti,holdingForFade:Vi,collisionBoxArray:et,partiallyEvaluatedTextSize:lt,collisionGroup:Tt}=O.parameters,Lt=qe.get("text-optional"),Vt=qe.get("icon-optional"),Nt=n.ar(qe,"text-overlap","text-allow-overlap"),Xt=Nt==="always",Pr=n.ar(qe,"icon-overlap","icon-allow-overlap"),Hr=Pr==="always",Zr=qe.get("text-rotation-alignment")==="map",pi=qe.get("text-pitch-alignment")==="map",zi=qe.get("icon-text-fit")!=="none",Ki=qe.get("symbol-z-order")==="viewport-y",rn=Xt&&(Hr||!Fe.hasIconData()||Vt),kn=Hr&&(Xt||!Fe.hasTextData()||Lt);!Fe.collisionArrays&&et&&Fe.deserializeCollisionBoxes(et);let Qn=this._getTerrainElevationFunc(this.retainedQueryData[Fe.bucketInstanceId].tileID),Ca=(Ta,Ba,xo)=>{var Go,Bo;if(pe[Ta.crossTileID])return;if(Vi)return void(this.placements[Ta.crossTileID]=new Sn(!1,!1,!1));let _s=!1,wl=!1,Al=!0,Us=null,Pl={box:null,placeable:!1,offscreen:null},Fu={placeable:!1},Tu=null,Js=null,Qs=null,nc=0,wc=0,ih=0;Ba.textFeatureIndex?nc=Ba.textFeatureIndex:Ta.useRuntimeCollisionCircles&&(nc=Ta.featureIndex),Ba.verticalTextFeatureIndex&&(wc=Ba.verticalTextFeatureIndex);let Me=Ba.textBox;if(Me){let Bt=Or=>{let mi=n.ah.horizontal;if(Fe.allowVerticalPlacement&&!Or&&this.prevPlacement){let hi=this.prevPlacement.placedOrientations[Ta.crossTileID];hi&&(this.placedOrientations[Ta.crossTileID]=hi,mi=hi,this.markUsedOrientation(Fe,mi,Ta))}return mi},Ht=(Or,mi)=>{if(Fe.allowVerticalPlacement&&Ta.numVerticalGlyphVertices>0&&Ba.verticalTextBox){for(let hi of Fe.writingModes)if(hi===n.ah.vertical?(Pl=mi(),Fu=Pl):Pl=Or(),Pl&&Pl.placeable)break}else Pl=Or()},dr=Ta.textAnchorOffsetStartIndex,cr=Ta.textAnchorOffsetEndIndex;if(cr===dr){let Or=(mi,hi)=>{let Bi=this.collisionIndex.placeCollisionBox(mi,Nt,Ti,tr,kr,pi,Zr,Mt,Tt.predicate,Qn);return Bi&&Bi.placeable&&(this.markUsedOrientation(Fe,hi,Ta),this.placedOrientations[Ta.crossTileID]=hi),Bi};Ht(()=>Or(Me,n.ah.horizontal),()=>{let mi=Ba.verticalTextBox;return Fe.allowVerticalPlacement&&Ta.numVerticalGlyphVertices>0&&mi?Or(mi,n.ah.vertical):{box:null,offscreen:null}}),Bt(Pl&&Pl.placeable)}else{let Or=n.aq[(Bo=(Go=this.prevPlacement)===null||Go===void 0?void 0:Go.variableOffsets[Ta.crossTileID])===null||Bo===void 0?void 0:Bo.anchor],mi=(Bi,Yi,Ji)=>{let ta=Bi.x2-Bi.x1,sn=Bi.y2-Bi.y1,Bn=Ta.textBoxScale,$n=zi&&Pr==="never"?Yi:null,Yn=null,aa=Nt==="never"?1:2,vn="never";Or&&aa++;for(let Qa=0;Qami(Me,Ba.iconBox,n.ah.horizontal),()=>{let Bi=Ba.verticalTextBox;return Fe.allowVerticalPlacement&&(!Pl||!Pl.placeable)&&Ta.numVerticalGlyphVertices>0&&Bi?mi(Bi,Ba.verticalIconBox,n.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Pl&&(_s=Pl.placeable,Al=Pl.offscreen);let hi=Bt(Pl&&Pl.placeable);if(!_s&&this.prevPlacement){let Bi=this.prevPlacement.variableOffsets[Ta.crossTileID];Bi&&(this.variableOffsets[Ta.crossTileID]=Bi,this.markUsedJustification(Fe,Bi.anchor,Ta,hi))}}}if(Tu=Pl,_s=Tu&&Tu.placeable,Al=Tu&&Tu.offscreen,Ta.useRuntimeCollisionCircles){let Bt=Fe.text.placedSymbolArray.get(Ta.centerJustifiedTextSymbolIndex),Ht=n.ai(Fe.textSizeData,lt,Bt),dr=qe.get("text-padding");Js=this.collisionIndex.placeCollisionCircles(Nt,Bt,Fe.lineVertexArray,Fe.glyphOffsetArray,Ht,tr,kr,Vr,Wr,Ie,pi,Tt.predicate,Ta.collisionCircleDiameter,dr,Mt,Qn),Js.circles.length&&Js.collisionDetected&&!Ie&&n.w("Collisions detected, but collision boxes are not shown"),_s=Xt||Js.circles.length>0&&!Js.collisionDetected,Al=Al&&Js.offscreen}if(Ba.iconFeatureIndex&&(ih=Ba.iconFeatureIndex),Ba.iconBox){let Bt=Ht=>this.collisionIndex.placeCollisionBox(Ht,Pr,Ti,tr,kr,pi,Zr,jt,Tt.predicate,Qn,zi&&Us?Us:void 0);Fu&&Fu.placeable&&Ba.verticalIconBox?(Qs=Bt(Ba.verticalIconBox),wl=Qs.placeable):(Qs=Bt(Ba.iconBox),wl=Qs.placeable),Al=Al&&Qs.offscreen}let Ve=Lt||Ta.numHorizontalGlyphVertices===0&&Ta.numVerticalGlyphVertices===0,ft=Vt||Ta.numIconVertices===0;Ve||ft?ft?Ve||(wl=wl&&_s):_s=wl&&_s:wl=_s=wl&&_s;let Pt=wl&&Qs.placeable;if(_s&&Tu.placeable&&this.collisionIndex.insertCollisionBox(Tu.box,Nt,qe.get("text-ignore-placement"),Fe.bucketInstanceId,Fu&&Fu.placeable&&wc?wc:nc,Tt.ID),Pt&&this.collisionIndex.insertCollisionBox(Qs.box,Pr,qe.get("icon-ignore-placement"),Fe.bucketInstanceId,ih,Tt.ID),Js&&_s&&this.collisionIndex.insertCollisionCircles(Js.circles,Nt,qe.get("text-ignore-placement"),Fe.bucketInstanceId,nc,Tt.ID),Ie&&this.storeCollisionData(Fe.bucketInstanceId,xo,Ba,Tu,Qs,Js),Ta.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Fe.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ta.crossTileID]=new Sn(_s||rn,wl||kn,Al||Fe.justReloaded),pe[Ta.crossTileID]=!0};if(Ki){if(O.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let Ta=Fe.getSortedSymbolIndexes(this.transform.angle);for(let Ba=Ta.length-1;Ba>=0;--Ba){let xo=Ta[Ba];Ca(Fe.symbolInstances.get(xo),Fe.collisionArrays[xo],xo)}}else for(let Ta=O.symbolInstanceStart;Ta=0&&(O.text.placedSymbolArray.get(jt).crossTileID=qe>=0&&jt!==qe?0:Ie.crossTileID)}markUsedOrientation(O,pe,Ie){let Fe=pe===n.ah.horizontal||pe===n.ah.horizontalOnly?pe:0,qe=pe===n.ah.vertical?pe:0,Mt=[Ie.leftJustifiedTextSymbolIndex,Ie.centerJustifiedTextSymbolIndex,Ie.rightJustifiedTextSymbolIndex];for(let jt of Mt)O.text.placedSymbolArray.get(jt).placedOrientation=Fe;Ie.verticalPlacedTextSymbolIndex&&(O.text.placedSymbolArray.get(Ie.verticalPlacedTextSymbolIndex).placedOrientation=qe)}commit(O){this.commitTime=O,this.zoomAtLastRecencyCheck=this.transform.zoom;let pe=this.prevPlacement,Ie=!1;this.prevZoomAdjustment=pe?pe.zoomAdjustment(this.transform.zoom):0;let Fe=pe?pe.symbolFadeChange(O):1,qe=pe?pe.opacities:{},Mt=pe?pe.variableOffsets:{},jt=pe?pe.placedOrientations:{};for(let tr in this.placements){let kr=this.placements[tr],Vr=qe[tr];Vr?(this.opacities[tr]=new Gn(Vr,Fe,kr.text,kr.icon),Ie=Ie||kr.text!==Vr.text.placed||kr.icon!==Vr.icon.placed):(this.opacities[tr]=new Gn(null,Fe,kr.text,kr.icon,kr.skipFade),Ie=Ie||kr.text||kr.icon)}for(let tr in qe){let kr=qe[tr];if(!this.opacities[tr]){let Vr=new Gn(kr,Fe,!1,!1);Vr.isHidden()||(this.opacities[tr]=Vr,Ie=Ie||kr.text.placed||kr.icon.placed)}}for(let tr in Mt)this.variableOffsets[tr]||!this.opacities[tr]||this.opacities[tr].isHidden()||(this.variableOffsets[tr]=Mt[tr]);for(let tr in jt)this.placedOrientations[tr]||!this.opacities[tr]||this.opacities[tr].isHidden()||(this.placedOrientations[tr]=jt[tr]);if(pe&&pe.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Ie?this.lastPlacementChangeTime=O:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=pe?pe.lastPlacementChangeTime:O)}updateLayerOpacities(O,pe){let Ie={};for(let Fe of pe){let qe=Fe.getBucket(O);qe&&Fe.latestFeatureIndex&&O.id===qe.layerIds[0]&&this.updateBucketOpacities(qe,Fe.tileID,Ie,Fe.collisionBoxArray)}}updateBucketOpacities(O,pe,Ie,Fe){O.hasTextData()&&(O.text.opacityVertexArray.clear(),O.text.hasVisibleVertices=!1),O.hasIconData()&&(O.icon.opacityVertexArray.clear(),O.icon.hasVisibleVertices=!1),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexArray.clear(),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexArray.clear();let qe=O.layers[0],Mt=qe.layout,jt=new Gn(null,0,!1,!1,!0),tr=Mt.get("text-allow-overlap"),kr=Mt.get("icon-allow-overlap"),Vr=qe._unevaluatedLayout.hasValue("text-variable-anchor")||qe._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Wr=Mt.get("text-rotation-alignment")==="map",Ti=Mt.get("text-pitch-alignment")==="map",Vi=Mt.get("icon-text-fit")!=="none",et=new Gn(null,0,tr&&(kr||!O.hasIconData()||Mt.get("icon-optional")),kr&&(tr||!O.hasTextData()||Mt.get("text-optional")),!0);!O.collisionArrays&&Fe&&(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData())&&O.deserializeCollisionBoxes(Fe);let lt=(Lt,Vt,Nt)=>{for(let Xt=0;Xt0,pi=this.placedOrientations[Vt.crossTileID],zi=pi===n.ah.vertical,Ki=pi===n.ah.horizontal||pi===n.ah.horizontalOnly;if(Nt>0||Xt>0){let kn=Kn(Hr.text);lt(O.text,Nt,zi?Jn:kn),lt(O.text,Xt,Ki?Jn:kn);let Qn=Hr.text.isHidden();[Vt.rightJustifiedTextSymbolIndex,Vt.centerJustifiedTextSymbolIndex,Vt.leftJustifiedTextSymbolIndex].forEach(Ba=>{Ba>=0&&(O.text.placedSymbolArray.get(Ba).hidden=Qn||zi?1:0)}),Vt.verticalPlacedTextSymbolIndex>=0&&(O.text.placedSymbolArray.get(Vt.verticalPlacedTextSymbolIndex).hidden=Qn||Ki?1:0);let Ca=this.variableOffsets[Vt.crossTileID];Ca&&this.markUsedJustification(O,Ca.anchor,Vt,pi);let Ta=this.placedOrientations[Vt.crossTileID];Ta&&(this.markUsedJustification(O,"left",Vt,Ta),this.markUsedOrientation(O,Ta,Vt))}if(Zr){let kn=Kn(Hr.icon),Qn=!(Vi&&Vt.verticalPlacedIconSymbolIndex&&zi);Vt.placedIconSymbolIndex>=0&&(lt(O.icon,Vt.numIconVertices,Qn?kn:Jn),O.icon.placedSymbolArray.get(Vt.placedIconSymbolIndex).hidden=Hr.icon.isHidden()),Vt.verticalPlacedIconSymbolIndex>=0&&(lt(O.icon,Vt.numVerticalIconVertices,Qn?Jn:kn),O.icon.placedSymbolArray.get(Vt.verticalPlacedIconSymbolIndex).hidden=Hr.icon.isHidden())}let rn=Tt&&Tt.has(Lt)?Tt.get(Lt):{text:null,icon:null};if(O.hasIconCollisionBoxData()||O.hasTextCollisionBoxData()){let kn=O.collisionArrays[Lt];if(kn){let Qn=new n.P(0,0);if(kn.textBox||kn.verticalTextBox){let Ca=!0;if(Vr){let Ta=this.variableOffsets[Pr];Ta?(Qn=Kt(Ta.anchor,Ta.width,Ta.height,Ta.textOffset,Ta.textBoxScale),Wr&&Qn._rotate(Ti?this.transform.angle:-this.transform.angle)):Ca=!1}if(kn.textBox||kn.verticalTextBox){let Ta;kn.textBox&&(Ta=zi),kn.verticalTextBox&&(Ta=Ki),_r(O.textCollisionBox.collisionVertexArray,Hr.text.placed,!Ca||Ta,rn.text,Qn.x,Qn.y)}}if(kn.iconBox||kn.verticalIconBox){let Ca=!!(!Ki&&kn.verticalIconBox),Ta;kn.iconBox&&(Ta=Ca),kn.verticalIconBox&&(Ta=!Ca),_r(O.iconCollisionBox.collisionVertexArray,Hr.icon.placed,Ta,rn.icon,Vi?Qn.x:0,Vi?Qn.y:0)}}}}if(O.sortFeatures(this.transform.angle),this.retainedQueryData[O.bucketInstanceId]&&(this.retainedQueryData[O.bucketInstanceId].featureSortOrder=O.featureSortOrder),O.hasTextData()&&O.text.opacityVertexBuffer&&O.text.opacityVertexBuffer.updateData(O.text.opacityVertexArray),O.hasIconData()&&O.icon.opacityVertexBuffer&&O.icon.opacityVertexBuffer.updateData(O.icon.opacityVertexArray),O.hasIconCollisionBoxData()&&O.iconCollisionBox.collisionVertexBuffer&&O.iconCollisionBox.collisionVertexBuffer.updateData(O.iconCollisionBox.collisionVertexArray),O.hasTextCollisionBoxData()&&O.textCollisionBox.collisionVertexBuffer&&O.textCollisionBox.collisionVertexBuffer.updateData(O.textCollisionBox.collisionVertexArray),O.text.opacityVertexArray.length!==O.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${O.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${O.text.layoutVertexArray.length}) / 4`);if(O.icon.opacityVertexArray.length!==O.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${O.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${O.icon.layoutVertexArray.length}) / 4`);if(O.bucketInstanceId in this.collisionCircleArrays){let Lt=this.collisionCircleArrays[O.bucketInstanceId];O.placementInvProjMatrix=Lt.invProjMatrix,O.placementViewportMatrix=Lt.viewportMatrix,O.collisionCircleArray=Lt.circles,delete this.collisionCircleArrays[O.bucketInstanceId]}}symbolFadeChange(O){return this.fadeDuration===0?1:(O-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(O){return Math.max(0,(this.transform.zoom-O)/1.5)}hasTransitions(O){return this.stale||O-this.lastPlacementChangeTimeO}setStale(){this.stale=!0}}function _r(Ke,O,pe,Ie,Fe,qe){Ie&&Ie.length!==0||(Ie=[0,0,0,0]);let Mt=Ie[0]-fi,jt=Ie[1]-fi,tr=Ie[2]-fi,kr=Ie[3]-fi;Ke.emplaceBack(O?1:0,pe?1:0,Fe||0,qe||0,Mt,jt),Ke.emplaceBack(O?1:0,pe?1:0,Fe||0,qe||0,tr,jt),Ke.emplaceBack(O?1:0,pe?1:0,Fe||0,qe||0,tr,kr),Ke.emplaceBack(O?1:0,pe?1:0,Fe||0,qe||0,Mt,kr)}let Er=Math.pow(2,25),di=Math.pow(2,24),qi=Math.pow(2,17),Ui=Math.pow(2,16),Hi=Math.pow(2,9),Ln=Math.pow(2,8),Fn=Math.pow(2,1);function Kn(Ke){if(Ke.opacity===0&&!Ke.placed)return 0;if(Ke.opacity===1&&Ke.placed)return 4294967295;let O=Ke.placed?1:0,pe=Math.floor(127*Ke.opacity);return pe*Er+O*di+pe*qi+O*Ui+pe*Hi+O*Ln+pe*Fn+O}let Jn=0;function sa(){return{isOccluded:(Ke,O,pe)=>!1,getPitchedTextCorrection:(Ke,O,pe)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Ke,O,pe,Ie){throw new Error("Not implemented.")},translatePosition:(Ke,O,pe,Ie)=>function(Fe,qe,Mt,jt,tr=!1){if(!Mt[0]&&!Mt[1])return[0,0];let kr=tr?jt==="map"?Fe.angle:0:jt==="viewport"?-Fe.angle:0;if(kr){let Vr=Math.sin(kr),Wr=Math.cos(kr);Mt=[Mt[0]*Wr-Mt[1]*Vr,Mt[0]*Vr+Mt[1]*Wr]}return[tr?Mt[0]:cn(qe,Mt[0],Fe.zoom),tr?Mt[1]:cn(qe,Mt[1],Fe.zoom)]}(Ke,O,pe,Ie),getCircleRadiusCorrection:Ke=>1}}class Mn{constructor(O){this._sortAcrossTiles=O.layout.get("symbol-z-order")!=="viewport-y"&&!O.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(O,pe,Ie,Fe,qe){let Mt=this._bucketParts;for(;this._currentTileIndexjt.sortKey-tr.sortKey));this._currentPartIndex!this._forceFullPlacement&&u.now()-Fe>2;for(;this._currentPlacementIndex>=0;){let Mt=pe[O[this._currentPlacementIndex]],jt=this.placement.collisionIndex.transform.zoom;if(Mt.type==="symbol"&&(!Mt.minzoom||Mt.minzoom<=jt)&&(!Mt.maxzoom||Mt.maxzoom>jt)){if(this._inProgressLayer||(this._inProgressLayer=new Mn(Mt)),this._inProgressLayer.continuePlacement(Ie[Mt.source],this.placement,this._showCollisionBoxes,Mt,qe))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(O){return this.placement.commit(O),this.placement}}let io=512/n.X/2;class Ft{constructor(O,pe,Ie){this.tileID=O,this.bucketInstanceId=Ie,this._symbolsByKey={};let Fe=new Map;for(let qe=0;qe({x:Math.floor(tr.anchorX*io),y:Math.floor(tr.anchorY*io)})),crossTileIDs:Mt.map(tr=>tr.crossTileID)};if(jt.positions.length>128){let tr=new n.av(jt.positions.length,16,Uint16Array);for(let{x:kr,y:Vr}of jt.positions)tr.add(kr,Vr);tr.finish(),delete jt.positions,jt.index=tr}this._symbolsByKey[qe]=jt}}getScaledCoordinates(O,pe){let{x:Ie,y:Fe,z:qe}=this.tileID.canonical,{x:Mt,y:jt,z:tr}=pe.canonical,kr=io/Math.pow(2,tr-qe),Vr=(jt*n.X+O.anchorY)*kr,Wr=Fe*n.X*io;return{x:Math.floor((Mt*n.X+O.anchorX)*kr-Ie*n.X*io),y:Math.floor(Vr-Wr)}}findMatches(O,pe,Ie){let Fe=this.tileID.canonical.zO)}}class Rt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class qr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(O){let pe=Math.round((O-this.lng)/360);if(pe!==0)for(let Ie in this.indexes){let Fe=this.indexes[Ie],qe={};for(let Mt in Fe){let jt=Fe[Mt];jt.tileID=jt.tileID.unwrapTo(jt.tileID.wrap+pe),qe[jt.tileID.key]=jt}this.indexes[Ie]=qe}this.lng=O}addBucket(O,pe,Ie){if(this.indexes[O.overscaledZ]&&this.indexes[O.overscaledZ][O.key]){if(this.indexes[O.overscaledZ][O.key].bucketInstanceId===pe.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(O.overscaledZ,this.indexes[O.overscaledZ][O.key])}for(let qe=0;qeO.overscaledZ)for(let jt in Mt){let tr=Mt[jt];tr.tileID.isChildOf(O)&&tr.findMatches(pe.symbolInstances,O,Fe)}else{let jt=Mt[O.scaledTo(Number(qe)).key];jt&&jt.findMatches(pe.symbolInstances,O,Fe)}}for(let qe=0;qe{pe[Ie]=!0});for(let Ie in this.layerIndexes)pe[Ie]||delete this.layerIndexes[Ie]}}let si=(Ke,O)=>n.t(Ke,O&&O.filter(pe=>pe.identifier!=="source.canvas")),Gr=n.aw();class li extends n.E{constructor(O,pe={}){super(),this._rtlPluginLoaded=()=>{for(let Ie in this.sourceCaches){let Fe=this.sourceCaches[Ie].getSource().type;Fe!=="vector"&&Fe!=="geojson"||this.sourceCaches[Ie].reload()}},this.map=O,this.dispatcher=new ne(ge(),O._getMapId()),this.dispatcher.registerMessageHandler("GG",(Ie,Fe)=>this.getGlyphs(Ie,Fe)),this.dispatcher.registerMessageHandler("GI",(Ie,Fe)=>this.getImages(Ie,Fe)),this.imageManager=new T,this.imageManager.setEventedParent(this),this.glyphManager=new V(O._requestManager,pe.localIdeographFontFamily),this.lineAtlas=new ee(256,512),this.crossTileSymbolIndex=new ai,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new n.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",n.ay()),xt().on(Oe,this._rtlPluginLoaded),this.on("data",Ie=>{if(Ie.dataType!=="source"||Ie.sourceDataType!=="metadata")return;let Fe=this.sourceCaches[Ie.sourceId];if(!Fe)return;let qe=Fe.getSource();if(qe&&qe.vectorLayerIds)for(let Mt in this._layers){let jt=this._layers[Mt];jt.source===qe.id&&this._validateLayer(jt)}})}loadURL(O,pe={},Ie){this.fire(new n.k("dataloading",{dataType:"style"})),pe.validate=typeof pe.validate!="boolean"||pe.validate;let Fe=this.map._requestManager.transformRequest(O,"Style");this._loadStyleRequest=new AbortController;let qe=this._loadStyleRequest;n.h(Fe,this._loadStyleRequest).then(Mt=>{this._loadStyleRequest=null,this._load(Mt.data,pe,Ie)}).catch(Mt=>{this._loadStyleRequest=null,Mt&&!qe.signal.aborted&&this.fire(new n.j(Mt))})}loadJSON(O,pe={},Ie){this.fire(new n.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,pe.validate=pe.validate!==!1,this._load(O,pe,Ie)}).catch(()=>{})}loadEmpty(){this.fire(new n.k("dataloading",{dataType:"style"})),this._load(Gr,{validate:!1})}_load(O,pe,Ie){var Fe;let qe=pe.transformStyle?pe.transformStyle(Ie,O):O;if(!pe.validate||!si(this,n.u(qe))){this._loaded=!0,this.stylesheet=qe;for(let Mt in qe.sources)this.addSource(Mt,qe.sources[Mt],{validate:!1});qe.sprite?this._loadSprite(qe.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(qe.glyphs),this._createLayers(),this.light=new H(this.stylesheet.light),this.sky=new G(this.stylesheet.sky),this.map.setTerrain((Fe=this.stylesheet.terrain)!==null&&Fe!==void 0?Fe:null),this.fire(new n.k("data",{dataType:"style"})),this.fire(new n.k("style.load"))}}_createLayers(){let O=n.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",O),this._order=O.map(pe=>pe.id),this._layers={},this._serializedLayers=null;for(let pe of O){let Ie=n.aA(pe);Ie.setEventedParent(this,{layer:{id:pe.id}}),this._layers[pe.id]=Ie}}_loadSprite(O,pe=!1,Ie=void 0){let Fe;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(qe,Mt,jt,tr){return n._(this,void 0,void 0,function*(){let kr=M(qe),Vr=jt>1?"@2x":"",Wr={},Ti={};for(let{id:Vi,url:et}of kr){let lt=Mt.transformRequest(p(et,Vr,".json"),"SpriteJSON");Wr[Vi]=n.h(lt,tr);let Tt=Mt.transformRequest(p(et,Vr,".png"),"SpriteImage");Ti[Vi]=f.getImage(Tt,tr)}return yield Promise.all([...Object.values(Wr),...Object.values(Ti)]),function(Vi,et){return n._(this,void 0,void 0,function*(){let lt={};for(let Tt in Vi){lt[Tt]={};let Lt=u.getImageCanvasContext((yield et[Tt]).data),Vt=(yield Vi[Tt]).data;for(let Nt in Vt){let{width:Xt,height:Pr,x:Hr,y:Zr,sdf:pi,pixelRatio:zi,stretchX:Ki,stretchY:rn,content:kn,textFitWidth:Qn,textFitHeight:Ca}=Vt[Nt];lt[Tt][Nt]={data:null,pixelRatio:zi,sdf:pi,stretchX:Ki,stretchY:rn,content:kn,textFitWidth:Qn,textFitHeight:Ca,spriteData:{width:Xt,height:Pr,x:Hr,y:Zr,context:Lt}}}}return lt})}(Wr,Ti)})}(O,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(qe=>{if(this._spriteRequest=null,qe)for(let Mt in qe){this._spritesImagesIds[Mt]=[];let jt=this._spritesImagesIds[Mt]?this._spritesImagesIds[Mt].filter(tr=>!(tr in qe)):[];for(let tr of jt)this.imageManager.removeImage(tr),this._changedImages[tr]=!0;for(let tr in qe[Mt]){let kr=Mt==="default"?tr:`${Mt}:${tr}`;this._spritesImagesIds[Mt].push(kr),kr in this.imageManager.images?this.imageManager.updateImage(kr,qe[Mt][tr],!1):this.imageManager.addImage(kr,qe[Mt][tr]),pe&&(this._changedImages[kr]=!0)}}}).catch(qe=>{this._spriteRequest=null,Fe=qe,this.fire(new n.j(Fe))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),pe&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"})),Ie&&Ie(Fe)})}_unloadSprite(){for(let O of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(O),this._changedImages[O]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}_validateLayer(O){let pe=this.sourceCaches[O.source];if(!pe)return;let Ie=O.sourceLayer;if(!Ie)return;let Fe=pe.getSource();(Fe.type==="geojson"||Fe.vectorLayerIds&&Fe.vectorLayerIds.indexOf(Ie)===-1)&&this.fire(new n.j(new Error(`Source layer "${Ie}" does not exist on source "${Fe.id}" as specified by style layer "${O.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let O in this.sourceCaches)if(!this.sourceCaches[O].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(O,pe=!1){let Ie=this._serializedAllLayers();if(!O||O.length===0)return Object.values(pe?n.aB(Ie):Ie);let Fe=[];for(let qe of O)if(Ie[qe]){let Mt=pe?n.aB(Ie[qe]):Ie[qe];Fe.push(Mt)}return Fe}_serializedAllLayers(){let O=this._serializedLayers;if(O)return O;O=this._serializedLayers={};let pe=Object.keys(this._layers);for(let Ie of pe){let Fe=this._layers[Ie];Fe.type!=="custom"&&(O[Ie]=Fe.serialize())}return O}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(let O in this.sourceCaches)if(this.sourceCaches[O].hasTransition())return!0;for(let O in this._layers)if(this._layers[O].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(O){if(!this._loaded)return;let pe=this._changed;if(pe){let Fe=Object.keys(this._updatedLayers),qe=Object.keys(this._removedLayers);(Fe.length||qe.length)&&this._updateWorkerLayers(Fe,qe);for(let Mt in this._updatedSources){let jt=this._updatedSources[Mt];if(jt==="reload")this._reloadSource(Mt);else{if(jt!=="clear")throw new Error(`Invalid action ${jt}`);this._clearSource(Mt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let Mt in this._updatedPaintProps)this._layers[Mt].updateTransitions(O);this.light.updateTransitions(O),this.sky.updateTransitions(O),this._resetUpdates()}let Ie={};for(let Fe in this.sourceCaches){let qe=this.sourceCaches[Fe];Ie[Fe]=qe.used,qe.used=!1}for(let Fe of this._order){let qe=this._layers[Fe];qe.recalculate(O,this._availableImages),!qe.isHidden(O.zoom)&&qe.source&&(this.sourceCaches[qe.source].used=!0)}for(let Fe in Ie){let qe=this.sourceCaches[Fe];!!Ie[Fe]!=!!qe.used&&qe.fire(new n.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Fe}))}this.light.recalculate(O),this.sky.recalculate(O),this.z=O.zoom,pe&&this.fire(new n.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let O=Object.keys(this._changedImages);if(O.length){for(let pe in this.sourceCaches)this.sourceCaches[pe].reloadTilesForDependencies(["icons","patterns"],O);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let O in this.sourceCaches)this.sourceCaches[O].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(O,pe){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(O,!1),removedIds:pe})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(O,pe={}){var Ie;this._checkLoaded();let Fe=this.serialize();if(O=pe.transformStyle?pe.transformStyle(Fe,O):O,((Ie=pe.validate)===null||Ie===void 0||Ie)&&si(this,n.u(O)))return!1;(O=n.aB(O)).layers=n.az(O.layers);let qe=n.aC(Fe,O),Mt=this._getOperationsToPerform(qe);if(Mt.unimplemented.length>0)throw new Error(`Unimplemented: ${Mt.unimplemented.join(", ")}.`);if(Mt.operations.length===0)return!1;for(let jt of Mt.operations)jt();return this.stylesheet=O,this._serializedLayers=null,!0}_getOperationsToPerform(O){let pe=[],Ie=[];for(let Fe of O)switch(Fe.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":pe.push(()=>this.addLayer.apply(this,Fe.args));break;case"removeLayer":pe.push(()=>this.removeLayer.apply(this,Fe.args));break;case"setPaintProperty":pe.push(()=>this.setPaintProperty.apply(this,Fe.args));break;case"setLayoutProperty":pe.push(()=>this.setLayoutProperty.apply(this,Fe.args));break;case"setFilter":pe.push(()=>this.setFilter.apply(this,Fe.args));break;case"addSource":pe.push(()=>this.addSource.apply(this,Fe.args));break;case"removeSource":pe.push(()=>this.removeSource.apply(this,Fe.args));break;case"setLayerZoomRange":pe.push(()=>this.setLayerZoomRange.apply(this,Fe.args));break;case"setLight":pe.push(()=>this.setLight.apply(this,Fe.args));break;case"setGeoJSONSourceData":pe.push(()=>this.setGeoJSONSourceData.apply(this,Fe.args));break;case"setGlyphs":pe.push(()=>this.setGlyphs.apply(this,Fe.args));break;case"setSprite":pe.push(()=>this.setSprite.apply(this,Fe.args));break;case"setSky":pe.push(()=>this.setSky.apply(this,Fe.args));break;case"setTerrain":pe.push(()=>this.map.setTerrain.apply(this,Fe.args));break;case"setTransition":pe.push(()=>{});break;default:Ie.push(Fe.command)}return{operations:pe,unimplemented:Ie}}addImage(O,pe){if(this.getImage(O))return this.fire(new n.j(new Error(`An image named "${O}" already exists.`)));this.imageManager.addImage(O,pe),this._afterImageUpdated(O)}updateImage(O,pe){this.imageManager.updateImage(O,pe)}getImage(O){return this.imageManager.getImage(O)}removeImage(O){if(!this.getImage(O))return this.fire(new n.j(new Error(`An image named "${O}" does not exist.`)));this.imageManager.removeImage(O),this._afterImageUpdated(O)}_afterImageUpdated(O){this._availableImages=this.imageManager.listImages(),this._changedImages[O]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(O,pe,Ie={}){if(this._checkLoaded(),this.sourceCaches[O]!==void 0)throw new Error(`Source "${O}" already exists.`);if(!pe.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(pe).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(pe.type)>=0&&this._validate(n.u.source,`sources.${O}`,pe,null,Ie))return;this.map&&this.map._collectResourceTiming&&(pe.collectResourceTiming=!0);let Fe=this.sourceCaches[O]=new Qt(O,pe,this.dispatcher);Fe.style=this,Fe.setEventedParent(this,()=>({isSourceLoaded:Fe.loaded(),source:Fe.serialize(),sourceId:O})),Fe.onAdd(this.map),this._changed=!0}removeSource(O){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error("There is no source with this ID");for(let Ie in this._layers)if(this._layers[Ie].source===O)return this.fire(new n.j(new Error(`Source "${O}" cannot be removed while layer "${Ie}" is using it.`)));let pe=this.sourceCaches[O];delete this.sourceCaches[O],delete this._updatedSources[O],pe.fire(new n.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:O})),pe.setEventedParent(null),pe.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(O,pe){if(this._checkLoaded(),this.sourceCaches[O]===void 0)throw new Error(`There is no source with this ID=${O}`);let Ie=this.sourceCaches[O].getSource();if(Ie.type!=="geojson")throw new Error(`geojsonSource.type is ${Ie.type}, which is !== 'geojson`);Ie.setData(pe),this._changed=!0}getSource(O){return this.sourceCaches[O]&&this.sourceCaches[O].getSource()}addLayer(O,pe,Ie={}){this._checkLoaded();let Fe=O.id;if(this.getLayer(Fe))return void this.fire(new n.j(new Error(`Layer "${Fe}" already exists on this map.`)));let qe;if(O.type==="custom"){if(si(this,n.aD(O)))return;qe=n.aA(O)}else{if("source"in O&&typeof O.source=="object"&&(this.addSource(Fe,O.source),O=n.aB(O),O=n.e(O,{source:Fe})),this._validate(n.u.layer,`layers.${Fe}`,O,{arrayIndex:-1},Ie))return;qe=n.aA(O),this._validateLayer(qe),qe.setEventedParent(this,{layer:{id:Fe}})}let Mt=pe?this._order.indexOf(pe):this._order.length;if(pe&&Mt===-1)this.fire(new n.j(new Error(`Cannot add layer "${Fe}" before non-existing layer "${pe}".`)));else{if(this._order.splice(Mt,0,Fe),this._layerOrderChanged=!0,this._layers[Fe]=qe,this._removedLayers[Fe]&&qe.source&&qe.type!=="custom"){let jt=this._removedLayers[Fe];delete this._removedLayers[Fe],jt.type!==qe.type?this._updatedSources[qe.source]="clear":(this._updatedSources[qe.source]="reload",this.sourceCaches[qe.source].pause())}this._updateLayer(qe),qe.onAdd&&qe.onAdd(this.map)}}moveLayer(O,pe){if(this._checkLoaded(),this._changed=!0,!this._layers[O])return void this.fire(new n.j(new Error(`The layer '${O}' does not exist in the map's style and cannot be moved.`)));if(O===pe)return;let Ie=this._order.indexOf(O);this._order.splice(Ie,1);let Fe=pe?this._order.indexOf(pe):this._order.length;pe&&Fe===-1?this.fire(new n.j(new Error(`Cannot move layer "${O}" before non-existing layer "${pe}".`))):(this._order.splice(Fe,0,O),this._layerOrderChanged=!0)}removeLayer(O){this._checkLoaded();let pe=this._layers[O];if(!pe)return void this.fire(new n.j(new Error(`Cannot remove non-existing layer "${O}".`)));pe.setEventedParent(null);let Ie=this._order.indexOf(O);this._order.splice(Ie,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[O]=pe,delete this._layers[O],this._serializedLayers&&delete this._serializedLayers[O],delete this._updatedLayers[O],delete this._updatedPaintProps[O],pe.onRemove&&pe.onRemove(this.map)}getLayer(O){return this._layers[O]}getLayersOrder(){return[...this._order]}hasLayer(O){return O in this._layers}setLayerZoomRange(O,pe,Ie){this._checkLoaded();let Fe=this.getLayer(O);Fe?Fe.minzoom===pe&&Fe.maxzoom===Ie||(pe!=null&&(Fe.minzoom=pe),Ie!=null&&(Fe.maxzoom=Ie),this._updateLayer(Fe)):this.fire(new n.j(new Error(`Cannot set the zoom range of non-existing layer "${O}".`)))}setFilter(O,pe,Ie={}){this._checkLoaded();let Fe=this.getLayer(O);if(Fe){if(!n.aE(Fe.filter,pe))return pe==null?(Fe.filter=void 0,void this._updateLayer(Fe)):void(this._validate(n.u.filter,`layers.${Fe.id}.filter`,pe,null,Ie)||(Fe.filter=n.aB(pe),this._updateLayer(Fe)))}else this.fire(new n.j(new Error(`Cannot filter non-existing layer "${O}".`)))}getFilter(O){return n.aB(this.getLayer(O).filter)}setLayoutProperty(O,pe,Ie,Fe={}){this._checkLoaded();let qe=this.getLayer(O);qe?n.aE(qe.getLayoutProperty(pe),Ie)||(qe.setLayoutProperty(pe,Ie,Fe),this._updateLayer(qe)):this.fire(new n.j(new Error(`Cannot style non-existing layer "${O}".`)))}getLayoutProperty(O,pe){let Ie=this.getLayer(O);if(Ie)return Ie.getLayoutProperty(pe);this.fire(new n.j(new Error(`Cannot get style of non-existing layer "${O}".`)))}setPaintProperty(O,pe,Ie,Fe={}){this._checkLoaded();let qe=this.getLayer(O);qe?n.aE(qe.getPaintProperty(pe),Ie)||(qe.setPaintProperty(pe,Ie,Fe)&&this._updateLayer(qe),this._changed=!0,this._updatedPaintProps[O]=!0,this._serializedLayers=null):this.fire(new n.j(new Error(`Cannot style non-existing layer "${O}".`)))}getPaintProperty(O,pe){return this.getLayer(O).getPaintProperty(pe)}setFeatureState(O,pe){this._checkLoaded();let Ie=O.source,Fe=O.sourceLayer,qe=this.sourceCaches[Ie];if(qe===void 0)return void this.fire(new n.j(new Error(`The source '${Ie}' does not exist in the map's style.`)));let Mt=qe.getSource().type;Mt==="geojson"&&Fe?this.fire(new n.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):Mt!=="vector"||Fe?(O.id===void 0&&this.fire(new n.j(new Error("The feature id parameter must be provided."))),qe.setFeatureState(Fe,O.id,pe)):this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(O,pe){this._checkLoaded();let Ie=O.source,Fe=this.sourceCaches[Ie];if(Fe===void 0)return void this.fire(new n.j(new Error(`The source '${Ie}' does not exist in the map's style.`)));let qe=Fe.getSource().type,Mt=qe==="vector"?O.sourceLayer:void 0;qe!=="vector"||Mt?pe&&typeof O.id!="string"&&typeof O.id!="number"?this.fire(new n.j(new Error("A feature id is required to remove its specific state property."))):Fe.removeFeatureState(Mt,O.id,pe):this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(O){this._checkLoaded();let pe=O.source,Ie=O.sourceLayer,Fe=this.sourceCaches[pe];if(Fe!==void 0)return Fe.getSource().type!=="vector"||Ie?(O.id===void 0&&this.fire(new n.j(new Error("The feature id parameter must be provided."))),Fe.getFeatureState(Ie,O.id)):void this.fire(new n.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new n.j(new Error(`The source '${pe}' does not exist in the map's style.`)))}getTransition(){return n.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let O=n.aF(this.sourceCaches,qe=>qe.serialize()),pe=this._serializeByIds(this._order,!0),Ie=this.map.getTerrain()||void 0,Fe=this.stylesheet;return n.aG({version:Fe.version,name:Fe.name,metadata:Fe.metadata,light:Fe.light,sky:Fe.sky,center:Fe.center,zoom:Fe.zoom,bearing:Fe.bearing,pitch:Fe.pitch,sprite:Fe.sprite,glyphs:Fe.glyphs,transition:Fe.transition,sources:O,layers:pe,terrain:Ie},qe=>qe!==void 0)}_updateLayer(O){this._updatedLayers[O.id]=!0,O.source&&!this._updatedSources[O.source]&&this.sourceCaches[O.source].getSource().type!=="raster"&&(this._updatedSources[O.source]="reload",this.sourceCaches[O.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(O){let pe=Mt=>this._layers[Mt].type==="fill-extrusion",Ie={},Fe=[];for(let Mt=this._order.length-1;Mt>=0;Mt--){let jt=this._order[Mt];if(pe(jt)){Ie[jt]=Mt;for(let tr of O){let kr=tr[jt];if(kr)for(let Vr of kr)Fe.push(Vr)}}}Fe.sort((Mt,jt)=>jt.intersectionZ-Mt.intersectionZ);let qe=[];for(let Mt=this._order.length-1;Mt>=0;Mt--){let jt=this._order[Mt];if(pe(jt))for(let tr=Fe.length-1;tr>=0;tr--){let kr=Fe[tr].feature;if(Ie[kr.layer.id]{let pi=Lt.featureSortOrder;if(pi){let zi=pi.indexOf(Hr.featureIndex);return pi.indexOf(Zr.featureIndex)-zi}return Zr.featureIndex-Hr.featureIndex});for(let Hr of Pr)Xt.push(Hr)}}for(let Lt in et)et[Lt].forEach(Vt=>{let Nt=Vt.feature,Xt=kr[jt[Lt].source].getFeatureState(Nt.layer["source-layer"],Nt.id);Nt.source=Nt.layer.source,Nt.layer["source-layer"]&&(Nt.sourceLayer=Nt.layer["source-layer"]),Nt.state=Xt});return et}(this._layers,Mt,this.sourceCaches,O,pe,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(qe)}querySourceFeatures(O,pe){pe&&pe.filter&&this._validate(n.u.filter,"querySourceFeatures.filter",pe.filter,null,pe);let Ie=this.sourceCaches[O];return Ie?function(Fe,qe){let Mt=Fe.getRenderableIds().map(kr=>Fe.getTileByID(kr)),jt=[],tr={};for(let kr=0;krTi.getTileByID(Vi)).sort((Vi,et)=>et.tileID.overscaledZ-Vi.tileID.overscaledZ||(Vi.tileID.isLessThan(et.tileID)?-1:1))}let Wr=this.crossTileSymbolIndex.addLayer(Vr,tr[Vr.source],O.center.lng);Mt=Mt||Wr}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((qe=qe||this._layerOrderChanged||Ie===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.now(),O.zoom))&&(this.pauseablePlacement=new Ha(O,this.map.terrain,this._order,qe,pe,Ie,Fe,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,tr),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.now()),jt=!0),Mt&&this.pauseablePlacement.placement.setStale()),jt||Mt)for(let kr of this._order){let Vr=this._layers[kr];Vr.type==="symbol"&&this.placement.updateLayerOpacities(Vr,tr[Vr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.now())}_releaseSymbolFadeTiles(){for(let O in this.sourceCaches)this.sourceCaches[O].releaseSymbolFadeTiles()}getImages(O,pe){return n._(this,void 0,void 0,function*(){let Ie=yield this.imageManager.getImages(pe.icons);this._updateTilesForChangedImages();let Fe=this.sourceCaches[pe.source];return Fe&&Fe.setDependencies(pe.tileID.key,pe.type,pe.icons),Ie})}getGlyphs(O,pe){return n._(this,void 0,void 0,function*(){let Ie=yield this.glyphManager.getGlyphs(pe.stacks),Fe=this.sourceCaches[pe.source];return Fe&&Fe.setDependencies(pe.tileID.key,pe.type,[""]),Ie})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(O,pe={}){this._checkLoaded(),O&&this._validate(n.u.glyphs,"glyphs",O,null,pe)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=O,this.glyphManager.entries={},this.glyphManager.setURL(O))}addSprite(O,pe,Ie={},Fe){this._checkLoaded();let qe=[{id:O,url:pe}],Mt=[...M(this.stylesheet.sprite),...qe];this._validate(n.u.sprite,"sprite",Mt,null,Ie)||(this.stylesheet.sprite=Mt,this._loadSprite(qe,!0,Fe))}removeSprite(O){this._checkLoaded();let pe=M(this.stylesheet.sprite);if(pe.find(Ie=>Ie.id===O)){if(this._spritesImagesIds[O])for(let Ie of this._spritesImagesIds[O])this.imageManager.removeImage(Ie),this._changedImages[Ie]=!0;pe.splice(pe.findIndex(Ie=>Ie.id===O),1),this.stylesheet.sprite=pe.length>0?pe:void 0,delete this._spritesImagesIds[O],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.k("data",{dataType:"style"}))}else this.fire(new n.j(new Error(`Sprite "${O}" doesn't exists on this map.`)))}getSprite(){return M(this.stylesheet.sprite)}setSprite(O,pe={},Ie){this._checkLoaded(),O&&this._validate(n.u.sprite,"sprite",O,null,pe)||(this.stylesheet.sprite=O,O?this._loadSprite(O,!0,Ie):(this._unloadSprite(),Ie&&Ie(null)))}}var Pi=n.Y([{name:"a_pos",type:"Int16",components:2}]);let xi={prelude:zt(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -3868,58 +3868,58 @@ void main() { #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : -u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:zt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:zt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:zt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:zt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function zt(Ke,O){let pe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Ie=O.match(/attribute ([\w]+) ([\w]+)/g),Ne=Ke.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),qe=O.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Mt=qe?qe.concat(Ne):Ne,jt={};return{fragmentSource:Ke=Ke.replace(pe,(er,kr,Hr,Vr,ki)=>(jt[ki]=!0,kr==="define"?` -#ifndef HAS_UNIFORM_u_${ki} -varying ${Hr} ${Vr} ${ki}; +u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:zt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:zt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:zt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:zt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function zt(Ke,O){let pe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Ie=O.match(/attribute ([\w]+) ([\w]+)/g),Fe=Ke.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),qe=O.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Mt=qe?qe.concat(Fe):Fe,jt={};return{fragmentSource:Ke=Ke.replace(pe,(tr,kr,Vr,Wr,Ti)=>(jt[Ti]=!0,kr==="define"?` +#ifndef HAS_UNIFORM_u_${Ti} +varying ${Vr} ${Wr} ${Ti}; #else -uniform ${Hr} ${Vr} u_${ki}; +uniform ${Vr} ${Wr} u_${Ti}; #endif `:` -#ifdef HAS_UNIFORM_u_${ki} - ${Hr} ${Vr} ${ki} = u_${ki}; +#ifdef HAS_UNIFORM_u_${Ti} + ${Vr} ${Wr} ${Ti} = u_${Ti}; #endif -`)),vertexSource:O=O.replace(pe,(er,kr,Hr,Vr,ki)=>{let Vi=Vr==="float"?"vec2":"vec4",tt=ki.match(/color/)?"color":Vi;return jt[ki]?kr==="define"?` -#ifndef HAS_UNIFORM_u_${ki} -uniform lowp float u_${ki}_t; -attribute ${Hr} ${Vi} a_${ki}; -varying ${Hr} ${Vr} ${ki}; +`)),vertexSource:O=O.replace(pe,(tr,kr,Vr,Wr,Ti)=>{let Vi=Wr==="float"?"vec2":"vec4",et=Ti.match(/color/)?"color":Vi;return jt[Ti]?kr==="define"?` +#ifndef HAS_UNIFORM_u_${Ti} +uniform lowp float u_${Ti}_t; +attribute ${Vr} ${Vi} a_${Ti}; +varying ${Vr} ${Wr} ${Ti}; #else -uniform ${Hr} ${Vr} u_${ki}; +uniform ${Vr} ${Wr} u_${Ti}; #endif -`:tt==="vec4"?` -#ifndef HAS_UNIFORM_u_${ki} - ${ki} = a_${ki}; +`:et==="vec4"?` +#ifndef HAS_UNIFORM_u_${Ti} + ${Ti} = a_${Ti}; #else - ${Hr} ${Vr} ${ki} = u_${ki}; + ${Vr} ${Wr} ${Ti} = u_${Ti}; #endif `:` -#ifndef HAS_UNIFORM_u_${ki} - ${ki} = unpack_mix_${tt}(a_${ki}, u_${ki}_t); +#ifndef HAS_UNIFORM_u_${Ti} + ${Ti} = unpack_mix_${et}(a_${Ti}, u_${Ti}_t); #else - ${Hr} ${Vr} ${ki} = u_${ki}; + ${Vr} ${Wr} ${Ti} = u_${Ti}; #endif `:kr==="define"?` -#ifndef HAS_UNIFORM_u_${ki} -uniform lowp float u_${ki}_t; -attribute ${Hr} ${Vi} a_${ki}; +#ifndef HAS_UNIFORM_u_${Ti} +uniform lowp float u_${Ti}_t; +attribute ${Vr} ${Vi} a_${Ti}; #else -uniform ${Hr} ${Vr} u_${ki}; +uniform ${Vr} ${Wr} u_${Ti}; #endif -`:tt==="vec4"?` -#ifndef HAS_UNIFORM_u_${ki} - ${Hr} ${Vr} ${ki} = a_${ki}; +`:et==="vec4"?` +#ifndef HAS_UNIFORM_u_${Ti} + ${Vr} ${Wr} ${Ti} = a_${Ti}; #else - ${Hr} ${Vr} ${ki} = u_${ki}; + ${Vr} ${Wr} ${Ti} = u_${Ti}; #endif `:` -#ifndef HAS_UNIFORM_u_${ki} - ${Hr} ${Vr} ${ki} = unpack_mix_${tt}(a_${ki}, u_${ki}_t); +#ifndef HAS_UNIFORM_u_${Ti} + ${Vr} ${Wr} ${Ti} = unpack_mix_${et}(a_${Ti}, u_${Ti}_t); #else - ${Hr} ${Vr} ${ki} = u_${ki}; + ${Vr} ${Wr} ${Ti} = u_${Ti}; #endif -`}),staticAttributes:Ie,staticUniforms:Mt}}class xr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(O,pe,Ie,Ne,qe,Mt,jt,er,kr){this.context=O;let Hr=this.boundPaintVertexBuffers.length!==Ne.length;for(let Vr=0;!Hr&&Vr({u_matrix:Ke,u_texture:0,u_ele_delta:O,u_fog_matrix:pe,u_fog_color:Ie?Ie.properties.get("fog-color"):n.aM.white,u_fog_ground_blend:Ie?Ie.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Ie?Ie.calculateFogBlendOpacity(Ne):0,u_horizon_color:Ie?Ie.properties.get("horizon-color"):n.aM.white,u_horizon_fog_blend:Ie?Ie.properties.get("horizon-fog-blend"):1});function Ri(Ke){let O=[];for(let pe=0;pe({u_depth:new n.aH($r,Zr.u_depth),u_terrain:new n.aH($r,Zr.u_terrain),u_terrain_dim:new n.aI($r,Zr.u_terrain_dim),u_terrain_matrix:new n.aJ($r,Zr.u_terrain_matrix),u_terrain_unpack:new n.aK($r,Zr.u_terrain_unpack),u_terrain_exaggeration:new n.aI($r,Zr.u_terrain_exaggeration)}))(O,Lr),this.binderUniforms=Ie?Ie.getUniforms(O,Lr):[]}draw(O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi,tt,lt,Tt,Lt,Vt){let Nt=O.gl;if(this.failedToCreate)return;if(O.program.set(this.program),O.setDepthMode(Ie),O.setStencilMode(Ne),O.setColorMode(qe),O.setCullFace(Mt),er){O.activeTexture.set(Nt.TEXTURE2),Nt.bindTexture(Nt.TEXTURE_2D,er.depthTexture),O.activeTexture.set(Nt.TEXTURE3),Nt.bindTexture(Nt.TEXTURE_2D,er.texture);for(let Lr in this.terrainUniforms)this.terrainUniforms[Lr].set(er[Lr])}for(let Lr in this.fixedUniforms)this.fixedUniforms[Lr].set(jt[Lr]);lt&<.setUniforms(O,this.binderUniforms,Vi,{zoom:tt});let Yt=0;switch(pe){case Nt.LINES:Yt=2;break;case Nt.TRIANGLES:Yt=3;break;case Nt.LINE_STRIP:Yt=1}for(let Lr of ki.get()){let $r=Lr.vaos||(Lr.vaos={});($r[kr]||($r[kr]=new xr)).bind(O,this,Hr,lt?lt.getPaintVertexBuffers():[],Vr,Lr.vertexOffset,Tt,Lt,Vt),Nt.drawElements(pe,Lr.primitiveLength*Yt,Nt.UNSIGNED_SHORT,Lr.primitiveOffset*Yt*2)}}}function _n(Ke,O,pe){let Ie=1/cn(pe,1,O.transform.tileZoom),Ne=Math.pow(2,pe.tileID.overscaledZ),qe=pe.tileSize*Math.pow(2,O.transform.tileZoom)/Ne,Mt=qe*(pe.tileID.canonical.x+pe.tileID.wrap*Ne),jt=qe*pe.tileID.canonical.y;return{u_image:0,u_texsize:pe.imageAtlasTexture.size,u_scale:[Ie,Ke.fromScale,Ke.toScale],u_fade:Ke.t,u_pixel_coord_upper:[Mt>>16,jt>>16],u_pixel_coord_lower:[65535&Mt,65535&jt]}}let Zi=(Ke,O,pe,Ie)=>{let Ne=O.style.light,qe=Ne.properties.get("position"),Mt=[qe.x,qe.y,qe.z],jt=function(){var kr=new n.A(9);return n.A!=Float32Array&&(kr[1]=0,kr[2]=0,kr[3]=0,kr[5]=0,kr[6]=0,kr[7]=0),kr[0]=1,kr[4]=1,kr[8]=1,kr}();Ne.properties.get("anchor")==="viewport"&&function(kr,Hr){var Vr=Math.sin(Hr),ki=Math.cos(Hr);kr[0]=ki,kr[1]=Vr,kr[2]=0,kr[3]=-Vr,kr[4]=ki,kr[5]=0,kr[6]=0,kr[7]=0,kr[8]=1}(jt,-O.transform.angle),function(kr,Hr,Vr){var ki=Hr[0],Vi=Hr[1],tt=Hr[2];kr[0]=ki*Vr[0]+Vi*Vr[3]+tt*Vr[6],kr[1]=ki*Vr[1]+Vi*Vr[4]+tt*Vr[7],kr[2]=ki*Vr[2]+Vi*Vr[5]+tt*Vr[8]}(Mt,Mt,jt);let er=Ne.properties.get("color");return{u_matrix:Ke,u_lightpos:Mt,u_lightintensity:Ne.properties.get("intensity"),u_lightcolor:[er.r,er.g,er.b],u_vertical_gradient:+pe,u_opacity:Ie}},Wi=(Ke,O,pe,Ie,Ne,qe,Mt)=>n.e(Zi(Ke,O,pe,Ie),_n(qe,O,Mt),{u_height_factor:-Math.pow(2,Ne.overscaledZ)/Mt.tileSize/8}),dn=Ke=>({u_matrix:Ke}),Ua=(Ke,O,pe,Ie)=>n.e(dn(Ke),_n(pe,O,Ie)),ea=(Ke,O)=>({u_matrix:Ke,u_world:O}),fo=(Ke,O,pe,Ie,Ne)=>n.e(Ua(Ke,O,pe,Ie),{u_world:Ne}),ho=(Ke,O,pe,Ie)=>{let Ne=Ke.transform,qe,Mt;if(Ie.paint.get("circle-pitch-alignment")==="map"){let jt=cn(pe,1,Ne.zoom);qe=!0,Mt=[jt,jt]}else qe=!1,Mt=Ne.pixelsToGLUnits;return{u_camera_to_center_distance:Ne.cameraToCenterDistance,u_scale_with_map:+(Ie.paint.get("circle-pitch-scale")==="map"),u_matrix:Ke.translatePosMatrix(O.posMatrix,pe,Ie.paint.get("circle-translate"),Ie.paint.get("circle-translate-anchor")),u_pitch_with_map:+qe,u_device_pixel_ratio:Ke.pixelRatio,u_extrude_scale:Mt}},Vo=(Ke,O,pe)=>({u_matrix:Ke,u_inv_matrix:O,u_camera_to_center_distance:pe.cameraToCenterDistance,u_viewport_size:[pe.width,pe.height]}),Ao=(Ke,O,pe=1)=>({u_matrix:Ke,u_color:O,u_overlay:0,u_overlay_scale:pe}),Wo=Ke=>({u_matrix:Ke}),Wa=(Ke,O,pe,Ie)=>({u_matrix:Ke,u_extrude_scale:cn(O,1,pe),u_intensity:Ie}),ks=(Ke,O,pe,Ie)=>{let Ne=n.H();n.aP(Ne,0,Ke.width,Ke.height,0,0,1);let qe=Ke.context.gl;return{u_matrix:Ne,u_world:[qe.drawingBufferWidth,qe.drawingBufferHeight],u_image:pe,u_color_ramp:Ie,u_opacity:O.paint.get("heatmap-opacity")}};function fs(Ke,O){let pe=Math.pow(2,O.canonical.z),Ie=O.canonical.y;return[new n.Z(0,Ie/pe).toLngLat().lat,new n.Z(0,(Ie+1)/pe).toLngLat().lat]}let _l=(Ke,O,pe,Ie)=>{let Ne=Ke.transform;return{u_matrix:ol(Ke,O,pe,Ie),u_ratio:1/cn(O,1,Ne.zoom),u_device_pixel_ratio:Ke.pixelRatio,u_units_to_pixels:[1/Ne.pixelsToGLUnits[0],1/Ne.pixelsToGLUnits[1]]}},es=(Ke,O,pe,Ie,Ne)=>n.e(_l(Ke,O,pe,Ne),{u_image:0,u_image_height:Ie}),rl=(Ke,O,pe,Ie,Ne)=>{let qe=Ke.transform,Mt=xl(O,qe);return{u_matrix:ol(Ke,O,pe,Ne),u_texsize:O.imageAtlasTexture.size,u_ratio:1/cn(O,1,qe.zoom),u_device_pixel_ratio:Ke.pixelRatio,u_image:0,u_scale:[Mt,Ie.fromScale,Ie.toScale],u_fade:Ie.t,u_units_to_pixels:[1/qe.pixelsToGLUnits[0],1/qe.pixelsToGLUnits[1]]}},ds=(Ke,O,pe,Ie,Ne,qe)=>{let Mt=Ke.lineAtlas,jt=xl(O,Ke.transform),er=pe.layout.get("line-cap")==="round",kr=Mt.getDash(Ie.from,er),Hr=Mt.getDash(Ie.to,er),Vr=kr.width*Ne.fromScale,ki=Hr.width*Ne.toScale;return n.e(_l(Ke,O,pe,qe),{u_patternscale_a:[jt/Vr,-kr.height/2],u_patternscale_b:[jt/ki,-Hr.height/2],u_sdfgamma:Mt.width/(256*Math.min(Vr,ki)*Ke.pixelRatio)/2,u_image:0,u_tex_y_a:kr.y,u_tex_y_b:Hr.y,u_mix:Ne.t})};function xl(Ke,O){return 1/cn(Ke,1,O.tileZoom)}function ol(Ke,O,pe,Ie){return Ke.translatePosMatrix(Ie?Ie.posMatrix:O.tileID.posMatrix,O,pe.paint.get("line-translate"),pe.paint.get("line-translate-anchor"))}let Gl=(Ke,O,pe,Ie,Ne)=>{return{u_matrix:Ke,u_tl_parent:O,u_scale_parent:pe,u_buffer_scale:1,u_fade_t:Ie.mix,u_opacity:Ie.opacity*Ne.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Ne.paint.get("raster-brightness-min"),u_brightness_high:Ne.paint.get("raster-brightness-max"),u_saturation_factor:(Mt=Ne.paint.get("raster-saturation"),Mt>0?1-1/(1.001-Mt):-Mt),u_contrast_factor:(qe=Ne.paint.get("raster-contrast"),qe>0?1/(1-qe):1+qe),u_spin_weights:ms(Ne.paint.get("raster-hue-rotate"))};var qe,Mt};function ms(Ke){Ke*=Math.PI/180;let O=Math.sin(Ke),pe=Math.cos(Ke);return[(2*pe+1)/3,(-Math.sqrt(3)*O-pe+1)/3,(Math.sqrt(3)*O-pe+1)/3]}let Bs=(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi)=>{let tt=Mt.transform;return{u_is_size_zoom_constant:+(Ke==="constant"||Ke==="source"),u_is_size_feature_constant:+(Ke==="constant"||Ke==="camera"),u_size_t:O?O.uSizeT:0,u_size:O?O.uSize:0,u_camera_to_center_distance:tt.cameraToCenterDistance,u_pitch:tt.pitch/360*2*Math.PI,u_rotate_symbol:+pe,u_aspect_ratio:tt.width/tt.height,u_fade_change:Mt.options.fadeDuration?Mt.symbolFadeChange:1,u_matrix:jt,u_label_plane_matrix:er,u_coord_matrix:kr,u_is_text:+Vr,u_pitch_with_map:+Ie,u_is_along_line:Ne,u_is_variable_anchor:qe,u_texsize:ki,u_texture:0,u_translation:Hr,u_pitched_scale:Vi}},No=(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi,tt)=>{let lt=Mt.transform;return n.e(Bs(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,tt),{u_gamma_scale:Ie?Math.cos(lt._pitch)*lt.cameraToCenterDistance:1,u_device_pixel_ratio:Mt.pixelRatio,u_is_halo:1})},Es=(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,Vr,ki,Vi)=>n.e(No(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr,Hr,!0,Vr,!0,Vi),{u_texsize_icon:ki,u_texture_icon:1}),Il=(Ke,O,pe)=>({u_matrix:Ke,u_opacity:O,u_color:pe}),Jl=(Ke,O,pe,Ie,Ne,qe)=>n.e(function(Mt,jt,er,kr){let Hr=er.imageManager.getPattern(Mt.from.toString()),Vr=er.imageManager.getPattern(Mt.to.toString()),{width:ki,height:Vi}=er.imageManager.getPixelSize(),tt=Math.pow(2,kr.tileID.overscaledZ),lt=kr.tileSize*Math.pow(2,er.transform.tileZoom)/tt,Tt=lt*(kr.tileID.canonical.x+kr.tileID.wrap*tt),Lt=lt*kr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Hr.tl,u_pattern_br_a:Hr.br,u_pattern_tl_b:Vr.tl,u_pattern_br_b:Vr.br,u_texsize:[ki,Vi],u_mix:jt.t,u_pattern_size_a:Hr.displaySize,u_pattern_size_b:Vr.displaySize,u_scale_a:jt.fromScale,u_scale_b:jt.toScale,u_tile_units_to_pixels:1/cn(kr,1,er.transform.tileZoom),u_pixel_coord_upper:[Tt>>16,Lt>>16],u_pixel_coord_lower:[65535&Tt,65535&Lt]}}(Ie,qe,pe,Ne),{u_matrix:Ke,u_opacity:O}),ou={fillExtrusion:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_lightpos:new n.aN(Ke,O.u_lightpos),u_lightintensity:new n.aI(Ke,O.u_lightintensity),u_lightcolor:new n.aN(Ke,O.u_lightcolor),u_vertical_gradient:new n.aI(Ke,O.u_vertical_gradient),u_opacity:new n.aI(Ke,O.u_opacity)}),fillExtrusionPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_lightpos:new n.aN(Ke,O.u_lightpos),u_lightintensity:new n.aI(Ke,O.u_lightintensity),u_lightcolor:new n.aN(Ke,O.u_lightcolor),u_vertical_gradient:new n.aI(Ke,O.u_vertical_gradient),u_height_factor:new n.aI(Ke,O.u_height_factor),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade),u_opacity:new n.aI(Ke,O.u_opacity)}),fill:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix)}),fillPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),fillOutline:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world)}),fillOutlinePattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),circle:(Ke,O)=>({u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_scale_with_map:new n.aH(Ke,O.u_scale_with_map),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_extrude_scale:new n.aO(Ke,O.u_extrude_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_matrix:new n.aJ(Ke,O.u_matrix)}),collisionBox:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_pixel_extrude_scale:new n.aO(Ke,O.u_pixel_extrude_scale)}),collisionCircle:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_inv_matrix:new n.aJ(Ke,O.u_inv_matrix),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_viewport_size:new n.aO(Ke,O.u_viewport_size)}),debug:(Ke,O)=>({u_color:new n.aL(Ke,O.u_color),u_matrix:new n.aJ(Ke,O.u_matrix),u_overlay:new n.aH(Ke,O.u_overlay),u_overlay_scale:new n.aI(Ke,O.u_overlay_scale)}),clippingMask:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix)}),heatmap:(Ke,O)=>({u_extrude_scale:new n.aI(Ke,O.u_extrude_scale),u_intensity:new n.aI(Ke,O.u_intensity),u_matrix:new n.aJ(Ke,O.u_matrix)}),heatmapTexture:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world),u_image:new n.aH(Ke,O.u_image),u_color_ramp:new n.aH(Ke,O.u_color_ramp),u_opacity:new n.aI(Ke,O.u_opacity)}),hillshade:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_latrange:new n.aO(Ke,O.u_latrange),u_light:new n.aO(Ke,O.u_light),u_shadow:new n.aL(Ke,O.u_shadow),u_highlight:new n.aL(Ke,O.u_highlight),u_accent:new n.aL(Ke,O.u_accent)}),hillshadePrepare:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_dimension:new n.aO(Ke,O.u_dimension),u_zoom:new n.aI(Ke,O.u_zoom),u_unpack:new n.aK(Ke,O.u_unpack)}),line:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels)}),lineGradient:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_image:new n.aH(Ke,O.u_image),u_image_height:new n.aI(Ke,O.u_image_height)}),linePattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texsize:new n.aO(Ke,O.u_texsize),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_image:new n.aH(Ke,O.u_image),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),lineSDF:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_patternscale_a:new n.aO(Ke,O.u_patternscale_a),u_patternscale_b:new n.aO(Ke,O.u_patternscale_b),u_sdfgamma:new n.aI(Ke,O.u_sdfgamma),u_image:new n.aH(Ke,O.u_image),u_tex_y_a:new n.aI(Ke,O.u_tex_y_a),u_tex_y_b:new n.aI(Ke,O.u_tex_y_b),u_mix:new n.aI(Ke,O.u_mix)}),raster:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_tl_parent:new n.aO(Ke,O.u_tl_parent),u_scale_parent:new n.aI(Ke,O.u_scale_parent),u_buffer_scale:new n.aI(Ke,O.u_buffer_scale),u_fade_t:new n.aI(Ke,O.u_fade_t),u_opacity:new n.aI(Ke,O.u_opacity),u_image0:new n.aH(Ke,O.u_image0),u_image1:new n.aH(Ke,O.u_image1),u_brightness_low:new n.aI(Ke,O.u_brightness_low),u_brightness_high:new n.aI(Ke,O.u_brightness_high),u_saturation_factor:new n.aI(Ke,O.u_saturation_factor),u_contrast_factor:new n.aI(Ke,O.u_contrast_factor),u_spin_weights:new n.aN(Ke,O.u_spin_weights)}),symbolIcon:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texture:new n.aH(Ke,O.u_texture),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),symbolSDF:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texture:new n.aH(Ke,O.u_texture),u_gamma_scale:new n.aI(Ke,O.u_gamma_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_is_halo:new n.aH(Ke,O.u_is_halo),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),symbolTextAndIcon:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texsize_icon:new n.aO(Ke,O.u_texsize_icon),u_texture:new n.aH(Ke,O.u_texture),u_texture_icon:new n.aH(Ke,O.u_texture_icon),u_gamma_scale:new n.aI(Ke,O.u_gamma_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_is_halo:new n.aH(Ke,O.u_is_halo),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),background:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_opacity:new n.aI(Ke,O.u_opacity),u_color:new n.aL(Ke,O.u_color)}),backgroundPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_opacity:new n.aI(Ke,O.u_opacity),u_image:new n.aH(Ke,O.u_image),u_pattern_tl_a:new n.aO(Ke,O.u_pattern_tl_a),u_pattern_br_a:new n.aO(Ke,O.u_pattern_br_a),u_pattern_tl_b:new n.aO(Ke,O.u_pattern_tl_b),u_pattern_br_b:new n.aO(Ke,O.u_pattern_br_b),u_texsize:new n.aO(Ke,O.u_texsize),u_mix:new n.aI(Ke,O.u_mix),u_pattern_size_a:new n.aO(Ke,O.u_pattern_size_a),u_pattern_size_b:new n.aO(Ke,O.u_pattern_size_b),u_scale_a:new n.aI(Ke,O.u_scale_a),u_scale_b:new n.aI(Ke,O.u_scale_b),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_tile_units_to_pixels:new n.aI(Ke,O.u_tile_units_to_pixels)}),terrain:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texture:new n.aH(Ke,O.u_texture),u_ele_delta:new n.aI(Ke,O.u_ele_delta),u_fog_matrix:new n.aJ(Ke,O.u_fog_matrix),u_fog_color:new n.aL(Ke,O.u_fog_color),u_fog_ground_blend:new n.aI(Ke,O.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.aI(Ke,O.u_fog_ground_blend_opacity),u_horizon_color:new n.aL(Ke,O.u_horizon_color),u_horizon_fog_blend:new n.aI(Ke,O.u_horizon_fog_blend)}),terrainDepth:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ele_delta:new n.aI(Ke,O.u_ele_delta)}),terrainCoords:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texture:new n.aH(Ke,O.u_texture),u_terrain_coords_id:new n.aI(Ke,O.u_terrain_coords_id),u_ele_delta:new n.aI(Ke,O.u_ele_delta)}),sky:(Ke,O)=>({u_sky_color:new n.aL(Ke,O.u_sky_color),u_horizon_color:new n.aL(Ke,O.u_horizon_color),u_horizon:new n.aI(Ke,O.u_horizon),u_sky_horizon_blend:new n.aI(Ke,O.u_sky_horizon_blend)})};class Gs{constructor(O,pe,Ie){this.context=O;let Ne=O.gl;this.buffer=Ne.createBuffer(),this.dynamicDraw=!!Ie,this.context.unbindVAO(),O.bindElementBuffer.set(this.buffer),Ne.bufferData(Ne.ELEMENT_ARRAY_BUFFER,pe.arrayBuffer,this.dynamicDraw?Ne.DYNAMIC_DRAW:Ne.STATIC_DRAW),this.dynamicDraw||delete pe.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(O){let pe=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),pe.bufferSubData(pe.ELEMENT_ARRAY_BUFFER,0,O.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let $a={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class So{constructor(O,pe,Ie,Ne){this.length=pe.length,this.attributes=Ie,this.itemSize=pe.bytesPerElement,this.dynamicDraw=Ne,this.context=O;let qe=O.gl;this.buffer=qe.createBuffer(),O.bindVertexBuffer.set(this.buffer),qe.bufferData(qe.ARRAY_BUFFER,pe.arrayBuffer,this.dynamicDraw?qe.DYNAMIC_DRAW:qe.STATIC_DRAW),this.dynamicDraw||delete pe.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(O){if(O.length!==this.length)throw new Error(`Length of new data is ${O.length}, which doesn't match current length of ${this.length}`);let pe=this.context.gl;this.bind(),pe.bufferSubData(pe.ARRAY_BUFFER,0,O.arrayBuffer)}enableAttributes(O,pe){for(let Ie=0;Ie0){let $r=n.H();n.aQ($r,Nt.placementInvProjMatrix,Ke.transform.glCoordMatrix),n.aQ($r,$r,Nt.placementViewportMatrix),er.push({circleArray:Lr,circleOffset:Hr,transform:Vt.posMatrix,invTransform:$r,coord:Vt}),kr+=Lr.length/4,Hr=kr}Yt&&jt.draw(qe,Mt.LINES,sl.disabled,jl.disabled,Ke.colorModeForRenderPass(),os.disabled,{u_matrix:Vt.posMatrix,u_pixel_extrude_scale:[1/(Vr=Ke.transform).width,1/Vr.height]},Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(Vt),pe.id,Yt.layoutVertexBuffer,Yt.indexBuffer,Yt.segments,null,Ke.transform.zoom,null,null,Yt.collisionVertexBuffer)}var Vr;if(!Ne||!er.length)return;let ki=Ke.useProgram("collisionCircle"),Vi=new n.aR;Vi.resize(4*kr),Vi._trim();let tt=0;for(let Lt of er)for(let Vt=0;Vt=0&&(Lt[Nt.associatedIconIndex]={shiftedAnchor:xo,angle:Go})}else Dr(Nt.numGlyphs,lt)}if(kr){Tt.clear();let Vt=Ke.icon.placedSymbolArray;for(let Nt=0;NtKe.style.map.terrain.getElevation(nn,Qi,ta):null,Yi=pe.layout.get("text-rotation-alignment")==="map";De(Jn,nn.posMatrix,Ke,Ne,wc,Me,Lt,kr,Yi,lt,nn.toUnwrapped(),tt.width,tt.height,Ve,Bi)}let Bt=nn.posMatrix,Ht=Ne&&di||Pt,fr=Vt||Ht?hc:wc,cr=ih,Or=Ba&&pe.paint.get(Ne?"text-halo-width":"icon-halo-width").constantOr(1)!==0,pi;pi=Ba?Jn.iconsInText?Es(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,fr,cr,Ve,Al,Tu,Ki):No(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,fr,cr,Ve,Ne,Al,!0,Ki):Bs(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,fr,cr,Ve,Ne,Al,Ki);let ci={program:Bo,buffers:Sa,uniformValues:pi,atlasTexture:Us,atlasTextureIcon:Js,atlasInterpolation:Pl,atlasInterpolationIcon:Ru,isSDF:Ba,hasHalo:Or};if(Lr&&Jn.canOverlap){$r=!0;let Bi=Sa.segments.get();for(let Yi of Bi)zi.push({segments:new n.a0([Yi]),sortKey:Yi.sortKey,state:ci,terrainData:wl})}else zi.push({segments:Sa.segments,sortKey:0,state:ci,terrainData:wl})}$r&&zi.sort((nn,kn)=>nn.sortKey-kn.sortKey);for(let nn of zi){let kn=nn.state;if(ki.activeTexture.set(Vi.TEXTURE0),kn.atlasTexture.bind(kn.atlasInterpolation,Vi.CLAMP_TO_EDGE),kn.atlasTextureIcon&&(ki.activeTexture.set(Vi.TEXTURE1),kn.atlasTextureIcon&&kn.atlasTextureIcon.bind(kn.atlasInterpolationIcon,Vi.CLAMP_TO_EDGE)),kn.isSDF){let Jn=kn.uniformValues;kn.hasHalo&&(Jn.u_is_halo=1,cd(kn.buffers,nn.segments,pe,Ke,kn.program,Zr,Hr,Vr,Jn,nn.terrainData)),Jn.u_is_halo=0}cd(kn.buffers,nn.segments,pe,Ke,kn.program,Zr,Hr,Vr,kn.uniformValues,nn.terrainData)}}function cd(Ke,O,pe,Ie,Ne,qe,Mt,jt,er,kr){let Hr=Ie.context;Ne.draw(Hr,Hr.gl.TRIANGLES,qe,Mt,jt,os.disabled,er,kr,pe.id,Ke.layoutVertexBuffer,Ke.indexBuffer,O,pe.paint,Ie.transform.zoom,Ke.programConfigurations.get(pe.id),Ke.dynamicLayoutVertexBuffer,Ke.opacityVertexBuffer)}function Lf(Ke,O,pe,Ie){let Ne=Ke.context,qe=Ne.gl,Mt=jl.disabled,jt=new Mu([qe.ONE,qe.ONE],n.aM.transparent,[!0,!0,!0,!0]),er=O.getBucket(pe);if(!er)return;let kr=Ie.key,Hr=pe.heatmapFbos.get(kr);Hr||(Hr=rd(Ne,O.tileSize,O.tileSize),pe.heatmapFbos.set(kr,Hr)),Ne.bindFramebuffer.set(Hr.framebuffer),Ne.viewport.set([0,0,O.tileSize,O.tileSize]),Ne.clear({color:n.aM.transparent});let Vr=er.programConfigurations.get(pe.id),ki=Ke.useProgram("heatmap",Vr),Vi=Ke.style.map.terrain.getTerrainData(Ie);ki.draw(Ne,qe.TRIANGLES,sl.disabled,Mt,jt,os.disabled,Wa(Ie.posMatrix,O,Ke.transform.zoom,pe.paint.get("heatmap-intensity")),Vi,pe.id,er.layoutVertexBuffer,er.indexBuffer,er.segments,pe.paint,Ke.transform.zoom,Vr)}function ef(Ke,O,pe){let Ie=Ke.context,Ne=Ie.gl;Ie.setColorMode(Ke.colorModeForRenderPass());let qe=id(Ie,O),Mt=pe.key,jt=O.heatmapFbos.get(Mt);jt&&(Ie.activeTexture.set(Ne.TEXTURE0),Ne.bindTexture(Ne.TEXTURE_2D,jt.colorAttachment.get()),Ie.activeTexture.set(Ne.TEXTURE1),qe.bind(Ne.LINEAR,Ne.CLAMP_TO_EDGE),Ke.useProgram("heatmapTexture").draw(Ie,Ne.TRIANGLES,sl.disabled,jl.disabled,Ke.colorModeForRenderPass(),os.disabled,ks(Ke,O,0,1),null,O.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments,O.paint,Ke.transform.zoom),jt.destroy(),O.heatmapFbos.delete(Mt))}function rd(Ke,O,pe){var Ie,Ne;let qe=Ke.gl,Mt=qe.createTexture();qe.bindTexture(qe.TEXTURE_2D,Mt),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,qe.LINEAR),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,qe.LINEAR);let jt=(Ie=Ke.HALF_FLOAT)!==null&&Ie!==void 0?Ie:qe.UNSIGNED_BYTE,er=(Ne=Ke.RGBA16F)!==null&&Ne!==void 0?Ne:qe.RGBA;qe.texImage2D(qe.TEXTURE_2D,0,er,O,pe,0,qe.RGBA,jt,null);let kr=Ke.createFramebuffer(O,pe,!1,!1);return kr.colorAttachment.set(Mt),kr}function id(Ke,O){return O.colorRampTexture||(O.colorRampTexture=new g(Ke,O.colorRamp,Ke.gl.RGBA)),O.colorRampTexture}function _h(Ke,O,pe,Ie,Ne){if(!pe||!Ie||!Ie.imageAtlas)return;let qe=Ie.imageAtlas.patternPositions,Mt=qe[pe.to.toString()],jt=qe[pe.from.toString()];if(!Mt&&jt&&(Mt=jt),!jt&&Mt&&(jt=Mt),!Mt||!jt){let er=Ne.getPaintProperty(O);Mt=qe[er],jt=qe[er]}Mt&&jt&&Ke.setConstantPatternPositions(Mt,jt)}function hd(Ke,O,pe,Ie,Ne,qe,Mt){let jt=Ke.context.gl,er="fill-pattern",kr=pe.paint.get(er),Hr=kr&&kr.constantOr(1),Vr=pe.getCrossfadeParameters(),ki,Vi,tt,lt,Tt;Mt?(Vi=Hr&&!pe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ki=jt.LINES):(Vi=Hr?"fillPattern":"fill",ki=jt.TRIANGLES);let Lt=kr.constantOr(null);for(let Vt of Ie){let Nt=O.getTile(Vt);if(Hr&&!Nt.patternsLoaded())continue;let Yt=Nt.getBucket(pe);if(!Yt)continue;let Lr=Yt.programConfigurations.get(pe.id),$r=Ke.useProgram(Vi,Lr),Zr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(Vt);Hr&&(Ke.context.activeTexture.set(jt.TEXTURE0),Nt.imageAtlasTexture.bind(jt.LINEAR,jt.CLAMP_TO_EDGE),Lr.updatePaintBuffers(Vr)),_h(Lr,er,Lt,Nt,pe);let di=Zr?Vt:null,zi=Ke.translatePosMatrix(di?di.posMatrix:Vt.posMatrix,Nt,pe.paint.get("fill-translate"),pe.paint.get("fill-translate-anchor"));if(Mt){lt=Yt.indexBuffer2,Tt=Yt.segments2;let Ki=[jt.drawingBufferWidth,jt.drawingBufferHeight];tt=Vi==="fillOutlinePattern"&&Hr?fo(zi,Ke,Vr,Nt,Ki):ea(zi,Ki)}else lt=Yt.indexBuffer,Tt=Yt.segments,tt=Hr?Ua(zi,Ke,Vr,Nt):dn(zi);$r.draw(Ke.context,ki,Ne,Ke.stencilModeForClipping(Vt),qe,os.disabled,tt,Zr,pe.id,Yt.layoutVertexBuffer,lt,Tt,pe.paint,Ke.transform.zoom,Lr)}}function Nh(Ke,O,pe,Ie,Ne,qe,Mt){let jt=Ke.context,er=jt.gl,kr="fill-extrusion-pattern",Hr=pe.paint.get(kr),Vr=Hr.constantOr(1),ki=pe.getCrossfadeParameters(),Vi=pe.paint.get("fill-extrusion-opacity"),tt=Hr.constantOr(null);for(let lt of Ie){let Tt=O.getTile(lt),Lt=Tt.getBucket(pe);if(!Lt)continue;let Vt=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(lt),Nt=Lt.programConfigurations.get(pe.id),Yt=Ke.useProgram(Vr?"fillExtrusionPattern":"fillExtrusion",Nt);Vr&&(Ke.context.activeTexture.set(er.TEXTURE0),Tt.imageAtlasTexture.bind(er.LINEAR,er.CLAMP_TO_EDGE),Nt.updatePaintBuffers(ki)),_h(Nt,kr,tt,Tt,pe);let Lr=Ke.translatePosMatrix(lt.posMatrix,Tt,pe.paint.get("fill-extrusion-translate"),pe.paint.get("fill-extrusion-translate-anchor")),$r=pe.paint.get("fill-extrusion-vertical-gradient"),Zr=Vr?Wi(Lr,Ke,$r,Vi,lt,ki,Tt):Zi(Lr,Ke,$r,Vi);Yt.draw(jt,jt.gl.TRIANGLES,Ne,qe,Mt,os.backCCW,Zr,Vt,pe.id,Lt.layoutVertexBuffer,Lt.indexBuffer,Lt.segments,pe.paint,Ke.transform.zoom,Nt,Ke.style.map.terrain&&Lt.centroidVertexBuffer)}}function Mh(Ke,O,pe,Ie,Ne,qe,Mt){let jt=Ke.context,er=jt.gl,kr=pe.fbo;if(!kr)return;let Hr=Ke.useProgram("hillshade"),Vr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(O);jt.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,kr.colorAttachment.get()),Hr.draw(jt,er.TRIANGLES,Ne,qe,Mt,os.disabled,((ki,Vi,tt,lt)=>{let Tt=tt.paint.get("hillshade-shadow-color"),Lt=tt.paint.get("hillshade-highlight-color"),Vt=tt.paint.get("hillshade-accent-color"),Nt=tt.paint.get("hillshade-illumination-direction")*(Math.PI/180);tt.paint.get("hillshade-illumination-anchor")==="viewport"&&(Nt-=ki.transform.angle);let Yt=!ki.options.moving;return{u_matrix:lt?lt.posMatrix:ki.transform.calculatePosMatrix(Vi.tileID.toUnwrapped(),Yt),u_image:0,u_latrange:fs(0,Vi.tileID),u_light:[tt.paint.get("hillshade-exaggeration"),Nt],u_shadow:Tt,u_highlight:Lt,u_accent:Vt}})(Ke,pe,Ie,Vr?O:null),Vr,Ie.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments)}function yc(Ke,O,pe,Ie,Ne,qe){let Mt=Ke.context,jt=Mt.gl,er=O.dem;if(er&&er.data){let kr=er.dim,Hr=er.stride,Vr=er.getPixels();if(Mt.activeTexture.set(jt.TEXTURE1),Mt.pixelStoreUnpackPremultiplyAlpha.set(!1),O.demTexture=O.demTexture||Ke.getTileTexture(Hr),O.demTexture){let Vi=O.demTexture;Vi.update(Vr,{premultiply:!1}),Vi.bind(jt.NEAREST,jt.CLAMP_TO_EDGE)}else O.demTexture=new g(Mt,Vr,jt.RGBA,{premultiply:!1}),O.demTexture.bind(jt.NEAREST,jt.CLAMP_TO_EDGE);Mt.activeTexture.set(jt.TEXTURE0);let ki=O.fbo;if(!ki){let Vi=new g(Mt,{width:kr,height:kr,data:null},jt.RGBA);Vi.bind(jt.LINEAR,jt.CLAMP_TO_EDGE),ki=O.fbo=Mt.createFramebuffer(kr,kr,!0,!1),ki.colorAttachment.set(Vi.texture)}Mt.bindFramebuffer.set(ki.framebuffer),Mt.viewport.set([0,0,kr,kr]),Ke.useProgram("hillshadePrepare").draw(Mt,jt.TRIANGLES,Ie,Ne,qe,os.disabled,((Vi,tt)=>{let lt=tt.stride,Tt=n.H();return n.aP(Tt,0,n.X,-n.X,0,0,1),n.J(Tt,Tt,[0,-n.X,0]),{u_matrix:Tt,u_image:1,u_dimension:[lt,lt],u_zoom:Vi.overscaledZ,u_unpack:tt.getUnpackVector()}})(O.tileID,er),null,pe.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments),O.needsHillshadePrepare=!1}}function df(Ke,O,pe,Ie,Ne,qe){let Mt=Ie.paint.get("raster-fade-duration");if(!qe&&Mt>0){let jt=u.now(),er=(jt-Ke.timeAdded)/Mt,kr=O?(jt-O.timeAdded)/Mt:-1,Hr=pe.getSource(),Vr=Ne.coveringZoomLevel({tileSize:Hr.tileSize,roundZoom:Hr.roundZoom}),ki=!O||Math.abs(O.tileID.overscaledZ-Vr)>Math.abs(Ke.tileID.overscaledZ-Vr),Vi=ki&&Ke.refreshedUponExpiration?1:n.ac(ki?er:1-kr,0,1);return Ke.refreshedUponExpiration&&er>=1&&(Ke.refreshedUponExpiration=!1),O?{opacity:1,mix:1-Vi}:{opacity:Vi,mix:0}}return{opacity:1,mix:0}}let nd=new n.aM(1,0,0,1),uu=new n.aM(0,1,0,1),Nf=new n.aM(0,0,1,1),Xd=new n.aM(1,0,1,1),fd=new n.aM(0,1,1,1);function Pf(Ke,O,pe,Ie){Yc(Ke,0,O+pe/2,Ke.transform.width,pe,Ie)}function dd(Ke,O,pe,Ie){Yc(Ke,O-pe/2,0,pe,Ke.transform.height,Ie)}function Yc(Ke,O,pe,Ie,Ne,qe){let Mt=Ke.context,jt=Mt.gl;jt.enable(jt.SCISSOR_TEST),jt.scissor(O*Ke.pixelRatio,pe*Ke.pixelRatio,Ie*Ke.pixelRatio,Ne*Ke.pixelRatio),Mt.clear({color:qe}),jt.disable(jt.SCISSOR_TEST)}function pd(Ke,O,pe){let Ie=Ke.context,Ne=Ie.gl,qe=pe.posMatrix,Mt=Ke.useProgram("debug"),jt=sl.disabled,er=jl.disabled,kr=Ke.colorModeForRenderPass(),Hr="$debug",Vr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(pe);Ie.activeTexture.set(Ne.TEXTURE0);let ki=O.getTileByID(pe.key).latestRawTileData,Vi=Math.floor((ki&&ki.byteLength||0)/1024),tt=O.getTile(pe).tileSize,lt=512/Math.min(tt,512)*(pe.overscaledZ/Ke.transform.zoom)*.5,Tt=pe.canonical.toString();pe.overscaledZ!==pe.canonical.z&&(Tt+=` => ${pe.overscaledZ}`),function(Lt,Vt){Lt.initDebugOverlayCanvas();let Nt=Lt.debugOverlayCanvas,Yt=Lt.context.gl,Lr=Lt.debugOverlayCanvas.getContext("2d");Lr.clearRect(0,0,Nt.width,Nt.height),Lr.shadowColor="white",Lr.shadowBlur=2,Lr.lineWidth=1.5,Lr.strokeStyle="white",Lr.textBaseline="top",Lr.font="bold 36px Open Sans, sans-serif",Lr.fillText(Vt,5,5),Lr.strokeText(Vt,5,5),Lt.debugOverlayTexture.update(Nt),Lt.debugOverlayTexture.bind(Yt.LINEAR,Yt.CLAMP_TO_EDGE)}(Ke,`${Tt} ${Vi}kB`),Mt.draw(Ie,Ne.TRIANGLES,jt,er,Mu.alphaBlended,os.disabled,Ao(qe,n.aM.transparent,lt),null,Hr,Ke.debugBuffer,Ke.quadTriangleIndexBuffer,Ke.debugSegments),Mt.draw(Ie,Ne.LINE_STRIP,jt,er,kr,os.disabled,Ao(qe,n.aM.red),Vr,Hr,Ke.debugBuffer,Ke.tileBorderIndexBuffer,Ke.debugSegments)}function Vu(Ke,O,pe){let Ie=Ke.context,Ne=Ie.gl,qe=Ke.colorModeForRenderPass(),Mt=new sl(Ne.LEQUAL,sl.ReadWrite,Ke.depthRangeFor3D),jt=Ke.useProgram("terrain"),er=O.getTerrainMesh();Ie.bindFramebuffer.set(null),Ie.viewport.set([0,0,Ke.width,Ke.height]);for(let kr of pe){let Hr=Ke.renderToTexture.getTexture(kr),Vr=O.getTerrainData(kr.tileID);Ie.activeTexture.set(Ne.TEXTURE0),Ne.bindTexture(Ne.TEXTURE_2D,Hr.texture);let ki=Ke.transform.calculatePosMatrix(kr.tileID.toUnwrapped()),Vi=O.getMeshFrameDelta(Ke.transform.zoom),tt=Ke.transform.calculateFogMatrix(kr.tileID.toUnwrapped()),lt=Jr(ki,Vi,tt,Ke.style.sky,Ke.transform.pitch);jt.draw(Ie,Ne.TRIANGLES,Mt,jl.disabled,qe,os.backCCW,lt,Vr,"terrain",er.vertexBuffer,er.indexBuffer,er.segments)}}class Xc{constructor(O,pe,Ie){this.vertexBuffer=O,this.indexBuffer=pe,this.segments=Ie}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class tf{constructor(O,pe){this.context=new Yd(O),this.transform=pe,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Jt.maxUnderzooming+Jt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ni}resize(O,pe,Ie){if(this.width=Math.floor(O*Ie),this.height=Math.floor(pe*Ie),this.pixelRatio=Ie,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Ne of this.style._order)this.style._layers[Ne].resize()}setup(){let O=this.context,pe=new n.aX;pe.emplaceBack(0,0),pe.emplaceBack(n.X,0),pe.emplaceBack(0,n.X),pe.emplaceBack(n.X,n.X),this.tileExtentBuffer=O.createVertexBuffer(pe,Pi.members),this.tileExtentSegments=n.a0.simpleSegment(0,0,4,2);let Ie=new n.aX;Ie.emplaceBack(0,0),Ie.emplaceBack(n.X,0),Ie.emplaceBack(0,n.X),Ie.emplaceBack(n.X,n.X),this.debugBuffer=O.createVertexBuffer(Ie,Pi.members),this.debugSegments=n.a0.simpleSegment(0,0,4,5);let Ne=new n.$;Ne.emplaceBack(0,0,0,0),Ne.emplaceBack(n.X,0,n.X,0),Ne.emplaceBack(0,n.X,0,n.X),Ne.emplaceBack(n.X,n.X,n.X,n.X),this.rasterBoundsBuffer=O.createVertexBuffer(Ne,rt.members),this.rasterBoundsSegments=n.a0.simpleSegment(0,0,4,2);let qe=new n.aX;qe.emplaceBack(0,0),qe.emplaceBack(1,0),qe.emplaceBack(0,1),qe.emplaceBack(1,1),this.viewportBuffer=O.createVertexBuffer(qe,Pi.members),this.viewportSegments=n.a0.simpleSegment(0,0,4,2);let Mt=new n.aZ;Mt.emplaceBack(0),Mt.emplaceBack(1),Mt.emplaceBack(3),Mt.emplaceBack(2),Mt.emplaceBack(0),this.tileBorderIndexBuffer=O.createIndexBuffer(Mt);let jt=new n.aY;jt.emplaceBack(0,1,2),jt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=O.createIndexBuffer(jt);let er=this.context.gl;this.stencilClearMode=new jl({func:er.ALWAYS,mask:0},0,255,er.ZERO,er.ZERO,er.ZERO)}clearStencil(){let O=this.context,pe=O.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Ie=n.H();n.aP(Ie,0,this.width,this.height,0,0,1),n.K(Ie,Ie,[pe.drawingBufferWidth,pe.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(O,pe.TRIANGLES,sl.disabled,this.stencilClearMode,Mu.disabled,os.disabled,Wo(Ie),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(O,pe){if(this.currentStencilSource===O.source||!O.isTileClipped()||!pe||!pe.length)return;this.currentStencilSource=O.source;let Ie=this.context,Ne=Ie.gl;this.nextStencilID+pe.length>256&&this.clearStencil(),Ie.setColorMode(Mu.disabled),Ie.setDepthMode(sl.disabled);let qe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let Mt of pe){let jt=this._tileClippingMaskIDs[Mt.key]=this.nextStencilID++,er=this.style.map.terrain&&this.style.map.terrain.getTerrainData(Mt);qe.draw(Ie,Ne.TRIANGLES,sl.disabled,new jl({func:Ne.ALWAYS,mask:0},jt,255,Ne.KEEP,Ne.KEEP,Ne.REPLACE),Mu.disabled,os.disabled,Wo(Mt.posMatrix),er,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let O=this.nextStencilID++,pe=this.context.gl;return new jl({func:pe.NOTEQUAL,mask:255},O,255,pe.KEEP,pe.KEEP,pe.REPLACE)}stencilModeForClipping(O){let pe=this.context.gl;return new jl({func:pe.EQUAL,mask:255},this._tileClippingMaskIDs[O.key],0,pe.KEEP,pe.KEEP,pe.REPLACE)}stencilConfigForOverlap(O){let pe=this.context.gl,Ie=O.sort((Mt,jt)=>jt.overscaledZ-Mt.overscaledZ),Ne=Ie[Ie.length-1].overscaledZ,qe=Ie[0].overscaledZ-Ne+1;if(qe>1){this.currentStencilSource=void 0,this.nextStencilID+qe>256&&this.clearStencil();let Mt={};for(let jt=0;jt({u_sky_color:Lt.properties.get("sky-color"),u_horizon_color:Lt.properties.get("horizon-color"),u_horizon:(Vt.height/2+Vt.getHorizon())*Nt,u_sky_horizon_blend:Lt.properties.get("sky-horizon-blend")*Vt.height/2*Nt}))(kr,er.style.map.transform,er.pixelRatio),Vi=new sl(Vr.LEQUAL,sl.ReadWrite,[0,1]),tt=jl.disabled,lt=er.colorModeForRenderPass(),Tt=er.useProgram("sky");if(!kr.mesh){let Lt=new n.aX;Lt.emplaceBack(-1,-1),Lt.emplaceBack(1,-1),Lt.emplaceBack(1,1),Lt.emplaceBack(-1,1);let Vt=new n.aY;Vt.emplaceBack(0,1,2),Vt.emplaceBack(0,2,3),kr.mesh=new Xc(Hr.createVertexBuffer(Lt,Pi.members),Hr.createIndexBuffer(Vt),n.a0.simpleSegment(0,0,Lt.length,Vt.length))}Tt.draw(Hr,Vr.TRIANGLES,Vi,tt,lt,os.disabled,ki,void 0,"sky",kr.mesh.vertexBuffer,kr.mesh.indexBuffer,kr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=pe.showOverdrawInspector,this.depthRangeFor3D=[0,1-(O._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Ie.length-1;this.currentLayer>=0;this.currentLayer--){let er=this.style._layers[Ie[this.currentLayer]],kr=Ne[er.source],Hr=qe[er.source];this._renderTileClippingMasks(er,Hr),this.renderLayer(this,kr,er,Hr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerTt.source&&!Tt.isHidden(Hr)?[kr.sourceCaches[Tt.source]]:[]),Vi=ki.filter(Tt=>Tt.getSource().type==="vector"),tt=ki.filter(Tt=>Tt.getSource().type!=="vector"),lt=Tt=>{(!Vr||Vr.getSource().maxzoomlt(Tt)),Vr||tt.forEach(Tt=>lt(Tt)),Vr}(this.style,this.transform.zoom);er&&function(kr,Hr,Vr){for(let ki=0;ki0),Ne&&(n.b0(pe,Ie),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(qe,Mt){let jt=qe.context,er=jt.gl,kr=Mu.unblended,Hr=new sl(er.LEQUAL,sl.ReadWrite,[0,1]),Vr=Mt.getTerrainMesh(),ki=Mt.sourceCache.getRenderableTiles(),Vi=qe.useProgram("terrainDepth");jt.bindFramebuffer.set(Mt.getFramebuffer("depth").framebuffer),jt.viewport.set([0,0,qe.width/devicePixelRatio,qe.height/devicePixelRatio]),jt.clear({color:n.aM.transparent,depth:1});for(let tt of ki){let lt=Mt.getTerrainData(tt.tileID),Tt={u_matrix:qe.transform.calculatePosMatrix(tt.tileID.toUnwrapped()),u_ele_delta:Mt.getMeshFrameDelta(qe.transform.zoom)};Vi.draw(jt,er.TRIANGLES,Hr,jl.disabled,kr,os.backCCW,Tt,lt,"terrain",Vr.vertexBuffer,Vr.indexBuffer,Vr.segments)}jt.bindFramebuffer.set(null),jt.viewport.set([0,0,qe.width,qe.height])}(this,this.style.map.terrain),function(qe,Mt){let jt=qe.context,er=jt.gl,kr=Mu.unblended,Hr=new sl(er.LEQUAL,sl.ReadWrite,[0,1]),Vr=Mt.getTerrainMesh(),ki=Mt.getCoordsTexture(),Vi=Mt.sourceCache.getRenderableTiles(),tt=qe.useProgram("terrainCoords");jt.bindFramebuffer.set(Mt.getFramebuffer("coords").framebuffer),jt.viewport.set([0,0,qe.width/devicePixelRatio,qe.height/devicePixelRatio]),jt.clear({color:n.aM.transparent,depth:1}),Mt.coordsIndex=[];for(let lt of Vi){let Tt=Mt.getTerrainData(lt.tileID);jt.activeTexture.set(er.TEXTURE0),er.bindTexture(er.TEXTURE_2D,ki.texture);let Lt={u_matrix:qe.transform.calculatePosMatrix(lt.tileID.toUnwrapped()),u_terrain_coords_id:(255-Mt.coordsIndex.length)/255,u_texture:0,u_ele_delta:Mt.getMeshFrameDelta(qe.transform.zoom)};tt.draw(jt,er.TRIANGLES,Hr,jl.disabled,kr,os.backCCW,Lt,Tt,"terrain",Vr.vertexBuffer,Vr.indexBuffer,Vr.segments),Mt.coordsIndex.push(lt.tileID.key)}jt.bindFramebuffer.set(null),jt.viewport.set([0,0,qe.width,qe.height])}(this,this.style.map.terrain))}renderLayer(O,pe,Ie,Ne){if(!Ie.isHidden(this.transform.zoom)&&(Ie.type==="background"||Ie.type==="custom"||(Ne||[]).length))switch(this.id=Ie.id,Ie.type){case"symbol":(function(qe,Mt,jt,er,kr){if(qe.renderPass!=="translucent")return;let Hr=jl.disabled,Vr=qe.colorModeForRenderPass();(jt._unevaluatedLayout.hasValue("text-variable-anchor")||jt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(ki,Vi,tt,lt,Tt,Lt,Vt,Nt,Yt){let Lr=Vi.transform,$r=sa(),Zr=Tt==="map",di=Lt==="map";for(let zi of ki){let Ki=lt.getTile(zi),nn=Ki.getBucket(tt);if(!nn||!nn.text||!nn.text.segments.get().length)continue;let kn=n.ag(nn.textSizeData,Lr.zoom),Jn=cn(Ki,1,Vi.transform.zoom),Sa=ui(zi.posMatrix,di,Zr,Vi.transform,Jn),wa=tt.layout.get("icon-text-fit")!=="none"&&nn.hasIconData();if(kn){let Ba=Math.pow(2,Lr.zoom-Ki.tileID.overscaledZ),xo=Vi.style.map.terrain?(Bo,_s)=>Vi.style.map.terrain.getElevation(zi,Bo,_s):null,Go=$r.translatePosition(Lr,Ki,Vt,Nt);Ef(nn,Zr,di,Yt,Lr,Sa,zi.posMatrix,Ba,kn,wa,$r,Go,zi.toUnwrapped(),xo)}}}(er,qe,jt,Mt,jt.layout.get("text-rotation-alignment"),jt.layout.get("text-pitch-alignment"),jt.paint.get("text-translate"),jt.paint.get("text-translate-anchor"),kr),jt.paint.get("icon-opacity").constantOr(1)!==0&&Ld(qe,Mt,jt,er,!1,jt.paint.get("icon-translate"),jt.paint.get("icon-translate-anchor"),jt.layout.get("icon-rotation-alignment"),jt.layout.get("icon-pitch-alignment"),jt.layout.get("icon-keep-upright"),Hr,Vr),jt.paint.get("text-opacity").constantOr(1)!==0&&Ld(qe,Mt,jt,er,!0,jt.paint.get("text-translate"),jt.paint.get("text-translate-anchor"),jt.layout.get("text-rotation-alignment"),jt.layout.get("text-pitch-alignment"),jt.layout.get("text-keep-upright"),Hr,Vr),Mt.map.showCollisionBoxes&&(yh(qe,Mt,jt,er,!0),yh(qe,Mt,jt,er,!1))})(O,pe,Ie,Ne,this.style.placement.variableOffsets);break;case"circle":(function(qe,Mt,jt,er){if(qe.renderPass!=="translucent")return;let kr=jt.paint.get("circle-opacity"),Hr=jt.paint.get("circle-stroke-width"),Vr=jt.paint.get("circle-stroke-opacity"),ki=!jt.layout.get("circle-sort-key").isConstant();if(kr.constantOr(1)===0&&(Hr.constantOr(1)===0||Vr.constantOr(1)===0))return;let Vi=qe.context,tt=Vi.gl,lt=qe.depthModeForSublayer(0,sl.ReadOnly),Tt=jl.disabled,Lt=qe.colorModeForRenderPass(),Vt=[];for(let Nt=0;NtNt.sortKey-Yt.sortKey);for(let Nt of Vt){let{programConfiguration:Yt,program:Lr,layoutVertexBuffer:$r,indexBuffer:Zr,uniformValues:di,terrainData:zi}=Nt.state;Lr.draw(Vi,tt.TRIANGLES,lt,Tt,Lt,os.disabled,di,zi,jt.id,$r,Zr,Nt.segments,jt.paint,qe.transform.zoom,Yt)}})(O,pe,Ie,Ne);break;case"heatmap":(function(qe,Mt,jt,er){if(jt.paint.get("heatmap-opacity")===0)return;let kr=qe.context;if(qe.style.map.terrain){for(let Hr of er){let Vr=Mt.getTile(Hr);Mt.hasRenderableParent(Hr)||(qe.renderPass==="offscreen"?Lf(qe,Vr,jt,Hr):qe.renderPass==="translucent"&&ef(qe,jt,Hr))}kr.viewport.set([0,0,qe.width,qe.height])}else qe.renderPass==="offscreen"?function(Hr,Vr,ki,Vi){let tt=Hr.context,lt=tt.gl,Tt=jl.disabled,Lt=new Mu([lt.ONE,lt.ONE],n.aM.transparent,[!0,!0,!0,!0]);(function(Vt,Nt,Yt){let Lr=Vt.gl;Vt.activeTexture.set(Lr.TEXTURE1),Vt.viewport.set([0,0,Nt.width/4,Nt.height/4]);let $r=Yt.heatmapFbos.get(n.aU);$r?(Lr.bindTexture(Lr.TEXTURE_2D,$r.colorAttachment.get()),Vt.bindFramebuffer.set($r.framebuffer)):($r=rd(Vt,Nt.width/4,Nt.height/4),Yt.heatmapFbos.set(n.aU,$r))})(tt,Hr,ki),tt.clear({color:n.aM.transparent});for(let Vt=0;Vt20&&Hr.texParameterf(Hr.TEXTURE_2D,kr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,kr.extTextureFilterAnisotropicMax);let nn=qe.style.map.terrain&&qe.style.map.terrain.getTerrainData(Vt),kn=nn?Vt:null,Jn=kn?kn.posMatrix:qe.transform.calculatePosMatrix(Vt.toUnwrapped(),Lt),Sa=Gl(Jn,zi||[0,0],di||1,Zr,jt);Vr instanceof _t?ki.draw(kr,Hr.TRIANGLES,Nt,jl.disabled,Vi,os.disabled,Sa,nn,jt.id,Vr.boundsBuffer,qe.quadTriangleIndexBuffer,Vr.boundsSegments):ki.draw(kr,Hr.TRIANGLES,Nt,tt[Vt.overscaledZ],Vi,os.disabled,Sa,nn,jt.id,qe.rasterBoundsBuffer,qe.quadTriangleIndexBuffer,qe.rasterBoundsSegments)}})(O,pe,Ie,Ne);break;case"background":(function(qe,Mt,jt,er){let kr=jt.paint.get("background-color"),Hr=jt.paint.get("background-opacity");if(Hr===0)return;let Vr=qe.context,ki=Vr.gl,Vi=qe.transform,tt=Vi.tileSize,lt=jt.paint.get("background-pattern");if(qe.isPatternMissing(lt))return;let Tt=!lt&&kr.a===1&&Hr===1&&qe.opaquePassEnabledForLayer()?"opaque":"translucent";if(qe.renderPass!==Tt)return;let Lt=jl.disabled,Vt=qe.depthModeForSublayer(0,Tt==="opaque"?sl.ReadWrite:sl.ReadOnly),Nt=qe.colorModeForRenderPass(),Yt=qe.useProgram(lt?"backgroundPattern":"background"),Lr=er||Vi.coveringTiles({tileSize:tt,terrain:qe.style.map.terrain});lt&&(Vr.activeTexture.set(ki.TEXTURE0),qe.imageManager.bind(qe.context));let $r=jt.getCrossfadeParameters();for(let Zr of Lr){let di=er?Zr.posMatrix:qe.transform.calculatePosMatrix(Zr.toUnwrapped()),zi=lt?Jl(di,Hr,qe,lt,{tileID:Zr,tileSize:tt},$r):Il(di,Hr,kr),Ki=qe.style.map.terrain&&qe.style.map.terrain.getTerrainData(Zr);Yt.draw(Vr,ki.TRIANGLES,Vt,Lt,Nt,os.disabled,zi,Ki,jt.id,qe.tileExtentBuffer,qe.quadTriangleIndexBuffer,qe.tileExtentSegments)}})(O,0,Ie,Ne);break;case"custom":(function(qe,Mt,jt){let er=qe.context,kr=jt.implementation;if(qe.renderPass==="offscreen"){let Hr=kr.prerender;Hr&&(qe.setCustomLayerDefaults(),er.setColorMode(qe.colorModeForRenderPass()),Hr.call(kr,er.gl,qe.transform.customLayerMatrix()),er.setDirty(),qe.setBaseState())}else if(qe.renderPass==="translucent"){qe.setCustomLayerDefaults(),er.setColorMode(qe.colorModeForRenderPass()),er.setStencilMode(jl.disabled);let Hr=kr.renderingMode==="3d"?new sl(qe.context.gl.LEQUAL,sl.ReadWrite,qe.depthRangeFor3D):qe.depthModeForSublayer(0,sl.ReadOnly);er.setDepthMode(Hr),kr.render(er.gl,qe.transform.customLayerMatrix(),{farZ:qe.transform.farZ,nearZ:qe.transform.nearZ,fov:qe.transform._fov,modelViewProjectionMatrix:qe.transform.modelViewProjectionMatrix,projectionMatrix:qe.transform.projectionMatrix}),er.setDirty(),qe.setBaseState(),er.bindFramebuffer.set(null)}})(O,0,Ie)}}translatePosMatrix(O,pe,Ie,Ne,qe){if(!Ie[0]&&!Ie[1])return O;let Mt=qe?Ne==="map"?this.transform.angle:0:Ne==="viewport"?-this.transform.angle:0;if(Mt){let kr=Math.sin(Mt),Hr=Math.cos(Mt);Ie=[Ie[0]*Hr-Ie[1]*kr,Ie[0]*kr+Ie[1]*Hr]}let jt=[qe?Ie[0]:cn(pe,Ie[0],this.transform.zoom),qe?Ie[1]:cn(pe,Ie[1],this.transform.zoom),0],er=new Float32Array(16);return n.J(er,O,jt),er}saveTileTexture(O){let pe=this._tileTextures[O.size[0]];pe?pe.push(O):this._tileTextures[O.size[0]]=[O]}getTileTexture(O){let pe=this._tileTextures[O];return pe&&pe.length>0?pe.pop():null}isPatternMissing(O){if(!O)return!1;if(!O.from||!O.to)return!0;let pe=this.imageManager.getPattern(O.from.toString()),Ie=this.imageManager.getPattern(O.to.toString());return!pe||!Ie}useProgram(O,pe){this.cache=this.cache||{};let Ie=O+(pe?pe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Ie]||(this.cache[Ie]=new tn(this.context,yi[O],pe,ou[O],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Ie]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let O=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(O.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new g(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:O,drawingBufferHeight:pe}=this.context.gl;return this.width!==O||this.height!==pe}}class _u{constructor(O,pe){this.points=O,this.planes=pe}static fromInvProjectionMatrix(O,pe,Ie){let Ne=Math.pow(2,Ie),qe=[[-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]].map(jt=>{let er=1/(jt=n.af([],jt,O))[3]/pe*Ne;return n.b1(jt,jt,[er,er,1/jt[3],er])}),Mt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(jt=>{let er=function(ki,Vi){var tt=Vi[0],lt=Vi[1],Tt=Vi[2],Lt=tt*tt+lt*lt+Tt*Tt;return Lt>0&&(Lt=1/Math.sqrt(Lt)),ki[0]=Vi[0]*Lt,ki[1]=Vi[1]*Lt,ki[2]=Vi[2]*Lt,ki}([],function(ki,Vi,tt){var lt=Vi[0],Tt=Vi[1],Lt=Vi[2],Vt=tt[0],Nt=tt[1],Yt=tt[2];return ki[0]=Tt*Yt-Lt*Nt,ki[1]=Lt*Vt-lt*Yt,ki[2]=lt*Nt-Tt*Vt,ki}([],E([],qe[jt[0]],qe[jt[1]]),E([],qe[jt[2]],qe[jt[1]]))),kr=-((Hr=er)[0]*(Vr=qe[jt[1]])[0]+Hr[1]*Vr[1]+Hr[2]*Vr[2]);var Hr,Vr;return er.concat(kr)});return new _u(qe,Mt)}}class jh{constructor(O,pe){this.min=O,this.max=pe,this.center=function(Ie,Ne,qe){return Ie[0]=.5*Ne[0],Ie[1]=.5*Ne[1],Ie[2]=.5*Ne[2],Ie}([],function(Ie,Ne,qe){return Ie[0]=Ne[0]+qe[0],Ie[1]=Ne[1]+qe[1],Ie[2]=Ne[2]+qe[2],Ie}([],this.min,this.max))}quadrant(O){let pe=[O%2==0,O<2],Ie=w(this.min),Ne=w(this.max);for(let qe=0;qe=0&&Mt++;if(Mt===0)return 0;Mt!==pe.length&&(Ie=!1)}if(Ie)return 2;for(let Ne=0;Ne<3;Ne++){let qe=Number.MAX_VALUE,Mt=-Number.MAX_VALUE;for(let jt=0;jtthis.max[Ne]-this.min[Ne])return 0}return 1}}class Rc{constructor(O=0,pe=0,Ie=0,Ne=0){if(isNaN(O)||O<0||isNaN(pe)||pe<0||isNaN(Ie)||Ie<0||isNaN(Ne)||Ne<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=O,this.bottom=pe,this.left=Ie,this.right=Ne}interpolate(O,pe,Ie){return pe.top!=null&&O.top!=null&&(this.top=n.y.number(O.top,pe.top,Ie)),pe.bottom!=null&&O.bottom!=null&&(this.bottom=n.y.number(O.bottom,pe.bottom,Ie)),pe.left!=null&&O.left!=null&&(this.left=n.y.number(O.left,pe.left,Ie)),pe.right!=null&&O.right!=null&&(this.right=n.y.number(O.right,pe.right,Ie)),this}getCenter(O,pe){let Ie=n.ac((this.left+O-this.right)/2,0,O),Ne=n.ac((this.top+pe-this.bottom)/2,0,pe);return new n.P(Ie,Ne)}equals(O){return this.top===O.top&&this.bottom===O.bottom&&this.left===O.left&&this.right===O.right}clone(){return new Rc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Jc=85.051129;class Eu{constructor(O,pe,Ie,Ne,qe){this.tileSize=512,this._renderWorldCopies=qe===void 0||!!qe,this._minZoom=O||0,this._maxZoom=pe||22,this._minPitch=Ie??0,this._maxPitch=Ne??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Rc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let O=new Eu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return O.apply(this),O}apply(O){this.tileSize=O.tileSize,this.latRange=O.latRange,this.lngRange=O.lngRange,this.width=O.width,this.height=O.height,this._center=O._center,this._elevation=O._elevation,this.minElevationForCurrentTile=O.minElevationForCurrentTile,this.zoom=O.zoom,this.angle=O.angle,this._fov=O._fov,this._pitch=O._pitch,this._unmodified=O._unmodified,this._edgeInsets=O._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(O){this._minZoom!==O&&(this._minZoom=O,this.zoom=Math.max(this.zoom,O))}get maxZoom(){return this._maxZoom}set maxZoom(O){this._maxZoom!==O&&(this._maxZoom=O,this.zoom=Math.min(this.zoom,O))}get minPitch(){return this._minPitch}set minPitch(O){this._minPitch!==O&&(this._minPitch=O,this.pitch=Math.max(this.pitch,O))}get maxPitch(){return this._maxPitch}set maxPitch(O){this._maxPitch!==O&&(this._maxPitch=O,this.pitch=Math.min(this.pitch,O))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(O){O===void 0?O=!0:O===null&&(O=!1),this._renderWorldCopies=O}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(O){let pe=-n.b3(O,-180,180)*Math.PI/180;this.angle!==pe&&(this._unmodified=!1,this.angle=pe,this._calcMatrices(),this.rotationMatrix=function(){var Ie=new n.A(4);return n.A!=Float32Array&&(Ie[1]=0,Ie[2]=0),Ie[0]=1,Ie[3]=1,Ie}(),function(Ie,Ne,qe){var Mt=Ne[0],jt=Ne[1],er=Ne[2],kr=Ne[3],Hr=Math.sin(qe),Vr=Math.cos(qe);Ie[0]=Mt*Vr+er*Hr,Ie[1]=jt*Vr+kr*Hr,Ie[2]=Mt*-Hr+er*Vr,Ie[3]=jt*-Hr+kr*Vr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(O){let pe=n.ac(O,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==pe&&(this._unmodified=!1,this._pitch=pe,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(O){O=Math.max(.01,Math.min(60,O)),this._fov!==O&&(this._unmodified=!1,this._fov=O/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(O){let pe=Math.min(Math.max(O,this.minZoom),this.maxZoom);this._zoom!==pe&&(this._unmodified=!1,this._zoom=pe,this.tileZoom=Math.max(0,Math.floor(pe)),this.scale=this.zoomScale(pe),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(O){O.lat===this._center.lat&&O.lng===this._center.lng||(this._unmodified=!1,this._center=O,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(O){O!==this._elevation&&(this._elevation=O,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(O){this._edgeInsets.equals(O)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,O,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(O){return this._edgeInsets.equals(O)}interpolatePadding(O,pe,Ie){this._unmodified=!1,this._edgeInsets.interpolate(O,pe,Ie),this._constrain(),this._calcMatrices()}coveringZoomLevel(O){let pe=(O.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/O.tileSize));return Math.max(0,pe)}getVisibleUnwrappedCoordinates(O){let pe=[new n.b4(0,O)];if(this._renderWorldCopies){let Ie=this.pointCoordinate(new n.P(0,0)),Ne=this.pointCoordinate(new n.P(this.width,0)),qe=this.pointCoordinate(new n.P(this.width,this.height)),Mt=this.pointCoordinate(new n.P(0,this.height)),jt=Math.floor(Math.min(Ie.x,Ne.x,qe.x,Mt.x)),er=Math.floor(Math.max(Ie.x,Ne.x,qe.x,Mt.x)),kr=1;for(let Hr=jt-kr;Hr<=er+kr;Hr++)Hr!==0&&pe.push(new n.b4(Hr,O))}return pe}coveringTiles(O){var pe,Ie;let Ne=this.coveringZoomLevel(O),qe=Ne;if(O.minzoom!==void 0&&NeO.maxzoom&&(Ne=O.maxzoom);let Mt=this.pointCoordinate(this.getCameraPoint()),jt=n.Z.fromLngLat(this.center),er=Math.pow(2,Ne),kr=[er*Mt.x,er*Mt.y,0],Hr=[er*jt.x,er*jt.y,0],Vr=_u.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Ne),ki=O.minzoom||0;!O.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(ki=Ne);let Vi=O.terrain?2/Math.min(this.tileSize,O.tileSize)*this.tileSize:3,tt=Nt=>({aabb:new jh([Nt*er,0,0],[(Nt+1)*er,er,0]),zoom:0,x:0,y:0,wrap:Nt,fullyVisible:!1}),lt=[],Tt=[],Lt=Ne,Vt=O.reparseOverscaled?qe:Ne;if(this._renderWorldCopies)for(let Nt=1;Nt<=3;Nt++)lt.push(tt(-Nt)),lt.push(tt(Nt));for(lt.push(tt(0));lt.length>0;){let Nt=lt.pop(),Yt=Nt.x,Lr=Nt.y,$r=Nt.fullyVisible;if(!$r){let nn=Nt.aabb.intersects(Vr);if(nn===0)continue;$r=nn===2}let Zr=O.terrain?kr:Hr,di=Nt.aabb.distanceX(Zr),zi=Nt.aabb.distanceY(Zr),Ki=Math.max(Math.abs(di),Math.abs(zi));if(Nt.zoom===Lt||Ki>Vi+(1<=ki){let nn=Lt-Nt.zoom,kn=kr[0]-.5-(Yt<>1),Sa=Nt.zoom+1,wa=Nt.aabb.quadrant(nn);if(O.terrain){let Ba=new n.S(Sa,Nt.wrap,Sa,kn,Jn),xo=O.terrain.getMinMaxElevation(Ba),Go=(pe=xo.minElevation)!==null&&pe!==void 0?pe:this.elevation,Bo=(Ie=xo.maxElevation)!==null&&Ie!==void 0?Ie:this.elevation;wa=new jh([wa.min[0],wa.min[1],Go],[wa.max[0],wa.max[1],Bo])}lt.push({aabb:wa,zoom:Sa,x:kn,y:Jn,wrap:Nt.wrap,fullyVisible:$r})}}return Tt.sort((Nt,Yt)=>Nt.distanceSq-Yt.distanceSq).map(Nt=>Nt.tileID)}resize(O,pe){this.width=O,this.height=pe,this.pixelsToGLUnits=[2/O,-2/pe],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(O){return Math.pow(2,O)}scaleZoom(O){return Math.log(O)/Math.LN2}project(O){let pe=n.ac(O.lat,-85.051129,Jc);return new n.P(n.O(O.lng)*this.worldSize,n.Q(pe)*this.worldSize)}unproject(O){return new n.Z(O.x/this.worldSize,O.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(O){let pe=this.elevation,Ie=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Ne=this.pointLocation(this.centerPoint,O),qe=O.getElevationForLngLatZoom(Ne,this.tileZoom);if(!(this.elevation-qe))return;let Mt=Ie+pe-qe,jt=Math.cos(this._pitch)*this.cameraToCenterDistance/Mt/n.b5(1,Ne.lat),er=this.scaleZoom(jt/this.tileSize);this._elevation=qe,this._center=Ne,this.zoom=er}setLocationAtPoint(O,pe){let Ie=this.pointCoordinate(pe),Ne=this.pointCoordinate(this.centerPoint),qe=this.locationCoordinate(O),Mt=new n.Z(qe.x-(Ie.x-Ne.x),qe.y-(Ie.y-Ne.y));this.center=this.coordinateLocation(Mt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(O,pe){return pe?this.coordinatePoint(this.locationCoordinate(O),pe.getElevationForLngLatZoom(O,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(O))}pointLocation(O,pe){return this.coordinateLocation(this.pointCoordinate(O,pe))}locationCoordinate(O){return n.Z.fromLngLat(O)}coordinateLocation(O){return O&&O.toLngLat()}pointCoordinate(O,pe){if(pe){let ki=pe.pointCoordinate(O);if(ki!=null)return ki}let Ie=[O.x,O.y,0,1],Ne=[O.x,O.y,1,1];n.af(Ie,Ie,this.pixelMatrixInverse),n.af(Ne,Ne,this.pixelMatrixInverse);let qe=Ie[3],Mt=Ne[3],jt=Ie[1]/qe,er=Ne[1]/Mt,kr=Ie[2]/qe,Hr=Ne[2]/Mt,Vr=kr===Hr?0:(0-kr)/(Hr-kr);return new n.Z(n.y.number(Ie[0]/qe,Ne[0]/Mt,Vr)/this.worldSize,n.y.number(jt,er,Vr)/this.worldSize)}coordinatePoint(O,pe=0,Ie=this.pixelMatrix){let Ne=[O.x*this.worldSize,O.y*this.worldSize,pe,1];return n.af(Ne,Ne,Ie),new n.P(Ne[0]/Ne[3],Ne[1]/Ne[3])}getBounds(){let O=Math.max(0,this.height/2-this.getHorizon());return new fe().extend(this.pointLocation(new n.P(0,O))).extend(this.pointLocation(new n.P(this.width,O))).extend(this.pointLocation(new n.P(this.width,this.height))).extend(this.pointLocation(new n.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new fe([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(O){O?(this.lngRange=[O.getWest(),O.getEast()],this.latRange=[O.getSouth(),O.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Jc])}calculateTileMatrix(O){let pe=O.canonical,Ie=this.worldSize/this.zoomScale(pe.z),Ne=pe.x+Math.pow(2,pe.z)*O.wrap,qe=n.an(new Float64Array(16));return n.J(qe,qe,[Ne*Ie,pe.y*Ie,0]),n.K(qe,qe,[Ie/n.X,Ie/n.X,1]),qe}calculatePosMatrix(O,pe=!1){let Ie=O.key,Ne=pe?this._alignedPosMatrixCache:this._posMatrixCache;if(Ne[Ie])return Ne[Ie];let qe=this.calculateTileMatrix(O);return n.L(qe,pe?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,qe),Ne[Ie]=new Float32Array(qe),Ne[Ie]}calculateFogMatrix(O){let pe=O.key,Ie=this._fogMatrixCache;if(Ie[pe])return Ie[pe];let Ne=this.calculateTileMatrix(O);return n.L(Ne,this.fogMatrix,Ne),Ie[pe]=new Float32Array(Ne),Ie[pe]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(O,pe){pe=n.ac(+pe,this.minZoom,this.maxZoom);let Ie={center:new n.N(O.lng,O.lat),zoom:pe},Ne=this.lngRange;if(!this._renderWorldCopies&&Ne===null){let Nt=179.9999999999;Ne=[-Nt,Nt]}let qe=this.tileSize*this.zoomScale(Ie.zoom),Mt=0,jt=qe,er=0,kr=qe,Hr=0,Vr=0,{x:ki,y:Vi}=this.size;if(this.latRange){let Nt=this.latRange;Mt=n.Q(Nt[1])*qe,jt=n.Q(Nt[0])*qe,jt-Mtjt&&(Lt=jt-Nt)}if(Ne){let Nt=(er+kr)/2,Yt=tt;this._renderWorldCopies&&(Yt=n.b3(tt,Nt-qe/2,Nt+qe/2));let Lr=ki/2;Yt-Lrkr&&(Tt=kr-Lr)}if(Tt!==void 0||Lt!==void 0){let Nt=new n.P(Tt??tt,Lt??lt);Ie.center=this.unproject.call({worldSize:qe},Nt).wrap()}return Ie}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let O=this._unmodified,{center:pe,zoom:Ie}=this.getConstrained(this.center,this.zoom);this.center=pe,this.zoom=Ie,this._unmodified=O,this._constraining=!1}_calcMatrices(){if(!this.height)return;let O=this.centerOffset,pe=this.point.x,Ie=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=n.b5(1,this.center.lat)*this.worldSize;let Ne=n.an(new Float64Array(16));n.K(Ne,Ne,[this.width/2,-this.height/2,1]),n.J(Ne,Ne,[1,-1,0]),this.labelPlaneMatrix=Ne,Ne=n.an(new Float64Array(16)),n.K(Ne,Ne,[1,-1,1]),n.J(Ne,Ne,[-1,-1,0]),n.K(Ne,Ne,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ne;let qe=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),Mt=Math.min(this.elevation,this.minElevationForCurrentTile),jt=qe-Mt*this._pixelPerMeter/Math.cos(this._pitch),er=Mt<0?jt:qe,kr=Math.PI/2+this._pitch,Hr=this._fov*(.5+O.y/this.height),Vr=Math.sin(Hr)*er/Math.sin(n.ac(Math.PI-kr-Hr,.01,Math.PI-.01)),ki=this.getHorizon(),Vi=2*Math.atan(ki/this.cameraToCenterDistance)*(.5+O.y/(2*ki)),tt=Math.sin(Vi)*er/Math.sin(n.ac(Math.PI-kr-Vi,.01,Math.PI-.01)),lt=Math.min(Vr,tt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*lt+er),this.nearZ=this.height/50,Ne=new Float64Array(16),n.b6(Ne,this._fov,this.width/this.height,this.nearZ,this.farZ),Ne[8]=2*-O.x/this.width,Ne[9]=2*O.y/this.height,this.projectionMatrix=n.ae(Ne),n.K(Ne,Ne,[1,-1,1]),n.J(Ne,Ne,[0,0,-this.cameraToCenterDistance]),n.b7(Ne,Ne,this._pitch),n.ad(Ne,Ne,this.angle),n.J(Ne,Ne,[-pe,-Ie,0]),this.mercatorMatrix=n.K([],Ne,[this.worldSize,this.worldSize,this.worldSize]),n.K(Ne,Ne,[1,1,this._pixelPerMeter]),this.pixelMatrix=n.L(new Float64Array(16),this.labelPlaneMatrix,Ne),n.J(Ne,Ne,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Ne,this.invModelViewProjectionMatrix=n.as([],Ne),this.fogMatrix=new Float64Array(16),n.b6(this.fogMatrix,this._fov,this.width/this.height,qe,this.farZ),this.fogMatrix[8]=2*-O.x/this.width,this.fogMatrix[9]=2*O.y/this.height,n.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),n.b7(this.fogMatrix,this.fogMatrix,this._pitch),n.ad(this.fogMatrix,this.fogMatrix,this.angle),n.J(this.fogMatrix,this.fogMatrix,[-pe,-Ie,0]),n.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=n.L(new Float64Array(16),this.labelPlaneMatrix,Ne);let Tt=this.width%2/2,Lt=this.height%2/2,Vt=Math.cos(this.angle),Nt=Math.sin(this.angle),Yt=pe-Math.round(pe)+Vt*Tt+Nt*Lt,Lr=Ie-Math.round(Ie)+Vt*Lt+Nt*Tt,$r=new Float64Array(Ne);if(n.J($r,$r,[Yt>.5?Yt-1:Yt,Lr>.5?Lr-1:Lr,0]),this.alignedModelViewProjectionMatrix=$r,Ne=n.as(new Float64Array(16),this.pixelMatrix),!Ne)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ne,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let O=this.pointCoordinate(new n.P(0,0)),pe=[O.x*this.worldSize,O.y*this.worldSize,0,1];return n.af(pe,pe,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let O=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.P(0,O))}getCameraQueryGeometry(O){let pe=this.getCameraPoint();if(O.length===1)return[O[0],pe];{let Ie=pe.x,Ne=pe.y,qe=pe.x,Mt=pe.y;for(let jt of O)Ie=Math.min(Ie,jt.x),Ne=Math.min(Ne,jt.y),qe=Math.max(qe,jt.x),Mt=Math.max(Mt,jt.y);return[new n.P(Ie,Ne),new n.P(qe,Ne),new n.P(qe,Mt),new n.P(Ie,Mt),new n.P(Ie,Ne)]}}lngLatToCameraDepth(O,pe){let Ie=this.locationCoordinate(O),Ne=[Ie.x*this.worldSize,Ie.y*this.worldSize,pe,1];return n.af(Ne,Ne,this.modelViewProjectionMatrix),Ne[2]/Ne[3]}}function xf(Ke,O){let pe,Ie=!1,Ne=null,qe=null,Mt=()=>{Ne=null,Ie&&(Ke.apply(qe,pe),Ne=setTimeout(Mt,O),Ie=!1)};return(...jt)=>(Ie=!0,qe=this,pe=jt,Ne||Mt(),Ne)}class Eh{constructor(O){this._getCurrentHash=()=>{let pe=window.location.hash.replace("#","");if(this._hashName){let Ie;return pe.split("&").map(Ne=>Ne.split("=")).forEach(Ne=>{Ne[0]===this._hashName&&(Ie=Ne)}),(Ie&&Ie[1]||"").split("/")}return pe.split("/")},this._onHashChange=()=>{let pe=this._getCurrentHash();if(pe.length>=3&&!pe.some(Ie=>isNaN(Ie))){let Ie=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(pe[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+pe[2],+pe[1]],zoom:+pe[0],bearing:Ie,pitch:+(pe[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let pe=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,pe)},this._removeHash=()=>{let pe=this._getCurrentHash();if(pe.length===0)return;let Ie=pe.join("/"),Ne=Ie;Ne.split("&").length>0&&(Ne=Ne.split("&")[0]),this._hashName&&(Ne=`${this._hashName}=${Ie}`);let qe=window.location.hash.replace(Ne,"");qe.startsWith("#&")?qe=qe.slice(0,1)+qe.slice(2):qe==="#"&&(qe="");let Mt=window.location.href.replace(/(#.+)?$/,qe);Mt=Mt.replace("&&","&"),window.history.replaceState(window.history.state,null,Mt)},this._updateHash=xf(this._updateHashUnthrottled,300),this._hashName=O&&encodeURIComponent(O)}addTo(O){return this._map=O,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(O){let pe=this._map.getCenter(),Ie=Math.round(100*this._map.getZoom())/100,Ne=Math.ceil((Ie*Math.LN2+Math.log(512/360/.5))/Math.LN10),qe=Math.pow(10,Ne),Mt=Math.round(pe.lng*qe)/qe,jt=Math.round(pe.lat*qe)/qe,er=this._map.getBearing(),kr=this._map.getPitch(),Hr="";if(Hr+=O?`/${Mt}/${jt}/${Ie}`:`${Ie}/${jt}/${Mt}`,(er||kr)&&(Hr+="/"+Math.round(10*er)/10),kr&&(Hr+=`/${Math.round(kr)}`),this._hashName){let Vr=this._hashName,ki=!1,Vi=window.location.hash.slice(1).split("&").map(tt=>{let lt=tt.split("=")[0];return lt===Vr?(ki=!0,`${lt}=${Hr}`):tt}).filter(tt=>tt);return ki||Vi.push(`${Vr}=${Hr}`),`#${Vi.join("&")}`}return`#${Hr}`}}let rf={linearity:.3,easing:n.b8(0,0,.3,1)},jf=n.e({deceleration:2500,maxSpeed:1400},rf),Jd=n.e({deceleration:20,maxSpeed:1400},rf),Tp=n.e({deceleration:1e3,maxSpeed:360},rf),bf=n.e({deceleration:1e3,maxSpeed:90},rf);class Uf{constructor(O){this._map=O,this.clear()}clear(){this._inertiaBuffer=[]}record(O){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:O})}_drainInertiaBuffer(){let O=this._inertiaBuffer,pe=u.now();for(;O.length>0&&pe-O[0].time>160;)O.shift()}_onMoveEnd(O){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let pe={zoom:0,bearing:0,pitch:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:qe}of this._inertiaBuffer)pe.zoom+=qe.zoomDelta||0,pe.bearing+=qe.bearingDelta||0,pe.pitch+=qe.pitchDelta||0,qe.panDelta&&pe.pan._add(qe.panDelta),qe.around&&(pe.around=qe.around),qe.pinchAround&&(pe.pinchAround=qe.pinchAround);let Ie=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Ne={};if(pe.pan.mag()){let qe=wf(pe.pan.mag(),Ie,n.e({},jf,O||{}));Ne.offset=pe.pan.mult(qe.amount/pe.pan.mag()),Ne.center=this._map.transform.center,Dc(Ne,qe)}if(pe.zoom){let qe=wf(pe.zoom,Ie,Jd);Ne.zoom=this._map.transform.zoom+qe.amount,Dc(Ne,qe)}if(pe.bearing){let qe=wf(pe.bearing,Ie,Tp);Ne.bearing=this._map.transform.bearing+n.ac(qe.amount,-179,179),Dc(Ne,qe)}if(pe.pitch){let qe=wf(pe.pitch,Ie,bf);Ne.pitch=this._map.transform.pitch+qe.amount,Dc(Ne,qe)}if(Ne.zoom||Ne.bearing){let qe=pe.pinchAround===void 0?pe.around:pe.pinchAround;Ne.around=qe?this._map.unproject(qe):this._map.getCenter()}return this.clear(),n.e(Ne,{noMoveStart:!0})}}function Dc(Ke,O){(!Ke.duration||Ke.durationpe.unproject(er)),jt=qe.reduce((er,kr,Hr,Vr)=>er.add(kr.div(Vr.length)),new n.P(0,0));super(O,{points:qe,point:jt,lngLats:Mt,lngLat:pe.unproject(jt),originalEvent:Ie}),this._defaultPrevented=!1}}class $f extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(O,pe,Ie){super(O,{originalEvent:Ie}),this._defaultPrevented=!1}}class Lh{constructor(O,pe){this._map=O,this._clickTolerance=pe.clickTolerance}reset(){delete this._mousedownPos}wheel(O){return this._firePreventable(new $f(O.type,this._map,O))}mousedown(O,pe){return this._mousedownPos=pe,this._firePreventable(new ch(O.type,this._map,O))}mouseup(O){this._map.fire(new ch(O.type,this._map,O))}click(O,pe){this._mousedownPos&&this._mousedownPos.dist(pe)>=this._clickTolerance||this._map.fire(new ch(O.type,this._map,O))}dblclick(O){return this._firePreventable(new ch(O.type,this._map,O))}mouseover(O){this._map.fire(new ch(O.type,this._map,O))}mouseout(O){this._map.fire(new ch(O.type,this._map,O))}touchstart(O){return this._firePreventable(new kf(O.type,this._map,O))}touchmove(O){this._map.fire(new kf(O.type,this._map,O))}touchend(O){this._map.fire(new kf(O.type,this._map,O))}touchcancel(O){this._map.fire(new kf(O.type,this._map,O))}_firePreventable(O){if(this._map.fire(O),O.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Lu{constructor(O){this._map=O}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(O){this._map.fire(new ch(O.type,this._map,O))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ch("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(O){this._delayContextMenu?this._contextMenuEvent=O:this._ignoreContextMenu||this._map.fire(new ch(O.type,this._map,O)),this._map.listens("contextmenu")&&O.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uh{constructor(O){this._map=O}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(O){return this.transform.pointLocation(n.P.convert(O),this._map.terrain)}}class Qc{constructor(O,pe){this._map=O,this._tr=new Uh(O),this._el=O.getCanvasContainer(),this._container=O.getContainer(),this._clickTolerance=pe.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(O,pe){this.isEnabled()&&O.shiftKey&&O.button===0&&(s.disableDrag(),this._startPos=this._lastPos=pe,this._active=!0)}mousemoveWindow(O,pe){if(!this._active)return;let Ie=pe;if(this._lastPos.equals(Ie)||!this._box&&Ie.dist(this._startPos)qe.fitScreenCoordinates(Ie,Ne,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",O)}keydown(O){this._active&&O.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",O))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(O,pe){return this._map.fire(new n.k(O,{originalEvent:pe}))}}function Pd(Ke,O){if(Ke.length!==O.length)throw new Error(`The number of touches and points are not equal - touches ${Ke.length}, points ${O.length}`);let pe={};for(let Ie=0;Iethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=O.timeStamp),Ie.length===this.numTouches&&(this.centroid=function(Ne){let qe=new n.P(0,0);for(let Mt of Ne)qe._add(Mt);return qe.div(Ne.length)}(pe),this.touches=Pd(Ie,pe)))}touchmove(O,pe,Ie){if(this.aborted||!this.centroid)return;let Ne=Pd(Ie,pe);for(let qe in this.touches){let Mt=Ne[qe];(!Mt||Mt.dist(this.touches[qe])>30)&&(this.aborted=!0)}}touchend(O,pe,Ie){if((!this.centroid||O.timeStamp-this.startTime>500)&&(this.aborted=!0),Ie.length===0){let Ne=!this.aborted&&this.centroid;if(this.reset(),Ne)return Ne}}}class If{constructor(O){this.singleTap=new Cu(O),this.numTaps=O.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(O,pe,Ie){this.singleTap.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){this.singleTap.touchmove(O,pe,Ie)}touchend(O,pe,Ie){let Ne=this.singleTap.touchend(O,pe,Ie);if(Ne){let qe=O.timeStamp-this.lastTime<500,Mt=!this.lastTap||this.lastTap.dist(Ne)<30;if(qe&&Mt||this.reset(),this.count++,this.lastTime=O.timeStamp,this.lastTap=Ne,this.count===this.numTaps)return this.reset(),Ne}}}class nf{constructor(O){this._tr=new Uh(O),this._zoomIn=new If({numTouches:1,numTaps:2}),this._zoomOut=new If({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(O,pe,Ie){this._zoomIn.touchstart(O,pe,Ie),this._zoomOut.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){this._zoomIn.touchmove(O,pe,Ie),this._zoomOut.touchmove(O,pe,Ie)}touchend(O,pe,Ie){let Ne=this._zoomIn.touchend(O,pe,Ie),qe=this._zoomOut.touchend(O,pe,Ie),Mt=this._tr;return Ne?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:jt=>jt.easeTo({duration:300,zoom:Mt.zoom+1,around:Mt.unproject(Ne)},{originalEvent:O})}):qe?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:jt=>jt.easeTo({duration:300,zoom:Mt.zoom-1,around:Mt.unproject(qe)},{originalEvent:O})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hh{constructor(O){this._enabled=!!O.enable,this._moveStateManager=O.moveStateManager,this._clickTolerance=O.clickTolerance||1,this._moveFunction=O.move,this._activateOnStart=!!O.activateOnStart,O.assignEvents(this),this.reset()}reset(O){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(O)}_move(...O){let pe=this._moveFunction(...O);if(pe.bearingDelta||pe.pitchDelta||pe.around||pe.panDelta)return this._active=!0,pe}dragStart(O,pe){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(O)&&(this._moveStateManager.startMove(O),this._lastPoint=pe.length?pe[0]:pe,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(O,pe){if(!this.isEnabled())return;let Ie=this._lastPoint;if(!Ie)return;if(O.preventDefault(),!this._moveStateManager.isValidMoveEvent(O))return void this.reset(O);let Ne=pe.length?pe[0]:pe;return!this._moved&&Ne.dist(Ie){Ke.mousedown=Ke.dragStart,Ke.mousemoveWindow=Ke.dragMove,Ke.mouseup=Ke.dragEnd,Ke.contextmenu=O=>{O.preventDefault()}},Ac=({enable:Ke,clickTolerance:O,bearingDegreesPerPixelMoved:pe=.8})=>{let Ie=new af({checkCorrectEvent:Ne=>s.mouseButton(Ne)===0&&Ne.ctrlKey||s.mouseButton(Ne)===2});return new hh({clickTolerance:O,move:(Ne,qe)=>({bearingDelta:(qe.x-Ne.x)*pe}),moveStateManager:Ie,enable:Ke,assignEvents:Qd})},md=({enable:Ke,clickTolerance:O,pitchDegreesPerPixelMoved:pe=-.5})=>{let Ie=new af({checkCorrectEvent:Ne=>s.mouseButton(Ne)===0&&Ne.ctrlKey||s.mouseButton(Ne)===2});return new hh({clickTolerance:O,move:(Ne,qe)=>({pitchDelta:(qe.y-Ne.y)*pe}),moveStateManager:Ie,enable:Ke,assignEvents:Qd})};class fh{constructor(O,pe){this._clickTolerance=O.clickTolerance||1,this._map=pe,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(O){return O<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(O,pe,Ie){return this._calculateTransform(O,pe,Ie)}touchmove(O,pe,Ie){if(this._active){if(!this._shouldBePrevented(Ie.length))return O.preventDefault(),this._calculateTransform(O,pe,Ie);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",O)}}touchend(O,pe,Ie){this._calculateTransform(O,pe,Ie),this._active&&this._shouldBePrevented(Ie.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(O,pe,Ie){Ie.length>0&&(this._active=!0);let Ne=Pd(Ie,pe),qe=new n.P(0,0),Mt=new n.P(0,0),jt=0;for(let kr in Ne){let Hr=Ne[kr],Vr=this._touches[kr];Vr&&(qe._add(Hr),Mt._add(Hr.sub(Vr)),jt++,Ne[kr]=Hr)}if(this._touches=Ne,this._shouldBePrevented(jt)||!Mt.mag())return;let er=Mt.div(jt);return this._sum._add(er),this._sum.mag()Math.abs(Ke.x)}class ad extends $h{constructor(O){super(),this._currentTouchCount=0,this._map=O}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(O,pe,Ie){super.touchstart(O,pe,Ie),this._currentTouchCount=Ie.length}_start(O){this._lastPoints=O,Dh(O[0].sub(O[1]))&&(this._valid=!1)}_move(O,pe,Ie){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Ne=O[0].sub(this._lastPoints[0]),qe=O[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Ne,qe,Ie.timeStamp),this._valid?(this._lastPoints=O,this._active=!0,{pitchDelta:(Ne.y+qe.y)/2*-.5}):void 0}gestureBeginsVertically(O,pe,Ie){if(this._valid!==void 0)return this._valid;let Ne=O.mag()>=2,qe=pe.mag()>=2;if(!Ne&&!qe)return;if(!Ne||!qe)return this._firstMove===void 0&&(this._firstMove=Ie),Ie-this._firstMove<100&&void 0;let Mt=O.y>0==pe.y>0;return Dh(O)&&Dh(pe)&&Mt}}let wr={panStep:100,bearingStep:15,pitchStep:10};class Yr{constructor(O){this._tr=new Uh(O);let pe=wr;this._panStep=pe.panStep,this._bearingStep=pe.bearingStep,this._pitchStep=pe.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(O){if(O.altKey||O.ctrlKey||O.metaKey)return;let pe=0,Ie=0,Ne=0,qe=0,Mt=0;switch(O.keyCode){case 61:case 107:case 171:case 187:pe=1;break;case 189:case 109:case 173:pe=-1;break;case 37:O.shiftKey?Ie=-1:(O.preventDefault(),qe=-1);break;case 39:O.shiftKey?Ie=1:(O.preventDefault(),qe=1);break;case 38:O.shiftKey?Ne=1:(O.preventDefault(),Mt=-1);break;case 40:O.shiftKey?Ne=-1:(O.preventDefault(),Mt=1);break;default:return}return this._rotationDisabled&&(Ie=0,Ne=0),{cameraAnimation:jt=>{let er=this._tr;jt.easeTo({duration:300,easeId:"keyboardHandler",easing:Ni,zoom:pe?Math.round(er.zoom)+pe*(O.shiftKey?2:1):er.zoom,bearing:er.bearing+Ie*this._bearingStep,pitch:er.pitch+Ne*this._pitchStep,offset:[-qe*this._panStep,-Mt*this._panStep],center:er.center},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Ni(Ke){return Ke*(2-Ke)}let Ai=4.000244140625;class hn{constructor(O,pe){this._onTimeout=Ie=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Ie)},this._map=O,this._tr=new Uh(O),this._triggerRenderFrame=pe,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(O){this._defaultZoomRate=O}setWheelZoomRate(O){this._wheelZoomRate=O}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(O){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!O&&O.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(O){return!!this._map.cooperativeGestures.isEnabled()&&!(O.ctrlKey||this._map.cooperativeGestures.isBypassed(O))}wheel(O){if(!this.isEnabled())return;if(this._shouldBePrevented(O))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",O);let pe=O.deltaMode===WheelEvent.DOM_DELTA_LINE?40*O.deltaY:O.deltaY,Ie=u.now(),Ne=Ie-(this._lastWheelEventTime||0);this._lastWheelEventTime=Ie,pe!==0&&pe%Ai==0?this._type="wheel":pe!==0&&Math.abs(pe)<4?this._type="trackpad":Ne>400?(this._type=null,this._lastValue=pe,this._timeout=setTimeout(this._onTimeout,40,O)):this._type||(this._type=Math.abs(Ne*pe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,pe+=this._lastValue)),O.shiftKey&&pe&&(pe/=4),this._type&&(this._lastWheelEvent=O,this._delta-=pe,this._active||this._start(O)),O.preventDefault()}_start(O){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let pe=s.mousePos(this._map.getCanvas(),O),Ie=this._tr;this._around=pe.y>Ie.transform.height/2-Ie.transform.getHorizon()?n.N.convert(this._aroundCenter?Ie.center:Ie.unproject(pe)):n.N.convert(Ie.center),this._aroundPoint=Ie.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let O=this._tr.transform;if(this._delta!==0){let er=this._type==="wheel"&&Math.abs(this._delta)>Ai?this._wheelZoomRate:this._defaultZoomRate,kr=2/(1+Math.exp(-Math.abs(this._delta*er)));this._delta<0&&kr!==0&&(kr=1/kr);let Hr=typeof this._targetZoom=="number"?O.zoomScale(this._targetZoom):O.scale;this._targetZoom=Math.min(O.maxZoom,Math.max(O.minZoom,O.scaleZoom(Hr*kr))),this._type==="wheel"&&(this._startZoom=O.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let pe=typeof this._targetZoom=="number"?this._targetZoom:O.zoom,Ie=this._startZoom,Ne=this._easing,qe,Mt=!1,jt=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Ie&&Ne&&jt){let er=Math.min(jt/200,1),kr=Ne(er);qe=n.y.number(Ie,pe,kr),er<1?this._frameId||(this._frameId=!0):Mt=!0}else qe=pe,Mt=!0;return this._active=!0,Mt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Mt,zoomDelta:qe-O.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(O){let pe=n.b9;if(this._prevEase){let Ie=this._prevEase,Ne=(u.now()-Ie.start)/Ie.duration,qe=Ie.easing(Ne+.01)-Ie.easing(Ne),Mt=.27/Math.sqrt(qe*qe+1e-4)*.01,jt=Math.sqrt(.0729-Mt*Mt);pe=n.b8(Mt,jt,.25,1)}return this._prevEase={start:u.now(),duration:O,easing:pe},pe}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ln{constructor(O,pe){this._clickZoom=O,this._tapZoom=pe}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class pa{constructor(O){this._tr=new Uh(O),this.reset()}reset(){this._active=!1}dblclick(O,pe){return O.preventDefault(),{cameraAnimation:Ie=>{Ie.easeTo({duration:300,zoom:this._tr.zoom+(O.shiftKey?-1:1),around:this._tr.unproject(pe)},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ea{constructor(){this._tap=new If({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(O,pe,Ie){if(!this._swipePoint)if(this._tapTime){let Ne=pe[0],qe=O.timeStamp-this._tapTime<500,Mt=this._tapPoint.dist(Ne)<30;qe&&Mt?Ie.length>0&&(this._swipePoint=Ne,this._swipeTouch=Ie[0].identifier):this.reset()}else this._tap.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){if(this._tapTime){if(this._swipePoint){if(Ie[0].identifier!==this._swipeTouch)return;let Ne=pe[0],qe=Ne.y-this._swipePoint.y;return this._swipePoint=Ne,O.preventDefault(),this._active=!0,{zoomDelta:qe/128}}}else this._tap.touchmove(O,pe,Ie)}touchend(O,pe,Ie){if(this._tapTime)this._swipePoint&&Ie.length===0&&this.reset();else{let Ne=this._tap.touchend(O,pe,Ie);Ne&&(this._tapTime=O.timeStamp,this._tapPoint=Ne)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Za{constructor(O,pe,Ie){this._el=O,this._mousePan=pe,this._touchPan=Ie}enable(O){this._inertiaOptions=O||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ao{constructor(O,pe,Ie){this._pitchWithRotate=O.pitchWithRotate,this._mouseRotate=pe,this._mousePitch=Ie}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class xa{constructor(O,pe,Ie,Ne){this._el=O,this._touchZoom=pe,this._touchRotate=Ie,this._tapDragZoom=Ne,this._rotationDisabled=!1,this._enabled=!0}enable(O){this._touchZoom.enable(O),this._rotationDisabled||this._touchRotate.enable(O),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Va{constructor(O,pe){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=O,this._options=pe,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let O=this._map.getCanvasContainer();O.classList.add("maplibregl-cooperative-gestures"),this._container=s.create("div","maplibregl-cooperative-gesture-screen",O);let pe=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(pe=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Ie=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Ne=document.createElement("div");Ne.className="maplibregl-desktop-message",Ne.textContent=pe,this._container.appendChild(Ne);let qe=document.createElement("div");qe.className="maplibregl-mobile-message",qe.textContent=Ie,this._container.appendChild(qe),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(s.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(O){return O[this._bypassKey]}notifyGestureBlocked(O,pe){this._enabled&&(this._map.fire(new n.k("cooperativegestureprevented",{gestureType:O,originalEvent:pe})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Oa=Ke=>Ke.zoom||Ke.drag||Ke.pitch||Ke.rotate;class fa extends n.k{}function vo(Ke){return Ke.panDelta&&Ke.panDelta.mag()||Ke.zoomDelta||Ke.bearingDelta||Ke.pitchDelta}class hs{constructor(O,pe){this.handleWindowEvent=Ne=>{this.handleEvent(Ne,`${Ne.type}Window`)},this.handleEvent=(Ne,qe)=>{if(Ne.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let Mt=Ne.type==="renderFrame"?void 0:Ne,jt={needsRenderFrame:!1},er={},kr={},Hr=Ne.touches,Vr=Hr?this._getMapTouches(Hr):void 0,ki=Vr?s.touchPos(this._map.getCanvas(),Vr):s.mousePos(this._map.getCanvas(),Ne);for(let{handlerName:lt,handler:Tt,allowed:Lt}of this._handlers){if(!Tt.isEnabled())continue;let Vt;this._blockedByActive(kr,Lt,lt)?Tt.reset():Tt[qe||Ne.type]&&(Vt=Tt[qe||Ne.type](Ne,ki,Vr),this.mergeHandlerResult(jt,er,Vt,lt,Mt),Vt&&Vt.needsRenderFrame&&this._triggerRenderFrame()),(Vt||Tt.isActive())&&(kr[lt]=Tt)}let Vi={};for(let lt in this._previousActiveHandlers)kr[lt]||(Vi[lt]=Mt);this._previousActiveHandlers=kr,(Object.keys(Vi).length||vo(jt))&&(this._changes.push([jt,er,Vi]),this._triggerRenderFrame()),(Object.keys(kr).length||vo(jt))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:tt}=jt;tt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],tt(this._map))},this._map=O,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Uf(O),this._bearingSnap=pe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(pe);let Ie=this._el;this._listeners=[[Ie,"touchstart",{passive:!0}],[Ie,"touchmove",{passive:!1}],[Ie,"touchend",void 0],[Ie,"touchcancel",void 0],[Ie,"mousedown",void 0],[Ie,"mousemove",void 0],[Ie,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Ie,"mouseover",void 0],[Ie,"mouseout",void 0],[Ie,"dblclick",void 0],[Ie,"click",void 0],[Ie,"keydown",{capture:!1}],[Ie,"keyup",void 0],[Ie,"wheel",{passive:!1}],[Ie,"contextmenu",void 0],[window,"blur",void 0]];for(let[Ne,qe,Mt]of this._listeners)s.addEventListener(Ne,qe,Ne===document?this.handleWindowEvent:this.handleEvent,Mt)}destroy(){for(let[O,pe,Ie]of this._listeners)s.removeEventListener(O,pe,O===document?this.handleWindowEvent:this.handleEvent,Ie)}_addDefaultHandlers(O){let pe=this._map,Ie=pe.getCanvasContainer();this._add("mapEvent",new Lh(pe,O));let Ne=pe.boxZoom=new Qc(pe,O);this._add("boxZoom",Ne),O.interactive&&O.boxZoom&&Ne.enable();let qe=pe.cooperativeGestures=new Va(pe,O.cooperativeGestures);this._add("cooperativeGestures",qe),O.cooperativeGestures&&qe.enable();let Mt=new nf(pe),jt=new pa(pe);pe.doubleClickZoom=new Ln(jt,Mt),this._add("tapZoom",Mt),this._add("clickZoom",jt),O.interactive&&O.doubleClickZoom&&pe.doubleClickZoom.enable();let er=new Ea;this._add("tapDragZoom",er);let kr=pe.touchPitch=new ad(pe);this._add("touchPitch",kr),O.interactive&&O.touchPitch&&pe.touchPitch.enable(O.touchPitch);let Hr=Ac(O),Vr=md(O);pe.dragRotate=new ao(O,Hr,Vr),this._add("mouseRotate",Hr,["mousePitch"]),this._add("mousePitch",Vr,["mouseRotate"]),O.interactive&&O.dragRotate&&pe.dragRotate.enable();let ki=(({enable:Vt,clickTolerance:Nt})=>{let Yt=new af({checkCorrectEvent:Lr=>s.mouseButton(Lr)===0&&!Lr.ctrlKey});return new hh({clickTolerance:Nt,move:(Lr,$r)=>({around:$r,panDelta:$r.sub(Lr)}),activateOnStart:!0,moveStateManager:Yt,enable:Vt,assignEvents:Qd})})(O),Vi=new fh(O,pe);pe.dragPan=new Za(Ie,ki,Vi),this._add("mousePan",ki),this._add("touchPan",Vi,["touchZoom","touchRotate"]),O.interactive&&O.dragPan&&pe.dragPan.enable(O.dragPan);let tt=new Tf,lt=new fu;pe.touchZoomRotate=new xa(Ie,lt,tt,er),this._add("touchRotate",tt,["touchPan","touchZoom"]),this._add("touchZoom",lt,["touchPan","touchRotate"]),O.interactive&&O.touchZoomRotate&&pe.touchZoomRotate.enable(O.touchZoomRotate);let Tt=pe.scrollZoom=new hn(pe,()=>this._triggerRenderFrame());this._add("scrollZoom",Tt,["mousePan"]),O.interactive&&O.scrollZoom&&pe.scrollZoom.enable(O.scrollZoom);let Lt=pe.keyboard=new Yr(pe);this._add("keyboard",Lt),O.interactive&&O.keyboard&&pe.keyboard.enable(),this._add("blockableMapEvent",new Lu(pe))}_add(O,pe,Ie){this._handlers.push({handlerName:O,handler:pe,allowed:Ie}),this._handlersById[O]=pe}stop(O){if(!this._updatingCamera){for(let{handler:pe}of this._handlers)pe.reset();this._inertia.clear(),this._fireEvents({},{},O),this._changes=[]}}isActive(){for(let{handler:O}of this._handlers)if(O.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Oa(this._eventsInProgress)||this.isZooming()}_blockedByActive(O,pe,Ie){for(let Ne in O)if(Ne!==Ie&&(!pe||pe.indexOf(Ne)<0))return!0;return!1}_getMapTouches(O){let pe=[];for(let Ie of O)this._el.contains(Ie.target)&&pe.push(Ie);return pe}mergeHandlerResult(O,pe,Ie,Ne,qe){if(!Ie)return;n.e(O,Ie);let Mt={handlerName:Ne,originalEvent:Ie.originalEvent||qe};Ie.zoomDelta!==void 0&&(pe.zoom=Mt),Ie.panDelta!==void 0&&(pe.drag=Mt),Ie.pitchDelta!==void 0&&(pe.pitch=Mt),Ie.bearingDelta!==void 0&&(pe.rotate=Mt)}_applyChanges(){let O={},pe={},Ie={};for(let[Ne,qe,Mt]of this._changes)Ne.panDelta&&(O.panDelta=(O.panDelta||new n.P(0,0))._add(Ne.panDelta)),Ne.zoomDelta&&(O.zoomDelta=(O.zoomDelta||0)+Ne.zoomDelta),Ne.bearingDelta&&(O.bearingDelta=(O.bearingDelta||0)+Ne.bearingDelta),Ne.pitchDelta&&(O.pitchDelta=(O.pitchDelta||0)+Ne.pitchDelta),Ne.around!==void 0&&(O.around=Ne.around),Ne.pinchAround!==void 0&&(O.pinchAround=Ne.pinchAround),Ne.noInertia&&(O.noInertia=Ne.noInertia),n.e(pe,qe),n.e(Ie,Mt);this._updateMapTransform(O,pe,Ie),this._changes=[]}_updateMapTransform(O,pe,Ie){let Ne=this._map,qe=Ne._getTransformForUpdate(),Mt=Ne.terrain;if(!(vo(O)||Mt&&this._terrainMovement))return this._fireEvents(pe,Ie,!0);let{panDelta:jt,zoomDelta:er,bearingDelta:kr,pitchDelta:Hr,around:Vr,pinchAround:ki}=O;ki!==void 0&&(Vr=ki),Ne._stop(!0),Vr=Vr||Ne.transform.centerPoint;let Vi=qe.pointLocation(jt?Vr.sub(jt):Vr);kr&&(qe.bearing+=kr),Hr&&(qe.pitch+=Hr),er&&(qe.zoom+=er),Mt?this._terrainMovement||!pe.drag&&!pe.zoom?pe.drag&&this._terrainMovement?qe.center=qe.pointLocation(qe.centerPoint.sub(jt)):qe.setLocationAtPoint(Vi,Vr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,qe.setLocationAtPoint(Vi,Vr)):qe.setLocationAtPoint(Vi,Vr),Ne._applyUpdatedTransform(qe),this._map._update(),O.noInertia||this._inertia.record(O),this._fireEvents(pe,Ie,!0)}_fireEvents(O,pe,Ie){let Ne=Oa(this._eventsInProgress),qe=Oa(O),Mt={};for(let Vr in O){let{originalEvent:ki}=O[Vr];this._eventsInProgress[Vr]||(Mt[`${Vr}start`]=ki),this._eventsInProgress[Vr]=O[Vr]}!Ne&&qe&&this._fireEvent("movestart",qe.originalEvent);for(let Vr in Mt)this._fireEvent(Vr,Mt[Vr]);qe&&this._fireEvent("move",qe.originalEvent);for(let Vr in O){let{originalEvent:ki}=O[Vr];this._fireEvent(Vr,ki)}let jt={},er;for(let Vr in this._eventsInProgress){let{handlerName:ki,originalEvent:Vi}=this._eventsInProgress[Vr];this._handlersById[ki].isActive()||(delete this._eventsInProgress[Vr],er=pe[ki]||Vi,jt[`${Vr}end`]=er)}for(let Vr in jt)this._fireEvent(Vr,jt[Vr]);let kr=Oa(this._eventsInProgress),Hr=(Ne||qe)&&!kr;if(Hr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Vr=this._map._getTransformForUpdate();Vr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Vr)}if(Ie&&Hr){this._updatingCamera=!0;let Vr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ki=Vi=>Vi!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new fa("renderFrame",{timeStamp:O})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class rs extends n.E{constructor(O,pe){super(),this._renderFrameCallback=()=>{let Ie=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Ie)),Ie<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=O,this._bearingSnap=pe.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new n.N(this.transform.center.lng,this.transform.center.lat)}setCenter(O,pe){return this.jumpTo({center:O},pe)}panBy(O,pe,Ie){return O=n.P.convert(O).mult(-1),this.panTo(this.transform.center,n.e({offset:O},pe),Ie)}panTo(O,pe,Ie){return this.easeTo(n.e({center:O},pe),Ie)}getZoom(){return this.transform.zoom}setZoom(O,pe){return this.jumpTo({zoom:O},pe),this}zoomTo(O,pe,Ie){return this.easeTo(n.e({zoom:O},pe),Ie)}zoomIn(O,pe){return this.zoomTo(this.getZoom()+1,O,pe),this}zoomOut(O,pe){return this.zoomTo(this.getZoom()-1,O,pe),this}getBearing(){return this.transform.bearing}setBearing(O,pe){return this.jumpTo({bearing:O},pe),this}getPadding(){return this.transform.padding}setPadding(O,pe){return this.jumpTo({padding:O},pe),this}rotateTo(O,pe,Ie){return this.easeTo(n.e({bearing:O},pe),Ie)}resetNorth(O,pe){return this.rotateTo(0,n.e({duration:1e3},O),pe),this}resetNorthPitch(O,pe){return this.easeTo(n.e({bearing:0,pitch:0,duration:1e3},O),pe),this}snapToNorth(O,pe){return Math.abs(this.getBearing()){if(this._zooming&&(Ne.zoom=n.y.number(qe,Tt,Zr)),this._rotating&&(Ne.bearing=n.y.number(Mt,kr,Zr)),this._pitching&&(Ne.pitch=n.y.number(jt,Hr,Zr)),this._padding&&(Ne.interpolatePadding(er,Vr,Zr),Vi=Ne.centerPoint.add(ki)),this.terrain&&!O.freezeElevation&&this._updateElevation(Zr),Yt)Ne.setLocationAtPoint(Yt,Lr);else{let di=Ne.zoomScale(Ne.zoom-qe),zi=Tt>qe?Math.min(2,Nt):Math.max(.5,Nt),Ki=Math.pow(zi,1-Zr),nn=Ne.unproject(Lt.add(Vt.mult(Zr*Ki)).mult(di));Ne.setLocationAtPoint(Ne.renderWorldCopies?nn.wrap():nn,Vi)}this._applyUpdatedTransform(Ne),this._fireMoveEvents(pe)},Zr=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pe,Zr)},O),this}_prepareEase(O,pe,Ie={}){this._moving=!0,pe||Ie.moving||this.fire(new n.k("movestart",O)),this._zooming&&!Ie.zooming&&this.fire(new n.k("zoomstart",O)),this._rotating&&!Ie.rotating&&this.fire(new n.k("rotatestart",O)),this._pitching&&!Ie.pitching&&this.fire(new n.k("pitchstart",O))}_prepareElevation(O){this._elevationCenter=O,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(O,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(O){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let pe=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(O<1&&pe!==this._elevationTarget){let Ie=this._elevationTarget-this._elevationStart;this._elevationStart+=O*(Ie-(pe-(Ie*O+this._elevationStart))/(1-O)),this._elevationTarget=pe}this.transform.elevation=n.y.number(this._elevationStart,this._elevationTarget,O)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(O){let pe=O.getCameraPosition(),Ie=this.terrain.getElevationForLngLatZoom(pe.lngLat,O.zoom);if(pe.altitudethis._elevateCameraIfInsideTerrain(Ne)),this.transformCameraUpdate&&pe.push(Ne=>this.transformCameraUpdate(Ne)),!pe.length)return;let Ie=O.clone();for(let Ne of pe){let qe=Ie.clone(),{center:Mt,zoom:jt,pitch:er,bearing:kr,elevation:Hr}=Ne(qe);Mt&&(qe.center=Mt),jt!==void 0&&(qe.zoom=jt),er!==void 0&&(qe.pitch=er),kr!==void 0&&(qe.bearing=kr),Hr!==void 0&&(qe.elevation=Hr),Ie.apply(qe)}this.transform.apply(Ie)}_fireMoveEvents(O){this.fire(new n.k("move",O)),this._zooming&&this.fire(new n.k("zoom",O)),this._rotating&&this.fire(new n.k("rotate",O)),this._pitching&&this.fire(new n.k("pitch",O))}_afterEase(O,pe){if(this._easeId&&pe&&this._easeId===pe)return;delete this._easeId;let Ie=this._zooming,Ne=this._rotating,qe=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ie&&this.fire(new n.k("zoomend",O)),Ne&&this.fire(new n.k("rotateend",O)),qe&&this.fire(new n.k("pitchend",O)),this.fire(new n.k("moveend",O))}flyTo(O,pe){var Ie;if(!O.essential&&u.prefersReducedMotion){let Ba=n.M(O,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ba,pe)}this.stop(),O=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.b9},O);let Ne=this._getTransformForUpdate(),qe=Ne.zoom,Mt=Ne.bearing,jt=Ne.pitch,er=Ne.padding,kr="bearing"in O?this._normalizeBearing(O.bearing,Mt):Mt,Hr="pitch"in O?+O.pitch:jt,Vr="padding"in O?O.padding:Ne.padding,ki=n.P.convert(O.offset),Vi=Ne.centerPoint.add(ki),tt=Ne.pointLocation(Vi),{center:lt,zoom:Tt}=Ne.getConstrained(n.N.convert(O.center||tt),(Ie=O.zoom)!==null&&Ie!==void 0?Ie:qe);this._normalizeCenter(lt,Ne);let Lt=Ne.zoomScale(Tt-qe),Vt=Ne.project(tt),Nt=Ne.project(lt).sub(Vt),Yt=O.curve,Lr=Math.max(Ne.width,Ne.height),$r=Lr/Lt,Zr=Nt.mag();if("minZoom"in O){let Ba=n.ac(Math.min(O.minZoom,qe,Tt),Ne.minZoom,Ne.maxZoom),xo=Lr/Ne.zoomScale(Ba-qe);Yt=Math.sqrt(xo/Zr*2)}let di=Yt*Yt;function zi(Ba){let xo=($r*$r-Lr*Lr+(Ba?-1:1)*di*di*Zr*Zr)/(2*(Ba?$r:Lr)*di*Zr);return Math.log(Math.sqrt(xo*xo+1)-xo)}function Ki(Ba){return(Math.exp(Ba)-Math.exp(-Ba))/2}function nn(Ba){return(Math.exp(Ba)+Math.exp(-Ba))/2}let kn=zi(!1),Jn=function(Ba){return nn(kn)/nn(kn+Yt*Ba)},Sa=function(Ba){return Lr*((nn(kn)*(Ki(xo=kn+Yt*Ba)/nn(xo))-Ki(kn))/di)/Zr;var xo},wa=(zi(!0)-kn)/Yt;if(Math.abs(Zr)<1e-6||!isFinite(wa)){if(Math.abs(Lr-$r)<1e-6)return this.easeTo(O,pe);let Ba=$r0,Jn=xo=>Math.exp(Ba*Yt*xo)}return O.duration="duration"in O?+O.duration:1e3*wa/("screenSpeed"in O?+O.screenSpeed/Yt:+O.speed),O.maxDuration&&O.duration>O.maxDuration&&(O.duration=0),this._zooming=!0,this._rotating=Mt!==kr,this._pitching=Hr!==jt,this._padding=!Ne.isPaddingEqual(Vr),this._prepareEase(pe,!1),this.terrain&&this._prepareElevation(lt),this._ease(Ba=>{let xo=Ba*wa,Go=1/Jn(xo);Ne.zoom=Ba===1?Tt:qe+Ne.scaleZoom(Go),this._rotating&&(Ne.bearing=n.y.number(Mt,kr,Ba)),this._pitching&&(Ne.pitch=n.y.number(jt,Hr,Ba)),this._padding&&(Ne.interpolatePadding(er,Vr,Ba),Vi=Ne.centerPoint.add(ki)),this.terrain&&!O.freezeElevation&&this._updateElevation(Ba);let Bo=Ba===1?lt:Ne.unproject(Vt.add(Nt.mult(Sa(xo))).mult(Go));Ne.setLocationAtPoint(Ne.renderWorldCopies?Bo.wrap():Bo,Vi),this._applyUpdatedTransform(Ne),this._fireMoveEvents(pe)},()=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pe)},O),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(O,pe){var Ie;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Ne=this._onEaseEnd;delete this._onEaseEnd,Ne.call(this,pe)}return O||(Ie=this.handlers)===null||Ie===void 0||Ie.stop(!1),this}_ease(O,pe,Ie){Ie.animate===!1||Ie.duration===0?(O(1),pe()):(this._easeStart=u.now(),this._easeOptions=Ie,this._onEaseFrame=O,this._onEaseEnd=pe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(O,pe){O=n.b3(O,-180,180);let Ie=Math.abs(O-pe);return Math.abs(O-360-pe)180?-360:Ie<-180?360:0}queryTerrainElevation(O){return this.terrain?this.terrain.getElevationForLngLatZoom(n.N.convert(O),this.transform.tileZoom)-this.transform.elevation:null}}let ps={compact:!0,customAttribution:'MapLibre'};class xs{constructor(O=ps){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=pe=>{!pe||pe.sourceDataType!=="metadata"&&pe.sourceDataType!=="visibility"&&pe.dataType!=="style"&&pe.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=O}getDefaultPosition(){return"bottom-right"}onAdd(O){return this._map=O,this._compact=this.options.compact,this._container=s.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=s.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){s.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(O,pe){let Ie=this._map._getUIString(`AttributionControl.${pe}`);O.title=Ie,O.setAttribute("aria-label",Ie)}_updateAttributions(){if(!this._map.style)return;let O=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?O=O.concat(this.options.customAttribution.map(Ne=>typeof Ne!="string"?"":Ne)):typeof this.options.customAttribution=="string"&&O.push(this.options.customAttribution)),this._map.style.stylesheet){let Ne=this._map.style.stylesheet;this.styleOwner=Ne.owner,this.styleId=Ne.id}let pe=this._map.style.sourceCaches;for(let Ne in pe){let qe=pe[Ne];if(qe.used||qe.usedForTerrain){let Mt=qe.getSource();Mt.attribution&&O.indexOf(Mt.attribution)<0&&O.push(Mt.attribution)}}O=O.filter(Ne=>String(Ne).trim()),O.sort((Ne,qe)=>Ne.length-qe.length),O=O.filter((Ne,qe)=>{for(let Mt=qe+1;Mt=0)return!1;return!0});let Ie=O.join(" | ");Ie!==this._attribHTML&&(this._attribHTML=Ie,O.length?(this._innerContainer.innerHTML=Ie,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class _o{constructor(O={}){this._updateCompact=()=>{let pe=this._container.children;if(pe.length){let Ie=pe[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Ie.classList.add("maplibregl-compact"):Ie.classList.remove("maplibregl-compact")}},this.options=O}getDefaultPosition(){return"bottom-left"}onAdd(O){this._map=O,this._compact=this.options&&this.options.compact,this._container=s.create("div","maplibregl-ctrl");let pe=s.create("a","maplibregl-ctrl-logo");return pe.target="_blank",pe.rel="noopener nofollow",pe.href="https://maplibre.org/",pe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),pe.setAttribute("rel","noopener nofollow"),this._container.appendChild(pe),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){s.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class io{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(O){let pe=++this._id;return this._queue.push({callback:O,id:pe,cancelled:!1}),pe}remove(O){let pe=this._currentlyRunning,Ie=pe?this._queue.concat(pe):this._queue;for(let Ne of Ie)if(Ne.id===O)return void(Ne.cancelled=!0)}run(O=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let pe=this._currentlyRunning=this._queue;this._queue=[];for(let Ie of pe)if(!Ie.cancelled&&(Ie.callback(O),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var bs=n.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ll extends n.E{constructor(O){super(),this.sourceCache=O,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,O.usedForTerrain=!0,O.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(O,pe){this.sourceCache.update(O,pe),this._renderableTilesKeys=[];let Ie={};for(let Ne of O.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:pe}))Ie[Ne.key]=!0,this._renderableTilesKeys.push(Ne.key),this._tiles[Ne.key]||(Ne.posMatrix=new Float64Array(16),n.aP(Ne.posMatrix,0,n.X,0,n.X,0,1),this._tiles[Ne.key]=new ut(Ne,this.tileSize));for(let Ne in this._tiles)Ie[Ne]||delete this._tiles[Ne]}freeRtt(O){for(let pe in this._tiles){let Ie=this._tiles[pe];(!O||Ie.tileID.equals(O)||Ie.tileID.isChildOf(O)||O.isChildOf(Ie.tileID))&&(Ie.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(O=>this.getTileByID(O))}getTileByID(O){return this._tiles[O]}getTerrainCoords(O){let pe={};for(let Ie of this._renderableTilesKeys){let Ne=this._tiles[Ie].tileID;if(Ne.canonical.equals(O.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16),n.aP(qe.posMatrix,0,n.X,0,n.X,0,1),pe[Ie]=qe}else if(Ne.canonical.isChildOf(O.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16);let Mt=Ne.canonical.z-O.canonical.z,jt=Ne.canonical.x-(Ne.canonical.x>>Mt<>Mt<>Mt;n.aP(qe.posMatrix,0,kr,0,kr,0,1),n.J(qe.posMatrix,qe.posMatrix,[-jt*kr,-er*kr,0]),pe[Ie]=qe}else if(O.canonical.isChildOf(Ne.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16);let Mt=O.canonical.z-Ne.canonical.z,jt=O.canonical.x-(O.canonical.x>>Mt<>Mt<>Mt;n.aP(qe.posMatrix,0,n.X,0,n.X,0,1),n.J(qe.posMatrix,qe.posMatrix,[jt*kr,er*kr,0]),n.K(qe.posMatrix,qe.posMatrix,[1/2**Mt,1/2**Mt,0]),pe[Ie]=qe}}return pe}getSourceTile(O,pe){let Ie=this.sourceCache._source,Ne=O.overscaledZ-this.deltaZoom;if(Ne>Ie.maxzoom&&(Ne=Ie.maxzoom),Ne=Ie.minzoom&&(!qe||!qe.dem);)qe=this.sourceCache.getTileByID(O.scaledTo(Ne--).key);return qe}tilesAfterTime(O=Date.now()){return Object.values(this._tiles).filter(pe=>pe.timeAdded>=O)}}class Ul{constructor(O,pe,Ie){this.painter=O,this.sourceCache=new ll(pe),this.options=Ie,this.exaggeration=typeof Ie.exaggeration=="number"?Ie.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(O,pe,Ie,Ne=n.X){var qe;if(!(pe>=0&&pe=0&&IeO.canonical.z&&(O.canonical.z>=Ne?qe=O.canonical.z-Ne:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let Mt=O.canonical.x-(O.canonical.x>>qe<>qe<>8<<4|qe>>8,pe[Mt+3]=0;let Ie=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(pe.buffer)),Ne=new g(O,Ie,O.gl.RGBA,{premultiply:!1});return Ne.bind(O.gl.NEAREST,O.gl.CLAMP_TO_EDGE),this._coordsTexture=Ne,Ne}pointCoordinate(O){this.painter.maybeDrawDepthAndCoords(!0);let pe=new Uint8Array(4),Ie=this.painter.context,Ne=Ie.gl,qe=Math.round(O.x*this.painter.pixelRatio/devicePixelRatio),Mt=Math.round(O.y*this.painter.pixelRatio/devicePixelRatio),jt=Math.round(this.painter.height/devicePixelRatio);Ie.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Ne.readPixels(qe,jt-Mt-1,1,1,Ne.RGBA,Ne.UNSIGNED_BYTE,pe),Ie.bindFramebuffer.set(null);let er=pe[0]+(pe[2]>>4<<8),kr=pe[1]+((15&pe[2])<<8),Hr=this.coordsIndex[255-pe[3]],Vr=Hr&&this.sourceCache.getTileByID(Hr);if(!Vr)return null;let ki=this._coordsTextureSize,Vi=(1<O.id!==pe),this._recentlyUsed.push(O.id)}stampObject(O){O.stamp=++this._stamp}getOrCreateFreeObject(){for(let pe of this._recentlyUsed)if(!this._objects[pe].inUse)return this._objects[pe];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let O=this._createObject(this._objects.length);return this._objects.push(O),O}freeObject(O){O.inUse=!1}freeAllObjects(){for(let O of this._objects)this.freeObject(O)}isFull(){return!(this._objects.length!O.inUse)===!1}}let Ql={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class gu{constructor(O,pe){this.painter=O,this.terrain=pe,this.pool=new mu(O.context,30,pe.sourceCache.tileSize*pe.qualityFactor)}destruct(){this.pool.destruct()}getTexture(O){return this.pool.getObjectForId(O.rtt[this._stacks.length-1].id).texture}prepareForRender(O,pe){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=O._order.filter(Ie=>!O._layers[Ie].isHidden(pe)),this._coordsDescendingInv={};for(let Ie in O.sourceCaches){this._coordsDescendingInv[Ie]={};let Ne=O.sourceCaches[Ie].getVisibleCoordinates();for(let qe of Ne){let Mt=this.terrain.sourceCache.getTerrainCoords(qe);for(let jt in Mt)this._coordsDescendingInv[Ie][jt]||(this._coordsDescendingInv[Ie][jt]=[]),this._coordsDescendingInv[Ie][jt].push(Mt[jt])}}this._coordsDescendingInvStr={};for(let Ie of O._order){let Ne=O._layers[Ie],qe=Ne.source;if(Ql[Ne.type]&&!this._coordsDescendingInvStr[qe]){this._coordsDescendingInvStr[qe]={};for(let Mt in this._coordsDescendingInv[qe])this._coordsDescendingInvStr[qe][Mt]=this._coordsDescendingInv[qe][Mt].map(jt=>jt.key).sort().join()}}for(let Ie of this._renderableTiles)for(let Ne in this._coordsDescendingInvStr){let qe=this._coordsDescendingInvStr[Ne][Ie.tileID.key];qe&&qe!==Ie.rttCoords[Ne]&&(Ie.rtt=[])}}renderLayer(O){if(O.isHidden(this.painter.transform.zoom))return!1;let pe=O.type,Ie=this.painter,Ne=this._renderableLayerIds[this._renderableLayerIds.length-1]===O.id;if(Ql[pe]&&(this._prevType&&Ql[this._prevType]||this._stacks.push([]),this._prevType=pe,this._stacks[this._stacks.length-1].push(O.id),!Ne))return!0;if(Ql[this._prevType]||Ql[pe]&&Ne){this._prevType=pe;let qe=this._stacks.length-1,Mt=this._stacks[qe]||[];for(let jt of this._renderableTiles){if(this.pool.isFull()&&(Vu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(jt),jt.rtt[qe]){let kr=this.pool.getObjectForId(jt.rtt[qe].id);if(kr.stamp===jt.rtt[qe].stamp){this.pool.useObject(kr);continue}}let er=this.pool.getOrCreateFreeObject();this.pool.useObject(er),this.pool.stampObject(er),jt.rtt[qe]={id:er.id,stamp:er.stamp},Ie.context.bindFramebuffer.set(er.fbo.framebuffer),Ie.context.clear({color:n.aM.transparent,stencil:0}),Ie.currentStencilSource=void 0;for(let kr=0;kr{Ke.touchstart=Ke.dragStart,Ke.touchmoveWindow=Ke.dragMove,Ke.touchend=Ke.dragEnd},Ho={showCompass:!0,showZoom:!0,visualizePitch:!1};class Is{constructor(O,pe,Ie=!1){this.mousedown=Mt=>{this.startMouse(n.e({},Mt,{ctrlKey:!0,preventDefault:()=>Mt.preventDefault()}),s.mousePos(this.element,Mt)),s.addEventListener(window,"mousemove",this.mousemove),s.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=Mt=>{this.moveMouse(Mt,s.mousePos(this.element,Mt))},this.mouseup=Mt=>{this.mouseRotate.dragEnd(Mt),this.mousePitch&&this.mousePitch.dragEnd(Mt),this.offTemp()},this.touchstart=Mt=>{Mt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=s.touchPos(this.element,Mt.targetTouches)[0],this.startTouch(Mt,this._startPos),s.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.addEventListener(window,"touchend",this.touchend))},this.touchmove=Mt=>{Mt.targetTouches.length!==1?this.reset():(this._lastPos=s.touchPos(this.element,Mt.targetTouches)[0],this.moveTouch(Mt,this._lastPos))},this.touchend=Mt=>{Mt.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Ne=O.dragRotate._mouseRotate.getClickTolerance(),qe=O.dragRotate._mousePitch.getClickTolerance();this.element=pe,this.mouseRotate=Ac({clickTolerance:Ne,enable:!0}),this.touchRotate=(({enable:Mt,clickTolerance:jt,bearingDegreesPerPixelMoved:er=.8})=>{let kr=new Df;return new hh({clickTolerance:jt,move:(Hr,Vr)=>({bearingDelta:(Vr.x-Hr.x)*er}),moveStateManager:kr,enable:Mt,assignEvents:xu})})({clickTolerance:Ne,enable:!0}),this.map=O,Ie&&(this.mousePitch=md({clickTolerance:qe,enable:!0}),this.touchPitch=(({enable:Mt,clickTolerance:jt,pitchDegreesPerPixelMoved:er=-.5})=>{let kr=new Df;return new hh({clickTolerance:jt,move:(Hr,Vr)=>({pitchDelta:(Vr.y-Hr.y)*er}),moveStateManager:kr,enable:Mt,assignEvents:xu})})({clickTolerance:qe,enable:!0})),s.addEventListener(pe,"mousedown",this.mousedown),s.addEventListener(pe,"touchstart",this.touchstart,{passive:!1}),s.addEventListener(pe,"touchcancel",this.reset)}startMouse(O,pe){this.mouseRotate.dragStart(O,pe),this.mousePitch&&this.mousePitch.dragStart(O,pe),s.disableDrag()}startTouch(O,pe){this.touchRotate.dragStart(O,pe),this.touchPitch&&this.touchPitch.dragStart(O,pe),s.disableDrag()}moveMouse(O,pe){let Ie=this.map,{bearingDelta:Ne}=this.mouseRotate.dragMove(O,pe)||{};if(Ne&&Ie.setBearing(Ie.getBearing()+Ne),this.mousePitch){let{pitchDelta:qe}=this.mousePitch.dragMove(O,pe)||{};qe&&Ie.setPitch(Ie.getPitch()+qe)}}moveTouch(O,pe){let Ie=this.map,{bearingDelta:Ne}=this.touchRotate.dragMove(O,pe)||{};if(Ne&&Ie.setBearing(Ie.getBearing()+Ne),this.touchPitch){let{pitchDelta:qe}=this.touchPitch.dragMove(O,pe)||{};qe&&Ie.setPitch(Ie.getPitch()+qe)}}off(){let O=this.element;s.removeEventListener(O,"mousedown",this.mousedown),s.removeEventListener(O,"touchstart",this.touchstart,{passive:!1}),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend),s.removeEventListener(O,"touchcancel",this.reset),this.offTemp()}offTemp(){s.enableDrag(),s.removeEventListener(window,"mousemove",this.mousemove),s.removeEventListener(window,"mouseup",this.mouseup),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend)}}let iu;function Wl(Ke,O,pe){let Ie=new n.N(Ke.lng,Ke.lat);if(Ke=new n.N(Ke.lng,Ke.lat),O){let Ne=new n.N(Ke.lng-360,Ke.lat),qe=new n.N(Ke.lng+360,Ke.lat),Mt=pe.locationPoint(Ke).distSqr(O);pe.locationPoint(Ne).distSqr(O)180;){let Ne=pe.locationPoint(Ke);if(Ne.x>=0&&Ne.y>=0&&Ne.x<=pe.width&&Ne.y<=pe.height)break;Ke.lng>pe.center.lng?Ke.lng-=360:Ke.lng+=360}return Ke.lng!==Ie.lng&&pe.locationPoint(Ke).y>pe.height/2-pe.getHorizon()?Ke:Ie}let Mc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function eh(Ke,O,pe){let Ie=Ke.classList;for(let Ne in Mc)Ie.remove(`maplibregl-${pe}-anchor-${Ne}`);Ie.add(`maplibregl-${pe}-anchor-${O}`)}class Uc extends n.E{constructor(O){if(super(),this._onKeyPress=pe=>{let Ie=pe.code,Ne=pe.charCode||pe.keyCode;Ie!=="Space"&&Ie!=="Enter"&&Ne!==32&&Ne!==13||this.togglePopup()},this._onMapClick=pe=>{let Ie=pe.originalEvent.target,Ne=this._element;this._popup&&(Ie===Ne||Ne.contains(Ie))&&this.togglePopup()},this._update=pe=>{var Ie;if(!this._map)return;let Ne=this._map.loaded()&&!this._map.isMoving();(pe?.type==="terrain"||pe?.type==="render"&&!Ne)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Wl(this._lngLat,this._flatPos,this._map.transform):(Ie=this._lngLat)===null||Ie===void 0?void 0:Ie.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let qe="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?qe=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(qe=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Mt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Mt="rotateX(0deg)":this._pitchAlignment==="map"&&(Mt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||pe&&pe.type!=="moveend"||(this._pos=this._pos.round()),s.setTransform(this._element,`${Mc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Mt} ${qe}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(pe&&pe.type==="moveend")}).catch(()=>{})},this._onMove=pe=>{if(!this._isDragging){let Ie=this._clickTolerance||this._map._clickTolerance;this._isDragging=pe.point.dist(this._pointerdownPos)>=Ie}this._isDragging&&(this._pos=pe.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n.k("dragstart"))),this.fire(new n.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.k("dragend")),this._state="inactive"},this._addDragHandler=pe=>{this._element.contains(pe.originalEvent.target)&&(pe.preventDefault(),this._positionDelta=pe.point.sub(this._pos).add(this._offset),this._pointerdownPos=pe.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=O&&O.anchor||"center",this._color=O&&O.color||"#3FB1CE",this._scale=O&&O.scale||1,this._draggable=O&&O.draggable||!1,this._clickTolerance=O&&O.clickTolerance||0,this._subpixelPositioning=O&&O.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=O&&O.rotation||0,this._rotationAlignment=O&&O.rotationAlignment||"auto",this._pitchAlignment=O&&O.pitchAlignment&&O.pitchAlignment!=="auto"?O.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(O?.opacity,O?.opacityWhenCovered),O&&O.element)this._element=O.element,this._offset=n.P.convert(O&&O.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");let pe=s.createNS("http://www.w3.org/2000/svg","svg"),Ie=41,Ne=27;pe.setAttributeNS(null,"display","block"),pe.setAttributeNS(null,"height",`${Ie}px`),pe.setAttributeNS(null,"width",`${Ne}px`),pe.setAttributeNS(null,"viewBox",`0 0 ${Ne} ${Ie}`);let qe=s.createNS("http://www.w3.org/2000/svg","g");qe.setAttributeNS(null,"stroke","none"),qe.setAttributeNS(null,"stroke-width","1"),qe.setAttributeNS(null,"fill","none"),qe.setAttributeNS(null,"fill-rule","evenodd");let Mt=s.createNS("http://www.w3.org/2000/svg","g");Mt.setAttributeNS(null,"fill-rule","nonzero");let jt=s.createNS("http://www.w3.org/2000/svg","g");jt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),jt.setAttributeNS(null,"fill","#000000");let er=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let Lt of er){let Vt=s.createNS("http://www.w3.org/2000/svg","ellipse");Vt.setAttributeNS(null,"opacity","0.04"),Vt.setAttributeNS(null,"cx","10.5"),Vt.setAttributeNS(null,"cy","5.80029008"),Vt.setAttributeNS(null,"rx",Lt.rx),Vt.setAttributeNS(null,"ry",Lt.ry),jt.appendChild(Vt)}let kr=s.createNS("http://www.w3.org/2000/svg","g");kr.setAttributeNS(null,"fill",this._color);let Hr=s.createNS("http://www.w3.org/2000/svg","path");Hr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),kr.appendChild(Hr);let Vr=s.createNS("http://www.w3.org/2000/svg","g");Vr.setAttributeNS(null,"opacity","0.25"),Vr.setAttributeNS(null,"fill","#000000");let ki=s.createNS("http://www.w3.org/2000/svg","path");ki.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Vr.appendChild(ki);let Vi=s.createNS("http://www.w3.org/2000/svg","g");Vi.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Vi.setAttributeNS(null,"fill","#FFFFFF");let tt=s.createNS("http://www.w3.org/2000/svg","g");tt.setAttributeNS(null,"transform","translate(8.0, 8.0)");let lt=s.createNS("http://www.w3.org/2000/svg","circle");lt.setAttributeNS(null,"fill","#000000"),lt.setAttributeNS(null,"opacity","0.25"),lt.setAttributeNS(null,"cx","5.5"),lt.setAttributeNS(null,"cy","5.5"),lt.setAttributeNS(null,"r","5.4999962");let Tt=s.createNS("http://www.w3.org/2000/svg","circle");Tt.setAttributeNS(null,"fill","#FFFFFF"),Tt.setAttributeNS(null,"cx","5.5"),Tt.setAttributeNS(null,"cy","5.5"),Tt.setAttributeNS(null,"r","5.4999962"),tt.appendChild(lt),tt.appendChild(Tt),Mt.appendChild(jt),Mt.appendChild(kr),Mt.appendChild(Vr),Mt.appendChild(Vi),Mt.appendChild(tt),pe.appendChild(Mt),pe.setAttributeNS(null,"height",Ie*this._scale+"px"),pe.setAttributeNS(null,"width",Ne*this._scale+"px"),this._element.appendChild(pe),this._offset=n.P.convert(O&&O.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",pe=>{pe.preventDefault()}),this._element.addEventListener("mousedown",pe=>{pe.preventDefault()}),eh(this._element,this._anchor,"marker"),O&&O.className)for(let pe of O.className.split(" "))this._element.classList.add(pe);this._popup=null}addTo(O){return this.remove(),this._map=O,this._element.setAttribute("aria-label",O._getUIString("Marker.Title")),O.getCanvasContainer().appendChild(this._element),O.on("move",this._update),O.on("moveend",this._update),O.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),s.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(O){return this._lngLat=n.N.convert(O),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(O){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),O){if(!("offset"in O.options)){let pe=Math.abs(13.5)/Math.SQRT2;O.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[pe,-1*(38.1-13.5+pe)],"bottom-right":[-pe,-1*(38.1-13.5+pe)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=O,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(O){return this._subpixelPositioning=O,this}getPopup(){return this._popup}togglePopup(){let O=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:O?(O.isOpen()?O.remove():(O.setLngLat(this._lngLat),O.addTo(this._map)),this):this}_updateOpacity(O=!1){var pe,Ie;if(!(!((pe=this._map)===null||pe===void 0)&&pe.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(O)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Ne=this._map,qe=Ne.terrain.depthAtPoint(this._pos),Mt=Ne.terrain.getElevationForLngLatZoom(this._lngLat,Ne.transform.tileZoom);if(Ne.transform.lngLatToCameraDepth(this._lngLat,Mt)-qe<.006)return void(this._element.style.opacity=this._opacity);let jt=-this._offset.y/Ne.transform._pixelPerMeter,er=Math.sin(Ne.getPitch()*Math.PI/180)*jt,kr=Ne.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),Hr=Ne.transform.lngLatToCameraDepth(this._lngLat,Mt+er)-kr>.006;!((Ie=this._popup)===null||Ie===void 0)&&Ie.isOpen()&&Hr&&this._popup.remove(),this._element.style.opacity=Hr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(O){return this._offset=n.P.convert(O),this._update(),this}addClassName(O){this._element.classList.add(O)}removeClassName(O){this._element.classList.remove(O)}toggleClassName(O){return this._element.classList.toggle(O)}setDraggable(O){return this._draggable=!!O,this._map&&(O?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(O){return this._rotation=O||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(O){return this._rotationAlignment=O||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(O){return this._pitchAlignment=O&&O!=="auto"?O:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(O,pe){return O===void 0&&pe===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),O!==void 0&&(this._opacity=O),pe!==void 0&&(this._opacityWhenCovered=pe),this._map&&this._updateOpacity(!0),this}}let Hh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},th=0,Vh=!1,Wu={maxWidth:100,unit:"metric"};function Wh(Ke,O,pe){let Ie=pe&&pe.maxWidth||100,Ne=Ke._container.clientHeight/2,qe=Ke.unproject([0,Ne]),Mt=Ke.unproject([Ie,Ne]),jt=qe.distanceTo(Mt);if(pe&&pe.unit==="imperial"){let er=3.2808*jt;er>5280?cs(O,Ie,er/5280,Ke._getUIString("ScaleControl.Miles")):cs(O,Ie,er,Ke._getUIString("ScaleControl.Feet"))}else pe&&pe.unit==="nautical"?cs(O,Ie,jt/1852,Ke._getUIString("ScaleControl.NauticalMiles")):jt>=1e3?cs(O,Ie,jt/1e3,Ke._getUIString("ScaleControl.Kilometers")):cs(O,Ie,jt,Ke._getUIString("ScaleControl.Meters"))}function cs(Ke,O,pe,Ie){let Ne=function(qe){let Mt=Math.pow(10,`${Math.floor(qe)}`.length-1),jt=qe/Mt;return jt=jt>=10?10:jt>=5?5:jt>=3?3:jt>=2?2:jt>=1?1:function(er){let kr=Math.pow(10,Math.ceil(-Math.log(er)/Math.LN10));return Math.round(er*kr)/kr}(jt),Mt*jt}(pe);Ke.style.width=O*(Ne/pe)+"px",Ke.innerHTML=`${Ne} ${Ie}`}let Fs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},rh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function tc(Ke){if(Ke){if(typeof Ke=="number"){let O=Math.round(Math.abs(Ke)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,Ke),"top-left":new n.P(O,O),"top-right":new n.P(-O,O),bottom:new n.P(0,-Ke),"bottom-left":new n.P(O,-O),"bottom-right":new n.P(-O,-O),left:new n.P(Ke,0),right:new n.P(-Ke,0)}}if(Ke instanceof n.P||Array.isArray(Ke)){let O=n.P.convert(Ke);return{center:O,top:O,"top-left":O,"top-right":O,bottom:O,"bottom-left":O,"bottom-right":O,left:O,right:O}}return{center:n.P.convert(Ke.center||[0,0]),top:n.P.convert(Ke.top||[0,0]),"top-left":n.P.convert(Ke["top-left"]||[0,0]),"top-right":n.P.convert(Ke["top-right"]||[0,0]),bottom:n.P.convert(Ke.bottom||[0,0]),"bottom-left":n.P.convert(Ke["bottom-left"]||[0,0]),"bottom-right":n.P.convert(Ke["bottom-right"]||[0,0]),left:n.P.convert(Ke.left||[0,0]),right:n.P.convert(Ke.right||[0,0])}}return tc(new n.P(0,0))}let od=a;i.AJAXError=n.bh,i.Evented=n.E,i.LngLat=n.N,i.MercatorCoordinate=n.Z,i.Point=n.P,i.addProtocol=n.bi,i.config=n.a,i.removeProtocol=n.bj,i.AttributionControl=xs,i.BoxZoomHandler=Qc,i.CanvasSource=gt,i.CooperativeGesturesHandler=Va,i.DoubleClickZoomHandler=Ln,i.DragPanHandler=Za,i.DragRotateHandler=ao,i.EdgeInsets=Rc,i.FullscreenControl=class extends n.E{constructor(Ke={}){super(),this._onFullscreenChange=()=>{var O;let pe=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((O=pe?.shadowRoot)===null||O===void 0)&&O.fullscreenElement;)pe=pe.shadowRoot.fullscreenElement;pe===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ke&&Ke.container&&(Ke.container instanceof HTMLElement?this._container=Ke.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Ke){return this._map=Ke,this._container||(this._container=this._map.getContainer()),this._controlContainer=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){s.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Ke=this._fullscreenButton=s.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);s.create("span","maplibregl-ctrl-icon",Ke).setAttribute("aria-hidden","true"),Ke.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Ke=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ke),this._fullscreenButton.title=Ke}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},i.GeoJSONSource=Ge,i.GeolocateControl=class extends n.E{constructor(Ke){super(),this._onSuccess=O=>{if(this._map){if(this._isOutOfMapMaxBounds(O))return this._setErrorState(),this.fire(new n.k("outofmaxbounds",O)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=O,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(O),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(O),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.k("geolocate",O)),this._finish()}},this._updateCamera=O=>{let pe=new n.N(O.coords.longitude,O.coords.latitude),Ie=O.coords.accuracy,Ne=this._map.getBearing(),qe=n.e({bearing:Ne},this.options.fitBoundsOptions),Mt=fe.fromLngLat(pe,Ie);this._map.fitBounds(Mt,qe,{geolocateSource:!0})},this._updateMarker=O=>{if(O){let pe=new n.N(O.coords.longitude,O.coords.latitude);this._accuracyCircleMarker.setLngLat(pe).addTo(this._map),this._userLocationDotMarker.setLngLat(pe).addTo(this._map),this._accuracy=O.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=O=>{if(this._map){if(this.options.trackUserLocation)if(O.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let pe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(O.code===3&&Vh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.k("error",O)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",O=>O.preventDefault()),this._geolocateButton=s.create("button","maplibregl-ctrl-geolocate",this._container),s.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=O=>{if(this._map){if(O===!1){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");let pe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe)}else{let pe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Uc({element:this._dotElement}),this._circleElement=s.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Uc({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",pe=>{pe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||pe.originalEvent&&pe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.k("trackuserlocationend")),this.fire(new n.k("userlocationlostfocus")))})}},this.options=n.e({},Hh,Ke)}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return n._(this,arguments,void 0,function*(O=!1){if(iu!==void 0&&!O)return iu;if(window.navigator.permissions===void 0)return iu=!!window.navigator.geolocation,iu;try{iu=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{iu=!!window.navigator.geolocation}return iu})}().then(O=>this._finishSetupUI(O)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),s.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,th=0,Vh=!1}_isOutOfMapMaxBounds(Ke){let O=this._map.getMaxBounds(),pe=Ke.coords;return O&&(pe.longitudeO.getEast()||pe.latitudeO.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Ke=this._map.getBounds(),O=Ke.getSouthEast(),pe=Ke.getNorthEast(),Ie=O.distanceTo(pe),Ne=Math.ceil(this._accuracy/(Ie/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Ne}px`,this._circleElement.style.height=`${Ne}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":th--,Vh=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.k("trackuserlocationstart")),this.fire(new n.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Ke;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),th++,th>1?(Ke={maximumAge:6e5,timeout:0},Vh=!0):(Ke=this.options.positionOptions,Vh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ke)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},i.Hash=Eh,i.ImageSource=_t,i.KeyboardHandler=Yr,i.LngLatBounds=fe,i.LogoControl=_o,i.Map=class extends rs{constructor(Ke){n.bf.mark(n.bg.create);let O=Object.assign(Object.assign({},$u),Ke);if(O.minZoom!=null&&O.maxZoom!=null&&O.minZoom>O.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(O.minPitch!=null&&O.maxPitch!=null&&O.minPitch>O.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(O.minPitch!=null&&O.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(O.maxPitch!=null&&O.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Eu(O.minZoom,O.maxZoom,O.minPitch,O.maxPitch,O.renderWorldCopies),{bearingSnap:O.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new io,this._controls=[],this._mapId=n.a4(),this._contextLost=pe=>{pe.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new n.k("webglcontextlost",{originalEvent:pe}))},this._contextRestored=pe=>{this._setupPainter(),this.resize(),this._update(),this.fire(new n.k("webglcontextrestored",{originalEvent:pe}))},this._onMapScroll=pe=>{if(pe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=O.interactive,this._maxTileCacheSize=O.maxTileCacheSize,this._maxTileCacheZoomLevels=O.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=O.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=O.preserveDrawingBuffer===!0,this._antialias=O.antialias===!0,this._trackResize=O.trackResize===!0,this._bearingSnap=O.bearingSnap,this._refreshExpiredTiles=O.refreshExpiredTiles===!0,this._fadeDuration=O.fadeDuration,this._crossSourceCollisions=O.crossSourceCollisions===!0,this._collectResourceTiming=O.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Cl),O.locale),this._clickTolerance=O.clickTolerance,this._overridePixelRatio=O.pixelRatio,this._maxCanvasSize=O.maxCanvasSize,this.transformCameraUpdate=O.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=O.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=f.addThrottleControl(()=>this.isMoving()),this._requestManager=new k(O.transformRequest),typeof O.container=="string"){if(this._container=document.getElementById(O.container),!this._container)throw new Error(`Container '${O.container}' not found.`)}else{if(!(O.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=O.container}if(O.maxBounds&&this.setMaxBounds(O.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let pe=!1,Ie=xf(Ne=>{this._trackResize&&!this._removed&&(this.resize(Ne),this.redraw())},50);this._resizeObserver=new ResizeObserver(Ne=>{pe?Ie(Ne):pe=!0}),this._resizeObserver.observe(this._container)}this.handlers=new hs(this,O),this._hash=O.hash&&new Eh(typeof O.hash=="string"&&O.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:O.center,zoom:O.zoom,bearing:O.bearing,pitch:O.pitch}),O.bounds&&(this.resize(),this.fitBounds(O.bounds,n.e({},O.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=O.localIdeographFontFamily,this._validateStyle=O.validateStyle,O.style&&this.setStyle(O.style,{localIdeographFontFamily:O.localIdeographFontFamily}),O.attributionControl&&this.addControl(new xs(typeof O.attributionControl=="boolean"?void 0:O.attributionControl)),O.maplibreLogo&&this.addControl(new _o,O.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",pe=>{this._update(pe.dataType==="style"),this.fire(new n.k(`${pe.dataType}data`,pe))}),this.on("dataloading",pe=>{this.fire(new n.k(`${pe.dataType}dataloading`,pe))}),this.on("dataabort",pe=>{this.fire(new n.k("sourcedataabort",pe))})}_getMapId(){return this._mapId}addControl(Ke,O){if(O===void 0&&(O=Ke.getDefaultPosition?Ke.getDefaultPosition():"top-right"),!Ke||!Ke.onAdd)return this.fire(new n.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let pe=Ke.onAdd(this);this._controls.push(Ke);let Ie=this._controlPositions[O];return O.indexOf("bottom")!==-1?Ie.insertBefore(pe,Ie.firstChild):Ie.appendChild(pe),this}removeControl(Ke){if(!Ke||!Ke.onRemove)return this.fire(new n.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let O=this._controls.indexOf(Ke);return O>-1&&this._controls.splice(O,1),Ke.onRemove(this),this}hasControl(Ke){return this._controls.indexOf(Ke)>-1}calculateCameraOptionsFromTo(Ke,O,pe,Ie){return Ie==null&&this.terrain&&(Ie=this.terrain.getElevationForLngLatZoom(pe,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ke,O,pe,Ie)}resize(Ke){var O;let pe=this._containerDimensions(),Ie=pe[0],Ne=pe[1],qe=this._getClampedPixelRatio(Ie,Ne);if(this._resizeCanvas(Ie,Ne,qe),this.painter.resize(Ie,Ne,qe),this.painter.overLimit()){let jt=this.painter.context.gl;this._maxCanvasSize=[jt.drawingBufferWidth,jt.drawingBufferHeight];let er=this._getClampedPixelRatio(Ie,Ne);this._resizeCanvas(Ie,Ne,er),this.painter.resize(Ie,Ne,er)}this.transform.resize(Ie,Ne),(O=this._requestedCameraState)===null||O===void 0||O.resize(Ie,Ne);let Mt=!this._moving;return Mt&&(this.stop(),this.fire(new n.k("movestart",Ke)).fire(new n.k("move",Ke))),this.fire(new n.k("resize",Ke)),Mt&&this.fire(new n.k("moveend",Ke)),this}_getClampedPixelRatio(Ke,O){let{0:pe,1:Ie}=this._maxCanvasSize,Ne=this.getPixelRatio(),qe=Ke*Ne,Mt=O*Ne;return Math.min(qe>pe?pe/qe:1,Mt>Ie?Ie/Mt:1)*Ne}getPixelRatio(){var Ke;return(Ke=this._overridePixelRatio)!==null&&Ke!==void 0?Ke:devicePixelRatio}setPixelRatio(Ke){this._overridePixelRatio=Ke,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ke){return this.transform.setMaxBounds(fe.convert(Ke)),this._update()}setMinZoom(Ke){if((Ke=Ke??-2)>=-2&&Ke<=this.transform.maxZoom)return this.transform.minZoom=Ke,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ke,this._update(),this.getZoom()>Ke&&this.setZoom(Ke),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ke){if((Ke=Ke??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ke>=0&&Ke<=this.transform.maxPitch)return this.transform.minPitch=Ke,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ke>=this.transform.minPitch)return this.transform.maxPitch=Ke,this._update(),this.getPitch()>Ke&&this.setPitch(Ke),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ke){return this.transform.renderWorldCopies=Ke,this._update()}project(Ke){return this.transform.locationPoint(n.N.convert(Ke),this.style&&this.terrain)}unproject(Ke){return this.transform.pointLocation(n.P.convert(Ke),this.terrain)}isMoving(){var Ke;return this._moving||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isMoving())}isZooming(){var Ke;return this._zooming||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isZooming())}isRotating(){var Ke;return this._rotating||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isRotating())}_createDelegatedListener(Ke,O,pe){if(Ke==="mouseenter"||Ke==="mouseover"){let Ie=!1;return{layers:O,listener:pe,delegates:{mousemove:Ne=>{let qe=O.filter(jt=>this.getLayer(jt)),Mt=qe.length!==0?this.queryRenderedFeatures(Ne.point,{layers:qe}):[];Mt.length?Ie||(Ie=!0,pe.call(this,new ch(Ke,this,Ne.originalEvent,{features:Mt}))):Ie=!1},mouseout:()=>{Ie=!1}}}}if(Ke==="mouseleave"||Ke==="mouseout"){let Ie=!1;return{layers:O,listener:pe,delegates:{mousemove:Ne=>{let qe=O.filter(Mt=>this.getLayer(Mt));(qe.length!==0?this.queryRenderedFeatures(Ne.point,{layers:qe}):[]).length?Ie=!0:Ie&&(Ie=!1,pe.call(this,new ch(Ke,this,Ne.originalEvent)))},mouseout:Ne=>{Ie&&(Ie=!1,pe.call(this,new ch(Ke,this,Ne.originalEvent)))}}}}{let Ie=Ne=>{let qe=O.filter(jt=>this.getLayer(jt)),Mt=qe.length!==0?this.queryRenderedFeatures(Ne.point,{layers:qe}):[];Mt.length&&(Ne.features=Mt,pe.call(this,Ne),delete Ne.features)};return{layers:O,listener:pe,delegates:{[Ke]:Ie}}}}_saveDelegatedListener(Ke,O){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ke]=this._delegatedListeners[Ke]||[],this._delegatedListeners[Ke].push(O)}_removeDelegatedListener(Ke,O,pe){if(!this._delegatedListeners||!this._delegatedListeners[Ke])return;let Ie=this._delegatedListeners[Ke];for(let Ne=0;NeO.includes(Mt))){for(let Mt in qe.delegates)this.off(Mt,qe.delegates[Mt]);return void Ie.splice(Ne,1)}}}on(Ke,O,pe){if(pe===void 0)return super.on(Ke,O);let Ie=this._createDelegatedListener(Ke,typeof O=="string"?[O]:O,pe);this._saveDelegatedListener(Ke,Ie);for(let Ne in Ie.delegates)this.on(Ne,Ie.delegates[Ne]);return this}once(Ke,O,pe){if(pe===void 0)return super.once(Ke,O);let Ie=typeof O=="string"?[O]:O,Ne=this._createDelegatedListener(Ke,Ie,pe);for(let qe in Ne.delegates){let Mt=Ne.delegates[qe];Ne.delegates[qe]=(...jt)=>{this._removeDelegatedListener(Ke,Ie,pe),Mt(...jt)}}this._saveDelegatedListener(Ke,Ne);for(let qe in Ne.delegates)this.once(qe,Ne.delegates[qe]);return this}off(Ke,O,pe){return pe===void 0?super.off(Ke,O):(this._removeDelegatedListener(Ke,typeof O=="string"?[O]:O,pe),this)}queryRenderedFeatures(Ke,O){if(!this.style)return[];let pe,Ie=Ke instanceof n.P||Array.isArray(Ke),Ne=Ie?Ke:[[0,0],[this.transform.width,this.transform.height]];if(O=O||(Ie?{}:Ke)||{},Ne instanceof n.P||typeof Ne[0]=="number")pe=[n.P.convert(Ne)];else{let qe=n.P.convert(Ne[0]),Mt=n.P.convert(Ne[1]);pe=[qe,new n.P(Mt.x,qe.y),Mt,new n.P(qe.x,Mt.y),qe]}return this.style.queryRenderedFeatures(pe,O,this.transform)}querySourceFeatures(Ke,O){return this.style.querySourceFeatures(Ke,O)}setStyle(Ke,O){return(O=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},O)).diff!==!1&&O.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ke?(this._diffStyle(Ke,O),this):(this._localIdeographFontFamily=O.localIdeographFontFamily,this._updateStyle(Ke,O))}setTransformRequest(Ke){return this._requestManager.setTransformRequest(Ke),this}_getUIString(Ke){let O=this._locale[Ke];if(O==null)throw new Error(`Missing UI string '${Ke}'`);return O}_updateStyle(Ke,O){if(O.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ke,O));let pe=this.style&&O.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ke)),Ke?(this.style=new si(this,O||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ke=="string"?this.style.loadURL(Ke,O,pe):this.style.loadJSON(Ke,O,pe),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new si(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ke,O){if(typeof Ke=="string"){let pe=this._requestManager.transformRequest(Ke,"Style");n.h(pe,new AbortController).then(Ie=>{this._updateDiff(Ie.data,O)}).catch(Ie=>{Ie&&this.fire(new n.j(Ie))})}else typeof Ke=="object"&&this._updateDiff(Ke,O)}_updateDiff(Ke,O){try{this.style.setState(Ke,O)&&this._update(!0)}catch(pe){n.w(`Unable to perform style diff: ${pe.message||pe.error||pe}. Rebuilding the style from scratch.`),this._updateStyle(Ke,O)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(Ke,O){return this._lazyInitEmptyStyle(),this.style.addSource(Ke,O),this._update(!0)}isSourceLoaded(Ke){let O=this.style&&this.style.sourceCaches[Ke];if(O!==void 0)return O.loaded();this.fire(new n.j(new Error(`There is no source with ID '${Ke}'`)))}setTerrain(Ke){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ke){let O=this.style.sourceCaches[Ke.source];if(!O)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ke.source}`);this.terrain===null&&O.reload();for(let pe in this.style._layers){let Ie=this.style._layers[pe];Ie.type==="hillshade"&&Ie.source===Ke.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ul(this.painter,O,Ke),this.painter.renderToTexture=new gu(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=pe=>{pe.dataType==="style"?this.terrain.sourceCache.freeRtt():pe.dataType==="source"&&pe.tile&&(pe.sourceId!==Ke.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(pe.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new n.k("terrain",{terrain:Ke})),this}getTerrain(){var Ke,O;return(O=(Ke=this.terrain)===null||Ke===void 0?void 0:Ke.options)!==null&&O!==void 0?O:null}areTilesLoaded(){let Ke=this.style&&this.style.sourceCaches;for(let O in Ke){let pe=Ke[O]._tiles;for(let Ie in pe){let Ne=pe[Ie];if(Ne.state!=="loaded"&&Ne.state!=="errored")return!1}}return!0}removeSource(Ke){return this.style.removeSource(Ke),this._update(!0)}getSource(Ke){return this.style.getSource(Ke)}addImage(Ke,O,pe={}){let{pixelRatio:Ie=1,sdf:Ne=!1,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:er,textFitHeight:kr}=pe;if(this._lazyInitEmptyStyle(),!(O instanceof HTMLImageElement||n.b(O))){if(O.width===void 0||O.height===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:Hr,height:Vr,data:ki}=O,Vi=O;return this.style.addImage(Ke,{data:new n.R({width:Hr,height:Vr},new Uint8Array(ki)),pixelRatio:Ie,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:er,textFitHeight:kr,sdf:Ne,version:0,userImage:Vi}),Vi.onAdd&&Vi.onAdd(this,Ke),this}}{let{width:Hr,height:Vr,data:ki}=u.getImageData(O);this.style.addImage(Ke,{data:new n.R({width:Hr,height:Vr},ki),pixelRatio:Ie,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:er,textFitHeight:kr,sdf:Ne,version:0})}}updateImage(Ke,O){let pe=this.style.getImage(Ke);if(!pe)return this.fire(new n.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let Ie=O instanceof HTMLImageElement||n.b(O)?u.getImageData(O):O,{width:Ne,height:qe,data:Mt}=Ie;if(Ne===void 0||qe===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Ne!==pe.data.width||qe!==pe.data.height)return this.fire(new n.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let jt=!(O instanceof HTMLImageElement||n.b(O));return pe.data.replace(Mt,jt),this.style.updateImage(Ke,pe),this}getImage(Ke){return this.style.getImage(Ke)}hasImage(Ke){return Ke?!!this.style.getImage(Ke):(this.fire(new n.j(new Error("Missing required image id"))),!1)}removeImage(Ke){this.style.removeImage(Ke)}loadImage(Ke){return f.getImage(this._requestManager.transformRequest(Ke,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ke,O){return this._lazyInitEmptyStyle(),this.style.addLayer(Ke,O),this._update(!0)}moveLayer(Ke,O){return this.style.moveLayer(Ke,O),this._update(!0)}removeLayer(Ke){return this.style.removeLayer(Ke),this._update(!0)}getLayer(Ke){return this.style.getLayer(Ke)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ke,O,pe){return this.style.setLayerZoomRange(Ke,O,pe),this._update(!0)}setFilter(Ke,O,pe={}){return this.style.setFilter(Ke,O,pe),this._update(!0)}getFilter(Ke){return this.style.getFilter(Ke)}setPaintProperty(Ke,O,pe,Ie={}){return this.style.setPaintProperty(Ke,O,pe,Ie),this._update(!0)}getPaintProperty(Ke,O){return this.style.getPaintProperty(Ke,O)}setLayoutProperty(Ke,O,pe,Ie={}){return this.style.setLayoutProperty(Ke,O,pe,Ie),this._update(!0)}getLayoutProperty(Ke,O){return this.style.getLayoutProperty(Ke,O)}setGlyphs(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ke,O),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ke,O,pe={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ke,O,pe,Ie=>{Ie||this._update(!0)}),this}removeSprite(Ke){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ke),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ke,O,pe=>{pe||this._update(!0)}),this}setLight(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ke,O),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ke){return this._lazyInitEmptyStyle(),this.style.setSky(Ke),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ke,O){return this.style.setFeatureState(Ke,O),this._update()}removeFeatureState(Ke,O){return this.style.removeFeatureState(Ke,O),this._update()}getFeatureState(Ke){return this.style.getFeatureState(Ke)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ke=0,O=0;return this._container&&(Ke=this._container.clientWidth||400,O=this._container.clientHeight||300),[Ke,O]}_setupContainer(){let Ke=this._container;Ke.classList.add("maplibregl-map");let O=this._canvasContainer=s.create("div","maplibregl-canvas-container",Ke);this._interactive&&O.classList.add("maplibregl-interactive"),this._canvas=s.create("canvas","maplibregl-canvas",O),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let pe=this._containerDimensions(),Ie=this._getClampedPixelRatio(pe[0],pe[1]);this._resizeCanvas(pe[0],pe[1],Ie);let Ne=this._controlContainer=s.create("div","maplibregl-control-container",Ke),qe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(Mt=>{qe[Mt]=s.create("div",`maplibregl-ctrl-${Mt} `,Ne)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ke,O,pe){this._canvas.width=Math.floor(pe*Ke),this._canvas.height=Math.floor(pe*O),this._canvas.style.width=`${Ke}px`,this._canvas.style.height=`${O}px`}_setupPainter(){let Ke={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},O=null;this._canvas.addEventListener("webglcontextcreationerror",Ie=>{O={requestedAttributes:Ke},Ie&&(O.statusMessage=Ie.statusMessage,O.type=Ie.type)},{once:!0});let pe=this._canvas.getContext("webgl2",Ke)||this._canvas.getContext("webgl",Ke);if(!pe){let Ie="Failed to initialize WebGL";throw O?(O.message=Ie,new Error(JSON.stringify(O))):new Error(Ie)}this.painter=new tf(pe,this.transform),h.testSupport(pe)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ke){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ke,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ke){return this._update(),this._renderTaskQueue.add(Ke)}_cancelRenderFrame(Ke){this._renderTaskQueue.remove(Ke)}_render(Ke){let O=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ke),this._removed)return;let pe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Ne=this.transform.zoom,qe=u.now();this.style.zoomHistory.update(Ne,qe);let Mt=new n.z(Ne,{now:qe,fadeDuration:O,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),jt=Mt.crossFadingFactor();jt===1&&jt===this._crossFadingFactor||(pe=!0,this._crossFadingFactor=jt),this.style.update(Mt)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,O,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:O,showPadding:this.showPadding}),this.fire(new n.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.bf.mark(n.bg.load),this.fire(new n.k("load"))),this.style&&(this.style.hasTransitions()||pe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Ie=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ie||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.k("idle")),!this._loaded||this._fullyLoaded||Ie||(this._fullyLoaded=!0,n.bf.mark(n.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Ke;this._hash&&this._hash.remove();for(let pe of this._controls)pe.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),f.removeThrottleControl(this._imageQueueHandle),(Ke=this._resizeObserver)===null||Ke===void 0||Ke.disconnect();let O=this.painter.context.gl.getExtension("WEBGL_lose_context");O!=null&&O.loseContext&&O.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),s.remove(this._canvasContainer),s.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),n.bf.clearMetrics(),this._removed=!0,this.fire(new n.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(Ke=>{n.bf.frame(Ke),this._frameRequest=null,this._render(Ke)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ke){this._showTileBoundaries!==Ke&&(this._showTileBoundaries=Ke,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ke){this._showPadding!==Ke&&(this._showPadding=Ke,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ke){this._showCollisionBoxes!==Ke&&(this._showCollisionBoxes=Ke,Ke?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ke){this._showOverdrawInspector!==Ke&&(this._showOverdrawInspector=Ke,this._update())}get repaint(){return!!this._repaint}set repaint(Ke){this._repaint!==Ke&&(this._repaint=Ke,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ke){this._vertices=Ke,this._update()}get version(){return ec}getCameraTargetElevation(){return this.transform.elevation}},i.MapMouseEvent=ch,i.MapTouchEvent=kf,i.MapWheelEvent=$f,i.Marker=Uc,i.NavigationControl=class{constructor(Ke){this._updateZoomButtons=()=>{let O=this._map.getZoom(),pe=O===this._map.getMaxZoom(),Ie=O===this._map.getMinZoom();this._zoomInButton.disabled=pe,this._zoomOutButton.disabled=Ie,this._zoomInButton.setAttribute("aria-disabled",pe.toString()),this._zoomOutButton.setAttribute("aria-disabled",Ie.toString())},this._rotateCompassArrow=()=>{let O=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=O},this._setButtonTitle=(O,pe)=>{let Ie=this._map._getUIString(`NavigationControl.${pe}`);O.title=Ie,O.setAttribute("aria-label",Ie)},this.options=n.e({},Ho,Ke),this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",O=>O.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",O=>this._map.zoomIn({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",O=>this._map.zoomOut({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",O=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:O}):this._map.resetNorth({},{originalEvent:O})}),this._compassIcon=s.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ke){return this._map=Ke,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Is(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){s.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Ke,O){let pe=s.create("button",Ke,this._container);return pe.type="button",pe.addEventListener("click",O),pe}},i.Popup=class extends n.E{constructor(Ke){super(),this.remove=()=>(this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.k("close"))),this),this._onMouseUp=O=>{this._update(O.point)},this._onMouseMove=O=>{this._update(O.point)},this._onDrag=O=>{this._update(O.point)},this._update=O=>{var pe;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=s.create("div","maplibregl-popup",this._map.getContainer()),this._tip=s.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let jt of this.options.className.split(" "))this._container.classList.add(jt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Wl(this._lngLat,this._flatPos,this._map.transform):(pe=this._lngLat)===null||pe===void 0?void 0:pe.wrap(),this._trackPointer&&!O)return;let Ie=this._flatPos=this._pos=this._trackPointer&&O?O:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&O?O:this._map.transform.locationPoint(this._lngLat));let Ne=this.options.anchor,qe=tc(this.options.offset);if(!Ne){let jt=this._container.offsetWidth,er=this._container.offsetHeight,kr;kr=Ie.y+qe.bottom.ythis._map.transform.height-er?["bottom"]:[],Ie.xthis._map.transform.width-jt/2&&kr.push("right"),Ne=kr.length===0?"bottom":kr.join("-")}let Mt=Ie.add(qe[Ne]);this.options.subpixelPositioning||(Mt=Mt.round()),s.setTransform(this._container,`${Mc[Ne]} translate(${Mt.x}px,${Mt.y}px)`),eh(this._container,Ne,"popup")},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(Fs),Ke)}addTo(Ke){return this._map&&this.remove(),this._map=Ke,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ke){return this._lngLat=n.N.convert(Ke),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Ke){return this.setDOMContent(document.createTextNode(Ke))}setHTML(Ke){let O=document.createDocumentFragment(),pe=document.createElement("body"),Ie;for(pe.innerHTML=Ke;Ie=pe.firstChild,Ie;)O.appendChild(Ie);return this.setDOMContent(O)}getMaxWidth(){var Ke;return(Ke=this._container)===null||Ke===void 0?void 0:Ke.style.maxWidth}setMaxWidth(Ke){return this.options.maxWidth=Ke,this._update(),this}setDOMContent(Ke){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=s.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ke),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ke){return this._container&&this._container.classList.add(Ke),this}removeClassName(Ke){return this._container&&this._container.classList.remove(Ke),this}setOffset(Ke){return this.options.offset=Ke,this._update(),this}toggleClassName(Ke){if(this._container)return this._container.classList.toggle(Ke)}setSubpixelPositioning(Ke){this.options.subpixelPositioning=Ke}_createCloseButton(){this.options.closeButton&&(this._closeButton=s.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Ke=this._container.querySelector(rh);Ke&&Ke.focus()}},i.RasterDEMTileSource=Ze,i.RasterTileSource=Oe,i.ScaleControl=class{constructor(Ke){this._onMove=()=>{Wh(this._map,this._container,this.options)},this.setUnit=O=>{this.options.unit=O,Wh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Wu),Ke)}getDefaultPosition(){return"bottom-left"}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ke.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},i.ScrollZoomHandler=hn,i.Style=si,i.TerrainControl=class{constructor(Ke){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Ke}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=s.create("button","maplibregl-ctrl-terrain",this._container),s.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){s.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},i.TwoFingersTouchPitchHandler=ad,i.TwoFingersTouchRotateHandler=Tf,i.TwoFingersTouchZoomHandler=fu,i.TwoFingersTouchZoomRotateHandler=xa,i.VectorTileSource=Be,i.VideoSource=pt,i.addSourceType=(Ke,O)=>n._(void 0,void 0,void 0,function*(){if(Ae(Ke))throw new Error(`A source type called "${Ke}" already exists.`);((pe,Ie)=>{ct[pe]=Ie})(Ke,O)}),i.clearPrewarmedResources=function(){let Ke=ce;Ke&&(Ke.isPreloaded()&&Ke.numActive()===1?(Ke.release(he),ce=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},i.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},i.getRTLTextPluginStatus=function(){return xt().getRTLTextPluginStatus()},i.getVersion=function(){return od},i.getWorkerCount=function(){return xe.workerCount},i.getWorkerUrl=function(){return n.a.WORKER_URL},i.importScriptInWorkers=function(Ke){return se().broadcast("IS",Ke)},i.prewarm=function(){ge().acquire(he)},i.setMaxParallelImageRequests=function(Ke){n.a.MAX_PARALLEL_IMAGE_REQUESTS=Ke},i.setRTLTextPlugin=function(Ke,O){return xt().setRTLTextPlugin(Ke,O)},i.setWorkerCount=function(Ke){xe.workerCount=Ke},i.setWorkerUrl=function(Ke){n.a.WORKER_URL=Ke}});var P=d;return P})}),fee=Fe((te,Y)=>{var d=ji(),y=cc().sanitizeHTML,z=fz(),P=W_();function i(u,s){this.subplot=u,this.uid=u.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var n=i.prototype;n.update=function(u){this.visible?this.needsNewImage(u)?this.updateImage(u):this.needsNewSource(u)?(this.removeLayer(),this.updateSource(u),this.updateLayer(u)):this.needsNewLayer(u)?this.updateLayer(u):this.updateStyle(u):(this.updateSource(u),this.updateLayer(u)),this.visible=a(u)},n.needsNewImage=function(u){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&u.sourcetype==="image"&&(this.source!==u.source||JSON.stringify(this.coordinates)!==JSON.stringify(u.coordinates))},n.needsNewSource=function(u){return this.sourceType!==u.sourcetype||JSON.stringify(this.source)!==JSON.stringify(u.source)||this.layerType!==u.type},n.needsNewLayer=function(u){return this.layerType!==u.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},n.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},n.updateImage=function(u){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:u.source,coordinates:u.coordinates});var h=this.findFollowingMapLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},n.updateSource=function(u){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=u.sourcetype,this.source=u.source,!!a(u)){var h=o(u);s.addSource(this.idSource,h)}},n.findFollowingMapLayerId=function(u){if(u==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(u){var s={},h={};switch(u.type){case"circle":d.extendFlat(h,{"circle-radius":u.circle.radius,"circle-color":u.color,"circle-opacity":u.opacity});break;case"line":d.extendFlat(h,{"line-width":u.line.width,"line-color":u.color,"line-opacity":u.opacity,"line-dasharray":u.line.dash});break;case"fill":d.extendFlat(h,{"fill-color":u.color,"fill-outline-color":u.fill.outlinecolor,"fill-opacity":u.opacity});break;case"symbol":var m=u.symbol,b=z(m.textposition,m.iconsize);d.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),d.extendFlat(h,{"icon-color":u.color,"text-color":m.textfont.color,"text-opacity":u.opacity});break;case"raster":d.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":u.opacity});break}return{layout:s,paint:h}}function o(u){var s=u.sourcetype,h=u.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=u.coordinates),m[b]=h,u.sourceattribution&&(m.attribution=y(u.sourceattribution)),m}Y.exports=function(u,s,h){var m=new i(u,s);return m.update(h),m}}),dee=Fe((te,Y)=>{var d=hee(),y=ji(),z=U_(),P=as(),i=Os(),n=Np(),a=hf(),l=dm(),o=l.drawMode,u=l.selectMode,s=Mf().prepSelect,h=Mf().clearOutline,m=Mf().clearSelectionsCache,b=Mf().selectOnClick,x=W_(),_=fee();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=A.prototype;f.plot=function(I,M,p){var g=this,C;g.map?C=new Promise(function(T,N){g.updateMap(I,M,T,N)}):C=new Promise(function(T,N){g.createMap(I,M,T,N)}),p.push(C)},f.createMap=function(I,M,p,g){var C=this,T=M[C.id],N=C.styleObj=w(T.style),B=T.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new d.Map({container:C.div,style:N.style,center:E(T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),W={};V.on("styleimagemissing",function($){var q=$.id;if(!W[q]&&q.includes("-15")){W[q]=!0;var G=new Image(15,15);G.onload=function(){V.addImage(q,G)},G.crossOrigin="Anonymous",G.src="https://unpkg.com/maki@2.1.0/icons/"+q+".svg"}}),V.setTransformRequest(function($){return $=$.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),$=$.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),$=$.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:$}}),V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var F=[];F.push(new Promise(function($){V.once("load",$)})),F=F.concat(z.fetchTraceGeoData(I)),Promise.all(F).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.updateMap=function(I,M,p,g){var C=this,T=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,T.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){T.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,T,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},f.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var T=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),u(T)||o(T)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,T)},n.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},f.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},f.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var d=ji(),y=L_(),z=Gd(),P=D6();Y.exports=function(a,l,o){y(a,l,o,{type:"map",attributes:P,handleDefaults:i,partition:"y"})};function i(a,l,o){o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var u=o("bounds.west"),s=o("bounds.east"),h=o("bounds.south"),m=o("bounds.north");(u===void 0||s===void 0||h===void 0||m===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:n}),l._input=a}function n(a,l){function o(x,_){return d.coerce(a,l,P.layers,x,_)}var u=o("visible");if(u){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",d.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),d.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),pA=Fe(te=>{var Y=ji(),d=Y.strTranslate,y=Y.strScale,z=Md().getSubplotCalcData,P=k0(),i=ii(),n=Zs(),a=cc(),l=dee(),o="map";te.name=o,te.attr="subplot",te.idRoot=o,te.idRegex=te.attrRegex=Y.counterRegex(o),te.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},te.layoutAttributes=D6(),te.supplyLayoutDefaults=pee(),te.plot=function(u){for(var s=u._fullLayout,h=u.calcdata,m=s._subplots[o],b=0;bp/2){var g=D.split("|").join("
");I.text(g).attr("data-unformatted",g).call(a.convertToTspans,u),M=n.bBox(I.node())}I.attr("transform",d(-3,-M.height+8)),E.insert("rect",".static-attribution").attr({x:-M.width-6,y:-M.height-3,width:M.width+6,height:M.height+3,fill:"rgba(255, 255, 255, 0.75)"});var C=1;M.width+6>p&&(C=p/(M.width+6));var T=[m.l+m.w*_.x[1],m.t+m.h*(1-_.y[0])];E.attr("transform",d(T[0],T[1])+y(C))}},te.updateFx=function(u){for(var s=u._fullLayout,h=s._subplots[o],m=0;m{Y.exports={attributes:fA(),supplyDefaults:oee(),colorbar:Mo(),formatLabels:hz(),calc:HC(),plot:lee(),hoverPoints:dA().hoverPoints,eventData:uee(),selectPoints:cee(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermap",basePlotModule:pA(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),gee=Fe((te,Y)=>{Y.exports=mee()}),dz=Fe((te,Y)=>{var d=Vw(),y=zc(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=_a(),n=an().extendFlat;Y.exports=n({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:n({},d.featureidkey,{}),below:{valType:"string",editType:"plot"},text:d.text,hovertext:d.hovertext,marker:{line:{color:n({},d.marker.line.color,{editType:"plot"}),width:n({},d.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:n({},d.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:n({},d.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n({},d.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:d.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:n({},i.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),vee=Fe((te,Y)=>{var d=ji(),y=Cc(),z=dz();Y.exports=function(P,i,n,a){function l(m,b){return d.coerce(P,i,z,m,b)}var o=l("locations"),u=l("z"),s=l("geojson");if(!d.isArrayOrTypedArray(o)||!o.length||!d.isArrayOrTypedArray(u)||!u.length||!(typeof s=="string"&&s!==""||d.isPlainObject(s))){i.visible=!1;return}l("featureidkey"),i._length=Math.min(o.length,u.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,i,a,l,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(i,l)}}),pz=Fe((te,Y)=>{var d=Ar(),y=ji(),z=lh(),P=Zs(),i=j_().makeBlank,n=U_();function a(o){var u=o[0].trace,s=u.visible===!0&&u._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=u._opts={fill:h,line:m,geojson:i()};if(!s)return b;var x=n.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(u),A=u.marker,f=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var T=C.mo;return d(T)?+y.constrain(T,0,1):0});var w;y.isArrayOrTypedArray(f.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(f.width)&&(D=function(C){return C.mlw});for(var E=0;E{var d=pz().convert,y=pz().convertOnSelect,z=W_().traceLayerPrefix;function P(n,a){this.type="choroplethmap",this.subplot=n,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var i=P.prototype;i.update=function(n){this._update(d(n)),n[0].trace._glTrace=this},i.updateOnSelect=function(n){this._update(y(n))},i._update=function(n){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(n.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(n,o),this.below=o);for(var u=0;u=0;l--)n.removeLayer(a[l][1])},i.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,a){var l=a[0].trace,o=new P(n,l.uid),u=o.sourceId,s=d(a),h=o.below=n.belowLookup["trace-"+l.uid];return n.map.addSource(u,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),_ee=Fe((te,Y)=>{Y.exports={attributes:dz(),supplyDefaults:vee(),colorbar:E_(),calc:GC(),plot:yee(),hoverPoints:KC(),eventData:YC(),selectPoints:XC(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(d,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var i=z[P].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var n=P+1;n{Y.exports=_ee()}),mz=Fe((te,Y)=>{var d=zc(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=_a(),i=fA(),n=an().extendFlat;Y.exports=n({lon:i.lon,lat:i.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:i.text,hovertext:i.hovertext,hoverinfo:n({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:n({},P.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),bee=Fe((te,Y)=>{var d=ji(),y=Cc(),z=mz();Y.exports=function(P,i,n,a){function l(h,m){return d.coerce(P,i,z,h,m)}var o=l("lon")||[],u=l("lat")||[],s=Math.min(o.length,u.length);if(!s){i.visible=!1;return}i._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,i,a,l,{prefix:"",cLetter:"z"})}}),wee=Fe((te,Y)=>{var d=Ar(),y=ji().isArrayOrTypedArray,z=ti().BADNUM,P=kp(),i=ji()._;Y.exports=function(n,a){for(var l=a._length,o=new Array(l),u=a.z,s=y(u)&&u.length,h=0;h{var d=Ar(),y=ji(),z=Xi(),P=lh(),i=ti().BADNUM,n=j_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,u={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:u,geojson:n()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var d=kee(),y=W_().traceLayerPrefix;function z(i,n){this.type="densitymap",this.subplot=i,this.uid=n,this.sourceId="source-"+n,this.layerList=[["heatmap",y+n+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(i){var n=this.subplot,a=this.layerList,l=d(i),o=n.belowLookup["trace-"+this.uid];n.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var u=0;u=0;a--)i.removeLayer(n[a][1])},P.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,n){var a=n[0].trace,l=new z(i,a.uid),o=l.sourceId,u=d(n),s=l.below=i.belowLookup["trace-"+a.uid];return i.map.addSource(o,{type:"geojson",data:u.geojson}),l._addLayers(u,s),l}}),See=Fe((te,Y)=>{var d=Os(),y=dA().hoverPoints,z=dA().getExtraText;Y.exports=function(P,i,n){var a=y(P,i,n);if(a){var l=a[0],o=l.cd,u=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(u,s,o[0].t.labels),[l]}}}),Cee=Fe((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d.z=y.z,d}}),Aee=Fe((te,Y)=>{Y.exports={attributes:mz(),supplyDefaults:bee(),colorbar:E_(),formatLabels:hz(),calc:wee(),plot:Tee(),hoverPoints:See(),eventData:Cee(),getBelow:function(d,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=Aee()}),gz=Fe((te,Y)=>{var d=zn(),y=_a(),z=Mi(),P=zo(),i=Xh().attributes,{hovertemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=zc(),o=ku().templatedArray,u=Sh().descriptionOnlyNumbers,s=an().extendFlat,h=oh().overrideAll;Y.exports=h({hoverinfo:s({},y.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:P.hoverlabel,domain:i({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:d({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:n({},{keys:["value","label"]}),hovertemplatefallback:a(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:n({},{keys:["value","label"]}),hovertemplatefallback:a(),colorscales:o("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:s(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Eee=Fe((te,Y)=>{var d=ji(),y=gz(),z=Xi(),P=sn(),i=Xh().defaults,n=qv(),a=ku(),l=Gd();Y.exports=function(u,s,h,m){function b(N,B){return d.coerce(u,s,y,N,B)}var x=d.extendDeep(m.hoverlabel,u.hoverlabel),_=u.node,A=a.newContainer(s,"node");function f(N,B){return d.coerce(_,A,y.node,N,B)}f("label"),f("groups"),f("x"),f("y"),f("pad"),f("thickness"),f("line.color"),f("line.width"),f("hoverinfo",u.hoverinfo),n(_,A,f,x),f("hovertemplate"),f("align");var k=m.colorway,w=function(N){return k[N%k.length]};f("color",A.label.map(function(N,B){return z.addOpacity(w(B),.8)})),f("customdata");var D=u.link||{},E=a.newContainer(s,"link");function I(N,B){return d.coerce(D,E,y.link,N,B)}I("label"),I("arrowlen"),I("source"),I("target"),I("value"),I("line.color"),I("line.width"),I("hoverinfo",u.hoverinfo),n(D,E,I,x),I("hovertemplate");var M=P(m.paper_bgcolor).getLuminance()<.333,p=M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",g=I("color",p);function C(N){var B=P(N);if(!B.isValid())return N;var U=B.getAlpha();return U<=.8?B.setAlpha(U+.2):B=M?B.brighten():B.darken(),B.toRgbString()}I("hovercolor",Array.isArray(g)?g.map(C):C(g)),I("customdata"),l(D,E,{name:"colorscales",handleItemDefaults:o}),i(s,m,b),b("orientation"),b("valueformat"),b("valuesuffix");var T;A.x.length&&A.y.length&&(T="freeform"),b("arrangement",T),d.coerceFont(b,"textfont",m.font,{autoShadowDflt:!0}),s._length=null};function o(u,s){function h(m,b){return d.coerce(u,s,y.link.colorscales,m,b)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}),vz=Fe((te,Y)=>{Y.exports=d;function d(y){for(var z=y.length,P=new Array(z),i=new Array(z),n=new Array(z),a=new Array(z),l=new Array(z),o=new Array(z),u=0;u0;){f=w[w.length-1];var D=y[f];if(a[f]=0&&o[f].push(l[I])}a[f]=E}else{if(i[f]===P[f]){for(var M=[],p=[],g=0,E=k.length-1;E>=0;--E){var C=k[E];if(n[C]=!1,M.push(C),p.push(o[C]),g+=o[C].length,l[C]=h.length,C===f){k.length=E;break}}h.push(M);for(var T=new Array(g),E=0;E{var d=vz(),y=ji(),z=t1().wrap,P=y.isArrayOrTypedArray,i=y.isIndex,n=lh();function a(o){var u=o.node,s=o.link,h=[],m=P(s.color),b=P(s.hovercolor),x=P(s.customdata),_={},A={},f=s.colorscales.length,k;for(k=0;kI&&(I=s.source[k]),s.target[k]>I&&(I=s.target[k]);var M=I+1;o.node._count=M;var p,g=o.node.groups,C={};for(k=0;k0&&i(W,M)&&i(F,M)&&!(C.hasOwnProperty(W)&&C.hasOwnProperty(F)&&C[W]===C[F])){C.hasOwnProperty(F)&&(F=C[F]),C.hasOwnProperty(W)&&(W=C[W]),W=+W,F=+F,_[W]=_[F]=!0;var $="";s.label&&s.label[k]&&($=s.label[k]);var q=null;$&&A.hasOwnProperty($)&&(q=A[$]),h.push({pointNumber:k,label:$,color:m?s.color[k]:s.color,hovercolor:b?s.hovercolor[k]:s.hovercolor,customdata:x?s.customdata[k]:s.customdata,concentrationscale:q,source:W,target:F,value:+V}),U.source.push(W),U.target.push(F)}}var G=M+g.length,ee=P(u.color),he=P(u.customdata),xe=[];for(k=0;kM-1,childrenNodes:[],pointNumber:k,label:ve,color:ee?u.color[k]:u.color,customdata:he?u.customdata[k]:u.customdata})}var ce=!1;return l(G,U.source,U.target)&&(ce=!0),{circular:ce,links:h,nodes:xe,groups:g,groupLookup:C}}function l(o,u,s){for(var h=y.init2dArray(o,0),m=0;m1})}Y.exports=function(o,u){var s=a(u);return z({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}),Pee=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(M){var p=+this._x.call(null,M),g=+this._y.call(null,M);return z(this.cover(p,g),p,g,M)}function z(M,p,g,C){if(isNaN(p)||isNaN(g))return M;var T,N=M._root,B={data:C},U=M._x0,V=M._y0,W=M._x1,F=M._y1,$,q,G,ee,he,xe,ve,ce;if(!N)return M._root=B,M;for(;N.length;)if((he=p>=($=(U+W)/2))?U=$:W=$,(xe=g>=(q=(V+F)/2))?V=q:F=q,T=N,!(N=N[ve=xe<<1|he]))return T[ve]=B,M;if(G=+M._x.call(null,N.data),ee=+M._y.call(null,N.data),p===G&&g===ee)return B.next=N,T?T[ve]=B:M._root=B,M;do T=T?T[ve]=new Array(4):M._root=new Array(4),(he=p>=($=(U+W)/2))?U=$:W=$,(xe=g>=(q=(V+F)/2))?V=q:F=q;while((ve=xe<<1|he)===(ce=(ee>=q)<<1|G>=$));return T[ce]=N,T[ve]=B,M}function P(M){var p,g,C=M.length,T,N,B=new Array(C),U=new Array(C),V=1/0,W=1/0,F=-1/0,$=-1/0;for(g=0;gF&&(F=T),N$&&($=N));if(V>F||W>$)return this;for(this.cover(V,W).cover(F,$),g=0;gM||M>=T||C>p||p>=N;)switch(W=(pF||(U=ee.y0)>$||(V=ee.x1)=ve)<<1|M>=xe)&&(ee=q[q.length-1],q[q.length-1]=q[q.length-1-he],q[q.length-1-he]=ee)}else{var ce=M-+this._x.call(null,G.data),re=p-+this._y.call(null,G.data),ge=ce*ce+re*re;if(ge=(q=(B+V)/2))?B=q:V=q,(he=$>=(G=(U+W)/2))?U=G:W=G,p=g,!(g=g[xe=he<<1|ee]))return this;if(!g.length)break;(p[xe+1&3]||p[xe+2&3]||p[xe+3&3])&&(C=p,ve=xe)}for(;g.data!==M;)if(T=g,!(g=g.next))return this;return(N=g.next)&&delete g.next,T?(N?T.next=N:delete T.next,this):p?(N?p[xe]=N:delete p[xe],(g=p[0]||p[1]||p[2]||p[3])&&g===(p[3]||p[2]||p[1]||p[0])&&!g.length&&(C?C[ve]=g:this._root=g),this):(this._root=N,this)}function s(M){for(var p=0,g=M.length;p{(function(d,y){y(typeof te=="object"&&typeof Y<"u"?te:d.d3=d.d3||{})})(te,function(d){var y="$";function z(){}z.prototype=P.prototype={constructor:z,has:function(_){return y+_ in this},get:function(_){return this[y+_]},set:function(_,A){return this[y+_]=A,this},remove:function(_){var A=y+_;return A in this&&delete this[A]},clear:function(){for(var _ in this)_[0]===y&&delete this[_]},keys:function(){var _=[];for(var A in this)A[0]===y&&_.push(A.slice(1));return _},values:function(){var _=[];for(var A in this)A[0]===y&&_.push(this[A]);return _},entries:function(){var _=[];for(var A in this)A[0]===y&&_.push({key:A.slice(1),value:this[A]});return _},size:function(){var _=0;for(var A in this)A[0]===y&&++_;return _},empty:function(){for(var _ in this)if(_[0]===y)return!1;return!0},each:function(_){for(var A in this)A[0]===y&&_(this[A],A.slice(1),this)}};function P(_,A){var f=new z;if(_ instanceof z)_.each(function(I,M){f.set(M,I)});else if(Array.isArray(_)){var k=-1,w=_.length,D;if(A==null)for(;++k=_.length)return f!=null&&I.sort(f),k!=null?k(I):I;for(var C=-1,T=I.length,N=_[M++],B,U,V=P(),W,F=p();++C_.length)return I;var p,g=A[M-1];return k!=null&&M>=_.length?p=I.entries():(p=[],I.each(function(C,T){p.push({key:T,values:E(C,M)})})),g!=null?p.sort(function(C,T){return g(C.key,T.key)}):p}return w={object:function(I){return D(I,0,n,a)},map:function(I){return D(I,0,l,o)},entries:function(I){return E(D(I,0,l,o),0)},key:function(I){return _.push(I),w},sortKeys:function(I){return A[_.length-1]=I,w},sortValues:function(I){return f=I,w},rollup:function(I){return k=I,w}}}function n(){return{}}function a(_,A,f){_[A]=f}function l(){return P()}function o(_,A,f){_.set(A,f)}function u(){}var s=P.prototype;u.prototype=h.prototype={constructor:u,has:s.has,add:function(_){return _+="",this[y+_]=_,this},remove:s.remove,clear:s.clear,values:s.keys,size:s.size,empty:s.empty,each:s.each};function h(_,A){var f=new u;if(_ instanceof u)_.each(function(D){f.add(D)});else if(_){var k=-1,w=_.length;if(A==null)for(;++k{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y={value:function(){}};function z(){for(var l=0,o=arguments.length,u={},s;l=0&&(s=u.slice(h+1),u=u.slice(0,h)),u&&!o.hasOwnProperty(u))throw new Error("unknown type: "+u);return{type:u,name:s}})}P.prototype=z.prototype={constructor:P,on:function(l,o){var u=this._,s=i(l+"",u),h,m=-1,b=s.length;if(arguments.length<2){for(;++m0)for(var u=new Array(h),s=0,h,m;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=0,z=0,P=0,i=1e3,n,a,l=0,o=0,u=0,s=typeof performance=="object"&&performance.now?performance:Date,h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(M){setTimeout(M,17)};function m(){return o||(h(b),o=s.now()+u)}function b(){o=0}function x(){this._call=this._time=this._next=null}x.prototype=_.prototype={constructor:x,restart:function(M,p,g){if(typeof M!="function")throw new TypeError("callback is not a function");g=(g==null?m():+g)+(p==null?0:+p),!this._next&&a!==this&&(a?a._next=this:n=this,a=this),this._call=M,this._time=g,D()},stop:function(){this._call&&(this._call=null,this._time=1/0,D())}};function _(M,p,g){var C=new x;return C.restart(M,p,g),C}function A(){m(),++y;for(var M=n,p;M;)(p=o-M._time)>=0&&M._call.call(null,p),M=M._next;--y}function f(){o=(l=s.now())+u,y=z=0;try{A()}finally{y=0,w(),o=0}}function k(){var M=s.now(),p=M-l;p>i&&(u-=p,l=M)}function w(){for(var M,p=n,g,C=1/0;p;)p._call?(C>p._time&&(C=p._time),M=p,p=p._next):(g=p._next,p._next=null,p=M?M._next=g:n=g);a=M,D(C)}function D(M){if(!y){z&&(z=clearTimeout(z));var p=M-o;p>24?(M<1/0&&(z=setTimeout(f,M-s.now()-u)),P&&(P=clearInterval(P))):(P||(l=s.now(),P=setInterval(k,i)),y=1,h(f))}}function E(M,p,g){var C=new x;return p=p==null?0:+p,C.restart(function(T){C.stop(),M(T+p)},p,g),C}function I(M,p,g){var C=new x,T=p;return p==null?(C.restart(M,p,g),C):(p=+p,g=g==null?m():+g,C.restart(function N(B){B+=T,C.restart(N,T+=p,g),M(B)},p,g),C)}d.interval=I,d.now=m,d.timeout=E,d.timer=_,d.timerFlush=A,Object.defineProperty(d,"__esModule",{value:!0})})}),zee=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,Pee(),mA(),Iee(),Dee()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(te,function(d,y,z,P,i){function n(M,p){var g;M==null&&(M=0),p==null&&(p=0);function C(){var T,N=g.length,B,U=0,V=0;for(T=0;T$.index){var me=q-_e.x-_e.vx,fe=G-_e.y-_e.vy,Ce=me*me+fe*fe;Ceq+J||neG+J||seV.r&&(V.r=V[W].r)}function U(){if(p){var V,W=p.length,F;for(g=new Array(W),V=0;V1?(he==null?U.remove(ee):U.set(ee,G(he)),p):U.get(ee)},find:function(ee,he,xe){var ve=0,ce=M.length,re,ge,ne,se,_e;for(xe==null?xe=1/0:xe*=xe,ve=0;ve1?(W.on(ee,he),p):W.on(ee)}}}function w(){var M,p,g,C=a(-30),T,N=1,B=1/0,U=.81;function V(q){var G,ee=M.length,he=y.quadtree(M,x,_).visitAfter(F);for(g=q,G=0;G=B)){(q.data!==p||q.next)&&(xe===0&&(xe=l(),re+=xe*xe),ve===0&&(ve=l(),re+=ve*ve),re{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=Math.PI,z=2*y,P=1e-6,i=z-P;function n(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new n}n.prototype=a.prototype={constructor:n,moveTo:function(l,o){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(l,o){this._+="L"+(this._x1=+l)+","+(this._y1=+o)},quadraticCurveTo:function(l,o,u,s){this._+="Q"+ +l+","+ +o+","+(this._x1=+u)+","+(this._y1=+s)},bezierCurveTo:function(l,o,u,s,h,m){this._+="C"+ +l+","+ +o+","+ +u+","+ +s+","+(this._x1=+h)+","+(this._y1=+m)},arcTo:function(l,o,u,s,h){l=+l,o=+o,u=+u,s=+s,h=+h;var m=this._x1,b=this._y1,x=u-l,_=s-o,A=m-l,f=b-o,k=A*A+f*f;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=l)+","+(this._y1=o);else if(k>P)if(!(Math.abs(f*x-_*A)>P)||!h)this._+="L"+(this._x1=l)+","+(this._y1=o);else{var w=u-m,D=s-b,E=x*x+_*_,I=w*w+D*D,M=Math.sqrt(E),p=Math.sqrt(k),g=h*Math.tan((y-Math.acos((E+k-I)/(2*M*p)))/2),C=g/p,T=g/M;Math.abs(C-1)>P&&(this._+="L"+(l+C*A)+","+(o+C*f)),this._+="A"+h+","+h+",0,0,"+ +(f*w>A*D)+","+(this._x1=l+T*x)+","+(this._y1=o+T*_)}},arc:function(l,o,u,s,h,m){l=+l,o=+o,u=+u,m=!!m;var b=u*Math.cos(s),x=u*Math.sin(s),_=l+b,A=o+x,f=1^m,k=m?s-h:h-s;if(u<0)throw new Error("negative radius: "+u);this._x1===null?this._+="M"+_+","+A:(Math.abs(this._x1-_)>P||Math.abs(this._y1-A)>P)&&(this._+="L"+_+","+A),u&&(k<0&&(k=k%z+z),k>i?this._+="A"+u+","+u+",0,1,"+f+","+(l-b)+","+(o-x)+"A"+u+","+u+",0,1,"+f+","+(this._x1=_)+","+(this._y1=A):k>P&&(this._+="A"+u+","+u+",0,"+ +(k>=y)+","+f+","+(this._x1=l+u*Math.cos(h))+","+(this._y1=o+u*Math.sin(h))))},rect:function(l,o,u,s){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)+"h"+ +u+"v"+ +s+"h"+-u+"Z"},toString:function(){return this._}},d.path=a,Object.defineProperty(d,"__esModule",{value:!0})})}),yz=Fe((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,Oee()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(zt){return function(){return zt}}var P=Math.abs,i=Math.atan2,n=Math.cos,a=Math.max,l=Math.min,o=Math.sin,u=Math.sqrt,s=1e-12,h=Math.PI,m=h/2,b=2*h;function x(zt){return zt>1?0:zt<-1?h:Math.acos(zt)}function _(zt){return zt>=1?m:zt<=-1?-m:Math.asin(zt)}function A(zt){return zt.innerRadius}function f(zt){return zt.outerRadius}function k(zt){return zt.startAngle}function w(zt){return zt.endAngle}function D(zt){return zt&&zt.padAngle}function E(zt,xr,Jr,Ri,tn,_n,Zi,Wi){var dn=Jr-zt,Ua=Ri-xr,ea=Zi-tn,fo=Wi-_n,ho=fo*dn-ea*Ua;if(!(ho*hoIl*Il+Jl*Jl&&(ol=ms,Gl=Bs),{cx:ol,cy:Gl,x01:-ea,y01:-fo,x11:ol*(tn/rl-1),y11:Gl*(tn/rl-1)}}function M(){var zt=A,xr=f,Jr=z(0),Ri=null,tn=k,_n=w,Zi=D,Wi=null;function dn(){var Ua,ea,fo=+zt.apply(this,arguments),ho=+xr.apply(this,arguments),Vo=tn.apply(this,arguments)-m,Ao=_n.apply(this,arguments)-m,Wo=P(Ao-Vo),Wa=Ao>Vo;if(Wi||(Wi=Ua=y.path()),hos))Wi.moveTo(0,0);else if(Wo>b-s)Wi.moveTo(ho*n(Vo),ho*o(Vo)),Wi.arc(0,0,ho,Vo,Ao,!Wa),fo>s&&(Wi.moveTo(fo*n(Ao),fo*o(Ao)),Wi.arc(0,0,fo,Ao,Vo,Wa));else{var ks=Vo,fs=Ao,_l=Vo,es=Ao,rl=Wo,ds=Wo,xl=Zi.apply(this,arguments)/2,ol=xl>s&&(Ri?+Ri.apply(this,arguments):u(fo*fo+ho*ho)),Gl=l(P(ho-fo)/2,+Jr.apply(this,arguments)),ms=Gl,Bs=Gl,No,Es;if(ol>s){var Il=_(ol/fo*o(xl)),Jl=_(ol/ho*o(xl));(rl-=Il*2)>s?(Il*=Wa?1:-1,_l+=Il,es-=Il):(rl=0,_l=es=(Vo+Ao)/2),(ds-=Jl*2)>s?(Jl*=Wa?1:-1,ks+=Jl,fs-=Jl):(ds=0,ks=fs=(Vo+Ao)/2)}var ou=ho*n(ks),Gs=ho*o(ks),$a=fo*n(es),So=fo*o(es);if(Gl>s){var Xs=ho*n(fs),su=ho*o(fs),is=fo*n(_l),tu=fo*o(_l),pl;if(Wos?Bs>s?(No=I(is,tu,ou,Gs,ho,Bs,Wa),Es=I(Xs,su,$a,So,ho,Bs,Wa),Wi.moveTo(No.cx+No.x01,No.cy+No.y01),Bss)||!(rl>s)?Wi.lineTo($a,So):ms>s?(No=I($a,So,Xs,su,fo,-ms,Wa),Es=I(ou,Gs,is,tu,fo,-ms,Wa),Wi.lineTo(No.cx+No.x01,No.cy+No.y01),ms=ho;--Vo)Wi.point(fs[Vo],_l[Vo]);Wi.lineEnd(),Wi.areaEnd()}Wa&&(fs[fo]=+zt(Wo,fo,ea),_l[fo]=+Jr(Wo,fo,ea),Wi.point(xr?+xr(Wo,fo,ea):fs[fo],Ri?+Ri(Wo,fo,ea):_l[fo]))}if(ks)return Wi=null,ks+""||null}function Ua(){return N().defined(tn).curve(Zi).context(_n)}return dn.x=function(ea){return arguments.length?(zt=typeof ea=="function"?ea:z(+ea),xr=null,dn):zt},dn.x0=function(ea){return arguments.length?(zt=typeof ea=="function"?ea:z(+ea),dn):zt},dn.x1=function(ea){return arguments.length?(xr=ea==null?null:typeof ea=="function"?ea:z(+ea),dn):xr},dn.y=function(ea){return arguments.length?(Jr=typeof ea=="function"?ea:z(+ea),Ri=null,dn):Jr},dn.y0=function(ea){return arguments.length?(Jr=typeof ea=="function"?ea:z(+ea),dn):Jr},dn.y1=function(ea){return arguments.length?(Ri=ea==null?null:typeof ea=="function"?ea:z(+ea),dn):Ri},dn.lineX0=dn.lineY0=function(){return Ua().x(zt).y(Jr)},dn.lineY1=function(){return Ua().x(zt).y(Ri)},dn.lineX1=function(){return Ua().x(xr).y(Jr)},dn.defined=function(ea){return arguments.length?(tn=typeof ea=="function"?ea:z(!!ea),dn):tn},dn.curve=function(ea){return arguments.length?(Zi=ea,_n!=null&&(Wi=Zi(_n)),dn):Zi},dn.context=function(ea){return arguments.length?(ea==null?_n=Wi=null:Wi=Zi(_n=ea),dn):_n},dn}function U(zt,xr){return xrzt?1:xr>=zt?0:NaN}function V(zt){return zt}function W(){var zt=V,xr=U,Jr=null,Ri=z(0),tn=z(b),_n=z(0);function Zi(Wi){var dn,Ua=Wi.length,ea,fo,ho=0,Vo=new Array(Ua),Ao=new Array(Ua),Wo=+Ri.apply(this,arguments),Wa=Math.min(b,Math.max(-b,tn.apply(this,arguments)-Wo)),ks,fs=Math.min(Math.abs(Wa)/Ua,_n.apply(this,arguments)),_l=fs*(Wa<0?-1:1),es;for(dn=0;dn0&&(ho+=es);for(xr!=null?Vo.sort(function(rl,ds){return xr(Ao[rl],Ao[ds])}):Jr!=null&&Vo.sort(function(rl,ds){return Jr(Wi[rl],Wi[ds])}),dn=0,fo=ho?(Wa-Ua*_l)/ho:0;dn0?es*fo:0)+_l,Ao[ea]={data:Wi[ea],index:dn,value:es,startAngle:Wo,endAngle:ks,padAngle:fs};return Ao}return Zi.value=function(Wi){return arguments.length?(zt=typeof Wi=="function"?Wi:z(+Wi),Zi):zt},Zi.sortValues=function(Wi){return arguments.length?(xr=Wi,Jr=null,Zi):xr},Zi.sort=function(Wi){return arguments.length?(Jr=Wi,xr=null,Zi):Jr},Zi.startAngle=function(Wi){return arguments.length?(Ri=typeof Wi=="function"?Wi:z(+Wi),Zi):Ri},Zi.endAngle=function(Wi){return arguments.length?(tn=typeof Wi=="function"?Wi:z(+Wi),Zi):tn},Zi.padAngle=function(Wi){return arguments.length?(_n=typeof Wi=="function"?Wi:z(+Wi),Zi):_n},Zi}var F=q(g);function $(zt){this._curve=zt}$.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(zt,xr){this._curve.point(xr*Math.sin(zt),xr*-Math.cos(zt))}};function q(zt){function xr(Jr){return new $(zt(Jr))}return xr._curve=zt,xr}function G(zt){var xr=zt.curve;return zt.angle=zt.x,delete zt.x,zt.radius=zt.y,delete zt.y,zt.curve=function(Jr){return arguments.length?xr(q(Jr)):xr()._curve},zt}function ee(){return G(N().curve(F))}function he(){var zt=B().curve(F),xr=zt.curve,Jr=zt.lineX0,Ri=zt.lineX1,tn=zt.lineY0,_n=zt.lineY1;return zt.angle=zt.x,delete zt.x,zt.startAngle=zt.x0,delete zt.x0,zt.endAngle=zt.x1,delete zt.x1,zt.radius=zt.y,delete zt.y,zt.innerRadius=zt.y0,delete zt.y0,zt.outerRadius=zt.y1,delete zt.y1,zt.lineStartAngle=function(){return G(Jr())},delete zt.lineX0,zt.lineEndAngle=function(){return G(Ri())},delete zt.lineX1,zt.lineInnerRadius=function(){return G(tn())},delete zt.lineY0,zt.lineOuterRadius=function(){return G(_n())},delete zt.lineY1,zt.curve=function(Zi){return arguments.length?xr(q(Zi)):xr()._curve},zt}function xe(zt,xr){return[(xr=+xr)*Math.cos(zt-=Math.PI/2),xr*Math.sin(zt)]}var ve=Array.prototype.slice;function ce(zt){return zt.source}function re(zt){return zt.target}function ge(zt){var xr=ce,Jr=re,Ri=C,tn=T,_n=null;function Zi(){var Wi,dn=ve.call(arguments),Ua=xr.apply(this,dn),ea=Jr.apply(this,dn);if(_n||(_n=Wi=y.path()),zt(_n,+Ri.apply(this,(dn[0]=Ua,dn)),+tn.apply(this,dn),+Ri.apply(this,(dn[0]=ea,dn)),+tn.apply(this,dn)),Wi)return _n=null,Wi+""||null}return Zi.source=function(Wi){return arguments.length?(xr=Wi,Zi):xr},Zi.target=function(Wi){return arguments.length?(Jr=Wi,Zi):Jr},Zi.x=function(Wi){return arguments.length?(Ri=typeof Wi=="function"?Wi:z(+Wi),Zi):Ri},Zi.y=function(Wi){return arguments.length?(tn=typeof Wi=="function"?Wi:z(+Wi),Zi):tn},Zi.context=function(Wi){return arguments.length?(_n=Wi??null,Zi):_n},Zi}function ne(zt,xr,Jr,Ri,tn){zt.moveTo(xr,Jr),zt.bezierCurveTo(xr=(xr+Ri)/2,Jr,xr,tn,Ri,tn)}function se(zt,xr,Jr,Ri,tn){zt.moveTo(xr,Jr),zt.bezierCurveTo(xr,Jr=(Jr+tn)/2,Ri,Jr,Ri,tn)}function _e(zt,xr,Jr,Ri,tn){var _n=xe(xr,Jr),Zi=xe(xr,Jr=(Jr+tn)/2),Wi=xe(Ri,Jr),dn=xe(Ri,tn);zt.moveTo(_n[0],_n[1]),zt.bezierCurveTo(Zi[0],Zi[1],Wi[0],Wi[1],dn[0],dn[1])}function oe(){return ge(ne)}function J(){return ge(se)}function me(){var zt=ge(_e);return zt.angle=zt.x,delete zt.x,zt.radius=zt.y,delete zt.y,zt}var fe={draw:function(zt,xr){var Jr=Math.sqrt(xr/h);zt.moveTo(Jr,0),zt.arc(0,0,Jr,0,b)}},Ce={draw:function(zt,xr){var Jr=Math.sqrt(xr/5)/2;zt.moveTo(-3*Jr,-Jr),zt.lineTo(-Jr,-Jr),zt.lineTo(-Jr,-3*Jr),zt.lineTo(Jr,-3*Jr),zt.lineTo(Jr,-Jr),zt.lineTo(3*Jr,-Jr),zt.lineTo(3*Jr,Jr),zt.lineTo(Jr,Jr),zt.lineTo(Jr,3*Jr),zt.lineTo(-Jr,3*Jr),zt.lineTo(-Jr,Jr),zt.lineTo(-3*Jr,Jr),zt.closePath()}},Be=Math.sqrt(1/3),Oe=Be*2,Ze={draw:function(zt,xr){var Jr=Math.sqrt(xr/Oe),Ri=Jr*Be;zt.moveTo(0,-Jr),zt.lineTo(Ri,0),zt.lineTo(0,Jr),zt.lineTo(-Ri,0),zt.closePath()}},Ge=.8908130915292852,rt=Math.sin(h/10)/Math.sin(7*h/10),_t=Math.sin(b/10)*rt,pt=-Math.cos(b/10)*rt,gt={draw:function(zt,xr){var Jr=Math.sqrt(xr*Ge),Ri=_t*Jr,tn=pt*Jr;zt.moveTo(0,-Jr),zt.lineTo(Ri,tn);for(var _n=1;_n<5;++_n){var Zi=b*_n/5,Wi=Math.cos(Zi),dn=Math.sin(Zi);zt.lineTo(dn*Jr,-Wi*Jr),zt.lineTo(Wi*Ri-dn*tn,dn*Ri+Wi*tn)}zt.closePath()}},ct={draw:function(zt,xr){var Jr=Math.sqrt(xr),Ri=-Jr/2;zt.rect(Ri,Ri,Jr,Jr)}},Ae=Math.sqrt(3),ze={draw:function(zt,xr){var Jr=-Math.sqrt(xr/(Ae*3));zt.moveTo(0,Jr*2),zt.lineTo(-Ae*Jr,-Jr),zt.lineTo(Ae*Jr,-Jr),zt.closePath()}},Ee=-.5,nt=Math.sqrt(3)/2,xt=1/Math.sqrt(12),ut=(xt/2+1)*3,Et={draw:function(zt,xr){var Jr=Math.sqrt(xr/ut),Ri=Jr/2,tn=Jr*xt,_n=Ri,Zi=Jr*xt+Jr,Wi=-_n,dn=Zi;zt.moveTo(Ri,tn),zt.lineTo(_n,Zi),zt.lineTo(Wi,dn),zt.lineTo(Ee*Ri-nt*tn,nt*Ri+Ee*tn),zt.lineTo(Ee*_n-nt*Zi,nt*_n+Ee*Zi),zt.lineTo(Ee*Wi-nt*dn,nt*Wi+Ee*dn),zt.lineTo(Ee*Ri+nt*tn,Ee*tn-nt*Ri),zt.lineTo(Ee*_n+nt*Zi,Ee*Zi-nt*_n),zt.lineTo(Ee*Wi+nt*dn,Ee*dn-nt*Wi),zt.closePath()}},Gt=[fe,Ce,Ze,ct,gt,ze,Et];function Jt(){var zt=z(fe),xr=z(64),Jr=null;function Ri(){var tn;if(Jr||(Jr=tn=y.path()),zt.apply(this,arguments).draw(Jr,+xr.apply(this,arguments)),tn)return Jr=null,tn+""||null}return Ri.type=function(tn){return arguments.length?(zt=typeof tn=="function"?tn:z(tn),Ri):zt},Ri.size=function(tn){return arguments.length?(xr=typeof tn=="function"?tn:z(+tn),Ri):xr},Ri.context=function(tn){return arguments.length?(Jr=tn??null,Ri):Jr},Ri}function gr(){}function mr(zt,xr,Jr){zt._context.bezierCurveTo((2*zt._x0+zt._x1)/3,(2*zt._y0+zt._y1)/3,(zt._x0+2*zt._x1)/3,(zt._y0+2*zt._y1)/3,(zt._x0+4*zt._x1+xr)/6,(zt._y0+4*zt._y1+Jr)/6)}function Kr(zt){this._context=zt}Kr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function ri(zt){return new Kr(zt)}function Mr(zt){this._context=zt}Mr.prototype={areaStart:gr,areaEnd:gr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._x2=zt,this._y2=xr;break;case 1:this._point=2,this._x3=zt,this._y3=xr;break;case 2:this._point=3,this._x4=zt,this._y4=xr,this._context.moveTo((this._x0+4*this._x1+zt)/6,(this._y0+4*this._y1+xr)/6);break;default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function ui(zt){return new Mr(zt)}function mi(zt){this._context=zt}mi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Jr=(this._x0+4*this._x1+zt)/6,Ri=(this._y0+4*this._y1+xr)/6;this._line?this._context.lineTo(Jr,Ri):this._context.moveTo(Jr,Ri);break;case 3:this._point=4;default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function Ot(zt){return new mi(zt)}function Je(zt,xr){this._basis=new Kr(zt),this._beta=xr}Je.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var zt=this._x,xr=this._y,Jr=zt.length-1;if(Jr>0)for(var Ri=zt[0],tn=xr[0],_n=zt[Jr]-Ri,Zi=xr[Jr]-tn,Wi=-1,dn;++Wi<=Jr;)dn=Wi/Jr,this._basis.point(this._beta*zt[Wi]+(1-this._beta)*(Ri+dn*_n),this._beta*xr[Wi]+(1-this._beta)*(tn+dn*Zi));this._x=this._y=null,this._basis.lineEnd()},point:function(zt,xr){this._x.push(+zt),this._y.push(+xr)}};var ot=function zt(xr){function Jr(Ri){return xr===1?new Kr(Ri):new Je(Ri,xr)}return Jr.beta=function(Ri){return zt(+Ri)},Jr}(.85);function De(zt,xr,Jr){zt._context.bezierCurveTo(zt._x1+zt._k*(zt._x2-zt._x0),zt._y1+zt._k*(zt._y2-zt._y0),zt._x2+zt._k*(zt._x1-xr),zt._y2+zt._k*(zt._y1-Jr),zt._x2,zt._y2)}function ye(zt,xr){this._context=zt,this._k=(1-xr)/6}ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:De(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2,this._x1=zt,this._y1=xr;break;case 2:this._point=3;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Pe=function zt(xr){function Jr(Ri){return new ye(Ri,xr)}return Jr.tension=function(Ri){return zt(+Ri)},Jr}(0);function He(zt,xr){this._context=zt,this._k=(1-xr)/6}He.prototype={areaStart:gr,areaEnd:gr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._x3=zt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=zt,this._y4=xr);break;case 2:this._point=3,this._x5=zt,this._y5=xr;break;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var at=function zt(xr){function Jr(Ri){return new He(Ri,xr)}return Jr.tension=function(Ri){return zt(+Ri)},Jr}(0);function ht(zt,xr){this._context=zt,this._k=(1-xr)/6}ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var At=function zt(xr){function Jr(Ri){return new ht(Ri,xr)}return Jr.tension=function(Ri){return zt(+Ri)},Jr}(0);function Wt(zt,xr,Jr){var Ri=zt._x1,tn=zt._y1,_n=zt._x2,Zi=zt._y2;if(zt._l01_a>s){var Wi=2*zt._l01_2a+3*zt._l01_a*zt._l12_a+zt._l12_2a,dn=3*zt._l01_a*(zt._l01_a+zt._l12_a);Ri=(Ri*Wi-zt._x0*zt._l12_2a+zt._x2*zt._l01_2a)/dn,tn=(tn*Wi-zt._y0*zt._l12_2a+zt._y2*zt._l01_2a)/dn}if(zt._l23_a>s){var Ua=2*zt._l23_2a+3*zt._l23_a*zt._l12_a+zt._l12_2a,ea=3*zt._l23_a*(zt._l23_a+zt._l12_a);_n=(_n*Ua+zt._x1*zt._l23_2a-xr*zt._l12_2a)/ea,Zi=(Zi*Ua+zt._y1*zt._l23_2a-Jr*zt._l12_2a)/ea}zt._context.bezierCurveTo(Ri,tn,_n,Zi,zt._x2,zt._y2)}function Kt(zt,xr){this._context=zt,this._alpha=xr}Kt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Jr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var hr=function zt(xr){function Jr(Ri){return xr?new Kt(Ri,xr):new ye(Ri,0)}return Jr.alpha=function(Ri){return zt(+Ri)},Jr}(.5);function zr(zt,xr){this._context=zt,this._alpha=xr}zr.prototype={areaStart:gr,areaEnd:gr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Jr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=zt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=zt,this._y4=xr);break;case 2:this._point=3,this._x5=zt,this._y5=xr;break;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Dr=function zt(xr){function Jr(Ri){return xr?new zr(Ri,xr):new He(Ri,0)}return Jr.alpha=function(Ri){return zt(+Ri)},Jr}(.5);function br(zt,xr){this._context=zt,this._alpha=xr}br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Jr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Jr*Jr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var hi=function zt(xr){function Jr(Ri){return xr?new br(Ri,xr):new ht(Ri,0)}return Jr.alpha=function(Ri){return zt(+Ri)},Jr}(.5);function un(zt){this._context=zt}un.prototype={areaStart:gr,areaEnd:gr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(zt,xr){zt=+zt,xr=+xr,this._point?this._context.lineTo(zt,xr):(this._point=1,this._context.moveTo(zt,xr))}};function cn(zt){return new un(zt)}function yn(zt){return zt<0?-1:1}function Wn(zt,xr,Jr){var Ri=zt._x1-zt._x0,tn=xr-zt._x1,_n=(zt._y1-zt._y0)/(Ri||tn<0&&-0),Zi=(Jr-zt._y1)/(tn||Ri<0&&-0),Wi=(_n*tn+Zi*Ri)/(Ri+tn);return(yn(_n)+yn(Zi))*Math.min(Math.abs(_n),Math.abs(Zi),.5*Math.abs(Wi))||0}function Sn(zt,xr){var Jr=zt._x1-zt._x0;return Jr?(3*(zt._y1-zt._y0)/Jr-xr)/2:xr}function fn(zt,xr,Jr){var Ri=zt._x0,tn=zt._y0,_n=zt._x1,Zi=zt._y1,Wi=(_n-Ri)/3;zt._context.bezierCurveTo(Ri+Wi,tn+Wi*xr,_n-Wi,Zi-Wi*Jr,_n,Zi)}function ga(zt){this._context=zt}ga.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:fn(this,this._t0,Sn(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){var Jr=NaN;if(zt=+zt,xr=+xr,!(zt===this._x1&&xr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3,fn(this,Sn(this,Jr=Wn(this,zt,xr)),Jr);break;default:fn(this,this._t0,Jr=Wn(this,zt,xr));break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr,this._t0=Jr}}};function na(zt){this._context=new Zt(zt)}(na.prototype=Object.create(ga.prototype)).point=function(zt,xr){ga.prototype.point.call(this,xr,zt)};function Zt(zt){this._context=zt}Zt.prototype={moveTo:function(zt,xr){this._context.moveTo(xr,zt)},closePath:function(){this._context.closePath()},lineTo:function(zt,xr){this._context.lineTo(xr,zt)},bezierCurveTo:function(zt,xr,Jr,Ri,tn,_n){this._context.bezierCurveTo(xr,zt,Ri,Jr,_n,tn)}};function sr(zt){return new ga(zt)}function _r(zt){return new na(zt)}function Cr(zt){this._context=zt}Cr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var zt=this._x,xr=this._y,Jr=zt.length;if(Jr)if(this._line?this._context.lineTo(zt[0],xr[0]):this._context.moveTo(zt[0],xr[0]),Jr===2)this._context.lineTo(zt[1],xr[1]);else for(var Ri=fi(zt),tn=fi(xr),_n=0,Zi=1;Zi=0;--xr)tn[xr]=(Zi[xr]-tn[xr+1])/_n[xr];for(_n[Jr-1]=(zt[Jr]+tn[Jr-1])/2,xr=0;xr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,xr),this._context.lineTo(zt,xr);else{var Jr=this._x*(1-this._t)+zt*this._t;this._context.lineTo(Jr,this._y),this._context.lineTo(Jr,xr)}break}}this._x=zt,this._y=xr}};function Hi(zt){return new Ui(zt,.5)}function En(zt){return new Ui(zt,0)}function Rn(zt){return new Ui(zt,1)}function Gn(zt,xr){if((Zi=zt.length)>1)for(var Jr=1,Ri,tn,_n=zt[xr[0]],Zi,Wi=_n.length;Jr=0;)Jr[xr]=xr;return Jr}function sa(zt,xr){return zt[xr]}function Mn(){var zt=z([]),xr=Xn,Jr=Gn,Ri=sa;function tn(_n){var Zi=zt.apply(this,arguments),Wi,dn=_n.length,Ua=Zi.length,ea=new Array(Ua),fo;for(Wi=0;Wi0){for(var Jr,Ri,tn=0,_n=zt[0].length,Zi;tn<_n;++tn){for(Zi=Jr=0;Jr0)for(var Jr,Ri=0,tn,_n,Zi,Wi,dn,Ua=zt[xr[0]].length;Ri0?(tn[0]=Zi,tn[1]=Zi+=_n):_n<0?(tn[1]=Wi,tn[0]=Wi+=_n):(tn[0]=0,tn[1]=_n)}function Ft(zt,xr){if((tn=zt.length)>0){for(var Jr=0,Ri=zt[xr[0]],tn,_n=Ri.length;Jr<_n;++Jr){for(var Zi=0,Wi=0;Zi0)||!((_n=(tn=zt[xr[0]]).length)>0))){for(var Jr=0,Ri=1,tn,_n,Zi;Ri<_n;++Ri){for(var Wi=0,dn=0,Ua=0;Wi_n&&(_n=tn,Jr=xr);return Jr}function oi(zt){var xr=zt.map(Gr);return Xn(zt).sort(function(Jr,Ri){return xr[Jr]-xr[Ri]})}function Gr(zt){for(var xr=0,Jr=-1,Ri=zt.length,tn;++Jr{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,T6(),mA(),yz()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3)})(te,function(d,y,z,P){function i(g){return g.target.depth}function n(g){return g.depth}function a(g,C){return C-1-g.height}function l(g,C){return g.sourceLinks.length?g.depth:C-1}function o(g){return g.targetLinks.length?g.depth:g.sourceLinks.length?y.min(g.sourceLinks,i)-1:0}function u(g){return function(){return g}}function s(g,C){return m(g.source,C.source)||g.index-C.index}function h(g,C){return m(g.target,C.target)||g.index-C.index}function m(g,C){return g.y0-C.y0}function b(g){return g.value}function x(g){return(g.y0+g.y1)/2}function _(g){return x(g.source)*g.value}function A(g){return x(g.target)*g.value}function f(g){return g.index}function k(g){return g.nodes}function w(g){return g.links}function D(g,C){var T=g.get(C);if(!T)throw new Error("missing: "+C);return T}var E=function(){var g=0,C=0,T=1,N=1,B=24,U=8,V=f,W=l,F=k,$=w,q=32,G=2/3;function ee(){var ge={nodes:F.apply(null,arguments),links:$.apply(null,arguments)};return he(ge),xe(ge),ve(ge),ce(ge),re(ge),ge}ee.update=function(ge){return re(ge),ge},ee.nodeId=function(ge){return arguments.length?(V=typeof ge=="function"?ge:u(ge),ee):V},ee.nodeAlign=function(ge){return arguments.length?(W=typeof ge=="function"?ge:u(ge),ee):W},ee.nodeWidth=function(ge){return arguments.length?(B=+ge,ee):B},ee.nodePadding=function(ge){return arguments.length?(U=+ge,ee):U},ee.nodes=function(ge){return arguments.length?(F=typeof ge=="function"?ge:u(ge),ee):F},ee.links=function(ge){return arguments.length?($=typeof ge=="function"?ge:u(ge),ee):$},ee.size=function(ge){return arguments.length?(g=C=0,T=+ge[0],N=+ge[1],ee):[T-g,N-C]},ee.extent=function(ge){return arguments.length?(g=+ge[0][0],T=+ge[1][0],C=+ge[0][1],N=+ge[1][1],ee):[[g,C],[T,N]]},ee.iterations=function(ge){return arguments.length?(q=+ge,ee):q};function he(ge){ge.nodes.forEach(function(se,_e){se.index=_e,se.sourceLinks=[],se.targetLinks=[]});var ne=z.map(ge.nodes,V);ge.links.forEach(function(se,_e){se.index=_e;var oe=se.source,J=se.target;typeof oe!="object"&&(oe=se.source=D(ne,oe)),typeof J!="object"&&(J=se.target=D(ne,J)),oe.sourceLinks.push(se),J.targetLinks.push(se)})}function xe(ge){ge.nodes.forEach(function(ne){ne.value=Math.max(y.sum(ne.sourceLinks,b),y.sum(ne.targetLinks,b))})}function ve(ge){var ne,se,_e;for(ne=ge.nodes,se=[],_e=0;ne.length;++_e,ne=se,se=[])ne.forEach(function(J){J.depth=_e,J.sourceLinks.forEach(function(me){se.indexOf(me.target)<0&&se.push(me.target)})});for(ne=ge.nodes,se=[],_e=0;ne.length;++_e,ne=se,se=[])ne.forEach(function(J){J.height=_e,J.targetLinks.forEach(function(me){se.indexOf(me.source)<0&&se.push(me.source)})});var oe=(T-g-B)/(_e-1);ge.nodes.forEach(function(J){J.x1=(J.x0=g+Math.max(0,Math.min(_e-1,Math.floor(W.call(null,J,_e))))*oe)+B})}function ce(ge){var ne=z.nest().key(function(Ce){return Ce.x0}).sortKeys(y.ascending).entries(ge.nodes).map(function(Ce){return Ce.values});oe(),fe();for(var se=1,_e=q;_e>0;--_e)me(se*=.99),fe(),J(se),fe();function oe(){var Ce=y.max(ne,function(Ze){return Ze.length}),Be=G*(N-C)/(Ce-1);U>Be&&(U=Be);var Oe=y.min(ne,function(Ze){return(N-C-(Ze.length-1)*U)/y.sum(Ze,b)});ne.forEach(function(Ze){Ze.forEach(function(Ge,rt){Ge.y1=(Ge.y0=rt)+Ge.value*Oe})}),ge.links.forEach(function(Ze){Ze.width=Ze.value*Oe})}function J(Ce){ne.forEach(function(Be){Be.forEach(function(Oe){if(Oe.targetLinks.length){var Ze=(y.sum(Oe.targetLinks,_)/y.sum(Oe.targetLinks,b)-x(Oe))*Ce;Oe.y0+=Ze,Oe.y1+=Ze}})})}function me(Ce){ne.slice().reverse().forEach(function(Be){Be.forEach(function(Oe){if(Oe.sourceLinks.length){var Ze=(y.sum(Oe.sourceLinks,A)/y.sum(Oe.sourceLinks,b)-x(Oe))*Ce;Oe.y0+=Ze,Oe.y1+=Ze}})})}function fe(){ne.forEach(function(Ce){var Be,Oe,Ze=C,Ge=Ce.length,rt;for(Ce.sort(m),rt=0;rt0&&(Be.y0+=Oe,Be.y1+=Oe),Ze=Be.y1+U;if(Oe=Ze-U-N,Oe>0)for(Ze=Be.y0-=Oe,Be.y1-=Oe,rt=Ge-2;rt>=0;--rt)Be=Ce[rt],Oe=Be.y1+U-Ze,Oe>0&&(Be.y0-=Oe,Be.y1-=Oe),Ze=Be.y0})}}function re(ge){ge.nodes.forEach(function(ne){ne.sourceLinks.sort(h),ne.targetLinks.sort(s)}),ge.nodes.forEach(function(ne){var se=ne.y0,_e=se;ne.sourceLinks.forEach(function(oe){oe.y0=se+oe.width/2,se+=oe.width}),ne.targetLinks.forEach(function(oe){oe.y1=_e+oe.width/2,_e+=oe.width})})}return ee};function I(g){return[g.source.x1,g.y0]}function M(g){return[g.target.x0,g.y1]}var p=function(){return P.linkHorizontal().source(I).target(M)};d.sankey=E,d.sankeyCenter=o,d.sankeyLeft=n,d.sankeyRight=a,d.sankeyJustify=l,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}),Ree=Fe((te,Y)=>{var d=vz();Y.exports=function(y,z){var P=[],i=[],n=[],a={},l=[],o;function u(w){n[w]=!1,a.hasOwnProperty(w)&&Object.keys(a[w]).forEach(function(D){delete a[w][D],n[D]&&u(D)})}function s(w){var D=!1;i.push(w),n[w]=!0;var E,I;for(E=0;E=w})}function b(w){m(w);for(var D=y,E=d(D),I=E.components.filter(function(B){return B.length>1}),M=1/0,p,g=0;g{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,T6(),mA(),yz(),Ree()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3,null)})(te,function(d,y,z,P,i){i=i&&i.hasOwnProperty("default")?i.default:i;function n(Ge){return Ge.target.depth}function a(Ge){return Ge.depth}function l(Ge,rt){return rt-1-Ge.height}function o(Ge,rt){return Ge.sourceLinks.length?Ge.depth:rt-1}function u(Ge){return Ge.targetLinks.length?Ge.depth:Ge.sourceLinks.length?y.min(Ge.sourceLinks,n)-1:0}function s(Ge){return function(){return Ge}}var h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ge){return typeof Ge}:function(Ge){return Ge&&typeof Symbol=="function"&&Ge.constructor===Symbol&&Ge!==Symbol.prototype?"symbol":typeof Ge};function m(Ge,rt){return x(Ge.source,rt.source)||Ge.index-rt.index}function b(Ge,rt){return x(Ge.target,rt.target)||Ge.index-rt.index}function x(Ge,rt){return Ge.partOfCycle===rt.partOfCycle?Ge.y0-rt.y0:Ge.circularLinkType==="top"||rt.circularLinkType==="bottom"?-1:1}function _(Ge){return Ge.value}function A(Ge){return(Ge.y0+Ge.y1)/2}function f(Ge){return A(Ge.source)}function k(Ge){return A(Ge.target)}function w(Ge){return Ge.index}function D(Ge){return Ge.nodes}function E(Ge){return Ge.links}function I(Ge,rt){var _t=Ge.get(rt);if(!_t)throw new Error("missing: "+rt);return _t}function M(Ge,rt){return rt(Ge)}var p=25,g=10,C=.3;function T(){var Ge=0,rt=0,_t=1,pt=1,gt=24,ct,Ae=w,ze=o,Ee=D,nt=E,xt=32,ut=2,Et,Gt=null;function Jt(){var Ot={nodes:Ee.apply(null,arguments),links:nt.apply(null,arguments)};gr(Ot),N(Ot,Ae,Gt),mr(Ot),Mr(Ot),B(Ot,Ae),ui(Ot,xt,Ae),mi(Ot);for(var Je=4,ot=0;ot"u"?"undefined":h(ye))!=="object"&&(ye=ot.source=I(Je,ye)),(typeof Pe>"u"?"undefined":h(Pe))!=="object"&&(Pe=ot.target=I(Je,Pe)),ye.sourceLinks.push(ot),Pe.targetLinks.push(ot)}),Ot}function mr(Ot){Ot.nodes.forEach(function(Je){Je.partOfCycle=!1,Je.value=Math.max(y.sum(Je.sourceLinks,_),y.sum(Je.targetLinks,_)),Je.sourceLinks.forEach(function(ot){ot.circular&&(Je.partOfCycle=!0,Je.circularLinkType=ot.circularLinkType)}),Je.targetLinks.forEach(function(ot){ot.circular&&(Je.partOfCycle=!0,Je.circularLinkType=ot.circularLinkType)})})}function Kr(Ot){var Je=0,ot=0,De=0,ye=0,Pe=y.max(Ot.nodes,function(He){return He.column});return Ot.links.forEach(function(He){He.circular&&(He.circularLinkType=="top"?Je=Je+He.width:ot=ot+He.width,He.target.column==0&&(ye=ye+He.width),He.source.column==Pe&&(De=De+He.width))}),Je=Je>0?Je+p+g:Je,ot=ot>0?ot+p+g:ot,De=De>0?De+p+g:De,ye=ye>0?ye+p+g:ye,{top:Je,bottom:ot,left:ye,right:De}}function ri(Ot,Je){var ot=y.max(Ot.nodes,function(At){return At.column}),De=_t-Ge,ye=pt-rt,Pe=De+Je.right+Je.left,He=ye+Je.top+Je.bottom,at=De/Pe,ht=ye/He;return Ge=Ge*at+Je.left,_t=Je.right==0?_t:_t*at,rt=rt*ht+Je.top,pt=pt*ht,Ot.nodes.forEach(function(At){At.x0=Ge+At.column*((_t-Ge-gt)/ot),At.x1=At.x0+gt}),ht}function Mr(Ot){var Je,ot,De;for(Je=Ot.nodes,ot=[],De=0;Je.length;++De,Je=ot,ot=[])Je.forEach(function(ye){ye.depth=De,ye.sourceLinks.forEach(function(Pe){ot.indexOf(Pe.target)<0&&!Pe.circular&&ot.push(Pe.target)})});for(Je=Ot.nodes,ot=[],De=0;Je.length;++De,Je=ot,ot=[])Je.forEach(function(ye){ye.height=De,ye.targetLinks.forEach(function(Pe){ot.indexOf(Pe.source)<0&&!Pe.circular&&ot.push(Pe.source)})});Ot.nodes.forEach(function(ye){ye.column=Math.floor(ze.call(null,ye,De))})}function ui(Ot,Je,ot){var De=z.nest().key(function(At){return At.column}).sortKeys(y.ascending).entries(Ot.nodes).map(function(At){return At.values});He(ot),ht();for(var ye=1,Pe=Je;Pe>0;--Pe)at(ye*=.99,ot),ht();function He(At){if(Et){var Wt=1/0;De.forEach(function(Dr){var br=pt*Et/(Dr.length+1);Wt=br0))if(Dr==0&&zr==1)hi=br.y1-br.y0,br.y0=pt/2-hi/2,br.y1=pt/2+hi/2;else if(Dr==Kt-1&&zr==1)hi=br.y1-br.y0,br.y0=pt/2-hi/2,br.y1=pt/2+hi/2;else{var un=0,cn=y.mean(br.sourceLinks,k),yn=y.mean(br.targetLinks,f);cn&&yn?un=(cn+yn)/2:un=cn||yn;var Wn=(un-A(br))*At;br.y0+=Wn,br.y1+=Wn}})})}function ht(){De.forEach(function(At){var Wt,Kt,hr=rt,zr=At.length,Dr;for(At.sort(x),Dr=0;Dr0&&(Wt.y0+=Kt,Wt.y1+=Kt),hr=Wt.y1+ct;if(Kt=hr-ct-pt,Kt>0)for(hr=Wt.y0-=Kt,Wt.y1-=Kt,Dr=zr-2;Dr>=0;--Dr)Wt=At[Dr],Kt=Wt.y1+ct-hr,Kt>0&&(Wt.y0-=Kt,Wt.y1-=Kt),hr=Wt.y0})}}function mi(Ot){Ot.nodes.forEach(function(Je){Je.sourceLinks.sort(b),Je.targetLinks.sort(m)}),Ot.nodes.forEach(function(Je){var ot=Je.y0,De=ot,ye=Je.y1,Pe=ye;Je.sourceLinks.forEach(function(He){He.circular?(He.y0=ye-He.width/2,ye=ye-He.width):(He.y0=ot+He.width/2,ot+=He.width)}),Je.targetLinks.forEach(function(He){He.circular?(He.y1=Pe-He.width/2,Pe=Pe-He.width):(He.y1=De+He.width/2,De+=He.width)})})}return Jt}function N(Ge,rt,_t){var pt=0;if(_t===null){for(var gt=[],ct=0;ctrt.source.column)}function W(Ge,rt){var _t=0;Ge.sourceLinks.forEach(function(gt){_t=gt.circular&&!Oe(gt,rt)?_t+1:_t});var pt=0;return Ge.targetLinks.forEach(function(gt){pt=gt.circular&&!Oe(gt,rt)?pt+1:pt}),_t+pt}function F(Ge){var rt=Ge.source.sourceLinks,_t=0;rt.forEach(function(ct){_t=ct.circular?_t+1:_t});var pt=Ge.target.targetLinks,gt=0;return pt.forEach(function(ct){gt=ct.circular?gt+1:gt}),!(_t>1||gt>1)}function $(Ge,rt,_t){return Ge.sort(ee),Ge.forEach(function(pt,gt){var ct=0;if(Oe(pt,_t)&&F(pt))pt.circularPathData.verticalBuffer=ct+pt.width/2;else{var Ae=0;for(Ae;Aect?ze:ct}pt.circularPathData.verticalBuffer=ct+pt.width/2}}),Ge}function q(Ge,rt,_t,pt){var gt=5,ct=y.min(Ge.links,function(Ee){return Ee.source.y0});Ge.links.forEach(function(Ee){Ee.circular&&(Ee.circularPathData={})});var Ae=Ge.links.filter(function(Ee){return Ee.circularLinkType=="top"});$(Ae,rt,pt);var ze=Ge.links.filter(function(Ee){return Ee.circularLinkType=="bottom"});$(ze,rt,pt),Ge.links.forEach(function(Ee){if(Ee.circular){if(Ee.circularPathData.arcRadius=Ee.width+g,Ee.circularPathData.leftNodeBuffer=gt,Ee.circularPathData.rightNodeBuffer=gt,Ee.circularPathData.sourceWidth=Ee.source.x1-Ee.source.x0,Ee.circularPathData.sourceX=Ee.source.x0+Ee.circularPathData.sourceWidth,Ee.circularPathData.targetX=Ee.target.x0,Ee.circularPathData.sourceY=Ee.y0,Ee.circularPathData.targetY=Ee.y1,Oe(Ee,pt)&&F(Ee))Ee.circularPathData.leftSmallArcRadius=g+Ee.width/2,Ee.circularPathData.leftLargeArcRadius=g+Ee.width/2,Ee.circularPathData.rightSmallArcRadius=g+Ee.width/2,Ee.circularPathData.rightLargeArcRadius=g+Ee.width/2,Ee.circularLinkType=="bottom"?(Ee.circularPathData.verticalFullExtent=Ee.source.y1+p+Ee.circularPathData.verticalBuffer,Ee.circularPathData.verticalLeftInnerExtent=Ee.circularPathData.verticalFullExtent-Ee.circularPathData.leftLargeArcRadius,Ee.circularPathData.verticalRightInnerExtent=Ee.circularPathData.verticalFullExtent-Ee.circularPathData.rightLargeArcRadius):(Ee.circularPathData.verticalFullExtent=Ee.source.y0-p-Ee.circularPathData.verticalBuffer,Ee.circularPathData.verticalLeftInnerExtent=Ee.circularPathData.verticalFullExtent+Ee.circularPathData.leftLargeArcRadius,Ee.circularPathData.verticalRightInnerExtent=Ee.circularPathData.verticalFullExtent+Ee.circularPathData.rightLargeArcRadius);else{var nt=Ee.source.column,xt=Ee.circularLinkType,ut=Ge.links.filter(function(Jt){return Jt.source.column==nt&&Jt.circularLinkType==xt});Ee.circularLinkType=="bottom"?ut.sort(xe):ut.sort(he);var Et=0;ut.forEach(function(Jt,gr){Jt.circularLinkID==Ee.circularLinkID&&(Ee.circularPathData.leftSmallArcRadius=g+Ee.width/2+Et,Ee.circularPathData.leftLargeArcRadius=g+Ee.width/2+gr*rt+Et),Et=Et+Jt.width}),nt=Ee.target.column,ut=Ge.links.filter(function(Jt){return Jt.target.column==nt&&Jt.circularLinkType==xt}),Ee.circularLinkType=="bottom"?ut.sort(ce):ut.sort(ve),Et=0,ut.forEach(function(Jt,gr){Jt.circularLinkID==Ee.circularLinkID&&(Ee.circularPathData.rightSmallArcRadius=g+Ee.width/2+Et,Ee.circularPathData.rightLargeArcRadius=g+Ee.width/2+gr*rt+Et),Et=Et+Jt.width}),Ee.circularLinkType=="bottom"?(Ee.circularPathData.verticalFullExtent=Math.max(_t,Ee.source.y1,Ee.target.y1)+p+Ee.circularPathData.verticalBuffer,Ee.circularPathData.verticalLeftInnerExtent=Ee.circularPathData.verticalFullExtent-Ee.circularPathData.leftLargeArcRadius,Ee.circularPathData.verticalRightInnerExtent=Ee.circularPathData.verticalFullExtent-Ee.circularPathData.rightLargeArcRadius):(Ee.circularPathData.verticalFullExtent=ct-p-Ee.circularPathData.verticalBuffer,Ee.circularPathData.verticalLeftInnerExtent=Ee.circularPathData.verticalFullExtent+Ee.circularPathData.leftLargeArcRadius,Ee.circularPathData.verticalRightInnerExtent=Ee.circularPathData.verticalFullExtent+Ee.circularPathData.rightLargeArcRadius)}Ee.circularPathData.leftInnerExtent=Ee.circularPathData.sourceX+Ee.circularPathData.leftNodeBuffer,Ee.circularPathData.rightInnerExtent=Ee.circularPathData.targetX-Ee.circularPathData.rightNodeBuffer,Ee.circularPathData.leftFullExtent=Ee.circularPathData.sourceX+Ee.circularPathData.leftLargeArcRadius+Ee.circularPathData.leftNodeBuffer,Ee.circularPathData.rightFullExtent=Ee.circularPathData.targetX-Ee.circularPathData.rightLargeArcRadius-Ee.circularPathData.rightNodeBuffer}if(Ee.circular)Ee.path=G(Ee);else{var Gt=P.linkHorizontal().source(function(Jt){var gr=Jt.source.x0+(Jt.source.x1-Jt.source.x0),mr=Jt.y0;return[gr,mr]}).target(function(Jt){var gr=Jt.target.x0,mr=Jt.y1;return[gr,mr]});Ee.path=Gt(Ee)}})}function G(Ge){var rt="";return Ge.circularLinkType=="top"?rt="M"+Ge.circularPathData.sourceX+" "+Ge.circularPathData.sourceY+" L"+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.sourceY+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ge.circularPathData.leftFullExtent+" "+(Ge.circularPathData.sourceY-Ge.circularPathData.leftSmallArcRadius)+" L"+Ge.circularPathData.leftFullExtent+" "+Ge.circularPathData.verticalLeftInnerExtent+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" L"+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ge.circularPathData.rightFullExtent+" "+Ge.circularPathData.verticalRightInnerExtent+" L"+Ge.circularPathData.rightFullExtent+" "+(Ge.circularPathData.targetY-Ge.circularPathData.rightSmallArcRadius)+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.targetY+" L"+Ge.circularPathData.targetX+" "+Ge.circularPathData.targetY:rt="M"+Ge.circularPathData.sourceX+" "+Ge.circularPathData.sourceY+" L"+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.sourceY+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ge.circularPathData.leftFullExtent+" "+(Ge.circularPathData.sourceY+Ge.circularPathData.leftSmallArcRadius)+" L"+Ge.circularPathData.leftFullExtent+" "+Ge.circularPathData.verticalLeftInnerExtent+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" L"+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ge.circularPathData.rightFullExtent+" "+Ge.circularPathData.verticalRightInnerExtent+" L"+Ge.circularPathData.rightFullExtent+" "+(Ge.circularPathData.targetY+Ge.circularPathData.rightSmallArcRadius)+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.targetY+" L"+Ge.circularPathData.targetX+" "+Ge.circularPathData.targetY,rt}function ee(Ge,rt){return re(Ge)==re(rt)?Ge.circularLinkType=="bottom"?xe(Ge,rt):he(Ge,rt):re(rt)-re(Ge)}function he(Ge,rt){return Ge.y0-rt.y0}function xe(Ge,rt){return rt.y0-Ge.y0}function ve(Ge,rt){return Ge.y1-rt.y1}function ce(Ge,rt){return rt.y1-Ge.y1}function re(Ge){return Ge.target.column-Ge.source.column}function ge(Ge){return Ge.target.x0-Ge.source.x1}function ne(Ge,rt){var _t=U(Ge),pt=ge(rt)/Math.tan(_t),gt=Be(Ge)=="up"?Ge.y1+pt:Ge.y1-pt;return gt}function se(Ge,rt){var _t=U(Ge),pt=ge(rt)/Math.tan(_t),gt=Be(Ge)=="up"?Ge.y1-pt:Ge.y1+pt;return gt}function _e(Ge,rt,_t,pt){Ge.links.forEach(function(gt){if(!gt.circular&>.target.column-gt.source.column>1){var ct=gt.source.column+1,Ae=gt.target.column-1,ze=1,Ee=Ae-ct+1;for(ze=1;ct<=Ae;ct++,ze++)Ge.nodes.forEach(function(nt){if(nt.column==ct){var xt=ze/(Ee+1),ut=Math.pow(1-xt,3),Et=3*xt*Math.pow(1-xt,2),Gt=3*Math.pow(xt,2)*(1-xt),Jt=Math.pow(xt,3),gr=ut*gt.y0+Et*gt.y0+Gt*gt.y1+Jt*gt.y1,mr=gr-gt.width/2,Kr=gr+gt.width/2,ri;mr>nt.y0&&mrnt.y0&&Krnt.y1&&J(Mr,ri,rt,_t)})):mrnt.y1&&(ri=Kr-nt.y0+10,nt=J(nt,ri,rt,_t),Ge.nodes.forEach(function(Mr){M(Mr,pt)==M(nt,pt)||Mr.column!=nt.column||Mr.y0nt.y1&&J(Mr,ri,rt,_t)}))}})}})}function oe(Ge,rt){return Ge.y0>rt.y0&&Ge.y0rt.y0&&Ge.y1rt.y1}function J(Ge,rt,_t,pt){return Ge.y0+rt>=_t&&Ge.y1+rt<=pt&&(Ge.y0=Ge.y0+rt,Ge.y1=Ge.y1+rt,Ge.targetLinks.forEach(function(gt){gt.y1=gt.y1+rt}),Ge.sourceLinks.forEach(function(gt){gt.y0=gt.y0+rt})),Ge}function me(Ge,rt,_t,pt){Ge.nodes.forEach(function(gt){pt&>.y+(gt.y1-gt.y0)>rt&&(gt.y=gt.y-(gt.y+(gt.y1-gt.y0)-rt));var ct=Ge.links.filter(function(Ee){return M(Ee.source,_t)==M(gt,_t)}),Ae=ct.length;Ae>1&&ct.sort(function(Ee,nt){if(!Ee.circular&&!nt.circular){if(Ee.target.column==nt.target.column)return Ee.y1-nt.y1;if(Ce(Ee,nt)){if(Ee.target.column>nt.target.column){var xt=se(nt,Ee);return Ee.y1-xt}if(nt.target.column>Ee.target.column){var ut=se(Ee,nt);return ut-nt.y1}}else return Ee.y1-nt.y1}if(Ee.circular&&!nt.circular)return Ee.circularLinkType=="top"?-1:1;if(nt.circular&&!Ee.circular)return nt.circularLinkType=="top"?1:-1;if(Ee.circular&&nt.circular)return Ee.circularLinkType===nt.circularLinkType&&Ee.circularLinkType=="top"?Ee.target.column===nt.target.column?Ee.target.y1-nt.target.y1:nt.target.column-Ee.target.column:Ee.circularLinkType===nt.circularLinkType&&Ee.circularLinkType=="bottom"?Ee.target.column===nt.target.column?nt.target.y1-Ee.target.y1:Ee.target.column-nt.target.column:Ee.circularLinkType=="top"?-1:1});var ze=gt.y0;ct.forEach(function(Ee){Ee.y0=ze+Ee.width/2,ze=ze+Ee.width}),ct.forEach(function(Ee,nt){if(Ee.circularLinkType=="bottom"){var xt=nt+1,ut=0;for(xt;xt1&>.sort(function(ze,Ee){if(!ze.circular&&!Ee.circular){if(ze.source.column==Ee.source.column)return ze.y0-Ee.y0;if(Ce(ze,Ee)){if(Ee.source.column0?"up":"down"}function Oe(Ge,rt){return M(Ge.source,rt)==M(Ge.target,rt)}function Ze(Ge,rt,_t){var pt=Ge.nodes,gt=Ge.links,ct=!1,Ae=!1;if(gt.forEach(function(Et){Et.circularLinkType=="top"?ct=!0:Et.circularLinkType=="bottom"&&(Ae=!0)}),ct==!1||Ae==!1){var ze=y.min(pt,function(Et){return Et.y0}),Ee=y.max(pt,function(Et){return Et.y1}),nt=Ee-ze,xt=_t-rt,ut=xt/nt;pt.forEach(function(Et){var Gt=(Et.y1-Et.y0)*ut;Et.y0=(Et.y0-ze)*ut,Et.y1=Et.y0+Gt}),gt.forEach(function(Et){Et.y0=(Et.y0-ze)*ut,Et.y1=(Et.y1-ze)*ut,Et.width=Et.width*ut})}}d.sankeyCircular=T,d.sankeyCenter=u,d.sankeyLeft=a,d.sankeyRight=l,d.sankeyJustify=o,Object.defineProperty(d,"__esModule",{value:!0})})}),_z=Fe((te,Y)=>{Y.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),Nee=Fe((te,Y)=>{var d=zee(),y=(Ab(),Ti(R_)).interpolateNumber,z=ii(),P=Bee(),i=Fee(),n=_z(),a=sn(),l=Xi(),o=Zs(),u=ji(),s=u.strTranslate,h=u.strRotate,m=t1(),b=m.keyFun,x=m.repeat,_=m.unwrap,A=cc(),f=as(),k=Bf(),w=k.CAP_SHIFT,D=k.LINE_SPACING,E=3;function I(ne,se,_e){var oe=_(se),J=oe.trace,me=J.domain,fe=J.orientation==="h",Ce=J.node.pad,Be=J.node.thickness,Oe={justify:P.sankeyJustify,left:P.sankeyLeft,right:P.sankeyRight,center:P.sankeyCenter}[J.node.align],Ze=ne.width*(me.x[1]-me.x[0]),Ge=ne.height*(me.y[1]-me.y[0]),rt=oe._nodes,_t=oe._links,pt=oe.circular,gt;pt?gt=i.sankeyCircular().circularLinkGap(0):gt=P.sankey(),gt.iterations(n.sankeyIterations).size(fe?[Ze,Ge]:[Ge,Ze]).nodeWidth(Be).nodePadding(Ce).nodeId(function(Mr){return Mr.pointNumber}).nodeAlign(Oe).nodes(rt).links(_t);var ct=gt();gt.nodePadding()=Je||(Ot=Je-mi.y0,Ot>1e-6&&(mi.y0+=Ot,mi.y1+=Ot)),Je=mi.y1+Ce})}function gr(Mr){var ui=Mr.map(function(Pe,He){return{x0:Pe.x0,index:He}}).sort(function(Pe,He){return Pe.x0-He.x0}),mi=[],Ot=-1,Je,ot=-1/0,De;for(Ae=0;Aeot+Be&&(Ot+=1,Je=ye.x0),ot=ye.x0,mi[Ot]||(mi[Ot]=[]),mi[Ot].push(ye),De=Je-ye.x0,ye.x0+=De,ye.x1+=De}return mi}if(J.node.x.length&&J.node.y.length){for(Ae=0;Ae0?" L "+J.targetX+" "+J.targetY:"")+"Z"):(_e="M "+(J.targetX-se)+" "+(J.targetY-oe)+" L "+(J.rightInnerExtent-se)+" "+(J.targetY-oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightSmallArcRadius+oe)+" 0 0 0 "+(J.rightFullExtent-oe-se)+" "+(J.targetY+J.rightSmallArcRadius)+" L "+(J.rightFullExtent-oe-se)+" "+J.verticalRightInnerExtent,me&&fe?_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightInnerExtent-oe-se)+" "+(J.verticalFullExtent+oe)+" L "+(J.rightFullExtent+oe-se-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent+oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent:me?_e+=" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent-se-oe-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" L "+(J.leftFullExtent+oe+(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent:_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightInnerExtent-se)+" "+(J.verticalFullExtent+oe)+" L "+J.leftInnerExtent+" "+(J.verticalFullExtent+oe)+" A "+(J.leftLargeArcRadius+oe)+" "+(J.leftLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent,_e+=" L "+(J.leftFullExtent+oe)+" "+(J.sourceY+J.leftSmallArcRadius)+" A "+(J.leftLargeArcRadius+oe)+" "+(J.leftSmallArcRadius+oe)+" 0 0 0 "+J.leftInnerExtent+" "+(J.sourceY-oe)+" L "+J.sourceX+" "+(J.sourceY-oe)+" L "+J.sourceX+" "+(J.sourceY+oe)+" L "+J.leftInnerExtent+" "+(J.sourceY+oe)+" A "+(J.leftLargeArcRadius-oe)+" "+(J.leftSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent-oe)+" "+(J.sourceY+J.leftSmallArcRadius)+" L "+(J.leftFullExtent-oe)+" "+J.verticalLeftInnerExtent,me&&fe?_e+=" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent-oe-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" L "+(J.rightFullExtent+oe-se+(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent:me?_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+(J.verticalFullExtent+oe)+" L "+(J.rightFullExtent-se-oe)+" "+(J.verticalFullExtent+oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent:_e+=" A "+(J.leftLargeArcRadius-oe)+" "+(J.leftLargeArcRadius-oe)+" 0 0 1 "+J.leftInnerExtent+" "+(J.verticalFullExtent-oe)+" L "+(J.rightInnerExtent-se)+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightLargeArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent,_e+=" L "+(J.rightFullExtent+oe-se)+" "+(J.targetY+J.rightSmallArcRadius)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightInnerExtent-se)+" "+(J.targetY+oe)+" L "+(J.targetX-se)+" "+(J.targetY+oe)+(se>0?" L "+J.targetX+" "+J.targetY:"")+"Z"),_e}function g(){var ne=.5;function se(_e){var oe=_e.linkArrowLength;if(_e.link.circular)return p(_e.link,oe);var J=Math.abs((_e.link.target.x0-_e.link.source.x1)/2);oe>J&&(oe=J);var me=_e.link.source.x1,fe=_e.link.target.x0-oe,Ce=y(me,fe),Be=Ce(ne),Oe=Ce(1-ne),Ze=_e.link.y0-_e.link.width/2,Ge=_e.link.y0+_e.link.width/2,rt=_e.link.y1-_e.link.width/2,_t=_e.link.y1+_e.link.width/2,pt="M"+me+","+Ze,gt="C"+Be+","+Ze+" "+Oe+","+rt+" "+fe+","+rt,ct="C"+Oe+","+_t+" "+Be+","+Ge+" "+me+","+Ge,Ae=oe>0?"L"+(fe+oe)+","+(rt+_e.link.width/2):"";return Ae+="L"+fe+","+_t,pt+gt+Ae+ct+"Z"}return se}function C(ne,se){var _e=a(se.color),oe=n.nodePadAcross,J=ne.nodePad/2;se.dx=se.x1-se.x0,se.dy=se.y1-se.y0;var me=se.dx,fe=Math.max(.5,se.dy),Ce="node_"+se.pointNumber;return se.group&&(Ce=u.randstr()),se.trace=ne.trace,se.curveNumber=ne.trace.index,{index:se.pointNumber,key:Ce,partOfGroup:se.partOfGroup||!1,group:se.group,traceId:ne.key,trace:ne.trace,node:se,nodePad:ne.nodePad,nodeLineColor:ne.nodeLineColor,nodeLineWidth:ne.nodeLineWidth,textFont:ne.textFont,size:ne.horizontal?ne.height:ne.width,visibleWidth:Math.ceil(me),visibleHeight:fe,zoneX:-oe,zoneY:-J,zoneWidth:me+2*oe,zoneHeight:fe+2*J,labelY:ne.horizontal?se.dy/2+1:se.dx/2+1,left:se.originalLayer===1,sizeAcross:ne.width,forceLayouts:ne.forceLayouts,horizontal:ne.horizontal,darkBackground:_e.getBrightness()<=128,tinyColorHue:l.tinyRGB(_e),tinyColorAlpha:_e.getAlpha(),valueFormat:ne.valueFormat,valueSuffix:ne.valueSuffix,sankey:ne.sankey,graph:ne.graph,arrangement:ne.arrangement,uniqueNodeLabelPathId:[ne.guid,ne.key,Ce].join("_"),interactionState:ne.interactionState,figure:ne}}function T(ne){ne.attr("transform",function(se){return s(se.node.x0.toFixed(3),se.node.y0.toFixed(3))})}function N(ne){ne.call(T)}function B(ne,se){ne.call(N),se.attr("d",g())}function U(ne){ne.attr("width",function(se){return se.node.x1-se.node.x0}).attr("height",function(se){return se.visibleHeight})}function V(ne){return ne.link.width>1||ne.linkLineWidth>0}function W(ne){var se=s(ne.translateX,ne.translateY);return se+(ne.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function F(ne,se,_e){ne.on(".basic",null).on("mouseover.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.hover(this,oe,se),oe.interactionState.hovered=[this,oe])}).on("mousemove.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.follow(this,oe),oe.interactionState.hovered=[this,oe])}).on("mouseout.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.unhover(this,oe,se),oe.interactionState.hovered=!1)}).on("click.basic",function(oe){oe.interactionState.hovered&&(_e.unhover(this,oe,se),oe.interactionState.hovered=!1),!oe.interactionState.dragInProgress&&!oe.partOfGroup&&_e.select(this,oe,se)})}function $(ne,se,_e,oe){var J=z.behavior.drag().origin(function(me){return{x:me.node.x0+me.visibleWidth/2,y:me.node.y0+me.visibleHeight/2}}).on("dragstart",function(me){if(me.arrangement!=="fixed"&&(u.ensureSingle(oe._fullLayout._infolayer,"g","dragcover",function(Ce){oe._fullLayout._dragCover=Ce}),u.raiseToTop(this),me.interactionState.dragInProgress=me.node,ve(me.node),me.interactionState.hovered&&(_e.nodeEvents.unhover.apply(0,me.interactionState.hovered),me.interactionState.hovered=!1),me.arrangement==="snap")){var fe=me.traceId+"|"+me.key;me.forceLayouts[fe]?me.forceLayouts[fe].alpha(1):q(ne,fe,me),G(ne,se,me,fe,oe)}}).on("drag",function(me){if(me.arrangement!=="fixed"){var fe=z.event.x,Ce=z.event.y;me.arrangement==="snap"?(me.node.x0=fe-me.visibleWidth/2,me.node.x1=fe+me.visibleWidth/2,me.node.y0=Ce-me.visibleHeight/2,me.node.y1=Ce+me.visibleHeight/2):(me.arrangement==="freeform"&&(me.node.x0=fe-me.visibleWidth/2,me.node.x1=fe+me.visibleWidth/2),Ce=Math.max(0,Math.min(me.size-me.visibleHeight/2,Ce)),me.node.y0=Ce-me.visibleHeight/2,me.node.y1=Ce+me.visibleHeight/2),ve(me.node),me.arrangement!=="snap"&&(me.sankey.update(me.graph),B(ne.filter(ce(me)),se))}}).on("dragend",function(me){if(me.arrangement!=="fixed"){me.interactionState.dragInProgress=!1;for(var fe=0;fe0)window.requestAnimationFrame(me);else{var Be=_e.node.originalX;_e.node.x0=Be-_e.visibleWidth/2,_e.node.x1=Be+_e.visibleWidth/2,he(_e,J)}})}function ee(ne,se,_e,oe){return function(){for(var J=0,me=0;me<_e.length;me++){var fe=_e[me];fe===oe.interactionState.dragInProgress?(fe.x=fe.lastDraggedX,fe.y=fe.lastDraggedY):(fe.vx=(fe.originalX-fe.x)/n.forceTicksPerFrame,fe.y=Math.min(oe.size-fe.dy/2,Math.max(fe.dy/2,fe.y))),J=Math.max(J,Math.abs(fe.vx),Math.abs(fe.vy))}!oe.interactionState.dragInProgress&&J<.1&&oe.forceLayouts[se].alpha()>0&&oe.forceLayouts[se].alpha(0)}}function he(ne,se){for(var _e=[],oe=[],J=0;J{var d=ii(),y=ji(),z=y.numberFormat,P=Nee(),i=hf(),n=Xi(),a=_z().cn,l=y._;function o(w){return w!==""}function u(w,D){return w.filter(function(E){return E.key===D.traceId})}function s(w,D){d.select(w).select("path").style("fill-opacity",D),d.select(w).select("rect").style("fill-opacity",D)}function h(w){d.select(w).select("text.name").style("fill","black")}function m(w){return function(D){return w.node.sourceLinks.indexOf(D.link)!==-1||w.node.targetLinks.indexOf(D.link)!==-1}}function b(w){return function(D){return D.node.sourceLinks.indexOf(w.link)!==-1||D.node.targetLinks.indexOf(w.link)!==-1}}function x(w,D,E){D&&E&&u(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(A.bind(0,D,E,!1))}function _(w,D,E){D&&E&&u(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(f.bind(0,D,E,!1))}function A(w,D,E,I){I.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),I.each(function(M){var p=M.link.label;p!==""&&u(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverHue}).style("fill-opacity",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverAlpha})}),E&&u(D,w).selectAll("."+a.sankeyNode).filter(b(w)).call(x)}function f(w,D,E,I){I.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),I.each(function(M){var p=M.link.label;p!==""&&u(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){return g.tinyColorHue}).style("fill-opacity",function(g){return g.tinyColorAlpha})}),E&&u(D,w).selectAll(a.sankeyNode).filter(b(w)).call(_)}function k(w,D){var E=w.hoverlabel||{},I=y.nestedProperty(E,D).get();return Array.isArray(I)?!1:I}Y.exports=function(w,D){for(var E=w._fullLayout,I=E._paper,M=E._size,p=0;p"),color:k(ce,"bgcolor")||n.addOpacity(_e.color,1),borderColor:k(ce,"bordercolor"),fontFamily:k(ce,"font.family"),fontSize:k(ce,"font.size"),fontColor:k(ce,"font.color"),fontWeight:k(ce,"font.weight"),fontStyle:k(ce,"font.style"),fontVariant:k(ce,"font.variant"),fontTextcase:k(ce,"font.textcase"),fontLineposition:k(ce,"font.lineposition"),fontShadow:k(ce,"font.shadow"),nameLength:k(ce,"namelength"),textAlign:k(ce,"align"),idealAlign:d.event.x"),color:k(ce,"bgcolor")||ve.tinyColorHue,borderColor:k(ce,"bordercolor"),fontFamily:k(ce,"font.family"),fontSize:k(ce,"font.size"),fontColor:k(ce,"font.color"),fontWeight:k(ce,"font.weight"),fontStyle:k(ce,"font.style"),fontVariant:k(ce,"font.variant"),fontTextcase:k(ce,"font.textcase"),fontLineposition:k(ce,"font.lineposition"),fontShadow:k(ce,"font.shadow"),nameLength:k(ce,"namelength"),textAlign:k(ce,"align"),idealAlign:"left",hovertemplate:ce.hovertemplate,hovertemplateLabels:J,eventData:[ve.node]},{container:E._hoverlayer.node(),outerContainer:E._paper.node(),gd:w});s(Ce,.85),h(Ce)}}},he=function(xe,ve,ce){w._fullLayout.hovermode!==!1&&(d.select(xe).call(_,ve,ce),ve.node.trace.node.hoverinfo!=="skip"&&(ve.node.fullData=ve.node.trace,w.emit("plotly_unhover",{event:d.event,points:[ve.node]})),i.loneUnhover(E._hoverlayer.node()))};P(w,I,D,{width:M.w,height:M.h,margin:{t:M.t,r:M.r,b:M.b,l:M.l}},{linkEvents:{hover:T,follow:F,unhover:$,select:C},nodeEvents:{hover:G,follow:ee,unhover:he,select:q}})}}),jee=Fe(te=>{var Y=oh().overrideAll,d=Md().getModuleCalcData,y=xz(),z=Ya(),P=Em(),i=Np(),n=Mf().prepSelect,a=ji(),l=as(),o="sankey";te.name=o,te.baseLayoutAttrOverrides=Y({hoverlabel:z.hoverlabel},"plot","nested"),te.plot=function(s){var h=d(s.calcdata,o)[0];y(s,h),te.updateFx(s)},te.clean=function(s,h,m,b){var x=b._has&&b._has(o),_=h._has&&h._has(o);x&&!_&&(b._paperdiv.selectAll(".sankey").remove(),b._paperdiv.selectAll(".bgsankey").remove())},te.updateFx=function(s){for(var h=0;h{Y.exports=function(d,y){for(var z=d.cd,P=[],i=z[0].trace,n=i._sankey.graph.nodes,a=0;a{Y.exports={attributes:gz(),supplyDefaults:Eee(),calc:Lee(),plot:xz(),moduleType:"trace",name:"sankey",basePlotModule:jee(),selectPoints:Uee(),categories:["noOpacity"],meta:{}}}),Hee=Fe((te,Y)=>{Y.exports=$ee()}),Vee=Fe(te=>{var Y=sh();te.name="indicator",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),bz=Fe((te,Y)=>{var d=an().extendFlat,y=an().extendDeep,z=oh().overrideAll,P=zn(),i=Mi(),n=Xh().attributes,a=qd(),l=ku().templatedArray,o=Lw(),u=Sh().descriptionOnlyNumbers,s=P({editType:"plot",colorEditType:"plot"}),h={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:i.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},m={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},b=l("step",y({},h,{range:m}));Y.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:n({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:d({},s,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:u("value")},font:d({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:u("value")},increasing:{symbol:{valType:"string",dflt:o.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:o.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:d({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:y({},h,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:z({range:m,visible:d({},a.visible,{dflt:!0}),tickmode:a.minor.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:d({},a.ticks,{dflt:"outside"}),ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,tickfont:P({}),tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,separatethousands:a.separatethousands,exponentformat:a.exponentformat,minexponent:a.minexponent,showexponent:a.showexponent,editType:"plot"},"plot"),steps:b,threshold:{line:{color:d({},h.line.color,{}),width:d({},h.line.width,{dflt:1}),editType:"plot"},thickness:d({},h.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),wz=Fe((te,Y)=>{Y.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),Wee=Fe((te,Y)=>{var d=ji(),y=bz(),z=Xh().defaults,P=ku(),i=Gd(),n=wz(),a=jv(),l=Uv(),o=G0(),u=Tg();function s(m,b,x,_){function A($,q){return d.coerce(m,b,y,$,q)}z(b,_,A),A("mode"),b._hasNumber=b.mode.indexOf("number")!==-1,b._hasDelta=b.mode.indexOf("delta")!==-1,b._hasGauge=b.mode.indexOf("gauge")!==-1;var f=A("value");b._range=[0,typeof f=="number"?1.5*f:1];var k=new Array(2),w;if(b._hasNumber){A("number.valueformat");var D=d.extendFlat({},_.font);D.size=void 0,d.coerceFont(A,"number.font",D),b.number.font.size===void 0&&(b.number.font.size=n.defaultNumberFontSize,k[0]=!0),A("number.prefix"),A("number.suffix"),w=b.number.font.size}var E;if(b._hasDelta){var I=d.extendFlat({},_.font);I.size=void 0,d.coerceFont(A,"delta.font",I),b.delta.font.size===void 0&&(b.delta.font.size=(b._hasNumber?.5:1)*(w||n.defaultNumberFontSize),k[1]=!0),A("delta.reference",b.value),A("delta.relative"),A("delta.valueformat",b.delta.relative?"2%":""),A("delta.increasing.symbol"),A("delta.increasing.color"),A("delta.decreasing.symbol"),A("delta.decreasing.color"),A("delta.position"),A("delta.prefix"),A("delta.suffix"),E=b.delta.font.size}b._scaleNumbers=(!b._hasNumber||k[0])&&(!b._hasDelta||k[1])||!1;var M=d.extendFlat({},_.font);M.size=.25*(w||E||n.defaultNumberFontSize),d.coerceFont(A,"title.font",M),A("title.text");var p,g,C,T;function N($,q){return d.coerce(p,g,y.gauge,$,q)}function B($,q){return d.coerce(C,T,y.gauge.axis,$,q)}if(b._hasGauge){p=m.gauge,p||(p={}),g=P.newContainer(b,"gauge"),N("shape");var U=b._isBullet=b.gauge.shape==="bullet";U||A("title.align","center");var V=b._isAngular=b.gauge.shape==="angular";V||A("align","center"),N("bgcolor",_.paper_bgcolor),N("borderwidth"),N("bordercolor"),N("bar.color"),N("bar.line.color"),N("bar.line.width");var W=n.valueThickness*(b.gauge.shape==="bullet"?.5:1);N("bar.thickness",W),i(p,g,{name:"steps",handleItemDefaults:h}),N("threshold.value"),N("threshold.thickness"),N("threshold.line.width"),N("threshold.line.color"),C={},p&&(C=p.axis||{}),T=P.newContainer(g,"axis"),B("visible"),b._range=B("range",b._range);var F={font:_.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};a(C,T,B,"linear"),u(C,T,B,"linear",F),o(C,T,B,"linear",F),l(C,T,B,F)}else A("title.align","center"),A("align","center"),b._isAngular=b._isBullet=!1;b._length=null}function h(m,b){function x(_,A){return d.coerce(m,b,y.gauge.steps,_,A)}x("color"),x("line.color"),x("line.width"),x("range"),x("thickness")}Y.exports={supplyDefaults:s}}),qee=Fe((te,Y)=>{function d(y,z){var P=[],i=z.value;typeof z._lastValue!="number"&&(z._lastValue=z.value);var n=z._lastValue,a=n;return z._hasDelta&&typeof z.delta.reference=="number"&&(a=z.delta.reference),P[0]={y:i,lastY:n,delta:i-a,relativeDelta:(i-a)/a},P}Y.exports={calc:d}}),Gee=Fe((te,Y)=>{var d=ii(),y=(Ab(),Ti(R_)).interpolate,z=(Ab(),Ti(R_)).interpolateNumber,P=ji(),i=P.strScale,n=P.strTranslate,a=P.rad2deg,l=Bf().MID_SHIFT,o=Zs(),u=wz(),s=cc(),h=Os(),m=fb(),b=Tw(),x=qd(),_=Xi(),A={left:"start",center:"middle",right:"end"},f={left:0,center:.5,right:1},k=/[yzafpnµmkMGTPEZY]/;function w(U){return U&&U.duration>0}Y.exports=function(U,V,W,F){var $=U._fullLayout,q;w(W)&&F&&(q=F()),P.makeTraceGroups($._indicatorlayer,V,"trace").each(function(G){var ee=G[0],he=ee.trace,xe=d.select(this),ve=he._hasGauge,ce=he._isAngular,re=he._isBullet,ge=he.domain,ne={w:$._size.w*(ge.x[1]-ge.x[0]),h:$._size.h*(ge.y[1]-ge.y[0]),l:$._size.l+$._size.w*ge.x[0],r:$._size.r+$._size.w*(1-ge.x[1]),t:$._size.t+$._size.h*(1-ge.y[1]),b:$._size.b+$._size.h*ge.y[0]},se=ne.l+ne.w/2,_e=ne.t+ne.h/2,oe=Math.min(ne.w/2,ne.h),J=u.innerRadius*oe,me,fe,Ce,Be=he.align||"center";if(fe=_e,!ve)me=ne.l+f[Be]*ne.w,Ce=function(ze){return C(ze,ne.w,ne.h)};else if(ce&&(me=se,fe=_e+oe/2,Ce=function(ze){return T(ze,.9*J)}),re){var Oe=u.bulletPadding,Ze=1-u.bulletNumberDomainSize+Oe;me=ne.l+(Ze+(1-Ze)*f[Be])*ne.w,Ce=function(ze){return C(ze,(u.bulletNumberDomainSize-Oe)*ne.w,ne.h)}}I(U,xe,G,{numbersX:me,numbersY:fe,numbersScaler:Ce,transitionOpts:W,onComplete:q});var Ge,rt;ve&&(Ge={range:he.gauge.axis.range,color:he.gauge.bgcolor,line:{color:he.gauge.bordercolor,width:0},thickness:1},rt={range:he.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:he.gauge.bordercolor,width:he.gauge.borderwidth},thickness:1});var _t=xe.selectAll("g.angular").data(ce?G:[]);_t.exit().remove();var pt=xe.selectAll("g.angularaxis").data(ce?G:[]);pt.exit().remove(),ce&&E(U,xe,G,{radius:oe,innerRadius:J,gauge:_t,layer:pt,size:ne,gaugeBg:Ge,gaugeOutline:rt,transitionOpts:W,onComplete:q});var gt=xe.selectAll("g.bullet").data(re?G:[]);gt.exit().remove();var ct=xe.selectAll("g.bulletaxis").data(re?G:[]);ct.exit().remove(),re&&D(U,xe,G,{gauge:gt,layer:ct,size:ne,gaugeBg:Ge,gaugeOutline:rt,transitionOpts:W,onComplete:q});var Ae=xe.selectAll("text.title").data(G);Ae.exit().remove(),Ae.enter().append("text").classed("title",!0),Ae.attr("text-anchor",function(){return re?A.right:A[he.title.align]}).text(he.title.text).call(o.font,he.title.font).call(s.convertToTspans,U),Ae.attr("transform",function(){var ze=ne.l+ne.w*f[he.title.align],Ee,nt=u.titlePadding,xt=o.bBox(Ae.node());if(ve){if(ce)if(he.gauge.axis.visible){var ut=o.bBox(pt.node());Ee=ut.top-nt-xt.bottom}else Ee=ne.t+ne.h/2-oe/2-xt.bottom-nt;re&&(Ee=fe-(xt.top+xt.bottom)/2,ze=ne.l-u.bulletPadding*ne.w)}else Ee=he._numbersTop-nt-xt.bottom;return n(ze,Ee)})})};function D(U,V,W,F){var $=W[0].trace,q=F.gauge,G=F.layer,ee=F.gaugeBg,he=F.gaugeOutline,xe=F.size,ve=$.domain,ce=F.transitionOpts,re=F.onComplete,ge,ne,se,_e,oe;q.enter().append("g").classed("bullet",!0),q.attr("transform",n(xe.l,xe.t)),G.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),G.selectAll("g.xbulletaxistick,path,text").remove();var J=xe.h,me=$.gauge.bar.thickness*J,fe=ve.x[0],Ce=ve.x[0]+(ve.x[1]-ve.x[0])*($._hasNumber||$._hasDelta?1-u.bulletNumberDomainSize:1);ge=g(U,$.gauge.axis),ge._id="xbulletaxis",ge.domain=[fe,Ce],ge.setScale(),ne=h.calcTicks(ge),se=h.makeTransTickFn(ge),_e=h.getTickSigns(ge)[2],oe=xe.t+xe.h,ge.visible&&(h.drawTicks(U,ge,{vals:ge.ticks==="inside"?h.clipEnds(ge,ne):ne,layer:G,path:h.makeTickPath(ge,oe,_e),transFn:se}),h.drawLabels(U,ge,{vals:ne,layer:G,transFn:se,labelFns:h.makeLabelFns(ge,oe)}));function Be(gt){gt.attr("width",function(ct){return Math.max(0,ge.c2p(ct.range[1])-ge.c2p(ct.range[0]))}).attr("x",function(ct){return ge.c2p(ct.range[0])}).attr("y",function(ct){return .5*(1-ct.thickness)*J}).attr("height",function(ct){return ct.thickness*J})}var Oe=[ee].concat($.gauge.steps),Ze=q.selectAll("g.bg-bullet").data(Oe);Ze.enter().append("g").classed("bg-bullet",!0).append("rect"),Ze.select("rect").call(Be).call(M),Ze.exit().remove();var Ge=q.selectAll("g.value-bullet").data([$.gauge.bar]);Ge.enter().append("g").classed("value-bullet",!0).append("rect"),Ge.select("rect").attr("height",me).attr("y",(J-me)/2).call(M),w(ce)?Ge.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){re&&re()}).each("interrupt",function(){re&&re()}).attr("width",Math.max(0,ge.c2p(Math.min($.gauge.axis.range[1],W[0].y)))):Ge.select("rect").attr("width",typeof W[0].y=="number"?Math.max(0,ge.c2p(Math.min($.gauge.axis.range[1],W[0].y))):0),Ge.exit().remove();var rt=W.filter(function(){return $.gauge.threshold.value||$.gauge.threshold.value===0}),_t=q.selectAll("g.threshold-bullet").data(rt);_t.enter().append("g").classed("threshold-bullet",!0).append("line"),_t.select("line").attr("x1",ge.c2p($.gauge.threshold.value)).attr("x2",ge.c2p($.gauge.threshold.value)).attr("y1",(1-$.gauge.threshold.thickness)/2*J).attr("y2",(1-(1-$.gauge.threshold.thickness)/2)*J).call(_.stroke,$.gauge.threshold.line.color).style("stroke-width",$.gauge.threshold.line.width),_t.exit().remove();var pt=q.selectAll("g.gauge-outline").data([he]);pt.enter().append("g").classed("gauge-outline",!0).append("rect"),pt.select("rect").call(Be).call(M),pt.exit().remove()}function E(U,V,W,F){var $=W[0].trace,q=F.size,G=F.radius,ee=F.innerRadius,he=F.gaugeBg,xe=F.gaugeOutline,ve=[q.l+q.w/2,q.t+q.h/2+G/2],ce=F.gauge,re=F.layer,ge=F.transitionOpts,ne=F.onComplete,se=Math.PI/2;function _e(Gt){var Jt=$.gauge.axis.range[0],gr=$.gauge.axis.range[1],mr=(Gt-Jt)/(gr-Jt)*Math.PI-se;return mr<-se?-se:mr>se?se:mr}function oe(Gt){return d.svg.arc().innerRadius((ee+G)/2-Gt/2*(G-ee)).outerRadius((ee+G)/2+Gt/2*(G-ee)).startAngle(-se)}function J(Gt){Gt.attr("d",function(Jt){return oe(Jt.thickness).startAngle(_e(Jt.range[0])).endAngle(_e(Jt.range[1]))()})}var me,fe,Ce,Be;ce.enter().append("g").classed("angular",!0),ce.attr("transform",n(ve[0],ve[1])),re.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),re.selectAll("g.xangularaxistick,path,text").remove(),me=g(U,$.gauge.axis),me.type="linear",me.range=$.gauge.axis.range,me._id="xangularaxis",me.ticklabeloverflow="allow",me.setScale();var Oe=function(Gt){return(me.range[0]-Gt.x)/(me.range[1]-me.range[0])*Math.PI+Math.PI},Ze={},Ge=h.makeLabelFns(me,0),rt=Ge.labelStandoff;Ze.xFn=function(Gt){var Jt=Oe(Gt);return Math.cos(Jt)*rt},Ze.yFn=function(Gt){var Jt=Oe(Gt),gr=Math.sin(Jt)>0?.2:1;return-Math.sin(Jt)*(rt+Gt.fontSize*gr)+Math.abs(Math.cos(Jt))*(Gt.fontSize*l)},Ze.anchorFn=function(Gt){var Jt=Oe(Gt),gr=Math.cos(Jt);return Math.abs(gr)<.1?"middle":gr>0?"start":"end"},Ze.heightFn=function(Gt,Jt,gr){var mr=Oe(Gt);return-.5*(1+Math.sin(mr))*gr};var _t=function(Gt){return n(ve[0]+G*Math.cos(Gt),ve[1]-G*Math.sin(Gt))};Ce=function(Gt){return _t(Oe(Gt))};var pt=function(Gt){var Jt=Oe(Gt);return _t(Jt)+"rotate("+-a(Jt)+")"};if(fe=h.calcTicks(me),Be=h.getTickSigns(me)[2],me.visible){Be=me.ticks==="inside"?-1:1;var gt=(me.linewidth||1)/2;h.drawTicks(U,me,{vals:fe,layer:re,path:"M"+Be*gt+",0h"+Be*me.ticklen,transFn:pt}),h.drawLabels(U,me,{vals:fe,layer:re,transFn:Ce,labelFns:Ze})}var ct=[he].concat($.gauge.steps),Ae=ce.selectAll("g.bg-arc").data(ct);Ae.enter().append("g").classed("bg-arc",!0).append("path"),Ae.select("path").call(J).call(M),Ae.exit().remove();var ze=oe($.gauge.bar.thickness),Ee=ce.selectAll("g.value-arc").data([$.gauge.bar]);Ee.enter().append("g").classed("value-arc",!0).append("path");var nt=Ee.select("path");w(ge)?(nt.transition().duration(ge.duration).ease(ge.easing).each("end",function(){ne&&ne()}).each("interrupt",function(){ne&&ne()}).attrTween("d",p(ze,_e(W[0].lastY),_e(W[0].y))),$._lastValue=W[0].y):nt.attr("d",typeof W[0].y=="number"?ze.endAngle(_e(W[0].y)):"M0,0Z"),nt.call(M),Ee.exit().remove(),ct=[];var xt=$.gauge.threshold.value;(xt||xt===0)&&ct.push({range:[xt,xt],color:$.gauge.threshold.color,line:{color:$.gauge.threshold.line.color,width:$.gauge.threshold.line.width},thickness:$.gauge.threshold.thickness});var ut=ce.selectAll("g.threshold-arc").data(ct);ut.enter().append("g").classed("threshold-arc",!0).append("path"),ut.select("path").call(J).call(M),ut.exit().remove();var Et=ce.selectAll("g.gauge-outline").data([xe]);Et.enter().append("g").classed("gauge-outline",!0).append("path"),Et.select("path").call(J).call(M),Et.exit().remove()}function I(U,V,W,F){var $=W[0].trace,q=F.numbersX,G=F.numbersY,ee=$.align||"center",he=A[ee],xe=F.transitionOpts,ve=F.onComplete,ce=P.ensureSingle(V,"g","numbers"),re,ge,ne,se=[];$._hasNumber&&se.push("number"),$._hasDelta&&(se.push("delta"),$.delta.position==="left"&&se.reverse());var _e=ce.selectAll("text").data(se);_e.enter().append("text"),_e.attr("text-anchor",function(){return he}).attr("class",function(_t){return _t}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),_e.exit().remove();function oe(_t,pt,gt,ct){if(_t.match("s")&>>=0!=ct>=0&&!pt(gt).slice(-1).match(k)&&!pt(ct).slice(-1).match(k)){var Ae=_t.slice().replace("s","f").replace(/\d+/,function(Ee){return parseInt(Ee)-1}),ze=g(U,{tickformat:Ae});return function(Ee){return Math.abs(Ee)<1?h.tickText(ze,Ee).text:pt(Ee)}}else return pt}function J(){var _t=g(U,{tickformat:$.number.valueformat},$._range);_t.setScale(),h.prepTicks(_t);var pt=function(Ee){return h.tickText(_t,Ee).text},gt=$.number.suffix,ct=$.number.prefix,Ae=ce.select("text.number");function ze(){var Ee=typeof W[0].y=="number"?ct+pt(W[0].y)+gt:"-";Ae.text(Ee).call(o.font,$.number.font).call(s.convertToTspans,U)}return w(xe)?Ae.transition().duration(xe.duration).ease(xe.easing).each("end",function(){ze(),ve&&ve()}).each("interrupt",function(){ze(),ve&&ve()}).attrTween("text",function(){var Ee=d.select(this),nt=z(W[0].lastY,W[0].y);$._lastValue=W[0].y;var xt=oe($.number.valueformat,pt,W[0].lastY,W[0].y);return function(ut){Ee.text(ct+xt(nt(ut))+gt)}}):ze(),re=N(ct+pt(W[0].y)+gt,$.number.font,he,U),Ae}function me(){var _t=g(U,{tickformat:$.delta.valueformat},$._range);_t.setScale(),h.prepTicks(_t);var pt=function(ut){return h.tickText(_t,ut).text},gt=$.delta.suffix,ct=$.delta.prefix,Ae=function(ut){var Et=$.delta.relative?ut.relativeDelta:ut.delta;return Et},ze=function(ut,Et){return ut===0||typeof ut!="number"||isNaN(ut)?"-":(ut>0?$.delta.increasing.symbol:$.delta.decreasing.symbol)+ct+Et(ut)+gt},Ee=function(ut){return ut.delta>=0?$.delta.increasing.color:$.delta.decreasing.color};$._deltaLastValue===void 0&&($._deltaLastValue=Ae(W[0]));var nt=ce.select("text.delta");nt.call(o.font,$.delta.font).call(_.fill,Ee({delta:$._deltaLastValue}));function xt(){nt.text(ze(Ae(W[0]),pt)).call(_.fill,Ee(W[0])).call(s.convertToTspans,U)}return w(xe)?nt.transition().duration(xe.duration).ease(xe.easing).tween("text",function(){var ut=d.select(this),Et=Ae(W[0]),Gt=$._deltaLastValue,Jt=oe($.delta.valueformat,pt,Gt,Et),gr=z(Gt,Et);return $._deltaLastValue=Et,function(mr){ut.text(ze(gr(mr),Jt)),ut.call(_.fill,Ee({delta:gr(mr)}))}}).each("end",function(){xt(),ve&&ve()}).each("interrupt",function(){xt(),ve&&ve()}):xt(),ge=N(ze(Ae(W[0]),pt),$.delta.font,he,U),nt}var fe=$.mode+$.align,Ce;if($._hasDelta&&(Ce=me(),fe+=$.delta.position+$.delta.font.size+$.delta.font.family+$.delta.valueformat,fe+=$.delta.increasing.symbol+$.delta.decreasing.symbol,ne=ge),$._hasNumber&&(J(),fe+=$.number.font.size+$.number.font.family+$.number.valueformat+$.number.suffix+$.number.prefix,ne=re),$._hasDelta&&$._hasNumber){var Be=[(re.left+re.right)/2,(re.top+re.bottom)/2],Oe=[(ge.left+ge.right)/2,(ge.top+ge.bottom)/2],Ze,Ge,rt=.75*$.delta.font.size;$.delta.position==="left"&&(Ze=B($,"deltaPos",0,-1*(re.width*f[$.align]+ge.width*(1-f[$.align])+rt),fe,Math.min),Ge=Be[1]-Oe[1],ne={width:re.width+ge.width+rt,height:Math.max(re.height,ge.height),left:ge.left+Ze,right:re.right,top:Math.min(re.top,ge.top+Ge),bottom:Math.max(re.bottom,ge.bottom+Ge)}),$.delta.position==="right"&&(Ze=B($,"deltaPos",0,re.width*(1-f[$.align])+ge.width*f[$.align]+rt,fe,Math.max),Ge=Be[1]-Oe[1],ne={width:re.width+ge.width+rt,height:Math.max(re.height,ge.height),left:re.left,right:ge.right+Ze,top:Math.min(re.top,ge.top+Ge),bottom:Math.max(re.bottom,ge.bottom+Ge)}),$.delta.position==="bottom"&&(Ze=null,Ge=ge.height,ne={width:Math.max(re.width,ge.width),height:re.height+ge.height,left:Math.min(re.left,ge.left),right:Math.max(re.right,ge.right),top:re.bottom-re.height,bottom:re.bottom+ge.height}),$.delta.position==="top"&&(Ze=null,Ge=re.top,ne={width:Math.max(re.width,ge.width),height:re.height+ge.height,left:Math.min(re.left,ge.left),right:Math.max(re.right,ge.right),top:re.bottom-re.height-ge.height,bottom:re.bottom}),Ce.attr({dx:Ze,dy:Ge})}($._hasNumber||$._hasDelta)&&ce.attr("transform",function(){var _t=F.numbersScaler(ne);fe+=_t[2];var pt=B($,"numbersScale",1,_t[0],fe,Math.min),gt;$._scaleNumbers||(pt=1),$._isAngular?gt=G-pt*ne.bottom:gt=G-pt*(ne.top+ne.bottom)/2,$._numbersTop=pt*ne.top+gt;var ct=ne[ee];ee==="center"&&(ct=(ne.left+ne.right)/2);var Ae=q-pt*ct;return Ae=B($,"numbersTranslate",0,Ae,fe,Math.max),n(Ae,gt)+i(pt)})}function M(U){U.each(function(V){_.stroke(d.select(this),V.line.color)}).each(function(V){_.fill(d.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function p(U,V,W){return function(){var F=y(V,W);return function($){return U.endAngle(F($))()}}}function g(U,V,W){var F=U._fullLayout,$=P.extendFlat({type:"linear",ticks:"outside",range:W,showline:!0},V),q={type:"linear",_id:"x"+V._id},G={letter:"x",font:F.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function ee(he,xe){return P.coerce($,q,x,he,xe)}return m($,q,ee,G,F),b($,q,ee,G),q}function C(U,V,W){var F=Math.min(V/U.width,W/U.height);return[F,U,V+"x"+W]}function T(U,V){var W=Math.sqrt(U.width/2*(U.width/2)+U.height*U.height),F=V/W;return[F,U,V]}function N(U,V,W,F){var $=document.createElementNS("http://www.w3.org/2000/svg","text"),q=d.select($);return q.text(U).attr("x",0).attr("y",0).attr("text-anchor",W).attr("data-unformatted",U).call(s.convertToTspans,F).call(o.font,V),o.bBox(q.node())}function B(U,V,W,F,$,q){var G="_cache"+V;U[G]&&U[G].key===$||(U[G]={key:$,value:W});var ee=P.aggNums(q,null,[U[G].value,F],2);return U[G].value=ee,ee}}),Zee=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"indicator",basePlotModule:Vee(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:bz(),supplyDefaults:Wee().supplyDefaults,calc:qee().calc,plot:Gee(),meta:{}}}),Kee=Fe((te,Y)=>{Y.exports=Zee()}),kz=Fe((te,Y)=>{var d=Ag(),y=an().extendFlat,z=oh().overrideAll,P=zn(),i=Xh().attributes,n=Sh().descriptionOnlyNumbers;Y.exports=z({domain:i({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:n("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:y({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:n("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:y({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))}},"calc","from-root")}),Yee=Fe((te,Y)=>{var d=ji(),y=kz(),z=Xh().defaults;function P(i,n){for(var a=i.columnorder||[],l=i.header.values.length,o=a.slice(0,l),u=o.slice().sort(function(m,b){return m-b}),s=o.map(function(m){return u.indexOf(m)}),h=s.length;h{var d=t1().wrap;Y.exports=function(){return d({})}}),Tz=Fe((te,Y)=>{Y.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),Jee=Fe((te,Y)=>{var d=Tz(),y=an().extendFlat,z=Ar(),P=Di().isTypedArray,i=Di().isArrayOrTypedArray;Y.exports=function(b,x){var _=l(x.cells.values),A=function(ee){return ee.slice(x.header.values.length,ee.length)},f=l(x.header.values);f.length&&!f[0].length&&(f[0]=[""],f=l(f));var k=f.concat(A(_).map(function(){return o((f[0]||[""]).length)})),w=x.domain,D=Math.floor(b._fullLayout._size.w*(w.x[1]-w.x[0])),E=Math.floor(b._fullLayout._size.h*(w.y[1]-w.y[0])),I=x.header.values.length?k[0].map(function(){return x.header.height}):[d.emptyHeaderHeight],M=_.length?_[0].map(function(){return x.cells.height}):[],p=I.reduce(a,0),g=E-p,C=g+d.uplift,T=h(M,C),N=h(I,p),B=s(N,[]),U=s(T,B),V={},W=x._fullInput.columnorder;i(W)&&(W=Array.from(W)),W=W.concat(A(_.map(function(ee,he){return he})));var F=k.map(function(ee,he){var xe=i(x.columnwidth)?x.columnwidth[Math.min(he,x.columnwidth.length-1)]:x.columnwidth;return z(xe)?Number(xe):1}),$=F.reduce(a,0);F=F.map(function(ee){return ee/$*D});var q=Math.max(n(x.header.line.width),n(x.cells.line.width)),G={key:x.uid+b._context.staticPlot,translateX:w.x[0]*b._fullLayout._size.w,translateY:b._fullLayout._size.h*(1-w.y[1]),size:b._fullLayout._size,width:D,maxLineWidth:q,height:E,columnOrder:W,groupHeight:E,rowBlocks:U,headerRowBlocks:B,scrollY:0,cells:y({},x.cells,{values:_}),headerCells:y({},x.header,{values:k}),gdColumns:k.map(function(ee){return ee[0]}),gdColumnsOriginalOrder:k.map(function(ee){return ee[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(ee,he){var xe=V[ee];V[ee]=(xe||0)+1;var ve=ee+"__"+V[ee];return{key:ve,label:ee,specIndex:he,xIndex:W[he],xScale:u,x:void 0,calcdata:void 0,columnWidth:F[he]}})};return G.columns.forEach(function(ee){ee.calcdata=G,ee.x=u(ee)}),G};function n(b){if(i(b)){for(var x=0,_=0;_=x||I===b.length-1)&&(_[f]=w,w.key=E++,w.firstRowIndex=D,w.lastRowIndex=I,w=m(),f+=k,D=I+1,k=0);return _}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),Qee=Fe(te=>{var Y=an().extendFlat;te.splitToPanels=function(y){var z=[0,0],P=Y({},y,{key:"header",type:"header",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!0,values:y.calcdata.headerCells.values[y.specIndex],rowBlocks:y.calcdata.headerRowBlocks,calcdata:Y({},y.calcdata,{cells:y.calcdata.headerCells})}),i=Y({},y,{key:"cells1",type:"cells",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks}),n=Y({},y,{key:"cells2",type:"cells",page:1,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks});return[i,n,P]},te.splitToCells=function(y){var z=d(y);return(y.values||[]).slice(z[0],z[1]).map(function(P,i){var n=typeof P=="string"&&P.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:i+n,key:z[0]+i,column:y,calcdata:y.calcdata,page:y.page,rowBlocks:y.rowBlocks,value:P}})};function d(y){var z=y.rowBlocks[y.page],P=z?z.rows[0].rowIndex:0,i=z?P+z.rows.length:0;return[P,i]}}),Sz=Fe((te,Y)=>{var d=Tz(),y=ii(),z=ji(),P=z.numberFormat,i=t1(),n=Zs(),a=cc(),l=ji().raiseToTop,o=ji().strTranslate,u=ji().cancelTransition,s=Jee(),h=Qee(),m=Xi();Y.exports=function(me,fe){var Ce=!me._context.staticPlot,Be=me._fullLayout._paper.selectAll("."+d.cn.table).data(fe.map(function(ut){var Et=i.unwrap(ut),Gt=Et.trace;return s(me,Gt)}),i.keyFun);Be.exit().remove(),Be.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Be.attr("width",function(ut){return ut.width+ut.size.l+ut.size.r}).attr("height",function(ut){return ut.height+ut.size.t+ut.size.b}).attr("transform",function(ut){return o(ut.translateX,ut.translateY)});var Oe=Be.selectAll("."+d.cn.tableControlView).data(i.repeat,i.keyFun),Ze=Oe.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(Ce){var Ge="onwheel"in document?"wheel":"mousewheel";Ze.on("mousemove",function(ut){Oe.filter(function(Et){return ut===Et}).call(f,me)}).on(Ge,function(ut){if(!ut.scrollbarState.wheeling){ut.scrollbarState.wheeling=!0;var Et=ut.scrollY+y.event.deltaY,Gt=he(me,Oe,null,Et)(ut);Gt||(y.event.stopPropagation(),y.event.preventDefault()),ut.scrollbarState.wheeling=!1}}).call(f,me,!0)}Oe.attr("transform",function(ut){return o(ut.size.l,ut.size.t)});var rt=Oe.selectAll("."+d.cn.scrollBackground).data(i.repeat,i.keyFun);rt.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),rt.attr("width",function(ut){return ut.width}).attr("height",function(ut){return ut.height}),Oe.each(function(ut){n.setClipUrl(y.select(this),x(me,ut),me)});var _t=Oe.selectAll("."+d.cn.yColumn).data(function(ut){return ut.columns},i.keyFun);_t.enter().append("g").classed(d.cn.yColumn,!0),_t.exit().remove(),_t.attr("transform",function(ut){return o(ut.x,0)}),Ce&&_t.call(y.behavior.drag().origin(function(ut){var Et=y.select(this);return W(Et,ut,-d.uplift),l(this),ut.calcdata.columnDragInProgress=!0,f(Oe.filter(function(Gt){return ut.calcdata.key===Gt.key}),me),ut}).on("drag",function(ut){var Et=y.select(this),Gt=function(mr){return(ut===mr?y.event.x:mr.x)+mr.columnWidth/2};ut.x=Math.max(-d.overdrag,Math.min(ut.calcdata.width+d.overdrag-ut.columnWidth,y.event.x));var Jt=A(_t).filter(function(mr){return mr.calcdata.key===ut.calcdata.key}),gr=Jt.sort(function(mr,Kr){return Gt(mr)-Gt(Kr)});gr.forEach(function(mr,Kr){mr.xIndex=Kr,mr.x=ut===mr?mr.x:mr.xScale(mr)}),_t.filter(function(mr){return ut!==mr}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(mr){return o(mr.x,0)}),Et.call(u).attr("transform",o(ut.x,-d.uplift))}).on("dragend",function(ut){var Et=y.select(this),Gt=ut.calcdata;ut.x=ut.xScale(ut),ut.calcdata.columnDragInProgress=!1,W(Et,ut,0),U(me,Gt,Gt.columns.map(function(Jt){return Jt.xIndex}))})),_t.each(function(ut){n.setClipUrl(y.select(this),_(me,ut),me)});var pt=_t.selectAll("."+d.cn.columnBlock).data(h.splitToPanels,i.keyFun);pt.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(ut){return ut.key}),pt.style("cursor",function(ut){return ut.dragHandle?"ew-resize":ut.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var gt=pt.filter($),ct=pt.filter(F);Ce&&ct.call(y.behavior.drag().origin(function(ut){return y.event.stopPropagation(),ut}).on("drag",he(me,Oe,-1)).on("dragend",function(){})),k(me,Oe,gt,pt),k(me,Oe,ct,pt);var Ae=Oe.selectAll("."+d.cn.scrollAreaClip).data(i.repeat,i.keyFun);Ae.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(ut){return x(me,ut)});var ze=Ae.selectAll("."+d.cn.scrollAreaClipRect).data(i.repeat,i.keyFun);ze.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ze.attr("width",function(ut){return ut.width+2*d.overdrag}).attr("height",function(ut){return ut.height+d.uplift});var Ee=_t.selectAll("."+d.cn.columnBoundary).data(i.repeat,i.keyFun);Ee.enter().append("g").classed(d.cn.columnBoundary,!0);var nt=_t.selectAll("."+d.cn.columnBoundaryClippath).data(i.repeat,i.keyFun);nt.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),nt.attr("id",function(ut){return _(me,ut)});var xt=nt.selectAll("."+d.cn.columnBoundaryRect).data(i.repeat,i.keyFun);xt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),xt.attr("width",function(ut){return ut.columnWidth+2*b(ut)}).attr("height",function(ut){return ut.calcdata.height+2*b(ut)+d.uplift}).attr("x",function(ut){return-b(ut)}).attr("y",function(ut){return-b(ut)}),ee(null,ct,Oe)};function b(me){return Math.ceil(me.calcdata.maxLineWidth/2)}function x(me,fe){return"clip"+me._fullLayout._uid+"_scrollAreaBottomClip_"+fe.key}function _(me,fe){return"clip"+me._fullLayout._uid+"_columnBoundaryClippath_"+fe.calcdata.key+"_"+fe.specIndex}function A(me){return[].concat.apply([],me.map(function(fe){return fe})).map(function(fe){return fe.__data__})}function f(me,fe,Ce){function Be(pt){var gt=pt.rowBlocks;return ne(gt,gt.length-1)+(gt.length?se(gt[gt.length-1],1/0):1)}var Oe=me.selectAll("."+d.cn.scrollbarKit).data(i.repeat,i.keyFun);Oe.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Oe.each(function(pt){var gt=pt.scrollbarState;gt.totalHeight=Be(pt),gt.scrollableAreaHeight=pt.groupHeight-q(pt),gt.currentlyVisibleHeight=Math.min(gt.totalHeight,gt.scrollableAreaHeight),gt.ratio=gt.currentlyVisibleHeight/gt.totalHeight,gt.barLength=Math.max(gt.ratio*gt.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),gt.barWiggleRoom=gt.currentlyVisibleHeight-gt.barLength,gt.wiggleRoom=Math.max(0,gt.totalHeight-gt.scrollableAreaHeight),gt.topY=gt.barWiggleRoom===0?0:pt.scrollY/gt.wiggleRoom*gt.barWiggleRoom,gt.bottomY=gt.topY+gt.barLength,gt.dragMultiplier=gt.wiggleRoom/gt.barWiggleRoom}).attr("transform",function(pt){var gt=pt.width+d.scrollbarWidth/2+d.scrollbarOffset;return o(gt,q(pt))});var Ze=Oe.selectAll("."+d.cn.scrollbar).data(i.repeat,i.keyFun);Ze.enter().append("g").classed(d.cn.scrollbar,!0);var Ge=Ze.selectAll("."+d.cn.scrollbarSlider).data(i.repeat,i.keyFun);Ge.enter().append("g").classed(d.cn.scrollbarSlider,!0),Ge.attr("transform",function(pt){return o(0,pt.scrollbarState.topY||0)});var rt=Ge.selectAll("."+d.cn.scrollbarGlyph).data(i.repeat,i.keyFun);rt.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),rt.attr("y2",function(pt){return pt.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(pt){return pt.columnDragInProgress||!pt.scrollbarState.barWiggleRoom||Ce?0:.4}),rt.transition().delay(0).duration(0),rt.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var _t=Ze.selectAll("."+d.cn.scrollbarCaptureZone).data(i.repeat,i.keyFun);_t.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(pt){var gt=y.event.y,ct=this.getBoundingClientRect(),Ae=pt.scrollbarState,ze=gt-ct.top,Ee=y.scale.linear().domain([0,Ae.scrollableAreaHeight]).range([0,Ae.totalHeight]).clamp(!0);Ae.topY<=ze&&ze<=Ae.bottomY||he(fe,me,null,Ee(ze-Ae.barLength/2))(pt)}).call(y.behavior.drag().origin(function(pt){return y.event.stopPropagation(),pt.scrollbarState.scrollbarScrollInProgress=!0,pt}).on("drag",he(fe,me)).on("dragend",function(){})),_t.attr("y2",function(pt){return pt.scrollbarState.scrollableAreaHeight}),fe._context.staticPlot&&(rt.remove(),_t.remove())}function k(me,fe,Ce,Be){var Oe=w(Ce),Ze=D(Oe);p(Ze);var Ge=E(Ze);C(Ge);var rt=M(Ze),_t=I(rt);g(_t),T(_t,fe,Be,me),ge(Ze)}function w(me){var fe=me.selectAll("."+d.cn.columnCells).data(i.repeat,i.keyFun);return fe.enter().append("g").classed(d.cn.columnCells,!0),fe.exit().remove(),fe}function D(me){var fe=me.selectAll("."+d.cn.columnCell).data(h.splitToCells,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("g").classed(d.cn.columnCell,!0),fe.exit().remove(),fe}function E(me){var fe=me.selectAll("."+d.cn.cellRect).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("rect").classed(d.cn.cellRect,!0),fe}function I(me){var fe=me.selectAll("."+d.cn.cellText).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){y.event.stopPropagation()}),fe}function M(me){var fe=me.selectAll("."+d.cn.cellTextHolder).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),fe}function p(me){me.each(function(fe,Ce){var Be=fe.calcdata.cells.font,Oe=fe.column.specIndex,Ze={size:V(Be.size,Oe,Ce),color:V(Be.color,Oe,Ce),family:V(Be.family,Oe,Ce),weight:V(Be.weight,Oe,Ce),style:V(Be.style,Oe,Ce),variant:V(Be.variant,Oe,Ce),textcase:V(Be.textcase,Oe,Ce),lineposition:V(Be.lineposition,Oe,Ce),shadow:V(Be.shadow,Oe,Ce)};fe.rowNumber=fe.key,fe.align=V(fe.calcdata.cells.align,Oe,Ce),fe.cellBorderWidth=V(fe.calcdata.cells.line.width,Oe,Ce),fe.font=Ze})}function g(me){me.each(function(fe){n.font(y.select(this),fe.font)})}function C(me){me.attr("width",function(fe){return fe.column.columnWidth}).attr("stroke-width",function(fe){return fe.cellBorderWidth}).each(function(fe){var Ce=y.select(this);m.stroke(Ce,V(fe.calcdata.cells.line.color,fe.column.specIndex,fe.rowNumber)),m.fill(Ce,V(fe.calcdata.cells.fill.color,fe.column.specIndex,fe.rowNumber))})}function T(me,fe,Ce,Be){me.text(function(Oe){var Ze=Oe.column.specIndex,Ge=Oe.rowNumber,rt=Oe.value,_t=typeof rt=="string",pt=_t&&rt.match(/
/i),gt=!_t||pt;Oe.mayHaveMarkup=_t&&rt.match(/[<&>]/);var ct=N(rt);Oe.latex=ct;var Ae=ct?"":V(Oe.calcdata.cells.prefix,Ze,Ge)||"",ze=ct?"":V(Oe.calcdata.cells.suffix,Ze,Ge)||"",Ee=ct?null:V(Oe.calcdata.cells.format,Ze,Ge)||null,nt=Ae+(Ee?P(Ee)(Oe.value):Oe.value)+ze,xt;Oe.wrappingNeeded=!Oe.wrapped&&!gt&&!ct&&(xt=B(nt)),Oe.cellHeightMayIncrease=pt||ct||Oe.mayHaveMarkup||(xt===void 0?B(nt):xt),Oe.needsConvertToTspans=Oe.mayHaveMarkup||Oe.wrappingNeeded||Oe.latex;var ut;if(Oe.wrappingNeeded){var Et=d.wrapSplitCharacter===" "?nt.replace(/Oe&&Be.push(Ze),Oe+=_t}return Be}function ee(me,fe,Ce){var Be=A(fe)[0];if(Be!==void 0){var Oe=Be.rowBlocks,Ze=Be.calcdata,Ge=ne(Oe,Oe.length),rt=Be.calcdata.groupHeight-q(Be),_t=Ze.scrollY=Math.max(0,Math.min(Ge-rt,Ze.scrollY)),pt=G(Oe,_t,rt);pt.length===1&&(pt[0]===Oe.length-1?pt.unshift(pt[0]-1):pt.push(pt[0]+1)),pt[0]%2&&pt.reverse(),fe.each(function(gt,ct){gt.page=pt[ct],gt.scrollY=_t}),fe.attr("transform",function(gt){var ct=ne(gt.rowBlocks,gt.page)-gt.scrollY;return o(0,ct)}),me&&(xe(me,Ce,fe,pt,Be.prevPages,Be,0),xe(me,Ce,fe,pt,Be.prevPages,Be,1),f(Ce,me))}}function he(me,fe,Ce,Be){return function(Oe){var Ze=Oe.calcdata?Oe.calcdata:Oe,Ge=fe.filter(function(gt){return Ze.key===gt.key}),rt=Ce||Ze.scrollbarState.dragMultiplier,_t=Ze.scrollY;Ze.scrollY=Be===void 0?Ze.scrollY+rt*y.event.dy:Be;var pt=Ge.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(F);return ee(me,pt,Ge),Ze.scrollY===_t}}function xe(me,fe,Ce,Be,Oe,Ze,Ge){var rt=Be[Ge]!==Oe[Ge];rt&&(clearTimeout(Ze.currentRepaint[Ge]),Ze.currentRepaint[Ge]=setTimeout(function(){var _t=Ce.filter(function(pt,gt){return gt===Ge&&Be[gt]!==Oe[gt]});k(me,fe,_t,Ce),Oe[Ge]=Be[Ge]}))}function ve(me,fe,Ce,Be){return function(){var Oe=y.select(fe.parentNode);Oe.each(function(Ze){var Ge=Ze.fragments;Oe.selectAll("tspan.line").each(function(Ee,nt){Ge[nt].width=this.getComputedTextLength()});var rt=Ge[Ge.length-1].width,_t=Ge.slice(0,-1),pt=[],gt,ct,Ae=0,ze=Ze.column.columnWidth-2*d.cellPad;for(Ze.value="";_t.length;)gt=_t.shift(),ct=gt.width+rt,Ae+ct>ze&&(Ze.value+=pt.join(d.wrapSpacer)+d.lineBreaker,pt=[],Ae=0),pt.push(gt.text),Ae+=ct;Ae&&(Ze.value+=pt.join(d.wrapSpacer)),Ze.wrapped=!0}),Oe.selectAll("tspan.line").remove(),T(Oe.select("."+d.cn.cellText),Ce,me,Be),y.select(fe.parentNode.parentNode).call(ge)}}function ce(me,fe,Ce,Be,Oe){return function(){if(!Oe.settledY){var Ze=y.select(fe.parentNode),Ge=oe(Oe),rt=Oe.key-Ge.firstRowIndex,_t=Ge.rows[rt].rowHeight,pt=Oe.cellHeightMayIncrease?fe.parentNode.getBoundingClientRect().height+2*d.cellPad:_t,gt=Math.max(pt,_t),ct=gt-Ge.rows[rt].rowHeight;ct&&(Ge.rows[rt].rowHeight=gt,me.selectAll("."+d.cn.columnCell).call(ge),ee(null,me.filter(F),0),f(Ce,Be,!0)),Ze.attr("transform",function(){var Ae=this,ze=Ae.parentNode,Ee=ze.getBoundingClientRect(),nt=y.select(Ae.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),xt=Ae.transform.baseVal.consolidate(),ut=nt.top-Ee.top+(xt?xt.matrix.f:d.cellPad);return o(re(Oe,y.select(Ae.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),ut)}),Oe.settledY=!0}}}function re(me,fe){switch(me.align){case"left":return d.cellPad;case"right":return me.column.columnWidth-(fe||0)-d.cellPad;case"center":return(me.column.columnWidth-(fe||0))/2;default:return d.cellPad}}function ge(me){me.attr("transform",function(fe){var Ce=fe.rowBlocks[0].auxiliaryBlocks.reduce(function(Ge,rt){return Ge+se(rt,1/0)},0),Be=oe(fe),Oe=se(Be,fe.key),Ze=Oe+Ce;return o(0,Ze)}).selectAll("."+d.cn.cellRect).attr("height",function(fe){return J(oe(fe),fe.key).rowHeight})}function ne(me,fe){for(var Ce=0,Be=fe-1;Be>=0;Be--)Ce+=_e(me[Be]);return Ce}function se(me,fe){for(var Ce=0,Be=0;Be{var Y=Md().getModuleCalcData,d=Sz(),y="table";te.name=y,te.plot=function(z){var P=Y(z.calcdata,y)[0];P.length&&d(z,P)},te.clean=function(z,P,i,n){var a=n._has&&n._has(y),l=P._has&&P._has(y);a&&!l&&n._paperdiv.selectAll(".table").remove()}}),tte=Fe((te,Y)=>{Y.exports={attributes:kz(),supplyDefaults:Yee(),calc:Xee(),plot:Sz(),moduleType:"trace",name:"table",basePlotModule:ete(),categories:["noOpacity"],meta:{}}}),rte=Fe((te,Y)=>{Y.exports=tte()}),ite=Fe((te,Y)=>{var d=zn(),y=Mi(),z=qd(),P=Sh().descriptionWithDates,i=oh().overrideAll,n=Wd().dash,a=an().extendFlat;Y.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:d({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:z.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:a({},z.labelalias,{editType:"calc"}),tickfont:d({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:P("tick label")},tickformatstops:i(z.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:a({},n,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:a({},n,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:y.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),gA=Fe((te,Y)=>{var d=zn(),y=ite(),z=Mi(),P=d({editType:"calc"}),i=ff().zorder;P.family.dflt='"Open Sans", verdana, arial, sans-serif',P.size.dflt=12,P.color.dflt=z.defaultLine,Y.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:y,baxis:y,font:P,color:{valType:"color",dflt:z.defaultLine,editType:"plot"},zorder:i}}),nte=Fe((te,Y)=>{var d=ji().isArray1D;Y.exports=function(y,z,P){var i=P("x"),n=i&&i.length,a=P("y"),l=a&&a.length;if(!n&&!l)return!1;if(z._cheater=!i,(!n||d(i))&&(!l||d(a))){var o=n?i.length:1/0;l&&(o=Math.min(o,a.length)),z.a&&z.a.length&&(o=Math.min(o,z.a.length)),z.b&&z.b.length&&(o=Math.min(o,z.b.length)),z._length=o}else z._length=null;return!0}}),ate=Fe((te,Y)=>{var d=gA(),y=Xi().addOpacity,z=as(),P=ji(),i=jv(),n=G0(),a=Tg(),l=Qg(),o=Z0(),u=Y1();Y.exports=function(h,m,b){var x=b.letter,_=b.font||{},A=d[x+"axis"];function f(q,G){return P.coerce(h,m,A,q,G)}function k(q,G){return P.coerce2(h,m,A,q,G)}b.name&&(m._name=b.name,m._id=b.name),f("autotypenumbers",b.autotypenumbersDflt);var w=f("type");if(w==="-"&&(b.data&&s(m,b.data),m.type==="-"?m.type="linear":w=h.type=m.type),f("smoothing"),f("cheatertype"),f("showticklabels"),f("labelprefix",x+" = "),f("labelsuffix"),f("showtickprefix"),f("showticksuffix"),f("separatethousands"),f("tickformat"),f("exponentformat"),f("minexponent"),f("showexponent"),f("categoryorder"),f("tickmode"),f("tickvals"),f("ticktext"),f("tick0"),f("dtick"),m.tickmode==="array"&&(f("arraytick0"),f("arraydtick")),f("labelpadding"),m._hovertitle=x,w==="date"){var D=z.getComponentMethod("calendars","handleDefaults");D(h,m,"calendar",b.calendar)}o(m,b.fullLayout),m.c2p=P.identity;var E=f("color",b.dfltColor),I=E===h.color?E:_.color,M=f("title.text");M&&(P.coerceFont(f,"title.font",_,{overrideDflt:{size:P.bigFont(_.size),color:I}}),f("title.offset")),f("tickangle");var p=f("autorange",!m.isValidRange(h.range));p&&f("rangemode"),f("range"),m.cleanRange(),f("fixedrange"),i(h,m,f,w),a(h,m,f,w,b),n(h,m,f,w,b),l(h,m,f,{data:b.data,dataAttr:x});var g=k("gridcolor",y(E,.3)),C=k("gridwidth"),T=k("griddash"),N=f("showgrid");N||(delete m.gridcolor,delete m.gridwidth,delete m.griddash);var B=k("startlinecolor",E),U=k("startlinewidth",C),V=f("startline",m.showgrid||!!B||!!U);V||(delete m.startlinecolor,delete m.startlinewidth);var W=k("endlinecolor",E),F=k("endlinewidth",C),$=f("endline",m.showgrid||!!W||!!F);return $||(delete m.endlinecolor,delete m.endlinewidth),N?(f("minorgridcount"),f("minorgridwidth",C),f("minorgriddash",T),f("minorgridcolor",y(g,.06)),m.minorgridcount||(delete m.minorgridwidth,delete m.minorgriddash,delete m.minorgridcolor)):(delete m.gridcolor,delete m.gridwidth,delete m.griddash),m.showticklabels==="none"&&(delete m.tickfont,delete m.tickangle,delete m.showexponent,delete m.exponentformat,delete m.minexponent,delete m.tickformat,delete m.showticksuffix,delete m.showtickprefix),m.showticksuffix||delete m.ticksuffix,m.showtickprefix||delete m.tickprefix,f("tickmode"),m};function s(h,m){if(h.type==="-"){var b=h._id,x=b.charAt(0),_=x+"calendar",A=h[_];h.type=u(m,A,{autotypenumbers:h.autotypenumbers})}}}),ote=Fe((te,Y)=>{var d=ate(),y=ku();Y.exports=function(P,i,n,a,l){var o=a("a");o||(a("da"),a("a0"));var u=a("b");u||(a("db"),a("b0")),z(P,i,n,l)};function z(P,i,n,a){var l=["aaxis","baxis"];l.forEach(function(o){var u=o.charAt(0),s=P[o]||{},h=y.newContainer(i,o),m={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:u+"axis",letter:u,font:i.font,name:o,data:P[u],calendar:i.calendar,dfltColor:a,bgColor:n.paper_bgcolor,autotypenumbersDflt:n.autotypenumbers,fullLayout:n};d(s,h,m),h._categories=h._categories||[],!P[o]&&s.type!=="-"&&(P[o]={type:s.type})})}}),ste=Fe((te,Y)=>{var d=ji(),y=nte(),z=ote(),P=gA(),i=Mi();Y.exports=function(n,a,l,o){function u(m,b){return d.coerce(n,a,P,m,b)}a._clipPathId="clip"+a.uid+"carpet";var s=u("color",i.defaultLine);if(d.coerceFont(u,"font",o.font),u("carpet"),z(n,a,o,u,s),!a.a||!a.b){a.visible=!1;return}a.a.length<3&&(a.aaxis.smoothing=0),a.b.length<3&&(a.baxis.smoothing=0);var h=y(n,a,u);h||(a.visible=!1),a._cheater&&u("cheaterslope"),u("zorder")}}),Cz=Fe((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P){var i;for(d(y)?y.length>z.length&&(y=y.slice(0,z.length)):y=[],i=0;i{Y.exports=function(d,y,z){if(d.length===0)return"";var P,i=[],n=z?3:1;for(P=0;P{Y.exports=function(d,y,z,P,i,n){var a=i[0]*d.dpdx(y),l=i[1]*d.dpdy(z),o=1,u=1;if(n){var s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(n[0]*n[0]+n[1]*n[1]),m=(i[0]*n[0]+i[1]*n[1])/s/h;u=Math.max(0,m)}var b=Math.atan2(l,a)*180/Math.PI;return b<-90?(b+=180,o=-o):b>90&&(b-=180,o=-o),{angle:b,flip:o,p:d.c2p(P,y,z),offsetMultplier:u}}}),ute=Fe((te,Y)=>{var d=ii(),y=Zs(),z=Cz(),P=Az(),i=lte(),n=cc(),a=ji(),l=a.strRotate,o=a.strTranslate,u=Bf();Y.exports=function(f,k,w,D){var E=f._context.staticPlot,I=k.xaxis,M=k.yaxis,p=f._fullLayout,g=p._clips;a.makeTraceGroups(D,w,"trace").each(function(C){var T=d.select(this),N=C[0],B=N.trace,U=B.aaxis,V=B.baxis,W=a.ensureSingle(T,"g","minorlayer"),F=a.ensureSingle(T,"g","majorlayer"),$=a.ensureSingle(T,"g","boundarylayer"),q=a.ensureSingle(T,"g","labellayer");T.style("opacity",B.opacity),h(I,M,F,U,"a",U._gridlines,!0),h(I,M,F,V,"b",V._gridlines,!0),h(I,M,W,U,"a",U._minorgridlines,!0),h(I,M,W,V,"b",V._minorgridlines,!0),h(I,M,$,U,"a-boundary",U._boundarylines,E),h(I,M,$,V,"b-boundary",V._boundarylines,E);var G=m(f,I,M,B,N,q,U._labels,"a-label"),ee=m(f,I,M,B,N,q,V._labels,"b-label");b(f,q,B,N,I,M,G,ee),s(B,N,g,I,M)})};function s(f,k,w,D,E){var I,M,p,g,C=w.select("#"+f._clipPathId);C.size()||(C=w.append("clipPath").classed("carpetclip",!0));var T=a.ensureSingle(C,"path","carpetboundary"),N=k.clipsegments,B=[];for(g=0;g0?"start":"end","data-notex":1}).call(y.font,N.font).text(N.text).call(n.convertToTspans,f),$=y.bBox(this);F.attr("transform",o(U.p[0],U.p[1])+l(U.angle)+o(N.axis.labelpadding*W,$.height*.3)),C=Math.max(C,$.width+N.axis.labelpadding)}),g.exit().remove(),T.maxExtent=C,T}function b(f,k,w,D,E,I,M,p){var g,C,T,N,B=a.aggNums(Math.min,null,w.a),U=a.aggNums(Math.max,null,w.a),V=a.aggNums(Math.min,null,w.b),W=a.aggNums(Math.max,null,w.b);g=.5*(B+U),C=V,T=w.ab2xy(g,C,!0),N=w.dxyda_rough(g,C),M.angle===void 0&&a.extendFlat(M,i(w,E,I,T,w.dxydb_rough(g,C))),A(f,k,w,D,T,N,w.aaxis,E,I,M,"a-title"),g=B,C=.5*(V+W),T=w.ab2xy(g,C,!0),N=w.dxydb_rough(g,C),p.angle===void 0&&a.extendFlat(p,i(w,E,I,T,w.dxyda_rough(g,C))),A(f,k,w,D,T,N,w.baxis,E,I,p,"b-title")}var x=u.LINE_SPACING,_=(1-u.MID_SHIFT)/x+1;function A(f,k,w,D,E,I,M,p,g,C,T){var N=[];M.title.text&&N.push(M.title.text);var B=k.selectAll("text."+T).data(N),U=C.maxExtent;B.enter().append("text").classed(T,!0),B.each(function(){var V=i(w,p,g,E,I);["start","both"].indexOf(M.showticklabels)===-1&&(U=0);var W=M.title.font.size;U+=W+M.title.offset;var F=C.angle+(C.flip<0?180:0),$=(F-V.angle+450)%360,q=$>90&&$<270,G=d.select(this);G.text(M.title.text).call(n.convertToTspans,f),q&&(U=(-n.lineCount(G)+_)*x*W-U),G.attr("transform",o(V.p[0],V.p[1])+l(V.angle)+o(0,U)).attr("text-anchor","middle").call(y.font,M.title.font)}),B.exit().remove()}}),cte=Fe((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P){var i,n,a,l,o,u,s=[],h=d(y)?y.length:y,m=d(z)?z.length:z,b=d(y)?y:null,x=d(z)?z:null;b&&(a=(b.length-1)/(b[b.length-1]-b[0])/(h-1)),x&&(l=(x.length-1)/(x[x.length-1]-x[0])/(m-1));var _,A=1/0,f=-1/0;for(n=0;n{var d=ji().isArrayOrTypedArray;Y.exports=function(z){return y(z,0)};function y(z,P){if(!d(z)||P>=10)return null;for(var i=1/0,n=-1/0,a=z.length,l=0;l{var d=Os(),y=an().extendFlat;Y.exports=function(z,P,i){var n,a,l,o,u,s,h,m,b,x,_,A,f,k,w=z["_"+P],D=z[P+"axis"],E=D._gridlines=[],I=D._minorgridlines=[],M=D._boundarylines=[],p=z["_"+i],g=z[i+"axis"];D.tickmode==="array"&&(D.tickvals=w.slice());var C=z._xctrl,T=z._yctrl,N=C[0].length,B=C.length,U=z._a.length,V=z._b.length;d.prepTicks(D),D.tickmode==="array"&&delete D.tickvals;var W=D.smoothing?3:1;function F(q){var G,ee,he,xe,ve,ce,re,ge,ne,se,_e,oe,J=[],me=[],fe={};if(P==="b")for(ee=z.b2j(q),he=Math.floor(Math.max(0,Math.min(V-2,ee))),xe=ee-he,fe.length=V,fe.crossLength=U,fe.xy=function(Ce){return z.evalxy([],Ce,ee)},fe.dxy=function(Ce,Be){return z.dxydi([],Ce,he,Be,xe)},G=0;G0&&(ne=z.dxydi([],G-1,he,0,xe),J.push(ve[0]+ne[0]/3),me.push(ve[1]+ne[1]/3),se=z.dxydi([],G-1,he,1,xe),J.push(ge[0]-se[0]/3),me.push(ge[1]-se[1]/3)),J.push(ge[0]),me.push(ge[1]),ve=ge;else for(G=z.a2i(q),ce=Math.floor(Math.max(0,Math.min(U-2,G))),re=G-ce,fe.length=U,fe.crossLength=V,fe.xy=function(Ce){return z.evalxy([],G,Ce)},fe.dxy=function(Ce,Be){return z.dxydj([],ce,Ce,re,Be)},ee=0;ee0&&(_e=z.dxydj([],ce,ee-1,re,0),J.push(ve[0]+_e[0]/3),me.push(ve[1]+_e[1]/3),oe=z.dxydj([],ce,ee-1,re,1),J.push(ge[0]-oe[0]/3),me.push(ge[1]-oe[1]/3)),J.push(ge[0]),me.push(ge[1]),ve=ge;return fe.axisLetter=P,fe.axis=D,fe.crossAxis=g,fe.value=q,fe.constvar=i,fe.index=m,fe.x=J,fe.y=me,fe.smoothing=g.smoothing,fe}function $(q){var G,ee,he,xe,ve,ce=[],re=[],ge={};if(ge.length=w.length,ge.crossLength=p.length,P==="b")for(he=Math.max(0,Math.min(V-2,q)),ve=Math.min(1,Math.max(0,q-he)),ge.xy=function(ne){return z.evalxy([],ne,q)},ge.dxy=function(ne,se){return z.dxydi([],ne,he,se,ve)},G=0;Gw.length-1)&&E.push(y($(a),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s;mw.length-1)&&!(_<0||_>w.length-1))for(A=w[l],f=w[_],n=0;nw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash})));D.startline&&M.push(y($(0),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y($(w.length-1),{color:D.endlinecolor,width:D.endlinewidth}))}else{for(o=5e-15,u=[Math.floor((w[w.length-1]-D.tick0)/D.dtick*(1+o)),Math.ceil((w[0]-D.tick0)/D.dtick/(1+o))].sort(function(q,G){return q-G}),s=u[0],h=u[1],m=s;m<=h;m++)b=D.tick0+D.dtick*m,E.push(y(F(b),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s-1;mw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash}));D.startline&&M.push(y(F(w[0]),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(F(w[w.length-1]),{color:D.endlinecolor,width:D.endlinewidth}))}}}),dte=Fe((te,Y)=>{var d=Os(),y=an().extendFlat;Y.exports=function(z,P){var i,n,a,l,o,u=P._labels=[],s=P._gridlines;for(i=0;i{Y.exports=function(d,y,z,P){var i,n,a,l=[],o=!!z.smoothing,u=!!P.smoothing,s=d[0].length-1,h=d.length-1;for(i=0,n=[],a=[];i<=s;i++)n[i]=d[0][i],a[i]=y[0][i];for(l.push({x:n,y:a,bicubic:o}),i=0,n=[],a=[];i<=h;i++)n[i]=d[i][s],a[i]=y[i][s];for(l.push({x:n,y:a,bicubic:u}),i=s,n=[],a=[];i>=0;i--)n[s-i]=d[h][i],a[s-i]=y[h][i];for(l.push({x:n,y:a,bicubic:o}),i=h,n=[],a=[];i>=0;i--)n[h-i]=d[i][0],a[h-i]=y[i][0];return l.push({x:n,y:a,bicubic:u}),l}}),mte=Fe((te,Y)=>{var d=ji();Y.exports=function(y,z,P){var i,n,a,l=[],o=[],u=y[0].length,s=y.length;function h(ee,he){var xe=0,ve,ce=0;return ee>0&&(ve=y[he][ee-1])!==void 0&&(ce++,xe+=ve),ee0&&(ve=y[he-1][ee])!==void 0&&(ce++,xe+=ve),he0&&n0&&ip);return d.log("Smoother converged to",g,"after",T,"iterations"),y}}),gte=Fe((te,Y)=>{Y.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),vte=Fe((te,Y)=>{var d=.5;Y.exports=function(y,z,P,i){var n=y[0]-z[0],a=y[1]-z[1],l=P[0]-z[0],o=P[1]-z[1],u=Math.pow(n*n+a*a,d/2),s=Math.pow(l*l+o*o,d/2),h=(s*s*n-u*u*l)*i,m=(s*s*a-u*u*o)*i,b=s*(u+s)*3,x=u*(u+s)*3;return[[z[0]+(b&&h/b),z[1]+(b&&m/b)],[z[0]-(x&&h/x),z[1]-(x&&m/x)]]}}),yte=Fe((te,Y)=>{var d=vte(),y=ji().ensureArray;function z(P,i,n){var a=-.5*n[0]+1.5*i[0],l=-.5*n[1]+1.5*i[1];return[(2*a+P[0])/3,(2*l+P[1])/3]}Y.exports=function(P,i,n,a,l,o){var u,s,h,m,b,x,_,A,f,k,w=n[0].length,D=n.length,E=l?3*w-2:w,I=o?3*D-2:D;for(P=y(P,I),i=y(i,I),h=0;h{Y.exports=function(d,y,z,P,i){var n=y-2,a=z-2;return P&&i?function(l,o,u){l||(l=[]);var s,h,m,b,x,_,A=Math.max(0,Math.min(Math.floor(o),n)),f=Math.max(0,Math.min(Math.floor(u),a)),k=Math.max(0,Math.min(1,o-A)),w=Math.max(0,Math.min(1,u-f));A*=3,f*=3;var D=k*k,E=D*k,I=1-k,M=I*I,p=M*I,g=w*w,C=g*w,T=1-w,N=T*T,B=N*T;for(_=0;_{Y.exports=function(d,y,z){return y&&z?function(P,i,n,a,l){P||(P=[]);var o,u,s,h,m,b;i*=3,n*=3;var x=a*a,_=1-a,A=_*_,f=_*a*2,k=-3*A,w=3*(A-f),D=3*(f-x),E=3*x,I=l*l,M=I*l,p=1-l,g=p*p,C=g*p;for(b=0;b{Y.exports=function(d,y,z){return y&&z?function(P,i,n,a,l){P||(P=[]);var o,u,s,h,m,b;i*=3,n*=3;var x=a*a,_=x*a,A=1-a,f=A*A,k=f*A,w=l*l,D=1-l,E=D*D,I=D*l*2,M=-3*E,p=3*(E-I),g=3*(I-w),C=3*w;for(b=0;b{var d=gte(),y=rw().findBin,z=yte(),P=_te(),i=xte(),n=bte();Y.exports=function(a){var l=a._a,o=a._b,u=l.length,s=o.length,h=a.aaxis,m=a.baxis,b=l[0],x=l[u-1],_=o[0],A=o[s-1],f=l[l.length-1]-l[0],k=o[o.length-1]-o[0],w=f*d.RELATIVE_CULL_TOLERANCE,D=k*d.RELATIVE_CULL_TOLERANCE;b-=w,x+=w,_-=D,A+=D,a.isVisible=function(E,I){return E>b&&E_&&Ix||I<_||I>A},a.setScale=function(){var E=a._x,I=a._y,M=z(a._xctrl,a._yctrl,E,I,h.smoothing,m.smoothing);a._xctrl=M[0],a._yctrl=M[1],a.evalxy=P([a._xctrl,a._yctrl],u,s,h.smoothing,m.smoothing),a.dxydi=i([a._xctrl,a._yctrl],h.smoothing,m.smoothing),a.dxydj=n([a._xctrl,a._yctrl],h.smoothing,m.smoothing)},a.i2a=function(E){var I=Math.max(0,Math.floor(E[0]),u-2),M=E[0]-I;return(1-M)*l[I]+M*l[I+1]},a.j2b=function(E){var I=Math.max(0,Math.floor(E[1]),u-2),M=E[1]-I;return(1-M)*o[I]+M*o[I+1]},a.ij2ab=function(E){return[a.i2a(E[0]),a.j2b(E[1])]},a.a2i=function(E){var I=Math.max(0,Math.min(y(E,l),u-2)),M=l[I],p=l[I+1];return Math.max(0,Math.min(u-1,I+(E-M)/(p-M)))},a.b2j=function(E){var I=Math.max(0,Math.min(y(E,o),s-2)),M=o[I],p=o[I+1];return Math.max(0,Math.min(s-1,I+(E-M)/(p-M)))},a.ab2ij=function(E){return[a.a2i(E[0]),a.b2j(E[1])]},a.i2c=function(E,I){return a.evalxy([],E,I)},a.ab2xy=function(E,I,M){if(!M&&(El[u-1]|Io[s-1]))return[!1,!1];var p=a.a2i(E),g=a.b2j(I),C=a.evalxy([],p,g);if(M){var T=0,N=0,B=[],U,V,W,F;El[u-1]?(U=u-2,V=1,T=(E-l[u-1])/(l[u-1]-l[u-2])):(U=Math.max(0,Math.min(u-2,Math.floor(p))),V=p-U),Io[s-1]?(W=s-2,F=1,N=(I-o[s-1])/(o[s-1]-o[s-2])):(W=Math.max(0,Math.min(s-2,Math.floor(g))),F=g-W),T&&(a.dxydi(B,U,W,V,F),C[0]+=B[0]*T,C[1]+=B[1]*T),N&&(a.dxydj(B,U,W,V,F),C[0]+=B[0]*N,C[1]+=B[1]*N)}return C},a.c2p=function(E,I,M){return[I.c2p(E[0]),M.c2p(E[1])]},a.p2x=function(E,I,M){return[I.p2c(E[0]),M.p2c(E[1])]},a.dadi=function(E){var I=Math.max(0,Math.min(l.length-2,E));return l[I+1]-l[I]},a.dbdj=function(E){var I=Math.max(0,Math.min(o.length-2,E));return o[I+1]-o[I]},a.dxyda=function(E,I,M,p){var g=a.dxydi(null,E,I,M,p),C=a.dadi(E,M);return[g[0]/C,g[1]/C]},a.dxydb=function(E,I,M,p){var g=a.dxydj(null,E,I,M,p),C=a.dbdj(I,p);return[g[0]/C,g[1]/C]},a.dxyda_rough=function(E,I,M){var p=f*(M||.1),g=a.ab2xy(E+p,I,!0),C=a.ab2xy(E-p,I,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dxydb_rough=function(E,I,M){var p=k*(M||.1),g=a.ab2xy(E,I+p,!0),C=a.ab2xy(E,I-p,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dpdx=function(E){return E._m},a.dpdy=function(E){return E._m}}}),kte=Fe((te,Y)=>{var d=Os(),y=ji().isArray1D,z=cte(),P=hte(),i=fte(),n=dte(),a=pte(),l=z8(),o=mte(),u=D8(),s=wte();Y.exports=function(h,m){var b=d.getFromId(h,m.xaxis),x=d.getFromId(h,m.yaxis),_=m.aaxis,A=m.baxis,f=m.x,k=m.y,w=[];f&&y(f)&&w.push("x"),k&&y(k)&&w.push("y"),w.length&&u(m,_,A,"a","b",w);var D=m._a=m._a||m.a,E=m._b=m._b||m.b;f=m._x||m.x,k=m._y||m.y;var I={};if(m._cheater){var M=_.cheatertype==="index"?D.length:D,p=A.cheatertype==="index"?E.length:E;f=z(M,p,m.cheaterslope)}m._x=f=l(f),m._y=k=l(k),o(f,D,E),o(k,D,E),s(m),m.setScale();var g=P(f),C=P(k),T=.5*(g[1]-g[0]),N=.5*(g[1]+g[0]),B=.5*(C[1]-C[0]),U=.5*(C[1]+C[0]),V=1.3;return g=[N-T*V,N+T*V],C=[U-B*V,U+B*V],m._extremes[b._id]=d.findExtremes(b,g,{padded:!0}),m._extremes[x._id]=d.findExtremes(x,C,{padded:!0}),i(m,"a","b"),i(m,"b","a"),n(m,_),n(m,A),I.clipsegments=a(m._xctrl,m._yctrl,_,A),I.x=f,I.y=k,I.a=D,I.b=E,[I]}}),Tte=Fe((te,Y)=>{Y.exports={attributes:gA(),supplyDefaults:ste(),plot:ute(),calc:kte(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Rf(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Ste=Fe((te,Y)=>{Y.exports=Tte()}),Mz=Fe((te,Y)=>{var d=Lm(),y=ff(),z=_a(),{hovertemplateAttrs:P,texttemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=zc(),l=an().extendFlat,o=y.marker,u=y.line,s=o.line;Y.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},y.mode,{dflt:"markers"}),text:l({},y.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:n({editType:"plot"}),hovertext:l({},y.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:y.connectgaps,fill:l({},y.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:l({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:l({width:s.width,editType:"calc"},a("marker.line")),gradient:o.gradient,editType:"calc"},a("marker")),textfont:y.textfont,textposition:y.textposition,selected:y.selected,unselected:y.unselected,hoverinfo:l({},z.hoverinfo,{flags:["a","b","text","name"]}),hoveron:y.hoveron,hovertemplate:P(),hovertemplatefallback:n(),zorder:y.zorder}}),Cte=Fe((te,Y)=>{var d=ji(),y=Mg(),z=Oc(),P=X0(),i=Pm(),n=ry(),a=mm(),l=Im(),o=Mz();Y.exports=function(u,s,h,m){function b(D,E){return d.coerce(u,s,o,D,E)}b("carpet"),s.xaxis="x",s.yaxis="y";var x=b("a"),_=b("b"),A=Math.min(x.length,_.length);if(!A){s.visible=!1;return}s._length=A,b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext");var f=A{Y.exports=function(d,y){var z={},P=y._carpet,i=P.ab2ij([d.a,d.b]),n=Math.floor(i[0]),a=i[0]-n,l=Math.floor(i[1]),o=i[1]-l,u=P.evalxy([],n,l,a,o);return z.yLabel=u[1].toFixed(3),z}}),vA=Fe((te,Y)=>{Y.exports=function(d,y){for(var z=d._fullData.length,P,i=0;i{var d=Ar(),y=zm(),z=de(),P=$e(),i=yt().calcMarkerSize,n=vA();Y.exports=function(a,l){var o=l._carpetTrace=n(a,l);if(!(!o||!o.visible||o.visible==="legendonly")){var u;l.xaxis=o.xaxis,l.yaxis=o.yaxis;var s=l._length,h=new Array(s),m,b,x=!1;for(u=0;u{var d=uo(),y=Os(),z=Zs();Y.exports=function(P,i,n,a){var l,o,u,s=n[0][0].carpet,h=y.getFromId(P,s.xaxis||"x"),m=y.getFromId(P,s.yaxis||"y"),b={xaxis:h,yaxis:m,plot:i.plot};for(l=0;l{var d=Zd(),y=ji().fillText;Y.exports=function(z,P,i,n){var a=d(z,P,i,n);if(!a||a[0].index===!1)return;var l=a[0];if(l.index===void 0){var o=1-l.y0/z.ya._length,u=z.xa._length,s=u*o/2,h=u-s;return l.x0=Math.max(Math.min(l.x0,h),s),l.x1=Math.max(Math.min(l.x1,h),s),a}var m=l.cd[l.index];l.a=m.a,l.b=m.b,l.xLabelVal=void 0,l.yLabelVal=void 0;var b=l.trace,x=b._carpet,_=b._module.formatLabels(m,b);l.yLabel=_.yLabel,delete l.text;var A=[];function f(D,E){var I;D.labelprefix&&D.labelprefix.length>0?I=D.labelprefix.replace(/ = $/,""):I=D._hovertitle,A.push(I+": "+E.toFixed(3)+D.labelsuffix)}if(!b.hovertemplate){var k=m.hi||b.hoverinfo,w=k.split("+");w.indexOf("all")!==-1&&(w=["a","b","text"]),w.indexOf("a")!==-1&&f(x.aaxis,m.a),w.indexOf("b")!==-1&&f(x.baxis,m.b),A.push("y: "+l.yLabel),w.indexOf("text")!==-1&&y(m,b,A),l.extraText=A.join("
")}return a}}),Pte=Fe((te,Y)=>{Y.exports=function(d,y,z,P,i){var n=P[i];return d.a=n.a,d.b=n.b,d.y=n.y,d}}),Ite=Fe((te,Y)=>{Y.exports={attributes:Mz(),supplyDefaults:Cte(),colorbar:Mo(),formatLabels:Ate(),calc:Mte(),plot:Ete(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Lte(),selectPoints:Jf(),eventData:Pte(),moduleType:"trace",name:"scattercarpet",basePlotModule:Rf(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),Dte=Fe((te,Y)=>{Y.exports=Ite()}),Ez=Fe((te,Y)=>{var d=Ew(),y=Z4(),z=zc(),P=an().extendFlat,i=y.contours;Y.exports=P({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:y.fillcolor,autocontour:y.autocontour,ncontours:y.ncontours,contours:{type:i.type,start:i.start,end:i.end,size:i.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:i.showlines,showlabels:i.showlabels,labelfont:i.labelfont,labelformat:i.labelformat,operation:i.operation,value:i.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:y.line.color,width:y.line.width,dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},zorder:y.zorder},z("",{cLetter:"z",autoColorDflt:!1}))}),Lz=Fe((te,Y)=>{var d=ji(),y=I8(),z=Ez(),P=tP(),i=q8(),n=G8();Y.exports=function(a,l,o,u){function s(x,_){return d.coerce(a,l,z,x,_)}function h(x){return d.coerce2(a,l,z,x)}if(s("carpet"),a.a&&a.b){var m=y(a,l,s,u,"a","b");if(!m){l.visible=!1;return}s("text");var b=s("contours.type")==="constraint";b?P(a,l,s,u,o,{hasHover:!1}):(i(a,l,s,h),n(a,l,s,u,{hasHover:!1}))}else l._defaultColor=o,l._length=null;s("zorder")}}),zte=Fe((te,Y)=>{var d=kp(),y=ji(),z=D8(),P=z8(),i=O8(),n=B8(),a=NL(),l=Lz(),o=vA(),u=qL();Y.exports=function(h,m){var b=m._carpetTrace=o(h,m);if(!(!b||!b.visible||b.visible==="legendonly")){if(!m.a||!m.b){var x=h.data[b.index],_=h.data[m.index];_.a||(_.a=x.a),_.b||(_.b=x.b),l(_,m,m._defaultColor,h._fullLayout)}var A=s(h,m);return u(m,m._z),A}};function s(h,m){var b=m._carpetTrace,x=b.aaxis,_=b.baxis,A,f,k,w,D,E,I;x._minDtick=0,_._minDtick=0,y.isArray1D(m.z)&&z(m,x,_,"a","b",["z"]),A=m._a=m._a||m.a,w=m._b=m._b||m.b,A=A?x.makeCalcdata(m,"_a"):[],w=w?_.makeCalcdata(m,"_b"):[],f=m.a0||0,k=m.da||1,D=m.b0||0,E=m.db||1,I=m._z=P(m._z||m.z,m.transpose),m._emptypoints=n(I),i(I,m._emptypoints);var M=y.maxRowLength(I),p=m.xtype==="scaled"?"":A,g=a(m,p,f,k,M,x),C=m.ytype==="scaled"?"":w,T=a(m,C,D,E,I.length,_),N={a:g,b:T,z:I};return m.contours.type==="levels"&&m.contours.coloring!=="none"&&d(h,m,{vals:I,containerStr:"",cLetter:"z"}),[N]}}),Ote=Fe((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P,i){var n,a,l,o,u,s,h,m,b,x,_,A,f,k=d(P)?"a":"b",w=k==="a"?y.aaxis:y.baxis,D=w.smoothing,E=k==="a"?y.a2i:y.b2j,I=k==="a"?P:i,M=k==="a"?i:P,p=k==="a"?z.a.length:z.b.length,g=k==="a"?z.b.length:z.a.length,C=Math.floor(k==="a"?y.b2j(M):y.a2i(M)),T=k==="a"?function(xe){return y.evalxy([],xe,C)}:function(xe){return y.evalxy([],C,xe)};D&&(l=Math.max(0,Math.min(g-2,C)),o=C-l,a=k==="a"?function(xe,ve){return y.dxydi([],xe,l,ve,o)}:function(xe,ve){return y.dxydj([],l,xe,o,ve)});var N=E(I[0]),B=E(I[1]),U=N0?Math.floor:Math.ceil,F=U>0?Math.ceil:Math.floor,$=U>0?Math.min:Math.max,q=U>0?Math.max:Math.min,G=W(N+V),ee=F(B-V);h=T(N);var he=[[h]];for(n=G;n*U{var d=ii(),y=Cz(),z=Az(),P=Zs(),i=ji(),n=ZL(),a=KL(),l=Z8(),o=Y4(),u=XL(),s=YL(),h=JL(),m=vA(),b=Ote();Y.exports=function(M,p,g,C){var T=p.xaxis,N=p.yaxis;i.makeTraceGroups(C,g,"contour").each(function(B){var U=d.select(this),V=B[0],W=V.trace,F=W._carpetTrace=m(M,W),$=M.calcdata[F.index][0];if(!F.visible||F.visible==="legendonly")return;var q=V.a,G=V.b,ee=W.contours,he=s(ee,p,V),xe=ee.type==="constraint",ve=ee._operation,ce=xe?ve==="="?"lines":"fill":ee.coloring;function re(Oe){var Ze=F.ab2xy(Oe[0],Oe[1],!0);return[T.c2p(Ze[0]),N.c2p(Ze[1])]}var ge=[[q[0],G[G.length-1]],[q[q.length-1],G[G.length-1]],[q[q.length-1],G[0]],[q[0],G[0]]];n(he);var ne=(q[q.length-1]-q[0])*1e-8,se=(G[G.length-1]-G[0])*1e-8;a(he,ne,se);var _e=he;ee.type==="constraint"&&(_e=u(he,ve)),x(he,re);var oe,J,me,fe,Ce=[];for(fe=$.clipsegments.length-1;fe>=0;fe--)oe=$.clipsegments[fe],J=y([],oe.x,T.c2p),me=y([],oe.y,N.c2p),J.reverse(),me.reverse(),Ce.push(z(J,me,oe.bicubic));var Be="M"+Ce.join("L")+"Z";D(U,$.clipsegments,T,N,xe,ce),E(W,U,T,N,_e,ge,re,F,$,ce,Be),_(U,he,M,V,ee,p,F),P.setClipUrl(U,F._clipPathId,M)})};function x(M,p){var g,C,T,N,B,U,V,W,F;for(g=0;gxe&&(C.max=xe),C.len=C.max-C.min}function f(M,p,g){var C=M.getPointAtLength(p),T=M.getPointAtLength(g),N=T.x-C.x,B=T.y-C.y,U=Math.sqrt(N*N+B*B);return[N/U,B/U]}function k(M){var p=Math.sqrt(M[0]*M[0]+M[1]*M[1]);return[M[0]/p,M[1]/p]}function w(M,p){var g=Math.abs(M[0]*p[0]+M[1]*p[1]),C=Math.sqrt(1-g*g);return C/g}function D(M,p,g,C,T,N){var B,U,V,W,F=i.ensureSingle(M,"g","contourbg"),$=F.selectAll("path").data(N==="fill"&&!T?[0]:[]);$.enter().append("path"),$.exit().remove();var q=[];for(W=0;W=0&&(G=me,he=xe):Math.abs(q[1]-G[1])=0&&(G=me,he=xe):i.log("endpt to newendpt is not vert. or horz.",q,G,me)}if(he>=0)break;W+=oe(q,G),q=G}if(he===p.edgepaths.length){i.log("unclosed perimeter path");break}V=he,$=F.indexOf(V)===-1,$&&(V=F[0],W+=oe(q,G)+"Z",q=null)}for(V=0;V{Y.exports={attributes:Ez(),supplyDefaults:Lz(),colorbar:Y8(),calc:zte(),plot:Bte(),style:K8(),moduleType:"trace",name:"contourcarpet",basePlotModule:Rf(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),Fte=Fe((te,Y)=>{Y.exports=Rte()}),yA=Fe((te,Y)=>{var d=ji().extendFlat,y=ff(),z=Sh().axisHoverFormat,P=Wd().dash,i=zo(),n=Lw(),a=n.INCREASING.COLOR,l=n.DECREASING.COLOR,o=y.line;function u(s){return{line:{color:d({},o.color,{dflt:s}),width:o.width,dash:P,editType:"style"},editType:"style"}}Y.exports={xperiod:y.xperiod,xperiod0:y.xperiod0,xperiodalignment:y.xperiodalignment,xhoverformat:z("x"),yhoverformat:z("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:d({},o.width,{}),dash:d({},P,{}),editType:"style"},increasing:u(a),decreasing:u(l),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:d({},i.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:y.zorder}}),Pz=Fe((te,Y)=>{var d=as(),y=ji();Y.exports=function(z,P,i,n){var a=i("x"),l=i("open"),o=i("high"),u=i("low"),s=i("close");i("hoverlabel.split");var h=d.getComponentMethod("calendars","handleTraceDefaults");if(h(z,P,["x"],n),!!(l&&o&&u&&s)){var m=Math.min(l.length,o.length,u.length,s.length);return a&&(m=Math.min(m,y.minRowLength(a))),P._length=m,m}}}),Nte=Fe((te,Y)=>{var d=ji(),y=Pz(),z=S0(),P=yA();Y.exports=function(n,a,l,o){function u(h,m){return d.coerce(n,a,P,h,m)}var s=y(n,a,u,o);if(!s){a.visible=!1;return}z(n,a,o,u,{x:!0}),u("xhoverformat"),u("yhoverformat"),u("line.width"),u("line.dash"),i(n,a,u,"increasing"),i(n,a,u,"decreasing"),u("text"),u("hovertext"),u("tickwidth"),o._requestRangeslider[a.xaxis]=!0,u("zorder")};function i(n,a,l,o){l(o+".line.color"),l(o+".line.width",a.line.width),l(o+".line.dash",a.line.dash)}}),Iz=Fe((te,Y)=>{var d=ji(),y=d._,z=Os(),P=Dm(),i=ti().BADNUM;function n(u,s){var h=z.getFromId(u,s.xaxis),m=z.getFromId(u,s.yaxis),b=o(u,h,s),x=s._minDiff;s._minDiff=null;var _=s._origX;s._origX=null;var A=s._xcalc;s._xcalc=null;var f=l(u,s,_,A,m,a);return s._extremes[h._id]=z.findExtremes(h,A,{vpad:x/2}),f.length?(d.extendFlat(f[0].t,{wHover:x/2,tickLen:b}),f):[{t:{empty:!0}}]}function a(u,s,h,m){return{o:u,h:s,l:h,c:m}}function l(u,s,h,m,b,x){for(var _=b.makeCalcdata(s,"open"),A=b.makeCalcdata(s,"high"),f=b.makeCalcdata(s,"low"),k=b.makeCalcdata(s,"close"),w=d.isArrayOrTypedArray(s.text),D=d.isArrayOrTypedArray(s.hovertext),E=!0,I=null,M=!!s.xperiodalignment,p=[],g=0;gI):E=U>T,I=U;var V=x(T,N,B,U);V.pos=C,V.yc=(T+U)/2,V.i=g,V.dir=E?"increasing":"decreasing",V.x=V.pos,V.y=[B,N],M&&(V.orig_p=h[g]),w&&(V.tx=s.text[g]),D&&(V.htx=s.hovertext[g]),p.push(V)}else p.push({pos:C,empty:!0})}return s._extremes[b._id]=z.findExtremes(b,d.concat(f,A),{padded:!0}),p.length&&(p[0].t={labels:{open:y(u,"open:")+" ",high:y(u,"high:")+" ",low:y(u,"low:")+" ",close:y(u,"close:")+" "}}),p}function o(u,s,h){var m=h._minDiff;if(!m){var b=u._fullData,x=[];m=1/0;var _;for(_=0;_{var d=ii(),y=ji();Y.exports=function(z,P,i,n){var a=P.yaxis,l=P.xaxis,o=!!l.rangebreaks;y.makeTraceGroups(n,i,"trace ohlc").each(function(u){var s=d.select(this),h=u[0],m=h.t,b=h.trace;if(b.visible!==!0||m.empty){s.remove();return}var x=m.tickLen,_=s.selectAll("path").data(y.identity);_.enter().append("path"),_.exit().remove(),_.attr("d",function(A){if(A.empty)return"M0,0Z";var f=l.c2p(A.pos-x,!0),k=l.c2p(A.pos+x,!0),w=o?(f+k)/2:l.c2p(A.pos,!0),D=a.c2p(A.o,!0),E=a.c2p(A.h,!0),I=a.c2p(A.l,!0),M=a.c2p(A.c,!0);return"M"+f+","+D+"H"+w+"M"+w+","+E+"V"+I+"M"+k+","+M+"H"+w})})}}),Ute=Fe((te,Y)=>{var d=ii(),y=Zs(),z=Xi();Y.exports=function(P,i,n){var a=n||d.select(P).selectAll("g.ohlclayer").selectAll("g.trace");a.style("opacity",function(l){return l[0].trace.opacity}),a.each(function(l){var o=l[0].trace;d.select(this).selectAll("path").each(function(u){if(!u.empty){var s=o[u.dir].line;d.select(this).style("fill","none").call(z.stroke,s.color).call(y.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!u.selected?.3:1)}})})}}),Dz=Fe((te,Y)=>{var d=Os(),y=ji(),z=hf(),P=Xi(),i=ji().fillText,n=Lw(),a={increasing:n.INCREASING.SYMBOL,decreasing:n.DECREASING.SYMBOL};function l(h,m,b,x){var _=h.cd,A=_[0].trace;return A.hoverlabel.split?u(h,m,b,x):s(h,m,b,x)}function o(h,m,b,x){var _=h.cd,A=h.xa,f=_[0].trace,k=_[0].t,w=f.type,D=w==="ohlc"?"l":"min",E=w==="ohlc"?"h":"max",I,M,p=k.bPos||0,g=function(ee){return ee.pos+p-m},C=k.bdPos||k.tickLen,T=k.wHover,N=Math.min(1,C/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));I=h.maxHoverDistance-N,M=h.maxSpikeDistance-N;function B(ee){var he=g(ee);return z.inbox(he-T,he+T,I)}function U(ee){var he=ee[D],xe=ee[E];return he===xe||z.inbox(he-b,xe-b,I)}function V(ee){return(B(ee)+U(ee))/2}var W=z.getDistanceFunction(x,B,U,V);if(z.getClosest(_,W,h),h.index===!1)return null;var F=_[h.index];if(F.empty)return null;var $=F.dir,q=f[$],G=q.line.color;return P.opacity(G)&&q.line.width?h.color=G:h.color=q.fillcolor,h.x0=A.c2p(F.pos+p-C,!0),h.x1=A.c2p(F.pos+p+C,!0),h.xLabelVal=F.orig_p!==void 0?F.orig_p:F.pos,h.spikeDistance=V(F)*M/I,h.xSpike=A.c2p(F.pos,!0),h}function u(h,m,b,x){var _=h.cd,A=h.ya,f=_[0].trace,k=_[0].t,w=[],D=o(h,m,b,x);if(!D)return[];var E=D.index,I=_[E],M=I.hi||f.hoverinfo,p=M.split("+"),g=M==="all",C=g||p.indexOf("y")!==-1;if(!C)return[];for(var T=["high","open","close","low"],N={},B=0;B"+k.labels[U]+d.hoverLabelText(A,V,f.yhoverformat)):(F=y.extendFlat({},D),F.y0=F.y1=W,F.yLabelVal=V,F.yLabel=k.labels[U]+d.hoverLabelText(A,V,f.yhoverformat),F.name="",w.push(F),N[V]=F)}return w}function s(h,m,b,x){var _=h.cd,A=h.ya,f=_[0].trace,k=_[0].t,w=o(h,m,b,x);if(!w)return[];var D=w.index,E=_[D],I=w.index=E.i,M=E.dir;function p(V){return k.labels[V]+d.hoverLabelText(A,f[V][I],f.yhoverformat)}var g=E.hi||f.hoverinfo,C=g.split("+"),T=g==="all",N=T||C.indexOf("y")!==-1,B=T||C.indexOf("text")!==-1,U=N?[p("open"),p("high"),p("low"),p("close")+" "+a[M]]:[];return B&&i(E,f,U),w.extraText=U.join("
"),w.y0=w.y1=A.c2p(E.yc,!0),[w]}Y.exports={hoverPoints:l,hoverSplit:u,hoverOnPoints:s}}),zz=Fe((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l=z[0].t.bPos||0;if(y===!1)for(a=0;a{Y.exports={moduleType:"trace",name:"ohlc",basePlotModule:Rf(),categories:["cartesian","svg","showLegend"],meta:{},attributes:yA(),supplyDefaults:Nte(),calc:Iz().calc,plot:jte(),style:Ute(),hoverPoints:Dz().hoverPoints,selectPoints:zz()}}),Hte=Fe((te,Y)=>{Y.exports=$te()}),Oz=Fe((te,Y)=>{var d=ji().extendFlat,y=Sh().axisHoverFormat,z=yA(),P=V4();function i(n){return{line:{color:d({},P.line.color,{dflt:n}),width:P.line.width,editType:"style"},fillcolor:P.fillcolor,editType:"style"}}Y.exports={xperiod:z.xperiod,xperiod0:z.xperiod0,xperiodalignment:z.xperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),x:z.x,open:z.open,high:z.high,low:z.low,close:z.close,line:{width:d({},P.line.width,{}),editType:"style"},increasing:i(z.increasing.line.color.dflt),decreasing:i(z.decreasing.line.color.dflt),text:z.text,hovertext:z.hovertext,whiskerwidth:d({},P.whiskerwidth,{dflt:0}),hoverlabel:z.hoverlabel,zorder:P.zorder}}),Vte=Fe((te,Y)=>{var d=ji(),y=Xi(),z=Pz(),P=S0(),i=Oz();Y.exports=function(a,l,o,u){function s(m,b){return d.coerce(a,l,i,m,b)}var h=z(a,l,s,u);if(!h){l.visible=!1;return}P(a,l,u,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),n(a,l,s,"increasing"),n(a,l,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),u._requestRangeslider[l.xaxis]=!0,s("zorder")};function n(a,l,o,u){var s=o(u+".line.color");o(u+".line.width",l.line.width),o(u+".fillcolor",y.addOpacity(s,.5))}}),Wte=Fe((te,Y)=>{var d=ji(),y=Os(),z=Dm(),P=Iz().calcCommon;Y.exports=function(n,a){var l=n._fullLayout,o=y.getFromId(n,a.xaxis),u=y.getFromId(n,a.yaxis),s=o.makeCalcdata(a,"x"),h=z(a,o,"x",s).vals,m=P(n,a,s,h,u,i);return m.length?(d.extendFlat(m[0].t,{num:l._numBoxes,dPos:d.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),l._numBoxes++,m):[{t:{empty:!0}}]};function i(n,a,l,o){return{min:l,q1:Math.min(n,o),med:o,q3:Math.max(n,o),max:a}}}),qte=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"candlestick",basePlotModule:Rf(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:Oz(),layoutAttributes:W4(),supplyLayoutDefaults:M8().supplyLayoutDefaults,crossTraceCalc:E8().crossTraceCalc,supplyDefaults:Vte(),calc:Wte(),plot:L8().plot,layerName:"boxlayer",style:P8().style,hoverPoints:Dz().hoverPoints,selectPoints:zz()}}),Gte=Fe((te,Y)=>{Y.exports=qte()}),Bz=Fe((te,Y)=>{var d=ji(),y=Z0(),z=d.deg2rad,P=d.rad2deg;Y.exports=function(o,u,s){switch(y(o,s),o._id){case"x":case"radialaxis":i(o,u);break;case"angularaxis":l(o,u);break}};function i(o,u){var s=u._subplot;o.setGeometry=function(){var h=o._rl[0],m=o._rl[1],b=s.innerRadius,x=(s.radius-b)/(m-h),_=b/x,A=h>m?function(f){return f<=0}:function(f){return f>=0};o.c2g=function(f){var k=o.c2l(f)-h;return(A(k)?k:0)+_},o.g2c=function(f){return o.l2c(f+h-_)},o.g2p=function(f){return f*x},o.c2p=function(f){return o.g2p(o.c2g(f))}}}function n(o,u){return u==="degrees"?z(o):o}function a(o,u){return u==="degrees"?P(o):o}function l(o,u){var s=o.type;if(s==="linear"){var h=o.d2c,m=o.c2d;o.d2c=function(b,x){return n(h(b),x)},o.c2d=function(b,x){return m(a(b,x))}}o.makeCalcdata=function(b,x){var _=b[x],A=b._length,f,k,w=function(p){return o.d2c(p,b.thetaunit)};if(_)for(f=new Array(A),k=0;k{Y.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),xA=Fe((te,Y)=>{var d=ji(),y=Cg().tester,z=d.findIndexOfMin,P=d.isAngleInsideSector,i=d.angleDelta,n=d.angleDist;function a(k,w,D,E,I){if(!P(w,E))return!1;var M,p;D[0]0?p:1/0},E=z(w,D),I=d.mod(E+1,w.length);return[w[E],w[I]]}function x(k){return Math.abs(k)>1e-10?k:0}function _(k,w,D){w=w||0,D=D||0;for(var E=k.length,I=new Array(E),M=0;M{function d(a){return a<0?-1:a>0?1:0}function y(a){var l=a[0],o=a[1];if(!isFinite(l)||!isFinite(o))return[1,0];var u=(l+1)*(l+1)+o*o;return[(l*l+o*o-1)/u,2*o/u]}function z(a,l){var o=l[0],u=l[1];return[o*a.radius+a.cx,-u*a.radius+a.cy]}function P(a,l){return l*a.radius}function i(a,l,o,u){var s=z(a,y([o,l])),h=s[0],m=s[1],b=z(a,y([u,l])),x=b[0],_=b[1];if(l===0)return["M"+h+","+m,"L"+x+","+_].join(" ");var A=P(a,1/Math.abs(l));return["M"+h+","+m,"A"+A+","+A+" 0 0,"+(l<0?1:0)+" "+x+","+_].join(" ")}function n(a,l,o,u){var s=P(a,1/(l+1)),h=z(a,y([l,o])),m=h[0],b=h[1],x=z(a,y([l,u])),_=x[0],A=x[1];if(d(o)!==d(u)){var f=z(a,y([l,0])),k=f[0],w=f[1];return["M"+m+","+b,"A"+s+","+s+" 0 0,"+(0{var d=ii(),y=sn(),z=as(),P=ji(),i=P.strRotate,n=P.strTranslate,a=Xi(),l=Zs(),o=sh(),u=Os(),s=Z0(),h=Bz(),m=Xm().doAutoRange,b=C_(),x=Np(),_=hf(),A=Fp(),f=Mf().prepSelect,k=Mf().selectOnClick,w=Mf().clearOutline,D=Em(),E=J1(),I=pm().redrawReglTraces,M=Bf().MID_SHIFT,p=_A(),g=xA(),C=Rz(),T=C.smith,N=C.reactanceArc,B=C.resistanceArc,U=C.smithTransform,V=P._,W=P.mod,F=P.deg2rad,$=P.rad2deg;function q(ce,re,ge){this.isSmith=ge||!1,this.id=re,this.gd=ce,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var ne=ce._fullLayout,se="clip"+ne._uid+re;this.clipIds.forTraces=se+"-for-traces",this.clipPaths.forTraces=ne._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=ne["_"+(ge?"smith":"polar")+"layer"].append("g").attr("class",re),this.getHole=function(_e){return this.isSmith?0:_e.hole},this.getSector=function(_e){return this.isSmith?[0,360]:_e.sector},this.getRadial=function(_e){return this.isSmith?_e.realaxis:_e.radialaxis},this.getAngular=function(_e){return this.isSmith?_e.imaginaryaxis:_e.angularaxis},ge||(this.radialTickLayout=null,this.angularTickLayout=null)}var G=q.prototype;Y.exports=function(ce,re,ge){return new q(ce,re,ge)},G.plot=function(ce,re){for(var ge=this,ne=re[ge.id],se=!1,_e=0;_e_t?(pt=fe,gt=fe*_t,ze=(Ce-gt)/se.h/2,ct=[J[0],J[1]],Ae=[me[0]+ze,me[1]-ze]):(pt=Ce/_t,gt=Ce,ze=(fe-pt)/se.w/2,ct=[J[0]+ze,J[1]-ze],Ae=[me[0],me[1]]),ge.xLength2=pt,ge.yLength2=gt,ge.xDomain2=ct,ge.yDomain2=Ae;var Ee=ge.xOffset2=se.l+se.w*ct[0],nt=ge.yOffset2=se.t+se.h*(1-Ae[1]),xt=ge.radius=pt/Ze,ut=ge.innerRadius=ge.getHole(re)*xt,Et=ge.cx=Ee-xt*Oe[0],Gt=ge.cy=nt+xt*Oe[3],Jt=ge.cxx=Et-Ee,gr=ge.cyy=Gt-nt,mr=_e.side,Kr;mr==="counterclockwise"?(Kr=mr,mr="top"):mr==="clockwise"&&(Kr=mr,mr="bottom"),ge.radialAxis=ge.mockAxis(ce,re,_e,{_id:"x",side:mr,_trueSide:Kr,domain:[ut/se.w,xt/se.w]}),ge.angularAxis=ge.mockAxis(ce,re,oe,{side:"right",domain:[0,Math.PI],autorange:!1}),ge.doAutoRange(ce,re),ge.updateAngularAxis(ce,re),ge.updateRadialAxis(ce,re),ge.updateRadialAxisTitle(ce,re),ge.xaxis=ge.mockCartesianAxis(ce,re,{_id:"x",domain:ct}),ge.yaxis=ge.mockCartesianAxis(ce,re,{_id:"y",domain:Ae});var ri=ge.pathSubplot();ge.clipPaths.forTraces.select("path").attr("d",ri).attr("transform",n(Jt,gr)),ne.frontplot.attr("transform",n(Ee,nt)).call(l.setClipUrl,ge._hasClipOnAxisFalse?null:ge.clipIds.forTraces,ge.gd),ne.bg.attr("d",ri).attr("transform",n(Et,Gt)).call(a.fill,re.bgcolor)},G.mockAxis=function(ce,re,ge,ne){var se=P.extendFlat({},ge,ne);return h(se,re,ce),se},G.mockCartesianAxis=function(ce,re,ge){var ne=this,se=ne.isSmith,_e=ge._id,oe=P.extendFlat({type:"linear"},ge);s(oe,ce);var J={x:[0,2],y:[1,3]};return oe.setRange=function(){var me=ne.sectorBBox,fe=J[_e],Ce=ne.radialAxis._rl,Be=(Ce[1]-Ce[0])/(1-ne.getHole(re));oe.range=[me[fe[0]]*Be,me[fe[1]]*Be]},oe.isPtWithinRange=_e==="x"&&!se?function(me){return ne.isPtInside(me)}:function(){return!0},oe.setRange(),oe.setScale(),oe},G.doAutoRange=function(ce,re){var ge=this,ne=ge.gd,se=ge.radialAxis,_e=ge.getRadial(re);m(ne,se);var oe=se.range;if(_e.range=oe.slice(),_e._input.range=oe.slice(),se._rl=[se.r2l(oe[0],null,"gregorian"),se.r2l(oe[1],null,"gregorian")],se.minallowed!==void 0){var J=se.r2l(se.minallowed);se._rl[0]>se._rl[1]?se._rl[1]=Math.max(se._rl[1],J):se._rl[0]=Math.max(se._rl[0],J)}if(se.maxallowed!==void 0){var me=se.r2l(se.maxallowed);se._rl[0]90&&Ce<=270&&(Be.tickangle=180);var Ge=Ze?function(xt){var ut=U(ge,T([xt.x,0]));return n(ut[0]-J,ut[1]-me)}:function(xt){return n(Be.l2p(xt.x)+oe,0)},rt=Ze?function(xt){return B(ge,xt.x,-1/0,1/0)}:function(xt){return ge.pathArc(Be.r2p(xt.x)+oe)},_t=ee(fe);if(ge.radialTickLayout!==_t&&(se["radial-axis"].selectAll(".xtick").remove(),ge.radialTickLayout=_t),Oe){Be.setScale();var pt=0,gt=Ze?(Be.tickvals||[]).filter(function(xt){return xt>=0}).map(function(xt){return u.tickText(Be,xt,!0,!1)}):u.calcTicks(Be),ct=Ze?gt:u.clipEnds(Be,gt),Ae=u.getTickSigns(Be)[2];Ze&&((Be.ticks==="top"&&Be.side==="bottom"||Be.ticks==="bottom"&&Be.side==="top")&&(Ae=-Ae),Be.ticks==="top"&&Be.side==="top"&&(pt=-Be.ticklen),Be.ticks==="bottom"&&Be.side==="bottom"&&(pt=Be.ticklen)),u.drawTicks(ne,Be,{vals:gt,layer:se["radial-axis"],path:u.makeTickPath(Be,0,Ae),transFn:Ge,crisp:!1}),u.drawGrid(ne,Be,{vals:ct,layer:se["radial-grid"],path:rt,transFn:P.noop,crisp:!1}),u.drawLabels(ne,Be,{vals:gt,layer:se["radial-axis"],transFn:Ge,labelFns:u.makeLabelFns(Be,pt)})}var ze=ge.radialAxisAngle=ge.vangles?$(xe(F(fe.angle),ge.vangles)):fe.angle,Ee=n(J,me),nt=Ee+i(-ze);ve(se["radial-axis"],Oe&&(fe.showticklabels||fe.ticks),{transform:nt}),ve(se["radial-grid"],Oe&&fe.showgrid,{transform:Ze?"":Ee}),ve(se["radial-line"].select("line"),Oe&&fe.showline,{x1:Ze?-_e:oe,y1:0,x2:_e,y2:0,transform:nt}).attr("stroke-width",fe.linewidth).call(a.stroke,fe.linecolor)},G.updateRadialAxisTitle=function(ce,re,ge){if(!this.isSmith){var ne=this,se=ne.gd,_e=ne.radius,oe=ne.cx,J=ne.cy,me=ne.getRadial(re),fe=ne.id+"title",Ce=0;if(me.title){var Be=l.bBox(ne.layers["radial-axis"].node()).height,Oe=me.title.font.size,Ze=me.side;Ce=Ze==="top"?Oe:Ze==="counterclockwise"?-(Be+Oe*.4):Be+Oe*.8}var Ge=ge!==void 0?ge:ne.radialAxisAngle,rt=F(Ge),_t=Math.cos(rt),pt=Math.sin(rt),gt=oe+_e/2*_t+Ce*pt,ct=J-_e/2*pt+Ce*_t;ne.layers["radial-axis-title"]=A.draw(se,fe,{propContainer:me,propName:ne.id+".radialaxis.title.text",placeholder:V(se,"Click to enter radial axis title"),attributes:{x:gt,y:ct,"text-anchor":"middle"},transform:{rotate:-Ge}})}},G.updateAngularAxis=function(ce,re){var ge=this,ne=ge.gd,se=ge.layers,_e=ge.radius,oe=ge.innerRadius,J=ge.cx,me=ge.cy,fe=ge.getAngular(re),Ce=ge.angularAxis,Be=ge.isSmith;Be||(ge.fillViewInitialKey("angularaxis.rotation",fe.rotation),Ce.setGeometry(),Ce.setScale());var Oe=Be?function(ut){var Et=U(ge,T([0,ut.x]));return Math.atan2(Et[0]-J,Et[1]-me)-Math.PI/2}:function(ut){return Ce.t2g(ut.x)};Ce.type==="linear"&&Ce.thetaunit==="radians"&&(Ce.tick0=$(Ce.tick0),Ce.dtick=$(Ce.dtick));var Ze=function(ut){return n(J+_e*Math.cos(ut),me-_e*Math.sin(ut))},Ge=Be?function(ut){var Et=U(ge,T([0,ut.x]));return n(Et[0],Et[1])}:function(ut){return Ze(Oe(ut))},rt=Be?function(ut){var Et=U(ge,T([0,ut.x])),Gt=Math.atan2(Et[0]-J,Et[1]-me)-Math.PI/2;return n(Et[0],Et[1])+i(-$(Gt))}:function(ut){var Et=Oe(ut);return Ze(Et)+i(-$(Et))},_t=Be?function(ut){return N(ge,ut.x,0,1/0)}:function(ut){var Et=Oe(ut),Gt=Math.cos(Et),Jt=Math.sin(Et);return"M"+[J+oe*Gt,me-oe*Jt]+"L"+[J+_e*Gt,me-_e*Jt]},pt=u.makeLabelFns(Ce,0),gt=pt.labelStandoff,ct={};ct.xFn=function(ut){var Et=Oe(ut);return Math.cos(Et)*gt},ct.yFn=function(ut){var Et=Oe(ut),Gt=Math.sin(Et)>0?.2:1;return-Math.sin(Et)*(gt+ut.fontSize*Gt)+Math.abs(Math.cos(Et))*(ut.fontSize*M)},ct.anchorFn=function(ut){var Et=Oe(ut),Gt=Math.cos(Et);return Math.abs(Gt)<.1?"middle":Gt>0?"start":"end"},ct.heightFn=function(ut,Et,Gt){var Jt=Oe(ut);return-.5*(1+Math.sin(Jt))*Gt};var Ae=ee(fe);ge.angularTickLayout!==Ae&&(se["angular-axis"].selectAll("."+Ce._id+"tick").remove(),ge.angularTickLayout=Ae);var ze=Be?[1/0].concat(Ce.tickvals||[]).map(function(ut){return u.tickText(Ce,ut,!0,!1)}):u.calcTicks(Ce);Be&&(ze[0].text="∞",ze[0].fontSize*=1.75);var Ee;if(re.gridshape==="linear"?(Ee=ze.map(Oe),P.angleDelta(Ee[0],Ee[1])<0&&(Ee=Ee.slice().reverse())):Ee=null,ge.vangles=Ee,Ce.type==="category"&&(ze=ze.filter(function(ut){return P.isAngleInsideSector(Oe(ut),ge.sectorInRad)})),Ce.visible){var nt=Ce.ticks==="inside"?-1:1,xt=(Ce.linewidth||1)/2;u.drawTicks(ne,Ce,{vals:ze,layer:se["angular-axis"],path:"M"+nt*xt+",0h"+nt*Ce.ticklen,transFn:rt,crisp:!1}),u.drawGrid(ne,Ce,{vals:ze,layer:se["angular-grid"],path:_t,transFn:P.noop,crisp:!1}),u.drawLabels(ne,Ce,{vals:ze,layer:se["angular-axis"],repositionOnUpdate:!0,transFn:Ge,labelFns:ct})}ve(se["angular-line"].select("path"),fe.showline,{d:ge.pathSubplot(),transform:n(J,me)}).attr("stroke-width",fe.linewidth).call(a.stroke,fe.linecolor)},G.updateFx=function(ce,re){if(!this.gd._context.staticPlot){var ge=!this.isSmith;ge&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,re,0),this.updateRadialDrag(ce,re,1)),this.updateHoverAndMainDrag(ce)}},G.updateHoverAndMainDrag=function(ce){var re=this,ge=re.isSmith,ne=re.gd,se=re.layers,_e=ce._zoomlayer,oe=p.MINZOOM,J=p.OFFEDGE,me=re.radius,fe=re.innerRadius,Ce=re.cx,Be=re.cy,Oe=re.cxx,Ze=re.cyy,Ge=re.sectorInRad,rt=re.vangles,_t=re.radialAxis,pt=g.clampTiny,gt=g.findXYatLength,ct=g.findEnclosingVertexAngles,Ae=p.cornerHalfWidth,ze=p.cornerLen/2,Ee,nt,xt=b.makeDragger(se,"path","maindrag",ce.dragmode===!1?"none":"crosshair");d.select(xt).attr("d",re.pathSubplot()).attr("transform",n(Ce,Be)),xt.onmousemove=function(Dr){_.hover(ne,Dr,re.id),ne._fullLayout._lasthover=xt,ne._fullLayout._hoversubplot=re.id},xt.onmouseout=function(Dr){ne._dragging||x.unhover(ne,Dr)};var ut={element:xt,gd:ne,subplot:re.id,plotinfo:{id:re.id,xaxis:re.xaxis,yaxis:re.yaxis},xaxes:[re.xaxis],yaxes:[re.yaxis]},Et,Gt,Jt,gr,mr,Kr,ri,Mr,ui;function mi(Dr,br){return Math.sqrt(Dr*Dr+br*br)}function Ot(Dr,br){return mi(Dr-Oe,br-Ze)}function Je(Dr,br){return Math.atan2(Ze-br,Dr-Oe)}function ot(Dr,br){return[Dr*Math.cos(br),Dr*Math.sin(-br)]}function De(Dr,br){if(Dr===0)return re.pathSector(2*Ae);var hi=ze/Dr,un=br-hi,cn=br+hi,yn=Math.max(0,Math.min(Dr,me)),Wn=yn-Ae,Sn=yn+Ae;return"M"+ot(Wn,un)+"A"+[Wn,Wn]+" 0,0,0 "+ot(Wn,cn)+"L"+ot(Sn,cn)+"A"+[Sn,Sn]+" 0,0,1 "+ot(Sn,un)+"Z"}function ye(Dr,br,hi){if(Dr===0)return re.pathSector(2*Ae);var un=ot(Dr,br),cn=ot(Dr,hi),yn=pt((un[0]+cn[0])/2),Wn=pt((un[1]+cn[1])/2),Sn,fn;if(yn&&Wn){var ga=Wn/yn,na=-1/ga,Zt=gt(Ae,ga,yn,Wn);Sn=gt(ze,na,Zt[0][0],Zt[0][1]),fn=gt(ze,na,Zt[1][0],Zt[1][1])}else{var sr,_r;Wn?(sr=ze,_r=Ae):(sr=Ae,_r=ze),Sn=[[yn-sr,Wn-_r],[yn+sr,Wn-_r]],fn=[[yn-sr,Wn+_r],[yn+sr,Wn+_r]]}return"M"+Sn.join("L")+"L"+fn.reverse().join("L")+"Z"}function Pe(){Jt=null,gr=null,mr=re.pathSubplot(),Kr=!1;var Dr=ne._fullLayout[re.id];ri=y(Dr.bgcolor).getLuminance(),Mr=b.makeZoombox(_e,ri,Ce,Be,mr),Mr.attr("fill-rule","evenodd"),ui=b.makeCorners(_e,Ce,Be),w(ne)}function He(Dr,br){return br=Math.max(Math.min(br,me),fe),Droe?(Dr-1&&Dr===1&&k(br,ne,[re.xaxis],[re.yaxis],re.id,ut),hi.indexOf("event")>-1&&_.click(ne,br,re.id)}ut.prepFn=function(Dr,br,hi){var un=ne._fullLayout.dragmode,cn=xt.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var yn=ne._fullLayout._invTransform;Ee=ne._fullLayout._invScaleX,nt=ne._fullLayout._invScaleY;var Wn=P.apply3DTransform(yn)(br-cn.left,hi-cn.top);if(Et=Wn[0],Gt=Wn[1],rt){var Sn=g.findPolygonOffset(me,Ge[0],Ge[1],rt);Et+=Oe+Sn[0],Gt+=Ze+Sn[1]}switch(un){case"zoom":ut.clickFn=zr,ge||(rt?ut.moveFn=Wt:ut.moveFn=ht,ut.doneFn=Kt,Pe());break;case"select":case"lasso":f(Dr,br,hi,ut,un);break}},x.init(ut)},G.updateRadialDrag=function(ce,re,ge){var ne=this,se=ne.gd,_e=ne.layers,oe=ne.radius,J=ne.innerRadius,me=ne.cx,fe=ne.cy,Ce=ne.radialAxis,Be=p.radialDragBoxSize,Oe=Be/2;if(!Ce.visible)return;var Ze=F(ne.radialAxisAngle),Ge=Ce._rl,rt=Ge[0],_t=Ge[1],pt=Ge[ge],gt=.75*(Ge[1]-Ge[0])/(1-ne.getHole(re))/oe,ct,Ae,ze;ge?(ct=me+(oe+Oe)*Math.cos(Ze),Ae=fe-(oe+Oe)*Math.sin(Ze),ze="radialdrag"):(ct=me+(J-Oe)*Math.cos(Ze),Ae=fe-(J-Oe)*Math.sin(Ze),ze="radialdrag-inner");var Ee=b.makeRectDragger(_e,ze,"crosshair",-Oe,-Oe,Be,Be),nt={element:Ee,gd:se};ce.dragmode===!1&&(nt.dragmode=!1),ve(d.select(Ee),Ce.visible&&J0!=(ge?Et>rt:Et<_t)){Et=null;return}var mi=se._fullLayout,Ot=mi[ne.id];Ce.range[ge]=Et,Ce._rl[ge]=Et,ne.updateRadialAxis(mi,Ot),ne.xaxis.setRange(),ne.xaxis.setScale(),ne.yaxis.setRange(),ne.yaxis.setScale();var Je=!1;for(var ot in ne.traceHash){var De=ne.traceHash[ot],ye=P.filterVisible(De),Pe=De[0][0].trace._module;Pe.plot(se,ne,ye,Ot),z.traceIs(ot,"gl")&&ye.length&&(Je=!0)}Je&&(E(se),I(se))}nt.prepFn=function(){xt=null,ut=null,Et=null,nt.moveFn=Gt,nt.doneFn=gr,w(se)},nt.clampFn=function(ri,Mr){return Math.sqrt(ri*ri+Mr*Mr)=90||se>90&&_e>=450?Ze=1:J<=0&&fe<=0?Ze=0:Ze=Math.max(J,fe),se<=180&&_e>=180||se>180&&_e>=540?Ce=-1:oe>=0&&me>=0?Ce=0:Ce=Math.min(oe,me),se<=270&&_e>=270||se>270&&_e>=630?Be=-1:J>=0&&fe>=0?Be=0:Be=Math.min(J,fe),_e>=360?Oe=1:oe<=0&&me<=0?Oe=0:Oe=Math.max(oe,me),[Ce,Be,Oe,Ze]}function xe(ce,re){var ge=function(se){return P.angleDist(ce,se)},ne=P.findIndexOfMin(re,ge);return re[ne]}function ve(ce,re,ge){return re?(ce.attr("display",null),ce.attr(ge)):ce&&ce.attr("display","none"),ce}}),Nz=Fe((te,Y)=>{var d=Mi(),y=qd(),z=Xh().attributes,P=ji().extendFlat,i=oh().overrideAll,n=i({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=i({tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,ticklabelstep:y.ticklabelstep,showticklabels:y.showticklabels,labelalias:y.labelalias,minorloglabels:y.minorloglabels,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickfont:y.tickfont,tickangle:y.tickangle,tickformat:y.tickformat,tickformatstops:y.tickformatstops,layer:y.layer},"plot","from-root"),l={visible:P({},y.visible,{dflt:!0}),type:P({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},autorange:P({},y.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:P({},y.minallowed,{editType:"plot"}),maxallowed:P({},y.maxallowed,{editType:"plot"}),range:P({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:y.categoryorder,categoryarray:y.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:y.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:P({},y.title.text,{editType:"plot",dflt:""}),font:P({},y.title.font,{editType:"plot"}),editType:"plot"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(l,n,a);var o={visible:P({},y.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:y.autotypenumbers,categoryorder:y.categoryorder,categoryarray:y.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(o,n,a),Y.exports={domain:z({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:l,angularaxis:o,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),Zte=Fe((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=L_(),i=Md().getSubplotData,n=jv(),a=Uv(),l=G0(),o=Tg(),u=Qg(),s=hb(),h=w4(),m=Y1(),b=Nz(),x=Bz(),_=_A(),A=_.axisNames;function f(w,D,E,I){var M=E("bgcolor");I.bgColor=y.combine(M,I.paper_bgcolor);var p=E("sector");E("hole");var g=i(I.fullData,_.name,I.id),C=I.layoutOut,T;function N(Be,Oe){return E(T+"."+Be,Oe)}for(var B=0;B{var d=Md().getSubplotCalcData,y=ji().counterRegex,z=Fz(),P=_A(),i=P.attr,n=P.name,a=y(n),l={};l[i]={valType:"subplotid",dflt:n,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[n],x=0;x{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=an().extendFlat,i=Lm(),n=ff(),a=_a(),l=n.line;Y.exports={mode:n.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:n.text,texttemplate:y({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,cliponaxis:P({},n.cliponaxis,{dflt:!1}),textposition:n.textposition,textfont:n.textfont,fill:P({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),hoverinfo:P({},a.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:n.hoveron,hovertemplate:d(),hovertemplatefallback:z(),selected:n.selected,unselected:n.unselected}}),wA=Fe((te,Y)=>{var d=ji(),y=Oc(),z=X0(),P=Pm(),i=ry(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=z6();function u(h,m,b,x){function _(k,w){return d.coerce(h,m,o,k,w)}var A=s(h,m,x,_);if(!A){m.visible=!1;return}_("thetaunit"),_("mode",A{var d=ji(),y=Os();Y.exports=function(z,P,i){var n={},a=i[P.subplot]._subplot,l,o;a?(l=a.radialAxis,o=a.angularAxis):(a=i[P.subplot],l=a.radialaxis,o=a.angularaxis);var u=l.c2l(z.r);n.rLabel=y.tickText(l,u,!0).text;var s=o.thetaunit==="degrees"?d.rad2deg(z.theta):z.theta;return n.thetaLabel=y.tickText(o,s,!0).text,n}}),Kte=Fe((te,Y)=>{var d=Ar(),y=ti().BADNUM,z=Os(),P=zm(),i=de(),n=$e(),a=yt().calcMarkerSize;Y.exports=function(l,o){for(var u=l._fullLayout,s=o.subplot,h=u[s].radialaxis,m=u[s].angularaxis,b=h.makeCalcdata(o,"r"),x=m.makeCalcdata(o,"theta"),_=o._length,A=new Array(_),f=0;f<_;f++){var k=b[f],w=x[f],D=A[f]={};d(k)&&d(w)?(D.r=k,D.theta=w):D.r=y}var E=a(o,_);return o._extremes.x=z.findExtremes(h,b,{ppad:E}),P(l,o),i(A,o),n(A,o),A}}),Yte=Fe((te,Y)=>{var d=uo(),y=ti().BADNUM;Y.exports=function(z,P,i){for(var n=P.layers.frontplot.select("g.scatterlayer"),a=P.xaxis,l=P.yaxis,o={xaxis:a,yaxis:l,plot:P.framework,layerClipId:P._hasClipOnAxisFalse?P.clipIds.forTraces:null},u=P.radialAxis,s=P.angularAxis,h=0;h{var d=Zd();function y(P,i,n,a){var l=d(P,i,n,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var u=P.subplot,s=o.cd[o.index],h=o.trace;if(u.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,u,o),o.hovertemplate=h.hovertemplate,l}}function z(P,i,n,a){var l=n.radialAxis,o=n.angularAxis;l._hovertitle="r",o._hovertitle="θ";var u={};u[i.subplot]={_subplot:n};var s=i._module.formatLabels(P,i,u);a.rLabel=s.rLabel,a.thetaLabel=s.thetaLabel;var h=P.hi||i.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!i.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["r","theta","text"]),x.indexOf("r")!==-1&&b(l,a.rLabel),x.indexOf("theta")!==-1&&b(o,a.thetaLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),Xte=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:bA(),categories:["polar","symbols","showLegend","scatter-like"],attributes:z6(),supplyDefaults:wA().supplyDefaults,colorbar:Mo(),formatLabels:kA(),calc:Kte(),plot:Yte(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:TA().hoverPoints,selectPoints:Jf(),meta:{}}}),Jte=Fe((te,Y)=>{Y.exports=Xte()}),jz=Fe((te,Y)=>{var d=z6(),{cliponaxis:y,hoveron:z}=d,P=rr(d,["cliponaxis","hoveron"]),{connectgaps:i,line:{color:n,dash:a,width:l},fill:o,fillcolor:u,marker:s,textfont:h,textposition:m}=S6();Y.exports=Dt(kt({},P),{connectgaps:i,fill:o,fillcolor:u,line:{color:n,dash:a,editType:"calc",width:l},marker:s,textfont:h,textposition:m})}),Qte=Fe((te,Y)=>{var d=ji(),y=Oc(),z=wA().handleRThetaDefaults,P=X0(),i=Pm(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=jz();Y.exports=function(u,s,h,m){function b(_,A){return d.coerce(u,s,o,_,A)}var x=z(u,s,m,b);if(!x){s.visible=!1;return}b("thetaunit"),b("mode",x{var d=kA();Y.exports=function(y,z,P){var i=y.i;return"r"in y||(y.r=z._r[i]),"theta"in y||(y.theta=z._theta[i]),d(y,z,P)}}),tre=Fe((te,Y)=>{var d=zm(),y=yt().calcMarkerSize,z=Ib(),P=Os(),i=$_().TOO_MANY_POINTS;Y.exports=function(n,a){var l=n._fullLayout,o=a.subplot,u=l[o].radialaxis,s=l[o].angularaxis,h=a._r=u.makeCalcdata(a,"r"),m=a._theta=s.makeCalcdata(a,"theta"),b=a._length,x={};b{var d=JC(),y=TA().makeHoverPointText;function z(P,i,n,a){var l=P.cd,o=l[0].t,u=o.r,s=o.theta,h=d.hoverPoints(P,i,n,a);if(!(!h||h[0].index===!1)){var m=h[0];if(m.index===void 0)return h;var b=P.subplot,x=m.cd[m.index],_=m.trace;if(x.r=u[m.index],x.theta=s[m.index],!!b.isPtInside(x))return m.xLabelVal=void 0,m.yLabelVal=void 0,y(x,_,b,m),h}}Y.exports={hoverPoints:z}}),ire=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:bA(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:jz(),supplyDefaults:Qte(),colorbar:Mo(),formatLabels:ere(),calc:tre(),hoverPoints:rre().hoverPoints,selectPoints:bD(),meta:{}}}),nre=Fe((te,Y)=>{var d=eA(),y=Ar(),z=WD(),P=_D(),i=Ib(),n=ji(),a=$_().TOO_MANY_POINTS,l={};Y.exports=function(o,u,s){if(s.length){var h=u.radialAxis,m=u.angularAxis,b=P(o,u);return s.forEach(function(x){if(!(!x||!x[0]||!x[0].trace)){var _=x[0],A=_.trace,f=_.t,k=A._length,w=f.r,D=f.theta,E=f.opts,I,M=w.slice(),p=D.slice();for(I=0;I=a&&(E.marker.cluster=f.tree),E.marker&&(E.markerSel.positions=E.markerUnsel.positions=E.marker.positions=g),E.line&&g.length>1&&n.extendFlat(E.line,i.linePositions(o,A,g)),E.text&&(n.extendFlat(E.text,{positions:g},i.textPosition(o,A,E.text,E.marker)),n.extendFlat(E.textSel,{positions:g},i.textPosition(o,A,E.text,E.markerSel)),n.extendFlat(E.textUnsel,{positions:g},i.textPosition(o,A,E.text,E.markerUnsel))),E.fill&&!b.fill2d&&(b.fill2d=!0),E.marker&&!b.scatter2d&&(b.scatter2d=!0),E.line&&!b.line2d&&(b.line2d=!0),E.text&&!b.glText&&(b.glText=!0),b.lineOptions.push(E.line),b.fillOptions.push(E.fill),b.markerOptions.push(E.marker),b.markerSelectedOptions.push(E.markerSel),b.markerUnselectedOptions.push(E.markerUnsel),b.textOptions.push(E.text),b.textSelectedOptions.push(E.textSel),b.textUnselectedOptions.push(E.textUnsel),b.selectBatch.push([]),b.unselectBatch.push([]),f.x=C,f.y=T,f.rawx=C,f.rawy=T,f.r=w,f.theta=D,f.positions=g,f._scene=b,f.index=b.count,b.count++}}),z(o,u,s)}},Y.exports.reglPrecompiled=l}),are=Fe((te,Y)=>{var d=ire();d.plot=nre(),Y.exports=d}),ore=Fe((te,Y)=>{Y.exports=are()}),Uz=Fe((te,Y)=>{var{hovertemplateAttrs:d,templatefallbackAttrs:y}=rc(),z=an().extendFlat,P=z6(),i=Jv();Y.exports={r:P.r,theta:P.theta,r0:P.r0,dr:P.dr,theta0:P.theta0,dtheta:P.dtheta,thetaunit:P.thetaunit,base:z({},i.base,{}),offset:z({},i.offset,{}),width:z({},i.width,{}),text:z({},i.text,{}),hovertext:z({},i.hovertext,{}),marker:n(),hoverinfo:P.hoverinfo,hovertemplate:d(),hovertemplatefallback:y(),selected:i.selected,unselected:i.unselected};function n(){var a=z({},i.marker);return delete a.cornerradius,a}}),$z=Fe((te,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),sre=Fe((te,Y)=>{var d=ji(),y=wA().handleRThetaDefaults,z=C8(),P=Uz();Y.exports=function(i,n,a,l){function o(s,h){return d.coerce(i,n,P,s,h)}var u=y(i,n,l,o);if(!u){n.visible=!1;return}o("thetaunit"),o("base"),o("offset"),o("width"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),z(i,n,o,a,l),d.coerceSelectionMarkerOpacity(n,o)}}),lre=Fe((te,Y)=>{var d=ji(),y=$z();Y.exports=function(z,P,i){var n={},a;function l(s,h){return d.coerce(z[a]||{},P[a],y,s,h)}for(var o=0;o{var d=cp().hasColorscale,y=kp(),z=ji().isArrayOrTypedArray,P=H4(),i=jr().setGroupPositions,n=$e(),a=as().traceIs,l=ji().extendFlat;function o(s,h){for(var m=s._fullLayout,b=h.subplot,x=m[b].radialaxis,_=m[b].angularaxis,A=x.makeCalcdata(h,"r"),f=_.makeCalcdata(h,"theta"),k=h._length,w=new Array(k),D=A,E=f,I=0;I{var d=ii(),y=Ar(),z=ji(),P=Zs(),i=xA();Y.exports=function(a,l,o){var u=a._context.staticPlot,s=l.xaxis,h=l.yaxis,m=l.radialAxis,b=l.angularAxis,x=n(l),_=l.layers.frontplot.select("g.barlayer");z.makeTraceGroups(_,o,"trace bars").each(function(){var A=d.select(this),f=z.ensureSingle(A,"g","points"),k=f.selectAll("g.point").data(z.identity);k.enter().append("g").style("vector-effect",u?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),k.exit().remove(),k.each(function(w){var D=d.select(this),E=w.rp0=m.c2p(w.s0),I=w.rp1=m.c2p(w.s1),M=w.thetag0=b.c2g(w.p0),p=w.thetag1=b.c2g(w.p1),g;if(!y(E)||!y(I)||!y(M)||!y(p)||E===I||M===p)g="M0,0Z";else{var C=m.c2g(w.s1),T=(M+p)/2;w.ct=[s.c2p(C*Math.cos(T)),h.c2p(C*Math.sin(T))],g=x(E,I,M,p)}z.ensureSingle(D,"path").attr("d",g)}),P.setClipUrl(A,l._hasClipOnAxisFalse?l.clipIds.forTraces:null,a)})};function n(a){var l=a.cxx,o=a.cyy;return a.vangles?function(u,s,h,m){var b,x;z.angleDelta(h,m)>0?(b=h,x=m):(b=m,x=h);var _=i.findEnclosingVertexAngles(b,a.vangles)[0],A=i.findEnclosingVertexAngles(x,a.vangles)[1],f=[_,(b+x)/2,A];return i.pathPolygonAnnulus(u,s,b,x,f,l,o)}:function(u,s,h,m){return z.pathAnnulus(u,s,h,m,l,o)}}}),cre=Fe((te,Y)=>{var d=hf(),y=ji(),z=Aw().getTraceColor,P=y.fillText,i=TA().makeHoverPointText,n=xA().isPtInsidePolygon;Y.exports=function(a,l,o){var u=a.cd,s=u[0].trace,h=a.subplot,m=h.radialAxis,b=h.angularAxis,x=h.vangles,_=x?n:y.isPtInsideSector,A=a.maxHoverDistance,f=b._period||2*Math.PI,k=Math.abs(m.g2p(Math.sqrt(l*l+o*o))),w=Math.atan2(o,l);m.range[0]>m.range[1]&&(w+=Math.PI);var D=function(p){return _(k,w,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?A+Math.min(1,Math.abs(p.thetag1-p.thetag0)/f)-1+(p.rp1-k)/(p.rp1-p.rp0)-1:1/0};if(d.getClosest(u,D,a),a.index!==!1){var E=a.index,I=u[E];a.x0=a.x1=I.ct[0],a.y0=a.y1=I.ct[1];var M=y.extendFlat({},I,{r:I.s,theta:I.p});return P(I,s,a),i(M,s,h,a),a.hovertemplate=s.hovertemplate,a.color=z(s,I),a.xLabelVal=a.yLabelVal=void 0,I.s<0&&(a.idealAlign="left"),[a]}}}),hre=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"barpolar",basePlotModule:bA(),categories:["polar","bar","showLegend"],attributes:Uz(),layoutAttributes:$z(),supplyDefaults:sre(),supplyLayoutDefaults:lre(),calc:Hz().calc,crossTraceCalc:Hz().crossTraceCalc,plot:ure(),colorbar:Mo(),formatLabels:kA(),style:Lg().style,styleOnSelect:Lg().styleOnSelect,hoverPoints:cre(),selectPoints:Mw(),meta:{}}}),fre=Fe((te,Y)=>{Y.exports=hre()}),Vz=Fe((te,Y)=>{Y.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),Wz=Fe((te,Y)=>{var d=Mi(),y=qd(),z=Xh().attributes,P=ji().extendFlat,i=oh().overrideAll,n=i({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=i({ticklen:y.ticklen,tickwidth:P({},y.tickwidth,{dflt:2}),tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,tickfont:y.tickfont,tickformat:y.tickformat,hoverformat:y.hoverformat,layer:y.layer},"plot","from-root"),l=P({visible:P({},y.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:P({},y.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},n,a),o=P({visible:P({},y.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:y.ticks,editType:"calc"},n,a);Y.exports={domain:z({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:l,imaginaryaxis:o,editType:"calc"}}),dre=Fe((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=L_(),i=Md().getSubplotData,n=Tg(),a=G0(),l=hb(),o=Z0(),u=Wz(),s=Vz(),h=s.axisNames,m=x(function(_){return d.isTypedArray(_)&&(_=Array.from(_)),_.slice().reverse().map(function(A){return-A}).concat([0]).concat(_)},String);function b(_,A,f,k){var w=f("bgcolor");k.bgColor=y.combine(w,k.paper_bgcolor);var D=i(k.fullData,s.name,k.id),E=k.layoutOut,I;function M(G,ee){return f(I+"."+G,ee)}for(var p=0;p{var d=Md().getSubplotCalcData,y=ji().counterRegex,z=Fz(),P=Vz(),i=P.attr,n=P.name,a=y(n),l={};l[i]={valType:"subplotid",dflt:n,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[n],x=0;x{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=an().extendFlat,i=Lm(),n=ff(),a=_a(),l=n.line;Y.exports={mode:n.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:n.text,texttemplate:y({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,cliponaxis:P({},n.cliponaxis,{dflt:!1}),textposition:n.textposition,textfont:n.textfont,fill:P({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),hoverinfo:P({},a.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:n.hoveron,hovertemplate:d(),hovertemplatefallback:z(),selected:n.selected,unselected:n.unselected}}),mre=Fe((te,Y)=>{var d=ji(),y=Oc(),z=X0(),P=Pm(),i=ry(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=qz();Y.exports=function(s,h,m,b){function x(f,k){return d.coerce(s,h,o,f,k)}var _=u(s,h,b,x);if(!_){h.visible=!1;return}x("mode",_{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot;return i.realLabel=d.tickText(n.radialAxis,y.real,!0).text,i.imagLabel=d.tickText(n.angularAxis,y.imag,!0).text,i}}),vre=Fe((te,Y)=>{var d=Ar(),y=ti().BADNUM,z=zm(),P=de(),i=$e(),n=yt().calcMarkerSize;Y.exports=function(a,l){for(var o=a._fullLayout,u=l.subplot,s=o[u].realaxis,h=o[u].imaginaryaxis,m=s.makeCalcdata(l,"real"),b=h.makeCalcdata(l,"imag"),x=l._length,_=new Array(x),A=0;A{var d=uo(),y=ti().BADNUM,z=Rz(),P=z.smith;Y.exports=function(i,n,a){for(var l=n.layers.frontplot.select("g.scatterlayer"),o=n.xaxis,u=n.yaxis,s={xaxis:o,yaxis:u,plot:n.framework,layerClipId:n._hasClipOnAxisFalse?n.clipIds.forTraces:null},h=0;h{var d=Zd();function y(P,i,n,a){var l=d(P,i,n,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var u=P.subplot,s=o.cd[o.index],h=o.trace;if(u.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,u,o),o.hovertemplate=h.hovertemplate,l}}function z(P,i,n,a){var l=n.radialAxis,o=n.angularAxis;l._hovertitle="real",o._hovertitle="imag";var u={};u[i.subplot]={_subplot:n};var s=i._module.formatLabels(P,i,u);a.realLabel=s.realLabel,a.imagLabel=s.imagLabel;var h=P.hi||i.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!i.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["real","imag","text"]),x.indexOf("real")!==-1&&b(l,a.realLabel),x.indexOf("imag")!==-1&&b(o,a.imagLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),xre=Fe((te,Y)=>{Y.exports={moduleType:"trace",name:"scattersmith",basePlotModule:pre(),categories:["smith","symbols","showLegend","scatter-like"],attributes:qz(),supplyDefaults:mre(),colorbar:Mo(),formatLabels:gre(),calc:vre(),plot:yre(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:_re().hoverPoints,selectPoints:Jf(),meta:{}}}),bre=Fe((te,Y)=>{Y.exports=xre()}),A0=Fe((te,Y)=>{var d=Kd();function y(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}d(y.prototype,{instance:function(l,o){l=(l||"gregorian").toLowerCase(),o=o||"";var u=this._localCals[l+"-"+o];if(!u&&this.calendars[l]&&(u=new this.calendars[l](o),this._localCals[l+"-"+o]=u),!u)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,l);return u},newDate:function(l,o,u,s,h){return s=(l!=null&&l.year?l.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(l,o,u)},substituteDigits:function(l){return function(o){return(o+"").replace(/[0-9]/g,function(u){return l[u]})}},substituteChineseDigits:function(l,o){return function(u){for(var s="",h=0;u>0;){var m=u%10;s=(m===0?"":l[m]+o[h])+s,h++,u=Math.floor(u/10)}return s.indexOf(l[1]+o[1])===0&&(s=s.substr(1)),s||l[0]}}});function z(l,o,u,s){if(this._calendar=l,this._year=o,this._month=u,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function P(l,o){return l=""+l,"000000".substring(0,o-l.length)+l}d(z.prototype,{newDate:function(l,o,u){return this._calendar.newDate(l??this,o,u)},year:function(l){return arguments.length===0?this._year:this.set(l,"y")},month:function(l){return arguments.length===0?this._month:this.set(l,"m")},day:function(l){return arguments.length===0?this._day:this.set(l,"d")},date:function(l,o,u){if(!this._calendar.isValid(l,o,u))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=l,this._month=o,this._day=u,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(l,o){return this._calendar.add(this,l,o)},set:function(l,o){return this._calendar.set(this,l,o)},compareTo:function(l){if(this._calendar.name!==l._calendar.name)throw(a.local.differentCalendars||a.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,l._calendar.local.name);var o=this._year!==l._year?this._year-l._year:this._month!==l._month?this.monthOfYear()-l.monthOfYear():this._day-l._day;return o===0?0:o<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(l){return this._calendar.fromJD(l)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(l){return this._calendar.fromJSDate(l)},toString:function(){return(this.year()<0?"-":"")+P(Math.abs(this.year()),4)+"-"+P(this.month(),2)+"-"+P(this.day(),2)}});function i(){this.shortYearCutoff="+10"}d(i.prototype,{_validateLevel:0,newDate:function(l,o,u){return l==null?this.today():(l.year&&(this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),u=l.day(),o=l.month(),l=l.year()),new z(this,l,o,u))},today:function(){return this.fromJSDate(new Date)},epoch:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return o.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return(o.year()<0?"-":"")+P(Math.abs(o.year()),4)},monthsInYear:function(l){return this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear),12},monthOfYear:function(l,o){var u=this._validate(l,o,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth);return(u.month()+this.monthsInYear(u)-this.firstMonth)%this.monthsInYear(u)+this.minMonth},fromMonthOfYear:function(l,o){var u=(o+this.firstMonth-2*this.minMonth)%this.monthsInYear(l)+this.minMonth;return this._validate(l,u,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth),u},daysInYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return this.leapYear(o)?366:365},dayOfYear:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(l,o,u){return this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),{}},add:function(l,o,u){return this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate),this._correctAdd(l,this._add(l,o,u),o,u)},_add:function(l,o,u){if(this._validateLevel++,u==="d"||u==="w"){var s=l.toJD()+o*(u==="w"?this.daysInWeek():1),h=l.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var m=l.year()+(u==="y"?o:0),b=l.monthOfYear()+(u==="m"?o:0),h=l.day(),x=function(f){for(;bk-1+f.minMonth;)m++,b-=k,k=f.monthsInYear(m)};u==="y"?(l.month()!==this.fromMonthOfYear(m,b)&&(b=this.newDate(m,l.month(),this.minDay).monthOfYear()),b=Math.min(b,this.monthsInYear(m)),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b)))):u==="m"&&(x(this),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b))));var _=[m,this.fromMonthOfYear(m,b),h];return this._validateLevel--,_}catch(A){throw this._validateLevel--,A}},_correctAdd:function(l,o,u,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(o[0]===0||l.year()>0!=o[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],m=u<0?-1:1;o=this._add(l,u*h[0]+m*h[1],h[2])}return l.date(o[0],o[1],o[2])},set:function(l,o,u){this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate);var s=u==="y"?o:l.year(),h=u==="m"?o:l.month(),m=u==="d"?o:l.day();return(u==="y"||u==="m")&&(m=Math.min(m,this.daysInMonth(s,h))),l.date(s,h,m)},isValid:function(l,o,u){this._validateLevel++;var s=this.hasYearZero||l!==0;if(s){var h=this.newDate(l,o,this.minDay);s=o>=this.minMonth&&o-this.minMonth=this.minDay&&u-this.minDay13.5?13:1),A=h-(_>2.5?4716:4715);return A<=0&&A--,this.newDate(A,_,x)},toJSDate:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(l){return this.newDate(l.getFullYear(),l.getMonth()+1,l.getDate())}});var a=Y.exports=new y;a.cdate=z,a.baseCalendar=i,a.calendars.gregorian=n}),wre=Fe(()=>{var te=Kd(),Y=A0();te(Y.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),Y.local=Y.regionalOptions[""],te(Y.cdate.prototype,{formatDate:function(d,y){return typeof d!="string"&&(y=d,d=""),this._calendar.formatDate(d||"",this,y)}}),te(Y.baseCalendar.prototype,{UNIX_EPOCH:Y.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:Y.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(d,y,z){if(typeof d!="string"&&(z=y,y=d,d=""),!y)return"";if(y.calendar()!==this)throw Y.local.invalidFormat||Y.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,z=z||{};for(var P=z.dayNamesShort||this.local.dayNamesShort,i=z.dayNames||this.local.dayNames,n=z.monthNumbers||this.local.monthNumbers,a=z.monthNamesShort||this.local.monthNamesShort,l=z.monthNames||this.local.monthNames,o=z.calculateWeek||this.local.calculateWeek,u=function(D,E){for(var I=1;w+I1},s=function(D,E,I,M){var p=""+E;if(u(D,M))for(;p.length1},k=function(N,B){var U=f(N,B),V=[2,3,U?4:2,U?4:2,10,11,20]["oyYJ@!".indexOf(N)+1],W=new RegExp("^-?\\d{1,"+V+"}"),F=y.substring(p).match(W);if(!F)throw(Y.local.missingNumberAt||Y.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=F[0].length,parseInt(F[0],10)},w=this,D=function(){if(typeof l=="function"){f("m");var N=l.call(w,y.substring(p));return p+=N.length,N}return k("m")},E=function(N,B,U,V){for(var W=f(N,V)?U:B,F=0;F-1){m=1,b=x;for(var T=this.daysInMonth(h,m);b>T;T=this.daysInMonth(h,m))m++,b-=T}return s>-1?this.fromJD(s):this.newDate(h,m,b)},determineDate:function(d,y,z,P,i){z&&typeof z!="object"&&(i=P,P=z,z=null),typeof P!="string"&&(i=P,P="");var n=this,a=function(l){try{return n.parseDate(P,l,i)}catch{}l=l.toLowerCase();for(var o=(l.match(/^c/)&&z?z.newDate():null)||n.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=u.exec(l);s;)o.add(parseInt(s[1],10),s[2]||"d"),s=u.exec(l);return o};return y=y?y.newDate():null,d=d==null?y:typeof d=="string"?a(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?y:n.today().add(d,"d"):n.newDate(d),d}})}),kre=Fe(()=>{var te=A0(),Y=Kd(),d=te.instance();function y(s){this.local=this.regionalOptions[s||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(s,h){if(typeof s=="string"){var m=s.match(P);return m?m[0]:""}var b=this._validateYear(s),x=s.month(),_=""+this.toChineseMonth(b,x);return h&&_.length<2&&(_="0"+_),this.isIntercalaryMonth(b,x)&&(_+="i"),_},monthNames:function(s){if(typeof s=="string"){var h=s.match(i);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},monthNamesShort:function(s){if(typeof s=="string"){var h=s.match(n);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一","二","三","四","五","六","七","八","九","十","十一","十二"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},parseMonth:function(s,h){s=this._validateYear(s);var m=parseInt(h),b;if(isNaN(m))h[0]==="闰"&&(b=!0,h=h.substring(1)),h[h.length-1]==="月"&&(h=h.substring(0,h.length-1)),m=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(h);else{var x=h[h.length-1];b=x==="i"||x==="I"}var _=this.toMonthIndex(s,m,b);return _},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(s,h){if(s.year&&(s=s.year()),typeof s!="number"||s<1888||s>2111)throw h.replace(/\{0\}/,this.local.name);return s},toMonthIndex:function(s,h,m){var b=this.intercalaryMonth(s),x=m&&h!==b;if(x||h<1||h>12)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var _;return b?!m&&h<=b?_=h-1:_=h:_=h-1,_},toChineseMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s),b=m?12:11;if(h<0||h>b)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var x;return m?h>13;return m},isIntercalaryMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s);return!!m&&m===h},leapYear:function(s){return this.intercalaryMonth(s)!==0},weekOfYear:function(s,h,m){var b=this._validateYear(s,te.local.invalidyear),x=l[b-l[0]],_=x>>9&4095,A=x>>5&15,f=x&31,k;k=d.newDate(_,A,f),k.add(4-(k.dayOfWeek()||7),"d");var w=this.toJD(s,h,m)-k.toJD();return 1+Math.floor(w/7)},monthsInYear:function(s){return this.leapYear(s)?13:12},daysInMonth:function(s,h){s.year&&(h=s.month(),s=s.year()),s=this._validateYear(s);var m=a[s-a[0]],b=m>>13,x=b?12:11;if(h>x)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var _=m&1<<12-h?30:29;return _},weekDay:function(s,h,m){return(this.dayOfWeek(s,h,m)||7)<6},toJD:function(s,h,m){var b=this._validate(s,_,m,te.local.invalidDate);s=this._validateYear(b.year()),h=b.month(),m=b.day();var x=this.isIntercalaryMonth(s,h),_=this.toChineseMonth(s,h),A=u(s,_,m,x);return d.toJD(A.year,A.month,A.day)},fromJD:function(s){var h=d.fromJD(s),m=o(h.year(),h.month(),h.day()),b=this.toMonthIndex(m.year,m.month,m.isIntercalary);return this.newDate(m.year,b,m.day)},fromString:function(s){var h=s.match(z),m=this._validateYear(+h[1]),b=+h[2],x=!!h[3],_=this.toMonthIndex(m,b,x),A=+h[4];return this.newDate(m,_,A)},add:function(s,h,m){var b=s.year(),x=s.month(),_=this.isIntercalaryMonth(b,x),A=this.toChineseMonth(b,x),f=Object.getPrototypeOf(y.prototype).add.call(this,s,h,m);if(m==="y"){var k=f.year(),w=f.month(),D=this.isIntercalaryMonth(k,A),E=_&&D?this.toMonthIndex(k,A,!0):this.toMonthIndex(k,A,!1);E!==w&&f.month(E)}return f}});var z=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,P=/^\d?\d[iI]?/m,i=/^闰?十?[一二三四五六七八九]?月/m,n=/^闰?十?[一二三四五六七八九]?/m;te.calendars.chinese=y;var a=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function o(s,h,m,b){var x,_;if(typeof s=="object")x=s,_=h||{};else{var A=typeof s=="number"&&s>=1888&&s<=2111;if(!A)throw new Error("Solar year outside range 1888-2111");var f=typeof h=="number"&&h>=1&&h<=12;if(!f)throw new Error("Solar month outside range 1 - 12");var k=typeof m=="number"&&m>=1&&m<=31;if(!k)throw new Error("Solar day outside range 1 - 31");x={year:s,month:h,day:m},_={}}var w=l[x.year-l[0]],D=x.year<<9|x.month<<5|x.day;_.year=D>=w?x.year:x.year-1,w=l[_.year-l[0]];var E=w>>9&4095,I=w>>5&15,M=w&31,p,g=new Date(E,I-1,M),C=new Date(x.year,x.month-1,x.day);p=Math.round((C-g)/(24*3600*1e3));var T=a[_.year-a[0]],N;for(N=0;N<13;N++){var B=T&1<<12-N?30:29;if(p>13;return!U||N=1888&&s<=2111;if(!f)throw new Error("Lunar year outside range 1888-2111");var k=typeof h=="number"&&h>=1&&h<=12;if(!k)throw new Error("Lunar month outside range 1 - 12");var w=typeof m=="number"&&m>=1&&m<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var D;typeof b=="object"?(D=!1,_=b):(D=!!b,_={}),A={year:s,month:h,day:m,isIntercalary:D}}var E;E=A.day-1;var I=a[A.year-a[0]],M=I>>13,p;M&&(A.month>M||A.isIntercalary)?p=A.month:p=A.month-1;for(var g=0;g>9&4095,B=T>>5&15,U=T&31,V=new Date(N,B-1,U+E);return _.year=V.getFullYear(),_.month=1+V.getMonth(),_.day=V.getDate(),_}}),Tre=Fe(()=>{var te=A0(),Y=Kd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),y<0&&y++,i.day()+(i.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var i=Math.floor(z/30)+1,n=z-(i-1)*30+1;return this.newDate(P,i,n)}}),te.calendars.coptic=d}),Sre=Fe(()=>{var te=A0(),Y=Kd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),!1},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),13},daysInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),400},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return(n.day()+1)%8},weekDay:function(z,P,i){var n=this.dayOfWeek(z,P,i);return n>=2&&n<=6},extraInfo:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return{century:y[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return z=n.year()+(n.year()<0?1:0),P=n.month(),i=n.day(),i+(P>1?16:0)+(P>2?(P-2)*32:0)+(z-1)*400+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z+.5)-Math.floor(this.jdEpoch)-1;var P=Math.floor(z/400)+1;z-=(P-1)*400,z+=z>15?16:0;var i=Math.floor(z/32)+1,n=z-(i-1)*32+1;return this.newDate(P<=0?P-1:P,i,n)}});var y={20:"Fruitbat",21:"Anchovy"};te.calendars.discworld=d}),Cre=Fe(()=>{var te=A0(),Y=Kd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),y<0&&y++,i.day()+(i.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var i=Math.floor(z/30)+1,n=z-(i-1)*30+1;return this.newDate(P,i,n)}}),te.calendars.ethiopian=d}),Are=Fe(()=>{var te=A0(),Y=Kd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return this._leapYear(P.year())},_leapYear:function(z){return z=z<0?z+1:z,y(z*7+1,19)<7},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),this._leapYear(z.year?z.year():z)?13:12},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return z=P.year(),this.toJD(z===-1?1:z+1,7,1)-this.toJD(z,7,1)},daysInMonth:function(z,P){return z.year&&(P=z.month(),z=z.year()),this._validate(z,P,this.minDay,te.local.invalidMonth),P===12&&this.leapYear(z)||P===8&&y(this.daysInYear(z),10)===5?30:P===9&&y(this.daysInYear(z),10)===3?29:this.daysPerMonth[P-1]},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==6},extraInfo:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);z=n.year(),P=n.month(),i=n.day();var a=z<=0?z+1:z,l=this.jdEpoch+this._delay1(a)+this._delay2(a)+i+1;if(P<7){for(var o=7;o<=this.monthsInYear(z);o++)l+=this.daysInMonth(z,o);for(var o=1;o=this.toJD(P===-1?1:P+1,7,1);)P++;for(var i=zthis.toJD(P,i,this.daysInMonth(P,i));)i++;var n=z-this.toJD(P,i,1)+1;return this.newDate(P,i,n)}});function y(z,P){return z-P*Math.floor(z/P)}te.calendars.hebrew=d}),Mre=Fe(()=>{var te=A0(),Y=Kd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,te.local.invalidYear);return(z.year()*11+14)%30<11},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(y){return this.leapYear(y)?355:354},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===12&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==5},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),z=i.month(),P=i.day(),y=y<=0?y+1:y,P+Math.ceil(29.5*(z-1))+(y-1)*354+Math.floor((3+11*y)/30)+this.jdEpoch-1},fromJD:function(y){y=Math.floor(y)+.5;var z=Math.floor((30*(y-this.jdEpoch)+10646)/10631);z=z<=0?z-1:z;var P=Math.min(12,Math.ceil((y-29-this.toJD(z,1,1))/29.5)+1),i=y-this.toJD(z,P,1)+1;return this.newDate(z,P,i)}}),te.calendars.islamic=d}),Ere=Fe(()=>{var te=A0(),Y=Kd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()<0?z.year()+1:z.year();return P%4===0},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(4-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===2&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),z=i.month(),P=i.day(),y<0&&y++,z<=2&&(y--,z+=12),Math.floor(365.25*(y+4716))+Math.floor(30.6001*(z+1))+P-1524.5},fromJD:function(y){var z=Math.floor(y+.5),P=z+1524,i=Math.floor((P-122.1)/365.25),n=Math.floor(365.25*i),a=Math.floor((P-n)/30.6001),l=a-Math.floor(a<14?1:13),o=i-Math.floor(l>2?4716:4715),u=P-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,l,u)}}),te.calendars.julian=d}),Lre=Fe(()=>{var te=A0(),Y=Kd();function d(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),!1},formatYear:function(P){var i=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear);P=i.year();var n=Math.floor(P/400);P=P%400,P+=P<0?400:0;var a=Math.floor(P/20);return n+"."+a+"."+P%20},forYear:function(P){if(P=P.split("."),P.length<3)throw"Invalid Mayan year";for(var i=0,n=0;n19||n>0&&a<0)throw"Invalid Mayan year";i=i*20+a}return i},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),18},weekOfYear:function(P,i,n){return this._validate(P,i,n,te.local.invalidDate),0},daysInYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),360},daysInMonth:function(P,i){return this._validate(P,i,this.minDay,te.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate);return a.day()},weekDay:function(P,i,n){return this._validate(P,i,n,te.local.invalidDate),!0},extraInfo:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate),l=a.toJD(),o=this._toHaab(l),u=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[u[0]-1],tzolkinDay:u[0],tzolkinTrecena:u[1]}},_toHaab:function(P){P-=this.jdEpoch;var i=y(P+8+340,365);return[Math.floor(i/20)+1,y(i,20)]},_toTzolkin:function(P){return P-=this.jdEpoch,[z(P+20,20),z(P+4,13)]},toJD:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(P){P=Math.floor(P)+.5-this.jdEpoch;var i=Math.floor(P/360);P=P%360,P+=P<0?360:0;var n=Math.floor(P/20),a=P%20;return this.newDate(i,n,a)}});function y(P,i){return P-i*Math.floor(P/i)}function z(P,i){return y(P-1,i)+1}te.calendars.mayan=d}),Pre=Fe(()=>{var te=A0(),Y=Kd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar;var y=te.instance("gregorian");Y(d.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear);return y.leapYear(P.year()+(P.year()<1?1:0)+1469)},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===12&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidMonth),a=n.year();a<0&&a++;for(var l=n.day(),o=1;o=this.toJD(P+1,1,1);)P++;for(var i=z-Math.floor(this.toJD(P,1,1)+.5)+1,n=1;i>this.daysInMonth(P,n);)i-=this.daysInMonth(P,n),n++;return this.newDate(P,n,i)}}),te.calendars.nanakshahi=d}),Ire=Fe(()=>{var te=A0(),Y=Kd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(y){return this.daysInYear(y)!==this.daysPerYear},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,te.local.invalidYear);if(y=z.year(),typeof this.NEPALI_CALENDAR_DATA[y]>"u")return this.daysPerYear;for(var P=0,i=this.minMonth;i<=12;i++)P+=this.NEPALI_CALENDAR_DATA[y][i];return P},daysInMonth:function(y,z){return y.year&&(z=y.month(),y=y.year()),this._validate(y,z,this.minDay,te.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[y]>"u"?this.daysPerMonth[z-1]:this.NEPALI_CALENDAR_DATA[y][z]},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);y=i.year(),z=i.month(),P=i.day();var n=te.instance(),a=0,l=z,o=y;this._createMissingCalendarData(y);var u=y-(l>9||l===9&&P>=this.NEPALI_CALENDAR_DATA[o][0]?56:57);for(z!==9&&(a=P,l--);l!==9;)l<=0&&(l=12,o--),a+=this.NEPALI_CALENDAR_DATA[o][l],l--;return z===9?(a+=P-this.NEPALI_CALENDAR_DATA[o][0],a<0&&(a+=n.daysInYear(u))):a+=this.NEPALI_CALENDAR_DATA[o][9]-this.NEPALI_CALENDAR_DATA[o][0],n.newDate(u,1,1).add(a,"d").toJD()},fromJD:function(y){var z=te.instance(),P=z.fromJD(y),i=P.year(),n=P.dayOfYear(),a=i+56;this._createMissingCalendarData(a);for(var l=9,o=this.NEPALI_CALENDAR_DATA[a][0],u=this.NEPALI_CALENDAR_DATA[a][l]-o+1;n>u;)l++,l>12&&(l=1,a++),u+=this.NEPALI_CALENDAR_DATA[a][l];var s=this.NEPALI_CALENDAR_DATA[a][l]-(u-n);return this.newDate(a,l,s)},_createMissingCalendarData:function(y){var z=this.daysPerMonth.slice(0);z.unshift(17);for(var P=y-1;P"u"&&(this.NEPALI_CALENDAR_DATA[P]=z)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),te.calendars.nepali=d}),Dre=Fe(()=>{var te=A0(),Y=Kd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}function y(z){var P=z-475;z<0&&P++;var i=.242197,n=i*P,a=i*(P+1),l=n-Math.floor(n),o=a-Math.floor(a);return l>o}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return y(P.year())},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===12&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==5},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);z=n.year(),P=n.month(),i=n.day();var a=0;if(z>0)for(var l=1;l0?z-1:z)*365+a+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z)+.5;var P=475+(z-this.toJD(475,1,1))/365.242197,i=Math.floor(P);i<=0&&i--,z>this.toJD(i,12,y(i)?30:29)&&(i++,i===0&&i++);var n=z-this.toJD(i,1,1)+1,a=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),l=z-this.toJD(i,a,1)+1;return this.newDate(i,a,l)}}),te.calendars.persian=d,te.calendars.jalali=d}),zre=Fe(()=>{var te=A0(),Y=Kd(),d=te.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(i){var P=this._validate(i,this.minMonth,this.minDay,te.local.invalidYear),i=this._t2gYear(P.year());return d.leapYear(i)},weekOfYear:function(a,P,i){var n=this._validate(a,this.minMonth,this.minDay,te.local.invalidYear),a=this._t2gYear(n.year());return d.weekOfYear(a,n.month(),n.day())},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===2&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidDate),a=this._t2gYear(n.year());return d.toJD(a,n.month(),n.day())},fromJD:function(z){var P=d.fromJD(z),i=this._g2tYear(P.year());return this.newDate(i,P.month(),P.day())},_t2gYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)},_g2tYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)}}),te.calendars.taiwan=y}),Ore=Fe(()=>{var te=A0(),Y=Kd(),d=te.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(i){var P=this._validate(i,this.minMonth,this.minDay,te.local.invalidYear),i=this._t2gYear(P.year());return d.leapYear(i)},weekOfYear:function(a,P,i){var n=this._validate(a,this.minMonth,this.minDay,te.local.invalidYear),a=this._t2gYear(n.year());return d.weekOfYear(a,n.month(),n.day())},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===2&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidDate),a=this._t2gYear(n.year());return d.toJD(a,n.month(),n.day())},fromJD:function(z){var P=d.fromJD(z),i=this._g2tYear(P.year());return this.newDate(i,P.month(),P.day())},_t2gYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)},_g2tYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)}}),te.calendars.thai=y}),Bre=Fe(()=>{var te=A0(),Y=Kd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return this.daysInYear(P.year())===355},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(z){for(var P=0,i=1;i<=12;i++)P+=this.daysInMonth(z,i);return P},daysInMonth:function(z,P){for(var i=this._validate(z,P,this.minDay,te.local.invalidMonth),n=i.toJD()-24e5+.5,a=0,l=0;ln)return y[a]-y[a-1];a++}return 30},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==5},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate),a=12*(n.year()-1)+n.month()-15292,l=n.day()+y[a-1]-1;return l+24e5-.5},fromJD:function(z){for(var P=z-24e5+.5,i=0,n=0;nP);n++)i++;var a=i+15292,l=Math.floor((a-1)/12),o=l+1,u=a-12*l,s=P-y[i-1]+1;return this.newDate(o,u,s)},isValid:function(z,P,i){var n=te.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(z=z.year!=null?z.year:z,n=z>=1276&&z<=1500),n},_validate:function(z,P,i,n){var a=te.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),te.calendars.ummalqura=d;var y=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),Rre=Fe((te,Y)=>{Y.exports=A0(),wre(),kre(),Tre(),Sre(),Cre(),Are(),Mre(),Ere(),Lre(),Pre(),Ire(),Dre(),zre(),Ore(),Bre()}),Fre=Fe((te,Y)=>{var d=Rre(),y=ji(),z=ti(),P=z.EPOCHJD,i=z.ONEDAY,n={valType:"enumerated",values:y.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},a=function(I,M,p,g){var C={};return C[p]=n,y.coerce(I,M,C,p,g)},l=function(I,M,p,g){for(var C=0;C{Y.exports=Fre()}),jre=Fe((te,Y)=>{var d=vq();d.register([bq(),Tq(),Mq(),Dq(),Rq(),Uq(),Vq(),tG(),cG(),bG(),PG(),XZ(),iK(),HK(),JK(),oY(),dY(),LY(),zY(),BY(),jY(),WY(),YY(),eX(),mX(),yX(),tQ(),gQ(),EQ(),OQ(),WQ(),KQ(),iee(),gee(),xee(),Mee(),Hee(),Kee(),rte(),Ste(),Dte(),Fte(),Hte(),Gte(),Jte(),ore(),fre(),bre(),Nre()]),Y.exports=d});return jre()})();/*! +`}),staticAttributes:Ie,staticUniforms:Mt}}class xr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(O,pe,Ie,Fe,qe,Mt,jt,tr,kr){this.context=O;let Vr=this.boundPaintVertexBuffers.length!==Fe.length;for(let Wr=0;!Vr&&Wr({u_matrix:Ke,u_texture:0,u_ele_delta:O,u_fog_matrix:pe,u_fog_color:Ie?Ie.properties.get("fog-color"):n.aM.white,u_fog_ground_blend:Ie?Ie.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Ie?Ie.calculateFogBlendOpacity(Fe):0,u_horizon_color:Ie?Ie.properties.get("horizon-color"):n.aM.white,u_horizon_fog_blend:Ie?Ie.properties.get("horizon-fog-blend"):1});function Ri(Ke){let O=[];for(let pe=0;pe({u_depth:new n.aH(Hr,Zr.u_depth),u_terrain:new n.aH(Hr,Zr.u_terrain),u_terrain_dim:new n.aI(Hr,Zr.u_terrain_dim),u_terrain_matrix:new n.aJ(Hr,Zr.u_terrain_matrix),u_terrain_unpack:new n.aK(Hr,Zr.u_terrain_unpack),u_terrain_exaggeration:new n.aI(Hr,Zr.u_terrain_exaggeration)}))(O,Pr),this.binderUniforms=Ie?Ie.getUniforms(O,Pr):[]}draw(O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi,et,lt,Tt,Lt,Vt){let Nt=O.gl;if(this.failedToCreate)return;if(O.program.set(this.program),O.setDepthMode(Ie),O.setStencilMode(Fe),O.setColorMode(qe),O.setCullFace(Mt),tr){O.activeTexture.set(Nt.TEXTURE2),Nt.bindTexture(Nt.TEXTURE_2D,tr.depthTexture),O.activeTexture.set(Nt.TEXTURE3),Nt.bindTexture(Nt.TEXTURE_2D,tr.texture);for(let Pr in this.terrainUniforms)this.terrainUniforms[Pr].set(tr[Pr])}for(let Pr in this.fixedUniforms)this.fixedUniforms[Pr].set(jt[Pr]);lt&<.setUniforms(O,this.binderUniforms,Vi,{zoom:et});let Xt=0;switch(pe){case Nt.LINES:Xt=2;break;case Nt.TRIANGLES:Xt=3;break;case Nt.LINE_STRIP:Xt=1}for(let Pr of Ti.get()){let Hr=Pr.vaos||(Pr.vaos={});(Hr[kr]||(Hr[kr]=new xr)).bind(O,this,Vr,lt?lt.getPaintVertexBuffers():[],Wr,Pr.vertexOffset,Tt,Lt,Vt),Nt.drawElements(pe,Pr.primitiveLength*Xt,Nt.UNSIGNED_SHORT,Pr.primitiveOffset*Xt*2)}}}function _n(Ke,O,pe){let Ie=1/cn(pe,1,O.transform.tileZoom),Fe=Math.pow(2,pe.tileID.overscaledZ),qe=pe.tileSize*Math.pow(2,O.transform.tileZoom)/Fe,Mt=qe*(pe.tileID.canonical.x+pe.tileID.wrap*Fe),jt=qe*pe.tileID.canonical.y;return{u_image:0,u_texsize:pe.imageAtlasTexture.size,u_scale:[Ie,Ke.fromScale,Ke.toScale],u_fade:Ke.t,u_pixel_coord_upper:[Mt>>16,jt>>16],u_pixel_coord_lower:[65535&Mt,65535&jt]}}let Zi=(Ke,O,pe,Ie)=>{let Fe=O.style.light,qe=Fe.properties.get("position"),Mt=[qe.x,qe.y,qe.z],jt=function(){var kr=new n.A(9);return n.A!=Float32Array&&(kr[1]=0,kr[2]=0,kr[3]=0,kr[5]=0,kr[6]=0,kr[7]=0),kr[0]=1,kr[4]=1,kr[8]=1,kr}();Fe.properties.get("anchor")==="viewport"&&function(kr,Vr){var Wr=Math.sin(Vr),Ti=Math.cos(Vr);kr[0]=Ti,kr[1]=Wr,kr[2]=0,kr[3]=-Wr,kr[4]=Ti,kr[5]=0,kr[6]=0,kr[7]=0,kr[8]=1}(jt,-O.transform.angle),function(kr,Vr,Wr){var Ti=Vr[0],Vi=Vr[1],et=Vr[2];kr[0]=Ti*Wr[0]+Vi*Wr[3]+et*Wr[6],kr[1]=Ti*Wr[1]+Vi*Wr[4]+et*Wr[7],kr[2]=Ti*Wr[2]+Vi*Wr[5]+et*Wr[8]}(Mt,Mt,jt);let tr=Fe.properties.get("color");return{u_matrix:Ke,u_lightpos:Mt,u_lightintensity:Fe.properties.get("intensity"),u_lightcolor:[tr.r,tr.g,tr.b],u_vertical_gradient:+pe,u_opacity:Ie}},Wi=(Ke,O,pe,Ie,Fe,qe,Mt)=>n.e(Zi(Ke,O,pe,Ie),_n(qe,O,Mt),{u_height_factor:-Math.pow(2,Fe.overscaledZ)/Mt.tileSize/8}),pn=Ke=>({u_matrix:Ke}),Ua=(Ke,O,pe,Ie)=>n.e(pn(Ke),_n(pe,O,Ie)),ea=(Ke,O)=>({u_matrix:Ke,u_world:O}),fo=(Ke,O,pe,Ie,Fe)=>n.e(Ua(Ke,O,pe,Ie),{u_world:Fe}),ho=(Ke,O,pe,Ie)=>{let Fe=Ke.transform,qe,Mt;if(Ie.paint.get("circle-pitch-alignment")==="map"){let jt=cn(pe,1,Fe.zoom);qe=!0,Mt=[jt,jt]}else qe=!1,Mt=Fe.pixelsToGLUnits;return{u_camera_to_center_distance:Fe.cameraToCenterDistance,u_scale_with_map:+(Ie.paint.get("circle-pitch-scale")==="map"),u_matrix:Ke.translatePosMatrix(O.posMatrix,pe,Ie.paint.get("circle-translate"),Ie.paint.get("circle-translate-anchor")),u_pitch_with_map:+qe,u_device_pixel_ratio:Ke.pixelRatio,u_extrude_scale:Mt}},Vo=(Ke,O,pe)=>({u_matrix:Ke,u_inv_matrix:O,u_camera_to_center_distance:pe.cameraToCenterDistance,u_viewport_size:[pe.width,pe.height]}),Ao=(Ke,O,pe=1)=>({u_matrix:Ke,u_color:O,u_overlay:0,u_overlay_scale:pe}),Wo=Ke=>({u_matrix:Ke}),Wa=(Ke,O,pe,Ie)=>({u_matrix:Ke,u_extrude_scale:cn(O,1,pe),u_intensity:Ie}),Ts=(Ke,O,pe,Ie)=>{let Fe=n.H();n.aP(Fe,0,Ke.width,Ke.height,0,0,1);let qe=Ke.context.gl;return{u_matrix:Fe,u_world:[qe.drawingBufferWidth,qe.drawingBufferHeight],u_image:pe,u_color_ramp:Ie,u_opacity:O.paint.get("heatmap-opacity")}};function fs(Ke,O){let pe=Math.pow(2,O.canonical.z),Ie=O.canonical.y;return[new n.Z(0,Ie/pe).toLngLat().lat,new n.Z(0,(Ie+1)/pe).toLngLat().lat]}let _l=(Ke,O,pe,Ie)=>{let Fe=Ke.transform;return{u_matrix:sl(Ke,O,pe,Ie),u_ratio:1/cn(O,1,Fe.zoom),u_device_pixel_ratio:Ke.pixelRatio,u_units_to_pixels:[1/Fe.pixelsToGLUnits[0],1/Fe.pixelsToGLUnits[1]]}},es=(Ke,O,pe,Ie,Fe)=>n.e(_l(Ke,O,pe,Fe),{u_image:0,u_image_height:Ie}),rl=(Ke,O,pe,Ie,Fe)=>{let qe=Ke.transform,Mt=xl(O,qe);return{u_matrix:sl(Ke,O,pe,Fe),u_texsize:O.imageAtlasTexture.size,u_ratio:1/cn(O,1,qe.zoom),u_device_pixel_ratio:Ke.pixelRatio,u_image:0,u_scale:[Mt,Ie.fromScale,Ie.toScale],u_fade:Ie.t,u_units_to_pixels:[1/qe.pixelsToGLUnits[0],1/qe.pixelsToGLUnits[1]]}},ds=(Ke,O,pe,Ie,Fe,qe)=>{let Mt=Ke.lineAtlas,jt=xl(O,Ke.transform),tr=pe.layout.get("line-cap")==="round",kr=Mt.getDash(Ie.from,tr),Vr=Mt.getDash(Ie.to,tr),Wr=kr.width*Fe.fromScale,Ti=Vr.width*Fe.toScale;return n.e(_l(Ke,O,pe,qe),{u_patternscale_a:[jt/Wr,-kr.height/2],u_patternscale_b:[jt/Ti,-Vr.height/2],u_sdfgamma:Mt.width/(256*Math.min(Wr,Ti)*Ke.pixelRatio)/2,u_image:0,u_tex_y_a:kr.y,u_tex_y_b:Vr.y,u_mix:Fe.t})};function xl(Ke,O){return 1/cn(Ke,1,O.tileZoom)}function sl(Ke,O,pe,Ie){return Ke.translatePosMatrix(Ie?Ie.posMatrix:O.tileID.posMatrix,O,pe.paint.get("line-translate"),pe.paint.get("line-translate-anchor"))}let Gl=(Ke,O,pe,Ie,Fe)=>{return{u_matrix:Ke,u_tl_parent:O,u_scale_parent:pe,u_buffer_scale:1,u_fade_t:Ie.mix,u_opacity:Ie.opacity*Fe.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Fe.paint.get("raster-brightness-min"),u_brightness_high:Fe.paint.get("raster-brightness-max"),u_saturation_factor:(Mt=Fe.paint.get("raster-saturation"),Mt>0?1-1/(1.001-Mt):-Mt),u_contrast_factor:(qe=Fe.paint.get("raster-contrast"),qe>0?1/(1-qe):1+qe),u_spin_weights:ms(Fe.paint.get("raster-hue-rotate"))};var qe,Mt};function ms(Ke){Ke*=Math.PI/180;let O=Math.sin(Ke),pe=Math.cos(Ke);return[(2*pe+1)/3,(-Math.sqrt(3)*O-pe+1)/3,(Math.sqrt(3)*O-pe+1)/3]}let Bs=(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi)=>{let et=Mt.transform;return{u_is_size_zoom_constant:+(Ke==="constant"||Ke==="source"),u_is_size_feature_constant:+(Ke==="constant"||Ke==="camera"),u_size_t:O?O.uSizeT:0,u_size:O?O.uSize:0,u_camera_to_center_distance:et.cameraToCenterDistance,u_pitch:et.pitch/360*2*Math.PI,u_rotate_symbol:+pe,u_aspect_ratio:et.width/et.height,u_fade_change:Mt.options.fadeDuration?Mt.symbolFadeChange:1,u_matrix:jt,u_label_plane_matrix:tr,u_coord_matrix:kr,u_is_text:+Wr,u_pitch_with_map:+Ie,u_is_along_line:Fe,u_is_variable_anchor:qe,u_texsize:Ti,u_texture:0,u_translation:Vr,u_pitched_scale:Vi}},No=(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi,et)=>{let lt=Mt.transform;return n.e(Bs(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,et),{u_gamma_scale:Ie?Math.cos(lt._pitch)*lt.cameraToCenterDistance:1,u_device_pixel_ratio:Mt.pixelRatio,u_is_halo:1})},Ls=(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,Wr,Ti,Vi)=>n.e(No(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr,Vr,!0,Wr,!0,Vi),{u_texsize_icon:Ti,u_texture_icon:1}),Il=(Ke,O,pe)=>({u_matrix:Ke,u_opacity:O,u_color:pe}),Jl=(Ke,O,pe,Ie,Fe,qe)=>n.e(function(Mt,jt,tr,kr){let Vr=tr.imageManager.getPattern(Mt.from.toString()),Wr=tr.imageManager.getPattern(Mt.to.toString()),{width:Ti,height:Vi}=tr.imageManager.getPixelSize(),et=Math.pow(2,kr.tileID.overscaledZ),lt=kr.tileSize*Math.pow(2,tr.transform.tileZoom)/et,Tt=lt*(kr.tileID.canonical.x+kr.tileID.wrap*et),Lt=lt*kr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Vr.tl,u_pattern_br_a:Vr.br,u_pattern_tl_b:Wr.tl,u_pattern_br_b:Wr.br,u_texsize:[Ti,Vi],u_mix:jt.t,u_pattern_size_a:Vr.displaySize,u_pattern_size_b:Wr.displaySize,u_scale_a:jt.fromScale,u_scale_b:jt.toScale,u_tile_units_to_pixels:1/cn(kr,1,tr.transform.tileZoom),u_pixel_coord_upper:[Tt>>16,Lt>>16],u_pixel_coord_lower:[65535&Tt,65535&Lt]}}(Ie,qe,pe,Fe),{u_matrix:Ke,u_opacity:O}),ou={fillExtrusion:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_lightpos:new n.aN(Ke,O.u_lightpos),u_lightintensity:new n.aI(Ke,O.u_lightintensity),u_lightcolor:new n.aN(Ke,O.u_lightcolor),u_vertical_gradient:new n.aI(Ke,O.u_vertical_gradient),u_opacity:new n.aI(Ke,O.u_opacity)}),fillExtrusionPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_lightpos:new n.aN(Ke,O.u_lightpos),u_lightintensity:new n.aI(Ke,O.u_lightintensity),u_lightcolor:new n.aN(Ke,O.u_lightcolor),u_vertical_gradient:new n.aI(Ke,O.u_vertical_gradient),u_height_factor:new n.aI(Ke,O.u_height_factor),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade),u_opacity:new n.aI(Ke,O.u_opacity)}),fill:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix)}),fillPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),fillOutline:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world)}),fillOutlinePattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world),u_image:new n.aH(Ke,O.u_image),u_texsize:new n.aO(Ke,O.u_texsize),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),circle:(Ke,O)=>({u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_scale_with_map:new n.aH(Ke,O.u_scale_with_map),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_extrude_scale:new n.aO(Ke,O.u_extrude_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_matrix:new n.aJ(Ke,O.u_matrix)}),collisionBox:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_pixel_extrude_scale:new n.aO(Ke,O.u_pixel_extrude_scale)}),collisionCircle:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_inv_matrix:new n.aJ(Ke,O.u_inv_matrix),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_viewport_size:new n.aO(Ke,O.u_viewport_size)}),debug:(Ke,O)=>({u_color:new n.aL(Ke,O.u_color),u_matrix:new n.aJ(Ke,O.u_matrix),u_overlay:new n.aH(Ke,O.u_overlay),u_overlay_scale:new n.aI(Ke,O.u_overlay_scale)}),clippingMask:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix)}),heatmap:(Ke,O)=>({u_extrude_scale:new n.aI(Ke,O.u_extrude_scale),u_intensity:new n.aI(Ke,O.u_intensity),u_matrix:new n.aJ(Ke,O.u_matrix)}),heatmapTexture:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_world:new n.aO(Ke,O.u_world),u_image:new n.aH(Ke,O.u_image),u_color_ramp:new n.aH(Ke,O.u_color_ramp),u_opacity:new n.aI(Ke,O.u_opacity)}),hillshade:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_latrange:new n.aO(Ke,O.u_latrange),u_light:new n.aO(Ke,O.u_light),u_shadow:new n.aL(Ke,O.u_shadow),u_highlight:new n.aL(Ke,O.u_highlight),u_accent:new n.aL(Ke,O.u_accent)}),hillshadePrepare:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_image:new n.aH(Ke,O.u_image),u_dimension:new n.aO(Ke,O.u_dimension),u_zoom:new n.aI(Ke,O.u_zoom),u_unpack:new n.aK(Ke,O.u_unpack)}),line:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels)}),lineGradient:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_image:new n.aH(Ke,O.u_image),u_image_height:new n.aI(Ke,O.u_image_height)}),linePattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texsize:new n.aO(Ke,O.u_texsize),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_image:new n.aH(Ke,O.u_image),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_scale:new n.aN(Ke,O.u_scale),u_fade:new n.aI(Ke,O.u_fade)}),lineSDF:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ratio:new n.aI(Ke,O.u_ratio),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_units_to_pixels:new n.aO(Ke,O.u_units_to_pixels),u_patternscale_a:new n.aO(Ke,O.u_patternscale_a),u_patternscale_b:new n.aO(Ke,O.u_patternscale_b),u_sdfgamma:new n.aI(Ke,O.u_sdfgamma),u_image:new n.aH(Ke,O.u_image),u_tex_y_a:new n.aI(Ke,O.u_tex_y_a),u_tex_y_b:new n.aI(Ke,O.u_tex_y_b),u_mix:new n.aI(Ke,O.u_mix)}),raster:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_tl_parent:new n.aO(Ke,O.u_tl_parent),u_scale_parent:new n.aI(Ke,O.u_scale_parent),u_buffer_scale:new n.aI(Ke,O.u_buffer_scale),u_fade_t:new n.aI(Ke,O.u_fade_t),u_opacity:new n.aI(Ke,O.u_opacity),u_image0:new n.aH(Ke,O.u_image0),u_image1:new n.aH(Ke,O.u_image1),u_brightness_low:new n.aI(Ke,O.u_brightness_low),u_brightness_high:new n.aI(Ke,O.u_brightness_high),u_saturation_factor:new n.aI(Ke,O.u_saturation_factor),u_contrast_factor:new n.aI(Ke,O.u_contrast_factor),u_spin_weights:new n.aN(Ke,O.u_spin_weights)}),symbolIcon:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texture:new n.aH(Ke,O.u_texture),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),symbolSDF:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texture:new n.aH(Ke,O.u_texture),u_gamma_scale:new n.aI(Ke,O.u_gamma_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_is_halo:new n.aH(Ke,O.u_is_halo),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),symbolTextAndIcon:(Ke,O)=>({u_is_size_zoom_constant:new n.aH(Ke,O.u_is_size_zoom_constant),u_is_size_feature_constant:new n.aH(Ke,O.u_is_size_feature_constant),u_size_t:new n.aI(Ke,O.u_size_t),u_size:new n.aI(Ke,O.u_size),u_camera_to_center_distance:new n.aI(Ke,O.u_camera_to_center_distance),u_pitch:new n.aI(Ke,O.u_pitch),u_rotate_symbol:new n.aH(Ke,O.u_rotate_symbol),u_aspect_ratio:new n.aI(Ke,O.u_aspect_ratio),u_fade_change:new n.aI(Ke,O.u_fade_change),u_matrix:new n.aJ(Ke,O.u_matrix),u_label_plane_matrix:new n.aJ(Ke,O.u_label_plane_matrix),u_coord_matrix:new n.aJ(Ke,O.u_coord_matrix),u_is_text:new n.aH(Ke,O.u_is_text),u_pitch_with_map:new n.aH(Ke,O.u_pitch_with_map),u_is_along_line:new n.aH(Ke,O.u_is_along_line),u_is_variable_anchor:new n.aH(Ke,O.u_is_variable_anchor),u_texsize:new n.aO(Ke,O.u_texsize),u_texsize_icon:new n.aO(Ke,O.u_texsize_icon),u_texture:new n.aH(Ke,O.u_texture),u_texture_icon:new n.aH(Ke,O.u_texture_icon),u_gamma_scale:new n.aI(Ke,O.u_gamma_scale),u_device_pixel_ratio:new n.aI(Ke,O.u_device_pixel_ratio),u_is_halo:new n.aH(Ke,O.u_is_halo),u_translation:new n.aO(Ke,O.u_translation),u_pitched_scale:new n.aI(Ke,O.u_pitched_scale)}),background:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_opacity:new n.aI(Ke,O.u_opacity),u_color:new n.aL(Ke,O.u_color)}),backgroundPattern:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_opacity:new n.aI(Ke,O.u_opacity),u_image:new n.aH(Ke,O.u_image),u_pattern_tl_a:new n.aO(Ke,O.u_pattern_tl_a),u_pattern_br_a:new n.aO(Ke,O.u_pattern_br_a),u_pattern_tl_b:new n.aO(Ke,O.u_pattern_tl_b),u_pattern_br_b:new n.aO(Ke,O.u_pattern_br_b),u_texsize:new n.aO(Ke,O.u_texsize),u_mix:new n.aI(Ke,O.u_mix),u_pattern_size_a:new n.aO(Ke,O.u_pattern_size_a),u_pattern_size_b:new n.aO(Ke,O.u_pattern_size_b),u_scale_a:new n.aI(Ke,O.u_scale_a),u_scale_b:new n.aI(Ke,O.u_scale_b),u_pixel_coord_upper:new n.aO(Ke,O.u_pixel_coord_upper),u_pixel_coord_lower:new n.aO(Ke,O.u_pixel_coord_lower),u_tile_units_to_pixels:new n.aI(Ke,O.u_tile_units_to_pixels)}),terrain:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texture:new n.aH(Ke,O.u_texture),u_ele_delta:new n.aI(Ke,O.u_ele_delta),u_fog_matrix:new n.aJ(Ke,O.u_fog_matrix),u_fog_color:new n.aL(Ke,O.u_fog_color),u_fog_ground_blend:new n.aI(Ke,O.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.aI(Ke,O.u_fog_ground_blend_opacity),u_horizon_color:new n.aL(Ke,O.u_horizon_color),u_horizon_fog_blend:new n.aI(Ke,O.u_horizon_fog_blend)}),terrainDepth:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_ele_delta:new n.aI(Ke,O.u_ele_delta)}),terrainCoords:(Ke,O)=>({u_matrix:new n.aJ(Ke,O.u_matrix),u_texture:new n.aH(Ke,O.u_texture),u_terrain_coords_id:new n.aI(Ke,O.u_terrain_coords_id),u_ele_delta:new n.aI(Ke,O.u_ele_delta)}),sky:(Ke,O)=>({u_sky_color:new n.aL(Ke,O.u_sky_color),u_horizon_color:new n.aL(Ke,O.u_horizon_color),u_horizon:new n.aI(Ke,O.u_horizon),u_sky_horizon_blend:new n.aI(Ke,O.u_sky_horizon_blend)})};class Gs{constructor(O,pe,Ie){this.context=O;let Fe=O.gl;this.buffer=Fe.createBuffer(),this.dynamicDraw=!!Ie,this.context.unbindVAO(),O.bindElementBuffer.set(this.buffer),Fe.bufferData(Fe.ELEMENT_ARRAY_BUFFER,pe.arrayBuffer,this.dynamicDraw?Fe.DYNAMIC_DRAW:Fe.STATIC_DRAW),this.dynamicDraw||delete pe.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(O){let pe=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),pe.bufferSubData(pe.ELEMENT_ARRAY_BUFFER,0,O.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let $a={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class So{constructor(O,pe,Ie,Fe){this.length=pe.length,this.attributes=Ie,this.itemSize=pe.bytesPerElement,this.dynamicDraw=Fe,this.context=O;let qe=O.gl;this.buffer=qe.createBuffer(),O.bindVertexBuffer.set(this.buffer),qe.bufferData(qe.ARRAY_BUFFER,pe.arrayBuffer,this.dynamicDraw?qe.DYNAMIC_DRAW:qe.STATIC_DRAW),this.dynamicDraw||delete pe.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(O){if(O.length!==this.length)throw new Error(`Length of new data is ${O.length}, which doesn't match current length of ${this.length}`);let pe=this.context.gl;this.bind(),pe.bufferSubData(pe.ARRAY_BUFFER,0,O.arrayBuffer)}enableAttributes(O,pe){for(let Ie=0;Ie0){let Hr=n.H();n.aQ(Hr,Nt.placementInvProjMatrix,Ke.transform.glCoordMatrix),n.aQ(Hr,Hr,Nt.placementViewportMatrix),tr.push({circleArray:Pr,circleOffset:Vr,transform:Vt.posMatrix,invTransform:Hr,coord:Vt}),kr+=Pr.length/4,Vr=kr}Xt&&jt.draw(qe,Mt.LINES,ll.disabled,jl.disabled,Ke.colorModeForRenderPass(),os.disabled,{u_matrix:Vt.posMatrix,u_pixel_extrude_scale:[1/(Wr=Ke.transform).width,1/Wr.height]},Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(Vt),pe.id,Xt.layoutVertexBuffer,Xt.indexBuffer,Xt.segments,null,Ke.transform.zoom,null,null,Xt.collisionVertexBuffer)}var Wr;if(!Fe||!tr.length)return;let Ti=Ke.useProgram("collisionCircle"),Vi=new n.aR;Vi.resize(4*kr),Vi._trim();let et=0;for(let Lt of tr)for(let Vt=0;Vt=0&&(Lt[Nt.associatedIconIndex]={shiftedAnchor:xo,angle:Go})}else Dr(Nt.numGlyphs,lt)}if(kr){Tt.clear();let Vt=Ke.icon.placedSymbolArray;for(let Nt=0;NtKe.style.map.terrain.getElevation(rn,Ji,ta):null,Yi=pe.layout.get("text-rotation-alignment")==="map";De(Qn,rn.posMatrix,Ke,Fe,wc,Me,Lt,kr,Yi,lt,rn.toUnwrapped(),et.width,et.height,Ve,Bi)}let Bt=rn.posMatrix,Ht=Fe&&pi||Pt,dr=Vt||Ht?hc:wc,cr=ih,Or=Ba&&pe.paint.get(Fe?"text-halo-width":"icon-halo-width").constantOr(1)!==0,mi;mi=Ba?Qn.iconsInText?Ls(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,dr,cr,Ve,Al,Tu,Ki):No(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,dr,cr,Ve,Fe,Al,!0,Ki):Bs(xo.kind,_s,Nt,Lt,Vt,Ht,Ke,Bt,dr,cr,Ve,Fe,Al,Ki);let hi={program:Bo,buffers:Ca,uniformValues:mi,atlasTexture:Us,atlasTextureIcon:Js,atlasInterpolation:Pl,atlasInterpolationIcon:Fu,isSDF:Ba,hasHalo:Or};if(Pr&&Qn.canOverlap){Hr=!0;let Bi=Ca.segments.get();for(let Yi of Bi)zi.push({segments:new n.a0([Yi]),sortKey:Yi.sortKey,state:hi,terrainData:wl})}else zi.push({segments:Ca.segments,sortKey:0,state:hi,terrainData:wl})}Hr&&zi.sort((rn,kn)=>rn.sortKey-kn.sortKey);for(let rn of zi){let kn=rn.state;if(Ti.activeTexture.set(Vi.TEXTURE0),kn.atlasTexture.bind(kn.atlasInterpolation,Vi.CLAMP_TO_EDGE),kn.atlasTextureIcon&&(Ti.activeTexture.set(Vi.TEXTURE1),kn.atlasTextureIcon&&kn.atlasTextureIcon.bind(kn.atlasInterpolationIcon,Vi.CLAMP_TO_EDGE)),kn.isSDF){let Qn=kn.uniformValues;kn.hasHalo&&(Qn.u_is_halo=1,hd(kn.buffers,rn.segments,pe,Ke,kn.program,Zr,Vr,Wr,Qn,rn.terrainData)),Qn.u_is_halo=0}hd(kn.buffers,rn.segments,pe,Ke,kn.program,Zr,Vr,Wr,kn.uniformValues,rn.terrainData)}}function hd(Ke,O,pe,Ie,Fe,qe,Mt,jt,tr,kr){let Vr=Ie.context;Fe.draw(Vr,Vr.gl.TRIANGLES,qe,Mt,jt,os.disabled,tr,kr,pe.id,Ke.layoutVertexBuffer,Ke.indexBuffer,O,pe.paint,Ie.transform.zoom,Ke.programConfigurations.get(pe.id),Ke.dynamicLayoutVertexBuffer,Ke.opacityVertexBuffer)}function Pf(Ke,O,pe,Ie){let Fe=Ke.context,qe=Fe.gl,Mt=jl.disabled,jt=new Mu([qe.ONE,qe.ONE],n.aM.transparent,[!0,!0,!0,!0]),tr=O.getBucket(pe);if(!tr)return;let kr=Ie.key,Vr=pe.heatmapFbos.get(kr);Vr||(Vr=nd(Fe,O.tileSize,O.tileSize),pe.heatmapFbos.set(kr,Vr)),Fe.bindFramebuffer.set(Vr.framebuffer),Fe.viewport.set([0,0,O.tileSize,O.tileSize]),Fe.clear({color:n.aM.transparent});let Wr=tr.programConfigurations.get(pe.id),Ti=Ke.useProgram("heatmap",Wr),Vi=Ke.style.map.terrain.getTerrainData(Ie);Ti.draw(Fe,qe.TRIANGLES,ll.disabled,Mt,jt,os.disabled,Wa(Ie.posMatrix,O,Ke.transform.zoom,pe.paint.get("heatmap-intensity")),Vi,pe.id,tr.layoutVertexBuffer,tr.indexBuffer,tr.segments,pe.paint,Ke.transform.zoom,Wr)}function ef(Ke,O,pe){let Ie=Ke.context,Fe=Ie.gl;Ie.setColorMode(Ke.colorModeForRenderPass());let qe=ad(Ie,O),Mt=pe.key,jt=O.heatmapFbos.get(Mt);jt&&(Ie.activeTexture.set(Fe.TEXTURE0),Fe.bindTexture(Fe.TEXTURE_2D,jt.colorAttachment.get()),Ie.activeTexture.set(Fe.TEXTURE1),qe.bind(Fe.LINEAR,Fe.CLAMP_TO_EDGE),Ke.useProgram("heatmapTexture").draw(Ie,Fe.TRIANGLES,ll.disabled,jl.disabled,Ke.colorModeForRenderPass(),os.disabled,Ts(Ke,O,0,1),null,O.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments,O.paint,Ke.transform.zoom),jt.destroy(),O.heatmapFbos.delete(Mt))}function nd(Ke,O,pe){var Ie,Fe;let qe=Ke.gl,Mt=qe.createTexture();qe.bindTexture(qe.TEXTURE_2D,Mt),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_S,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_WRAP_T,qe.CLAMP_TO_EDGE),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MIN_FILTER,qe.LINEAR),qe.texParameteri(qe.TEXTURE_2D,qe.TEXTURE_MAG_FILTER,qe.LINEAR);let jt=(Ie=Ke.HALF_FLOAT)!==null&&Ie!==void 0?Ie:qe.UNSIGNED_BYTE,tr=(Fe=Ke.RGBA16F)!==null&&Fe!==void 0?Fe:qe.RGBA;qe.texImage2D(qe.TEXTURE_2D,0,tr,O,pe,0,qe.RGBA,jt,null);let kr=Ke.createFramebuffer(O,pe,!1,!1);return kr.colorAttachment.set(Mt),kr}function ad(Ke,O){return O.colorRampTexture||(O.colorRampTexture=new g(Ke,O.colorRamp,Ke.gl.RGBA)),O.colorRampTexture}function _h(Ke,O,pe,Ie,Fe){if(!pe||!Ie||!Ie.imageAtlas)return;let qe=Ie.imageAtlas.patternPositions,Mt=qe[pe.to.toString()],jt=qe[pe.from.toString()];if(!Mt&&jt&&(Mt=jt),!jt&&Mt&&(jt=Mt),!Mt||!jt){let tr=Fe.getPaintProperty(O);Mt=qe[tr],jt=qe[tr]}Mt&&jt&&Ke.setConstantPatternPositions(Mt,jt)}function fd(Ke,O,pe,Ie,Fe,qe,Mt){let jt=Ke.context.gl,tr="fill-pattern",kr=pe.paint.get(tr),Vr=kr&&kr.constantOr(1),Wr=pe.getCrossfadeParameters(),Ti,Vi,et,lt,Tt;Mt?(Vi=Vr&&!pe.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Ti=jt.LINES):(Vi=Vr?"fillPattern":"fill",Ti=jt.TRIANGLES);let Lt=kr.constantOr(null);for(let Vt of Ie){let Nt=O.getTile(Vt);if(Vr&&!Nt.patternsLoaded())continue;let Xt=Nt.getBucket(pe);if(!Xt)continue;let Pr=Xt.programConfigurations.get(pe.id),Hr=Ke.useProgram(Vi,Pr),Zr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(Vt);Vr&&(Ke.context.activeTexture.set(jt.TEXTURE0),Nt.imageAtlasTexture.bind(jt.LINEAR,jt.CLAMP_TO_EDGE),Pr.updatePaintBuffers(Wr)),_h(Pr,tr,Lt,Nt,pe);let pi=Zr?Vt:null,zi=Ke.translatePosMatrix(pi?pi.posMatrix:Vt.posMatrix,Nt,pe.paint.get("fill-translate"),pe.paint.get("fill-translate-anchor"));if(Mt){lt=Xt.indexBuffer2,Tt=Xt.segments2;let Ki=[jt.drawingBufferWidth,jt.drawingBufferHeight];et=Vi==="fillOutlinePattern"&&Vr?fo(zi,Ke,Wr,Nt,Ki):ea(zi,Ki)}else lt=Xt.indexBuffer,Tt=Xt.segments,et=Vr?Ua(zi,Ke,Wr,Nt):pn(zi);Hr.draw(Ke.context,Ti,Fe,Ke.stencilModeForClipping(Vt),qe,os.disabled,et,Zr,pe.id,Xt.layoutVertexBuffer,lt,Tt,pe.paint,Ke.transform.zoom,Pr)}}function Nh(Ke,O,pe,Ie,Fe,qe,Mt){let jt=Ke.context,tr=jt.gl,kr="fill-extrusion-pattern",Vr=pe.paint.get(kr),Wr=Vr.constantOr(1),Ti=pe.getCrossfadeParameters(),Vi=pe.paint.get("fill-extrusion-opacity"),et=Vr.constantOr(null);for(let lt of Ie){let Tt=O.getTile(lt),Lt=Tt.getBucket(pe);if(!Lt)continue;let Vt=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(lt),Nt=Lt.programConfigurations.get(pe.id),Xt=Ke.useProgram(Wr?"fillExtrusionPattern":"fillExtrusion",Nt);Wr&&(Ke.context.activeTexture.set(tr.TEXTURE0),Tt.imageAtlasTexture.bind(tr.LINEAR,tr.CLAMP_TO_EDGE),Nt.updatePaintBuffers(Ti)),_h(Nt,kr,et,Tt,pe);let Pr=Ke.translatePosMatrix(lt.posMatrix,Tt,pe.paint.get("fill-extrusion-translate"),pe.paint.get("fill-extrusion-translate-anchor")),Hr=pe.paint.get("fill-extrusion-vertical-gradient"),Zr=Wr?Wi(Pr,Ke,Hr,Vi,lt,Ti,Tt):Zi(Pr,Ke,Hr,Vi);Xt.draw(jt,jt.gl.TRIANGLES,Fe,qe,Mt,os.backCCW,Zr,Vt,pe.id,Lt.layoutVertexBuffer,Lt.indexBuffer,Lt.segments,pe.paint,Ke.transform.zoom,Nt,Ke.style.map.terrain&&Lt.centroidVertexBuffer)}}function Mh(Ke,O,pe,Ie,Fe,qe,Mt){let jt=Ke.context,tr=jt.gl,kr=pe.fbo;if(!kr)return;let Vr=Ke.useProgram("hillshade"),Wr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(O);jt.activeTexture.set(tr.TEXTURE0),tr.bindTexture(tr.TEXTURE_2D,kr.colorAttachment.get()),Vr.draw(jt,tr.TRIANGLES,Fe,qe,Mt,os.disabled,((Ti,Vi,et,lt)=>{let Tt=et.paint.get("hillshade-shadow-color"),Lt=et.paint.get("hillshade-highlight-color"),Vt=et.paint.get("hillshade-accent-color"),Nt=et.paint.get("hillshade-illumination-direction")*(Math.PI/180);et.paint.get("hillshade-illumination-anchor")==="viewport"&&(Nt-=Ti.transform.angle);let Xt=!Ti.options.moving;return{u_matrix:lt?lt.posMatrix:Ti.transform.calculatePosMatrix(Vi.tileID.toUnwrapped(),Xt),u_image:0,u_latrange:fs(0,Vi.tileID),u_light:[et.paint.get("hillshade-exaggeration"),Nt],u_shadow:Tt,u_highlight:Lt,u_accent:Vt}})(Ke,pe,Ie,Wr?O:null),Wr,Ie.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments)}function yc(Ke,O,pe,Ie,Fe,qe){let Mt=Ke.context,jt=Mt.gl,tr=O.dem;if(tr&&tr.data){let kr=tr.dim,Vr=tr.stride,Wr=tr.getPixels();if(Mt.activeTexture.set(jt.TEXTURE1),Mt.pixelStoreUnpackPremultiplyAlpha.set(!1),O.demTexture=O.demTexture||Ke.getTileTexture(Vr),O.demTexture){let Vi=O.demTexture;Vi.update(Wr,{premultiply:!1}),Vi.bind(jt.NEAREST,jt.CLAMP_TO_EDGE)}else O.demTexture=new g(Mt,Wr,jt.RGBA,{premultiply:!1}),O.demTexture.bind(jt.NEAREST,jt.CLAMP_TO_EDGE);Mt.activeTexture.set(jt.TEXTURE0);let Ti=O.fbo;if(!Ti){let Vi=new g(Mt,{width:kr,height:kr,data:null},jt.RGBA);Vi.bind(jt.LINEAR,jt.CLAMP_TO_EDGE),Ti=O.fbo=Mt.createFramebuffer(kr,kr,!0,!1),Ti.colorAttachment.set(Vi.texture)}Mt.bindFramebuffer.set(Ti.framebuffer),Mt.viewport.set([0,0,kr,kr]),Ke.useProgram("hillshadePrepare").draw(Mt,jt.TRIANGLES,Ie,Fe,qe,os.disabled,((Vi,et)=>{let lt=et.stride,Tt=n.H();return n.aP(Tt,0,n.X,-n.X,0,0,1),n.J(Tt,Tt,[0,-n.X,0]),{u_matrix:Tt,u_image:1,u_dimension:[lt,lt],u_zoom:Vi.overscaledZ,u_unpack:et.getUnpackVector()}})(O.tileID,tr),null,pe.id,Ke.rasterBoundsBuffer,Ke.quadTriangleIndexBuffer,Ke.rasterBoundsSegments),O.needsHillshadePrepare=!1}}function df(Ke,O,pe,Ie,Fe,qe){let Mt=Ie.paint.get("raster-fade-duration");if(!qe&&Mt>0){let jt=u.now(),tr=(jt-Ke.timeAdded)/Mt,kr=O?(jt-O.timeAdded)/Mt:-1,Vr=pe.getSource(),Wr=Fe.coveringZoomLevel({tileSize:Vr.tileSize,roundZoom:Vr.roundZoom}),Ti=!O||Math.abs(O.tileID.overscaledZ-Wr)>Math.abs(Ke.tileID.overscaledZ-Wr),Vi=Ti&&Ke.refreshedUponExpiration?1:n.ac(Ti?tr:1-kr,0,1);return Ke.refreshedUponExpiration&&tr>=1&&(Ke.refreshedUponExpiration=!1),O?{opacity:1,mix:1-Vi}:{opacity:Vi,mix:0}}return{opacity:1,mix:0}}let od=new n.aM(1,0,0,1),uu=new n.aM(0,1,0,1),jf=new n.aM(0,0,1,1),Jd=new n.aM(1,0,1,1),dd=new n.aM(0,1,1,1);function If(Ke,O,pe,Ie){Yc(Ke,0,O+pe/2,Ke.transform.width,pe,Ie)}function pd(Ke,O,pe,Ie){Yc(Ke,O-pe/2,0,pe,Ke.transform.height,Ie)}function Yc(Ke,O,pe,Ie,Fe,qe){let Mt=Ke.context,jt=Mt.gl;jt.enable(jt.SCISSOR_TEST),jt.scissor(O*Ke.pixelRatio,pe*Ke.pixelRatio,Ie*Ke.pixelRatio,Fe*Ke.pixelRatio),Mt.clear({color:qe}),jt.disable(jt.SCISSOR_TEST)}function md(Ke,O,pe){let Ie=Ke.context,Fe=Ie.gl,qe=pe.posMatrix,Mt=Ke.useProgram("debug"),jt=ll.disabled,tr=jl.disabled,kr=Ke.colorModeForRenderPass(),Vr="$debug",Wr=Ke.style.map.terrain&&Ke.style.map.terrain.getTerrainData(pe);Ie.activeTexture.set(Fe.TEXTURE0);let Ti=O.getTileByID(pe.key).latestRawTileData,Vi=Math.floor((Ti&&Ti.byteLength||0)/1024),et=O.getTile(pe).tileSize,lt=512/Math.min(et,512)*(pe.overscaledZ/Ke.transform.zoom)*.5,Tt=pe.canonical.toString();pe.overscaledZ!==pe.canonical.z&&(Tt+=` => ${pe.overscaledZ}`),function(Lt,Vt){Lt.initDebugOverlayCanvas();let Nt=Lt.debugOverlayCanvas,Xt=Lt.context.gl,Pr=Lt.debugOverlayCanvas.getContext("2d");Pr.clearRect(0,0,Nt.width,Nt.height),Pr.shadowColor="white",Pr.shadowBlur=2,Pr.lineWidth=1.5,Pr.strokeStyle="white",Pr.textBaseline="top",Pr.font="bold 36px Open Sans, sans-serif",Pr.fillText(Vt,5,5),Pr.strokeText(Vt,5,5),Lt.debugOverlayTexture.update(Nt),Lt.debugOverlayTexture.bind(Xt.LINEAR,Xt.CLAMP_TO_EDGE)}(Ke,`${Tt} ${Vi}kB`),Mt.draw(Ie,Fe.TRIANGLES,jt,tr,Mu.alphaBlended,os.disabled,Ao(qe,n.aM.transparent,lt),null,Vr,Ke.debugBuffer,Ke.quadTriangleIndexBuffer,Ke.debugSegments),Mt.draw(Ie,Fe.LINE_STRIP,jt,tr,kr,os.disabled,Ao(qe,n.aM.red),Wr,Vr,Ke.debugBuffer,Ke.tileBorderIndexBuffer,Ke.debugSegments)}function Vu(Ke,O,pe){let Ie=Ke.context,Fe=Ie.gl,qe=Ke.colorModeForRenderPass(),Mt=new ll(Fe.LEQUAL,ll.ReadWrite,Ke.depthRangeFor3D),jt=Ke.useProgram("terrain"),tr=O.getTerrainMesh();Ie.bindFramebuffer.set(null),Ie.viewport.set([0,0,Ke.width,Ke.height]);for(let kr of pe){let Vr=Ke.renderToTexture.getTexture(kr),Wr=O.getTerrainData(kr.tileID);Ie.activeTexture.set(Fe.TEXTURE0),Fe.bindTexture(Fe.TEXTURE_2D,Vr.texture);let Ti=Ke.transform.calculatePosMatrix(kr.tileID.toUnwrapped()),Vi=O.getMeshFrameDelta(Ke.transform.zoom),et=Ke.transform.calculateFogMatrix(kr.tileID.toUnwrapped()),lt=Qr(Ti,Vi,et,Ke.style.sky,Ke.transform.pitch);jt.draw(Ie,Fe.TRIANGLES,Mt,jl.disabled,qe,os.backCCW,lt,Wr,"terrain",tr.vertexBuffer,tr.indexBuffer,tr.segments)}}class Xc{constructor(O,pe,Ie){this.vertexBuffer=O,this.indexBuffer=pe,this.segments=Ie}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class tf{constructor(O,pe){this.context=new Xd(O),this.transform=pe,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Qt.maxUnderzooming+Qt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ai}resize(O,pe,Ie){if(this.width=Math.floor(O*Ie),this.height=Math.floor(pe*Ie),this.pixelRatio=Ie,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let Fe of this.style._order)this.style._layers[Fe].resize()}setup(){let O=this.context,pe=new n.aX;pe.emplaceBack(0,0),pe.emplaceBack(n.X,0),pe.emplaceBack(0,n.X),pe.emplaceBack(n.X,n.X),this.tileExtentBuffer=O.createVertexBuffer(pe,Pi.members),this.tileExtentSegments=n.a0.simpleSegment(0,0,4,2);let Ie=new n.aX;Ie.emplaceBack(0,0),Ie.emplaceBack(n.X,0),Ie.emplaceBack(0,n.X),Ie.emplaceBack(n.X,n.X),this.debugBuffer=O.createVertexBuffer(Ie,Pi.members),this.debugSegments=n.a0.simpleSegment(0,0,4,5);let Fe=new n.$;Fe.emplaceBack(0,0,0,0),Fe.emplaceBack(n.X,0,n.X,0),Fe.emplaceBack(0,n.X,0,n.X),Fe.emplaceBack(n.X,n.X,n.X,n.X),this.rasterBoundsBuffer=O.createVertexBuffer(Fe,tt.members),this.rasterBoundsSegments=n.a0.simpleSegment(0,0,4,2);let qe=new n.aX;qe.emplaceBack(0,0),qe.emplaceBack(1,0),qe.emplaceBack(0,1),qe.emplaceBack(1,1),this.viewportBuffer=O.createVertexBuffer(qe,Pi.members),this.viewportSegments=n.a0.simpleSegment(0,0,4,2);let Mt=new n.aZ;Mt.emplaceBack(0),Mt.emplaceBack(1),Mt.emplaceBack(3),Mt.emplaceBack(2),Mt.emplaceBack(0),this.tileBorderIndexBuffer=O.createIndexBuffer(Mt);let jt=new n.aY;jt.emplaceBack(0,1,2),jt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=O.createIndexBuffer(jt);let tr=this.context.gl;this.stencilClearMode=new jl({func:tr.ALWAYS,mask:0},0,255,tr.ZERO,tr.ZERO,tr.ZERO)}clearStencil(){let O=this.context,pe=O.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let Ie=n.H();n.aP(Ie,0,this.width,this.height,0,0,1),n.K(Ie,Ie,[pe.drawingBufferWidth,pe.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(O,pe.TRIANGLES,ll.disabled,this.stencilClearMode,Mu.disabled,os.disabled,Wo(Ie),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(O,pe){if(this.currentStencilSource===O.source||!O.isTileClipped()||!pe||!pe.length)return;this.currentStencilSource=O.source;let Ie=this.context,Fe=Ie.gl;this.nextStencilID+pe.length>256&&this.clearStencil(),Ie.setColorMode(Mu.disabled),Ie.setDepthMode(ll.disabled);let qe=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let Mt of pe){let jt=this._tileClippingMaskIDs[Mt.key]=this.nextStencilID++,tr=this.style.map.terrain&&this.style.map.terrain.getTerrainData(Mt);qe.draw(Ie,Fe.TRIANGLES,ll.disabled,new jl({func:Fe.ALWAYS,mask:0},jt,255,Fe.KEEP,Fe.KEEP,Fe.REPLACE),Mu.disabled,os.disabled,Wo(Mt.posMatrix),tr,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let O=this.nextStencilID++,pe=this.context.gl;return new jl({func:pe.NOTEQUAL,mask:255},O,255,pe.KEEP,pe.KEEP,pe.REPLACE)}stencilModeForClipping(O){let pe=this.context.gl;return new jl({func:pe.EQUAL,mask:255},this._tileClippingMaskIDs[O.key],0,pe.KEEP,pe.KEEP,pe.REPLACE)}stencilConfigForOverlap(O){let pe=this.context.gl,Ie=O.sort((Mt,jt)=>jt.overscaledZ-Mt.overscaledZ),Fe=Ie[Ie.length-1].overscaledZ,qe=Ie[0].overscaledZ-Fe+1;if(qe>1){this.currentStencilSource=void 0,this.nextStencilID+qe>256&&this.clearStencil();let Mt={};for(let jt=0;jt({u_sky_color:Lt.properties.get("sky-color"),u_horizon_color:Lt.properties.get("horizon-color"),u_horizon:(Vt.height/2+Vt.getHorizon())*Nt,u_sky_horizon_blend:Lt.properties.get("sky-horizon-blend")*Vt.height/2*Nt}))(kr,tr.style.map.transform,tr.pixelRatio),Vi=new ll(Wr.LEQUAL,ll.ReadWrite,[0,1]),et=jl.disabled,lt=tr.colorModeForRenderPass(),Tt=tr.useProgram("sky");if(!kr.mesh){let Lt=new n.aX;Lt.emplaceBack(-1,-1),Lt.emplaceBack(1,-1),Lt.emplaceBack(1,1),Lt.emplaceBack(-1,1);let Vt=new n.aY;Vt.emplaceBack(0,1,2),Vt.emplaceBack(0,2,3),kr.mesh=new Xc(Vr.createVertexBuffer(Lt,Pi.members),Vr.createIndexBuffer(Vt),n.a0.simpleSegment(0,0,Lt.length,Vt.length))}Tt.draw(Vr,Wr.TRIANGLES,Vi,et,lt,os.disabled,Ti,void 0,"sky",kr.mesh.vertexBuffer,kr.mesh.indexBuffer,kr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=pe.showOverdrawInspector,this.depthRangeFor3D=[0,1-(O._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Ie.length-1;this.currentLayer>=0;this.currentLayer--){let tr=this.style._layers[Ie[this.currentLayer]],kr=Fe[tr.source],Vr=qe[tr.source];this._renderTileClippingMasks(tr,Vr),this.renderLayer(this,kr,tr,Vr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerTt.source&&!Tt.isHidden(Vr)?[kr.sourceCaches[Tt.source]]:[]),Vi=Ti.filter(Tt=>Tt.getSource().type==="vector"),et=Ti.filter(Tt=>Tt.getSource().type!=="vector"),lt=Tt=>{(!Wr||Wr.getSource().maxzoomlt(Tt)),Wr||et.forEach(Tt=>lt(Tt)),Wr}(this.style,this.transform.zoom);tr&&function(kr,Vr,Wr){for(let Ti=0;Ti0),Fe&&(n.b0(pe,Ie),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(qe,Mt){let jt=qe.context,tr=jt.gl,kr=Mu.unblended,Vr=new ll(tr.LEQUAL,ll.ReadWrite,[0,1]),Wr=Mt.getTerrainMesh(),Ti=Mt.sourceCache.getRenderableTiles(),Vi=qe.useProgram("terrainDepth");jt.bindFramebuffer.set(Mt.getFramebuffer("depth").framebuffer),jt.viewport.set([0,0,qe.width/devicePixelRatio,qe.height/devicePixelRatio]),jt.clear({color:n.aM.transparent,depth:1});for(let et of Ti){let lt=Mt.getTerrainData(et.tileID),Tt={u_matrix:qe.transform.calculatePosMatrix(et.tileID.toUnwrapped()),u_ele_delta:Mt.getMeshFrameDelta(qe.transform.zoom)};Vi.draw(jt,tr.TRIANGLES,Vr,jl.disabled,kr,os.backCCW,Tt,lt,"terrain",Wr.vertexBuffer,Wr.indexBuffer,Wr.segments)}jt.bindFramebuffer.set(null),jt.viewport.set([0,0,qe.width,qe.height])}(this,this.style.map.terrain),function(qe,Mt){let jt=qe.context,tr=jt.gl,kr=Mu.unblended,Vr=new ll(tr.LEQUAL,ll.ReadWrite,[0,1]),Wr=Mt.getTerrainMesh(),Ti=Mt.getCoordsTexture(),Vi=Mt.sourceCache.getRenderableTiles(),et=qe.useProgram("terrainCoords");jt.bindFramebuffer.set(Mt.getFramebuffer("coords").framebuffer),jt.viewport.set([0,0,qe.width/devicePixelRatio,qe.height/devicePixelRatio]),jt.clear({color:n.aM.transparent,depth:1}),Mt.coordsIndex=[];for(let lt of Vi){let Tt=Mt.getTerrainData(lt.tileID);jt.activeTexture.set(tr.TEXTURE0),tr.bindTexture(tr.TEXTURE_2D,Ti.texture);let Lt={u_matrix:qe.transform.calculatePosMatrix(lt.tileID.toUnwrapped()),u_terrain_coords_id:(255-Mt.coordsIndex.length)/255,u_texture:0,u_ele_delta:Mt.getMeshFrameDelta(qe.transform.zoom)};et.draw(jt,tr.TRIANGLES,Vr,jl.disabled,kr,os.backCCW,Lt,Tt,"terrain",Wr.vertexBuffer,Wr.indexBuffer,Wr.segments),Mt.coordsIndex.push(lt.tileID.key)}jt.bindFramebuffer.set(null),jt.viewport.set([0,0,qe.width,qe.height])}(this,this.style.map.terrain))}renderLayer(O,pe,Ie,Fe){if(!Ie.isHidden(this.transform.zoom)&&(Ie.type==="background"||Ie.type==="custom"||(Fe||[]).length))switch(this.id=Ie.id,Ie.type){case"symbol":(function(qe,Mt,jt,tr,kr){if(qe.renderPass!=="translucent")return;let Vr=jl.disabled,Wr=qe.colorModeForRenderPass();(jt._unevaluatedLayout.hasValue("text-variable-anchor")||jt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Ti,Vi,et,lt,Tt,Lt,Vt,Nt,Xt){let Pr=Vi.transform,Hr=sa(),Zr=Tt==="map",pi=Lt==="map";for(let zi of Ti){let Ki=lt.getTile(zi),rn=Ki.getBucket(et);if(!rn||!rn.text||!rn.text.segments.get().length)continue;let kn=n.ag(rn.textSizeData,Pr.zoom),Qn=cn(Ki,1,Vi.transform.zoom),Ca=ci(zi.posMatrix,pi,Zr,Vi.transform,Qn),Ta=et.layout.get("icon-text-fit")!=="none"&&rn.hasIconData();if(kn){let Ba=Math.pow(2,Pr.zoom-Ki.tileID.overscaledZ),xo=Vi.style.map.terrain?(Bo,_s)=>Vi.style.map.terrain.getElevation(zi,Bo,_s):null,Go=Hr.translatePosition(Pr,Ki,Vt,Nt);Lf(rn,Zr,pi,Xt,Pr,Ca,zi.posMatrix,Ba,kn,Ta,Hr,Go,zi.toUnwrapped(),xo)}}}(tr,qe,jt,Mt,jt.layout.get("text-rotation-alignment"),jt.layout.get("text-pitch-alignment"),jt.paint.get("text-translate"),jt.paint.get("text-translate-anchor"),kr),jt.paint.get("icon-opacity").constantOr(1)!==0&&Pd(qe,Mt,jt,tr,!1,jt.paint.get("icon-translate"),jt.paint.get("icon-translate-anchor"),jt.layout.get("icon-rotation-alignment"),jt.layout.get("icon-pitch-alignment"),jt.layout.get("icon-keep-upright"),Vr,Wr),jt.paint.get("text-opacity").constantOr(1)!==0&&Pd(qe,Mt,jt,tr,!0,jt.paint.get("text-translate"),jt.paint.get("text-translate-anchor"),jt.layout.get("text-rotation-alignment"),jt.layout.get("text-pitch-alignment"),jt.layout.get("text-keep-upright"),Vr,Wr),Mt.map.showCollisionBoxes&&(yh(qe,Mt,jt,tr,!0),yh(qe,Mt,jt,tr,!1))})(O,pe,Ie,Fe,this.style.placement.variableOffsets);break;case"circle":(function(qe,Mt,jt,tr){if(qe.renderPass!=="translucent")return;let kr=jt.paint.get("circle-opacity"),Vr=jt.paint.get("circle-stroke-width"),Wr=jt.paint.get("circle-stroke-opacity"),Ti=!jt.layout.get("circle-sort-key").isConstant();if(kr.constantOr(1)===0&&(Vr.constantOr(1)===0||Wr.constantOr(1)===0))return;let Vi=qe.context,et=Vi.gl,lt=qe.depthModeForSublayer(0,ll.ReadOnly),Tt=jl.disabled,Lt=qe.colorModeForRenderPass(),Vt=[];for(let Nt=0;NtNt.sortKey-Xt.sortKey);for(let Nt of Vt){let{programConfiguration:Xt,program:Pr,layoutVertexBuffer:Hr,indexBuffer:Zr,uniformValues:pi,terrainData:zi}=Nt.state;Pr.draw(Vi,et.TRIANGLES,lt,Tt,Lt,os.disabled,pi,zi,jt.id,Hr,Zr,Nt.segments,jt.paint,qe.transform.zoom,Xt)}})(O,pe,Ie,Fe);break;case"heatmap":(function(qe,Mt,jt,tr){if(jt.paint.get("heatmap-opacity")===0)return;let kr=qe.context;if(qe.style.map.terrain){for(let Vr of tr){let Wr=Mt.getTile(Vr);Mt.hasRenderableParent(Vr)||(qe.renderPass==="offscreen"?Pf(qe,Wr,jt,Vr):qe.renderPass==="translucent"&&ef(qe,jt,Vr))}kr.viewport.set([0,0,qe.width,qe.height])}else qe.renderPass==="offscreen"?function(Vr,Wr,Ti,Vi){let et=Vr.context,lt=et.gl,Tt=jl.disabled,Lt=new Mu([lt.ONE,lt.ONE],n.aM.transparent,[!0,!0,!0,!0]);(function(Vt,Nt,Xt){let Pr=Vt.gl;Vt.activeTexture.set(Pr.TEXTURE1),Vt.viewport.set([0,0,Nt.width/4,Nt.height/4]);let Hr=Xt.heatmapFbos.get(n.aU);Hr?(Pr.bindTexture(Pr.TEXTURE_2D,Hr.colorAttachment.get()),Vt.bindFramebuffer.set(Hr.framebuffer)):(Hr=nd(Vt,Nt.width/4,Nt.height/4),Xt.heatmapFbos.set(n.aU,Hr))})(et,Vr,Ti),et.clear({color:n.aM.transparent});for(let Vt=0;Vt20&&Vr.texParameterf(Vr.TEXTURE_2D,kr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,kr.extTextureFilterAnisotropicMax);let rn=qe.style.map.terrain&&qe.style.map.terrain.getTerrainData(Vt),kn=rn?Vt:null,Qn=kn?kn.posMatrix:qe.transform.calculatePosMatrix(Vt.toUnwrapped(),Lt),Ca=Gl(Qn,zi||[0,0],pi||1,Zr,jt);Wr instanceof _t?Ti.draw(kr,Vr.TRIANGLES,Nt,jl.disabled,Vi,os.disabled,Ca,rn,jt.id,Wr.boundsBuffer,qe.quadTriangleIndexBuffer,Wr.boundsSegments):Ti.draw(kr,Vr.TRIANGLES,Nt,et[Vt.overscaledZ],Vi,os.disabled,Ca,rn,jt.id,qe.rasterBoundsBuffer,qe.quadTriangleIndexBuffer,qe.rasterBoundsSegments)}})(O,pe,Ie,Fe);break;case"background":(function(qe,Mt,jt,tr){let kr=jt.paint.get("background-color"),Vr=jt.paint.get("background-opacity");if(Vr===0)return;let Wr=qe.context,Ti=Wr.gl,Vi=qe.transform,et=Vi.tileSize,lt=jt.paint.get("background-pattern");if(qe.isPatternMissing(lt))return;let Tt=!lt&&kr.a===1&&Vr===1&&qe.opaquePassEnabledForLayer()?"opaque":"translucent";if(qe.renderPass!==Tt)return;let Lt=jl.disabled,Vt=qe.depthModeForSublayer(0,Tt==="opaque"?ll.ReadWrite:ll.ReadOnly),Nt=qe.colorModeForRenderPass(),Xt=qe.useProgram(lt?"backgroundPattern":"background"),Pr=tr||Vi.coveringTiles({tileSize:et,terrain:qe.style.map.terrain});lt&&(Wr.activeTexture.set(Ti.TEXTURE0),qe.imageManager.bind(qe.context));let Hr=jt.getCrossfadeParameters();for(let Zr of Pr){let pi=tr?Zr.posMatrix:qe.transform.calculatePosMatrix(Zr.toUnwrapped()),zi=lt?Jl(pi,Vr,qe,lt,{tileID:Zr,tileSize:et},Hr):Il(pi,Vr,kr),Ki=qe.style.map.terrain&&qe.style.map.terrain.getTerrainData(Zr);Xt.draw(Wr,Ti.TRIANGLES,Vt,Lt,Nt,os.disabled,zi,Ki,jt.id,qe.tileExtentBuffer,qe.quadTriangleIndexBuffer,qe.tileExtentSegments)}})(O,0,Ie,Fe);break;case"custom":(function(qe,Mt,jt){let tr=qe.context,kr=jt.implementation;if(qe.renderPass==="offscreen"){let Vr=kr.prerender;Vr&&(qe.setCustomLayerDefaults(),tr.setColorMode(qe.colorModeForRenderPass()),Vr.call(kr,tr.gl,qe.transform.customLayerMatrix()),tr.setDirty(),qe.setBaseState())}else if(qe.renderPass==="translucent"){qe.setCustomLayerDefaults(),tr.setColorMode(qe.colorModeForRenderPass()),tr.setStencilMode(jl.disabled);let Vr=kr.renderingMode==="3d"?new ll(qe.context.gl.LEQUAL,ll.ReadWrite,qe.depthRangeFor3D):qe.depthModeForSublayer(0,ll.ReadOnly);tr.setDepthMode(Vr),kr.render(tr.gl,qe.transform.customLayerMatrix(),{farZ:qe.transform.farZ,nearZ:qe.transform.nearZ,fov:qe.transform._fov,modelViewProjectionMatrix:qe.transform.modelViewProjectionMatrix,projectionMatrix:qe.transform.projectionMatrix}),tr.setDirty(),qe.setBaseState(),tr.bindFramebuffer.set(null)}})(O,0,Ie)}}translatePosMatrix(O,pe,Ie,Fe,qe){if(!Ie[0]&&!Ie[1])return O;let Mt=qe?Fe==="map"?this.transform.angle:0:Fe==="viewport"?-this.transform.angle:0;if(Mt){let kr=Math.sin(Mt),Vr=Math.cos(Mt);Ie=[Ie[0]*Vr-Ie[1]*kr,Ie[0]*kr+Ie[1]*Vr]}let jt=[qe?Ie[0]:cn(pe,Ie[0],this.transform.zoom),qe?Ie[1]:cn(pe,Ie[1],this.transform.zoom),0],tr=new Float32Array(16);return n.J(tr,O,jt),tr}saveTileTexture(O){let pe=this._tileTextures[O.size[0]];pe?pe.push(O):this._tileTextures[O.size[0]]=[O]}getTileTexture(O){let pe=this._tileTextures[O];return pe&&pe.length>0?pe.pop():null}isPatternMissing(O){if(!O)return!1;if(!O.from||!O.to)return!0;let pe=this.imageManager.getPattern(O.from.toString()),Ie=this.imageManager.getPattern(O.to.toString());return!pe||!Ie}useProgram(O,pe){this.cache=this.cache||{};let Ie=O+(pe?pe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Ie]||(this.cache[Ie]=new en(this.context,xi[O],pe,ou[O],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Ie]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let O=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(O.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new g(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:O,drawingBufferHeight:pe}=this.context.gl;return this.width!==O||this.height!==pe}}class _u{constructor(O,pe){this.points=O,this.planes=pe}static fromInvProjectionMatrix(O,pe,Ie){let Fe=Math.pow(2,Ie),qe=[[-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]].map(jt=>{let tr=1/(jt=n.af([],jt,O))[3]/pe*Fe;return n.b1(jt,jt,[tr,tr,1/jt[3],tr])}),Mt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(jt=>{let tr=function(Ti,Vi){var et=Vi[0],lt=Vi[1],Tt=Vi[2],Lt=et*et+lt*lt+Tt*Tt;return Lt>0&&(Lt=1/Math.sqrt(Lt)),Ti[0]=Vi[0]*Lt,Ti[1]=Vi[1]*Lt,Ti[2]=Vi[2]*Lt,Ti}([],function(Ti,Vi,et){var lt=Vi[0],Tt=Vi[1],Lt=Vi[2],Vt=et[0],Nt=et[1],Xt=et[2];return Ti[0]=Tt*Xt-Lt*Nt,Ti[1]=Lt*Vt-lt*Xt,Ti[2]=lt*Nt-Tt*Vt,Ti}([],E([],qe[jt[0]],qe[jt[1]]),E([],qe[jt[2]],qe[jt[1]]))),kr=-((Vr=tr)[0]*(Wr=qe[jt[1]])[0]+Vr[1]*Wr[1]+Vr[2]*Wr[2]);var Vr,Wr;return tr.concat(kr)});return new _u(qe,Mt)}}class jh{constructor(O,pe){this.min=O,this.max=pe,this.center=function(Ie,Fe,qe){return Ie[0]=.5*Fe[0],Ie[1]=.5*Fe[1],Ie[2]=.5*Fe[2],Ie}([],function(Ie,Fe,qe){return Ie[0]=Fe[0]+qe[0],Ie[1]=Fe[1]+qe[1],Ie[2]=Fe[2]+qe[2],Ie}([],this.min,this.max))}quadrant(O){let pe=[O%2==0,O<2],Ie=w(this.min),Fe=w(this.max);for(let qe=0;qe=0&&Mt++;if(Mt===0)return 0;Mt!==pe.length&&(Ie=!1)}if(Ie)return 2;for(let Fe=0;Fe<3;Fe++){let qe=Number.MAX_VALUE,Mt=-Number.MAX_VALUE;for(let jt=0;jtthis.max[Fe]-this.min[Fe])return 0}return 1}}class Fc{constructor(O=0,pe=0,Ie=0,Fe=0){if(isNaN(O)||O<0||isNaN(pe)||pe<0||isNaN(Ie)||Ie<0||isNaN(Fe)||Fe<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=O,this.bottom=pe,this.left=Ie,this.right=Fe}interpolate(O,pe,Ie){return pe.top!=null&&O.top!=null&&(this.top=n.y.number(O.top,pe.top,Ie)),pe.bottom!=null&&O.bottom!=null&&(this.bottom=n.y.number(O.bottom,pe.bottom,Ie)),pe.left!=null&&O.left!=null&&(this.left=n.y.number(O.left,pe.left,Ie)),pe.right!=null&&O.right!=null&&(this.right=n.y.number(O.right,pe.right,Ie)),this}getCenter(O,pe){let Ie=n.ac((this.left+O-this.right)/2,0,O),Fe=n.ac((this.top+pe-this.bottom)/2,0,pe);return new n.P(Ie,Fe)}equals(O){return this.top===O.top&&this.bottom===O.bottom&&this.left===O.left&&this.right===O.right}clone(){return new Fc(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}let Jc=85.051129;class Eu{constructor(O,pe,Ie,Fe,qe){this.tileSize=512,this._renderWorldCopies=qe===void 0||!!qe,this._minZoom=O||0,this._maxZoom=pe||22,this._minPitch=Ie??0,this._maxPitch=Fe??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new n.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Fc,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){let O=new Eu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return O.apply(this),O}apply(O){this.tileSize=O.tileSize,this.latRange=O.latRange,this.lngRange=O.lngRange,this.width=O.width,this.height=O.height,this._center=O._center,this._elevation=O._elevation,this.minElevationForCurrentTile=O.minElevationForCurrentTile,this.zoom=O.zoom,this.angle=O.angle,this._fov=O._fov,this._pitch=O._pitch,this._unmodified=O._unmodified,this._edgeInsets=O._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(O){this._minZoom!==O&&(this._minZoom=O,this.zoom=Math.max(this.zoom,O))}get maxZoom(){return this._maxZoom}set maxZoom(O){this._maxZoom!==O&&(this._maxZoom=O,this.zoom=Math.min(this.zoom,O))}get minPitch(){return this._minPitch}set minPitch(O){this._minPitch!==O&&(this._minPitch=O,this.pitch=Math.max(this.pitch,O))}get maxPitch(){return this._maxPitch}set maxPitch(O){this._maxPitch!==O&&(this._maxPitch=O,this.pitch=Math.min(this.pitch,O))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(O){O===void 0?O=!0:O===null&&(O=!1),this._renderWorldCopies=O}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(O){let pe=-n.b3(O,-180,180)*Math.PI/180;this.angle!==pe&&(this._unmodified=!1,this.angle=pe,this._calcMatrices(),this.rotationMatrix=function(){var Ie=new n.A(4);return n.A!=Float32Array&&(Ie[1]=0,Ie[2]=0),Ie[0]=1,Ie[3]=1,Ie}(),function(Ie,Fe,qe){var Mt=Fe[0],jt=Fe[1],tr=Fe[2],kr=Fe[3],Vr=Math.sin(qe),Wr=Math.cos(qe);Ie[0]=Mt*Wr+tr*Vr,Ie[1]=jt*Wr+kr*Vr,Ie[2]=Mt*-Vr+tr*Wr,Ie[3]=jt*-Vr+kr*Wr}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(O){let pe=n.ac(O,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==pe&&(this._unmodified=!1,this._pitch=pe,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(O){O=Math.max(.01,Math.min(60,O)),this._fov!==O&&(this._unmodified=!1,this._fov=O/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(O){let pe=Math.min(Math.max(O,this.minZoom),this.maxZoom);this._zoom!==pe&&(this._unmodified=!1,this._zoom=pe,this.tileZoom=Math.max(0,Math.floor(pe)),this.scale=this.zoomScale(pe),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(O){O.lat===this._center.lat&&O.lng===this._center.lng||(this._unmodified=!1,this._center=O,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(O){O!==this._elevation&&(this._elevation=O,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(O){this._edgeInsets.equals(O)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,O,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(O){return this._edgeInsets.equals(O)}interpolatePadding(O,pe,Ie){this._unmodified=!1,this._edgeInsets.interpolate(O,pe,Ie),this._constrain(),this._calcMatrices()}coveringZoomLevel(O){let pe=(O.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/O.tileSize));return Math.max(0,pe)}getVisibleUnwrappedCoordinates(O){let pe=[new n.b4(0,O)];if(this._renderWorldCopies){let Ie=this.pointCoordinate(new n.P(0,0)),Fe=this.pointCoordinate(new n.P(this.width,0)),qe=this.pointCoordinate(new n.P(this.width,this.height)),Mt=this.pointCoordinate(new n.P(0,this.height)),jt=Math.floor(Math.min(Ie.x,Fe.x,qe.x,Mt.x)),tr=Math.floor(Math.max(Ie.x,Fe.x,qe.x,Mt.x)),kr=1;for(let Vr=jt-kr;Vr<=tr+kr;Vr++)Vr!==0&&pe.push(new n.b4(Vr,O))}return pe}coveringTiles(O){var pe,Ie;let Fe=this.coveringZoomLevel(O),qe=Fe;if(O.minzoom!==void 0&&FeO.maxzoom&&(Fe=O.maxzoom);let Mt=this.pointCoordinate(this.getCameraPoint()),jt=n.Z.fromLngLat(this.center),tr=Math.pow(2,Fe),kr=[tr*Mt.x,tr*Mt.y,0],Vr=[tr*jt.x,tr*jt.y,0],Wr=_u.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Fe),Ti=O.minzoom||0;!O.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Ti=Fe);let Vi=O.terrain?2/Math.min(this.tileSize,O.tileSize)*this.tileSize:3,et=Nt=>({aabb:new jh([Nt*tr,0,0],[(Nt+1)*tr,tr,0]),zoom:0,x:0,y:0,wrap:Nt,fullyVisible:!1}),lt=[],Tt=[],Lt=Fe,Vt=O.reparseOverscaled?qe:Fe;if(this._renderWorldCopies)for(let Nt=1;Nt<=3;Nt++)lt.push(et(-Nt)),lt.push(et(Nt));for(lt.push(et(0));lt.length>0;){let Nt=lt.pop(),Xt=Nt.x,Pr=Nt.y,Hr=Nt.fullyVisible;if(!Hr){let rn=Nt.aabb.intersects(Wr);if(rn===0)continue;Hr=rn===2}let Zr=O.terrain?kr:Vr,pi=Nt.aabb.distanceX(Zr),zi=Nt.aabb.distanceY(Zr),Ki=Math.max(Math.abs(pi),Math.abs(zi));if(Nt.zoom===Lt||Ki>Vi+(1<=Ti){let rn=Lt-Nt.zoom,kn=kr[0]-.5-(Xt<>1),Ca=Nt.zoom+1,Ta=Nt.aabb.quadrant(rn);if(O.terrain){let Ba=new n.S(Ca,Nt.wrap,Ca,kn,Qn),xo=O.terrain.getMinMaxElevation(Ba),Go=(pe=xo.minElevation)!==null&&pe!==void 0?pe:this.elevation,Bo=(Ie=xo.maxElevation)!==null&&Ie!==void 0?Ie:this.elevation;Ta=new jh([Ta.min[0],Ta.min[1],Go],[Ta.max[0],Ta.max[1],Bo])}lt.push({aabb:Ta,zoom:Ca,x:kn,y:Qn,wrap:Nt.wrap,fullyVisible:Hr})}}return Tt.sort((Nt,Xt)=>Nt.distanceSq-Xt.distanceSq).map(Nt=>Nt.tileID)}resize(O,pe){this.width=O,this.height=pe,this.pixelsToGLUnits=[2/O,-2/pe],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(O){return Math.pow(2,O)}scaleZoom(O){return Math.log(O)/Math.LN2}project(O){let pe=n.ac(O.lat,-85.051129,Jc);return new n.P(n.O(O.lng)*this.worldSize,n.Q(pe)*this.worldSize)}unproject(O){return new n.Z(O.x/this.worldSize,O.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(O){let pe=this.elevation,Ie=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Fe=this.pointLocation(this.centerPoint,O),qe=O.getElevationForLngLatZoom(Fe,this.tileZoom);if(!(this.elevation-qe))return;let Mt=Ie+pe-qe,jt=Math.cos(this._pitch)*this.cameraToCenterDistance/Mt/n.b5(1,Fe.lat),tr=this.scaleZoom(jt/this.tileSize);this._elevation=qe,this._center=Fe,this.zoom=tr}setLocationAtPoint(O,pe){let Ie=this.pointCoordinate(pe),Fe=this.pointCoordinate(this.centerPoint),qe=this.locationCoordinate(O),Mt=new n.Z(qe.x-(Ie.x-Fe.x),qe.y-(Ie.y-Fe.y));this.center=this.coordinateLocation(Mt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(O,pe){return pe?this.coordinatePoint(this.locationCoordinate(O),pe.getElevationForLngLatZoom(O,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(O))}pointLocation(O,pe){return this.coordinateLocation(this.pointCoordinate(O,pe))}locationCoordinate(O){return n.Z.fromLngLat(O)}coordinateLocation(O){return O&&O.toLngLat()}pointCoordinate(O,pe){if(pe){let Ti=pe.pointCoordinate(O);if(Ti!=null)return Ti}let Ie=[O.x,O.y,0,1],Fe=[O.x,O.y,1,1];n.af(Ie,Ie,this.pixelMatrixInverse),n.af(Fe,Fe,this.pixelMatrixInverse);let qe=Ie[3],Mt=Fe[3],jt=Ie[1]/qe,tr=Fe[1]/Mt,kr=Ie[2]/qe,Vr=Fe[2]/Mt,Wr=kr===Vr?0:(0-kr)/(Vr-kr);return new n.Z(n.y.number(Ie[0]/qe,Fe[0]/Mt,Wr)/this.worldSize,n.y.number(jt,tr,Wr)/this.worldSize)}coordinatePoint(O,pe=0,Ie=this.pixelMatrix){let Fe=[O.x*this.worldSize,O.y*this.worldSize,pe,1];return n.af(Fe,Fe,Ie),new n.P(Fe[0]/Fe[3],Fe[1]/Fe[3])}getBounds(){let O=Math.max(0,this.height/2-this.getHorizon());return new fe().extend(this.pointLocation(new n.P(0,O))).extend(this.pointLocation(new n.P(this.width,O))).extend(this.pointLocation(new n.P(this.width,this.height))).extend(this.pointLocation(new n.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new fe([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(O){O?(this.lngRange=[O.getWest(),O.getEast()],this.latRange=[O.getSouth(),O.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Jc])}calculateTileMatrix(O){let pe=O.canonical,Ie=this.worldSize/this.zoomScale(pe.z),Fe=pe.x+Math.pow(2,pe.z)*O.wrap,qe=n.an(new Float64Array(16));return n.J(qe,qe,[Fe*Ie,pe.y*Ie,0]),n.K(qe,qe,[Ie/n.X,Ie/n.X,1]),qe}calculatePosMatrix(O,pe=!1){let Ie=O.key,Fe=pe?this._alignedPosMatrixCache:this._posMatrixCache;if(Fe[Ie])return Fe[Ie];let qe=this.calculateTileMatrix(O);return n.L(qe,pe?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,qe),Fe[Ie]=new Float32Array(qe),Fe[Ie]}calculateFogMatrix(O){let pe=O.key,Ie=this._fogMatrixCache;if(Ie[pe])return Ie[pe];let Fe=this.calculateTileMatrix(O);return n.L(Fe,this.fogMatrix,Fe),Ie[pe]=new Float32Array(Fe),Ie[pe]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(O,pe){pe=n.ac(+pe,this.minZoom,this.maxZoom);let Ie={center:new n.N(O.lng,O.lat),zoom:pe},Fe=this.lngRange;if(!this._renderWorldCopies&&Fe===null){let Nt=179.9999999999;Fe=[-Nt,Nt]}let qe=this.tileSize*this.zoomScale(Ie.zoom),Mt=0,jt=qe,tr=0,kr=qe,Vr=0,Wr=0,{x:Ti,y:Vi}=this.size;if(this.latRange){let Nt=this.latRange;Mt=n.Q(Nt[1])*qe,jt=n.Q(Nt[0])*qe,jt-Mtjt&&(Lt=jt-Nt)}if(Fe){let Nt=(tr+kr)/2,Xt=et;this._renderWorldCopies&&(Xt=n.b3(et,Nt-qe/2,Nt+qe/2));let Pr=Ti/2;Xt-Prkr&&(Tt=kr-Pr)}if(Tt!==void 0||Lt!==void 0){let Nt=new n.P(Tt??et,Lt??lt);Ie.center=this.unproject.call({worldSize:qe},Nt).wrap()}return Ie}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let O=this._unmodified,{center:pe,zoom:Ie}=this.getConstrained(this.center,this.zoom);this.center=pe,this.zoom=Ie,this._unmodified=O,this._constraining=!1}_calcMatrices(){if(!this.height)return;let O=this.centerOffset,pe=this.point.x,Ie=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=n.b5(1,this.center.lat)*this.worldSize;let Fe=n.an(new Float64Array(16));n.K(Fe,Fe,[this.width/2,-this.height/2,1]),n.J(Fe,Fe,[1,-1,0]),this.labelPlaneMatrix=Fe,Fe=n.an(new Float64Array(16)),n.K(Fe,Fe,[1,-1,1]),n.J(Fe,Fe,[-1,-1,0]),n.K(Fe,Fe,[2/this.width,2/this.height,1]),this.glCoordMatrix=Fe;let qe=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),Mt=Math.min(this.elevation,this.minElevationForCurrentTile),jt=qe-Mt*this._pixelPerMeter/Math.cos(this._pitch),tr=Mt<0?jt:qe,kr=Math.PI/2+this._pitch,Vr=this._fov*(.5+O.y/this.height),Wr=Math.sin(Vr)*tr/Math.sin(n.ac(Math.PI-kr-Vr,.01,Math.PI-.01)),Ti=this.getHorizon(),Vi=2*Math.atan(Ti/this.cameraToCenterDistance)*(.5+O.y/(2*Ti)),et=Math.sin(Vi)*tr/Math.sin(n.ac(Math.PI-kr-Vi,.01,Math.PI-.01)),lt=Math.min(Wr,et);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*lt+tr),this.nearZ=this.height/50,Fe=new Float64Array(16),n.b6(Fe,this._fov,this.width/this.height,this.nearZ,this.farZ),Fe[8]=2*-O.x/this.width,Fe[9]=2*O.y/this.height,this.projectionMatrix=n.ae(Fe),n.K(Fe,Fe,[1,-1,1]),n.J(Fe,Fe,[0,0,-this.cameraToCenterDistance]),n.b7(Fe,Fe,this._pitch),n.ad(Fe,Fe,this.angle),n.J(Fe,Fe,[-pe,-Ie,0]),this.mercatorMatrix=n.K([],Fe,[this.worldSize,this.worldSize,this.worldSize]),n.K(Fe,Fe,[1,1,this._pixelPerMeter]),this.pixelMatrix=n.L(new Float64Array(16),this.labelPlaneMatrix,Fe),n.J(Fe,Fe,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Fe,this.invModelViewProjectionMatrix=n.as([],Fe),this.fogMatrix=new Float64Array(16),n.b6(this.fogMatrix,this._fov,this.width/this.height,qe,this.farZ),this.fogMatrix[8]=2*-O.x/this.width,this.fogMatrix[9]=2*O.y/this.height,n.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),n.b7(this.fogMatrix,this.fogMatrix,this._pitch),n.ad(this.fogMatrix,this.fogMatrix,this.angle),n.J(this.fogMatrix,this.fogMatrix,[-pe,-Ie,0]),n.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),n.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=n.L(new Float64Array(16),this.labelPlaneMatrix,Fe);let Tt=this.width%2/2,Lt=this.height%2/2,Vt=Math.cos(this.angle),Nt=Math.sin(this.angle),Xt=pe-Math.round(pe)+Vt*Tt+Nt*Lt,Pr=Ie-Math.round(Ie)+Vt*Lt+Nt*Tt,Hr=new Float64Array(Fe);if(n.J(Hr,Hr,[Xt>.5?Xt-1:Xt,Pr>.5?Pr-1:Pr,0]),this.alignedModelViewProjectionMatrix=Hr,Fe=n.as(new Float64Array(16),this.pixelMatrix),!Fe)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Fe,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let O=this.pointCoordinate(new n.P(0,0)),pe=[O.x*this.worldSize,O.y*this.worldSize,0,1];return n.af(pe,pe,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let O=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.P(0,O))}getCameraQueryGeometry(O){let pe=this.getCameraPoint();if(O.length===1)return[O[0],pe];{let Ie=pe.x,Fe=pe.y,qe=pe.x,Mt=pe.y;for(let jt of O)Ie=Math.min(Ie,jt.x),Fe=Math.min(Fe,jt.y),qe=Math.max(qe,jt.x),Mt=Math.max(Mt,jt.y);return[new n.P(Ie,Fe),new n.P(qe,Fe),new n.P(qe,Mt),new n.P(Ie,Mt),new n.P(Ie,Fe)]}}lngLatToCameraDepth(O,pe){let Ie=this.locationCoordinate(O),Fe=[Ie.x*this.worldSize,Ie.y*this.worldSize,pe,1];return n.af(Fe,Fe,this.modelViewProjectionMatrix),Fe[2]/Fe[3]}}function xf(Ke,O){let pe,Ie=!1,Fe=null,qe=null,Mt=()=>{Fe=null,Ie&&(Ke.apply(qe,pe),Fe=setTimeout(Mt,O),Ie=!1)};return(...jt)=>(Ie=!0,qe=this,pe=jt,Fe||Mt(),Fe)}class Eh{constructor(O){this._getCurrentHash=()=>{let pe=window.location.hash.replace("#","");if(this._hashName){let Ie;return pe.split("&").map(Fe=>Fe.split("=")).forEach(Fe=>{Fe[0]===this._hashName&&(Ie=Fe)}),(Ie&&Ie[1]||"").split("/")}return pe.split("/")},this._onHashChange=()=>{let pe=this._getCurrentHash();if(pe.length>=3&&!pe.some(Ie=>isNaN(Ie))){let Ie=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(pe[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+pe[2],+pe[1]],zoom:+pe[0],bearing:Ie,pitch:+(pe[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let pe=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,pe)},this._removeHash=()=>{let pe=this._getCurrentHash();if(pe.length===0)return;let Ie=pe.join("/"),Fe=Ie;Fe.split("&").length>0&&(Fe=Fe.split("&")[0]),this._hashName&&(Fe=`${this._hashName}=${Ie}`);let qe=window.location.hash.replace(Fe,"");qe.startsWith("#&")?qe=qe.slice(0,1)+qe.slice(2):qe==="#"&&(qe="");let Mt=window.location.href.replace(/(#.+)?$/,qe);Mt=Mt.replace("&&","&"),window.history.replaceState(window.history.state,null,Mt)},this._updateHash=xf(this._updateHashUnthrottled,300),this._hashName=O&&encodeURIComponent(O)}addTo(O){return this._map=O,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(O){let pe=this._map.getCenter(),Ie=Math.round(100*this._map.getZoom())/100,Fe=Math.ceil((Ie*Math.LN2+Math.log(512/360/.5))/Math.LN10),qe=Math.pow(10,Fe),Mt=Math.round(pe.lng*qe)/qe,jt=Math.round(pe.lat*qe)/qe,tr=this._map.getBearing(),kr=this._map.getPitch(),Vr="";if(Vr+=O?`/${Mt}/${jt}/${Ie}`:`${Ie}/${jt}/${Mt}`,(tr||kr)&&(Vr+="/"+Math.round(10*tr)/10),kr&&(Vr+=`/${Math.round(kr)}`),this._hashName){let Wr=this._hashName,Ti=!1,Vi=window.location.hash.slice(1).split("&").map(et=>{let lt=et.split("=")[0];return lt===Wr?(Ti=!0,`${lt}=${Vr}`):et}).filter(et=>et);return Ti||Vi.push(`${Wr}=${Vr}`),`#${Vi.join("&")}`}return`#${Vr}`}}let rf={linearity:.3,easing:n.b8(0,0,.3,1)},Uf=n.e({deceleration:2500,maxSpeed:1400},rf),Qd=n.e({deceleration:20,maxSpeed:1400},rf),Sp=n.e({deceleration:1e3,maxSpeed:360},rf),bf=n.e({deceleration:1e3,maxSpeed:90},rf);class $f{constructor(O){this._map=O,this.clear()}clear(){this._inertiaBuffer=[]}record(O){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:O})}_drainInertiaBuffer(){let O=this._inertiaBuffer,pe=u.now();for(;O.length>0&&pe-O[0].time>160;)O.shift()}_onMoveEnd(O){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let pe={zoom:0,bearing:0,pitch:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:qe}of this._inertiaBuffer)pe.zoom+=qe.zoomDelta||0,pe.bearing+=qe.bearingDelta||0,pe.pitch+=qe.pitchDelta||0,qe.panDelta&&pe.pan._add(qe.panDelta),qe.around&&(pe.around=qe.around),qe.pinchAround&&(pe.pinchAround=qe.pinchAround);let Ie=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Fe={};if(pe.pan.mag()){let qe=wf(pe.pan.mag(),Ie,n.e({},Uf,O||{}));Fe.offset=pe.pan.mult(qe.amount/pe.pan.mag()),Fe.center=this._map.transform.center,zc(Fe,qe)}if(pe.zoom){let qe=wf(pe.zoom,Ie,Qd);Fe.zoom=this._map.transform.zoom+qe.amount,zc(Fe,qe)}if(pe.bearing){let qe=wf(pe.bearing,Ie,Sp);Fe.bearing=this._map.transform.bearing+n.ac(qe.amount,-179,179),zc(Fe,qe)}if(pe.pitch){let qe=wf(pe.pitch,Ie,bf);Fe.pitch=this._map.transform.pitch+qe.amount,zc(Fe,qe)}if(Fe.zoom||Fe.bearing){let qe=pe.pinchAround===void 0?pe.around:pe.pinchAround;Fe.around=qe?this._map.unproject(qe):this._map.getCenter()}return this.clear(),n.e(Fe,{noMoveStart:!0})}}function zc(Ke,O){(!Ke.duration||Ke.durationpe.unproject(tr)),jt=qe.reduce((tr,kr,Vr,Wr)=>tr.add(kr.div(Wr.length)),new n.P(0,0));super(O,{points:qe,point:jt,lngLats:Mt,lngLat:pe.unproject(jt),originalEvent:Ie}),this._defaultPrevented=!1}}class Hf extends n.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(O,pe,Ie){super(O,{originalEvent:Ie}),this._defaultPrevented=!1}}class Lh{constructor(O,pe){this._map=O,this._clickTolerance=pe.clickTolerance}reset(){delete this._mousedownPos}wheel(O){return this._firePreventable(new Hf(O.type,this._map,O))}mousedown(O,pe){return this._mousedownPos=pe,this._firePreventable(new ch(O.type,this._map,O))}mouseup(O){this._map.fire(new ch(O.type,this._map,O))}click(O,pe){this._mousedownPos&&this._mousedownPos.dist(pe)>=this._clickTolerance||this._map.fire(new ch(O.type,this._map,O))}dblclick(O){return this._firePreventable(new ch(O.type,this._map,O))}mouseover(O){this._map.fire(new ch(O.type,this._map,O))}mouseout(O){this._map.fire(new ch(O.type,this._map,O))}touchstart(O){return this._firePreventable(new kf(O.type,this._map,O))}touchmove(O){this._map.fire(new kf(O.type,this._map,O))}touchend(O){this._map.fire(new kf(O.type,this._map,O))}touchcancel(O){this._map.fire(new kf(O.type,this._map,O))}_firePreventable(O){if(this._map.fire(O),O.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Lu{constructor(O){this._map=O}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(O){this._map.fire(new ch(O.type,this._map,O))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ch("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(O){this._delayContextMenu?this._contextMenuEvent=O:this._ignoreContextMenu||this._map.fire(new ch(O.type,this._map,O)),this._map.listens("contextmenu")&&O.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uh{constructor(O){this._map=O}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(O){return this.transform.pointLocation(n.P.convert(O),this._map.terrain)}}class Qc{constructor(O,pe){this._map=O,this._tr=new Uh(O),this._el=O.getCanvasContainer(),this._container=O.getContainer(),this._clickTolerance=pe.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(O,pe){this.isEnabled()&&O.shiftKey&&O.button===0&&(s.disableDrag(),this._startPos=this._lastPos=pe,this._active=!0)}mousemoveWindow(O,pe){if(!this._active)return;let Ie=pe;if(this._lastPos.equals(Ie)||!this._box&&Ie.dist(this._startPos)qe.fitScreenCoordinates(Ie,Fe,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",O)}keydown(O){this._active&&O.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",O))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(O,pe){return this._map.fire(new n.k(O,{originalEvent:pe}))}}function Id(Ke,O){if(Ke.length!==O.length)throw new Error(`The number of touches and points are not equal - touches ${Ke.length}, points ${O.length}`);let pe={};for(let Ie=0;Iethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=O.timeStamp),Ie.length===this.numTouches&&(this.centroid=function(Fe){let qe=new n.P(0,0);for(let Mt of Fe)qe._add(Mt);return qe.div(Fe.length)}(pe),this.touches=Id(Ie,pe)))}touchmove(O,pe,Ie){if(this.aborted||!this.centroid)return;let Fe=Id(Ie,pe);for(let qe in this.touches){let Mt=Fe[qe];(!Mt||Mt.dist(this.touches[qe])>30)&&(this.aborted=!0)}}touchend(O,pe,Ie){if((!this.centroid||O.timeStamp-this.startTime>500)&&(this.aborted=!0),Ie.length===0){let Fe=!this.aborted&&this.centroid;if(this.reset(),Fe)return Fe}}}class Df{constructor(O){this.singleTap=new Cu(O),this.numTaps=O.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(O,pe,Ie){this.singleTap.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){this.singleTap.touchmove(O,pe,Ie)}touchend(O,pe,Ie){let Fe=this.singleTap.touchend(O,pe,Ie);if(Fe){let qe=O.timeStamp-this.lastTime<500,Mt=!this.lastTap||this.lastTap.dist(Fe)<30;if(qe&&Mt||this.reset(),this.count++,this.lastTime=O.timeStamp,this.lastTap=Fe,this.count===this.numTaps)return this.reset(),Fe}}}class nf{constructor(O){this._tr=new Uh(O),this._zoomIn=new Df({numTouches:1,numTaps:2}),this._zoomOut=new Df({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(O,pe,Ie){this._zoomIn.touchstart(O,pe,Ie),this._zoomOut.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){this._zoomIn.touchmove(O,pe,Ie),this._zoomOut.touchmove(O,pe,Ie)}touchend(O,pe,Ie){let Fe=this._zoomIn.touchend(O,pe,Ie),qe=this._zoomOut.touchend(O,pe,Ie),Mt=this._tr;return Fe?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:jt=>jt.easeTo({duration:300,zoom:Mt.zoom+1,around:Mt.unproject(Fe)},{originalEvent:O})}):qe?(this._active=!0,O.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:jt=>jt.easeTo({duration:300,zoom:Mt.zoom-1,around:Mt.unproject(qe)},{originalEvent:O})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hh{constructor(O){this._enabled=!!O.enable,this._moveStateManager=O.moveStateManager,this._clickTolerance=O.clickTolerance||1,this._moveFunction=O.move,this._activateOnStart=!!O.activateOnStart,O.assignEvents(this),this.reset()}reset(O){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(O)}_move(...O){let pe=this._moveFunction(...O);if(pe.bearingDelta||pe.pitchDelta||pe.around||pe.panDelta)return this._active=!0,pe}dragStart(O,pe){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(O)&&(this._moveStateManager.startMove(O),this._lastPoint=pe.length?pe[0]:pe,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(O,pe){if(!this.isEnabled())return;let Ie=this._lastPoint;if(!Ie)return;if(O.preventDefault(),!this._moveStateManager.isValidMoveEvent(O))return void this.reset(O);let Fe=pe.length?pe[0]:pe;return!this._moved&&Fe.dist(Ie){Ke.mousedown=Ke.dragStart,Ke.mousemoveWindow=Ke.dragMove,Ke.mouseup=Ke.dragEnd,Ke.contextmenu=O=>{O.preventDefault()}},Ac=({enable:Ke,clickTolerance:O,bearingDegreesPerPixelMoved:pe=.8})=>{let Ie=new af({checkCorrectEvent:Fe=>s.mouseButton(Fe)===0&&Fe.ctrlKey||s.mouseButton(Fe)===2});return new hh({clickTolerance:O,move:(Fe,qe)=>({bearingDelta:(qe.x-Fe.x)*pe}),moveStateManager:Ie,enable:Ke,assignEvents:ep})},gd=({enable:Ke,clickTolerance:O,pitchDegreesPerPixelMoved:pe=-.5})=>{let Ie=new af({checkCorrectEvent:Fe=>s.mouseButton(Fe)===0&&Fe.ctrlKey||s.mouseButton(Fe)===2});return new hh({clickTolerance:O,move:(Fe,qe)=>({pitchDelta:(qe.y-Fe.y)*pe}),moveStateManager:Ie,enable:Ke,assignEvents:ep})};class fh{constructor(O,pe){this._clickTolerance=O.clickTolerance||1,this._map=pe,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(O){return O<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(O,pe,Ie){return this._calculateTransform(O,pe,Ie)}touchmove(O,pe,Ie){if(this._active){if(!this._shouldBePrevented(Ie.length))return O.preventDefault(),this._calculateTransform(O,pe,Ie);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",O)}}touchend(O,pe,Ie){this._calculateTransform(O,pe,Ie),this._active&&this._shouldBePrevented(Ie.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(O,pe,Ie){Ie.length>0&&(this._active=!0);let Fe=Id(Ie,pe),qe=new n.P(0,0),Mt=new n.P(0,0),jt=0;for(let kr in Fe){let Vr=Fe[kr],Wr=this._touches[kr];Wr&&(qe._add(Vr),Mt._add(Vr.sub(Wr)),jt++,Fe[kr]=Vr)}if(this._touches=Fe,this._shouldBePrevented(jt)||!Mt.mag())return;let tr=Mt.div(jt);return this._sum._add(tr),this._sum.mag()Math.abs(Ke.x)}class sd extends $h{constructor(O){super(),this._currentTouchCount=0,this._map=O}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(O,pe,Ie){super.touchstart(O,pe,Ie),this._currentTouchCount=Ie.length}_start(O){this._lastPoints=O,Dh(O[0].sub(O[1]))&&(this._valid=!1)}_move(O,pe,Ie){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let Fe=O[0].sub(this._lastPoints[0]),qe=O[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Fe,qe,Ie.timeStamp),this._valid?(this._lastPoints=O,this._active=!0,{pitchDelta:(Fe.y+qe.y)/2*-.5}):void 0}gestureBeginsVertically(O,pe,Ie){if(this._valid!==void 0)return this._valid;let Fe=O.mag()>=2,qe=pe.mag()>=2;if(!Fe&&!qe)return;if(!Fe||!qe)return this._firstMove===void 0&&(this._firstMove=Ie),Ie-this._firstMove<100&&void 0;let Mt=O.y>0==pe.y>0;return Dh(O)&&Dh(pe)&&Mt}}let wr={panStep:100,bearingStep:15,pitchStep:10};class Xr{constructor(O){this._tr=new Uh(O);let pe=wr;this._panStep=pe.panStep,this._bearingStep=pe.bearingStep,this._pitchStep=pe.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(O){if(O.altKey||O.ctrlKey||O.metaKey)return;let pe=0,Ie=0,Fe=0,qe=0,Mt=0;switch(O.keyCode){case 61:case 107:case 171:case 187:pe=1;break;case 189:case 109:case 173:pe=-1;break;case 37:O.shiftKey?Ie=-1:(O.preventDefault(),qe=-1);break;case 39:O.shiftKey?Ie=1:(O.preventDefault(),qe=1);break;case 38:O.shiftKey?Fe=1:(O.preventDefault(),Mt=-1);break;case 40:O.shiftKey?Fe=-1:(O.preventDefault(),Mt=1);break;default:return}return this._rotationDisabled&&(Ie=0,Fe=0),{cameraAnimation:jt=>{let tr=this._tr;jt.easeTo({duration:300,easeId:"keyboardHandler",easing:Ni,zoom:pe?Math.round(tr.zoom)+pe*(O.shiftKey?2:1):tr.zoom,bearing:tr.bearing+Ie*this._bearingStep,pitch:tr.pitch+Fe*this._pitchStep,offset:[-qe*this._panStep,-Mt*this._panStep],center:tr.center},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Ni(Ke){return Ke*(2-Ke)}let Ai=4.000244140625;class hn{constructor(O,pe){this._onTimeout=Ie=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Ie)},this._map=O,this._tr=new Uh(O),this._triggerRenderFrame=pe,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(O){this._defaultZoomRate=O}setWheelZoomRate(O){this._wheelZoomRate=O}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(O){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!O&&O.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(O){return!!this._map.cooperativeGestures.isEnabled()&&!(O.ctrlKey||this._map.cooperativeGestures.isBypassed(O))}wheel(O){if(!this.isEnabled())return;if(this._shouldBePrevented(O))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",O);let pe=O.deltaMode===WheelEvent.DOM_DELTA_LINE?40*O.deltaY:O.deltaY,Ie=u.now(),Fe=Ie-(this._lastWheelEventTime||0);this._lastWheelEventTime=Ie,pe!==0&&pe%Ai==0?this._type="wheel":pe!==0&&Math.abs(pe)<4?this._type="trackpad":Fe>400?(this._type=null,this._lastValue=pe,this._timeout=setTimeout(this._onTimeout,40,O)):this._type||(this._type=Math.abs(Fe*pe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,pe+=this._lastValue)),O.shiftKey&&pe&&(pe/=4),this._type&&(this._lastWheelEvent=O,this._delta-=pe,this._active||this._start(O)),O.preventDefault()}_start(O){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let pe=s.mousePos(this._map.getCanvas(),O),Ie=this._tr;this._around=pe.y>Ie.transform.height/2-Ie.transform.getHorizon()?n.N.convert(this._aroundCenter?Ie.center:Ie.unproject(pe)):n.N.convert(Ie.center),this._aroundPoint=Ie.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let O=this._tr.transform;if(this._delta!==0){let tr=this._type==="wheel"&&Math.abs(this._delta)>Ai?this._wheelZoomRate:this._defaultZoomRate,kr=2/(1+Math.exp(-Math.abs(this._delta*tr)));this._delta<0&&kr!==0&&(kr=1/kr);let Vr=typeof this._targetZoom=="number"?O.zoomScale(this._targetZoom):O.scale;this._targetZoom=Math.min(O.maxZoom,Math.max(O.minZoom,O.scaleZoom(Vr*kr))),this._type==="wheel"&&(this._startZoom=O.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let pe=typeof this._targetZoom=="number"?this._targetZoom:O.zoom,Ie=this._startZoom,Fe=this._easing,qe,Mt=!1,jt=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Ie&&Fe&&jt){let tr=Math.min(jt/200,1),kr=Fe(tr);qe=n.y.number(Ie,pe,kr),tr<1?this._frameId||(this._frameId=!0):Mt=!0}else qe=pe,Mt=!0;return this._active=!0,Mt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!Mt,zoomDelta:qe-O.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(O){let pe=n.b9;if(this._prevEase){let Ie=this._prevEase,Fe=(u.now()-Ie.start)/Ie.duration,qe=Ie.easing(Fe+.01)-Ie.easing(Fe),Mt=.27/Math.sqrt(qe*qe+1e-4)*.01,jt=Math.sqrt(.0729-Mt*Mt);pe=n.b8(Mt,jt,.25,1)}return this._prevEase={start:u.now(),duration:O,easing:pe},pe}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pn{constructor(O,pe){this._clickZoom=O,this._tapZoom=pe}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class pa{constructor(O){this._tr=new Uh(O),this.reset()}reset(){this._active=!1}dblclick(O,pe){return O.preventDefault(),{cameraAnimation:Ie=>{Ie.easeTo({duration:300,zoom:this._tr.zoom+(O.shiftKey?-1:1),around:this._tr.unproject(pe)},{originalEvent:O})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ea{constructor(){this._tap=new Df({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(O,pe,Ie){if(!this._swipePoint)if(this._tapTime){let Fe=pe[0],qe=O.timeStamp-this._tapTime<500,Mt=this._tapPoint.dist(Fe)<30;qe&&Mt?Ie.length>0&&(this._swipePoint=Fe,this._swipeTouch=Ie[0].identifier):this.reset()}else this._tap.touchstart(O,pe,Ie)}touchmove(O,pe,Ie){if(this._tapTime){if(this._swipePoint){if(Ie[0].identifier!==this._swipeTouch)return;let Fe=pe[0],qe=Fe.y-this._swipePoint.y;return this._swipePoint=Fe,O.preventDefault(),this._active=!0,{zoomDelta:qe/128}}}else this._tap.touchmove(O,pe,Ie)}touchend(O,pe,Ie){if(this._tapTime)this._swipePoint&&Ie.length===0&&this.reset();else{let Fe=this._tap.touchend(O,pe,Ie);Fe&&(this._tapTime=O.timeStamp,this._tapPoint=Fe)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ka{constructor(O,pe,Ie){this._el=O,this._mousePan=pe,this._touchPan=Ie}enable(O){this._inertiaOptions=O||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class oo{constructor(O,pe,Ie){this._pitchWithRotate=O.pitchWithRotate,this._mouseRotate=pe,this._mousePitch=Ie}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class wa{constructor(O,pe,Ie,Fe){this._el=O,this._touchZoom=pe,this._touchRotate=Ie,this._tapDragZoom=Fe,this._rotationDisabled=!1,this._enabled=!0}enable(O){this._touchZoom.enable(O),this._rotationDisabled||this._touchRotate.enable(O),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Va{constructor(O,pe){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=O,this._options=pe,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let O=this._map.getCanvasContainer();O.classList.add("maplibregl-cooperative-gestures"),this._container=s.create("div","maplibregl-cooperative-gesture-screen",O);let pe=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(pe=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let Ie=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Fe=document.createElement("div");Fe.className="maplibregl-desktop-message",Fe.textContent=pe,this._container.appendChild(Fe);let qe=document.createElement("div");qe.className="maplibregl-mobile-message",qe.textContent=Ie,this._container.appendChild(qe),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(s.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(O){return O[this._bypassKey]}notifyGestureBlocked(O,pe){this._enabled&&(this._map.fire(new n.k("cooperativegestureprevented",{gestureType:O,originalEvent:pe})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let Oa=Ke=>Ke.zoom||Ke.drag||Ke.pitch||Ke.rotate;class fa extends n.k{}function vo(Ke){return Ke.panDelta&&Ke.panDelta.mag()||Ke.zoomDelta||Ke.bearingDelta||Ke.pitchDelta}class hs{constructor(O,pe){this.handleWindowEvent=Fe=>{this.handleEvent(Fe,`${Fe.type}Window`)},this.handleEvent=(Fe,qe)=>{if(Fe.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let Mt=Fe.type==="renderFrame"?void 0:Fe,jt={needsRenderFrame:!1},tr={},kr={},Vr=Fe.touches,Wr=Vr?this._getMapTouches(Vr):void 0,Ti=Wr?s.touchPos(this._map.getCanvas(),Wr):s.mousePos(this._map.getCanvas(),Fe);for(let{handlerName:lt,handler:Tt,allowed:Lt}of this._handlers){if(!Tt.isEnabled())continue;let Vt;this._blockedByActive(kr,Lt,lt)?Tt.reset():Tt[qe||Fe.type]&&(Vt=Tt[qe||Fe.type](Fe,Ti,Wr),this.mergeHandlerResult(jt,tr,Vt,lt,Mt),Vt&&Vt.needsRenderFrame&&this._triggerRenderFrame()),(Vt||Tt.isActive())&&(kr[lt]=Tt)}let Vi={};for(let lt in this._previousActiveHandlers)kr[lt]||(Vi[lt]=Mt);this._previousActiveHandlers=kr,(Object.keys(Vi).length||vo(jt))&&(this._changes.push([jt,tr,Vi]),this._triggerRenderFrame()),(Object.keys(kr).length||vo(jt))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:et}=jt;et&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],et(this._map))},this._map=O,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $f(O),this._bearingSnap=pe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(pe);let Ie=this._el;this._listeners=[[Ie,"touchstart",{passive:!0}],[Ie,"touchmove",{passive:!1}],[Ie,"touchend",void 0],[Ie,"touchcancel",void 0],[Ie,"mousedown",void 0],[Ie,"mousemove",void 0],[Ie,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Ie,"mouseover",void 0],[Ie,"mouseout",void 0],[Ie,"dblclick",void 0],[Ie,"click",void 0],[Ie,"keydown",{capture:!1}],[Ie,"keyup",void 0],[Ie,"wheel",{passive:!1}],[Ie,"contextmenu",void 0],[window,"blur",void 0]];for(let[Fe,qe,Mt]of this._listeners)s.addEventListener(Fe,qe,Fe===document?this.handleWindowEvent:this.handleEvent,Mt)}destroy(){for(let[O,pe,Ie]of this._listeners)s.removeEventListener(O,pe,O===document?this.handleWindowEvent:this.handleEvent,Ie)}_addDefaultHandlers(O){let pe=this._map,Ie=pe.getCanvasContainer();this._add("mapEvent",new Lh(pe,O));let Fe=pe.boxZoom=new Qc(pe,O);this._add("boxZoom",Fe),O.interactive&&O.boxZoom&&Fe.enable();let qe=pe.cooperativeGestures=new Va(pe,O.cooperativeGestures);this._add("cooperativeGestures",qe),O.cooperativeGestures&&qe.enable();let Mt=new nf(pe),jt=new pa(pe);pe.doubleClickZoom=new Pn(jt,Mt),this._add("tapZoom",Mt),this._add("clickZoom",jt),O.interactive&&O.doubleClickZoom&&pe.doubleClickZoom.enable();let tr=new Ea;this._add("tapDragZoom",tr);let kr=pe.touchPitch=new sd(pe);this._add("touchPitch",kr),O.interactive&&O.touchPitch&&pe.touchPitch.enable(O.touchPitch);let Vr=Ac(O),Wr=gd(O);pe.dragRotate=new oo(O,Vr,Wr),this._add("mouseRotate",Vr,["mousePitch"]),this._add("mousePitch",Wr,["mouseRotate"]),O.interactive&&O.dragRotate&&pe.dragRotate.enable();let Ti=(({enable:Vt,clickTolerance:Nt})=>{let Xt=new af({checkCorrectEvent:Pr=>s.mouseButton(Pr)===0&&!Pr.ctrlKey});return new hh({clickTolerance:Nt,move:(Pr,Hr)=>({around:Hr,panDelta:Hr.sub(Pr)}),activateOnStart:!0,moveStateManager:Xt,enable:Vt,assignEvents:ep})})(O),Vi=new fh(O,pe);pe.dragPan=new Ka(Ie,Ti,Vi),this._add("mousePan",Ti),this._add("touchPan",Vi,["touchZoom","touchRotate"]),O.interactive&&O.dragPan&&pe.dragPan.enable(O.dragPan);let et=new Tf,lt=new fu;pe.touchZoomRotate=new wa(Ie,lt,et,tr),this._add("touchRotate",et,["touchPan","touchZoom"]),this._add("touchZoom",lt,["touchPan","touchRotate"]),O.interactive&&O.touchZoomRotate&&pe.touchZoomRotate.enable(O.touchZoomRotate);let Tt=pe.scrollZoom=new hn(pe,()=>this._triggerRenderFrame());this._add("scrollZoom",Tt,["mousePan"]),O.interactive&&O.scrollZoom&&pe.scrollZoom.enable(O.scrollZoom);let Lt=pe.keyboard=new Xr(pe);this._add("keyboard",Lt),O.interactive&&O.keyboard&&pe.keyboard.enable(),this._add("blockableMapEvent",new Lu(pe))}_add(O,pe,Ie){this._handlers.push({handlerName:O,handler:pe,allowed:Ie}),this._handlersById[O]=pe}stop(O){if(!this._updatingCamera){for(let{handler:pe}of this._handlers)pe.reset();this._inertia.clear(),this._fireEvents({},{},O),this._changes=[]}}isActive(){for(let{handler:O}of this._handlers)if(O.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Oa(this._eventsInProgress)||this.isZooming()}_blockedByActive(O,pe,Ie){for(let Fe in O)if(Fe!==Ie&&(!pe||pe.indexOf(Fe)<0))return!0;return!1}_getMapTouches(O){let pe=[];for(let Ie of O)this._el.contains(Ie.target)&&pe.push(Ie);return pe}mergeHandlerResult(O,pe,Ie,Fe,qe){if(!Ie)return;n.e(O,Ie);let Mt={handlerName:Fe,originalEvent:Ie.originalEvent||qe};Ie.zoomDelta!==void 0&&(pe.zoom=Mt),Ie.panDelta!==void 0&&(pe.drag=Mt),Ie.pitchDelta!==void 0&&(pe.pitch=Mt),Ie.bearingDelta!==void 0&&(pe.rotate=Mt)}_applyChanges(){let O={},pe={},Ie={};for(let[Fe,qe,Mt]of this._changes)Fe.panDelta&&(O.panDelta=(O.panDelta||new n.P(0,0))._add(Fe.panDelta)),Fe.zoomDelta&&(O.zoomDelta=(O.zoomDelta||0)+Fe.zoomDelta),Fe.bearingDelta&&(O.bearingDelta=(O.bearingDelta||0)+Fe.bearingDelta),Fe.pitchDelta&&(O.pitchDelta=(O.pitchDelta||0)+Fe.pitchDelta),Fe.around!==void 0&&(O.around=Fe.around),Fe.pinchAround!==void 0&&(O.pinchAround=Fe.pinchAround),Fe.noInertia&&(O.noInertia=Fe.noInertia),n.e(pe,qe),n.e(Ie,Mt);this._updateMapTransform(O,pe,Ie),this._changes=[]}_updateMapTransform(O,pe,Ie){let Fe=this._map,qe=Fe._getTransformForUpdate(),Mt=Fe.terrain;if(!(vo(O)||Mt&&this._terrainMovement))return this._fireEvents(pe,Ie,!0);let{panDelta:jt,zoomDelta:tr,bearingDelta:kr,pitchDelta:Vr,around:Wr,pinchAround:Ti}=O;Ti!==void 0&&(Wr=Ti),Fe._stop(!0),Wr=Wr||Fe.transform.centerPoint;let Vi=qe.pointLocation(jt?Wr.sub(jt):Wr);kr&&(qe.bearing+=kr),Vr&&(qe.pitch+=Vr),tr&&(qe.zoom+=tr),Mt?this._terrainMovement||!pe.drag&&!pe.zoom?pe.drag&&this._terrainMovement?qe.center=qe.pointLocation(qe.centerPoint.sub(jt)):qe.setLocationAtPoint(Vi,Wr):(this._terrainMovement=!0,this._map._elevationFreeze=!0,qe.setLocationAtPoint(Vi,Wr)):qe.setLocationAtPoint(Vi,Wr),Fe._applyUpdatedTransform(qe),this._map._update(),O.noInertia||this._inertia.record(O),this._fireEvents(pe,Ie,!0)}_fireEvents(O,pe,Ie){let Fe=Oa(this._eventsInProgress),qe=Oa(O),Mt={};for(let Wr in O){let{originalEvent:Ti}=O[Wr];this._eventsInProgress[Wr]||(Mt[`${Wr}start`]=Ti),this._eventsInProgress[Wr]=O[Wr]}!Fe&&qe&&this._fireEvent("movestart",qe.originalEvent);for(let Wr in Mt)this._fireEvent(Wr,Mt[Wr]);qe&&this._fireEvent("move",qe.originalEvent);for(let Wr in O){let{originalEvent:Ti}=O[Wr];this._fireEvent(Wr,Ti)}let jt={},tr;for(let Wr in this._eventsInProgress){let{handlerName:Ti,originalEvent:Vi}=this._eventsInProgress[Wr];this._handlersById[Ti].isActive()||(delete this._eventsInProgress[Wr],tr=pe[Ti]||Vi,jt[`${Wr}end`]=tr)}for(let Wr in jt)this._fireEvent(Wr,jt[Wr]);let kr=Oa(this._eventsInProgress),Vr=(Fe||qe)&&!kr;if(Vr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let Wr=this._map._getTransformForUpdate();Wr.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Wr)}if(Ie&&Vr){this._updatingCamera=!0;let Wr=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Ti=Vi=>Vi!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new fa("renderFrame",{timeStamp:O})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class rs extends n.E{constructor(O,pe){super(),this._renderFrameCallback=()=>{let Ie=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Ie)),Ie<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=O,this._bearingSnap=pe.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new n.N(this.transform.center.lng,this.transform.center.lat)}setCenter(O,pe){return this.jumpTo({center:O},pe)}panBy(O,pe,Ie){return O=n.P.convert(O).mult(-1),this.panTo(this.transform.center,n.e({offset:O},pe),Ie)}panTo(O,pe,Ie){return this.easeTo(n.e({center:O},pe),Ie)}getZoom(){return this.transform.zoom}setZoom(O,pe){return this.jumpTo({zoom:O},pe),this}zoomTo(O,pe,Ie){return this.easeTo(n.e({zoom:O},pe),Ie)}zoomIn(O,pe){return this.zoomTo(this.getZoom()+1,O,pe),this}zoomOut(O,pe){return this.zoomTo(this.getZoom()-1,O,pe),this}getBearing(){return this.transform.bearing}setBearing(O,pe){return this.jumpTo({bearing:O},pe),this}getPadding(){return this.transform.padding}setPadding(O,pe){return this.jumpTo({padding:O},pe),this}rotateTo(O,pe,Ie){return this.easeTo(n.e({bearing:O},pe),Ie)}resetNorth(O,pe){return this.rotateTo(0,n.e({duration:1e3},O),pe),this}resetNorthPitch(O,pe){return this.easeTo(n.e({bearing:0,pitch:0,duration:1e3},O),pe),this}snapToNorth(O,pe){return Math.abs(this.getBearing()){if(this._zooming&&(Fe.zoom=n.y.number(qe,Tt,Zr)),this._rotating&&(Fe.bearing=n.y.number(Mt,kr,Zr)),this._pitching&&(Fe.pitch=n.y.number(jt,Vr,Zr)),this._padding&&(Fe.interpolatePadding(tr,Wr,Zr),Vi=Fe.centerPoint.add(Ti)),this.terrain&&!O.freezeElevation&&this._updateElevation(Zr),Xt)Fe.setLocationAtPoint(Xt,Pr);else{let pi=Fe.zoomScale(Fe.zoom-qe),zi=Tt>qe?Math.min(2,Nt):Math.max(.5,Nt),Ki=Math.pow(zi,1-Zr),rn=Fe.unproject(Lt.add(Vt.mult(Zr*Ki)).mult(pi));Fe.setLocationAtPoint(Fe.renderWorldCopies?rn.wrap():rn,Vi)}this._applyUpdatedTransform(Fe),this._fireMoveEvents(pe)},Zr=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pe,Zr)},O),this}_prepareEase(O,pe,Ie={}){this._moving=!0,pe||Ie.moving||this.fire(new n.k("movestart",O)),this._zooming&&!Ie.zooming&&this.fire(new n.k("zoomstart",O)),this._rotating&&!Ie.rotating&&this.fire(new n.k("rotatestart",O)),this._pitching&&!Ie.pitching&&this.fire(new n.k("pitchstart",O))}_prepareElevation(O){this._elevationCenter=O,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(O,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(O){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let pe=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(O<1&&pe!==this._elevationTarget){let Ie=this._elevationTarget-this._elevationStart;this._elevationStart+=O*(Ie-(pe-(Ie*O+this._elevationStart))/(1-O)),this._elevationTarget=pe}this.transform.elevation=n.y.number(this._elevationStart,this._elevationTarget,O)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(O){let pe=O.getCameraPosition(),Ie=this.terrain.getElevationForLngLatZoom(pe.lngLat,O.zoom);if(pe.altitudethis._elevateCameraIfInsideTerrain(Fe)),this.transformCameraUpdate&&pe.push(Fe=>this.transformCameraUpdate(Fe)),!pe.length)return;let Ie=O.clone();for(let Fe of pe){let qe=Ie.clone(),{center:Mt,zoom:jt,pitch:tr,bearing:kr,elevation:Vr}=Fe(qe);Mt&&(qe.center=Mt),jt!==void 0&&(qe.zoom=jt),tr!==void 0&&(qe.pitch=tr),kr!==void 0&&(qe.bearing=kr),Vr!==void 0&&(qe.elevation=Vr),Ie.apply(qe)}this.transform.apply(Ie)}_fireMoveEvents(O){this.fire(new n.k("move",O)),this._zooming&&this.fire(new n.k("zoom",O)),this._rotating&&this.fire(new n.k("rotate",O)),this._pitching&&this.fire(new n.k("pitch",O))}_afterEase(O,pe){if(this._easeId&&pe&&this._easeId===pe)return;delete this._easeId;let Ie=this._zooming,Fe=this._rotating,qe=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ie&&this.fire(new n.k("zoomend",O)),Fe&&this.fire(new n.k("rotateend",O)),qe&&this.fire(new n.k("pitchend",O)),this.fire(new n.k("moveend",O))}flyTo(O,pe){var Ie;if(!O.essential&&u.prefersReducedMotion){let Ba=n.M(O,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ba,pe)}this.stop(),O=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.b9},O);let Fe=this._getTransformForUpdate(),qe=Fe.zoom,Mt=Fe.bearing,jt=Fe.pitch,tr=Fe.padding,kr="bearing"in O?this._normalizeBearing(O.bearing,Mt):Mt,Vr="pitch"in O?+O.pitch:jt,Wr="padding"in O?O.padding:Fe.padding,Ti=n.P.convert(O.offset),Vi=Fe.centerPoint.add(Ti),et=Fe.pointLocation(Vi),{center:lt,zoom:Tt}=Fe.getConstrained(n.N.convert(O.center||et),(Ie=O.zoom)!==null&&Ie!==void 0?Ie:qe);this._normalizeCenter(lt,Fe);let Lt=Fe.zoomScale(Tt-qe),Vt=Fe.project(et),Nt=Fe.project(lt).sub(Vt),Xt=O.curve,Pr=Math.max(Fe.width,Fe.height),Hr=Pr/Lt,Zr=Nt.mag();if("minZoom"in O){let Ba=n.ac(Math.min(O.minZoom,qe,Tt),Fe.minZoom,Fe.maxZoom),xo=Pr/Fe.zoomScale(Ba-qe);Xt=Math.sqrt(xo/Zr*2)}let pi=Xt*Xt;function zi(Ba){let xo=(Hr*Hr-Pr*Pr+(Ba?-1:1)*pi*pi*Zr*Zr)/(2*(Ba?Hr:Pr)*pi*Zr);return Math.log(Math.sqrt(xo*xo+1)-xo)}function Ki(Ba){return(Math.exp(Ba)-Math.exp(-Ba))/2}function rn(Ba){return(Math.exp(Ba)+Math.exp(-Ba))/2}let kn=zi(!1),Qn=function(Ba){return rn(kn)/rn(kn+Xt*Ba)},Ca=function(Ba){return Pr*((rn(kn)*(Ki(xo=kn+Xt*Ba)/rn(xo))-Ki(kn))/pi)/Zr;var xo},Ta=(zi(!0)-kn)/Xt;if(Math.abs(Zr)<1e-6||!isFinite(Ta)){if(Math.abs(Pr-Hr)<1e-6)return this.easeTo(O,pe);let Ba=Hr0,Qn=xo=>Math.exp(Ba*Xt*xo)}return O.duration="duration"in O?+O.duration:1e3*Ta/("screenSpeed"in O?+O.screenSpeed/Xt:+O.speed),O.maxDuration&&O.duration>O.maxDuration&&(O.duration=0),this._zooming=!0,this._rotating=Mt!==kr,this._pitching=Vr!==jt,this._padding=!Fe.isPaddingEqual(Wr),this._prepareEase(pe,!1),this.terrain&&this._prepareElevation(lt),this._ease(Ba=>{let xo=Ba*Ta,Go=1/Qn(xo);Fe.zoom=Ba===1?Tt:qe+Fe.scaleZoom(Go),this._rotating&&(Fe.bearing=n.y.number(Mt,kr,Ba)),this._pitching&&(Fe.pitch=n.y.number(jt,Vr,Ba)),this._padding&&(Fe.interpolatePadding(tr,Wr,Ba),Vi=Fe.centerPoint.add(Ti)),this.terrain&&!O.freezeElevation&&this._updateElevation(Ba);let Bo=Ba===1?lt:Fe.unproject(Vt.add(Nt.mult(Ca(xo))).mult(Go));Fe.setLocationAtPoint(Fe.renderWorldCopies?Bo.wrap():Bo,Vi),this._applyUpdatedTransform(Fe),this._fireMoveEvents(pe)},()=>{this.terrain&&O.freezeElevation&&this._finalizeElevation(),this._afterEase(pe)},O),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(O,pe){var Ie;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let Fe=this._onEaseEnd;delete this._onEaseEnd,Fe.call(this,pe)}return O||(Ie=this.handlers)===null||Ie===void 0||Ie.stop(!1),this}_ease(O,pe,Ie){Ie.animate===!1||Ie.duration===0?(O(1),pe()):(this._easeStart=u.now(),this._easeOptions=Ie,this._onEaseFrame=O,this._onEaseEnd=pe,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(O,pe){O=n.b3(O,-180,180);let Ie=Math.abs(O-pe);return Math.abs(O-360-pe)180?-360:Ie<-180?360:0}queryTerrainElevation(O){return this.terrain?this.terrain.getElevationForLngLatZoom(n.N.convert(O),this.transform.tileZoom)-this.transform.elevation:null}}let ps={compact:!0,customAttribution:'
MapLibre'};class xs{constructor(O=ps){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=pe=>{!pe||pe.sourceDataType!=="metadata"&&pe.sourceDataType!=="visibility"&&pe.dataType!=="style"&&pe.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=O}getDefaultPosition(){return"bottom-right"}onAdd(O){return this._map=O,this._compact=this.options.compact,this._container=s.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=s.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=s.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){s.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(O,pe){let Ie=this._map._getUIString(`AttributionControl.${pe}`);O.title=Ie,O.setAttribute("aria-label",Ie)}_updateAttributions(){if(!this._map.style)return;let O=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?O=O.concat(this.options.customAttribution.map(Fe=>typeof Fe!="string"?"":Fe)):typeof this.options.customAttribution=="string"&&O.push(this.options.customAttribution)),this._map.style.stylesheet){let Fe=this._map.style.stylesheet;this.styleOwner=Fe.owner,this.styleId=Fe.id}let pe=this._map.style.sourceCaches;for(let Fe in pe){let qe=pe[Fe];if(qe.used||qe.usedForTerrain){let Mt=qe.getSource();Mt.attribution&&O.indexOf(Mt.attribution)<0&&O.push(Mt.attribution)}}O=O.filter(Fe=>String(Fe).trim()),O.sort((Fe,qe)=>Fe.length-qe.length),O=O.filter((Fe,qe)=>{for(let Mt=qe+1;Mt=0)return!1;return!0});let Ie=O.join(" | ");Ie!==this._attribHTML&&(this._attribHTML=Ie,O.length?(this._innerContainer.innerHTML=Ie,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class _o{constructor(O={}){this._updateCompact=()=>{let pe=this._container.children;if(pe.length){let Ie=pe[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Ie.classList.add("maplibregl-compact"):Ie.classList.remove("maplibregl-compact")}},this.options=O}getDefaultPosition(){return"bottom-left"}onAdd(O){this._map=O,this._compact=this.options&&this.options.compact,this._container=s.create("div","maplibregl-ctrl");let pe=s.create("a","maplibregl-ctrl-logo");return pe.target="_blank",pe.rel="noopener nofollow",pe.href="https://maplibre.org/",pe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),pe.setAttribute("rel","noopener nofollow"),this._container.appendChild(pe),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){s.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class no{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(O){let pe=++this._id;return this._queue.push({callback:O,id:pe,cancelled:!1}),pe}remove(O){let pe=this._currentlyRunning,Ie=pe?this._queue.concat(pe):this._queue;for(let Fe of Ie)if(Fe.id===O)return void(Fe.cancelled=!0)}run(O=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let pe=this._currentlyRunning=this._queue;this._queue=[];for(let Ie of pe)if(!Ie.cancelled&&(Ie.callback(O),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var ws=n.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ul extends n.E{constructor(O){super(),this.sourceCache=O,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,O.usedForTerrain=!0,O.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(O,pe){this.sourceCache.update(O,pe),this._renderableTilesKeys=[];let Ie={};for(let Fe of O.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:pe}))Ie[Fe.key]=!0,this._renderableTilesKeys.push(Fe.key),this._tiles[Fe.key]||(Fe.posMatrix=new Float64Array(16),n.aP(Fe.posMatrix,0,n.X,0,n.X,0,1),this._tiles[Fe.key]=new ut(Fe,this.tileSize));for(let Fe in this._tiles)Ie[Fe]||delete this._tiles[Fe]}freeRtt(O){for(let pe in this._tiles){let Ie=this._tiles[pe];(!O||Ie.tileID.equals(O)||Ie.tileID.isChildOf(O)||O.isChildOf(Ie.tileID))&&(Ie.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(O=>this.getTileByID(O))}getTileByID(O){return this._tiles[O]}getTerrainCoords(O){let pe={};for(let Ie of this._renderableTilesKeys){let Fe=this._tiles[Ie].tileID;if(Fe.canonical.equals(O.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16),n.aP(qe.posMatrix,0,n.X,0,n.X,0,1),pe[Ie]=qe}else if(Fe.canonical.isChildOf(O.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16);let Mt=Fe.canonical.z-O.canonical.z,jt=Fe.canonical.x-(Fe.canonical.x>>Mt<>Mt<>Mt;n.aP(qe.posMatrix,0,kr,0,kr,0,1),n.J(qe.posMatrix,qe.posMatrix,[-jt*kr,-tr*kr,0]),pe[Ie]=qe}else if(O.canonical.isChildOf(Fe.canonical)){let qe=O.clone();qe.posMatrix=new Float64Array(16);let Mt=O.canonical.z-Fe.canonical.z,jt=O.canonical.x-(O.canonical.x>>Mt<>Mt<>Mt;n.aP(qe.posMatrix,0,n.X,0,n.X,0,1),n.J(qe.posMatrix,qe.posMatrix,[jt*kr,tr*kr,0]),n.K(qe.posMatrix,qe.posMatrix,[1/2**Mt,1/2**Mt,0]),pe[Ie]=qe}}return pe}getSourceTile(O,pe){let Ie=this.sourceCache._source,Fe=O.overscaledZ-this.deltaZoom;if(Fe>Ie.maxzoom&&(Fe=Ie.maxzoom),Fe=Ie.minzoom&&(!qe||!qe.dem);)qe=this.sourceCache.getTileByID(O.scaledTo(Fe--).key);return qe}tilesAfterTime(O=Date.now()){return Object.values(this._tiles).filter(pe=>pe.timeAdded>=O)}}class Ul{constructor(O,pe,Ie){this.painter=O,this.sourceCache=new ul(pe),this.options=Ie,this.exaggeration=typeof Ie.exaggeration=="number"?Ie.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(O,pe,Ie,Fe=n.X){var qe;if(!(pe>=0&&pe=0&&IeO.canonical.z&&(O.canonical.z>=Fe?qe=O.canonical.z-Fe:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let Mt=O.canonical.x-(O.canonical.x>>qe<>qe<>8<<4|qe>>8,pe[Mt+3]=0;let Ie=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(pe.buffer)),Fe=new g(O,Ie,O.gl.RGBA,{premultiply:!1});return Fe.bind(O.gl.NEAREST,O.gl.CLAMP_TO_EDGE),this._coordsTexture=Fe,Fe}pointCoordinate(O){this.painter.maybeDrawDepthAndCoords(!0);let pe=new Uint8Array(4),Ie=this.painter.context,Fe=Ie.gl,qe=Math.round(O.x*this.painter.pixelRatio/devicePixelRatio),Mt=Math.round(O.y*this.painter.pixelRatio/devicePixelRatio),jt=Math.round(this.painter.height/devicePixelRatio);Ie.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Fe.readPixels(qe,jt-Mt-1,1,1,Fe.RGBA,Fe.UNSIGNED_BYTE,pe),Ie.bindFramebuffer.set(null);let tr=pe[0]+(pe[2]>>4<<8),kr=pe[1]+((15&pe[2])<<8),Vr=this.coordsIndex[255-pe[3]],Wr=Vr&&this.sourceCache.getTileByID(Vr);if(!Wr)return null;let Ti=this._coordsTextureSize,Vi=(1<O.id!==pe),this._recentlyUsed.push(O.id)}stampObject(O){O.stamp=++this._stamp}getOrCreateFreeObject(){for(let pe of this._recentlyUsed)if(!this._objects[pe].inUse)return this._objects[pe];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let O=this._createObject(this._objects.length);return this._objects.push(O),O}freeObject(O){O.inUse=!1}freeAllObjects(){for(let O of this._objects)this.freeObject(O)}isFull(){return!(this._objects.length!O.inUse)===!1}}let Ql={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class gu{constructor(O,pe){this.painter=O,this.terrain=pe,this.pool=new mu(O.context,30,pe.sourceCache.tileSize*pe.qualityFactor)}destruct(){this.pool.destruct()}getTexture(O){return this.pool.getObjectForId(O.rtt[this._stacks.length-1].id).texture}prepareForRender(O,pe){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=O._order.filter(Ie=>!O._layers[Ie].isHidden(pe)),this._coordsDescendingInv={};for(let Ie in O.sourceCaches){this._coordsDescendingInv[Ie]={};let Fe=O.sourceCaches[Ie].getVisibleCoordinates();for(let qe of Fe){let Mt=this.terrain.sourceCache.getTerrainCoords(qe);for(let jt in Mt)this._coordsDescendingInv[Ie][jt]||(this._coordsDescendingInv[Ie][jt]=[]),this._coordsDescendingInv[Ie][jt].push(Mt[jt])}}this._coordsDescendingInvStr={};for(let Ie of O._order){let Fe=O._layers[Ie],qe=Fe.source;if(Ql[Fe.type]&&!this._coordsDescendingInvStr[qe]){this._coordsDescendingInvStr[qe]={};for(let Mt in this._coordsDescendingInv[qe])this._coordsDescendingInvStr[qe][Mt]=this._coordsDescendingInv[qe][Mt].map(jt=>jt.key).sort().join()}}for(let Ie of this._renderableTiles)for(let Fe in this._coordsDescendingInvStr){let qe=this._coordsDescendingInvStr[Fe][Ie.tileID.key];qe&&qe!==Ie.rttCoords[Fe]&&(Ie.rtt=[])}}renderLayer(O){if(O.isHidden(this.painter.transform.zoom))return!1;let pe=O.type,Ie=this.painter,Fe=this._renderableLayerIds[this._renderableLayerIds.length-1]===O.id;if(Ql[pe]&&(this._prevType&&Ql[this._prevType]||this._stacks.push([]),this._prevType=pe,this._stacks[this._stacks.length-1].push(O.id),!Fe))return!0;if(Ql[this._prevType]||Ql[pe]&&Fe){this._prevType=pe;let qe=this._stacks.length-1,Mt=this._stacks[qe]||[];for(let jt of this._renderableTiles){if(this.pool.isFull()&&(Vu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(jt),jt.rtt[qe]){let kr=this.pool.getObjectForId(jt.rtt[qe].id);if(kr.stamp===jt.rtt[qe].stamp){this.pool.useObject(kr);continue}}let tr=this.pool.getOrCreateFreeObject();this.pool.useObject(tr),this.pool.stampObject(tr),jt.rtt[qe]={id:tr.id,stamp:tr.stamp},Ie.context.bindFramebuffer.set(tr.fbo.framebuffer),Ie.context.clear({color:n.aM.transparent,stencil:0}),Ie.currentStencilSource=void 0;for(let kr=0;kr{Ke.touchstart=Ke.dragStart,Ke.touchmoveWindow=Ke.dragMove,Ke.touchend=Ke.dragEnd},Ho={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ds{constructor(O,pe,Ie=!1){this.mousedown=Mt=>{this.startMouse(n.e({},Mt,{ctrlKey:!0,preventDefault:()=>Mt.preventDefault()}),s.mousePos(this.element,Mt)),s.addEventListener(window,"mousemove",this.mousemove),s.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=Mt=>{this.moveMouse(Mt,s.mousePos(this.element,Mt))},this.mouseup=Mt=>{this.mouseRotate.dragEnd(Mt),this.mousePitch&&this.mousePitch.dragEnd(Mt),this.offTemp()},this.touchstart=Mt=>{Mt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=s.touchPos(this.element,Mt.targetTouches)[0],this.startTouch(Mt,this._startPos),s.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.addEventListener(window,"touchend",this.touchend))},this.touchmove=Mt=>{Mt.targetTouches.length!==1?this.reset():(this._lastPos=s.touchPos(this.element,Mt.targetTouches)[0],this.moveTouch(Mt,this._lastPos))},this.touchend=Mt=>{Mt.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let Fe=O.dragRotate._mouseRotate.getClickTolerance(),qe=O.dragRotate._mousePitch.getClickTolerance();this.element=pe,this.mouseRotate=Ac({clickTolerance:Fe,enable:!0}),this.touchRotate=(({enable:Mt,clickTolerance:jt,bearingDegreesPerPixelMoved:tr=.8})=>{let kr=new zf;return new hh({clickTolerance:jt,move:(Vr,Wr)=>({bearingDelta:(Wr.x-Vr.x)*tr}),moveStateManager:kr,enable:Mt,assignEvents:xu})})({clickTolerance:Fe,enable:!0}),this.map=O,Ie&&(this.mousePitch=gd({clickTolerance:qe,enable:!0}),this.touchPitch=(({enable:Mt,clickTolerance:jt,pitchDegreesPerPixelMoved:tr=-.5})=>{let kr=new zf;return new hh({clickTolerance:jt,move:(Vr,Wr)=>({pitchDelta:(Wr.y-Vr.y)*tr}),moveStateManager:kr,enable:Mt,assignEvents:xu})})({clickTolerance:qe,enable:!0})),s.addEventListener(pe,"mousedown",this.mousedown),s.addEventListener(pe,"touchstart",this.touchstart,{passive:!1}),s.addEventListener(pe,"touchcancel",this.reset)}startMouse(O,pe){this.mouseRotate.dragStart(O,pe),this.mousePitch&&this.mousePitch.dragStart(O,pe),s.disableDrag()}startTouch(O,pe){this.touchRotate.dragStart(O,pe),this.touchPitch&&this.touchPitch.dragStart(O,pe),s.disableDrag()}moveMouse(O,pe){let Ie=this.map,{bearingDelta:Fe}=this.mouseRotate.dragMove(O,pe)||{};if(Fe&&Ie.setBearing(Ie.getBearing()+Fe),this.mousePitch){let{pitchDelta:qe}=this.mousePitch.dragMove(O,pe)||{};qe&&Ie.setPitch(Ie.getPitch()+qe)}}moveTouch(O,pe){let Ie=this.map,{bearingDelta:Fe}=this.touchRotate.dragMove(O,pe)||{};if(Fe&&Ie.setBearing(Ie.getBearing()+Fe),this.touchPitch){let{pitchDelta:qe}=this.touchPitch.dragMove(O,pe)||{};qe&&Ie.setPitch(Ie.getPitch()+qe)}}off(){let O=this.element;s.removeEventListener(O,"mousedown",this.mousedown),s.removeEventListener(O,"touchstart",this.touchstart,{passive:!1}),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend),s.removeEventListener(O,"touchcancel",this.reset),this.offTemp()}offTemp(){s.enableDrag(),s.removeEventListener(window,"mousemove",this.mousemove),s.removeEventListener(window,"mouseup",this.mouseup),s.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),s.removeEventListener(window,"touchend",this.touchend)}}let iu;function Wl(Ke,O,pe){let Ie=new n.N(Ke.lng,Ke.lat);if(Ke=new n.N(Ke.lng,Ke.lat),O){let Fe=new n.N(Ke.lng-360,Ke.lat),qe=new n.N(Ke.lng+360,Ke.lat),Mt=pe.locationPoint(Ke).distSqr(O);pe.locationPoint(Fe).distSqr(O)180;){let Fe=pe.locationPoint(Ke);if(Fe.x>=0&&Fe.y>=0&&Fe.x<=pe.width&&Fe.y<=pe.height)break;Ke.lng>pe.center.lng?Ke.lng-=360:Ke.lng+=360}return Ke.lng!==Ie.lng&&pe.locationPoint(Ke).y>pe.height/2-pe.getHorizon()?Ke:Ie}let Mc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function eh(Ke,O,pe){let Ie=Ke.classList;for(let Fe in Mc)Ie.remove(`maplibregl-${pe}-anchor-${Fe}`);Ie.add(`maplibregl-${pe}-anchor-${O}`)}class $c extends n.E{constructor(O){if(super(),this._onKeyPress=pe=>{let Ie=pe.code,Fe=pe.charCode||pe.keyCode;Ie!=="Space"&&Ie!=="Enter"&&Fe!==32&&Fe!==13||this.togglePopup()},this._onMapClick=pe=>{let Ie=pe.originalEvent.target,Fe=this._element;this._popup&&(Ie===Fe||Fe.contains(Ie))&&this.togglePopup()},this._update=pe=>{var Ie;if(!this._map)return;let Fe=this._map.loaded()&&!this._map.isMoving();(pe?.type==="terrain"||pe?.type==="render"&&!Fe)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Wl(this._lngLat,this._flatPos,this._map.transform):(Ie=this._lngLat)===null||Ie===void 0?void 0:Ie.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let qe="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?qe=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(qe=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let Mt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?Mt="rotateX(0deg)":this._pitchAlignment==="map"&&(Mt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||pe&&pe.type!=="moveend"||(this._pos=this._pos.round()),s.setTransform(this._element,`${Mc[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${Mt} ${qe}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(pe&&pe.type==="moveend")}).catch(()=>{})},this._onMove=pe=>{if(!this._isDragging){let Ie=this._clickTolerance||this._map._clickTolerance;this._isDragging=pe.point.dist(this._pointerdownPos)>=Ie}this._isDragging&&(this._pos=pe.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new n.k("dragstart"))),this.fire(new n.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new n.k("dragend")),this._state="inactive"},this._addDragHandler=pe=>{this._element.contains(pe.originalEvent.target)&&(pe.preventDefault(),this._positionDelta=pe.point.sub(this._pos).add(this._offset),this._pointerdownPos=pe.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=O&&O.anchor||"center",this._color=O&&O.color||"#3FB1CE",this._scale=O&&O.scale||1,this._draggable=O&&O.draggable||!1,this._clickTolerance=O&&O.clickTolerance||0,this._subpixelPositioning=O&&O.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=O&&O.rotation||0,this._rotationAlignment=O&&O.rotationAlignment||"auto",this._pitchAlignment=O&&O.pitchAlignment&&O.pitchAlignment!=="auto"?O.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(O?.opacity,O?.opacityWhenCovered),O&&O.element)this._element=O.element,this._offset=n.P.convert(O&&O.offset||[0,0]);else{this._defaultMarker=!0,this._element=s.create("div");let pe=s.createNS("http://www.w3.org/2000/svg","svg"),Ie=41,Fe=27;pe.setAttributeNS(null,"display","block"),pe.setAttributeNS(null,"height",`${Ie}px`),pe.setAttributeNS(null,"width",`${Fe}px`),pe.setAttributeNS(null,"viewBox",`0 0 ${Fe} ${Ie}`);let qe=s.createNS("http://www.w3.org/2000/svg","g");qe.setAttributeNS(null,"stroke","none"),qe.setAttributeNS(null,"stroke-width","1"),qe.setAttributeNS(null,"fill","none"),qe.setAttributeNS(null,"fill-rule","evenodd");let Mt=s.createNS("http://www.w3.org/2000/svg","g");Mt.setAttributeNS(null,"fill-rule","nonzero");let jt=s.createNS("http://www.w3.org/2000/svg","g");jt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),jt.setAttributeNS(null,"fill","#000000");let tr=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let Lt of tr){let Vt=s.createNS("http://www.w3.org/2000/svg","ellipse");Vt.setAttributeNS(null,"opacity","0.04"),Vt.setAttributeNS(null,"cx","10.5"),Vt.setAttributeNS(null,"cy","5.80029008"),Vt.setAttributeNS(null,"rx",Lt.rx),Vt.setAttributeNS(null,"ry",Lt.ry),jt.appendChild(Vt)}let kr=s.createNS("http://www.w3.org/2000/svg","g");kr.setAttributeNS(null,"fill",this._color);let Vr=s.createNS("http://www.w3.org/2000/svg","path");Vr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),kr.appendChild(Vr);let Wr=s.createNS("http://www.w3.org/2000/svg","g");Wr.setAttributeNS(null,"opacity","0.25"),Wr.setAttributeNS(null,"fill","#000000");let Ti=s.createNS("http://www.w3.org/2000/svg","path");Ti.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),Wr.appendChild(Ti);let Vi=s.createNS("http://www.w3.org/2000/svg","g");Vi.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Vi.setAttributeNS(null,"fill","#FFFFFF");let et=s.createNS("http://www.w3.org/2000/svg","g");et.setAttributeNS(null,"transform","translate(8.0, 8.0)");let lt=s.createNS("http://www.w3.org/2000/svg","circle");lt.setAttributeNS(null,"fill","#000000"),lt.setAttributeNS(null,"opacity","0.25"),lt.setAttributeNS(null,"cx","5.5"),lt.setAttributeNS(null,"cy","5.5"),lt.setAttributeNS(null,"r","5.4999962");let Tt=s.createNS("http://www.w3.org/2000/svg","circle");Tt.setAttributeNS(null,"fill","#FFFFFF"),Tt.setAttributeNS(null,"cx","5.5"),Tt.setAttributeNS(null,"cy","5.5"),Tt.setAttributeNS(null,"r","5.4999962"),et.appendChild(lt),et.appendChild(Tt),Mt.appendChild(jt),Mt.appendChild(kr),Mt.appendChild(Wr),Mt.appendChild(Vi),Mt.appendChild(et),pe.appendChild(Mt),pe.setAttributeNS(null,"height",Ie*this._scale+"px"),pe.setAttributeNS(null,"width",Fe*this._scale+"px"),this._element.appendChild(pe),this._offset=n.P.convert(O&&O.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",pe=>{pe.preventDefault()}),this._element.addEventListener("mousedown",pe=>{pe.preventDefault()}),eh(this._element,this._anchor,"marker"),O&&O.className)for(let pe of O.className.split(" "))this._element.classList.add(pe);this._popup=null}addTo(O){return this.remove(),this._map=O,this._element.setAttribute("aria-label",O._getUIString("Marker.Title")),O.getCanvasContainer().appendChild(this._element),O.on("move",this._update),O.on("moveend",this._update),O.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),s.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(O){return this._lngLat=n.N.convert(O),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(O){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),O){if(!("offset"in O.options)){let pe=Math.abs(13.5)/Math.SQRT2;O.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[pe,-1*(38.1-13.5+pe)],"bottom-right":[-pe,-1*(38.1-13.5+pe)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=O,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(O){return this._subpixelPositioning=O,this}getPopup(){return this._popup}togglePopup(){let O=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:O?(O.isOpen()?O.remove():(O.setLngLat(this._lngLat),O.addTo(this._map)),this):this}_updateOpacity(O=!1){var pe,Ie;if(!(!((pe=this._map)===null||pe===void 0)&&pe.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(O)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let Fe=this._map,qe=Fe.terrain.depthAtPoint(this._pos),Mt=Fe.terrain.getElevationForLngLatZoom(this._lngLat,Fe.transform.tileZoom);if(Fe.transform.lngLatToCameraDepth(this._lngLat,Mt)-qe<.006)return void(this._element.style.opacity=this._opacity);let jt=-this._offset.y/Fe.transform._pixelPerMeter,tr=Math.sin(Fe.getPitch()*Math.PI/180)*jt,kr=Fe.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),Vr=Fe.transform.lngLatToCameraDepth(this._lngLat,Mt+tr)-kr>.006;!((Ie=this._popup)===null||Ie===void 0)&&Ie.isOpen()&&Vr&&this._popup.remove(),this._element.style.opacity=Vr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(O){return this._offset=n.P.convert(O),this._update(),this}addClassName(O){this._element.classList.add(O)}removeClassName(O){this._element.classList.remove(O)}toggleClassName(O){return this._element.classList.toggle(O)}setDraggable(O){return this._draggable=!!O,this._map&&(O?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(O){return this._rotation=O||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(O){return this._rotationAlignment=O||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(O){return this._pitchAlignment=O&&O!=="auto"?O:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(O,pe){return O===void 0&&pe===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),O!==void 0&&(this._opacity=O),pe!==void 0&&(this._opacityWhenCovered=pe),this._map&&this._updateOpacity(!0),this}}let Hh={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},th=0,Vh=!1,Wu={maxWidth:100,unit:"metric"};function Wh(Ke,O,pe){let Ie=pe&&pe.maxWidth||100,Fe=Ke._container.clientHeight/2,qe=Ke.unproject([0,Fe]),Mt=Ke.unproject([Ie,Fe]),jt=qe.distanceTo(Mt);if(pe&&pe.unit==="imperial"){let tr=3.2808*jt;tr>5280?cs(O,Ie,tr/5280,Ke._getUIString("ScaleControl.Miles")):cs(O,Ie,tr,Ke._getUIString("ScaleControl.Feet"))}else pe&&pe.unit==="nautical"?cs(O,Ie,jt/1852,Ke._getUIString("ScaleControl.NauticalMiles")):jt>=1e3?cs(O,Ie,jt/1e3,Ke._getUIString("ScaleControl.Kilometers")):cs(O,Ie,jt,Ke._getUIString("ScaleControl.Meters"))}function cs(Ke,O,pe,Ie){let Fe=function(qe){let Mt=Math.pow(10,`${Math.floor(qe)}`.length-1),jt=qe/Mt;return jt=jt>=10?10:jt>=5?5:jt>=3?3:jt>=2?2:jt>=1?1:function(tr){let kr=Math.pow(10,Math.ceil(-Math.log(tr)/Math.LN10));return Math.round(tr*kr)/kr}(jt),Mt*jt}(pe);Ke.style.width=O*(Fe/pe)+"px",Ke.innerHTML=`${Fe} ${Ie}`}let Fs={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},rh=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function tc(Ke){if(Ke){if(typeof Ke=="number"){let O=Math.round(Math.abs(Ke)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,Ke),"top-left":new n.P(O,O),"top-right":new n.P(-O,O),bottom:new n.P(0,-Ke),"bottom-left":new n.P(O,-O),"bottom-right":new n.P(-O,-O),left:new n.P(Ke,0),right:new n.P(-Ke,0)}}if(Ke instanceof n.P||Array.isArray(Ke)){let O=n.P.convert(Ke);return{center:O,top:O,"top-left":O,"top-right":O,bottom:O,"bottom-left":O,"bottom-right":O,left:O,right:O}}return{center:n.P.convert(Ke.center||[0,0]),top:n.P.convert(Ke.top||[0,0]),"top-left":n.P.convert(Ke["top-left"]||[0,0]),"top-right":n.P.convert(Ke["top-right"]||[0,0]),bottom:n.P.convert(Ke.bottom||[0,0]),"bottom-left":n.P.convert(Ke["bottom-left"]||[0,0]),"bottom-right":n.P.convert(Ke["bottom-right"]||[0,0]),left:n.P.convert(Ke.left||[0,0]),right:n.P.convert(Ke.right||[0,0])}}return tc(new n.P(0,0))}let ld=a;i.AJAXError=n.bh,i.Evented=n.E,i.LngLat=n.N,i.MercatorCoordinate=n.Z,i.Point=n.P,i.addProtocol=n.bi,i.config=n.a,i.removeProtocol=n.bj,i.AttributionControl=xs,i.BoxZoomHandler=Qc,i.CanvasSource=vt,i.CooperativeGesturesHandler=Va,i.DoubleClickZoomHandler=Pn,i.DragPanHandler=Ka,i.DragRotateHandler=oo,i.EdgeInsets=Fc,i.FullscreenControl=class extends n.E{constructor(Ke={}){super(),this._onFullscreenChange=()=>{var O;let pe=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((O=pe?.shadowRoot)===null||O===void 0)&&O.fullscreenElement;)pe=pe.shadowRoot.fullscreenElement;pe===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Ke&&Ke.container&&(Ke.container instanceof HTMLElement?this._container=Ke.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(Ke){return this._map=Ke,this._container||(this._container=this._map.getContainer()),this._controlContainer=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){s.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let Ke=this._fullscreenButton=s.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);s.create("span","maplibregl-ctrl-icon",Ke).setAttribute("aria-hidden","true"),Ke.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let Ke=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Ke),this._fullscreenButton.title=Ke}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},i.GeoJSONSource=Ge,i.GeolocateControl=class extends n.E{constructor(Ke){super(),this._onSuccess=O=>{if(this._map){if(this._isOutOfMapMaxBounds(O))return this._setErrorState(),this.fire(new n.k("outofmaxbounds",O)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=O,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(O),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(O),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.k("geolocate",O)),this._finish()}},this._updateCamera=O=>{let pe=new n.N(O.coords.longitude,O.coords.latitude),Ie=O.coords.accuracy,Fe=this._map.getBearing(),qe=n.e({bearing:Fe},this.options.fitBoundsOptions),Mt=fe.fromLngLat(pe,Ie);this._map.fitBounds(Mt,qe,{geolocateSource:!0})},this._updateMarker=O=>{if(O){let pe=new n.N(O.coords.longitude,O.coords.latitude);this._accuracyCircleMarker.setLngLat(pe).addTo(this._map),this._userLocationDotMarker.setLngLat(pe).addTo(this._map),this._accuracy=O.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=O=>{if(this._map){if(this.options.trackUserLocation)if(O.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let pe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(O.code===3&&Vh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.k("error",O)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",O=>O.preventDefault()),this._geolocateButton=s.create("button","maplibregl-ctrl-geolocate",this._container),s.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=O=>{if(this._map){if(O===!1){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");let pe=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe)}else{let pe=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=pe,this._geolocateButton.setAttribute("aria-label",pe)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=s.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new $c({element:this._dotElement}),this._circleElement=s.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new $c({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",pe=>{pe.geolocateSource||this._watchState!=="ACTIVE_LOCK"||pe.originalEvent&&pe.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.k("trackuserlocationend")),this.fire(new n.k("userlocationlostfocus")))})}},this.options=n.e({},Hh,Ke)}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return n._(this,arguments,void 0,function*(O=!1){if(iu!==void 0&&!O)return iu;if(window.navigator.permissions===void 0)return iu=!!window.navigator.geolocation,iu;try{iu=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{iu=!!window.navigator.geolocation}return iu})}().then(O=>this._finishSetupUI(O)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),s.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,th=0,Vh=!1}_isOutOfMapMaxBounds(Ke){let O=this._map.getMaxBounds(),pe=Ke.coords;return O&&(pe.longitudeO.getEast()||pe.latitudeO.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let Ke=this._map.getBounds(),O=Ke.getSouthEast(),pe=Ke.getNorthEast(),Ie=O.distanceTo(pe),Fe=Math.ceil(this._accuracy/(Ie/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Fe}px`,this._circleElement.style.height=`${Fe}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":th--,Vh=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.k("trackuserlocationstart")),this.fire(new n.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let Ke;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),th++,th>1?(Ke={maximumAge:6e5,timeout:0},Vh=!0):(Ke=this.options.positionOptions,Vh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Ke)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},i.Hash=Eh,i.ImageSource=_t,i.KeyboardHandler=Xr,i.LngLatBounds=fe,i.LogoControl=_o,i.Map=class extends rs{constructor(Ke){n.bf.mark(n.bg.create);let O=Object.assign(Object.assign({},$u),Ke);if(O.minZoom!=null&&O.maxZoom!=null&&O.minZoom>O.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(O.minPitch!=null&&O.maxPitch!=null&&O.minPitch>O.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(O.minPitch!=null&&O.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(O.maxPitch!=null&&O.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Eu(O.minZoom,O.maxZoom,O.minPitch,O.maxPitch,O.renderWorldCopies),{bearingSnap:O.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new no,this._controls=[],this._mapId=n.a4(),this._contextLost=pe=>{pe.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new n.k("webglcontextlost",{originalEvent:pe}))},this._contextRestored=pe=>{this._setupPainter(),this.resize(),this._update(),this.fire(new n.k("webglcontextrestored",{originalEvent:pe}))},this._onMapScroll=pe=>{if(pe.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=O.interactive,this._maxTileCacheSize=O.maxTileCacheSize,this._maxTileCacheZoomLevels=O.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=O.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=O.preserveDrawingBuffer===!0,this._antialias=O.antialias===!0,this._trackResize=O.trackResize===!0,this._bearingSnap=O.bearingSnap,this._refreshExpiredTiles=O.refreshExpiredTiles===!0,this._fadeDuration=O.fadeDuration,this._crossSourceCollisions=O.crossSourceCollisions===!0,this._collectResourceTiming=O.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Cl),O.locale),this._clickTolerance=O.clickTolerance,this._overridePixelRatio=O.pixelRatio,this._maxCanvasSize=O.maxCanvasSize,this.transformCameraUpdate=O.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=O.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=f.addThrottleControl(()=>this.isMoving()),this._requestManager=new k(O.transformRequest),typeof O.container=="string"){if(this._container=document.getElementById(O.container),!this._container)throw new Error(`Container '${O.container}' not found.`)}else{if(!(O.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=O.container}if(O.maxBounds&&this.setMaxBounds(O.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let pe=!1,Ie=xf(Fe=>{this._trackResize&&!this._removed&&(this.resize(Fe),this.redraw())},50);this._resizeObserver=new ResizeObserver(Fe=>{pe?Ie(Fe):pe=!0}),this._resizeObserver.observe(this._container)}this.handlers=new hs(this,O),this._hash=O.hash&&new Eh(typeof O.hash=="string"&&O.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:O.center,zoom:O.zoom,bearing:O.bearing,pitch:O.pitch}),O.bounds&&(this.resize(),this.fitBounds(O.bounds,n.e({},O.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=O.localIdeographFontFamily,this._validateStyle=O.validateStyle,O.style&&this.setStyle(O.style,{localIdeographFontFamily:O.localIdeographFontFamily}),O.attributionControl&&this.addControl(new xs(typeof O.attributionControl=="boolean"?void 0:O.attributionControl)),O.maplibreLogo&&this.addControl(new _o,O.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",pe=>{this._update(pe.dataType==="style"),this.fire(new n.k(`${pe.dataType}data`,pe))}),this.on("dataloading",pe=>{this.fire(new n.k(`${pe.dataType}dataloading`,pe))}),this.on("dataabort",pe=>{this.fire(new n.k("sourcedataabort",pe))})}_getMapId(){return this._mapId}addControl(Ke,O){if(O===void 0&&(O=Ke.getDefaultPosition?Ke.getDefaultPosition():"top-right"),!Ke||!Ke.onAdd)return this.fire(new n.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let pe=Ke.onAdd(this);this._controls.push(Ke);let Ie=this._controlPositions[O];return O.indexOf("bottom")!==-1?Ie.insertBefore(pe,Ie.firstChild):Ie.appendChild(pe),this}removeControl(Ke){if(!Ke||!Ke.onRemove)return this.fire(new n.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let O=this._controls.indexOf(Ke);return O>-1&&this._controls.splice(O,1),Ke.onRemove(this),this}hasControl(Ke){return this._controls.indexOf(Ke)>-1}calculateCameraOptionsFromTo(Ke,O,pe,Ie){return Ie==null&&this.terrain&&(Ie=this.terrain.getElevationForLngLatZoom(pe,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Ke,O,pe,Ie)}resize(Ke){var O;let pe=this._containerDimensions(),Ie=pe[0],Fe=pe[1],qe=this._getClampedPixelRatio(Ie,Fe);if(this._resizeCanvas(Ie,Fe,qe),this.painter.resize(Ie,Fe,qe),this.painter.overLimit()){let jt=this.painter.context.gl;this._maxCanvasSize=[jt.drawingBufferWidth,jt.drawingBufferHeight];let tr=this._getClampedPixelRatio(Ie,Fe);this._resizeCanvas(Ie,Fe,tr),this.painter.resize(Ie,Fe,tr)}this.transform.resize(Ie,Fe),(O=this._requestedCameraState)===null||O===void 0||O.resize(Ie,Fe);let Mt=!this._moving;return Mt&&(this.stop(),this.fire(new n.k("movestart",Ke)).fire(new n.k("move",Ke))),this.fire(new n.k("resize",Ke)),Mt&&this.fire(new n.k("moveend",Ke)),this}_getClampedPixelRatio(Ke,O){let{0:pe,1:Ie}=this._maxCanvasSize,Fe=this.getPixelRatio(),qe=Ke*Fe,Mt=O*Fe;return Math.min(qe>pe?pe/qe:1,Mt>Ie?Ie/Mt:1)*Fe}getPixelRatio(){var Ke;return(Ke=this._overridePixelRatio)!==null&&Ke!==void 0?Ke:devicePixelRatio}setPixelRatio(Ke){this._overridePixelRatio=Ke,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Ke){return this.transform.setMaxBounds(fe.convert(Ke)),this._update()}setMinZoom(Ke){if((Ke=Ke??-2)>=-2&&Ke<=this.transform.maxZoom)return this.transform.minZoom=Ke,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Ke,this._update(),this.getZoom()>Ke&&this.setZoom(Ke),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Ke){if((Ke=Ke??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Ke>=0&&Ke<=this.transform.maxPitch)return this.transform.minPitch=Ke,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Ke>=this.transform.minPitch)return this.transform.maxPitch=Ke,this._update(),this.getPitch()>Ke&&this.setPitch(Ke),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Ke){return this.transform.renderWorldCopies=Ke,this._update()}project(Ke){return this.transform.locationPoint(n.N.convert(Ke),this.style&&this.terrain)}unproject(Ke){return this.transform.pointLocation(n.P.convert(Ke),this.terrain)}isMoving(){var Ke;return this._moving||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isMoving())}isZooming(){var Ke;return this._zooming||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isZooming())}isRotating(){var Ke;return this._rotating||((Ke=this.handlers)===null||Ke===void 0?void 0:Ke.isRotating())}_createDelegatedListener(Ke,O,pe){if(Ke==="mouseenter"||Ke==="mouseover"){let Ie=!1;return{layers:O,listener:pe,delegates:{mousemove:Fe=>{let qe=O.filter(jt=>this.getLayer(jt)),Mt=qe.length!==0?this.queryRenderedFeatures(Fe.point,{layers:qe}):[];Mt.length?Ie||(Ie=!0,pe.call(this,new ch(Ke,this,Fe.originalEvent,{features:Mt}))):Ie=!1},mouseout:()=>{Ie=!1}}}}if(Ke==="mouseleave"||Ke==="mouseout"){let Ie=!1;return{layers:O,listener:pe,delegates:{mousemove:Fe=>{let qe=O.filter(Mt=>this.getLayer(Mt));(qe.length!==0?this.queryRenderedFeatures(Fe.point,{layers:qe}):[]).length?Ie=!0:Ie&&(Ie=!1,pe.call(this,new ch(Ke,this,Fe.originalEvent)))},mouseout:Fe=>{Ie&&(Ie=!1,pe.call(this,new ch(Ke,this,Fe.originalEvent)))}}}}{let Ie=Fe=>{let qe=O.filter(jt=>this.getLayer(jt)),Mt=qe.length!==0?this.queryRenderedFeatures(Fe.point,{layers:qe}):[];Mt.length&&(Fe.features=Mt,pe.call(this,Fe),delete Fe.features)};return{layers:O,listener:pe,delegates:{[Ke]:Ie}}}}_saveDelegatedListener(Ke,O){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Ke]=this._delegatedListeners[Ke]||[],this._delegatedListeners[Ke].push(O)}_removeDelegatedListener(Ke,O,pe){if(!this._delegatedListeners||!this._delegatedListeners[Ke])return;let Ie=this._delegatedListeners[Ke];for(let Fe=0;FeO.includes(Mt))){for(let Mt in qe.delegates)this.off(Mt,qe.delegates[Mt]);return void Ie.splice(Fe,1)}}}on(Ke,O,pe){if(pe===void 0)return super.on(Ke,O);let Ie=this._createDelegatedListener(Ke,typeof O=="string"?[O]:O,pe);this._saveDelegatedListener(Ke,Ie);for(let Fe in Ie.delegates)this.on(Fe,Ie.delegates[Fe]);return this}once(Ke,O,pe){if(pe===void 0)return super.once(Ke,O);let Ie=typeof O=="string"?[O]:O,Fe=this._createDelegatedListener(Ke,Ie,pe);for(let qe in Fe.delegates){let Mt=Fe.delegates[qe];Fe.delegates[qe]=(...jt)=>{this._removeDelegatedListener(Ke,Ie,pe),Mt(...jt)}}this._saveDelegatedListener(Ke,Fe);for(let qe in Fe.delegates)this.once(qe,Fe.delegates[qe]);return this}off(Ke,O,pe){return pe===void 0?super.off(Ke,O):(this._removeDelegatedListener(Ke,typeof O=="string"?[O]:O,pe),this)}queryRenderedFeatures(Ke,O){if(!this.style)return[];let pe,Ie=Ke instanceof n.P||Array.isArray(Ke),Fe=Ie?Ke:[[0,0],[this.transform.width,this.transform.height]];if(O=O||(Ie?{}:Ke)||{},Fe instanceof n.P||typeof Fe[0]=="number")pe=[n.P.convert(Fe)];else{let qe=n.P.convert(Fe[0]),Mt=n.P.convert(Fe[1]);pe=[qe,new n.P(Mt.x,qe.y),Mt,new n.P(qe.x,Mt.y),qe]}return this.style.queryRenderedFeatures(pe,O,this.transform)}querySourceFeatures(Ke,O){return this.style.querySourceFeatures(Ke,O)}setStyle(Ke,O){return(O=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},O)).diff!==!1&&O.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Ke?(this._diffStyle(Ke,O),this):(this._localIdeographFontFamily=O.localIdeographFontFamily,this._updateStyle(Ke,O))}setTransformRequest(Ke){return this._requestManager.setTransformRequest(Ke),this}_getUIString(Ke){let O=this._locale[Ke];if(O==null)throw new Error(`Missing UI string '${Ke}'`);return O}_updateStyle(Ke,O){if(O.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Ke,O));let pe=this.style&&O.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Ke)),Ke?(this.style=new li(this,O||{}),this.style.setEventedParent(this,{style:this.style}),typeof Ke=="string"?this.style.loadURL(Ke,O,pe):this.style.loadJSON(Ke,O,pe),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new li(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Ke,O){if(typeof Ke=="string"){let pe=this._requestManager.transformRequest(Ke,"Style");n.h(pe,new AbortController).then(Ie=>{this._updateDiff(Ie.data,O)}).catch(Ie=>{Ie&&this.fire(new n.j(Ie))})}else typeof Ke=="object"&&this._updateDiff(Ke,O)}_updateDiff(Ke,O){try{this.style.setState(Ke,O)&&this._update(!0)}catch(pe){n.w(`Unable to perform style diff: ${pe.message||pe.error||pe}. Rebuilding the style from scratch.`),this._updateStyle(Ke,O)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(Ke,O){return this._lazyInitEmptyStyle(),this.style.addSource(Ke,O),this._update(!0)}isSourceLoaded(Ke){let O=this.style&&this.style.sourceCaches[Ke];if(O!==void 0)return O.loaded();this.fire(new n.j(new Error(`There is no source with ID '${Ke}'`)))}setTerrain(Ke){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Ke){let O=this.style.sourceCaches[Ke.source];if(!O)throw new Error(`cannot load terrain, because there exists no source with ID: ${Ke.source}`);this.terrain===null&&O.reload();for(let pe in this.style._layers){let Ie=this.style._layers[pe];Ie.type==="hillshade"&&Ie.source===Ke.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ul(this.painter,O,Ke),this.painter.renderToTexture=new gu(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=pe=>{pe.dataType==="style"?this.terrain.sourceCache.freeRtt():pe.dataType==="source"&&pe.tile&&(pe.sourceId!==Ke.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(pe.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new n.k("terrain",{terrain:Ke})),this}getTerrain(){var Ke,O;return(O=(Ke=this.terrain)===null||Ke===void 0?void 0:Ke.options)!==null&&O!==void 0?O:null}areTilesLoaded(){let Ke=this.style&&this.style.sourceCaches;for(let O in Ke){let pe=Ke[O]._tiles;for(let Ie in pe){let Fe=pe[Ie];if(Fe.state!=="loaded"&&Fe.state!=="errored")return!1}}return!0}removeSource(Ke){return this.style.removeSource(Ke),this._update(!0)}getSource(Ke){return this.style.getSource(Ke)}addImage(Ke,O,pe={}){let{pixelRatio:Ie=1,sdf:Fe=!1,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:tr,textFitHeight:kr}=pe;if(this._lazyInitEmptyStyle(),!(O instanceof HTMLImageElement||n.b(O))){if(O.width===void 0||O.height===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:Vr,height:Wr,data:Ti}=O,Vi=O;return this.style.addImage(Ke,{data:new n.R({width:Vr,height:Wr},new Uint8Array(Ti)),pixelRatio:Ie,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:tr,textFitHeight:kr,sdf:Fe,version:0,userImage:Vi}),Vi.onAdd&&Vi.onAdd(this,Ke),this}}{let{width:Vr,height:Wr,data:Ti}=u.getImageData(O);this.style.addImage(Ke,{data:new n.R({width:Vr,height:Wr},Ti),pixelRatio:Ie,stretchX:qe,stretchY:Mt,content:jt,textFitWidth:tr,textFitHeight:kr,sdf:Fe,version:0})}}updateImage(Ke,O){let pe=this.style.getImage(Ke);if(!pe)return this.fire(new n.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let Ie=O instanceof HTMLImageElement||n.b(O)?u.getImageData(O):O,{width:Fe,height:qe,data:Mt}=Ie;if(Fe===void 0||qe===void 0)return this.fire(new n.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Fe!==pe.data.width||qe!==pe.data.height)return this.fire(new n.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let jt=!(O instanceof HTMLImageElement||n.b(O));return pe.data.replace(Mt,jt),this.style.updateImage(Ke,pe),this}getImage(Ke){return this.style.getImage(Ke)}hasImage(Ke){return Ke?!!this.style.getImage(Ke):(this.fire(new n.j(new Error("Missing required image id"))),!1)}removeImage(Ke){this.style.removeImage(Ke)}loadImage(Ke){return f.getImage(this._requestManager.transformRequest(Ke,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Ke,O){return this._lazyInitEmptyStyle(),this.style.addLayer(Ke,O),this._update(!0)}moveLayer(Ke,O){return this.style.moveLayer(Ke,O),this._update(!0)}removeLayer(Ke){return this.style.removeLayer(Ke),this._update(!0)}getLayer(Ke){return this.style.getLayer(Ke)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Ke,O,pe){return this.style.setLayerZoomRange(Ke,O,pe),this._update(!0)}setFilter(Ke,O,pe={}){return this.style.setFilter(Ke,O,pe),this._update(!0)}getFilter(Ke){return this.style.getFilter(Ke)}setPaintProperty(Ke,O,pe,Ie={}){return this.style.setPaintProperty(Ke,O,pe,Ie),this._update(!0)}getPaintProperty(Ke,O){return this.style.getPaintProperty(Ke,O)}setLayoutProperty(Ke,O,pe,Ie={}){return this.style.setLayoutProperty(Ke,O,pe,Ie),this._update(!0)}getLayoutProperty(Ke,O){return this.style.getLayoutProperty(Ke,O)}setGlyphs(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Ke,O),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Ke,O,pe={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Ke,O,pe,Ie=>{Ie||this._update(!0)}),this}removeSprite(Ke){return this._lazyInitEmptyStyle(),this.style.removeSprite(Ke),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Ke,O,pe=>{pe||this._update(!0)}),this}setLight(Ke,O={}){return this._lazyInitEmptyStyle(),this.style.setLight(Ke,O),this._update(!0)}getLight(){return this.style.getLight()}setSky(Ke){return this._lazyInitEmptyStyle(),this.style.setSky(Ke),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Ke,O){return this.style.setFeatureState(Ke,O),this._update()}removeFeatureState(Ke,O){return this.style.removeFeatureState(Ke,O),this._update()}getFeatureState(Ke){return this.style.getFeatureState(Ke)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Ke=0,O=0;return this._container&&(Ke=this._container.clientWidth||400,O=this._container.clientHeight||300),[Ke,O]}_setupContainer(){let Ke=this._container;Ke.classList.add("maplibregl-map");let O=this._canvasContainer=s.create("div","maplibregl-canvas-container",Ke);this._interactive&&O.classList.add("maplibregl-interactive"),this._canvas=s.create("canvas","maplibregl-canvas",O),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let pe=this._containerDimensions(),Ie=this._getClampedPixelRatio(pe[0],pe[1]);this._resizeCanvas(pe[0],pe[1],Ie);let Fe=this._controlContainer=s.create("div","maplibregl-control-container",Ke),qe=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(Mt=>{qe[Mt]=s.create("div",`maplibregl-ctrl-${Mt} `,Fe)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Ke,O,pe){this._canvas.width=Math.floor(pe*Ke),this._canvas.height=Math.floor(pe*O),this._canvas.style.width=`${Ke}px`,this._canvas.style.height=`${O}px`}_setupPainter(){let Ke={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},O=null;this._canvas.addEventListener("webglcontextcreationerror",Ie=>{O={requestedAttributes:Ke},Ie&&(O.statusMessage=Ie.statusMessage,O.type=Ie.type)},{once:!0});let pe=this._canvas.getContext("webgl2",Ke)||this._canvas.getContext("webgl",Ke);if(!pe){let Ie="Failed to initialize WebGL";throw O?(O.message=Ie,new Error(JSON.stringify(O))):new Error(Ie)}this.painter=new tf(pe,this.transform),h.testSupport(pe)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Ke){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Ke,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Ke){return this._update(),this._renderTaskQueue.add(Ke)}_cancelRenderFrame(Ke){this._renderTaskQueue.remove(Ke)}_render(Ke){let O=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Ke),this._removed)return;let pe=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let Fe=this.transform.zoom,qe=u.now();this.style.zoomHistory.update(Fe,qe);let Mt=new n.z(Fe,{now:qe,fadeDuration:O,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),jt=Mt.crossFadingFactor();jt===1&&jt===this._crossFadingFactor||(pe=!0,this._crossFadingFactor=jt),this.style.update(Mt)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,O,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:O,showPadding:this.showPadding}),this.fire(new n.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.bf.mark(n.bg.load),this.fire(new n.k("load"))),this.style&&(this.style.hasTransitions()||pe)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let Ie=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ie||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.k("idle")),!this._loaded||this._fullyLoaded||Ie||(this._fullyLoaded=!0,n.bf.mark(n.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var Ke;this._hash&&this._hash.remove();for(let pe of this._controls)pe.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),f.removeThrottleControl(this._imageQueueHandle),(Ke=this._resizeObserver)===null||Ke===void 0||Ke.disconnect();let O=this.painter.context.gl.getExtension("WEBGL_lose_context");O!=null&&O.loseContext&&O.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),s.remove(this._canvasContainer),s.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),n.bf.clearMetrics(),this._removed=!0,this.fire(new n.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(Ke=>{n.bf.frame(Ke),this._frameRequest=null,this._render(Ke)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Ke){this._showTileBoundaries!==Ke&&(this._showTileBoundaries=Ke,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Ke){this._showPadding!==Ke&&(this._showPadding=Ke,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Ke){this._showCollisionBoxes!==Ke&&(this._showCollisionBoxes=Ke,Ke?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Ke){this._showOverdrawInspector!==Ke&&(this._showOverdrawInspector=Ke,this._update())}get repaint(){return!!this._repaint}set repaint(Ke){this._repaint!==Ke&&(this._repaint=Ke,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Ke){this._vertices=Ke,this._update()}get version(){return ec}getCameraTargetElevation(){return this.transform.elevation}},i.MapMouseEvent=ch,i.MapTouchEvent=kf,i.MapWheelEvent=Hf,i.Marker=$c,i.NavigationControl=class{constructor(Ke){this._updateZoomButtons=()=>{let O=this._map.getZoom(),pe=O===this._map.getMaxZoom(),Ie=O===this._map.getMinZoom();this._zoomInButton.disabled=pe,this._zoomOutButton.disabled=Ie,this._zoomInButton.setAttribute("aria-disabled",pe.toString()),this._zoomOutButton.setAttribute("aria-disabled",Ie.toString())},this._rotateCompassArrow=()=>{let O=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=O},this._setButtonTitle=(O,pe)=>{let Ie=this._map._getUIString(`NavigationControl.${pe}`);O.title=Ie,O.setAttribute("aria-label",Ie)},this.options=n.e({},Ho,Ke),this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",O=>O.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",O=>this._map.zoomIn({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",O=>this._map.zoomOut({},{originalEvent:O})),s.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",O=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:O}):this._map.resetNorth({},{originalEvent:O})}),this._compassIcon=s.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Ke){return this._map=Ke,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ds(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){s.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(Ke,O){let pe=s.create("button",Ke,this._container);return pe.type="button",pe.addEventListener("click",O),pe}},i.Popup=class extends n.E{constructor(Ke){super(),this.remove=()=>(this._content&&s.remove(this._content),this._container&&(s.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.k("close"))),this),this._onMouseUp=O=>{this._update(O.point)},this._onMouseMove=O=>{this._update(O.point)},this._onDrag=O=>{this._update(O.point)},this._update=O=>{var pe;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=s.create("div","maplibregl-popup",this._map.getContainer()),this._tip=s.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let jt of this.options.className.split(" "))this._container.classList.add(jt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Wl(this._lngLat,this._flatPos,this._map.transform):(pe=this._lngLat)===null||pe===void 0?void 0:pe.wrap(),this._trackPointer&&!O)return;let Ie=this._flatPos=this._pos=this._trackPointer&&O?O:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&O?O:this._map.transform.locationPoint(this._lngLat));let Fe=this.options.anchor,qe=tc(this.options.offset);if(!Fe){let jt=this._container.offsetWidth,tr=this._container.offsetHeight,kr;kr=Ie.y+qe.bottom.ythis._map.transform.height-tr?["bottom"]:[],Ie.xthis._map.transform.width-jt/2&&kr.push("right"),Fe=kr.length===0?"bottom":kr.join("-")}let Mt=Ie.add(qe[Fe]);this.options.subpixelPositioning||(Mt=Mt.round()),s.setTransform(this._container,`${Mc[Fe]} translate(${Mt.x}px,${Mt.y}px)`),eh(this._container,Fe,"popup")},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(Fs),Ke)}addTo(Ke){return this._map&&this.remove(),this._map=Ke,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(Ke){return this._lngLat=n.N.convert(Ke),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(Ke){return this.setDOMContent(document.createTextNode(Ke))}setHTML(Ke){let O=document.createDocumentFragment(),pe=document.createElement("body"),Ie;for(pe.innerHTML=Ke;Ie=pe.firstChild,Ie;)O.appendChild(Ie);return this.setDOMContent(O)}getMaxWidth(){var Ke;return(Ke=this._container)===null||Ke===void 0?void 0:Ke.style.maxWidth}setMaxWidth(Ke){return this.options.maxWidth=Ke,this._update(),this}setDOMContent(Ke){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=s.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(Ke),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Ke){return this._container&&this._container.classList.add(Ke),this}removeClassName(Ke){return this._container&&this._container.classList.remove(Ke),this}setOffset(Ke){return this.options.offset=Ke,this._update(),this}toggleClassName(Ke){if(this._container)return this._container.classList.toggle(Ke)}setSubpixelPositioning(Ke){this.options.subpixelPositioning=Ke}_createCloseButton(){this.options.closeButton&&(this._closeButton=s.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let Ke=this._container.querySelector(rh);Ke&&Ke.focus()}},i.RasterDEMTileSource=Ze,i.RasterTileSource=Be,i.ScaleControl=class{constructor(Ke){this._onMove=()=>{Wh(this._map,this._container,this.options)},this.setUnit=O=>{this.options.unit=O,Wh(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Wu),Ke)}getDefaultPosition(){return"bottom-left"}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Ke.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){s.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},i.ScrollZoomHandler=hn,i.Style=li,i.TerrainControl=class{constructor(Ke){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=Ke}onAdd(Ke){return this._map=Ke,this._container=s.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=s.create("button","maplibregl-ctrl-terrain",this._container),s.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){s.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},i.TwoFingersTouchPitchHandler=sd,i.TwoFingersTouchRotateHandler=Tf,i.TwoFingersTouchZoomHandler=fu,i.TwoFingersTouchZoomRotateHandler=wa,i.VectorTileSource=Re,i.VideoSource=mt,i.addSourceType=(Ke,O)=>n._(void 0,void 0,void 0,function*(){if(Ae(Ke))throw new Error(`A source type called "${Ke}" already exists.`);((pe,Ie)=>{ct[pe]=Ie})(Ke,O)}),i.clearPrewarmedResources=function(){let Ke=ce;Ke&&(Ke.isPreloaded()&&Ke.numActive()===1?(Ke.release(he),ce=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},i.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},i.getRTLTextPluginStatus=function(){return xt().getRTLTextPluginStatus()},i.getVersion=function(){return ld},i.getWorkerCount=function(){return be.workerCount},i.getWorkerUrl=function(){return n.a.WORKER_URL},i.importScriptInWorkers=function(Ke){return se().broadcast("IS",Ke)},i.prewarm=function(){ge().acquire(he)},i.setMaxParallelImageRequests=function(Ke){n.a.MAX_PARALLEL_IMAGE_REQUESTS=Ke},i.setRTLTextPlugin=function(Ke,O){return xt().setRTLTextPlugin(Ke,O)},i.setWorkerCount=function(Ke){be.workerCount=Ke},i.setWorkerUrl=function(Ke){n.a.WORKER_URL=Ke}});var P=d;return P})}),mee=ze((te,Y)=>{var d=ji(),y=cc().sanitizeHTML,z=pz(),P=K_();function i(u,s){this.subplot=u,this.uid=u.uid+"-"+s,this.index=s,this.idSource="source-"+this.uid,this.idLayer=P.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var n=i.prototype;n.update=function(u){this.visible?this.needsNewImage(u)?this.updateImage(u):this.needsNewSource(u)?(this.removeLayer(),this.updateSource(u),this.updateLayer(u)):this.needsNewLayer(u)?this.updateLayer(u):this.updateStyle(u):(this.updateSource(u),this.updateLayer(u)),this.visible=a(u)},n.needsNewImage=function(u){var s=this.subplot.map;return s.getSource(this.idSource)&&this.sourceType==="image"&&u.sourcetype==="image"&&(this.source!==u.source||JSON.stringify(this.coordinates)!==JSON.stringify(u.coordinates))},n.needsNewSource=function(u){return this.sourceType!==u.sourcetype||JSON.stringify(this.source)!==JSON.stringify(u.source)||this.layerType!==u.type},n.needsNewLayer=function(u){return this.layerType!==u.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},n.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},n.updateImage=function(u){var s=this.subplot.map;s.getSource(this.idSource).updateImage({url:u.source,coordinates:u.coordinates});var h=this.findFollowingMapLayerId(this.lookupBelow());h!==null&&this.subplot.map.moveLayer(this.idLayer,h)},n.updateSource=function(u){var s=this.subplot.map;if(s.getSource(this.idSource)&&s.removeSource(this.idSource),this.sourceType=u.sourcetype,this.source=u.source,!!a(u)){var h=o(u);s.addSource(this.idSource,h)}},n.findFollowingMapLayerId=function(u){if(u==="traces")for(var s=this.subplot.getMapLayers(),h=0;h0){for(var h=0;h0}function l(u){var s={},h={};switch(u.type){case"circle":d.extendFlat(h,{"circle-radius":u.circle.radius,"circle-color":u.color,"circle-opacity":u.opacity});break;case"line":d.extendFlat(h,{"line-width":u.line.width,"line-color":u.color,"line-opacity":u.opacity,"line-dasharray":u.line.dash});break;case"fill":d.extendFlat(h,{"fill-color":u.color,"fill-outline-color":u.fill.outlinecolor,"fill-opacity":u.opacity});break;case"symbol":var m=u.symbol,b=z(m.textposition,m.iconsize);d.extendFlat(s,{"icon-image":m.icon+"-15","icon-size":m.iconsize/10,"text-field":m.text,"text-size":m.textfont.size,"text-anchor":b.anchor,"text-offset":b.offset,"symbol-placement":m.placement}),d.extendFlat(h,{"icon-color":u.color,"text-color":m.textfont.color,"text-opacity":u.opacity});break;case"raster":d.extendFlat(h,{"raster-fade-duration":0,"raster-opacity":u.opacity});break}return{layout:s,paint:h}}function o(u){var s=u.sourcetype,h=u.source,m={type:s},b;return s==="geojson"?b="data":s==="vector"?b=typeof h=="string"?"url":"tiles":s==="raster"?(b="tiles",m.tileSize=256):s==="image"&&(b="url",m.coordinates=u.coordinates),m[b]=h,u.sourceattribution&&(m.attribution=y(u.sourceattribution)),m}Y.exports=function(u,s,h){var m=new i(u,s);return m.update(h),m}}),gee=ze((te,Y)=>{var d=pee(),y=ji(),z=W_(),P=as(),i=Os(),n=jp(),a=hf(),l=dm(),o=l.drawMode,u=l.selectMode,s=Ef().prepSelect,h=Ef().clearOutline,m=Ef().clearSelectionsCache,b=Ef().selectOnClick,x=K_(),_=mee();function A(I,M){this.id=M,this.gd=I;var p=I._fullLayout,g=I._context;this.container=p._glcontainer.node(),this.isStatic=g.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var f=A.prototype;f.plot=function(I,M,p){var g=this,C;g.map?C=new Promise(function(T,N){g.updateMap(I,M,T,N)}):C=new Promise(function(T,N){g.createMap(I,M,T,N)}),p.push(C)},f.createMap=function(I,M,p,g){var C=this,T=M[C.id],N=C.styleObj=w(T.style),B=T.bounds,U=B?[[B.west,B.south],[B.east,B.north]]:null,V=C.map=new d.Map({container:C.div,style:N.style,center:E(T.center),zoom:T.zoom,bearing:T.bearing,pitch:T.pitch,maxBounds:U,interactive:!C.isStatic,preserveDrawingBuffer:C.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),W={};V.on("styleimagemissing",function(H){var q=H.id;if(!W[q]&&q.includes("-15")){W[q]=!0;var G=new Image(15,15);G.onload=function(){V.addImage(q,G)},G.crossOrigin="Anonymous",G.src="https://unpkg.com/maki@2.1.0/icons/"+q+".svg"}}),V.setTransformRequest(function(H){return H=H.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),H=H.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:H}}),V._canvas.style.left="0px",V._canvas.style.top="0px",C.rejectOnError(g),C.isStatic||C.initFx(I,M);var F=[];F.push(new Promise(function(H){V.once("load",H)})),F=F.concat(z.fetchTraceGeoData(I)),Promise.all(F).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.updateMap=function(I,M,p,g){var C=this,T=C.map,N=M[this.id];C.rejectOnError(g);var B=[],U=w(N.style);JSON.stringify(C.styleObj)!==JSON.stringify(U)&&(C.styleObj=U,T.setStyle(U.style),C.traceHash={},B.push(new Promise(function(V){T.once("styledata",V)}))),B=B.concat(z.fetchTraceGeoData(I)),Promise.all(B).then(function(){C.fillBelowLookup(I,M),C.updateData(I),C.updateLayout(M),C.resolveOnRender(p)}).catch(g)},f.fillBelowLookup=function(I,M){var p=M[this.id],g=p.layers,C,T,N=this.belowLookup={},B=!1;for(C=0;C1)for(C=0;C-1&&b(U.originalEvent,g,[p.xaxis],[p.yaxis],p.id,B),V.indexOf("event")>-1&&a.click(g,U.originalEvent)}}},f.updateFx=function(I){var M=this,p=M.map,g=M.gd;if(M.isStatic)return;function C(U){var V=M.map.unproject(U);return[V.lng,V.lat]}var T=I.dragmode,N;N=function(U,V){if(V.isRect){var W=U.range={};W[M.id]=[C([V.xmin,V.ymin]),C([V.xmax,V.ymax])]}else{var F=U.lassoPoints={};F[M.id]=V.map(C)}};var B=M.dragOptions;M.dragOptions=y.extendDeep(B||{},{dragmode:I.dragmode,element:M.div,gd:g,plotinfo:{id:M.id,domain:I[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:N},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),p.off("click",M.onClickInPanHandler),u(T)||o(T)?(p.dragPan.disable(),p.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(U,V,W){s(U,V,W,M.dragOptions,T)},n.init(M.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),p.on("click",M.onClickInPanHandler))},f.updateFramework=function(I){var M=I[this.id].domain,p=I._size,g=this.div.style;g.width=p.w*(M.x[1]-M.x[0])+"px",g.height=p.h*(M.y[1]-M.y[0])+"px",g.left=p.l+M.x[0]*p.w+"px",g.top=p.t+(1-M.y[1])*p.h+"px",this.xaxis._offset=p.l+M.x[0]*p.w,this.xaxis._length=p.w*(M.x[1]-M.x[0]),this.yaxis._offset=p.t+(1-M.y[1])*p.h,this.yaxis._length=p.h*(M.y[1]-M.y[0])},f.updateLayers=function(I){var M=I[this.id],p=M.layers,g=this.layerList,C;if(p.length!==g.length){for(C=0;C{var d=ji(),y=z_(),z=Zd(),P=O6();Y.exports=function(a,l,o){y(a,l,o,{type:"map",attributes:P,handleDefaults:i,partition:"y"})};function i(a,l,o){o("style"),o("center.lon"),o("center.lat"),o("zoom"),o("bearing"),o("pitch");var u=o("bounds.west"),s=o("bounds.east"),h=o("bounds.south"),m=o("bounds.north");(u===void 0||s===void 0||h===void 0||m===void 0)&&delete l.bounds,z(a,l,{name:"layers",handleItemDefaults:n}),l._input=a}function n(a,l){function o(x,_){return d.coerce(a,l,P.layers,x,_)}var u=o("visible");if(u){var s=o("sourcetype"),h=s==="raster"||s==="image";o("source"),o("sourceattribution"),s==="vector"&&o("sourcelayer"),s==="image"&&o("coordinates");var m;h&&(m="raster");var b=o("type",m);h&&b!=="raster"&&(b=l.type="raster",d.log("Source types *raster* and *image* must drawn *raster* layer type.")),o("below"),o("color"),o("opacity"),o("minzoom"),o("maxzoom"),b==="circle"&&o("circle.radius"),b==="line"&&(o("line.width"),o("line.dash")),b==="fill"&&o("fill.outlinecolor"),b==="symbol"&&(o("symbol.icon"),o("symbol.iconsize"),o("symbol.text"),d.coerceFont(o,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),o("symbol.textposition"),o("symbol.placement"))}}}),gA=ze(te=>{var Y=ji(),d=Y.strTranslate,y=Y.strScale,z=Ed().getSubplotCalcData,P=k0(),i=ri(),n=Zs(),a=cc(),l=gee(),o="map";te.name=o,te.attr="subplot",te.idRoot=o,te.idRegex=te.attrRegex=Y.counterRegex(o),te.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},te.layoutAttributes=O6(),te.supplyLayoutDefaults=vee(),te.plot=function(u){for(var s=u._fullLayout,h=u.calcdata,m=s._subplots[o],b=0;bp/2){var g=D.split("|").join("
");I.text(g).attr("data-unformatted",g).call(a.convertToTspans,u),M=n.bBox(I.node())}I.attr("transform",d(-3,-M.height+8)),E.insert("rect",".static-attribution").attr({x:-M.width-6,y:-M.height-3,width:M.width+6,height:M.height+3,fill:"rgba(255, 255, 255, 0.75)"});var C=1;M.width+6>p&&(C=p/(M.width+6));var T=[m.l+m.w*_.x[1],m.t+m.h*(1-_.y[0])];E.attr("transform",d(T[0],T[1])+y(C))}},te.updateFx=function(u){for(var s=u._fullLayout,h=s._subplots[o],m=0;m{Y.exports={attributes:pA(),supplyDefaults:uee(),colorbar:Mo(),formatLabels:dz(),calc:WC(),plot:hee(),hoverPoints:mA().hoverPoints,eventData:fee(),selectPoints:dee(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.update(y)}},moduleType:"trace",name:"scattermap",basePlotModule:gA(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}),_ee=ze((te,Y)=>{Y.exports=yee()}),mz=ze((te,Y)=>{var d=qw(),y=Oc(),{hovertemplateAttrs:z,templatefallbackAttrs:P}=rc(),i=xa(),n=nn().extendFlat;Y.exports=n({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:n({},d.featureidkey,{}),below:{valType:"string",editType:"plot"},text:d.text,hovertext:d.hovertext,marker:{line:{color:n({},d.marker.line.color,{editType:"plot"}),width:n({},d.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:n({},d.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:n({},d.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n({},d.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:d.hoverinfo,hovertemplate:z({},{keys:["properties"]}),hovertemplatefallback:P(),showlegend:n({},i.showlegend,{dflt:!1})},y("",{cLetter:"z",editTypeOverride:"calc"}))}),xee=ze((te,Y)=>{var d=ji(),y=Cc(),z=mz();Y.exports=function(P,i,n,a){function l(m,b){return d.coerce(P,i,z,m,b)}var o=l("locations"),u=l("z"),s=l("geojson");if(!d.isArrayOrTypedArray(o)||!o.length||!d.isArrayOrTypedArray(u)||!u.length||!(typeof s=="string"&&s!==""||d.isPlainObject(s))){i.visible=!1;return}l("featureidkey"),i._length=Math.min(o.length,u.length),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback");var h=l("marker.line.width");h&&l("marker.line.color"),l("marker.opacity"),y(P,i,a,l,{prefix:"",cLetter:"z"}),d.coerceSelectionMarkerOpacity(i,l)}}),gz=ze((te,Y)=>{var d=Sr(),y=ji(),z=lh(),P=Zs(),i=V_().makeBlank,n=W_();function a(o){var u=o[0].trace,s=u.visible===!0&&u._length!==0,h={layout:{visibility:"none"},paint:{}},m={layout:{visibility:"none"},paint:{}},b=u._opts={fill:h,line:m,geojson:i()};if(!s)return b;var x=n.extractTraceFeature(o);if(!x)return b;var _=z.makeColorScaleFuncFromTrace(u),A=u.marker,f=A.line||{},k;y.isArrayOrTypedArray(A.opacity)&&(k=function(C){var T=C.mo;return d(T)?+y.constrain(T,0,1):0});var w;y.isArrayOrTypedArray(f.color)&&(w=function(C){return C.mlc});var D;y.isArrayOrTypedArray(f.width)&&(D=function(C){return C.mlw});for(var E=0;E{var d=gz().convert,y=gz().convertOnSelect,z=K_().traceLayerPrefix;function P(n,a){this.type="choroplethmap",this.subplot=n,this.uid=a,this.sourceId="source-"+a,this.layerList=[["fill",z+a+"-fill"],["line",z+a+"-line"]],this.below=null}var i=P.prototype;i.update=function(n){this._update(d(n)),n[0].trace._glTrace=this},i.updateOnSelect=function(n){this._update(y(n))},i._update=function(n){var a=this.subplot,l=this.layerList,o=a.belowLookup["trace-"+this.uid];a.map.getSource(this.sourceId).setData(n.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(n,o),this.below=o);for(var u=0;u=0;l--)n.removeLayer(a[l][1])},i.dispose=function(){var n=this.subplot.map;this._removeLayers(),n.removeSource(this.sourceId)},Y.exports=function(n,a){var l=a[0].trace,o=new P(n,l.uid),u=o.sourceId,s=d(a),h=o.below=n.belowLookup["trace-"+l.uid];return n.map.addSource(u,{type:"geojson",data:s.geojson}),o._addLayers(s,h),a[0].trace._glTrace=o,o}}),wee=ze((te,Y)=>{Y.exports={attributes:mz(),supplyDefaults:xee(),colorbar:D_(),calc:KC(),plot:bee(),hoverPoints:XC(),eventData:JC(),selectPoints:QC(),styleOnSelect:function(d,y){if(y){var z=y[0].trace;z._glTrace.updateOnSelect(y)}},getBelow:function(d,y){for(var z=y.getMapLayers(),P=z.length-2;P>=0;P--){var i=z[P].id;if(typeof i=="string"&&i.indexOf("water")===0){for(var n=P+1;n{Y.exports=wee()}),vz=ze((te,Y)=>{var d=Oc(),{hovertemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=xa(),i=pA(),n=nn().extendFlat;Y.exports=n({lon:i.lon,lat:i.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:i.text,hovertext:i.hovertext,hoverinfo:n({},P.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:y(),hovertemplatefallback:z(),showlegend:n({},P.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))}),Tee=ze((te,Y)=>{var d=ji(),y=Cc(),z=vz();Y.exports=function(P,i,n,a){function l(h,m){return d.coerce(P,i,z,h,m)}var o=l("lon")||[],u=l("lat")||[],s=Math.min(o.length,u.length);if(!s){i.visible=!1;return}i._length=s,l("z"),l("radius"),l("below"),l("text"),l("hovertext"),l("hovertemplate"),l("hovertemplatefallback"),y(P,i,a,l,{prefix:"",cLetter:"z"})}}),See=ze((te,Y)=>{var d=Sr(),y=ji().isArrayOrTypedArray,z=ei().BADNUM,P=Tp(),i=ji()._;Y.exports=function(n,a){for(var l=a._length,o=new Array(l),u=a.z,s=y(u)&&u.length,h=0;h{var d=Sr(),y=ji(),z=Xi(),P=lh(),i=ei().BADNUM,n=V_().makeBlank;Y.exports=function(a){var l=a[0].trace,o=l.visible===!0&&l._length!==0,u={layout:{visibility:"none"},paint:{}},s=l._opts={heatmap:u,geojson:n()};if(!o)return s;var h=[],m,b=l.z,x=l.radius,_=y.isArrayOrTypedArray(b)&&b.length,A=y.isArrayOrTypedArray(x);for(m=0;m0?+x[m]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:w})}}var E=P.extractOpts(l),I=E.reversescale?P.flipScale(E.colorscale):E.colorscale,M=I[0][1],p=z.opacity(M)<1?M:z.addOpacity(M,0),g=["interpolate",["linear"],["heatmap-density"],0,p];for(m=1;m{var d=Cee(),y=K_().traceLayerPrefix;function z(i,n){this.type="densitymap",this.subplot=i,this.uid=n,this.sourceId="source-"+n,this.layerList=[["heatmap",y+n+"-heatmap"]],this.below=null}var P=z.prototype;P.update=function(i){var n=this.subplot,a=this.layerList,l=d(i),o=n.belowLookup["trace-"+this.uid];n.map.getSource(this.sourceId).setData(l.geojson),o!==this.below&&(this._removeLayers(),this._addLayers(l,o),this.below=o);for(var u=0;u=0;a--)i.removeLayer(n[a][1])},P.dispose=function(){var i=this.subplot.map;this._removeLayers(),i.removeSource(this.sourceId)},Y.exports=function(i,n){var a=n[0].trace,l=new z(i,a.uid),o=l.sourceId,u=d(n),s=l.below=i.belowLookup["trace-"+a.uid];return i.map.addSource(o,{type:"geojson",data:u.geojson}),l._addLayers(u,s),l}}),Mee=ze((te,Y)=>{var d=Os(),y=mA().hoverPoints,z=mA().getExtraText;Y.exports=function(P,i,n){var a=y(P,i,n);if(a){var l=a[0],o=l.cd,u=o[0].trace,s=o[l.index];if(delete l.color,"z"in s){var h=l.subplot.mockAxis;l.z=s.z,l.zLabel=d.tickText(h,h.c2l(s.z),"hover").text}return l.extraText=z(u,s,o[0].t.labels),[l]}}}),Eee=ze((te,Y)=>{Y.exports=function(d,y){return d.lon=y.lon,d.lat=y.lat,d.z=y.z,d}}),Lee=ze((te,Y)=>{Y.exports={attributes:vz(),supplyDefaults:Tee(),colorbar:D_(),formatLabels:dz(),calc:See(),plot:Aee(),hoverPoints:Mee(),eventData:Eee(),getBelow:function(d,y){for(var z=y.getMapLayers(),P=0;P{Y.exports=Lee()}),yz=ze((te,Y)=>{var d=On(),y=xa(),z=Mi(),P=zo(),i=Xh().attributes,{hovertemplateAttrs:n,templatefallbackAttrs:a}=rc(),l=Oc(),o=ku().templatedArray,u=Sh().descriptionOnlyNumbers,s=nn().extendFlat,h=oh().overrideAll;Y.exports=h({hoverinfo:s({},y.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:P.hoverlabel,domain:i({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:d({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:n({},{keys:["value","label"]}),hovertemplatefallback:a(),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:z.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:P.hoverlabel,hovertemplate:n({},{keys:["value","label"]}),hovertemplatefallback:a(),colorscales:o("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:s(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}),Iee=ze((te,Y)=>{var d=ji(),y=yz(),z=Xi(),P=ln(),i=Xh().defaults,n=Wv(),a=ku(),l=Zd();Y.exports=function(u,s,h,m){function b(N,B){return d.coerce(u,s,y,N,B)}var x=d.extendDeep(m.hoverlabel,u.hoverlabel),_=u.node,A=a.newContainer(s,"node");function f(N,B){return d.coerce(_,A,y.node,N,B)}f("label"),f("groups"),f("x"),f("y"),f("pad"),f("thickness"),f("line.color"),f("line.width"),f("hoverinfo",u.hoverinfo),n(_,A,f,x),f("hovertemplate"),f("align");var k=m.colorway,w=function(N){return k[N%k.length]};f("color",A.label.map(function(N,B){return z.addOpacity(w(B),.8)})),f("customdata");var D=u.link||{},E=a.newContainer(s,"link");function I(N,B){return d.coerce(D,E,y.link,N,B)}I("label"),I("arrowlen"),I("source"),I("target"),I("value"),I("line.color"),I("line.width"),I("hoverinfo",u.hoverinfo),n(D,E,I,x),I("hovertemplate");var M=P(m.paper_bgcolor).getLuminance()<.333,p=M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)",g=I("color",p);function C(N){var B=P(N);if(!B.isValid())return N;var U=B.getAlpha();return U<=.8?B.setAlpha(U+.2):B=M?B.brighten():B.darken(),B.toRgbString()}I("hovercolor",Array.isArray(g)?g.map(C):C(g)),I("customdata"),l(D,E,{name:"colorscales",handleItemDefaults:o}),i(s,m,b),b("orientation"),b("valueformat"),b("valuesuffix");var T;A.x.length&&A.y.length&&(T="freeform"),b("arrangement",T),d.coerceFont(b,"textfont",m.font,{autoShadowDflt:!0}),s._length=null};function o(u,s){function h(m,b){return d.coerce(u,s,y.link.colorscales,m,b)}h("label"),h("cmin"),h("cmax"),h("colorscale")}}),_z=ze((te,Y)=>{Y.exports=d;function d(y){for(var z=y.length,P=new Array(z),i=new Array(z),n=new Array(z),a=new Array(z),l=new Array(z),o=new Array(z),u=0;u0;){f=w[w.length-1];var D=y[f];if(a[f]=0&&o[f].push(l[I])}a[f]=E}else{if(i[f]===P[f]){for(var M=[],p=[],g=0,E=k.length-1;E>=0;--E){var C=k[E];if(n[C]=!1,M.push(C),p.push(o[C]),g+=o[C].length,l[C]=h.length,C===f){k.length=E;break}}h.push(M);for(var T=new Array(g),E=0;E{var d=_z(),y=ji(),z=e1().wrap,P=y.isArrayOrTypedArray,i=y.isIndex,n=lh();function a(o){var u=o.node,s=o.link,h=[],m=P(s.color),b=P(s.hovercolor),x=P(s.customdata),_={},A={},f=s.colorscales.length,k;for(k=0;kI&&(I=s.source[k]),s.target[k]>I&&(I=s.target[k]);var M=I+1;o.node._count=M;var p,g=o.node.groups,C={};for(k=0;k0&&i(W,M)&&i(F,M)&&!(C.hasOwnProperty(W)&&C.hasOwnProperty(F)&&C[W]===C[F])){C.hasOwnProperty(F)&&(F=C[F]),C.hasOwnProperty(W)&&(W=C[W]),W=+W,F=+F,_[W]=_[F]=!0;var H="";s.label&&s.label[k]&&(H=s.label[k]);var q=null;H&&A.hasOwnProperty(H)&&(q=A[H]),h.push({pointNumber:k,label:H,color:m?s.color[k]:s.color,hovercolor:b?s.hovercolor[k]:s.hovercolor,customdata:x?s.customdata[k]:s.customdata,concentrationscale:q,source:W,target:F,value:+V}),U.source.push(W),U.target.push(F)}}var G=M+g.length,ee=P(u.color),he=P(u.customdata),be=[];for(k=0;kM-1,childrenNodes:[],pointNumber:k,label:ve,color:ee?u.color[k]:u.color,customdata:he?u.customdata[k]:u.customdata})}var ce=!1;return l(G,U.source,U.target)&&(ce=!0),{circular:ce,links:h,nodes:be,groups:g,groupLookup:C}}function l(o,u,s){for(var h=y.init2dArray(o,0),m=0;m1})}Y.exports=function(o,u){var s=a(u);return z({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}),zee=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){function y(M){var p=+this._x.call(null,M),g=+this._y.call(null,M);return z(this.cover(p,g),p,g,M)}function z(M,p,g,C){if(isNaN(p)||isNaN(g))return M;var T,N=M._root,B={data:C},U=M._x0,V=M._y0,W=M._x1,F=M._y1,H,q,G,ee,he,be,ve,ce;if(!N)return M._root=B,M;for(;N.length;)if((he=p>=(H=(U+W)/2))?U=H:W=H,(be=g>=(q=(V+F)/2))?V=q:F=q,T=N,!(N=N[ve=be<<1|he]))return T[ve]=B,M;if(G=+M._x.call(null,N.data),ee=+M._y.call(null,N.data),p===G&&g===ee)return B.next=N,T?T[ve]=B:M._root=B,M;do T=T?T[ve]=new Array(4):M._root=new Array(4),(he=p>=(H=(U+W)/2))?U=H:W=H,(be=g>=(q=(V+F)/2))?V=q:F=q;while((ve=be<<1|he)===(ce=(ee>=q)<<1|G>=H));return T[ce]=N,T[ve]=B,M}function P(M){var p,g,C=M.length,T,N,B=new Array(C),U=new Array(C),V=1/0,W=1/0,F=-1/0,H=-1/0;for(g=0;gF&&(F=T),NH&&(H=N));if(V>F||W>H)return this;for(this.cover(V,W).cover(F,H),g=0;gM||M>=T||C>p||p>=N;)switch(W=(pF||(U=ee.y0)>H||(V=ee.x1)=ve)<<1|M>=be)&&(ee=q[q.length-1],q[q.length-1]=q[q.length-1-he],q[q.length-1-he]=ee)}else{var ce=M-+this._x.call(null,G.data),re=p-+this._y.call(null,G.data),ge=ce*ce+re*re;if(ge=(q=(B+V)/2))?B=q:V=q,(he=H>=(G=(U+W)/2))?U=G:W=G,p=g,!(g=g[be=he<<1|ee]))return this;if(!g.length)break;(p[be+1&3]||p[be+2&3]||p[be+3&3])&&(C=p,ve=be)}for(;g.data!==M;)if(T=g,!(g=g.next))return this;return(N=g.next)&&delete g.next,T?(N?T.next=N:delete T.next,this):p?(N?p[be]=N:delete p[be],(g=p[0]||p[1]||p[2]||p[3])&&g===(p[3]||p[2]||p[1]||p[0])&&!g.length&&(C?C[ve]=g:this._root=g),this):(this._root=N,this)}function s(M){for(var p=0,g=M.length;p{(function(d,y){y(typeof te=="object"&&typeof Y<"u"?te:d.d3=d.d3||{})})(te,function(d){var y="$";function z(){}z.prototype=P.prototype={constructor:z,has:function(_){return y+_ in this},get:function(_){return this[y+_]},set:function(_,A){return this[y+_]=A,this},remove:function(_){var A=y+_;return A in this&&delete this[A]},clear:function(){for(var _ in this)_[0]===y&&delete this[_]},keys:function(){var _=[];for(var A in this)A[0]===y&&_.push(A.slice(1));return _},values:function(){var _=[];for(var A in this)A[0]===y&&_.push(this[A]);return _},entries:function(){var _=[];for(var A in this)A[0]===y&&_.push({key:A.slice(1),value:this[A]});return _},size:function(){var _=0;for(var A in this)A[0]===y&&++_;return _},empty:function(){for(var _ in this)if(_[0]===y)return!1;return!0},each:function(_){for(var A in this)A[0]===y&&_(this[A],A.slice(1),this)}};function P(_,A){var f=new z;if(_ instanceof z)_.each(function(I,M){f.set(M,I)});else if(Array.isArray(_)){var k=-1,w=_.length,D;if(A==null)for(;++k=_.length)return f!=null&&I.sort(f),k!=null?k(I):I;for(var C=-1,T=I.length,N=_[M++],B,U,V=P(),W,F=p();++C_.length)return I;var p,g=A[M-1];return k!=null&&M>=_.length?p=I.entries():(p=[],I.each(function(C,T){p.push({key:T,values:E(C,M)})})),g!=null?p.sort(function(C,T){return g(C.key,T.key)}):p}return w={object:function(I){return D(I,0,n,a)},map:function(I){return D(I,0,l,o)},entries:function(I){return E(D(I,0,l,o),0)},key:function(I){return _.push(I),w},sortKeys:function(I){return A[_.length-1]=I,w},sortValues:function(I){return f=I,w},rollup:function(I){return k=I,w}}}function n(){return{}}function a(_,A,f){_[A]=f}function l(){return P()}function o(_,A,f){_.set(A,f)}function u(){}var s=P.prototype;u.prototype=h.prototype={constructor:u,has:s.has,add:function(_){return _+="",this[y+_]=_,this},remove:s.remove,clear:s.clear,values:s.keys,size:s.size,empty:s.empty,each:s.each};function h(_,A){var f=new u;if(_ instanceof u)_.each(function(D){f.add(D)});else if(_){var k=-1,w=_.length;if(A==null)for(;++k{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y={value:function(){}};function z(){for(var l=0,o=arguments.length,u={},s;l=0&&(s=u.slice(h+1),u=u.slice(0,h)),u&&!o.hasOwnProperty(u))throw new Error("unknown type: "+u);return{type:u,name:s}})}P.prototype=z.prototype={constructor:P,on:function(l,o){var u=this._,s=i(l+"",u),h,m=-1,b=s.length;if(arguments.length<2){for(;++m0)for(var u=new Array(h),s=0,h,m;s{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=0,z=0,P=0,i=1e3,n,a,l=0,o=0,u=0,s=typeof performance=="object"&&performance.now?performance:Date,h=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(M){setTimeout(M,17)};function m(){return o||(h(b),o=s.now()+u)}function b(){o=0}function x(){this._call=this._time=this._next=null}x.prototype=_.prototype={constructor:x,restart:function(M,p,g){if(typeof M!="function")throw new TypeError("callback is not a function");g=(g==null?m():+g)+(p==null?0:+p),!this._next&&a!==this&&(a?a._next=this:n=this,a=this),this._call=M,this._time=g,D()},stop:function(){this._call&&(this._call=null,this._time=1/0,D())}};function _(M,p,g){var C=new x;return C.restart(M,p,g),C}function A(){m(),++y;for(var M=n,p;M;)(p=o-M._time)>=0&&M._call.call(null,p),M=M._next;--y}function f(){o=(l=s.now())+u,y=z=0;try{A()}finally{y=0,w(),o=0}}function k(){var M=s.now(),p=M-l;p>i&&(u-=p,l=M)}function w(){for(var M,p=n,g,C=1/0;p;)p._call?(C>p._time&&(C=p._time),M=p,p=p._next):(g=p._next,p._next=null,p=M?M._next=g:n=g);a=M,D(C)}function D(M){if(!y){z&&(z=clearTimeout(z));var p=M-o;p>24?(M<1/0&&(z=setTimeout(f,M-s.now()-u)),P&&(P=clearInterval(P))):(P||(l=s.now(),P=setInterval(k,i)),y=1,h(f))}}function E(M,p,g){var C=new x;return p=p==null?0:+p,C.restart(function(T){C.stop(),M(T+p)},p,g),C}function I(M,p,g){var C=new x,T=p;return p==null?(C.restart(M,p,g),C):(p=+p,g=g==null?m():+g,C.restart(function N(B){B+=T,C.restart(N,T+=p,g),M(B)},p,g),C)}d.interval=I,d.now=m,d.timeout=E,d.timer=_,d.timerFlush=A,Object.defineProperty(d,"__esModule",{value:!0})})}),Ree=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,zee(),vA(),Oee(),Bee()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(te,function(d,y,z,P,i){function n(M,p){var g;M==null&&(M=0),p==null&&(p=0);function C(){var T,N=g.length,B,U=0,V=0;for(T=0;TH.index){var me=q-_e.x-_e.vx,fe=G-_e.y-_e.vy,Ce=me*me+fe*fe;Ceq+J||neG+J||seV.r&&(V.r=V[W].r)}function U(){if(p){var V,W=p.length,F;for(g=new Array(W),V=0;V1?(he==null?U.remove(ee):U.set(ee,G(he)),p):U.get(ee)},find:function(ee,he,be){var ve=0,ce=M.length,re,ge,ne,se,_e;for(be==null?be=1/0:be*=be,ve=0;ve1?(W.on(ee,he),p):W.on(ee)}}}function w(){var M,p,g,C=a(-30),T,N=1,B=1/0,U=.81;function V(q){var G,ee=M.length,he=y.quadtree(M,x,_).visitAfter(F);for(g=q,G=0;G=B)){(q.data!==p||q.next)&&(be===0&&(be=l(),re+=be*be),ve===0&&(ve=l(),re+=ve*ve),re{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te):(d=d||self,y(d.d3=d.d3||{}))})(te,function(d){var y=Math.PI,z=2*y,P=1e-6,i=z-P;function n(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new n}n.prototype=a.prototype={constructor:n,moveTo:function(l,o){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(l,o){this._+="L"+(this._x1=+l)+","+(this._y1=+o)},quadraticCurveTo:function(l,o,u,s){this._+="Q"+ +l+","+ +o+","+(this._x1=+u)+","+(this._y1=+s)},bezierCurveTo:function(l,o,u,s,h,m){this._+="C"+ +l+","+ +o+","+ +u+","+ +s+","+(this._x1=+h)+","+(this._y1=+m)},arcTo:function(l,o,u,s,h){l=+l,o=+o,u=+u,s=+s,h=+h;var m=this._x1,b=this._y1,x=u-l,_=s-o,A=m-l,f=b-o,k=A*A+f*f;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=l)+","+(this._y1=o);else if(k>P)if(!(Math.abs(f*x-_*A)>P)||!h)this._+="L"+(this._x1=l)+","+(this._y1=o);else{var w=u-m,D=s-b,E=x*x+_*_,I=w*w+D*D,M=Math.sqrt(E),p=Math.sqrt(k),g=h*Math.tan((y-Math.acos((E+k-I)/(2*M*p)))/2),C=g/p,T=g/M;Math.abs(C-1)>P&&(this._+="L"+(l+C*A)+","+(o+C*f)),this._+="A"+h+","+h+",0,0,"+ +(f*w>A*D)+","+(this._x1=l+T*x)+","+(this._y1=o+T*_)}},arc:function(l,o,u,s,h,m){l=+l,o=+o,u=+u,m=!!m;var b=u*Math.cos(s),x=u*Math.sin(s),_=l+b,A=o+x,f=1^m,k=m?s-h:h-s;if(u<0)throw new Error("negative radius: "+u);this._x1===null?this._+="M"+_+","+A:(Math.abs(this._x1-_)>P||Math.abs(this._y1-A)>P)&&(this._+="L"+_+","+A),u&&(k<0&&(k=k%z+z),k>i?this._+="A"+u+","+u+",0,1,"+f+","+(l-b)+","+(o-x)+"A"+u+","+u+",0,1,"+f+","+(this._x1=_)+","+(this._y1=A):k>P&&(this._+="A"+u+","+u+",0,"+ +(k>=y)+","+f+","+(this._x1=l+u*Math.cos(h))+","+(this._y1=o+u*Math.sin(h))))},rect:function(l,o,u,s){this._+="M"+(this._x0=this._x1=+l)+","+(this._y0=this._y1=+o)+"h"+ +u+"v"+ +s+"h"+-u+"Z"},toString:function(){return this._}},d.path=a,Object.defineProperty(d,"__esModule",{value:!0})})}),xz=ze((te,Y)=>{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,Fee()):(d=d||self,y(d.d3=d.d3||{},d.d3))})(te,function(d,y){function z(zt){return function(){return zt}}var P=Math.abs,i=Math.atan2,n=Math.cos,a=Math.max,l=Math.min,o=Math.sin,u=Math.sqrt,s=1e-12,h=Math.PI,m=h/2,b=2*h;function x(zt){return zt>1?0:zt<-1?h:Math.acos(zt)}function _(zt){return zt>=1?m:zt<=-1?-m:Math.asin(zt)}function A(zt){return zt.innerRadius}function f(zt){return zt.outerRadius}function k(zt){return zt.startAngle}function w(zt){return zt.endAngle}function D(zt){return zt&&zt.padAngle}function E(zt,xr,Qr,Ri,en,_n,Zi,Wi){var pn=Qr-zt,Ua=Ri-xr,ea=Zi-en,fo=Wi-_n,ho=fo*pn-ea*Ua;if(!(ho*hoIl*Il+Jl*Jl&&(sl=ms,Gl=Bs),{cx:sl,cy:Gl,x01:-ea,y01:-fo,x11:sl*(en/rl-1),y11:Gl*(en/rl-1)}}function M(){var zt=A,xr=f,Qr=z(0),Ri=null,en=k,_n=w,Zi=D,Wi=null;function pn(){var Ua,ea,fo=+zt.apply(this,arguments),ho=+xr.apply(this,arguments),Vo=en.apply(this,arguments)-m,Ao=_n.apply(this,arguments)-m,Wo=P(Ao-Vo),Wa=Ao>Vo;if(Wi||(Wi=Ua=y.path()),hos))Wi.moveTo(0,0);else if(Wo>b-s)Wi.moveTo(ho*n(Vo),ho*o(Vo)),Wi.arc(0,0,ho,Vo,Ao,!Wa),fo>s&&(Wi.moveTo(fo*n(Ao),fo*o(Ao)),Wi.arc(0,0,fo,Ao,Vo,Wa));else{var Ts=Vo,fs=Ao,_l=Vo,es=Ao,rl=Wo,ds=Wo,xl=Zi.apply(this,arguments)/2,sl=xl>s&&(Ri?+Ri.apply(this,arguments):u(fo*fo+ho*ho)),Gl=l(P(ho-fo)/2,+Qr.apply(this,arguments)),ms=Gl,Bs=Gl,No,Ls;if(sl>s){var Il=_(sl/fo*o(xl)),Jl=_(sl/ho*o(xl));(rl-=Il*2)>s?(Il*=Wa?1:-1,_l+=Il,es-=Il):(rl=0,_l=es=(Vo+Ao)/2),(ds-=Jl*2)>s?(Jl*=Wa?1:-1,Ts+=Jl,fs-=Jl):(ds=0,Ts=fs=(Vo+Ao)/2)}var ou=ho*n(Ts),Gs=ho*o(Ts),$a=fo*n(es),So=fo*o(es);if(Gl>s){var Xs=ho*n(fs),su=ho*o(fs),is=fo*n(_l),tu=fo*o(_l),pl;if(Wos?Bs>s?(No=I(is,tu,ou,Gs,ho,Bs,Wa),Ls=I(Xs,su,$a,So,ho,Bs,Wa),Wi.moveTo(No.cx+No.x01,No.cy+No.y01),Bss)||!(rl>s)?Wi.lineTo($a,So):ms>s?(No=I($a,So,Xs,su,fo,-ms,Wa),Ls=I(ou,Gs,is,tu,fo,-ms,Wa),Wi.lineTo(No.cx+No.x01,No.cy+No.y01),ms=ho;--Vo)Wi.point(fs[Vo],_l[Vo]);Wi.lineEnd(),Wi.areaEnd()}Wa&&(fs[fo]=+zt(Wo,fo,ea),_l[fo]=+Qr(Wo,fo,ea),Wi.point(xr?+xr(Wo,fo,ea):fs[fo],Ri?+Ri(Wo,fo,ea):_l[fo]))}if(Ts)return Wi=null,Ts+""||null}function Ua(){return N().defined(en).curve(Zi).context(_n)}return pn.x=function(ea){return arguments.length?(zt=typeof ea=="function"?ea:z(+ea),xr=null,pn):zt},pn.x0=function(ea){return arguments.length?(zt=typeof ea=="function"?ea:z(+ea),pn):zt},pn.x1=function(ea){return arguments.length?(xr=ea==null?null:typeof ea=="function"?ea:z(+ea),pn):xr},pn.y=function(ea){return arguments.length?(Qr=typeof ea=="function"?ea:z(+ea),Ri=null,pn):Qr},pn.y0=function(ea){return arguments.length?(Qr=typeof ea=="function"?ea:z(+ea),pn):Qr},pn.y1=function(ea){return arguments.length?(Ri=ea==null?null:typeof ea=="function"?ea:z(+ea),pn):Ri},pn.lineX0=pn.lineY0=function(){return Ua().x(zt).y(Qr)},pn.lineY1=function(){return Ua().x(zt).y(Ri)},pn.lineX1=function(){return Ua().x(xr).y(Qr)},pn.defined=function(ea){return arguments.length?(en=typeof ea=="function"?ea:z(!!ea),pn):en},pn.curve=function(ea){return arguments.length?(Zi=ea,_n!=null&&(Wi=Zi(_n)),pn):Zi},pn.context=function(ea){return arguments.length?(ea==null?_n=Wi=null:Wi=Zi(_n=ea),pn):_n},pn}function U(zt,xr){return xrzt?1:xr>=zt?0:NaN}function V(zt){return zt}function W(){var zt=V,xr=U,Qr=null,Ri=z(0),en=z(b),_n=z(0);function Zi(Wi){var pn,Ua=Wi.length,ea,fo,ho=0,Vo=new Array(Ua),Ao=new Array(Ua),Wo=+Ri.apply(this,arguments),Wa=Math.min(b,Math.max(-b,en.apply(this,arguments)-Wo)),Ts,fs=Math.min(Math.abs(Wa)/Ua,_n.apply(this,arguments)),_l=fs*(Wa<0?-1:1),es;for(pn=0;pn0&&(ho+=es);for(xr!=null?Vo.sort(function(rl,ds){return xr(Ao[rl],Ao[ds])}):Qr!=null&&Vo.sort(function(rl,ds){return Qr(Wi[rl],Wi[ds])}),pn=0,fo=ho?(Wa-Ua*_l)/ho:0;pn0?es*fo:0)+_l,Ao[ea]={data:Wi[ea],index:pn,value:es,startAngle:Wo,endAngle:Ts,padAngle:fs};return Ao}return Zi.value=function(Wi){return arguments.length?(zt=typeof Wi=="function"?Wi:z(+Wi),Zi):zt},Zi.sortValues=function(Wi){return arguments.length?(xr=Wi,Qr=null,Zi):xr},Zi.sort=function(Wi){return arguments.length?(Qr=Wi,xr=null,Zi):Qr},Zi.startAngle=function(Wi){return arguments.length?(Ri=typeof Wi=="function"?Wi:z(+Wi),Zi):Ri},Zi.endAngle=function(Wi){return arguments.length?(en=typeof Wi=="function"?Wi:z(+Wi),Zi):en},Zi.padAngle=function(Wi){return arguments.length?(_n=typeof Wi=="function"?Wi:z(+Wi),Zi):_n},Zi}var F=q(g);function H(zt){this._curve=zt}H.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(zt,xr){this._curve.point(xr*Math.sin(zt),xr*-Math.cos(zt))}};function q(zt){function xr(Qr){return new H(zt(Qr))}return xr._curve=zt,xr}function G(zt){var xr=zt.curve;return zt.angle=zt.x,delete zt.x,zt.radius=zt.y,delete zt.y,zt.curve=function(Qr){return arguments.length?xr(q(Qr)):xr()._curve},zt}function ee(){return G(N().curve(F))}function he(){var zt=B().curve(F),xr=zt.curve,Qr=zt.lineX0,Ri=zt.lineX1,en=zt.lineY0,_n=zt.lineY1;return zt.angle=zt.x,delete zt.x,zt.startAngle=zt.x0,delete zt.x0,zt.endAngle=zt.x1,delete zt.x1,zt.radius=zt.y,delete zt.y,zt.innerRadius=zt.y0,delete zt.y0,zt.outerRadius=zt.y1,delete zt.y1,zt.lineStartAngle=function(){return G(Qr())},delete zt.lineX0,zt.lineEndAngle=function(){return G(Ri())},delete zt.lineX1,zt.lineInnerRadius=function(){return G(en())},delete zt.lineY0,zt.lineOuterRadius=function(){return G(_n())},delete zt.lineY1,zt.curve=function(Zi){return arguments.length?xr(q(Zi)):xr()._curve},zt}function be(zt,xr){return[(xr=+xr)*Math.cos(zt-=Math.PI/2),xr*Math.sin(zt)]}var ve=Array.prototype.slice;function ce(zt){return zt.source}function re(zt){return zt.target}function ge(zt){var xr=ce,Qr=re,Ri=C,en=T,_n=null;function Zi(){var Wi,pn=ve.call(arguments),Ua=xr.apply(this,pn),ea=Qr.apply(this,pn);if(_n||(_n=Wi=y.path()),zt(_n,+Ri.apply(this,(pn[0]=Ua,pn)),+en.apply(this,pn),+Ri.apply(this,(pn[0]=ea,pn)),+en.apply(this,pn)),Wi)return _n=null,Wi+""||null}return Zi.source=function(Wi){return arguments.length?(xr=Wi,Zi):xr},Zi.target=function(Wi){return arguments.length?(Qr=Wi,Zi):Qr},Zi.x=function(Wi){return arguments.length?(Ri=typeof Wi=="function"?Wi:z(+Wi),Zi):Ri},Zi.y=function(Wi){return arguments.length?(en=typeof Wi=="function"?Wi:z(+Wi),Zi):en},Zi.context=function(Wi){return arguments.length?(_n=Wi??null,Zi):_n},Zi}function ne(zt,xr,Qr,Ri,en){zt.moveTo(xr,Qr),zt.bezierCurveTo(xr=(xr+Ri)/2,Qr,xr,en,Ri,en)}function se(zt,xr,Qr,Ri,en){zt.moveTo(xr,Qr),zt.bezierCurveTo(xr,Qr=(Qr+en)/2,Ri,Qr,Ri,en)}function _e(zt,xr,Qr,Ri,en){var _n=be(xr,Qr),Zi=be(xr,Qr=(Qr+en)/2),Wi=be(Ri,Qr),pn=be(Ri,en);zt.moveTo(_n[0],_n[1]),zt.bezierCurveTo(Zi[0],Zi[1],Wi[0],Wi[1],pn[0],pn[1])}function oe(){return ge(ne)}function J(){return ge(se)}function me(){var zt=ge(_e);return zt.angle=zt.x,delete zt.x,zt.radius=zt.y,delete zt.y,zt}var fe={draw:function(zt,xr){var Qr=Math.sqrt(xr/h);zt.moveTo(Qr,0),zt.arc(0,0,Qr,0,b)}},Ce={draw:function(zt,xr){var Qr=Math.sqrt(xr/5)/2;zt.moveTo(-3*Qr,-Qr),zt.lineTo(-Qr,-Qr),zt.lineTo(-Qr,-3*Qr),zt.lineTo(Qr,-3*Qr),zt.lineTo(Qr,-Qr),zt.lineTo(3*Qr,-Qr),zt.lineTo(3*Qr,Qr),zt.lineTo(Qr,Qr),zt.lineTo(Qr,3*Qr),zt.lineTo(-Qr,3*Qr),zt.lineTo(-Qr,Qr),zt.lineTo(-3*Qr,Qr),zt.closePath()}},Re=Math.sqrt(1/3),Be=Re*2,Ze={draw:function(zt,xr){var Qr=Math.sqrt(xr/Be),Ri=Qr*Re;zt.moveTo(0,-Qr),zt.lineTo(Ri,0),zt.lineTo(0,Qr),zt.lineTo(-Ri,0),zt.closePath()}},Ge=.8908130915292852,tt=Math.sin(h/10)/Math.sin(7*h/10),_t=Math.sin(b/10)*tt,mt=-Math.cos(b/10)*tt,vt={draw:function(zt,xr){var Qr=Math.sqrt(xr*Ge),Ri=_t*Qr,en=mt*Qr;zt.moveTo(0,-Qr),zt.lineTo(Ri,en);for(var _n=1;_n<5;++_n){var Zi=b*_n/5,Wi=Math.cos(Zi),pn=Math.sin(Zi);zt.lineTo(pn*Qr,-Wi*Qr),zt.lineTo(Wi*Ri-pn*en,pn*Ri+Wi*en)}zt.closePath()}},ct={draw:function(zt,xr){var Qr=Math.sqrt(xr),Ri=-Qr/2;zt.rect(Ri,Ri,Qr,Qr)}},Ae=Math.sqrt(3),Oe={draw:function(zt,xr){var Qr=-Math.sqrt(xr/(Ae*3));zt.moveTo(0,Qr*2),zt.lineTo(-Ae*Qr,-Qr),zt.lineTo(Ae*Qr,-Qr),zt.closePath()}},Le=-.5,nt=Math.sqrt(3)/2,xt=1/Math.sqrt(12),ut=(xt/2+1)*3,Et={draw:function(zt,xr){var Qr=Math.sqrt(xr/ut),Ri=Qr/2,en=Qr*xt,_n=Ri,Zi=Qr*xt+Qr,Wi=-_n,pn=Zi;zt.moveTo(Ri,en),zt.lineTo(_n,Zi),zt.lineTo(Wi,pn),zt.lineTo(Le*Ri-nt*en,nt*Ri+Le*en),zt.lineTo(Le*_n-nt*Zi,nt*_n+Le*Zi),zt.lineTo(Le*Wi-nt*pn,nt*Wi+Le*pn),zt.lineTo(Le*Ri+nt*en,Le*en-nt*Ri),zt.lineTo(Le*_n+nt*Zi,Le*Zi-nt*_n),zt.lineTo(Le*Wi+nt*pn,Le*pn-nt*Wi),zt.closePath()}},Gt=[fe,Ce,Ze,ct,vt,Oe,Et];function Qt(){var zt=z(fe),xr=z(64),Qr=null;function Ri(){var en;if(Qr||(Qr=en=y.path()),zt.apply(this,arguments).draw(Qr,+xr.apply(this,arguments)),en)return Qr=null,en+""||null}return Ri.type=function(en){return arguments.length?(zt=typeof en=="function"?en:z(en),Ri):zt},Ri.size=function(en){return arguments.length?(xr=typeof en=="function"?en:z(+en),Ri):xr},Ri.context=function(en){return arguments.length?(Qr=en??null,Ri):Qr},Ri}function vr(){}function mr(zt,xr,Qr){zt._context.bezierCurveTo((2*zt._x0+zt._x1)/3,(2*zt._y0+zt._y1)/3,(zt._x0+2*zt._x1)/3,(zt._y0+2*zt._y1)/3,(zt._x0+4*zt._x1+xr)/6,(zt._y0+4*zt._y1+Qr)/6)}function Yr(zt){this._context=zt}Yr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:mr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function ii(zt){return new Yr(zt)}function Lr(zt){this._context=zt}Lr.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._x2=zt,this._y2=xr;break;case 1:this._point=2,this._x3=zt,this._y3=xr;break;case 2:this._point=3,this._x4=zt,this._y4=xr,this._context.moveTo((this._x0+4*this._x1+zt)/6,(this._y0+4*this._y1+xr)/6);break;default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function ci(zt){return new Lr(zt)}function vi(zt){this._context=zt}vi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Qr=(this._x0+4*this._x1+zt)/6,Ri=(this._y0+4*this._y1+xr)/6;this._line?this._context.lineTo(Qr,Ri):this._context.moveTo(Qr,Ri);break;case 3:this._point=4;default:mr(this,zt,xr);break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr}};function Ot(zt){return new vi(zt)}function Xe(zt,xr){this._basis=new Yr(zt),this._beta=xr}Xe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var zt=this._x,xr=this._y,Qr=zt.length-1;if(Qr>0)for(var Ri=zt[0],en=xr[0],_n=zt[Qr]-Ri,Zi=xr[Qr]-en,Wi=-1,pn;++Wi<=Qr;)pn=Wi/Qr,this._basis.point(this._beta*zt[Wi]+(1-this._beta)*(Ri+pn*_n),this._beta*xr[Wi]+(1-this._beta)*(en+pn*Zi));this._x=this._y=null,this._basis.lineEnd()},point:function(zt,xr){this._x.push(+zt),this._y.push(+xr)}};var ot=function zt(xr){function Qr(Ri){return xr===1?new Yr(Ri):new Xe(Ri,xr)}return Qr.beta=function(Ri){return zt(+Ri)},Qr}(.85);function De(zt,xr,Qr){zt._context.bezierCurveTo(zt._x1+zt._k*(zt._x2-zt._x0),zt._y1+zt._k*(zt._y2-zt._y0),zt._x2+zt._k*(zt._x1-xr),zt._y2+zt._k*(zt._y1-Qr),zt._x2,zt._y2)}function ye(zt,xr){this._context=zt,this._k=(1-xr)/6}ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:De(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2,this._x1=zt,this._y1=xr;break;case 2:this._point=3;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Pe=function zt(xr){function Qr(Ri){return new ye(Ri,xr)}return Qr.tension=function(Ri){return zt(+Ri)},Qr}(0);function He(zt,xr){this._context=zt,this._k=(1-xr)/6}He.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._x3=zt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=zt,this._y4=xr);break;case 2:this._point=3,this._x5=zt,this._y5=xr;break;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var at=function zt(xr){function Qr(Ri){return new He(Ri,xr)}return Qr.tension=function(Ri){return zt(+Ri)},Qr}(0);function ht(zt,xr){this._context=zt,this._k=(1-xr)/6}ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:De(this,zt,xr);break}this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var At=function zt(xr){function Qr(Ri){return new ht(Ri,xr)}return Qr.tension=function(Ri){return zt(+Ri)},Qr}(0);function Wt(zt,xr,Qr){var Ri=zt._x1,en=zt._y1,_n=zt._x2,Zi=zt._y2;if(zt._l01_a>s){var Wi=2*zt._l01_2a+3*zt._l01_a*zt._l12_a+zt._l12_2a,pn=3*zt._l01_a*(zt._l01_a+zt._l12_a);Ri=(Ri*Wi-zt._x0*zt._l12_2a+zt._x2*zt._l01_2a)/pn,en=(en*Wi-zt._y0*zt._l12_2a+zt._y2*zt._l01_2a)/pn}if(zt._l23_a>s){var Ua=2*zt._l23_2a+3*zt._l23_a*zt._l12_a+zt._l12_2a,ea=3*zt._l23_a*(zt._l23_a+zt._l12_a);_n=(_n*Ua+zt._x1*zt._l23_2a-xr*zt._l12_2a)/ea,Zi=(Zi*Ua+zt._y1*zt._l23_2a-Qr*zt._l12_2a)/ea}zt._context.bezierCurveTo(Ri,en,_n,Zi,zt._x2,zt._y2)}function Yt(zt,xr){this._context=zt,this._alpha=xr}Yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Qr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Qr*Qr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var hr=function zt(xr){function Qr(Ri){return xr?new Yt(Ri,xr):new ye(Ri,0)}return Qr.alpha=function(Ri){return zt(+Ri)},Qr}(.5);function zr(zt,xr){this._context=zt,this._alpha=xr}zr.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Qr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Qr*Qr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=zt,this._y3=xr;break;case 1:this._point=2,this._context.moveTo(this._x4=zt,this._y4=xr);break;case 2:this._point=3,this._x5=zt,this._y5=xr;break;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var Dr=function zt(xr){function Qr(Ri){return xr?new zr(Ri,xr):new He(Ri,0)}return Qr.alpha=function(Ri){return zt(+Ri)},Qr}(.5);function br(zt,xr){this._context=zt,this._alpha=xr}br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){if(zt=+zt,xr=+xr,this._point){var Qr=this._x2-zt,Ri=this._y2-xr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Qr*Qr+Ri*Ri,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wt(this,zt,xr);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=zt,this._y0=this._y1,this._y1=this._y2,this._y2=xr}};var fi=function zt(xr){function Qr(Ri){return xr?new br(Ri,xr):new ht(Ri,0)}return Qr.alpha=function(Ri){return zt(+Ri)},Qr}(.5);function un(zt){this._context=zt}un.prototype={areaStart:vr,areaEnd:vr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(zt,xr){zt=+zt,xr=+xr,this._point?this._context.lineTo(zt,xr):(this._point=1,this._context.moveTo(zt,xr))}};function cn(zt){return new un(zt)}function yn(zt){return zt<0?-1:1}function Gn(zt,xr,Qr){var Ri=zt._x1-zt._x0,en=xr-zt._x1,_n=(zt._y1-zt._y0)/(Ri||en<0&&-0),Zi=(Qr-zt._y1)/(en||Ri<0&&-0),Wi=(_n*en+Zi*Ri)/(Ri+en);return(yn(_n)+yn(Zi))*Math.min(Math.abs(_n),Math.abs(Zi),.5*Math.abs(Wi))||0}function Sn(zt,xr){var Qr=zt._x1-zt._x0;return Qr?(3*(zt._y1-zt._y0)/Qr-xr)/2:xr}function dn(zt,xr,Qr){var Ri=zt._x0,en=zt._y0,_n=zt._x1,Zi=zt._y1,Wi=(_n-Ri)/3;zt._context.bezierCurveTo(Ri+Wi,en+Wi*xr,_n-Wi,Zi-Wi*Qr,_n,Zi)}function va(zt){this._context=zt}va.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dn(this,this._t0,Sn(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(zt,xr){var Qr=NaN;if(zt=+zt,xr=+xr,!(zt===this._x1&&xr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;break;case 2:this._point=3,dn(this,Sn(this,Qr=Gn(this,zt,xr)),Qr);break;default:dn(this,this._t0,Qr=Gn(this,zt,xr));break}this._x0=this._x1,this._x1=zt,this._y0=this._y1,this._y1=xr,this._t0=Qr}}};function na(zt){this._context=new Kt(zt)}(na.prototype=Object.create(va.prototype)).point=function(zt,xr){va.prototype.point.call(this,xr,zt)};function Kt(zt){this._context=zt}Kt.prototype={moveTo:function(zt,xr){this._context.moveTo(xr,zt)},closePath:function(){this._context.closePath()},lineTo:function(zt,xr){this._context.lineTo(xr,zt)},bezierCurveTo:function(zt,xr,Qr,Ri,en,_n){this._context.bezierCurveTo(xr,zt,Ri,Qr,_n,en)}};function lr(zt){return new va(zt)}function _r(zt){return new na(zt)}function Er(zt){this._context=zt}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var zt=this._x,xr=this._y,Qr=zt.length;if(Qr)if(this._line?this._context.lineTo(zt[0],xr[0]):this._context.moveTo(zt[0],xr[0]),Qr===2)this._context.lineTo(zt[1],xr[1]);else for(var Ri=di(zt),en=di(xr),_n=0,Zi=1;Zi=0;--xr)en[xr]=(Zi[xr]-en[xr+1])/_n[xr];for(_n[Qr-1]=(zt[Qr]+en[Qr-1])/2,xr=0;xr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(zt,xr){switch(zt=+zt,xr=+xr,this._point){case 0:this._point=1,this._line?this._context.lineTo(zt,xr):this._context.moveTo(zt,xr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,xr),this._context.lineTo(zt,xr);else{var Qr=this._x*(1-this._t)+zt*this._t;this._context.lineTo(Qr,this._y),this._context.lineTo(Qr,xr)}break}}this._x=zt,this._y=xr}};function Hi(zt){return new Ui(zt,.5)}function Ln(zt){return new Ui(zt,0)}function Fn(zt){return new Ui(zt,1)}function Kn(zt,xr){if((Zi=zt.length)>1)for(var Qr=1,Ri,en,_n=zt[xr[0]],Zi,Wi=_n.length;Qr=0;)Qr[xr]=xr;return Qr}function sa(zt,xr){return zt[xr]}function Mn(){var zt=z([]),xr=Jn,Qr=Kn,Ri=sa;function en(_n){var Zi=zt.apply(this,arguments),Wi,pn=_n.length,Ua=Zi.length,ea=new Array(Ua),fo;for(Wi=0;Wi0){for(var Qr,Ri,en=0,_n=zt[0].length,Zi;en<_n;++en){for(Zi=Qr=0;Qr0)for(var Qr,Ri=0,en,_n,Zi,Wi,pn,Ua=zt[xr[0]].length;Ri0?(en[0]=Zi,en[1]=Zi+=_n):_n<0?(en[1]=Wi,en[0]=Wi+=_n):(en[0]=0,en[1]=_n)}function Ft(zt,xr){if((en=zt.length)>0){for(var Qr=0,Ri=zt[xr[0]],en,_n=Ri.length;Qr<_n;++Qr){for(var Zi=0,Wi=0;Zi0)||!((_n=(en=zt[xr[0]]).length)>0))){for(var Qr=0,Ri=1,en,_n,Zi;Ri<_n;++Ri){for(var Wi=0,pn=0,Ua=0;Wi_n&&(_n=en,Qr=xr);return Qr}function si(zt){var xr=zt.map(Gr);return Jn(zt).sort(function(Qr,Ri){return xr[Qr]-xr[Ri]})}function Gr(zt){for(var xr=0,Qr=-1,Ri=zt.length,en;++Qr{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,C6(),vA(),xz()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3)})(te,function(d,y,z,P){function i(g){return g.target.depth}function n(g){return g.depth}function a(g,C){return C-1-g.height}function l(g,C){return g.sourceLinks.length?g.depth:C-1}function o(g){return g.targetLinks.length?g.depth:g.sourceLinks.length?y.min(g.sourceLinks,i)-1:0}function u(g){return function(){return g}}function s(g,C){return m(g.source,C.source)||g.index-C.index}function h(g,C){return m(g.target,C.target)||g.index-C.index}function m(g,C){return g.y0-C.y0}function b(g){return g.value}function x(g){return(g.y0+g.y1)/2}function _(g){return x(g.source)*g.value}function A(g){return x(g.target)*g.value}function f(g){return g.index}function k(g){return g.nodes}function w(g){return g.links}function D(g,C){var T=g.get(C);if(!T)throw new Error("missing: "+C);return T}var E=function(){var g=0,C=0,T=1,N=1,B=24,U=8,V=f,W=l,F=k,H=w,q=32,G=2/3;function ee(){var ge={nodes:F.apply(null,arguments),links:H.apply(null,arguments)};return he(ge),be(ge),ve(ge),ce(ge),re(ge),ge}ee.update=function(ge){return re(ge),ge},ee.nodeId=function(ge){return arguments.length?(V=typeof ge=="function"?ge:u(ge),ee):V},ee.nodeAlign=function(ge){return arguments.length?(W=typeof ge=="function"?ge:u(ge),ee):W},ee.nodeWidth=function(ge){return arguments.length?(B=+ge,ee):B},ee.nodePadding=function(ge){return arguments.length?(U=+ge,ee):U},ee.nodes=function(ge){return arguments.length?(F=typeof ge=="function"?ge:u(ge),ee):F},ee.links=function(ge){return arguments.length?(H=typeof ge=="function"?ge:u(ge),ee):H},ee.size=function(ge){return arguments.length?(g=C=0,T=+ge[0],N=+ge[1],ee):[T-g,N-C]},ee.extent=function(ge){return arguments.length?(g=+ge[0][0],T=+ge[1][0],C=+ge[0][1],N=+ge[1][1],ee):[[g,C],[T,N]]},ee.iterations=function(ge){return arguments.length?(q=+ge,ee):q};function he(ge){ge.nodes.forEach(function(se,_e){se.index=_e,se.sourceLinks=[],se.targetLinks=[]});var ne=z.map(ge.nodes,V);ge.links.forEach(function(se,_e){se.index=_e;var oe=se.source,J=se.target;typeof oe!="object"&&(oe=se.source=D(ne,oe)),typeof J!="object"&&(J=se.target=D(ne,J)),oe.sourceLinks.push(se),J.targetLinks.push(se)})}function be(ge){ge.nodes.forEach(function(ne){ne.value=Math.max(y.sum(ne.sourceLinks,b),y.sum(ne.targetLinks,b))})}function ve(ge){var ne,se,_e;for(ne=ge.nodes,se=[],_e=0;ne.length;++_e,ne=se,se=[])ne.forEach(function(J){J.depth=_e,J.sourceLinks.forEach(function(me){se.indexOf(me.target)<0&&se.push(me.target)})});for(ne=ge.nodes,se=[],_e=0;ne.length;++_e,ne=se,se=[])ne.forEach(function(J){J.height=_e,J.targetLinks.forEach(function(me){se.indexOf(me.source)<0&&se.push(me.source)})});var oe=(T-g-B)/(_e-1);ge.nodes.forEach(function(J){J.x1=(J.x0=g+Math.max(0,Math.min(_e-1,Math.floor(W.call(null,J,_e))))*oe)+B})}function ce(ge){var ne=z.nest().key(function(Ce){return Ce.x0}).sortKeys(y.ascending).entries(ge.nodes).map(function(Ce){return Ce.values});oe(),fe();for(var se=1,_e=q;_e>0;--_e)me(se*=.99),fe(),J(se),fe();function oe(){var Ce=y.max(ne,function(Ze){return Ze.length}),Re=G*(N-C)/(Ce-1);U>Re&&(U=Re);var Be=y.min(ne,function(Ze){return(N-C-(Ze.length-1)*U)/y.sum(Ze,b)});ne.forEach(function(Ze){Ze.forEach(function(Ge,tt){Ge.y1=(Ge.y0=tt)+Ge.value*Be})}),ge.links.forEach(function(Ze){Ze.width=Ze.value*Be})}function J(Ce){ne.forEach(function(Re){Re.forEach(function(Be){if(Be.targetLinks.length){var Ze=(y.sum(Be.targetLinks,_)/y.sum(Be.targetLinks,b)-x(Be))*Ce;Be.y0+=Ze,Be.y1+=Ze}})})}function me(Ce){ne.slice().reverse().forEach(function(Re){Re.forEach(function(Be){if(Be.sourceLinks.length){var Ze=(y.sum(Be.sourceLinks,A)/y.sum(Be.sourceLinks,b)-x(Be))*Ce;Be.y0+=Ze,Be.y1+=Ze}})})}function fe(){ne.forEach(function(Ce){var Re,Be,Ze=C,Ge=Ce.length,tt;for(Ce.sort(m),tt=0;tt0&&(Re.y0+=Be,Re.y1+=Be),Ze=Re.y1+U;if(Be=Ze-U-N,Be>0)for(Ze=Re.y0-=Be,Re.y1-=Be,tt=Ge-2;tt>=0;--tt)Re=Ce[tt],Be=Re.y1+U-Ze,Be>0&&(Re.y0-=Be,Re.y1-=Be),Ze=Re.y0})}}function re(ge){ge.nodes.forEach(function(ne){ne.sourceLinks.sort(h),ne.targetLinks.sort(s)}),ge.nodes.forEach(function(ne){var se=ne.y0,_e=se;ne.sourceLinks.forEach(function(oe){oe.y0=se+oe.width/2,se+=oe.width}),ne.targetLinks.forEach(function(oe){oe.y1=_e+oe.width/2,_e+=oe.width})})}return ee};function I(g){return[g.source.x1,g.y0]}function M(g){return[g.target.x0,g.y1]}var p=function(){return P.linkHorizontal().source(I).target(M)};d.sankey=E,d.sankeyCenter=o,d.sankeyLeft=n,d.sankeyRight=a,d.sankeyJustify=l,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}),jee=ze((te,Y)=>{var d=_z();Y.exports=function(y,z){var P=[],i=[],n=[],a={},l=[],o;function u(w){n[w]=!1,a.hasOwnProperty(w)&&Object.keys(a[w]).forEach(function(D){delete a[w][D],n[D]&&u(D)})}function s(w){var D=!1;i.push(w),n[w]=!0;var E,I;for(E=0;E=w})}function b(w){m(w);for(var D=y,E=d(D),I=E.components.filter(function(B){return B.length>1}),M=1/0,p,g=0;g{(function(d,y){typeof te=="object"&&typeof Y<"u"?y(te,C6(),vA(),xz(),jee()):y(d.d3=d.d3||{},d.d3,d.d3,d.d3,null)})(te,function(d,y,z,P,i){i=i&&i.hasOwnProperty("default")?i.default:i;function n(Ge){return Ge.target.depth}function a(Ge){return Ge.depth}function l(Ge,tt){return tt-1-Ge.height}function o(Ge,tt){return Ge.sourceLinks.length?Ge.depth:tt-1}function u(Ge){return Ge.targetLinks.length?Ge.depth:Ge.sourceLinks.length?y.min(Ge.sourceLinks,n)-1:0}function s(Ge){return function(){return Ge}}var h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ge){return typeof Ge}:function(Ge){return Ge&&typeof Symbol=="function"&&Ge.constructor===Symbol&&Ge!==Symbol.prototype?"symbol":typeof Ge};function m(Ge,tt){return x(Ge.source,tt.source)||Ge.index-tt.index}function b(Ge,tt){return x(Ge.target,tt.target)||Ge.index-tt.index}function x(Ge,tt){return Ge.partOfCycle===tt.partOfCycle?Ge.y0-tt.y0:Ge.circularLinkType==="top"||tt.circularLinkType==="bottom"?-1:1}function _(Ge){return Ge.value}function A(Ge){return(Ge.y0+Ge.y1)/2}function f(Ge){return A(Ge.source)}function k(Ge){return A(Ge.target)}function w(Ge){return Ge.index}function D(Ge){return Ge.nodes}function E(Ge){return Ge.links}function I(Ge,tt){var _t=Ge.get(tt);if(!_t)throw new Error("missing: "+tt);return _t}function M(Ge,tt){return tt(Ge)}var p=25,g=10,C=.3;function T(){var Ge=0,tt=0,_t=1,mt=1,vt=24,ct,Ae=w,Oe=o,Le=D,nt=E,xt=32,ut=2,Et,Gt=null;function Qt(){var Ot={nodes:Le.apply(null,arguments),links:nt.apply(null,arguments)};vr(Ot),N(Ot,Ae,Gt),mr(Ot),Lr(Ot),B(Ot,Ae),ci(Ot,xt,Ae),vi(Ot);for(var Xe=4,ot=0;ot"u"?"undefined":h(ye))!=="object"&&(ye=ot.source=I(Xe,ye)),(typeof Pe>"u"?"undefined":h(Pe))!=="object"&&(Pe=ot.target=I(Xe,Pe)),ye.sourceLinks.push(ot),Pe.targetLinks.push(ot)}),Ot}function mr(Ot){Ot.nodes.forEach(function(Xe){Xe.partOfCycle=!1,Xe.value=Math.max(y.sum(Xe.sourceLinks,_),y.sum(Xe.targetLinks,_)),Xe.sourceLinks.forEach(function(ot){ot.circular&&(Xe.partOfCycle=!0,Xe.circularLinkType=ot.circularLinkType)}),Xe.targetLinks.forEach(function(ot){ot.circular&&(Xe.partOfCycle=!0,Xe.circularLinkType=ot.circularLinkType)})})}function Yr(Ot){var Xe=0,ot=0,De=0,ye=0,Pe=y.max(Ot.nodes,function(He){return He.column});return Ot.links.forEach(function(He){He.circular&&(He.circularLinkType=="top"?Xe=Xe+He.width:ot=ot+He.width,He.target.column==0&&(ye=ye+He.width),He.source.column==Pe&&(De=De+He.width))}),Xe=Xe>0?Xe+p+g:Xe,ot=ot>0?ot+p+g:ot,De=De>0?De+p+g:De,ye=ye>0?ye+p+g:ye,{top:Xe,bottom:ot,left:ye,right:De}}function ii(Ot,Xe){var ot=y.max(Ot.nodes,function(At){return At.column}),De=_t-Ge,ye=mt-tt,Pe=De+Xe.right+Xe.left,He=ye+Xe.top+Xe.bottom,at=De/Pe,ht=ye/He;return Ge=Ge*at+Xe.left,_t=Xe.right==0?_t:_t*at,tt=tt*ht+Xe.top,mt=mt*ht,Ot.nodes.forEach(function(At){At.x0=Ge+At.column*((_t-Ge-vt)/ot),At.x1=At.x0+vt}),ht}function Lr(Ot){var Xe,ot,De;for(Xe=Ot.nodes,ot=[],De=0;Xe.length;++De,Xe=ot,ot=[])Xe.forEach(function(ye){ye.depth=De,ye.sourceLinks.forEach(function(Pe){ot.indexOf(Pe.target)<0&&!Pe.circular&&ot.push(Pe.target)})});for(Xe=Ot.nodes,ot=[],De=0;Xe.length;++De,Xe=ot,ot=[])Xe.forEach(function(ye){ye.height=De,ye.targetLinks.forEach(function(Pe){ot.indexOf(Pe.source)<0&&!Pe.circular&&ot.push(Pe.source)})});Ot.nodes.forEach(function(ye){ye.column=Math.floor(Oe.call(null,ye,De))})}function ci(Ot,Xe,ot){var De=z.nest().key(function(At){return At.column}).sortKeys(y.ascending).entries(Ot.nodes).map(function(At){return At.values});He(ot),ht();for(var ye=1,Pe=Xe;Pe>0;--Pe)at(ye*=.99,ot),ht();function He(At){if(Et){var Wt=1/0;De.forEach(function(Dr){var br=mt*Et/(Dr.length+1);Wt=br0))if(Dr==0&&zr==1)fi=br.y1-br.y0,br.y0=mt/2-fi/2,br.y1=mt/2+fi/2;else if(Dr==Yt-1&&zr==1)fi=br.y1-br.y0,br.y0=mt/2-fi/2,br.y1=mt/2+fi/2;else{var un=0,cn=y.mean(br.sourceLinks,k),yn=y.mean(br.targetLinks,f);cn&&yn?un=(cn+yn)/2:un=cn||yn;var Gn=(un-A(br))*At;br.y0+=Gn,br.y1+=Gn}})})}function ht(){De.forEach(function(At){var Wt,Yt,hr=tt,zr=At.length,Dr;for(At.sort(x),Dr=0;Dr0&&(Wt.y0+=Yt,Wt.y1+=Yt),hr=Wt.y1+ct;if(Yt=hr-ct-mt,Yt>0)for(hr=Wt.y0-=Yt,Wt.y1-=Yt,Dr=zr-2;Dr>=0;--Dr)Wt=At[Dr],Yt=Wt.y1+ct-hr,Yt>0&&(Wt.y0-=Yt,Wt.y1-=Yt),hr=Wt.y0})}}function vi(Ot){Ot.nodes.forEach(function(Xe){Xe.sourceLinks.sort(b),Xe.targetLinks.sort(m)}),Ot.nodes.forEach(function(Xe){var ot=Xe.y0,De=ot,ye=Xe.y1,Pe=ye;Xe.sourceLinks.forEach(function(He){He.circular?(He.y0=ye-He.width/2,ye=ye-He.width):(He.y0=ot+He.width/2,ot+=He.width)}),Xe.targetLinks.forEach(function(He){He.circular?(He.y1=Pe-He.width/2,Pe=Pe-He.width):(He.y1=De+He.width/2,De+=He.width)})})}return Qt}function N(Ge,tt,_t){var mt=0;if(_t===null){for(var vt=[],ct=0;cttt.source.column)}function W(Ge,tt){var _t=0;Ge.sourceLinks.forEach(function(vt){_t=vt.circular&&!Be(vt,tt)?_t+1:_t});var mt=0;return Ge.targetLinks.forEach(function(vt){mt=vt.circular&&!Be(vt,tt)?mt+1:mt}),_t+mt}function F(Ge){var tt=Ge.source.sourceLinks,_t=0;tt.forEach(function(ct){_t=ct.circular?_t+1:_t});var mt=Ge.target.targetLinks,vt=0;return mt.forEach(function(ct){vt=ct.circular?vt+1:vt}),!(_t>1||vt>1)}function H(Ge,tt,_t){return Ge.sort(ee),Ge.forEach(function(mt,vt){var ct=0;if(Be(mt,_t)&&F(mt))mt.circularPathData.verticalBuffer=ct+mt.width/2;else{var Ae=0;for(Ae;Aect?Oe:ct}mt.circularPathData.verticalBuffer=ct+mt.width/2}}),Ge}function q(Ge,tt,_t,mt){var vt=5,ct=y.min(Ge.links,function(Le){return Le.source.y0});Ge.links.forEach(function(Le){Le.circular&&(Le.circularPathData={})});var Ae=Ge.links.filter(function(Le){return Le.circularLinkType=="top"});H(Ae,tt,mt);var Oe=Ge.links.filter(function(Le){return Le.circularLinkType=="bottom"});H(Oe,tt,mt),Ge.links.forEach(function(Le){if(Le.circular){if(Le.circularPathData.arcRadius=Le.width+g,Le.circularPathData.leftNodeBuffer=vt,Le.circularPathData.rightNodeBuffer=vt,Le.circularPathData.sourceWidth=Le.source.x1-Le.source.x0,Le.circularPathData.sourceX=Le.source.x0+Le.circularPathData.sourceWidth,Le.circularPathData.targetX=Le.target.x0,Le.circularPathData.sourceY=Le.y0,Le.circularPathData.targetY=Le.y1,Be(Le,mt)&&F(Le))Le.circularPathData.leftSmallArcRadius=g+Le.width/2,Le.circularPathData.leftLargeArcRadius=g+Le.width/2,Le.circularPathData.rightSmallArcRadius=g+Le.width/2,Le.circularPathData.rightLargeArcRadius=g+Le.width/2,Le.circularLinkType=="bottom"?(Le.circularPathData.verticalFullExtent=Le.source.y1+p+Le.circularPathData.verticalBuffer,Le.circularPathData.verticalLeftInnerExtent=Le.circularPathData.verticalFullExtent-Le.circularPathData.leftLargeArcRadius,Le.circularPathData.verticalRightInnerExtent=Le.circularPathData.verticalFullExtent-Le.circularPathData.rightLargeArcRadius):(Le.circularPathData.verticalFullExtent=Le.source.y0-p-Le.circularPathData.verticalBuffer,Le.circularPathData.verticalLeftInnerExtent=Le.circularPathData.verticalFullExtent+Le.circularPathData.leftLargeArcRadius,Le.circularPathData.verticalRightInnerExtent=Le.circularPathData.verticalFullExtent+Le.circularPathData.rightLargeArcRadius);else{var nt=Le.source.column,xt=Le.circularLinkType,ut=Ge.links.filter(function(Qt){return Qt.source.column==nt&&Qt.circularLinkType==xt});Le.circularLinkType=="bottom"?ut.sort(be):ut.sort(he);var Et=0;ut.forEach(function(Qt,vr){Qt.circularLinkID==Le.circularLinkID&&(Le.circularPathData.leftSmallArcRadius=g+Le.width/2+Et,Le.circularPathData.leftLargeArcRadius=g+Le.width/2+vr*tt+Et),Et=Et+Qt.width}),nt=Le.target.column,ut=Ge.links.filter(function(Qt){return Qt.target.column==nt&&Qt.circularLinkType==xt}),Le.circularLinkType=="bottom"?ut.sort(ce):ut.sort(ve),Et=0,ut.forEach(function(Qt,vr){Qt.circularLinkID==Le.circularLinkID&&(Le.circularPathData.rightSmallArcRadius=g+Le.width/2+Et,Le.circularPathData.rightLargeArcRadius=g+Le.width/2+vr*tt+Et),Et=Et+Qt.width}),Le.circularLinkType=="bottom"?(Le.circularPathData.verticalFullExtent=Math.max(_t,Le.source.y1,Le.target.y1)+p+Le.circularPathData.verticalBuffer,Le.circularPathData.verticalLeftInnerExtent=Le.circularPathData.verticalFullExtent-Le.circularPathData.leftLargeArcRadius,Le.circularPathData.verticalRightInnerExtent=Le.circularPathData.verticalFullExtent-Le.circularPathData.rightLargeArcRadius):(Le.circularPathData.verticalFullExtent=ct-p-Le.circularPathData.verticalBuffer,Le.circularPathData.verticalLeftInnerExtent=Le.circularPathData.verticalFullExtent+Le.circularPathData.leftLargeArcRadius,Le.circularPathData.verticalRightInnerExtent=Le.circularPathData.verticalFullExtent+Le.circularPathData.rightLargeArcRadius)}Le.circularPathData.leftInnerExtent=Le.circularPathData.sourceX+Le.circularPathData.leftNodeBuffer,Le.circularPathData.rightInnerExtent=Le.circularPathData.targetX-Le.circularPathData.rightNodeBuffer,Le.circularPathData.leftFullExtent=Le.circularPathData.sourceX+Le.circularPathData.leftLargeArcRadius+Le.circularPathData.leftNodeBuffer,Le.circularPathData.rightFullExtent=Le.circularPathData.targetX-Le.circularPathData.rightLargeArcRadius-Le.circularPathData.rightNodeBuffer}if(Le.circular)Le.path=G(Le);else{var Gt=P.linkHorizontal().source(function(Qt){var vr=Qt.source.x0+(Qt.source.x1-Qt.source.x0),mr=Qt.y0;return[vr,mr]}).target(function(Qt){var vr=Qt.target.x0,mr=Qt.y1;return[vr,mr]});Le.path=Gt(Le)}})}function G(Ge){var tt="";return Ge.circularLinkType=="top"?tt="M"+Ge.circularPathData.sourceX+" "+Ge.circularPathData.sourceY+" L"+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.sourceY+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ge.circularPathData.leftFullExtent+" "+(Ge.circularPathData.sourceY-Ge.circularPathData.leftSmallArcRadius)+" L"+Ge.circularPathData.leftFullExtent+" "+Ge.circularPathData.verticalLeftInnerExtent+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" L"+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ge.circularPathData.rightFullExtent+" "+Ge.circularPathData.verticalRightInnerExtent+" L"+Ge.circularPathData.rightFullExtent+" "+(Ge.circularPathData.targetY-Ge.circularPathData.rightSmallArcRadius)+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.targetY+" L"+Ge.circularPathData.targetX+" "+Ge.circularPathData.targetY:tt="M"+Ge.circularPathData.sourceX+" "+Ge.circularPathData.sourceY+" L"+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.sourceY+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ge.circularPathData.leftFullExtent+" "+(Ge.circularPathData.sourceY+Ge.circularPathData.leftSmallArcRadius)+" L"+Ge.circularPathData.leftFullExtent+" "+Ge.circularPathData.verticalLeftInnerExtent+" A"+Ge.circularPathData.leftLargeArcRadius+" "+Ge.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ge.circularPathData.leftInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" L"+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.verticalFullExtent+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ge.circularPathData.rightFullExtent+" "+Ge.circularPathData.verticalRightInnerExtent+" L"+Ge.circularPathData.rightFullExtent+" "+(Ge.circularPathData.targetY+Ge.circularPathData.rightSmallArcRadius)+" A"+Ge.circularPathData.rightLargeArcRadius+" "+Ge.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ge.circularPathData.rightInnerExtent+" "+Ge.circularPathData.targetY+" L"+Ge.circularPathData.targetX+" "+Ge.circularPathData.targetY,tt}function ee(Ge,tt){return re(Ge)==re(tt)?Ge.circularLinkType=="bottom"?be(Ge,tt):he(Ge,tt):re(tt)-re(Ge)}function he(Ge,tt){return Ge.y0-tt.y0}function be(Ge,tt){return tt.y0-Ge.y0}function ve(Ge,tt){return Ge.y1-tt.y1}function ce(Ge,tt){return tt.y1-Ge.y1}function re(Ge){return Ge.target.column-Ge.source.column}function ge(Ge){return Ge.target.x0-Ge.source.x1}function ne(Ge,tt){var _t=U(Ge),mt=ge(tt)/Math.tan(_t),vt=Re(Ge)=="up"?Ge.y1+mt:Ge.y1-mt;return vt}function se(Ge,tt){var _t=U(Ge),mt=ge(tt)/Math.tan(_t),vt=Re(Ge)=="up"?Ge.y1-mt:Ge.y1+mt;return vt}function _e(Ge,tt,_t,mt){Ge.links.forEach(function(vt){if(!vt.circular&&vt.target.column-vt.source.column>1){var ct=vt.source.column+1,Ae=vt.target.column-1,Oe=1,Le=Ae-ct+1;for(Oe=1;ct<=Ae;ct++,Oe++)Ge.nodes.forEach(function(nt){if(nt.column==ct){var xt=Oe/(Le+1),ut=Math.pow(1-xt,3),Et=3*xt*Math.pow(1-xt,2),Gt=3*Math.pow(xt,2)*(1-xt),Qt=Math.pow(xt,3),vr=ut*vt.y0+Et*vt.y0+Gt*vt.y1+Qt*vt.y1,mr=vr-vt.width/2,Yr=vr+vt.width/2,ii;mr>nt.y0&&mrnt.y0&&Yrnt.y1&&J(Lr,ii,tt,_t)})):mrnt.y1&&(ii=Yr-nt.y0+10,nt=J(nt,ii,tt,_t),Ge.nodes.forEach(function(Lr){M(Lr,mt)==M(nt,mt)||Lr.column!=nt.column||Lr.y0nt.y1&&J(Lr,ii,tt,_t)}))}})}})}function oe(Ge,tt){return Ge.y0>tt.y0&&Ge.y0tt.y0&&Ge.y1tt.y1}function J(Ge,tt,_t,mt){return Ge.y0+tt>=_t&&Ge.y1+tt<=mt&&(Ge.y0=Ge.y0+tt,Ge.y1=Ge.y1+tt,Ge.targetLinks.forEach(function(vt){vt.y1=vt.y1+tt}),Ge.sourceLinks.forEach(function(vt){vt.y0=vt.y0+tt})),Ge}function me(Ge,tt,_t,mt){Ge.nodes.forEach(function(vt){mt&&vt.y+(vt.y1-vt.y0)>tt&&(vt.y=vt.y-(vt.y+(vt.y1-vt.y0)-tt));var ct=Ge.links.filter(function(Le){return M(Le.source,_t)==M(vt,_t)}),Ae=ct.length;Ae>1&&ct.sort(function(Le,nt){if(!Le.circular&&!nt.circular){if(Le.target.column==nt.target.column)return Le.y1-nt.y1;if(Ce(Le,nt)){if(Le.target.column>nt.target.column){var xt=se(nt,Le);return Le.y1-xt}if(nt.target.column>Le.target.column){var ut=se(Le,nt);return ut-nt.y1}}else return Le.y1-nt.y1}if(Le.circular&&!nt.circular)return Le.circularLinkType=="top"?-1:1;if(nt.circular&&!Le.circular)return nt.circularLinkType=="top"?1:-1;if(Le.circular&&nt.circular)return Le.circularLinkType===nt.circularLinkType&&Le.circularLinkType=="top"?Le.target.column===nt.target.column?Le.target.y1-nt.target.y1:nt.target.column-Le.target.column:Le.circularLinkType===nt.circularLinkType&&Le.circularLinkType=="bottom"?Le.target.column===nt.target.column?nt.target.y1-Le.target.y1:Le.target.column-nt.target.column:Le.circularLinkType=="top"?-1:1});var Oe=vt.y0;ct.forEach(function(Le){Le.y0=Oe+Le.width/2,Oe=Oe+Le.width}),ct.forEach(function(Le,nt){if(Le.circularLinkType=="bottom"){var xt=nt+1,ut=0;for(xt;xt1&&vt.sort(function(Oe,Le){if(!Oe.circular&&!Le.circular){if(Oe.source.column==Le.source.column)return Oe.y0-Le.y0;if(Ce(Oe,Le)){if(Le.source.column0?"up":"down"}function Be(Ge,tt){return M(Ge.source,tt)==M(Ge.target,tt)}function Ze(Ge,tt,_t){var mt=Ge.nodes,vt=Ge.links,ct=!1,Ae=!1;if(vt.forEach(function(Et){Et.circularLinkType=="top"?ct=!0:Et.circularLinkType=="bottom"&&(Ae=!0)}),ct==!1||Ae==!1){var Oe=y.min(mt,function(Et){return Et.y0}),Le=y.max(mt,function(Et){return Et.y1}),nt=Le-Oe,xt=_t-tt,ut=xt/nt;mt.forEach(function(Et){var Gt=(Et.y1-Et.y0)*ut;Et.y0=(Et.y0-Oe)*ut,Et.y1=Et.y0+Gt}),vt.forEach(function(Et){Et.y0=(Et.y0-Oe)*ut,Et.y1=(Et.y1-Oe)*ut,Et.width=Et.width*ut})}}d.sankeyCircular=T,d.sankeyCenter=u,d.sankeyLeft=a,d.sankeyRight=l,d.sankeyJustify=o,Object.defineProperty(d,"__esModule",{value:!0})})}),bz=ze((te,Y)=>{Y.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}}),$ee=ze((te,Y)=>{var d=Ree(),y=(Mb(),gi(U_)).interpolateNumber,z=ri(),P=Nee(),i=Uee(),n=bz(),a=ln(),l=Xi(),o=Zs(),u=ji(),s=u.strTranslate,h=u.strRotate,m=e1(),b=m.keyFun,x=m.repeat,_=m.unwrap,A=cc(),f=as(),k=Rf(),w=k.CAP_SHIFT,D=k.LINE_SPACING,E=3;function I(ne,se,_e){var oe=_(se),J=oe.trace,me=J.domain,fe=J.orientation==="h",Ce=J.node.pad,Re=J.node.thickness,Be={justify:P.sankeyJustify,left:P.sankeyLeft,right:P.sankeyRight,center:P.sankeyCenter}[J.node.align],Ze=ne.width*(me.x[1]-me.x[0]),Ge=ne.height*(me.y[1]-me.y[0]),tt=oe._nodes,_t=oe._links,mt=oe.circular,vt;mt?vt=i.sankeyCircular().circularLinkGap(0):vt=P.sankey(),vt.iterations(n.sankeyIterations).size(fe?[Ze,Ge]:[Ge,Ze]).nodeWidth(Re).nodePadding(Ce).nodeId(function(Lr){return Lr.pointNumber}).nodeAlign(Be).nodes(tt).links(_t);var ct=vt();vt.nodePadding()=Xe||(Ot=Xe-vi.y0,Ot>1e-6&&(vi.y0+=Ot,vi.y1+=Ot)),Xe=vi.y1+Ce})}function vr(Lr){var ci=Lr.map(function(Pe,He){return{x0:Pe.x0,index:He}}).sort(function(Pe,He){return Pe.x0-He.x0}),vi=[],Ot=-1,Xe,ot=-1/0,De;for(Ae=0;Aeot+Re&&(Ot+=1,Xe=ye.x0),ot=ye.x0,vi[Ot]||(vi[Ot]=[]),vi[Ot].push(ye),De=Xe-ye.x0,ye.x0+=De,ye.x1+=De}return vi}if(J.node.x.length&&J.node.y.length){for(Ae=0;Ae0?" L "+J.targetX+" "+J.targetY:"")+"Z"):(_e="M "+(J.targetX-se)+" "+(J.targetY-oe)+" L "+(J.rightInnerExtent-se)+" "+(J.targetY-oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightSmallArcRadius+oe)+" 0 0 0 "+(J.rightFullExtent-oe-se)+" "+(J.targetY+J.rightSmallArcRadius)+" L "+(J.rightFullExtent-oe-se)+" "+J.verticalRightInnerExtent,me&&fe?_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightInnerExtent-oe-se)+" "+(J.verticalFullExtent+oe)+" L "+(J.rightFullExtent+oe-se-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent+oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent:me?_e+=" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent-se-oe-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" L "+(J.leftFullExtent+oe+(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent:_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightInnerExtent-se)+" "+(J.verticalFullExtent+oe)+" L "+J.leftInnerExtent+" "+(J.verticalFullExtent+oe)+" A "+(J.leftLargeArcRadius+oe)+" "+(J.leftLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+J.verticalLeftInnerExtent,_e+=" L "+(J.leftFullExtent+oe)+" "+(J.sourceY+J.leftSmallArcRadius)+" A "+(J.leftLargeArcRadius+oe)+" "+(J.leftSmallArcRadius+oe)+" 0 0 0 "+J.leftInnerExtent+" "+(J.sourceY-oe)+" L "+J.sourceX+" "+(J.sourceY-oe)+" L "+J.sourceX+" "+(J.sourceY+oe)+" L "+J.leftInnerExtent+" "+(J.sourceY+oe)+" A "+(J.leftLargeArcRadius-oe)+" "+(J.leftSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent-oe)+" "+(J.sourceY+J.leftSmallArcRadius)+" L "+(J.leftFullExtent-oe)+" "+J.verticalLeftInnerExtent,me&&fe?_e+=" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.leftFullExtent-oe-(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" L "+(J.rightFullExtent+oe-se+(J.rightLargeArcRadius-oe))+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent:me?_e+=" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.leftFullExtent+oe)+" "+(J.verticalFullExtent+oe)+" L "+(J.rightFullExtent-se-oe)+" "+(J.verticalFullExtent+oe)+" A "+(J.rightLargeArcRadius+oe)+" "+(J.rightLargeArcRadius+oe)+" 0 0 0 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent:_e+=" A "+(J.leftLargeArcRadius-oe)+" "+(J.leftLargeArcRadius-oe)+" 0 0 1 "+J.leftInnerExtent+" "+(J.verticalFullExtent-oe)+" L "+(J.rightInnerExtent-se)+" "+(J.verticalFullExtent-oe)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightLargeArcRadius-oe)+" 0 0 1 "+(J.rightFullExtent+oe-se)+" "+J.verticalRightInnerExtent,_e+=" L "+(J.rightFullExtent+oe-se)+" "+(J.targetY+J.rightSmallArcRadius)+" A "+(J.rightLargeArcRadius-oe)+" "+(J.rightSmallArcRadius-oe)+" 0 0 1 "+(J.rightInnerExtent-se)+" "+(J.targetY+oe)+" L "+(J.targetX-se)+" "+(J.targetY+oe)+(se>0?" L "+J.targetX+" "+J.targetY:"")+"Z"),_e}function g(){var ne=.5;function se(_e){var oe=_e.linkArrowLength;if(_e.link.circular)return p(_e.link,oe);var J=Math.abs((_e.link.target.x0-_e.link.source.x1)/2);oe>J&&(oe=J);var me=_e.link.source.x1,fe=_e.link.target.x0-oe,Ce=y(me,fe),Re=Ce(ne),Be=Ce(1-ne),Ze=_e.link.y0-_e.link.width/2,Ge=_e.link.y0+_e.link.width/2,tt=_e.link.y1-_e.link.width/2,_t=_e.link.y1+_e.link.width/2,mt="M"+me+","+Ze,vt="C"+Re+","+Ze+" "+Be+","+tt+" "+fe+","+tt,ct="C"+Be+","+_t+" "+Re+","+Ge+" "+me+","+Ge,Ae=oe>0?"L"+(fe+oe)+","+(tt+_e.link.width/2):"";return Ae+="L"+fe+","+_t,mt+vt+Ae+ct+"Z"}return se}function C(ne,se){var _e=a(se.color),oe=n.nodePadAcross,J=ne.nodePad/2;se.dx=se.x1-se.x0,se.dy=se.y1-se.y0;var me=se.dx,fe=Math.max(.5,se.dy),Ce="node_"+se.pointNumber;return se.group&&(Ce=u.randstr()),se.trace=ne.trace,se.curveNumber=ne.trace.index,{index:se.pointNumber,key:Ce,partOfGroup:se.partOfGroup||!1,group:se.group,traceId:ne.key,trace:ne.trace,node:se,nodePad:ne.nodePad,nodeLineColor:ne.nodeLineColor,nodeLineWidth:ne.nodeLineWidth,textFont:ne.textFont,size:ne.horizontal?ne.height:ne.width,visibleWidth:Math.ceil(me),visibleHeight:fe,zoneX:-oe,zoneY:-J,zoneWidth:me+2*oe,zoneHeight:fe+2*J,labelY:ne.horizontal?se.dy/2+1:se.dx/2+1,left:se.originalLayer===1,sizeAcross:ne.width,forceLayouts:ne.forceLayouts,horizontal:ne.horizontal,darkBackground:_e.getBrightness()<=128,tinyColorHue:l.tinyRGB(_e),tinyColorAlpha:_e.getAlpha(),valueFormat:ne.valueFormat,valueSuffix:ne.valueSuffix,sankey:ne.sankey,graph:ne.graph,arrangement:ne.arrangement,uniqueNodeLabelPathId:[ne.guid,ne.key,Ce].join("_"),interactionState:ne.interactionState,figure:ne}}function T(ne){ne.attr("transform",function(se){return s(se.node.x0.toFixed(3),se.node.y0.toFixed(3))})}function N(ne){ne.call(T)}function B(ne,se){ne.call(N),se.attr("d",g())}function U(ne){ne.attr("width",function(se){return se.node.x1-se.node.x0}).attr("height",function(se){return se.visibleHeight})}function V(ne){return ne.link.width>1||ne.linkLineWidth>0}function W(ne){var se=s(ne.translateX,ne.translateY);return se+(ne.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function F(ne,se,_e){ne.on(".basic",null).on("mouseover.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.hover(this,oe,se),oe.interactionState.hovered=[this,oe])}).on("mousemove.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.follow(this,oe),oe.interactionState.hovered=[this,oe])}).on("mouseout.basic",function(oe){!oe.interactionState.dragInProgress&&!oe.partOfGroup&&(_e.unhover(this,oe,se),oe.interactionState.hovered=!1)}).on("click.basic",function(oe){oe.interactionState.hovered&&(_e.unhover(this,oe,se),oe.interactionState.hovered=!1),!oe.interactionState.dragInProgress&&!oe.partOfGroup&&_e.select(this,oe,se)})}function H(ne,se,_e,oe){var J=z.behavior.drag().origin(function(me){return{x:me.node.x0+me.visibleWidth/2,y:me.node.y0+me.visibleHeight/2}}).on("dragstart",function(me){if(me.arrangement!=="fixed"&&(u.ensureSingle(oe._fullLayout._infolayer,"g","dragcover",function(Ce){oe._fullLayout._dragCover=Ce}),u.raiseToTop(this),me.interactionState.dragInProgress=me.node,ve(me.node),me.interactionState.hovered&&(_e.nodeEvents.unhover.apply(0,me.interactionState.hovered),me.interactionState.hovered=!1),me.arrangement==="snap")){var fe=me.traceId+"|"+me.key;me.forceLayouts[fe]?me.forceLayouts[fe].alpha(1):q(ne,fe,me),G(ne,se,me,fe,oe)}}).on("drag",function(me){if(me.arrangement!=="fixed"){var fe=z.event.x,Ce=z.event.y;me.arrangement==="snap"?(me.node.x0=fe-me.visibleWidth/2,me.node.x1=fe+me.visibleWidth/2,me.node.y0=Ce-me.visibleHeight/2,me.node.y1=Ce+me.visibleHeight/2):(me.arrangement==="freeform"&&(me.node.x0=fe-me.visibleWidth/2,me.node.x1=fe+me.visibleWidth/2),Ce=Math.max(0,Math.min(me.size-me.visibleHeight/2,Ce)),me.node.y0=Ce-me.visibleHeight/2,me.node.y1=Ce+me.visibleHeight/2),ve(me.node),me.arrangement!=="snap"&&(me.sankey.update(me.graph),B(ne.filter(ce(me)),se))}}).on("dragend",function(me){if(me.arrangement!=="fixed"){me.interactionState.dragInProgress=!1;for(var fe=0;fe0)window.requestAnimationFrame(me);else{var Re=_e.node.originalX;_e.node.x0=Re-_e.visibleWidth/2,_e.node.x1=Re+_e.visibleWidth/2,he(_e,J)}})}function ee(ne,se,_e,oe){return function(){for(var J=0,me=0;me<_e.length;me++){var fe=_e[me];fe===oe.interactionState.dragInProgress?(fe.x=fe.lastDraggedX,fe.y=fe.lastDraggedY):(fe.vx=(fe.originalX-fe.x)/n.forceTicksPerFrame,fe.y=Math.min(oe.size-fe.dy/2,Math.max(fe.dy/2,fe.y))),J=Math.max(J,Math.abs(fe.vx),Math.abs(fe.vy))}!oe.interactionState.dragInProgress&&J<.1&&oe.forceLayouts[se].alpha()>0&&oe.forceLayouts[se].alpha(0)}}function he(ne,se){for(var _e=[],oe=[],J=0;J{var d=ri(),y=ji(),z=y.numberFormat,P=$ee(),i=hf(),n=Xi(),a=bz().cn,l=y._;function o(w){return w!==""}function u(w,D){return w.filter(function(E){return E.key===D.traceId})}function s(w,D){d.select(w).select("path").style("fill-opacity",D),d.select(w).select("rect").style("fill-opacity",D)}function h(w){d.select(w).select("text.name").style("fill","black")}function m(w){return function(D){return w.node.sourceLinks.indexOf(D.link)!==-1||w.node.targetLinks.indexOf(D.link)!==-1}}function b(w){return function(D){return D.node.sourceLinks.indexOf(w.link)!==-1||D.node.targetLinks.indexOf(w.link)!==-1}}function x(w,D,E){D&&E&&u(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(A.bind(0,D,E,!1))}function _(w,D,E){D&&E&&u(E,D).selectAll("."+a.sankeyLink).filter(m(D)).call(f.bind(0,D,E,!1))}function A(w,D,E,I){I.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),I.each(function(M){var p=M.link.label;p!==""&&u(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverHue}).style("fill-opacity",function(g){if(!g.link.concentrationscale)return g.tinyColorHoverAlpha})}),E&&u(D,w).selectAll("."+a.sankeyNode).filter(b(w)).call(x)}function f(w,D,E,I){I.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),I.each(function(M){var p=M.link.label;p!==""&&u(D,w).selectAll("."+a.sankeyLink).filter(function(g){return g.link.label===p}).style("fill",function(g){return g.tinyColorHue}).style("fill-opacity",function(g){return g.tinyColorAlpha})}),E&&u(D,w).selectAll(a.sankeyNode).filter(b(w)).call(_)}function k(w,D){var E=w.hoverlabel||{},I=y.nestedProperty(E,D).get();return Array.isArray(I)?!1:I}Y.exports=function(w,D){for(var E=w._fullLayout,I=E._paper,M=E._size,p=0;p"),color:k(ce,"bgcolor")||n.addOpacity(_e.color,1),borderColor:k(ce,"bordercolor"),fontFamily:k(ce,"font.family"),fontSize:k(ce,"font.size"),fontColor:k(ce,"font.color"),fontWeight:k(ce,"font.weight"),fontStyle:k(ce,"font.style"),fontVariant:k(ce,"font.variant"),fontTextcase:k(ce,"font.textcase"),fontLineposition:k(ce,"font.lineposition"),fontShadow:k(ce,"font.shadow"),nameLength:k(ce,"namelength"),textAlign:k(ce,"align"),idealAlign:d.event.x"),color:k(ce,"bgcolor")||ve.tinyColorHue,borderColor:k(ce,"bordercolor"),fontFamily:k(ce,"font.family"),fontSize:k(ce,"font.size"),fontColor:k(ce,"font.color"),fontWeight:k(ce,"font.weight"),fontStyle:k(ce,"font.style"),fontVariant:k(ce,"font.variant"),fontTextcase:k(ce,"font.textcase"),fontLineposition:k(ce,"font.lineposition"),fontShadow:k(ce,"font.shadow"),nameLength:k(ce,"namelength"),textAlign:k(ce,"align"),idealAlign:"left",hovertemplate:ce.hovertemplate,hovertemplateLabels:J,eventData:[ve.node]},{container:E._hoverlayer.node(),outerContainer:E._paper.node(),gd:w});s(Ce,.85),h(Ce)}}},he=function(be,ve,ce){w._fullLayout.hovermode!==!1&&(d.select(be).call(_,ve,ce),ve.node.trace.node.hoverinfo!=="skip"&&(ve.node.fullData=ve.node.trace,w.emit("plotly_unhover",{event:d.event,points:[ve.node]})),i.loneUnhover(E._hoverlayer.node()))};P(w,I,D,{width:M.w,height:M.h,margin:{t:M.t,r:M.r,b:M.b,l:M.l}},{linkEvents:{hover:T,follow:F,unhover:H,select:C},nodeEvents:{hover:G,follow:ee,unhover:he,select:q}})}}),Hee=ze(te=>{var Y=oh().overrideAll,d=Ed().getModuleCalcData,y=wz(),z=Xa(),P=Em(),i=jp(),n=Ef().prepSelect,a=ji(),l=as(),o="sankey";te.name=o,te.baseLayoutAttrOverrides=Y({hoverlabel:z.hoverlabel},"plot","nested"),te.plot=function(s){var h=d(s.calcdata,o)[0];y(s,h),te.updateFx(s)},te.clean=function(s,h,m,b){var x=b._has&&b._has(o),_=h._has&&h._has(o);x&&!_&&(b._paperdiv.selectAll(".sankey").remove(),b._paperdiv.selectAll(".bgsankey").remove())},te.updateFx=function(s){for(var h=0;h{Y.exports=function(d,y){for(var z=d.cd,P=[],i=z[0].trace,n=i._sankey.graph.nodes,a=0;a{Y.exports={attributes:yz(),supplyDefaults:Iee(),calc:Dee(),plot:wz(),moduleType:"trace",name:"sankey",basePlotModule:Hee(),selectPoints:Vee(),categories:["noOpacity"],meta:{}}}),qee=ze((te,Y)=>{Y.exports=Wee()}),Gee=ze(te=>{var Y=sh();te.name="indicator",te.plot=function(d,y,z,P){Y.plotBasePlot(te.name,d,y,z,P)},te.clean=function(d,y,z,P){Y.cleanBasePlot(te.name,d,y,z,P)}}),kz=ze((te,Y)=>{var d=nn().extendFlat,y=nn().extendDeep,z=oh().overrideAll,P=On(),i=Mi(),n=Xh().attributes,a=Gd(),l=ku().templatedArray,o=Iw(),u=Sh().descriptionOnlyNumbers,s=P({editType:"plot",colorEditType:"plot"}),h={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:i.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},m={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},b=l("step",y({},h,{range:m}));Y.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:n({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:d({},s,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:u("value")},font:d({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:u("value")},increasing:{symbol:{valType:"string",dflt:o.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:o.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:o.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:d({},s,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:y({},h,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:z({range:m,visible:d({},a.visible,{dflt:!0}),tickmode:a.minor.tickmode,nticks:a.nticks,tick0:a.tick0,dtick:a.dtick,tickvals:a.tickvals,ticktext:a.ticktext,ticks:d({},a.ticks,{dflt:"outside"}),ticklen:a.ticklen,tickwidth:a.tickwidth,tickcolor:a.tickcolor,ticklabelstep:a.ticklabelstep,showticklabels:a.showticklabels,labelalias:a.labelalias,tickfont:P({}),tickangle:a.tickangle,tickformat:a.tickformat,tickformatstops:a.tickformatstops,tickprefix:a.tickprefix,showtickprefix:a.showtickprefix,ticksuffix:a.ticksuffix,showticksuffix:a.showticksuffix,separatethousands:a.separatethousands,exponentformat:a.exponentformat,minexponent:a.minexponent,showexponent:a.showexponent,editType:"plot"},"plot"),steps:b,threshold:{line:{color:d({},h.line.color,{}),width:d({},h.line.width,{dflt:1}),editType:"plot"},thickness:d({},h.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}),Tz=ze((te,Y)=>{Y.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}),Zee=ze((te,Y)=>{var d=ji(),y=kz(),z=Xh().defaults,P=ku(),i=Zd(),n=Tz(),a=Nv(),l=jv(),o=G0(),u=Tg();function s(m,b,x,_){function A(H,q){return d.coerce(m,b,y,H,q)}z(b,_,A),A("mode"),b._hasNumber=b.mode.indexOf("number")!==-1,b._hasDelta=b.mode.indexOf("delta")!==-1,b._hasGauge=b.mode.indexOf("gauge")!==-1;var f=A("value");b._range=[0,typeof f=="number"?1.5*f:1];var k=new Array(2),w;if(b._hasNumber){A("number.valueformat");var D=d.extendFlat({},_.font);D.size=void 0,d.coerceFont(A,"number.font",D),b.number.font.size===void 0&&(b.number.font.size=n.defaultNumberFontSize,k[0]=!0),A("number.prefix"),A("number.suffix"),w=b.number.font.size}var E;if(b._hasDelta){var I=d.extendFlat({},_.font);I.size=void 0,d.coerceFont(A,"delta.font",I),b.delta.font.size===void 0&&(b.delta.font.size=(b._hasNumber?.5:1)*(w||n.defaultNumberFontSize),k[1]=!0),A("delta.reference",b.value),A("delta.relative"),A("delta.valueformat",b.delta.relative?"2%":""),A("delta.increasing.symbol"),A("delta.increasing.color"),A("delta.decreasing.symbol"),A("delta.decreasing.color"),A("delta.position"),A("delta.prefix"),A("delta.suffix"),E=b.delta.font.size}b._scaleNumbers=(!b._hasNumber||k[0])&&(!b._hasDelta||k[1])||!1;var M=d.extendFlat({},_.font);M.size=.25*(w||E||n.defaultNumberFontSize),d.coerceFont(A,"title.font",M),A("title.text");var p,g,C,T;function N(H,q){return d.coerce(p,g,y.gauge,H,q)}function B(H,q){return d.coerce(C,T,y.gauge.axis,H,q)}if(b._hasGauge){p=m.gauge,p||(p={}),g=P.newContainer(b,"gauge"),N("shape");var U=b._isBullet=b.gauge.shape==="bullet";U||A("title.align","center");var V=b._isAngular=b.gauge.shape==="angular";V||A("align","center"),N("bgcolor",_.paper_bgcolor),N("borderwidth"),N("bordercolor"),N("bar.color"),N("bar.line.color"),N("bar.line.width");var W=n.valueThickness*(b.gauge.shape==="bullet"?.5:1);N("bar.thickness",W),i(p,g,{name:"steps",handleItemDefaults:h}),N("threshold.value"),N("threshold.thickness"),N("threshold.line.width"),N("threshold.line.color"),C={},p&&(C=p.axis||{}),T=P.newContainer(g,"axis"),B("visible"),b._range=B("range",b._range);var F={font:_.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};a(C,T,B,"linear"),u(C,T,B,"linear",F),o(C,T,B,"linear",F),l(C,T,B,F)}else A("title.align","center"),A("align","center"),b._isAngular=b._isBullet=!1;b._length=null}function h(m,b){function x(_,A){return d.coerce(m,b,y.gauge.steps,_,A)}x("color"),x("line.color"),x("line.width"),x("range"),x("thickness")}Y.exports={supplyDefaults:s}}),Kee=ze((te,Y)=>{function d(y,z){var P=[],i=z.value;typeof z._lastValue!="number"&&(z._lastValue=z.value);var n=z._lastValue,a=n;return z._hasDelta&&typeof z.delta.reference=="number"&&(a=z.delta.reference),P[0]={y:i,lastY:n,delta:i-a,relativeDelta:(i-a)/a},P}Y.exports={calc:d}}),Yee=ze((te,Y)=>{var d=ri(),y=(Mb(),gi(U_)).interpolate,z=(Mb(),gi(U_)).interpolateNumber,P=ji(),i=P.strScale,n=P.strTranslate,a=P.rad2deg,l=Rf().MID_SHIFT,o=Zs(),u=Tz(),s=cc(),h=Os(),m=db(),b=Cw(),x=Gd(),_=Xi(),A={left:"start",center:"middle",right:"end"},f={left:0,center:.5,right:1},k=/[yzafpnµmkMGTPEZY]/;function w(U){return U&&U.duration>0}Y.exports=function(U,V,W,F){var H=U._fullLayout,q;w(W)&&F&&(q=F()),P.makeTraceGroups(H._indicatorlayer,V,"trace").each(function(G){var ee=G[0],he=ee.trace,be=d.select(this),ve=he._hasGauge,ce=he._isAngular,re=he._isBullet,ge=he.domain,ne={w:H._size.w*(ge.x[1]-ge.x[0]),h:H._size.h*(ge.y[1]-ge.y[0]),l:H._size.l+H._size.w*ge.x[0],r:H._size.r+H._size.w*(1-ge.x[1]),t:H._size.t+H._size.h*(1-ge.y[1]),b:H._size.b+H._size.h*ge.y[0]},se=ne.l+ne.w/2,_e=ne.t+ne.h/2,oe=Math.min(ne.w/2,ne.h),J=u.innerRadius*oe,me,fe,Ce,Re=he.align||"center";if(fe=_e,!ve)me=ne.l+f[Re]*ne.w,Ce=function(Oe){return C(Oe,ne.w,ne.h)};else if(ce&&(me=se,fe=_e+oe/2,Ce=function(Oe){return T(Oe,.9*J)}),re){var Be=u.bulletPadding,Ze=1-u.bulletNumberDomainSize+Be;me=ne.l+(Ze+(1-Ze)*f[Re])*ne.w,Ce=function(Oe){return C(Oe,(u.bulletNumberDomainSize-Be)*ne.w,ne.h)}}I(U,be,G,{numbersX:me,numbersY:fe,numbersScaler:Ce,transitionOpts:W,onComplete:q});var Ge,tt;ve&&(Ge={range:he.gauge.axis.range,color:he.gauge.bgcolor,line:{color:he.gauge.bordercolor,width:0},thickness:1},tt={range:he.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:he.gauge.bordercolor,width:he.gauge.borderwidth},thickness:1});var _t=be.selectAll("g.angular").data(ce?G:[]);_t.exit().remove();var mt=be.selectAll("g.angularaxis").data(ce?G:[]);mt.exit().remove(),ce&&E(U,be,G,{radius:oe,innerRadius:J,gauge:_t,layer:mt,size:ne,gaugeBg:Ge,gaugeOutline:tt,transitionOpts:W,onComplete:q});var vt=be.selectAll("g.bullet").data(re?G:[]);vt.exit().remove();var ct=be.selectAll("g.bulletaxis").data(re?G:[]);ct.exit().remove(),re&&D(U,be,G,{gauge:vt,layer:ct,size:ne,gaugeBg:Ge,gaugeOutline:tt,transitionOpts:W,onComplete:q});var Ae=be.selectAll("text.title").data(G);Ae.exit().remove(),Ae.enter().append("text").classed("title",!0),Ae.attr("text-anchor",function(){return re?A.right:A[he.title.align]}).text(he.title.text).call(o.font,he.title.font).call(s.convertToTspans,U),Ae.attr("transform",function(){var Oe=ne.l+ne.w*f[he.title.align],Le,nt=u.titlePadding,xt=o.bBox(Ae.node());if(ve){if(ce)if(he.gauge.axis.visible){var ut=o.bBox(mt.node());Le=ut.top-nt-xt.bottom}else Le=ne.t+ne.h/2-oe/2-xt.bottom-nt;re&&(Le=fe-(xt.top+xt.bottom)/2,Oe=ne.l-u.bulletPadding*ne.w)}else Le=he._numbersTop-nt-xt.bottom;return n(Oe,Le)})})};function D(U,V,W,F){var H=W[0].trace,q=F.gauge,G=F.layer,ee=F.gaugeBg,he=F.gaugeOutline,be=F.size,ve=H.domain,ce=F.transitionOpts,re=F.onComplete,ge,ne,se,_e,oe;q.enter().append("g").classed("bullet",!0),q.attr("transform",n(be.l,be.t)),G.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),G.selectAll("g.xbulletaxistick,path,text").remove();var J=be.h,me=H.gauge.bar.thickness*J,fe=ve.x[0],Ce=ve.x[0]+(ve.x[1]-ve.x[0])*(H._hasNumber||H._hasDelta?1-u.bulletNumberDomainSize:1);ge=g(U,H.gauge.axis),ge._id="xbulletaxis",ge.domain=[fe,Ce],ge.setScale(),ne=h.calcTicks(ge),se=h.makeTransTickFn(ge),_e=h.getTickSigns(ge)[2],oe=be.t+be.h,ge.visible&&(h.drawTicks(U,ge,{vals:ge.ticks==="inside"?h.clipEnds(ge,ne):ne,layer:G,path:h.makeTickPath(ge,oe,_e),transFn:se}),h.drawLabels(U,ge,{vals:ne,layer:G,transFn:se,labelFns:h.makeLabelFns(ge,oe)}));function Re(vt){vt.attr("width",function(ct){return Math.max(0,ge.c2p(ct.range[1])-ge.c2p(ct.range[0]))}).attr("x",function(ct){return ge.c2p(ct.range[0])}).attr("y",function(ct){return .5*(1-ct.thickness)*J}).attr("height",function(ct){return ct.thickness*J})}var Be=[ee].concat(H.gauge.steps),Ze=q.selectAll("g.bg-bullet").data(Be);Ze.enter().append("g").classed("bg-bullet",!0).append("rect"),Ze.select("rect").call(Re).call(M),Ze.exit().remove();var Ge=q.selectAll("g.value-bullet").data([H.gauge.bar]);Ge.enter().append("g").classed("value-bullet",!0).append("rect"),Ge.select("rect").attr("height",me).attr("y",(J-me)/2).call(M),w(ce)?Ge.select("rect").transition().duration(ce.duration).ease(ce.easing).each("end",function(){re&&re()}).each("interrupt",function(){re&&re()}).attr("width",Math.max(0,ge.c2p(Math.min(H.gauge.axis.range[1],W[0].y)))):Ge.select("rect").attr("width",typeof W[0].y=="number"?Math.max(0,ge.c2p(Math.min(H.gauge.axis.range[1],W[0].y))):0),Ge.exit().remove();var tt=W.filter(function(){return H.gauge.threshold.value||H.gauge.threshold.value===0}),_t=q.selectAll("g.threshold-bullet").data(tt);_t.enter().append("g").classed("threshold-bullet",!0).append("line"),_t.select("line").attr("x1",ge.c2p(H.gauge.threshold.value)).attr("x2",ge.c2p(H.gauge.threshold.value)).attr("y1",(1-H.gauge.threshold.thickness)/2*J).attr("y2",(1-(1-H.gauge.threshold.thickness)/2)*J).call(_.stroke,H.gauge.threshold.line.color).style("stroke-width",H.gauge.threshold.line.width),_t.exit().remove();var mt=q.selectAll("g.gauge-outline").data([he]);mt.enter().append("g").classed("gauge-outline",!0).append("rect"),mt.select("rect").call(Re).call(M),mt.exit().remove()}function E(U,V,W,F){var H=W[0].trace,q=F.size,G=F.radius,ee=F.innerRadius,he=F.gaugeBg,be=F.gaugeOutline,ve=[q.l+q.w/2,q.t+q.h/2+G/2],ce=F.gauge,re=F.layer,ge=F.transitionOpts,ne=F.onComplete,se=Math.PI/2;function _e(Gt){var Qt=H.gauge.axis.range[0],vr=H.gauge.axis.range[1],mr=(Gt-Qt)/(vr-Qt)*Math.PI-se;return mr<-se?-se:mr>se?se:mr}function oe(Gt){return d.svg.arc().innerRadius((ee+G)/2-Gt/2*(G-ee)).outerRadius((ee+G)/2+Gt/2*(G-ee)).startAngle(-se)}function J(Gt){Gt.attr("d",function(Qt){return oe(Qt.thickness).startAngle(_e(Qt.range[0])).endAngle(_e(Qt.range[1]))()})}var me,fe,Ce,Re;ce.enter().append("g").classed("angular",!0),ce.attr("transform",n(ve[0],ve[1])),re.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),re.selectAll("g.xangularaxistick,path,text").remove(),me=g(U,H.gauge.axis),me.type="linear",me.range=H.gauge.axis.range,me._id="xangularaxis",me.ticklabeloverflow="allow",me.setScale();var Be=function(Gt){return(me.range[0]-Gt.x)/(me.range[1]-me.range[0])*Math.PI+Math.PI},Ze={},Ge=h.makeLabelFns(me,0),tt=Ge.labelStandoff;Ze.xFn=function(Gt){var Qt=Be(Gt);return Math.cos(Qt)*tt},Ze.yFn=function(Gt){var Qt=Be(Gt),vr=Math.sin(Qt)>0?.2:1;return-Math.sin(Qt)*(tt+Gt.fontSize*vr)+Math.abs(Math.cos(Qt))*(Gt.fontSize*l)},Ze.anchorFn=function(Gt){var Qt=Be(Gt),vr=Math.cos(Qt);return Math.abs(vr)<.1?"middle":vr>0?"start":"end"},Ze.heightFn=function(Gt,Qt,vr){var mr=Be(Gt);return-.5*(1+Math.sin(mr))*vr};var _t=function(Gt){return n(ve[0]+G*Math.cos(Gt),ve[1]-G*Math.sin(Gt))};Ce=function(Gt){return _t(Be(Gt))};var mt=function(Gt){var Qt=Be(Gt);return _t(Qt)+"rotate("+-a(Qt)+")"};if(fe=h.calcTicks(me),Re=h.getTickSigns(me)[2],me.visible){Re=me.ticks==="inside"?-1:1;var vt=(me.linewidth||1)/2;h.drawTicks(U,me,{vals:fe,layer:re,path:"M"+Re*vt+",0h"+Re*me.ticklen,transFn:mt}),h.drawLabels(U,me,{vals:fe,layer:re,transFn:Ce,labelFns:Ze})}var ct=[he].concat(H.gauge.steps),Ae=ce.selectAll("g.bg-arc").data(ct);Ae.enter().append("g").classed("bg-arc",!0).append("path"),Ae.select("path").call(J).call(M),Ae.exit().remove();var Oe=oe(H.gauge.bar.thickness),Le=ce.selectAll("g.value-arc").data([H.gauge.bar]);Le.enter().append("g").classed("value-arc",!0).append("path");var nt=Le.select("path");w(ge)?(nt.transition().duration(ge.duration).ease(ge.easing).each("end",function(){ne&&ne()}).each("interrupt",function(){ne&&ne()}).attrTween("d",p(Oe,_e(W[0].lastY),_e(W[0].y))),H._lastValue=W[0].y):nt.attr("d",typeof W[0].y=="number"?Oe.endAngle(_e(W[0].y)):"M0,0Z"),nt.call(M),Le.exit().remove(),ct=[];var xt=H.gauge.threshold.value;(xt||xt===0)&&ct.push({range:[xt,xt],color:H.gauge.threshold.color,line:{color:H.gauge.threshold.line.color,width:H.gauge.threshold.line.width},thickness:H.gauge.threshold.thickness});var ut=ce.selectAll("g.threshold-arc").data(ct);ut.enter().append("g").classed("threshold-arc",!0).append("path"),ut.select("path").call(J).call(M),ut.exit().remove();var Et=ce.selectAll("g.gauge-outline").data([be]);Et.enter().append("g").classed("gauge-outline",!0).append("path"),Et.select("path").call(J).call(M),Et.exit().remove()}function I(U,V,W,F){var H=W[0].trace,q=F.numbersX,G=F.numbersY,ee=H.align||"center",he=A[ee],be=F.transitionOpts,ve=F.onComplete,ce=P.ensureSingle(V,"g","numbers"),re,ge,ne,se=[];H._hasNumber&&se.push("number"),H._hasDelta&&(se.push("delta"),H.delta.position==="left"&&se.reverse());var _e=ce.selectAll("text").data(se);_e.enter().append("text"),_e.attr("text-anchor",function(){return he}).attr("class",function(_t){return _t}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),_e.exit().remove();function oe(_t,mt,vt,ct){if(_t.match("s")&&vt>=0!=ct>=0&&!mt(vt).slice(-1).match(k)&&!mt(ct).slice(-1).match(k)){var Ae=_t.slice().replace("s","f").replace(/\d+/,function(Le){return parseInt(Le)-1}),Oe=g(U,{tickformat:Ae});return function(Le){return Math.abs(Le)<1?h.tickText(Oe,Le).text:mt(Le)}}else return mt}function J(){var _t=g(U,{tickformat:H.number.valueformat},H._range);_t.setScale(),h.prepTicks(_t);var mt=function(Le){return h.tickText(_t,Le).text},vt=H.number.suffix,ct=H.number.prefix,Ae=ce.select("text.number");function Oe(){var Le=typeof W[0].y=="number"?ct+mt(W[0].y)+vt:"-";Ae.text(Le).call(o.font,H.number.font).call(s.convertToTspans,U)}return w(be)?Ae.transition().duration(be.duration).ease(be.easing).each("end",function(){Oe(),ve&&ve()}).each("interrupt",function(){Oe(),ve&&ve()}).attrTween("text",function(){var Le=d.select(this),nt=z(W[0].lastY,W[0].y);H._lastValue=W[0].y;var xt=oe(H.number.valueformat,mt,W[0].lastY,W[0].y);return function(ut){Le.text(ct+xt(nt(ut))+vt)}}):Oe(),re=N(ct+mt(W[0].y)+vt,H.number.font,he,U),Ae}function me(){var _t=g(U,{tickformat:H.delta.valueformat},H._range);_t.setScale(),h.prepTicks(_t);var mt=function(ut){return h.tickText(_t,ut).text},vt=H.delta.suffix,ct=H.delta.prefix,Ae=function(ut){var Et=H.delta.relative?ut.relativeDelta:ut.delta;return Et},Oe=function(ut,Et){return ut===0||typeof ut!="number"||isNaN(ut)?"-":(ut>0?H.delta.increasing.symbol:H.delta.decreasing.symbol)+ct+Et(ut)+vt},Le=function(ut){return ut.delta>=0?H.delta.increasing.color:H.delta.decreasing.color};H._deltaLastValue===void 0&&(H._deltaLastValue=Ae(W[0]));var nt=ce.select("text.delta");nt.call(o.font,H.delta.font).call(_.fill,Le({delta:H._deltaLastValue}));function xt(){nt.text(Oe(Ae(W[0]),mt)).call(_.fill,Le(W[0])).call(s.convertToTspans,U)}return w(be)?nt.transition().duration(be.duration).ease(be.easing).tween("text",function(){var ut=d.select(this),Et=Ae(W[0]),Gt=H._deltaLastValue,Qt=oe(H.delta.valueformat,mt,Gt,Et),vr=z(Gt,Et);return H._deltaLastValue=Et,function(mr){ut.text(Oe(vr(mr),Qt)),ut.call(_.fill,Le({delta:vr(mr)}))}}).each("end",function(){xt(),ve&&ve()}).each("interrupt",function(){xt(),ve&&ve()}):xt(),ge=N(Oe(Ae(W[0]),mt),H.delta.font,he,U),nt}var fe=H.mode+H.align,Ce;if(H._hasDelta&&(Ce=me(),fe+=H.delta.position+H.delta.font.size+H.delta.font.family+H.delta.valueformat,fe+=H.delta.increasing.symbol+H.delta.decreasing.symbol,ne=ge),H._hasNumber&&(J(),fe+=H.number.font.size+H.number.font.family+H.number.valueformat+H.number.suffix+H.number.prefix,ne=re),H._hasDelta&&H._hasNumber){var Re=[(re.left+re.right)/2,(re.top+re.bottom)/2],Be=[(ge.left+ge.right)/2,(ge.top+ge.bottom)/2],Ze,Ge,tt=.75*H.delta.font.size;H.delta.position==="left"&&(Ze=B(H,"deltaPos",0,-1*(re.width*f[H.align]+ge.width*(1-f[H.align])+tt),fe,Math.min),Ge=Re[1]-Be[1],ne={width:re.width+ge.width+tt,height:Math.max(re.height,ge.height),left:ge.left+Ze,right:re.right,top:Math.min(re.top,ge.top+Ge),bottom:Math.max(re.bottom,ge.bottom+Ge)}),H.delta.position==="right"&&(Ze=B(H,"deltaPos",0,re.width*(1-f[H.align])+ge.width*f[H.align]+tt,fe,Math.max),Ge=Re[1]-Be[1],ne={width:re.width+ge.width+tt,height:Math.max(re.height,ge.height),left:re.left,right:ge.right+Ze,top:Math.min(re.top,ge.top+Ge),bottom:Math.max(re.bottom,ge.bottom+Ge)}),H.delta.position==="bottom"&&(Ze=null,Ge=ge.height,ne={width:Math.max(re.width,ge.width),height:re.height+ge.height,left:Math.min(re.left,ge.left),right:Math.max(re.right,ge.right),top:re.bottom-re.height,bottom:re.bottom+ge.height}),H.delta.position==="top"&&(Ze=null,Ge=re.top,ne={width:Math.max(re.width,ge.width),height:re.height+ge.height,left:Math.min(re.left,ge.left),right:Math.max(re.right,ge.right),top:re.bottom-re.height-ge.height,bottom:re.bottom}),Ce.attr({dx:Ze,dy:Ge})}(H._hasNumber||H._hasDelta)&&ce.attr("transform",function(){var _t=F.numbersScaler(ne);fe+=_t[2];var mt=B(H,"numbersScale",1,_t[0],fe,Math.min),vt;H._scaleNumbers||(mt=1),H._isAngular?vt=G-mt*ne.bottom:vt=G-mt*(ne.top+ne.bottom)/2,H._numbersTop=mt*ne.top+vt;var ct=ne[ee];ee==="center"&&(ct=(ne.left+ne.right)/2);var Ae=q-mt*ct;return Ae=B(H,"numbersTranslate",0,Ae,fe,Math.max),n(Ae,vt)+i(mt)})}function M(U){U.each(function(V){_.stroke(d.select(this),V.line.color)}).each(function(V){_.fill(d.select(this),V.color)}).style("stroke-width",function(V){return V.line.width})}function p(U,V,W){return function(){var F=y(V,W);return function(H){return U.endAngle(F(H))()}}}function g(U,V,W){var F=U._fullLayout,H=P.extendFlat({type:"linear",ticks:"outside",range:W,showline:!0},V),q={type:"linear",_id:"x"+V._id},G={letter:"x",font:F.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function ee(he,be){return P.coerce(H,q,x,he,be)}return m(H,q,ee,G,F),b(H,q,ee,G),q}function C(U,V,W){var F=Math.min(V/U.width,W/U.height);return[F,U,V+"x"+W]}function T(U,V){var W=Math.sqrt(U.width/2*(U.width/2)+U.height*U.height),F=V/W;return[F,U,V]}function N(U,V,W,F){var H=document.createElementNS("http://www.w3.org/2000/svg","text"),q=d.select(H);return q.text(U).attr("x",0).attr("y",0).attr("text-anchor",W).attr("data-unformatted",U).call(s.convertToTspans,F).call(o.font,V),o.bBox(q.node())}function B(U,V,W,F,H,q){var G="_cache"+V;U[G]&&U[G].key===H||(U[G]={key:H,value:W});var ee=P.aggNums(q,null,[U[G].value,F],2);return U[G].value=ee,ee}}),Xee=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"indicator",basePlotModule:Gee(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:kz(),supplyDefaults:Zee().supplyDefaults,calc:Kee().calc,plot:Yee(),meta:{}}}),Jee=ze((te,Y)=>{Y.exports=Xee()}),Sz=ze((te,Y)=>{var d=Ag(),y=nn().extendFlat,z=oh().overrideAll,P=On(),i=Xh().attributes,n=Sh().descriptionOnlyNumbers;Y.exports=z({domain:i({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:n("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:y({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:n("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:y({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:y({},P({arrayOk:!0}))}},"calc","from-root")}),Qee=ze((te,Y)=>{var d=ji(),y=Sz(),z=Xh().defaults;function P(i,n){for(var a=i.columnorder||[],l=i.header.values.length,o=a.slice(0,l),u=o.slice().sort(function(m,b){return m-b}),s=o.map(function(m){return u.indexOf(m)}),h=s.length;h{var d=e1().wrap;Y.exports=function(){return d({})}}),Cz=ze((te,Y)=>{Y.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"
",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}),tte=ze((te,Y)=>{var d=Cz(),y=nn().extendFlat,z=Sr(),P=Di().isTypedArray,i=Di().isArrayOrTypedArray;Y.exports=function(b,x){var _=l(x.cells.values),A=function(ee){return ee.slice(x.header.values.length,ee.length)},f=l(x.header.values);f.length&&!f[0].length&&(f[0]=[""],f=l(f));var k=f.concat(A(_).map(function(){return o((f[0]||[""]).length)})),w=x.domain,D=Math.floor(b._fullLayout._size.w*(w.x[1]-w.x[0])),E=Math.floor(b._fullLayout._size.h*(w.y[1]-w.y[0])),I=x.header.values.length?k[0].map(function(){return x.header.height}):[d.emptyHeaderHeight],M=_.length?_[0].map(function(){return x.cells.height}):[],p=I.reduce(a,0),g=E-p,C=g+d.uplift,T=h(M,C),N=h(I,p),B=s(N,[]),U=s(T,B),V={},W=x._fullInput.columnorder;i(W)&&(W=Array.from(W)),W=W.concat(A(_.map(function(ee,he){return he})));var F=k.map(function(ee,he){var be=i(x.columnwidth)?x.columnwidth[Math.min(he,x.columnwidth.length-1)]:x.columnwidth;return z(be)?Number(be):1}),H=F.reduce(a,0);F=F.map(function(ee){return ee/H*D});var q=Math.max(n(x.header.line.width),n(x.cells.line.width)),G={key:x.uid+b._context.staticPlot,translateX:w.x[0]*b._fullLayout._size.w,translateY:b._fullLayout._size.h*(1-w.y[1]),size:b._fullLayout._size,width:D,maxLineWidth:q,height:E,columnOrder:W,groupHeight:E,rowBlocks:U,headerRowBlocks:B,scrollY:0,cells:y({},x.cells,{values:_}),headerCells:y({},x.header,{values:k}),gdColumns:k.map(function(ee){return ee[0]}),gdColumnsOriginalOrder:k.map(function(ee){return ee[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(ee,he){var be=V[ee];V[ee]=(be||0)+1;var ve=ee+"__"+V[ee];return{key:ve,label:ee,specIndex:he,xIndex:W[he],xScale:u,x:void 0,calcdata:void 0,columnWidth:F[he]}})};return G.columns.forEach(function(ee){ee.calcdata=G,ee.x=u(ee)}),G};function n(b){if(i(b)){for(var x=0,_=0;_=x||I===b.length-1)&&(_[f]=w,w.key=E++,w.firstRowIndex=D,w.lastRowIndex=I,w=m(),f+=k,D=I+1,k=0);return _}function m(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}),rte=ze(te=>{var Y=nn().extendFlat;te.splitToPanels=function(y){var z=[0,0],P=Y({},y,{key:"header",type:"header",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!0,values:y.calcdata.headerCells.values[y.specIndex],rowBlocks:y.calcdata.headerRowBlocks,calcdata:Y({},y.calcdata,{cells:y.calcdata.headerCells})}),i=Y({},y,{key:"cells1",type:"cells",page:0,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks}),n=Y({},y,{key:"cells2",type:"cells",page:1,prevPages:z,currentRepaint:[null,null],dragHandle:!1,values:y.calcdata.cells.values[y.specIndex],rowBlocks:y.calcdata.rowBlocks});return[i,n,P]},te.splitToCells=function(y){var z=d(y);return(y.values||[]).slice(z[0],z[1]).map(function(P,i){var n=typeof P=="string"&&P.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:i+n,key:z[0]+i,column:y,calcdata:y.calcdata,page:y.page,rowBlocks:y.rowBlocks,value:P}})};function d(y){var z=y.rowBlocks[y.page],P=z?z.rows[0].rowIndex:0,i=z?P+z.rows.length:0;return[P,i]}}),Az=ze((te,Y)=>{var d=Cz(),y=ri(),z=ji(),P=z.numberFormat,i=e1(),n=Zs(),a=cc(),l=ji().raiseToTop,o=ji().strTranslate,u=ji().cancelTransition,s=tte(),h=rte(),m=Xi();Y.exports=function(me,fe){var Ce=!me._context.staticPlot,Re=me._fullLayout._paper.selectAll("."+d.cn.table).data(fe.map(function(ut){var Et=i.unwrap(ut),Gt=Et.trace;return s(me,Gt)}),i.keyFun);Re.exit().remove(),Re.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Re.attr("width",function(ut){return ut.width+ut.size.l+ut.size.r}).attr("height",function(ut){return ut.height+ut.size.t+ut.size.b}).attr("transform",function(ut){return o(ut.translateX,ut.translateY)});var Be=Re.selectAll("."+d.cn.tableControlView).data(i.repeat,i.keyFun),Ze=Be.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(Ce){var Ge="onwheel"in document?"wheel":"mousewheel";Ze.on("mousemove",function(ut){Be.filter(function(Et){return ut===Et}).call(f,me)}).on(Ge,function(ut){if(!ut.scrollbarState.wheeling){ut.scrollbarState.wheeling=!0;var Et=ut.scrollY+y.event.deltaY,Gt=he(me,Be,null,Et)(ut);Gt||(y.event.stopPropagation(),y.event.preventDefault()),ut.scrollbarState.wheeling=!1}}).call(f,me,!0)}Be.attr("transform",function(ut){return o(ut.size.l,ut.size.t)});var tt=Be.selectAll("."+d.cn.scrollBackground).data(i.repeat,i.keyFun);tt.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),tt.attr("width",function(ut){return ut.width}).attr("height",function(ut){return ut.height}),Be.each(function(ut){n.setClipUrl(y.select(this),x(me,ut),me)});var _t=Be.selectAll("."+d.cn.yColumn).data(function(ut){return ut.columns},i.keyFun);_t.enter().append("g").classed(d.cn.yColumn,!0),_t.exit().remove(),_t.attr("transform",function(ut){return o(ut.x,0)}),Ce&&_t.call(y.behavior.drag().origin(function(ut){var Et=y.select(this);return W(Et,ut,-d.uplift),l(this),ut.calcdata.columnDragInProgress=!0,f(Be.filter(function(Gt){return ut.calcdata.key===Gt.key}),me),ut}).on("drag",function(ut){var Et=y.select(this),Gt=function(mr){return(ut===mr?y.event.x:mr.x)+mr.columnWidth/2};ut.x=Math.max(-d.overdrag,Math.min(ut.calcdata.width+d.overdrag-ut.columnWidth,y.event.x));var Qt=A(_t).filter(function(mr){return mr.calcdata.key===ut.calcdata.key}),vr=Qt.sort(function(mr,Yr){return Gt(mr)-Gt(Yr)});vr.forEach(function(mr,Yr){mr.xIndex=Yr,mr.x=ut===mr?mr.x:mr.xScale(mr)}),_t.filter(function(mr){return ut!==mr}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(mr){return o(mr.x,0)}),Et.call(u).attr("transform",o(ut.x,-d.uplift))}).on("dragend",function(ut){var Et=y.select(this),Gt=ut.calcdata;ut.x=ut.xScale(ut),ut.calcdata.columnDragInProgress=!1,W(Et,ut,0),U(me,Gt,Gt.columns.map(function(Qt){return Qt.xIndex}))})),_t.each(function(ut){n.setClipUrl(y.select(this),_(me,ut),me)});var mt=_t.selectAll("."+d.cn.columnBlock).data(h.splitToPanels,i.keyFun);mt.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(ut){return ut.key}),mt.style("cursor",function(ut){return ut.dragHandle?"ew-resize":ut.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var vt=mt.filter(H),ct=mt.filter(F);Ce&&ct.call(y.behavior.drag().origin(function(ut){return y.event.stopPropagation(),ut}).on("drag",he(me,Be,-1)).on("dragend",function(){})),k(me,Be,vt,mt),k(me,Be,ct,mt);var Ae=Be.selectAll("."+d.cn.scrollAreaClip).data(i.repeat,i.keyFun);Ae.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(ut){return x(me,ut)});var Oe=Ae.selectAll("."+d.cn.scrollAreaClipRect).data(i.repeat,i.keyFun);Oe.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),Oe.attr("width",function(ut){return ut.width+2*d.overdrag}).attr("height",function(ut){return ut.height+d.uplift});var Le=_t.selectAll("."+d.cn.columnBoundary).data(i.repeat,i.keyFun);Le.enter().append("g").classed(d.cn.columnBoundary,!0);var nt=_t.selectAll("."+d.cn.columnBoundaryClippath).data(i.repeat,i.keyFun);nt.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),nt.attr("id",function(ut){return _(me,ut)});var xt=nt.selectAll("."+d.cn.columnBoundaryRect).data(i.repeat,i.keyFun);xt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),xt.attr("width",function(ut){return ut.columnWidth+2*b(ut)}).attr("height",function(ut){return ut.calcdata.height+2*b(ut)+d.uplift}).attr("x",function(ut){return-b(ut)}).attr("y",function(ut){return-b(ut)}),ee(null,ct,Be)};function b(me){return Math.ceil(me.calcdata.maxLineWidth/2)}function x(me,fe){return"clip"+me._fullLayout._uid+"_scrollAreaBottomClip_"+fe.key}function _(me,fe){return"clip"+me._fullLayout._uid+"_columnBoundaryClippath_"+fe.calcdata.key+"_"+fe.specIndex}function A(me){return[].concat.apply([],me.map(function(fe){return fe})).map(function(fe){return fe.__data__})}function f(me,fe,Ce){function Re(mt){var vt=mt.rowBlocks;return ne(vt,vt.length-1)+(vt.length?se(vt[vt.length-1],1/0):1)}var Be=me.selectAll("."+d.cn.scrollbarKit).data(i.repeat,i.keyFun);Be.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Be.each(function(mt){var vt=mt.scrollbarState;vt.totalHeight=Re(mt),vt.scrollableAreaHeight=mt.groupHeight-q(mt),vt.currentlyVisibleHeight=Math.min(vt.totalHeight,vt.scrollableAreaHeight),vt.ratio=vt.currentlyVisibleHeight/vt.totalHeight,vt.barLength=Math.max(vt.ratio*vt.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),vt.barWiggleRoom=vt.currentlyVisibleHeight-vt.barLength,vt.wiggleRoom=Math.max(0,vt.totalHeight-vt.scrollableAreaHeight),vt.topY=vt.barWiggleRoom===0?0:mt.scrollY/vt.wiggleRoom*vt.barWiggleRoom,vt.bottomY=vt.topY+vt.barLength,vt.dragMultiplier=vt.wiggleRoom/vt.barWiggleRoom}).attr("transform",function(mt){var vt=mt.width+d.scrollbarWidth/2+d.scrollbarOffset;return o(vt,q(mt))});var Ze=Be.selectAll("."+d.cn.scrollbar).data(i.repeat,i.keyFun);Ze.enter().append("g").classed(d.cn.scrollbar,!0);var Ge=Ze.selectAll("."+d.cn.scrollbarSlider).data(i.repeat,i.keyFun);Ge.enter().append("g").classed(d.cn.scrollbarSlider,!0),Ge.attr("transform",function(mt){return o(0,mt.scrollbarState.topY||0)});var tt=Ge.selectAll("."+d.cn.scrollbarGlyph).data(i.repeat,i.keyFun);tt.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),tt.attr("y2",function(mt){return mt.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(mt){return mt.columnDragInProgress||!mt.scrollbarState.barWiggleRoom||Ce?0:.4}),tt.transition().delay(0).duration(0),tt.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var _t=Ze.selectAll("."+d.cn.scrollbarCaptureZone).data(i.repeat,i.keyFun);_t.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(mt){var vt=y.event.y,ct=this.getBoundingClientRect(),Ae=mt.scrollbarState,Oe=vt-ct.top,Le=y.scale.linear().domain([0,Ae.scrollableAreaHeight]).range([0,Ae.totalHeight]).clamp(!0);Ae.topY<=Oe&&Oe<=Ae.bottomY||he(fe,me,null,Le(Oe-Ae.barLength/2))(mt)}).call(y.behavior.drag().origin(function(mt){return y.event.stopPropagation(),mt.scrollbarState.scrollbarScrollInProgress=!0,mt}).on("drag",he(fe,me)).on("dragend",function(){})),_t.attr("y2",function(mt){return mt.scrollbarState.scrollableAreaHeight}),fe._context.staticPlot&&(tt.remove(),_t.remove())}function k(me,fe,Ce,Re){var Be=w(Ce),Ze=D(Be);p(Ze);var Ge=E(Ze);C(Ge);var tt=M(Ze),_t=I(tt);g(_t),T(_t,fe,Re,me),ge(Ze)}function w(me){var fe=me.selectAll("."+d.cn.columnCells).data(i.repeat,i.keyFun);return fe.enter().append("g").classed(d.cn.columnCells,!0),fe.exit().remove(),fe}function D(me){var fe=me.selectAll("."+d.cn.columnCell).data(h.splitToCells,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("g").classed(d.cn.columnCell,!0),fe.exit().remove(),fe}function E(me){var fe=me.selectAll("."+d.cn.cellRect).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("rect").classed(d.cn.cellRect,!0),fe}function I(me){var fe=me.selectAll("."+d.cn.cellText).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){y.event.stopPropagation()}),fe}function M(me){var fe=me.selectAll("."+d.cn.cellTextHolder).data(i.repeat,function(Ce){return Ce.keyWithinBlock});return fe.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),fe}function p(me){me.each(function(fe,Ce){var Re=fe.calcdata.cells.font,Be=fe.column.specIndex,Ze={size:V(Re.size,Be,Ce),color:V(Re.color,Be,Ce),family:V(Re.family,Be,Ce),weight:V(Re.weight,Be,Ce),style:V(Re.style,Be,Ce),variant:V(Re.variant,Be,Ce),textcase:V(Re.textcase,Be,Ce),lineposition:V(Re.lineposition,Be,Ce),shadow:V(Re.shadow,Be,Ce)};fe.rowNumber=fe.key,fe.align=V(fe.calcdata.cells.align,Be,Ce),fe.cellBorderWidth=V(fe.calcdata.cells.line.width,Be,Ce),fe.font=Ze})}function g(me){me.each(function(fe){n.font(y.select(this),fe.font)})}function C(me){me.attr("width",function(fe){return fe.column.columnWidth}).attr("stroke-width",function(fe){return fe.cellBorderWidth}).each(function(fe){var Ce=y.select(this);m.stroke(Ce,V(fe.calcdata.cells.line.color,fe.column.specIndex,fe.rowNumber)),m.fill(Ce,V(fe.calcdata.cells.fill.color,fe.column.specIndex,fe.rowNumber))})}function T(me,fe,Ce,Re){me.text(function(Be){var Ze=Be.column.specIndex,Ge=Be.rowNumber,tt=Be.value,_t=typeof tt=="string",mt=_t&&tt.match(/
/i),vt=!_t||mt;Be.mayHaveMarkup=_t&&tt.match(/[<&>]/);var ct=N(tt);Be.latex=ct;var Ae=ct?"":V(Be.calcdata.cells.prefix,Ze,Ge)||"",Oe=ct?"":V(Be.calcdata.cells.suffix,Ze,Ge)||"",Le=ct?null:V(Be.calcdata.cells.format,Ze,Ge)||null,nt=Ae+(Le?P(Le)(Be.value):Be.value)+Oe,xt;Be.wrappingNeeded=!Be.wrapped&&!vt&&!ct&&(xt=B(nt)),Be.cellHeightMayIncrease=mt||ct||Be.mayHaveMarkup||(xt===void 0?B(nt):xt),Be.needsConvertToTspans=Be.mayHaveMarkup||Be.wrappingNeeded||Be.latex;var ut;if(Be.wrappingNeeded){var Et=d.wrapSplitCharacter===" "?nt.replace(/Be&&Re.push(Ze),Be+=_t}return Re}function ee(me,fe,Ce){var Re=A(fe)[0];if(Re!==void 0){var Be=Re.rowBlocks,Ze=Re.calcdata,Ge=ne(Be,Be.length),tt=Re.calcdata.groupHeight-q(Re),_t=Ze.scrollY=Math.max(0,Math.min(Ge-tt,Ze.scrollY)),mt=G(Be,_t,tt);mt.length===1&&(mt[0]===Be.length-1?mt.unshift(mt[0]-1):mt.push(mt[0]+1)),mt[0]%2&&mt.reverse(),fe.each(function(vt,ct){vt.page=mt[ct],vt.scrollY=_t}),fe.attr("transform",function(vt){var ct=ne(vt.rowBlocks,vt.page)-vt.scrollY;return o(0,ct)}),me&&(be(me,Ce,fe,mt,Re.prevPages,Re,0),be(me,Ce,fe,mt,Re.prevPages,Re,1),f(Ce,me))}}function he(me,fe,Ce,Re){return function(Be){var Ze=Be.calcdata?Be.calcdata:Be,Ge=fe.filter(function(vt){return Ze.key===vt.key}),tt=Ce||Ze.scrollbarState.dragMultiplier,_t=Ze.scrollY;Ze.scrollY=Re===void 0?Ze.scrollY+tt*y.event.dy:Re;var mt=Ge.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(F);return ee(me,mt,Ge),Ze.scrollY===_t}}function be(me,fe,Ce,Re,Be,Ze,Ge){var tt=Re[Ge]!==Be[Ge];tt&&(clearTimeout(Ze.currentRepaint[Ge]),Ze.currentRepaint[Ge]=setTimeout(function(){var _t=Ce.filter(function(mt,vt){return vt===Ge&&Re[vt]!==Be[vt]});k(me,fe,_t,Ce),Be[Ge]=Re[Ge]}))}function ve(me,fe,Ce,Re){return function(){var Be=y.select(fe.parentNode);Be.each(function(Ze){var Ge=Ze.fragments;Be.selectAll("tspan.line").each(function(Le,nt){Ge[nt].width=this.getComputedTextLength()});var tt=Ge[Ge.length-1].width,_t=Ge.slice(0,-1),mt=[],vt,ct,Ae=0,Oe=Ze.column.columnWidth-2*d.cellPad;for(Ze.value="";_t.length;)vt=_t.shift(),ct=vt.width+tt,Ae+ct>Oe&&(Ze.value+=mt.join(d.wrapSpacer)+d.lineBreaker,mt=[],Ae=0),mt.push(vt.text),Ae+=ct;Ae&&(Ze.value+=mt.join(d.wrapSpacer)),Ze.wrapped=!0}),Be.selectAll("tspan.line").remove(),T(Be.select("."+d.cn.cellText),Ce,me,Re),y.select(fe.parentNode.parentNode).call(ge)}}function ce(me,fe,Ce,Re,Be){return function(){if(!Be.settledY){var Ze=y.select(fe.parentNode),Ge=oe(Be),tt=Be.key-Ge.firstRowIndex,_t=Ge.rows[tt].rowHeight,mt=Be.cellHeightMayIncrease?fe.parentNode.getBoundingClientRect().height+2*d.cellPad:_t,vt=Math.max(mt,_t),ct=vt-Ge.rows[tt].rowHeight;ct&&(Ge.rows[tt].rowHeight=vt,me.selectAll("."+d.cn.columnCell).call(ge),ee(null,me.filter(F),0),f(Ce,Re,!0)),Ze.attr("transform",function(){var Ae=this,Oe=Ae.parentNode,Le=Oe.getBoundingClientRect(),nt=y.select(Ae.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),xt=Ae.transform.baseVal.consolidate(),ut=nt.top-Le.top+(xt?xt.matrix.f:d.cellPad);return o(re(Be,y.select(Ae.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),ut)}),Be.settledY=!0}}}function re(me,fe){switch(me.align){case"left":return d.cellPad;case"right":return me.column.columnWidth-(fe||0)-d.cellPad;case"center":return(me.column.columnWidth-(fe||0))/2;default:return d.cellPad}}function ge(me){me.attr("transform",function(fe){var Ce=fe.rowBlocks[0].auxiliaryBlocks.reduce(function(Ge,tt){return Ge+se(tt,1/0)},0),Re=oe(fe),Be=se(Re,fe.key),Ze=Be+Ce;return o(0,Ze)}).selectAll("."+d.cn.cellRect).attr("height",function(fe){return J(oe(fe),fe.key).rowHeight})}function ne(me,fe){for(var Ce=0,Re=fe-1;Re>=0;Re--)Ce+=_e(me[Re]);return Ce}function se(me,fe){for(var Ce=0,Re=0;Re{var Y=Ed().getModuleCalcData,d=Az(),y="table";te.name=y,te.plot=function(z){var P=Y(z.calcdata,y)[0];P.length&&d(z,P)},te.clean=function(z,P,i,n){var a=n._has&&n._has(y),l=P._has&&P._has(y);a&&!l&&n._paperdiv.selectAll(".table").remove()}}),nte=ze((te,Y)=>{Y.exports={attributes:Sz(),supplyDefaults:Qee(),calc:ete(),plot:Az(),moduleType:"trace",name:"table",basePlotModule:ite(),categories:["noOpacity"],meta:{}}}),ate=ze((te,Y)=>{Y.exports=nte()}),ote=ze((te,Y)=>{var d=On(),y=Mi(),z=Gd(),P=Sh().descriptionWithDates,i=oh().overrideAll,n=qd().dash,a=nn().extendFlat;Y.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:d({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:z.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:a({},z.labelalias,{editType:"calc"}),tickfont:d({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:P("tick label")},tickformatstops:i(z.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:y.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:a({},n,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:a({},n,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:y.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}),yA=ze((te,Y)=>{var d=On(),y=ote(),z=Mi(),P=d({editType:"calc"}),i=ff().zorder;P.family.dflt='"Open Sans", verdana, arial, sans-serif',P.size.dflt=12,P.color.dflt=z.defaultLine,Y.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:y,baxis:y,font:P,color:{valType:"color",dflt:z.defaultLine,editType:"plot"},zorder:i}}),ste=ze((te,Y)=>{var d=ji().isArray1D;Y.exports=function(y,z,P){var i=P("x"),n=i&&i.length,a=P("y"),l=a&&a.length;if(!n&&!l)return!1;if(z._cheater=!i,(!n||d(i))&&(!l||d(a))){var o=n?i.length:1/0;l&&(o=Math.min(o,a.length)),z.a&&z.a.length&&(o=Math.min(o,z.a.length)),z.b&&z.b.length&&(o=Math.min(o,z.b.length)),z._length=o}else z._length=null;return!0}}),lte=ze((te,Y)=>{var d=yA(),y=Xi().addOpacity,z=as(),P=ji(),i=Nv(),n=G0(),a=Tg(),l=Qg(),o=Z0(),u=J1();Y.exports=function(h,m,b){var x=b.letter,_=b.font||{},A=d[x+"axis"];function f(q,G){return P.coerce(h,m,A,q,G)}function k(q,G){return P.coerce2(h,m,A,q,G)}b.name&&(m._name=b.name,m._id=b.name),f("autotypenumbers",b.autotypenumbersDflt);var w=f("type");if(w==="-"&&(b.data&&s(m,b.data),m.type==="-"?m.type="linear":w=h.type=m.type),f("smoothing"),f("cheatertype"),f("showticklabels"),f("labelprefix",x+" = "),f("labelsuffix"),f("showtickprefix"),f("showticksuffix"),f("separatethousands"),f("tickformat"),f("exponentformat"),f("minexponent"),f("showexponent"),f("categoryorder"),f("tickmode"),f("tickvals"),f("ticktext"),f("tick0"),f("dtick"),m.tickmode==="array"&&(f("arraytick0"),f("arraydtick")),f("labelpadding"),m._hovertitle=x,w==="date"){var D=z.getComponentMethod("calendars","handleDefaults");D(h,m,"calendar",b.calendar)}o(m,b.fullLayout),m.c2p=P.identity;var E=f("color",b.dfltColor),I=E===h.color?E:_.color,M=f("title.text");M&&(P.coerceFont(f,"title.font",_,{overrideDflt:{size:P.bigFont(_.size),color:I}}),f("title.offset")),f("tickangle");var p=f("autorange",!m.isValidRange(h.range));p&&f("rangemode"),f("range"),m.cleanRange(),f("fixedrange"),i(h,m,f,w),a(h,m,f,w,b),n(h,m,f,w,b),l(h,m,f,{data:b.data,dataAttr:x});var g=k("gridcolor",y(E,.3)),C=k("gridwidth"),T=k("griddash"),N=f("showgrid");N||(delete m.gridcolor,delete m.gridwidth,delete m.griddash);var B=k("startlinecolor",E),U=k("startlinewidth",C),V=f("startline",m.showgrid||!!B||!!U);V||(delete m.startlinecolor,delete m.startlinewidth);var W=k("endlinecolor",E),F=k("endlinewidth",C),H=f("endline",m.showgrid||!!W||!!F);return H||(delete m.endlinecolor,delete m.endlinewidth),N?(f("minorgridcount"),f("minorgridwidth",C),f("minorgriddash",T),f("minorgridcolor",y(g,.06)),m.minorgridcount||(delete m.minorgridwidth,delete m.minorgriddash,delete m.minorgridcolor)):(delete m.gridcolor,delete m.gridwidth,delete m.griddash),m.showticklabels==="none"&&(delete m.tickfont,delete m.tickangle,delete m.showexponent,delete m.exponentformat,delete m.minexponent,delete m.tickformat,delete m.showticksuffix,delete m.showtickprefix),m.showticksuffix||delete m.ticksuffix,m.showtickprefix||delete m.tickprefix,f("tickmode"),m};function s(h,m){if(h.type==="-"){var b=h._id,x=b.charAt(0),_=x+"calendar",A=h[_];h.type=u(m,A,{autotypenumbers:h.autotypenumbers})}}}),ute=ze((te,Y)=>{var d=lte(),y=ku();Y.exports=function(P,i,n,a,l){var o=a("a");o||(a("da"),a("a0"));var u=a("b");u||(a("db"),a("b0")),z(P,i,n,l)};function z(P,i,n,a){var l=["aaxis","baxis"];l.forEach(function(o){var u=o.charAt(0),s=P[o]||{},h=y.newContainer(i,o),m={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:u+"axis",letter:u,font:i.font,name:o,data:P[u],calendar:i.calendar,dfltColor:a,bgColor:n.paper_bgcolor,autotypenumbersDflt:n.autotypenumbers,fullLayout:n};d(s,h,m),h._categories=h._categories||[],!P[o]&&s.type!=="-"&&(P[o]={type:s.type})})}}),cte=ze((te,Y)=>{var d=ji(),y=ste(),z=ute(),P=yA(),i=Mi();Y.exports=function(n,a,l,o){function u(m,b){return d.coerce(n,a,P,m,b)}a._clipPathId="clip"+a.uid+"carpet";var s=u("color",i.defaultLine);if(d.coerceFont(u,"font",o.font),u("carpet"),z(n,a,o,u,s),!a.a||!a.b){a.visible=!1;return}a.a.length<3&&(a.aaxis.smoothing=0),a.b.length<3&&(a.baxis.smoothing=0);var h=y(n,a,u);h||(a.visible=!1),a._cheater&&u("cheaterslope"),u("zorder")}}),Mz=ze((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P){var i;for(d(y)?y.length>z.length&&(y=y.slice(0,z.length)):y=[],i=0;i{Y.exports=function(d,y,z){if(d.length===0)return"";var P,i=[],n=z?3:1;for(P=0;P{Y.exports=function(d,y,z,P,i,n){var a=i[0]*d.dpdx(y),l=i[1]*d.dpdy(z),o=1,u=1;if(n){var s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(n[0]*n[0]+n[1]*n[1]),m=(i[0]*n[0]+i[1]*n[1])/s/h;u=Math.max(0,m)}var b=Math.atan2(l,a)*180/Math.PI;return b<-90?(b+=180,o=-o):b>90&&(b-=180,o=-o),{angle:b,flip:o,p:d.c2p(P,y,z),offsetMultplier:u}}}),fte=ze((te,Y)=>{var d=ri(),y=Zs(),z=Mz(),P=Ez(),i=hte(),n=cc(),a=ji(),l=a.strRotate,o=a.strTranslate,u=Rf();Y.exports=function(f,k,w,D){var E=f._context.staticPlot,I=k.xaxis,M=k.yaxis,p=f._fullLayout,g=p._clips;a.makeTraceGroups(D,w,"trace").each(function(C){var T=d.select(this),N=C[0],B=N.trace,U=B.aaxis,V=B.baxis,W=a.ensureSingle(T,"g","minorlayer"),F=a.ensureSingle(T,"g","majorlayer"),H=a.ensureSingle(T,"g","boundarylayer"),q=a.ensureSingle(T,"g","labellayer");T.style("opacity",B.opacity),h(I,M,F,U,"a",U._gridlines,!0),h(I,M,F,V,"b",V._gridlines,!0),h(I,M,W,U,"a",U._minorgridlines,!0),h(I,M,W,V,"b",V._minorgridlines,!0),h(I,M,H,U,"a-boundary",U._boundarylines,E),h(I,M,H,V,"b-boundary",V._boundarylines,E);var G=m(f,I,M,B,N,q,U._labels,"a-label"),ee=m(f,I,M,B,N,q,V._labels,"b-label");b(f,q,B,N,I,M,G,ee),s(B,N,g,I,M)})};function s(f,k,w,D,E){var I,M,p,g,C=w.select("#"+f._clipPathId);C.size()||(C=w.append("clipPath").classed("carpetclip",!0));var T=a.ensureSingle(C,"path","carpetboundary"),N=k.clipsegments,B=[];for(g=0;g0?"start":"end","data-notex":1}).call(y.font,N.font).text(N.text).call(n.convertToTspans,f),H=y.bBox(this);F.attr("transform",o(U.p[0],U.p[1])+l(U.angle)+o(N.axis.labelpadding*W,H.height*.3)),C=Math.max(C,H.width+N.axis.labelpadding)}),g.exit().remove(),T.maxExtent=C,T}function b(f,k,w,D,E,I,M,p){var g,C,T,N,B=a.aggNums(Math.min,null,w.a),U=a.aggNums(Math.max,null,w.a),V=a.aggNums(Math.min,null,w.b),W=a.aggNums(Math.max,null,w.b);g=.5*(B+U),C=V,T=w.ab2xy(g,C,!0),N=w.dxyda_rough(g,C),M.angle===void 0&&a.extendFlat(M,i(w,E,I,T,w.dxydb_rough(g,C))),A(f,k,w,D,T,N,w.aaxis,E,I,M,"a-title"),g=B,C=.5*(V+W),T=w.ab2xy(g,C,!0),N=w.dxydb_rough(g,C),p.angle===void 0&&a.extendFlat(p,i(w,E,I,T,w.dxyda_rough(g,C))),A(f,k,w,D,T,N,w.baxis,E,I,p,"b-title")}var x=u.LINE_SPACING,_=(1-u.MID_SHIFT)/x+1;function A(f,k,w,D,E,I,M,p,g,C,T){var N=[];M.title.text&&N.push(M.title.text);var B=k.selectAll("text."+T).data(N),U=C.maxExtent;B.enter().append("text").classed(T,!0),B.each(function(){var V=i(w,p,g,E,I);["start","both"].indexOf(M.showticklabels)===-1&&(U=0);var W=M.title.font.size;U+=W+M.title.offset;var F=C.angle+(C.flip<0?180:0),H=(F-V.angle+450)%360,q=H>90&&H<270,G=d.select(this);G.text(M.title.text).call(n.convertToTspans,f),q&&(U=(-n.lineCount(G)+_)*x*W-U),G.attr("transform",o(V.p[0],V.p[1])+l(V.angle)+o(0,U)).attr("text-anchor","middle").call(y.font,M.title.font)}),B.exit().remove()}}),dte=ze((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P){var i,n,a,l,o,u,s=[],h=d(y)?y.length:y,m=d(z)?z.length:z,b=d(y)?y:null,x=d(z)?z:null;b&&(a=(b.length-1)/(b[b.length-1]-b[0])/(h-1)),x&&(l=(x.length-1)/(x[x.length-1]-x[0])/(m-1));var _,A=1/0,f=-1/0;for(n=0;n{var d=ji().isArrayOrTypedArray;Y.exports=function(z){return y(z,0)};function y(z,P){if(!d(z)||P>=10)return null;for(var i=1/0,n=-1/0,a=z.length,l=0;l{var d=Os(),y=nn().extendFlat;Y.exports=function(z,P,i){var n,a,l,o,u,s,h,m,b,x,_,A,f,k,w=z["_"+P],D=z[P+"axis"],E=D._gridlines=[],I=D._minorgridlines=[],M=D._boundarylines=[],p=z["_"+i],g=z[i+"axis"];D.tickmode==="array"&&(D.tickvals=w.slice());var C=z._xctrl,T=z._yctrl,N=C[0].length,B=C.length,U=z._a.length,V=z._b.length;d.prepTicks(D),D.tickmode==="array"&&delete D.tickvals;var W=D.smoothing?3:1;function F(q){var G,ee,he,be,ve,ce,re,ge,ne,se,_e,oe,J=[],me=[],fe={};if(P==="b")for(ee=z.b2j(q),he=Math.floor(Math.max(0,Math.min(V-2,ee))),be=ee-he,fe.length=V,fe.crossLength=U,fe.xy=function(Ce){return z.evalxy([],Ce,ee)},fe.dxy=function(Ce,Re){return z.dxydi([],Ce,he,Re,be)},G=0;G0&&(ne=z.dxydi([],G-1,he,0,be),J.push(ve[0]+ne[0]/3),me.push(ve[1]+ne[1]/3),se=z.dxydi([],G-1,he,1,be),J.push(ge[0]-se[0]/3),me.push(ge[1]-se[1]/3)),J.push(ge[0]),me.push(ge[1]),ve=ge;else for(G=z.a2i(q),ce=Math.floor(Math.max(0,Math.min(U-2,G))),re=G-ce,fe.length=U,fe.crossLength=V,fe.xy=function(Ce){return z.evalxy([],G,Ce)},fe.dxy=function(Ce,Re){return z.dxydj([],ce,Ce,re,Re)},ee=0;ee0&&(_e=z.dxydj([],ce,ee-1,re,0),J.push(ve[0]+_e[0]/3),me.push(ve[1]+_e[1]/3),oe=z.dxydj([],ce,ee-1,re,1),J.push(ge[0]-oe[0]/3),me.push(ge[1]-oe[1]/3)),J.push(ge[0]),me.push(ge[1]),ve=ge;return fe.axisLetter=P,fe.axis=D,fe.crossAxis=g,fe.value=q,fe.constvar=i,fe.index=m,fe.x=J,fe.y=me,fe.smoothing=g.smoothing,fe}function H(q){var G,ee,he,be,ve,ce=[],re=[],ge={};if(ge.length=w.length,ge.crossLength=p.length,P==="b")for(he=Math.max(0,Math.min(V-2,q)),ve=Math.min(1,Math.max(0,q-he)),ge.xy=function(ne){return z.evalxy([],ne,q)},ge.dxy=function(ne,se){return z.dxydi([],ne,he,se,ve)},G=0;Gw.length-1)&&E.push(y(H(a),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s;mw.length-1)&&!(_<0||_>w.length-1))for(A=w[l],f=w[_],n=0;nw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash})));D.startline&&M.push(y(H(0),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(H(w.length-1),{color:D.endlinecolor,width:D.endlinewidth}))}else{for(o=5e-15,u=[Math.floor((w[w.length-1]-D.tick0)/D.dtick*(1+o)),Math.ceil((w[0]-D.tick0)/D.dtick/(1+o))].sort(function(q,G){return q-G}),s=u[0],h=u[1],m=s;m<=h;m++)b=D.tick0+D.dtick*m,E.push(y(F(b),{color:D.gridcolor,width:D.gridwidth,dash:D.griddash}));for(m=s-1;mw[w.length-1])&&I.push(y(F(x),{color:D.minorgridcolor,width:D.minorgridwidth,dash:D.minorgriddash}));D.startline&&M.push(y(F(w[0]),{color:D.startlinecolor,width:D.startlinewidth})),D.endline&&M.push(y(F(w[w.length-1]),{color:D.endlinecolor,width:D.endlinewidth}))}}}),gte=ze((te,Y)=>{var d=Os(),y=nn().extendFlat;Y.exports=function(z,P){var i,n,a,l,o,u=P._labels=[],s=P._gridlines;for(i=0;i{Y.exports=function(d,y,z,P){var i,n,a,l=[],o=!!z.smoothing,u=!!P.smoothing,s=d[0].length-1,h=d.length-1;for(i=0,n=[],a=[];i<=s;i++)n[i]=d[0][i],a[i]=y[0][i];for(l.push({x:n,y:a,bicubic:o}),i=0,n=[],a=[];i<=h;i++)n[i]=d[i][s],a[i]=y[i][s];for(l.push({x:n,y:a,bicubic:u}),i=s,n=[],a=[];i>=0;i--)n[s-i]=d[h][i],a[s-i]=y[h][i];for(l.push({x:n,y:a,bicubic:o}),i=h,n=[],a=[];i>=0;i--)n[h-i]=d[i][0],a[h-i]=y[i][0];return l.push({x:n,y:a,bicubic:u}),l}}),yte=ze((te,Y)=>{var d=ji();Y.exports=function(y,z,P){var i,n,a,l=[],o=[],u=y[0].length,s=y.length;function h(ee,he){var be=0,ve,ce=0;return ee>0&&(ve=y[he][ee-1])!==void 0&&(ce++,be+=ve),ee0&&(ve=y[he-1][ee])!==void 0&&(ce++,be+=ve),he0&&n0&&ip);return d.log("Smoother converged to",g,"after",T,"iterations"),y}}),_te=ze((te,Y)=>{Y.exports={RELATIVE_CULL_TOLERANCE:1e-6}}),xte=ze((te,Y)=>{var d=.5;Y.exports=function(y,z,P,i){var n=y[0]-z[0],a=y[1]-z[1],l=P[0]-z[0],o=P[1]-z[1],u=Math.pow(n*n+a*a,d/2),s=Math.pow(l*l+o*o,d/2),h=(s*s*n-u*u*l)*i,m=(s*s*a-u*u*o)*i,b=s*(u+s)*3,x=u*(u+s)*3;return[[z[0]+(b&&h/b),z[1]+(b&&m/b)],[z[0]-(x&&h/x),z[1]-(x&&m/x)]]}}),bte=ze((te,Y)=>{var d=xte(),y=ji().ensureArray;function z(P,i,n){var a=-.5*n[0]+1.5*i[0],l=-.5*n[1]+1.5*i[1];return[(2*a+P[0])/3,(2*l+P[1])/3]}Y.exports=function(P,i,n,a,l,o){var u,s,h,m,b,x,_,A,f,k,w=n[0].length,D=n.length,E=l?3*w-2:w,I=o?3*D-2:D;for(P=y(P,I),i=y(i,I),h=0;h{Y.exports=function(d,y,z,P,i){var n=y-2,a=z-2;return P&&i?function(l,o,u){l||(l=[]);var s,h,m,b,x,_,A=Math.max(0,Math.min(Math.floor(o),n)),f=Math.max(0,Math.min(Math.floor(u),a)),k=Math.max(0,Math.min(1,o-A)),w=Math.max(0,Math.min(1,u-f));A*=3,f*=3;var D=k*k,E=D*k,I=1-k,M=I*I,p=M*I,g=w*w,C=g*w,T=1-w,N=T*T,B=N*T;for(_=0;_{Y.exports=function(d,y,z){return y&&z?function(P,i,n,a,l){P||(P=[]);var o,u,s,h,m,b;i*=3,n*=3;var x=a*a,_=1-a,A=_*_,f=_*a*2,k=-3*A,w=3*(A-f),D=3*(f-x),E=3*x,I=l*l,M=I*l,p=1-l,g=p*p,C=g*p;for(b=0;b{Y.exports=function(d,y,z){return y&&z?function(P,i,n,a,l){P||(P=[]);var o,u,s,h,m,b;i*=3,n*=3;var x=a*a,_=x*a,A=1-a,f=A*A,k=f*A,w=l*l,D=1-l,E=D*D,I=D*l*2,M=-3*E,p=3*(E-I),g=3*(I-w),C=3*w;for(b=0;b{var d=_te(),y=nw().findBin,z=bte(),P=wte(),i=kte(),n=Tte();Y.exports=function(a){var l=a._a,o=a._b,u=l.length,s=o.length,h=a.aaxis,m=a.baxis,b=l[0],x=l[u-1],_=o[0],A=o[s-1],f=l[l.length-1]-l[0],k=o[o.length-1]-o[0],w=f*d.RELATIVE_CULL_TOLERANCE,D=k*d.RELATIVE_CULL_TOLERANCE;b-=w,x+=w,_-=D,A+=D,a.isVisible=function(E,I){return E>b&&E_&&Ix||I<_||I>A},a.setScale=function(){var E=a._x,I=a._y,M=z(a._xctrl,a._yctrl,E,I,h.smoothing,m.smoothing);a._xctrl=M[0],a._yctrl=M[1],a.evalxy=P([a._xctrl,a._yctrl],u,s,h.smoothing,m.smoothing),a.dxydi=i([a._xctrl,a._yctrl],h.smoothing,m.smoothing),a.dxydj=n([a._xctrl,a._yctrl],h.smoothing,m.smoothing)},a.i2a=function(E){var I=Math.max(0,Math.floor(E[0]),u-2),M=E[0]-I;return(1-M)*l[I]+M*l[I+1]},a.j2b=function(E){var I=Math.max(0,Math.floor(E[1]),u-2),M=E[1]-I;return(1-M)*o[I]+M*o[I+1]},a.ij2ab=function(E){return[a.i2a(E[0]),a.j2b(E[1])]},a.a2i=function(E){var I=Math.max(0,Math.min(y(E,l),u-2)),M=l[I],p=l[I+1];return Math.max(0,Math.min(u-1,I+(E-M)/(p-M)))},a.b2j=function(E){var I=Math.max(0,Math.min(y(E,o),s-2)),M=o[I],p=o[I+1];return Math.max(0,Math.min(s-1,I+(E-M)/(p-M)))},a.ab2ij=function(E){return[a.a2i(E[0]),a.b2j(E[1])]},a.i2c=function(E,I){return a.evalxy([],E,I)},a.ab2xy=function(E,I,M){if(!M&&(El[u-1]|Io[s-1]))return[!1,!1];var p=a.a2i(E),g=a.b2j(I),C=a.evalxy([],p,g);if(M){var T=0,N=0,B=[],U,V,W,F;El[u-1]?(U=u-2,V=1,T=(E-l[u-1])/(l[u-1]-l[u-2])):(U=Math.max(0,Math.min(u-2,Math.floor(p))),V=p-U),Io[s-1]?(W=s-2,F=1,N=(I-o[s-1])/(o[s-1]-o[s-2])):(W=Math.max(0,Math.min(s-2,Math.floor(g))),F=g-W),T&&(a.dxydi(B,U,W,V,F),C[0]+=B[0]*T,C[1]+=B[1]*T),N&&(a.dxydj(B,U,W,V,F),C[0]+=B[0]*N,C[1]+=B[1]*N)}return C},a.c2p=function(E,I,M){return[I.c2p(E[0]),M.c2p(E[1])]},a.p2x=function(E,I,M){return[I.p2c(E[0]),M.p2c(E[1])]},a.dadi=function(E){var I=Math.max(0,Math.min(l.length-2,E));return l[I+1]-l[I]},a.dbdj=function(E){var I=Math.max(0,Math.min(o.length-2,E));return o[I+1]-o[I]},a.dxyda=function(E,I,M,p){var g=a.dxydi(null,E,I,M,p),C=a.dadi(E,M);return[g[0]/C,g[1]/C]},a.dxydb=function(E,I,M,p){var g=a.dxydj(null,E,I,M,p),C=a.dbdj(I,p);return[g[0]/C,g[1]/C]},a.dxyda_rough=function(E,I,M){var p=f*(M||.1),g=a.ab2xy(E+p,I,!0),C=a.ab2xy(E-p,I,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dxydb_rough=function(E,I,M){var p=k*(M||.1),g=a.ab2xy(E,I+p,!0),C=a.ab2xy(E,I-p,!0);return[(g[0]-C[0])*.5/p,(g[1]-C[1])*.5/p]},a.dpdx=function(E){return E._m},a.dpdy=function(E){return E._m}}}),Cte=ze((te,Y)=>{var d=Os(),y=ji().isArray1D,z=dte(),P=pte(),i=mte(),n=gte(),a=vte(),l=BS(),o=yte(),u=OS(),s=Ste();Y.exports=function(h,m){var b=d.getFromId(h,m.xaxis),x=d.getFromId(h,m.yaxis),_=m.aaxis,A=m.baxis,f=m.x,k=m.y,w=[];f&&y(f)&&w.push("x"),k&&y(k)&&w.push("y"),w.length&&u(m,_,A,"a","b",w);var D=m._a=m._a||m.a,E=m._b=m._b||m.b;f=m._x||m.x,k=m._y||m.y;var I={};if(m._cheater){var M=_.cheatertype==="index"?D.length:D,p=A.cheatertype==="index"?E.length:E;f=z(M,p,m.cheaterslope)}m._x=f=l(f),m._y=k=l(k),o(f,D,E),o(k,D,E),s(m),m.setScale();var g=P(f),C=P(k),T=.5*(g[1]-g[0]),N=.5*(g[1]+g[0]),B=.5*(C[1]-C[0]),U=.5*(C[1]+C[0]),V=1.3;return g=[N-T*V,N+T*V],C=[U-B*V,U+B*V],m._extremes[b._id]=d.findExtremes(b,g,{padded:!0}),m._extremes[x._id]=d.findExtremes(x,C,{padded:!0}),i(m,"a","b"),i(m,"b","a"),n(m,_),n(m,A),I.clipsegments=a(m._xctrl,m._yctrl,_,A),I.x=f,I.y=k,I.a=D,I.b=E,[I]}}),Ate=ze((te,Y)=>{Y.exports={attributes:yA(),supplyDefaults:cte(),plot:fte(),calc:Cte(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ff(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}),Mte=ze((te,Y)=>{Y.exports=Ate()}),Lz=ze((te,Y)=>{var d=Lm(),y=ff(),z=xa(),{hovertemplateAttrs:P,texttemplateAttrs:i,templatefallbackAttrs:n}=rc(),a=Oc(),l=nn().extendFlat,o=y.marker,u=y.line,s=o.line;Y.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},y.mode,{dflt:"markers"}),text:l({},y.text,{}),texttemplate:i({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:n({editType:"plot"}),hovertext:l({},y.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:y.connectgaps,fill:l({},y.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:l({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:l({width:s.width,editType:"calc"},a("marker.line")),gradient:o.gradient,editType:"calc"},a("marker")),textfont:y.textfont,textposition:y.textposition,selected:y.selected,unselected:y.unselected,hoverinfo:l({},z.hoverinfo,{flags:["a","b","text","name"]}),hoveron:y.hoveron,hovertemplate:P(),hovertemplatefallback:n(),zorder:y.zorder}}),Ete=ze((te,Y)=>{var d=ji(),y=Mg(),z=Bc(),P=X0(),i=Pm(),n=ny(),a=mm(),l=Im(),o=Lz();Y.exports=function(u,s,h,m){function b(D,E){return d.coerce(u,s,o,D,E)}b("carpet"),s.xaxis="x",s.yaxis="y";var x=b("a"),_=b("b"),A=Math.min(x.length,_.length);if(!A){s.visible=!1;return}s._length=A,b("text"),b("texttemplate"),b("texttemplatefallback"),b("hovertext");var f=A{Y.exports=function(d,y){var z={},P=y._carpet,i=P.ab2ij([d.a,d.b]),n=Math.floor(i[0]),a=i[0]-n,l=Math.floor(i[1]),o=i[1]-l,u=P.evalxy([],n,l,a,o);return z.yLabel=u[1].toFixed(3),z}}),_A=ze((te,Y)=>{Y.exports=function(d,y){for(var z=d._fullData.length,P,i=0;i{var d=Sr(),y=zm(),z=de(),P=$e(),i=yt().calcMarkerSize,n=_A();Y.exports=function(a,l){var o=l._carpetTrace=n(a,l);if(!(!o||!o.visible||o.visible==="legendonly")){var u;l.xaxis=o.xaxis,l.yaxis=o.yaxis;var s=l._length,h=new Array(s),m,b,x=!1;for(u=0;u{var d=uo(),y=Os(),z=Zs();Y.exports=function(P,i,n,a){var l,o,u,s=n[0][0].carpet,h=y.getFromId(P,s.xaxis||"x"),m=y.getFromId(P,s.yaxis||"y"),b={xaxis:h,yaxis:m,plot:i.plot};for(l=0;l{var d=Kd(),y=ji().fillText;Y.exports=function(z,P,i,n){var a=d(z,P,i,n);if(!a||a[0].index===!1)return;var l=a[0];if(l.index===void 0){var o=1-l.y0/z.ya._length,u=z.xa._length,s=u*o/2,h=u-s;return l.x0=Math.max(Math.min(l.x0,h),s),l.x1=Math.max(Math.min(l.x1,h),s),a}var m=l.cd[l.index];l.a=m.a,l.b=m.b,l.xLabelVal=void 0,l.yLabelVal=void 0;var b=l.trace,x=b._carpet,_=b._module.formatLabels(m,b);l.yLabel=_.yLabel,delete l.text;var A=[];function f(D,E){var I;D.labelprefix&&D.labelprefix.length>0?I=D.labelprefix.replace(/ = $/,""):I=D._hovertitle,A.push(I+": "+E.toFixed(3)+D.labelsuffix)}if(!b.hovertemplate){var k=m.hi||b.hoverinfo,w=k.split("+");w.indexOf("all")!==-1&&(w=["a","b","text"]),w.indexOf("a")!==-1&&f(x.aaxis,m.a),w.indexOf("b")!==-1&&f(x.baxis,m.b),A.push("y: "+l.yLabel),w.indexOf("text")!==-1&&y(m,b,A),l.extraText=A.join("
")}return a}}),zte=ze((te,Y)=>{Y.exports=function(d,y,z,P,i){var n=P[i];return d.a=n.a,d.b=n.b,d.y=n.y,d}}),Ote=ze((te,Y)=>{Y.exports={attributes:Lz(),supplyDefaults:Ete(),colorbar:Mo(),formatLabels:Lte(),calc:Pte(),plot:Ite(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:Dte(),selectPoints:ed(),eventData:zte(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ff(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}),Bte=ze((te,Y)=>{Y.exports=Ote()}),Pz=ze((te,Y)=>{var d=Pw(),y=Y4(),z=Oc(),P=nn().extendFlat,i=y.contours;Y.exports=P({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:y.fillcolor,autocontour:y.autocontour,ncontours:y.ncontours,contours:{type:i.type,start:i.start,end:i.end,size:i.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:i.showlines,showlabels:i.showlabels,labelfont:i.labelfont,labelformat:i.labelformat,operation:i.operation,value:i.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:y.line.color,width:y.line.width,dash:y.line.dash,smoothing:y.line.smoothing,editType:"plot"},zorder:y.zorder},z("",{cLetter:"z",autoColorDflt:!1}))}),Iz=ze((te,Y)=>{var d=ji(),y=zS(),z=Pz(),P=iP(),i=ZS(),n=KS();Y.exports=function(a,l,o,u){function s(x,_){return d.coerce(a,l,z,x,_)}function h(x){return d.coerce2(a,l,z,x)}if(s("carpet"),a.a&&a.b){var m=y(a,l,s,u,"a","b");if(!m){l.visible=!1;return}s("text");var b=s("contours.type")==="constraint";b?P(a,l,s,u,o,{hasHover:!1}):(i(a,l,s,h),n(a,l,s,u,{hasHover:!1}))}else l._defaultColor=o,l._length=null;s("zorder")}}),Rte=ze((te,Y)=>{var d=Tp(),y=ji(),z=OS(),P=BS(),i=RS(),n=FS(),a=UL(),l=Iz(),o=_A(),u=ZL();Y.exports=function(h,m){var b=m._carpetTrace=o(h,m);if(!(!b||!b.visible||b.visible==="legendonly")){if(!m.a||!m.b){var x=h.data[b.index],_=h.data[m.index];_.a||(_.a=x.a),_.b||(_.b=x.b),l(_,m,m._defaultColor,h._fullLayout)}var A=s(h,m);return u(m,m._z),A}};function s(h,m){var b=m._carpetTrace,x=b.aaxis,_=b.baxis,A,f,k,w,D,E,I;x._minDtick=0,_._minDtick=0,y.isArray1D(m.z)&&z(m,x,_,"a","b",["z"]),A=m._a=m._a||m.a,w=m._b=m._b||m.b,A=A?x.makeCalcdata(m,"_a"):[],w=w?_.makeCalcdata(m,"_b"):[],f=m.a0||0,k=m.da||1,D=m.b0||0,E=m.db||1,I=m._z=P(m._z||m.z,m.transpose),m._emptypoints=n(I),i(I,m._emptypoints);var M=y.maxRowLength(I),p=m.xtype==="scaled"?"":A,g=a(m,p,f,k,M,x),C=m.ytype==="scaled"?"":w,T=a(m,C,D,E,I.length,_),N={a:g,b:T,z:I};return m.contours.type==="levels"&&m.contours.coloring!=="none"&&d(h,m,{vals:I,containerStr:"",cLetter:"z"}),[N]}}),Fte=ze((te,Y)=>{var d=ji().isArrayOrTypedArray;Y.exports=function(y,z,P,i){var n,a,l,o,u,s,h,m,b,x,_,A,f,k=d(P)?"a":"b",w=k==="a"?y.aaxis:y.baxis,D=w.smoothing,E=k==="a"?y.a2i:y.b2j,I=k==="a"?P:i,M=k==="a"?i:P,p=k==="a"?z.a.length:z.b.length,g=k==="a"?z.b.length:z.a.length,C=Math.floor(k==="a"?y.b2j(M):y.a2i(M)),T=k==="a"?function(be){return y.evalxy([],be,C)}:function(be){return y.evalxy([],C,be)};D&&(l=Math.max(0,Math.min(g-2,C)),o=C-l,a=k==="a"?function(be,ve){return y.dxydi([],be,l,ve,o)}:function(be,ve){return y.dxydj([],l,be,o,ve)});var N=E(I[0]),B=E(I[1]),U=N0?Math.floor:Math.ceil,F=U>0?Math.ceil:Math.floor,H=U>0?Math.min:Math.max,q=U>0?Math.max:Math.min,G=W(N+V),ee=F(B-V);h=T(N);var he=[[h]];for(n=G;n*U{var d=ri(),y=Mz(),z=Ez(),P=Zs(),i=ji(),n=YL(),a=XL(),l=YS(),o=J4(),u=QL(),s=JL(),h=eP(),m=_A(),b=Fte();Y.exports=function(M,p,g,C){var T=p.xaxis,N=p.yaxis;i.makeTraceGroups(C,g,"contour").each(function(B){var U=d.select(this),V=B[0],W=V.trace,F=W._carpetTrace=m(M,W),H=M.calcdata[F.index][0];if(!F.visible||F.visible==="legendonly")return;var q=V.a,G=V.b,ee=W.contours,he=s(ee,p,V),be=ee.type==="constraint",ve=ee._operation,ce=be?ve==="="?"lines":"fill":ee.coloring;function re(Be){var Ze=F.ab2xy(Be[0],Be[1],!0);return[T.c2p(Ze[0]),N.c2p(Ze[1])]}var ge=[[q[0],G[G.length-1]],[q[q.length-1],G[G.length-1]],[q[q.length-1],G[0]],[q[0],G[0]]];n(he);var ne=(q[q.length-1]-q[0])*1e-8,se=(G[G.length-1]-G[0])*1e-8;a(he,ne,se);var _e=he;ee.type==="constraint"&&(_e=u(he,ve)),x(he,re);var oe,J,me,fe,Ce=[];for(fe=H.clipsegments.length-1;fe>=0;fe--)oe=H.clipsegments[fe],J=y([],oe.x,T.c2p),me=y([],oe.y,N.c2p),J.reverse(),me.reverse(),Ce.push(z(J,me,oe.bicubic));var Re="M"+Ce.join("L")+"Z";D(U,H.clipsegments,T,N,be,ce),E(W,U,T,N,_e,ge,re,F,H,ce,Re),_(U,he,M,V,ee,p,F),P.setClipUrl(U,F._clipPathId,M)})};function x(M,p){var g,C,T,N,B,U,V,W,F;for(g=0;gbe&&(C.max=be),C.len=C.max-C.min}function f(M,p,g){var C=M.getPointAtLength(p),T=M.getPointAtLength(g),N=T.x-C.x,B=T.y-C.y,U=Math.sqrt(N*N+B*B);return[N/U,B/U]}function k(M){var p=Math.sqrt(M[0]*M[0]+M[1]*M[1]);return[M[0]/p,M[1]/p]}function w(M,p){var g=Math.abs(M[0]*p[0]+M[1]*p[1]),C=Math.sqrt(1-g*g);return C/g}function D(M,p,g,C,T,N){var B,U,V,W,F=i.ensureSingle(M,"g","contourbg"),H=F.selectAll("path").data(N==="fill"&&!T?[0]:[]);H.enter().append("path"),H.exit().remove();var q=[];for(W=0;W=0&&(G=me,he=be):Math.abs(q[1]-G[1])=0&&(G=me,he=be):i.log("endpt to newendpt is not vert. or horz.",q,G,me)}if(he>=0)break;W+=oe(q,G),q=G}if(he===p.edgepaths.length){i.log("unclosed perimeter path");break}V=he,H=F.indexOf(V)===-1,H&&(V=F[0],W+=oe(q,G)+"Z",q=null)}for(V=0;V{Y.exports={attributes:Pz(),supplyDefaults:Iz(),colorbar:JS(),calc:Rte(),plot:Nte(),style:XS(),moduleType:"trace",name:"contourcarpet",basePlotModule:Ff(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}),Ute=ze((te,Y)=>{Y.exports=jte()}),xA=ze((te,Y)=>{var d=ji().extendFlat,y=ff(),z=Sh().axisHoverFormat,P=qd().dash,i=zo(),n=Iw(),a=n.INCREASING.COLOR,l=n.DECREASING.COLOR,o=y.line;function u(s){return{line:{color:d({},o.color,{dflt:s}),width:o.width,dash:P,editType:"style"},editType:"style"}}Y.exports={xperiod:y.xperiod,xperiod0:y.xperiod0,xperiodalignment:y.xperiodalignment,xhoverformat:z("x"),yhoverformat:z("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:d({},o.width,{}),dash:d({},P,{}),editType:"style"},increasing:u(a),decreasing:u(l),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:d({},i.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:y.zorder}}),Dz=ze((te,Y)=>{var d=as(),y=ji();Y.exports=function(z,P,i,n){var a=i("x"),l=i("open"),o=i("high"),u=i("low"),s=i("close");i("hoverlabel.split");var h=d.getComponentMethod("calendars","handleTraceDefaults");if(h(z,P,["x"],n),!!(l&&o&&u&&s)){var m=Math.min(l.length,o.length,u.length,s.length);return a&&(m=Math.min(m,y.minRowLength(a))),P._length=m,m}}}),$te=ze((te,Y)=>{var d=ji(),y=Dz(),z=S0(),P=xA();Y.exports=function(n,a,l,o){function u(h,m){return d.coerce(n,a,P,h,m)}var s=y(n,a,u,o);if(!s){a.visible=!1;return}z(n,a,o,u,{x:!0}),u("xhoverformat"),u("yhoverformat"),u("line.width"),u("line.dash"),i(n,a,u,"increasing"),i(n,a,u,"decreasing"),u("text"),u("hovertext"),u("tickwidth"),o._requestRangeslider[a.xaxis]=!0,u("zorder")};function i(n,a,l,o){l(o+".line.color"),l(o+".line.width",a.line.width),l(o+".line.dash",a.line.dash)}}),zz=ze((te,Y)=>{var d=ji(),y=d._,z=Os(),P=Dm(),i=ei().BADNUM;function n(u,s){var h=z.getFromId(u,s.xaxis),m=z.getFromId(u,s.yaxis),b=o(u,h,s),x=s._minDiff;s._minDiff=null;var _=s._origX;s._origX=null;var A=s._xcalc;s._xcalc=null;var f=l(u,s,_,A,m,a);return s._extremes[h._id]=z.findExtremes(h,A,{vpad:x/2}),f.length?(d.extendFlat(f[0].t,{wHover:x/2,tickLen:b}),f):[{t:{empty:!0}}]}function a(u,s,h,m){return{o:u,h:s,l:h,c:m}}function l(u,s,h,m,b,x){for(var _=b.makeCalcdata(s,"open"),A=b.makeCalcdata(s,"high"),f=b.makeCalcdata(s,"low"),k=b.makeCalcdata(s,"close"),w=d.isArrayOrTypedArray(s.text),D=d.isArrayOrTypedArray(s.hovertext),E=!0,I=null,M=!!s.xperiodalignment,p=[],g=0;gI):E=U>T,I=U;var V=x(T,N,B,U);V.pos=C,V.yc=(T+U)/2,V.i=g,V.dir=E?"increasing":"decreasing",V.x=V.pos,V.y=[B,N],M&&(V.orig_p=h[g]),w&&(V.tx=s.text[g]),D&&(V.htx=s.hovertext[g]),p.push(V)}else p.push({pos:C,empty:!0})}return s._extremes[b._id]=z.findExtremes(b,d.concat(f,A),{padded:!0}),p.length&&(p[0].t={labels:{open:y(u,"open:")+" ",high:y(u,"high:")+" ",low:y(u,"low:")+" ",close:y(u,"close:")+" "}}),p}function o(u,s,h){var m=h._minDiff;if(!m){var b=u._fullData,x=[];m=1/0;var _;for(_=0;_{var d=ri(),y=ji();Y.exports=function(z,P,i,n){var a=P.yaxis,l=P.xaxis,o=!!l.rangebreaks;y.makeTraceGroups(n,i,"trace ohlc").each(function(u){var s=d.select(this),h=u[0],m=h.t,b=h.trace;if(b.visible!==!0||m.empty){s.remove();return}var x=m.tickLen,_=s.selectAll("path").data(y.identity);_.enter().append("path"),_.exit().remove(),_.attr("d",function(A){if(A.empty)return"M0,0Z";var f=l.c2p(A.pos-x,!0),k=l.c2p(A.pos+x,!0),w=o?(f+k)/2:l.c2p(A.pos,!0),D=a.c2p(A.o,!0),E=a.c2p(A.h,!0),I=a.c2p(A.l,!0),M=a.c2p(A.c,!0);return"M"+f+","+D+"H"+w+"M"+w+","+E+"V"+I+"M"+k+","+M+"H"+w})})}}),Vte=ze((te,Y)=>{var d=ri(),y=Zs(),z=Xi();Y.exports=function(P,i,n){var a=n||d.select(P).selectAll("g.ohlclayer").selectAll("g.trace");a.style("opacity",function(l){return l[0].trace.opacity}),a.each(function(l){var o=l[0].trace;d.select(this).selectAll("path").each(function(u){if(!u.empty){var s=o[u.dir].line;d.select(this).style("fill","none").call(z.stroke,s.color).call(y.dashLine,s.dash,s.width).style("opacity",o.selectedpoints&&!u.selected?.3:1)}})})}}),Oz=ze((te,Y)=>{var d=Os(),y=ji(),z=hf(),P=Xi(),i=ji().fillText,n=Iw(),a={increasing:n.INCREASING.SYMBOL,decreasing:n.DECREASING.SYMBOL};function l(h,m,b,x){var _=h.cd,A=_[0].trace;return A.hoverlabel.split?u(h,m,b,x):s(h,m,b,x)}function o(h,m,b,x){var _=h.cd,A=h.xa,f=_[0].trace,k=_[0].t,w=f.type,D=w==="ohlc"?"l":"min",E=w==="ohlc"?"h":"max",I,M,p=k.bPos||0,g=function(ee){return ee.pos+p-m},C=k.bdPos||k.tickLen,T=k.wHover,N=Math.min(1,C/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));I=h.maxHoverDistance-N,M=h.maxSpikeDistance-N;function B(ee){var he=g(ee);return z.inbox(he-T,he+T,I)}function U(ee){var he=ee[D],be=ee[E];return he===be||z.inbox(he-b,be-b,I)}function V(ee){return(B(ee)+U(ee))/2}var W=z.getDistanceFunction(x,B,U,V);if(z.getClosest(_,W,h),h.index===!1)return null;var F=_[h.index];if(F.empty)return null;var H=F.dir,q=f[H],G=q.line.color;return P.opacity(G)&&q.line.width?h.color=G:h.color=q.fillcolor,h.x0=A.c2p(F.pos+p-C,!0),h.x1=A.c2p(F.pos+p+C,!0),h.xLabelVal=F.orig_p!==void 0?F.orig_p:F.pos,h.spikeDistance=V(F)*M/I,h.xSpike=A.c2p(F.pos,!0),h}function u(h,m,b,x){var _=h.cd,A=h.ya,f=_[0].trace,k=_[0].t,w=[],D=o(h,m,b,x);if(!D)return[];var E=D.index,I=_[E],M=I.hi||f.hoverinfo,p=M.split("+"),g=M==="all",C=g||p.indexOf("y")!==-1;if(!C)return[];for(var T=["high","open","close","low"],N={},B=0;B"+k.labels[U]+d.hoverLabelText(A,V,f.yhoverformat)):(F=y.extendFlat({},D),F.y0=F.y1=W,F.yLabelVal=V,F.yLabel=k.labels[U]+d.hoverLabelText(A,V,f.yhoverformat),F.name="",w.push(F),N[V]=F)}return w}function s(h,m,b,x){var _=h.cd,A=h.ya,f=_[0].trace,k=_[0].t,w=o(h,m,b,x);if(!w)return[];var D=w.index,E=_[D],I=w.index=E.i,M=E.dir;function p(V){return k.labels[V]+d.hoverLabelText(A,f[V][I],f.yhoverformat)}var g=E.hi||f.hoverinfo,C=g.split("+"),T=g==="all",N=T||C.indexOf("y")!==-1,B=T||C.indexOf("text")!==-1,U=N?[p("open"),p("high"),p("low"),p("close")+" "+a[M]]:[];return B&&i(E,f,U),w.extraText=U.join("
"),w.y0=w.y1=A.c2p(E.yc,!0),[w]}Y.exports={hoverPoints:l,hoverSplit:u,hoverOnPoints:s}}),Bz=ze((te,Y)=>{Y.exports=function(d,y){var z=d.cd,P=d.xaxis,i=d.yaxis,n=[],a,l=z[0].t.bPos||0;if(y===!1)for(a=0;a{Y.exports={moduleType:"trace",name:"ohlc",basePlotModule:Ff(),categories:["cartesian","svg","showLegend"],meta:{},attributes:xA(),supplyDefaults:$te(),calc:zz().calc,plot:Hte(),style:Vte(),hoverPoints:Oz().hoverPoints,selectPoints:Bz()}}),qte=ze((te,Y)=>{Y.exports=Wte()}),Rz=ze((te,Y)=>{var d=ji().extendFlat,y=Sh().axisHoverFormat,z=xA(),P=q4();function i(n){return{line:{color:d({},P.line.color,{dflt:n}),width:P.line.width,editType:"style"},fillcolor:P.fillcolor,editType:"style"}}Y.exports={xperiod:z.xperiod,xperiod0:z.xperiod0,xperiodalignment:z.xperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),x:z.x,open:z.open,high:z.high,low:z.low,close:z.close,line:{width:d({},P.line.width,{}),editType:"style"},increasing:i(z.increasing.line.color.dflt),decreasing:i(z.decreasing.line.color.dflt),text:z.text,hovertext:z.hovertext,whiskerwidth:d({},P.whiskerwidth,{dflt:0}),hoverlabel:z.hoverlabel,zorder:P.zorder}}),Gte=ze((te,Y)=>{var d=ji(),y=Xi(),z=Dz(),P=S0(),i=Rz();Y.exports=function(a,l,o,u){function s(m,b){return d.coerce(a,l,i,m,b)}var h=z(a,l,s,u);if(!h){l.visible=!1;return}P(a,l,u,s,{x:!0}),s("xhoverformat"),s("yhoverformat"),s("line.width"),n(a,l,s,"increasing"),n(a,l,s,"decreasing"),s("text"),s("hovertext"),s("whiskerwidth"),u._requestRangeslider[l.xaxis]=!0,s("zorder")};function n(a,l,o,u){var s=o(u+".line.color");o(u+".line.width",l.line.width),o(u+".fillcolor",y.addOpacity(s,.5))}}),Zte=ze((te,Y)=>{var d=ji(),y=Os(),z=Dm(),P=zz().calcCommon;Y.exports=function(n,a){var l=n._fullLayout,o=y.getFromId(n,a.xaxis),u=y.getFromId(n,a.yaxis),s=o.makeCalcdata(a,"x"),h=z(a,o,"x",s).vals,m=P(n,a,s,h,u,i);return m.length?(d.extendFlat(m[0].t,{num:l._numBoxes,dPos:d.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),l._numBoxes++,m):[{t:{empty:!0}}]};function i(n,a,l,o){return{min:l,q1:Math.min(n,o),med:o,q3:Math.max(n,o),max:a}}}),Kte=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"candlestick",basePlotModule:Ff(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:Rz(),layoutAttributes:G4(),supplyLayoutDefaults:LS().supplyLayoutDefaults,crossTraceCalc:PS().crossTraceCalc,supplyDefaults:Gte(),calc:Zte(),plot:IS().plot,layerName:"boxlayer",style:DS().style,hoverPoints:Oz().hoverPoints,selectPoints:Bz()}}),Yte=ze((te,Y)=>{Y.exports=Kte()}),Fz=ze((te,Y)=>{var d=ji(),y=Z0(),z=d.deg2rad,P=d.rad2deg;Y.exports=function(o,u,s){switch(y(o,s),o._id){case"x":case"radialaxis":i(o,u);break;case"angularaxis":l(o,u);break}};function i(o,u){var s=u._subplot;o.setGeometry=function(){var h=o._rl[0],m=o._rl[1],b=s.innerRadius,x=(s.radius-b)/(m-h),_=b/x,A=h>m?function(f){return f<=0}:function(f){return f>=0};o.c2g=function(f){var k=o.c2l(f)-h;return(A(k)?k:0)+_},o.g2c=function(f){return o.l2c(f+h-_)},o.g2p=function(f){return f*x},o.c2p=function(f){return o.g2p(o.c2g(f))}}}function n(o,u){return u==="degrees"?z(o):o}function a(o,u){return u==="degrees"?P(o):o}function l(o,u){var s=o.type;if(s==="linear"){var h=o.d2c,m=o.c2d;o.d2c=function(b,x){return n(h(b),x)},o.c2d=function(b,x){return m(a(b,x))}}o.makeCalcdata=function(b,x){var _=b[x],A=b._length,f,k,w=function(p){return o.d2c(p,b.thetaunit)};if(_)for(f=new Array(A),k=0;k{Y.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}),wA=ze((te,Y)=>{var d=ji(),y=Cg().tester,z=d.findIndexOfMin,P=d.isAngleInsideSector,i=d.angleDelta,n=d.angleDist;function a(k,w,D,E,I){if(!P(w,E))return!1;var M,p;D[0]0?p:1/0},E=z(w,D),I=d.mod(E+1,w.length);return[w[E],w[I]]}function x(k){return Math.abs(k)>1e-10?k:0}function _(k,w,D){w=w||0,D=D||0;for(var E=k.length,I=new Array(E),M=0;M{function d(a){return a<0?-1:a>0?1:0}function y(a){var l=a[0],o=a[1];if(!isFinite(l)||!isFinite(o))return[1,0];var u=(l+1)*(l+1)+o*o;return[(l*l+o*o-1)/u,2*o/u]}function z(a,l){var o=l[0],u=l[1];return[o*a.radius+a.cx,-u*a.radius+a.cy]}function P(a,l){return l*a.radius}function i(a,l,o,u){var s=z(a,y([o,l])),h=s[0],m=s[1],b=z(a,y([u,l])),x=b[0],_=b[1];if(l===0)return["M"+h+","+m,"L"+x+","+_].join(" ");var A=P(a,1/Math.abs(l));return["M"+h+","+m,"A"+A+","+A+" 0 0,"+(l<0?1:0)+" "+x+","+_].join(" ")}function n(a,l,o,u){var s=P(a,1/(l+1)),h=z(a,y([l,o])),m=h[0],b=h[1],x=z(a,y([l,u])),_=x[0],A=x[1];if(d(o)!==d(u)){var f=z(a,y([l,0])),k=f[0],w=f[1];return["M"+m+","+b,"A"+s+","+s+" 0 0,"+(0{var d=ri(),y=ln(),z=as(),P=ji(),i=P.strRotate,n=P.strTranslate,a=Xi(),l=Zs(),o=sh(),u=Os(),s=Z0(),h=Fz(),m=Jm().doAutoRange,b=L_(),x=jp(),_=hf(),A=Np(),f=Ef().prepSelect,k=Ef().selectOnClick,w=Ef().clearOutline,D=Em(),E=ey(),I=pm().redrawReglTraces,M=Rf().MID_SHIFT,p=bA(),g=wA(),C=Nz(),T=C.smith,N=C.reactanceArc,B=C.resistanceArc,U=C.smithTransform,V=P._,W=P.mod,F=P.deg2rad,H=P.rad2deg;function q(ce,re,ge){this.isSmith=ge||!1,this.id=re,this.gd=ce,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var ne=ce._fullLayout,se="clip"+ne._uid+re;this.clipIds.forTraces=se+"-for-traces",this.clipPaths.forTraces=ne._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=ne["_"+(ge?"smith":"polar")+"layer"].append("g").attr("class",re),this.getHole=function(_e){return this.isSmith?0:_e.hole},this.getSector=function(_e){return this.isSmith?[0,360]:_e.sector},this.getRadial=function(_e){return this.isSmith?_e.realaxis:_e.radialaxis},this.getAngular=function(_e){return this.isSmith?_e.imaginaryaxis:_e.angularaxis},ge||(this.radialTickLayout=null,this.angularTickLayout=null)}var G=q.prototype;Y.exports=function(ce,re,ge){return new q(ce,re,ge)},G.plot=function(ce,re){for(var ge=this,ne=re[ge.id],se=!1,_e=0;_e_t?(mt=fe,vt=fe*_t,Oe=(Ce-vt)/se.h/2,ct=[J[0],J[1]],Ae=[me[0]+Oe,me[1]-Oe]):(mt=Ce/_t,vt=Ce,Oe=(fe-mt)/se.w/2,ct=[J[0]+Oe,J[1]-Oe],Ae=[me[0],me[1]]),ge.xLength2=mt,ge.yLength2=vt,ge.xDomain2=ct,ge.yDomain2=Ae;var Le=ge.xOffset2=se.l+se.w*ct[0],nt=ge.yOffset2=se.t+se.h*(1-Ae[1]),xt=ge.radius=mt/Ze,ut=ge.innerRadius=ge.getHole(re)*xt,Et=ge.cx=Le-xt*Be[0],Gt=ge.cy=nt+xt*Be[3],Qt=ge.cxx=Et-Le,vr=ge.cyy=Gt-nt,mr=_e.side,Yr;mr==="counterclockwise"?(Yr=mr,mr="top"):mr==="clockwise"&&(Yr=mr,mr="bottom"),ge.radialAxis=ge.mockAxis(ce,re,_e,{_id:"x",side:mr,_trueSide:Yr,domain:[ut/se.w,xt/se.w]}),ge.angularAxis=ge.mockAxis(ce,re,oe,{side:"right",domain:[0,Math.PI],autorange:!1}),ge.doAutoRange(ce,re),ge.updateAngularAxis(ce,re),ge.updateRadialAxis(ce,re),ge.updateRadialAxisTitle(ce,re),ge.xaxis=ge.mockCartesianAxis(ce,re,{_id:"x",domain:ct}),ge.yaxis=ge.mockCartesianAxis(ce,re,{_id:"y",domain:Ae});var ii=ge.pathSubplot();ge.clipPaths.forTraces.select("path").attr("d",ii).attr("transform",n(Qt,vr)),ne.frontplot.attr("transform",n(Le,nt)).call(l.setClipUrl,ge._hasClipOnAxisFalse?null:ge.clipIds.forTraces,ge.gd),ne.bg.attr("d",ii).attr("transform",n(Et,Gt)).call(a.fill,re.bgcolor)},G.mockAxis=function(ce,re,ge,ne){var se=P.extendFlat({},ge,ne);return h(se,re,ce),se},G.mockCartesianAxis=function(ce,re,ge){var ne=this,se=ne.isSmith,_e=ge._id,oe=P.extendFlat({type:"linear"},ge);s(oe,ce);var J={x:[0,2],y:[1,3]};return oe.setRange=function(){var me=ne.sectorBBox,fe=J[_e],Ce=ne.radialAxis._rl,Re=(Ce[1]-Ce[0])/(1-ne.getHole(re));oe.range=[me[fe[0]]*Re,me[fe[1]]*Re]},oe.isPtWithinRange=_e==="x"&&!se?function(me){return ne.isPtInside(me)}:function(){return!0},oe.setRange(),oe.setScale(),oe},G.doAutoRange=function(ce,re){var ge=this,ne=ge.gd,se=ge.radialAxis,_e=ge.getRadial(re);m(ne,se);var oe=se.range;if(_e.range=oe.slice(),_e._input.range=oe.slice(),se._rl=[se.r2l(oe[0],null,"gregorian"),se.r2l(oe[1],null,"gregorian")],se.minallowed!==void 0){var J=se.r2l(se.minallowed);se._rl[0]>se._rl[1]?se._rl[1]=Math.max(se._rl[1],J):se._rl[0]=Math.max(se._rl[0],J)}if(se.maxallowed!==void 0){var me=se.r2l(se.maxallowed);se._rl[0]90&&Ce<=270&&(Re.tickangle=180);var Ge=Ze?function(xt){var ut=U(ge,T([xt.x,0]));return n(ut[0]-J,ut[1]-me)}:function(xt){return n(Re.l2p(xt.x)+oe,0)},tt=Ze?function(xt){return B(ge,xt.x,-1/0,1/0)}:function(xt){return ge.pathArc(Re.r2p(xt.x)+oe)},_t=ee(fe);if(ge.radialTickLayout!==_t&&(se["radial-axis"].selectAll(".xtick").remove(),ge.radialTickLayout=_t),Be){Re.setScale();var mt=0,vt=Ze?(Re.tickvals||[]).filter(function(xt){return xt>=0}).map(function(xt){return u.tickText(Re,xt,!0,!1)}):u.calcTicks(Re),ct=Ze?vt:u.clipEnds(Re,vt),Ae=u.getTickSigns(Re)[2];Ze&&((Re.ticks==="top"&&Re.side==="bottom"||Re.ticks==="bottom"&&Re.side==="top")&&(Ae=-Ae),Re.ticks==="top"&&Re.side==="top"&&(mt=-Re.ticklen),Re.ticks==="bottom"&&Re.side==="bottom"&&(mt=Re.ticklen)),u.drawTicks(ne,Re,{vals:vt,layer:se["radial-axis"],path:u.makeTickPath(Re,0,Ae),transFn:Ge,crisp:!1}),u.drawGrid(ne,Re,{vals:ct,layer:se["radial-grid"],path:tt,transFn:P.noop,crisp:!1}),u.drawLabels(ne,Re,{vals:vt,layer:se["radial-axis"],transFn:Ge,labelFns:u.makeLabelFns(Re,mt)})}var Oe=ge.radialAxisAngle=ge.vangles?H(be(F(fe.angle),ge.vangles)):fe.angle,Le=n(J,me),nt=Le+i(-Oe);ve(se["radial-axis"],Be&&(fe.showticklabels||fe.ticks),{transform:nt}),ve(se["radial-grid"],Be&&fe.showgrid,{transform:Ze?"":Le}),ve(se["radial-line"].select("line"),Be&&fe.showline,{x1:Ze?-_e:oe,y1:0,x2:_e,y2:0,transform:nt}).attr("stroke-width",fe.linewidth).call(a.stroke,fe.linecolor)},G.updateRadialAxisTitle=function(ce,re,ge){if(!this.isSmith){var ne=this,se=ne.gd,_e=ne.radius,oe=ne.cx,J=ne.cy,me=ne.getRadial(re),fe=ne.id+"title",Ce=0;if(me.title){var Re=l.bBox(ne.layers["radial-axis"].node()).height,Be=me.title.font.size,Ze=me.side;Ce=Ze==="top"?Be:Ze==="counterclockwise"?-(Re+Be*.4):Re+Be*.8}var Ge=ge!==void 0?ge:ne.radialAxisAngle,tt=F(Ge),_t=Math.cos(tt),mt=Math.sin(tt),vt=oe+_e/2*_t+Ce*mt,ct=J-_e/2*mt+Ce*_t;ne.layers["radial-axis-title"]=A.draw(se,fe,{propContainer:me,propName:ne.id+".radialaxis.title.text",placeholder:V(se,"Click to enter radial axis title"),attributes:{x:vt,y:ct,"text-anchor":"middle"},transform:{rotate:-Ge}})}},G.updateAngularAxis=function(ce,re){var ge=this,ne=ge.gd,se=ge.layers,_e=ge.radius,oe=ge.innerRadius,J=ge.cx,me=ge.cy,fe=ge.getAngular(re),Ce=ge.angularAxis,Re=ge.isSmith;Re||(ge.fillViewInitialKey("angularaxis.rotation",fe.rotation),Ce.setGeometry(),Ce.setScale());var Be=Re?function(ut){var Et=U(ge,T([0,ut.x]));return Math.atan2(Et[0]-J,Et[1]-me)-Math.PI/2}:function(ut){return Ce.t2g(ut.x)};Ce.type==="linear"&&Ce.thetaunit==="radians"&&(Ce.tick0=H(Ce.tick0),Ce.dtick=H(Ce.dtick));var Ze=function(ut){return n(J+_e*Math.cos(ut),me-_e*Math.sin(ut))},Ge=Re?function(ut){var Et=U(ge,T([0,ut.x]));return n(Et[0],Et[1])}:function(ut){return Ze(Be(ut))},tt=Re?function(ut){var Et=U(ge,T([0,ut.x])),Gt=Math.atan2(Et[0]-J,Et[1]-me)-Math.PI/2;return n(Et[0],Et[1])+i(-H(Gt))}:function(ut){var Et=Be(ut);return Ze(Et)+i(-H(Et))},_t=Re?function(ut){return N(ge,ut.x,0,1/0)}:function(ut){var Et=Be(ut),Gt=Math.cos(Et),Qt=Math.sin(Et);return"M"+[J+oe*Gt,me-oe*Qt]+"L"+[J+_e*Gt,me-_e*Qt]},mt=u.makeLabelFns(Ce,0),vt=mt.labelStandoff,ct={};ct.xFn=function(ut){var Et=Be(ut);return Math.cos(Et)*vt},ct.yFn=function(ut){var Et=Be(ut),Gt=Math.sin(Et)>0?.2:1;return-Math.sin(Et)*(vt+ut.fontSize*Gt)+Math.abs(Math.cos(Et))*(ut.fontSize*M)},ct.anchorFn=function(ut){var Et=Be(ut),Gt=Math.cos(Et);return Math.abs(Gt)<.1?"middle":Gt>0?"start":"end"},ct.heightFn=function(ut,Et,Gt){var Qt=Be(ut);return-.5*(1+Math.sin(Qt))*Gt};var Ae=ee(fe);ge.angularTickLayout!==Ae&&(se["angular-axis"].selectAll("."+Ce._id+"tick").remove(),ge.angularTickLayout=Ae);var Oe=Re?[1/0].concat(Ce.tickvals||[]).map(function(ut){return u.tickText(Ce,ut,!0,!1)}):u.calcTicks(Ce);Re&&(Oe[0].text="∞",Oe[0].fontSize*=1.75);var Le;if(re.gridshape==="linear"?(Le=Oe.map(Be),P.angleDelta(Le[0],Le[1])<0&&(Le=Le.slice().reverse())):Le=null,ge.vangles=Le,Ce.type==="category"&&(Oe=Oe.filter(function(ut){return P.isAngleInsideSector(Be(ut),ge.sectorInRad)})),Ce.visible){var nt=Ce.ticks==="inside"?-1:1,xt=(Ce.linewidth||1)/2;u.drawTicks(ne,Ce,{vals:Oe,layer:se["angular-axis"],path:"M"+nt*xt+",0h"+nt*Ce.ticklen,transFn:tt,crisp:!1}),u.drawGrid(ne,Ce,{vals:Oe,layer:se["angular-grid"],path:_t,transFn:P.noop,crisp:!1}),u.drawLabels(ne,Ce,{vals:Oe,layer:se["angular-axis"],repositionOnUpdate:!0,transFn:Ge,labelFns:ct})}ve(se["angular-line"].select("path"),fe.showline,{d:ge.pathSubplot(),transform:n(J,me)}).attr("stroke-width",fe.linewidth).call(a.stroke,fe.linecolor)},G.updateFx=function(ce,re){if(!this.gd._context.staticPlot){var ge=!this.isSmith;ge&&(this.updateAngularDrag(ce),this.updateRadialDrag(ce,re,0),this.updateRadialDrag(ce,re,1)),this.updateHoverAndMainDrag(ce)}},G.updateHoverAndMainDrag=function(ce){var re=this,ge=re.isSmith,ne=re.gd,se=re.layers,_e=ce._zoomlayer,oe=p.MINZOOM,J=p.OFFEDGE,me=re.radius,fe=re.innerRadius,Ce=re.cx,Re=re.cy,Be=re.cxx,Ze=re.cyy,Ge=re.sectorInRad,tt=re.vangles,_t=re.radialAxis,mt=g.clampTiny,vt=g.findXYatLength,ct=g.findEnclosingVertexAngles,Ae=p.cornerHalfWidth,Oe=p.cornerLen/2,Le,nt,xt=b.makeDragger(se,"path","maindrag",ce.dragmode===!1?"none":"crosshair");d.select(xt).attr("d",re.pathSubplot()).attr("transform",n(Ce,Re)),xt.onmousemove=function(Dr){_.hover(ne,Dr,re.id),ne._fullLayout._lasthover=xt,ne._fullLayout._hoversubplot=re.id},xt.onmouseout=function(Dr){ne._dragging||x.unhover(ne,Dr)};var ut={element:xt,gd:ne,subplot:re.id,plotinfo:{id:re.id,xaxis:re.xaxis,yaxis:re.yaxis},xaxes:[re.xaxis],yaxes:[re.yaxis]},Et,Gt,Qt,vr,mr,Yr,ii,Lr,ci;function vi(Dr,br){return Math.sqrt(Dr*Dr+br*br)}function Ot(Dr,br){return vi(Dr-Be,br-Ze)}function Xe(Dr,br){return Math.atan2(Ze-br,Dr-Be)}function ot(Dr,br){return[Dr*Math.cos(br),Dr*Math.sin(-br)]}function De(Dr,br){if(Dr===0)return re.pathSector(2*Ae);var fi=Oe/Dr,un=br-fi,cn=br+fi,yn=Math.max(0,Math.min(Dr,me)),Gn=yn-Ae,Sn=yn+Ae;return"M"+ot(Gn,un)+"A"+[Gn,Gn]+" 0,0,0 "+ot(Gn,cn)+"L"+ot(Sn,cn)+"A"+[Sn,Sn]+" 0,0,1 "+ot(Sn,un)+"Z"}function ye(Dr,br,fi){if(Dr===0)return re.pathSector(2*Ae);var un=ot(Dr,br),cn=ot(Dr,fi),yn=mt((un[0]+cn[0])/2),Gn=mt((un[1]+cn[1])/2),Sn,dn;if(yn&&Gn){var va=Gn/yn,na=-1/va,Kt=vt(Ae,va,yn,Gn);Sn=vt(Oe,na,Kt[0][0],Kt[0][1]),dn=vt(Oe,na,Kt[1][0],Kt[1][1])}else{var lr,_r;Gn?(lr=Oe,_r=Ae):(lr=Ae,_r=Oe),Sn=[[yn-lr,Gn-_r],[yn+lr,Gn-_r]],dn=[[yn-lr,Gn+_r],[yn+lr,Gn+_r]]}return"M"+Sn.join("L")+"L"+dn.reverse().join("L")+"Z"}function Pe(){Qt=null,vr=null,mr=re.pathSubplot(),Yr=!1;var Dr=ne._fullLayout[re.id];ii=y(Dr.bgcolor).getLuminance(),Lr=b.makeZoombox(_e,ii,Ce,Re,mr),Lr.attr("fill-rule","evenodd"),ci=b.makeCorners(_e,Ce,Re),w(ne)}function He(Dr,br){return br=Math.max(Math.min(br,me),fe),Droe?(Dr-1&&Dr===1&&k(br,ne,[re.xaxis],[re.yaxis],re.id,ut),fi.indexOf("event")>-1&&_.click(ne,br,re.id)}ut.prepFn=function(Dr,br,fi){var un=ne._fullLayout.dragmode,cn=xt.getBoundingClientRect();ne._fullLayout._calcInverseTransform(ne);var yn=ne._fullLayout._invTransform;Le=ne._fullLayout._invScaleX,nt=ne._fullLayout._invScaleY;var Gn=P.apply3DTransform(yn)(br-cn.left,fi-cn.top);if(Et=Gn[0],Gt=Gn[1],tt){var Sn=g.findPolygonOffset(me,Ge[0],Ge[1],tt);Et+=Be+Sn[0],Gt+=Ze+Sn[1]}switch(un){case"zoom":ut.clickFn=zr,ge||(tt?ut.moveFn=Wt:ut.moveFn=ht,ut.doneFn=Yt,Pe());break;case"select":case"lasso":f(Dr,br,fi,ut,un);break}},x.init(ut)},G.updateRadialDrag=function(ce,re,ge){var ne=this,se=ne.gd,_e=ne.layers,oe=ne.radius,J=ne.innerRadius,me=ne.cx,fe=ne.cy,Ce=ne.radialAxis,Re=p.radialDragBoxSize,Be=Re/2;if(!Ce.visible)return;var Ze=F(ne.radialAxisAngle),Ge=Ce._rl,tt=Ge[0],_t=Ge[1],mt=Ge[ge],vt=.75*(Ge[1]-Ge[0])/(1-ne.getHole(re))/oe,ct,Ae,Oe;ge?(ct=me+(oe+Be)*Math.cos(Ze),Ae=fe-(oe+Be)*Math.sin(Ze),Oe="radialdrag"):(ct=me+(J-Be)*Math.cos(Ze),Ae=fe-(J-Be)*Math.sin(Ze),Oe="radialdrag-inner");var Le=b.makeRectDragger(_e,Oe,"crosshair",-Be,-Be,Re,Re),nt={element:Le,gd:se};ce.dragmode===!1&&(nt.dragmode=!1),ve(d.select(Le),Ce.visible&&J0!=(ge?Et>tt:Et<_t)){Et=null;return}var vi=se._fullLayout,Ot=vi[ne.id];Ce.range[ge]=Et,Ce._rl[ge]=Et,ne.updateRadialAxis(vi,Ot),ne.xaxis.setRange(),ne.xaxis.setScale(),ne.yaxis.setRange(),ne.yaxis.setScale();var Xe=!1;for(var ot in ne.traceHash){var De=ne.traceHash[ot],ye=P.filterVisible(De),Pe=De[0][0].trace._module;Pe.plot(se,ne,ye,Ot),z.traceIs(ot,"gl")&&ye.length&&(Xe=!0)}Xe&&(E(se),I(se))}nt.prepFn=function(){xt=null,ut=null,Et=null,nt.moveFn=Gt,nt.doneFn=vr,w(se)},nt.clampFn=function(ii,Lr){return Math.sqrt(ii*ii+Lr*Lr)=90||se>90&&_e>=450?Ze=1:J<=0&&fe<=0?Ze=0:Ze=Math.max(J,fe),se<=180&&_e>=180||se>180&&_e>=540?Ce=-1:oe>=0&&me>=0?Ce=0:Ce=Math.min(oe,me),se<=270&&_e>=270||se>270&&_e>=630?Re=-1:J>=0&&fe>=0?Re=0:Re=Math.min(J,fe),_e>=360?Be=1:oe<=0&&me<=0?Be=0:Be=Math.max(oe,me),[Ce,Re,Be,Ze]}function be(ce,re){var ge=function(se){return P.angleDist(ce,se)},ne=P.findIndexOfMin(re,ge);return re[ne]}function ve(ce,re,ge){return re?(ce.attr("display",null),ce.attr(ge)):ce&&ce.attr("display","none"),ce}}),Uz=ze((te,Y)=>{var d=Mi(),y=Gd(),z=Xh().attributes,P=ji().extendFlat,i=oh().overrideAll,n=i({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=i({tickmode:y.minor.tickmode,nticks:y.nticks,tick0:y.tick0,dtick:y.dtick,tickvals:y.tickvals,ticktext:y.ticktext,ticks:y.ticks,ticklen:y.ticklen,tickwidth:y.tickwidth,tickcolor:y.tickcolor,ticklabelstep:y.ticklabelstep,showticklabels:y.showticklabels,labelalias:y.labelalias,minorloglabels:y.minorloglabels,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,showexponent:y.showexponent,exponentformat:y.exponentformat,minexponent:y.minexponent,separatethousands:y.separatethousands,tickfont:y.tickfont,tickangle:y.tickangle,tickformat:y.tickformat,tickformatstops:y.tickformatstops,layer:y.layer},"plot","from-root"),l={visible:P({},y.visible,{dflt:!0}),type:P({},y.type,{values:["-","linear","log","date","category"]}),autotypenumbers:y.autotypenumbers,autorangeoptions:{minallowed:y.autorangeoptions.minallowed,maxallowed:y.autorangeoptions.maxallowed,clipmin:y.autorangeoptions.clipmin,clipmax:y.autorangeoptions.clipmax,include:y.autorangeoptions.include,editType:"plot"},autorange:P({},y.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:P({},y.minallowed,{editType:"plot"}),maxallowed:P({},y.maxallowed,{editType:"plot"}),range:P({},y.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:y.categoryorder,categoryarray:y.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:y.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:P({},y.title.text,{editType:"plot",dflt:""}),font:P({},y.title.font,{editType:"plot"}),editType:"plot"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(l,n,a);var o={visible:P({},y.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:y.autotypenumbers,categoryorder:y.categoryorder,categoryarray:y.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:y.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};P(o,n,a),Y.exports={domain:z({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:l,angularaxis:o,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}),Xte=ze((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=z_(),i=Ed().getSubplotData,n=Nv(),a=jv(),l=G0(),o=Tg(),u=Qg(),s=fb(),h=T4(),m=J1(),b=Uz(),x=Fz(),_=bA(),A=_.axisNames;function f(w,D,E,I){var M=E("bgcolor");I.bgColor=y.combine(M,I.paper_bgcolor);var p=E("sector");E("hole");var g=i(I.fullData,_.name,I.id),C=I.layoutOut,T;function N(Re,Be){return E(T+"."+Re,Be)}for(var B=0;B{var d=Ed().getSubplotCalcData,y=ji().counterRegex,z=jz(),P=bA(),i=P.attr,n=P.name,a=y(n),l={};l[i]={valType:"subplotid",dflt:n,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[n],x=0;x{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=nn().extendFlat,i=Lm(),n=ff(),a=xa(),l=n.line;Y.exports={mode:n.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:n.text,texttemplate:y({editType:"plot"},{keys:["r","theta","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,cliponaxis:P({},n.cliponaxis,{dflt:!1}),textposition:n.textposition,textfont:n.textfont,fill:P({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),hoverinfo:P({},a.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:n.hoveron,hovertemplate:d(),hovertemplatefallback:z(),selected:n.selected,unselected:n.unselected}}),TA=ze((te,Y)=>{var d=ji(),y=Bc(),z=X0(),P=Pm(),i=ny(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=B6();function u(h,m,b,x){function _(k,w){return d.coerce(h,m,o,k,w)}var A=s(h,m,x,_);if(!A){m.visible=!1;return}_("thetaunit"),_("mode",A{var d=ji(),y=Os();Y.exports=function(z,P,i){var n={},a=i[P.subplot]._subplot,l,o;a?(l=a.radialAxis,o=a.angularAxis):(a=i[P.subplot],l=a.radialaxis,o=a.angularaxis);var u=l.c2l(z.r);n.rLabel=y.tickText(l,u,!0).text;var s=o.thetaunit==="degrees"?d.rad2deg(z.theta):z.theta;return n.thetaLabel=y.tickText(o,s,!0).text,n}}),Jte=ze((te,Y)=>{var d=Sr(),y=ei().BADNUM,z=Os(),P=zm(),i=de(),n=$e(),a=yt().calcMarkerSize;Y.exports=function(l,o){for(var u=l._fullLayout,s=o.subplot,h=u[s].radialaxis,m=u[s].angularaxis,b=h.makeCalcdata(o,"r"),x=m.makeCalcdata(o,"theta"),_=o._length,A=new Array(_),f=0;f<_;f++){var k=b[f],w=x[f],D=A[f]={};d(k)&&d(w)?(D.r=k,D.theta=w):D.r=y}var E=a(o,_);return o._extremes.x=z.findExtremes(h,b,{ppad:E}),P(l,o),i(A,o),n(A,o),A}}),Qte=ze((te,Y)=>{var d=uo(),y=ei().BADNUM;Y.exports=function(z,P,i){for(var n=P.layers.frontplot.select("g.scatterlayer"),a=P.xaxis,l=P.yaxis,o={xaxis:a,yaxis:l,plot:P.framework,layerClipId:P._hasClipOnAxisFalse?P.clipIds.forTraces:null},u=P.radialAxis,s=P.angularAxis,h=0;h{var d=Kd();function y(P,i,n,a){var l=d(P,i,n,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var u=P.subplot,s=o.cd[o.index],h=o.trace;if(u.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,u,o),o.hovertemplate=h.hovertemplate,l}}function z(P,i,n,a){var l=n.radialAxis,o=n.angularAxis;l._hovertitle="r",o._hovertitle="θ";var u={};u[i.subplot]={_subplot:n};var s=i._module.formatLabels(P,i,u);a.rLabel=s.rLabel,a.thetaLabel=s.thetaLabel;var h=P.hi||i.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!i.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["r","theta","text"]),x.indexOf("r")!==-1&&b(l,a.rLabel),x.indexOf("theta")!==-1&&b(o,a.thetaLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),ere=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:kA(),categories:["polar","symbols","showLegend","scatter-like"],attributes:B6(),supplyDefaults:TA().supplyDefaults,colorbar:Mo(),formatLabels:SA(),calc:Jte(),plot:Qte(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:CA().hoverPoints,selectPoints:ed(),meta:{}}}),tre=ze((te,Y)=>{Y.exports=ere()}),$z=ze((te,Y)=>{var d=B6(),{cliponaxis:y,hoveron:z}=d,P=Zt(d,["cliponaxis","hoveron"]),{connectgaps:i,line:{color:n,dash:a,width:l},fill:o,fillcolor:u,marker:s,textfont:h,textposition:m}=A6();Y.exports=Dt(wt({},P),{connectgaps:i,fill:o,fillcolor:u,line:{color:n,dash:a,editType:"calc",width:l},marker:s,textfont:h,textposition:m})}),rre=ze((te,Y)=>{var d=ji(),y=Bc(),z=TA().handleRThetaDefaults,P=X0(),i=Pm(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=$z();Y.exports=function(u,s,h,m){function b(_,A){return d.coerce(u,s,o,_,A)}var x=z(u,s,m,b);if(!x){s.visible=!1;return}b("thetaunit"),b("mode",x{var d=SA();Y.exports=function(y,z,P){var i=y.i;return"r"in y||(y.r=z._r[i]),"theta"in y||(y.theta=z._theta[i]),d(y,z,P)}}),nre=ze((te,Y)=>{var d=zm(),y=yt().calcMarkerSize,z=Db(),P=Os(),i=q_().TOO_MANY_POINTS;Y.exports=function(n,a){var l=n._fullLayout,o=a.subplot,u=l[o].radialaxis,s=l[o].angularaxis,h=a._r=u.makeCalcdata(a,"r"),m=a._theta=s.makeCalcdata(a,"theta"),b=a._length,x={};b{var d=eA(),y=CA().makeHoverPointText;function z(P,i,n,a){var l=P.cd,o=l[0].t,u=o.r,s=o.theta,h=d.hoverPoints(P,i,n,a);if(!(!h||h[0].index===!1)){var m=h[0];if(m.index===void 0)return h;var b=P.subplot,x=m.cd[m.index],_=m.trace;if(x.r=u[m.index],x.theta=s[m.index],!!b.isPtInside(x))return m.xLabelVal=void 0,m.yLabelVal=void 0,y(x,_,b,m),h}}Y.exports={hoverPoints:z}}),ore=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:kA(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:$z(),supplyDefaults:rre(),colorbar:Mo(),formatLabels:ire(),calc:nre(),hoverPoints:are().hoverPoints,selectPoints:kD(),meta:{}}}),sre=ze((te,Y)=>{var d=rA(),y=Sr(),z=GD(),P=bD(),i=Db(),n=ji(),a=q_().TOO_MANY_POINTS,l={};Y.exports=function(o,u,s){if(s.length){var h=u.radialAxis,m=u.angularAxis,b=P(o,u);return s.forEach(function(x){if(!(!x||!x[0]||!x[0].trace)){var _=x[0],A=_.trace,f=_.t,k=A._length,w=f.r,D=f.theta,E=f.opts,I,M=w.slice(),p=D.slice();for(I=0;I=a&&(E.marker.cluster=f.tree),E.marker&&(E.markerSel.positions=E.markerUnsel.positions=E.marker.positions=g),E.line&&g.length>1&&n.extendFlat(E.line,i.linePositions(o,A,g)),E.text&&(n.extendFlat(E.text,{positions:g},i.textPosition(o,A,E.text,E.marker)),n.extendFlat(E.textSel,{positions:g},i.textPosition(o,A,E.text,E.markerSel)),n.extendFlat(E.textUnsel,{positions:g},i.textPosition(o,A,E.text,E.markerUnsel))),E.fill&&!b.fill2d&&(b.fill2d=!0),E.marker&&!b.scatter2d&&(b.scatter2d=!0),E.line&&!b.line2d&&(b.line2d=!0),E.text&&!b.glText&&(b.glText=!0),b.lineOptions.push(E.line),b.fillOptions.push(E.fill),b.markerOptions.push(E.marker),b.markerSelectedOptions.push(E.markerSel),b.markerUnselectedOptions.push(E.markerUnsel),b.textOptions.push(E.text),b.textSelectedOptions.push(E.textSel),b.textUnselectedOptions.push(E.textUnsel),b.selectBatch.push([]),b.unselectBatch.push([]),f.x=C,f.y=T,f.rawx=C,f.rawy=T,f.r=w,f.theta=D,f.positions=g,f._scene=b,f.index=b.count,b.count++}}),z(o,u,s)}},Y.exports.reglPrecompiled=l}),lre=ze((te,Y)=>{var d=ore();d.plot=sre(),Y.exports=d}),ure=ze((te,Y)=>{Y.exports=lre()}),Hz=ze((te,Y)=>{var{hovertemplateAttrs:d,templatefallbackAttrs:y}=rc(),z=nn().extendFlat,P=B6(),i=Xv();Y.exports={r:P.r,theta:P.theta,r0:P.r0,dr:P.dr,theta0:P.theta0,dtheta:P.dtheta,thetaunit:P.thetaunit,base:z({},i.base,{}),offset:z({},i.offset,{}),width:z({},i.width,{}),text:z({},i.text,{}),hovertext:z({},i.hovertext,{}),marker:n(),hoverinfo:P.hoverinfo,hovertemplate:d(),hovertemplatefallback:y(),selected:i.selected,unselected:i.unselected};function n(){var a=z({},i.marker);return delete a.cornerradius,a}}),Vz=ze((te,Y)=>{Y.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}),cre=ze((te,Y)=>{var d=ji(),y=TA().handleRThetaDefaults,z=MS(),P=Hz();Y.exports=function(i,n,a,l){function o(s,h){return d.coerce(i,n,P,s,h)}var u=y(i,n,l,o);if(!u){n.visible=!1;return}o("thetaunit"),o("base"),o("offset"),o("width"),o("text"),o("hovertext"),o("hovertemplate"),o("hovertemplatefallback"),z(i,n,o,a,l),d.coerceSelectionMarkerOpacity(n,o)}}),hre=ze((te,Y)=>{var d=ji(),y=Vz();Y.exports=function(z,P,i){var n={},a;function l(s,h){return d.coerce(z[a]||{},P[a],y,s,h)}for(var o=0;o{var d=hp().hasColorscale,y=Tp(),z=ji().isArrayOrTypedArray,P=W4(),i=Ur().setGroupPositions,n=$e(),a=as().traceIs,l=ji().extendFlat;function o(s,h){for(var m=s._fullLayout,b=h.subplot,x=m[b].radialaxis,_=m[b].angularaxis,A=x.makeCalcdata(h,"r"),f=_.makeCalcdata(h,"theta"),k=h._length,w=new Array(k),D=A,E=f,I=0;I{var d=ri(),y=Sr(),z=ji(),P=Zs(),i=wA();Y.exports=function(a,l,o){var u=a._context.staticPlot,s=l.xaxis,h=l.yaxis,m=l.radialAxis,b=l.angularAxis,x=n(l),_=l.layers.frontplot.select("g.barlayer");z.makeTraceGroups(_,o,"trace bars").each(function(){var A=d.select(this),f=z.ensureSingle(A,"g","points"),k=f.selectAll("g.point").data(z.identity);k.enter().append("g").style("vector-effect",u?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),k.exit().remove(),k.each(function(w){var D=d.select(this),E=w.rp0=m.c2p(w.s0),I=w.rp1=m.c2p(w.s1),M=w.thetag0=b.c2g(w.p0),p=w.thetag1=b.c2g(w.p1),g;if(!y(E)||!y(I)||!y(M)||!y(p)||E===I||M===p)g="M0,0Z";else{var C=m.c2g(w.s1),T=(M+p)/2;w.ct=[s.c2p(C*Math.cos(T)),h.c2p(C*Math.sin(T))],g=x(E,I,M,p)}z.ensureSingle(D,"path").attr("d",g)}),P.setClipUrl(A,l._hasClipOnAxisFalse?l.clipIds.forTraces:null,a)})};function n(a){var l=a.cxx,o=a.cyy;return a.vangles?function(u,s,h,m){var b,x;z.angleDelta(h,m)>0?(b=h,x=m):(b=m,x=h);var _=i.findEnclosingVertexAngles(b,a.vangles)[0],A=i.findEnclosingVertexAngles(x,a.vangles)[1],f=[_,(b+x)/2,A];return i.pathPolygonAnnulus(u,s,b,x,f,l,o)}:function(u,s,h,m){return z.pathAnnulus(u,s,h,m,l,o)}}}),dre=ze((te,Y)=>{var d=hf(),y=ji(),z=Ew().getTraceColor,P=y.fillText,i=CA().makeHoverPointText,n=wA().isPtInsidePolygon;Y.exports=function(a,l,o){var u=a.cd,s=u[0].trace,h=a.subplot,m=h.radialAxis,b=h.angularAxis,x=h.vangles,_=x?n:y.isPtInsideSector,A=a.maxHoverDistance,f=b._period||2*Math.PI,k=Math.abs(m.g2p(Math.sqrt(l*l+o*o))),w=Math.atan2(o,l);m.range[0]>m.range[1]&&(w+=Math.PI);var D=function(p){return _(k,w,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?A+Math.min(1,Math.abs(p.thetag1-p.thetag0)/f)-1+(p.rp1-k)/(p.rp1-p.rp0)-1:1/0};if(d.getClosest(u,D,a),a.index!==!1){var E=a.index,I=u[E];a.x0=a.x1=I.ct[0],a.y0=a.y1=I.ct[1];var M=y.extendFlat({},I,{r:I.s,theta:I.p});return P(I,s,a),i(M,s,h,a),a.hovertemplate=s.hovertemplate,a.color=z(s,I),a.xLabelVal=a.yLabelVal=void 0,I.s<0&&(a.idealAlign="left"),[a]}}}),pre=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"barpolar",basePlotModule:kA(),categories:["polar","bar","showLegend"],attributes:Hz(),layoutAttributes:Vz(),supplyDefaults:cre(),supplyLayoutDefaults:hre(),calc:Wz().calc,crossTraceCalc:Wz().crossTraceCalc,plot:fre(),colorbar:Mo(),formatLabels:SA(),style:Lg().style,styleOnSelect:Lg().styleOnSelect,hoverPoints:dre(),selectPoints:Lw(),meta:{}}}),mre=ze((te,Y)=>{Y.exports=pre()}),qz=ze((te,Y)=>{Y.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}),Gz=ze((te,Y)=>{var d=Mi(),y=Gd(),z=Xh().attributes,P=ji().extendFlat,i=oh().overrideAll,n=i({color:y.color,showline:P({},y.showline,{dflt:!0}),linecolor:y.linecolor,linewidth:y.linewidth,showgrid:P({},y.showgrid,{dflt:!0}),gridcolor:y.gridcolor,gridwidth:y.gridwidth,griddash:y.griddash},"plot","from-root"),a=i({ticklen:y.ticklen,tickwidth:P({},y.tickwidth,{dflt:2}),tickcolor:y.tickcolor,showticklabels:y.showticklabels,labelalias:y.labelalias,showtickprefix:y.showtickprefix,tickprefix:y.tickprefix,showticksuffix:y.showticksuffix,ticksuffix:y.ticksuffix,tickfont:y.tickfont,tickformat:y.tickformat,hoverformat:y.hoverformat,layer:y.layer},"plot","from-root"),l=P({visible:P({},y.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:P({},y.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},n,a),o=P({visible:P({},y.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:y.ticks,editType:"calc"},n,a);Y.exports={domain:z({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:l,imaginaryaxis:o,editType:"calc"}}),gre=ze((te,Y)=>{var d=ji(),y=Xi(),z=ku(),P=z_(),i=Ed().getSubplotData,n=Tg(),a=G0(),l=fb(),o=Z0(),u=Gz(),s=qz(),h=s.axisNames,m=x(function(_){return d.isTypedArray(_)&&(_=Array.from(_)),_.slice().reverse().map(function(A){return-A}).concat([0]).concat(_)},String);function b(_,A,f,k){var w=f("bgcolor");k.bgColor=y.combine(w,k.paper_bgcolor);var D=i(k.fullData,s.name,k.id),E=k.layoutOut,I;function M(G,ee){return f(I+"."+G,ee)}for(var p=0;p{var d=Ed().getSubplotCalcData,y=ji().counterRegex,z=jz(),P=qz(),i=P.attr,n=P.name,a=y(n),l={};l[i]={valType:"subplotid",dflt:n,editType:"calc"};function o(s){for(var h=s._fullLayout,m=s.calcdata,b=h._subplots[n],x=0;x{var{hovertemplateAttrs:d,texttemplateAttrs:y,templatefallbackAttrs:z}=rc(),P=nn().extendFlat,i=Lm(),n=ff(),a=xa(),l=n.line;Y.exports={mode:n.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:n.text,texttemplate:y({editType:"plot"},{keys:["real","imag","text"]}),texttemplatefallback:z({editType:"plot"}),hovertext:n.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:P({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,cliponaxis:P({},n.cliponaxis,{dflt:!1}),textposition:n.textposition,textfont:n.textfont,fill:P({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),hoverinfo:P({},a.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:n.hoveron,hovertemplate:d(),hovertemplatefallback:z(),selected:n.selected,unselected:n.unselected}}),yre=ze((te,Y)=>{var d=ji(),y=Bc(),z=X0(),P=Pm(),i=ny(),n=mm(),a=Im(),l=Mg().PTS_LINESONLY,o=Zz();Y.exports=function(s,h,m,b){function x(f,k){return d.coerce(s,h,o,f,k)}var _=u(s,h,b,x);if(!_){h.visible=!1;return}x("mode",_{var d=Os();Y.exports=function(y,z,P){var i={},n=P[z.subplot]._subplot;return i.realLabel=d.tickText(n.radialAxis,y.real,!0).text,i.imagLabel=d.tickText(n.angularAxis,y.imag,!0).text,i}}),xre=ze((te,Y)=>{var d=Sr(),y=ei().BADNUM,z=zm(),P=de(),i=$e(),n=yt().calcMarkerSize;Y.exports=function(a,l){for(var o=a._fullLayout,u=l.subplot,s=o[u].realaxis,h=o[u].imaginaryaxis,m=s.makeCalcdata(l,"real"),b=h.makeCalcdata(l,"imag"),x=l._length,_=new Array(x),A=0;A{var d=uo(),y=ei().BADNUM,z=Nz(),P=z.smith;Y.exports=function(i,n,a){for(var l=n.layers.frontplot.select("g.scatterlayer"),o=n.xaxis,u=n.yaxis,s={xaxis:o,yaxis:u,plot:n.framework,layerClipId:n._hasClipOnAxisFalse?n.clipIds.forTraces:null},h=0;h{var d=Kd();function y(P,i,n,a){var l=d(P,i,n,a);if(!(!l||l[0].index===!1)){var o=l[0];if(o.index===void 0)return l;var u=P.subplot,s=o.cd[o.index],h=o.trace;if(u.isPtInside(s))return o.xLabelVal=void 0,o.yLabelVal=void 0,z(s,h,u,o),o.hovertemplate=h.hovertemplate,l}}function z(P,i,n,a){var l=n.radialAxis,o=n.angularAxis;l._hovertitle="real",o._hovertitle="imag";var u={};u[i.subplot]={_subplot:n};var s=i._module.formatLabels(P,i,u);a.realLabel=s.realLabel,a.imagLabel=s.imagLabel;var h=P.hi||i.hoverinfo,m=[];function b(_,A){m.push(_._hovertitle+": "+A)}if(!i.hovertemplate){var x=h.split("+");x.indexOf("all")!==-1&&(x=["real","imag","text"]),x.indexOf("real")!==-1&&b(l,a.realLabel),x.indexOf("imag")!==-1&&b(o,a.imagLabel),x.indexOf("text")!==-1&&a.text&&(m.push(a.text),delete a.text),a.extraText=m.join("
")}}Y.exports={hoverPoints:y,makeHoverPointText:z}}),kre=ze((te,Y)=>{Y.exports={moduleType:"trace",name:"scattersmith",basePlotModule:vre(),categories:["smith","symbols","showLegend","scatter-like"],attributes:Zz(),supplyDefaults:yre(),colorbar:Mo(),formatLabels:_re(),calc:xre(),plot:bre(),style:El().style,styleOnSelect:El().styleOnSelect,hoverPoints:wre().hoverPoints,selectPoints:ed(),meta:{}}}),Tre=ze((te,Y)=>{Y.exports=kre()}),A0=ze((te,Y)=>{var d=Yd();function y(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}d(y.prototype,{instance:function(l,o){l=(l||"gregorian").toLowerCase(),o=o||"";var u=this._localCals[l+"-"+o];if(!u&&this.calendars[l]&&(u=new this.calendars[l](o),this._localCals[l+"-"+o]=u),!u)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,l);return u},newDate:function(l,o,u,s,h){return s=(l!=null&&l.year?l.calendar():typeof s=="string"?this.instance(s,h):s)||this.instance(),s.newDate(l,o,u)},substituteDigits:function(l){return function(o){return(o+"").replace(/[0-9]/g,function(u){return l[u]})}},substituteChineseDigits:function(l,o){return function(u){for(var s="",h=0;u>0;){var m=u%10;s=(m===0?"":l[m]+o[h])+s,h++,u=Math.floor(u/10)}return s.indexOf(l[1]+o[1])===0&&(s=s.substr(1)),s||l[0]}}});function z(l,o,u,s){if(this._calendar=l,this._year=o,this._month=u,this._day=s,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function P(l,o){return l=""+l,"000000".substring(0,o-l.length)+l}d(z.prototype,{newDate:function(l,o,u){return this._calendar.newDate(l??this,o,u)},year:function(l){return arguments.length===0?this._year:this.set(l,"y")},month:function(l){return arguments.length===0?this._month:this.set(l,"m")},day:function(l){return arguments.length===0?this._day:this.set(l,"d")},date:function(l,o,u){if(!this._calendar.isValid(l,o,u))throw(a.local.invalidDate||a.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=l,this._month=o,this._day=u,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(l,o){return this._calendar.add(this,l,o)},set:function(l,o){return this._calendar.set(this,l,o)},compareTo:function(l){if(this._calendar.name!==l._calendar.name)throw(a.local.differentCalendars||a.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,l._calendar.local.name);var o=this._year!==l._year?this._year-l._year:this._month!==l._month?this.monthOfYear()-l.monthOfYear():this._day-l._day;return o===0?0:o<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(l){return this._calendar.fromJD(l)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(l){return this._calendar.fromJSDate(l)},toString:function(){return(this.year()<0?"-":"")+P(Math.abs(this.year()),4)+"-"+P(this.month(),2)+"-"+P(this.day(),2)}});function i(){this.shortYearCutoff="+10"}d(i.prototype,{_validateLevel:0,newDate:function(l,o,u){return l==null?this.today():(l.year&&(this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),u=l.day(),o=l.month(),l=l.year()),new z(this,l,o,u))},today:function(){return this.fromJSDate(new Date)},epoch:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return o.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return(o.year()<0?"-":"")+P(Math.abs(o.year()),4)},monthsInYear:function(l){return this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear),12},monthOfYear:function(l,o){var u=this._validate(l,o,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth);return(u.month()+this.monthsInYear(u)-this.firstMonth)%this.monthsInYear(u)+this.minMonth},fromMonthOfYear:function(l,o){var u=(o+this.firstMonth-2*this.minMonth)%this.monthsInYear(l)+this.minMonth;return this._validate(l,u,this.minDay,a.local.invalidMonth||a.regionalOptions[""].invalidMonth),u},daysInYear:function(l){var o=this._validate(l,this.minMonth,this.minDay,a.local.invalidYear||a.regionalOptions[""].invalidYear);return this.leapYear(o)?366:365},dayOfYear:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate);return s.toJD()-this.newDate(s.year(),this.fromMonthOfYear(s.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(s))+2)%this.daysInWeek()},extraInfo:function(l,o,u){return this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),{}},add:function(l,o,u){return this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate),this._correctAdd(l,this._add(l,o,u),o,u)},_add:function(l,o,u){if(this._validateLevel++,u==="d"||u==="w"){var s=l.toJD()+o*(u==="w"?this.daysInWeek():1),h=l.calendar().fromJD(s);return this._validateLevel--,[h.year(),h.month(),h.day()]}try{var m=l.year()+(u==="y"?o:0),b=l.monthOfYear()+(u==="m"?o:0),h=l.day(),x=function(f){for(;bk-1+f.minMonth;)m++,b-=k,k=f.monthsInYear(m)};u==="y"?(l.month()!==this.fromMonthOfYear(m,b)&&(b=this.newDate(m,l.month(),this.minDay).monthOfYear()),b=Math.min(b,this.monthsInYear(m)),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b)))):u==="m"&&(x(this),h=Math.min(h,this.daysInMonth(m,this.fromMonthOfYear(m,b))));var _=[m,this.fromMonthOfYear(m,b),h];return this._validateLevel--,_}catch(A){throw this._validateLevel--,A}},_correctAdd:function(l,o,u,s){if(!this.hasYearZero&&(s==="y"||s==="m")&&(o[0]===0||l.year()>0!=o[0]>0)){var h={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[s],m=u<0?-1:1;o=this._add(l,u*h[0]+m*h[1],h[2])}return l.date(o[0],o[1],o[2])},set:function(l,o,u){this._validate(l,this.minMonth,this.minDay,a.local.invalidDate||a.regionalOptions[""].invalidDate);var s=u==="y"?o:l.year(),h=u==="m"?o:l.month(),m=u==="d"?o:l.day();return(u==="y"||u==="m")&&(m=Math.min(m,this.daysInMonth(s,h))),l.date(s,h,m)},isValid:function(l,o,u){this._validateLevel++;var s=this.hasYearZero||l!==0;if(s){var h=this.newDate(l,o,this.minDay);s=o>=this.minMonth&&o-this.minMonth=this.minDay&&u-this.minDay13.5?13:1),A=h-(_>2.5?4716:4715);return A<=0&&A--,this.newDate(A,_,x)},toJSDate:function(l,o,u){var s=this._validate(l,o,u,a.local.invalidDate||a.regionalOptions[""].invalidDate),h=new Date(s.year(),s.month()-1,s.day());return h.setHours(0),h.setMinutes(0),h.setSeconds(0),h.setMilliseconds(0),h.setHours(h.getHours()>12?h.getHours()+2:0),h},fromJSDate:function(l){return this.newDate(l.getFullYear(),l.getMonth()+1,l.getDate())}});var a=Y.exports=new y;a.cdate=z,a.baseCalendar=i,a.calendars.gregorian=n}),Sre=ze(()=>{var te=Yd(),Y=A0();te(Y.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),Y.local=Y.regionalOptions[""],te(Y.cdate.prototype,{formatDate:function(d,y){return typeof d!="string"&&(y=d,d=""),this._calendar.formatDate(d||"",this,y)}}),te(Y.baseCalendar.prototype,{UNIX_EPOCH:Y.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:1440*60,TICKS_EPOCH:Y.instance().jdEpoch,TICKS_PER_DAY:1440*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(d,y,z){if(typeof d!="string"&&(z=y,y=d,d=""),!y)return"";if(y.calendar()!==this)throw Y.local.invalidFormat||Y.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,z=z||{};for(var P=z.dayNamesShort||this.local.dayNamesShort,i=z.dayNames||this.local.dayNames,n=z.monthNumbers||this.local.monthNumbers,a=z.monthNamesShort||this.local.monthNamesShort,l=z.monthNames||this.local.monthNames,o=z.calculateWeek||this.local.calculateWeek,u=function(D,E){for(var I=1;w+I1},s=function(D,E,I,M){var p=""+E;if(u(D,M))for(;p.length1},k=function(N,B){var U=f(N,B),V=[2,3,U?4:2,U?4:2,10,11,20]["oyYJ@!".indexOf(N)+1],W=new RegExp("^-?\\d{1,"+V+"}"),F=y.substring(p).match(W);if(!F)throw(Y.local.missingNumberAt||Y.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=F[0].length,parseInt(F[0],10)},w=this,D=function(){if(typeof l=="function"){f("m");var N=l.call(w,y.substring(p));return p+=N.length,N}return k("m")},E=function(N,B,U,V){for(var W=f(N,V)?U:B,F=0;F-1){m=1,b=x;for(var T=this.daysInMonth(h,m);b>T;T=this.daysInMonth(h,m))m++,b-=T}return s>-1?this.fromJD(s):this.newDate(h,m,b)},determineDate:function(d,y,z,P,i){z&&typeof z!="object"&&(i=P,P=z,z=null),typeof P!="string"&&(i=P,P="");var n=this,a=function(l){try{return n.parseDate(P,l,i)}catch{}l=l.toLowerCase();for(var o=(l.match(/^c/)&&z?z.newDate():null)||n.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=u.exec(l);s;)o.add(parseInt(s[1],10),s[2]||"d"),s=u.exec(l);return o};return y=y?y.newDate():null,d=d==null?y:typeof d=="string"?a(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?y:n.today().add(d,"d"):n.newDate(d),d}})}),Cre=ze(()=>{var te=A0(),Y=Yd(),d=te.instance();function y(s){this.local=this.regionalOptions[s||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(s,h){if(typeof s=="string"){var m=s.match(P);return m?m[0]:""}var b=this._validateYear(s),x=s.month(),_=""+this.toChineseMonth(b,x);return h&&_.length<2&&(_="0"+_),this.isIntercalaryMonth(b,x)&&(_+="i"),_},monthNames:function(s){if(typeof s=="string"){var h=s.match(i);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},monthNamesShort:function(s){if(typeof s=="string"){var h=s.match(n);return h?h[0]:""}var m=this._validateYear(s),b=s.month(),x=this.toChineseMonth(m,b),_=["一","二","三","四","五","六","七","八","九","十","十一","十二"][x-1];return this.isIntercalaryMonth(m,b)&&(_="闰"+_),_},parseMonth:function(s,h){s=this._validateYear(s);var m=parseInt(h),b;if(isNaN(m))h[0]==="闰"&&(b=!0,h=h.substring(1)),h[h.length-1]==="月"&&(h=h.substring(0,h.length-1)),m=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(h);else{var x=h[h.length-1];b=x==="i"||x==="I"}var _=this.toMonthIndex(s,m,b);return _},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(s,h){if(s.year&&(s=s.year()),typeof s!="number"||s<1888||s>2111)throw h.replace(/\{0\}/,this.local.name);return s},toMonthIndex:function(s,h,m){var b=this.intercalaryMonth(s),x=m&&h!==b;if(x||h<1||h>12)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var _;return b?!m&&h<=b?_=h-1:_=h:_=h-1,_},toChineseMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s),b=m?12:11;if(h<0||h>b)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var x;return m?h>13;return m},isIntercalaryMonth:function(s,h){s.year&&(s=s.year(),h=s.month());var m=this.intercalaryMonth(s);return!!m&&m===h},leapYear:function(s){return this.intercalaryMonth(s)!==0},weekOfYear:function(s,h,m){var b=this._validateYear(s,te.local.invalidyear),x=l[b-l[0]],_=x>>9&4095,A=x>>5&15,f=x&31,k;k=d.newDate(_,A,f),k.add(4-(k.dayOfWeek()||7),"d");var w=this.toJD(s,h,m)-k.toJD();return 1+Math.floor(w/7)},monthsInYear:function(s){return this.leapYear(s)?13:12},daysInMonth:function(s,h){s.year&&(h=s.month(),s=s.year()),s=this._validateYear(s);var m=a[s-a[0]],b=m>>13,x=b?12:11;if(h>x)throw te.local.invalidMonth.replace(/\{0\}/,this.local.name);var _=m&1<<12-h?30:29;return _},weekDay:function(s,h,m){return(this.dayOfWeek(s,h,m)||7)<6},toJD:function(s,h,m){var b=this._validate(s,_,m,te.local.invalidDate);s=this._validateYear(b.year()),h=b.month(),m=b.day();var x=this.isIntercalaryMonth(s,h),_=this.toChineseMonth(s,h),A=u(s,_,m,x);return d.toJD(A.year,A.month,A.day)},fromJD:function(s){var h=d.fromJD(s),m=o(h.year(),h.month(),h.day()),b=this.toMonthIndex(m.year,m.month,m.isIntercalary);return this.newDate(m.year,b,m.day)},fromString:function(s){var h=s.match(z),m=this._validateYear(+h[1]),b=+h[2],x=!!h[3],_=this.toMonthIndex(m,b,x),A=+h[4];return this.newDate(m,_,A)},add:function(s,h,m){var b=s.year(),x=s.month(),_=this.isIntercalaryMonth(b,x),A=this.toChineseMonth(b,x),f=Object.getPrototypeOf(y.prototype).add.call(this,s,h,m);if(m==="y"){var k=f.year(),w=f.month(),D=this.isIntercalaryMonth(k,A),E=_&&D?this.toMonthIndex(k,A,!0):this.toMonthIndex(k,A,!1);E!==w&&f.month(E)}return f}});var z=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,P=/^\d?\d[iI]?/m,i=/^闰?十?[一二三四五六七八九]?月/m,n=/^闰?十?[一二三四五六七八九]?/m;te.calendars.chinese=y;var a=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],l=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function o(s,h,m,b){var x,_;if(typeof s=="object")x=s,_=h||{};else{var A=typeof s=="number"&&s>=1888&&s<=2111;if(!A)throw new Error("Solar year outside range 1888-2111");var f=typeof h=="number"&&h>=1&&h<=12;if(!f)throw new Error("Solar month outside range 1 - 12");var k=typeof m=="number"&&m>=1&&m<=31;if(!k)throw new Error("Solar day outside range 1 - 31");x={year:s,month:h,day:m},_={}}var w=l[x.year-l[0]],D=x.year<<9|x.month<<5|x.day;_.year=D>=w?x.year:x.year-1,w=l[_.year-l[0]];var E=w>>9&4095,I=w>>5&15,M=w&31,p,g=new Date(E,I-1,M),C=new Date(x.year,x.month-1,x.day);p=Math.round((C-g)/(24*3600*1e3));var T=a[_.year-a[0]],N;for(N=0;N<13;N++){var B=T&1<<12-N?30:29;if(p>13;return!U||N=1888&&s<=2111;if(!f)throw new Error("Lunar year outside range 1888-2111");var k=typeof h=="number"&&h>=1&&h<=12;if(!k)throw new Error("Lunar month outside range 1 - 12");var w=typeof m=="number"&&m>=1&&m<=30;if(!w)throw new Error("Lunar day outside range 1 - 30");var D;typeof b=="object"?(D=!1,_=b):(D=!!b,_={}),A={year:s,month:h,day:m,isIntercalary:D}}var E;E=A.day-1;var I=a[A.year-a[0]],M=I>>13,p;M&&(A.month>M||A.isIntercalary)?p=A.month:p=A.month-1;for(var g=0;g>9&4095,B=T>>5&15,U=T&31,V=new Date(N,B-1,U+E);return _.year=V.getFullYear(),_.month=1+V.getMonth(),_.day=V.getDate(),_}}),Are=ze(()=>{var te=A0(),Y=Yd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),y<0&&y++,i.day()+(i.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var i=Math.floor(z/30)+1,n=z-(i-1)*30+1;return this.newDate(P,i,n)}}),te.calendars.coptic=d}),Mre=ze(()=>{var te=A0(),Y=Yd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),!1},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),13},daysInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),400},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return(n.day()+1)%8},weekDay:function(z,P,i){var n=this.dayOfWeek(z,P,i);return n>=2&&n<=6},extraInfo:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return{century:y[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return z=n.year()+(n.year()<0?1:0),P=n.month(),i=n.day(),i+(P>1?16:0)+(P>2?(P-2)*32:0)+(z-1)*400+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z+.5)-Math.floor(this.jdEpoch)-1;var P=Math.floor(z/400)+1;z-=(P-1)*400,z+=z>15?16:0;var i=Math.floor(z/32)+1,n=z-(i-1)*32+1;return this.newDate(P<=0?P-1:P,i,n)}});var y={20:"Fruitbat",21:"Anchovy"};te.calendars.discworld=d}),Ere=ze(()=>{var te=A0(),Y=Yd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()+(z.year()<0?1:0);return P%4===3||P%4===-1},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear),13},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===13&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),y<0&&y++,i.day()+(i.month()-1)*30+(y-1)*365+Math.floor(y/4)+this.jdEpoch-1},fromJD:function(y){var z=Math.floor(y)+.5-this.jdEpoch,P=Math.floor((z-Math.floor((z+366)/1461))/365)+1;P<=0&&P--,z=Math.floor(y)+.5-this.newDate(P,1,1).toJD();var i=Math.floor(z/30)+1,n=z-(i-1)*30+1;return this.newDate(P,i,n)}}),te.calendars.ethiopian=d}),Lre=ze(()=>{var te=A0(),Y=Yd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return this._leapYear(P.year())},_leapYear:function(z){return z=z<0?z+1:z,y(z*7+1,19)<7},monthsInYear:function(z){return this._validate(z,this.minMonth,this.minDay,te.local.invalidYear),this._leapYear(z.year?z.year():z)?13:12},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return z=P.year(),this.toJD(z===-1?1:z+1,7,1)-this.toJD(z,7,1)},daysInMonth:function(z,P){return z.year&&(P=z.month(),z=z.year()),this._validate(z,P,this.minDay,te.local.invalidMonth),P===12&&this.leapYear(z)||P===8&&y(this.daysInYear(z),10)===5?30:P===9&&y(this.daysInYear(z),10)===3?29:this.daysPerMonth[P-1]},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==6},extraInfo:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);z=n.year(),P=n.month(),i=n.day();var a=z<=0?z+1:z,l=this.jdEpoch+this._delay1(a)+this._delay2(a)+i+1;if(P<7){for(var o=7;o<=this.monthsInYear(z);o++)l+=this.daysInMonth(z,o);for(var o=1;o=this.toJD(P===-1?1:P+1,7,1);)P++;for(var i=zthis.toJD(P,i,this.daysInMonth(P,i));)i++;var n=z-this.toJD(P,i,1)+1;return this.newDate(P,i,n)}});function y(z,P){return z-P*Math.floor(z/P)}te.calendars.hebrew=d}),Pre=ze(()=>{var te=A0(),Y=Yd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,te.local.invalidYear);return(z.year()*11+14)%30<11},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(y){return this.leapYear(y)?355:354},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===12&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==5},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),z=i.month(),P=i.day(),y=y<=0?y+1:y,P+Math.ceil(29.5*(z-1))+(y-1)*354+Math.floor((3+11*y)/30)+this.jdEpoch-1},fromJD:function(y){y=Math.floor(y)+.5;var z=Math.floor((30*(y-this.jdEpoch)+10646)/10631);z=z<=0?z-1:z;var P=Math.min(12,Math.ceil((y-29-this.toJD(z,1,1))/29.5)+1),i=y-this.toJD(z,P,1)+1;return this.newDate(z,P,i)}}),te.calendars.islamic=d}),Ire=ze(()=>{var te=A0(),Y=Yd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(P){var z=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),P=z.year()<0?z.year()+1:z.year();return P%4===0},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(4-(i.dayOfWeek()||7),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInMonth:function(y,z){var P=this._validate(y,z,this.minDay,te.local.invalidMonth);return this.daysPerMonth[P.month()-1]+(P.month()===2&&this.leapYear(P.year())?1:0)},weekDay:function(y,z,P){return(this.dayOfWeek(y,z,P)||7)<6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);return y=i.year(),z=i.month(),P=i.day(),y<0&&y++,z<=2&&(y--,z+=12),Math.floor(365.25*(y+4716))+Math.floor(30.6001*(z+1))+P-1524.5},fromJD:function(y){var z=Math.floor(y+.5),P=z+1524,i=Math.floor((P-122.1)/365.25),n=Math.floor(365.25*i),a=Math.floor((P-n)/30.6001),l=a-Math.floor(a<14?1:13),o=i-Math.floor(l>2?4716:4715),u=P-n-Math.floor(30.6001*a);return o<=0&&o--,this.newDate(o,l,u)}}),te.calendars.julian=d}),Dre=ze(()=>{var te=A0(),Y=Yd();function d(P){this.local=this.regionalOptions[P||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),!1},formatYear:function(P){var i=this._validate(P,this.minMonth,this.minDay,te.local.invalidYear);P=i.year();var n=Math.floor(P/400);P=P%400,P+=P<0?400:0;var a=Math.floor(P/20);return n+"."+a+"."+P%20},forYear:function(P){if(P=P.split("."),P.length<3)throw"Invalid Mayan year";for(var i=0,n=0;n19||n>0&&a<0)throw"Invalid Mayan year";i=i*20+a}return i},monthsInYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),18},weekOfYear:function(P,i,n){return this._validate(P,i,n,te.local.invalidDate),0},daysInYear:function(P){return this._validate(P,this.minMonth,this.minDay,te.local.invalidYear),360},daysInMonth:function(P,i){return this._validate(P,i,this.minDay,te.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate);return a.day()},weekDay:function(P,i,n){return this._validate(P,i,n,te.local.invalidDate),!0},extraInfo:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate),l=a.toJD(),o=this._toHaab(l),u=this._toTzolkin(l);return{haabMonthName:this.local.haabMonths[o[0]-1],haabMonth:o[0],haabDay:o[1],tzolkinDayName:this.local.tzolkinMonths[u[0]-1],tzolkinDay:u[0],tzolkinTrecena:u[1]}},_toHaab:function(P){P-=this.jdEpoch;var i=y(P+8+340,365);return[Math.floor(i/20)+1,y(i,20)]},_toTzolkin:function(P){return P-=this.jdEpoch,[z(P+20,20),z(P+4,13)]},toJD:function(P,i,n){var a=this._validate(P,i,n,te.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(P){P=Math.floor(P)+.5-this.jdEpoch;var i=Math.floor(P/360);P=P%360,P+=P<0?360:0;var n=Math.floor(P/20),a=P%20;return this.newDate(i,n,a)}});function y(P,i){return P-i*Math.floor(P/i)}function z(P,i){return y(P-1,i)+1}te.calendars.mayan=d}),zre=ze(()=>{var te=A0(),Y=Yd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar;var y=te.instance("gregorian");Y(d.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear||te.regionalOptions[""].invalidYear);return y.leapYear(P.year()+(P.year()<1?1:0)+1469)},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===12&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidMonth),a=n.year();a<0&&a++;for(var l=n.day(),o=1;o=this.toJD(P+1,1,1);)P++;for(var i=z-Math.floor(this.toJD(P,1,1)+.5)+1,n=1;i>this.daysInMonth(P,n);)i-=this.daysInMonth(P,n),n++;return this.newDate(P,n,i)}}),te.calendars.nanakshahi=d}),Ore=ze(()=>{var te=A0(),Y=Yd();function d(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(y){return this.daysInYear(y)!==this.daysPerYear},weekOfYear:function(y,z,P){var i=this.newDate(y,z,P);return i.add(-i.dayOfWeek(),"d"),Math.floor((i.dayOfYear()-1)/7)+1},daysInYear:function(y){var z=this._validate(y,this.minMonth,this.minDay,te.local.invalidYear);if(y=z.year(),typeof this.NEPALI_CALENDAR_DATA[y]>"u")return this.daysPerYear;for(var P=0,i=this.minMonth;i<=12;i++)P+=this.NEPALI_CALENDAR_DATA[y][i];return P},daysInMonth:function(y,z){return y.year&&(z=y.month(),y=y.year()),this._validate(y,z,this.minDay,te.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[y]>"u"?this.daysPerMonth[z-1]:this.NEPALI_CALENDAR_DATA[y][z]},weekDay:function(y,z,P){return this.dayOfWeek(y,z,P)!==6},toJD:function(y,z,P){var i=this._validate(y,z,P,te.local.invalidDate);y=i.year(),z=i.month(),P=i.day();var n=te.instance(),a=0,l=z,o=y;this._createMissingCalendarData(y);var u=y-(l>9||l===9&&P>=this.NEPALI_CALENDAR_DATA[o][0]?56:57);for(z!==9&&(a=P,l--);l!==9;)l<=0&&(l=12,o--),a+=this.NEPALI_CALENDAR_DATA[o][l],l--;return z===9?(a+=P-this.NEPALI_CALENDAR_DATA[o][0],a<0&&(a+=n.daysInYear(u))):a+=this.NEPALI_CALENDAR_DATA[o][9]-this.NEPALI_CALENDAR_DATA[o][0],n.newDate(u,1,1).add(a,"d").toJD()},fromJD:function(y){var z=te.instance(),P=z.fromJD(y),i=P.year(),n=P.dayOfYear(),a=i+56;this._createMissingCalendarData(a);for(var l=9,o=this.NEPALI_CALENDAR_DATA[a][0],u=this.NEPALI_CALENDAR_DATA[a][l]-o+1;n>u;)l++,l>12&&(l=1,a++),u+=this.NEPALI_CALENDAR_DATA[a][l];var s=this.NEPALI_CALENDAR_DATA[a][l]-(u-n);return this.newDate(a,l,s)},_createMissingCalendarData:function(y){var z=this.daysPerMonth.slice(0);z.unshift(17);for(var P=y-1;P"u"&&(this.NEPALI_CALENDAR_DATA[P]=z)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),te.calendars.nepali=d}),Bre=ze(()=>{var te=A0(),Y=Yd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}function y(z){var P=z-475;z<0&&P++;var i=.242197,n=i*P,a=i*(P+1),l=n-Math.floor(n),o=a-Math.floor(a);return l>o}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chahārshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return y(P.year())},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-((n.dayOfWeek()+1)%7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===12&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==5},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate);z=n.year(),P=n.month(),i=n.day();var a=0;if(z>0)for(var l=1;l0?z-1:z)*365+a+this.jdEpoch-1},fromJD:function(z){z=Math.floor(z)+.5;var P=475+(z-this.toJD(475,1,1))/365.242197,i=Math.floor(P);i<=0&&i--,z>this.toJD(i,12,y(i)?30:29)&&(i++,i===0&&i++);var n=z-this.toJD(i,1,1)+1,a=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),l=z-this.toJD(i,a,1)+1;return this.newDate(i,a,l)}}),te.calendars.persian=d,te.calendars.jalali=d}),Rre=ze(()=>{var te=A0(),Y=Yd(),d=te.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(i){var P=this._validate(i,this.minMonth,this.minDay,te.local.invalidYear),i=this._t2gYear(P.year());return d.leapYear(i)},weekOfYear:function(a,P,i){var n=this._validate(a,this.minMonth,this.minDay,te.local.invalidYear),a=this._t2gYear(n.year());return d.weekOfYear(a,n.month(),n.day())},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===2&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidDate),a=this._t2gYear(n.year());return d.toJD(a,n.month(),n.day())},fromJD:function(z){var P=d.fromJD(z),i=this._g2tYear(P.year());return this.newDate(i,P.month(),P.day())},_t2gYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)},_g2tYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)}}),te.calendars.taiwan=y}),Fre=ze(()=>{var te=A0(),Y=Yd(),d=te.instance();function y(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}y.prototype=new te.baseCalendar,Y(y.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(i){var P=this._validate(i,this.minMonth,this.minDay,te.local.invalidYear),i=this._t2gYear(P.year());return d.leapYear(i)},weekOfYear:function(a,P,i){var n=this._validate(a,this.minMonth,this.minDay,te.local.invalidYear),a=this._t2gYear(n.year());return d.weekOfYear(a,n.month(),n.day())},daysInMonth:function(z,P){var i=this._validate(z,P,this.minDay,te.local.invalidMonth);return this.daysPerMonth[i.month()-1]+(i.month()===2&&this.leapYear(i.year())?1:0)},weekDay:function(z,P,i){return(this.dayOfWeek(z,P,i)||7)<6},toJD:function(a,P,i){var n=this._validate(a,P,i,te.local.invalidDate),a=this._t2gYear(n.year());return d.toJD(a,n.month(),n.day())},fromJD:function(z){var P=d.fromJD(z),i=this._g2tYear(P.year());return this.newDate(i,P.month(),P.day())},_t2gYear:function(z){return z-this.yearsOffset-(z>=1&&z<=this.yearsOffset?1:0)},_g2tYear:function(z){return z+this.yearsOffset+(z>=-this.yearsOffset&&z<=-1?1:0)}}),te.calendars.thai=y}),Nre=ze(()=>{var te=A0(),Y=Yd();function d(z){this.local=this.regionalOptions[z||""]||this.regionalOptions[""]}d.prototype=new te.baseCalendar,Y(d.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(z){var P=this._validate(z,this.minMonth,this.minDay,te.local.invalidYear);return this.daysInYear(P.year())===355},weekOfYear:function(z,P,i){var n=this.newDate(z,P,i);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(z){for(var P=0,i=1;i<=12;i++)P+=this.daysInMonth(z,i);return P},daysInMonth:function(z,P){for(var i=this._validate(z,P,this.minDay,te.local.invalidMonth),n=i.toJD()-24e5+.5,a=0,l=0;ln)return y[a]-y[a-1];a++}return 30},weekDay:function(z,P,i){return this.dayOfWeek(z,P,i)!==5},toJD:function(z,P,i){var n=this._validate(z,P,i,te.local.invalidDate),a=12*(n.year()-1)+n.month()-15292,l=n.day()+y[a-1]-1;return l+24e5-.5},fromJD:function(z){for(var P=z-24e5+.5,i=0,n=0;nP);n++)i++;var a=i+15292,l=Math.floor((a-1)/12),o=l+1,u=a-12*l,s=P-y[i-1]+1;return this.newDate(o,u,s)},isValid:function(z,P,i){var n=te.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(z=z.year!=null?z.year:z,n=z>=1276&&z<=1500),n},_validate:function(z,P,i,n){var a=te.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),te.calendars.ummalqura=d;var y=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}),jre=ze((te,Y)=>{Y.exports=A0(),Sre(),Cre(),Are(),Mre(),Ere(),Lre(),Pre(),Ire(),Dre(),zre(),Ore(),Bre(),Rre(),Fre(),Nre()}),Ure=ze((te,Y)=>{var d=jre(),y=ji(),z=ei(),P=z.EPOCHJD,i=z.ONEDAY,n={valType:"enumerated",values:y.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},a=function(I,M,p,g){var C={};return C[p]=n,y.coerce(I,M,C,p,g)},l=function(I,M,p,g){for(var C=0;C{Y.exports=Ure()}),Hre=ze((te,Y)=>{var d=xq();d.register([Tq(),Aq(),Pq(),Bq(),jq(),Vq(),Gq(),nG(),dG(),TG(),zG(),eK(),oK(),qK(),tY(),uY(),gY(),DY(),RY(),NY(),HY(),ZY(),QY(),iX(),yX(),bX(),nQ(),_Q(),IQ(),FQ(),ZQ(),JQ(),oee(),_ee(),kee(),Pee(),qee(),Jee(),ate(),Mte(),Bte(),Ute(),qte(),Yte(),tre(),ure(),mre(),Tre(),$re()]),Y.exports=d});return Hre()})();/*! * pad-left * * Copyright (c) 2014-2015, Jon Schlinkert. @@ -3988,7 +3988,7 @@ maplibre-gl/dist/maplibre-gl.js: * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt *) -*/return window.Plotly=r,r})}(vT)),vT.exports}var PH=Jxe();const D1=r$(PH),W7=kie({__proto__:null,default:D1},[PH]),Qxe={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},ebe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},tbe={class:"flex items-center gap-2 sm:gap-3"},rbe=["value"],ibe={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},nbe={class:"glass-card rounded-[15px] p-3 sm:p-6"},abe={class:"mb-4 sm:mb-6"},obe={class:"relative h-40 sm:h-48 bg-white/5 rounded-lg p-2 sm:p-4"},sbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},lbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},ube={class:"mb-4 sm:mb-6"},cbe={class:"relative h-40 sm:h-48 bg-white/5 rounded-lg p-2 sm:p-4"},hbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},fbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},dbe={class:"glass-card rounded-[15px] p-3 sm:p-6"},pbe={class:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6"},mbe={class:"lg:col-span-2"},gbe={class:"relative h-48 sm:h-64 bg-white/5 rounded-lg p-2 sm:p-4"},vbe={class:"flex flex-col items-center justify-center"},ybe={class:"relative w-40 h-40 sm:w-48 sm:h-48"},_be={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm rounded-full z-20"},xbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 rounded-full z-20"},bbe={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},wbe={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},kbe={class:"text-white/60 text-sm"},Tbe=Uu({name:"StatisticsView",__name:"Statistics",setup(t){a_.register(lH,uH,Y$,a4,B$,z$,O$,aH,sH,iH,G$,J$,tH,ZT);const e=i4(),r=vn(null),c=vn(!1),S=vn(24),H=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}],Z=vn(null),ue=vn(null),be=vn([]),Se=vn(null),Re=vn([]),Xe=vn(!0),vt=vn(null),bt=vn({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0}),kt=vn(!1),Dt=vn(!1),rr=vn(!1),Er=vn(null),Fe=vn(null),wi=vn(null),ur=vn(null),Ir=vn(null),Ti=vn(null),_i=vn(null),Ci=Do(()=>{const Yn=e.packetStats;return Yn?{totalRx:Yn.total_packets||0,totalTx:Yn.transmitted_packets||0}:{totalRx:0,totalTx:0}}),ii=Do(()=>{let Yn=[],sn=[];if(Z.value?.series){const an=Z.value.series.find(Ra=>Ra.type==="rx_count"),zn=Z.value.series.find(Ra=>Ra.type==="tx_count");an?.data&&(Yn=an.data.map(([,Ra])=>Ra)),zn?.data&&(sn=zn.data.map(([,Ra])=>Ra))}return{totalPackets:Yn,transmittedPackets:sn,droppedPackets:[]}}),Ji=async()=>{try{Xe.value=!0,vt.value=null,await Promise.all([e.fetchPacketStats({hours:S.value}),e.fetchSystemStats()]),Xe.value=!1,vi()}catch(Yn){vt.value=Yn instanceof Error?Yn.message:"Failed to fetch data",Xe.value=!1}},vi=async()=>{bt.value={packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0};const Yn=[vr(),dr(),Ar(),ti()];try{await Promise.allSettled(Yn),await x0(),!ur.value||!Ir.value?setTimeout(()=>{Di()},100):Di()}catch(sn){console.error("Error loading chart data:",sn)}},vr=async()=>{bt.value.packetRate=!0;try{const Yn=await zs.get("/metrics_graph_data",{hours:S.value,resolution:"average",metrics:"rx_count,tx_count"});Yn?.success&&(Z.value=Yn.data)}catch{Z.value=null}},dr=async()=>{bt.value.packetType=!0;try{const Yn=await zs.get("/packet_type_graph_data",{hours:S.value,resolution:"average",types:"all"});if(Yn?.success&&Yn.data){const sn=Yn.data;be.value=sn.series||[]}}catch{be.value=[]}},Ar=async()=>{bt.value.routePie=!0;try{const Yn=await zs.get("/route_stats",{hours:S.value});Yn?.success&&Yn.data&&(Se.value=Yn.data)}catch{Se.value=null}},ti=async()=>{try{const Yn=await zs.get("/noise_floor_history",{hours:S.value});if(Yn.success&&Yn.data){const an=Yn.data.history||[];Array.isArray(an)&&an.length>0&&(ue.value={chart_data:an.map(zn=>({timestamp:zn.timestamp||Date.now()/1e3,noise_floor_dbm:zn.noise_floor_dbm||zn.noise_floor||-120}))},ei())}}catch{ue.value={chart_data:[]}}},Xr=()=>{qn(),kt.value=!1,Dt.value=!1,rr.value=!1,Ji()},ei=()=>{if(Re.value=[],ue.value?.chart_data&&ue.value.chart_data.length>0){const Yn=ue.value.chart_data,sn=Math.max(1,Math.floor(Yn.length/100));Re.value=Yn.filter((an,zn)=>zn%sn===0).map(an=>({timestamp:an.timestamp*1e3,snr:null,rssi:null,noiseFloor:an.noise_floor_dbm}))}},Di=()=>{if(!c.value){c.value=!0;try{Qn(),ka(),Ta(),so(),setTimeout(()=>{bt.value.packetRate&&Er.value&&(bt.value.packetRate=!1),bt.value.packetType&&Fe.value&&(bt.value.packetType=!1),bt.value.routePie&&_i.value&&(bt.value.routePie=!1),bt.value.routePie&&_i.value&&(bt.value.routePie=!1),setTimeout(()=>{const Yn=Ou(Er.value),sn=Ou(Fe.value),an=Ou(wi.value);Yn&&Yn.update("none"),sn&&sn.update("none"),an&&an.update("none")},50)},100)}catch(Yn){console.error("Error creating/updating charts:",Yn),qn()}finally{c.value=!1}}},qn=()=>{try{Er.value&&(Er.value.destroy(),Er.value=null),Fe.value&&(Fe.value.destroy(),Fe.value=null),wi.value&&(wi.value.destroy(),wi.value=null),_i.value&&D1.purge(_i.value)}catch(Yn){console.error("Error destroying charts:",Yn)}},Qn=()=>{if(!ur.value){bt.value.packetRate=!1;return}const Yn=ur.value.getContext("2d");if(!Yn){bt.value.packetRate=!1;return}let sn=[],an=[];if(Z.value?.series){const zn=Z.value.series.find(Ya=>Ya.type==="rx_count"),Ra=Z.value.series.find(Ya=>Ya.type==="tx_count");zn?.data&&(sn=zn.data.map(([Ya,zo])=>{let _a=Ya;return Ya>1e15?_a=Ya/1e3:Ya>1e12?_a=Ya:Ya>1e9?_a=Ya*1e3:_a=Date.now(),{x:_a,y:zo}})),Ra?.data&&(an=Ra.data.map(([Ya,zo])=>{let _a=Ya;return Ya>1e15?_a=Ya/1e3:Ya>1e12?_a=Ya:Ya>1e9?_a=Ya*1e3:_a=Date.now(),{x:_a,y:zo}}))}if(sn.length===0&&an.length===0){kt.value=!0,bt.value.packetRate=!1;return}kt.value=!1,Er.value&&(Er.value.destroy(),Er.value=null);try{const zn=JSON.parse(JSON.stringify(sn)),Ra=JSON.parse(JSON.stringify(an)),Ya=new a_(Yn,{type:"line",data:{datasets:[{label:"RX/hr",data:zn,borderColor:"#C084FC",backgroundColor:"rgba(192, 132, 252, 0.1)",borderWidth:2,fill:!0,tension:.4},{label:"TX/hr",data:Ra,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",callback:function(zo){return typeof zo=="number"?zo.toFixed(3):zo},stepSize:.002},min:0,max:.012}}}});Er.value=Ou(Ya),bt.value.packetRate=!1,setTimeout(()=>{bt.value.packetRate&&(bt.value.packetRate=!1)},50)}catch(zn){console.error("Error creating packet rate chart:",zn),kt.value=!0,bt.value.packetRate=!1}},ka=()=>{if(!Ir.value){bt.value.packetType=!1;return}const Yn=Ir.value.getContext("2d");if(!Yn){bt.value.packetType=!1;return}const sn=[],an=[],zn=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(be.value.length>0)be.value.forEach(Ra=>{const Ya=Ra.data?Ra.data.reduce((zo,_a)=>zo+_a[1],0):0;Ya>0&&(sn.push(Ra.name.replace(/\([^)]*\)/g,"").trim()),an.push(Ya))});else{Dt.value=!0,bt.value.packetType=!1;return}Dt.value=!1,Fe.value&&(Fe.value.destroy(),Fe.value=null);try{const Ra=JSON.parse(JSON.stringify(sn)),Ya=JSON.parse(JSON.stringify(an)),zo=new a_(Yn,{type:"bar",data:{labels:Ra,datasets:[{data:Ya,backgroundColor:zn.slice(0,Ya.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});Fe.value=Ou(zo),bt.value.packetType=!1,setTimeout(()=>{bt.value.packetType&&(bt.value.packetType=!1)},50)}catch(Ra){console.error("Error creating packet type chart:",Ra),Dt.value=!0,bt.value.packetType=!1}},Ta=()=>{if(!Ti.value)return;const Yn=Ti.value.getContext("2d");if(!Yn)return;const sn=Re.value.map(Ra=>({x:Ra.timestamp,y:Ra.noiseFloor})).filter(Ra=>Ra.y!==null&&Ra.y!==void 0);if(wi.value)try{const Ra=Ou(wi.value),Ya=JSON.parse(JSON.stringify(sn));Ra.data.datasets[0]&&(Ra.data.datasets[0].data=Ya),Ra.update("active");return}catch{wi.value.destroy(),wi.value=null}const an=JSON.parse(JSON.stringify(sn)),zn=new a_(Yn,{type:"line",data:{datasets:[{label:"Noise Floor (dBm)",data:an,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:3,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:"rgba(255, 255, 255, 0.8)",usePointStyle:!0,padding:20}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:"rgba(255, 255, 255, 0.8)"},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",stepSize:.5,callback:function(Ra){return typeof Ra=="number"?Ra.toFixed(1):Ra}},min:-117,max:-113}}}});wi.value=Ou(zn)},so=()=>{if(!_i.value){bt.value.routePie=!1;return}if(!Se.value||!Se.value.route_totals){rr.value=!0,bt.value.routePie=!1;return}rr.value=!1;const Yn=Se.value.route_totals,sn=Object.keys(Yn),an=Object.values(Yn),zn=["#3B82F6","#F87171","#10B981","#F59E0B","#A78BFA"];try{const Ra=JSON.parse(JSON.stringify(sn)),Ya=JSON.parse(JSON.stringify(an)),zo=[{type:"pie",labels:Ra,values:Ya,marker:{colors:zn.slice(0,Ya.length)},hovertemplate:"%{label}
Count: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",pull:.1,hole:.3}],_a={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},Ur={responsive:!0,displayModeBar:!1,staticPlot:!1};D1.newPlot(_i.value,zo,_a,Ur),bt.value.routePie=!1,setTimeout(()=>{bt.value.routePie&&(bt.value.routePie=!1)},50)}catch(Ra){console.error("Error creating 3D route pie chart:",Ra),rr.value=!0,bt.value.routePie=!1}};return ud(async()=>{await x0(),Ji(),r.value=window.setInterval(Ji,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{Ou(Er.value)?.resize(),Ou(Fe.value)?.resize(),Ou(wi.value)?.resize(),_i.value&&D1.Plots&&D1.Plots.resize(_i.value)},100)})}),$g(()=>{r.value&&clearInterval(r.value),Er.value?.destroy(),Fe.value?.destroy(),wi.value?.destroy(),_i.value&&D1.purge(_i.value),window.removeEventListener("resize",()=>{})}),(Yn,sn)=>(Wr(),Qr("div",Qxe,[Le("div",ebe,[sn[2]||(sn[2]=Le("h2",{class:"text-xl sm:text-2xl font-bold text-white"},"Statistics",-1)),Le("div",tbe,[sn[1]||(sn[1]=Le("label",{class:"text-white/70 text-xs sm:text-sm"},"Time Range:",-1)),Sl(Le("select",{"onUpdate:modelValue":sn[0]||(sn[0]=an=>S.value=an),onChange:Xr,class:"bg-white/10 border border-white/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-white text-xs sm:text-sm focus:outline-none focus:border-accent-purple/50 transition-colors"},[(Wr(),Qr(js,null,au(H,an=>Le("option",{key:an.value,value:an.value,class:"bg-gray-800 text-white"},Si(an.label),9,rbe)),64))],544),[[_g,S.value]])])]),Le("div",ibe,[il(Av,{title:"Total RX",value:Ci.value.totalRx,color:"#AAE8E8",data:ii.value.totalPackets},null,8,["value","data"]),il(Av,{title:"Total TX",value:Ci.value.totalTx,color:"#FFC246",data:ii.value.transmittedPackets},null,8,["value","data"])]),Le("div",nbe,[sn[9]||(sn[9]=Le("h3",{class:"text-white text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),Le("div",abe,[sn[5]||(sn[5]=qc('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),Le("div",obe,[Le("canvas",{ref_key:"packetRateCanvasRef",ref:ur,class:"w-full h-full relative z-10"},null,512),bt.value.packetRate?(Wr(),Qr("div",sbe,sn[3]||(sn[3]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-purple-400 rounded-full mx-auto mb-2"}),Le("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):Ma("",!0),kt.value&&!bt.value.packetRate?(Wr(),Qr("div",lbe,sn[4]||(sn[4]=[Le("div",{class:"text-center"},[Le("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Le("div",{class:"text-white/50 text-xs"},"Packet rate data not found")],-1)]))):Ma("",!0)])]),Le("div",ube,[sn[8]||(sn[8]=Le("p",{class:"text-white/70 text-xs sm:text-sm uppercase tracking-wide mb-2"},"Packet Type Distribution",-1)),Le("div",cbe,[Le("canvas",{ref_key:"packetTypeCanvasRef",ref:Ir,class:"w-full h-full relative z-10"},null,512),bt.value.packetType?(Wr(),Qr("div",hbe,sn[6]||(sn[6]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-blue-400 rounded-full mx-auto mb-2"}),Le("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading packet type data...")],-1)]))):Ma("",!0),Dt.value&&!bt.value.packetType?(Wr(),Qr("div",fbe,sn[7]||(sn[7]=[Le("div",{class:"text-center"},[Le("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Le("div",{class:"text-white/50 text-xs"},"Packet type data not found")],-1)]))):Ma("",!0)])])]),Le("div",dbe,[sn[13]||(sn[13]=Le("h3",{class:"text-white text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Noise Floor Over Time",-1)),Le("div",pbe,[Le("div",mbe,[Le("div",gbe,[Le("canvas",{ref_key:"signalMetricsCanvasRef",ref:Ti,class:"w-full h-full"},null,512)])]),Le("div",vbe,[sn[12]||(sn[12]=Le("p",{class:"text-white/70 text-xs sm:text-sm uppercase tracking-wide mb-2"},"Route Distribution",-1)),Le("div",ybe,[Le("div",{ref_key:"signalPie3DRef",ref:_i,class:"w-full h-full relative z-10"},null,512),bt.value.routePie?(Wr(),Qr("div",_be,sn[10]||(sn[10]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Le("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading route data...")],-1)]))):Ma("",!0),rr.value&&!bt.value.routePie?(Wr(),Qr("div",xbe,sn[11]||(sn[11]=[Le("div",{class:"text-center"},[Le("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Le("div",{class:"text-white/50 text-xs"},"Route statistics not found")],-1)]))):Ma("",!0)])])])]),Xe.value?(Wr(),Qr("div",bbe,sn[14]||(sn[14]=[Le("div",{class:"text-white/70 mb-2 text-sm"},"Loading statistics...",-1),Le("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ma("",!0),vt.value?(Wr(),Qr("div",wbe,[sn[15]||(sn[15]=Le("div",{class:"text-red-400 mb-2 text-sm"},"Failed to load statistics",-1)),Le("p",kbe,Si(vt.value),1),Le("button",{onClick:Ji,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):Ma("",!0)]))}}),Sbe=kh(Tbe,[["__scopeId","data-v-f0302052"]]),Cbe="modulepreload",Abe=function(t){return"/"+t},pF={},T5=function(e,r,c){let S=Promise.resolve();if(r&&r.length>0){let Se=function(Re){return Promise.all(Re.map(Xe=>Promise.resolve(Xe).then(vt=>({status:"fulfilled",value:vt}),vt=>({status:"rejected",reason:vt}))))};var Z=Se;document.getElementsByTagName("link");const ue=document.querySelector("meta[property=csp-nonce]"),be=ue?.nonce||ue?.getAttribute("nonce");S=Se(r.map(Re=>{if(Re=Abe(Re),Re in pF)return;pF[Re]=!0;const Xe=Re.endsWith(".css"),vt=Xe?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Re}"]${vt}`))return;const bt=document.createElement("link");if(bt.rel=Xe?"stylesheet":Cbe,Xe||(bt.as="script"),bt.crossOrigin="",bt.href=Re,be&&bt.setAttribute("nonce",be),document.head.appendChild(bt),Xe)return new Promise((kt,Dt)=>{bt.addEventListener("load",kt),bt.addEventListener("error",()=>Dt(new Error(`Unable to preload CSS for ${Re}`)))})}))}function H(ue){const be=new Event("vite:preloadError",{cancelable:!0});if(be.payload=ue,window.dispatchEvent(be),!be.defaultPrevented)throw ue}return S.then(ue=>{for(const be of ue||[])be.status==="rejected"&&H(be.reason);return e().catch(H)})},Mbe={class:"p-6 space-y-6"},Ebe={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},Lbe={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Pbe={class:"glass-card rounded-[15px] p-6"},Ibe={class:"relative h-32 bg-white/5 rounded-lg p-4 mb-4 chart-container"},Dbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},zbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Obe={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Bbe={class:"text-white font-semibold"},Rbe={class:"text-white font-semibold"},Fbe={class:"text-white font-semibold"},Nbe={class:"text-white font-semibold"},jbe={class:"glass-card rounded-[15px] p-6"},Ube={class:"relative h-32 bg-white/5 rounded-lg p-4 mb-4 chart-container"},$be={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Hbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Vbe={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Wbe={class:"text-white font-semibold"},qbe={class:"text-white font-semibold"},Gbe={class:"text-white font-semibold"},Zbe={class:"text-white font-semibold"},Kbe={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Ybe={class:"glass-card rounded-[15px] p-6"},Xbe={class:"relative h-48"},Jbe={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},Qbe={class:"text-center"},e2e={class:"text-white font-semibold"},t2e={class:"text-center"},r2e={class:"font-semibold text-red-400"},i2e={class:"text-center"},n2e={class:"font-semibold text-green-400"},a2e={class:"glass-card rounded-[15px] p-6"},o2e={key:0,class:"space-y-4"},s2e={class:"grid grid-cols-2 gap-4 text-sm"},l2e={class:"text-white font-semibold"},u2e={class:"text-white font-semibold"},c2e={class:"text-white font-semibold"},h2e={class:"text-white font-semibold"},f2e={key:0,class:"pt-4 border-t border-white/10"},d2e={class:"grid grid-cols-2 gap-2 text-sm"},p2e={class:"text-white/60"},m2e={class:"text-white font-semibold ml-1"},g2e={class:"glass-card rounded-[15px] p-6"},v2e={key:0,class:"overflow-x-auto"},y2e={class:"w-full text-sm"},_2e={class:"text-white/80 py-2 transition-all duration-300"},x2e={class:"text-white font-semibold py-2 transition-all duration-300"},b2e={class:"text-center text-orange-400 py-2 transition-all duration-300"},w2e={class:"text-center text-green-400 py-2 transition-all duration-300"},k2e={class:"text-right text-white/80 py-2 transition-all duration-300"},T2e={key:0,class:"mt-4 text-center text-white/60 text-sm transition-all duration-300"},S2e={key:1,class:"text-center text-white/60 py-8"},C2e={key:0,class:"glass-card rounded-[15px] p-8 text-center"},A2e={key:1,class:"glass-card rounded-[15px] p-8 text-center"},M2e={class:"text-white/60 text-sm"},E2e=Uu({name:"SystemStatsView",__name:"SystemStats",setup(t){a_.register(lH,uH,Y$,a4,B$,z$,O$,aH,sH,iH,G$,J$,tH,ZT);const e=vn(null),r=vn(!0),c=vn(null),S=vn(null),H=vn(null),Z=vn([]),ue=vn(null),be=vn({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),Se=vn(!1),Re=vn(!1),Xe=vn(null),vt=vn(null),bt=vn(null),kt=vn(null),Dt=vn(null),rr=Do(()=>S.value?{cpuUsage:S.value.cpu.usage_percent,memoryUsage:S.value.memory.usage_percent,diskUsage:S.value.disk.usage_percent,uptime:S.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),Er=Do(()=>Z.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:Z.value.map(dr=>dr.cpu.usage_percent),memory:Z.value.map(dr=>dr.memory.usage_percent),disk:Z.value.map(dr=>dr.disk.usage_percent),network:Z.value.map(dr=>dr.network.bytes_recv/1024/1024)}),Fe=dr=>{const Ar=["B","KB","MB","GB","TB"];if(dr===0)return"0 B";const ti=Math.floor(Math.log(dr)/Math.log(1024));return parseFloat((dr/Math.pow(1024,ti)).toFixed(2))+" "+Ar[ti]},wi=dr=>{const Ar=Math.floor(dr/86400),ti=Math.floor(dr%86400/3600),Xr=Math.floor(dr%3600/60);return Ar>0?`${Ar}d ${ti}h ${Xr}m`:ti>0?`${ti}h ${Xr}m`:`${Xr}m`},ur=async()=>{try{const dr=await zs.get("/hardware_stats");if(dr?.success&&dr.data){const Ar=dr.data;if(S.value=Ar,Z.value.length===0)for(let Xr=0;Xr<12;Xr++)Z.value.push(JSON.parse(JSON.stringify(Ar)));else Z.value.push(Ar),Z.value.length>20&&Z.value.shift()}}catch(dr){console.error("Failed to fetch hardware stats:",dr),c.value="Failed to fetch hardware stats"}},Ir=async()=>{try{const dr=await zs.get("/hardware_processes");dr?.success&&dr.data&&(ue.value=H.value,H.value=dr.data)}catch(dr){console.error("Failed to fetch process stats:",dr)}},Ti=(dr,Ar)=>{if(!ue.value)return!1;const ti=ue.value.processes.find(Xr=>Xr.pid===dr.pid);return ti?ti[Ar]!==dr[Ar]:!0},_i=async()=>{try{r.value=!0,c.value=null,await Promise.all([ur(),Ir()]),r.value=!1,await x0(),Ci()}catch(dr){c.value=dr instanceof Error?dr.message:"Failed to fetch system data",r.value=!1}},Ci=()=>{S.value&&(ii(),Ji(),vi())},ii=()=>{if(!bt.value||!S.value){be.value.cpuChart=!1;return}const dr=bt.value.getContext("2d");if(!dr){be.value.cpuChart=!1;return}const Ar=S.value.cpu.usage_percent,ti=100-Ar;if(Xe.value)try{Xe.value.data.datasets[0].data=[Ar,ti],Xe.value.update("none");return}catch(Xr){console.warn("Failed to update CPU chart, recreating...",Xr),Xe.value.destroy(),Xe.value=null}try{const Xr=new a_(dr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Ar,ti],backgroundColor:["#FFC246","rgba(255, 255, 255, 0.1)"],borderColor:["#FFC246","rgba(255, 255, 255, 0.2)"],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(ei){return`${ei.label}: ${ei.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(ei){const Di=ei.ctx;Di.save();const qn=(ei.chartArea.left+ei.chartArea.right)/2,Qn=(ei.chartArea.top+ei.chartArea.bottom)/2;Di.textAlign="center",Di.textBaseline="middle",Di.fillStyle="#FFC246",Di.font="bold 18px sans-serif",Di.fillText(`${Ar.toFixed(1)}%`,qn,Qn-5),Di.fillStyle="rgba(255, 255, 255, 0.6)",Di.font="10px sans-serif",Di.fillText("CPU",qn,Qn+12),Di.restore()}}]});Xe.value=Ou(Xr),Se.value=!1,be.value.cpuChart=!1}catch(Xr){console.error("Error creating CPU chart:",Xr),Se.value=!0,be.value.cpuChart=!1}},Ji=()=>{if(!kt.value||!S.value){be.value.memoryChart=!1;return}const dr=kt.value.getContext("2d");if(!dr){be.value.memoryChart=!1;return}const Ar=S.value.memory.usage_percent,ti=100-Ar;if(vt.value)try{vt.value.data.datasets[0].data=[Ar,ti],vt.value.update("none");return}catch(Xr){console.warn("Failed to update Memory chart, recreating...",Xr),vt.value.destroy(),vt.value=null}try{const Xr=new a_(dr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Ar,ti],backgroundColor:["#A5E5B6","rgba(255, 255, 255, 0.1)"],borderColor:["#A5E5B6","rgba(255, 255, 255, 0.2)"],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(ei){return`${ei.label}: ${ei.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(ei){const Di=ei.ctx;Di.save();const qn=(ei.chartArea.left+ei.chartArea.right)/2,Qn=(ei.chartArea.top+ei.chartArea.bottom)/2;Di.textAlign="center",Di.textBaseline="middle",Di.fillStyle="#A5E5B6",Di.font="bold 18px sans-serif",Di.fillText(`${Ar.toFixed(1)}%`,qn,Qn-5),Di.fillStyle="rgba(255, 255, 255, 0.6)",Di.font="10px sans-serif",Di.fillText("Memory",qn,Qn+12),Di.restore()}}]});vt.value=Ou(Xr),Re.value=!1,be.value.memoryChart=!1}catch(Xr){console.error("Error creating Memory chart:",Xr),Re.value=!0,be.value.memoryChart=!1}},vi=()=>{if(!(!Dt.value||!S.value))try{T5(()=>Promise.resolve().then(()=>W7),void 0).then(dr=>{const Ar=dr.default||dr,ti=S.value.disk,Xr=[{type:"pie",labels:["Used","Free"],values:[ti.used,ti.free],marker:{colors:["#FB787B","#A5E5B6"]},hovertemplate:"%{label}
Size: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",hole:.4}],ei={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},Di={responsive:!0,displayModeBar:!1,staticPlot:!1};Ar.newPlot(Dt.value,Xr,ei,Di)})}catch(dr){console.error("Error creating disk chart:",dr)}},vr=()=>{try{if(Xe.value&&(Xe.value.destroy(),Xe.value=null),vt.value&&(vt.value.destroy(),vt.value=null),Dt.value)try{T5(()=>Promise.resolve().then(()=>W7),void 0).then(dr=>{const Ar=dr?.default||dr;Ar?.purge&&Ar.purge(Dt.value)}).catch(()=>{})}catch{}}catch(dr){console.error("Error destroying charts:",dr)}};return ud(async()=>{await x0(),_i(),e.value=window.setInterval(_i,5e3),window.addEventListener("resize",()=>{setTimeout(()=>{Ou(Xe.value)?.resize(),Ou(vt.value)?.resize();try{T5(()=>Promise.resolve().then(()=>W7),void 0).then(dr=>{const Ar=dr?.default||dr;Ar?.Plots&&Ar.Plots.resize(Dt.value)}).catch(()=>{})}catch{}},100)})}),$g(()=>{e.value&&clearInterval(e.value),vr(),window.removeEventListener("resize",()=>{})}),(dr,Ar)=>(Wr(),Qr("div",Mbe,[Ar[28]||(Ar[28]=Le("div",{class:"flex justify-between items-center"},[Le("h2",{class:"text-2xl font-bold text-white"},"System Statistics"),Le("div",{class:"text-white/60 text-sm"}," Updates every 5 seconds ")],-1)),Le("div",Ebe,[il(Av,{title:"CPU Usage",value:`${rr.value.cpuUsage.toFixed(1)}%`,color:"#FFC246",data:Er.value.cpu},null,8,["value","data"]),il(Av,{title:"Memory Usage",value:`${rr.value.memoryUsage.toFixed(1)}%`,color:"#A5E5B6",data:Er.value.memory},null,8,["value","data"]),il(Av,{title:"Disk Usage",value:`${rr.value.diskUsage.toFixed(1)}%`,color:"#FB787B",data:Er.value.disk},null,8,["value","data"]),il(Av,{title:"Uptime",value:wi(rr.value.uptime),color:"#EBA0FC",data:Er.value.network},null,8,["value","data"])]),Le("div",Lbe,[Le("div",Pbe,[Ar[6]||(Ar[6]=Le("h3",{class:"text-white text-xl font-semibold mb-4"},"CPU Performance",-1)),Le("div",Ibe,[Le("canvas",{ref_key:"cpuCanvasRef",ref:bt,class:"w-full h-full relative z-10"},null,512),be.value.cpuChart?(Wr(),Qr("div",Dbe,Ar[0]||(Ar[0]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-6 h-6 border-2 border-white/20 border-t-orange-400 rounded-full mx-auto mb-2"}),Le("div",{class:"text-white/50 text-xs"},"Loading CPU data...")],-1)]))):Ma("",!0),Se.value&&!be.value.cpuChart?(Wr(),Qr("div",zbe,Ar[1]||(Ar[1]=[Le("div",{class:"text-center"},[Le("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Le("div",{class:"text-white/50 text-xs"},"CPU data not found")],-1)]))):Ma("",!0)]),S.value?(Wr(),Qr("div",Obe,[Le("div",null,[Ar[2]||(Ar[2]=Le("div",{class:"text-white/60"},"CPU Count",-1)),Le("div",Bbe,Si(S.value.cpu.count)+" cores",1)]),Le("div",null,[Ar[3]||(Ar[3]=Le("div",{class:"text-white/60"},"Frequency",-1)),Le("div",Rbe,Si(S.value.cpu.frequency.toFixed(0))+" MHz",1)]),Le("div",null,[Ar[4]||(Ar[4]=Le("div",{class:"text-white/60"},"Load (1m)",-1)),Le("div",Fbe,Si(S.value.cpu.load_avg["1min"].toFixed(2)),1)]),Le("div",null,[Ar[5]||(Ar[5]=Le("div",{class:"text-white/60"},"Load (5m)",-1)),Le("div",Nbe,Si(S.value.cpu.load_avg["5min"].toFixed(2)),1)])])):Ma("",!0)]),Le("div",jbe,[Ar[13]||(Ar[13]=Le("h3",{class:"text-white text-xl font-semibold mb-4"},"Memory Usage",-1)),Le("div",Ube,[Le("canvas",{ref_key:"memoryCanvasRef",ref:kt,class:"w-full h-full relative z-10"},null,512),be.value.memoryChart?(Wr(),Qr("div",$be,Ar[7]||(Ar[7]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-6 h-6 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Le("div",{class:"text-white/50 text-xs"},"Loading memory data...")],-1)]))):Ma("",!0),Re.value&&!be.value.memoryChart?(Wr(),Qr("div",Hbe,Ar[8]||(Ar[8]=[Le("div",{class:"text-center"},[Le("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Le("div",{class:"text-white/50 text-xs"},"Memory data not found")],-1)]))):Ma("",!0)]),S.value?(Wr(),Qr("div",Vbe,[Le("div",null,[Ar[9]||(Ar[9]=Le("div",{class:"text-white/60"},"Total",-1)),Le("div",Wbe,Si(Fe(S.value.memory.total)),1)]),Le("div",null,[Ar[10]||(Ar[10]=Le("div",{class:"text-white/60"},"Used",-1)),Le("div",qbe,Si(Fe(S.value.memory.used)),1)]),Le("div",null,[Ar[11]||(Ar[11]=Le("div",{class:"text-white/60"},"Available",-1)),Le("div",Gbe,Si(Fe(S.value.memory.available)),1)]),Le("div",null,[Ar[12]||(Ar[12]=Le("div",{class:"text-white/60"},"Usage",-1)),Le("div",Zbe,Si(S.value.memory.usage_percent.toFixed(1))+"%",1)])])):Ma("",!0)])]),Le("div",Kbe,[Le("div",Ybe,[Ar[17]||(Ar[17]=Le("h3",{class:"text-white text-xl font-semibold mb-4"},"Storage Usage",-1)),Le("div",Xbe,[Le("div",{ref_key:"diskCanvasRef",ref:Dt,class:"w-full h-full"},null,512)]),S.value?(Wr(),Qr("div",Jbe,[Le("div",Qbe,[Ar[14]||(Ar[14]=Le("div",{class:"text-white/60"},"Total",-1)),Le("div",e2e,Si(Fe(S.value.disk.total)),1)]),Le("div",t2e,[Ar[15]||(Ar[15]=Le("div",{class:"text-white/60"},"Used",-1)),Le("div",r2e,Si(Fe(S.value.disk.used)),1)]),Le("div",i2e,[Ar[16]||(Ar[16]=Le("div",{class:"text-white/60"},"Free",-1)),Le("div",n2e,Si(Fe(S.value.disk.free)),1)])])):Ma("",!0)]),Le("div",a2e,[Ar[23]||(Ar[23]=Le("h3",{class:"text-white text-xl font-semibold mb-4"},"Network Statistics",-1)),S.value?(Wr(),Qr("div",o2e,[Le("div",s2e,[Le("div",null,[Ar[18]||(Ar[18]=Le("div",{class:"text-white/60"},"Bytes Sent",-1)),Le("div",l2e,Si(Fe(S.value.network.bytes_sent)),1)]),Le("div",null,[Ar[19]||(Ar[19]=Le("div",{class:"text-white/60"},"Bytes Received",-1)),Le("div",u2e,Si(Fe(S.value.network.bytes_recv)),1)]),Le("div",null,[Ar[20]||(Ar[20]=Le("div",{class:"text-white/60"},"Packets Sent",-1)),Le("div",c2e,Si(S.value.network.packets_sent.toLocaleString()),1)]),Le("div",null,[Ar[21]||(Ar[21]=Le("div",{class:"text-white/60"},"Packets Received",-1)),Le("div",h2e,Si(S.value.network.packets_recv.toLocaleString()),1)])]),S.value.temperatures&&Object.keys(S.value.temperatures).length>0?(Wr(),Qr("div",f2e,[Ar[22]||(Ar[22]=Le("div",{class:"text-white/60 mb-2"},"System Temperatures",-1)),Le("div",d2e,[(Wr(!0),Qr(js,null,au(S.value.temperatures,(ti,Xr)=>(Wr(),Qr("div",{key:Xr},[Le("span",p2e,Si(Xr)+":",1),Le("span",m2e,Si(ti.toFixed(1))+"°C",1)]))),128))])])):Ma("",!0)])):Ma("",!0)])]),Le("div",g2e,[Ar[25]||(Ar[25]=Le("h3",{class:"text-white text-xl font-semibold mb-4"},"Top Processes",-1)),H.value?.processes&&H.value.processes.length>0?(Wr(),Qr("div",v2e,[Le("table",y2e,[Ar[24]||(Ar[24]=Le("thead",null,[Le("tr",{class:"border-b border-white/10"},[Le("th",{class:"text-left text-white/70 py-2"},"PID"),Le("th",{class:"text-left text-white/70 py-2"},"Name"),Le("th",{class:"text-center text-white/70 py-2"},"CPU %"),Le("th",{class:"text-center text-white/70 py-2"},"Memory %"),Le("th",{class:"text-right text-white/70 py-2"},"Memory")])],-1)),Le("tbody",null,[(Wr(!0),Qr(js,null,au(H.value.processes.slice(0,10),ti=>(Wr(),Qr("tr",{key:ti.pid,class:"border-b border-white/5 process-row"},[Le("td",_2e,Si(ti.pid),1),Le("td",x2e,Si(ti.name),1),Le("td",b2e,[Le("span",{class:eo(["cpu-value",{"value-updated":Ti(ti,"cpu_percent")}])},Si(ti.cpu_percent.toFixed(1))+"% ",3)]),Le("td",w2e,[Le("span",{class:eo(["memory-value",{"value-updated":Ti(ti,"memory_percent")}])},Si(ti.memory_percent.toFixed(1))+"% ",3)]),Le("td",k2e,[Le("span",{class:eo({"value-updated":Ti(ti,"memory_mb")})},Si(ti.memory_mb.toFixed(1))+" MB ",3)])]))),128))])]),H.value.total_processes?(Wr(),Qr("div",T2e," Showing top 10 of "+Si(H.value.total_processes)+" total processes ",1)):Ma("",!0)])):r.value?Ma("",!0):(Wr(),Qr("div",S2e," No process data available "))]),r.value?(Wr(),Qr("div",C2e,Ar[26]||(Ar[26]=[Le("div",{class:"text-white/70 mb-2"},"Loading system statistics...",-1),Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):Ma("",!0),c.value?(Wr(),Qr("div",A2e,[Ar[27]||(Ar[27]=Le("div",{class:"text-red-400 mb-2"},"Failed to load system statistics",-1)),Le("p",M2e,Si(c.value),1),Le("button",{onClick:_i,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):Ma("",!0)]))}}),L2e=kh(E2e,[["__scopeId","data-v-04026a5d"]]),P2e={class:"space-y-4"},I2e={key:0,class:"bg-green-500/10 border border-green-500/30 rounded-lg p-3"},D2e={class:"text-green-400 text-sm"},z2e={key:1,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},O2e={class:"text-red-400 text-sm"},B2e={class:"flex justify-end gap-2"},R2e=["disabled"],F2e=["disabled"],N2e={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},j2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},U2e={key:0,class:"text-white font-mono text-sm"},$2e={key:1,class:"flex items-center gap-2"},H2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},V2e={key:0,class:"text-white font-mono text-sm"},W2e={key:1},q2e=["value"],G2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Z2e={key:0,class:"text-white font-mono text-sm"},K2e={key:1},Y2e=["value"],X2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},J2e={key:0,class:"text-white font-mono text-sm"},Q2e={key:1,class:"flex items-center gap-2"},ewe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},twe={key:0,class:"text-white font-mono text-sm"},rwe={key:1},iwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},nwe={class:"text-white font-mono text-sm"},awe={key:2,class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},owe=Uu({__name:"RadioSettings",setup(t){const e=kg(),r=Do(()=>e.stats?.config?.radio||{}),c=vn(!1),S=vn(!1),H=vn(null),Z=vn(null),ue=vn(0),be=vn(0),Se=vn(0),Re=vn(0),Xe=vn(0),vt=vn(0),bt=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];w0(r,_i=>{_i&&!c.value&&(ue.value=_i.frequency?Number((_i.frequency/1e6).toFixed(3)):0,be.value=_i.spreading_factor??0,Se.value=_i.bandwidth?Number((_i.bandwidth/1e3).toFixed(1)):0,Re.value=_i.tx_power??0,Xe.value=_i.coding_rate??0,vt.value=_i.preamble_length??0)},{immediate:!0});const kt=Do(()=>{const _i=r.value.frequency;return _i?(_i/1e6).toFixed(3)+" MHz":"Not set"}),Dt=Do(()=>{const _i=r.value.bandwidth;return _i?(_i/1e3).toFixed(1)+" kHz":"Not set"}),rr=Do(()=>{const _i=r.value.tx_power;return _i!==void 0?_i+" dBm":"Not set"}),Er=Do(()=>{const _i=r.value.coding_rate;return _i?"4/"+_i:"Not set"}),Fe=Do(()=>{const _i=r.value.preamble_length;return _i?_i+" symbols":"Not set"}),wi=Do(()=>r.value.spreading_factor??"Not set"),ur=()=>{c.value=!0,H.value=null,Z.value=null},Ir=()=>{c.value=!1,H.value=null;const _i=r.value;ue.value=_i.frequency?Number((_i.frequency/1e6).toFixed(3)):0,be.value=_i.spreading_factor??0,Se.value=_i.bandwidth?Number((_i.bandwidth/1e3).toFixed(1)):0,Re.value=_i.tx_power??0,Xe.value=_i.coding_rate??0,vt.value=_i.preamble_length??0},Ti=async()=>{S.value=!0,H.value=null,Z.value=null;try{const _i={};ue.value&&(_i.frequency=ue.value*1e6),be.value&&(_i.spreading_factor=be.value),Se.value&&(_i.bandwidth=Se.value*1e3),Re.value&&(_i.tx_power=Re.value),Xe.value&&(_i.coding_rate=Xe.value);const ii=(await zs.post("/update_radio_config",_i)).data;ii.message||ii.persisted?(Z.value=ii.message||"Settings saved successfully",c.value=!1,await e.fetchStats(),setTimeout(()=>{Z.value=null},3e3)):ii.error?H.value=ii.error:H.value="Unknown response from server"}catch(_i){console.error("Failed to update radio settings:",_i);const Ci=_i;H.value=Ci.response?.data?.error||"Failed to update settings"}finally{S.value=!1}};return(_i,Ci)=>(Wr(),Qr("div",P2e,[Z.value?(Wr(),Qr("div",I2e,[Le("p",D2e,Si(Z.value),1)])):Ma("",!0),H.value?(Wr(),Qr("div",z2e,[Le("p",O2e,Si(H.value),1)])):Ma("",!0),Le("div",B2e,[c.value?(Wr(),Qr(js,{key:1},[Le("button",{onClick:Ir,disabled:S.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,R2e),Le("button",{onClick:Ti,disabled:S.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},Si(S.value?"Saving...":"Save Changes"),9,F2e)],64)):(Wr(),Qr("button",{key:0,onClick:ur,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Le("div",N2e,[Le("div",j2e,[Ci[6]||(Ci[6]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Frequency",-1)),c.value?(Wr(),Qr("div",$2e,[Sl(Le("input",{"onUpdate:modelValue":Ci[0]||(Ci[0]=ii=>ue.value=ii),type:"number",step:"0.001",min:"100",max:"1000",class:"w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,ue.value,void 0,{number:!0}]]),Ci[5]||(Ci[5]=Le("span",{class:"text-white/50 text-sm"},"MHz",-1))])):(Wr(),Qr("div",U2e,Si(kt.value),1))]),Le("div",H2e,[Ci[7]||(Ci[7]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Spreading Factor",-1)),c.value?(Wr(),Qr("div",W2e,[Sl(Le("select",{"onUpdate:modelValue":Ci[1]||(Ci[1]=ii=>be.value=ii),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},[(Wr(),Qr(js,null,au([5,6,7,8,9,10,11,12],ii=>Le("option",{key:ii,value:ii},Si(ii),9,q2e)),64))],512),[[_g,be.value,void 0,{number:!0}]])])):(Wr(),Qr("div",V2e,Si(wi.value),1))]),Le("div",G2e,[Ci[8]||(Ci[8]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Bandwidth",-1)),c.value?(Wr(),Qr("div",K2e,[Sl(Le("select",{"onUpdate:modelValue":Ci[2]||(Ci[2]=ii=>Se.value=ii),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},[(Wr(),Qr(js,null,au(bt,ii=>Le("option",{key:ii.value,value:ii.value},Si(ii.label),9,Y2e)),64))],512),[[_g,Se.value,void 0,{number:!0}]])])):(Wr(),Qr("div",Z2e,Si(Dt.value),1))]),Le("div",X2e,[Ci[10]||(Ci[10]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"TX Power",-1)),c.value?(Wr(),Qr("div",Q2e,[Sl(Le("input",{"onUpdate:modelValue":Ci[3]||(Ci[3]=ii=>Re.value=ii),type:"number",min:"2",max:"30",class:"w-20 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,Re.value,void 0,{number:!0}]]),Ci[9]||(Ci[9]=Le("span",{class:"text-white/50 text-sm"},"dBm",-1))])):(Wr(),Qr("div",J2e,Si(rr.value),1))]),Le("div",ewe,[Ci[12]||(Ci[12]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Coding Rate",-1)),c.value?(Wr(),Qr("div",rwe,[Sl(Le("select",{"onUpdate:modelValue":Ci[4]||(Ci[4]=ii=>Xe.value=ii),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},Ci[11]||(Ci[11]=[Le("option",{value:5},"4/5",-1),Le("option",{value:6},"4/6",-1),Le("option",{value:7},"4/7",-1),Le("option",{value:8},"4/8",-1)]),512),[[_g,Xe.value,void 0,{number:!0}]])])):(Wr(),Qr("div",twe,Si(Er.value),1))]),Le("div",iwe,[Ci[13]||(Ci[13]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Preamble Length",-1)),Le("span",nwe,Si(Fe.value),1)])]),c.value?(Wr(),Qr("div",awe,Ci[14]||(Ci[14]=[Le("p",{class:"text-yellow-400 text-xs"},[Le("strong",null,"Note:"),ul(" Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. ")],-1)]))):Ma("",!0)]))}}),swe={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl"},lwe={class:"flex-1 relative min-h-[400px]"},uwe={class:"p-6 border-t border-white/10 space-y-4"},cwe={class:"grid grid-cols-2 gap-4"},hwe=Uu({__name:"LocationPicker",props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:["close","select"],setup(t,{emit:e}){const r=t,c=e,S=vn(null),H=vn(r.latitude||0),Z=vn(r.longitude||0);let ue=null,be=null;const Se=async()=>{if(S.value){Re();try{const kt=(await T5(async()=>{const{default:Fe}=await Promise.resolve().then(()=>RB);return{default:Fe}},void 0)).default;delete kt.Icon.Default.prototype._getIconUrl,kt.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"}),await x0();const Dt=H.value||0,rr=Z.value||0,Er=Dt===0&&rr===0?2:13;ue=kt.map(S.value).setView([Dt,rr],Er);try{const Fe=kt.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'©
OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),wi=kt.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});Fe.addTo(ue),wi.addTo(ue)}catch(Fe){console.warn("Error loading tiles:",Fe)}(Dt!==0||rr!==0)&&(be=kt.marker([Dt,rr]).addTo(ue)),ue.on("click",Fe=>{H.value=Fe.latlng.lat,Z.value=Fe.latlng.lng,be?be.setLatLng(Fe.latlng):be=kt.marker(Fe.latlng).addTo(ue)}),setTimeout(()=>{ue?.invalidateSize()},200)}catch(kt){console.error("Failed to initialize map:",kt)}}},Re=()=>{ue&&(ue.remove(),ue=null,be=null)};w0(()=>r.isOpen,async kt=>{kt?(await x0(),await Se()):Re()}),w0(()=>[r.latitude,r.longitude],([kt,Dt])=>{H.value=kt,Z.value=Dt});const Xe=()=>{c("select",{latitude:H.value,longitude:Z.value}),c("close")},vt=()=>{c("close")},bt=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async kt=>{if(H.value=kt.coords.latitude,Z.value=kt.coords.longitude,ue){ue.setView([H.value,Z.value],13);const Dt=(await T5(async()=>{const{default:rr}=await Promise.resolve().then(()=>RB);return{default:rr}},void 0)).default;be?be.setLatLng([H.value,Z.value]):be=Dt.marker([H.value,Z.value]).addTo(ue)}},kt=>{console.error("Error getting location:",kt),alert("Unable to get current location. Please check browser permissions.")}):alert("Geolocation is not supported by this browser.")};return Dv(()=>{Re()}),(kt,Dt)=>kt.isOpen?(Wr(),Qr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Yf(vt,["self"])},[Le("div",swe,[Le("div",{class:"flex items-center justify-between p-6 border-b border-white/10"},[Dt[3]||(Dt[3]=Le("h3",{class:"text-xl font-semibold text-white"},"Select Location",-1)),Le("button",{onClick:vt,class:"text-white/70 hover:text-white transition-colors"},Dt[2]||(Dt[2]=[Le("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",lwe,[Le("div",{ref_key:"mapContainer",ref:S,class:"absolute inset-0 rounded-b-[15px] overflow-hidden"},null,512)]),Le("div",uwe,[Le("div",cwe,[Le("div",null,[Dt[4]||(Dt[4]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Latitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Dt[0]||(Dt[0]=rr=>H.value=rr),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white focus:outline-none focus:border-primary",readonly:""},null,512),[[sc,H.value,void 0,{number:!0}]])]),Le("div",null,[Dt[5]||(Dt[5]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Longitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Dt[1]||(Dt[1]=rr=>Z.value=rr),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white focus:outline-none focus:border-primary",readonly:""},null,512),[[sc,Z.value,void 0,{number:!0}]])])]),Le("div",{class:"flex gap-3"},[Le("button",{onClick:bt,class:"flex-1 px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm flex items-center justify-center gap-2"},Dt[6]||(Dt[6]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),ul(" Use Current Location ",-1)])),Le("button",{onClick:vt,class:"px-6 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm"}," Cancel "),Le("button",{onClick:Xe,class:"px-6 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Select Location ")]),Dt[7]||(Dt[7]=Le("p",{class:"text-white/50 text-xs text-center"},"Click on the map to select a location",-1))])])])):Ma("",!0)}}),fwe=kh(hwe,[["__scopeId","data-v-5793518c"]]),dwe={class:"space-y-4"},pwe={key:0,class:"bg-green-500/10 border border-green-500/30 rounded-lg p-3"},mwe={class:"text-green-400 text-sm"},gwe={key:1,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},vwe={class:"text-red-400 text-sm"},ywe={class:"flex justify-end gap-2"},_we=["disabled"],xwe=["disabled"],bwe={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},wwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},kwe={key:0,class:"text-white font-mono text-sm break-all"},Twe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Swe={class:"text-white font-mono text-xs break-all"},Cwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-white/10 gap-1"},Awe={class:"text-white font-mono text-xs break-all sm:text-right sm:max-w-xs"},Mwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Ewe={key:0,class:"text-white font-mono text-sm"},Lwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Pwe={key:0,class:"text-white font-mono text-sm"},Iwe={key:0,class:"flex justify-end"},Dwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},zwe={class:"text-white font-mono text-sm"},Owe={class:"flex flex-col py-2 gap-2"},Bwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},Rwe={key:0,class:"text-white font-mono text-sm sm:ml-4"},Fwe={key:1,class:"flex items-center gap-2"},Nwe=Uu({__name:"RepeaterSettings",setup(t){const e=kg(),r=Do(()=>e.stats?.config||{}),c=Do(()=>r.value.repeater||{}),S=Do(()=>e.stats),H=vn(!1),Z=vn(!1),ue=vn(null),be=vn(null),Se=vn(!1),Re=vn(""),Xe=vn(0),vt=vn(0),bt=vn(0);w0([r,c],()=>{H.value||(Re.value=r.value.node_name||"",Xe.value=c.value.latitude||0,vt.value=c.value.longitude||0,bt.value=c.value.send_advert_interval_hours||0)},{immediate:!0});const kt=Do(()=>r.value.node_name||"Not set"),Dt=Do(()=>S.value?.local_hash||"Not available"),rr=Do(()=>{const Ji=S.value?.public_key;return!Ji||Ji==="Not set"?"Not set":Ji}),Er=Do(()=>{const Ji=c.value.latitude;return Ji&&Ji!==0?Ji.toFixed(6):"Not set"}),Fe=Do(()=>{const Ji=c.value.longitude;return Ji&&Ji!==0?Ji.toFixed(6):"Not set"}),wi=Do(()=>{const Ji=c.value.mode;return Ji?Ji.charAt(0).toUpperCase()+Ji.slice(1):"Not set"}),ur=Do(()=>{const Ji=c.value.send_advert_interval_hours;return Ji===void 0?"Not set":Ji===0?"Disabled":Ji+" hour"+(Ji!==1?"s":"")}),Ir=()=>{H.value=!0,ue.value=null,be.value=null},Ti=()=>{H.value=!1,ue.value=null,Re.value=r.value.node_name||"",Xe.value=c.value.latitude||0,vt.value=c.value.longitude||0,bt.value=c.value.send_advert_interval_hours||0},_i=async()=>{Z.value=!0,ue.value=null,be.value=null;try{const Ji={};Re.value&&(Ji.node_name=Re.value),Ji.latitude=Xe.value,Ji.longitude=vt.value,Ji.flood_advert_interval_hours=bt.value;const vr=(await zs.post("/update_radio_config",Ji)).data;vr.message||vr.persisted?(be.value=vr.message||"Settings saved successfully",H.value=!1,await e.fetchStats(),setTimeout(()=>{be.value=null},3e3)):vr.error?ue.value=vr.error:ue.value="Unknown response from server"}catch(Ji){console.error("Failed to update repeater settings:",Ji);const vi=Ji;ue.value=vi.response?.data?.error||"Failed to update settings"}finally{Z.value=!1}},Ci=()=>{Se.value=!0},ii=Ji=>{Xe.value=Ji.latitude,vt.value=Ji.longitude};return(Ji,vi)=>(Wr(),Qr("div",dwe,[be.value?(Wr(),Qr("div",pwe,[Le("p",mwe,Si(be.value),1)])):Ma("",!0),ue.value?(Wr(),Qr("div",gwe,[Le("p",vwe,Si(ue.value),1)])):Ma("",!0),Le("div",ywe,[H.value?(Wr(),Qr(js,{key:1},[Le("button",{onClick:Ti,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,_we),Le("button",{onClick:_i,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},Si(Z.value?"Saving...":"Save Changes"),9,xwe)],64)):(Wr(),Qr("button",{key:0,onClick:Ir,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Le("div",bwe,[Le("div",wwe,[vi[5]||(vi[5]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Node Name",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":vi[0]||(vi[0]=vr=>Re.value=vr),type:"text",maxlength:"50",class:"w-full sm:w-64 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Enter node name"},null,512)),[[sc,Re.value]]):(Wr(),Qr("div",kwe,Si(kt.value),1))]),Le("div",Twe,[vi[6]||(vi[6]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Local Hash",-1)),Le("span",Swe,Si(Dt.value),1)]),Le("div",Cwe,[vi[7]||(vi[7]=Le("span",{class:"text-white/70 text-xs sm:text-sm flex-shrink-0"},"Public Key",-1)),Le("span",Awe,Si(rr.value),1)]),Le("div",Mwe,[vi[8]||(vi[8]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Latitude",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":vi[1]||(vi[1]=vr=>Xe.value=vr),type:"number",step:"0.000001",min:"-90",max:"90",class:"w-full sm:w-48 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Xe.value,void 0,{number:!0}]]):(Wr(),Qr("div",Ewe,Si(Er.value),1))]),Le("div",Lwe,[vi[9]||(vi[9]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Longitude",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":vi[2]||(vi[2]=vr=>vt.value=vr),type:"number",step:"0.000001",min:"-180",max:"180",class:"w-full sm:w-48 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,vt.value,void 0,{number:!0}]]):(Wr(),Qr("div",Pwe,Si(Fe.value),1))]),H.value?(Wr(),Qr("div",Iwe,[Le("button",{onClick:Ci,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2",title:"Pick location on map"},vi[10]||(vi[10]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),ul(" Pick Location on Map ",-1)]))])):Ma("",!0),Le("div",Dwe,[vi[11]||(vi[11]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Mode",-1)),Le("span",zwe,Si(wi.value),1)]),Le("div",Owe,[Le("div",Bwe,[vi[13]||(vi[13]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Periodic Advertisement Interval",-1)),H.value?(Wr(),Qr("div",Fwe,[Sl(Le("input",{"onUpdate:modelValue":vi[3]||(vi[3]=vr=>bt.value=vr),type:"number",min:"0",max:"48",class:"w-20 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,bt.value,void 0,{number:!0}]]),vi[12]||(vi[12]=Le("span",{class:"text-white/50 text-sm"},"hours",-1))])):(Wr(),Qr("div",Rwe,Si(ur.value),1))]),vi[14]||(vi[14]=Le("span",{class:"text-white/50 text-xs"},"How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)",-1))])]),il(fwe,{"is-open":Se.value,latitude:Xe.value,longitude:vt.value,onClose:vi[4]||(vi[4]=vr=>Se.value=!1),onSelect:ii},null,8,["is-open","latitude","longitude"])]))}}),jwe={class:"space-y-4"},Uwe={key:0,class:"bg-green-500/20 border border-green-500/50 rounded-lg p-3 text-green-400 text-sm"},$we={key:1,class:"bg-red-500/20 border border-red-500/50 rounded-lg p-3 text-red-400 text-sm"},Hwe={class:"flex justify-end gap-2"},Vwe=["disabled"],Wwe=["disabled"],qwe={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Gwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Zwe={key:0,class:"text-white font-mono text-sm"},Kwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},Ywe={key:0,class:"text-white font-mono text-sm"},Xwe=Uu({__name:"DutyCycle",setup(t){const e=kg(),r=Do(()=>e.stats?.config?.duty_cycle||{}),c=Do(()=>{const kt=r.value.max_airtime_percent;return typeof kt=="number"?kt.toFixed(1)+"%":kt&&typeof kt=="object"&&"parsedValue"in kt?(kt.parsedValue||0).toFixed(1)+"%":"Not set"}),S=Do(()=>r.value.enforcement_enabled?"Enabled":"Disabled"),H=vn(!1),Z=vn(!1),ue=vn(""),be=vn(""),Se=vn(0),Re=vn(!0),Xe=()=>{const kt=r.value.max_airtime_percent;typeof kt=="number"?Se.value=kt:kt&&typeof kt=="object"&&"parsedValue"in kt?Se.value=kt.parsedValue||0:Se.value=6,Re.value=r.value.enforcement_enabled!==!1,H.value=!0,ue.value="",be.value=""},vt=()=>{H.value=!1,ue.value="",be.value=""},bt=async()=>{Z.value=!0,be.value="",ue.value="";try{const Dt=(await J2.post("/api/update_duty_cycle_config",{max_airtime_percent:Se.value,enforcement_enabled:Re.value})).data;Dt.message||Dt.persisted?(ue.value=Dt.message||"Settings saved successfully",H.value=!1,await e.fetchStats(),setTimeout(()=>{ue.value=""},3e3)):be.value="Failed to save settings"}catch(kt){console.error("Failed to save duty cycle settings:",kt),be.value=kt.response?.data?.error||"Failed to save settings"}finally{Z.value=!1}};return(kt,Dt)=>(Wr(),Qr("div",jwe,[ue.value?(Wr(),Qr("div",Uwe,Si(ue.value),1)):Ma("",!0),be.value?(Wr(),Qr("div",$we,Si(be.value),1)):Ma("",!0),Le("div",Hwe,[H.value?(Wr(),Qr(js,{key:1},[Le("button",{onClick:vt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,Vwe),Le("button",{onClick:bt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},Si(Z.value?"Saving...":"Save Changes"),9,Wwe)],64)):(Wr(),Qr("button",{key:0,onClick:Xe,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Le("div",qwe,[Le("div",Gwe,[Dt[2]||(Dt[2]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Max Airtime %",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":Dt[0]||(Dt[0]=rr=>Se.value=rr),type:"number",step:"0.1",min:"0.1",max:"100",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Se.value,void 0,{number:!0}]]):(Wr(),Qr("div",Zwe,Si(c.value),1))]),Le("div",Kwe,[Dt[4]||(Dt[4]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Enforcement",-1)),H.value?Sl((Wr(),Qr("select",{key:1,"onUpdate:modelValue":Dt[1]||(Dt[1]=rr=>Re.value=rr),class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},Dt[3]||(Dt[3]=[Le("option",{value:!0},"Enabled",-1),Le("option",{value:!1},"Disabled",-1)]),512)),[[_g,Re.value]]):(Wr(),Qr("div",Ywe,Si(S.value),1))])])]))}}),Jwe={class:"space-y-4"},Qwe={key:0,class:"bg-green-500/20 border border-green-500/50 rounded-lg p-3 text-green-400 text-sm"},e3e={key:1,class:"bg-red-500/20 border border-red-500/50 rounded-lg p-3 text-red-400 text-sm"},t3e={class:"flex justify-end gap-2"},r3e=["disabled"],i3e=["disabled"],n3e={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},a3e={class:"flex flex-col py-2 border-b border-white/10 gap-2"},o3e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},s3e={key:0,class:"text-white font-mono text-sm sm:ml-4"},l3e={class:"flex flex-col py-2 gap-2"},u3e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},c3e={key:0,class:"text-white font-mono text-sm sm:ml-4"},h3e=Uu({__name:"TransmissionDelays",setup(t){const e=kg(),r=Do(()=>e.stats?.config?.delays||{}),c=Do(()=>{const kt=r.value.tx_delay_factor;if(kt&&typeof kt=="object"&&kt!==null&&"parsedValue"in kt){const Dt=kt.parsedValue;if(typeof Dt=="number")return Dt.toFixed(2)+"x"}return"Not set"}),S=Do(()=>{const kt=r.value.direct_tx_delay_factor;return typeof kt=="number"?kt.toFixed(2)+"s":"Not set"}),H=vn(!1),Z=vn(!1),ue=vn(""),be=vn(""),Se=vn(0),Re=vn(0),Xe=()=>{const kt=r.value.tx_delay_factor;kt&&typeof kt=="object"&&"parsedValue"in kt?Se.value=kt.parsedValue||1:typeof kt=="number"?Se.value=kt:Se.value=1;const Dt=r.value.direct_tx_delay_factor;Re.value=typeof Dt=="number"?Dt:.5,H.value=!0,ue.value="",be.value=""},vt=()=>{H.value=!1,ue.value="",be.value=""},bt=async()=>{Z.value=!0,be.value="",ue.value="";try{const Dt=(await J2.post("/api/update_radio_config",{tx_delay_factor:Se.value,direct_tx_delay_factor:Re.value})).data;Dt.message||Dt.persisted?(ue.value=Dt.message||"Settings saved successfully",H.value=!1,await e.fetchStats(),setTimeout(()=>{ue.value=""},3e3)):be.value="Failed to save settings"}catch(kt){console.error("Failed to save delay settings:",kt),be.value=kt.response?.data?.error||"Failed to save settings"}finally{Z.value=!1}};return(kt,Dt)=>(Wr(),Qr("div",Jwe,[ue.value?(Wr(),Qr("div",Qwe,Si(ue.value),1)):Ma("",!0),be.value?(Wr(),Qr("div",e3e,Si(be.value),1)):Ma("",!0),Le("div",t3e,[H.value?(Wr(),Qr(js,{key:1},[Le("button",{onClick:vt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,r3e),Le("button",{onClick:bt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},Si(Z.value?"Saving...":"Save Changes"),9,i3e)],64)):(Wr(),Qr("button",{key:0,onClick:Xe,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Le("div",n3e,[Le("div",a3e,[Le("div",o3e,[Dt[2]||(Dt[2]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Flood TX Delay Factor",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":Dt[0]||(Dt[0]=rr=>Se.value=rr),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Se.value,void 0,{number:!0}]]):(Wr(),Qr("div",s3e,Si(c.value),1))]),Dt[3]||(Dt[3]=Le("span",{class:"text-white/50 text-xs"},"Multiplier for flood packet transmission delays (collision avoidance)",-1))]),Le("div",l3e,[Le("div",u3e,[Dt[4]||(Dt[4]=Le("span",{class:"text-white/70 text-xs sm:text-sm"},"Direct TX Delay Factor",-1)),H.value?Sl((Wr(),Qr("input",{key:1,"onUpdate:modelValue":Dt[1]||(Dt[1]=rr=>Re.value=rr),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Re.value,void 0,{number:!0}]]):(Wr(),Qr("div",c3e,Si(S.value),1))]),Dt[5]||(Dt[5]=Le("span",{class:"text-white/50 text-xs"},"Base delay for direct-routed packet transmission (seconds)",-1))])])]))}}),IH=SS("treeState",()=>{const t=Ox(new Set),e=Ox({value:null}),r=ue=>{t.add(ue)},c=ue=>{t.delete(ue)};return{expandedNodes:t,selectedNodeId:e,addExpandedNode:r,removeExpandedNode:c,isNodeExpanded:ue=>t.has(ue),setSelectedNode:ue=>{e.value=ue},toggleExpanded:ue=>{t.has(ue)?c(ue):r(ue)}}}),f3e={class:"select-none"},d3e={class:"flex-shrink-0"},p3e={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},m3e={key:1,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},g3e={key:0,class:"hidden sm:flex items-center gap-1 ml-2"},v3e={class:"relative group"},y3e=["title"],_3e={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},x3e={class:"flex justify-between items-start mb-4"},b3e={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},w3e={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},k3e={class:"flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0"},T3e={key:0,class:"hidden sm:flex items-center gap-1"},S3e=["title"],C3e={key:1,class:"hidden sm:flex items-center gap-1"},A3e={key:2,class:"hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},M3e={key:0,class:"space-y-1"},E3e=Uu({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const r=t,c=e,S=IH(),H=vn(!1),Z=Do({get:()=>S.isNodeExpanded(r.node.id),set:Dt=>{Dt?S.addExpandedNode(r.node.id):S.removeExpandedNode(r.node.id)}}),ue=Do(()=>r.node.children.length>0);function be(Dt){if(!Dt)return"Never";const Er=new Date().getTime()-Dt.getTime(),Fe=Math.floor(Er/(1e3*60)),wi=Math.floor(Er/(1e3*60*60)),ur=Math.floor(Er/(1e3*60*60*24)),Ir=Math.floor(ur/365);return Fe<60?`${Fe}m ago`:wi<24?`${wi}h ago`:ur<365?`${ur}d ago`:`${Ir}y ago`}function Se(Dt){return Dt?Dt.length<=16?Dt:`${Dt.slice(0,8)}...${Dt.slice(-8)}`:"No key"}function Re(){if(ue.value){const Dt=!Z.value;Z.value=Dt}}function Xe(){c("select",r.node.id)}function vt(Dt){c("select",Dt)}function bt(Dt){Dt.stopPropagation(),H.value=!H.value}function kt(Dt){Dt.stopPropagation(),r.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(r.node.transport_key)}return(Dt,rr)=>{const Er=_S("TreeNode",!0);return Wr(),Qr("div",f3e,[Le("div",{class:eo(["flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200",r.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",Dt.selectedNodeId===Dt.node.id&&!r.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${Dt.level*4}`]),onClick:rr[3]||(rr[3]=Fe=>!r.disabled&&Xe())},[Le("div",{class:"flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center",onClick:Yf(Re,["stop"])},[ue.value?(Wr(),Qr("svg",{key:0,class:eo(["w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200",Z.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},rr[4]||(rr[4]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):Ma("",!0)]),Le("div",d3e,[r.node.name.startsWith("#")?(Wr(),Qr("svg",p3e,rr[5]||(rr[5]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",m3e,rr[6]||(rr[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),Le("span",{class:eo(["font-mono text-xs sm:text-sm transition-colors duration-200 break-all",Dt.selectedNodeId===Dt.node.id?"text-primary font-medium":""])},Si(Dt.node.name),3),Dt.node.transport_key?(Wr(),Qr("div",g3e,[Le("div",v3e,[Le("button",{onClick:bt,class:"p-1 rounded hover:bg-white/10 transition-colors",title:H.value?"Hide full key":"Show full key"},rr[7]||(rr[7]=[Le("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,y3e),H.value?Ma("",!0):(Wr(),Qr("span",_3e,Si(Se(Dt.node.transport_key)),1)),H.value?(Wr(),Qr("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:rr[2]||(rr[2]=Fe=>H.value=!1)},[Le("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:rr[1]||(rr[1]=Yf(()=>{},["stop"]))},[Le("div",x3e,[rr[9]||(rr[9]=Le("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),Le("button",{onClick:rr[0]||(rr[0]=Fe=>H.value=!1),class:"text-white/60 hover:text-white transition-colors"},rr[8]||(rr[8]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",b3e,[Le("div",w3e,Si(Dt.node.transport_key),1)]),Le("div",{class:"flex justify-end"},[Le("button",{onClick:kt,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},rr[10]||(rr[10]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),ul(" Copy Key ",-1)]))])])])):Ma("",!0)])])):Ma("",!0),Le("div",k3e,[Dt.node.last_used?(Wr(),Qr("div",T3e,[rr[11]||(rr[11]=Le("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Le("span",{class:"text-xs text-white/50",title:Dt.node.last_used.toLocaleString()},Si(be(Dt.node.last_used)),9,S3e)])):(Wr(),Qr("div",C3e,rr[12]||(rr[12]=[Le("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Le("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),Le("span",{class:eo(["px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors",Dt.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},Si(Dt.node.floodPolicy==="allow"?"ALLOW":"DENY"),3),ue.value?(Wr(),Qr("span",A3e," > "+Si(Dt.node.children.length),1)):Ma("",!0)])],2),il(Rx,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:Iv(()=>[Z.value&&Dt.node.children.length>0?(Wr(),Qr("div",M3e,[(Wr(!0),Qr(js,null,au(Dt.node.children,Fe=>(Wr(),Sd(Er,{key:Fe.id,node:Fe,"selected-node-id":Dt.selectedNodeId,level:Dt.level+1,disabled:r.disabled,onSelect:vt},null,8,["node","selected-node-id","level","disabled"]))),128))])):Ma("",!0)]),_:1})])}}}),L3e=kh(E3e,[["__scopeId","data-v-59e9974c"]]),P3e={class:"flex items-center justify-between mb-6"},I3e={class:"text-white/60 text-sm mt-1"},D3e={key:0},z3e={class:"text-primary font-mono"},O3e={key:1},B3e={for:"keyName",class:"block text-sm font-medium text-white mb-2"},R3e={class:"flex items-center gap-2"},F3e={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},N3e={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},j3e={class:"bg-white/5 border border-white/10 rounded-lg p-4"},U3e={class:"flex items-center gap-3 mb-2"},$3e={class:"flex items-center gap-2"},H3e={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},V3e={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},W3e={class:"text-white/70 text-sm"},q3e={class:"grid grid-cols-2 gap-3"},G3e={class:"relative cursor-pointer group"},Z3e={class:"relative cursor-pointer group"},K3e={class:"flex gap-3 pt-4"},Y3e=["disabled"],X3e=Uu({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(t,{emit:e}){const r=t,c=e,S=vn(""),H=vn(""),Z=vn("allow"),ue=Do(()=>S.value.startsWith("#")),be=Do(()=>({type:ue.value?"Region":"Private Key",description:ue.value?"Regional organizational key":"Individual assigned key"}));w0(ue,bt=>{bt?H.value="This will create a new region for organizing keys":H.value="This will create a new private key entry"},{immediate:!0});const Se=Do(()=>S.value.trim().length>0),Re=()=>{Se.value&&(c("add",{name:S.value.trim(),floodPolicy:Z.value,parentId:r.selectedNodeId}),S.value="",H.value="",Z.value="allow")},Xe=()=>{S.value="",H.value="",Z.value="allow",c("close")},vt=bt=>{bt.target===bt.currentTarget&&Xe()};return(bt,kt)=>bt.show?(Wr(),Qr("div",{key:0,onClick:vt,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:kt[3]||(kt[3]=Yf(()=>{},["stop"]))},[Le("div",P3e,[Le("div",null,[kt[5]||(kt[5]=Le("h3",{class:"text-xl font-semibold text-white"},"Add New Entry",-1)),Le("p",I3e,[r.selectedNodeName?(Wr(),Qr("span",D3e,[kt[4]||(kt[4]=ul(" Add to: ",-1)),Le("span",z3e,Si(r.selectedNodeName),1)])):(Wr(),Qr("span",O3e," Add to root level (#uk) "))])]),Le("button",{onClick:Xe,class:"text-white/60 hover:text-white transition-colors"},kt[6]||(kt[6]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("form",{onSubmit:Yf(Re,["prevent"]),class:"space-y-4"},[Le("div",null,[Le("label",B3e,[Le("div",R3e,[ue.value?(Wr(),Qr("svg",F3e,kt[7]||(kt[7]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",N3e,kt[8]||(kt[8]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),kt[9]||(kt[9]=ul(" Region/Key Name ",-1))])]),Sl(Le("input",{id:"keyName","onUpdate:modelValue":kt[0]||(kt[0]=Dt=>S.value=Dt),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[sc,S.value]])]),Le("div",j3e,[Le("div",U3e,[Le("div",$3e,[ue.value?(Wr(),Qr("svg",H3e,kt[10]||(kt[10]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",V3e,kt[11]||(kt[11]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),Le("span",{class:eo([ue.value?"text-secondary":"text-accent-green","font-medium"])},Si(be.value.type),3)]),Le("div",{class:eo(["flex-1 h-px",ue.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Le("p",W3e,Si(be.value.description),1)]),Le("div",null,[kt[14]||(kt[14]=Le("label",{class:"block text-sm font-medium text-white mb-3"},[Le("div",{class:"flex items-center gap-2"},[Le("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),ul(" Flood Policy ")])],-1)),Le("div",q3e,[Le("label",G3e,[Sl(Le("input",{type:"radio","onUpdate:modelValue":kt[1]||(kt[1]=Dt=>Z.value=Dt),value:"allow",class:"sr-only"},null,512),[[z5,Z.value]]),kt[12]||(kt[12]=qc('
Allow

Permit flooding

',1))]),Le("label",Z3e,[Sl(Le("input",{type:"radio","onUpdate:modelValue":kt[2]||(kt[2]=Dt=>Z.value=Dt),value:"deny",class:"sr-only"},null,512),[[z5,Z.value]]),kt[13]||(kt[13]=qc('
Deny

Block flooding

',1))])])]),Le("div",K3e,[Le("button",{type:"button",onClick:Xe,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Le("button",{type:"submit",disabled:!Se.value,class:eo(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",Se.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Add "+Si(be.value.type),11,Y3e)])],32)])])):Ma("",!0)}}),J3e={class:"flex bg-black items-center justify-between mb-6"},Q3e={class:"text-white/60 text-sm mt-1"},e5e={class:"text-primary font-mono"},t5e={for:"keyName",class:"block text-sm font-medium text-white mb-2"},r5e={class:"flex items-center gap-2"},i5e={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n5e={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a5e={class:"bg-white/5 border border-white/10 rounded-lg p-4"},o5e={class:"flex items-center gap-3 mb-2"},s5e={class:"flex items-center gap-2"},l5e={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},u5e={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},c5e={class:"text-white/70 text-sm"},h5e={key:0,class:"space-y-4"},f5e={key:0,class:"bg-white/5 border border-white/10 rounded-lg p-4"},d5e={class:"bg-black/20 border border-white/10 rounded-md p-3"},p5e={class:"text-xs font-mono text-white/80 break-all"},m5e={key:1,class:"bg-white/5 border border-white/10 rounded-lg p-4"},g5e={class:"flex items-center justify-between"},v5e={class:"text-sm text-white/70"},y5e={class:"text-xs text-white/50"},_5e={class:"grid grid-cols-2 gap-3"},x5e={class:"relative cursor-pointer group"},b5e={class:"relative cursor-pointer group"},w5e={class:"flex gap-3 pt-4"},k5e=["disabled"],T5e=Uu({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(t,{emit:e}){const r=t,c=e,S=vn(""),H=vn("allow"),Z=Do(()=>S.value.startsWith("#")),ue=Do(()=>({type:Z.value?"Region":"Private Key",description:Z.value?"Regional organizational key":"Individual assigned key"}));w0(()=>r.node,Dt=>{Dt?(S.value=Dt.name,H.value=Dt.floodPolicy):(S.value="",H.value="allow")},{immediate:!0});const be=Do(()=>S.value.trim().length>0&&r.node),Se=Dt=>{const Er=new Date().getTime()-Dt.getTime(),Fe=Math.floor(Er/(1e3*60)),wi=Math.floor(Er/(1e3*60*60)),ur=Math.floor(Er/(1e3*60*60*24)),Ir=Math.floor(ur/365);return Fe<60?`${Fe}m ago`:wi<24?`${wi}h ago`:ur<365?`${ur}d ago`:`${Ir}y ago`},Re=Dt=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(Dt)},Xe=()=>{!be.value||!r.node||(c("save",{id:r.node.id,name:S.value.trim(),floodPolicy:H.value}),bt())},vt=()=>{r.node&&(c("request-delete",r.node),bt())},bt=()=>{c("close")},kt=Dt=>{Dt.target===Dt.currentTarget&&bt()};return(Dt,rr)=>Dt.show?(Wr(),Qr("div",{key:0,onClick:kt,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:rr[4]||(rr[4]=Yf(()=>{},["stop"]))},[Le("div",J3e,[Le("div",null,[rr[6]||(rr[6]=Le("h3",{class:"text-xl font-semibold text-white"},"Edit Entry",-1)),Le("p",Q3e,[rr[5]||(rr[5]=ul(" Modify ",-1)),Le("span",e5e,Si(Dt.node?.name),1)])]),Le("button",{onClick:bt,class:"text-white/60 hover:text-white transition-colors"},rr[7]||(rr[7]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("form",{onSubmit:Yf(Xe,["prevent"]),class:"space-y-4"},[Le("div",null,[Le("label",t5e,[Le("div",r5e,[Z.value?(Wr(),Qr("svg",i5e,rr[8]||(rr[8]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",n5e,rr[9]||(rr[9]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),rr[10]||(rr[10]=ul(" Region/Key Name ",-1))])]),Sl(Le("input",{id:"keyName","onUpdate:modelValue":rr[0]||(rr[0]=Er=>S.value=Er),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[sc,S.value]])]),Le("div",a5e,[Le("div",o5e,[Le("div",s5e,[Z.value?(Wr(),Qr("svg",l5e,rr[11]||(rr[11]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",u5e,rr[12]||(rr[12]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Le("span",{class:eo([Z.value?"text-secondary":"text-accent-green","font-medium"])},Si(ue.value.type),3)]),Le("div",{class:eo(["flex-1 h-px",Z.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Le("p",c5e,Si(ue.value.description),1)]),Dt.node?(Wr(),Qr("div",h5e,[Dt.node.transport_key?(Wr(),Qr("div",f5e,[rr[14]||(rr[14]=qc('
Transport Key
',1)),Le("div",d5e,[Le("div",p5e,Si(Dt.node.transport_key),1),Le("button",{onClick:rr[1]||(rr[1]=Er=>Re(Dt.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},rr[13]||(rr[13]=[Le("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),ul(" Copy Key ",-1)]))])])):Ma("",!0),Dt.node.last_used?(Wr(),Qr("div",m5e,[rr[15]||(rr[15]=Le("div",{class:"flex items-center gap-2 mb-3"},[Le("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Le("span",{class:"text-sm font-medium text-white"},"Last Used")],-1)),Le("div",g5e,[Le("div",v5e,Si(Dt.node.last_used.toLocaleDateString())+" at "+Si(Dt.node.last_used.toLocaleTimeString()),1),Le("div",y5e,Si(Se(Dt.node.last_used)),1)])])):Ma("",!0)])):Ma("",!0),Le("div",null,[rr[18]||(rr[18]=Le("label",{class:"block text-sm font-medium text-white mb-3"},[Le("div",{class:"flex items-center gap-2"},[Le("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),ul(" Flood Policy ")])],-1)),Le("div",_5e,[Le("label",x5e,[Sl(Le("input",{type:"radio","onUpdate:modelValue":rr[2]||(rr[2]=Er=>H.value=Er),value:"allow",class:"sr-only"},null,512),[[z5,H.value]]),rr[16]||(rr[16]=qc('
Allow

Permit flooding

',1))]),Le("label",b5e,[Sl(Le("input",{type:"radio","onUpdate:modelValue":rr[3]||(rr[3]=Er=>H.value=Er),value:"deny",class:"sr-only"},null,512),[[z5,H.value]]),rr[17]||(rr[17]=qc('
Deny

Block flooding

',1))])])]),Le("div",w5e,[Le("button",{type:"button",onClick:vt,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),Le("button",{type:"button",onClick:bt,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Le("button",{type:"submit",disabled:!be.value,class:eo(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",be.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Save Changes ",10,k5e)])],32)])])):Ma("",!0)}}),S5e={class:"flex items-center gap-3 mb-6"},C5e={class:"text-white/60 text-sm mt-1"},A5e={class:"text-accent-red font-mono"},M5e={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},E5e={class:"flex items-start gap-3"},L5e={class:"flex-1"},P5e={class:"text-accent-red font-medium text-sm mb-2"},I5e={class:"space-y-1 max-h-32 overflow-y-auto"},D5e={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},z5e={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},O5e={class:"font-mono"},B5e={key:0,class:"text-white/60 text-xs"},R5e={key:1,class:"mb-6"},F5e={class:"mb-3"},N5e={class:"relative"},j5e={class:"space-y-2 max-h-40 overflow-y-auto border border-white/20 rounded-lg p-3 bg-white/5"},U5e={key:0,class:"text-center py-4 text-white/60 text-sm"},$5e={class:"relative"},H5e=["value"],V5e={class:"flex items-center gap-2 flex-1"},W5e={class:"text-white font-mono text-sm"},q5e={key:0,class:"ml-auto px-2 py-0.5 bg-white/10 text-white/60 text-xs rounded-full"},G5e={class:"flex gap-3"},Z5e=Uu({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(t,{emit:e}){const r=t,c=e,S=vn(null),H=vn(""),Z=kt=>{const Dt=[],rr=Er=>{for(const Fe of Er.children)Dt.push(Fe),rr(Fe)};return rr(kt),Dt},ue=Do(()=>r.node?Z(r.node):[]),be=Do(()=>{if(!r.node)return[];const kt=new Set([r.node.id,...ue.value.map(rr=>rr.id)]),Dt=rr=>{const Er=[];for(const Fe of rr)Fe.name.startsWith("#")&&!kt.has(Fe.id)&&Er.push(Fe),Fe.children.length>0&&Er.push(...Dt(Fe.children));return Er};return Dt(r.allNodes)}),Se=Do(()=>{if(!H.value.trim())return be.value;const kt=H.value.toLowerCase();return be.value.filter(Dt=>Dt.name.toLowerCase().includes(kt))}),Re=()=>{r.node&&(c("delete-all",r.node.id),vt())},Xe=()=>{!r.node||!S.value||(c("move-children",{nodeId:r.node.id,targetParentId:S.value}),vt())},vt=()=>{S.value=null,H.value="",c("close")},bt=kt=>{kt.target===kt.currentTarget&&vt()};return(kt,Dt)=>kt.show&&kt.node?(Wr(),Qr("div",{key:0,onClick:bt,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-lg border border-white/10",onClick:Dt[2]||(Dt[2]=Yf(()=>{},["stop"]))},[Le("div",S5e,[Dt[6]||(Dt[6]=Le("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Le("div",null,[Dt[4]||(Dt[4]=Le("h3",{class:"text-xl font-semibold text-white"},"Confirm Deletion",-1)),Le("p",C5e,[Dt[3]||(Dt[3]=ul(" Deleting ",-1)),Le("span",A5e,Si(kt.node?.name),1)])]),Le("button",{onClick:vt,class:"ml-auto text-white/60 hover:text-white transition-colors"},Dt[5]||(Dt[5]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),ue.value.length>0?(Wr(),Qr("div",M5e,[Le("div",E5e,[Dt[9]||(Dt[9]=Le("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Le("div",L5e,[Le("h4",P5e," This will affect "+Si(ue.value.length)+" child "+Si(ue.value.length===1?"entry":"entries")+": ",1),Le("div",I5e,[(Wr(!0),Qr(js,null,au(ue.value.slice(0,10),rr=>(Wr(),Qr("div",{key:rr.id,class:"flex items-center gap-2 text-xs text-white/80"},[rr.name.startsWith("#")?(Wr(),Qr("svg",D5e,Dt[7]||(Dt[7]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(Wr(),Qr("svg",z5e,Dt[8]||(Dt[8]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Le("span",O5e,Si(rr.name),1),Le("span",{class:eo(["px-1 py-0.5 text-xs rounded",rr.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},Si(rr.floodPolicy),3)]))),128)),ue.value.length>10?(Wr(),Qr("div",B5e," ...and "+Si(ue.value.length-10)+" more ",1)):Ma("",!0)])])])])):Ma("",!0),ue.value.length>0&&be.value.length>0?(Wr(),Qr("div",R5e,[Dt[13]||(Dt[13]=Le("h4",{class:"text-white font-medium text-sm mb-3"},"Move children to another region:",-1)),Le("div",F5e,[Le("div",N5e,[Dt[10]||(Dt[10]=Le("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Sl(Le("input",{"onUpdate:modelValue":Dt[0]||(Dt[0]=rr=>H.value=rr),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[sc,H.value]])])]),Le("div",j5e,[Se.value.length===0?(Wr(),Qr("div",U5e,Si(H.value?"No regions match your search":"No available regions"),1)):Ma("",!0),(Wr(!0),Qr(js,null,au(Se.value,rr=>(Wr(),Qr("label",{key:rr.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-white/10 transition-colors group"},[Le("div",$5e,[Sl(Le("input",{type:"radio",value:rr.id,"onUpdate:modelValue":Dt[1]||(Dt[1]=Er=>S.value=Er),class:"sr-only peer"},null,8,H5e),[[z5,S.value]]),Dt[11]||(Dt[11]=Le("div",{class:"w-4 h-4 border-2 border-white/30 rounded-full group-hover:border-white/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[Le("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),Le("div",V5e,[Dt[12]||(Dt[12]=Le("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),Le("span",W5e,Si(rr.name),1),rr.children.length>0?(Wr(),Qr("span",q5e,Si(rr.children.length),1)):Ma("",!0)])]))),128))])])):Ma("",!0),Le("div",G5e,[Le("button",{onClick:vt,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),ue.value.length>0&&S.value?(Wr(),Qr("button",{key:0,onClick:Xe,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):Ma("",!0),Le("button",{onClick:Re,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},Si(ue.value.length>0?"Delete All":"Delete"),1)])])])):Ma("",!0)}}),K5e={class:"space-y-4 sm:space-y-6"},Y5e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3"},X5e={class:"flex gap-2 flex-wrap"},J5e=["disabled"],Q5e=["disabled"],e4e=["disabled"],t4e={class:"glass-card rounded-[15px] p-3 sm:p-4 border border-white/10 bg-white/5"},r4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},i4e={class:"flex items-center gap-2 sm:gap-3"},n4e={class:"flex bg-white/5 rounded-lg border border-white/20 p-0.5 sm:p-1"},a4e={class:"glass-card rounded-[15px] p-3 sm:p-6 border border-white/10"},o4e={key:0,class:"flex items-center justify-center py-8"},s4e={key:1,class:"text-center py-8"},l4e={class:"text-white/70 text-sm"},u4e={key:2,class:"text-center py-8"},c4e={key:3,class:"space-y-2"},h4e=Uu({name:"TransportKeys",__name:"TransportKeys",setup(t){const e=IH(),r=vn(!1),c=vn(!1),S=vn(!1),H=vn(null),Z=vn(null),ue=vn("deny"),be=vn([]),Se=vn(!1),Re=vn(null),Xe=vr=>{const dr=new Map,Ar=[];return vr.forEach(ti=>{const Xr={id:ti.id,name:ti.name,floodPolicy:ti.flood_policy,transport_key:ti.transport_key,last_used:ti.last_used?new Date(ti.last_used*1e3):void 0,parent_id:ti.parent_id,children:[]};dr.set(ti.id,Xr)}),dr.forEach(ti=>{ti.parent_id&&dr.has(ti.parent_id)?dr.get(ti.parent_id).children.push(ti):Ar.push(ti)}),Ar},vt=async()=>{try{Se.value=!0,Re.value=null;const vr=await zs.getTransportKeys();vr.success&&vr.data?be.value=Xe(vr.data):Re.value=vr.error||"Failed to load transport keys"}catch(vr){Re.value=vr instanceof Error?vr.message:"Unknown error occurred",console.error("Error loading transport keys:",vr)}finally{Se.value=!1}};ud(()=>{vt()});function bt(vr,dr){for(const Ar of vr){if(Ar.id===dr)return Ar;if(Ar.children){const ti=bt(Ar.children,dr);if(ti)return ti}}return null}function kt(){const vr=e.selectedNodeId.value;return vr?bt(be.value,vr)?.name:void 0}function Dt(vr){ue.value==="deny"&&e.setSelectedNode(vr)}function rr(){ue.value==="deny"&&(r.value=!0)}function Er(){if(ue.value==="deny"&&e.selectedNodeId.value){const vr=bt(be.value,e.selectedNodeId.value);vr&&(Z.value=vr,S.value=!0)}}function Fe(){if(ue.value==="deny"&&e.selectedNodeId.value){const vr=bt(be.value,e.selectedNodeId.value);vr&&(H.value=vr,c.value=!0)}}const wi=async vr=>{try{const dr=await zs.createTransportKey(vr.name,vr.floodPolicy,void 0,vr.parentId,void 0);dr.success?await vt():(console.error("Failed to add transport key:",dr.error),Re.value=dr.error||"Failed to add transport key")}catch(dr){console.error("Error adding transport key:",dr),Re.value=dr instanceof Error?dr.message:"Unknown error occurred"}finally{r.value=!1}};function ur(){r.value=!1}async function Ir(vr){try{const dr=vr==="allow",Ar=await zs.updateGlobalFloodPolicy(dr);Ar.success?ue.value=vr:(console.error("Failed to update global flood policy:",Ar.error),Re.value=Ar.error||"Failed to update global flood policy")}catch(dr){console.error("Error updating global flood policy:",dr),Re.value=dr instanceof Error?dr.message:"Failed to update global flood policy"}}function Ti(){c.value=!1,H.value=null}async function _i(vr){try{const dr=await zs.updateTransportKey(vr.id,vr.name,vr.floodPolicy);dr.success?await vt():(console.error("Failed to update transport key:",dr.error),Re.value=dr.error||"Failed to update transport key")}catch(dr){console.error("Error updating transport key:",dr),Re.value=dr instanceof Error?dr.message:"Unknown error occurred"}finally{Ti()}}function Ci(vr){c.value=!1,H.value=null,Z.value=vr,S.value=!0}function ii(){S.value=!1,Z.value=null}async function Ji(vr){try{const dr=await zs.deleteTransportKey(vr);dr.success?(await vt(),e.setSelectedNode(null)):(console.error("Failed to delete transport key:",dr.error),Re.value=dr.error||"Failed to delete transport key")}catch(dr){console.error("Error deleting transport key:",dr),Re.value=dr instanceof Error?dr.message:"Unknown error occurred"}finally{ii()}}async function vi(vr){try{const dr=await zs.deleteTransportKey(vr.nodeId);dr.success?(await vt(),e.setSelectedNode(null)):(console.error("Failed to delete transport key:",dr.error),Re.value=dr.error||"Failed to delete transport key")}catch(dr){console.error("Error deleting transport key:",dr),Re.value=dr instanceof Error?dr.message:"Unknown error occurred"}finally{ii()}}return(vr,dr)=>(Wr(),Qr("div",K5e,[Le("div",Y5e,[dr[3]||(dr[3]=Le("div",null,[Le("h3",{class:"text-base sm:text-lg font-semibold text-white mb-1 sm:mb-2"},"Regions/Keys"),Le("p",{class:"text-white/70 text-xs sm:text-sm"},"Manage regional key hierarchy")],-1)),Le("div",X5e,[Le("button",{onClick:rr,disabled:ue.value==="allow",class:eo(["flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ue.value==="allow"?"bg-white/5 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},dr[2]||(dr[2]=[Le("svg",{class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),ul(" Add ",-1)]),10,J5e),Le("button",{onClick:Fe,disabled:!Po(e).selectedNodeId.value||ue.value==="allow",class:eo(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Po(e).selectedNodeId.value||ue.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,Q5e),Le("button",{onClick:Er,disabled:!Po(e).selectedNodeId.value||ue.value==="allow",class:eo(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Po(e).selectedNodeId.value||ue.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,e4e)])]),Le("div",t4e,[Le("div",r4e,[dr[4]||(dr[4]=Le("div",null,[Le("h4",{class:"text-xs sm:text-sm font-medium text-white mb-1"},"Global Flood Policy (*)"),Le("p",{class:"text-white/60 text-[10px] sm:text-xs"},"Master control for repeater flooding")],-1)),Le("div",i4e,[Le("div",n4e,[Le("button",{onClick:dr[0]||(dr[0]=Ar=>Ir("deny")),class:eo(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ue.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-white/60 hover:text-white/80"])}," DENY ",2),Le("button",{onClick:dr[1]||(dr[1]=Ar=>Ir("allow")),class:eo(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ue.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-white/60 hover:text-white/80"])}," ALLOW ",2)])])])]),Le("div",a4e,[Se.value?(Wr(),Qr("div",o4e,dr[5]||(dr[5]=[Le("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),Le("span",{class:"ml-2 text-white/70"},"Loading transport keys...",-1)]))):Re.value?(Wr(),Qr("div",s4e,[dr[6]||(dr[6]=Le("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),Le("div",l4e,Si(Re.value),1),Le("button",{onClick:vt,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):be.value.length===0?(Wr(),Qr("div",u4e,dr[7]||(dr[7]=[Le("div",{class:"text-white/50 mb-2"},"📝 No transport keys found",-1),Le("div",{class:"text-white/30 text-sm"},"Add your first transport key to get started",-1)]))):(Wr(),Qr("div",c4e,[(Wr(!0),Qr(js,null,au(be.value,Ar=>(Wr(),Sd(L3e,{key:Ar.id,node:Ar,"selected-node-id":Po(e).selectedNodeId.value,level:0,disabled:ue.value==="allow",onSelect:Dt},null,8,["node","selected-node-id","disabled"]))),128))]))]),il(X3e,{show:r.value,"selected-node-name":kt(),"selected-node-id":Po(e).selectedNodeId.value||void 0,onClose:ur,onAdd:wi},null,8,["show","selected-node-name","selected-node-id"]),il(T5e,{show:c.value,node:H.value,onClose:Ti,onSave:_i,onRequestDelete:Ci},null,8,["show","node"]),il(Z5e,{show:S.value,node:Z.value,"all-nodes":be.value,onClose:ii,onDeleteAll:Ji,onMoveChildren:vi},null,8,["show","node","all-nodes"])]))}}),f4e={class:"flex items-center justify-between mb-4"},d4e={class:"text-xl font-semibold text-white"},p4e={class:"mb-6"},m4e={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},g4e={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v4e={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y4e={class:"text-white/80 text-base leading-relaxed"},_4e={class:"flex gap-3"},DH=Uu({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(t,{emit:e}){const r=t,c=e,S=ue=>{ue.target===ue.currentTarget&&c("close")},H={danger:"bg-red-500/20 border-red-500/30 text-red-400",warning:"bg-yellow-500/20 border-yellow-500/30 text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-400"},Z={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(ue,be)=>r.show?(Wr(),Qr("div",{key:0,onClick:S,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:be[3]||(be[3]=Yf(()=>{},["stop"]))},[Le("div",f4e,[Le("h3",d4e,Si(r.title),1),Le("button",{onClick:be[0]||(be[0]=Se=>c("close")),class:"text-white/60 hover:text-white transition-colors"},be[4]||(be[4]=[Le("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",p4e,[Le("div",{class:eo(["inline-flex p-3 rounded-xl mb-4",H[r.variant]])},[r.variant==="danger"?(Wr(),Qr("svg",m4e,be[5]||(be[5]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):r.variant==="warning"?(Wr(),Qr("svg",g4e,be[6]||(be[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(Wr(),Qr("svg",v4e,be[7]||(be[7]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),Le("p",y4e,Si(r.message),1)]),Le("div",_4e,[Le("button",{onClick:be[1]||(be[1]=Se=>c("close")),class:"flex-1 px-4 py-3 rounded-xl bg-white/5 hover:bg-white/10 text-white transition-all duration-200 border border-white/10"},Si(r.cancelText),1),Le("button",{onClick:be[2]||(be[2]=Se=>c("confirm")),class:eo(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",Z[r.variant]])},Si(r.confirmText),3)])])])):Ma("",!0)}}),x4e={class:"space-y-4 sm:space-y-6"},b4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},w4e={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-4"},k4e={class:"flex items-center gap-2 text-red-400"},T4e={key:1,class:"flex items-center justify-center py-12"},S4e={key:2,class:"space-y-3"},C4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},A4e={class:"flex-1"},M4e={class:"flex items-center gap-2 sm:gap-3"},E4e={class:"min-w-0 flex-1"},L4e={class:"text-white font-medium text-sm sm:text-base break-all"},P4e={class:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-white/60"},I4e={class:"truncate"},D4e={class:"truncate"},z4e=["onClick","disabled"],O4e={key:3,class:"text-center py-12"},B4e={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},R4e={class:"space-y-4"},F4e={class:"flex justify-end gap-3 mt-6"},N4e=["disabled"],j4e=["disabled"],U4e={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl"},$4e={class:"space-y-4"},H4e={class:"flex gap-2"},V4e=["value"],W4e={class:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4"},q4e={class:"block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto"},G4e=Uu({name:"APITokens",__name:"APITokens",setup(t){const e=vn([]),r=vn(!1),c=vn(null),S=vn(!1),H=vn(""),Z=vn(null),ue=vn(!1),be=vn(!1),Se=vn(null),Re=async()=>{r.value=!0,c.value=null;try{const wi=await zs.get("/auth/tokens"),ur=wi.data||wi;e.value=ur.tokens||[]}catch(wi){console.error("Failed to fetch API tokens:",wi),c.value=wi instanceof Error?wi.message:"Failed to fetch tokens"}finally{r.value=!1}},Xe=async()=>{if(!H.value.trim()){c.value="Token name is required";return}r.value=!0,c.value=null;try{const wi=await zs.post("/auth/tokens",{name:H.value.trim()}),ur=wi.data||wi;Z.value=ur.token||null,S.value=!1,ue.value=!0,H.value="",await Re()}catch(wi){console.error("Failed to create API token:",wi),c.value=wi instanceof Error?wi.message:"Failed to create token"}finally{r.value=!1}},vt=(wi,ur)=>{Se.value={id:wi,name:ur},be.value=!0},bt=async()=>{if(Se.value){r.value=!0,c.value=null;try{await zs.delete(`/auth/tokens/${Se.value.id}`),await Re(),be.value=!1,Se.value=null}catch(wi){console.error("Failed to revoke API token:",wi),c.value=wi instanceof Error?wi.message:"Failed to revoke token"}finally{r.value=!1}}},kt=()=>{S.value=!1,H.value="",c.value=null},Dt=()=>{ue.value=!1,Z.value=null},rr=()=>{Z.value&&navigator.clipboard.writeText(Z.value)},Er=wi=>wi?new Date(wi*1e3).toLocaleString():"Never",Fe=Do(()=>`${window.location.origin}/api/stats`);return ud(()=>{Re()}),(wi,ur)=>(Wr(),Qr(js,null,[Le("div",x4e,[Le("div",b4e,[ur[5]||(ur[5]=Le("div",null,[Le("h2",{class:"text-lg sm:text-xl font-semibold text-white"},"API Tokens"),Le("p",{class:"text-white/70 text-xs sm:text-sm mt-1"},"Manage API tokens for machine-to-machine authentication")],-1)),Le("button",{onClick:ur[0]||(ur[0]=Ir=>S.value=!0),class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base"},ur[4]||(ur[4]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),ul(" Create Token ",-1)]))]),ur[20]||(ur[20]=qc('

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

',1)),c.value?(Wr(),Qr("div",w4e,[Le("div",k4e,[ur[6]||(ur[6]=Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),ul(" "+Si(c.value),1)])])):Ma("",!0),r.value&&e.value.length===0?(Wr(),Qr("div",T4e,ur[7]||(ur[7]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Le("div",{class:"text-white/70"},"Loading tokens...")],-1)]))):e.value.length>0?(Wr(),Qr("div",S4e,[(Wr(!0),Qr(js,null,au(e.value,Ir=>(Wr(),Qr("div",{key:Ir.id,class:"bg-white/5 border border-white/10 rounded-lg p-3 sm:p-4 hover:bg-white/10 transition-colors"},[Le("div",C4e,[Le("div",A4e,[Le("div",M4e,[ur[8]||(ur[8]=Le("svg",{class:"w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),Le("div",E4e,[Le("h3",L4e,Si(Ir.name),1),Le("div",P4e,[Le("span",I4e,"Created: "+Si(Er(Ir.created_at)),1),Le("span",D4e,"Last used: "+Si(Er(Ir.last_used)),1)])])])]),Le("button",{onClick:Ti=>vt(Ir.id,Ir.name),disabled:r.value,class:"w-full sm:w-auto px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm"}," Revoke ",8,z4e)])]))),128))])):(Wr(),Qr("div",O4e,[ur[9]||(ur[9]=Le("svg",{class:"w-16 h-16 text-white/20 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),ur[10]||(ur[10]=Le("h3",{class:"text-white font-medium mb-2"},"No API Tokens",-1)),ur[11]||(ur[11]=Le("p",{class:"text-white/60 text-sm mb-4"},"Create a token to enable API access",-1)),Le("button",{onClick:ur[1]||(ur[1]=Ir=>S.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Create Your First Token ")])),S.value?(Wr(),Qr("div",{key:4,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Yf(kt,["self"])},[Le("div",B4e,[ur[14]||(ur[14]=Le("h3",{class:"text-xl font-semibold text-white mb-4"},"Create API Token",-1)),Le("div",R4e,[Le("div",null,[ur[12]||(ur[12]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Token Name",-1)),Sl(Le("input",{"onUpdate:modelValue":ur[2]||(ur[2]=Ir=>H.value=Ir),type:"text",placeholder:"e.g., Production Server, CI/CD Pipeline",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 focus:outline-none focus:border-primary transition-colors",onKeydown:bx(Xe,["enter"])},null,544),[[sc,H.value]]),ur[13]||(ur[13]=Le("p",{class:"text-xs text-white/50 mt-1"},"Give your token a descriptive name to identify its purpose",-1))]),Le("div",F4e,[Le("button",{onClick:kt,disabled:r.value,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/10 transition-colors disabled:opacity-50"}," Cancel ",8,N4e),Le("button",{onClick:Xe,disabled:r.value||!H.value.trim(),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},Si(r.value?"Creating...":"Create Token"),9,j4e)])])])])):Ma("",!0),ue.value&&Z.value?(Wr(),Qr("div",{key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Yf(Dt,["self"])},[Le("div",U4e,[ur[19]||(ur[19]=Le("h3",{class:"text-xl font-semibold text-white mb-4"},"Token Created Successfully",-1)),Le("div",$4e,[ur[18]||(ur[18]=qc('
Save this token now! For security reasons, it will not be shown again.
',1)),Le("div",null,[ur[16]||(ur[16]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Your API Token",-1)),Le("div",H4e,[Le("input",{value:Z.value,readonly:"",class:"flex-1 px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white font-mono text-sm"},null,8,V4e),Le("button",{onClick:rr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard"},ur[15]||(ur[15]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),ul(" Copy ",-1)]))])]),Le("div",W4e,[ur[17]||(ur[17]=Le("p",{class:"text-sm text-blue-200 mb-2"},[Le("strong",null,"Usage Example:")],-1)),Le("code",q4e,' curl -H "X-API-Key: '+Si(Z.value)+'" '+Si(Fe.value),1)]),Le("div",{class:"flex justify-end mt-6"},[Le("button",{onClick:Dt,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Done ")])])])])):Ma("",!0)]),il(DH,{show:be.value,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${Se.value?.name}'? This action cannot be undone.`,"confirm-text":"Revoke","cancel-text":"Cancel",variant:"danger",onConfirm:bt,onClose:ur[3]||(ur[3]=Ir=>be.value=!1)},null,8,["show","message"])],64))}}),Z4e={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},K4e={class:"glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-primary/30 bg-primary/10"},Y4e={class:"text-primary text-sm sm:text-base"},X4e={class:"mt-1 sm:mt-2 text-primary/80"},J4e={class:"glass-card rounded-[15px] p-3 sm:p-6"},Q4e={class:"flex overflow-x-auto border-b border-white/10 mb-4 sm:mb-6 -mx-3 px-3 sm:mx-0 sm:px-0 scrollbar-hide"},e6e=["onClick"],t6e={class:"flex items-center gap-1 sm:gap-2"},r6e={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},i6e={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n6e={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a6e={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o6e={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s6e={key:5,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},l6e={class:"min-h-[400px]"},u6e={key:0,class:"flex items-center justify-center py-12"},c6e={key:1,class:"flex items-center justify-center py-12"},h6e={class:"text-center"},f6e={class:"text-white/60 text-sm mb-4"},d6e={key:2},p6e=Uu({name:"ConfigurationView",__name:"Configuration",setup(t){const e=kg(),r=vn("radio"),c=vn(!1),S=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"},{id:"api-tokens",label:"API Tokens",icon:"tokens"}];ud(async()=>{try{await e.fetchStats(),c.value=!0}catch(Z){console.error("Failed to load configuration data:",Z),c.value=!0}});function H(Z){r.value=Z}return(Z,ue)=>{const be=_S("router-link");return Wr(),Qr("div",Z4e,[ue[12]||(ue[12]=Le("div",null,[Le("h1",{class:"text-xl sm:text-2xl font-bold text-white"},"Configuration"),Le("p",{class:"text-white/70 mt-1 sm:mt-2 text-sm sm:text-base"},"System configuration and settings")],-1)),Le("div",K4e,[Le("div",Y4e,[ue[3]||(ue[3]=Le("strong",null,"CAD Calibration Tool Available",-1)),Le("p",X4e,[ue[2]||(ue[2]=ul(" Optimize your Channel Activity Detection settings. ",-1)),il(be,{to:"/cad-calibration",class:"underline hover:text-primary transition-colors"},{default:Iv(()=>ue[1]||(ue[1]=[ul(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),Le("div",J4e,[Le("div",Q4e,[(Wr(),Qr(js,null,au(S,Se=>Le("button",{key:Se.id,onClick:Re=>H(Se.id),class:eo(["px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0",r.value===Se.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Le("div",t6e,[Se.icon==="radio"?(Wr(),Qr("svg",r6e,ue[4]||(ue[4]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):Se.icon==="repeater"?(Wr(),Qr("svg",i6e,ue[5]||(ue[5]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):Se.icon==="duty"?(Wr(),Qr("svg",n6e,ue[6]||(ue[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Se.icon==="delays"?(Wr(),Qr("svg",a6e,ue[7]||(ue[7]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):Se.icon==="keys"?(Wr(),Qr("svg",o6e,ue[8]||(ue[8]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):Se.icon==="tokens"?(Wr(),Qr("svg",s6e,ue[9]||(ue[9]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)]))):Ma("",!0),ul(" "+Si(Se.label),1)])],10,e6e)),64))]),Le("div",l6e,[!c.value&&Po(e).isLoading?(Wr(),Qr("div",u6e,ue[10]||(ue[10]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Le("div",{class:"text-white/70"},"Loading configuration...")],-1)]))):Po(e).error&&!c.value?(Wr(),Qr("div",c6e,[Le("div",h6e,[ue[11]||(ue[11]=Le("div",{class:"text-red-400 mb-2"},"Failed to load configuration",-1)),Le("div",f6e,Si(Po(e).error),1),Le("button",{onClick:ue[0]||(ue[0]=Se=>Po(e).fetchStats()),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):(Wr(),Qr("div",d6e,[Sl(Le("div",null,[il(owe,{key:"radio-settings"})],512),[[dx,r.value==="radio"]]),Sl(Le("div",null,[il(Nwe,{key:"repeater-settings"})],512),[[dx,r.value==="repeater"]]),Sl(Le("div",null,[il(Xwe,{key:"duty-cycle"})],512),[[dx,r.value==="duty"]]),Sl(Le("div",null,[il(h3e,{key:"transmission-delays"})],512),[[dx,r.value==="delays"]]),Sl(Le("div",null,[il(h4e,{key:"transport-keys"})],512),[[dx,r.value==="transport"]]),Sl(Le("div",null,[il(G4e,{key:"api-tokens"})],512),[[dx,r.value==="api-tokens"]])]))])])])}}}),m6e={class:"p-6 space-y-6"},g6e={class:"glass-card rounded-[15px] p-6"},v6e={class:"flex justify-center"},y6e={class:"flex gap-4"},_6e=["disabled"],x6e=["disabled"],b6e={class:"glass-card rounded-[15px] p-6 space-y-4"},w6e={class:"text-white"},k6e={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},T6e={class:"text-primary/90"},S6e={class:"space-y-2"},C6e={class:"w-full bg-white/10 rounded-full h-2"},A6e={class:"text-white/70 text-sm"},M6e={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},E6e={class:"glass-card rounded-[15px] p-4 text-center"},L6e={class:"text-2xl font-bold text-primary"},P6e={class:"glass-card rounded-[15px] p-4 text-center"},I6e={class:"text-2xl font-bold text-primary"},D6e={class:"glass-card rounded-[15px] p-4 text-center"},z6e={class:"text-2xl font-bold text-primary"},O6e={class:"glass-card rounded-[15px] p-4 text-center"},B6e={class:"text-2xl font-bold text-primary"},R6e={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},F6e={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},N6e={class:"text-white/80 mb-4"},j6e={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},U6e=Uu({name:"CADCalibrationView",__name:"CADCalibration",setup(t){const e=kg(),r=vn(!1),c=vn(null),S=vn(null),H=vn({}),Z=vn(null),ue=vn([]),be=vn({}),Se=vn("Ready to start calibration"),Re=vn(0),Xe=vn(0),vt=vn(0),bt=vn(0),kt=vn(0),Dt=vn(0),rr=vn(null),Er=vn(!1),Fe=vn(!1),wi=vn(!1),ur=vn(!1);let Ir=null;const Ti={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function _i(){const Xr=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],ei={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};D1.newPlot("plotly-chart",Xr,ei,Ti)}function Ci(){if(Object.keys(H.value).length===0)return;const Xr=Object.values(H.value),ei=[],Di=[],qn=[];for(const ka of Xr)ei.push(ka.det_peak),Di.push(ka.det_min),qn.push(ka.detection_rate);const Qn={x:[ei],y:[Di],"marker.color":[qn],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};D1.restyle("plotly-chart",Qn,[0])}async function ii(){try{const Di=await zs.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Di.success)r.value=!0,c.value=Date.now(),e.setCadCalibrationRunning(!0),H.value={},ue.value=[],be.value={},Z.value=null,Er.value=!1,Fe.value=!1,wi.value=!1,ur.value=!1,vt.value=0,bt.value=0,kt.value=0,Dt.value=0,Re.value=0,Xe.value=0,Ir=setInterval(()=>{c.value&&(Dt.value=Math.floor((Date.now()-c.value)/1e3))},1e3),vi();else throw new Error(Di.error||"Failed to start calibration")}catch(Di){Se.value=`Error: ${Di instanceof Error?Di.message:"Unknown error"}`}}async function Ji(){try{(await zs.post("/cad-calibration-stop")).success&&(r.value=!1,e.setCadCalibrationRunning(!1),S.value&&(S.value.close(),S.value=null),Ir&&(clearInterval(Ir),Ir=null))}catch(Xr){console.error("Failed to stop calibration:",Xr)}}function vi(){S.value&&S.value.close(),S.value=new EventSource(`${gL}/api/cad-calibration-stream`),S.value.onmessage=function(Xr){try{const ei=JSON.parse(Xr.data);vr(ei)}catch(ei){console.error("Failed to parse SSE data:",ei)}},S.value.onerror=function(Xr){console.error("SSE connection error:",Xr),r.value||S.value&&(S.value.close(),S.value=null)}}function vr(Xr){switch(Xr.type){case"status":Se.value=Xr.message||"Status update",Xr.test_ranges&&(rr.value=Xr.test_ranges,Er.value=!0);break;case"progress":Re.value=Xr.current||0,Xe.value=Xr.total||0,vt.value=Xr.current||0;break;case"result":if(Xr.det_peak!==void 0&&Xr.det_min!==void 0&&Xr.detection_rate!==void 0&&Xr.detections!==void 0&&Xr.samples!==void 0){const ei=`${Xr.det_peak}_${Xr.det_min}`;H.value[ei]={det_peak:Xr.det_peak,det_min:Xr.det_min,detection_rate:Xr.detection_rate,detections:Xr.detections,samples:Xr.samples},Ci(),dr()}break;case"complete":case"completed":r.value=!1,Se.value=Xr.message||"Calibration completed",e.setCadCalibrationRunning(!1),Ar(),S.value&&(S.value.close(),S.value=null),Ir&&(clearInterval(Ir),Ir=null);break;case"error":Se.value=`Error: ${Xr.message}`,e.setCadCalibrationRunning(!1),Ji();break}}function dr(){const Xr=Object.values(H.value).map(ei=>ei.detection_rate);Xr.length!==0&&(bt.value=Math.max(...Xr),kt.value=Xr.reduce((ei,Di)=>ei+Di,0)/Xr.length)}function Ar(){Fe.value=!0;let Xr=null,ei=0;for(const Di of Object.values(H.value))Di.detection_rate>ei&&(ei=Di.detection_rate,Xr=Di);Z.value=Xr,Xr&&ei>0?(wi.value=!0,ur.value=!1):(wi.value=!1,ur.value=!0)}async function ti(){if(!Z.value){Se.value="Error: No calibration results to save";return}try{const Xr=await zs.post("/save_cad_settings",{peak:Z.value.det_peak,min_val:Z.value.det_min,detection_rate:Z.value.detection_rate});if(Xr.success)Se.value=`Settings saved! Peak=${Z.value.det_peak}, Min=${Z.value.det_min} applied to configuration.`;else throw new Error(Xr.error||"Failed to save settings")}catch(Xr){Se.value=`Error: Failed to save settings: ${Xr instanceof Error?Xr.message:"Unknown error"}`}}return ud(()=>{_i()}),Dv(()=>{S.value&&S.value.close(),Ir&&clearInterval(Ir),e.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&D1.purge("plotly-chart")}),(Xr,ei)=>(Wr(),Qr("div",m6e,[ei[14]||(ei[14]=Le("div",null,[Le("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),Le("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),Le("div",g6e,[Le("div",v6e,[Le("div",y6e,[Le("button",{onClick:ii,disabled:r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},ei[0]||(ei[0]=[qc('
Start Calibration
Begin testing
',2)]),8,_6e),Le("button",{onClick:Ji,disabled:!r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},ei[1]||(ei[1]=[qc('
Stop
Halt calibration
',2)]),8,x6e)])])]),Le("div",b6e,[Le("div",w6e,Si(Se.value),1),Er.value&&rr.value?(Wr(),Qr("div",k6e,[Le("div",T6e,[ei[2]||(ei[2]=Le("strong",null,"Configuration:",-1)),ul(" SF"+Si(rr.value.spreading_factor)+" | Peak: "+Si(rr.value.peak_min)+" - "+Si(rr.value.peak_max)+" | Min: "+Si(rr.value.min_min)+" - "+Si(rr.value.min_max)+" | "+Si((rr.value.peak_max-rr.value.peak_min+1)*(rr.value.min_max-rr.value.min_min+1))+" tests ",1)])])):Ma("",!0),Le("div",S6e,[Le("div",C6e,[Le("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:om({width:Xe.value>0?`${Re.value/Xe.value*100}%`:"0%"})},null,4)]),Le("div",A6e,Si(Re.value)+" / "+Si(Xe.value)+" tests completed",1)])]),Le("div",M6e,[Le("div",E6e,[Le("div",L6e,Si(vt.value),1),ei[3]||(ei[3]=Le("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),Le("div",P6e,[Le("div",I6e,Si(bt.value.toFixed(1))+"%",1),ei[4]||(ei[4]=Le("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),Le("div",D6e,[Le("div",z6e,Si(kt.value.toFixed(1))+"%",1),ei[5]||(ei[5]=Le("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),Le("div",O6e,[Le("div",B6e,Si(Dt.value)+"s",1),ei[6]||(ei[6]=Le("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),ei[15]||(ei[15]=Le("div",{class:"glass-card rounded-[15px] p-6"},[Le("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),Fe.value?(Wr(),Qr("div",R6e,[ei[13]||(ei[13]=Le("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),wi.value&&Z.value?(Wr(),Qr("div",F6e,[ei[11]||(ei[11]=Le("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),Le("p",N6e,[ei[7]||(ei[7]=ul(" Peak: ",-1)),Le("strong",null,Si(Z.value.det_peak),1),ei[8]||(ei[8]=ul(", Min: ",-1)),Le("strong",null,Si(Z.value.det_min),1),ei[9]||(ei[9]=ul(", Rate: ",-1)),Le("strong",null,Si(Z.value.detection_rate.toFixed(1))+"%",1)]),Le("div",{class:"flex justify-center"},[Le("button",{onClick:ti,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},ei[10]||(ei[10]=[qc('
Save Settings
Apply to configuration
',2)]))])])):Ma("",!0),ur.value?(Wr(),Qr("div",j6e,ei[12]||(ei[12]=[Le("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),Le("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):Ma("",!0)])):Ma("",!0)]))}}),$6e=kh(U6e,[["__scopeId","data-v-854f5f55"]]),H6e={class:"p-6 space-y-6"},V6e={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},W6e={class:"glass-card rounded-[15px] p-4"},q6e={class:"text-2xl font-bold text-white"},G6e={class:"glass-card rounded-[15px] p-4"},Z6e={class:"text-2xl font-bold text-primary"},K6e={class:"glass-card rounded-[15px] p-4"},Y6e={class:"text-2xl font-bold text-accent-green"},X6e={class:"glass-card rounded-[15px] p-4"},J6e={class:"text-2xl font-bold text-secondary"},Q6e={class:"glass-card rounded-[15px] p-6"},eke={class:"flex flex-wrap border-b border-white/10 mb-6"},tke=["onClick"],rke={class:"flex items-center gap-2"},ike={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},nke={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ake={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},oke={class:"min-h-[400px]"},ske={key:0,class:"flex items-center justify-center py-12"},lke={key:1,class:"flex items-center justify-center py-12"},uke={class:"text-center"},cke={class:"text-white/60 text-sm mb-4"},hke={key:2,class:"space-y-4"},fke={key:0,class:"text-center py-12 text-white/60"},dke={key:1,class:"space-y-4"},pke={class:"flex items-start justify-between"},mke={class:"flex-1"},gke={class:"flex items-center gap-3 mb-2"},vke={class:"text-lg font-semibold text-white"},yke={class:"text-white/50 text-sm"},_ke={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},xke={class:"text-white font-medium"},bke={class:"text-primary font-medium"},wke={class:"mt-3 flex items-center gap-2"},kke={key:3,class:"space-y-4"},Tke={key:0,class:"text-center py-12 text-white/60"},Ske={key:1,class:"overflow-x-auto"},Cke={class:"w-full"},Ake={class:"py-3"},Mke={class:"font-mono text-sm text-white"},Eke={class:"py-3"},Lke={class:"font-mono text-xs text-white/70"},Pke={class:"py-3"},Ike={class:"text-sm text-white"},Dke={class:"text-xs text-white/50"},zke={class:"py-3"},Oke={class:"py-3"},Bke={class:"text-sm text-white/70"},Rke={class:"py-3"},Fke=["onClick"],Nke={key:4,class:"space-y-4"},jke={class:"mb-4"},Uke=["value"],$ke={key:0,class:"text-center py-12 text-white/60"},Hke={key:1,class:"grid grid-cols-1 gap-4"},Vke={class:"flex items-start justify-between"},Wke={class:"flex-1"},qke={class:"flex items-center gap-3 mb-3"},Gke={class:"text-white font-mono text-sm"},Zke={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},Kke={class:"text-white/90 font-mono ml-2"},Yke={class:"text-white/90 ml-2"},Xke={class:"text-white/90 ml-2"},Jke={class:"text-white/90 ml-2"},Qke=["onClick"],eTe={class:"flex justify-end"},tTe=["disabled"],rTe=Uu({name:"SessionsView",__name:"Sessions",setup(t){const e=vn("overview"),r=vn(!1),c=vn(!1),S=vn(null),H=vn(null),Z=vn([]),ue=vn(null),be=vn(null),Se=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];ud(async()=>{await Re(),r.value=!0});async function Re(){c.value=!0,S.value=null;try{const rr=await zs.getACLInfo();rr.success&&(H.value=rr.data);const Er=await zs.getACLClients();Er.success&&Er.data&&(Z.value=Er.data.clients||[]);const Fe=await zs.getACLStats();Fe.success&&(ue.value=Fe.data)}catch(rr){S.value=rr instanceof Error?rr.message:"Failed to load ACL data",console.error("Error fetching ACL data:",rr)}finally{c.value=!1}}async function Xe(rr,Er){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const Fe=await zs.removeACLClient({public_key:rr,identity_hash:Er});Fe.success?await Re():alert(`Failed to remove client: ${Fe.error}`)}catch(Fe){alert(`Error removing client: ${Fe}`)}}function vt(rr){return rr?new Date(rr*1e3).toLocaleString():"Never"}function bt(rr){e.value=rr}const kt=Do(()=>be.value?Z.value.filter(rr=>rr.identity_name===be.value):Z.value),Dt=Do(()=>H.value?H.value.acls||[]:[]);return(rr,Er)=>(Wr(),Qr("div",H6e,[Er[22]||(Er[22]=Le("div",null,[Le("h1",{class:"text-2xl font-bold text-white"},"Sessions & Access Control"),Le("p",{class:"text-white/70 mt-2"},"Manage authenticated clients and access control lists")],-1)),ue.value?(Wr(),Qr("div",V6e,[Le("div",W6e,[Er[1]||(Er[1]=Le("div",{class:"text-white/70 text-sm mb-1"},"Total Identities",-1)),Le("div",q6e,Si(ue.value.total_identities),1)]),Le("div",G6e,[Er[2]||(Er[2]=Le("div",{class:"text-white/70 text-sm mb-1"},"Authenticated Clients",-1)),Le("div",Z6e,Si(ue.value.total_clients),1)]),Le("div",K6e,[Er[3]||(Er[3]=Le("div",{class:"text-white/70 text-sm mb-1"},"Admin Clients",-1)),Le("div",Y6e,Si(ue.value.admin_clients),1)]),Le("div",X6e,[Er[4]||(Er[4]=Le("div",{class:"text-white/70 text-sm mb-1"},"Guest Clients",-1)),Le("div",J6e,Si(ue.value.guest_clients),1)])])):Ma("",!0),Le("div",Q6e,[Le("div",eke,[(Wr(),Qr(js,null,au(Se,Fe=>Le("button",{key:Fe.id,onClick:wi=>bt(Fe.id),class:eo(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",e.value===Fe.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Le("div",rke,[Fe.icon==="overview"?(Wr(),Qr("svg",ike,Er[5]||(Er[5]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):Fe.icon==="clients"?(Wr(),Qr("svg",nke,Er[6]||(Er[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):Fe.icon==="identities"?(Wr(),Qr("svg",ake,Er[7]||(Er[7]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):Ma("",!0),ul(" "+Si(Fe.label),1)])],10,tke)),64))]),Le("div",oke,[c.value&&!r.value?(Wr(),Qr("div",ske,Er[8]||(Er[8]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Le("div",{class:"text-white/70"},"Loading ACL data...")],-1)]))):S.value?(Wr(),Qr("div",lke,[Le("div",uke,[Er[9]||(Er[9]=Le("div",{class:"text-red-400 mb-2"},"Failed to load ACL data",-1)),Le("div",cke,Si(S.value),1),Le("button",{onClick:Re,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):e.value==="overview"?(Wr(),Qr("div",hke,[Dt.value.length===0?(Wr(),Qr("div",fke," No identities configured ")):(Wr(),Qr("div",dke,[(Wr(!0),Qr(js,null,au(Dt.value,Fe=>(Wr(),Qr("div",{key:Fe.hash,class:"glass-card rounded-[10px] p-4 border border-white/10 hover:border-primary/30 transition-colors"},[Le("div",pke,[Le("div",mke,[Le("div",gke,[Le("h3",vke,Si(Fe.name),1),Le("span",{class:eo(["px-2 py-1 text-xs font-medium rounded",Fe.type==="repeater"?"bg-primary/20 text-primary":"bg-secondary/20 text-secondary"])},Si(Fe.type),3),Le("span",yke,Si(Fe.hash),1)]),Le("div",_ke,[Le("div",null,[Er[10]||(Er[10]=Le("div",{class:"text-white/50 text-xs mb-1"},"Max Clients",-1)),Le("div",xke,Si(Fe.max_clients),1)]),Le("div",null,[Er[11]||(Er[11]=Le("div",{class:"text-white/50 text-xs mb-1"},"Authenticated",-1)),Le("div",bke,Si(Fe.authenticated_clients),1)]),Le("div",null,[Er[12]||(Er[12]=Le("div",{class:"text-white/50 text-xs mb-1"},"Admin Password",-1)),Le("div",{class:eo(Fe.has_admin_password?"text-accent-green":"text-accent-red")},Si(Fe.has_admin_password?"✓ Set":"✗ Not Set"),3)]),Le("div",null,[Er[13]||(Er[13]=Le("div",{class:"text-white/50 text-xs mb-1"},"Guest Password",-1)),Le("div",{class:eo(Fe.has_guest_password?"text-accent-green":"text-accent-red")},Si(Fe.has_guest_password?"✓ Set":"✗ Not Set"),3)])]),Le("div",wke,[Er[14]||(Er[14]=Le("span",{class:"text-white/50 text-xs"},"Read-Only Access:",-1)),Le("span",{class:eo(Fe.allow_read_only?"text-accent-green":"text-accent-red")},Si(Fe.allow_read_only?"Allowed":"Disabled"),3)])])])]))),128))]))])):e.value==="clients"?(Wr(),Qr("div",kke,[Z.value.length===0?(Wr(),Qr("div",Tke," No authenticated clients ")):(Wr(),Qr("div",Ske,[Le("table",Cke,[Er[15]||(Er[15]=Le("thead",null,[Le("tr",{class:"border-b border-white/10"},[Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Client"),Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Address"),Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Identity"),Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Permissions"),Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Last Activity"),Le("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Actions")])],-1)),Le("tbody",null,[(Wr(!0),Qr(js,null,au(Z.value,Fe=>(Wr(),Qr("tr",{key:Fe.public_key_full,class:"border-b border-white/5 hover:bg-white/5 transition-colors"},[Le("td",Ake,[Le("div",Mke,Si(Fe.public_key),1)]),Le("td",Eke,[Le("div",Lke,Si(Fe.address),1)]),Le("td",Pke,[Le("div",Ike,Si(Fe.identity_name),1),Le("div",Dke,Si(Fe.identity_hash),1)]),Le("td",zke,[Le("span",{class:eo(["px-2 py-1 text-xs font-medium rounded",Fe.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},Si(Fe.permissions),3)]),Le("td",Oke,[Le("div",Bke,Si(vt(Fe.last_activity)),1)]),Le("td",Rke,[Le("button",{onClick:wi=>Xe(Fe.public_key_full,Fe.identity_hash),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Remove ",8,Fke)])]))),128))])])]))])):e.value==="identities"?(Wr(),Qr("div",Nke,[Le("div",jke,[Er[17]||(Er[17]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Filter by Identity",-1)),Sl(Le("select",{"onUpdate:modelValue":Er[0]||(Er[0]=Fe=>be.value=Fe),class:"bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},[Er[16]||(Er[16]=Le("option",{value:null},"All Identities",-1)),(Wr(!0),Qr(js,null,au(Dt.value,Fe=>(Wr(),Qr("option",{key:Fe.name,value:Fe.name},Si(Fe.name)+" ("+Si(Fe.authenticated_clients)+" clients) ",9,Uke))),128))],512),[[_g,be.value]])]),kt.value.length===0?(Wr(),Qr("div",$ke," No clients for selected identity ")):(Wr(),Qr("div",Hke,[(Wr(!0),Qr(js,null,au(kt.value,Fe=>(Wr(),Qr("div",{key:Fe.public_key_full,class:"glass-card rounded-[10px] p-4 border border-white/10"},[Le("div",Vke,[Le("div",Wke,[Le("div",qke,[Le("span",{class:eo(["px-2 py-1 text-xs font-medium rounded",Fe.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},Si(Fe.permissions),3),Le("span",Gke,Si(Fe.public_key),1)]),Le("div",Zke,[Le("div",null,[Er[18]||(Er[18]=Le("span",{class:"text-white/50"},"Address:",-1)),Le("span",Kke,Si(Fe.address),1)]),Le("div",null,[Er[19]||(Er[19]=Le("span",{class:"text-white/50"},"Identity:",-1)),Le("span",Yke,Si(Fe.identity_name)+" ("+Si(Fe.identity_hash)+")",1)]),Le("div",null,[Er[20]||(Er[20]=Le("span",{class:"text-white/50"},"Last Activity:",-1)),Le("span",Xke,Si(vt(Fe.last_activity)),1)]),Le("div",null,[Er[21]||(Er[21]=Le("span",{class:"text-white/50"},"Last Login:",-1)),Le("span",Jke,Si(vt(Fe.last_login_success)),1)])])]),Le("button",{onClick:wi=>Xe(Fe.public_key_full,Fe.identity_hash),class:"ml-4 px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Remove ",8,Qke)])]))),128))]))])):Ma("",!0)])]),Le("div",eTe,[Le("button",{onClick:Re,disabled:c.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},Si(c.value?"Refreshing...":"Refresh Data"),9,tTe)])]))}}),iTe={class:"mb-6"},nTe={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},aTe={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},oTe={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},sTe={class:"text-white/80 text-base leading-relaxed"},lTe={class:"flex"},uTe=Uu({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=ue=>{ue.target===ue.currentTarget&&c("close")},H={success:"bg-green-500/20 border-green-500/30 text-green-400",error:"bg-red-500/20 border-red-500/30 text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-400"},Z={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(ue,be)=>r.show?(Wr(),Qr("div",{key:0,onClick:S,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Le("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:be[1]||(be[1]=Yf(()=>{},["stop"]))},[Le("div",iTe,[Le("div",{class:eo(["inline-flex p-3 rounded-xl mb-4",H[r.variant]])},[r.variant==="success"?(Wr(),Qr("svg",nTe,be[2]||(be[2]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):r.variant==="error"?(Wr(),Qr("svg",aTe,be[3]||(be[3]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Wr(),Qr("svg",oTe,be[4]||(be[4]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),Le("p",sTe,Si(r.message),1)]),Le("div",lTe,[Le("button",{onClick:be[0]||(be[0]=Se=>c("close")),class:eo(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",Z[r.variant]])}," OK ",2)])])])):Ma("",!0)}}),cTe={class:"p-6 space-y-6"},hTe={class:"relative overflow-hidden rounded-[20px] p-6 mb-6"},fTe={class:"relative flex items-center justify-between"},dTe={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},pTe={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},mTe={class:"relative flex items-center justify-between"},gTe={class:"text-3xl font-bold text-white mb-1"},vTe={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},yTe={class:"relative flex items-center justify-between"},_Te={class:"text-3xl font-bold text-primary mb-1"},xTe={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},bTe={class:"relative flex items-center justify-between"},wTe={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kTe={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},TTe={class:"glass-card rounded-[15px] p-6"},STe={key:0,class:"flex items-center justify-center py-12"},CTe={key:1,class:"flex items-center justify-center py-12"},ATe={class:"text-center"},MTe={class:"text-white/60 text-sm mb-4"},ETe={key:2,class:"space-y-4"},LTe={class:"relative flex items-start justify-between"},PTe={class:"flex-1"},ITe={class:"flex items-center gap-3 mb-4"},DTe={class:"relative"},zTe={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},OTe={class:"text-xl font-bold text-white group-hover:text-primary transition-colors"},BTe={key:0,class:"text-white/50 text-sm"},RTe={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},FTe={class:"text-white/90 ml-2"},NTe={class:"flex items-center gap-2"},jTe={key:0,class:"text-white/90 font-mono ml-2 text-xs"},UTe={key:1,class:"text-white/50 ml-2 text-xs"},$Te=["onClick"],HTe={class:"text-white/90 ml-2"},VTe={key:0},WTe={class:"text-white/90 ml-2"},qTe={key:0,class:"text-accent-green"},GTe={key:1,class:"text-white/50"},ZTe={key:2,class:"text-primary"},KTe={key:0,class:"text-xs text-white/50 font-mono"},YTe={class:"ml-4 flex flex-wrap gap-2"},XTe=["onClick","disabled","title"],JTe=["onClick","disabled","title"],QTe=["onClick"],eSe=["onClick"],tSe={key:3,class:"text-center py-12 text-white/60"},rSe={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},iSe={class:"glass-card rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},nSe={class:"space-y-4"},aSe={class:"block text-white/70 text-sm mb-2"},oSe={key:0},sSe={key:1,class:"text-white/50 text-sm"},lSe={class:"grid grid-cols-2 gap-4"},uSe={class:"grid grid-cols-2 gap-4"},cSe={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},hSe={class:"glass-card rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},fSe={class:"space-y-4"},dSe=["value"],pSe={class:"block text-white/70 text-sm mb-2"},mSe={key:0},gSe={key:1,class:"text-white/50 text-sm"},vSe={class:"grid grid-cols-2 gap-4"},ySe={class:"grid grid-cols-2 gap-4"},_Se={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},xSe={class:"glass-card rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl border border-white/20"},bSe={class:"relative overflow-hidden rounded-[15px] mb-6 p-5"},wSe={class:"relative flex items-center justify-between"},kSe={class:"flex items-center gap-4"},TSe={class:"text-white/60 text-sm flex items-center gap-2"},SSe={class:"text-primary font-semibold"},CSe={class:"flex items-center gap-2"},ASe={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},MSe={class:"flex-1 overflow-y-auto mb-4 space-y-3"},ESe={key:0,class:"flex items-center justify-center py-12"},LSe={key:1,class:"flex items-center justify-center py-12"},PSe={class:"text-center"},ISe={class:"text-white/60 text-sm mb-4"},DSe={key:2,class:"space-y-3"},zSe={class:"relative flex items-start justify-between gap-3"},OSe={class:"flex-1 min-w-0"},BSe={class:"flex items-center gap-2 mb-3"},RSe={class:"flex items-center gap-2 flex-wrap"},FSe={key:0,class:"text-primary text-sm font-bold"},NSe={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},jSe={key:2,class:"text-white/40 text-xs"},USe={class:"text-white/50 text-xs flex items-center gap-1"},$Se={key:3,class:"text-white/30 text-[10px] font-mono bg-white/5 px-1.5 py-0.5 rounded"},HSe={class:"text-white/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-white/5 p-3 rounded-[10px] border border-white/5"},VSe=["onClick"],WSe={key:0,class:"text-center pt-4"},qSe={key:1,class:"text-center pt-4"},GSe={key:3,class:"flex items-center justify-center h-full"},ZSe={class:"relative overflow-hidden rounded-[15px] border-t border-white/20 pt-4 mt-4"},KSe={class:"relative space-y-3"},YSe={class:"flex gap-3"},XSe={class:"flex-1 relative"},JSe=["onKeydown"],QSe=["disabled"],e8e={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},t8e={class:"glass-card rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},r8e={class:"flex items-center justify-between mb-4 pb-4 border-b border-white/10"},i8e={class:"text-white/70 text-sm mt-1"},n8e={class:"text-primary"},a8e={class:"flex-1 overflow-y-auto space-y-3"},o8e={key:0,class:"text-center py-12"},s8e={class:"space-y-2"},l8e={class:"flex items-center justify-between"},u8e={class:"flex items-center gap-2"},c8e={class:"text-white font-semibold"},h8e={class:"flex items-center gap-2"},f8e={class:"text-white/50 text-xs"},d8e=["onClick"],p8e={class:"space-y-1 text-xs"},m8e={class:"flex items-center gap-2"},g8e={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},v8e={class:"flex items-center gap-2"},y8e={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},_8e={class:"flex items-center justify-between text-xs text-white/50"},x8e={class:"flex items-center gap-4"},b8e={key:0},w8e={key:1},k8e={key:0},T8e=Uu({name:"RoomServersView",__name:"RoomServers",setup(t){const e=vn(!1),r=vn(null),c=vn(null),S=vn(!1),H=vn(!1),Z=vn(null),ue=vn(!1),be=vn(!1),Se=vn(new Set),Re=vn(!1),Xe=vn(""),vt=vn(!1),bt=vn({message:"",variant:"success"}),kt=vn(!1),Dt=vn(""),rr=vn(""),Er=vn([]),Fe=vn(!1),wi=vn(null),ur=vn(""),Ir=vn(50),Ti=vn(0),_i=vn(!0),Ci=vn([]),ii=vn(!1),Ji=vn({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});ud(async()=>{await vi()});async function vi(){e.value=!0,r.value=null;try{const _a=await zs.getIdentities();_a.success?c.value=_a.data:r.value=_a.error||"Failed to load identities"}catch(_a){r.value=_a instanceof Error?_a.message:"Failed to load identities"}finally{e.value=!1}}async function vr(){try{const _a=await zs.createIdentity(Ji.value);_a.success?(S.value=!1,qn(),await vi(),Xr(_a.message||"Identity created successfully!","success")):Xr(`Failed to create identity: ${_a.error}`,"error")}catch(_a){Xr(`Error creating identity: ${_a}`,"error")}}async function dr(){try{const _a=await zs.updateIdentity(Z.value);_a.success?(H.value=!1,Z.value=null,await vi(),Xr(_a.message||"Identity updated successfully!","success")):Xr(`Failed to update identity: ${_a.error}`,"error")}catch(_a){Xr(`Error updating identity: ${_a}`,"error")}}function Ar(_a){Xe.value=_a,Re.value=!0}async function ti(){const _a=Xe.value;Re.value=!1;try{const Ur=await zs.deleteIdentity(_a);Ur.success?(await vi(),Xr(Ur.message||"Identity deleted successfully!","success")):Xr(`Failed to delete identity: ${Ur.error}`,"error")}catch(Ur){Xr(`Error deleting identity: ${Ur}`,"error")}finally{Xe.value=""}}function Xr(_a,Ur){bt.value={message:_a,variant:Ur},vt.value=!0}async function ei(_a){try{const Ur=await zs.sendRoomServerAdvert(_a);Ur.success?Xr(Ur.message||`Advert sent for '${_a}'!`,"success"):Xr(`Failed to send advert: ${Ur.error}`,"error")}catch(Ur){Xr(`Error sending advert: ${Ur}`,"error")}}function Di(_a){Z.value=JSON.parse(JSON.stringify(_a)),Z.value.settings||(Z.value.settings={}),Z.value.settings.admin_password||(Z.value.settings.admin_password=""),Z.value.settings.guest_password||(Z.value.settings.guest_password=""),be.value=!1,H.value=!0}function qn(){Ji.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},ue.value=!1}function Qn(){S.value=!1,H.value=!1,Z.value=null,ue.value=!1,be.value=!1,qn()}function ka(_a){Se.value.has(_a)?Se.value.delete(_a):Se.value.add(_a)}async function Ta(_a){Dt.value=_a,kt.value=!0,Ti.value=0,_i.value=!0;const Ur=c.value?.configured.find(Mi=>Mi.name===_a);rr.value=Ur?.hash||"",await so(),await Yn(!0)}async function so(){try{console.log("Fetching ACL clients for room:",Dt.value,"hash:",rr.value);const _a=await zs.getACLClients({identity_hash:rr.value,identity_name:Dt.value});console.log("ACL clients response:",_a),_a.success&&_a.data&&(Ci.value=_a.data.clients||[],console.log("ACL clients loaded:",Ci.value.length))}catch(_a){console.error("Failed to fetch ACL clients:",_a)}}async function Yn(_a=!1){_a&&(Ti.value=0,Er.value=[]),Fe.value=!0,wi.value=null;try{const Ur=await zs.getRoomMessages({room_name:Dt.value,limit:Ir.value,offset:Ti.value});if(Ur.success&&Ur.data){const Mi=Ur.data.messages||[];_a?Er.value=Mi:Er.value=[...Er.value,...Mi],_i.value=Mi.length===Ir.value}else wi.value=Ur.error||"Failed to load messages"}catch(Ur){wi.value=Ur instanceof Error?Ur.message:"Failed to load messages"}finally{Fe.value=!1}}async function sn(){Ti.value+=Ir.value,await Yn(!1)}async function an(){if(ur.value.trim())try{const _a=await zs.postRoomMessage({room_name:Dt.value,message:ur.value,author_pubkey:"server"});_a.success?(ur.value="",await Yn(!0)):Xr(`Failed to send message: ${_a.error}`,"error")}catch(_a){Xr(`Error sending message: ${_a}`,"error")}}async function zn(_a){if(confirm("Are you sure you want to delete this message?"))try{const Ur=await zs.deleteRoomMessage({room_name:Dt.value,message_id:_a});Ur.success?(await Yn(!0),Xr("Message deleted successfully","success")):Xr(`Failed to delete message: ${Ur.error}`,"error")}catch(Ur){Xr(`Error deleting message: ${Ur}`,"error")}}function Ra(){kt.value=!1,Dt.value="",rr.value="",Er.value=[],ur.value="",wi.value=null,Ci.value=[]}function Ya(_a){return _a?new Date(_a*1e3).toLocaleString():"Unknown"}async function zo(_a,Ur){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const Mi=await zs.removeACLClient({public_key:_a,identity_hash:Ur});Mi.success?(await so(),Xr("Client removed successfully","success")):Xr(`Failed to remove client: ${Mi.error}`,"error")}catch(Mi){Xr(`Error removing client: ${Mi}`,"error")}}return(_a,Ur)=>(Wr(),Qr(js,null,[Le("div",cTe,[Le("div",hTe,[Ur[26]||(Ur[26]=Le("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),Ur[27]||(Ur[27]=Le("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),Le("div",fTe,[Ur[25]||(Ur[25]=qc('

Room Servers

Manage room server identities and messages

',1)),Le("button",{onClick:Ur[0]||(Ur[0]=Mi=>S.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-white rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},Ur[24]||(Ur[24]=[Le("span",{class:"flex items-center gap-2"},[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),ul(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(Wr(),Qr("div",dTe,[Le("div",pTe,[Ur[30]||(Ur[30]=Le("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Le("div",mTe,[Le("div",null,[Ur[28]||(Ur[28]=Le("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),Le("div",gTe,Si(c.value.total_configured),1)]),Ur[29]||(Ur[29]=Le("div",{class:"bg-white/10 p-3 rounded-[12px] group-hover:bg-white/20 transition-colors"},[Le("svg",{class:"w-6 h-6 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),Le("div",vTe,[Ur[33]||(Ur[33]=Le("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Le("div",yTe,[Le("div",null,[Ur[31]||(Ur[31]=Le("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),Le("div",_Te,Si(c.value.total_registered),1)]),Ur[32]||(Ur[32]=Le("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[Le("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),Le("div",xTe,[Ur[37]||(Ur[37]=Le("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Le("div",bTe,[Le("div",null,[Ur[34]||(Ur[34]=Le("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),Le("div",{class:eo(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},Si(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),Le("div",{class:eo(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(Wr(),Qr("svg",wTe,Ur[35]||(Ur[35]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(Wr(),Qr("svg",kTe,Ur[36]||(Ur[36]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):Ma("",!0),Le("div",TTe,[e.value?(Wr(),Qr("div",STe,Ur[38]||(Ur[38]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Le("div",{class:"text-white/70"},"Loading room servers...")],-1)]))):r.value?(Wr(),Qr("div",CTe,[Le("div",ATe,[Ur[39]||(Ur[39]=Le("div",{class:"text-red-400 mb-2"},"Failed to load room servers",-1)),Le("div",MTe,Si(r.value),1),Le("button",{onClick:vi,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(Wr(),Qr("div",ETe,[(Wr(!0),Qr(js,null,au(c.value.configured,Mi=>(Wr(),Qr("div",{key:Mi.name,class:"group relative overflow-hidden glass-card rounded-[15px] p-5 border border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[Ur[46]||(Ur[46]=Le("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Le("div",LTe,[Le("div",PTe,[Le("div",ITe,[Le("div",DTe,[Mi.registered?(Wr(),Qr("div",zTe)):Ma("",!0),Le("div",{class:eo(["relative w-3 h-3 rounded-full",Mi.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),Le("h3",OTe,Si(Mi.name),1),Le("span",{class:eo(["px-3 py-1 text-xs font-semibold rounded-full",Mi.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},Si(Mi.registered?"● Active":"○ Inactive"),3),Mi.hash?(Wr(),Qr("span",BTe,Si(Mi.hash),1)):Ma("",!0)]),Le("div",RTe,[Le("div",null,[Ur[40]||(Ur[40]=Le("span",{class:"text-white/50"},"Node Name:",-1)),Le("span",FTe,Si(Mi.settings?.node_name||"Not set"),1)]),Le("div",NTe,[Ur[41]||(Ur[41]=Le("span",{class:"text-white/50"},"Identity Key:",-1)),Se.value.has(Mi.name)?(Wr(),Qr("span",jTe,Si(Mi.identity_key),1)):(Wr(),Qr("span",UTe," •••••••••••••••• ")),Le("button",{onClick:Xi=>ka(Mi.name),class:"text-primary/70 hover:text-primary text-xs underline"},Si(Se.value.has(Mi.name)?"Hide":"Show"),9,$Te)]),Le("div",null,[Ur[42]||(Ur[42]=Le("span",{class:"text-white/50"},"Location:",-1)),Le("span",HTe,Si(Mi.settings?.latitude||0)+", "+Si(Mi.settings?.longitude||0),1)]),Mi.settings?.admin_password||Mi.settings?.guest_password?(Wr(),Qr("div",VTe,[Ur[43]||(Ur[43]=Le("span",{class:"text-white/50"},"Passwords:",-1)),Le("span",WTe,[Mi.settings?.admin_password?(Wr(),Qr("span",qTe,"Admin")):Ma("",!0),Mi.settings?.admin_password&&Mi.settings?.guest_password?(Wr(),Qr("span",GTe," / ")):Ma("",!0),Mi.settings?.guest_password?(Wr(),Qr("span",ZTe,"Guest")):Ma("",!0)])])):Ma("",!0)]),Mi.address?(Wr(),Qr("div",KTe," Address: "+Si(Mi.address),1)):Ma("",!0)]),Le("div",YTe,[Le("button",{onClick:Xi=>Ta(Mi.name),disabled:!Mi.registered,class:eo(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Mi.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"]),title:Mi.registered?"Manage messages for this room":"Room server must be active to manage messages"},Ur[44]||(Ur[44]=[Le("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),ul(" Messages ",-1)]),10,XTe),Le("button",{onClick:Xi=>ei(Mi.name),disabled:!Mi.registered,class:eo(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Mi.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"]),title:Mi.registered?"Send advert for this room server":"Room server must be active to send advert"},Ur[45]||(Ur[45]=[Le("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),ul(" Send Advert ",-1)]),10,JTe),Le("button",{onClick:Xi=>Di(Mi),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,QTe),Le("button",{onClick:Xi=>Ar(Mi.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,eSe)])])]))),128))])):(Wr(),Qr("div",tSe,[Ur[47]||(Ur[47]=Le("svg",{class:"w-16 h-16 mx-auto mb-4 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),Ur[48]||(Ur[48]=Le("p",{class:"text-lg mb-2"},"No room servers configured",-1)),Ur[49]||(Ur[49]=Le("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),Le("button",{onClick:Ur[1]||(Ur[1]=Mi=>S.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),S.value?(Wr(),Qr("div",rSe,[Le("div",iSe,[Ur[60]||(Ur[60]=Le("h2",{class:"text-xl font-bold text-white mb-4"},"Add Room Server",-1)),Le("div",nSe,[Le("div",null,[Ur[50]||(Ur[50]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Name *",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[2]||(Ur[2]=Mi=>Ji.value.name=Mi),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.name]])]),Le("div",null,[Le("label",aSe,[Ur[51]||(Ur[51]=ul(" Identity Key (Optional) ",-1)),Le("button",{onClick:Ur[3]||(Ur[3]=Mi=>ue.value=!ue.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},Si(ue.value?"Hide":"Show/Edit"),1)]),ue.value?(Wr(),Qr("div",oSe,[Sl(Le("input",{"onUpdate:modelValue":Ur[4]||(Ur[4]=Mi=>Ji.value.identity_key=Mi),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white font-mono text-sm focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.identity_key]]),Ur[52]||(Ur[52]=Le("p",{class:"text-white/50 text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(Wr(),Qr("div",sSe," Will be auto-generated if not provided "))]),Le("div",null,[Ur[53]||(Ur[53]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Node Name",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[5]||(Ur[5]=Mi=>Ji.value.settings.node_name=Mi),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.settings.node_name]])]),Le("div",lSe,[Le("div",null,[Ur[54]||(Ur[54]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Latitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[6]||(Ur[6]=Mi=>Ji.value.settings.latitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.settings.latitude,void 0,{number:!0}]])]),Le("div",null,[Ur[55]||(Ur[55]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Longitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[7]||(Ur[7]=Mi=>Ji.value.settings.longitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.settings.longitude,void 0,{number:!0}]])])]),Le("div",uSe,[Le("div",null,[Ur[56]||(Ur[56]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Admin Password (Optional)",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[8]||(Ur[8]=Mi=>Ji.value.settings.admin_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.settings.admin_password]]),Ur[57]||(Ur[57]=Le("p",{class:"text-white/50 text-xs mt-1"},"Full access to room server",-1))]),Le("div",null,[Ur[58]||(Ur[58]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Guest Password (Optional)",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[9]||(Ur[9]=Mi=>Ji.value.settings.guest_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Ji.value.settings.guest_password]]),Ur[59]||(Ur[59]=Le("p",{class:"text-white/50 text-xs mt-1"},"Read-only access",-1))])])]),Le("div",{class:"flex justify-end gap-3 mt-6"},[Le("button",{onClick:Qn,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg transition-colors"}," Cancel "),Le("button",{onClick:vr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):Ma("",!0),H.value&&Z.value?(Wr(),Qr("div",cSe,[Le("div",hSe,[Ur[72]||(Ur[72]=Le("h2",{class:"text-xl font-bold text-white mb-4"},"Edit Room Server",-1)),Le("div",fSe,[Le("div",null,[Ur[61]||(Ur[61]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Current Name",-1)),Le("input",{value:Z.value.name,disabled:"",type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white/50 cursor-not-allowed"},null,8,dSe)]),Le("div",null,[Ur[62]||(Ur[62]=Le("label",{class:"block text-white/70 text-sm mb-2"},"New Name (optional)",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[10]||(Ur[10]=Mi=>Z.value.new_name=Mi),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.new_name]])]),Le("div",null,[Le("label",pSe,[Ur[63]||(Ur[63]=ul(" Identity Key (Optional) ",-1)),Le("button",{onClick:Ur[11]||(Ur[11]=Mi=>be.value=!be.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},Si(be.value?"Hide":"Show/Edit"),1)]),be.value?(Wr(),Qr("div",mSe,[Sl(Le("input",{"onUpdate:modelValue":Ur[12]||(Ur[12]=Mi=>Z.value.identity_key=Mi),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white font-mono text-sm focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.identity_key]]),Ur[64]||(Ur[64]=Le("p",{class:"text-white/50 text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(Wr(),Qr("div",gSe,' Click "Show/Edit" to change the identity key '))]),Le("div",null,[Ur[65]||(Ur[65]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Node Name",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[13]||(Ur[13]=Mi=>Z.value.settings.node_name=Mi),type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.node_name]])]),Le("div",vSe,[Le("div",null,[Ur[66]||(Ur[66]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Latitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[14]||(Ur[14]=Mi=>Z.value.settings.latitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.latitude,void 0,{number:!0}]])]),Le("div",null,[Ur[67]||(Ur[67]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Longitude",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[15]||(Ur[15]=Mi=>Z.value.settings.longitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.longitude,void 0,{number:!0}]])])]),Le("div",ySe,[Le("div",null,[Ur[68]||(Ur[68]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Admin Password",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[16]||(Ur[16]=Mi=>Z.value.settings.admin_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.admin_password]]),Ur[69]||(Ur[69]=Le("p",{class:"text-white/50 text-xs mt-1"},"Full access to room server",-1))]),Le("div",null,[Ur[70]||(Ur[70]=Le("label",{class:"block text-white/70 text-sm mb-2"},"Guest Password",-1)),Sl(Le("input",{"onUpdate:modelValue":Ur[17]||(Ur[17]=Mi=>Z.value.settings.guest_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.guest_password]]),Ur[71]||(Ur[71]=Le("p",{class:"text-white/50 text-xs mt-1"},"Read-only access",-1))])])]),Le("div",{class:"flex justify-end gap-3 mt-6"},[Le("button",{onClick:Qn,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg transition-colors"}," Cancel "),Le("button",{onClick:dr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):Ma("",!0)]),il(DH,{show:Re.value,title:"Delete Room Server",message:`Are you sure you want to delete '${Xe.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:Ur[18]||(Ur[18]=Mi=>Re.value=!1),onConfirm:ti},null,8,["show","message"]),il(uTe,{show:vt.value,message:bt.value.message,variant:bt.value.variant,onClose:Ur[19]||(Ur[19]=Mi=>vt.value=!1)},null,8,["show","message","variant"]),kt.value?(Wr(),Qr("div",_Se,[Le("div",xSe,[Le("div",bSe,[Ur[79]||(Ur[79]=Le("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),Ur[80]||(Ur[80]=Le("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),Le("div",wSe,[Le("div",kSe,[Ur[75]||(Ur[75]=qc('
',1)),Le("div",null,[Ur[74]||(Ur[74]=Le("h2",{class:"text-2xl font-bold text-white mb-1"},"Room Messages",-1)),Le("p",TSe,[Ur[73]||(Ur[73]=Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),Le("span",SSe,Si(Dt.value),1)])])]),Le("div",CSe,[Le("button",{onClick:Ur[20]||(Ur[20]=Mi=>ii.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[Ur[76]||(Ur[76]=Le("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),Ur[77]||(Ur[77]=Le("span",{class:"hidden sm:inline"},"Sessions",-1)),Le("span",ASe,Si(Ci.value.length),1)]),Le("button",{onClick:Ra,class:"p-2 text-white/70 hover:text-white hover:bg-white/10 rounded-[10px] transition-all"},Ur[78]||(Ur[78]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),Le("div",MSe,[Fe.value&&Er.value.length===0?(Wr(),Qr("div",ESe,Ur[81]||(Ur[81]=[Le("div",{class:"text-center"},[Le("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Le("div",{class:"text-white/70"},"Loading messages...")],-1)]))):wi.value?(Wr(),Qr("div",LSe,[Le("div",PSe,[Ur[82]||(Ur[82]=Le("div",{class:"text-red-400 mb-2"},"Failed to load messages",-1)),Le("div",ISe,Si(wi.value),1),Le("button",{onClick:Ur[21]||(Ur[21]=Mi=>Yn(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):Er.value.length>0?(Wr(),Qr("div",DSe,[(Wr(!0),Qr(js,null,au(Er.value,(Mi,Xi)=>(Wr(),Qr("div",{key:Mi.id||Xi,class:"group relative overflow-hidden glass-card rounded-[12px] p-4 border border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[Ur[87]||(Ur[87]=Le("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Le("div",zSe,[Le("div",OSe,[Le("div",BSe,[Le("div",RSe,[Ur[84]||(Ur[84]=Le("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[Le("svg",{class:"w-3 h-3 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),Mi.author_name?(Wr(),Qr("span",FSe,Si(Mi.author_name),1)):Ma("",!0),Mi.author_pubkey?(Wr(),Qr("span",NSe,Si(Mi.author_pubkey.substring(0,8))+"... ",1)):(Wr(),Qr("span",jSe," Anonymous ")),Ur[85]||(Ur[85]=Le("span",{class:"text-white/30 text-xs"},"•",-1)),Le("span",USe,[Ur[83]||(Ur[83]=Le("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),ul(" "+Si(Ya(Mi.timestamp)),1)]),Mi.id?(Wr(),Qr("span",$Se," #"+Si(Mi.id),1)):Ma("",!0)])]),Le("div",HSe,Si(Mi.message_text),1)]),Le("button",{onClick:oo=>zn(Mi.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},Ur[86]||(Ur[86]=[Le("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,VSe)])]))),128)),_i.value&&!Fe.value?(Wr(),Qr("div",WSe,[Le("button",{onClick:sn,class:"group px-6 py-2.5 bg-gradient-to-r from-white/5 to-white/10 hover:from-white/10 hover:to-white/15 text-white rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-white/10 flex items-center gap-2 mx-auto"},Ur[88]||(Ur[88]=[Le("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),ul(" Load More Messages ",-1)]))])):Fe.value?(Wr(),Qr("div",qSe,Ur[89]||(Ur[89]=[Le("div",{class:"flex items-center justify-center gap-2 text-white/50 text-sm"},[Le("div",{class:"animate-spin w-4 h-4 border-2 border-white/20 border-t-primary rounded-full"}),ul(" Loading... ")],-1)]))):Ma("",!0)])):(Wr(),Qr("div",GSe,Ur[90]||(Ur[90]=[qc('

No messages yet

Be the first to start the conversation

',1)])))]),Le("div",ZSe,[Ur[93]||(Ur[93]=Le("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),Le("div",KSe,[Le("div",YSe,[Le("div",XSe,[Sl(Le("textarea",{"onUpdate:modelValue":Ur[22]||(Ur[22]=Mi=>ur.value=Mi),onKeydown:[bx(Yf(an,["ctrl"]),["enter"]),bx(Yf(an,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-3 text-white text-sm focus:outline-none focus:border-primary/50 focus:bg-white/10 transition-all resize-none placeholder-white/30"},null,40,JSe),[[sc,ur.value]])]),Le("button",{onClick:an,disabled:!ur.value.trim(),class:eo(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",ur.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-white border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"])},Ur[91]||(Ur[91]=[Le("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),Le("span",{class:"hidden sm:inline"},"Send",-1)]),10,QSe)]),Ur[92]||(Ur[92]=Le("p",{class:"text-white/40 text-xs flex items-center gap-2"},[Le("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),ul(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):Ma("",!0),ii.value?(Wr(),Qr("div",e8e,[Le("div",t8e,[Le("div",r8e,[Le("div",null,[Ur[95]||(Ur[95]=Le("h2",{class:"text-xl font-bold text-white"},"Active Sessions",-1)),Le("p",i8e,[Ur[94]||(Ur[94]=ul("Room: ",-1)),Le("span",n8e,Si(Dt.value),1)])]),Le("button",{onClick:Ur[23]||(Ur[23]=Mi=>ii.value=!1),class:"text-white/70 hover:text-white transition-colors"},Ur[96]||(Ur[96]=[Le("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Le("div",a8e,[Ci.value.length===0?(Wr(),Qr("div",o8e,Ur[97]||(Ur[97]=[Le("div",{class:"text-white/50"},"No active sessions found",-1)]))):Ma("",!0),(Wr(!0),Qr(js,null,au(Ci.value,(Mi,Xi)=>(Wr(),Qr("div",{key:Mi.public_key_full||Xi,class:"glass-card rounded-[10px] p-4 border border-white/10"},[Le("div",s8e,[Le("div",l8e,[Le("div",u8e,[Le("span",c8e,Si(Mi.identity_name||"Unknown"),1),Le("span",{class:eo(["px-2 py-0.5 text-xs font-medium rounded",Mi.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},Si(Mi.permissions),3)]),Le("div",h8e,[Le("span",f8e,Si(Mi.identity_type),1),Le("button",{onClick:oo=>zo(Mi.public_key_full,Mi.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,d8e)])]),Le("div",p8e,[Le("div",m8e,[Ur[98]||(Ur[98]=Le("span",{class:"text-white/50"},"Short Key:",-1)),Le("code",g8e,Si(Mi.public_key),1)]),Le("div",v8e,[Ur[99]||(Ur[99]=Le("span",{class:"text-white/50"},"Full Key:",-1)),Le("code",y8e,Si(Mi.public_key_full),1)])]),Le("div",_8e,[Le("div",x8e,[Mi.address?(Wr(),Qr("span",b8e,"📍 "+Si(Mi.address),1)):Ma("",!0),Mi.last_login_success?(Wr(),Qr("span",w8e,"Last Login: "+Si(new Date(Mi.last_login_success*1e3).toLocaleString()),1)):Ma("",!0)]),Mi.last_activity?(Wr(),Qr("span",k8e,"Active: "+Si(Math.floor((Date.now()/1e3-Mi.last_activity)/60))+"m ago",1)):Ma("",!0)])])]))),128))])])])):Ma("",!0)],64))}}),S8e={class:"space-y-6"},C8e={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},A8e={class:"flex items-center justify-between mb-4"},M8e=["disabled"],E8e={class:"bg-white/5 border border-white/10 rounded-lg p-4"},L8e={class:"flex flex-wrap gap-2"},P8e=["onClick"],I8e={key:0,class:"w-px h-6 bg-white/20 mx-2 self-center"},D8e=["onClick"],z8e={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},O8e={key:0,class:"p-8 text-center"},B8e={key:1,class:"p-8 text-center"},R8e={class:"text-dark-text mb-4"},F8e={key:2,class:"max-h-[600px] overflow-y-auto"},N8e={key:0,class:"p-8 text-center"},j8e={key:1,class:"divide-y divide-white/5"},U8e={class:"flex-shrink-0 text-dark-text"},$8e={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-400"},H8e={class:"text-white flex-1 break-all"},V8e=Uu({name:"LogsView",__name:"Logs",setup(t){const e=vn([]),r=vn(new Set),c=vn(new Set(["DEBUG","INFO","WARNING","ERROR"])),S=vn(new Set),H=vn(new Set),Z=vn(!0),ue=vn(null);let be=null;const Se=vi=>{const vr=vi.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return vr?vr[1].trim():"Unknown"},Re=vi=>{const vr=vi.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return vr?vr[1]:vi},Xe=(vi,vr)=>{if(vi.size!==vr.size)return!1;for(const dr of vi)if(!vr.has(dr))return!1;return!0},vt=async()=>{try{const vi=await zs.getLogs();if(vi.logs&&vi.logs.length>0){e.value=vi.logs;const vr=new Set;e.value.forEach(Xr=>{const ei=Se(Xr.message);vr.add(ei)});const dr=new Set;e.value.forEach(Xr=>{dr.add(Xr.level)}),r.value.size===0&&(r.value=new Set(vr));const Ar=!Xe(S.value,vr),ti=!Xe(H.value,dr);Ar&&(S.value=vr),ti&&(H.value=dr),ue.value=null}}catch(vi){console.error("Error loading logs:",vi),ue.value=vi instanceof Error?vi.message:"Failed to load logs"}finally{Z.value=!1}},bt=Do(()=>e.value.filter(vr=>{const dr=Se(vr.message),Ar=r.value.has(dr),ti=c.value.has(vr.level);return Ar&&ti})),kt=Do(()=>Array.from(S.value).sort()),Dt=Do(()=>{const vi=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(H.value).sort((dr,Ar)=>{const ti=vi.indexOf(dr),Xr=vi.indexOf(Ar);return ti!==-1&&Xr!==-1?ti-Xr:dr.localeCompare(Ar)})}),rr=vi=>{c.value.has(vi)?c.value.delete(vi):c.value.add(vi),c.value=new Set(c.value)},Er=vi=>new Date(vi).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),Fe=vi=>({ERROR:"text-red-400 bg-red-900/20",WARNING:"text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-400 bg-yellow-900/20",INFO:"text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[vi]||"text-gray-400 bg-gray-900/20",wi=(vi,vr)=>vr?{ERROR:"bg-red-500/20 text-red-400 border-red-500/50",WARNING:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[vi]||"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10",ur=vi=>{r.value.has(vi)?r.value.delete(vi):r.value.add(vi),r.value=new Set(r.value)},Ir=()=>{r.value=new Set(S.value)},Ti=()=>{r.value=new Set},_i=()=>{c.value=new Set(H.value)},Ci=()=>{c.value=new Set},ii=()=>{be&&clearInterval(be),be=setInterval(vt,5e3)},Ji=()=>{be&&(clearInterval(be),be=null)};return ud(()=>{vt(),ii()}),$g(()=>{Ji()}),(vi,vr)=>(Wr(),Qr("div",S8e,[Le("div",C8e,[Le("div",A8e,[vr[1]||(vr[1]=Le("div",null,[Le("h1",{class:"text-white text-2xl font-semibold mb-2"},"System Logs"),Le("p",{class:"text-dark-text"},"Real-time system events and diagnostics")],-1)),Le("button",{onClick:vt,disabled:Z.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(Wr(),Qr("svg",{class:eo(["w-4 h-4",{"animate-spin":Z.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},vr[0]||(vr[0]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),ul(" "+Si(Z.value?"Loading...":"Refresh"),1)],8,M8e)]),Le("div",E8e,[Le("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[vr[2]||(vr[2]=Le("span",{class:"text-white font-medium"},"Filters:",-1)),Le("button",{onClick:Ir,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),Le("button",{onClick:Ti,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),vr[3]||(vr[3]=Le("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),Le("button",{onClick:_i,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),Le("button",{onClick:Ci,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),Le("div",L8e,[(Wr(!0),Qr(js,null,au(kt.value,dr=>(Wr(),Qr("button",{key:"logger-"+dr,onClick:Ar=>ur(dr),class:eo(["px-3 py-1 text-xs border rounded-full transition-colors",r.value.has(dr)?"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10"])},Si(dr),11,P8e))),128)),kt.value.length>0&&Dt.value.length>0?(Wr(),Qr("div",I8e)):Ma("",!0),(Wr(!0),Qr(js,null,au(Dt.value,dr=>(Wr(),Qr("button",{key:"level-"+dr,onClick:Ar=>rr(dr),class:eo(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",c.value.has(dr)?wi(dr,!0):wi(dr,!1)])},Si(dr),11,D8e))),128))])])]),Le("div",z8e,[Z.value&&e.value.length===0?(Wr(),Qr("div",O8e,vr[4]||(vr[4]=[Le("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),Le("p",{class:"text-dark-text"},"Loading system logs...",-1)]))):ue.value?(Wr(),Qr("div",B8e,[vr[5]||(vr[5]=Le("div",{class:"text-red-400 mb-4"},[Le("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),vr[6]||(vr[6]=Le("h3",{class:"text-white text-lg font-medium mb-2"},"Error Loading Logs",-1)),Le("p",R8e,Si(ue.value),1),Le("button",{onClick:vt,class:"px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(Wr(),Qr("div",F8e,[bt.value.length===0?(Wr(),Qr("div",N8e,vr[7]||(vr[7]=[qc('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(Wr(),Qr("div",j8e,[(Wr(!0),Qr(js,null,au(bt.value,(dr,Ar)=>(Wr(),Qr("div",{key:Ar,class:"flex items-start gap-4 p-4 hover:bg-white/5 transition-colors font-mono text-sm"},[Le("span",U8e," ["+Si(Er(dr.timestamp))+"] ",1),Le("span",$8e,Si(Se(dr.message)),1),Le("span",{class:eo(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",Fe(dr.level)])},Si(dr.level),3),Le("span",H8e,Si(Re(dr.message)),1)]))),128))]))]))])]))}});/** +*/return window.Plotly=r,r})}(_T)),_T.exports}var zH=ebe();const I1=a$(zH),G7=Cie({__proto__:null,default:I1},[zH]),tbe={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},rbe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},ibe={class:"flex items-center gap-2 sm:gap-3"},nbe=["value"],abe={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},obe={class:"glass-card rounded-[15px] p-3 sm:p-6"},sbe={class:"mb-4 sm:mb-6"},lbe={class:"relative h-40 sm:h-48 bg-white/5 rounded-lg p-2 sm:p-4"},ube={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},cbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},hbe={class:"mb-4 sm:mb-6"},fbe={class:"relative h-40 sm:h-48 bg-white/5 rounded-lg p-2 sm:p-4"},dbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},pbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},mbe={class:"glass-card rounded-[15px] p-3 sm:p-6"},gbe={class:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6"},vbe={class:"lg:col-span-2"},ybe={class:"relative h-48 sm:h-64 bg-white/5 rounded-lg p-2 sm:p-4"},_be={class:"flex flex-col items-center justify-center"},xbe={class:"relative w-40 h-40 sm:w-48 sm:h-48"},bbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm rounded-full z-20"},wbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 rounded-full z-20"},kbe={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Tbe={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Sbe={class:"text-white/60 text-sm"},Cbe=Bu({name:"StatisticsView",__name:"Statistics",setup(t){l_.register(hH,fH,Q$,s4,N$,R$,F$,lH,cH,oH,Y$,tH,nH,YT);const e=a4(),r=fn(null),c=fn(!1),S=fn(D1("statistics_selectedHours",24)),$=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}];Af(S,qn=>z1("statistics_selectedHours",qn));const Z=fn(null),ue=fn(null),xe=fn([]),Se=fn(null),Ne=fn([]),it=fn(!0),pt=fn(null),bt=fn({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0}),wt=fn(!1),Dt=fn(!1),Zt=fn(!1),Mr=fn(null),ze=fn(null),ni=fn(null),or=fn(null),Cr=fn(null),gi=fn(null),Si=fn(null),Ci=Io(()=>{const qn=e.packetStats;return qn?{totalRx:qn.total_packets||0,totalTx:qn.transmitted_packets||0}:{totalRx:0,totalTx:0}}),ri=Io(()=>{let qn=[],ln=[];if(Z.value?.series){const nn=Z.value.series.find(Ra=>Ra.type==="rx_count"),On=Z.value.series.find(Ra=>Ra.type==="tx_count");nn?.data&&(qn=nn.data.map(([,Ra])=>Ra)),On?.data&&(ln=On.data.map(([,Ra])=>Ra))}return{totalPackets:qn,transmittedPackets:ln,droppedPackets:[]}}),on=async()=>{try{it.value=!0,pt.value=null,await Promise.all([e.fetchPacketStats({hours:S.value}),e.fetchSystemStats()]),it.value=!1,yi()}catch(qn){pt.value=qn instanceof Error?qn.message:"Failed to fetch data",it.value=!1}},yi=async()=>{bt.value={packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0};const qn=[gr(),fr(),Sr(),ei()];try{await Promise.allSettled(qn),await b0(),!or.value||!Cr.value?setTimeout(()=>{Di()},100):Di()}catch(ln){console.error("Error loading chart data:",ln)}},gr=async()=>{bt.value.packetRate=!0;try{const qn=await bs.get("/metrics_graph_data",{hours:S.value,resolution:"average",metrics:"rx_count,tx_count"});qn?.success&&(Z.value=qn.data)}catch{Z.value=null}},fr=async()=>{bt.value.packetType=!0;try{const qn=await bs.get("/packet_type_graph_data",{hours:S.value,resolution:"average",types:"all"});if(qn?.success&&qn.data){const ln=qn.data;xe.value=ln.series||[]}}catch{xe.value=[]}},Sr=async()=>{bt.value.routePie=!0;try{const qn=await bs.get("/route_stats",{hours:S.value});qn?.success&&qn.data&&(Se.value=qn.data)}catch{Se.value=null}},ei=async()=>{try{const qn=await bs.get("/noise_floor_history",{hours:S.value});if(qn.success&&qn.data){const nn=qn.data.history||[];Array.isArray(nn)&&nn.length>0&&(ue.value={chart_data:nn.map(On=>({timestamp:On.timestamp||Date.now()/1e3,noise_floor_dbm:On.noise_floor_dbm||On.noise_floor||-120}))},ti())}}catch{ue.value={chart_data:[]}}},Jr=()=>{En(),wt.value=!1,Dt.value=!1,Zt.value=!1,on()},ti=()=>{if(Ne.value=[],ue.value?.chart_data&&ue.value.chart_data.length>0){const qn=ue.value.chart_data,ln=Math.max(1,Math.floor(qn.length/100));Ne.value=qn.filter((nn,On)=>On%ln===0).map(nn=>({timestamp:nn.timestamp*1e3,snr:null,rssi:null,noiseFloor:nn.noise_floor_dbm}))}},Di=()=>{if(!c.value){c.value=!0;try{Zn(),ga(),ya(),ro(),setTimeout(()=>{bt.value.packetRate&&Mr.value&&(bt.value.packetRate=!1),bt.value.packetType&&ze.value&&(bt.value.packetType=!1),bt.value.routePie&&Si.value&&(bt.value.routePie=!1),bt.value.routePie&&Si.value&&(bt.value.routePie=!1),setTimeout(()=>{const qn=Ou(Mr.value),ln=Ou(ze.value),nn=Ou(ni.value);qn&&qn.update("none"),ln&&ln.update("none"),nn&&nn.update("none")},50)},100)}catch(qn){console.error("Error creating/updating charts:",qn),En()}finally{c.value=!1}}},En=()=>{try{Mr.value&&(Mr.value.destroy(),Mr.value=null),ze.value&&(ze.value.destroy(),ze.value=null),ni.value&&(ni.value.destroy(),ni.value=null),Si.value&&I1.purge(Si.value)}catch(qn){console.error("Error destroying charts:",qn)}},Zn=()=>{if(!or.value){bt.value.packetRate=!1;return}const qn=or.value.getContext("2d");if(!qn){bt.value.packetRate=!1;return}let ln=[],nn=[];if(Z.value?.series){const On=Z.value.series.find(Xa=>Xa.type==="rx_count"),Ra=Z.value.series.find(Xa=>Xa.type==="tx_count");On?.data&&(ln=On.data.map(([Xa,zo])=>{let xa=Xa;return Xa>1e15?xa=Xa/1e3:Xa>1e12?xa=Xa:Xa>1e9?xa=Xa*1e3:xa=Date.now(),{x:xa,y:zo}})),Ra?.data&&(nn=Ra.data.map(([Xa,zo])=>{let xa=Xa;return Xa>1e15?xa=Xa/1e3:Xa>1e12?xa=Xa:Xa>1e9?xa=Xa*1e3:xa=Date.now(),{x:xa,y:zo}}))}if(ln.length===0&&nn.length===0){wt.value=!0,bt.value.packetRate=!1;return}wt.value=!1,Mr.value&&(Mr.value.destroy(),Mr.value=null);try{const On=JSON.parse(JSON.stringify(ln)),Ra=JSON.parse(JSON.stringify(nn)),Xa=new l_(qn,{type:"line",data:{datasets:[{label:"RX/hr",data:On,borderColor:"#C084FC",backgroundColor:"rgba(192, 132, 252, 0.1)",borderWidth:2,fill:!0,tension:.4},{label:"TX/hr",data:Ra,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,fill:!0,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1},title:{display:!1}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",callback:function(zo){return typeof zo=="number"?zo.toFixed(3):zo},stepSize:.002},min:0,max:.012}}}});Mr.value=Ou(Xa),bt.value.packetRate=!1,setTimeout(()=>{bt.value.packetRate&&(bt.value.packetRate=!1)},50)}catch(On){console.error("Error creating packet rate chart:",On),wt.value=!0,bt.value.packetRate=!1}},ga=()=>{if(!Cr.value){bt.value.packetType=!1;return}const qn=Cr.value.getContext("2d");if(!qn){bt.value.packetType=!1;return}const ln=[],nn=[],On=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(xe.value.length>0)xe.value.forEach(Ra=>{const Xa=Ra.data?Ra.data.reduce((zo,xa)=>zo+xa[1],0):0;Xa>0&&(ln.push(Ra.name.replace(/\([^)]*\)/g,"").trim()),nn.push(Xa))});else{Dt.value=!0,bt.value.packetType=!1;return}Dt.value=!1,ze.value&&(ze.value.destroy(),ze.value=null);try{const Ra=JSON.parse(JSON.stringify(ln)),Xa=JSON.parse(JSON.stringify(nn)),zo=new l_(qn,{type:"bar",data:{labels:Ra,datasets:[{data:Xa,backgroundColor:On.slice(0,Xa.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});ze.value=Ou(zo),bt.value.packetType=!1,setTimeout(()=>{bt.value.packetType&&(bt.value.packetType=!1)},50)}catch(Ra){console.error("Error creating packet type chart:",Ra),Dt.value=!0,bt.value.packetType=!1}},ya=()=>{if(!gi.value)return;const qn=gi.value.getContext("2d");if(!qn)return;const ln=Ne.value.map(Ra=>({x:Ra.timestamp,y:Ra.noiseFloor})).filter(Ra=>Ra.y!==null&&Ra.y!==void 0);if(ni.value)try{const Ra=Ou(ni.value),Xa=JSON.parse(JSON.stringify(ln));Ra.data.datasets[0]&&(Ra.data.datasets[0].data=Xa),Ra.update("active");return}catch{ni.value.destroy(),ni.value=null}const nn=JSON.parse(JSON.stringify(ln)),On=new l_(qn,{type:"line",data:{datasets:[{label:"Noise Floor (dBm)",data:nn,borderColor:"#F59E0B",backgroundColor:"rgba(245, 158, 11, 0.1)",borderWidth:2,tension:.3,pointRadius:0,pointHoverRadius:3,fill:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:"rgba(255, 255, 255, 0.8)",usePointStyle:!0,padding:20}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)",maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:"rgba(255, 255, 255, 0.8)"},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",stepSize:.5,callback:function(Ra){return typeof Ra=="number"?Ra.toFixed(1):Ra}},min:-117,max:-113}}}});ni.value=Ou(On)},ro=()=>{if(!Si.value){bt.value.routePie=!1;return}if(!Se.value||!Se.value.route_totals){Zt.value=!0,bt.value.routePie=!1;return}Zt.value=!1;const qn=Se.value.route_totals,ln=Object.keys(qn),nn=Object.values(qn),On=["#3B82F6","#F87171","#10B981","#F59E0B","#A78BFA"];try{const Ra=JSON.parse(JSON.stringify(ln)),Xa=JSON.parse(JSON.stringify(nn)),zo=[{type:"pie",labels:Ra,values:Xa,marker:{colors:On.slice(0,Xa.length)},hovertemplate:"%{label}
Count: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",pull:.1,hole:.3}],xa={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},$r={responsive:!0,displayModeBar:!1,staticPlot:!1};I1.newPlot(Si.value,zo,xa,$r),bt.value.routePie=!1,setTimeout(()=>{bt.value.routePie&&(bt.value.routePie=!1)},50)}catch(Ra){console.error("Error creating 3D route pie chart:",Ra),Zt.value=!0,bt.value.routePie=!1}};return Jf(async()=>{await b0(),on(),r.value=window.setInterval(on,3e4),window.addEventListener("resize",()=>{setTimeout(()=>{Ou(Mr.value)?.resize(),Ou(ze.value)?.resize(),Ou(ni.value)?.resize(),Si.value&&I1.Plots&&I1.Plots.resize(Si.value)},100)})}),$g(()=>{r.value&&clearInterval(r.value),Mr.value?.destroy(),ze.value?.destroy(),ni.value?.destroy(),Si.value&&I1.purge(Si.value),window.removeEventListener("resize",()=>{})}),(qn,ln)=>(jr(),Kr("div",tbe,[Ee("div",rbe,[ln[2]||(ln[2]=Ee("h2",{class:"text-xl sm:text-2xl font-bold text-white"},"Statistics",-1)),Ee("div",ibe,[ln[1]||(ln[1]=Ee("label",{class:"text-white/70 text-xs sm:text-sm"},"Time Range:",-1)),Sl(Ee("select",{"onUpdate:modelValue":ln[0]||(ln[0]=nn=>S.value=nn),onChange:Jr,class:"bg-white/10 border border-white/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-white text-xs sm:text-sm focus:outline-none focus:border-accent-purple/50 transition-colors"},[(jr(),Kr(js,null,au($,nn=>Ee("option",{key:nn.value,value:nn.value,class:"bg-gray-800 text-white"},ki(nn.label),9,nbe)),64))],544),[[xg,S.value]])])]),Ee("div",abe,[nl(Av,{title:"Total RX",value:Ci.value.totalRx,color:"#AAE8E8",data:ri.value.totalPackets},null,8,["value","data"]),nl(Av,{title:"Total TX",value:Ci.value.totalTx,color:"#FFC246",data:ri.value.transmittedPackets},null,8,["value","data"])]),Ee("div",obe,[ln[9]||(ln[9]=Ee("h3",{class:"text-white text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),Ee("div",sbe,[ln[5]||(ln[5]=Dc('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),Ee("div",lbe,[Ee("canvas",{ref_key:"packetRateCanvasRef",ref:or,class:"w-full h-full relative z-10"},null,512),bt.value.packetRate?(jr(),Kr("div",ube,ln[3]||(ln[3]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-purple-400 rounded-full mx-auto mb-2"}),Ee("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):Sa("",!0),wt.value&&!bt.value.packetRate?(jr(),Kr("div",cbe,ln[4]||(ln[4]=[Ee("div",{class:"text-center"},[Ee("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Ee("div",{class:"text-white/50 text-xs"},"Packet rate data not found")],-1)]))):Sa("",!0)])]),Ee("div",hbe,[ln[8]||(ln[8]=Ee("p",{class:"text-white/70 text-xs sm:text-sm uppercase tracking-wide mb-2"},"Packet Type Distribution",-1)),Ee("div",fbe,[Ee("canvas",{ref_key:"packetTypeCanvasRef",ref:Cr,class:"w-full h-full relative z-10"},null,512),bt.value.packetType?(jr(),Kr("div",dbe,ln[6]||(ln[6]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-blue-400 rounded-full mx-auto mb-2"}),Ee("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading packet type data...")],-1)]))):Sa("",!0),Dt.value&&!bt.value.packetType?(jr(),Kr("div",pbe,ln[7]||(ln[7]=[Ee("div",{class:"text-center"},[Ee("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Ee("div",{class:"text-white/50 text-xs"},"Packet type data not found")],-1)]))):Sa("",!0)])])]),Ee("div",mbe,[ln[13]||(ln[13]=Ee("h3",{class:"text-white text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Noise Floor Over Time",-1)),Ee("div",gbe,[Ee("div",vbe,[Ee("div",ybe,[Ee("canvas",{ref_key:"signalMetricsCanvasRef",ref:gi,class:"w-full h-full"},null,512)])]),Ee("div",_be,[ln[12]||(ln[12]=Ee("p",{class:"text-white/70 text-xs sm:text-sm uppercase tracking-wide mb-2"},"Route Distribution",-1)),Ee("div",xbe,[Ee("div",{ref_key:"signalPie3DRef",ref:Si,class:"w-full h-full relative z-10"},null,512),bt.value.routePie?(jr(),Kr("div",bbe,ln[10]||(ln[10]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Ee("div",{class:"text-white/50 text-[10px] sm:text-xs"},"Loading route data...")],-1)]))):Sa("",!0),Zt.value&&!bt.value.routePie?(jr(),Kr("div",wbe,ln[11]||(ln[11]=[Ee("div",{class:"text-center"},[Ee("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Ee("div",{class:"text-white/50 text-xs"},"Route statistics not found")],-1)]))):Sa("",!0)])])])]),it.value?(jr(),Kr("div",kbe,ln[14]||(ln[14]=[Ee("div",{class:"text-white/70 mb-2 text-sm"},"Loading statistics...",-1),Ee("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):Sa("",!0),pt.value?(jr(),Kr("div",Tbe,[ln[15]||(ln[15]=Ee("div",{class:"text-red-400 mb-2 text-sm"},"Failed to load statistics",-1)),Ee("p",Sbe,ki(pt.value),1),Ee("button",{onClick:on,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):Sa("",!0)]))}}),Abe=kh(Cbe,[["__scopeId","data-v-382b21ff"]]),Mbe="modulepreload",Ebe=function(t){return"/"+t},gF={},C5=function(e,r,c){let S=Promise.resolve();if(r&&r.length>0){let Se=function(Ne){return Promise.all(Ne.map(it=>Promise.resolve(it).then(pt=>({status:"fulfilled",value:pt}),pt=>({status:"rejected",reason:pt}))))};var Z=Se;document.getElementsByTagName("link");const ue=document.querySelector("meta[property=csp-nonce]"),xe=ue?.nonce||ue?.getAttribute("nonce");S=Se(r.map(Ne=>{if(Ne=Ebe(Ne),Ne in gF)return;gF[Ne]=!0;const it=Ne.endsWith(".css"),pt=it?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Ne}"]${pt}`))return;const bt=document.createElement("link");if(bt.rel=it?"stylesheet":Mbe,it||(bt.as="script"),bt.crossOrigin="",bt.href=Ne,xe&&bt.setAttribute("nonce",xe),document.head.appendChild(bt),it)return new Promise((wt,Dt)=>{bt.addEventListener("load",wt),bt.addEventListener("error",()=>Dt(new Error(`Unable to preload CSS for ${Ne}`)))})}))}function $(ue){const xe=new Event("vite:preloadError",{cancelable:!0});if(xe.payload=ue,window.dispatchEvent(xe),!xe.defaultPrevented)throw ue}return S.then(ue=>{for(const xe of ue||[])xe.status==="rejected"&&$(xe.reason);return e().catch($)})},Lbe={class:"p-6 space-y-6"},Pbe={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},Ibe={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Dbe={class:"glass-card rounded-[15px] p-6"},zbe={class:"relative h-32 bg-white/5 rounded-lg p-4 mb-4 chart-container"},Obe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Bbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},Rbe={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Fbe={class:"text-white font-semibold"},Nbe={class:"text-white font-semibold"},jbe={class:"text-white font-semibold"},Ube={class:"text-white font-semibold"},$be={class:"glass-card rounded-[15px] p-6"},Hbe={class:"relative h-32 bg-white/5 rounded-lg p-4 mb-4 chart-container"},Vbe={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/5 backdrop-blur-sm z-20"},Wbe={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/5 z-20"},qbe={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Gbe={class:"text-white font-semibold"},Zbe={class:"text-white font-semibold"},Kbe={class:"text-white font-semibold"},Ybe={class:"text-white font-semibold"},Xbe={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Jbe={class:"glass-card rounded-[15px] p-6"},Qbe={class:"relative h-48"},e2e={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},t2e={class:"text-center"},r2e={class:"text-white font-semibold"},i2e={class:"text-center"},n2e={class:"font-semibold text-red-400"},a2e={class:"text-center"},o2e={class:"font-semibold text-green-400"},s2e={class:"glass-card rounded-[15px] p-6"},l2e={key:0,class:"space-y-4"},u2e={class:"grid grid-cols-2 gap-4 text-sm"},c2e={class:"text-white font-semibold"},h2e={class:"text-white font-semibold"},f2e={class:"text-white font-semibold"},d2e={class:"text-white font-semibold"},p2e={key:0,class:"pt-4 border-t border-white/10"},m2e={class:"grid grid-cols-2 gap-2 text-sm"},g2e={class:"text-white/60"},v2e={class:"text-white font-semibold ml-1"},y2e={class:"glass-card rounded-[15px] p-6"},_2e={key:0,class:"overflow-x-auto"},x2e={class:"w-full text-sm"},b2e={class:"text-white/80 py-2 transition-all duration-300"},w2e={class:"text-white font-semibold py-2 transition-all duration-300"},k2e={class:"text-center text-orange-400 py-2 transition-all duration-300"},T2e={class:"text-center text-green-400 py-2 transition-all duration-300"},S2e={class:"text-right text-white/80 py-2 transition-all duration-300"},C2e={key:0,class:"mt-4 text-center text-white/60 text-sm transition-all duration-300"},A2e={key:1,class:"text-center text-white/60 py-8"},M2e={key:0,class:"glass-card rounded-[15px] p-8 text-center"},E2e={key:1,class:"glass-card rounded-[15px] p-8 text-center"},L2e={class:"text-white/60 text-sm"},P2e=Bu({name:"SystemStatsView",__name:"SystemStats",setup(t){l_.register(hH,fH,Q$,s4,N$,R$,F$,lH,cH,oH,Y$,tH,nH,YT);const e=fn(null),r=fn(!0),c=fn(null),S=fn(null),$=fn(null),Z=fn([]),ue=fn(null),xe=fn({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),Se=fn(!1),Ne=fn(!1),it=fn(null),pt=fn(null),bt=fn(null),wt=fn(null),Dt=fn(null),Zt=Io(()=>S.value?{cpuUsage:S.value.cpu.usage_percent,memoryUsage:S.value.memory.usage_percent,diskUsage:S.value.disk.usage_percent,uptime:S.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),Mr=Io(()=>Z.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:Z.value.map(fr=>fr.cpu.usage_percent),memory:Z.value.map(fr=>fr.memory.usage_percent),disk:Z.value.map(fr=>fr.disk.usage_percent),network:Z.value.map(fr=>fr.network.bytes_recv/1024/1024)}),ze=fr=>{const Sr=["B","KB","MB","GB","TB"];if(fr===0)return"0 B";const ei=Math.floor(Math.log(fr)/Math.log(1024));return parseFloat((fr/Math.pow(1024,ei)).toFixed(2))+" "+Sr[ei]},ni=fr=>{const Sr=Math.floor(fr/86400),ei=Math.floor(fr%86400/3600),Jr=Math.floor(fr%3600/60);return Sr>0?`${Sr}d ${ei}h ${Jr}m`:ei>0?`${ei}h ${Jr}m`:`${Jr}m`},or=async()=>{try{const fr=await bs.get("/hardware_stats");if(fr?.success&&fr.data){const Sr=fr.data;if(S.value=Sr,Z.value.length===0)for(let Jr=0;Jr<12;Jr++)Z.value.push(JSON.parse(JSON.stringify(Sr)));else Z.value.push(Sr),Z.value.length>20&&Z.value.shift()}}catch(fr){console.error("Failed to fetch hardware stats:",fr),c.value="Failed to fetch hardware stats"}},Cr=async()=>{try{const fr=await bs.get("/hardware_processes");fr?.success&&fr.data&&(ue.value=$.value,$.value=fr.data)}catch(fr){console.error("Failed to fetch process stats:",fr)}},gi=(fr,Sr)=>{if(!ue.value)return!1;const ei=ue.value.processes.find(Jr=>Jr.pid===fr.pid);return ei?ei[Sr]!==fr[Sr]:!0},Si=async()=>{try{r.value=!0,c.value=null,await Promise.all([or(),Cr()]),r.value=!1,await b0(),Ci()}catch(fr){c.value=fr instanceof Error?fr.message:"Failed to fetch system data",r.value=!1}},Ci=()=>{S.value&&(ri(),on(),yi())},ri=()=>{if(!bt.value||!S.value){xe.value.cpuChart=!1;return}const fr=bt.value.getContext("2d");if(!fr){xe.value.cpuChart=!1;return}const Sr=S.value.cpu.usage_percent,ei=100-Sr;if(it.value)try{it.value.data.datasets[0].data=[Sr,ei],it.value.update("none");return}catch(Jr){console.warn("Failed to update CPU chart, recreating...",Jr),it.value.destroy(),it.value=null}try{const Jr=new l_(fr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Sr,ei],backgroundColor:["#FFC246","rgba(255, 255, 255, 0.1)"],borderColor:["#FFC246","rgba(255, 255, 255, 0.2)"],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(ti){return`${ti.label}: ${ti.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(ti){const Di=ti.ctx;Di.save();const En=(ti.chartArea.left+ti.chartArea.right)/2,Zn=(ti.chartArea.top+ti.chartArea.bottom)/2;Di.textAlign="center",Di.textBaseline="middle",Di.fillStyle="#FFC246",Di.font="bold 18px sans-serif",Di.fillText(`${Sr.toFixed(1)}%`,En,Zn-5),Di.fillStyle="rgba(255, 255, 255, 0.6)",Di.font="10px sans-serif",Di.fillText("CPU",En,Zn+12),Di.restore()}}]});it.value=Ou(Jr),Se.value=!1,xe.value.cpuChart=!1}catch(Jr){console.error("Error creating CPU chart:",Jr),Se.value=!0,xe.value.cpuChart=!1}},on=()=>{if(!wt.value||!S.value){xe.value.memoryChart=!1;return}const fr=wt.value.getContext("2d");if(!fr){xe.value.memoryChart=!1;return}const Sr=S.value.memory.usage_percent,ei=100-Sr;if(pt.value)try{pt.value.data.datasets[0].data=[Sr,ei],pt.value.update("none");return}catch(Jr){console.warn("Failed to update Memory chart, recreating...",Jr),pt.value.destroy(),pt.value=null}try{const Jr=new l_(fr,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[Sr,ei],backgroundColor:["#A5E5B6","rgba(255, 255, 255, 0.1)"],borderColor:["#A5E5B6","rgba(255, 255, 255, 0.2)"],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(ti){return`${ti.label}: ${ti.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(ti){const Di=ti.ctx;Di.save();const En=(ti.chartArea.left+ti.chartArea.right)/2,Zn=(ti.chartArea.top+ti.chartArea.bottom)/2;Di.textAlign="center",Di.textBaseline="middle",Di.fillStyle="#A5E5B6",Di.font="bold 18px sans-serif",Di.fillText(`${Sr.toFixed(1)}%`,En,Zn-5),Di.fillStyle="rgba(255, 255, 255, 0.6)",Di.font="10px sans-serif",Di.fillText("Memory",En,Zn+12),Di.restore()}}]});pt.value=Ou(Jr),Ne.value=!1,xe.value.memoryChart=!1}catch(Jr){console.error("Error creating Memory chart:",Jr),Ne.value=!0,xe.value.memoryChart=!1}},yi=()=>{if(!(!Dt.value||!S.value))try{C5(()=>Promise.resolve().then(()=>G7),void 0).then(fr=>{const Sr=fr.default||fr,ei=S.value.disk,Jr=[{type:"pie",labels:["Used","Free"],values:[ei.used,ei.free],marker:{colors:["#FB787B","#A5E5B6"]},hovertemplate:"%{label}
Size: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",hole:.4}],ti={title:{text:"",font:{color:"rgba(255, 255, 255, 0.8)"}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:"rgba(255, 255, 255, 0.8)",size:10}}},Di={responsive:!0,displayModeBar:!1,staticPlot:!1};Sr.newPlot(Dt.value,Jr,ti,Di)})}catch(fr){console.error("Error creating disk chart:",fr)}},gr=()=>{try{if(it.value&&(it.value.destroy(),it.value=null),pt.value&&(pt.value.destroy(),pt.value=null),Dt.value)try{C5(()=>Promise.resolve().then(()=>G7),void 0).then(fr=>{const Sr=fr?.default||fr;Sr?.purge&&Sr.purge(Dt.value)}).catch(()=>{})}catch{}}catch(fr){console.error("Error destroying charts:",fr)}};return Jf(async()=>{await b0(),Si(),e.value=window.setInterval(Si,5e3),window.addEventListener("resize",()=>{setTimeout(()=>{Ou(it.value)?.resize(),Ou(pt.value)?.resize();try{C5(()=>Promise.resolve().then(()=>G7),void 0).then(fr=>{const Sr=fr?.default||fr;Sr?.Plots&&Sr.Plots.resize(Dt.value)}).catch(()=>{})}catch{}},100)})}),$g(()=>{e.value&&clearInterval(e.value),gr(),window.removeEventListener("resize",()=>{})}),(fr,Sr)=>(jr(),Kr("div",Lbe,[Sr[28]||(Sr[28]=Ee("div",{class:"flex justify-between items-center"},[Ee("h2",{class:"text-2xl font-bold text-white"},"System Statistics"),Ee("div",{class:"text-white/60 text-sm"}," Updates every 5 seconds ")],-1)),Ee("div",Pbe,[nl(Av,{title:"CPU Usage",value:`${Zt.value.cpuUsage.toFixed(1)}%`,color:"#FFC246",data:Mr.value.cpu},null,8,["value","data"]),nl(Av,{title:"Memory Usage",value:`${Zt.value.memoryUsage.toFixed(1)}%`,color:"#A5E5B6",data:Mr.value.memory},null,8,["value","data"]),nl(Av,{title:"Disk Usage",value:`${Zt.value.diskUsage.toFixed(1)}%`,color:"#FB787B",data:Mr.value.disk},null,8,["value","data"]),nl(Av,{title:"Uptime",value:ni(Zt.value.uptime),color:"#EBA0FC",data:Mr.value.network},null,8,["value","data"])]),Ee("div",Ibe,[Ee("div",Dbe,[Sr[6]||(Sr[6]=Ee("h3",{class:"text-white text-xl font-semibold mb-4"},"CPU Performance",-1)),Ee("div",zbe,[Ee("canvas",{ref_key:"cpuCanvasRef",ref:bt,class:"w-full h-full relative z-10"},null,512),xe.value.cpuChart?(jr(),Kr("div",Obe,Sr[0]||(Sr[0]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-6 h-6 border-2 border-white/20 border-t-orange-400 rounded-full mx-auto mb-2"}),Ee("div",{class:"text-white/50 text-xs"},"Loading CPU data...")],-1)]))):Sa("",!0),Se.value&&!xe.value.cpuChart?(jr(),Kr("div",Bbe,Sr[1]||(Sr[1]=[Ee("div",{class:"text-center"},[Ee("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Ee("div",{class:"text-white/50 text-xs"},"CPU data not found")],-1)]))):Sa("",!0)]),S.value?(jr(),Kr("div",Rbe,[Ee("div",null,[Sr[2]||(Sr[2]=Ee("div",{class:"text-white/60"},"CPU Count",-1)),Ee("div",Fbe,ki(S.value.cpu.count)+" cores",1)]),Ee("div",null,[Sr[3]||(Sr[3]=Ee("div",{class:"text-white/60"},"Frequency",-1)),Ee("div",Nbe,ki(S.value.cpu.frequency.toFixed(0))+" MHz",1)]),Ee("div",null,[Sr[4]||(Sr[4]=Ee("div",{class:"text-white/60"},"Load (1m)",-1)),Ee("div",jbe,ki(S.value.cpu.load_avg["1min"].toFixed(2)),1)]),Ee("div",null,[Sr[5]||(Sr[5]=Ee("div",{class:"text-white/60"},"Load (5m)",-1)),Ee("div",Ube,ki(S.value.cpu.load_avg["5min"].toFixed(2)),1)])])):Sa("",!0)]),Ee("div",$be,[Sr[13]||(Sr[13]=Ee("h3",{class:"text-white text-xl font-semibold mb-4"},"Memory Usage",-1)),Ee("div",Hbe,[Ee("canvas",{ref_key:"memoryCanvasRef",ref:wt,class:"w-full h-full relative z-10"},null,512),xe.value.memoryChart?(jr(),Kr("div",Vbe,Sr[7]||(Sr[7]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-6 h-6 border-2 border-white/20 border-t-green-400 rounded-full mx-auto mb-2"}),Ee("div",{class:"text-white/50 text-xs"},"Loading memory data...")],-1)]))):Sa("",!0),Ne.value&&!xe.value.memoryChart?(jr(),Kr("div",Wbe,Sr[8]||(Sr[8]=[Ee("div",{class:"text-center"},[Ee("div",{class:"text-red-400 text-sm mb-1"},"No Data Available"),Ee("div",{class:"text-white/50 text-xs"},"Memory data not found")],-1)]))):Sa("",!0)]),S.value?(jr(),Kr("div",qbe,[Ee("div",null,[Sr[9]||(Sr[9]=Ee("div",{class:"text-white/60"},"Total",-1)),Ee("div",Gbe,ki(ze(S.value.memory.total)),1)]),Ee("div",null,[Sr[10]||(Sr[10]=Ee("div",{class:"text-white/60"},"Used",-1)),Ee("div",Zbe,ki(ze(S.value.memory.used)),1)]),Ee("div",null,[Sr[11]||(Sr[11]=Ee("div",{class:"text-white/60"},"Available",-1)),Ee("div",Kbe,ki(ze(S.value.memory.available)),1)]),Ee("div",null,[Sr[12]||(Sr[12]=Ee("div",{class:"text-white/60"},"Usage",-1)),Ee("div",Ybe,ki(S.value.memory.usage_percent.toFixed(1))+"%",1)])])):Sa("",!0)])]),Ee("div",Xbe,[Ee("div",Jbe,[Sr[17]||(Sr[17]=Ee("h3",{class:"text-white text-xl font-semibold mb-4"},"Storage Usage",-1)),Ee("div",Qbe,[Ee("div",{ref_key:"diskCanvasRef",ref:Dt,class:"w-full h-full"},null,512)]),S.value?(jr(),Kr("div",e2e,[Ee("div",t2e,[Sr[14]||(Sr[14]=Ee("div",{class:"text-white/60"},"Total",-1)),Ee("div",r2e,ki(ze(S.value.disk.total)),1)]),Ee("div",i2e,[Sr[15]||(Sr[15]=Ee("div",{class:"text-white/60"},"Used",-1)),Ee("div",n2e,ki(ze(S.value.disk.used)),1)]),Ee("div",a2e,[Sr[16]||(Sr[16]=Ee("div",{class:"text-white/60"},"Free",-1)),Ee("div",o2e,ki(ze(S.value.disk.free)),1)])])):Sa("",!0)]),Ee("div",s2e,[Sr[23]||(Sr[23]=Ee("h3",{class:"text-white text-xl font-semibold mb-4"},"Network Statistics",-1)),S.value?(jr(),Kr("div",l2e,[Ee("div",u2e,[Ee("div",null,[Sr[18]||(Sr[18]=Ee("div",{class:"text-white/60"},"Bytes Sent",-1)),Ee("div",c2e,ki(ze(S.value.network.bytes_sent)),1)]),Ee("div",null,[Sr[19]||(Sr[19]=Ee("div",{class:"text-white/60"},"Bytes Received",-1)),Ee("div",h2e,ki(ze(S.value.network.bytes_recv)),1)]),Ee("div",null,[Sr[20]||(Sr[20]=Ee("div",{class:"text-white/60"},"Packets Sent",-1)),Ee("div",f2e,ki(S.value.network.packets_sent.toLocaleString()),1)]),Ee("div",null,[Sr[21]||(Sr[21]=Ee("div",{class:"text-white/60"},"Packets Received",-1)),Ee("div",d2e,ki(S.value.network.packets_recv.toLocaleString()),1)])]),S.value.temperatures&&Object.keys(S.value.temperatures).length>0?(jr(),Kr("div",p2e,[Sr[22]||(Sr[22]=Ee("div",{class:"text-white/60 mb-2"},"System Temperatures",-1)),Ee("div",m2e,[(jr(!0),Kr(js,null,au(S.value.temperatures,(ei,Jr)=>(jr(),Kr("div",{key:Jr},[Ee("span",g2e,ki(Jr)+":",1),Ee("span",v2e,ki(ei.toFixed(1))+"°C",1)]))),128))])])):Sa("",!0)])):Sa("",!0)])]),Ee("div",y2e,[Sr[25]||(Sr[25]=Ee("h3",{class:"text-white text-xl font-semibold mb-4"},"Top Processes",-1)),$.value?.processes&&$.value.processes.length>0?(jr(),Kr("div",_2e,[Ee("table",x2e,[Sr[24]||(Sr[24]=Ee("thead",null,[Ee("tr",{class:"border-b border-white/10"},[Ee("th",{class:"text-left text-white/70 py-2"},"PID"),Ee("th",{class:"text-left text-white/70 py-2"},"Name"),Ee("th",{class:"text-center text-white/70 py-2"},"CPU %"),Ee("th",{class:"text-center text-white/70 py-2"},"Memory %"),Ee("th",{class:"text-right text-white/70 py-2"},"Memory")])],-1)),Ee("tbody",null,[(jr(!0),Kr(js,null,au($.value.processes.slice(0,10),ei=>(jr(),Kr("tr",{key:ei.pid,class:"border-b border-white/5 process-row"},[Ee("td",b2e,ki(ei.pid),1),Ee("td",w2e,ki(ei.name),1),Ee("td",k2e,[Ee("span",{class:Ga(["cpu-value",{"value-updated":gi(ei,"cpu_percent")}])},ki(ei.cpu_percent.toFixed(1))+"% ",3)]),Ee("td",T2e,[Ee("span",{class:Ga(["memory-value",{"value-updated":gi(ei,"memory_percent")}])},ki(ei.memory_percent.toFixed(1))+"% ",3)]),Ee("td",S2e,[Ee("span",{class:Ga({"value-updated":gi(ei,"memory_mb")})},ki(ei.memory_mb.toFixed(1))+" MB ",3)])]))),128))])]),$.value.total_processes?(jr(),Kr("div",C2e," Showing top 10 of "+ki($.value.total_processes)+" total processes ",1)):Sa("",!0)])):r.value?Sa("",!0):(jr(),Kr("div",A2e," No process data available "))]),r.value?(jr(),Kr("div",M2e,Sr[26]||(Sr[26]=[Ee("div",{class:"text-white/70 mb-2"},"Loading system statistics...",-1),Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-white/70 rounded-full mx-auto"},null,-1)]))):Sa("",!0),c.value?(jr(),Kr("div",E2e,[Sr[27]||(Sr[27]=Ee("div",{class:"text-red-400 mb-2"},"Failed to load system statistics",-1)),Ee("p",L2e,ki(c.value),1),Ee("button",{onClick:Si,class:"mt-4 px-4 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-white rounded-lg border border-accent-purple/50 transition-colors"}," Retry ")])):Sa("",!0)]))}}),I2e=kh(P2e,[["__scopeId","data-v-04026a5d"]]),D2e={class:"space-y-4"},z2e={key:0,class:"bg-green-500/10 border border-green-500/30 rounded-lg p-3"},O2e={class:"text-green-400 text-sm"},B2e={key:1,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},R2e={class:"text-red-400 text-sm"},F2e={class:"flex justify-end gap-2"},N2e=["disabled"],j2e=["disabled"],U2e={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},$2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},H2e={key:0,class:"text-white font-mono text-sm"},V2e={key:1,class:"flex items-center gap-2"},W2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},q2e={key:0,class:"text-white font-mono text-sm"},G2e={key:1},Z2e=["value"],K2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Y2e={key:0,class:"text-white font-mono text-sm"},X2e={key:1},J2e=["value"],Q2e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},ewe={key:0,class:"text-white font-mono text-sm"},twe={key:1,class:"flex items-center gap-2"},rwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},iwe={key:0,class:"text-white font-mono text-sm"},nwe={key:1},awe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},owe={class:"text-white font-mono text-sm"},swe={key:2,class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},lwe=Bu({__name:"RadioSettings",setup(t){const e=Ym(),r=Io(()=>e.stats?.config?.radio||{}),c=fn(!1),S=fn(!1),$=fn(null),Z=fn(null),ue=fn(0),xe=fn(0),Se=fn(0),Ne=fn(0),it=fn(0),pt=fn(0),bt=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];Af(r,Si=>{Si&&!c.value&&(ue.value=Si.frequency?Number((Si.frequency/1e6).toFixed(3)):0,xe.value=Si.spreading_factor??0,Se.value=Si.bandwidth?Number((Si.bandwidth/1e3).toFixed(1)):0,Ne.value=Si.tx_power??0,it.value=Si.coding_rate??0,pt.value=Si.preamble_length??0)},{immediate:!0});const wt=Io(()=>{const Si=r.value.frequency;return Si?(Si/1e6).toFixed(3)+" MHz":"Not set"}),Dt=Io(()=>{const Si=r.value.bandwidth;return Si?(Si/1e3).toFixed(1)+" kHz":"Not set"}),Zt=Io(()=>{const Si=r.value.tx_power;return Si!==void 0?Si+" dBm":"Not set"}),Mr=Io(()=>{const Si=r.value.coding_rate;return Si?"4/"+Si:"Not set"}),ze=Io(()=>{const Si=r.value.preamble_length;return Si?Si+" symbols":"Not set"}),ni=Io(()=>r.value.spreading_factor??"Not set"),or=()=>{c.value=!0,$.value=null,Z.value=null},Cr=()=>{c.value=!1,$.value=null;const Si=r.value;ue.value=Si.frequency?Number((Si.frequency/1e6).toFixed(3)):0,xe.value=Si.spreading_factor??0,Se.value=Si.bandwidth?Number((Si.bandwidth/1e3).toFixed(1)):0,Ne.value=Si.tx_power??0,it.value=Si.coding_rate??0,pt.value=Si.preamble_length??0},gi=async()=>{S.value=!0,$.value=null,Z.value=null;try{const Si={};ue.value&&(Si.frequency=ue.value*1e6),xe.value&&(Si.spreading_factor=xe.value),Se.value&&(Si.bandwidth=Se.value*1e3),Ne.value&&(Si.tx_power=Ne.value),it.value&&(Si.coding_rate=it.value);const ri=(await bs.post("/update_radio_config",Si)).data;ri.message||ri.persisted?(Z.value=ri.message||"Settings saved successfully",c.value=!1,await e.fetchStats(),setTimeout(()=>{Z.value=null},3e3)):ri.error?$.value=ri.error:$.value="Unknown response from server"}catch(Si){console.error("Failed to update radio settings:",Si);const Ci=Si;$.value=Ci.response?.data?.error||"Failed to update settings"}finally{S.value=!1}};return(Si,Ci)=>(jr(),Kr("div",D2e,[Z.value?(jr(),Kr("div",z2e,[Ee("p",O2e,ki(Z.value),1)])):Sa("",!0),$.value?(jr(),Kr("div",B2e,[Ee("p",R2e,ki($.value),1)])):Sa("",!0),Ee("div",F2e,[c.value?(jr(),Kr(js,{key:1},[Ee("button",{onClick:Cr,disabled:S.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,N2e),Ee("button",{onClick:gi,disabled:S.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},ki(S.value?"Saving...":"Save Changes"),9,j2e)],64)):(jr(),Kr("button",{key:0,onClick:or,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Ee("div",U2e,[Ee("div",$2e,[Ci[6]||(Ci[6]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Frequency",-1)),c.value?(jr(),Kr("div",V2e,[Sl(Ee("input",{"onUpdate:modelValue":Ci[0]||(Ci[0]=ri=>ue.value=ri),type:"number",step:"0.001",min:"100",max:"1000",class:"w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,ue.value,void 0,{number:!0}]]),Ci[5]||(Ci[5]=Ee("span",{class:"text-white/50 text-sm"},"MHz",-1))])):(jr(),Kr("div",H2e,ki(wt.value),1))]),Ee("div",W2e,[Ci[7]||(Ci[7]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Spreading Factor",-1)),c.value?(jr(),Kr("div",G2e,[Sl(Ee("select",{"onUpdate:modelValue":Ci[1]||(Ci[1]=ri=>xe.value=ri),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},[(jr(),Kr(js,null,au([5,6,7,8,9,10,11,12],ri=>Ee("option",{key:ri,value:ri},ki(ri),9,Z2e)),64))],512),[[xg,xe.value,void 0,{number:!0}]])])):(jr(),Kr("div",q2e,ki(ni.value),1))]),Ee("div",K2e,[Ci[8]||(Ci[8]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Bandwidth",-1)),c.value?(jr(),Kr("div",X2e,[Sl(Ee("select",{"onUpdate:modelValue":Ci[2]||(Ci[2]=ri=>Se.value=ri),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},[(jr(),Kr(js,null,au(bt,ri=>Ee("option",{key:ri.value,value:ri.value},ki(ri.label),9,J2e)),64))],512),[[xg,Se.value,void 0,{number:!0}]])])):(jr(),Kr("div",Y2e,ki(Dt.value),1))]),Ee("div",Q2e,[Ci[10]||(Ci[10]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"TX Power",-1)),c.value?(jr(),Kr("div",twe,[Sl(Ee("input",{"onUpdate:modelValue":Ci[3]||(Ci[3]=ri=>Ne.value=ri),type:"number",min:"2",max:"30",class:"w-20 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,Ne.value,void 0,{number:!0}]]),Ci[9]||(Ci[9]=Ee("span",{class:"text-white/50 text-sm"},"dBm",-1))])):(jr(),Kr("div",ewe,ki(Zt.value),1))]),Ee("div",rwe,[Ci[12]||(Ci[12]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Coding Rate",-1)),c.value?(jr(),Kr("div",nwe,[Sl(Ee("select",{"onUpdate:modelValue":Ci[4]||(Ci[4]=ri=>it.value=ri),class:"px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},Ci[11]||(Ci[11]=[Ee("option",{value:5},"4/5",-1),Ee("option",{value:6},"4/6",-1),Ee("option",{value:7},"4/7",-1),Ee("option",{value:8},"4/8",-1)]),512),[[xg,it.value,void 0,{number:!0}]])])):(jr(),Kr("div",iwe,ki(Mr.value),1))]),Ee("div",awe,[Ci[13]||(Ci[13]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Preamble Length",-1)),Ee("span",owe,ki(ze.value),1)])]),c.value?(jr(),Kr("div",swe,Ci[14]||(Ci[14]=[Ee("p",{class:"text-yellow-400 text-xs"},[Ee("strong",null,"Note:"),il(" Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. ")],-1)]))):Sa("",!0)]))}}),uwe={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl"},cwe={class:"flex-1 relative min-h-[400px]"},hwe={class:"p-6 border-t border-white/10 space-y-4"},fwe={class:"grid grid-cols-2 gap-4"},dwe=Bu({__name:"LocationPicker",props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:["close","select"],setup(t,{emit:e}){const r=t,c=e,S=fn(null),$=fn(r.latitude||0),Z=fn(r.longitude||0);let ue=null,xe=null;const Se=async()=>{if(S.value){Ne();try{const wt=(await C5(async()=>{const{default:ze}=await Promise.resolve().then(()=>NB);return{default:ze}},void 0)).default;delete wt.Icon.Default.prototype._getIconUrl,wt.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"}),await b0();const Dt=$.value||0,Zt=Z.value||0,Mr=Dt===0&&Zt===0?2:13;ue=wt.map(S.value).setView([Dt,Zt],Mr);try{const ze=wt.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),ni=wt.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});ze.addTo(ue),ni.addTo(ue)}catch(ze){console.warn("Error loading tiles:",ze)}(Dt!==0||Zt!==0)&&(xe=wt.marker([Dt,Zt]).addTo(ue)),ue.on("click",ze=>{$.value=ze.latlng.lat,Z.value=ze.latlng.lng,xe?xe.setLatLng(ze.latlng):xe=wt.marker(ze.latlng).addTo(ue)}),setTimeout(()=>{ue?.invalidateSize()},200)}catch(wt){console.error("Failed to initialize map:",wt)}}},Ne=()=>{ue&&(ue.remove(),ue=null,xe=null)};Af(()=>r.isOpen,async wt=>{wt?(await b0(),await Se()):Ne()}),Af(()=>[r.latitude,r.longitude],([wt,Dt])=>{$.value=wt,Z.value=Dt});const it=()=>{c("select",{latitude:$.value,longitude:Z.value}),c("close")},pt=()=>{c("close")},bt=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async wt=>{if($.value=wt.coords.latitude,Z.value=wt.coords.longitude,ue){ue.setView([$.value,Z.value],13);const Dt=(await C5(async()=>{const{default:Zt}=await Promise.resolve().then(()=>NB);return{default:Zt}},void 0)).default;xe?xe.setLatLng([$.value,Z.value]):xe=Dt.marker([$.value,Z.value]).addTo(ue)}},wt=>{console.error("Error getting location:",wt),alert("Unable to get current location. Please check browser permissions.")}):alert("Geolocation is not supported by this browser.")};return Iv(()=>{Ne()}),(wt,Dt)=>wt.isOpen?(jr(),Kr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Xf(pt,["self"])},[Ee("div",uwe,[Ee("div",{class:"flex items-center justify-between p-6 border-b border-white/10"},[Dt[3]||(Dt[3]=Ee("h3",{class:"text-xl font-semibold text-white"},"Select Location",-1)),Ee("button",{onClick:pt,class:"text-white/70 hover:text-white transition-colors"},Dt[2]||(Dt[2]=[Ee("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",cwe,[Ee("div",{ref_key:"mapContainer",ref:S,class:"absolute inset-0 rounded-b-[15px] overflow-hidden"},null,512)]),Ee("div",hwe,[Ee("div",fwe,[Ee("div",null,[Dt[4]||(Dt[4]=Ee("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Latitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":Dt[0]||(Dt[0]=Zt=>$.value=Zt),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white focus:outline-none focus:border-primary",readonly:""},null,512),[[sc,$.value,void 0,{number:!0}]])]),Ee("div",null,[Dt[5]||(Dt[5]=Ee("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Longitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":Dt[1]||(Dt[1]=Zt=>Z.value=Zt),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white focus:outline-none focus:border-primary",readonly:""},null,512),[[sc,Z.value,void 0,{number:!0}]])])]),Ee("div",{class:"flex gap-3"},[Ee("button",{onClick:bt,class:"flex-1 px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm flex items-center justify-center gap-2"},Dt[6]||(Dt[6]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),il(" Use Current Location ",-1)])),Ee("button",{onClick:pt,class:"px-6 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm"}," Cancel "),Ee("button",{onClick:it,class:"px-6 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Select Location ")]),Dt[7]||(Dt[7]=Ee("p",{class:"text-white/50 text-xs text-center"},"Click on the map to select a location",-1))])])])):Sa("",!0)}}),pwe=kh(dwe,[["__scopeId","data-v-5793518c"]]),mwe={class:"space-y-4"},gwe={key:0,class:"bg-green-500/10 border border-green-500/30 rounded-lg p-3"},vwe={class:"text-green-400 text-sm"},ywe={key:1,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},_we={class:"text-red-400 text-sm"},xwe={class:"flex justify-end gap-2"},bwe=["disabled"],wwe=["disabled"],kwe={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Twe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Swe={key:0,class:"text-white font-mono text-sm break-all"},Cwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Awe={class:"text-white font-mono text-xs break-all"},Mwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-white/10 gap-1"},Ewe={class:"text-white font-mono text-xs break-all sm:text-right sm:max-w-xs"},Lwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Pwe={key:0,class:"text-white font-mono text-sm"},Iwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Dwe={key:0,class:"text-white font-mono text-sm"},zwe={key:0,class:"flex justify-end"},Owe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Bwe={class:"text-white font-mono text-sm"},Rwe={class:"flex flex-col py-2 gap-2"},Fwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},Nwe={key:0,class:"text-white font-mono text-sm sm:ml-4"},jwe={key:1,class:"flex items-center gap-2"},Uwe=Bu({__name:"RepeaterSettings",setup(t){const e=Ym(),r=Io(()=>e.stats?.config||{}),c=Io(()=>r.value.repeater||{}),S=Io(()=>e.stats),$=fn(!1),Z=fn(!1),ue=fn(null),xe=fn(null),Se=fn(!1),Ne=fn(""),it=fn(0),pt=fn(0),bt=fn(0);Af([r,c],()=>{$.value||(Ne.value=r.value.node_name||"",it.value=c.value.latitude||0,pt.value=c.value.longitude||0,bt.value=c.value.send_advert_interval_hours||0)},{immediate:!0});const wt=Io(()=>r.value.node_name||"Not set"),Dt=Io(()=>S.value?.local_hash||"Not available"),Zt=Io(()=>{const on=S.value?.public_key;return!on||on==="Not set"?"Not set":on}),Mr=Io(()=>{const on=c.value.latitude;return on&&on!==0?on.toFixed(6):"Not set"}),ze=Io(()=>{const on=c.value.longitude;return on&&on!==0?on.toFixed(6):"Not set"}),ni=Io(()=>{const on=c.value.mode;return on?on.charAt(0).toUpperCase()+on.slice(1):"Not set"}),or=Io(()=>{const on=c.value.send_advert_interval_hours;return on===void 0?"Not set":on===0?"Disabled":on+" hour"+(on!==1?"s":"")}),Cr=()=>{$.value=!0,ue.value=null,xe.value=null},gi=()=>{$.value=!1,ue.value=null,Ne.value=r.value.node_name||"",it.value=c.value.latitude||0,pt.value=c.value.longitude||0,bt.value=c.value.send_advert_interval_hours||0},Si=async()=>{Z.value=!0,ue.value=null,xe.value=null;try{const on={};Ne.value&&(on.node_name=Ne.value),on.latitude=it.value,on.longitude=pt.value,on.flood_advert_interval_hours=bt.value;const gr=(await bs.post("/update_radio_config",on)).data;gr.message||gr.persisted?(xe.value=gr.message||"Settings saved successfully",$.value=!1,await e.fetchStats(),setTimeout(()=>{xe.value=null},3e3)):gr.error?ue.value=gr.error:ue.value="Unknown response from server"}catch(on){console.error("Failed to update repeater settings:",on);const yi=on;ue.value=yi.response?.data?.error||"Failed to update settings"}finally{Z.value=!1}},Ci=()=>{Se.value=!0},ri=on=>{it.value=on.latitude,pt.value=on.longitude};return(on,yi)=>(jr(),Kr("div",mwe,[xe.value?(jr(),Kr("div",gwe,[Ee("p",vwe,ki(xe.value),1)])):Sa("",!0),ue.value?(jr(),Kr("div",ywe,[Ee("p",_we,ki(ue.value),1)])):Sa("",!0),Ee("div",xwe,[$.value?(jr(),Kr(js,{key:1},[Ee("button",{onClick:gi,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,bwe),Ee("button",{onClick:Si,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},ki(Z.value?"Saving...":"Save Changes"),9,wwe)],64)):(jr(),Kr("button",{key:0,onClick:Cr,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Ee("div",kwe,[Ee("div",Twe,[yi[5]||(yi[5]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Node Name",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":yi[0]||(yi[0]=gr=>Ne.value=gr),type:"text",maxlength:"50",class:"w-full sm:w-64 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary",placeholder:"Enter node name"},null,512)),[[sc,Ne.value]]):(jr(),Kr("div",Swe,ki(wt.value),1))]),Ee("div",Cwe,[yi[6]||(yi[6]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Local Hash",-1)),Ee("span",Awe,ki(Dt.value),1)]),Ee("div",Mwe,[yi[7]||(yi[7]=Ee("span",{class:"text-white/70 text-xs sm:text-sm flex-shrink-0"},"Public Key",-1)),Ee("span",Ewe,ki(Zt.value),1)]),Ee("div",Lwe,[yi[8]||(yi[8]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Latitude",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":yi[1]||(yi[1]=gr=>it.value=gr),type:"number",step:"0.000001",min:"-90",max:"90",class:"w-full sm:w-48 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,it.value,void 0,{number:!0}]]):(jr(),Kr("div",Pwe,ki(Mr.value),1))]),Ee("div",Iwe,[yi[9]||(yi[9]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Longitude",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":yi[2]||(yi[2]=gr=>pt.value=gr),type:"number",step:"0.000001",min:"-180",max:"180",class:"w-full sm:w-48 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,pt.value,void 0,{number:!0}]]):(jr(),Kr("div",Dwe,ki(ze.value),1))]),$.value?(jr(),Kr("div",zwe,[Ee("button",{onClick:Ci,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2",title:"Pick location on map"},yi[10]||(yi[10]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),il(" Pick Location on Map ",-1)]))])):Sa("",!0),Ee("div",Owe,[yi[11]||(yi[11]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Mode",-1)),Ee("span",Bwe,ki(ni.value),1)]),Ee("div",Rwe,[Ee("div",Fwe,[yi[13]||(yi[13]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Periodic Advertisement Interval",-1)),$.value?(jr(),Kr("div",jwe,[Sl(Ee("input",{"onUpdate:modelValue":yi[3]||(yi[3]=gr=>bt.value=gr),type:"number",min:"0",max:"48",class:"w-20 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512),[[sc,bt.value,void 0,{number:!0}]]),yi[12]||(yi[12]=Ee("span",{class:"text-white/50 text-sm"},"hours",-1))])):(jr(),Kr("div",Nwe,ki(or.value),1))]),yi[14]||(yi[14]=Ee("span",{class:"text-white/50 text-xs"},"How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)",-1))])]),nl(pwe,{"is-open":Se.value,latitude:it.value,longitude:pt.value,onClose:yi[4]||(yi[4]=gr=>Se.value=!1),onSelect:ri},null,8,["is-open","latitude","longitude"])]))}}),$we={class:"space-y-4"},Hwe={key:0,class:"bg-green-500/20 border border-green-500/50 rounded-lg p-3 text-green-400 text-sm"},Vwe={key:1,class:"bg-red-500/20 border border-red-500/50 rounded-lg p-3 text-red-400 text-sm"},Wwe={class:"flex justify-end gap-2"},qwe=["disabled"],Gwe=["disabled"],Zwe={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Kwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-white/10 gap-1"},Ywe={key:0,class:"text-white font-mono text-sm"},Xwe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},Jwe={key:0,class:"text-white font-mono text-sm"},Qwe=Bu({__name:"DutyCycle",setup(t){const e=Ym(),r=Io(()=>e.stats?.config?.duty_cycle||{}),c=Io(()=>{const wt=r.value.max_airtime_percent;return typeof wt=="number"?wt.toFixed(1)+"%":wt&&typeof wt=="object"&&"parsedValue"in wt?(wt.parsedValue||0).toFixed(1)+"%":"Not set"}),S=Io(()=>r.value.enforcement_enabled?"Enabled":"Disabled"),$=fn(!1),Z=fn(!1),ue=fn(""),xe=fn(""),Se=fn(0),Ne=fn(!0),it=()=>{const wt=r.value.max_airtime_percent;typeof wt=="number"?Se.value=wt:wt&&typeof wt=="object"&&"parsedValue"in wt?Se.value=wt.parsedValue||0:Se.value=6,Ne.value=r.value.enforcement_enabled!==!1,$.value=!0,ue.value="",xe.value=""},pt=()=>{$.value=!1,ue.value="",xe.value=""},bt=async()=>{Z.value=!0,xe.value="",ue.value="";try{const Dt=(await ew.post("/api/update_duty_cycle_config",{max_airtime_percent:Se.value,enforcement_enabled:Ne.value})).data;Dt.message||Dt.persisted?(ue.value=Dt.message||"Settings saved successfully",$.value=!1,await e.fetchStats(),setTimeout(()=>{ue.value=""},3e3)):xe.value="Failed to save settings"}catch(wt){console.error("Failed to save duty cycle settings:",wt),xe.value=wt.response?.data?.error||"Failed to save settings"}finally{Z.value=!1}};return(wt,Dt)=>(jr(),Kr("div",$we,[ue.value?(jr(),Kr("div",Hwe,ki(ue.value),1)):Sa("",!0),xe.value?(jr(),Kr("div",Vwe,ki(xe.value),1)):Sa("",!0),Ee("div",Wwe,[$.value?(jr(),Kr(js,{key:1},[Ee("button",{onClick:pt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,qwe),Ee("button",{onClick:bt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},ki(Z.value?"Saving...":"Save Changes"),9,Gwe)],64)):(jr(),Kr("button",{key:0,onClick:it,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Ee("div",Zwe,[Ee("div",Kwe,[Dt[2]||(Dt[2]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Max Airtime %",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":Dt[0]||(Dt[0]=Zt=>Se.value=Zt),type:"number",step:"0.1",min:"0.1",max:"100",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Se.value,void 0,{number:!0}]]):(jr(),Kr("div",Ywe,ki(c.value),1))]),Ee("div",Xwe,[Dt[4]||(Dt[4]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Enforcement",-1)),$.value?Sl((jr(),Kr("select",{key:1,"onUpdate:modelValue":Dt[1]||(Dt[1]=Zt=>Ne.value=Zt),class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},Dt[3]||(Dt[3]=[Ee("option",{value:!0},"Enabled",-1),Ee("option",{value:!1},"Disabled",-1)]),512)),[[xg,Ne.value]]):(jr(),Kr("div",Jwe,ki(S.value),1))])])]))}}),e3e={class:"space-y-4"},t3e={key:0,class:"bg-green-500/20 border border-green-500/50 rounded-lg p-3 text-green-400 text-sm"},r3e={key:1,class:"bg-red-500/20 border border-red-500/50 rounded-lg p-3 text-red-400 text-sm"},i3e={class:"flex justify-end gap-2"},n3e=["disabled"],a3e=["disabled"],o3e={class:"bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},s3e={class:"flex flex-col py-2 border-b border-white/10 gap-2"},l3e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},u3e={key:0,class:"text-white font-mono text-sm sm:ml-4"},c3e={class:"flex flex-col py-2 gap-2"},h3e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},f3e={key:0,class:"text-white font-mono text-sm sm:ml-4"},d3e=Bu({__name:"TransmissionDelays",setup(t){const e=Ym(),r=Io(()=>e.stats?.config?.delays||{}),c=Io(()=>{const wt=r.value.tx_delay_factor;if(wt&&typeof wt=="object"&&wt!==null&&"parsedValue"in wt){const Dt=wt.parsedValue;if(typeof Dt=="number")return Dt.toFixed(2)+"x"}return"Not set"}),S=Io(()=>{const wt=r.value.direct_tx_delay_factor;return typeof wt=="number"?wt.toFixed(2)+"s":"Not set"}),$=fn(!1),Z=fn(!1),ue=fn(""),xe=fn(""),Se=fn(0),Ne=fn(0),it=()=>{const wt=r.value.tx_delay_factor;wt&&typeof wt=="object"&&"parsedValue"in wt?Se.value=wt.parsedValue||1:typeof wt=="number"?Se.value=wt:Se.value=1;const Dt=r.value.direct_tx_delay_factor;Ne.value=typeof Dt=="number"?Dt:.5,$.value=!0,ue.value="",xe.value=""},pt=()=>{$.value=!1,ue.value="",xe.value=""},bt=async()=>{Z.value=!0,xe.value="",ue.value="";try{const Dt=(await ew.post("/api/update_radio_config",{tx_delay_factor:Se.value,direct_tx_delay_factor:Ne.value})).data;Dt.message||Dt.persisted?(ue.value=Dt.message||"Settings saved successfully",$.value=!1,await e.fetchStats(),setTimeout(()=>{ue.value=""},3e3)):xe.value="Failed to save settings"}catch(wt){console.error("Failed to save delay settings:",wt),xe.value=wt.response?.data?.error||"Failed to save settings"}finally{Z.value=!1}};return(wt,Dt)=>(jr(),Kr("div",e3e,[ue.value?(jr(),Kr("div",t3e,ki(ue.value),1)):Sa("",!0),xe.value?(jr(),Kr("div",r3e,ki(xe.value),1)):Sa("",!0),Ee("div",i3e,[$.value?(jr(),Kr(js,{key:1},[Ee("button",{onClick:pt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,n3e),Ee("button",{onClick:bt,disabled:Z.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},ki(Z.value?"Saving...":"Save Changes"),9,a3e)],64)):(jr(),Kr("button",{key:0,onClick:it,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),Ee("div",o3e,[Ee("div",s3e,[Ee("div",l3e,[Dt[2]||(Dt[2]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Flood TX Delay Factor",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":Dt[0]||(Dt[0]=Zt=>Se.value=Zt),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Se.value,void 0,{number:!0}]]):(jr(),Kr("div",u3e,ki(c.value),1))]),Dt[3]||(Dt[3]=Ee("span",{class:"text-white/50 text-xs"},"Multiplier for flood packet transmission delays (collision avoidance)",-1))]),Ee("div",c3e,[Ee("div",h3e,[Dt[4]||(Dt[4]=Ee("span",{class:"text-white/70 text-xs sm:text-sm"},"Direct TX Delay Factor",-1)),$.value?Sl((jr(),Kr("input",{key:1,"onUpdate:modelValue":Dt[1]||(Dt[1]=Zt=>Ne.value=Zt),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg text-white text-sm focus:outline-none focus:border-primary"},null,512)),[[sc,Ne.value,void 0,{number:!0}]]):(jr(),Kr("div",f3e,ki(S.value),1))]),Dt[5]||(Dt[5]=Ee("span",{class:"text-white/50 text-xs"},"Base delay for direct-routed packet transmission (seconds)",-1))])])]))}}),OH=A8("treeState",()=>{const t=m_(new Set),e=m_({value:null}),r=ue=>{t.add(ue)},c=ue=>{t.delete(ue)};return{expandedNodes:t,selectedNodeId:e,addExpandedNode:r,removeExpandedNode:c,isNodeExpanded:ue=>t.has(ue),setSelectedNode:ue=>{e.value=ue},toggleExpanded:ue=>{t.has(ue)?c(ue):r(ue)}}}),p3e={class:"select-none"},m3e={class:"flex-shrink-0"},g3e={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v3e={key:1,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y3e={key:0,class:"hidden sm:flex items-center gap-1 ml-2"},_3e={class:"relative group"},x3e=["title"],b3e={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},w3e={class:"flex justify-between items-start mb-4"},k3e={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},T3e={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},S3e={class:"flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0"},C3e={key:0,class:"hidden sm:flex items-center gap-1"},A3e=["title"],M3e={key:1,class:"hidden sm:flex items-center gap-1"},E3e={key:2,class:"hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},L3e={key:0,class:"space-y-1"},P3e=Bu({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const r=t,c=e,S=OH(),$=fn(!1),Z=Io({get:()=>S.isNodeExpanded(r.node.id),set:Dt=>{Dt?S.addExpandedNode(r.node.id):S.removeExpandedNode(r.node.id)}}),ue=Io(()=>r.node.children.length>0);function xe(Dt){if(!Dt)return"Never";const Mr=new Date().getTime()-Dt.getTime(),ze=Math.floor(Mr/(1e3*60)),ni=Math.floor(Mr/(1e3*60*60)),or=Math.floor(Mr/(1e3*60*60*24)),Cr=Math.floor(or/365);return ze<60?`${ze}m ago`:ni<24?`${ni}h ago`:or<365?`${or}d ago`:`${Cr}y ago`}function Se(Dt){return Dt?Dt.length<=16?Dt:`${Dt.slice(0,8)}...${Dt.slice(-8)}`:"No key"}function Ne(){if(ue.value){const Dt=!Z.value;Z.value=Dt}}function it(){c("select",r.node.id)}function pt(Dt){c("select",Dt)}function bt(Dt){Dt.stopPropagation(),$.value=!$.value}function wt(Dt){Dt.stopPropagation(),r.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(r.node.transport_key)}return(Dt,Zt)=>{const Mr=b8("TreeNode",!0);return jr(),Kr("div",p3e,[Ee("div",{class:Ga(["flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200",r.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",Dt.selectedNodeId===Dt.node.id&&!r.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${Dt.level*4}`]),onClick:Zt[3]||(Zt[3]=ze=>!r.disabled&&it())},[Ee("div",{class:"flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center",onClick:Xf(Ne,["stop"])},[ue.value?(jr(),Kr("svg",{key:0,class:Ga(["w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200",Z.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Zt[4]||(Zt[4]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):Sa("",!0)]),Ee("div",m3e,[r.node.name.startsWith("#")?(jr(),Kr("svg",g3e,Zt[5]||(Zt[5]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",v3e,Zt[6]||(Zt[6]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),Ee("span",{class:Ga(["font-mono text-xs sm:text-sm transition-colors duration-200 break-all",Dt.selectedNodeId===Dt.node.id?"text-primary font-medium":""])},ki(Dt.node.name),3),Dt.node.transport_key?(jr(),Kr("div",y3e,[Ee("div",_3e,[Ee("button",{onClick:bt,class:"p-1 rounded hover:bg-white/10 transition-colors",title:$.value?"Hide full key":"Show full key"},Zt[7]||(Zt[7]=[Ee("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,x3e),$.value?Sa("",!0):(jr(),Kr("span",b3e,ki(Se(Dt.node.transport_key)),1)),$.value?(jr(),Kr("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:Zt[2]||(Zt[2]=ze=>$.value=!1)},[Ee("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:Zt[1]||(Zt[1]=Xf(()=>{},["stop"]))},[Ee("div",w3e,[Zt[9]||(Zt[9]=Ee("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),Ee("button",{onClick:Zt[0]||(Zt[0]=ze=>$.value=!1),class:"text-white/60 hover:text-white transition-colors"},Zt[8]||(Zt[8]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",k3e,[Ee("div",T3e,ki(Dt.node.transport_key),1)]),Ee("div",{class:"flex justify-end"},[Ee("button",{onClick:wt,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},Zt[10]||(Zt[10]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),il(" Copy Key ",-1)]))])])])):Sa("",!0)])])):Sa("",!0),Ee("div",S3e,[Dt.node.last_used?(jr(),Kr("div",C3e,[Zt[11]||(Zt[11]=Ee("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Ee("span",{class:"text-xs text-white/50",title:Dt.node.last_used.toLocaleString()},ki(xe(Dt.node.last_used)),9,A3e)])):(jr(),Kr("div",M3e,Zt[12]||(Zt[12]=[Ee("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),Ee("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),Ee("span",{class:Ga(["px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors",Dt.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},ki(Dt.node.floodPolicy==="allow"?"ALLOW":"DENY"),3),ue.value?(jr(),Kr("span",E3e," > "+ki(Dt.node.children.length),1)):Sa("",!0)])],2),nl(R2,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:$1(()=>[Z.value&&Dt.node.children.length>0?(jr(),Kr("div",L3e,[(jr(!0),Kr(js,null,au(Dt.node.children,ze=>(jr(),Cd(Mr,{key:ze.id,node:ze,"selected-node-id":Dt.selectedNodeId,level:Dt.level+1,disabled:r.disabled,onSelect:pt},null,8,["node","selected-node-id","level","disabled"]))),128))])):Sa("",!0)]),_:1})])}}}),I3e=kh(P3e,[["__scopeId","data-v-59e9974c"]]),D3e={class:"flex items-center justify-between mb-6"},z3e={class:"text-white/60 text-sm mt-1"},O3e={key:0},B3e={class:"text-primary font-mono"},R3e={key:1},F3e={for:"keyName",class:"block text-sm font-medium text-white mb-2"},N3e={class:"flex items-center gap-2"},j3e={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},U3e={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$3e={class:"bg-white/5 border border-white/10 rounded-lg p-4"},H3e={class:"flex items-center gap-3 mb-2"},V3e={class:"flex items-center gap-2"},W3e={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},q3e={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},G3e={class:"text-white/70 text-sm"},Z3e={class:"grid grid-cols-2 gap-3"},K3e={class:"relative cursor-pointer group"},Y3e={class:"relative cursor-pointer group"},X3e={class:"flex gap-3 pt-4"},J3e=["disabled"],Q3e=Bu({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(t,{emit:e}){const r=t,c=e,S=fn(""),$=fn(""),Z=fn("allow"),ue=Io(()=>S.value.startsWith("#")),xe=Io(()=>({type:ue.value?"Region":"Private Key",description:ue.value?"Regional organizational key":"Individual assigned key"}));Af(ue,bt=>{bt?$.value="This will create a new region for organizing keys":$.value="This will create a new private key entry"},{immediate:!0});const Se=Io(()=>S.value.trim().length>0),Ne=()=>{Se.value&&(c("add",{name:S.value.trim(),floodPolicy:Z.value,parentId:r.selectedNodeId}),S.value="",$.value="",Z.value="allow")},it=()=>{S.value="",$.value="",Z.value="allow",c("close")},pt=bt=>{bt.target===bt.currentTarget&&it()};return(bt,wt)=>bt.show?(jr(),Kr("div",{key:0,onClick:pt,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:wt[3]||(wt[3]=Xf(()=>{},["stop"]))},[Ee("div",D3e,[Ee("div",null,[wt[5]||(wt[5]=Ee("h3",{class:"text-xl font-semibold text-white"},"Add New Entry",-1)),Ee("p",z3e,[r.selectedNodeName?(jr(),Kr("span",O3e,[wt[4]||(wt[4]=il(" Add to: ",-1)),Ee("span",B3e,ki(r.selectedNodeName),1)])):(jr(),Kr("span",R3e," Add to root level (#uk) "))])]),Ee("button",{onClick:it,class:"text-white/60 hover:text-white transition-colors"},wt[6]||(wt[6]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("form",{onSubmit:Xf(Ne,["prevent"]),class:"space-y-4"},[Ee("div",null,[Ee("label",F3e,[Ee("div",N3e,[ue.value?(jr(),Kr("svg",j3e,wt[7]||(wt[7]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",U3e,wt[8]||(wt[8]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),wt[9]||(wt[9]=il(" Region/Key Name ",-1))])]),Sl(Ee("input",{id:"keyName","onUpdate:modelValue":wt[0]||(wt[0]=Dt=>S.value=Dt),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[sc,S.value]])]),Ee("div",$3e,[Ee("div",H3e,[Ee("div",V3e,[ue.value?(jr(),Kr("svg",W3e,wt[10]||(wt[10]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",q3e,wt[11]||(wt[11]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),Ee("span",{class:Ga([ue.value?"text-secondary":"text-accent-green","font-medium"])},ki(xe.value.type),3)]),Ee("div",{class:Ga(["flex-1 h-px",ue.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Ee("p",G3e,ki(xe.value.description),1)]),Ee("div",null,[wt[14]||(wt[14]=Ee("label",{class:"block text-sm font-medium text-white mb-3"},[Ee("div",{class:"flex items-center gap-2"},[Ee("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),il(" Flood Policy ")])],-1)),Ee("div",Z3e,[Ee("label",K3e,[Sl(Ee("input",{type:"radio","onUpdate:modelValue":wt[1]||(wt[1]=Dt=>Z.value=Dt),value:"allow",class:"sr-only"},null,512),[[B5,Z.value]]),wt[12]||(wt[12]=Dc('
Allow

Permit flooding

',1))]),Ee("label",Y3e,[Sl(Ee("input",{type:"radio","onUpdate:modelValue":wt[2]||(wt[2]=Dt=>Z.value=Dt),value:"deny",class:"sr-only"},null,512),[[B5,Z.value]]),wt[13]||(wt[13]=Dc('
Deny

Block flooding

',1))])])]),Ee("div",X3e,[Ee("button",{type:"button",onClick:it,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Ee("button",{type:"submit",disabled:!Se.value,class:Ga(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",Se.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Add "+ki(xe.value.type),11,J3e)])],32)])])):Sa("",!0)}}),e5e={class:"flex bg-black items-center justify-between mb-6"},t5e={class:"text-white/60 text-sm mt-1"},r5e={class:"text-primary font-mono"},i5e={for:"keyName",class:"block text-sm font-medium text-white mb-2"},n5e={class:"flex items-center gap-2"},a5e={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},o5e={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},s5e={class:"bg-white/5 border border-white/10 rounded-lg p-4"},l5e={class:"flex items-center gap-3 mb-2"},u5e={class:"flex items-center gap-2"},c5e={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},h5e={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},f5e={class:"text-white/70 text-sm"},d5e={key:0,class:"space-y-4"},p5e={key:0,class:"bg-white/5 border border-white/10 rounded-lg p-4"},m5e={class:"bg-black/20 border border-white/10 rounded-md p-3"},g5e={class:"text-xs font-mono text-white/80 break-all"},v5e={key:1,class:"bg-white/5 border border-white/10 rounded-lg p-4"},y5e={class:"flex items-center justify-between"},_5e={class:"text-sm text-white/70"},x5e={class:"text-xs text-white/50"},b5e={class:"grid grid-cols-2 gap-3"},w5e={class:"relative cursor-pointer group"},k5e={class:"relative cursor-pointer group"},T5e={class:"flex gap-3 pt-4"},S5e=["disabled"],C5e=Bu({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(t,{emit:e}){const r=t,c=e,S=fn(""),$=fn("allow"),Z=Io(()=>S.value.startsWith("#")),ue=Io(()=>({type:Z.value?"Region":"Private Key",description:Z.value?"Regional organizational key":"Individual assigned key"}));Af(()=>r.node,Dt=>{Dt?(S.value=Dt.name,$.value=Dt.floodPolicy):(S.value="",$.value="allow")},{immediate:!0});const xe=Io(()=>S.value.trim().length>0&&r.node),Se=Dt=>{const Mr=new Date().getTime()-Dt.getTime(),ze=Math.floor(Mr/(1e3*60)),ni=Math.floor(Mr/(1e3*60*60)),or=Math.floor(Mr/(1e3*60*60*24)),Cr=Math.floor(or/365);return ze<60?`${ze}m ago`:ni<24?`${ni}h ago`:or<365?`${or}d ago`:`${Cr}y ago`},Ne=Dt=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(Dt)},it=()=>{!xe.value||!r.node||(c("save",{id:r.node.id,name:S.value.trim(),floodPolicy:$.value}),bt())},pt=()=>{r.node&&(c("request-delete",r.node),bt())},bt=()=>{c("close")},wt=Dt=>{Dt.target===Dt.currentTarget&&bt()};return(Dt,Zt)=>Dt.show?(jr(),Kr("div",{key:0,onClick:wt,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:Zt[4]||(Zt[4]=Xf(()=>{},["stop"]))},[Ee("div",e5e,[Ee("div",null,[Zt[6]||(Zt[6]=Ee("h3",{class:"text-xl font-semibold text-white"},"Edit Entry",-1)),Ee("p",t5e,[Zt[5]||(Zt[5]=il(" Modify ",-1)),Ee("span",r5e,ki(Dt.node?.name),1)])]),Ee("button",{onClick:bt,class:"text-white/60 hover:text-white transition-colors"},Zt[7]||(Zt[7]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("form",{onSubmit:Xf(it,["prevent"]),class:"space-y-4"},[Ee("div",null,[Ee("label",i5e,[Ee("div",n5e,[Z.value?(jr(),Kr("svg",a5e,Zt[8]||(Zt[8]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",o5e,Zt[9]||(Zt[9]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Zt[10]||(Zt[10]=il(" Region/Key Name ",-1))])]),Sl(Ee("input",{id:"keyName","onUpdate:modelValue":Zt[0]||(Zt[0]=Mr=>S.value=Mr),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[sc,S.value]])]),Ee("div",s5e,[Ee("div",l5e,[Ee("div",u5e,[Z.value?(jr(),Kr("svg",c5e,Zt[11]||(Zt[11]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",h5e,Zt[12]||(Zt[12]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Ee("span",{class:Ga([Z.value?"text-secondary":"text-accent-green","font-medium"])},ki(ue.value.type),3)]),Ee("div",{class:Ga(["flex-1 h-px",Z.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),Ee("p",f5e,ki(ue.value.description),1)]),Dt.node?(jr(),Kr("div",d5e,[Dt.node.transport_key?(jr(),Kr("div",p5e,[Zt[14]||(Zt[14]=Dc('
Transport Key
',1)),Ee("div",m5e,[Ee("div",g5e,ki(Dt.node.transport_key),1),Ee("button",{onClick:Zt[1]||(Zt[1]=Mr=>Ne(Dt.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},Zt[13]||(Zt[13]=[Ee("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),il(" Copy Key ",-1)]))])])):Sa("",!0),Dt.node.last_used?(jr(),Kr("div",v5e,[Zt[15]||(Zt[15]=Ee("div",{class:"flex items-center gap-2 mb-3"},[Ee("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),Ee("span",{class:"text-sm font-medium text-white"},"Last Used")],-1)),Ee("div",y5e,[Ee("div",_5e,ki(Dt.node.last_used.toLocaleDateString())+" at "+ki(Dt.node.last_used.toLocaleTimeString()),1),Ee("div",x5e,ki(Se(Dt.node.last_used)),1)])])):Sa("",!0)])):Sa("",!0),Ee("div",null,[Zt[18]||(Zt[18]=Ee("label",{class:"block text-sm font-medium text-white mb-3"},[Ee("div",{class:"flex items-center gap-2"},[Ee("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),il(" Flood Policy ")])],-1)),Ee("div",b5e,[Ee("label",w5e,[Sl(Ee("input",{type:"radio","onUpdate:modelValue":Zt[2]||(Zt[2]=Mr=>$.value=Mr),value:"allow",class:"sr-only"},null,512),[[B5,$.value]]),Zt[16]||(Zt[16]=Dc('
Allow

Permit flooding

',1))]),Ee("label",k5e,[Sl(Ee("input",{type:"radio","onUpdate:modelValue":Zt[3]||(Zt[3]=Mr=>$.value=Mr),value:"deny",class:"sr-only"},null,512),[[B5,$.value]]),Zt[17]||(Zt[17]=Dc('
Deny

Block flooding

',1))])])]),Ee("div",T5e,[Ee("button",{type:"button",onClick:pt,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),Ee("button",{type:"button",onClick:bt,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),Ee("button",{type:"submit",disabled:!xe.value,class:Ga(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",xe.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-white/5 border border-white/20 text-white/40 cursor-not-allowed"])}," Save Changes ",10,S5e)])],32)])])):Sa("",!0)}}),A5e={class:"flex items-center gap-3 mb-6"},M5e={class:"text-white/60 text-sm mt-1"},E5e={class:"text-accent-red font-mono"},L5e={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},P5e={class:"flex items-start gap-3"},I5e={class:"flex-1"},D5e={class:"text-accent-red font-medium text-sm mb-2"},z5e={class:"space-y-1 max-h-32 overflow-y-auto"},O5e={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B5e={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},R5e={class:"font-mono"},F5e={key:0,class:"text-white/60 text-xs"},N5e={key:1,class:"mb-6"},j5e={class:"mb-3"},U5e={class:"relative"},$5e={class:"space-y-2 max-h-40 overflow-y-auto border border-white/20 rounded-lg p-3 bg-white/5"},H5e={key:0,class:"text-center py-4 text-white/60 text-sm"},V5e={class:"relative"},W5e=["value"],q5e={class:"flex items-center gap-2 flex-1"},G5e={class:"text-white font-mono text-sm"},Z5e={key:0,class:"ml-auto px-2 py-0.5 bg-white/10 text-white/60 text-xs rounded-full"},K5e={class:"flex gap-3"},Y5e=Bu({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(t,{emit:e}){const r=t,c=e,S=fn(null),$=fn(""),Z=wt=>{const Dt=[],Zt=Mr=>{for(const ze of Mr.children)Dt.push(ze),Zt(ze)};return Zt(wt),Dt},ue=Io(()=>r.node?Z(r.node):[]),xe=Io(()=>{if(!r.node)return[];const wt=new Set([r.node.id,...ue.value.map(Zt=>Zt.id)]),Dt=Zt=>{const Mr=[];for(const ze of Zt)ze.name.startsWith("#")&&!wt.has(ze.id)&&Mr.push(ze),ze.children.length>0&&Mr.push(...Dt(ze.children));return Mr};return Dt(r.allNodes)}),Se=Io(()=>{if(!$.value.trim())return xe.value;const wt=$.value.toLowerCase();return xe.value.filter(Dt=>Dt.name.toLowerCase().includes(wt))}),Ne=()=>{r.node&&(c("delete-all",r.node.id),pt())},it=()=>{!r.node||!S.value||(c("move-children",{nodeId:r.node.id,targetParentId:S.value}),pt())},pt=()=>{S.value=null,$.value="",c("close")},bt=wt=>{wt.target===wt.currentTarget&&pt()};return(wt,Dt)=>wt.show&&wt.node?(jr(),Kr("div",{key:0,onClick:bt,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-lg border border-white/10",onClick:Dt[2]||(Dt[2]=Xf(()=>{},["stop"]))},[Ee("div",A5e,[Dt[6]||(Dt[6]=Ee("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),Ee("div",null,[Dt[4]||(Dt[4]=Ee("h3",{class:"text-xl font-semibold text-white"},"Confirm Deletion",-1)),Ee("p",M5e,[Dt[3]||(Dt[3]=il(" Deleting ",-1)),Ee("span",E5e,ki(wt.node?.name),1)])]),Ee("button",{onClick:pt,class:"ml-auto text-white/60 hover:text-white transition-colors"},Dt[5]||(Dt[5]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),ue.value.length>0?(jr(),Kr("div",L5e,[Ee("div",P5e,[Dt[9]||(Dt[9]=Ee("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),Ee("div",I5e,[Ee("h4",D5e," This will affect "+ki(ue.value.length)+" child "+ki(ue.value.length===1?"entry":"entries")+": ",1),Ee("div",z5e,[(jr(!0),Kr(js,null,au(ue.value.slice(0,10),Zt=>(jr(),Kr("div",{key:Zt.id,class:"flex items-center gap-2 text-xs text-white/80"},[Zt.name.startsWith("#")?(jr(),Kr("svg",O5e,Dt[7]||(Dt[7]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(jr(),Kr("svg",B5e,Dt[8]||(Dt[8]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),Ee("span",R5e,ki(Zt.name),1),Ee("span",{class:Ga(["px-1 py-0.5 text-xs rounded",Zt.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},ki(Zt.floodPolicy),3)]))),128)),ue.value.length>10?(jr(),Kr("div",F5e," ...and "+ki(ue.value.length-10)+" more ",1)):Sa("",!0)])])])])):Sa("",!0),ue.value.length>0&&xe.value.length>0?(jr(),Kr("div",N5e,[Dt[13]||(Dt[13]=Ee("h4",{class:"text-white font-medium text-sm mb-3"},"Move children to another region:",-1)),Ee("div",j5e,[Ee("div",U5e,[Dt[10]||(Dt[10]=Ee("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),Sl(Ee("input",{"onUpdate:modelValue":Dt[0]||(Dt[0]=Zt=>$.value=Zt),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white/5 border border-white/20 rounded-lg text-white placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[sc,$.value]])])]),Ee("div",$5e,[Se.value.length===0?(jr(),Kr("div",H5e,ki($.value?"No regions match your search":"No available regions"),1)):Sa("",!0),(jr(!0),Kr(js,null,au(Se.value,Zt=>(jr(),Kr("label",{key:Zt.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-white/10 transition-colors group"},[Ee("div",V5e,[Sl(Ee("input",{type:"radio",value:Zt.id,"onUpdate:modelValue":Dt[1]||(Dt[1]=Mr=>S.value=Mr),class:"sr-only peer"},null,8,W5e),[[B5,S.value]]),Dt[11]||(Dt[11]=Ee("div",{class:"w-4 h-4 border-2 border-white/30 rounded-full group-hover:border-white/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[Ee("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),Ee("div",q5e,[Dt[12]||(Dt[12]=Ee("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),Ee("span",G5e,ki(Zt.name),1),Zt.children.length>0?(jr(),Kr("span",Z5e,ki(Zt.children.length),1)):Sa("",!0)])]))),128))])])):Sa("",!0),Ee("div",K5e,[Ee("button",{onClick:pt,class:"flex-1 px-4 py-3 bg-white/5 hover:bg-white/10 border border-white/20 text-white rounded-lg transition-colors"}," Cancel "),ue.value.length>0&&S.value?(jr(),Kr("button",{key:0,onClick:it,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):Sa("",!0),Ee("button",{onClick:Ne,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},ki(ue.value.length>0?"Delete All":"Delete"),1)])])])):Sa("",!0)}}),X5e={class:"space-y-4 sm:space-y-6"},J5e={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3"},Q5e={class:"flex gap-2 flex-wrap"},e4e=["disabled"],t4e=["disabled"],r4e=["disabled"],i4e={class:"glass-card rounded-[15px] p-3 sm:p-4 border border-white/10 bg-white/5"},n4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},a4e={class:"flex items-center gap-2 sm:gap-3"},o4e={class:"flex bg-white/5 rounded-lg border border-white/20 p-0.5 sm:p-1"},s4e={class:"glass-card rounded-[15px] p-3 sm:p-6 border border-white/10"},l4e={key:0,class:"flex items-center justify-center py-8"},u4e={key:1,class:"text-center py-8"},c4e={class:"text-white/70 text-sm"},h4e={key:2,class:"text-center py-8"},f4e={key:3,class:"space-y-2"},d4e=Bu({name:"TransportKeys",__name:"TransportKeys",setup(t){const e=OH(),r=fn(!1),c=fn(!1),S=fn(!1),$=fn(null),Z=fn(null),ue=fn("deny"),xe=fn([]),Se=fn(!1),Ne=fn(null),it=gr=>{const fr=new Map,Sr=[];return gr.forEach(ei=>{const Jr={id:ei.id,name:ei.name,floodPolicy:ei.flood_policy,transport_key:ei.transport_key,last_used:ei.last_used?new Date(ei.last_used*1e3):void 0,parent_id:ei.parent_id,children:[]};fr.set(ei.id,Jr)}),fr.forEach(ei=>{ei.parent_id&&fr.has(ei.parent_id)?fr.get(ei.parent_id).children.push(ei):Sr.push(ei)}),Sr},pt=async()=>{try{Se.value=!0,Ne.value=null;const gr=await bs.getTransportKeys();gr.success&&gr.data?xe.value=it(gr.data):Ne.value=gr.error||"Failed to load transport keys"}catch(gr){Ne.value=gr instanceof Error?gr.message:"Unknown error occurred",console.error("Error loading transport keys:",gr)}finally{Se.value=!1}};Jf(()=>{pt()});function bt(gr,fr){for(const Sr of gr){if(Sr.id===fr)return Sr;if(Sr.children){const ei=bt(Sr.children,fr);if(ei)return ei}}return null}function wt(){const gr=e.selectedNodeId.value;return gr?bt(xe.value,gr)?.name:void 0}function Dt(gr){ue.value==="deny"&&e.setSelectedNode(gr)}function Zt(){ue.value==="deny"&&(r.value=!0)}function Mr(){if(ue.value==="deny"&&e.selectedNodeId.value){const gr=bt(xe.value,e.selectedNodeId.value);gr&&(Z.value=gr,S.value=!0)}}function ze(){if(ue.value==="deny"&&e.selectedNodeId.value){const gr=bt(xe.value,e.selectedNodeId.value);gr&&($.value=gr,c.value=!0)}}const ni=async gr=>{try{const fr=await bs.createTransportKey(gr.name,gr.floodPolicy,void 0,gr.parentId,void 0);fr.success?await pt():(console.error("Failed to add transport key:",fr.error),Ne.value=fr.error||"Failed to add transport key")}catch(fr){console.error("Error adding transport key:",fr),Ne.value=fr instanceof Error?fr.message:"Unknown error occurred"}finally{r.value=!1}};function or(){r.value=!1}async function Cr(gr){try{const fr=gr==="allow",Sr=await bs.updateGlobalFloodPolicy(fr);Sr.success?ue.value=gr:(console.error("Failed to update global flood policy:",Sr.error),Ne.value=Sr.error||"Failed to update global flood policy")}catch(fr){console.error("Error updating global flood policy:",fr),Ne.value=fr instanceof Error?fr.message:"Failed to update global flood policy"}}function gi(){c.value=!1,$.value=null}async function Si(gr){try{const fr=await bs.updateTransportKey(gr.id,gr.name,gr.floodPolicy);fr.success?await pt():(console.error("Failed to update transport key:",fr.error),Ne.value=fr.error||"Failed to update transport key")}catch(fr){console.error("Error updating transport key:",fr),Ne.value=fr instanceof Error?fr.message:"Unknown error occurred"}finally{gi()}}function Ci(gr){c.value=!1,$.value=null,Z.value=gr,S.value=!0}function ri(){S.value=!1,Z.value=null}async function on(gr){try{const fr=await bs.deleteTransportKey(gr);fr.success?(await pt(),e.setSelectedNode(null)):(console.error("Failed to delete transport key:",fr.error),Ne.value=fr.error||"Failed to delete transport key")}catch(fr){console.error("Error deleting transport key:",fr),Ne.value=fr instanceof Error?fr.message:"Unknown error occurred"}finally{ri()}}async function yi(gr){try{const fr=await bs.deleteTransportKey(gr.nodeId);fr.success?(await pt(),e.setSelectedNode(null)):(console.error("Failed to delete transport key:",fr.error),Ne.value=fr.error||"Failed to delete transport key")}catch(fr){console.error("Error deleting transport key:",fr),Ne.value=fr instanceof Error?fr.message:"Unknown error occurred"}finally{ri()}}return(gr,fr)=>(jr(),Kr("div",X5e,[Ee("div",J5e,[fr[3]||(fr[3]=Ee("div",null,[Ee("h3",{class:"text-base sm:text-lg font-semibold text-white mb-1 sm:mb-2"},"Regions/Keys"),Ee("p",{class:"text-white/70 text-xs sm:text-sm"},"Manage regional key hierarchy")],-1)),Ee("div",Q5e,[Ee("button",{onClick:Zt,disabled:ue.value==="allow",class:Ga(["flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ue.value==="allow"?"bg-white/5 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"])},fr[2]||(fr[2]=[Ee("svg",{class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),il(" Add ",-1)]),10,e4e),Ee("button",{onClick:ze,disabled:!Po(e).selectedNodeId.value||ue.value==="allow",class:Ga(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Po(e).selectedNodeId.value||ue.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50"])}," Edit ",10,t4e),Ee("button",{onClick:Mr,disabled:!Po(e).selectedNodeId.value||ue.value==="allow",class:Ga(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",!Po(e).selectedNodeId.value||ue.value==="allow"?"bg-white/10 text-white/40 border-white/20 cursor-not-allowed":"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50"])}," Delete ",10,r4e)])]),Ee("div",i4e,[Ee("div",n4e,[fr[4]||(fr[4]=Ee("div",null,[Ee("h4",{class:"text-xs sm:text-sm font-medium text-white mb-1"},"Global Flood Policy (*)"),Ee("p",{class:"text-white/60 text-[10px] sm:text-xs"},"Master control for repeater flooding")],-1)),Ee("div",a4e,[Ee("div",o4e,[Ee("button",{onClick:fr[0]||(fr[0]=Sr=>Cr("deny")),class:Ga(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ue.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-white/60 hover:text-white/80"])}," DENY ",2),Ee("button",{onClick:fr[1]||(fr[1]=Sr=>Cr("allow")),class:Ga(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",ue.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-white/60 hover:text-white/80"])}," ALLOW ",2)])])])]),Ee("div",s4e,[Se.value?(jr(),Kr("div",l4e,fr[5]||(fr[5]=[Ee("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),Ee("span",{class:"ml-2 text-white/70"},"Loading transport keys...",-1)]))):Ne.value?(jr(),Kr("div",u4e,[fr[6]||(fr[6]=Ee("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),Ee("div",c4e,ki(Ne.value),1),Ee("button",{onClick:pt,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):xe.value.length===0?(jr(),Kr("div",h4e,fr[7]||(fr[7]=[Ee("div",{class:"text-white/50 mb-2"},"📝 No transport keys found",-1),Ee("div",{class:"text-white/30 text-sm"},"Add your first transport key to get started",-1)]))):(jr(),Kr("div",f4e,[(jr(!0),Kr(js,null,au(xe.value,Sr=>(jr(),Cd(I3e,{key:Sr.id,node:Sr,"selected-node-id":Po(e).selectedNodeId.value,level:0,disabled:ue.value==="allow",onSelect:Dt},null,8,["node","selected-node-id","disabled"]))),128))]))]),nl(Q3e,{show:r.value,"selected-node-name":wt(),"selected-node-id":Po(e).selectedNodeId.value||void 0,onClose:or,onAdd:ni},null,8,["show","selected-node-name","selected-node-id"]),nl(C5e,{show:c.value,node:$.value,onClose:gi,onSave:Si,onRequestDelete:Ci},null,8,["show","node"]),nl(Y5e,{show:S.value,node:Z.value,"all-nodes":xe.value,onClose:ri,onDeleteAll:on,onMoveChildren:yi},null,8,["show","node","all-nodes"])]))}}),p4e={class:"flex items-center justify-between mb-4"},m4e={class:"text-xl font-semibold text-white"},g4e={class:"mb-6"},v4e={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y4e={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_4e={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},x4e={class:"text-white/80 text-base leading-relaxed"},b4e={class:"flex gap-3"},BH=Bu({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(t,{emit:e}){const r=t,c=e,S=ue=>{ue.target===ue.currentTarget&&c("close")},$={danger:"bg-red-500/20 border-red-500/30 text-red-400",warning:"bg-yellow-500/20 border-yellow-500/30 text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-400"},Z={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(ue,xe)=>r.show?(jr(),Kr("div",{key:0,onClick:S,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:xe[3]||(xe[3]=Xf(()=>{},["stop"]))},[Ee("div",p4e,[Ee("h3",m4e,ki(r.title),1),Ee("button",{onClick:xe[0]||(xe[0]=Se=>c("close")),class:"text-white/60 hover:text-white transition-colors"},xe[4]||(xe[4]=[Ee("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",g4e,[Ee("div",{class:Ga(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="danger"?(jr(),Kr("svg",v4e,xe[5]||(xe[5]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):r.variant==="warning"?(jr(),Kr("svg",y4e,xe[6]||(xe[6]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(jr(),Kr("svg",_4e,xe[7]||(xe[7]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),Ee("p",x4e,ki(r.message),1)]),Ee("div",b4e,[Ee("button",{onClick:xe[1]||(xe[1]=Se=>c("close")),class:"flex-1 px-4 py-3 rounded-xl bg-white/5 hover:bg-white/10 text-white transition-all duration-200 border border-white/10"},ki(r.cancelText),1),Ee("button",{onClick:xe[2]||(xe[2]=Se=>c("confirm")),class:Ga(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",Z[r.variant]])},ki(r.confirmText),3)])])])):Sa("",!0)}}),w4e={class:"space-y-4 sm:space-y-6"},k4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},T4e={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-4"},S4e={class:"flex items-center gap-2 text-red-400"},C4e={key:1,class:"flex items-center justify-center py-12"},A4e={key:2,class:"space-y-3"},M4e={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},E4e={class:"flex-1"},L4e={class:"flex items-center gap-2 sm:gap-3"},P4e={class:"min-w-0 flex-1"},I4e={class:"text-white font-medium text-sm sm:text-base break-all"},D4e={class:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-white/60"},z4e={class:"truncate"},O4e={class:"truncate"},B4e=["onClick","disabled"],R4e={key:3,class:"text-center py-12"},F4e={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},N4e={class:"space-y-4"},j4e={class:"flex justify-end gap-3 mt-6"},U4e=["disabled"],$4e=["disabled"],H4e={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl"},V4e={class:"space-y-4"},W4e={class:"flex gap-2"},q4e=["value"],G4e={class:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4"},Z4e={class:"block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto"},K4e=Bu({name:"APITokens",__name:"APITokens",setup(t){const e=fn([]),r=fn(!1),c=fn(null),S=fn(!1),$=fn(""),Z=fn(null),ue=fn(!1),xe=fn(!1),Se=fn(null),Ne=async()=>{r.value=!0,c.value=null;try{const ni=await bs.get("/auth/tokens"),or=ni.data||ni;e.value=or.tokens||[]}catch(ni){console.error("Failed to fetch API tokens:",ni),c.value=ni instanceof Error?ni.message:"Failed to fetch tokens"}finally{r.value=!1}},it=async()=>{if(!$.value.trim()){c.value="Token name is required";return}r.value=!0,c.value=null;try{const ni=await bs.post("/auth/tokens",{name:$.value.trim()}),or=ni.data||ni;Z.value=or.token||null,S.value=!1,ue.value=!0,$.value="",await Ne()}catch(ni){console.error("Failed to create API token:",ni),c.value=ni instanceof Error?ni.message:"Failed to create token"}finally{r.value=!1}},pt=(ni,or)=>{Se.value={id:ni,name:or},xe.value=!0},bt=async()=>{if(Se.value){r.value=!0,c.value=null;try{await bs.delete(`/auth/tokens/${Se.value.id}`),await Ne(),xe.value=!1,Se.value=null}catch(ni){console.error("Failed to revoke API token:",ni),c.value=ni instanceof Error?ni.message:"Failed to revoke token"}finally{r.value=!1}}},wt=()=>{S.value=!1,$.value="",c.value=null},Dt=()=>{ue.value=!1,Z.value=null},Zt=()=>{Z.value&&navigator.clipboard.writeText(Z.value)},Mr=ni=>ni?new Date(ni*1e3).toLocaleString():"Never",ze=Io(()=>`${window.location.origin}/api/stats`);return Jf(()=>{Ne()}),(ni,or)=>(jr(),Kr(js,null,[Ee("div",w4e,[Ee("div",k4e,[or[5]||(or[5]=Ee("div",null,[Ee("h2",{class:"text-lg sm:text-xl font-semibold text-white"},"API Tokens"),Ee("p",{class:"text-white/70 text-xs sm:text-sm mt-1"},"Manage API tokens for machine-to-machine authentication")],-1)),Ee("button",{onClick:or[0]||(or[0]=Cr=>S.value=!0),class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base"},or[4]||(or[4]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),il(" Create Token ",-1)]))]),or[20]||(or[20]=Dc('

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

',1)),c.value?(jr(),Kr("div",T4e,[Ee("div",S4e,[or[6]||(or[6]=Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),il(" "+ki(c.value),1)])])):Sa("",!0),r.value&&e.value.length===0?(jr(),Kr("div",C4e,or[7]||(or[7]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Ee("div",{class:"text-white/70"},"Loading tokens...")],-1)]))):e.value.length>0?(jr(),Kr("div",A4e,[(jr(!0),Kr(js,null,au(e.value,Cr=>(jr(),Kr("div",{key:Cr.id,class:"bg-white/5 border border-white/10 rounded-lg p-3 sm:p-4 hover:bg-white/10 transition-colors"},[Ee("div",M4e,[Ee("div",E4e,[Ee("div",L4e,[or[8]||(or[8]=Ee("svg",{class:"w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),Ee("div",P4e,[Ee("h3",I4e,ki(Cr.name),1),Ee("div",D4e,[Ee("span",z4e,"Created: "+ki(Mr(Cr.created_at)),1),Ee("span",O4e,"Last used: "+ki(Mr(Cr.last_used)),1)])])])]),Ee("button",{onClick:gi=>pt(Cr.id,Cr.name),disabled:r.value,class:"w-full sm:w-auto px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm"}," Revoke ",8,B4e)])]))),128))])):(jr(),Kr("div",R4e,[or[9]||(or[9]=Ee("svg",{class:"w-16 h-16 text-white/20 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),or[10]||(or[10]=Ee("h3",{class:"text-white font-medium mb-2"},"No API Tokens",-1)),or[11]||(or[11]=Ee("p",{class:"text-white/60 text-sm mb-4"},"Create a token to enable API access",-1)),Ee("button",{onClick:or[1]||(or[1]=Cr=>S.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Create Your First Token ")])),S.value?(jr(),Kr("div",{key:4,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Xf(wt,["self"])},[Ee("div",F4e,[or[14]||(or[14]=Ee("h3",{class:"text-xl font-semibold text-white mb-4"},"Create API Token",-1)),Ee("div",N4e,[Ee("div",null,[or[12]||(or[12]=Ee("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Token Name",-1)),Sl(Ee("input",{"onUpdate:modelValue":or[2]||(or[2]=Cr=>$.value=Cr),type:"text",placeholder:"e.g., Production Server, CI/CD Pipeline",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 focus:outline-none focus:border-primary transition-colors",onKeydown:Tx(it,["enter"])},null,544),[[sc,$.value]]),or[13]||(or[13]=Ee("p",{class:"text-xs text-white/50 mt-1"},"Give your token a descriptive name to identify its purpose",-1))]),Ee("div",j4e,[Ee("button",{onClick:wt,disabled:r.value,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/10 transition-colors disabled:opacity-50"}," Cancel ",8,U4e),Ee("button",{onClick:it,disabled:r.value||!$.value.trim(),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},ki(r.value?"Creating...":"Create Token"),9,$4e)])])])])):Sa("",!0),ue.value&&Z.value?(jr(),Kr("div",{key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Xf(Dt,["self"])},[Ee("div",H4e,[or[19]||(or[19]=Ee("h3",{class:"text-xl font-semibold text-white mb-4"},"Token Created Successfully",-1)),Ee("div",V4e,[or[18]||(or[18]=Dc('
Save this token now! For security reasons, it will not be shown again.
',1)),Ee("div",null,[or[16]||(or[16]=Ee("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Your API Token",-1)),Ee("div",W4e,[Ee("input",{value:Z.value,readonly:"",class:"flex-1 px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white font-mono text-sm"},null,8,q4e),Ee("button",{onClick:Zt,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard"},or[15]||(or[15]=[Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),il(" Copy ",-1)]))])]),Ee("div",G4e,[or[17]||(or[17]=Ee("p",{class:"text-sm text-blue-200 mb-2"},[Ee("strong",null,"Usage Example:")],-1)),Ee("code",Z4e,' curl -H "X-API-Key: '+ki(Z.value)+'" '+ki(ze.value),1)]),Ee("div",{class:"flex justify-end mt-6"},[Ee("button",{onClick:Dt,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Done ")])])])])):Sa("",!0)]),nl(BH,{show:xe.value,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${Se.value?.name}'? This action cannot be undone.`,"confirm-text":"Revoke","cancel-text":"Cancel",variant:"danger",onConfirm:bt,onClose:or[3]||(or[3]=Cr=>xe.value=!1)},null,8,["show","message"])],64))}}),Y4e={class:"space-y-6"},X4e={class:"bg-dark-surface rounded-lg border border-white/10 p-6"},J4e={class:"space-y-4"},Q4e={class:"flex items-center justify-between"},e6e=["disabled"],t6e={class:"bg-dark-surface rounded-lg border border-white/10 p-6"},r6e={class:"space-y-4"},i6e={class:"space-y-3"},n6e=["checked","disabled"],a6e=["checked","disabled"],o6e={class:"flex items-start gap-3"},s6e={key:0,class:"w-5 h-5 text-green-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},l6e={key:1,class:"w-5 h-5 text-accent-blue flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},u6e={class:"flex-1"},c6e={class:"text-sm font-medium text-white"},h6e={key:0,class:"text-xs text-green-400 mt-1"},f6e={key:1,class:"p-4 bg-amber-500/10 border border-amber-500/30 rounded-lg"},d6e={class:"flex items-start justify-between gap-3"},p6e=["disabled"],m6e={key:0,class:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24"},g6e={key:1,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},v6e={class:"flex items-center space-x-2"},y6e={key:0,class:"w-5 h-5 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},_6e={key:1,class:"w-5 h-5 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},x6e=Bu({name:"WebSettings",__name:"WebSettings",setup(t){const e=fn(!1),r=fn(""),c=fn(!1),S=fn(!1),$=fn(!1),Z=fn(!1),ue=fn(!0),xe=m_({cors_enabled:!1,use_default_frontend:!0}),Se=Io(()=>c.value?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30");async function Ne(){try{ue.value=!0;const ze=await bs.get("/check_pymc_console");ze.success&&ze.data&&(Z.value=ze.data.exists,console.log("PyMC Console exists:",Z.value))}catch(ze){console.error("Failed to check PyMC Console:",ze),Z.value=!1}finally{ue.value=!1}}async function it(){try{const ze=await bs.get("/stats");console.log("WebSettings: Full response:",ze);let ni=null;if(ze.success&&ze.data?ni=ze.data:ze&&"version"in ze&&(ni=ze),ni){const or=ni.config?.web||{};console.log("WebSettings: webConfig:",or),xe.cors_enabled=or.cors_enabled===!0,console.log("WebSettings: Set cors_enabled to:",xe.cors_enabled);const Cr=or.web_path;xe.use_default_frontend=!Cr||Cr==="",console.log("WebSettings: Set use_default_frontend to:",xe.use_default_frontend,"from web_path:",Cr)}}catch(ze){console.error("Failed to load web settings:",ze),Zt("Failed to load settings",!1)}}async function pt(){e.value=!0,r.value="";try{const ze={web:{cors_enabled:xe.cors_enabled}};xe.use_default_frontend?ze.web.web_path=null:ze.web.web_path="/opt/pymc_console/web/html";const ni=await bs.post("/update_web_config",ze);ni.success?(Zt("Settings saved successfully",!0),S.value=!0):Zt(ni.error||"Failed to save settings",!1)}catch(ze){console.error("Failed to save web settings:",ze),Zt(ze.message||"Failed to save settings",!1)}finally{e.value=!1}}async function bt(){xe.cors_enabled=!xe.cors_enabled,await pt()}async function wt(){xe.use_default_frontend=!0,await pt()}async function Dt(){xe.use_default_frontend=!1,await pt()}function Zt(ze,ni){r.value=ze,c.value=ni,setTimeout(()=>{r.value=""},5e3)}async function Mr(){$.value=!0,r.value="";try{const ze=await bs.post("/restart_service",{});ze.success?(Zt("Service restart initiated. Page will reload...",!0),S.value=!1,setTimeout(()=>{window.location.reload()},2e3)):Zt(ze.error||"Failed to restart service",!1)}catch(ze){ze.code==="ERR_NETWORK"||ze.message?.includes("Network error")?(Zt("Service restarting... Page will reload",!0),S.value=!1,setTimeout(()=>{window.location.reload()},3e3)):(console.error("Failed to restart service:",ze),Zt(ze.message||"Failed to restart service",!1))}finally{$.value=!1}}return Jf(()=>{it(),Ne()}),(ze,ni)=>(jr(),Kr("div",Y4e,[Ee("div",X4e,[ni[1]||(ni[1]=Ee("div",{class:"flex items-start justify-between mb-4"},[Ee("div",null,[Ee("h3",{class:"text-lg font-semibold text-white mb-1"},"CORS Settings"),Ee("p",{class:"text-sm text-dark-text"},"Control cross-origin resource sharing for API access")])],-1)),Ee("div",J4e,[Ee("div",Q4e,[ni[0]||(ni[0]=Ee("div",null,[Ee("label",{class:"text-sm font-medium text-white"},"Enable CORS"),Ee("p",{class:"text-xs text-dark-text mt-1"},"Allow web frontends from different origins to access the API")],-1)),Ee("button",{onClick:bt,disabled:e.value,class:Ga(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",xe.cors_enabled?"bg-accent-blue border-accent-blue":"bg-gray-600 border-gray-600",e.value?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[Ee("span",{class:Ga(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",xe.cors_enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,e6e)])])]),Ee("div",t6e,[ni[11]||(ni[11]=Ee("div",{class:"flex items-start justify-between mb-4"},[Ee("div",null,[Ee("h3",{class:"text-lg font-semibold text-white mb-1"},"Web Frontend"),Ee("p",{class:"text-sm text-dark-text"},"Choose which web interface to use")])],-1)),Ee("div",r6e,[Ee("div",i6e,[Ee("label",{class:Ga(["flex items-start space-x-3 p-4 bg-dark-bg/30 rounded-lg border-2 cursor-pointer transition-all",xe.use_default_frontend?"border-accent-blue bg-accent-blue/10":"border-white/10 hover:border-accent-blue/50"])},[Ee("input",{type:"radio",name:"frontend",checked:xe.use_default_frontend,onChange:wt,disabled:e.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-dark-bg"},null,40,n6e),ni[2]||(ni[2]=Ee("div",{class:"flex-1"},[Ee("div",{class:"text-sm font-medium text-white"},"Default Frontend"),Ee("div",{class:"text-xs text-dark-text mt-1"},"Built-in pyMC Repeater web interface"),Ee("div",{class:"text-xs text-dark-text/60 mt-1 font-mono"},"Built-in")],-1))],2),Ee("label",{class:Ga(["flex items-start space-x-3 p-4 bg-dark-bg/30 rounded-lg border-2 cursor-pointer transition-all",xe.use_default_frontend?"border-white/10 hover:border-accent-blue/50":"border-accent-blue bg-accent-blue/10"])},[Ee("input",{type:"radio",name:"frontend",checked:!xe.use_default_frontend,onChange:Dt,disabled:e.value,class:"mt-1 h-4 w-4 text-accent-blue focus:ring-accent-blue focus:ring-offset-dark-bg"},null,40,a6e),ni[3]||(ni[3]=Dc('
PyMC Console
@Treehouse⚡
Alternative web interface for pyMC Repeater
/opt/pymc_console/web/html
',1))],2)]),ue.value?Sa("",!0):(jr(),Kr("div",{key:0,class:Ga(["p-4 rounded-lg border",Z.value?"bg-green-500/5 border-green-500/20":"bg-accent-blue/5 border-accent-blue/20"])},[Ee("div",o6e,[Z.value?(jr(),Kr("svg",s6e,ni[4]||(ni[4]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(jr(),Kr("svg",l6e,ni[5]||(ni[5]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))),Ee("div",u6e,[Ee("h4",c6e,ki(Z.value?"PyMC Console has been detected":"PyMC Console Not Installed"),1),Z.value?(jr(),Kr("p",h6e,ni[6]||(ni[6]=[il(" PyMC Console is installed at ",-1),Ee("code",{class:"text-green-300"},"/opt/pymc_console/web/html",-1)]))):(jr(),Kr(js,{key:1},[ni[7]||(ni[7]=Dc('

PyMC Console must be installed at /opt/pymc_console/web/html before selecting this option.

PyMC Console Install Instructions ',2))],64))])])],2)),S.value?(jr(),Kr("div",f6e,[Ee("div",d6e,[ni[10]||(ni[10]=Dc('

Service restart required

Web frontend changes will take effect after restarting the pymc-repeater service.

',1)),Ee("button",{onClick:Mr,disabled:$.value,class:"px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-500/50 text-white font-medium rounded-lg transition-colors disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap"},[$.value?(jr(),Kr("svg",m6e,ni[8]||(ni[8]=[Ee("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),Ee("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(jr(),Kr("svg",g6e,ni[9]||(ni[9]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]))),il(" "+ki($.value?"Restarting...":"Restart Now"),1)],8,p6e)])])):Sa("",!0)])]),r.value?(jr(),Kr("div",{key:0,class:Ga(["p-4 rounded-lg border",Se.value])},[Ee("div",v6e,[c.value?(jr(),Kr("svg",y6e,ni[12]||(ni[12]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):(jr(),Kr("svg",_6e,ni[13]||(ni[13]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))),Ee("span",{class:Ga(c.value?"text-green-400":"text-red-400")},ki(r.value),3)])],2)):Sa("",!0)]))}}),b6e={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},w6e={class:"glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-primary/30 bg-primary/10"},k6e={class:"text-primary text-sm sm:text-base"},T6e={class:"mt-1 sm:mt-2 text-primary/80"},S6e={class:"glass-card rounded-[15px] p-3 sm:p-6"},C6e={class:"flex overflow-x-auto border-b border-white/10 mb-4 sm:mb-6 -mx-3 px-3 sm:mx-0 sm:px-0 scrollbar-hide"},A6e=["onClick"],M6e={class:"flex items-center gap-1 sm:gap-2"},E6e={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},L6e={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},P6e={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},I6e={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},D6e={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},z6e={key:5,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},O6e={key:6,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B6e={class:"min-h-[400px]"},R6e={key:0,class:"flex items-center justify-center py-12"},F6e={key:1,class:"flex items-center justify-center py-12"},N6e={class:"text-center"},j6e={class:"text-white/60 text-sm mb-4"},U6e={key:2},$6e=Bu({name:"ConfigurationView",__name:"Configuration",setup(t){const e=Ym(),r=fn(D1("configuration_activeTab","radio")),c=fn(!1);Af(r,Z=>z1("configuration_activeTab",Z));const S=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"},{id:"api-tokens",label:"API Tokens",icon:"tokens"},{id:"web",label:"Web Options",icon:"web"}];Jf(async()=>{try{await e.fetchStats(),c.value=!0}catch(Z){console.error("Failed to load configuration data:",Z),c.value=!0}});function $(Z){r.value=Z}return(Z,ue)=>{const xe=b8("router-link");return jr(),Kr("div",b6e,[ue[13]||(ue[13]=Ee("div",null,[Ee("h1",{class:"text-xl sm:text-2xl font-bold text-white"},"Configuration"),Ee("p",{class:"text-white/70 mt-1 sm:mt-2 text-sm sm:text-base"},"System configuration and settings")],-1)),Ee("div",w6e,[Ee("div",k6e,[ue[3]||(ue[3]=Ee("strong",null,"CAD Calibration Tool Available",-1)),Ee("p",T6e,[ue[2]||(ue[2]=il(" Optimize your Channel Activity Detection settings. ",-1)),nl(xe,{to:"/cad-calibration",class:"underline hover:text-primary transition-colors"},{default:$1(()=>ue[1]||(ue[1]=[il(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[1]})])])]),Ee("div",S6e,[Ee("div",C6e,[(jr(),Kr(js,null,au(S,Se=>Ee("button",{key:Se.id,onClick:Ne=>$(Se.id),class:Ga(["px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0",r.value===Se.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Ee("div",M6e,[Se.icon==="radio"?(jr(),Kr("svg",E6e,ue[4]||(ue[4]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):Se.icon==="repeater"?(jr(),Kr("svg",L6e,ue[5]||(ue[5]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):Se.icon==="duty"?(jr(),Kr("svg",P6e,ue[6]||(ue[6]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):Se.icon==="delays"?(jr(),Kr("svg",I6e,ue[7]||(ue[7]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):Se.icon==="keys"?(jr(),Kr("svg",D6e,ue[8]||(ue[8]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):Se.icon==="tokens"?(jr(),Kr("svg",z6e,ue[9]||(ue[9]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)]))):Se.icon==="web"?(jr(),Kr("svg",O6e,ue[10]||(ue[10]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)]))):Sa("",!0),il(" "+ki(Se.label),1)])],10,A6e)),64))]),Ee("div",B6e,[!c.value&&Po(e).isLoading?(jr(),Kr("div",R6e,ue[11]||(ue[11]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Ee("div",{class:"text-white/70"},"Loading configuration...")],-1)]))):Po(e).error&&!c.value?(jr(),Kr("div",F6e,[Ee("div",N6e,[ue[12]||(ue[12]=Ee("div",{class:"text-red-400 mb-2"},"Failed to load configuration",-1)),Ee("div",j6e,ki(Po(e).error),1),Ee("button",{onClick:ue[0]||(ue[0]=Se=>Po(e).fetchStats()),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):(jr(),Kr("div",U6e,[Sl(Ee("div",null,[nl(lwe,{key:"radio-settings"})],512),[[qy,r.value==="radio"]]),Sl(Ee("div",null,[nl(Uwe,{key:"repeater-settings"})],512),[[qy,r.value==="repeater"]]),Sl(Ee("div",null,[nl(Qwe,{key:"duty-cycle"})],512),[[qy,r.value==="duty"]]),Sl(Ee("div",null,[nl(d3e,{key:"transmission-delays"})],512),[[qy,r.value==="delays"]]),Sl(Ee("div",null,[nl(d4e,{key:"transport-keys"})],512),[[qy,r.value==="transport"]]),Sl(Ee("div",null,[nl(K4e,{key:"api-tokens"})],512),[[qy,r.value==="api-tokens"]]),Sl(Ee("div",null,[nl(x6e,{key:"web-settings"})],512),[[qy,r.value==="web"]])]))])])])}}}),H6e={class:"p-6 space-y-6"},V6e={class:"glass-card rounded-[15px] p-6"},W6e={class:"flex justify-center"},q6e={class:"flex gap-4"},G6e=["disabled"],Z6e=["disabled"],K6e={class:"glass-card rounded-[15px] p-6 space-y-4"},Y6e={class:"text-white"},X6e={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},J6e={class:"text-primary/90"},Q6e={class:"space-y-2"},eke={class:"w-full bg-white/10 rounded-full h-2"},tke={class:"text-white/70 text-sm"},rke={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},ike={class:"glass-card rounded-[15px] p-4 text-center"},nke={class:"text-2xl font-bold text-primary"},ake={class:"glass-card rounded-[15px] p-4 text-center"},oke={class:"text-2xl font-bold text-primary"},ske={class:"glass-card rounded-[15px] p-4 text-center"},lke={class:"text-2xl font-bold text-primary"},uke={class:"glass-card rounded-[15px] p-4 text-center"},cke={class:"text-2xl font-bold text-primary"},hke={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},fke={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},dke={class:"text-white/80 mb-4"},pke={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},mke=Bu({name:"CADCalibrationView",__name:"CADCalibration",setup(t){const e=Ym(),r=fn(!1),c=fn(null),S=fn(null),$=fn({}),Z=fn(null),ue=fn([]),xe=fn({}),Se=fn("Ready to start calibration"),Ne=fn(0),it=fn(0),pt=fn(0),bt=fn(0),wt=fn(0),Dt=fn(0),Zt=fn(null),Mr=fn(!1),ze=fn(!1),ni=fn(!1),or=fn(!1);let Cr=null;const gi={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function Si(){const Jr=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:"#ffffff",size:14}},tickfont:{color:"#ffffff"},bgcolor:"rgba(0,0,0,0)",bordercolor:"rgba(255,255,255,0.2)",borderwidth:1,thickness:15},line:{color:"rgba(255,255,255,0.2)",width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],ti={title:{text:'CAD Detection Rate
Channel Activity Detection Calibration',font:{color:"#ffffff",size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},yaxis:{title:{text:"CAD Min Threshold",font:{color:"#cbd5e1",size:14}},tickfont:{color:"#cbd5e1"},gridcolor:"rgba(148, 163, 184, 0.1)",zerolinecolor:"rgba(148, 163, 184, 0.2)",linecolor:"rgba(148, 163, 184, 0.3)"},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:"#ffffff",family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};I1.newPlot("plotly-chart",Jr,ti,gi)}function Ci(){if(Object.keys($.value).length===0)return;const Jr=Object.values($.value),ti=[],Di=[],En=[];for(const ga of Jr)ti.push(ga.det_peak),Di.push(ga.det_min),En.push(ga.detection_rate);const Zn={x:[ti],y:[Di],"marker.color":[En],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};I1.restyle("plotly-chart",Zn,[0])}async function ri(){try{const Di=await bs.post("/cad-calibration-start",{samples:10,delay_ms:50});if(Di.success)r.value=!0,c.value=Date.now(),e.setCadCalibrationRunning(!0),$.value={},ue.value=[],xe.value={},Z.value=null,Mr.value=!1,ze.value=!1,ni.value=!1,or.value=!1,pt.value=0,bt.value=0,wt.value=0,Dt.value=0,Ne.value=0,it.value=0,Cr=setInterval(()=>{c.value&&(Dt.value=Math.floor((Date.now()-c.value)/1e3))},1e3),yi();else throw new Error(Di.error||"Failed to start calibration")}catch(Di){Se.value=`Error: ${Di instanceof Error?Di.message:"Unknown error"}`}}async function on(){try{(await bs.post("/cad-calibration-stop")).success&&(r.value=!1,e.setCadCalibrationRunning(!1),S.value&&(S.value.close(),S.value=null),Cr&&(clearInterval(Cr),Cr=null))}catch(Jr){console.error("Failed to stop calibration:",Jr)}}function yi(){S.value&&S.value.close(),S.value=new EventSource(`${yL}/api/cad-calibration-stream`),S.value.onmessage=function(Jr){try{const ti=JSON.parse(Jr.data);gr(ti)}catch(ti){console.error("Failed to parse SSE data:",ti)}},S.value.onerror=function(Jr){console.error("SSE connection error:",Jr),r.value||S.value&&(S.value.close(),S.value=null)}}function gr(Jr){switch(Jr.type){case"status":Se.value=Jr.message||"Status update",Jr.test_ranges&&(Zt.value=Jr.test_ranges,Mr.value=!0);break;case"progress":Ne.value=Jr.current||0,it.value=Jr.total||0,pt.value=Jr.current||0;break;case"result":if(Jr.det_peak!==void 0&&Jr.det_min!==void 0&&Jr.detection_rate!==void 0&&Jr.detections!==void 0&&Jr.samples!==void 0){const ti=`${Jr.det_peak}_${Jr.det_min}`;$.value[ti]={det_peak:Jr.det_peak,det_min:Jr.det_min,detection_rate:Jr.detection_rate,detections:Jr.detections,samples:Jr.samples},Ci(),fr()}break;case"complete":case"completed":r.value=!1,Se.value=Jr.message||"Calibration completed",e.setCadCalibrationRunning(!1),Sr(),S.value&&(S.value.close(),S.value=null),Cr&&(clearInterval(Cr),Cr=null);break;case"error":Se.value=`Error: ${Jr.message}`,e.setCadCalibrationRunning(!1),on();break}}function fr(){const Jr=Object.values($.value).map(ti=>ti.detection_rate);Jr.length!==0&&(bt.value=Math.max(...Jr),wt.value=Jr.reduce((ti,Di)=>ti+Di,0)/Jr.length)}function Sr(){ze.value=!0;let Jr=null,ti=0;for(const Di of Object.values($.value))Di.detection_rate>ti&&(ti=Di.detection_rate,Jr=Di);Z.value=Jr,Jr&&ti>0?(ni.value=!0,or.value=!1):(ni.value=!1,or.value=!0)}async function ei(){if(!Z.value){Se.value="Error: No calibration results to save";return}try{const Jr=await bs.post("/save_cad_settings",{peak:Z.value.det_peak,min_val:Z.value.det_min,detection_rate:Z.value.detection_rate});if(Jr.success)Se.value=`Settings saved! Peak=${Z.value.det_peak}, Min=${Z.value.det_min} applied to configuration.`;else throw new Error(Jr.error||"Failed to save settings")}catch(Jr){Se.value=`Error: Failed to save settings: ${Jr instanceof Error?Jr.message:"Unknown error"}`}}return Jf(()=>{Si()}),Iv(()=>{S.value&&S.value.close(),Cr&&clearInterval(Cr),e.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&I1.purge("plotly-chart")}),(Jr,ti)=>(jr(),Kr("div",H6e,[ti[14]||(ti[14]=Ee("div",null,[Ee("h1",{class:"text-2xl font-bold text-white"},"CAD Calibration Tool"),Ee("p",{class:"text-white/70 mt-2"},"Channel Activity Detection calibration")],-1)),Ee("div",V6e,[Ee("div",W6e,[Ee("div",q6e,[Ee("button",{onClick:ri,disabled:r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},ti[0]||(ti[0]=[Dc('
Start Calibration
Begin testing
',2)]),8,G6e),Ee("button",{onClick:on,disabled:!r.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},ti[1]||(ti[1]=[Dc('
Stop
Halt calibration
',2)]),8,Z6e)])])]),Ee("div",K6e,[Ee("div",Y6e,ki(Se.value),1),Mr.value&&Zt.value?(jr(),Kr("div",X6e,[Ee("div",J6e,[ti[2]||(ti[2]=Ee("strong",null,"Configuration:",-1)),il(" SF"+ki(Zt.value.spreading_factor)+" | Peak: "+ki(Zt.value.peak_min)+" - "+ki(Zt.value.peak_max)+" | Min: "+ki(Zt.value.min_min)+" - "+ki(Zt.value.min_max)+" | "+ki((Zt.value.peak_max-Zt.value.peak_min+1)*(Zt.value.min_max-Zt.value.min_min+1))+" tests ",1)])])):Sa("",!0),Ee("div",Q6e,[Ee("div",eke,[Ee("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:om({width:it.value>0?`${Ne.value/it.value*100}%`:"0%"})},null,4)]),Ee("div",tke,ki(Ne.value)+" / "+ki(it.value)+" tests completed",1)])]),Ee("div",rke,[Ee("div",ike,[Ee("div",nke,ki(pt.value),1),ti[3]||(ti[3]=Ee("div",{class:"text-white/70 text-sm"},"Tests Completed",-1))]),Ee("div",ake,[Ee("div",oke,ki(bt.value.toFixed(1))+"%",1),ti[4]||(ti[4]=Ee("div",{class:"text-white/70 text-sm"},"Best Detection Rate",-1))]),Ee("div",ske,[Ee("div",lke,ki(wt.value.toFixed(1))+"%",1),ti[5]||(ti[5]=Ee("div",{class:"text-white/70 text-sm"},"Average Rate",-1))]),Ee("div",uke,[Ee("div",cke,ki(Dt.value)+"s",1),ti[6]||(ti[6]=Ee("div",{class:"text-white/70 text-sm"},"Elapsed Time",-1))])]),ti[15]||(ti[15]=Ee("div",{class:"glass-card rounded-[15px] p-6"},[Ee("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),ze.value?(jr(),Kr("div",hke,[ti[13]||(ti[13]=Ee("h3",{class:"text-xl font-bold text-white"},"Calibration Results",-1)),ni.value&&Z.value?(jr(),Kr("div",fke,[ti[11]||(ti[11]=Ee("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),Ee("p",dke,[ti[7]||(ti[7]=il(" Peak: ",-1)),Ee("strong",null,ki(Z.value.det_peak),1),ti[8]||(ti[8]=il(", Min: ",-1)),Ee("strong",null,ki(Z.value.det_min),1),ti[9]||(ti[9]=il(", Rate: ",-1)),Ee("strong",null,ki(Z.value.detection_rate.toFixed(1))+"%",1)]),Ee("div",{class:"flex justify-center"},[Ee("button",{onClick:ei,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},ti[10]||(ti[10]=[Dc('
Save Settings
Apply to configuration
',2)]))])])):Sa("",!0),or.value?(jr(),Kr("div",pke,ti[12]||(ti[12]=[Ee("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),Ee("p",{class:"text-white/70"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):Sa("",!0)])):Sa("",!0)]))}}),gke=kh(mke,[["__scopeId","data-v-854f5f55"]]),vke={class:"p-6 space-y-6"},yke={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},_ke={class:"glass-card rounded-[15px] p-4"},xke={class:"text-2xl font-bold text-white"},bke={class:"glass-card rounded-[15px] p-4"},wke={class:"text-2xl font-bold text-primary"},kke={class:"glass-card rounded-[15px] p-4"},Tke={class:"text-2xl font-bold text-accent-green"},Ske={class:"glass-card rounded-[15px] p-4"},Cke={class:"text-2xl font-bold text-secondary"},Ake={class:"glass-card rounded-[15px] p-6"},Mke={class:"flex flex-wrap border-b border-white/10 mb-6"},Eke=["onClick"],Lke={class:"flex items-center gap-2"},Pke={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ike={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Dke={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},zke={class:"min-h-[400px]"},Oke={key:0,class:"flex items-center justify-center py-12"},Bke={key:1,class:"flex items-center justify-center py-12"},Rke={class:"text-center"},Fke={class:"text-white/60 text-sm mb-4"},Nke={key:2,class:"space-y-4"},jke={key:0,class:"text-center py-12 text-white/60"},Uke={key:1,class:"space-y-4"},$ke={class:"flex items-start justify-between"},Hke={class:"flex-1"},Vke={class:"flex items-center gap-3 mb-2"},Wke={class:"text-lg font-semibold text-white"},qke={class:"text-white/50 text-sm"},Gke={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},Zke={class:"text-white font-medium"},Kke={class:"text-primary font-medium"},Yke={class:"mt-3 flex items-center gap-2"},Xke={key:3,class:"space-y-4"},Jke={key:0,class:"text-center py-12 text-white/60"},Qke={key:1,class:"overflow-x-auto"},eTe={class:"w-full"},tTe={class:"py-3"},rTe={class:"font-mono text-sm text-white"},iTe={class:"py-3"},nTe={class:"font-mono text-xs text-white/70"},aTe={class:"py-3"},oTe={class:"text-sm text-white"},sTe={class:"text-xs text-white/50"},lTe={class:"py-3"},uTe={class:"py-3"},cTe={class:"text-sm text-white/70"},hTe={class:"py-3"},fTe=["onClick"],dTe={key:4,class:"space-y-4"},pTe={class:"mb-4"},mTe=["value"],gTe={key:0,class:"text-center py-12 text-white/60"},vTe={key:1,class:"grid grid-cols-1 gap-4"},yTe={class:"flex items-start justify-between"},_Te={class:"flex-1"},xTe={class:"flex items-center gap-3 mb-3"},bTe={class:"text-white font-mono text-sm"},wTe={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},kTe={class:"text-white/90 font-mono ml-2"},TTe={class:"text-white/90 ml-2"},STe={class:"text-white/90 ml-2"},CTe={class:"text-white/90 ml-2"},ATe=["onClick"],MTe={class:"flex justify-end"},ETe=["disabled"],LTe=Bu({name:"SessionsView",__name:"Sessions",setup(t){const e=fn("overview"),r=fn(!1),c=fn(!1),S=fn(null),$=fn(null),Z=fn([]),ue=fn(null),xe=fn(null),Se=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];Jf(async()=>{await Ne(),r.value=!0});async function Ne(){c.value=!0,S.value=null;try{const Zt=await bs.getACLInfo();Zt.success&&($.value=Zt.data);const Mr=await bs.getACLClients();Mr.success&&Mr.data&&(Z.value=Mr.data.clients||[]);const ze=await bs.getACLStats();ze.success&&(ue.value=ze.data)}catch(Zt){S.value=Zt instanceof Error?Zt.message:"Failed to load ACL data",console.error("Error fetching ACL data:",Zt)}finally{c.value=!1}}async function it(Zt,Mr){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const ze=await bs.removeACLClient({public_key:Zt,identity_hash:Mr});ze.success?await Ne():alert(`Failed to remove client: ${ze.error}`)}catch(ze){alert(`Error removing client: ${ze}`)}}function pt(Zt){return Zt?new Date(Zt*1e3).toLocaleString():"Never"}function bt(Zt){e.value=Zt}const wt=Io(()=>xe.value?Z.value.filter(Zt=>Zt.identity_name===xe.value):Z.value),Dt=Io(()=>$.value?$.value.acls||[]:[]);return(Zt,Mr)=>(jr(),Kr("div",vke,[Mr[22]||(Mr[22]=Ee("div",null,[Ee("h1",{class:"text-2xl font-bold text-white"},"Sessions & Access Control"),Ee("p",{class:"text-white/70 mt-2"},"Manage authenticated clients and access control lists")],-1)),ue.value?(jr(),Kr("div",yke,[Ee("div",_ke,[Mr[1]||(Mr[1]=Ee("div",{class:"text-white/70 text-sm mb-1"},"Total Identities",-1)),Ee("div",xke,ki(ue.value.total_identities),1)]),Ee("div",bke,[Mr[2]||(Mr[2]=Ee("div",{class:"text-white/70 text-sm mb-1"},"Authenticated Clients",-1)),Ee("div",wke,ki(ue.value.total_clients),1)]),Ee("div",kke,[Mr[3]||(Mr[3]=Ee("div",{class:"text-white/70 text-sm mb-1"},"Admin Clients",-1)),Ee("div",Tke,ki(ue.value.admin_clients),1)]),Ee("div",Ske,[Mr[4]||(Mr[4]=Ee("div",{class:"text-white/70 text-sm mb-1"},"Guest Clients",-1)),Ee("div",Cke,ki(ue.value.guest_clients),1)])])):Sa("",!0),Ee("div",Ake,[Ee("div",Mke,[(jr(),Kr(js,null,au(Se,ze=>Ee("button",{key:ze.id,onClick:ni=>bt(ze.id),class:Ga(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",e.value===ze.id?"text-primary border-primary":"text-white/70 border-transparent hover:text-white hover:border-white/30"])},[Ee("div",Lke,[ze.icon==="overview"?(jr(),Kr("svg",Pke,Mr[5]||(Mr[5]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):ze.icon==="clients"?(jr(),Kr("svg",Ike,Mr[6]||(Mr[6]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):ze.icon==="identities"?(jr(),Kr("svg",Dke,Mr[7]||(Mr[7]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):Sa("",!0),il(" "+ki(ze.label),1)])],10,Eke)),64))]),Ee("div",zke,[c.value&&!r.value?(jr(),Kr("div",Oke,Mr[8]||(Mr[8]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Ee("div",{class:"text-white/70"},"Loading ACL data...")],-1)]))):S.value?(jr(),Kr("div",Bke,[Ee("div",Rke,[Mr[9]||(Mr[9]=Ee("div",{class:"text-red-400 mb-2"},"Failed to load ACL data",-1)),Ee("div",Fke,ki(S.value),1),Ee("button",{onClick:Ne,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):e.value==="overview"?(jr(),Kr("div",Nke,[Dt.value.length===0?(jr(),Kr("div",jke," No identities configured ")):(jr(),Kr("div",Uke,[(jr(!0),Kr(js,null,au(Dt.value,ze=>(jr(),Kr("div",{key:ze.hash,class:"glass-card rounded-[10px] p-4 border border-white/10 hover:border-primary/30 transition-colors"},[Ee("div",$ke,[Ee("div",Hke,[Ee("div",Vke,[Ee("h3",Wke,ki(ze.name),1),Ee("span",{class:Ga(["px-2 py-1 text-xs font-medium rounded",ze.type==="repeater"?"bg-primary/20 text-primary":"bg-secondary/20 text-secondary"])},ki(ze.type),3),Ee("span",qke,ki(ze.hash),1)]),Ee("div",Gke,[Ee("div",null,[Mr[10]||(Mr[10]=Ee("div",{class:"text-white/50 text-xs mb-1"},"Max Clients",-1)),Ee("div",Zke,ki(ze.max_clients),1)]),Ee("div",null,[Mr[11]||(Mr[11]=Ee("div",{class:"text-white/50 text-xs mb-1"},"Authenticated",-1)),Ee("div",Kke,ki(ze.authenticated_clients),1)]),Ee("div",null,[Mr[12]||(Mr[12]=Ee("div",{class:"text-white/50 text-xs mb-1"},"Admin Password",-1)),Ee("div",{class:Ga(ze.has_admin_password?"text-accent-green":"text-accent-red")},ki(ze.has_admin_password?"✓ Set":"✗ Not Set"),3)]),Ee("div",null,[Mr[13]||(Mr[13]=Ee("div",{class:"text-white/50 text-xs mb-1"},"Guest Password",-1)),Ee("div",{class:Ga(ze.has_guest_password?"text-accent-green":"text-accent-red")},ki(ze.has_guest_password?"✓ Set":"✗ Not Set"),3)])]),Ee("div",Yke,[Mr[14]||(Mr[14]=Ee("span",{class:"text-white/50 text-xs"},"Read-Only Access:",-1)),Ee("span",{class:Ga(ze.allow_read_only?"text-accent-green":"text-accent-red")},ki(ze.allow_read_only?"Allowed":"Disabled"),3)])])])]))),128))]))])):e.value==="clients"?(jr(),Kr("div",Xke,[Z.value.length===0?(jr(),Kr("div",Jke," No authenticated clients ")):(jr(),Kr("div",Qke,[Ee("table",eTe,[Mr[15]||(Mr[15]=Ee("thead",null,[Ee("tr",{class:"border-b border-white/10"},[Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Client"),Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Address"),Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Identity"),Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Permissions"),Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Last Activity"),Ee("th",{class:"text-left text-white/70 text-sm font-medium pb-3"},"Actions")])],-1)),Ee("tbody",null,[(jr(!0),Kr(js,null,au(Z.value,ze=>(jr(),Kr("tr",{key:ze.public_key_full,class:"border-b border-white/5 hover:bg-white/5 transition-colors"},[Ee("td",tTe,[Ee("div",rTe,ki(ze.public_key),1)]),Ee("td",iTe,[Ee("div",nTe,ki(ze.address),1)]),Ee("td",aTe,[Ee("div",oTe,ki(ze.identity_name),1),Ee("div",sTe,ki(ze.identity_hash),1)]),Ee("td",lTe,[Ee("span",{class:Ga(["px-2 py-1 text-xs font-medium rounded",ze.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},ki(ze.permissions),3)]),Ee("td",uTe,[Ee("div",cTe,ki(pt(ze.last_activity)),1)]),Ee("td",hTe,[Ee("button",{onClick:ni=>it(ze.public_key_full,ze.identity_hash),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Remove ",8,fTe)])]))),128))])])]))])):e.value==="identities"?(jr(),Kr("div",dTe,[Ee("div",pTe,[Mr[17]||(Mr[17]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Filter by Identity",-1)),Sl(Ee("select",{"onUpdate:modelValue":Mr[0]||(Mr[0]=ze=>xe.value=ze),class:"bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},[Mr[16]||(Mr[16]=Ee("option",{value:null},"All Identities",-1)),(jr(!0),Kr(js,null,au(Dt.value,ze=>(jr(),Kr("option",{key:ze.name,value:ze.name},ki(ze.name)+" ("+ki(ze.authenticated_clients)+" clients) ",9,mTe))),128))],512),[[xg,xe.value]])]),wt.value.length===0?(jr(),Kr("div",gTe," No clients for selected identity ")):(jr(),Kr("div",vTe,[(jr(!0),Kr(js,null,au(wt.value,ze=>(jr(),Kr("div",{key:ze.public_key_full,class:"glass-card rounded-[10px] p-4 border border-white/10"},[Ee("div",yTe,[Ee("div",_Te,[Ee("div",xTe,[Ee("span",{class:Ga(["px-2 py-1 text-xs font-medium rounded",ze.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},ki(ze.permissions),3),Ee("span",bTe,ki(ze.public_key),1)]),Ee("div",wTe,[Ee("div",null,[Mr[18]||(Mr[18]=Ee("span",{class:"text-white/50"},"Address:",-1)),Ee("span",kTe,ki(ze.address),1)]),Ee("div",null,[Mr[19]||(Mr[19]=Ee("span",{class:"text-white/50"},"Identity:",-1)),Ee("span",TTe,ki(ze.identity_name)+" ("+ki(ze.identity_hash)+")",1)]),Ee("div",null,[Mr[20]||(Mr[20]=Ee("span",{class:"text-white/50"},"Last Activity:",-1)),Ee("span",STe,ki(pt(ze.last_activity)),1)]),Ee("div",null,[Mr[21]||(Mr[21]=Ee("span",{class:"text-white/50"},"Last Login:",-1)),Ee("span",CTe,ki(pt(ze.last_login_success)),1)])])]),Ee("button",{onClick:ni=>it(ze.public_key_full,ze.identity_hash),class:"ml-4 px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Remove ",8,ATe)])]))),128))]))])):Sa("",!0)])]),Ee("div",MTe,[Ee("button",{onClick:Ne,disabled:c.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},ki(c.value?"Refreshing...":"Refresh Data"),9,ETe)])]))}}),PTe={class:"mb-6"},ITe={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},DTe={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},zTe={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},OTe={class:"text-white/80 text-base leading-relaxed"},BTe={class:"flex"},RTe=Bu({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(t,{emit:e}){const r=t,c=e,S=ue=>{ue.target===ue.currentTarget&&c("close")},$={success:"bg-green-500/20 border-green-500/30 text-green-400",error:"bg-red-500/20 border-red-500/30 text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-400"},Z={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(ue,xe)=>r.show?(jr(),Kr("div",{key:0,onClick:S,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[Ee("div",{class:"glass-card rounded-[20px] p-6 w-full max-w-md border border-white/10",onClick:xe[1]||(xe[1]=Xf(()=>{},["stop"]))},[Ee("div",PTe,[Ee("div",{class:Ga(["inline-flex p-3 rounded-xl mb-4",$[r.variant]])},[r.variant==="success"?(jr(),Kr("svg",ITe,xe[2]||(xe[2]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):r.variant==="error"?(jr(),Kr("svg",DTe,xe[3]||(xe[3]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(jr(),Kr("svg",zTe,xe[4]||(xe[4]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),Ee("p",OTe,ki(r.message),1)]),Ee("div",BTe,[Ee("button",{onClick:xe[0]||(xe[0]=Se=>c("close")),class:Ga(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",Z[r.variant]])}," OK ",2)])])])):Sa("",!0)}}),FTe={class:"p-6 space-y-6"},NTe={class:"relative overflow-hidden rounded-[20px] p-6 mb-6"},jTe={class:"relative flex items-center justify-between"},UTe={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},$Te={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},HTe={class:"relative flex items-center justify-between"},VTe={class:"text-3xl font-bold text-white mb-1"},WTe={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},qTe={class:"relative flex items-center justify-between"},GTe={class:"text-3xl font-bold text-primary mb-1"},ZTe={class:"group relative overflow-hidden glass-card rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},KTe={class:"relative flex items-center justify-between"},YTe={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},XTe={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},JTe={class:"glass-card rounded-[15px] p-6"},QTe={key:0,class:"flex items-center justify-center py-12"},e8e={key:1,class:"flex items-center justify-center py-12"},t8e={class:"text-center"},r8e={class:"text-white/60 text-sm mb-4"},i8e={key:2,class:"space-y-4"},n8e={class:"relative flex items-start justify-between"},a8e={class:"flex-1"},o8e={class:"flex items-center gap-3 mb-4"},s8e={class:"relative"},l8e={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},u8e={class:"text-xl font-bold text-white group-hover:text-primary transition-colors"},c8e={key:0,class:"text-white/50 text-sm"},h8e={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},f8e={class:"text-white/90 ml-2"},d8e={class:"flex items-center gap-2"},p8e={key:0,class:"text-white/90 font-mono ml-2 text-xs"},m8e={key:1,class:"text-white/50 ml-2 text-xs"},g8e=["onClick"],v8e={class:"text-white/90 ml-2"},y8e={key:0},_8e={class:"text-white/90 ml-2"},x8e={key:0,class:"text-accent-green"},b8e={key:1,class:"text-white/50"},w8e={key:2,class:"text-primary"},k8e={key:0,class:"text-xs text-white/50 font-mono"},T8e={class:"ml-4 flex flex-wrap gap-2"},S8e=["onClick","disabled","title"],C8e=["onClick","disabled","title"],A8e=["onClick"],M8e=["onClick"],E8e={key:3,class:"text-center py-12 text-white/60"},L8e={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},P8e={class:"glass-card rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},I8e={class:"space-y-4"},D8e={class:"block text-white/70 text-sm mb-2"},z8e={key:0},O8e={key:1,class:"text-white/50 text-sm"},B8e={class:"grid grid-cols-2 gap-4"},R8e={class:"grid grid-cols-2 gap-4"},F8e={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},N8e={class:"glass-card rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},j8e={class:"space-y-4"},U8e=["value"],$8e={class:"block text-white/70 text-sm mb-2"},H8e={key:0},V8e={key:1,class:"text-white/50 text-sm"},W8e={class:"grid grid-cols-2 gap-4"},q8e={class:"grid grid-cols-2 gap-4"},G8e={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},Z8e={class:"glass-card rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl border border-white/20"},K8e={class:"relative overflow-hidden rounded-[15px] mb-6 p-5"},Y8e={class:"relative flex items-center justify-between"},X8e={class:"flex items-center gap-4"},J8e={class:"text-white/60 text-sm flex items-center gap-2"},Q8e={class:"text-primary font-semibold"},eSe={class:"flex items-center gap-2"},tSe={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},rSe={class:"flex-1 overflow-y-auto mb-4 space-y-3"},iSe={key:0,class:"flex items-center justify-center py-12"},nSe={key:1,class:"flex items-center justify-center py-12"},aSe={class:"text-center"},oSe={class:"text-white/60 text-sm mb-4"},sSe={key:2,class:"space-y-3"},lSe={class:"relative flex items-start justify-between gap-3"},uSe={class:"flex-1 min-w-0"},cSe={class:"flex items-center gap-2 mb-3"},hSe={class:"flex items-center gap-2 flex-wrap"},fSe={key:0,class:"text-primary text-sm font-bold"},dSe={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},pSe={key:2,class:"text-white/40 text-xs"},mSe={class:"text-white/50 text-xs flex items-center gap-1"},gSe={key:3,class:"text-white/30 text-[10px] font-mono bg-white/5 px-1.5 py-0.5 rounded"},vSe={class:"text-white/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-white/5 p-3 rounded-[10px] border border-white/5"},ySe=["onClick"],_Se={key:0,class:"text-center pt-4"},xSe={key:1,class:"text-center pt-4"},bSe={key:3,class:"flex items-center justify-center h-full"},wSe={class:"relative overflow-hidden rounded-[15px] border-t border-white/20 pt-4 mt-4"},kSe={class:"relative space-y-3"},TSe={class:"flex gap-3"},SSe={class:"flex-1 relative"},CSe=["onKeydown"],ASe=["disabled"],MSe={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},ESe={class:"glass-card rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},LSe={class:"flex items-center justify-between mb-4 pb-4 border-b border-white/10"},PSe={class:"text-white/70 text-sm mt-1"},ISe={class:"text-primary"},DSe={class:"flex-1 overflow-y-auto space-y-3"},zSe={key:0,class:"text-center py-12"},OSe={class:"space-y-2"},BSe={class:"flex items-center justify-between"},RSe={class:"flex items-center gap-2"},FSe={class:"text-white font-semibold"},NSe={class:"flex items-center gap-2"},jSe={class:"text-white/50 text-xs"},USe=["onClick"],$Se={class:"space-y-1 text-xs"},HSe={class:"flex items-center gap-2"},VSe={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},WSe={class:"flex items-center gap-2"},qSe={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},GSe={class:"flex items-center justify-between text-xs text-white/50"},ZSe={class:"flex items-center gap-4"},KSe={key:0},YSe={key:1},XSe={key:0},JSe=Bu({name:"RoomServersView",__name:"RoomServers",setup(t){const e=fn(!1),r=fn(null),c=fn(null),S=fn(!1),$=fn(!1),Z=fn(null),ue=fn(!1),xe=fn(!1),Se=fn(new Set),Ne=fn(!1),it=fn(""),pt=fn(!1),bt=fn({message:"",variant:"success"}),wt=fn(!1),Dt=fn(""),Zt=fn(""),Mr=fn([]),ze=fn(!1),ni=fn(null),or=fn(""),Cr=fn(D1("roomServers_messagesLimit",50)),gi=fn(0),Si=fn(!0);Af(Cr,xa=>z1("roomServers_messagesLimit",xa));const Ci=fn([]),ri=fn(!1),on=fn({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});Jf(async()=>{await yi()});async function yi(){e.value=!0,r.value=null;try{const xa=await bs.getIdentities();xa.success?c.value=xa.data:r.value=xa.error||"Failed to load identities"}catch(xa){r.value=xa instanceof Error?xa.message:"Failed to load identities"}finally{e.value=!1}}async function gr(){try{const xa=await bs.createIdentity(on.value);xa.success?(S.value=!1,En(),await yi(),Jr(xa.message||"Identity created successfully!","success")):Jr(`Failed to create identity: ${xa.error}`,"error")}catch(xa){Jr(`Error creating identity: ${xa}`,"error")}}async function fr(){try{const xa=await bs.updateIdentity(Z.value);xa.success?($.value=!1,Z.value=null,await yi(),Jr(xa.message||"Identity updated successfully!","success")):Jr(`Failed to update identity: ${xa.error}`,"error")}catch(xa){Jr(`Error updating identity: ${xa}`,"error")}}function Sr(xa){it.value=xa,Ne.value=!0}async function ei(){const xa=it.value;Ne.value=!1;try{const $r=await bs.deleteIdentity(xa);$r.success?(await yi(),Jr($r.message||"Identity deleted successfully!","success")):Jr(`Failed to delete identity: ${$r.error}`,"error")}catch($r){Jr(`Error deleting identity: ${$r}`,"error")}finally{it.value=""}}function Jr(xa,$r){bt.value={message:xa,variant:$r},pt.value=!0}async function ti(xa){try{const $r=await bs.sendRoomServerAdvert(xa);$r.success?Jr($r.message||`Advert sent for '${xa}'!`,"success"):Jr(`Failed to send advert: ${$r.error}`,"error")}catch($r){Jr(`Error sending advert: ${$r}`,"error")}}function Di(xa){Z.value=JSON.parse(JSON.stringify(xa)),Z.value.settings||(Z.value.settings={}),Z.value.settings.admin_password||(Z.value.settings.admin_password=""),Z.value.settings.guest_password||(Z.value.settings.guest_password=""),xe.value=!1,$.value=!0}function En(){on.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},ue.value=!1}function Zn(){S.value=!1,$.value=!1,Z.value=null,ue.value=!1,xe.value=!1,En()}function ga(xa){Se.value.has(xa)?Se.value.delete(xa):Se.value.add(xa)}async function ya(xa){Dt.value=xa,wt.value=!0,gi.value=0,Si.value=!0;const $r=c.value?.configured.find(Mi=>Mi.name===xa);Zt.value=$r?.hash||"",await ro(),await qn(!0)}async function ro(){try{console.log("Fetching ACL clients for room:",Dt.value,"hash:",Zt.value);const xa=await bs.getACLClients({identity_hash:Zt.value,identity_name:Dt.value});console.log("ACL clients response:",xa),xa.success&&xa.data&&(Ci.value=xa.data.clients||[],console.log("ACL clients loaded:",Ci.value.length))}catch(xa){console.error("Failed to fetch ACL clients:",xa)}}async function qn(xa=!1){xa&&(gi.value=0,Mr.value=[]),ze.value=!0,ni.value=null;try{const $r=await bs.getRoomMessages({room_name:Dt.value,limit:Cr.value,offset:gi.value});if($r.success&&$r.data){const Mi=$r.data.messages||[];xa?Mr.value=Mi:Mr.value=[...Mr.value,...Mi],Si.value=Mi.length===Cr.value}else ni.value=$r.error||"Failed to load messages"}catch($r){ni.value=$r instanceof Error?$r.message:"Failed to load messages"}finally{ze.value=!1}}async function ln(){gi.value+=Cr.value,await qn(!1)}async function nn(){if(or.value.trim())try{const xa=await bs.postRoomMessage({room_name:Dt.value,message:or.value,author_pubkey:"server"});xa.success?(or.value="",await qn(!0)):Jr(`Failed to send message: ${xa.error}`,"error")}catch(xa){Jr(`Error sending message: ${xa}`,"error")}}async function On(xa){if(confirm("Are you sure you want to delete this message?"))try{const $r=await bs.deleteRoomMessage({room_name:Dt.value,message_id:xa});$r.success?(await qn(!0),Jr("Message deleted successfully","success")):Jr(`Failed to delete message: ${$r.error}`,"error")}catch($r){Jr(`Error deleting message: ${$r}`,"error")}}function Ra(){wt.value=!1,Dt.value="",Zt.value="",Mr.value=[],or.value="",ni.value=null,Ci.value=[]}function Xa(xa){return xa?new Date(xa*1e3).toLocaleString():"Unknown"}async function zo(xa,$r){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const Mi=await bs.removeACLClient({public_key:xa,identity_hash:$r});Mi.success?(await ro(),Jr("Client removed successfully","success")):Jr(`Failed to remove client: ${Mi.error}`,"error")}catch(Mi){Jr(`Error removing client: ${Mi}`,"error")}}return(xa,$r)=>(jr(),Kr(js,null,[Ee("div",FTe,[Ee("div",NTe,[$r[26]||($r[26]=Ee("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),$r[27]||($r[27]=Ee("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),Ee("div",jTe,[$r[25]||($r[25]=Dc('

Room Servers

Manage room server identities and messages

',1)),Ee("button",{onClick:$r[0]||($r[0]=Mi=>S.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-white rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},$r[24]||($r[24]=[Ee("span",{class:"flex items-center gap-2"},[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),il(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(jr(),Kr("div",UTe,[Ee("div",$Te,[$r[30]||($r[30]=Ee("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Ee("div",HTe,[Ee("div",null,[$r[28]||($r[28]=Ee("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),Ee("div",VTe,ki(c.value.total_configured),1)]),$r[29]||($r[29]=Ee("div",{class:"bg-white/10 p-3 rounded-[12px] group-hover:bg-white/20 transition-colors"},[Ee("svg",{class:"w-6 h-6 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),Ee("div",WTe,[$r[33]||($r[33]=Ee("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Ee("div",qTe,[Ee("div",null,[$r[31]||($r[31]=Ee("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),Ee("div",GTe,ki(c.value.total_registered),1)]),$r[32]||($r[32]=Ee("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[Ee("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),Ee("div",ZTe,[$r[37]||($r[37]=Ee("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Ee("div",KTe,[Ee("div",null,[$r[34]||($r[34]=Ee("div",{class:"text-white/60 text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),Ee("div",{class:Ga(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},ki(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),Ee("div",{class:Ga(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(jr(),Kr("svg",YTe,$r[35]||($r[35]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(jr(),Kr("svg",XTe,$r[36]||($r[36]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):Sa("",!0),Ee("div",JTe,[e.value?(jr(),Kr("div",QTe,$r[38]||($r[38]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Ee("div",{class:"text-white/70"},"Loading room servers...")],-1)]))):r.value?(jr(),Kr("div",e8e,[Ee("div",t8e,[$r[39]||($r[39]=Ee("div",{class:"text-red-400 mb-2"},"Failed to load room servers",-1)),Ee("div",r8e,ki(r.value),1),Ee("button",{onClick:yi,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(jr(),Kr("div",i8e,[(jr(!0),Kr(js,null,au(c.value.configured,Mi=>(jr(),Kr("div",{key:Mi.name,class:"group relative overflow-hidden glass-card rounded-[15px] p-5 border border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[$r[46]||($r[46]=Ee("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Ee("div",n8e,[Ee("div",a8e,[Ee("div",o8e,[Ee("div",s8e,[Mi.registered?(jr(),Kr("div",l8e)):Sa("",!0),Ee("div",{class:Ga(["relative w-3 h-3 rounded-full",Mi.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),Ee("h3",u8e,ki(Mi.name),1),Ee("span",{class:Ga(["px-3 py-1 text-xs font-semibold rounded-full",Mi.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},ki(Mi.registered?"● Active":"○ Inactive"),3),Mi.hash?(jr(),Kr("span",c8e,ki(Mi.hash),1)):Sa("",!0)]),Ee("div",h8e,[Ee("div",null,[$r[40]||($r[40]=Ee("span",{class:"text-white/50"},"Node Name:",-1)),Ee("span",f8e,ki(Mi.settings?.node_name||"Not set"),1)]),Ee("div",d8e,[$r[41]||($r[41]=Ee("span",{class:"text-white/50"},"Identity Key:",-1)),Se.value.has(Mi.name)?(jr(),Kr("span",p8e,ki(Mi.identity_key),1)):(jr(),Kr("span",m8e," •••••••••••••••• ")),Ee("button",{onClick:Xi=>ga(Mi.name),class:"text-primary/70 hover:text-primary text-xs underline"},ki(Se.value.has(Mi.name)?"Hide":"Show"),9,g8e)]),Ee("div",null,[$r[42]||($r[42]=Ee("span",{class:"text-white/50"},"Location:",-1)),Ee("span",v8e,ki(Mi.settings?.latitude||0)+", "+ki(Mi.settings?.longitude||0),1)]),Mi.settings?.admin_password||Mi.settings?.guest_password?(jr(),Kr("div",y8e,[$r[43]||($r[43]=Ee("span",{class:"text-white/50"},"Passwords:",-1)),Ee("span",_8e,[Mi.settings?.admin_password?(jr(),Kr("span",x8e,"Admin")):Sa("",!0),Mi.settings?.admin_password&&Mi.settings?.guest_password?(jr(),Kr("span",b8e," / ")):Sa("",!0),Mi.settings?.guest_password?(jr(),Kr("span",w8e,"Guest")):Sa("",!0)])])):Sa("",!0)]),Mi.address?(jr(),Kr("div",k8e," Address: "+ki(Mi.address),1)):Sa("",!0)]),Ee("div",T8e,[Ee("button",{onClick:Xi=>ya(Mi.name),disabled:!Mi.registered,class:Ga(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Mi.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"]),title:Mi.registered?"Manage messages for this room":"Room server must be active to manage messages"},$r[44]||($r[44]=[Ee("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),il(" Messages ",-1)]),10,S8e),Ee("button",{onClick:Xi=>ti(Mi.name),disabled:!Mi.registered,class:Ga(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",Mi.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"]),title:Mi.registered?"Send advert for this room server":"Room server must be active to send advert"},$r[45]||($r[45]=[Ee("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),il(" Send Advert ",-1)]),10,C8e),Ee("button",{onClick:Xi=>Di(Mi),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,A8e),Ee("button",{onClick:Xi=>Sr(Mi.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,M8e)])])]))),128))])):(jr(),Kr("div",E8e,[$r[47]||($r[47]=Ee("svg",{class:"w-16 h-16 mx-auto mb-4 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),$r[48]||($r[48]=Ee("p",{class:"text-lg mb-2"},"No room servers configured",-1)),$r[49]||($r[49]=Ee("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),Ee("button",{onClick:$r[1]||($r[1]=Mi=>S.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),S.value?(jr(),Kr("div",L8e,[Ee("div",P8e,[$r[60]||($r[60]=Ee("h2",{class:"text-xl font-bold text-white mb-4"},"Add Room Server",-1)),Ee("div",I8e,[Ee("div",null,[$r[50]||($r[50]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Name *",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[2]||($r[2]=Mi=>on.value.name=Mi),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.name]])]),Ee("div",null,[Ee("label",D8e,[$r[51]||($r[51]=il(" Identity Key (Optional) ",-1)),Ee("button",{onClick:$r[3]||($r[3]=Mi=>ue.value=!ue.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},ki(ue.value?"Hide":"Show/Edit"),1)]),ue.value?(jr(),Kr("div",z8e,[Sl(Ee("input",{"onUpdate:modelValue":$r[4]||($r[4]=Mi=>on.value.identity_key=Mi),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white font-mono text-sm focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.identity_key]]),$r[52]||($r[52]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(jr(),Kr("div",O8e," Will be auto-generated if not provided "))]),Ee("div",null,[$r[53]||($r[53]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Node Name",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[5]||($r[5]=Mi=>on.value.settings.node_name=Mi),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.settings.node_name]])]),Ee("div",B8e,[Ee("div",null,[$r[54]||($r[54]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Latitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[6]||($r[6]=Mi=>on.value.settings.latitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.settings.latitude,void 0,{number:!0}]])]),Ee("div",null,[$r[55]||($r[55]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Longitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[7]||($r[7]=Mi=>on.value.settings.longitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.settings.longitude,void 0,{number:!0}]])])]),Ee("div",R8e,[Ee("div",null,[$r[56]||($r[56]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Admin Password (Optional)",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[8]||($r[8]=Mi=>on.value.settings.admin_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.settings.admin_password]]),$r[57]||($r[57]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Full access to room server",-1))]),Ee("div",null,[$r[58]||($r[58]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Guest Password (Optional)",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[9]||($r[9]=Mi=>on.value.settings.guest_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,on.value.settings.guest_password]]),$r[59]||($r[59]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Read-only access",-1))])])]),Ee("div",{class:"flex justify-end gap-3 mt-6"},[Ee("button",{onClick:Zn,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg transition-colors"}," Cancel "),Ee("button",{onClick:gr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):Sa("",!0),$.value&&Z.value?(jr(),Kr("div",F8e,[Ee("div",N8e,[$r[72]||($r[72]=Ee("h2",{class:"text-xl font-bold text-white mb-4"},"Edit Room Server",-1)),Ee("div",j8e,[Ee("div",null,[$r[61]||($r[61]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Current Name",-1)),Ee("input",{value:Z.value.name,disabled:"",type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white/50 cursor-not-allowed"},null,8,U8e)]),Ee("div",null,[$r[62]||($r[62]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"New Name (optional)",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[10]||($r[10]=Mi=>Z.value.new_name=Mi),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.new_name]])]),Ee("div",null,[Ee("label",$8e,[$r[63]||($r[63]=il(" Identity Key (Optional) ",-1)),Ee("button",{onClick:$r[11]||($r[11]=Mi=>xe.value=!xe.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},ki(xe.value?"Hide":"Show/Edit"),1)]),xe.value?(jr(),Kr("div",H8e,[Sl(Ee("input",{"onUpdate:modelValue":$r[12]||($r[12]=Mi=>Z.value.identity_key=Mi),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white font-mono text-sm focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.identity_key]]),$r[64]||($r[64]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(jr(),Kr("div",V8e,' Click "Show/Edit" to change the identity key '))]),Ee("div",null,[$r[65]||($r[65]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Node Name",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[13]||($r[13]=Mi=>Z.value.settings.node_name=Mi),type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.node_name]])]),Ee("div",W8e,[Ee("div",null,[$r[66]||($r[66]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Latitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[14]||($r[14]=Mi=>Z.value.settings.latitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.latitude,void 0,{number:!0}]])]),Ee("div",null,[$r[67]||($r[67]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Longitude",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[15]||($r[15]=Mi=>Z.value.settings.longitude=Mi),type:"number",step:"0.000001",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.longitude,void 0,{number:!0}]])])]),Ee("div",q8e,[Ee("div",null,[$r[68]||($r[68]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Admin Password",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[16]||($r[16]=Mi=>Z.value.settings.admin_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.admin_password]]),$r[69]||($r[69]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Full access to room server",-1))]),Ee("div",null,[$r[70]||($r[70]=Ee("label",{class:"block text-white/70 text-sm mb-2"},"Guest Password",-1)),Sl(Ee("input",{"onUpdate:modelValue":$r[17]||($r[17]=Mi=>Z.value.settings.guest_password=Mi),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-2 text-white focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[sc,Z.value.settings.guest_password]]),$r[71]||($r[71]=Ee("p",{class:"text-white/50 text-xs mt-1"},"Read-only access",-1))])])]),Ee("div",{class:"flex justify-end gap-3 mt-6"},[Ee("button",{onClick:Zn,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg transition-colors"}," Cancel "),Ee("button",{onClick:fr,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):Sa("",!0)]),nl(BH,{show:Ne.value,title:"Delete Room Server",message:`Are you sure you want to delete '${it.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:$r[18]||($r[18]=Mi=>Ne.value=!1),onConfirm:ei},null,8,["show","message"]),nl(RTe,{show:pt.value,message:bt.value.message,variant:bt.value.variant,onClose:$r[19]||($r[19]=Mi=>pt.value=!1)},null,8,["show","message","variant"]),wt.value?(jr(),Kr("div",G8e,[Ee("div",Z8e,[Ee("div",K8e,[$r[79]||($r[79]=Ee("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),$r[80]||($r[80]=Ee("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),Ee("div",Y8e,[Ee("div",X8e,[$r[75]||($r[75]=Dc('
',1)),Ee("div",null,[$r[74]||($r[74]=Ee("h2",{class:"text-2xl font-bold text-white mb-1"},"Room Messages",-1)),Ee("p",J8e,[$r[73]||($r[73]=Ee("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),Ee("span",Q8e,ki(Dt.value),1)])])]),Ee("div",eSe,[Ee("button",{onClick:$r[20]||($r[20]=Mi=>ri.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[$r[76]||($r[76]=Ee("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),$r[77]||($r[77]=Ee("span",{class:"hidden sm:inline"},"Sessions",-1)),Ee("span",tSe,ki(Ci.value.length),1)]),Ee("button",{onClick:Ra,class:"p-2 text-white/70 hover:text-white hover:bg-white/10 rounded-[10px] transition-all"},$r[78]||($r[78]=[Ee("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),Ee("div",rSe,[ze.value&&Mr.value.length===0?(jr(),Kr("div",iSe,$r[81]||($r[81]=[Ee("div",{class:"text-center"},[Ee("div",{class:"animate-spin w-8 h-8 border-2 border-white/20 border-t-primary rounded-full mx-auto mb-4"}),Ee("div",{class:"text-white/70"},"Loading messages...")],-1)]))):ni.value?(jr(),Kr("div",nSe,[Ee("div",aSe,[$r[82]||($r[82]=Ee("div",{class:"text-red-400 mb-2"},"Failed to load messages",-1)),Ee("div",oSe,ki(ni.value),1),Ee("button",{onClick:$r[21]||($r[21]=Mi=>qn(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):Mr.value.length>0?(jr(),Kr("div",sSe,[(jr(!0),Kr(js,null,au(Mr.value,(Mi,Xi)=>(jr(),Kr("div",{key:Mi.id||Xi,class:"group relative overflow-hidden glass-card rounded-[12px] p-4 border border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[$r[87]||($r[87]=Ee("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),Ee("div",lSe,[Ee("div",uSe,[Ee("div",cSe,[Ee("div",hSe,[$r[84]||($r[84]=Ee("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[Ee("svg",{class:"w-3 h-3 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),Mi.author_name?(jr(),Kr("span",fSe,ki(Mi.author_name),1)):Sa("",!0),Mi.author_pubkey?(jr(),Kr("span",dSe,ki(Mi.author_pubkey.substring(0,8))+"... ",1)):(jr(),Kr("span",pSe," Anonymous ")),$r[85]||($r[85]=Ee("span",{class:"text-white/30 text-xs"},"•",-1)),Ee("span",mSe,[$r[83]||($r[83]=Ee("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),il(" "+ki(Xa(Mi.timestamp)),1)]),Mi.id?(jr(),Kr("span",gSe," #"+ki(Mi.id),1)):Sa("",!0)])]),Ee("div",vSe,ki(Mi.message_text),1)]),Ee("button",{onClick:so=>On(Mi.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},$r[86]||($r[86]=[Ee("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,ySe)])]))),128)),Si.value&&!ze.value?(jr(),Kr("div",_Se,[Ee("button",{onClick:ln,class:"group px-6 py-2.5 bg-gradient-to-r from-white/5 to-white/10 hover:from-white/10 hover:to-white/15 text-white rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-white/10 flex items-center gap-2 mx-auto"},$r[88]||($r[88]=[Ee("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),il(" Load More Messages ",-1)]))])):ze.value?(jr(),Kr("div",xSe,$r[89]||($r[89]=[Ee("div",{class:"flex items-center justify-center gap-2 text-white/50 text-sm"},[Ee("div",{class:"animate-spin w-4 h-4 border-2 border-white/20 border-t-primary rounded-full"}),il(" Loading... ")],-1)]))):Sa("",!0)])):(jr(),Kr("div",bSe,$r[90]||($r[90]=[Dc('

No messages yet

Be the first to start the conversation

',1)])))]),Ee("div",wSe,[$r[93]||($r[93]=Ee("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),Ee("div",kSe,[Ee("div",TSe,[Ee("div",SSe,[Sl(Ee("textarea",{"onUpdate:modelValue":$r[22]||($r[22]=Mi=>or.value=Mi),onKeydown:[Tx(Xf(nn,["ctrl"]),["enter"]),Tx(Xf(nn,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-3 text-white text-sm focus:outline-none focus:border-primary/50 focus:bg-white/10 transition-all resize-none placeholder-white/30"},null,40,CSe),[[sc,or.value]])]),Ee("button",{onClick:nn,disabled:!or.value.trim(),class:Ga(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",or.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-white border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-white/5 text-white/30 cursor-not-allowed border border-white/10"])},$r[91]||($r[91]=[Ee("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),Ee("span",{class:"hidden sm:inline"},"Send",-1)]),10,ASe)]),$r[92]||($r[92]=Ee("p",{class:"text-white/40 text-xs flex items-center gap-2"},[Ee("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),il(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):Sa("",!0),ri.value?(jr(),Kr("div",MSe,[Ee("div",ESe,[Ee("div",LSe,[Ee("div",null,[$r[95]||($r[95]=Ee("h2",{class:"text-xl font-bold text-white"},"Active Sessions",-1)),Ee("p",PSe,[$r[94]||($r[94]=il("Room: ",-1)),Ee("span",ISe,ki(Dt.value),1)])]),Ee("button",{onClick:$r[23]||($r[23]=Mi=>ri.value=!1),class:"text-white/70 hover:text-white transition-colors"},$r[96]||($r[96]=[Ee("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),Ee("div",DSe,[Ci.value.length===0?(jr(),Kr("div",zSe,$r[97]||($r[97]=[Ee("div",{class:"text-white/50"},"No active sessions found",-1)]))):Sa("",!0),(jr(!0),Kr(js,null,au(Ci.value,(Mi,Xi)=>(jr(),Kr("div",{key:Mi.public_key_full||Xi,class:"glass-card rounded-[10px] p-4 border border-white/10"},[Ee("div",OSe,[Ee("div",BSe,[Ee("div",RSe,[Ee("span",FSe,ki(Mi.identity_name||"Unknown"),1),Ee("span",{class:Ga(["px-2 py-0.5 text-xs font-medium rounded",Mi.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},ki(Mi.permissions),3)]),Ee("div",NSe,[Ee("span",jSe,ki(Mi.identity_type),1),Ee("button",{onClick:so=>zo(Mi.public_key_full,Mi.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,USe)])]),Ee("div",$Se,[Ee("div",HSe,[$r[98]||($r[98]=Ee("span",{class:"text-white/50"},"Short Key:",-1)),Ee("code",VSe,ki(Mi.public_key),1)]),Ee("div",WSe,[$r[99]||($r[99]=Ee("span",{class:"text-white/50"},"Full Key:",-1)),Ee("code",qSe,ki(Mi.public_key_full),1)])]),Ee("div",GSe,[Ee("div",ZSe,[Mi.address?(jr(),Kr("span",KSe,"📍 "+ki(Mi.address),1)):Sa("",!0),Mi.last_login_success?(jr(),Kr("span",YSe,"Last Login: "+ki(new Date(Mi.last_login_success*1e3).toLocaleString()),1)):Sa("",!0)]),Mi.last_activity?(jr(),Kr("span",XSe,"Active: "+ki(Math.floor((Date.now()/1e3-Mi.last_activity)/60))+"m ago",1)):Sa("",!0)])])]))),128))])])])):Sa("",!0)],64))}}),QSe={class:"space-y-6"},eCe={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] p-6"},tCe={class:"flex items-center justify-between mb-4"},rCe=["disabled"],iCe={class:"bg-white/5 border border-white/10 rounded-lg p-4"},nCe={class:"flex flex-wrap gap-2"},aCe=["onClick"],oCe={key:0,class:"w-px h-6 bg-white/20 mx-2 self-center"},sCe=["onClick"],lCe={class:"bg-dark-card/30 backdrop-blur border border-white/10 rounded-[15px] overflow-hidden"},uCe={key:0,class:"p-8 text-center"},cCe={key:1,class:"p-8 text-center"},hCe={class:"text-dark-text mb-4"},fCe={key:2,class:"max-h-[600px] overflow-y-auto"},dCe={key:0,class:"p-8 text-center"},pCe={key:1,class:"divide-y divide-white/5"},mCe={class:"flex-shrink-0 text-dark-text"},gCe={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-400"},vCe={class:"text-white flex-1 break-all"},yCe=Bu({name:"LogsView",__name:"Logs",setup(t){const e=fn([]),r=fn(new Set),c=fn(new Set(["DEBUG","INFO","WARNING","ERROR"])),S=fn(new Set),$=fn(new Set),Z=fn(!0),ue=fn(null);let xe=null;const Se=yi=>{const gr=yi.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return gr?gr[1].trim():"Unknown"},Ne=yi=>{const gr=yi.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return gr?gr[1]:yi},it=(yi,gr)=>{if(yi.size!==gr.size)return!1;for(const fr of yi)if(!gr.has(fr))return!1;return!0},pt=async()=>{try{const yi=await bs.getLogs();if(yi.logs&&yi.logs.length>0){e.value=yi.logs;const gr=new Set;e.value.forEach(Jr=>{const ti=Se(Jr.message);gr.add(ti)});const fr=new Set;e.value.forEach(Jr=>{fr.add(Jr.level)}),r.value.size===0&&(r.value=new Set(gr));const Sr=!it(S.value,gr),ei=!it($.value,fr);Sr&&(S.value=gr),ei&&($.value=fr),ue.value=null}}catch(yi){console.error("Error loading logs:",yi),ue.value=yi instanceof Error?yi.message:"Failed to load logs"}finally{Z.value=!1}},bt=Io(()=>e.value.filter(gr=>{const fr=Se(gr.message),Sr=r.value.has(fr),ei=c.value.has(gr.level);return Sr&&ei})),wt=Io(()=>Array.from(S.value).sort()),Dt=Io(()=>{const yi=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from($.value).sort((fr,Sr)=>{const ei=yi.indexOf(fr),Jr=yi.indexOf(Sr);return ei!==-1&&Jr!==-1?ei-Jr:fr.localeCompare(Sr)})}),Zt=yi=>{c.value.has(yi)?c.value.delete(yi):c.value.add(yi),c.value=new Set(c.value)},Mr=yi=>new Date(yi).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ze=yi=>({ERROR:"text-red-400 bg-red-900/20",WARNING:"text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-400 bg-yellow-900/20",INFO:"text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[yi]||"text-gray-400 bg-gray-900/20",ni=(yi,gr)=>gr?{ERROR:"bg-red-500/20 text-red-400 border-red-500/50",WARNING:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-500/20 text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[yi]||"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10",or=yi=>{r.value.has(yi)?r.value.delete(yi):r.value.add(yi),r.value=new Set(r.value)},Cr=()=>{r.value=new Set(S.value)},gi=()=>{r.value=new Set},Si=()=>{c.value=new Set($.value)},Ci=()=>{c.value=new Set},ri=()=>{xe&&clearInterval(xe),xe=setInterval(pt,5e3)},on=()=>{xe&&(clearInterval(xe),xe=null)};return Jf(()=>{pt(),ri()}),$g(()=>{on()}),(yi,gr)=>(jr(),Kr("div",QSe,[Ee("div",eCe,[Ee("div",tCe,[gr[1]||(gr[1]=Ee("div",null,[Ee("h1",{class:"text-white text-2xl font-semibold mb-2"},"System Logs"),Ee("p",{class:"text-dark-text"},"Real-time system events and diagnostics")],-1)),Ee("button",{onClick:pt,disabled:Z.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(jr(),Kr("svg",{class:Ga(["w-4 h-4",{"animate-spin":Z.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},gr[0]||(gr[0]=[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),il(" "+ki(Z.value?"Loading...":"Refresh"),1)],8,rCe)]),Ee("div",iCe,[Ee("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[gr[2]||(gr[2]=Ee("span",{class:"text-white font-medium"},"Filters:",-1)),Ee("button",{onClick:Cr,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),Ee("button",{onClick:gi,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),gr[3]||(gr[3]=Ee("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),Ee("button",{onClick:Si,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),Ee("button",{onClick:Ci,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),Ee("div",nCe,[(jr(!0),Kr(js,null,au(wt.value,fr=>(jr(),Kr("button",{key:"logger-"+fr,onClick:Sr=>or(fr),class:Ga(["px-3 py-1 text-xs border rounded-full transition-colors",r.value.has(fr)?"bg-primary/20 text-primary border-primary/50":"bg-white/5 text-white/60 border-white/20 hover:bg-white/10"])},ki(fr),11,aCe))),128)),wt.value.length>0&&Dt.value.length>0?(jr(),Kr("div",oCe)):Sa("",!0),(jr(!0),Kr(js,null,au(Dt.value,fr=>(jr(),Kr("button",{key:"level-"+fr,onClick:Sr=>Zt(fr),class:Ga(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",c.value.has(fr)?ni(fr,!0):ni(fr,!1)])},ki(fr),11,sCe))),128))])])]),Ee("div",lCe,[Z.value&&e.value.length===0?(jr(),Kr("div",uCe,gr[4]||(gr[4]=[Ee("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),Ee("p",{class:"text-dark-text"},"Loading system logs...",-1)]))):ue.value?(jr(),Kr("div",cCe,[gr[5]||(gr[5]=Ee("div",{class:"text-red-400 mb-4"},[Ee("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Ee("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),gr[6]||(gr[6]=Ee("h3",{class:"text-white text-lg font-medium mb-2"},"Error Loading Logs",-1)),Ee("p",hCe,ki(ue.value),1),Ee("button",{onClick:pt,class:"px-4 py-2 bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(jr(),Kr("div",fCe,[bt.value.length===0?(jr(),Kr("div",dCe,gr[7]||(gr[7]=[Dc('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(jr(),Kr("div",pCe,[(jr(!0),Kr(js,null,au(bt.value,(fr,Sr)=>(jr(),Kr("div",{key:Sr,class:"flex items-start gap-4 p-4 hover:bg-white/5 transition-colors font-mono text-sm"},[Ee("span",mCe," ["+ki(Mr(fr.timestamp))+"] ",1),Ee("span",gCe,ki(Se(fr.message)),1),Ee("span",{class:Ga(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",ze(fr.level)])},ki(fr.level),3),Ee("span",vCe,ki(Ne(fr.message)),1)]))),128))]))]))])]))}});/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -3999,22 +3999,22 @@ maplibre-gl/dist/maplibre-gl.js: * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var zH=Object.defineProperty,W8e=Object.getOwnPropertyDescriptor,q8e=(t,e)=>{for(var r in e)zH(t,r,{get:e[r],enumerable:!0})},Vd=(t,e,r,c)=>{for(var S=c>1?void 0:c?W8e(e,r):e,H=t.length-1,Z;H>=0;H--)(Z=t[H])&&(S=(c?Z(e,r,S):Z(S))||S);return c&&S&&zH(e,r,S),S},cl=(t,e)=>(r,c)=>e(r,c,t),mF="Terminal input",s9={get:()=>mF,set:t=>mF=t},gF="Too much output to announce, navigate to rows manually to read",l9={get:()=>gF,set:t=>gF=t};function G8e(t){return t.replace(/\r?\n/g,"\r")}function Z8e(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function K8e(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function Y8e(t,e,r,c){if(t.stopPropagation(),t.clipboardData){let S=t.clipboardData.getData("text/plain");OH(S,e,r,c)}}function OH(t,e,r,c){t=G8e(t),t=Z8e(t,r.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(t,!0),e.value=""}function BH(t,e,r){let c=r.getBoundingClientRect(),S=t.clientX-c.left-10,H=t.clientY-c.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${S}px`,e.style.top=`${H}px`,e.style.zIndex="1000",e.focus()}function vF(t,e,r,c,S){BH(t,e,r),S&&c.rightClickSelect(t),e.value=c.selectionText,e.select()}function e_(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function US(t,e=0,r=t.length){let c="";for(let S=e;S65535?(H-=65536,c+=String.fromCharCode((H>>10)+55296)+String.fromCharCode(H%1024+56320)):c+=String.fromCharCode(H)}return c}var X8e=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,r){let c=e.length;if(!c)return 0;let S=0,H=0;if(this._interim){let Z=e.charCodeAt(H++);56320<=Z&&Z<=57343?r[S++]=(this._interim-55296)*1024+Z-56320+65536:(r[S++]=this._interim,r[S++]=Z),this._interim=0}for(let Z=H;Z=c)return this._interim=ue,S;let be=e.charCodeAt(Z);56320<=be&&be<=57343?r[S++]=(ue-55296)*1024+be-56320+65536:(r[S++]=ue,r[S++]=be);continue}ue!==65279&&(r[S++]=ue)}return S}},J8e=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,r){let c=e.length;if(!c)return 0;let S=0,H,Z,ue,be,Se=0,Re=0;if(this.interim[0]){let bt=!1,kt=this.interim[0];kt&=(kt&224)===192?31:(kt&240)===224?15:7;let Dt=0,rr;for(;(rr=this.interim[++Dt]&63)&&Dt<4;)kt<<=6,kt|=rr;let Er=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,Fe=Er-Dt;for(;Re=c)return 0;if(rr=e[Re++],(rr&192)!==128){Re--,bt=!0;break}else this.interim[Dt++]=rr,kt<<=6,kt|=rr&63}bt||(Er===2?kt<128?Re--:r[S++]=kt:Er===3?kt<2048||kt>=55296&&kt<=57343||kt===65279||(r[S++]=kt):kt<65536||kt>1114111||(r[S++]=kt)),this.interim.fill(0)}let Xe=c-4,vt=Re;for(;vt=c)return this.interim[0]=H,S;if(Z=e[vt++],(Z&192)!==128){vt--;continue}if(Se=(H&31)<<6|Z&63,Se<128){vt--;continue}r[S++]=Se}else if((H&240)===224){if(vt>=c)return this.interim[0]=H,S;if(Z=e[vt++],(Z&192)!==128){vt--;continue}if(vt>=c)return this.interim[0]=H,this.interim[1]=Z,S;if(ue=e[vt++],(ue&192)!==128){vt--;continue}if(Se=(H&15)<<12|(Z&63)<<6|ue&63,Se<2048||Se>=55296&&Se<=57343||Se===65279)continue;r[S++]=Se}else if((H&248)===240){if(vt>=c)return this.interim[0]=H,S;if(Z=e[vt++],(Z&192)!==128){vt--;continue}if(vt>=c)return this.interim[0]=H,this.interim[1]=Z,S;if(ue=e[vt++],(ue&192)!==128){vt--;continue}if(vt>=c)return this.interim[0]=H,this.interim[1]=Z,this.interim[2]=ue,S;if(be=e[vt++],(be&192)!==128){vt--;continue}if(Se=(H&7)<<18|(Z&63)<<12|(ue&63)<<6|be&63,Se<65536||Se>1114111)continue;r[S++]=Se}}return S}},RH="",s_=" ",u4=class FH{constructor(){this.fg=0,this.bg=0,this.extended=new XT}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new FH;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},XT=class NH{constructor(e=0,r=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new NH(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},xg=class jH extends u4{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new XT,this.combinedData=""}static fromCharData(e){let r=new jH;return r.setFromCharData(e),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?e_(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let r=!1;if(e[1].length>2)r=!0;else if(e[1].length===2){let c=e[1].charCodeAt(0);if(55296<=c&&c<=56319){let S=e[1].charCodeAt(1);56320<=S&&S<=57343?this.content=(c-55296)*1024+S-56320+65536|e[2]<<22:r=!0}else r=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;r&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},yF="di$target",u9="di$dependencies",q7=new Map;function Q8e(t){return t[u9]||[]}function a0(t){if(q7.has(t))return q7.get(t);let e=function(r,c,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");eCe(e,r,S)};return e._id=t,q7.set(t,e),e}function eCe(t,e,r){e[yF]===e?e[u9].push({id:t,index:r}):(e[u9]=[{id:t,index:r}],e[yF]=e)}var sm=a0("BufferService"),UH=a0("CoreMouseService"),Gx=a0("CoreService"),tCe=a0("CharsetService"),eL=a0("InstantiationService"),$H=a0("LogService"),lm=a0("OptionsService"),HH=a0("OscLinkService"),rCe=a0("UnicodeService"),c4=a0("DecorationService"),c9=class{constructor(e,r,c){this._bufferService=e,this._optionsService=r,this._oscLinkService=c}provideLinks(e,r){let c=this._bufferService.buffer.lines.get(e-1);if(!c){r(void 0);return}let S=[],H=this._optionsService.rawOptions.linkHandler,Z=new xg,ue=c.getTrimmedLength(),be=-1,Se=-1,Re=!1;for(let Xe=0;XeH?H.activate(Dt,rr,bt):iCe(Dt,rr),hover:(Dt,rr)=>H?.hover?.(Dt,rr,bt),leave:(Dt,rr)=>H?.leave?.(Dt,rr,bt)})}Re=!1,Z.hasExtendedAttrs()&&Z.extended.urlId?(Se=Xe,be=Z.extended.urlId):(Se=-1,be=-1)}}r(S)}};c9=Vd([cl(0,sm),cl(1,lm),cl(2,HH)],c9);function iCe(t,e){if(confirm(`Do you want to navigate to ${e}? + */var RH=Object.defineProperty,_Ce=Object.getOwnPropertyDescriptor,xCe=(t,e)=>{for(var r in e)RH(t,r,{get:e[r],enumerable:!0})},Wd=(t,e,r,c)=>{for(var S=c>1?void 0:c?_Ce(e,r):e,$=t.length-1,Z;$>=0;$--)(Z=t[$])&&(S=(c?Z(e,r,S):Z(S))||S);return c&&S&&RH(e,r,S),S},cl=(t,e)=>(r,c)=>e(r,c,t),vF="Terminal input",u9={get:()=>vF,set:t=>vF=t},yF="Too much output to announce, navigate to rows manually to read",c9={get:()=>yF,set:t=>yF=t};function bCe(t){return t.replace(/\r?\n/g,"\r")}function wCe(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function kCe(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function TCe(t,e,r,c){if(t.stopPropagation(),t.clipboardData){let S=t.clipboardData.getData("text/plain");FH(S,e,r,c)}}function FH(t,e,r,c){t=bCe(t),t=wCe(t,r.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(t,!0),e.value=""}function NH(t,e,r){let c=r.getBoundingClientRect(),S=t.clientX-c.left-10,$=t.clientY-c.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${S}px`,e.style.top=`${$}px`,e.style.zIndex="1000",e.focus()}function _F(t,e,r,c,S){NH(t,e,r),S&&c.rightClickSelect(t),e.value=c.selectionText,e.select()}function i_(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function H8(t,e=0,r=t.length){let c="";for(let S=e;S65535?($-=65536,c+=String.fromCharCode(($>>10)+55296)+String.fromCharCode($%1024+56320)):c+=String.fromCharCode($)}return c}var SCe=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,r){let c=e.length;if(!c)return 0;let S=0,$=0;if(this._interim){let Z=e.charCodeAt($++);56320<=Z&&Z<=57343?r[S++]=(this._interim-55296)*1024+Z-56320+65536:(r[S++]=this._interim,r[S++]=Z),this._interim=0}for(let Z=$;Z=c)return this._interim=ue,S;let xe=e.charCodeAt(Z);56320<=xe&&xe<=57343?r[S++]=(ue-55296)*1024+xe-56320+65536:(r[S++]=ue,r[S++]=xe);continue}ue!==65279&&(r[S++]=ue)}return S}},CCe=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,r){let c=e.length;if(!c)return 0;let S=0,$,Z,ue,xe,Se=0,Ne=0;if(this.interim[0]){let bt=!1,wt=this.interim[0];wt&=(wt&224)===192?31:(wt&240)===224?15:7;let Dt=0,Zt;for(;(Zt=this.interim[++Dt]&63)&&Dt<4;)wt<<=6,wt|=Zt;let Mr=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,ze=Mr-Dt;for(;Ne=c)return 0;if(Zt=e[Ne++],(Zt&192)!==128){Ne--,bt=!0;break}else this.interim[Dt++]=Zt,wt<<=6,wt|=Zt&63}bt||(Mr===2?wt<128?Ne--:r[S++]=wt:Mr===3?wt<2048||wt>=55296&&wt<=57343||wt===65279||(r[S++]=wt):wt<65536||wt>1114111||(r[S++]=wt)),this.interim.fill(0)}let it=c-4,pt=Ne;for(;pt=c)return this.interim[0]=$,S;if(Z=e[pt++],(Z&192)!==128){pt--;continue}if(Se=($&31)<<6|Z&63,Se<128){pt--;continue}r[S++]=Se}else if(($&240)===224){if(pt>=c)return this.interim[0]=$,S;if(Z=e[pt++],(Z&192)!==128){pt--;continue}if(pt>=c)return this.interim[0]=$,this.interim[1]=Z,S;if(ue=e[pt++],(ue&192)!==128){pt--;continue}if(Se=($&15)<<12|(Z&63)<<6|ue&63,Se<2048||Se>=55296&&Se<=57343||Se===65279)continue;r[S++]=Se}else if(($&248)===240){if(pt>=c)return this.interim[0]=$,S;if(Z=e[pt++],(Z&192)!==128){pt--;continue}if(pt>=c)return this.interim[0]=$,this.interim[1]=Z,S;if(ue=e[pt++],(ue&192)!==128){pt--;continue}if(pt>=c)return this.interim[0]=$,this.interim[1]=Z,this.interim[2]=ue,S;if(xe=e[pt++],(xe&192)!==128){pt--;continue}if(Se=($&7)<<18|(Z&63)<<12|(ue&63)<<6|xe&63,Se<65536||Se>1114111)continue;r[S++]=Se}}return S}},jH="",c_=" ",h4=class UH{constructor(){this.fg=0,this.bg=0,this.extended=new QT}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new UH;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},QT=class $H{constructor(e=0,r=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new $H(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},bg=class HH extends h4{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new QT,this.combinedData=""}static fromCharData(e){let r=new HH;return r.setFromCharData(e),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?i_(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let r=!1;if(e[1].length>2)r=!0;else if(e[1].length===2){let c=e[1].charCodeAt(0);if(55296<=c&&c<=56319){let S=e[1].charCodeAt(1);56320<=S&&S<=57343?this.content=(c-55296)*1024+S-56320+65536|e[2]<<22:r=!0}else r=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;r&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},xF="di$target",h9="di$dependencies",Z7=new Map;function ACe(t){return t[h9]||[]}function o0(t){if(Z7.has(t))return Z7.get(t);let e=function(r,c,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");MCe(e,r,S)};return e._id=t,Z7.set(t,e),e}function MCe(t,e,r){e[xF]===e?e[h9].push({id:t,index:r}):(e[h9]=[{id:t,index:r}],e[xF]=e)}var sm=o0("BufferService"),VH=o0("CoreMouseService"),Zx=o0("CoreService"),ECe=o0("CharsetService"),rL=o0("InstantiationService"),WH=o0("LogService"),lm=o0("OptionsService"),qH=o0("OscLinkService"),LCe=o0("UnicodeService"),f4=o0("DecorationService"),f9=class{constructor(e,r,c){this._bufferService=e,this._optionsService=r,this._oscLinkService=c}provideLinks(e,r){let c=this._bufferService.buffer.lines.get(e-1);if(!c){r(void 0);return}let S=[],$=this._optionsService.rawOptions.linkHandler,Z=new bg,ue=c.getTrimmedLength(),xe=-1,Se=-1,Ne=!1;for(let it=0;it$?$.activate(Dt,Zt,bt):PCe(Dt,Zt),hover:(Dt,Zt)=>$?.hover?.(Dt,Zt,bt),leave:(Dt,Zt)=>$?.leave?.(Dt,Zt,bt)})}Ne=!1,Z.hasExtendedAttrs()&&Z.extended.urlId?(Se=it,xe=Z.extended.urlId):(Se=-1,xe=-1)}}r(S)}};f9=Wd([cl(0,sm),cl(1,lm),cl(2,qH)],f9);function PCe(t,e){if(confirm(`Do you want to navigate to ${e}? -WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var $S=a0("CharSizeService"),V1=a0("CoreBrowserService"),tL=a0("MouseService"),W1=a0("RenderService"),nCe=a0("SelectionService"),VH=a0("CharacterJoinerService"),Z2=a0("ThemeService"),WH=a0("LinkProviderService"),aCe=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?_F.isErrorNoTelemetry(e)?new _F(e.message+` +WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var V8=o0("CharSizeService"),q1=o0("CoreBrowserService"),iL=o0("MouseService"),G1=o0("RenderService"),ICe=o0("SelectionService"),GH=o0("CharacterJoinerService"),Y2=o0("ThemeService"),ZH=o0("LinkProviderService"),DCe=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?bF.isErrorNoTelemetry(e)?new bF(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},oCe=new aCe;function yT(t){sCe(t)||oCe.onUnexpectedError(t)}var h9="Canceled";function sCe(t){return t instanceof lCe?!0:t instanceof Error&&t.name===h9&&t.message===h9}var lCe=class extends Error{constructor(){super(h9),this.name=this.message}};function uCe(t){return new Error(`Illegal argument: ${t}`)}var _F=class f9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof f9)return e;let r=new f9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},d9=class qH extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,qH.prototype)}};function Hm(t,e=0){return t[t.length-(1+e)]}var cCe;(t=>{function e(H){return H<0}t.isLessThan=e;function r(H){return H<=0}t.isLessThanOrEqual=r;function c(H){return H>0}t.isGreaterThan=c;function S(H){return H===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(cCe||={});function hCe(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var GH;(t=>{function e(ur){return ur&&typeof ur=="object"&&typeof ur[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(ur){yield ur}t.single=S;function H(ur){return e(ur)?ur:S(ur)}t.wrap=H;function Z(ur){return ur||r}t.from=Z;function*ue(ur){for(let Ir=ur.length-1;Ir>=0;Ir--)yield ur[Ir]}t.reverse=ue;function be(ur){return!ur||ur[Symbol.iterator]().next().done===!0}t.isEmpty=be;function Se(ur){return ur[Symbol.iterator]().next().value}t.first=Se;function Re(ur,Ir){let Ti=0;for(let _i of ur)if(Ir(_i,Ti++))return!0;return!1}t.some=Re;function Xe(ur,Ir){for(let Ti of ur)if(Ir(Ti))return Ti}t.find=Xe;function*vt(ur,Ir){for(let Ti of ur)Ir(Ti)&&(yield Ti)}t.filter=vt;function*bt(ur,Ir){let Ti=0;for(let _i of ur)yield Ir(_i,Ti++)}t.map=bt;function*kt(ur,Ir){let Ti=0;for(let _i of ur)yield*Ir(_i,Ti++)}t.flatMap=kt;function*Dt(...ur){for(let Ir of ur)yield*Ir}t.concat=Dt;function rr(ur,Ir,Ti){let _i=Ti;for(let Ci of ur)_i=Ir(_i,Ci);return _i}t.reduce=rr;function*Er(ur,Ir,Ti=ur.length){for(Ir<0&&(Ir+=ur.length),Ti<0?Ti+=ur.length:Ti>ur.length&&(Ti=ur.length);Ir1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function fCe(...t){return ld(()=>Ux(t))}function ld(t){return{dispose:hCe(()=>{t()})}}var ZH=class KH{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ux(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?KH.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};ZH.DISABLE_DISPOSED_WARNING=!1;var h_=ZH,Sc=class{constructor(){this._store=new h_,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Sc.None=Object.freeze({dispose(){}});var H2=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},B1=typeof window=="object"?window:globalThis,p9=class m9{constructor(e){this.element=e,this.next=m9.Undefined,this.prev=m9.Undefined}};p9.Undefined=new p9(void 0);var wd=p9,xF=class{constructor(){this._first=wd.Undefined,this._last=wd.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===wd.Undefined}clear(){let e=this._first;for(;e!==wd.Undefined;){let r=e.next;e.prev=wd.Undefined,e.next=wd.Undefined,e=r}this._first=wd.Undefined,this._last=wd.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let c=new wd(e);if(this._first===wd.Undefined)this._first=c,this._last=c;else if(r){let H=this._last;this._last=c,c.prev=H,H.next=c}else{let H=this._first;this._first=c,c.next=H,H.prev=c}this._size+=1;let S=!1;return()=>{S||(S=!0,this._remove(c))}}shift(){if(this._first!==wd.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==wd.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==wd.Undefined&&e.next!==wd.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===wd.Undefined&&e.next===wd.Undefined?(this._first=wd.Undefined,this._last=wd.Undefined):e.next===wd.Undefined?(this._last=this._last.prev,this._last.next=wd.Undefined):e.prev===wd.Undefined&&(this._first=this._first.next,this._first.prev=wd.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==wd.Undefined;)yield e.element,e=e.next}},dCe=globalThis.performance&&typeof globalThis.performance.now=="function",pCe=class YH{static create(e){return new YH(e)}constructor(e){this._now=dCe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},_0;(t=>{t.None=()=>Sc.None;function e(vr,dr){return Xe(vr,()=>{},0,void 0,!0,void 0,dr)}t.defer=e;function r(vr){return(dr,Ar=null,ti)=>{let Xr=!1,ei;return ei=vr(Di=>{if(!Xr)return ei?ei.dispose():Xr=!0,dr.call(Ar,Di)},null,ti),Xr&&ei.dispose(),ei}}t.once=r;function c(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>ti.call(Xr,dr(Di)),null,ei),Ar)}t.map=c;function S(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>{dr(Di),ti.call(Xr,Di)},null,ei),Ar)}t.forEach=S;function H(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>dr(Di)&&ti.call(Xr,Di),null,ei),Ar)}t.filter=H;function Z(vr){return vr}t.signal=Z;function ue(...vr){return(dr,Ar=null,ti)=>{let Xr=fCe(...vr.map(ei=>ei(Di=>dr.call(Ar,Di))));return Re(Xr,ti)}}t.any=ue;function be(vr,dr,Ar,ti){let Xr=Ar;return c(vr,ei=>(Xr=dr(Xr,ei),Xr),ti)}t.reduce=be;function Se(vr,dr){let Ar,ti={onWillAddFirstListener(){Ar=vr(Xr.fire,Xr)},onDidRemoveLastListener(){Ar?.dispose()}},Xr=new Ms(ti);return dr?.add(Xr),Xr.event}function Re(vr,dr){return dr instanceof Array?dr.push(vr):dr&&dr.add(vr),vr}function Xe(vr,dr,Ar=100,ti=!1,Xr=!1,ei,Di){let qn,Qn,ka,Ta=0,so,Yn={leakWarningThreshold:ei,onWillAddFirstListener(){qn=vr(an=>{Ta++,Qn=dr(Qn,an),ti&&!ka&&(sn.fire(Qn),Qn=void 0),so=()=>{let zn=Qn;Qn=void 0,ka=void 0,(!ti||Ta>1)&&sn.fire(zn),Ta=0},typeof Ar=="number"?(clearTimeout(ka),ka=setTimeout(so,Ar)):ka===void 0&&(ka=0,queueMicrotask(so))})},onWillRemoveListener(){Xr&&Ta>0&&so?.()},onDidRemoveLastListener(){so=void 0,qn.dispose()}},sn=new Ms(Yn);return Di?.add(sn),sn.event}t.debounce=Xe;function vt(vr,dr=0,Ar){return t.debounce(vr,(ti,Xr)=>ti?(ti.push(Xr),ti):[Xr],dr,void 0,!0,void 0,Ar)}t.accumulate=vt;function bt(vr,dr=(ti,Xr)=>ti===Xr,Ar){let ti=!0,Xr;return H(vr,ei=>{let Di=ti||!dr(ei,Xr);return ti=!1,Xr=ei,Di},Ar)}t.latch=bt;function kt(vr,dr,Ar){return[t.filter(vr,dr,Ar),t.filter(vr,ti=>!dr(ti),Ar)]}t.split=kt;function Dt(vr,dr=!1,Ar=[],ti){let Xr=Ar.slice(),ei=vr(Qn=>{Xr?Xr.push(Qn):qn.fire(Qn)});ti&&ti.add(ei);let Di=()=>{Xr?.forEach(Qn=>qn.fire(Qn)),Xr=null},qn=new Ms({onWillAddFirstListener(){ei||(ei=vr(Qn=>qn.fire(Qn)),ti&&ti.add(ei))},onDidAddFirstListener(){Xr&&(dr?setTimeout(Di):Di())},onDidRemoveLastListener(){ei&&ei.dispose(),ei=null}});return ti&&ti.add(qn),qn.event}t.buffer=Dt;function rr(vr,dr){return(Ar,ti,Xr)=>{let ei=dr(new Fe);return vr(function(Di){let qn=ei.evaluate(Di);qn!==Er&&Ar.call(ti,qn)},void 0,Xr)}}t.chain=rr;let Er=Symbol("HaltChainable");class Fe{constructor(){this.steps=[]}map(dr){return this.steps.push(dr),this}forEach(dr){return this.steps.push(Ar=>(dr(Ar),Ar)),this}filter(dr){return this.steps.push(Ar=>dr(Ar)?Ar:Er),this}reduce(dr,Ar){let ti=Ar;return this.steps.push(Xr=>(ti=dr(ti,Xr),ti)),this}latch(dr=(Ar,ti)=>Ar===ti){let Ar=!0,ti;return this.steps.push(Xr=>{let ei=Ar||!dr(Xr,ti);return Ar=!1,ti=Xr,ei?Xr:Er}),this}evaluate(dr){for(let Ar of this.steps)if(dr=Ar(dr),dr===Er)break;return dr}}function wi(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.on(dr,ti),ei=()=>vr.removeListener(dr,ti),Di=new Ms({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromNodeEventEmitter=wi;function ur(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.addEventListener(dr,ti),ei=()=>vr.removeEventListener(dr,ti),Di=new Ms({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromDOMEventEmitter=ur;function Ir(vr){return new Promise(dr=>r(vr)(dr))}t.toPromise=Ir;function Ti(vr){let dr=new Ms;return vr.then(Ar=>{dr.fire(Ar)},()=>{dr.fire(void 0)}).finally(()=>{dr.dispose()}),dr.event}t.fromPromise=Ti;function _i(vr,dr){return vr(Ar=>dr.fire(Ar))}t.forward=_i;function Ci(vr,dr,Ar){return dr(Ar),vr(ti=>dr(ti))}t.runAndSubscribe=Ci;class ii{constructor(dr,Ar){this._observable=dr,this._counter=0,this._hasChanged=!1;let ti={onWillAddFirstListener:()=>{dr.addObserver(this)},onDidRemoveLastListener:()=>{dr.removeObserver(this)}};this.emitter=new Ms(ti),Ar&&Ar.add(this.emitter)}beginUpdate(dr){this._counter++}handlePossibleChange(dr){}handleChange(dr,Ar){this._hasChanged=!0}endUpdate(dr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ji(vr,dr){return new ii(vr,dr).emitter.event}t.fromObservable=Ji;function vi(vr){return(dr,Ar,ti)=>{let Xr=0,ei=!1,Di={beginUpdate(){Xr++},endUpdate(){Xr--,Xr===0&&(vr.reportChanges(),ei&&(ei=!1,dr.call(Ar)))},handlePossibleChange(){},handleChange(){ei=!0}};vr.addObserver(Di),vr.reportChanges();let qn={dispose(){vr.removeObserver(Di)}};return ti instanceof h_?ti.add(qn):Array.isArray(ti)&&ti.push(qn),qn}}t.fromObservableLight=vi})(_0||={});var g9=class v9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${v9._idPool++}`,v9.all.add(this)}start(e){this._stopWatch=new pCe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};g9.all=new Set,g9._idPool=0;var mCe=g9,gCe=-1,XH=class JH{constructor(e,r,c=(JH._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let H=this._stacks.get(e.value)||0;this._stacks.set(e.value,H-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},zCe=new DCe;function xT(t){OCe(t)||zCe.onUnexpectedError(t)}var d9="Canceled";function OCe(t){return t instanceof BCe?!0:t instanceof Error&&t.name===d9&&t.message===d9}var BCe=class extends Error{constructor(){super(d9),this.name=this.message}};function RCe(t){return new Error(`Illegal argument: ${t}`)}var bF=class p9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof p9)return e;let r=new p9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},m9=class KH extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,KH.prototype)}};function Hm(t,e=0){return t[t.length-(1+e)]}var FCe;(t=>{function e($){return $<0}t.isLessThan=e;function r($){return $<=0}t.isLessThanOrEqual=r;function c($){return $>0}t.isGreaterThan=c;function S($){return $===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(FCe||={});function NCe(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var YH;(t=>{function e(or){return or&&typeof or=="object"&&typeof or[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(or){yield or}t.single=S;function $(or){return e(or)?or:S(or)}t.wrap=$;function Z(or){return or||r}t.from=Z;function*ue(or){for(let Cr=or.length-1;Cr>=0;Cr--)yield or[Cr]}t.reverse=ue;function xe(or){return!or||or[Symbol.iterator]().next().done===!0}t.isEmpty=xe;function Se(or){return or[Symbol.iterator]().next().value}t.first=Se;function Ne(or,Cr){let gi=0;for(let Si of or)if(Cr(Si,gi++))return!0;return!1}t.some=Ne;function it(or,Cr){for(let gi of or)if(Cr(gi))return gi}t.find=it;function*pt(or,Cr){for(let gi of or)Cr(gi)&&(yield gi)}t.filter=pt;function*bt(or,Cr){let gi=0;for(let Si of or)yield Cr(Si,gi++)}t.map=bt;function*wt(or,Cr){let gi=0;for(let Si of or)yield*Cr(Si,gi++)}t.flatMap=wt;function*Dt(...or){for(let Cr of or)yield*Cr}t.concat=Dt;function Zt(or,Cr,gi){let Si=gi;for(let Ci of or)Si=Cr(Si,Ci);return Si}t.reduce=Zt;function*Mr(or,Cr,gi=or.length){for(Cr<0&&(Cr+=or.length),gi<0?gi+=or.length:gi>or.length&&(gi=or.length);Cr1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function jCe(...t){return cd(()=>$x(t))}function cd(t){return{dispose:NCe(()=>{t()})}}var XH=class JH{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{$x(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?JH.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};XH.DISABLE_DISPOSED_WARNING=!1;var p_=XH,Sc=class{constructor(){this._store=new p_,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Sc.None=Object.freeze({dispose(){}});var W2=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},R1=typeof window=="object"?window:globalThis,g9=class v9{constructor(e){this.element=e,this.next=v9.Undefined,this.prev=v9.Undefined}};g9.Undefined=new g9(void 0);var kd=g9,wF=class{constructor(){this._first=kd.Undefined,this._last=kd.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===kd.Undefined}clear(){let e=this._first;for(;e!==kd.Undefined;){let r=e.next;e.prev=kd.Undefined,e.next=kd.Undefined,e=r}this._first=kd.Undefined,this._last=kd.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let c=new kd(e);if(this._first===kd.Undefined)this._first=c,this._last=c;else if(r){let $=this._last;this._last=c,c.prev=$,$.next=c}else{let $=this._first;this._first=c,c.next=$,$.prev=c}this._size+=1;let S=!1;return()=>{S||(S=!0,this._remove(c))}}shift(){if(this._first!==kd.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==kd.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==kd.Undefined&&e.next!==kd.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===kd.Undefined&&e.next===kd.Undefined?(this._first=kd.Undefined,this._last=kd.Undefined):e.next===kd.Undefined?(this._last=this._last.prev,this._last.next=kd.Undefined):e.prev===kd.Undefined&&(this._first=this._first.next,this._first.prev=kd.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==kd.Undefined;)yield e.element,e=e.next}},UCe=globalThis.performance&&typeof globalThis.performance.now=="function",$Ce=class QH{static create(e){return new QH(e)}constructor(e){this._now=UCe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},x0;(t=>{t.None=()=>Sc.None;function e(gr,fr){return it(gr,()=>{},0,void 0,!0,void 0,fr)}t.defer=e;function r(gr){return(fr,Sr=null,ei)=>{let Jr=!1,ti;return ti=gr(Di=>{if(!Jr)return ti?ti.dispose():Jr=!0,fr.call(Sr,Di)},null,ei),Jr&&ti.dispose(),ti}}t.once=r;function c(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>ei.call(Jr,fr(Di)),null,ti),Sr)}t.map=c;function S(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>{fr(Di),ei.call(Jr,Di)},null,ti),Sr)}t.forEach=S;function $(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>fr(Di)&&ei.call(Jr,Di),null,ti),Sr)}t.filter=$;function Z(gr){return gr}t.signal=Z;function ue(...gr){return(fr,Sr=null,ei)=>{let Jr=jCe(...gr.map(ti=>ti(Di=>fr.call(Sr,Di))));return Ne(Jr,ei)}}t.any=ue;function xe(gr,fr,Sr,ei){let Jr=Sr;return c(gr,ti=>(Jr=fr(Jr,ti),Jr),ei)}t.reduce=xe;function Se(gr,fr){let Sr,ei={onWillAddFirstListener(){Sr=gr(Jr.fire,Jr)},onDidRemoveLastListener(){Sr?.dispose()}},Jr=new Es(ei);return fr?.add(Jr),Jr.event}function Ne(gr,fr){return fr instanceof Array?fr.push(gr):fr&&fr.add(gr),gr}function it(gr,fr,Sr=100,ei=!1,Jr=!1,ti,Di){let En,Zn,ga,ya=0,ro,qn={leakWarningThreshold:ti,onWillAddFirstListener(){En=gr(nn=>{ya++,Zn=fr(Zn,nn),ei&&!ga&&(ln.fire(Zn),Zn=void 0),ro=()=>{let On=Zn;Zn=void 0,ga=void 0,(!ei||ya>1)&&ln.fire(On),ya=0},typeof Sr=="number"?(clearTimeout(ga),ga=setTimeout(ro,Sr)):ga===void 0&&(ga=0,queueMicrotask(ro))})},onWillRemoveListener(){Jr&&ya>0&&ro?.()},onDidRemoveLastListener(){ro=void 0,En.dispose()}},ln=new Es(qn);return Di?.add(ln),ln.event}t.debounce=it;function pt(gr,fr=0,Sr){return t.debounce(gr,(ei,Jr)=>ei?(ei.push(Jr),ei):[Jr],fr,void 0,!0,void 0,Sr)}t.accumulate=pt;function bt(gr,fr=(ei,Jr)=>ei===Jr,Sr){let ei=!0,Jr;return $(gr,ti=>{let Di=ei||!fr(ti,Jr);return ei=!1,Jr=ti,Di},Sr)}t.latch=bt;function wt(gr,fr,Sr){return[t.filter(gr,fr,Sr),t.filter(gr,ei=>!fr(ei),Sr)]}t.split=wt;function Dt(gr,fr=!1,Sr=[],ei){let Jr=Sr.slice(),ti=gr(Zn=>{Jr?Jr.push(Zn):En.fire(Zn)});ei&&ei.add(ti);let Di=()=>{Jr?.forEach(Zn=>En.fire(Zn)),Jr=null},En=new Es({onWillAddFirstListener(){ti||(ti=gr(Zn=>En.fire(Zn)),ei&&ei.add(ti))},onDidAddFirstListener(){Jr&&(fr?setTimeout(Di):Di())},onDidRemoveLastListener(){ti&&ti.dispose(),ti=null}});return ei&&ei.add(En),En.event}t.buffer=Dt;function Zt(gr,fr){return(Sr,ei,Jr)=>{let ti=fr(new ze);return gr(function(Di){let En=ti.evaluate(Di);En!==Mr&&Sr.call(ei,En)},void 0,Jr)}}t.chain=Zt;let Mr=Symbol("HaltChainable");class ze{constructor(){this.steps=[]}map(fr){return this.steps.push(fr),this}forEach(fr){return this.steps.push(Sr=>(fr(Sr),Sr)),this}filter(fr){return this.steps.push(Sr=>fr(Sr)?Sr:Mr),this}reduce(fr,Sr){let ei=Sr;return this.steps.push(Jr=>(ei=fr(ei,Jr),ei)),this}latch(fr=(Sr,ei)=>Sr===ei){let Sr=!0,ei;return this.steps.push(Jr=>{let ti=Sr||!fr(Jr,ei);return Sr=!1,ei=Jr,ti?Jr:Mr}),this}evaluate(fr){for(let Sr of this.steps)if(fr=Sr(fr),fr===Mr)break;return fr}}function ni(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.on(fr,ei),ti=()=>gr.removeListener(fr,ei),Di=new Es({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromNodeEventEmitter=ni;function or(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.addEventListener(fr,ei),ti=()=>gr.removeEventListener(fr,ei),Di=new Es({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromDOMEventEmitter=or;function Cr(gr){return new Promise(fr=>r(gr)(fr))}t.toPromise=Cr;function gi(gr){let fr=new Es;return gr.then(Sr=>{fr.fire(Sr)},()=>{fr.fire(void 0)}).finally(()=>{fr.dispose()}),fr.event}t.fromPromise=gi;function Si(gr,fr){return gr(Sr=>fr.fire(Sr))}t.forward=Si;function Ci(gr,fr,Sr){return fr(Sr),gr(ei=>fr(ei))}t.runAndSubscribe=Ci;class ri{constructor(fr,Sr){this._observable=fr,this._counter=0,this._hasChanged=!1;let ei={onWillAddFirstListener:()=>{fr.addObserver(this)},onDidRemoveLastListener:()=>{fr.removeObserver(this)}};this.emitter=new Es(ei),Sr&&Sr.add(this.emitter)}beginUpdate(fr){this._counter++}handlePossibleChange(fr){}handleChange(fr,Sr){this._hasChanged=!0}endUpdate(fr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function on(gr,fr){return new ri(gr,fr).emitter.event}t.fromObservable=on;function yi(gr){return(fr,Sr,ei)=>{let Jr=0,ti=!1,Di={beginUpdate(){Jr++},endUpdate(){Jr--,Jr===0&&(gr.reportChanges(),ti&&(ti=!1,fr.call(Sr)))},handlePossibleChange(){},handleChange(){ti=!0}};gr.addObserver(Di),gr.reportChanges();let En={dispose(){gr.removeObserver(Di)}};return ei instanceof p_?ei.add(En):Array.isArray(ei)&&ei.push(En),En}}t.fromObservableLight=yi})(x0||={});var y9=class _9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${_9._idPool++}`,_9.all.add(this)}start(e){this._stopWatch=new $Ce,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};y9.all=new Set,y9._idPool=0;var HCe=y9,VCe=-1,eV=class tV{constructor(e,r,c=(tV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let $=this._stacks.get(e.value)||0;this._stacks.set(e.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let be=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new xCe(`${ue}. HINT: Stack shows most frequent listener (${be[1]}-times)`,be[0]);return(this._options?.onListenerError||yT)(Se),Sc.None}if(this._disposed)return Sc.None;r&&(e=e.bind(r));let S=new G7(e),H;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=yCe.create(),H=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof G7?(this._deliveryQueue??=new TCe,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=ld(()=>{H?.(),this._removeListener(S)});return c instanceof h_?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*wCe<=r.length){let H=0;for(let Z=0;Z0}},TCe=class{constructor(){this.i=-1,this.end=0}enqueue(e,r,c){this.i=0,this.end=c,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},y9=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ms,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ms,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,r){if(this.getZoomLevel(r)===e)return;let c=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(c,e),this._onDidChangeZoomLevel.fire(c)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),e)}setFullscreen(e,r){if(this.isFullscreen(r)===e)return;let c=this.getWindowId(r);this.mapWindowIdToFullScreen.set(c,e),this._onDidChangeFullscreen.fire(c)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};y9.INSTANCE=new y9;var rL=y9;function SCe(t,e,r){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",r)}rL.INSTANCE.onDidChangeZoomLevel;function CCe(t){return rL.INSTANCE.getZoomFactor(t)}rL.INSTANCE.onDidChangeFullscreen;var K2=typeof navigator=="object"?navigator.userAgent:"",_9=K2.indexOf("Firefox")>=0,ACe=K2.indexOf("AppleWebKit")>=0,iL=K2.indexOf("Chrome")>=0,MCe=!iL&&K2.indexOf("Safari")>=0;K2.indexOf("Electron/")>=0;K2.indexOf("Android")>=0;var Z7=!1;if(typeof B1.matchMedia=="function"){let t=B1.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=B1.matchMedia("(display-mode: fullscreen)");Z7=t.matches,SCe(B1,t,({matches:r})=>{Z7&&e.matches||(Z7=r)})}var k2="en",x9=!1,b9=!1,_T=!1,eV=!1,Kk,xT=k2,bF=k2,ECe,S1,Px=globalThis,Wm;typeof Px.vscode<"u"&&typeof Px.vscode.process<"u"?Wm=Px.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Wm=process);var LCe=typeof Wm?.versions?.electron=="string",PCe=LCe&&Wm?.type==="renderer";if(typeof Wm=="object"){x9=Wm.platform==="win32",b9=Wm.platform==="darwin",_T=Wm.platform==="linux",_T&&Wm.env.SNAP&&Wm.env.SNAP_REVISION,Wm.env.CI||Wm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Kk=k2,xT=k2;let t=Wm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Kk=e.userLocale,bF=e.osLocale,xT=e.resolvedLanguage||k2,ECe=e.languagePack?.translationsConfigFile}catch{}eV=!0}else typeof navigator=="object"&&!PCe?(S1=navigator.userAgent,x9=S1.indexOf("Windows")>=0,b9=S1.indexOf("Macintosh")>=0,(S1.indexOf("Macintosh")>=0||S1.indexOf("iPad")>=0||S1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_T=S1.indexOf("Linux")>=0,S1?.indexOf("Mobi")>=0,xT=globalThis._VSCODE_NLS_LANGUAGE||k2,Kk=navigator.language.toLowerCase(),bF=Kk):console.error("Unable to resolve platform.");var tV=x9,Pv=b9,ICe=_T,wF=eV,Ov=S1,Fy=xT,DCe;(t=>{function e(){return Fy}t.value=e;function r(){return Fy.length===2?Fy==="en":Fy.length>=3?Fy[0]==="e"&&Fy[1]==="n"&&Fy[2]==="-":!1}t.isDefaultVariant=r;function c(){return Fy==="en"}t.isDefault=c})(DCe||={});var zCe=typeof Px.postMessage=="function"&&!Px.importScripts;(()=>{if(zCe){let t=[];Px.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),Px.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var OCe=!!(Ov&&Ov.indexOf("Chrome")>=0);Ov&&Ov.indexOf("Firefox")>=0;!OCe&&Ov&&Ov.indexOf("Safari")>=0;Ov&&Ov.indexOf("Edg/")>=0;Ov&&Ov.indexOf("Android")>=0;var g2=typeof navigator=="object"?navigator:{};wF||document.queryCommandSupported&&document.queryCommandSupported("copy")||g2&&g2.clipboard&&g2.clipboard.writeText,wF||g2&&g2.clipboard&&g2.clipboard.readText;var nL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,r){this._keyCodeToStr[e]=r,this._strToKeyCode[r.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},K7=new nL,kF=new nL,TF=new nL,BCe=new Array(230),rV;(t=>{function e(ue){return K7.keyCodeToStr(ue)}t.toString=e;function r(ue){return K7.strToKeyCode(ue)}t.fromString=r;function c(ue){return kF.keyCodeToStr(ue)}t.toUserSettingsUS=c;function S(ue){return TF.keyCodeToStr(ue)}t.toUserSettingsGeneral=S;function H(ue){return kF.strToKeyCode(ue)||TF.strToKeyCode(ue)}t.fromUserSettings=H;function Z(ue){if(ue>=98&&ue<=113)return null;switch(ue){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return K7.keyCodeToStr(ue)}t.toElectronAccelerator=Z})(rV||={});var RCe=class iV{constructor(e,r,c,S,H){this.ctrlKey=e,this.shiftKey=r,this.altKey=c,this.metaKey=S,this.keyCode=H}equals(e){return e instanceof iV&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",c=this.altKey?"1":"0",S=this.metaKey?"1":"0";return`K${e}${r}${c}${S}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new FCe([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},FCe=class{constructor(t){if(t.length===0)throw uCe("chords");this.chords=t}getHashCode(){let t="";for(let e=0,r=this.chords.length;e{function e(r){return r===t.None||r===t.Cancelled||r instanceof GCe?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_0.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nV})})(qCe||={});var GCe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?nV:(this._emitter||(this._emitter=new Ms),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},aL=class{constructor(e,r){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new d9("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new d9("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}},ZCe=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,c=globalThis){if(this.isDisposed)throw new d9("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let S=c.setInterval(()=>{e()},r);this.disposable=ld(()=>{c.clearInterval(S),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},KCe;(t=>{async function e(c){let S,H=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return H}t.settled=e;function r(c){return new Promise(async(S,H)=>{try{await c(S,H)}catch(Z){H(Z)}})}t.withAsyncBody=r})(KCe||={});var MF=class cg{static fromArray(e){return new cg(r=>{r.emitMany(e)})}static fromPromise(e){return new cg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new cg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new cg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Ms,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new cg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return cg.map(this,e)}static filter(e,r){return new cg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return cg.filter(this,e)}static coalesce(e){return cg.filter(e,r=>!!r)}coalesce(){return cg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return cg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};MF.EMPTY=MF.fromArray([]);var{getWindow:Mv,getWindowId:YCe,onDidRegisterWindow:XCe}=function(){let t=new Map,e={window:B1,disposables:new h_};t.set(B1.vscodeWindowId,e);let r=new Ms,c=new Ms,S=new Ms;function H(Z,ue){return(typeof Z=="number"?t.get(Z):void 0)??(ue?e:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:S.event,onDidUnregisterWindow:c.event,registerWindow(Z){if(t.has(Z.vscodeWindowId))return Sc.None;let ue=new h_,be={window:Z,disposables:ue.add(new h_)};return t.set(Z.vscodeWindowId,be),ue.add(ld(()=>{t.delete(Z.vscodeWindowId),c.fire(Z)})),ue.add(ju(Z,Jp.BEFORE_UNLOAD,()=>{S.fire(Z)})),r.fire(be),ue},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(Z){return Z.vscodeWindowId},hasWindow(Z){return t.has(Z)},getWindowById:H,getWindow(Z){let ue=Z;if(ue?.ownerDocument?.defaultView)return ue.ownerDocument.defaultView.window;let be=Z;return be?.view?be.view.window:B1},getDocument(Z){return Mv(Z).document}}}(),JCe=class{constructor(e,r,c,S){this._node=e,this._type=r,this._handler=c,this._options=S||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function ju(t,e,r,c){return new JCe(t,e,r,c)}var EF=function(t,e,r,c){return ju(t,e,r,c)},oL,QCe=class extends ZCe{constructor(t){super(),this.defaultTarget=t&&Mv(t)}cancelAndSet(t,e,r){return super.cancelAndSet(t,e,r??this.defaultTarget)}},LF=class{constructor(e,r=0){this._runner=e,this.priority=r,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){yT(e)}}static sort(e,r){return r.priority-e.priority}};(function(){let t=new Map,e=new Map,r=new Map,c=new Map,S=H=>{r.set(H,!1);let Z=t.get(H)??[];for(e.set(H,Z),t.set(H,[]),c.set(H,!0);Z.length>0;)Z.sort(LF.sort),Z.shift().execute();c.set(H,!1)};oL=(H,Z,ue=0)=>{let be=YCe(H),Se=new LF(Z,ue),Re=t.get(be);return Re||(Re=[],t.set(be,Re)),Re.push(Se),r.get(be)||(r.set(be,!0),H.requestAnimationFrame(()=>S(be))),Se}})();function eAe(t){let e=t.getBoundingClientRect(),r=Mv(t);return{left:e.left+r.scrollX,top:e.top+r.scrollY,width:e.width,height:e.height}}var Jp={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},tAe=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=wm(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=wm(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=wm(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=wm(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=wm(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=wm(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=wm(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=wm(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=wm(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=wm(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=wm(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=wm(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=wm(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=wm(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function wm(t){return typeof t=="number"?`${t}px`:t}function S5(t){return new tAe(t)}var aV=class{constructor(){this._hooks=new h_,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,r){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let c=this._onStopCallback;this._onStopCallback=null,e&&c&&c(r)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,r,c,S,H){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=S,this._onStopCallback=H;let Z=e;try{e.setPointerCapture(r),this._hooks.add(ld(()=>{try{e.releasePointerCapture(r)}catch{}}))}catch{Z=Mv(e)}this._hooks.add(ju(Z,Jp.POINTER_MOVE,ue=>{if(ue.buttons!==c){this.stopMonitoring(!0);return}ue.preventDefault(),this._pointerMoveCallback(ue)})),this._hooks.add(ju(Z,Jp.POINTER_UP,ue=>this.stopMonitoring(!0)))}};function rAe(t,e,r){let c=null,S=null;if(typeof r.value=="function"?(c="value",S=r.value,S.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(c="get",S=r.get),!S)throw new Error("not supported");let H=`$memoize$${e}`;r[c]=function(...Z){return this.hasOwnProperty(H)||Object.defineProperty(this,H,{configurable:!1,enumerable:!1,writable:!1,value:S.apply(this,Z)}),this[H]}}var xv;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(xv||={});var n5=class D0 extends Sc{constructor(){super(),this.dispatched=!1,this.targets=new xF,this.ignoreTargets=new xF,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(_0.runAndSubscribe(XCe,({window:e,disposables:r})=>{r.add(ju(e.document,"touchstart",c=>this.onTouchStart(c),{passive:!1})),r.add(ju(e.document,"touchend",c=>this.onTouchEnd(e,c))),r.add(ju(e.document,"touchmove",c=>this.onTouchMove(c),{passive:!1}))},{window:B1,disposables:this._store}))}static addTarget(e){if(!D0.isTouchDevice())return Sc.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.targets.push(e);return ld(r)}static ignoreTarget(e){if(!D0.isTouchDevice())return Sc.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.ignoreTargets.push(e);return ld(r)}static isTouchDevice(){return"ontouchstart"in B1||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let c=0,S=e.targetTouches.length;c=D0.HOLD_DELAY&&Math.abs(be.initialPageX-Hm(be.rollingPageX))<30&&Math.abs(be.initialPageY-Hm(be.rollingPageY))<30){let Re=this.newGestureEvent(xv.Contextmenu,be.initialTarget);Re.pageX=Hm(be.rollingPageX),Re.pageY=Hm(be.rollingPageY),this.dispatchEvent(Re)}else if(S===1){let Re=Hm(be.rollingPageX),Xe=Hm(be.rollingPageY),vt=Hm(be.rollingTimestamps)-be.rollingTimestamps[0],bt=Re-be.rollingPageX[0],kt=Xe-be.rollingPageY[0],Dt=[...this.targets].filter(rr=>be.initialTarget instanceof Node&&rr.contains(be.initialTarget));this.inertia(e,Dt,c,Math.abs(bt)/vt,bt>0?1:-1,Re,Math.abs(kt)/vt,kt>0?1:-1,Xe)}this.dispatchEvent(this.newGestureEvent(xv.End,be.initialTarget)),delete this.activeTouches[ue.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,r){let c=document.createEvent("CustomEvent");return c.initEvent(e,!1,!0),c.initialTarget=r,c.tapCount=0,c}dispatchEvent(e){if(e.type===xv.Tap){let r=new Date().getTime(),c=0;r-this._lastSetTapCountTime>D0.CLEAR_TAP_COUNT_TIME?c=1:c=2,this._lastSetTapCountTime=r,e.tapCount=c}else(e.type===xv.Change||e.type===xv.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let c of this.ignoreTargets)if(c.contains(e.initialTarget))return;let r=[];for(let c of this.targets)if(c.contains(e.initialTarget)){let S=0,H=e.initialTarget;for(;H&&H!==c;)S++,H=H.parentElement;r.push([S,c])}r.sort((c,S)=>c[0]-S[0]);for(let[c,S]of r)S.dispatchEvent(e),this.dispatched=!0}}inertia(e,r,c,S,H,Z,ue,be,Se){this.handle=oL(e,()=>{let Re=Date.now(),Xe=Re-c,vt=0,bt=0,kt=!0;S+=D0.SCROLL_FRICTION*Xe,ue+=D0.SCROLL_FRICTION*Xe,S>0&&(kt=!1,vt=H*S*Xe),ue>0&&(kt=!1,bt=be*ue*Xe);let Dt=this.newGestureEvent(xv.Change);Dt.translationX=vt,Dt.translationY=bt,r.forEach(rr=>rr.dispatchEvent(Dt)),kt||this.inertia(e,r,Re,S,H,Z+vt,ue,be,Se+bt)})}onTouchMove(e){let r=Date.now();for(let c=0,S=e.changedTouches.length;c3&&(Z.rollingPageX.shift(),Z.rollingPageY.shift(),Z.rollingTimestamps.shift()),Z.rollingPageX.push(H.pageX),Z.rollingPageY.push(H.pageY),Z.rollingTimestamps.push(r)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};n5.SCROLL_FRICTION=-.005,n5.HOLD_DELAY=700,n5.CLEAR_TAP_COUNT_TIME=400,Vd([rAe],n5,"isTouchDevice",1);var iAe=n5,sL=class extends Sc{onclick(e,r){this._register(ju(e,Jp.CLICK,c=>r(new Yk(Mv(e),c))))}onmousedown(e,r){this._register(ju(e,Jp.MOUSE_DOWN,c=>r(new Yk(Mv(e),c))))}onmouseover(e,r){this._register(ju(e,Jp.MOUSE_OVER,c=>r(new Yk(Mv(e),c))))}onmouseleave(e,r){this._register(ju(e,Jp.MOUSE_LEAVE,c=>r(new Yk(Mv(e),c))))}onkeydown(e,r){this._register(ju(e,Jp.KEY_DOWN,c=>r(new SF(c))))}onkeyup(e,r){this._register(ju(e,Jp.KEY_UP,c=>r(new SF(c))))}oninput(e,r){this._register(ju(e,Jp.INPUT,r))}onblur(e,r){this._register(ju(e,Jp.BLUR,r))}onfocus(e,r){this._register(ju(e,Jp.FOCUS,r))}onchange(e,r){this._register(ju(e,Jp.CHANGE,r))}ignoreGesture(e){return iAe.ignoreTarget(e)}},PF=11,nAe=class extends sL{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=PF+"px",this.domNode.style.height=PF+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new aV),this._register(EF(this.bgDomNode,Jp.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(EF(this.domNode,Jp.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new QCe),this._pointerdownScheduleRepeatTimer=this._register(new aL)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mv(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},aAe=class w9{constructor(e,r,c,S,H,Z,ue){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,c=c|0,S=S|0,H=H|0,Z=Z|0,ue=ue|0),this.rawScrollLeft=S,this.rawScrollTop=ue,r<0&&(r=0),S+r>c&&(S=c-r),S<0&&(S=0),H<0&&(H=0),ue+H>Z&&(ue=Z-H),ue<0&&(ue=0),this.width=r,this.scrollWidth=c,this.scrollLeft=S,this.height=H,this.scrollHeight=Z,this.scrollTop=ue}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,r){return new w9(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new w9(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,r){let c=this.width!==e.width,S=this.scrollWidth!==e.scrollWidth,H=this.scrollLeft!==e.scrollLeft,Z=this.height!==e.height,ue=this.scrollHeight!==e.scrollHeight,be=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:r,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:c,scrollWidthChanged:S,scrollLeftChanged:H,heightChanged:Z,scrollHeightChanged:ue,scrollTopChanged:be}}},oAe=class extends Sc{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Ms),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new aAe(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){let r=this._state.withScrollDimensions(t,e);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let r=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let c;e?c=new DF(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):c=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=c}else{let r=this._state.withScrollPosition(t);this._smoothScrolling=DF.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let r=this._state;r.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(r,e)))}},IF=class{constructor(e,r,c){this.scrollLeft=e,this.scrollTop=r,this.isDone=c}};function Y7(t,e){let r=e-t;return function(c){return t+r*uAe(c)}}function sAe(t,e,r){return function(c){return c2.5*c){let S,H;return e{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},hAe=140,oV=class extends sL{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new cAe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new aV),this._shouldRender=!0,this.domNode=S5(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ju(this.domNode.domNode,Jp.POINTER_DOWN,r=>this._domNodePointerDown(r)))}_createArrow(e){let r=this._register(new nAe(e));this.domNode.domNode.appendChild(r.bgDomNode),this.domNode.domNode.appendChild(r.domNode)}_createSlider(e,r,c,S){this.slider=S5(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(r),typeof c=="number"&&this.slider.setWidth(c),typeof S=="number"&&this.slider.setHeight(S),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ju(this.slider.domNode,Jp.POINTER_DOWN,H=>{H.button===0&&(H.preventDefault(),this._sliderPointerDown(H))})),this.onclick(this.slider.domNode,H=>{H.leftButton&&H.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let r=this.domNode.domNode.getClientRects()[0].top,c=r+this._scrollbarState.getSliderPosition(),S=r+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),H=this._sliderPointerPosition(e);c<=H&&H<=S?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let r,c;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")r=e.offsetX,c=e.offsetY;else{let H=eAe(this.domNode.domNode);r=e.pageX-H.left,c=e.pageY-H.top}let S=this._pointerDownRelativePosition(r,c);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(S):this._scrollbarState.getDesiredScrollPositionFromOffset(S)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let r=this._sliderPointerPosition(e),c=this._sliderOrthogonalPointerPosition(e),S=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,H=>{let Z=this._sliderOrthogonalPointerPosition(H),ue=Math.abs(Z-c);if(tV&&ue>hAe){this._setDesiredScrollPositionNow(S.getScrollPosition());return}let be=this._sliderPointerPosition(H)-r;this._setDesiredScrollPositionNow(S.getDesiredScrollPositionFromDelta(be))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let r={};this.writeScrollPosition(r,e),this._scrollable.setScrollPositionNow(r)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},sV=class T9{constructor(e,r,c,S,H,Z){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(c),this._arrowSize=Math.round(e),this._visibleSize=S,this._scrollSize=H,this._scrollPosition=Z,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new T9(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let r=Math.round(e);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(e){let r=Math.round(e);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let r=Math.round(e);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,r,c,S,H){let Z=Math.max(0,c-e),ue=Math.max(0,Z-2*r),be=S>0&&S>c;if(!be)return{computedAvailableSize:Math.round(Z),computedIsNeeded:be,computedSliderSize:Math.round(ue),computedSliderRatio:0,computedSliderPosition:0};let Se=Math.round(Math.max(20,Math.floor(c*ue/S))),Re=(ue-Se)/(S-c),Xe=H*Re;return{computedAvailableSize:Math.round(Z),computedIsNeeded:be,computedSliderSize:Math.round(Se),computedSliderRatio:Re,computedSliderPosition:Math.round(Xe)}}_refreshComputedValues(){let e=T9._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let r=e-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let r=e-this._arrowSize,c=this._scrollPosition;return r0&&Math.abs(e.deltaY)>0)return 1;let c=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(c+=.25),r){let S=Math.abs(e.deltaX),H=Math.abs(e.deltaY),Z=Math.abs(r.deltaX),ue=Math.abs(r.deltaY),be=Math.max(Math.min(S,Z),1),Se=Math.max(Math.min(H,ue),1),Re=Math.max(S,Z),Xe=Math.max(H,ue);Re%be===0&&Xe%Se===0&&(c-=.5)}return Math.min(Math.max(c,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};S9.INSTANCE=new S9;var gAe=S9,vAe=class extends sL{constructor(t,e,r){super(),this._onScroll=this._register(new Ms),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Ms),this.onWillScroll=this._onWillScroll.event,this._options=_Ae(e),this._scrollable=r,this._register(this._scrollable.onScroll(S=>{this._onWillScroll.fire(S),this._onDidScroll(S),this._onScroll.fire(S)}));let c={onMouseWheel:S=>this._onMouseWheel(S),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new dAe(this._scrollable,this._options,c)),this._horizontalScrollbar=this._register(new fAe(this._scrollable,this._options,c)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=S5(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=S5(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=S5(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,S=>this._onMouseOver(S)),this.onmouseleave(this._listenOnDomNode,S=>this._onMouseLeave(S)),this._hideTimeout=this._register(new aL),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ux(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Pv&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new AF(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Ux(this._mouseWheelToDispose),t)){let e=r=>{this._onMouseWheel(new AF(r))};this._mouseWheelToDispose.push(ju(this._listenOnDomNode,Jp.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let e=gAe.INSTANCE;e.acceptStandardWheelEvent(t);let r=!1;if(t.deltaY||t.deltaX){let S=t.deltaY*this._options.mouseWheelScrollSensitivity,H=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&H+S===0?H=S=0:Math.abs(S)>=Math.abs(H)?H=0:S=0),this._options.flipAxes&&([S,H]=[H,S]);let Z=!Pv&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||Z)&&!H&&(H=S,S=0),t.browserEvent&&t.browserEvent.altKey&&(H=H*this._options.fastScrollSensitivity,S=S*this._options.fastScrollSensitivity);let ue=this._scrollable.getFutureScrollPosition(),be={};if(S){let Se=zF*S,Re=ue.scrollTop-(Se<0?Math.floor(Se):Math.ceil(Se));this._verticalScrollbar.writeScrollPosition(be,Re)}if(H){let Se=zF*H,Re=ue.scrollLeft-(Se<0?Math.floor(Se):Math.ceil(Se));this._horizontalScrollbar.writeScrollPosition(be,Re)}be=this._scrollable.validateScrollPosition(be),(ue.scrollLeft!==be.scrollLeft||ue.scrollTop!==be.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(be):this._scrollable.setScrollPositionNow(be),r=!0)}let c=r;!c&&this._options.alwaysConsumeMouseWheel&&(c=!0),!c&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(c=!0),c&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,r=t.scrollLeft>0,c=r?" left":"",S=e?" top":"",H=r||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${c}`),this._topShadowDomNode.setClassName(`shadow${S}`),this._topLeftShadowDomNode.setClassName(`shadow${H}${S}${c}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),pAe)}},yAe=class extends vAe{constructor(e,r,c){super(e,r,c)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function _Ae(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,Pv&&(e.className+=" mac"),e}var C9=class extends Sc{constructor(e,r,c,S,H,Z,ue,be){super(),this._bufferService=c,this._optionsService=ue,this._renderService=be,this._onRequestScrollLines=this._register(new Ms),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let Se=this._register(new oAe({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:Re=>oL(S.window,Re)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{Se.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new yAe(r,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},Se)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(H.onProtocolChange(Re=>{this._scrollableElement.updateOptions({handleMouseWheel:!(Re&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(_0.runAndSubscribe(Z.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=Z.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ld(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=S.mainDocument.createElement("style"),r.appendChild(this._styleElement),this._register(ld(()=>this._styleElement.remove())),this._register(_0.runAndSubscribe(Z.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${Z.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${Z.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${Z.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(Re=>this._handleScroll(Re)))}scrollLines(e){let r=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:r.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,r){r&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!r,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let r=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),c=r-this._bufferService.buffer.ydisp;c!==0&&(this._latestYDisp=r,this._onRequestScrollLines.fire(c)),this._isHandlingScroll=!1}};C9=Vd([cl(2,sm),cl(3,V1),cl(4,UH),cl(5,Z2),cl(6,lm),cl(7,W1)],C9);var A9=class extends Sc{constructor(e,r,c,S,H){super(),this._screenElement=e,this._bufferService=r,this._coreBrowserService=c,this._decorationService=S,this._renderService=H,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(Z=>this._removeDecoration(Z))),this._register(ld(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let c=e.options.x??0;return c&&c>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(e,r),r}_refreshStyle(e){let r=e.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let c=this._decorationElements.get(e);c||(c=this._createElement(e),e.element=c,this._decorationElements.set(e,c),this._container.appendChild(c),e.onDispose(()=>{this._decorationElements.delete(e),c.remove()})),c.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(c.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,c.style.top=`${r*this._renderService.dimensions.css.cell.height}px`,c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(c)}}_refreshXPosition(e,r=e.element){if(!r)return;let c=e.options.x??0;(e.options.anchor||"left")==="right"?r.style.right=c?`${c*this._renderService.dimensions.css.cell.width}px`:"":r.style.left=c?`${c*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};A9=Vd([cl(1,sm),cl(2,V1),cl(3,c4),cl(4,W1)],A9);var xAe=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let r of this._zones)if(r.color===e.options.overviewRulerOptions.color&&r.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(r,e.marker.line))return;if(this._lineAdjacentToZone(r,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(r,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&r<=e.endBufferLine}_lineAdjacentToZone(e,r,c){return r>=e.startBufferLine-this._linePadding[c||"full"]&&r<=e.endBufferLine+this._linePadding[c||"full"]}_addLineToZone(e,r){e.startBufferLine=Math.min(e.startBufferLine,r),e.endBufferLine=Math.max(e.endBufferLine,r)}},mv={full:0,left:0,center:0,right:0},Ny={full:0,left:0,center:0,right:0},$3={full:0,left:0,center:0,right:0},JT=class extends Sc{constructor(e,r,c,S,H,Z,ue,be){super(),this._viewportElement=e,this._screenElement=r,this._bufferService=c,this._decorationService=S,this._renderService=H,this._optionsService=Z,this._themeService=ue,this._coreBrowserService=be,this._colorZoneStore=new xAe,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(ld(()=>this._canvas?.remove()));let Se=this._canvas.getContext("2d");if(Se)this._ctx=Se;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),r=Math.ceil((this._canvas.width-1)/3);Ny.full=this._canvas.width,Ny.left=e,Ny.center=r,Ny.right=e,this._refreshDrawHeightConstants(),$3.full=1,$3.left=1,$3.center=1+Ny.left,$3.right=1+Ny.left+Ny.center}_refreshDrawHeightConstants(){mv.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,r=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);mv.left=r,mv.center=r,mv.right=r}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let r of this._decorationService.decorations)this._colorZoneStore.addDecoration(r);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let r of e)r.position!=="full"&&this._renderColorZone(r);for(let r of e)r.position==="full"&&this._renderColorZone(r);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect($3[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-mv[e.position||"full"]/2),Ny[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+mv[e.position||"full"]))}_queueRefresh(e,r){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=r||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};JT=Vd([cl(2,sm),cl(3,c4),cl(4,W1),cl(5,lm),cl(6,Z2),cl(7,V1)],JT);var Uo;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=` -`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(Uo||={});var bT;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(bT||={});var lV;(t=>t.ST=`${Uo.ESC}\\`)(lV||={});var M9=class{constructor(e,r,c,S,H,Z){this._textarea=e,this._compositionView=r,this._bufferService=c,this._optionsService=S,this._coreService=H,this._renderService=Z,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let c;r.start+=this._dataAlreadySent.length,this._isComposing?c=this._textarea.value.substring(r.start,this._compositionPosition.start):c=this._textarea.value.substring(r.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;let r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let r=this._textarea.value,c=r.replace(e,"");this._dataAlreadySent=c,r.length>e.length?this._coreService.triggerDataEvent(c,!0):r.lengththis.updateCompositionElements(!0),0)}}};M9=Vd([cl(2,sm),cl(3,lm),cl(4,Gx),cl(5,W1)],M9);var Qp=0,e0=0,t0=0,jd=0,OF={css:"#00000000",rgba:0},xp;(t=>{function e(S,H,Z,ue){return ue!==void 0?`#${cx(S)}${cx(H)}${cx(Z)}${cx(ue)}`:`#${cx(S)}${cx(H)}${cx(Z)}`}t.toCss=e;function r(S,H,Z,ue=255){return(S<<24|H<<16|Z<<8|ue)>>>0}t.toRgba=r;function c(S,H,Z,ue){return{css:t.toCss(S,H,Z,ue),rgba:t.toRgba(S,H,Z,ue)}}t.toColor=c})(xp||={});var Gf;(t=>{function e(be,Se){if(jd=(Se.rgba&255)/255,jd===1)return{css:Se.css,rgba:Se.rgba};let Re=Se.rgba>>24&255,Xe=Se.rgba>>16&255,vt=Se.rgba>>8&255,bt=be.rgba>>24&255,kt=be.rgba>>16&255,Dt=be.rgba>>8&255;Qp=bt+Math.round((Re-bt)*jd),e0=kt+Math.round((Xe-kt)*jd),t0=Dt+Math.round((vt-Dt)*jd);let rr=xp.toCss(Qp,e0,t0),Er=xp.toRgba(Qp,e0,t0);return{css:rr,rgba:Er}}t.blend=e;function r(be){return(be.rgba&255)===255}t.isOpaque=r;function c(be,Se,Re){let Xe=wT.ensureContrastRatio(be.rgba,Se.rgba,Re);if(Xe)return xp.toColor(Xe>>24&255,Xe>>16&255,Xe>>8&255)}t.ensureContrastRatio=c;function S(be){let Se=(be.rgba|255)>>>0;return[Qp,e0,t0]=wT.toChannels(Se),{css:xp.toCss(Qp,e0,t0),rgba:Se}}t.opaque=S;function H(be,Se){return jd=Math.round(Se*255),[Qp,e0,t0]=wT.toChannels(be.rgba),{css:xp.toCss(Qp,e0,t0,jd),rgba:xp.toRgba(Qp,e0,t0,jd)}}t.opacity=H;function Z(be,Se){return jd=be.rgba&255,H(be,jd*Se/255)}t.multiplyOpacity=Z;function ue(be){return[be.rgba>>24&255,be.rgba>>16&255,be.rgba>>8&255]}t.toColorRGB=ue})(Gf||={});var kd;(t=>{let e,r;try{let S=document.createElement("canvas");S.width=1,S.height=1;let H=S.getContext("2d",{willReadFrequently:!0});H&&(e=H,e.globalCompositeOperation="copy",r=e.createLinearGradient(0,0,1,1))}catch{}function c(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return Qp=parseInt(S.slice(1,2).repeat(2),16),e0=parseInt(S.slice(2,3).repeat(2),16),t0=parseInt(S.slice(3,4).repeat(2),16),xp.toColor(Qp,e0,t0);case 5:return Qp=parseInt(S.slice(1,2).repeat(2),16),e0=parseInt(S.slice(2,3).repeat(2),16),t0=parseInt(S.slice(3,4).repeat(2),16),jd=parseInt(S.slice(4,5).repeat(2),16),xp.toColor(Qp,e0,t0,jd);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}let H=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(H)return Qp=parseInt(H[1]),e0=parseInt(H[2]),t0=parseInt(H[3]),jd=Math.round((H[5]===void 0?1:parseFloat(H[5]))*255),xp.toColor(Qp,e0,t0,jd);if(!e||!r)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=r,e.fillStyle=S,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Qp,e0,t0,jd]=e.getImageData(0,0,1,1).data,jd!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:xp.toRgba(Qp,e0,t0,jd),css:S}}t.toColor=c})(kd||={});var em;(t=>{function e(c){return r(c>>16&255,c>>8&255,c&255)}t.relativeLuminance=e;function r(c,S,H){let Z=c/255,ue=S/255,be=H/255,Se=Z<=.03928?Z/12.92:Math.pow((Z+.055)/1.055,2.4),Re=ue<=.03928?ue/12.92:Math.pow((ue+.055)/1.055,2.4),Xe=be<=.03928?be/12.92:Math.pow((be+.055)/1.055,2.4);return Se*.2126+Re*.7152+Xe*.0722}t.relativeLuminance2=r})(em||={});var wT;(t=>{function e(Z,ue){if(jd=(ue&255)/255,jd===1)return ue;let be=ue>>24&255,Se=ue>>16&255,Re=ue>>8&255,Xe=Z>>24&255,vt=Z>>16&255,bt=Z>>8&255;return Qp=Xe+Math.round((be-Xe)*jd),e0=vt+Math.round((Se-vt)*jd),t0=bt+Math.round((Re-bt)*jd),xp.toRgba(Qp,e0,t0)}t.blend=e;function r(Z,ue,be){let Se=em.relativeLuminance(Z>>8),Re=em.relativeLuminance(ue>>8);if(y1(Se,Re)>8));if(kt>8));return kt>rr?bt:Dt}return bt}let Xe=S(Z,ue,be),vt=y1(Se,em.relativeLuminance(Xe>>8));if(vt>8));return vt>kt?Xe:bt}return Xe}}t.ensureContrastRatio=r;function c(Z,ue,be){let Se=Z>>24&255,Re=Z>>16&255,Xe=Z>>8&255,vt=ue>>24&255,bt=ue>>16&255,kt=ue>>8&255,Dt=y1(em.relativeLuminance2(vt,bt,kt),em.relativeLuminance2(Se,Re,Xe));for(;Dt0||bt>0||kt>0);)vt-=Math.max(0,Math.ceil(vt*.1)),bt-=Math.max(0,Math.ceil(bt*.1)),kt-=Math.max(0,Math.ceil(kt*.1)),Dt=y1(em.relativeLuminance2(vt,bt,kt),em.relativeLuminance2(Se,Re,Xe));return(vt<<24|bt<<16|kt<<8|255)>>>0}t.reduceLuminance=c;function S(Z,ue,be){let Se=Z>>24&255,Re=Z>>16&255,Xe=Z>>8&255,vt=ue>>24&255,bt=ue>>16&255,kt=ue>>8&255,Dt=y1(em.relativeLuminance2(vt,bt,kt),em.relativeLuminance2(Se,Re,Xe));for(;Dt>>0}t.increaseLuminance=S;function H(Z){return[Z>>24&255,Z>>16&255,Z>>8&255,Z&255]}t.toChannels=H})(wT||={});function cx(t){let e=t.toString(16);return e.length<2?"0"+e:e}function y1(t,e){return t1){let Re=this._getJoinedRanges(c,Z,H,e,S);for(let Xe=0;Xe1){let Se=this._getJoinedRanges(c,Z,H,e,S);for(let Re=0;Re=vi,Di=Ar,qn=this._workCell;if(bt.length>0&&Ar===bt[0][0]&&ei){let Xi=bt.shift(),oo=this._isCellInSelection(Xi[0],r);for(wi=Xi[0]+1;wi=Xi[1],ei?(Xr=!0,qn=new bAe(this._workCell,e.translateToString(!0,Xi[0],Xi[1]),Xi[1]-Xi[0]),Di=Xi[1]-1,ti=qn.getWidth()):vi=Xi[1]}let Qn=this._isCellInSelection(Ar,r),ka=c&&Ar===Z,Ta=dr&&Ar>=Re&&Ar<=Xe,so=!1;this._decorationService.forEachDecorationAtCell(Ar,r,void 0,Xi=>{so=!0});let Yn=qn.getChars()||s_;if(Yn===" "&&(qn.isUnderline()||qn.isOverline())&&(Yn=" "),Ji=ti*be-Se.get(Yn,qn.isBold(),qn.isItalic()),!rr)rr=this._document.createElement("span");else if(Er&&(Qn&&ii||!Qn&&!ii&&qn.bg===ur)&&(Qn&&ii&&kt.selectionForeground||qn.fg===Ir)&&qn.extended.ext===Ti&&Ta===_i&&Ji===Ci&&!ka&&!Xr&&!so&&ei){qn.isInvisible()?Fe+=s_:Fe+=Yn,Er++;continue}else Er&&(rr.textContent=Fe),rr=this._document.createElement("span"),Er=0,Fe="";if(ur=qn.bg,Ir=qn.fg,Ti=qn.extended.ext,_i=Ta,Ci=Ji,ii=Qn,Xr&&Z>=Ar&&Z<=Di&&(Z=Ar),!this._coreService.isCursorHidden&&ka&&this._coreService.isCursorInitialized){if(vr.push("xterm-cursor"),this._coreBrowserService.isFocused)ue&&vr.push("xterm-cursor-blink"),vr.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":vr.push("xterm-cursor-outline");break;case"block":vr.push("xterm-cursor-block");break;case"bar":vr.push("xterm-cursor-bar");break;case"underline":vr.push("xterm-cursor-underline");break}}if(qn.isBold()&&vr.push("xterm-bold"),qn.isItalic()&&vr.push("xterm-italic"),qn.isDim()&&vr.push("xterm-dim"),qn.isInvisible()?Fe=s_:Fe=qn.getChars()||s_,qn.isUnderline()&&(vr.push(`xterm-underline-${qn.extended.underlineStyle}`),Fe===" "&&(Fe=" "),!qn.isUnderlineColorDefault()))if(qn.isUnderlineColorRGB())rr.style.textDecorationColor=`rgb(${u4.toColorRGB(qn.getUnderlineColor()).join(",")})`;else{let Xi=qn.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&qn.isBold()&&Xi<8&&(Xi+=8),rr.style.textDecorationColor=kt.ansi[Xi].css}qn.isOverline()&&(vr.push("xterm-overline"),Fe===" "&&(Fe=" ")),qn.isStrikethrough()&&vr.push("xterm-strikethrough"),Ta&&(rr.style.textDecoration="underline");let sn=qn.getFgColor(),an=qn.getFgColorMode(),zn=qn.getBgColor(),Ra=qn.getBgColorMode(),Ya=!!qn.isInverse();if(Ya){let Xi=sn;sn=zn,zn=Xi;let oo=an;an=Ra,Ra=oo}let zo,_a,Ur=!1;this._decorationService.forEachDecorationAtCell(Ar,r,void 0,Xi=>{Xi.options.layer!=="top"&&Ur||(Xi.backgroundColorRGB&&(Ra=50331648,zn=Xi.backgroundColorRGB.rgba>>8&16777215,zo=Xi.backgroundColorRGB),Xi.foregroundColorRGB&&(an=50331648,sn=Xi.foregroundColorRGB.rgba>>8&16777215,_a=Xi.foregroundColorRGB),Ur=Xi.options.layer==="top")}),!Ur&&Qn&&(zo=this._coreBrowserService.isFocused?kt.selectionBackgroundOpaque:kt.selectionInactiveBackgroundOpaque,zn=zo.rgba>>8&16777215,Ra=50331648,Ur=!0,kt.selectionForeground&&(an=50331648,sn=kt.selectionForeground.rgba>>8&16777215,_a=kt.selectionForeground)),Ur&&vr.push("xterm-decoration-top");let Mi;switch(Ra){case 16777216:case 33554432:Mi=kt.ansi[zn],vr.push(`xterm-bg-${zn}`);break;case 50331648:Mi=xp.toColor(zn>>16,zn>>8&255,zn&255),this._addStyle(rr,`background-color:#${BF((zn>>>0).toString(16),"0",6)}`);break;case 0:default:Ya?(Mi=kt.foreground,vr.push("xterm-bg-257")):Mi=kt.background}switch(zo||qn.isDim()&&(zo=Gf.multiplyOpacity(Mi,.5)),an){case 16777216:case 33554432:qn.isBold()&&sn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(sn+=8),this._applyMinimumContrast(rr,Mi,kt.ansi[sn],qn,zo,void 0)||vr.push(`xterm-fg-${sn}`);break;case 50331648:let Xi=xp.toColor(sn>>16&255,sn>>8&255,sn&255);this._applyMinimumContrast(rr,Mi,Xi,qn,zo,_a)||this._addStyle(rr,`color:#${BF(sn.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(rr,Mi,kt.foreground,qn,zo,_a)||Ya&&vr.push("xterm-fg-257")}vr.length&&(rr.className=vr.join(" "),vr.length=0),!ka&&!Xr&&!so&&ei?Er++:rr.textContent=Fe,Ji!==this.defaultSpacing&&(rr.style.letterSpacing=`${Ji}px`),vt.push(rr),Ar=Di}return rr&&Er&&(rr.textContent=Fe),vt}_applyMinimumContrast(e,r,c,S,H,Z){if(this._optionsService.rawOptions.minimumContrastRatio===1||TAe(S.getCode()))return!1;let ue=this._getContrastCache(S),be;if(!H&&!Z&&(be=ue.getColor(r.rgba,c.rgba)),be===void 0){let Se=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);be=Gf.ensureContrastRatio(H||r,Z||c,Se),ue.setColor((H||r).rgba,(Z||c).rgba,be??null)}return be?(this._addStyle(e,`color:${be.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,r){e.setAttribute("style",`${e.getAttribute("style")||""}${r};`)}_isCellInSelection(e,r){let c=this._selectionStart,S=this._selectionEnd;return!c||!S?!1:this._columnSelectMode?c[0]<=S[0]?e>=c[0]&&r>=c[1]&&e=c[1]&&e>=S[0]&&r<=S[1]:r>c[1]&&r=c[0]&&e=c[0]}};E9=Vd([cl(1,VH),cl(2,lm),cl(3,V1),cl(4,Gx),cl(5,c4),cl(6,Z2)],E9);function BF(t,e,r){for(;t.length0&&(this._flat[S]=ue),ue}let H=e;r&&(H+="B"),c&&(H+="I");let Z=this._holey.get(H);if(Z===void 0){let ue=0;r&&(ue|=1),c&&(ue|=2),Z=this._measure(e,ue),Z>0&&this._holey.set(H,Z)}return Z}_measure(e,r){let c=this._measureElements[r];return c.textContent=e.repeat(32),c.offsetWidth/32}},AAe=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,r,c,S=!1){if(this.selectionStart=r,this.selectionEnd=c,!r||!c||r[0]===c[0]&&r[1]===c[1]){this.clear();return}let H=e.buffers.active.ydisp,Z=r[1]-H,ue=c[1]-H,be=Math.max(Z,0),Se=Math.min(ue,e.rows-1);if(be>=e.rows||Se<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=Z,this.viewportEndRow=ue,this.viewportCappedStartRow=be,this.viewportCappedEndRow=Se,this.startCol=r[0],this.endCol=c[0]}isCellSelected(e,r,c){return this.hasSelection?(c-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&c>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c=this.startCol&&r=this.startCol):!1}};function MAe(){return new AAe}var X7="xterm-dom-renderer-owner-",lg="xterm-rows",Jk="xterm-fg-",RF="xterm-bg-",H3="xterm-focus",Qk="xterm-selection",EAe=1,L9=class extends Sc{constructor(e,r,c,S,H,Z,ue,be,Se,Re,Xe,vt,bt,kt){super(),this._terminal=e,this._document=r,this._element=c,this._screenElement=S,this._viewportElement=H,this._helperContainer=Z,this._linkifier2=ue,this._charSizeService=Se,this._optionsService=Re,this._bufferService=Xe,this._coreService=vt,this._coreBrowserService=bt,this._themeService=kt,this._terminalClass=EAe++,this._rowElements=[],this._selectionRenderModel=MAe(),this.onRequestRedraw=this._register(new Ms).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(lg),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Qk),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=SAe(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(Dt=>this._injectCss(Dt))),this._injectCss(this._themeService.colors),this._rowFactory=be.createInstance(E9,document),this._element.classList.add(X7+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(Dt=>this._handleLinkHover(Dt))),this._register(this._linkifier2.onHideLinkUnderline(Dt=>this._handleLinkLeave(Dt))),this._register(ld(()=>{this._element.classList.remove(X7+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new CAe(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let c of this._rowElements)c.style.width=`${this.dimensions.css.canvas.width}px`,c.style.height=`${this.dimensions.css.cell.height}px`,c.style.lineHeight=`${this.dimensions.css.cell.height}px`,c.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let r=`${this._terminalSelector} .${lg} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=r,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let r=`${this._terminalSelector} .${lg} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;r+=`${this._terminalSelector} .${lg} .xterm-dim { color: ${Gf.multiplyOpacity(e.foreground,.5).css};}`,r+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let c=`blink_underline_${this._terminalClass}`,S=`blink_bar_${this._terminalClass}`,H=`blink_block_${this._terminalClass}`;r+=`@keyframes ${c} { 50% { border-bottom-style: hidden; }}`,r+=`@keyframes ${S} { 50% { box-shadow: none; }}`,r+=`@keyframes ${H} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,r+=`${this._terminalSelector} .${lg}.${H3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${c} 1s step-end infinite;}${this._terminalSelector} .${lg}.${H3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${S} 1s step-end infinite;}${this._terminalSelector} .${lg}.${H3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${lg} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${lg} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${lg} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${lg} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${lg} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,r+=`${this._terminalSelector} .${Qk} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Qk} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Qk} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[Z,ue]of e.ansi.entries())r+=`${this._terminalSelector} .${Jk}${Z} { color: ${ue.css}; }${this._terminalSelector} .${Jk}${Z}.xterm-dim { color: ${Gf.multiplyOpacity(ue,.5).css}; }${this._terminalSelector} .${RF}${Z} { background-color: ${ue.css}; }`;r+=`${this._terminalSelector} .${Jk}257 { color: ${Gf.opaque(e.background).css}; }${this._terminalSelector} .${Jk}257.xterm-dim { color: ${Gf.multiplyOpacity(Gf.opaque(e.background),.5).css}; }${this._terminalSelector} .${RF}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=r}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,r){for(let c=this._rowElements.length;c<=r;c++){let S=this._document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,r){this._refreshRowElements(e,r),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(H3),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(H3),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,r,c){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,r,c),this.renderRows(0,this._bufferService.rows-1),!e||!r||(this._selectionRenderModel.update(this._terminal,e,r,c),!this._selectionRenderModel.hasSelection))return;let S=this._selectionRenderModel.viewportStartRow,H=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,ue=this._selectionRenderModel.viewportCappedEndRow,be=this._document.createDocumentFragment();if(c){let Se=e[0]>r[0];be.appendChild(this._createSelectionElement(Z,Se?r[0]:e[0],Se?e[0]:r[0],ue-Z+1))}else{let Se=S===Z?e[0]:0,Re=Z===H?r[0]:this._bufferService.cols;be.appendChild(this._createSelectionElement(Z,Se,Re));let Xe=ue-Z-1;if(be.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,Xe)),Z!==ue){let vt=H===ue?r[0]:this._bufferService.cols;be.appendChild(this._createSelectionElement(ue,0,vt))}}this._selectionContainer.appendChild(be)}_createSelectionElement(e,r,c,S=1){let H=this._document.createElement("div"),Z=r*this.dimensions.css.cell.width,ue=this.dimensions.css.cell.width*(c-r);return Z+ue>this.dimensions.css.canvas.width&&(ue=this.dimensions.css.canvas.width-Z),H.style.height=`${S*this.dimensions.css.cell.height}px`,H.style.top=`${e*this.dimensions.css.cell.height}px`,H.style.left=`${Z}px`,H.style.width=`${ue}px`,H}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,r){let c=this._bufferService.buffer,S=c.ybase+c.y,H=Math.min(c.x,this._bufferService.cols-1),Z=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,ue=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,be=this._optionsService.rawOptions.cursorInactiveStyle;for(let Se=e;Se<=r;Se++){let Re=Se+c.ydisp,Xe=this._rowElements[Se],vt=c.lines.get(Re);if(!Xe||!vt)break;Xe.replaceChildren(...this._rowFactory.createRow(vt,Re,Re===S,ue,be,H,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${X7}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,r,c,S,H,Z){c<0&&(e=0),S<0&&(r=0);let ue=this._bufferService.rows-1;c=Math.max(Math.min(c,ue),0),S=Math.max(Math.min(S,ue),0),H=Math.min(H,this._bufferService.cols);let be=this._bufferService.buffer,Se=be.ybase+be.y,Re=Math.min(be.x,H-1),Xe=this._optionsService.rawOptions.cursorBlink,vt=this._optionsService.rawOptions.cursorStyle,bt=this._optionsService.rawOptions.cursorInactiveStyle;for(let kt=c;kt<=S;++kt){let Dt=kt+be.ydisp,rr=this._rowElements[kt],Er=be.lines.get(Dt);if(!rr||!Er)break;rr.replaceChildren(...this._rowFactory.createRow(Er,Dt,Dt===Se,vt,bt,Re,Xe,this.dimensions.css.cell.width,this._widthCache,Z?kt===c?e:0:-1,Z?(kt===S?r:H)-1:-1))}}};L9=Vd([cl(7,eL),cl(8,$S),cl(9,lm),cl(10,sm),cl(11,Gx),cl(12,V1),cl(13,Z2)],L9);var P9=class extends Sc{constructor(e,r,c){super(),this._optionsService=c,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Ms),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new PAe(this._optionsService))}catch{this._measureStrategy=this._register(new LAe(e,r,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};P9=Vd([cl(2,lm)],P9);var uV=class extends Sc{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},LAe=class extends uV{constructor(t,e,r){super(),this._document=t,this._parentElement=e,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},PAe=class extends uV{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let r=this._ctx.measureText("W");if(!("width"in r&&"fontBoundingBoxAscent"in r&&"fontBoundingBoxDescent"in r))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},IAe=class extends Sc{constructor(e,r,c){super(),this._textarea=e,this._window=r,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new DAe(this._window)),this._onDprChange=this._register(new Ms),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Ms),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(S=>this._screenDprMonitor.setWindow(S))),this._register(_0.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ju(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ju(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},DAe=class extends Sc{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new H2),this._onDprChange=this._register(new Ms),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ld(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ju(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},zAe=class extends Sc{constructor(){super(),this.linkProviders=[],this._register(ld(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function lL(t,e,r){let c=r.getBoundingClientRect(),S=t.getComputedStyle(r),H=parseInt(S.getPropertyValue("padding-left")),Z=parseInt(S.getPropertyValue("padding-top"));return[e.clientX-c.left-H,e.clientY-c.top-Z]}function OAe(t,e,r,c,S,H,Z,ue,be){if(!H)return;let Se=lL(t,e,r);if(Se)return Se[0]=Math.ceil((Se[0]+(be?Z/2:0))/Z),Se[1]=Math.ceil(Se[1]/ue),Se[0]=Math.min(Math.max(Se[0],1),c+(be?1:0)),Se[1]=Math.min(Math.max(Se[1],1),S),Se}var I9=class{constructor(e,r){this._renderService=e,this._charSizeService=r}getCoords(e,r,c,S,H){return OAe(window,e,r,c,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,H)}getMouseReportCoords(e,r){let c=lL(window,e,r);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};I9=Vd([cl(0,W1),cl(1,$S)],I9);var BAe=class{constructor(e,r){this._renderCallback=e,this._coreBrowserService=r,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,r,c){this._rowCount=c,e=e!==void 0?e:0,r=r!==void 0?r:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,r):r,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,r),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},cV={};q8e(cV,{getSafariVersion:()=>FAe,isChromeOS:()=>pV,isFirefox:()=>hV,isIpad:()=>NAe,isIphone:()=>jAe,isLegacyEdge:()=>RAe,isLinux:()=>uL,isMac:()=>eS,isNode:()=>HS,isSafari:()=>fV,isWindows:()=>dV});var HS=typeof process<"u"&&"title"in process,h4=HS?"node":navigator.userAgent,f4=HS?"node":navigator.platform,hV=h4.includes("Firefox"),RAe=h4.includes("Edge"),fV=/^((?!chrome|android).)*safari/i.test(h4);function FAe(){if(!fV)return 0;let t=h4.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var eS=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f4),NAe=f4==="iPad",jAe=f4==="iPhone",dV=["Windows","Win16","Win32","WinCE"].includes(f4),uL=f4.indexOf("Linux")>=0,pV=/\bCrOS\b/.test(h4),mV=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._iS){c-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-e))}ms`),this._start();return}c=S}this.clear()}},UAe=class extends mV{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let r=performance.now()+e;return{timeRemaining:()=>Math.max(0,r-performance.now())}}},$Ae=class extends mV{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},tS=!HS&&"requestIdleCallback"in window?$Ae:UAe,HAe=class{constructor(){this._queue=new tS}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},D9=class extends Sc{constructor(e,r,c,S,H,Z,ue,be,Se){super(),this._rowCount=e,this._optionsService=c,this._charSizeService=S,this._coreService=H,this._coreBrowserService=be,this._renderer=this._register(new H2),this._pausedResizeTask=new HAe,this._observerDisposable=this._register(new H2),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Ms),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Ms),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Ms),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Ms),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new BAe((Re,Xe)=>this._renderRows(Re,Xe),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new VAe(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ld(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(ue.onResize(()=>this._fullRefresh())),this._register(ue.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(Z.onDecorationRegistered(()=>this._fullRefresh())),this._register(Z.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(ue.cols,ue.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(ue.buffer.y,ue.buffer.y,!0))),this._register(Se.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,r),this._register(this._coreBrowserService.onWindowChange(Re=>this._registerIntersectionObserver(Re,r)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,r){if("IntersectionObserver"in e){let c=new e.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});c.observe(r),this._observerDisposable.value=ld(()=>c.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,r,c=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,r);return}let S=this._syncOutputHandler.flush();S&&(e=Math.min(e,S.start),r=Math.max(r,S.end)),c||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,r,this._rowCount)}_renderRows(e,r){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,r);return}e=Math.min(e,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(e,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:r}),this._onRender.fire({start:e,end:r}),this._isNextRenderRedrawOnly=!0}}resize(e,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,r)):this._renderer.value.handleResize(e,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,r,c){this._selectionState.start=e,this._selectionState.end=r,this._selectionState.columnSelectMode=c,this._renderer.value?.handleSelectionChanged(e,r,c)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};D9=Vd([cl(2,lm),cl(3,$S),cl(4,Gx),cl(5,c4),cl(6,sm),cl(7,V1),cl(8,Z2)],D9);var VAe=class{constructor(t,e,r){this._coreBrowserService=t,this._coreService=e,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function WAe(t,e,r,c){let S=r.buffer.x,H=r.buffer.y;if(!r.buffer.hasScrollback)return ZAe(S,H,t,e,r,c)+VS(H,e,r,c)+KAe(S,H,t,e,r,c);let Z;if(H===e)return Z=S>t?"D":"C",q5(Math.abs(S-t),W5(Z,c));Z=H>e?"D":"C";let ue=Math.abs(H-e),be=GAe(H>e?t:S,r)+(ue-1)*r.cols+1+qAe(H>e?S:t);return q5(be,W5(Z,c))}function qAe(t,e){return t-1}function GAe(t,e){return e.cols-t}function ZAe(t,e,r,c,S,H){return VS(e,c,S,H).length===0?"":q5(vV(t,e,t,e-$x(e,S),!1,S).length,W5("D",H))}function VS(t,e,r,c){let S=t-$x(t,r),H=e-$x(e,r),Z=Math.abs(S-H)-YAe(t,e,r);return q5(Z,W5(gV(t,e),c))}function KAe(t,e,r,c,S,H){let Z;VS(e,c,S,H).length>0?Z=c-$x(c,S):Z=e;let ue=c,be=XAe(t,e,r,c,S,H);return q5(vV(t,Z,r,ue,be==="C",S).length,W5(be,H))}function YAe(t,e,r){let c=0,S=t-$x(t,r),H=e-$x(e,r);for(let Z=0;Z=0&&t0?Z=c-$x(c,S):Z=e,t=r&&Ze?"A":"B"}function vV(t,e,r,c,S,H){let Z=t,ue=e,be="";for(;(Z!==r||ue!==c)&&ue>=0&&ueH.cols-1?(be+=H.buffer.translateBufferLineToString(ue,!1,t,Z),Z=0,t=0,ue++):!S&&Z<0&&(be+=H.buffer.translateBufferLineToString(ue,!1,0,t+1),Z=H.cols-1,t=Z,ue--);return be+H.buffer.translateBufferLineToString(ue,!1,t,Z)}function W5(t,e){let r=e?"O":"[";return Uo.ESC+r+t}function q5(t,e){t=Math.floor(t);let r="";for(let c=0;cthis._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function FF(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var J7=50,QAe=15,e7e=50,t7e=500,r7e=" ",i7e=new RegExp(r7e,"g"),z9=class extends Sc{constructor(e,r,c,S,H,Z,ue,be,Se){super(),this._element=e,this._screenElement=r,this._linkifier=c,this._bufferService=S,this._coreService=H,this._mouseService=Z,this._optionsService=ue,this._renderService=be,this._coreBrowserService=Se,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new xg,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Ms),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Ms),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Ms),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Ms),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Re=>this._handleMouseMove(Re),this._mouseUpListener=Re=>this._handleMouseUp(Re),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Re=>this._handleTrim(Re)),this._register(this._bufferService.buffers.onBufferActivate(Re=>this._handleBufferActivate(Re))),this.enable(),this._model=new JAe(this._bufferService),this._activeSelectionMode=0,this._register(ld(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(Re=>{Re.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!e||!r?!1:e[0]!==r[0]||e[1]!==r[1]}get selectionText(){let e=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;if(!e||!r)return"";let c=this._bufferService.buffer,S=[];if(this._activeSelectionMode===3){if(e[0]===r[0])return"";let H=e[0]H.replace(i7e," ")).join(dV?`\r +`))}},GCe=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},ZCe=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},KCe=0,K7=class{constructor(e){this.value=e,this.id=KCe++}},YCe=2,XCe,Es=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new WCe(e?.onListenerError??xT,this._options?.leakWarningThreshold??VCe):void 0,this._perfMon=this._options?._profName?new HCe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,r,c)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let xe=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new ZCe(`${ue}. HINT: Stack shows most frequent listener (${xe[1]}-times)`,xe[0]);return(this._options?.onListenerError||xT)(Se),Sc.None}if(this._disposed)return Sc.None;r&&(e=e.bind(r));let S=new K7(e),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=qCe.create(),$=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof K7?(this._deliveryQueue??=new JCe,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=cd(()=>{$?.(),this._removeListener(S)});return c instanceof p_?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*YCe<=r.length){let $=0;for(let Z=0;Z0}},JCe=class{constructor(){this.i=-1,this.end=0}enqueue(e,r,c){this.i=0,this.end=c,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},x9=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Es,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Es,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,r){if(this.getZoomLevel(r)===e)return;let c=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(c,e),this._onDidChangeZoomLevel.fire(c)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),e)}setFullscreen(e,r){if(this.isFullscreen(r)===e)return;let c=this.getWindowId(r);this.mapWindowIdToFullScreen.set(c,e),this._onDidChangeFullscreen.fire(c)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};x9.INSTANCE=new x9;var nL=x9;function QCe(t,e,r){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",r)}nL.INSTANCE.onDidChangeZoomLevel;function eAe(t){return nL.INSTANCE.getZoomFactor(t)}nL.INSTANCE.onDidChangeFullscreen;var X2=typeof navigator=="object"?navigator.userAgent:"",b9=X2.indexOf("Firefox")>=0,tAe=X2.indexOf("AppleWebKit")>=0,aL=X2.indexOf("Chrome")>=0,rAe=!aL&&X2.indexOf("Safari")>=0;X2.indexOf("Electron/")>=0;X2.indexOf("Android")>=0;var Y7=!1;if(typeof R1.matchMedia=="function"){let t=R1.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=R1.matchMedia("(display-mode: fullscreen)");Y7=t.matches,QCe(R1,t,({matches:r})=>{Y7&&e.matches||(Y7=r)})}var T2="en",w9=!1,k9=!1,bT=!1,iV=!1,Xk,wT=T2,kF=T2,iAe,T1,zx=globalThis,Wm;typeof zx.vscode<"u"&&typeof zx.vscode.process<"u"?Wm=zx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Wm=process);var nAe=typeof Wm?.versions?.electron=="string",aAe=nAe&&Wm?.type==="renderer";if(typeof Wm=="object"){w9=Wm.platform==="win32",k9=Wm.platform==="darwin",bT=Wm.platform==="linux",bT&&Wm.env.SNAP&&Wm.env.SNAP_REVISION,Wm.env.CI||Wm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Xk=T2,wT=T2;let t=Wm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Xk=e.userLocale,kF=e.osLocale,wT=e.resolvedLanguage||T2,iAe=e.languagePack?.translationsConfigFile}catch{}iV=!0}else typeof navigator=="object"&&!aAe?(T1=navigator.userAgent,w9=T1.indexOf("Windows")>=0,k9=T1.indexOf("Macintosh")>=0,(T1.indexOf("Macintosh")>=0||T1.indexOf("iPad")>=0||T1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,bT=T1.indexOf("Linux")>=0,T1?.indexOf("Mobi")>=0,wT=globalThis._VSCODE_NLS_LANGUAGE||T2,Xk=navigator.language.toLowerCase(),kF=Xk):console.error("Unable to resolve platform.");var nV=w9,Pv=k9,oAe=bT,TF=iV,zv=T1,jy=wT,sAe;(t=>{function e(){return jy}t.value=e;function r(){return jy.length===2?jy==="en":jy.length>=3?jy[0]==="e"&&jy[1]==="n"&&jy[2]==="-":!1}t.isDefaultVariant=r;function c(){return jy==="en"}t.isDefault=c})(sAe||={});var lAe=typeof zx.postMessage=="function"&&!zx.importScripts;(()=>{if(lAe){let t=[];zx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),zx.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var uAe=!!(zv&&zv.indexOf("Chrome")>=0);zv&&zv.indexOf("Firefox")>=0;!uAe&&zv&&zv.indexOf("Safari")>=0;zv&&zv.indexOf("Edg/")>=0;zv&&zv.indexOf("Android")>=0;var v2=typeof navigator=="object"?navigator:{};TF||document.queryCommandSupported&&document.queryCommandSupported("copy")||v2&&v2.clipboard&&v2.clipboard.writeText,TF||v2&&v2.clipboard&&v2.clipboard.readText;var oL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,r){this._keyCodeToStr[e]=r,this._strToKeyCode[r.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},X7=new oL,SF=new oL,CF=new oL,cAe=new Array(230),aV;(t=>{function e(ue){return X7.keyCodeToStr(ue)}t.toString=e;function r(ue){return X7.strToKeyCode(ue)}t.fromString=r;function c(ue){return SF.keyCodeToStr(ue)}t.toUserSettingsUS=c;function S(ue){return CF.keyCodeToStr(ue)}t.toUserSettingsGeneral=S;function $(ue){return SF.strToKeyCode(ue)||CF.strToKeyCode(ue)}t.fromUserSettings=$;function Z(ue){if(ue>=98&&ue<=113)return null;switch(ue){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return X7.keyCodeToStr(ue)}t.toElectronAccelerator=Z})(aV||={});var hAe=class oV{constructor(e,r,c,S,$){this.ctrlKey=e,this.shiftKey=r,this.altKey=c,this.metaKey=S,this.keyCode=$}equals(e){return e instanceof oV&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",c=this.altKey?"1":"0",S=this.metaKey?"1":"0";return`K${e}${r}${c}${S}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new fAe([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},fAe=class{constructor(t){if(t.length===0)throw RCe("chords");this.chords=t}getHashCode(){let t="";for(let e=0,r=this.chords.length;e{function e(r){return r===t.None||r===t.Cancelled||r instanceof bAe?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:x0.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:sV})})(xAe||={});var bAe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?sV:(this._emitter||(this._emitter=new Es),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},sL=class{constructor(e,r){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new m9("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new m9("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}},wAe=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,c=globalThis){if(this.isDisposed)throw new m9("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let S=c.setInterval(()=>{e()},r);this.disposable=cd(()=>{c.clearInterval(S),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},kAe;(t=>{async function e(c){let S,$=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return $}t.settled=e;function r(c){return new Promise(async(S,$)=>{try{await c(S,$)}catch(Z){$(Z)}})}t.withAsyncBody=r})(kAe||={});var LF=class hg{static fromArray(e){return new hg(r=>{r.emitMany(e)})}static fromPromise(e){return new hg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new hg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new hg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Es,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new hg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return hg.map(this,e)}static filter(e,r){return new hg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return hg.filter(this,e)}static coalesce(e){return hg.filter(e,r=>!!r)}coalesce(){return hg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return hg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};LF.EMPTY=LF.fromArray([]);var{getWindow:Mv,getWindowId:TAe,onDidRegisterWindow:SAe}=function(){let t=new Map,e={window:R1,disposables:new p_};t.set(R1.vscodeWindowId,e);let r=new Es,c=new Es,S=new Es;function $(Z,ue){return(typeof Z=="number"?t.get(Z):void 0)??(ue?e:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:S.event,onDidUnregisterWindow:c.event,registerWindow(Z){if(t.has(Z.vscodeWindowId))return Sc.None;let ue=new p_,xe={window:Z,disposables:ue.add(new p_)};return t.set(Z.vscodeWindowId,xe),ue.add(cd(()=>{t.delete(Z.vscodeWindowId),c.fire(Z)})),ue.add(Uu(Z,Qp.BEFORE_UNLOAD,()=>{S.fire(Z)})),r.fire(xe),ue},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(Z){return Z.vscodeWindowId},hasWindow(Z){return t.has(Z)},getWindowById:$,getWindow(Z){let ue=Z;if(ue?.ownerDocument?.defaultView)return ue.ownerDocument.defaultView.window;let xe=Z;return xe?.view?xe.view.window:R1},getDocument(Z){return Mv(Z).document}}}(),CAe=class{constructor(e,r,c,S){this._node=e,this._type=r,this._handler=c,this._options=S||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Uu(t,e,r,c){return new CAe(t,e,r,c)}var PF=function(t,e,r,c){return Uu(t,e,r,c)},lL,AAe=class extends wAe{constructor(t){super(),this.defaultTarget=t&&Mv(t)}cancelAndSet(t,e,r){return super.cancelAndSet(t,e,r??this.defaultTarget)}},IF=class{constructor(e,r=0){this._runner=e,this.priority=r,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){xT(e)}}static sort(e,r){return r.priority-e.priority}};(function(){let t=new Map,e=new Map,r=new Map,c=new Map,S=$=>{r.set($,!1);let Z=t.get($)??[];for(e.set($,Z),t.set($,[]),c.set($,!0);Z.length>0;)Z.sort(IF.sort),Z.shift().execute();c.set($,!1)};lL=($,Z,ue=0)=>{let xe=TAe($),Se=new IF(Z,ue),Ne=t.get(xe);return Ne||(Ne=[],t.set(xe,Ne)),Ne.push(Se),r.get(xe)||(r.set(xe,!0),$.requestAnimationFrame(()=>S(xe))),Se}})();function MAe(t){let e=t.getBoundingClientRect(),r=Mv(t);return{left:e.left+r.scrollX,top:e.top+r.scrollY,width:e.width,height:e.height}}var Qp={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},EAe=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=wm(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=wm(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=wm(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=wm(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=wm(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=wm(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=wm(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=wm(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=wm(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=wm(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=wm(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=wm(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=wm(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=wm(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function wm(t){return typeof t=="number"?`${t}px`:t}function A5(t){return new EAe(t)}var lV=class{constructor(){this._hooks=new p_,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,r){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let c=this._onStopCallback;this._onStopCallback=null,e&&c&&c(r)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,r,c,S,$){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=S,this._onStopCallback=$;let Z=e;try{e.setPointerCapture(r),this._hooks.add(cd(()=>{try{e.releasePointerCapture(r)}catch{}}))}catch{Z=Mv(e)}this._hooks.add(Uu(Z,Qp.POINTER_MOVE,ue=>{if(ue.buttons!==c){this.stopMonitoring(!0);return}ue.preventDefault(),this._pointerMoveCallback(ue)})),this._hooks.add(Uu(Z,Qp.POINTER_UP,ue=>this.stopMonitoring(!0)))}};function LAe(t,e,r){let c=null,S=null;if(typeof r.value=="function"?(c="value",S=r.value,S.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(c="get",S=r.get),!S)throw new Error("not supported");let $=`$memoize$${e}`;r[c]=function(...Z){return this.hasOwnProperty($)||Object.defineProperty(this,$,{configurable:!1,enumerable:!1,writable:!1,value:S.apply(this,Z)}),this[$]}}var xv;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(xv||={});var o5=class D0 extends Sc{constructor(){super(),this.dispatched=!1,this.targets=new wF,this.ignoreTargets=new wF,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(x0.runAndSubscribe(SAe,({window:e,disposables:r})=>{r.add(Uu(e.document,"touchstart",c=>this.onTouchStart(c),{passive:!1})),r.add(Uu(e.document,"touchend",c=>this.onTouchEnd(e,c))),r.add(Uu(e.document,"touchmove",c=>this.onTouchMove(c),{passive:!1}))},{window:R1,disposables:this._store}))}static addTarget(e){if(!D0.isTouchDevice())return Sc.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.targets.push(e);return cd(r)}static ignoreTarget(e){if(!D0.isTouchDevice())return Sc.None;D0.INSTANCE||(D0.INSTANCE=new D0);let r=D0.INSTANCE.ignoreTargets.push(e);return cd(r)}static isTouchDevice(){return"ontouchstart"in R1||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let c=0,S=e.targetTouches.length;c=D0.HOLD_DELAY&&Math.abs(xe.initialPageX-Hm(xe.rollingPageX))<30&&Math.abs(xe.initialPageY-Hm(xe.rollingPageY))<30){let Ne=this.newGestureEvent(xv.Contextmenu,xe.initialTarget);Ne.pageX=Hm(xe.rollingPageX),Ne.pageY=Hm(xe.rollingPageY),this.dispatchEvent(Ne)}else if(S===1){let Ne=Hm(xe.rollingPageX),it=Hm(xe.rollingPageY),pt=Hm(xe.rollingTimestamps)-xe.rollingTimestamps[0],bt=Ne-xe.rollingPageX[0],wt=it-xe.rollingPageY[0],Dt=[...this.targets].filter(Zt=>xe.initialTarget instanceof Node&&Zt.contains(xe.initialTarget));this.inertia(e,Dt,c,Math.abs(bt)/pt,bt>0?1:-1,Ne,Math.abs(wt)/pt,wt>0?1:-1,it)}this.dispatchEvent(this.newGestureEvent(xv.End,xe.initialTarget)),delete this.activeTouches[ue.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,r){let c=document.createEvent("CustomEvent");return c.initEvent(e,!1,!0),c.initialTarget=r,c.tapCount=0,c}dispatchEvent(e){if(e.type===xv.Tap){let r=new Date().getTime(),c=0;r-this._lastSetTapCountTime>D0.CLEAR_TAP_COUNT_TIME?c=1:c=2,this._lastSetTapCountTime=r,e.tapCount=c}else(e.type===xv.Change||e.type===xv.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let c of this.ignoreTargets)if(c.contains(e.initialTarget))return;let r=[];for(let c of this.targets)if(c.contains(e.initialTarget)){let S=0,$=e.initialTarget;for(;$&&$!==c;)S++,$=$.parentElement;r.push([S,c])}r.sort((c,S)=>c[0]-S[0]);for(let[c,S]of r)S.dispatchEvent(e),this.dispatched=!0}}inertia(e,r,c,S,$,Z,ue,xe,Se){this.handle=lL(e,()=>{let Ne=Date.now(),it=Ne-c,pt=0,bt=0,wt=!0;S+=D0.SCROLL_FRICTION*it,ue+=D0.SCROLL_FRICTION*it,S>0&&(wt=!1,pt=$*S*it),ue>0&&(wt=!1,bt=xe*ue*it);let Dt=this.newGestureEvent(xv.Change);Dt.translationX=pt,Dt.translationY=bt,r.forEach(Zt=>Zt.dispatchEvent(Dt)),wt||this.inertia(e,r,Ne,S,$,Z+pt,ue,xe,Se+bt)})}onTouchMove(e){let r=Date.now();for(let c=0,S=e.changedTouches.length;c3&&(Z.rollingPageX.shift(),Z.rollingPageY.shift(),Z.rollingTimestamps.shift()),Z.rollingPageX.push($.pageX),Z.rollingPageY.push($.pageY),Z.rollingTimestamps.push(r)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};o5.SCROLL_FRICTION=-.005,o5.HOLD_DELAY=700,o5.CLEAR_TAP_COUNT_TIME=400,Wd([LAe],o5,"isTouchDevice",1);var PAe=o5,uL=class extends Sc{onclick(e,r){this._register(Uu(e,Qp.CLICK,c=>r(new Jk(Mv(e),c))))}onmousedown(e,r){this._register(Uu(e,Qp.MOUSE_DOWN,c=>r(new Jk(Mv(e),c))))}onmouseover(e,r){this._register(Uu(e,Qp.MOUSE_OVER,c=>r(new Jk(Mv(e),c))))}onmouseleave(e,r){this._register(Uu(e,Qp.MOUSE_LEAVE,c=>r(new Jk(Mv(e),c))))}onkeydown(e,r){this._register(Uu(e,Qp.KEY_DOWN,c=>r(new AF(c))))}onkeyup(e,r){this._register(Uu(e,Qp.KEY_UP,c=>r(new AF(c))))}oninput(e,r){this._register(Uu(e,Qp.INPUT,r))}onblur(e,r){this._register(Uu(e,Qp.BLUR,r))}onfocus(e,r){this._register(Uu(e,Qp.FOCUS,r))}onchange(e,r){this._register(Uu(e,Qp.CHANGE,r))}ignoreGesture(e){return PAe.ignoreTarget(e)}},DF=11,IAe=class extends uL{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=DF+"px",this.domNode.style.height=DF+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new lV),this._register(PF(this.bgDomNode,Qp.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(PF(this.domNode,Qp.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new AAe),this._pointerdownScheduleRepeatTimer=this._register(new sL)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Mv(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},DAe=class T9{constructor(e,r,c,S,$,Z,ue){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,c=c|0,S=S|0,$=$|0,Z=Z|0,ue=ue|0),this.rawScrollLeft=S,this.rawScrollTop=ue,r<0&&(r=0),S+r>c&&(S=c-r),S<0&&(S=0),$<0&&($=0),ue+$>Z&&(ue=Z-$),ue<0&&(ue=0),this.width=r,this.scrollWidth=c,this.scrollLeft=S,this.height=$,this.scrollHeight=Z,this.scrollTop=ue}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,r){return new T9(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new T9(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,r){let c=this.width!==e.width,S=this.scrollWidth!==e.scrollWidth,$=this.scrollLeft!==e.scrollLeft,Z=this.height!==e.height,ue=this.scrollHeight!==e.scrollHeight,xe=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:r,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:c,scrollWidthChanged:S,scrollLeftChanged:$,heightChanged:Z,scrollHeightChanged:ue,scrollTopChanged:xe}}},zAe=class extends Sc{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Es),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new DAe(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){let r=this._state.withScrollDimensions(t,e);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let r=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let c;e?c=new OF(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):c=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=c}else{let r=this._state.withScrollPosition(t);this._smoothScrolling=OF.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let r=this._state;r.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(r,e)))}},zF=class{constructor(e,r,c){this.scrollLeft=e,this.scrollTop=r,this.isDone=c}};function J7(t,e){let r=e-t;return function(c){return t+r*RAe(c)}}function OAe(t,e,r){return function(c){return c2.5*c){let S,$;return e{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},NAe=140,uV=class extends uL{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new FAe(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lV),this._shouldRender=!0,this.domNode=A5(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Uu(this.domNode.domNode,Qp.POINTER_DOWN,r=>this._domNodePointerDown(r)))}_createArrow(e){let r=this._register(new IAe(e));this.domNode.domNode.appendChild(r.bgDomNode),this.domNode.domNode.appendChild(r.domNode)}_createSlider(e,r,c,S){this.slider=A5(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(r),typeof c=="number"&&this.slider.setWidth(c),typeof S=="number"&&this.slider.setHeight(S),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Uu(this.slider.domNode,Qp.POINTER_DOWN,$=>{$.button===0&&($.preventDefault(),this._sliderPointerDown($))})),this.onclick(this.slider.domNode,$=>{$.leftButton&&$.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let r=this.domNode.domNode.getClientRects()[0].top,c=r+this._scrollbarState.getSliderPosition(),S=r+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),$=this._sliderPointerPosition(e);c<=$&&$<=S?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let r,c;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")r=e.offsetX,c=e.offsetY;else{let $=MAe(this.domNode.domNode);r=e.pageX-$.left,c=e.pageY-$.top}let S=this._pointerDownRelativePosition(r,c);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(S):this._scrollbarState.getDesiredScrollPositionFromOffset(S)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let r=this._sliderPointerPosition(e),c=this._sliderOrthogonalPointerPosition(e),S=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,$=>{let Z=this._sliderOrthogonalPointerPosition($),ue=Math.abs(Z-c);if(nV&&ue>NAe){this._setDesiredScrollPositionNow(S.getScrollPosition());return}let xe=this._sliderPointerPosition($)-r;this._setDesiredScrollPositionNow(S.getDesiredScrollPositionFromDelta(xe))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let r={};this.writeScrollPosition(r,e),this._scrollable.setScrollPositionNow(r)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},cV=class C9{constructor(e,r,c,S,$,Z){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(c),this._arrowSize=Math.round(e),this._visibleSize=S,this._scrollSize=$,this._scrollPosition=Z,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new C9(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let r=Math.round(e);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(e){let r=Math.round(e);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let r=Math.round(e);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,r,c,S,$){let Z=Math.max(0,c-e),ue=Math.max(0,Z-2*r),xe=S>0&&S>c;if(!xe)return{computedAvailableSize:Math.round(Z),computedIsNeeded:xe,computedSliderSize:Math.round(ue),computedSliderRatio:0,computedSliderPosition:0};let Se=Math.round(Math.max(20,Math.floor(c*ue/S))),Ne=(ue-Se)/(S-c),it=$*Ne;return{computedAvailableSize:Math.round(Z),computedIsNeeded:xe,computedSliderSize:Math.round(Se),computedSliderRatio:Ne,computedSliderPosition:Math.round(it)}}_refreshComputedValues(){let e=C9._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let r=e-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let r=e-this._arrowSize,c=this._scrollPosition;return r0&&Math.abs(e.deltaY)>0)return 1;let c=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(c+=.25),r){let S=Math.abs(e.deltaX),$=Math.abs(e.deltaY),Z=Math.abs(r.deltaX),ue=Math.abs(r.deltaY),xe=Math.max(Math.min(S,Z),1),Se=Math.max(Math.min($,ue),1),Ne=Math.max(S,Z),it=Math.max($,ue);Ne%xe===0&&it%Se===0&&(c-=.5)}return Math.min(Math.max(c,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};A9.INSTANCE=new A9;var VAe=A9,WAe=class extends uL{constructor(t,e,r){super(),this._onScroll=this._register(new Es),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Es),this.onWillScroll=this._onWillScroll.event,this._options=GAe(e),this._scrollable=r,this._register(this._scrollable.onScroll(S=>{this._onWillScroll.fire(S),this._onDidScroll(S),this._onScroll.fire(S)}));let c={onMouseWheel:S=>this._onMouseWheel(S),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new UAe(this._scrollable,this._options,c)),this._horizontalScrollbar=this._register(new jAe(this._scrollable,this._options,c)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=A5(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=A5(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=A5(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,S=>this._onMouseOver(S)),this.onmouseleave(this._listenOnDomNode,S=>this._onMouseLeave(S)),this._hideTimeout=this._register(new sL),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=$x(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Pv&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new EF(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=$x(this._mouseWheelToDispose),t)){let e=r=>{this._onMouseWheel(new EF(r))};this._mouseWheelToDispose.push(Uu(this._listenOnDomNode,Qp.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let e=VAe.INSTANCE;e.acceptStandardWheelEvent(t);let r=!1;if(t.deltaY||t.deltaX){let S=t.deltaY*this._options.mouseWheelScrollSensitivity,$=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&$+S===0?$=S=0:Math.abs(S)>=Math.abs($)?$=0:S=0),this._options.flipAxes&&([S,$]=[$,S]);let Z=!Pv&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||Z)&&!$&&($=S,S=0),t.browserEvent&&t.browserEvent.altKey&&($=$*this._options.fastScrollSensitivity,S=S*this._options.fastScrollSensitivity);let ue=this._scrollable.getFutureScrollPosition(),xe={};if(S){let Se=BF*S,Ne=ue.scrollTop-(Se<0?Math.floor(Se):Math.ceil(Se));this._verticalScrollbar.writeScrollPosition(xe,Ne)}if($){let Se=BF*$,Ne=ue.scrollLeft-(Se<0?Math.floor(Se):Math.ceil(Se));this._horizontalScrollbar.writeScrollPosition(xe,Ne)}xe=this._scrollable.validateScrollPosition(xe),(ue.scrollLeft!==xe.scrollLeft||ue.scrollTop!==xe.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(xe):this._scrollable.setScrollPositionNow(xe),r=!0)}let c=r;!c&&this._options.alwaysConsumeMouseWheel&&(c=!0),!c&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(c=!0),c&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,r=t.scrollLeft>0,c=r?" left":"",S=e?" top":"",$=r||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${c}`),this._topShadowDomNode.setClassName(`shadow${S}`),this._topLeftShadowDomNode.setClassName(`shadow${$}${S}${c}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),$Ae)}},qAe=class extends WAe{constructor(e,r,c){super(e,r,c)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function GAe(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,Pv&&(e.className+=" mac"),e}var M9=class extends Sc{constructor(e,r,c,S,$,Z,ue,xe){super(),this._bufferService=c,this._optionsService=ue,this._renderService=xe,this._onRequestScrollLines=this._register(new Es),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let Se=this._register(new zAe({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:Ne=>lL(S.window,Ne)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{Se.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new qAe(r,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},Se)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register($.onProtocolChange(Ne=>{this._scrollableElement.updateOptions({handleMouseWheel:!(Ne&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(x0.runAndSubscribe(Z.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=Z.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(cd(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=S.mainDocument.createElement("style"),r.appendChild(this._styleElement),this._register(cd(()=>this._styleElement.remove())),this._register(x0.runAndSubscribe(Z.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${Z.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${Z.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${Z.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(Ne=>this._handleScroll(Ne)))}scrollLines(e){let r=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:r.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,r){r&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!r,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let r=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),c=r-this._bufferService.buffer.ydisp;c!==0&&(this._latestYDisp=r,this._onRequestScrollLines.fire(c)),this._isHandlingScroll=!1}};M9=Wd([cl(2,sm),cl(3,q1),cl(4,VH),cl(5,Y2),cl(6,lm),cl(7,G1)],M9);var E9=class extends Sc{constructor(e,r,c,S,$){super(),this._screenElement=e,this._bufferService=r,this._coreBrowserService=c,this._decorationService=S,this._renderService=$,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(Z=>this._removeDecoration(Z))),this._register(cd(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let c=e.options.x??0;return c&&c>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(e,r),r}_refreshStyle(e){let r=e.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let c=this._decorationElements.get(e);c||(c=this._createElement(e),e.element=c,this._decorationElements.set(e,c),this._container.appendChild(c),e.onDispose(()=>{this._decorationElements.delete(e),c.remove()})),c.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(c.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,c.style.top=`${r*this._renderService.dimensions.css.cell.height}px`,c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(c)}}_refreshXPosition(e,r=e.element){if(!r)return;let c=e.options.x??0;(e.options.anchor||"left")==="right"?r.style.right=c?`${c*this._renderService.dimensions.css.cell.width}px`:"":r.style.left=c?`${c*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};E9=Wd([cl(1,sm),cl(2,q1),cl(3,f4),cl(4,G1)],E9);var ZAe=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let r of this._zones)if(r.color===e.options.overviewRulerOptions.color&&r.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(r,e.marker.line))return;if(this._lineAdjacentToZone(r,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(r,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&r<=e.endBufferLine}_lineAdjacentToZone(e,r,c){return r>=e.startBufferLine-this._linePadding[c||"full"]&&r<=e.endBufferLine+this._linePadding[c||"full"]}_addLineToZone(e,r){e.startBufferLine=Math.min(e.startBufferLine,r),e.endBufferLine=Math.max(e.endBufferLine,r)}},mv={full:0,left:0,center:0,right:0},Uy={full:0,left:0,center:0,right:0},V3={full:0,left:0,center:0,right:0},e8=class extends Sc{constructor(e,r,c,S,$,Z,ue,xe){super(),this._viewportElement=e,this._screenElement=r,this._bufferService=c,this._decorationService=S,this._renderService=$,this._optionsService=Z,this._themeService=ue,this._coreBrowserService=xe,this._colorZoneStore=new ZAe,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(cd(()=>this._canvas?.remove()));let Se=this._canvas.getContext("2d");if(Se)this._ctx=Se;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),r=Math.ceil((this._canvas.width-1)/3);Uy.full=this._canvas.width,Uy.left=e,Uy.center=r,Uy.right=e,this._refreshDrawHeightConstants(),V3.full=1,V3.left=1,V3.center=1+Uy.left,V3.right=1+Uy.left+Uy.center}_refreshDrawHeightConstants(){mv.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,r=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);mv.left=r,mv.center=r,mv.right=r}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*mv.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let r of this._decorationService.decorations)this._colorZoneStore.addDecoration(r);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let r of e)r.position!=="full"&&this._renderColorZone(r);for(let r of e)r.position==="full"&&this._renderColorZone(r);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(V3[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-mv[e.position||"full"]/2),Uy[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+mv[e.position||"full"]))}_queueRefresh(e,r){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=r||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};e8=Wd([cl(2,sm),cl(3,f4),cl(4,G1),cl(5,lm),cl(6,Y2),cl(7,q1)],e8);var Uo;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=` +`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(Uo||={});var kT;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(kT||={});var hV;(t=>t.ST=`${Uo.ESC}\\`)(hV||={});var L9=class{constructor(e,r,c,S,$,Z){this._textarea=e,this._compositionView=r,this._bufferService=c,this._optionsService=S,this._coreService=$,this._renderService=Z,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let c;r.start+=this._dataAlreadySent.length,this._isComposing?c=this._textarea.value.substring(r.start,this._compositionPosition.start):c=this._textarea.value.substring(r.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}},0)}else{this._isSendingComposition=!1;let r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let r=this._textarea.value,c=r.replace(e,"");this._dataAlreadySent=c,r.length>e.length?this._coreService.triggerDataEvent(c,!0):r.lengththis.updateCompositionElements(!0),0)}}};L9=Wd([cl(2,sm),cl(3,lm),cl(4,Zx),cl(5,G1)],L9);var e0=0,t0=0,r0=0,Ud=0,RF={css:"#00000000",rgba:0},bp;(t=>{function e(S,$,Z,ue){return ue!==void 0?`#${px(S)}${px($)}${px(Z)}${px(ue)}`:`#${px(S)}${px($)}${px(Z)}`}t.toCss=e;function r(S,$,Z,ue=255){return(S<<24|$<<16|Z<<8|ue)>>>0}t.toRgba=r;function c(S,$,Z,ue){return{css:t.toCss(S,$,Z,ue),rgba:t.toRgba(S,$,Z,ue)}}t.toColor=c})(bp||={});var Zf;(t=>{function e(xe,Se){if(Ud=(Se.rgba&255)/255,Ud===1)return{css:Se.css,rgba:Se.rgba};let Ne=Se.rgba>>24&255,it=Se.rgba>>16&255,pt=Se.rgba>>8&255,bt=xe.rgba>>24&255,wt=xe.rgba>>16&255,Dt=xe.rgba>>8&255;e0=bt+Math.round((Ne-bt)*Ud),t0=wt+Math.round((it-wt)*Ud),r0=Dt+Math.round((pt-Dt)*Ud);let Zt=bp.toCss(e0,t0,r0),Mr=bp.toRgba(e0,t0,r0);return{css:Zt,rgba:Mr}}t.blend=e;function r(xe){return(xe.rgba&255)===255}t.isOpaque=r;function c(xe,Se,Ne){let it=TT.ensureContrastRatio(xe.rgba,Se.rgba,Ne);if(it)return bp.toColor(it>>24&255,it>>16&255,it>>8&255)}t.ensureContrastRatio=c;function S(xe){let Se=(xe.rgba|255)>>>0;return[e0,t0,r0]=TT.toChannels(Se),{css:bp.toCss(e0,t0,r0),rgba:Se}}t.opaque=S;function $(xe,Se){return Ud=Math.round(Se*255),[e0,t0,r0]=TT.toChannels(xe.rgba),{css:bp.toCss(e0,t0,r0,Ud),rgba:bp.toRgba(e0,t0,r0,Ud)}}t.opacity=$;function Z(xe,Se){return Ud=xe.rgba&255,$(xe,Ud*Se/255)}t.multiplyOpacity=Z;function ue(xe){return[xe.rgba>>24&255,xe.rgba>>16&255,xe.rgba>>8&255]}t.toColorRGB=ue})(Zf||={});var Td;(t=>{let e,r;try{let S=document.createElement("canvas");S.width=1,S.height=1;let $=S.getContext("2d",{willReadFrequently:!0});$&&(e=$,e.globalCompositeOperation="copy",r=e.createLinearGradient(0,0,1,1))}catch{}function c(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return e0=parseInt(S.slice(1,2).repeat(2),16),t0=parseInt(S.slice(2,3).repeat(2),16),r0=parseInt(S.slice(3,4).repeat(2),16),bp.toColor(e0,t0,r0);case 5:return e0=parseInt(S.slice(1,2).repeat(2),16),t0=parseInt(S.slice(2,3).repeat(2),16),r0=parseInt(S.slice(3,4).repeat(2),16),Ud=parseInt(S.slice(4,5).repeat(2),16),bp.toColor(e0,t0,r0,Ud);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}let $=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return e0=parseInt($[1]),t0=parseInt($[2]),r0=parseInt($[3]),Ud=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),bp.toColor(e0,t0,r0,Ud);if(!e||!r)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=r,e.fillStyle=S,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[e0,t0,r0,Ud]=e.getImageData(0,0,1,1).data,Ud!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:bp.toRgba(e0,t0,r0,Ud),css:S}}t.toColor=c})(Td||={});var em;(t=>{function e(c){return r(c>>16&255,c>>8&255,c&255)}t.relativeLuminance=e;function r(c,S,$){let Z=c/255,ue=S/255,xe=$/255,Se=Z<=.03928?Z/12.92:Math.pow((Z+.055)/1.055,2.4),Ne=ue<=.03928?ue/12.92:Math.pow((ue+.055)/1.055,2.4),it=xe<=.03928?xe/12.92:Math.pow((xe+.055)/1.055,2.4);return Se*.2126+Ne*.7152+it*.0722}t.relativeLuminance2=r})(em||={});var TT;(t=>{function e(Z,ue){if(Ud=(ue&255)/255,Ud===1)return ue;let xe=ue>>24&255,Se=ue>>16&255,Ne=ue>>8&255,it=Z>>24&255,pt=Z>>16&255,bt=Z>>8&255;return e0=it+Math.round((xe-it)*Ud),t0=pt+Math.round((Se-pt)*Ud),r0=bt+Math.round((Ne-bt)*Ud),bp.toRgba(e0,t0,r0)}t.blend=e;function r(Z,ue,xe){let Se=em.relativeLuminance(Z>>8),Ne=em.relativeLuminance(ue>>8);if(v1(Se,Ne)>8));if(wt>8));return wt>Zt?bt:Dt}return bt}let it=S(Z,ue,xe),pt=v1(Se,em.relativeLuminance(it>>8));if(pt>8));return pt>wt?it:bt}return it}}t.ensureContrastRatio=r;function c(Z,ue,xe){let Se=Z>>24&255,Ne=Z>>16&255,it=Z>>8&255,pt=ue>>24&255,bt=ue>>16&255,wt=ue>>8&255,Dt=v1(em.relativeLuminance2(pt,bt,wt),em.relativeLuminance2(Se,Ne,it));for(;Dt0||bt>0||wt>0);)pt-=Math.max(0,Math.ceil(pt*.1)),bt-=Math.max(0,Math.ceil(bt*.1)),wt-=Math.max(0,Math.ceil(wt*.1)),Dt=v1(em.relativeLuminance2(pt,bt,wt),em.relativeLuminance2(Se,Ne,it));return(pt<<24|bt<<16|wt<<8|255)>>>0}t.reduceLuminance=c;function S(Z,ue,xe){let Se=Z>>24&255,Ne=Z>>16&255,it=Z>>8&255,pt=ue>>24&255,bt=ue>>16&255,wt=ue>>8&255,Dt=v1(em.relativeLuminance2(pt,bt,wt),em.relativeLuminance2(Se,Ne,it));for(;Dt>>0}t.increaseLuminance=S;function $(Z){return[Z>>24&255,Z>>16&255,Z>>8&255,Z&255]}t.toChannels=$})(TT||={});function px(t){let e=t.toString(16);return e.length<2?"0"+e:e}function v1(t,e){return t1){let Ne=this._getJoinedRanges(c,Z,$,e,S);for(let it=0;it1){let Se=this._getJoinedRanges(c,Z,$,e,S);for(let Ne=0;Ne=yi,Di=Sr,En=this._workCell;if(bt.length>0&&Sr===bt[0][0]&&ti){let Xi=bt.shift(),so=this._isCellInSelection(Xi[0],r);for(ni=Xi[0]+1;ni=Xi[1],ti?(Jr=!0,En=new KAe(this._workCell,e.translateToString(!0,Xi[0],Xi[1]),Xi[1]-Xi[0]),Di=Xi[1]-1,ei=En.getWidth()):yi=Xi[1]}let Zn=this._isCellInSelection(Sr,r),ga=c&&Sr===Z,ya=fr&&Sr>=Ne&&Sr<=it,ro=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Xi=>{ro=!0});let qn=En.getChars()||c_;if(qn===" "&&(En.isUnderline()||En.isOverline())&&(qn=" "),on=ei*xe-Se.get(qn,En.isBold(),En.isItalic()),!Zt)Zt=this._document.createElement("span");else if(Mr&&(Zn&&ri||!Zn&&!ri&&En.bg===or)&&(Zn&&ri&&wt.selectionForeground||En.fg===Cr)&&En.extended.ext===gi&&ya===Si&&on===Ci&&!ga&&!Jr&&!ro&&ti){En.isInvisible()?ze+=c_:ze+=qn,Mr++;continue}else Mr&&(Zt.textContent=ze),Zt=this._document.createElement("span"),Mr=0,ze="";if(or=En.bg,Cr=En.fg,gi=En.extended.ext,Si=ya,Ci=on,ri=Zn,Jr&&Z>=Sr&&Z<=Di&&(Z=Sr),!this._coreService.isCursorHidden&&ga&&this._coreService.isCursorInitialized){if(gr.push("xterm-cursor"),this._coreBrowserService.isFocused)ue&&gr.push("xterm-cursor-blink"),gr.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":gr.push("xterm-cursor-outline");break;case"block":gr.push("xterm-cursor-block");break;case"bar":gr.push("xterm-cursor-bar");break;case"underline":gr.push("xterm-cursor-underline");break}}if(En.isBold()&&gr.push("xterm-bold"),En.isItalic()&&gr.push("xterm-italic"),En.isDim()&&gr.push("xterm-dim"),En.isInvisible()?ze=c_:ze=En.getChars()||c_,En.isUnderline()&&(gr.push(`xterm-underline-${En.extended.underlineStyle}`),ze===" "&&(ze=" "),!En.isUnderlineColorDefault()))if(En.isUnderlineColorRGB())Zt.style.textDecorationColor=`rgb(${h4.toColorRGB(En.getUnderlineColor()).join(",")})`;else{let Xi=En.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&En.isBold()&&Xi<8&&(Xi+=8),Zt.style.textDecorationColor=wt.ansi[Xi].css}En.isOverline()&&(gr.push("xterm-overline"),ze===" "&&(ze=" ")),En.isStrikethrough()&&gr.push("xterm-strikethrough"),ya&&(Zt.style.textDecoration="underline");let ln=En.getFgColor(),nn=En.getFgColorMode(),On=En.getBgColor(),Ra=En.getBgColorMode(),Xa=!!En.isInverse();if(Xa){let Xi=ln;ln=On,On=Xi;let so=nn;nn=Ra,Ra=so}let zo,xa,$r=!1;this._decorationService.forEachDecorationAtCell(Sr,r,void 0,Xi=>{Xi.options.layer!=="top"&&$r||(Xi.backgroundColorRGB&&(Ra=50331648,On=Xi.backgroundColorRGB.rgba>>8&16777215,zo=Xi.backgroundColorRGB),Xi.foregroundColorRGB&&(nn=50331648,ln=Xi.foregroundColorRGB.rgba>>8&16777215,xa=Xi.foregroundColorRGB),$r=Xi.options.layer==="top")}),!$r&&Zn&&(zo=this._coreBrowserService.isFocused?wt.selectionBackgroundOpaque:wt.selectionInactiveBackgroundOpaque,On=zo.rgba>>8&16777215,Ra=50331648,$r=!0,wt.selectionForeground&&(nn=50331648,ln=wt.selectionForeground.rgba>>8&16777215,xa=wt.selectionForeground)),$r&&gr.push("xterm-decoration-top");let Mi;switch(Ra){case 16777216:case 33554432:Mi=wt.ansi[On],gr.push(`xterm-bg-${On}`);break;case 50331648:Mi=bp.toColor(On>>16,On>>8&255,On&255),this._addStyle(Zt,`background-color:#${FF((On>>>0).toString(16),"0",6)}`);break;case 0:default:Xa?(Mi=wt.foreground,gr.push("xterm-bg-257")):Mi=wt.background}switch(zo||En.isDim()&&(zo=Zf.multiplyOpacity(Mi,.5)),nn){case 16777216:case 33554432:En.isBold()&&ln<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ln+=8),this._applyMinimumContrast(Zt,Mi,wt.ansi[ln],En,zo,void 0)||gr.push(`xterm-fg-${ln}`);break;case 50331648:let Xi=bp.toColor(ln>>16&255,ln>>8&255,ln&255);this._applyMinimumContrast(Zt,Mi,Xi,En,zo,xa)||this._addStyle(Zt,`color:#${FF(ln.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(Zt,Mi,wt.foreground,En,zo,xa)||Xa&&gr.push("xterm-fg-257")}gr.length&&(Zt.className=gr.join(" "),gr.length=0),!ga&&!Jr&&!ro&&ti?Mr++:Zt.textContent=ze,on!==this.defaultSpacing&&(Zt.style.letterSpacing=`${on}px`),pt.push(Zt),Sr=Di}return Zt&&Mr&&(Zt.textContent=ze),pt}_applyMinimumContrast(e,r,c,S,$,Z){if(this._optionsService.rawOptions.minimumContrastRatio===1||JAe(S.getCode()))return!1;let ue=this._getContrastCache(S),xe;if(!$&&!Z&&(xe=ue.getColor(r.rgba,c.rgba)),xe===void 0){let Se=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);xe=Zf.ensureContrastRatio($||r,Z||c,Se),ue.setColor(($||r).rgba,(Z||c).rgba,xe??null)}return xe?(this._addStyle(e,`color:${xe.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,r){e.setAttribute("style",`${e.getAttribute("style")||""}${r};`)}_isCellInSelection(e,r){let c=this._selectionStart,S=this._selectionEnd;return!c||!S?!1:this._columnSelectMode?c[0]<=S[0]?e>=c[0]&&r>=c[1]&&e=c[1]&&e>=S[0]&&r<=S[1]:r>c[1]&&r=c[0]&&e=c[0]}};P9=Wd([cl(1,GH),cl(2,lm),cl(3,q1),cl(4,Zx),cl(5,f4),cl(6,Y2)],P9);function FF(t,e,r){for(;t.length0&&(this._flat[S]=ue),ue}let $=e;r&&($+="B"),c&&($+="I");let Z=this._holey.get($);if(Z===void 0){let ue=0;r&&(ue|=1),c&&(ue|=2),Z=this._measure(e,ue),Z>0&&this._holey.set($,Z)}return Z}_measure(e,r){let c=this._measureElements[r];return c.textContent=e.repeat(32),c.offsetWidth/32}},t7e=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,r,c,S=!1){if(this.selectionStart=r,this.selectionEnd=c,!r||!c||r[0]===c[0]&&r[1]===c[1]){this.clear();return}let $=e.buffers.active.ydisp,Z=r[1]-$,ue=c[1]-$,xe=Math.max(Z,0),Se=Math.min(ue,e.rows-1);if(xe>=e.rows||Se<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=Z,this.viewportEndRow=ue,this.viewportCappedStartRow=xe,this.viewportCappedEndRow=Se,this.startCol=r[0],this.endCol=c[0]}isCellSelected(e,r,c){return this.hasSelection?(c-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&c>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&c<=this.viewportCappedEndRow:c>this.viewportStartRow&&c=this.startCol&&r=this.startCol):!1}};function r7e(){return new t7e}var Q7="xterm-dom-renderer-owner-",ug="xterm-rows",eT="xterm-fg-",NF="xterm-bg-",W3="xterm-focus",tT="xterm-selection",i7e=1,I9=class extends Sc{constructor(e,r,c,S,$,Z,ue,xe,Se,Ne,it,pt,bt,wt){super(),this._terminal=e,this._document=r,this._element=c,this._screenElement=S,this._viewportElement=$,this._helperContainer=Z,this._linkifier2=ue,this._charSizeService=Se,this._optionsService=Ne,this._bufferService=it,this._coreService=pt,this._coreBrowserService=bt,this._themeService=wt,this._terminalClass=i7e++,this._rowElements=[],this._selectionRenderModel=r7e(),this.onRequestRedraw=this._register(new Es).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ug),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(tT),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=QAe(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(Dt=>this._injectCss(Dt))),this._injectCss(this._themeService.colors),this._rowFactory=xe.createInstance(P9,document),this._element.classList.add(Q7+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(Dt=>this._handleLinkHover(Dt))),this._register(this._linkifier2.onHideLinkUnderline(Dt=>this._handleLinkLeave(Dt))),this._register(cd(()=>{this._element.classList.remove(Q7+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new e7e(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let c of this._rowElements)c.style.width=`${this.dimensions.css.canvas.width}px`,c.style.height=`${this.dimensions.css.cell.height}px`,c.style.lineHeight=`${this.dimensions.css.cell.height}px`,c.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let r=`${this._terminalSelector} .${ug} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=r,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let r=`${this._terminalSelector} .${ug} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;r+=`${this._terminalSelector} .${ug} .xterm-dim { color: ${Zf.multiplyOpacity(e.foreground,.5).css};}`,r+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let c=`blink_underline_${this._terminalClass}`,S=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;r+=`@keyframes ${c} { 50% { border-bottom-style: hidden; }}`,r+=`@keyframes ${S} { 50% { box-shadow: none; }}`,r+=`@keyframes ${$} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,r+=`${this._terminalSelector} .${ug}.${W3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${c} 1s step-end infinite;}${this._terminalSelector} .${ug}.${W3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${S} 1s step-end infinite;}${this._terminalSelector} .${ug}.${W3} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${ug} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ug} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ug} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ug} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ug} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,r+=`${this._terminalSelector} .${tT} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${tT} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${tT} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[Z,ue]of e.ansi.entries())r+=`${this._terminalSelector} .${eT}${Z} { color: ${ue.css}; }${this._terminalSelector} .${eT}${Z}.xterm-dim { color: ${Zf.multiplyOpacity(ue,.5).css}; }${this._terminalSelector} .${NF}${Z} { background-color: ${ue.css}; }`;r+=`${this._terminalSelector} .${eT}257 { color: ${Zf.opaque(e.background).css}; }${this._terminalSelector} .${eT}257.xterm-dim { color: ${Zf.multiplyOpacity(Zf.opaque(e.background),.5).css}; }${this._terminalSelector} .${NF}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=r}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,r){for(let c=this._rowElements.length;c<=r;c++){let S=this._document.createElement("div");this._rowContainer.appendChild(S),this._rowElements.push(S)}for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,r){this._refreshRowElements(e,r),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(W3),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(W3),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,r,c){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,r,c),this.renderRows(0,this._bufferService.rows-1),!e||!r||(this._selectionRenderModel.update(this._terminal,e,r,c),!this._selectionRenderModel.hasSelection))return;let S=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,ue=this._selectionRenderModel.viewportCappedEndRow,xe=this._document.createDocumentFragment();if(c){let Se=e[0]>r[0];xe.appendChild(this._createSelectionElement(Z,Se?r[0]:e[0],Se?e[0]:r[0],ue-Z+1))}else{let Se=S===Z?e[0]:0,Ne=Z===$?r[0]:this._bufferService.cols;xe.appendChild(this._createSelectionElement(Z,Se,Ne));let it=ue-Z-1;if(xe.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,it)),Z!==ue){let pt=$===ue?r[0]:this._bufferService.cols;xe.appendChild(this._createSelectionElement(ue,0,pt))}}this._selectionContainer.appendChild(xe)}_createSelectionElement(e,r,c,S=1){let $=this._document.createElement("div"),Z=r*this.dimensions.css.cell.width,ue=this.dimensions.css.cell.width*(c-r);return Z+ue>this.dimensions.css.canvas.width&&(ue=this.dimensions.css.canvas.width-Z),$.style.height=`${S*this.dimensions.css.cell.height}px`,$.style.top=`${e*this.dimensions.css.cell.height}px`,$.style.left=`${Z}px`,$.style.width=`${ue}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,r){let c=this._bufferService.buffer,S=c.ybase+c.y,$=Math.min(c.x,this._bufferService.cols-1),Z=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,ue=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,xe=this._optionsService.rawOptions.cursorInactiveStyle;for(let Se=e;Se<=r;Se++){let Ne=Se+c.ydisp,it=this._rowElements[Se],pt=c.lines.get(Ne);if(!it||!pt)break;it.replaceChildren(...this._rowFactory.createRow(pt,Ne,Ne===S,ue,xe,$,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Q7}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,r,c,S,$,Z){c<0&&(e=0),S<0&&(r=0);let ue=this._bufferService.rows-1;c=Math.max(Math.min(c,ue),0),S=Math.max(Math.min(S,ue),0),$=Math.min($,this._bufferService.cols);let xe=this._bufferService.buffer,Se=xe.ybase+xe.y,Ne=Math.min(xe.x,$-1),it=this._optionsService.rawOptions.cursorBlink,pt=this._optionsService.rawOptions.cursorStyle,bt=this._optionsService.rawOptions.cursorInactiveStyle;for(let wt=c;wt<=S;++wt){let Dt=wt+xe.ydisp,Zt=this._rowElements[wt],Mr=xe.lines.get(Dt);if(!Zt||!Mr)break;Zt.replaceChildren(...this._rowFactory.createRow(Mr,Dt,Dt===Se,pt,bt,Ne,it,this.dimensions.css.cell.width,this._widthCache,Z?wt===c?e:0:-1,Z?(wt===S?r:$)-1:-1))}}};I9=Wd([cl(7,rL),cl(8,V8),cl(9,lm),cl(10,sm),cl(11,Zx),cl(12,q1),cl(13,Y2)],I9);var D9=class extends Sc{constructor(e,r,c){super(),this._optionsService=c,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Es),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new a7e(this._optionsService))}catch{this._measureStrategy=this._register(new n7e(e,r,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};D9=Wd([cl(2,lm)],D9);var fV=class extends Sc{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},n7e=class extends fV{constructor(t,e,r){super(),this._document=t,this._parentElement=e,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},a7e=class extends fV{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let r=this._ctx.measureText("W");if(!("width"in r&&"fontBoundingBoxAscent"in r&&"fontBoundingBoxDescent"in r))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},o7e=class extends Sc{constructor(e,r,c){super(),this._textarea=e,this._window=r,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new s7e(this._window)),this._onDprChange=this._register(new Es),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Es),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(S=>this._screenDprMonitor.setWindow(S))),this._register(x0.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Uu(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Uu(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},s7e=class extends Sc{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new W2),this._onDprChange=this._register(new Es),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(cd(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Uu(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},l7e=class extends Sc{constructor(){super(),this.linkProviders=[],this._register(cd(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function cL(t,e,r){let c=r.getBoundingClientRect(),S=t.getComputedStyle(r),$=parseInt(S.getPropertyValue("padding-left")),Z=parseInt(S.getPropertyValue("padding-top"));return[e.clientX-c.left-$,e.clientY-c.top-Z]}function u7e(t,e,r,c,S,$,Z,ue,xe){if(!$)return;let Se=cL(t,e,r);if(Se)return Se[0]=Math.ceil((Se[0]+(xe?Z/2:0))/Z),Se[1]=Math.ceil(Se[1]/ue),Se[0]=Math.min(Math.max(Se[0],1),c+(xe?1:0)),Se[1]=Math.min(Math.max(Se[1],1),S),Se}var z9=class{constructor(e,r){this._renderService=e,this._charSizeService=r}getCoords(e,r,c,S,$){return u7e(window,e,r,c,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,$)}getMouseReportCoords(e,r){let c=cL(window,e,r);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};z9=Wd([cl(0,G1),cl(1,V8)],z9);var c7e=class{constructor(e,r){this._renderCallback=e,this._coreBrowserService=r,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,r,c){this._rowCount=c,e=e!==void 0?e:0,r=r!==void 0?r:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,r):r,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,r),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},dV={};xCe(dV,{getSafariVersion:()=>f7e,isChromeOS:()=>vV,isFirefox:()=>pV,isIpad:()=>d7e,isIphone:()=>p7e,isLegacyEdge:()=>h7e,isLinux:()=>hL,isMac:()=>r8,isNode:()=>W8,isSafari:()=>mV,isWindows:()=>gV});var W8=typeof process<"u"&&"title"in process,d4=W8?"node":navigator.userAgent,p4=W8?"node":navigator.platform,pV=d4.includes("Firefox"),h7e=d4.includes("Edge"),mV=/^((?!chrome|android).)*safari/i.test(d4);function f7e(){if(!mV)return 0;let t=d4.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var r8=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p4),d7e=p4==="iPad",p7e=p4==="iPhone",gV=["Windows","Win16","Win32","WinCE"].includes(p4),hL=p4.indexOf("Linux")>=0,vV=/\bCrOS\b/.test(d4),yV=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._iS){c-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-e))}ms`),this._start();return}c=S}this.clear()}},m7e=class extends yV{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let r=performance.now()+e;return{timeRemaining:()=>Math.max(0,r-performance.now())}}},g7e=class extends yV{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},i8=!W8&&"requestIdleCallback"in window?g7e:m7e,v7e=class{constructor(){this._queue=new i8}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},O9=class extends Sc{constructor(e,r,c,S,$,Z,ue,xe,Se){super(),this._rowCount=e,this._optionsService=c,this._charSizeService=S,this._coreService=$,this._coreBrowserService=xe,this._renderer=this._register(new W2),this._pausedResizeTask=new v7e,this._observerDisposable=this._register(new W2),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Es),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Es),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Es),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Es),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c7e((Ne,it)=>this._renderRows(Ne,it),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new y7e(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(cd(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(ue.onResize(()=>this._fullRefresh())),this._register(ue.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(Z.onDecorationRegistered(()=>this._fullRefresh())),this._register(Z.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(ue.cols,ue.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(ue.buffer.y,ue.buffer.y,!0))),this._register(Se.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,r),this._register(this._coreBrowserService.onWindowChange(Ne=>this._registerIntersectionObserver(Ne,r)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,r){if("IntersectionObserver"in e){let c=new e.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});c.observe(r),this._observerDisposable.value=cd(()=>c.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,r,c=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,r);return}let S=this._syncOutputHandler.flush();S&&(e=Math.min(e,S.start),r=Math.max(r,S.end)),c||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,r,this._rowCount)}_renderRows(e,r){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,r);return}e=Math.min(e,this._rowCount-1),r=Math.min(r,this._rowCount-1),this._renderer.value.renderRows(e,r),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:r}),this._onRender.fire({start:e,end:r}),this._isNextRenderRedrawOnly=!0}}resize(e,r){this._rowCount=r,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(r=>this.refreshRows(r.start,r.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,r){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,r)):this._renderer.value.handleResize(e,r),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,r,c){this._selectionState.start=e,this._selectionState.end=r,this._selectionState.columnSelectMode=c,this._renderer.value?.handleSelectionChanged(e,r,c)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};O9=Wd([cl(2,lm),cl(3,V8),cl(4,Zx),cl(5,f4),cl(6,sm),cl(7,q1),cl(8,Y2)],O9);var y7e=class{constructor(t,e,r){this._coreBrowserService=t,this._coreService=e,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function _7e(t,e,r,c){let S=r.buffer.x,$=r.buffer.y;if(!r.buffer.hasScrollback)return w7e(S,$,t,e,r,c)+q8($,e,r,c)+k7e(S,$,t,e,r,c);let Z;if($===e)return Z=S>t?"D":"C",Z5(Math.abs(S-t),G5(Z,c));Z=$>e?"D":"C";let ue=Math.abs($-e),xe=b7e($>e?t:S,r)+(ue-1)*r.cols+1+x7e($>e?S:t);return Z5(xe,G5(Z,c))}function x7e(t,e){return t-1}function b7e(t,e){return e.cols-t}function w7e(t,e,r,c,S,$){return q8(e,c,S,$).length===0?"":Z5(xV(t,e,t,e-Hx(e,S),!1,S).length,G5("D",$))}function q8(t,e,r,c){let S=t-Hx(t,r),$=e-Hx(e,r),Z=Math.abs(S-$)-T7e(t,e,r);return Z5(Z,G5(_V(t,e),c))}function k7e(t,e,r,c,S,$){let Z;q8(e,c,S,$).length>0?Z=c-Hx(c,S):Z=e;let ue=c,xe=S7e(t,e,r,c,S,$);return Z5(xV(t,Z,r,ue,xe==="C",S).length,G5(xe,$))}function T7e(t,e,r){let c=0,S=t-Hx(t,r),$=e-Hx(e,r);for(let Z=0;Z=0&&t0?Z=c-Hx(c,S):Z=e,t=r&&Ze?"A":"B"}function xV(t,e,r,c,S,$){let Z=t,ue=e,xe="";for(;(Z!==r||ue!==c)&&ue>=0&&ue<$.buffer.lines.length;)Z+=S?1:-1,S&&Z>$.cols-1?(xe+=$.buffer.translateBufferLineToString(ue,!1,t,Z),Z=0,t=0,ue++):!S&&Z<0&&(xe+=$.buffer.translateBufferLineToString(ue,!1,0,t+1),Z=$.cols-1,t=Z,ue--);return xe+$.buffer.translateBufferLineToString(ue,!1,t,Z)}function G5(t,e){let r=e?"O":"[";return Uo.ESC+r+t}function Z5(t,e){t=Math.floor(t);let r="";for(let c=0;cthis._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function jF(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var eM=50,A7e=15,M7e=50,E7e=500,L7e=" ",P7e=new RegExp(L7e,"g"),B9=class extends Sc{constructor(e,r,c,S,$,Z,ue,xe,Se){super(),this._element=e,this._screenElement=r,this._linkifier=c,this._bufferService=S,this._coreService=$,this._mouseService=Z,this._optionsService=ue,this._renderService=xe,this._coreBrowserService=Se,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new bg,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Es),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Es),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Es),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Es),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Ne=>this._handleMouseMove(Ne),this._mouseUpListener=Ne=>this._handleMouseUp(Ne),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(Ne=>this._handleTrim(Ne)),this._register(this._bufferService.buffers.onBufferActivate(Ne=>this._handleBufferActivate(Ne))),this.enable(),this._model=new C7e(this._bufferService),this._activeSelectionMode=0,this._register(cd(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(Ne=>{Ne.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!e||!r?!1:e[0]!==r[0]||e[1]!==r[1]}get selectionText(){let e=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;if(!e||!r)return"";let c=this._bufferService.buffer,S=[];if(this._activeSelectionMode===3){if(e[0]===r[0])return"";let $=e[0]$.replace(P7e," ")).join(gV?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),uL&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let r=this._getMouseBufferCoords(e),c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!c||!S||!r?!1:this._areCoordsInSelection(r,c,S)}isCellInSelection(e,r){let c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!c||!S?!1:this._areCoordsInSelection([e,r],c,S)}_areCoordsInSelection(e,r,c){return e[1]>r[1]&&e[1]=r[0]&&e[0]=r[0]}_selectWordAtCursor(e,r){let c=this._linkifier.currentLink?.link?.range;if(c)return this._model.selectionStart=[c.start.x-1,c.start.y-1],this._model.selectionStartLength=FF(c,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let S=this._getMouseBufferCoords(e);return S?(this._selectWordAt(S,r),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,r){this._model.clearSelection(),e=Math.max(e,0),r=Math.min(r,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,r],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let r=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(r)return r[0]--,r[1]--,r[1]+=this._bufferService.buffer.ydisp,r}_getMouseEventScrollAmount(e){let r=lL(this._coreBrowserService.window,e,this._screenElement)[1],c=this._renderService.dimensions.css.canvas.height;return r>=0&&r<=c?0:(r>c&&(r-=c),r=Math.min(Math.max(r,-J7),J7),r/=J7,r/Math.abs(r)+Math.round(r*(QAe-1)))}shouldForceSelection(e){return eS?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),e7e)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let r=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);r&&r.length!==this._model.selectionStart[0]&&r.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let r=this._getMouseBufferCoords(e);r&&(this._activeSelectionMode=2,this._selectLineAt(r[1]))}shouldColumnSelect(e){return e.altKey&&!(eS&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let r=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let c=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let r=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&rthis._handleTrim(r))}_convertViewportColToCharacterIndex(e,r){let c=r;for(let S=0;r>=S;S++){let H=e.loadCell(S,this._workCell).getChars().length;this._workCell.getWidth()===0?c--:H>1&&r!==S&&(c+=H-1)}return c}setSelection(e,r,c){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,r],this._model.selectionStartLength=c,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,r,c=!0,S=!0){if(e[0]>=this._bufferService.cols)return;let H=this._bufferService.buffer,Z=H.lines.get(e[1]);if(!Z)return;let ue=H.translateBufferLineToString(e[1],!1),be=this._convertViewportColToCharacterIndex(Z,e[0]),Se=be,Re=e[0]-be,Xe=0,vt=0,bt=0,kt=0;if(ue.charAt(be)===" "){for(;be>0&&ue.charAt(be-1)===" ";)be--;for(;Se1&&(kt+=wi-1,Se+=wi-1);Er>0&&be>0&&!this._isCharWordSeparator(Z.loadCell(Er-1,this._workCell));){Z.loadCell(Er-1,this._workCell);let ur=this._workCell.getChars().length;this._workCell.getWidth()===0?(Xe++,Er--):ur>1&&(bt+=ur-1,be-=ur-1),be--,Er--}for(;Fe1&&(kt+=ur-1,Se+=ur-1),Se++,Fe++}}Se++;let Dt=be+Re-Xe+bt,rr=Math.min(this._bufferService.cols,Se-be+Xe+vt-bt-kt);if(!(!r&&ue.slice(be,Se).trim()==="")){if(c&&Dt===0&&Z.getCodePoint(0)!==32){let Er=H.lines.get(e[1]-1);if(Er&&Z.isWrapped&&Er.getCodePoint(this._bufferService.cols-1)!==32){let Fe=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(Fe){let wi=this._bufferService.cols-Fe.start;Dt-=wi,rr+=wi}}}if(S&&Dt+rr===this._bufferService.cols&&Z.getCodePoint(this._bufferService.cols-1)!==32){let Er=H.lines.get(e[1]+1);if(Er?.isWrapped&&Er.getCodePoint(0)!==32){let Fe=this._getWordAt([0,e[1]+1],!1,!1,!0);Fe&&(rr+=Fe.length)}}return{start:Dt,length:rr}}}_selectWordAt(e,r){let c=this._getWordAt(e,r);if(c){for(;c.start<0;)c.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[c.start,e[1]],this._model.selectionStartLength=c.length}}_selectToWordAt(e){let r=this._getWordAt(e,!0);if(r){let c=e[1];for(;r.start<0;)r.start+=this._bufferService.cols,c--;if(!this._model.areSelectionValuesReversed())for(;r.start+r.length>this._bufferService.cols;)r.length-=this._bufferService.cols,c++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?r.start:r.start+r.length,c]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let r=this._bufferService.buffer.getWrappedRangeForLine(e),c={start:{x:0,y:r.first},end:{x:this._bufferService.cols-1,y:r.last}};this._model.selectionStart=[0,r.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=FF(c,this._bufferService.cols)}};z9=Vd([cl(3,sm),cl(4,Gx),cl(5,tL),cl(6,lm),cl(7,W1),cl(8,V1)],z9);var NF=class{constructor(){this._data={}}set(e,r,c){this._data[e]||(this._data[e]={}),this._data[e][r]=c}get(e,r){return this._data[e]?this._data[e][r]:void 0}clear(){this._data={}}},jF=class{constructor(){this._color=new NF,this._css=new NF}setCss(e,r,c){this._css.set(e,r,c)}getCss(e,r){return this._css.get(e,r)}setColor(e,r,c){this._color.set(e,r,c)}getColor(e,r){return this._color.get(e,r)}clear(){this._color.clear(),this._css.clear()}},Ep=Object.freeze((()=>{let t=[kd.toColor("#2e3436"),kd.toColor("#cc0000"),kd.toColor("#4e9a06"),kd.toColor("#c4a000"),kd.toColor("#3465a4"),kd.toColor("#75507b"),kd.toColor("#06989a"),kd.toColor("#d3d7cf"),kd.toColor("#555753"),kd.toColor("#ef2929"),kd.toColor("#8ae234"),kd.toColor("#fce94f"),kd.toColor("#729fcf"),kd.toColor("#ad7fa8"),kd.toColor("#34e2e2"),kd.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let r=0;r<216;r++){let c=e[r/36%6|0],S=e[r/6%6|0],H=e[r%6];t.push({css:xp.toCss(c,S,H),rgba:xp.toRgba(c,S,H)})}for(let r=0;r<24;r++){let c=8+r*10;t.push({css:xp.toCss(c,c,c),rgba:xp.toRgba(c,c,c)})}return t})()),vx=kd.toColor("#ffffff"),a5=kd.toColor("#000000"),UF=kd.toColor("#ffffff"),$F=a5,V3={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},n7e=vx,O9=class extends Sc{constructor(e){super(),this._optionsService=e,this._contrastCache=new jF,this._halfContrastCache=new jF,this._onChangeColors=this._register(new Ms),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:vx,background:a5,cursor:UF,cursorAccent:$F,selectionForeground:void 0,selectionBackgroundTransparent:V3,selectionBackgroundOpaque:Gf.blend(a5,V3),selectionInactiveBackgroundTransparent:V3,selectionInactiveBackgroundOpaque:Gf.blend(a5,V3),scrollbarSliderBackground:Gf.opacity(vx,.2),scrollbarSliderHoverBackground:Gf.opacity(vx,.4),scrollbarSliderActiveBackground:Gf.opacity(vx,.5),overviewRulerBorder:vx,ansi:Ep.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let r=this._colors;if(r.foreground=yf(e.foreground,vx),r.background=yf(e.background,a5),r.cursor=Gf.blend(r.background,yf(e.cursor,UF)),r.cursorAccent=Gf.blend(r.background,yf(e.cursorAccent,$F)),r.selectionBackgroundTransparent=yf(e.selectionBackground,V3),r.selectionBackgroundOpaque=Gf.blend(r.background,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundTransparent=yf(e.selectionInactiveBackground,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundOpaque=Gf.blend(r.background,r.selectionInactiveBackgroundTransparent),r.selectionForeground=e.selectionForeground?yf(e.selectionForeground,OF):void 0,r.selectionForeground===OF&&(r.selectionForeground=void 0),Gf.isOpaque(r.selectionBackgroundTransparent)&&(r.selectionBackgroundTransparent=Gf.opacity(r.selectionBackgroundTransparent,.3)),Gf.isOpaque(r.selectionInactiveBackgroundTransparent)&&(r.selectionInactiveBackgroundTransparent=Gf.opacity(r.selectionInactiveBackgroundTransparent,.3)),r.scrollbarSliderBackground=yf(e.scrollbarSliderBackground,Gf.opacity(r.foreground,.2)),r.scrollbarSliderHoverBackground=yf(e.scrollbarSliderHoverBackground,Gf.opacity(r.foreground,.4)),r.scrollbarSliderActiveBackground=yf(e.scrollbarSliderActiveBackground,Gf.opacity(r.foreground,.5)),r.overviewRulerBorder=yf(e.overviewRulerBorder,n7e),r.ansi=Ep.slice(),r.ansi[0]=yf(e.black,Ep[0]),r.ansi[1]=yf(e.red,Ep[1]),r.ansi[2]=yf(e.green,Ep[2]),r.ansi[3]=yf(e.yellow,Ep[3]),r.ansi[4]=yf(e.blue,Ep[4]),r.ansi[5]=yf(e.magenta,Ep[5]),r.ansi[6]=yf(e.cyan,Ep[6]),r.ansi[7]=yf(e.white,Ep[7]),r.ansi[8]=yf(e.brightBlack,Ep[8]),r.ansi[9]=yf(e.brightRed,Ep[9]),r.ansi[10]=yf(e.brightGreen,Ep[10]),r.ansi[11]=yf(e.brightYellow,Ep[11]),r.ansi[12]=yf(e.brightBlue,Ep[12]),r.ansi[13]=yf(e.brightMagenta,Ep[13]),r.ansi[14]=yf(e.brightCyan,Ep[14]),r.ansi[15]=yf(e.brightWhite,Ep[15]),e.extendedAnsi){let c=Math.min(r.ansi.length-16,e.extendedAnsi.length);for(let S=0;SH.index-Z.index),c=[];for(let H of r){let Z=this._services.get(H.id);if(!Z)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${H.id._id}.`);c.push(Z)}let S=r.length>0?r[0].index:e.length;if(e.length!==S)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${S+1} conflicts with ${e.length} static arguments`);return new t(...e,...c)}},s7e={trace:0,debug:1,info:2,warn:3,error:4,off:5},l7e="xterm.js: ",B9=class extends Sc{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=s7e[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let r=0;rthis._length)for(let r=this._length;r=e;S--)this._array[this._getCyclicIndex(S+c.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;Sthis._maxLength){let S=this._length+c.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=c.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,r,c){if(!(r<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let H=r-1;H>=0;H--)this.set(e+H+c,this.get(e+H));let S=e+r+c-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S>22,r&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):c]}set(e,r){this._data[e*Tc+1]=r[0],r[1].length>1?(this._combined[e]=r[1],this._data[e*Tc+0]=e|2097152|r[2]<<22):this._data[e*Tc+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(e){return this._data[e*Tc+0]>>22}hasWidth(e){return this._data[e*Tc+0]&12582912}getFg(e){return this._data[e*Tc+1]}getBg(e){return this._data[e*Tc+2]}hasContent(e){return this._data[e*Tc+0]&4194303}getCodePoint(e){let r=this._data[e*Tc+0];return r&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):r&2097151}isCombined(e){return this._data[e*Tc+0]&2097152}getString(e){let r=this._data[e*Tc+0];return r&2097152?this._combined[e]:r&2097151?e_(r&2097151):""}isProtected(e){return this._data[e*Tc+2]&536870912}loadCell(e,r){return eT=e*Tc,r.content=this._data[eT+0],r.fg=this._data[eT+1],r.bg=this._data[eT+2],r.content&2097152&&(r.combinedData=this._combined[e]),r.bg&268435456&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){r.content&2097152&&(this._combined[e]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*Tc+0]=r.content,this._data[e*Tc+1]=r.fg,this._data[e*Tc+2]=r.bg}setCellFromCodepoint(e,r,c,S){S.bg&268435456&&(this._extendedAttrs[e]=S.extended),this._data[e*Tc+0]=r|c<<22,this._data[e*Tc+1]=S.fg,this._data[e*Tc+2]=S.bg}addCodepointToCell(e,r,c){let S=this._data[e*Tc+0];S&2097152?this._combined[e]+=e_(r):S&2097151?(this._combined[e]=e_(S&2097151)+e_(r),S&=-2097152,S|=2097152):S=r|1<<22,c&&(S&=-12582913,S|=c<<22),this._data[e*Tc+0]=S}insertCells(e,r,c){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,c),r=0;--H)this.setCell(e+r+H,this.loadCell(e+H,S));for(let H=0;Hthis.length){if(this._data.buffer.byteLength>=c*4)this._data=new Uint32Array(this._data.buffer,0,c);else{let S=new Uint32Array(c);S.set(this._data),this._data=S}for(let S=this.length;S=e&&delete this._combined[ue]}let H=Object.keys(this._extendedAttrs);for(let Z=0;Z=e&&delete this._extendedAttrs[ue]}}return this.length=e,c*4*Q7=0;--e)if(this._data[e*Tc+0]&4194303)return e+(this._data[e*Tc+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Tc+0]&4194303||this._data[e*Tc+2]&50331648)return e+(this._data[e*Tc+0]>>22);return 0}copyCellsFrom(e,r,c,S,H){let Z=e._data;if(H)for(let be=S-1;be>=0;be--){for(let Se=0;Se=r&&(this._combined[Se-r+c]=e._combined[Se])}}translateToString(e,r,c,S){r=r??0,c=c??this.length,e&&(c=Math.min(c,this.getTrimmedLength())),S&&(S.length=0);let H="";for(;r>22||1}return S&&S.push(r),H}};function u7e(t,e,r,c,S,H){let Z=[];for(let ue=0;ue=ue&&c0&&(rr>Xe||Re[rr].getTrimmedLength()===0);rr--)Dt++;Dt>0&&(Z.push(ue+Re.length-Dt),Z.push(Dt)),ue+=Re.length-1}return Z}function c7e(t,e){let r=[],c=0,S=e[c],H=0;for(let Z=0;ZG5(t,Se,e)).reduce((be,Se)=>be+Se),H=0,Z=0,ue=0;for(;uebe&&(H-=be,Z++);let Se=t[Z].getWidth(H-1)===2;Se&&H--;let Re=Se?r-1:r;c.push(Re),ue+=Re}return c}function G5(t,e,r){if(e===t.length-1)return t[e].getTrimmedLength();let c=!t[e].hasContent(r-1)&&t[e].getWidth(r-1)===1,S=t[e+1].getWidth(0)===2;return c&&S?r-1:r}var _V=class xV{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=xV._nextId++,this._onDispose=this.register(new Ms),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ux(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};_V._nextId=1;var d7e=_V,Op={},yx=Op.B;Op[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Op.A={"#":"£"};Op.B=void 0;Op[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Op.C=Op[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Op.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Op.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Op.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Op.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Op.E=Op[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Op.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Op.H=Op[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Op["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var VF=4294967295,WF=class{constructor(t,e,r){this._hasScrollback=t,this._optionsService=e,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=yp.clone(),this.savedCharset=yx,this.markers=[],this._nullCell=xg.fromCharData([0,RH,1,0]),this._whitespaceCell=xg.fromCharData([0,s_,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new tS,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new HF(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new XT),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new XT),this._whitespaceCell}getBlankLine(t,e){return new o5(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&tVF?VF:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=yp);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new HF(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let r=this.getNullCell(yp),c=0,S=this._getCorrectBufferLength(e);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+H+1?(this.ybase--,H++,this.ydisp>0&&this.ydisp--):this.lines.push(new o5(t,r)));else for(let Z=this._rows;Z>e;Z--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S0&&(this.lines.trimStart(Z),this.ybase=Math.max(this.ybase-Z,0),this.ydisp=Math.max(this.ydisp-Z,0),this.savedY=Math.max(this.savedY-Z,0)),this.lines.maxLength=S}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),H&&(this.y+=H),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let H=0;H.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let r=this._optionsService.rawOptions.reflowCursorLine,c=u7e(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(yp),r);if(c.length>0){let S=c7e(this.lines,c);h7e(this.lines,S.layout),this._reflowLargerAdjustViewport(t,e,S.countRemoved)}}_reflowLargerAdjustViewport(t,e,r){let c=this.getNullCell(yp),S=r;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;Z--){let ue=this.lines.get(Z);if(!ue||!ue.isWrapped&&ue.getTrimmedLength()<=t)continue;let be=[ue];for(;ue.isWrapped&&Z>0;)ue=this.lines.get(--Z),be.unshift(ue);if(!r){let wi=this.ybase+this.y;if(wi>=Z&&wi0&&(S.push({start:Z+be.length+H,newLines:bt}),H+=bt.length),be.push(...bt);let kt=Re.length-1,Dt=Re[kt];Dt===0&&(kt--,Dt=Re[kt]);let rr=be.length-Xe-1,Er=Se;for(;rr>=0;){let wi=Math.min(Er,Dt);if(be[kt]===void 0)break;if(be[kt].copyCellsFrom(be[rr],Er-wi,Dt-wi,wi,!0),Dt-=wi,Dt===0&&(kt--,Dt=Re[kt]),Er-=wi,Er===0){rr--;let ur=Math.max(rr,0);Er=G5(be,ur,this._cols)}}for(let wi=0;wi0;)this.ybase===0?this.y0){let Z=[],ue=[];for(let Dt=0;Dt=0;Dt--)if(Xe&&Xe.start>Se+vt){for(let rr=Xe.newLines.length-1;rr>=0;rr--)this.lines.set(Dt--,Xe.newLines[rr]);Dt++,Z.push({index:Se+1,amount:Xe.newLines.length}),vt+=Xe.newLines.length,Xe=S[++Re]}else this.lines.set(Dt,ue[Se--]);let bt=0;for(let Dt=Z.length-1;Dt>=0;Dt--)Z[Dt].index+=bt,this.lines.onInsertEmitter.fire(Z[Dt]),bt+=Z[Dt].amount;let kt=Math.max(0,be+H-this.lines.maxLength);kt>0&&this.lines.onTrimEmitter.fire(kt)}}translateBufferLineToString(t,e,r=0,c){let S=this.lines.get(t);return S?S.translateToString(e,r,c):""}getWrappedRangeForLine(t){let e=t,r=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;r+10;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e{e.line-=r,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(r=>{e.line>=r.index&&(e.line+=r.amount)})),e.register(this.lines.onDelete(r=>{e.line>=r.index&&e.liner.index&&(e.line-=r.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},p7e=class extends Sc{constructor(e,r){super(),this._optionsService=e,this._bufferService=r,this._onBufferActivate=this._register(new Ms),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new WF(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new WF(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,r){this._normal.resize(e,r),this._alt.resize(e,r),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},bV=2,wV=1,R9=class extends Sc{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new Ms),this.onResize=this._onResize.event,this._onScroll=this._register(new Ms),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,bV),this.rows=Math.max(t.rawOptions.rows||0,wV),this.buffers=this._register(new p7e(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let r=this.cols!==t,c=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:r,rowsChanged:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let r=this.buffer,c;c=this._cachedBlankLine,(!c||c.length!==this.cols||c.getFg(0)!==t.fg||c.getBg(0)!==t.bg)&&(c=r.getBlankLine(t,e),this._cachedBlankLine=c),c.isWrapped=e;let S=r.ybase+r.scrollTop,H=r.ybase+r.scrollBottom;if(r.scrollTop===0){let Z=r.lines.isFull;H===r.lines.length-1?Z?r.lines.recycle().copyFrom(c):r.lines.push(c.clone()):r.lines.splice(H+1,0,c.clone()),Z?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let Z=H-S+1;r.lines.shiftElements(S+1,Z-1,-1),r.lines.set(H,c.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(t,e){let r=this.buffer;if(t<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else t+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let c=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+t,r.ybase),0),c!==r.ydisp&&(e||this._onScroll.fire(r.ydisp))}};R9=Vd([cl(0,lm)],R9);var v2={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:eS,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},m7e=["normal","bold","100","200","300","400","500","600","700","800","900"],g7e=class extends Sc{constructor(e){super(),this._onOptionChange=this._register(new Ms),this.onOptionChange=this._onOptionChange.event;let r={...v2};for(let c in e)if(c in r)try{let S=e[c];r[c]=this._sanitizeAndValidateOption(c,S)}catch(S){console.error(S)}this.rawOptions=r,this.options={...r},this._setupOptions(),this._register(ld(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,r){return this.onOptionChange(c=>{c===e&&r(this.rawOptions[e])})}onMultipleOptionChange(e,r){return this.onOptionChange(c=>{e.indexOf(c)!==-1&&r()})}_setupOptions(){let e=c=>{if(!(c in v2))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},r=(c,S)=>{if(!(c in v2))throw new Error(`No option with key "${c}"`);S=this._sanitizeAndValidateOption(c,S),this.rawOptions[c]!==S&&(this.rawOptions[c]=S,this._onOptionChange.fire(c))};for(let c in this.rawOptions){let S={get:e.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this.options,c,S)}}_sanitizeAndValidateOption(e,r){switch(e){case"cursorStyle":if(r||(r=v2[e]),!v7e(r))throw new Error(`"${r}" is not a valid value for ${e}`);break;case"wordSeparator":r||(r=v2[e]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=m7e.includes(r)?r:v2[e];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${e} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(r*10)/10));break;case"scrollback":if(r=Math.min(r,4294967295),r<0)throw new Error(`${e} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${e} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{};break}return r}};function v7e(t){return t==="block"||t==="underline"||t==="bar"}function s5(t,e=5){if(typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let c in t)r[c]=e<=1?t[c]:t[c]&&s5(t[c],e-1);return r}var qF=Object.freeze({insertMode:!1}),GF=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),F9=class extends Sc{constructor(e,r,c){super(),this._bufferService=e,this._logService=r,this._optionsService=c,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Ms),this.onData=this._onData.event,this._onUserInput=this._register(new Ms),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Ms),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Ms),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=s5(qF),this.decPrivateModes=s5(GF)}reset(){this.modes=s5(qF),this.decPrivateModes=s5(GF)}triggerDataEvent(e,r=!1){if(this._optionsService.rawOptions.disableStdin)return;let c=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&c.ybase!==c.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(S=>S.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(e))}};F9=Vd([cl(0,sm),cl(1,$H),cl(2,lm)],F9);var ZF={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function eM(t,e){let r=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(r|=64,r|=t.action):(r|=t.button&3,t.button&4&&(r|=64),t.button&8&&(r|=128),t.action===32?r|=32:t.action===0&&!e&&(r|=3)),r}var tM=String.fromCharCode,KF={DEFAULT:t=>{let e=[eM(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${tM(e[0])}${tM(e[1])}${tM(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${eM(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${eM(t,!0)};${t.x};${t.y}${e}`}},N9=class extends Sc{constructor(t,e,r){super(),this._bufferService=t,this._coreService=e,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Ms),this.onProtocolChange=this._onProtocolChange.event;for(let c of Object.keys(ZF))this.addProtocol(c,ZF[c]);for(let c of Object.keys(KF))this.addEncoding(c,KF[c]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,r){if(t.deltaY===0||t.shiftKey||e===void 0||r===void 0)return 0;let c=e/r,S=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=c+0,Math.abs(t.deltaY)<50&&(S*=.3),this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,r){if(r){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};N9=Vd([cl(0,sm),cl(1,Gx),cl(2,lm)],N9);var rM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],y7e=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Lp;function _7e(t,e){let r=0,c=e.length-1,S;if(te[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,r){let c=this.wcwidth(e),S=c===0&&r!==0;if(S){let H=Sx.extractWidth(r);H===0?S=!1:H>c&&(c=H)}return Sx.createPropertyValue(0,c,S)}},Sx=class kT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ms,this.onChange=this._onChange.event;let e=new x7e;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,r,c=!1){return(e&16777215)<<3|(r&3)<<1|(c?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let r=0,c=0,S=e.length;for(let H=0;H=S)return r+this.wcwidth(Z);let Se=e.charCodeAt(H);56320<=Se&&Se<=57343?Z=(Z-55296)*1024+Se-56320+65536:r+=this.wcwidth(Se)}let ue=this.charProperties(Z,c),be=kT.extractWidth(ue);kT.extractShouldJoin(ue)&&(be-=kT.extractWidth(c)),r+=be,c=ue}return r}charProperties(e,r){return this._activeProvider.charProperties(e,r)}},b7e=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,r){this._charsets[e]=r,this.glevel===e&&(this.charset=r)}};function YF(t){let e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),r=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);r&&e&&(r.isWrapped=e[3]!==0&&e[3]!==32)}var W3=2147483647,w7e=256,kV=class j9{constructor(e=32,r=32){if(this.maxLength=e,this.maxSubParamsLength=r,r>w7e)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let r=new j9;if(!e.length)return r;for(let c=Array.isArray(e[0])?1:0;c>8,S=this._subParamsIdx[r]&255;S-c>0&&e.push(Array.prototype.slice.call(this._subParams,c,S))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>W3?W3:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>W3?W3:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let r=this._subParamsIdx[e]>>8,c=this._subParamsIdx[e]&255;return c-r>0?this._subParams.subarray(r,c):null}getSubParamsAll(){let e={};for(let r=0;r>8,S=this._subParamsIdx[r]&255;S-c>0&&(e[r]=this._subParams.slice(c,S))}return e}addDigit(e){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let c=this._digitIsSub?this._subParams:this.params,S=c[r-1];c[r-1]=~S?Math.min(S*10+e,W3):e}},q3=[],k7e=class{constructor(){this._state=0,this._active=q3,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,r){this._handlers[e]===void 0&&(this._handlers[e]=[]);let c=this._handlers[e];return c.push(r),{dispose:()=>{let S=c.indexOf(r);S!==-1&&c.splice(S,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=q3}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=q3,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||q3,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,r,c){if(!this._active.length)this._handlerFb(this._id,"PUT",US(e,r,c));else for(let S=this._active.length-1;S>=0;S--)this._active[S].put(e,r,c)}start(){this.reset(),this._state=1}put(e,r,c){if(this._state!==3){if(this._state===1)for(;r0&&this._put(e,r,c)}}end(e,r=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let c=!1,S=this._active.length-1,H=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,c=r,H=this._stack.fallThrough,this._stack.paused=!1),!H&&c===!1){for(;S>=0&&(c=this._active[S].end(e),c!==!0);S--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,c;S--}for(;S>=0;S--)if(c=this._active[S].end(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,c}this._active=q3,this._id=-1,this._state=0}}},Vm=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,r,c){this._hitLimit||(this._data+=US(e,r,c),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let r=!1;if(this._hitLimit)r=!1;else if(e&&(r=this._handler(this._data),r instanceof Promise))return r.then(c=>(this._data="",this._hitLimit=!1,c));return this._data="",this._hitLimit=!1,r}},G3=[],T7e=class{constructor(){this._handlers=Object.create(null),this._active=G3,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=G3}registerHandler(e,r){this._handlers[e]===void 0&&(this._handlers[e]=[]);let c=this._handlers[e];return c.push(r),{dispose:()=>{let S=c.indexOf(r);S!==-1&&c.splice(S,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=G3,this._ident=0}hook(e,r){if(this.reset(),this._ident=e,this._active=this._handlers[e]||G3,!this._active.length)this._handlerFb(this._ident,"HOOK",r);else for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(r)}put(e,r,c){if(!this._active.length)this._handlerFb(this._ident,"PUT",US(e,r,c));else for(let S=this._active.length-1;S>=0;S--)this._active[S].put(e,r,c)}unhook(e,r=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let c=!1,S=this._active.length-1,H=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,c=r,H=this._stack.fallThrough,this._stack.paused=!1),!H&&c===!1){for(;S>=0&&(c=this._active[S].unhook(e),c!==!0);S--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,c;S--}for(;S>=0;S--)if(c=this._active[S].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,c}this._active=G3,this._ident=0}},l5=new kV;l5.addParam(0);var XF=class{constructor(t){this._handler=t,this._data="",this._params=l5,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():l5,this._data="",this._hitLimit=!1}put(t,e,r){this._hitLimit||(this._data+=US(t,e,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(r=>(this._params=l5,this._data="",this._hitLimit=!1,r));return this._params=l5,this._data="",this._hitLimit=!1,e}},S7e=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,r){this.table.fill(e<<4|r)}add(e,r,c,S){this.table[r<<8|e]=c<<4|S}addMany(e,r,c,S){for(let H=0;Hbe),r=(ue,be)=>e.slice(ue,be),c=r(32,127),S=r(0,24);S.push(25),S.push.apply(S,r(28,32));let H=r(0,14),Z;t.setDefault(1,0),t.addMany(c,0,2,0);for(Z in H)t.addMany([24,26,153,154],Z,3,0),t.addMany(r(128,144),Z,3,0),t.addMany(r(144,152),Z,3,0),t.add(156,Z,0,0),t.add(27,Z,11,1),t.add(157,Z,4,8),t.addMany([152,158,159],Z,0,7),t.add(155,Z,11,3),t.add(144,Z,11,9);return t.addMany(S,0,3,0),t.addMany(S,1,3,1),t.add(127,1,0,1),t.addMany(S,8,0,8),t.addMany(S,3,3,3),t.add(127,3,0,3),t.addMany(S,4,3,4),t.add(127,4,0,4),t.addMany(S,6,3,6),t.addMany(S,5,3,5),t.add(127,5,0,5),t.addMany(S,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(c,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(r(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(c,7,0,7),t.addMany(S,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(r(64,127),3,7,0),t.addMany(r(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(r(48,60),4,8,4),t.addMany(r(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(r(32,64),6,0,6),t.add(127,6,0,6),t.addMany(r(64,127),6,0,0),t.addMany(r(32,48),3,9,5),t.addMany(r(32,48),5,9,5),t.addMany(r(48,64),5,0,6),t.addMany(r(64,127),5,7,0),t.addMany(r(32,48),4,9,5),t.addMany(r(32,48),1,9,2),t.addMany(r(32,48),2,9,2),t.addMany(r(48,127),2,10,0),t.addMany(r(48,80),1,10,0),t.addMany(r(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(r(96,127),1,10,0),t.add(80,1,11,9),t.addMany(S,9,0,9),t.add(127,9,0,9),t.addMany(r(28,32),9,0,9),t.addMany(r(32,48),9,9,12),t.addMany(r(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(S,11,0,11),t.addMany(r(32,128),11,0,11),t.addMany(r(28,32),11,0,11),t.addMany(S,10,0,10),t.add(127,10,0,10),t.addMany(r(28,32),10,0,10),t.addMany(r(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(r(32,48),10,9,12),t.addMany(S,12,0,12),t.add(127,12,0,12),t.addMany(r(28,32),12,0,12),t.addMany(r(32,48),12,9,12),t.addMany(r(48,64),12,0,11),t.addMany(r(64,127),12,12,13),t.addMany(r(64,127),10,12,13),t.addMany(r(64,127),9,12,13),t.addMany(S,13,13,13),t.addMany(c,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(pg,0,2,0),t.add(pg,8,5,8),t.add(pg,6,0,6),t.add(pg,11,0,11),t.add(pg,13,13,13),t}(),A7e=class extends Sc{constructor(e=C7e){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new kV,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,c,S)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,c)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ld(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new k7e),this._dcsParser=this._register(new T7e),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,r=[64,126]){let c=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=e.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let H=0;HZ||Z>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=Z}}if(e.final.length!==1)throw new Error("final must be a single byte");let S=e.final.charCodeAt(0);if(r[0]>S||S>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return c<<=8,c|=S,c}identToString(e){let r=[];for(;e;)r.push(String.fromCharCode(e&255)),e>>=8;return r.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,r){let c=this._identifier(e,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);let S=this._escHandlers[c];return S.push(r),{dispose:()=>{let H=S.indexOf(r);H!==-1&&S.splice(H,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,r){this._executeHandlers[e.charCodeAt(0)]=r}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,r){let c=this._identifier(e);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);let S=this._csiHandlers[c];return S.push(r),{dispose:()=>{let H=S.indexOf(r);H!==-1&&S.splice(H,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,r){return this._dcsParser.registerHandler(this._identifier(e),r)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,r){return this._oscParser.registerHandler(e,r)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,r,c,S,H){this._parseStack.state=e,this._parseStack.handlers=r,this._parseStack.handlerPos=c,this._parseStack.transition=S,this._parseStack.chunkPos=H}parse(e,r,c){let S=0,H=0,Z=0,ue;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,Z=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let be=this._parseStack.handlers,Se=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&Se>-1){for(;Se>=0&&(ue=be[Se](this._params),ue!==!0);Se--)if(ue instanceof Promise)return this._parseStack.handlerPos=Se,ue}this._parseStack.handlers=[];break;case 4:if(c===!1&&Se>-1){for(;Se>=0&&(ue=be[Se](),ue!==!0);Se--)if(ue instanceof Promise)return this._parseStack.handlerPos=Se,ue}this._parseStack.handlers=[];break;case 6:if(S=e[this._parseStack.chunkPos],ue=this._dcsParser.unhook(S!==24&&S!==26,c),ue)return ue;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=e[this._parseStack.chunkPos],ue=this._oscParser.end(S!==24&&S!==26,c),ue)return ue;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,Z=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let be=Z;be>4){case 2:for(let bt=be+1;;++bt){if(bt>=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=0&&(ue=Se[Re](this._params),ue!==!0);Re--)if(ue instanceof Promise)return this._preserveStack(3,Se,Re,H,be),ue;Re<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++be47&&S<60);be--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:let Xe=this._escHandlers[this._collect<<8|S],vt=Xe?Xe.length-1:-1;for(;vt>=0&&(ue=Xe[vt](),ue!==!0);vt--)if(ue instanceof Promise)return this._preserveStack(4,Xe,vt,H,be),ue;vt<0&&this._escHandlerFb(this._collect<<8|S),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|S,this._params);break;case 13:for(let bt=be+1;;++bt)if(bt>=r||(S=e[bt])===24||S===26||S===27||S>127&&S=r||(S=e[bt])<32||S>127&&S>4:H>>8}return c}}function iM(t,e){let r=t.toString(16),c=r.length<2?"0"+r:r;switch(e){case 4:return r[0];case 8:return c;case 12:return(c+c).slice(0,3);default:return c+c}}function L7e(t,e=16){let[r,c,S]=t;return`rgb:${iM(r,e)}/${iM(c,e)}/${iM(S,e)}`}var P7e={"(":0,")":1,"*":2,"+":3,"-":1,".":2},jy=131072,QF=10;function eN(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var tN=5e3,rN=0,I7e=class extends Sc{constructor(t,e,r,c,S,H,Z,ue,be=new A7e){super(),this._bufferService=t,this._charsetService=e,this._coreService=r,this._logService=c,this._optionsService=S,this._oscLinkService=H,this._coreMouseService=Z,this._unicodeService=ue,this._parser=be,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new X8e,this._utf8Decoder=new J8e,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=yp.clone(),this._eraseAttrDataInternal=yp.clone(),this._onRequestBell=this._register(new Ms),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Ms),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Ms),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Ms),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Ms),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Ms),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Ms),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Ms),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Ms),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Ms),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Ms),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Ms),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Ms),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new U9(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(Se=>this._activeBuffer=Se.activeBuffer)),this._parser.setCsiHandlerFallback((Se,Re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Se),params:Re.toArray()})}),this._parser.setEscHandlerFallback(Se=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Se)})}),this._parser.setExecuteHandlerFallback(Se=>{this._logService.debug("Unknown EXECUTE code: ",{code:Se})}),this._parser.setOscHandlerFallback((Se,Re,Xe)=>{this._logService.debug("Unknown OSC code: ",{identifier:Se,action:Re,data:Xe})}),this._parser.setDcsHandlerFallback((Se,Re,Xe)=>{Re==="HOOK"&&(Xe=Xe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Se),action:Re,payload:Xe})}),this._parser.setPrintHandler((Se,Re,Xe)=>this.print(Se,Re,Xe)),this._parser.registerCsiHandler({final:"@"},Se=>this.insertChars(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},Se=>this.scrollLeft(Se)),this._parser.registerCsiHandler({final:"A"},Se=>this.cursorUp(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},Se=>this.scrollRight(Se)),this._parser.registerCsiHandler({final:"B"},Se=>this.cursorDown(Se)),this._parser.registerCsiHandler({final:"C"},Se=>this.cursorForward(Se)),this._parser.registerCsiHandler({final:"D"},Se=>this.cursorBackward(Se)),this._parser.registerCsiHandler({final:"E"},Se=>this.cursorNextLine(Se)),this._parser.registerCsiHandler({final:"F"},Se=>this.cursorPrecedingLine(Se)),this._parser.registerCsiHandler({final:"G"},Se=>this.cursorCharAbsolute(Se)),this._parser.registerCsiHandler({final:"H"},Se=>this.cursorPosition(Se)),this._parser.registerCsiHandler({final:"I"},Se=>this.cursorForwardTab(Se)),this._parser.registerCsiHandler({final:"J"},Se=>this.eraseInDisplay(Se,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},Se=>this.eraseInDisplay(Se,!0)),this._parser.registerCsiHandler({final:"K"},Se=>this.eraseInLine(Se,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},Se=>this.eraseInLine(Se,!0)),this._parser.registerCsiHandler({final:"L"},Se=>this.insertLines(Se)),this._parser.registerCsiHandler({final:"M"},Se=>this.deleteLines(Se)),this._parser.registerCsiHandler({final:"P"},Se=>this.deleteChars(Se)),this._parser.registerCsiHandler({final:"S"},Se=>this.scrollUp(Se)),this._parser.registerCsiHandler({final:"T"},Se=>this.scrollDown(Se)),this._parser.registerCsiHandler({final:"X"},Se=>this.eraseChars(Se)),this._parser.registerCsiHandler({final:"Z"},Se=>this.cursorBackwardTab(Se)),this._parser.registerCsiHandler({final:"`"},Se=>this.charPosAbsolute(Se)),this._parser.registerCsiHandler({final:"a"},Se=>this.hPositionRelative(Se)),this._parser.registerCsiHandler({final:"b"},Se=>this.repeatPrecedingCharacter(Se)),this._parser.registerCsiHandler({final:"c"},Se=>this.sendDeviceAttributesPrimary(Se)),this._parser.registerCsiHandler({prefix:">",final:"c"},Se=>this.sendDeviceAttributesSecondary(Se)),this._parser.registerCsiHandler({final:"d"},Se=>this.linePosAbsolute(Se)),this._parser.registerCsiHandler({final:"e"},Se=>this.vPositionRelative(Se)),this._parser.registerCsiHandler({final:"f"},Se=>this.hVPosition(Se)),this._parser.registerCsiHandler({final:"g"},Se=>this.tabClear(Se)),this._parser.registerCsiHandler({final:"h"},Se=>this.setMode(Se)),this._parser.registerCsiHandler({prefix:"?",final:"h"},Se=>this.setModePrivate(Se)),this._parser.registerCsiHandler({final:"l"},Se=>this.resetMode(Se)),this._parser.registerCsiHandler({prefix:"?",final:"l"},Se=>this.resetModePrivate(Se)),this._parser.registerCsiHandler({final:"m"},Se=>this.charAttributes(Se)),this._parser.registerCsiHandler({final:"n"},Se=>this.deviceStatus(Se)),this._parser.registerCsiHandler({prefix:"?",final:"n"},Se=>this.deviceStatusPrivate(Se)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},Se=>this.softReset(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},Se=>this.setCursorStyle(Se)),this._parser.registerCsiHandler({final:"r"},Se=>this.setScrollRegion(Se)),this._parser.registerCsiHandler({final:"s"},Se=>this.saveCursor(Se)),this._parser.registerCsiHandler({final:"t"},Se=>this.windowOptions(Se)),this._parser.registerCsiHandler({final:"u"},Se=>this.restoreCursor(Se)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},Se=>this.insertColumns(Se)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},Se=>this.deleteColumns(Se)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},Se=>this.selectProtected(Se)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},Se=>this.requestMode(Se,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},Se=>this.requestMode(Se,!1)),this._parser.setExecuteHandler(Uo.BEL,()=>this.bell()),this._parser.setExecuteHandler(Uo.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Uo.BS,()=>this.backspace()),this._parser.setExecuteHandler(Uo.HT,()=>this.tab()),this._parser.setExecuteHandler(Uo.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Uo.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(bT.IND,()=>this.index()),this._parser.setExecuteHandler(bT.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(bT.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Vm(Se=>(this.setTitle(Se),this.setIconName(Se),!0))),this._parser.registerOscHandler(1,new Vm(Se=>this.setIconName(Se))),this._parser.registerOscHandler(2,new Vm(Se=>this.setTitle(Se))),this._parser.registerOscHandler(4,new Vm(Se=>this.setOrReportIndexedColor(Se))),this._parser.registerOscHandler(8,new Vm(Se=>this.setHyperlink(Se))),this._parser.registerOscHandler(10,new Vm(Se=>this.setOrReportFgColor(Se))),this._parser.registerOscHandler(11,new Vm(Se=>this.setOrReportBgColor(Se))),this._parser.registerOscHandler(12,new Vm(Se=>this.setOrReportCursorColor(Se))),this._parser.registerOscHandler(104,new Vm(Se=>this.restoreIndexedColor(Se))),this._parser.registerOscHandler(110,new Vm(Se=>this.restoreFgColor(Se))),this._parser.registerOscHandler(111,new Vm(Se=>this.restoreBgColor(Se))),this._parser.registerOscHandler(112,new Vm(Se=>this.restoreCursorColor(Se))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let Se in Op)this._parser.registerEscHandler({intermediates:"(",final:Se},()=>this.selectCharset("("+Se)),this._parser.registerEscHandler({intermediates:")",final:Se},()=>this.selectCharset(")"+Se)),this._parser.registerEscHandler({intermediates:"*",final:Se},()=>this.selectCharset("*"+Se)),this._parser.registerEscHandler({intermediates:"+",final:Se},()=>this.selectCharset("+"+Se)),this._parser.registerEscHandler({intermediates:"-",final:Se},()=>this.selectCharset("-"+Se)),this._parser.registerEscHandler({intermediates:".",final:Se},()=>this.selectCharset("."+Se)),this._parser.registerEscHandler({intermediates:"/",final:Se},()=>this.selectCharset("/"+Se));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(Se=>(this._logService.error("Parsing error: ",Se),Se)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new XF((Se,Re)=>this.requestStatusString(Se,Re)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,r,c){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=r,this._parseStack.position=c}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),tN))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${tN} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let r,c=this._activeBuffer.x,S=this._activeBuffer.y,H=0,Z=this._parseStack.paused;if(Z){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(r),r;c=this._parseStack.cursorStartX,S=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>jy&&(H=this._parseStack.position+jy)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,Se=>String.fromCharCode(Se)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(Se=>Se.charCodeAt(0)):t),this._parseBuffer.lengthjy)for(let Se=H;Se0&&Xe.getWidth(this._activeBuffer.x-1)===2&&Xe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Re);let vt=this._parser.precedingJoinState;for(let bt=e;btue){if(be){let Er=Xe,Fe=this._activeBuffer.x-rr;for(this._activeBuffer.x=rr,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Xe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),rr>0&&Xe instanceof o5&&Xe.copyCellsFrom(Er,Fe,0,rr,!1);Fe=0;)Xe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Re);continue}if(Se&&(Xe.insertCells(this._activeBuffer.x,S-rr,this._activeBuffer.getNullCell(Re)),Xe.getWidth(ue-1)===2&&Xe.setCellFromCodepoint(ue-1,0,1,Re)),Xe.setCellFromCodepoint(this._activeBuffer.x++,c,S,Re),S>0)for(;--S;)Xe.setCellFromCodepoint(this._activeBuffer.x++,0,0,Re)}this._parser.precedingJoinState=vt,this._activeBuffer.x0&&Xe.getWidth(this._activeBuffer.x)===0&&!Xe.hasContent(this._activeBuffer.x)&&Xe.setCellFromCodepoint(this._activeBuffer.x,0,1,Re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,r=>eN(r.params[0],this._optionsService.rawOptions.windowOptions)?e(r):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new XF(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Vm(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,r,c=!1,S=!1){let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);H.replaceCells(e,r,this._activeBuffer.getNullCell(this._eraseAttrData()),S),c&&(H.isWrapped=!1)}_resetBufferLine(t,e=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),r.isWrapped=!1)}eraseInDisplay(t,e=!1){this._restrictCursor(this._bufferService.cols);let r;switch(t.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let c=this._activeBuffer.lines.length-this._bufferService.rows;c>0&&(this._activeBuffer.lines.trimStart(c),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-c,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-c,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let be=ue;for(let Se=1;Se0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Uo.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Uo.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Uo.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Uo.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Uo.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e(Dt[Dt.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",Dt[Dt.SET=1]="SET",Dt[Dt.RESET=2]="RESET",Dt[Dt.PERMANENTLY_SET=3]="PERMANENTLY_SET",Dt[Dt.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(r||={});let c=this._coreService.decPrivateModes,{activeProtocol:S,activeEncoding:H}=this._coreMouseService,Z=this._coreService,{buffers:ue,cols:be}=this._bufferService,{active:Se,alt:Re}=ue,Xe=this._optionsService.rawOptions,vt=(Dt,rr)=>(Z.triggerDataEvent(`${Uo.ESC}[${e?"":"?"}${Dt};${rr}$y`),!0),bt=Dt=>Dt?1:2,kt=t.params[0];return e?kt===2?vt(kt,4):kt===4?vt(kt,bt(Z.modes.insertMode)):kt===12?vt(kt,3):kt===20?vt(kt,bt(Xe.convertEol)):vt(kt,0):kt===1?vt(kt,bt(c.applicationCursorKeys)):kt===3?vt(kt,Xe.windowOptions.setWinLines?be===80?2:be===132?1:0:0):kt===6?vt(kt,bt(c.origin)):kt===7?vt(kt,bt(c.wraparound)):kt===8?vt(kt,3):kt===9?vt(kt,bt(S==="X10")):kt===12?vt(kt,bt(Xe.cursorBlink)):kt===25?vt(kt,bt(!Z.isCursorHidden)):kt===45?vt(kt,bt(c.reverseWraparound)):kt===66?vt(kt,bt(c.applicationKeypad)):kt===67?vt(kt,4):kt===1e3?vt(kt,bt(S==="VT200")):kt===1002?vt(kt,bt(S==="DRAG")):kt===1003?vt(kt,bt(S==="ANY")):kt===1004?vt(kt,bt(c.sendFocus)):kt===1005?vt(kt,4):kt===1006?vt(kt,bt(H==="SGR")):kt===1015?vt(kt,4):kt===1016?vt(kt,bt(H==="SGR_PIXELS")):kt===1048?vt(kt,1):kt===47||kt===1047||kt===1049?vt(kt,bt(Se===Re)):kt===2004?vt(kt,bt(c.bracketedPasteMode)):kt===2026?vt(kt,bt(c.synchronizedOutput)):vt(kt,0)}_updateAttrColor(t,e,r,c,S){return e===2?(t|=50331648,t&=-16777216,t|=u4.fromColorRGB([r,c,S])):e===5&&(t&=-50331904,t|=33554432|r&255),t}_extractColor(t,e,r){let c=[0,0,-1,0,0,0],S=0,H=0;do{if(c[H+S]=t.params[e+H],t.hasSubParams(e+H)){let Z=t.getSubParams(e+H),ue=0;do c[1]===5&&(S=1),c[H+ue+1+S]=Z[ue];while(++ue=2||c[1]===2&&H+S>=5)break;c[1]&&(S=1)}while(++H+e5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=yp.fg,t.bg=yp.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,r,c=this._curAttrData;for(let S=0;S=30&&r<=37?(c.fg&=-50331904,c.fg|=16777216|r-30):r>=40&&r<=47?(c.bg&=-50331904,c.bg|=16777216|r-40):r>=90&&r<=97?(c.fg&=-50331904,c.fg|=16777216|r-90|8):r>=100&&r<=107?(c.bg&=-50331904,c.bg|=16777216|r-100|8):r===0?this._processSGR0(c):r===1?c.fg|=134217728:r===3?c.bg|=67108864:r===4?(c.fg|=268435456,this._processUnderline(t.hasSubParams(S)?t.getSubParams(S)[0]:1,c)):r===5?c.fg|=536870912:r===7?c.fg|=67108864:r===8?c.fg|=1073741824:r===9?c.fg|=2147483648:r===2?c.bg|=134217728:r===21?this._processUnderline(2,c):r===22?(c.fg&=-134217729,c.bg&=-134217729):r===23?c.bg&=-67108865:r===24?(c.fg&=-268435457,this._processUnderline(0,c)):r===25?c.fg&=-536870913:r===27?c.fg&=-67108865:r===28?c.fg&=-1073741825:r===29?c.fg&=2147483647:r===39?(c.fg&=-67108864,c.fg|=yp.fg&16777215):r===49?(c.bg&=-67108864,c.bg|=yp.bg&16777215):r===38||r===48||r===58?S+=this._extractColor(t,S,c):r===53?c.bg|=1073741824:r===55?c.bg&=-1073741825:r===59?(c.extended=c.extended.clone(),c.extended.underlineColor=-1,c.updateExtended()):r===100?(c.fg&=-67108864,c.fg|=yp.fg&16777215,c.bg&=-67108864,c.bg|=yp.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${Uo.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Uo.ESC}[${e};${r}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Uo.ESC}[?${e};${r}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=yp.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=e%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(t){let e=t.params[0]||1,r;return(t.length<2||(r=t.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(t){if(!eN(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Uo.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>QF&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>QF&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],r=t.split(";");for(;r.length>1;){let c=r.shift(),S=r.shift();if(/^\d+$/.exec(c)){let H=parseInt(c);if(iN(H))if(S==="?")e.push({type:0,index:H});else{let Z=JF(S);Z&&e.push({type:1,index:H,color:Z})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let r=t.slice(0,e).trim(),c=t.slice(e+1);return c?this._createHyperlink(r,c):r.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let r=t.split(":"),c,S=r.findIndex(H=>H.startsWith("id="));return S!==-1&&(c=r[S].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:c,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let r=t.split(";");for(let c=0;c=this._specialColors.length);++c,++e)if(r[c]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let S=JF(r[c]);S&&this._onColor.fire([{type:1,index:this._specialColors[e],color:S}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],r=t.split(";");for(let c=0;c=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=yp.clone(),this._eraseAttrDataInternal=yp.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new xg;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e(this._coreService.triggerDataEvent(`${Uo.ESC}${Z}${Uo.ESC}\\`),!0),c=this._bufferService.buffer,S=this._optionsService.rawOptions;return r(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${c.scrollTop+1};${c.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[S.cursorStyle]-(S.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},U9=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){tthis.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(rN=t,t=e,e=rN),tthis.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};U9=Vd([cl(0,sm)],U9);function iN(t){return 0<=t&&t<256}var D7e=5e7,nN=12,z7e=50,O7e=class extends Sc{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Ms),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,r){if(r!==void 0&&this._syncCalls>r){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let c;for(;c=this._writeBuffer.shift();){this._action(c);let S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,r){if(this._pendingData>D7e)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(r),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(r)}_innerWrite(e=0,r=!0){let c=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let S=this._writeBuffer[this._bufferOffset],H=this._action(S,r);if(H){let ue=be=>performance.now()-c>=nN?setTimeout(()=>this._innerWrite(0,be)):this._innerWrite(c,be);H.catch(be=>(queueMicrotask(()=>{throw be}),Promise.resolve(!1))).then(ue);return}let Z=this._callbacks[this._bufferOffset];if(Z&&Z(),this._bufferOffset++,this._pendingData-=S.length,performance.now()-c>=nN)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>z7e&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},$9=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let r=this._bufferService.buffer;if(e.id===void 0){let be=r.addMarker(r.ybase+r.y),Se={data:e,id:this._nextId++,lines:[be]};return be.onDispose(()=>this._removeMarkerFromLink(Se,be)),this._dataByLinkId.set(Se.id,Se),Se.id}let c=e,S=this._getEntryIdKey(c),H=this._entriesWithId.get(S);if(H)return this.addLineToLink(H.id,r.ybase+r.y),H.id;let Z=r.addMarker(r.ybase+r.y),ue={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[Z]};return Z.onDispose(()=>this._removeMarkerFromLink(ue,Z)),this._entriesWithId.set(ue.key,ue),this._dataByLinkId.set(ue.id,ue),ue.id}addLineToLink(e,r){let c=this._dataByLinkId.get(e);if(c&&c.lines.every(S=>S.line!==r)){let S=this._bufferService.buffer.addMarker(r);c.lines.push(S),S.onDispose(()=>this._removeMarkerFromLink(c,S))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,r){let c=e.lines.indexOf(r);c!==-1&&(e.lines.splice(c,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};$9=Vd([cl(0,sm)],$9);var aN=!1,B7e=class extends Sc{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new H2),this._onBinary=this._register(new Ms),this.onBinary=this._onBinary.event,this._onData=this._register(new Ms),this.onData=this._onData.event,this._onLineFeed=this._register(new Ms),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Ms),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Ms),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Ms),this._instantiationService=new o7e,this.optionsService=this._register(new g7e(e)),this._instantiationService.setService(lm,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(R9)),this._instantiationService.setService(sm,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(B9)),this._instantiationService.setService($H,this._logService),this.coreService=this._register(this._instantiationService.createInstance(F9)),this._instantiationService.setService(Gx,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(N9)),this._instantiationService.setService(UH,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Sx)),this._instantiationService.setService(rCe,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b7e),this._instantiationService.setService(tCe,this._charsetService),this._oscLinkService=this._instantiationService.createInstance($9),this._instantiationService.setService(HH,this._oscLinkService),this._inputHandler=this._register(new I7e(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(_0.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(_0.forward(this._bufferService.onResize,this._onResize)),this._register(_0.forward(this.coreService.onData,this._onData)),this._register(_0.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new O7e((r,c)=>this._inputHandler.parse(r,c))),this._register(_0.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Ms),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let r in e)this.optionsService.options[r]=e[r]}write(e,r){this._writeBuffer.write(e,r)}writeSync(e,r){this._logService.logLevel<=3&&!aN&&(this._logService.warn("writeSync is unreliable and will be removed soon."),aN=!0),this._writeBuffer.writeSync(e,r)}input(e,r=!0){this.coreService.triggerDataEvent(e,r)}resize(e,r){isNaN(e)||isNaN(r)||(e=Math.max(e,bV),r=Math.max(r,wV),this._bufferService.resize(e,r))}scroll(e,r=!1){this._bufferService.scroll(e,r)}scrollLines(e,r){this._bufferService.scrollLines(e,r)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let r=e-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}registerEscHandler(e,r){return this._inputHandler.registerEscHandler(e,r)}registerDcsHandler(e,r){return this._inputHandler.registerDcsHandler(e,r)}registerCsiHandler(e,r){return this._inputHandler.registerCsiHandler(e,r)}registerOscHandler(e,r){return this._inputHandler.registerOscHandler(e,r)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,r=this.optionsService.rawOptions.windowsPty;r&&r.buildNumber!==void 0&&r.buildNumber!==void 0?e=r.backend==="conpty"&&r.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(YF.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(YF(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ld(()=>{for(let r of e)r.dispose()})}}},R7e={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function F7e(t,e,r,c){let S={type:0,cancel:!1,key:void 0},H=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?S.key=Uo.ESC+"OA":S.key=Uo.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?S.key=Uo.ESC+"OD":S.key=Uo.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?S.key=Uo.ESC+"OC":S.key=Uo.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?S.key=Uo.ESC+"OB":S.key=Uo.ESC+"[B");break;case 8:S.key=t.ctrlKey?"\b":Uo.DEL,t.altKey&&(S.key=Uo.ESC+S.key);break;case 9:if(t.shiftKey){S.key=Uo.ESC+"[Z";break}S.key=Uo.HT,S.cancel=!0;break;case 13:S.key=t.altKey?Uo.ESC+Uo.CR:Uo.CR,S.cancel=!0;break;case 27:S.key=Uo.ESC,t.altKey&&(S.key=Uo.ESC+Uo.ESC),S.cancel=!0;break;case 37:if(t.metaKey)break;H?S.key=Uo.ESC+"[1;"+(H+1)+"D":e?S.key=Uo.ESC+"OD":S.key=Uo.ESC+"[D";break;case 39:if(t.metaKey)break;H?S.key=Uo.ESC+"[1;"+(H+1)+"C":e?S.key=Uo.ESC+"OC":S.key=Uo.ESC+"[C";break;case 38:if(t.metaKey)break;H?S.key=Uo.ESC+"[1;"+(H+1)+"A":e?S.key=Uo.ESC+"OA":S.key=Uo.ESC+"[A";break;case 40:if(t.metaKey)break;H?S.key=Uo.ESC+"[1;"+(H+1)+"B":e?S.key=Uo.ESC+"OB":S.key=Uo.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(S.key=Uo.ESC+"[2~");break;case 46:H?S.key=Uo.ESC+"[3;"+(H+1)+"~":S.key=Uo.ESC+"[3~";break;case 36:H?S.key=Uo.ESC+"[1;"+(H+1)+"H":e?S.key=Uo.ESC+"OH":S.key=Uo.ESC+"[H";break;case 35:H?S.key=Uo.ESC+"[1;"+(H+1)+"F":e?S.key=Uo.ESC+"OF":S.key=Uo.ESC+"[F";break;case 33:t.shiftKey?S.type=2:t.ctrlKey?S.key=Uo.ESC+"[5;"+(H+1)+"~":S.key=Uo.ESC+"[5~";break;case 34:t.shiftKey?S.type=3:t.ctrlKey?S.key=Uo.ESC+"[6;"+(H+1)+"~":S.key=Uo.ESC+"[6~";break;case 112:H?S.key=Uo.ESC+"[1;"+(H+1)+"P":S.key=Uo.ESC+"OP";break;case 113:H?S.key=Uo.ESC+"[1;"+(H+1)+"Q":S.key=Uo.ESC+"OQ";break;case 114:H?S.key=Uo.ESC+"[1;"+(H+1)+"R":S.key=Uo.ESC+"OR";break;case 115:H?S.key=Uo.ESC+"[1;"+(H+1)+"S":S.key=Uo.ESC+"OS";break;case 116:H?S.key=Uo.ESC+"[15;"+(H+1)+"~":S.key=Uo.ESC+"[15~";break;case 117:H?S.key=Uo.ESC+"[17;"+(H+1)+"~":S.key=Uo.ESC+"[17~";break;case 118:H?S.key=Uo.ESC+"[18;"+(H+1)+"~":S.key=Uo.ESC+"[18~";break;case 119:H?S.key=Uo.ESC+"[19;"+(H+1)+"~":S.key=Uo.ESC+"[19~";break;case 120:H?S.key=Uo.ESC+"[20;"+(H+1)+"~":S.key=Uo.ESC+"[20~";break;case 121:H?S.key=Uo.ESC+"[21;"+(H+1)+"~":S.key=Uo.ESC+"[21~";break;case 122:H?S.key=Uo.ESC+"[23;"+(H+1)+"~":S.key=Uo.ESC+"[23~";break;case 123:H?S.key=Uo.ESC+"[24;"+(H+1)+"~":S.key=Uo.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?S.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?S.key=Uo.NUL:t.keyCode>=51&&t.keyCode<=55?S.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?S.key=Uo.DEL:t.keyCode===219?S.key=Uo.ESC:t.keyCode===220?S.key=Uo.FS:t.keyCode===221&&(S.key=Uo.GS);else if((!r||c)&&t.altKey&&!t.metaKey){let Z=R7e[t.keyCode]?.[t.shiftKey?1:0];if(Z)S.key=Uo.ESC+Z;else if(t.keyCode>=65&&t.keyCode<=90){let ue=t.ctrlKey?t.keyCode-64:t.keyCode+32,be=String.fromCharCode(ue);t.shiftKey&&(be=be.toUpperCase()),S.key=Uo.ESC+be}else if(t.keyCode===32)S.key=Uo.ESC+(t.ctrlKey?Uo.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let ue=t.code.slice(3,4);t.shiftKey||(ue=ue.toLowerCase()),S.key=Uo.ESC+ue,S.cancel=!0}}else r&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(S.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?S.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(S.key=Uo.US),t.key==="@"&&(S.key=Uo.NUL));break}return S}var ap=0,N7e=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new tS,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new tS,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((H,Z)=>this._getKey(H)-this._getKey(Z)),r=0,c=0,S=new Array(this._array.length+this._insertedValues.length);for(let H=0;H=this._array.length||this._getKey(e[r])<=this._getKey(this._array[c])?(S[H]=e[r],r++):S[H]=this._array[c++];this._array=S,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let r=this._getKey(e);if(r===void 0||(ap=this._search(r),ap===-1)||this._getKey(this._array[ap])!==r)return!1;do if(this._array[ap]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ap),!0;while(++apH-Z),r=0,c=new Array(this._array.length-e.length),S=0;for(let H=0;H0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ap=this._search(e),!(ap<0||ap>=this._array.length)&&this._getKey(this._array[ap])===e))do yield this._array[ap];while(++ap=this._array.length)&&this._getKey(this._array[ap])===e))do r(this._array[ap]);while(++ap=r;){let S=r+c>>1,H=this._getKey(this._array[S]);if(H>e)c=S-1;else if(H0&&this._getKey(this._array[S-1])===e;)S--;return S}}return r}},nM=0,oN=0,j7e=class extends Sc{constructor(){super(),this._decorations=new N7e(t=>t?.marker.line),this._onDecorationRegistered=this._register(new Ms),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Ms),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ld(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new U7e(t);if(e){let r=e.marker.onDispose(()=>e.dispose()),c=e.onDispose(()=>{c.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),r.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,r){let c=0,S=0;for(let H of this._decorations.getKeyIterator(e))c=H.options.x??0,S=c+(H.options.width??1),t>=c&&t{nM=S.options.x??0,oN=nM+(S.options.width??1),t>=nM&&t=this._debounceThresholdMS)this._lastRefreshMs=S,this._innerRefresh();else if(!this._additionalRefreshRequested){let H=S-this._lastRefreshMs,Z=this._debounceThresholdMS-H;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},Z)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,r)}},sN=20,rS=class extends Sc{constructor(t,e,r,c){super(),this._terminal=t,this._coreBrowserService=r,this._renderService=c,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let S=this._coreBrowserService.mainDocument;this._accessibilityContainer=S.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=S.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let H=0;Hthis._handleBoundaryFocus(H,0),this._bottomBoundaryFocusListener=H=>this._handleBoundaryFocus(H,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=S.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new H7e(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(H=>this._handleResize(H.rows))),this._register(this._terminal.onRender(H=>this._refreshRows(H.start,H.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(H=>this._handleChar(H))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this._register(this._terminal.onA11yTab(H=>this._handleTab(H))),this._register(this._terminal.onKey(H=>this._handleKey(H.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(ju(S,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ld(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===sN+1&&(this._liveRegion.textContent+=l9.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let r=this._terminal.buffer,c=r.lines.length.toString();for(let S=t;S<=e;S++){let H=r.lines.get(r.ydisp+S),Z=[],ue=H?.translateToString(!0,void 0,void 0,Z)||"",be=(r.ydisp+S+1).toString(),Se=this._rowElements[S];Se&&(ue.length===0?(Se.textContent=" ",this._rowColumns.set(Se,[0,1])):(Se.textContent=ue,this._rowColumns.set(Se,Z)),Se.setAttribute("aria-posinset",be),Se.setAttribute("aria-setsize",c),this._alignRowWidth(Se))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let r=t.target,c=this._rowElements[e===0?1:this._rowElements.length-2],S=r.getAttribute("aria-posinset"),H=e===0?"1":`${this._terminal.buffer.lines.length}`;if(S===H||t.relatedTarget!==c)return;let Z,ue;if(e===0?(Z=r,ue=this._rowElements.pop(),this._rowContainer.removeChild(ue)):(Z=this._rowElements.shift(),ue=r,this._rowContainer.removeChild(Z)),Z.removeEventListener("focus",this._topBoundaryFocusListener),ue.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let be=this._createAccessibilityTreeNode();this._rowElements.unshift(be),this._rowContainer.insertAdjacentElement("afterbegin",be)}else{let be=this._createAccessibilityTreeNode();this._rowElements.push(be),this._rowContainer.appendChild(be)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},r={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===r.node&&e.offset>r.offset)&&([e,r]=[r,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let c=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(c)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:c,offset:c.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let S=({node:ue,offset:be})=>{let Se=ue instanceof Text?ue.parentNode:ue,Re=parseInt(Se?.getAttribute("aria-posinset"),10)-1;if(isNaN(Re))return console.warn("row is invalid. Race condition?"),null;let Xe=this._rowColumns.get(Se);if(!Xe)return console.warn("columns is null. Race condition?"),null;let vt=be=this._terminal.cols&&(++Re,vt=0),{row:Re,column:vt}},H=S(e),Z=S(r);if(!(!H||!Z)){if(H.row>Z.row||H.row===Z.row&&H.column>=Z.column)throw new Error("invalid range");this._terminal.select(H.column,H.row,(Z.row-H.row)*this._terminal.cols-H.column+Z.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;et;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t{Ux(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ju(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ju(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ju(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ju(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let r=t.composedPath();for(let c=0;c{c?.forEach(S=>{S.link.dispose&&S.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let r=!1;for(let[c,S]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(c)&&(r=this._checkLinkProviderResult(c,t,r)):S.provideLinks(t.y,H=>{if(this._isMouseOut)return;let Z=H?.map(ue=>({link:ue}));this._activeProviderReplies?.set(c,Z),r=this._checkLinkProviderResult(c,t,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let r=new Set;for(let c=0;ct?this._bufferService.cols:Z.link.range.end.x;for(let Se=ue;Se<=be;Se++){if(r.has(Se)){S.splice(H--,1);break}r.add(Se)}}}}_checkLinkProviderResult(t,e,r){if(!this._activeProviderReplies)return r;let c=this._activeProviderReplies.get(t),S=!1;for(let H=0;Hthis._linkAtPosition(Z.link,e));H&&(r=!0,this._handleNewLink(H))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let H=0;Hthis._linkAtPosition(ue.link,e));if(Z){r=!0,this._handleNewLink(Z);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&V7e(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ux(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let c=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(c,S),this._lastMouseEvent)){let H=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);H&&this._askForLink(H,!1)}})))}_linkHover(t,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(t,e){let r=t.range,c=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-c-1,r.end.x,r.end.y-c-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(t,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(t,e){let r=t.range.start.y*this._bufferService.cols+t.range.start.x,c=t.range.end.y*this._bufferService.cols+t.range.end.x,S=e.y*this._bufferService.cols+e.x;return r<=S&&S<=c}_positionFromMouseEvent(t,e,r){let c=r.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,r,c,S){return{x1:t,y1:e,x2:r,y2:c,cols:this._bufferService.cols,fg:S}}};H9=Vd([cl(1,tL),cl(2,W1),cl(3,sm),cl(4,WH)],H9);function V7e(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var W7e=class extends B7e{constructor(e={}){super(e),this._linkifier=this._register(new H2),this.browser=cV,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new H2),this._onCursorMove=this._register(new Ms),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Ms),this.onKey=this._onKey.event,this._onRender=this._register(new Ms),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Ms),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Ms),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Ms),this.onBell=this._onBell.event,this._onFocus=this._register(new Ms),this._onBlur=this._register(new Ms),this._onA11yCharEmitter=this._register(new Ms),this._onA11yTabEmitter=this._register(new Ms),this._onWillOpen=this._register(new Ms),this._setup(),this._decorationService=this._instantiationService.createInstance(j7e),this._instantiationService.setService(c4,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(zAe),this._instantiationService.setService(WH,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(c9)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(r=>this.refresh(r?.start??0,r?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(r=>this._reportWindowsOptions(r))),this._register(this._inputHandler.onColor(r=>this._handleColorEvent(r))),this._register(_0.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(_0.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(_0.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(_0.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(r=>this._afterResize(r.cols,r.rows))),this._register(ld(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let r of e){let c,S="";switch(r.index){case 256:c="foreground",S="10";break;case 257:c="background",S="11";break;case 258:c="cursor",S="12";break;default:c="ansi",S="4;"+r.index}switch(r.type){case 0:let H=Gf.toColorRGB(c==="ansi"?this._themeService.colors.ansi[r.index]:this._themeService.colors[c]);this.coreService.triggerDataEvent(`${Uo.ESC}]${S};${L7e(H)}${lV.ST}`);break;case 1:if(c==="ansi")this._themeService.modifyColors(Z=>Z.ansi[r.index]=xp.toColor(...r.color));else{let Z=c;this._themeService.modifyColors(ue=>ue[Z]=xp.toColor(...r.color))}break;case 2:this._themeService.restoreColor(r.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(rS,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Uo.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Uo.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,r=this.buffer.lines.get(e);if(!r)return;let c=Math.min(this.buffer.x,this.cols-1),S=this._renderService.dimensions.css.cell.height,H=r.getWidth(c),Z=this._renderService.dimensions.css.cell.width*H,ue=this.buffer.y*this._renderService.dimensions.css.cell.height,be=c*this._renderService.dimensions.css.cell.width;this.textarea.style.left=be+"px",this.textarea.style.top=ue+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=S+"px",this.textarea.style.lineHeight=S+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ju(this.element,"copy",r=>{this.hasSelection()&&K8e(r,this._selectionService)}));let e=r=>Y8e(r,this.textarea,this.coreService,this.optionsService);this._register(ju(this.textarea,"paste",e)),this._register(ju(this.element,"paste",e)),hV?this._register(ju(this.element,"mousedown",r=>{r.button===2&&vF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ju(this.element,"contextmenu",r=>{vF(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),uL&&this._register(ju(this.element,"auxclick",r=>{r.button===1&&BH(r,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ju(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ju(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ju(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ju(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ju(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ju(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ju(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let r=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(ju(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement);let c=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",s9.get()),pV||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>c.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(IAe,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(V1,this._coreBrowserService),this._register(ju(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this._register(ju(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(P9,this._document,this._helperContainer),this._instantiationService.setService($S,this._charSizeService),this._themeService=this._instantiationService.createInstance(O9),this._instantiationService.setService(Z2,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(QT),this._instantiationService.setService(VH,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(D9,this.rows,this.screenElement)),this._instantiationService.setService(W1,this._renderService),this._register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(M9,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(I9),this._instantiationService.setService(tL,this._mouseService);let S=this._linkifier.value=this._register(this._instantiationService.createInstance(H9,this.screenElement));this.element.appendChild(r);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(C9,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(H=>{super.scrollLines(H,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(z9,this.element,this.screenElement,S)),this._instantiationService.setService(nCe,this._selectionService),this._register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this._register(_0.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(A9,this.screenElement)),this._register(ju(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(rS,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(JT,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(JT,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(L9,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,r=this.element;function c(Z){let ue=e._mouseService.getMouseReportCoords(Z,e.screenElement);if(!ue)return!1;let be,Se;switch(Z.overrideType||Z.type){case"mousemove":Se=32,Z.buttons===void 0?(be=3,Z.button!==void 0&&(be=Z.button<3?Z.button:3)):be=Z.buttons&1?0:Z.buttons&4?1:Z.buttons&2?2:3;break;case"mouseup":Se=0,be=Z.button<3?Z.button:3;break;case"mousedown":Se=1,be=Z.button<3?Z.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(Z)===!1)return!1;let Re=Z.deltaY;if(Re===0||e.coreMouseService.consumeWheelEvent(Z,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;Se=Re<0?0:1,be=4;break;default:return!1}return Se===void 0||be===void 0||be>4?!1:e.coreMouseService.triggerMouseEvent({col:ue.col,row:ue.row,x:ue.x,y:ue.y,button:be,action:Se,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}let S={mouseup:null,wheel:null,mousedrag:null,mousemove:null},H={mouseup:Z=>(c(Z),Z.buttons||(this._document.removeEventListener("mouseup",S.mouseup),S.mousedrag&&this._document.removeEventListener("mousemove",S.mousedrag)),this.cancel(Z)),wheel:Z=>(c(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&c(Z)},mousemove:Z=>{Z.buttons||c(Z)}};this._register(this.coreMouseService.onProtocolChange(Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),Z&8?S.mousemove||(r.addEventListener("mousemove",H.mousemove),S.mousemove=H.mousemove):(r.removeEventListener("mousemove",S.mousemove),S.mousemove=null),Z&16?S.wheel||(r.addEventListener("wheel",H.wheel,{passive:!1}),S.wheel=H.wheel):(r.removeEventListener("wheel",S.wheel),S.wheel=null),Z&2?S.mouseup||(S.mouseup=H.mouseup):(this._document.removeEventListener("mouseup",S.mouseup),S.mouseup=null),Z&4?S.mousedrag||(S.mousedrag=H.mousedrag):(this._document.removeEventListener("mousemove",S.mousedrag),S.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ju(r,"mousedown",Z=>{if(Z.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(Z)))return c(Z),S.mouseup&&this._document.addEventListener("mouseup",S.mouseup),S.mousedrag&&this._document.addEventListener("mousemove",S.mousedrag),this.cancel(Z)})),this._register(ju(r,"wheel",Z=>{if(!S.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){if(Z.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(Z,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(Z,!0);let ue=Uo.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(ue,!0),this.cancel(Z,!0)}}},{passive:!1}))}refresh(e,r){this._renderService?.refreshRows(e,r)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,r){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,r),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let r=e-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}paste(e){OH(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let r=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),r}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,r,c){this._selectionService.setSelection(e,r,c)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,r){this._selectionService?.selectLines(e,r)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let r=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!r&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!r&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let c=F7e(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),c.type===3||c.type===2){let S=this.rows-1;return this.scrollLines(c.type===2?-S:S),this.cancel(e,!0)}if(c.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(c.cancel&&this.cancel(e,!0),!c.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((c.key===Uo.ETX||c.key===Uo.CR)&&(this.textarea.value=""),this._onKey.fire({key:c.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(c.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,r){let c=e.isMac&&!this.options.macOptionIsMeta&&r.altKey&&!r.ctrlKey&&!r.metaKey||e.isWindows&&r.altKey&&r.ctrlKey&&!r.metaKey||e.isWindows&&r.getModifierState("AltGraph");return r.type==="keypress"?c:c&&(!r.keyCode||r.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(q7e(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let r;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)r=e.charCode;else if(e.which===null||e.which===void 0)r=e.keyCode;else if(e.which!==0&&e.charCode!==0)r=e.which;else return!1;return!r||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(r=String.fromCharCode(r),this._onKey.fire({key:r,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let r=e.data;return this.coreService.triggerDataEvent(r,!0),this.cancel(e),!0}return!1}resize(e,r){if(e===this.cols&&r===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,r)}_afterResize(e,r){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,r){let c={instance:r,dispose:r.dispose,isDisposed:!1};this._addons.push(c),r.dispose=()=>this._wrappedAddonDispose(c),r.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let r=-1;for(let c=0;c=this._line.length))return r?(this._line.loadCell(e,r),r):this._line.loadCell(e,new xg)}translateToString(e,r,c){return this._line.translateToString(e,r,c)}},lN=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new Z7e(e)}getNullCell(){return new xg}},K7e=class extends Sc{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new Ms),this.onBufferChange=this._onBufferChange.event,this._normal=new lN(this._core.buffers.normal,"normal"),this._alternate=new lN(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},Y7e=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,r=>e(r.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(r,c)=>e(r,c.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},X7e=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},J7e=["cols","rows"],gv=0,Q7e=class extends Sc{constructor(t){super(),this._core=this._register(new W7e(t)),this._addonManager=this._register(new G7e),this._publicOptions={...this._core.options};let e=c=>this._core.options[c],r=(c,S)=>{this._checkReadonlyOptions(c),this._core.options[c]=S};for(let c in this._core.options){let S={get:e.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this._publicOptions,c,S)}}_checkReadonlyOptions(t){if(J7e.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Y7e(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new X7e(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new K7e(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,r){this._verifyIntegers(t,e,r),this._core.select(t,e,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r -`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return s9.get()},set promptLabel(t){s9.set(t)},get tooMuchOutput(){return l9.get()},set tooMuchOutput(t){l9.set(t)}}}_verifyIntegers(...t){for(gv of t)if(gv===1/0||isNaN(gv)||gv%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(gv of t)if(gv&&(gv===1/0||isNaN(gv)||gv%1!==0||gv<0))throw new Error("This API only accepts positive integers")}};/** +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),hL&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let r=this._getMouseBufferCoords(e),c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!c||!S||!r?!1:this._areCoordsInSelection(r,c,S)}isCellInSelection(e,r){let c=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!c||!S?!1:this._areCoordsInSelection([e,r],c,S)}_areCoordsInSelection(e,r,c){return e[1]>r[1]&&e[1]=r[0]&&e[0]=r[0]}_selectWordAtCursor(e,r){let c=this._linkifier.currentLink?.link?.range;if(c)return this._model.selectionStart=[c.start.x-1,c.start.y-1],this._model.selectionStartLength=jF(c,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let S=this._getMouseBufferCoords(e);return S?(this._selectWordAt(S,r),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,r){this._model.clearSelection(),e=Math.max(e,0),r=Math.min(r,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,r],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let r=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(r)return r[0]--,r[1]--,r[1]+=this._bufferService.buffer.ydisp,r}_getMouseEventScrollAmount(e){let r=cL(this._coreBrowserService.window,e,this._screenElement)[1],c=this._renderService.dimensions.css.canvas.height;return r>=0&&r<=c?0:(r>c&&(r-=c),r=Math.min(Math.max(r,-eM),eM),r/=eM,r/Math.abs(r)+Math.round(r*(A7e-1)))}shouldForceSelection(e){return r8?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),M7e)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let r=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);r&&r.length!==this._model.selectionStart[0]&&r.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let r=this._getMouseBufferCoords(e);r&&(this._activeSelectionMode=2,this._selectLineAt(r[1]))}shouldColumnSelect(e){return e.altKey&&!(r8&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let r=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let c=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let r=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&rthis._handleTrim(r))}_convertViewportColToCharacterIndex(e,r){let c=r;for(let S=0;r>=S;S++){let $=e.loadCell(S,this._workCell).getChars().length;this._workCell.getWidth()===0?c--:$>1&&r!==S&&(c+=$-1)}return c}setSelection(e,r,c){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,r],this._model.selectionStartLength=c,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,r,c=!0,S=!0){if(e[0]>=this._bufferService.cols)return;let $=this._bufferService.buffer,Z=$.lines.get(e[1]);if(!Z)return;let ue=$.translateBufferLineToString(e[1],!1),xe=this._convertViewportColToCharacterIndex(Z,e[0]),Se=xe,Ne=e[0]-xe,it=0,pt=0,bt=0,wt=0;if(ue.charAt(xe)===" "){for(;xe>0&&ue.charAt(xe-1)===" ";)xe--;for(;Se1&&(wt+=ni-1,Se+=ni-1);Mr>0&&xe>0&&!this._isCharWordSeparator(Z.loadCell(Mr-1,this._workCell));){Z.loadCell(Mr-1,this._workCell);let or=this._workCell.getChars().length;this._workCell.getWidth()===0?(it++,Mr--):or>1&&(bt+=or-1,xe-=or-1),xe--,Mr--}for(;ze1&&(wt+=or-1,Se+=or-1),Se++,ze++}}Se++;let Dt=xe+Ne-it+bt,Zt=Math.min(this._bufferService.cols,Se-xe+it+pt-bt-wt);if(!(!r&&ue.slice(xe,Se).trim()==="")){if(c&&Dt===0&&Z.getCodePoint(0)!==32){let Mr=$.lines.get(e[1]-1);if(Mr&&Z.isWrapped&&Mr.getCodePoint(this._bufferService.cols-1)!==32){let ze=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(ze){let ni=this._bufferService.cols-ze.start;Dt-=ni,Zt+=ni}}}if(S&&Dt+Zt===this._bufferService.cols&&Z.getCodePoint(this._bufferService.cols-1)!==32){let Mr=$.lines.get(e[1]+1);if(Mr?.isWrapped&&Mr.getCodePoint(0)!==32){let ze=this._getWordAt([0,e[1]+1],!1,!1,!0);ze&&(Zt+=ze.length)}}return{start:Dt,length:Zt}}}_selectWordAt(e,r){let c=this._getWordAt(e,r);if(c){for(;c.start<0;)c.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[c.start,e[1]],this._model.selectionStartLength=c.length}}_selectToWordAt(e){let r=this._getWordAt(e,!0);if(r){let c=e[1];for(;r.start<0;)r.start+=this._bufferService.cols,c--;if(!this._model.areSelectionValuesReversed())for(;r.start+r.length>this._bufferService.cols;)r.length-=this._bufferService.cols,c++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?r.start:r.start+r.length,c]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let r=this._bufferService.buffer.getWrappedRangeForLine(e),c={start:{x:0,y:r.first},end:{x:this._bufferService.cols-1,y:r.last}};this._model.selectionStart=[0,r.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=jF(c,this._bufferService.cols)}};B9=Wd([cl(3,sm),cl(4,Zx),cl(5,iL),cl(6,lm),cl(7,G1),cl(8,q1)],B9);var UF=class{constructor(){this._data={}}set(e,r,c){this._data[e]||(this._data[e]={}),this._data[e][r]=c}get(e,r){return this._data[e]?this._data[e][r]:void 0}clear(){this._data={}}},$F=class{constructor(){this._color=new UF,this._css=new UF}setCss(e,r,c){this._css.set(e,r,c)}getCss(e,r){return this._css.get(e,r)}setColor(e,r,c){this._color.set(e,r,c)}getColor(e,r){return this._color.get(e,r)}clear(){this._color.clear(),this._css.clear()}},Lp=Object.freeze((()=>{let t=[Td.toColor("#2e3436"),Td.toColor("#cc0000"),Td.toColor("#4e9a06"),Td.toColor("#c4a000"),Td.toColor("#3465a4"),Td.toColor("#75507b"),Td.toColor("#06989a"),Td.toColor("#d3d7cf"),Td.toColor("#555753"),Td.toColor("#ef2929"),Td.toColor("#8ae234"),Td.toColor("#fce94f"),Td.toColor("#729fcf"),Td.toColor("#ad7fa8"),Td.toColor("#34e2e2"),Td.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let r=0;r<216;r++){let c=e[r/36%6|0],S=e[r/6%6|0],$=e[r%6];t.push({css:bp.toCss(c,S,$),rgba:bp.toRgba(c,S,$)})}for(let r=0;r<24;r++){let c=8+r*10;t.push({css:bp.toCss(c,c,c),rgba:bp.toRgba(c,c,c)})}return t})()),xx=Td.toColor("#ffffff"),s5=Td.toColor("#000000"),HF=Td.toColor("#ffffff"),VF=s5,q3={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},I7e=xx,R9=class extends Sc{constructor(e){super(),this._optionsService=e,this._contrastCache=new $F,this._halfContrastCache=new $F,this._onChangeColors=this._register(new Es),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:xx,background:s5,cursor:HF,cursorAccent:VF,selectionForeground:void 0,selectionBackgroundTransparent:q3,selectionBackgroundOpaque:Zf.blend(s5,q3),selectionInactiveBackgroundTransparent:q3,selectionInactiveBackgroundOpaque:Zf.blend(s5,q3),scrollbarSliderBackground:Zf.opacity(xx,.2),scrollbarSliderHoverBackground:Zf.opacity(xx,.4),scrollbarSliderActiveBackground:Zf.opacity(xx,.5),overviewRulerBorder:xx,ansi:Lp.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let r=this._colors;if(r.foreground=yf(e.foreground,xx),r.background=yf(e.background,s5),r.cursor=Zf.blend(r.background,yf(e.cursor,HF)),r.cursorAccent=Zf.blend(r.background,yf(e.cursorAccent,VF)),r.selectionBackgroundTransparent=yf(e.selectionBackground,q3),r.selectionBackgroundOpaque=Zf.blend(r.background,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundTransparent=yf(e.selectionInactiveBackground,r.selectionBackgroundTransparent),r.selectionInactiveBackgroundOpaque=Zf.blend(r.background,r.selectionInactiveBackgroundTransparent),r.selectionForeground=e.selectionForeground?yf(e.selectionForeground,RF):void 0,r.selectionForeground===RF&&(r.selectionForeground=void 0),Zf.isOpaque(r.selectionBackgroundTransparent)&&(r.selectionBackgroundTransparent=Zf.opacity(r.selectionBackgroundTransparent,.3)),Zf.isOpaque(r.selectionInactiveBackgroundTransparent)&&(r.selectionInactiveBackgroundTransparent=Zf.opacity(r.selectionInactiveBackgroundTransparent,.3)),r.scrollbarSliderBackground=yf(e.scrollbarSliderBackground,Zf.opacity(r.foreground,.2)),r.scrollbarSliderHoverBackground=yf(e.scrollbarSliderHoverBackground,Zf.opacity(r.foreground,.4)),r.scrollbarSliderActiveBackground=yf(e.scrollbarSliderActiveBackground,Zf.opacity(r.foreground,.5)),r.overviewRulerBorder=yf(e.overviewRulerBorder,I7e),r.ansi=Lp.slice(),r.ansi[0]=yf(e.black,Lp[0]),r.ansi[1]=yf(e.red,Lp[1]),r.ansi[2]=yf(e.green,Lp[2]),r.ansi[3]=yf(e.yellow,Lp[3]),r.ansi[4]=yf(e.blue,Lp[4]),r.ansi[5]=yf(e.magenta,Lp[5]),r.ansi[6]=yf(e.cyan,Lp[6]),r.ansi[7]=yf(e.white,Lp[7]),r.ansi[8]=yf(e.brightBlack,Lp[8]),r.ansi[9]=yf(e.brightRed,Lp[9]),r.ansi[10]=yf(e.brightGreen,Lp[10]),r.ansi[11]=yf(e.brightYellow,Lp[11]),r.ansi[12]=yf(e.brightBlue,Lp[12]),r.ansi[13]=yf(e.brightMagenta,Lp[13]),r.ansi[14]=yf(e.brightCyan,Lp[14]),r.ansi[15]=yf(e.brightWhite,Lp[15]),e.extendedAnsi){let c=Math.min(r.ansi.length-16,e.extendedAnsi.length);for(let S=0;S$.index-Z.index),c=[];for(let $ of r){let Z=this._services.get($.id);if(!Z)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${$.id._id}.`);c.push(Z)}let S=r.length>0?r[0].index:e.length;if(e.length!==S)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${S+1} conflicts with ${e.length} static arguments`);return new t(...e,...c)}},O7e={trace:0,debug:1,info:2,warn:3,error:4,off:5},B7e="xterm.js: ",F9=class extends Sc{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=O7e[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let r=0;rthis._length)for(let r=this._length;r=e;S--)this._array[this._getCyclicIndex(S+c.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;Sthis._maxLength){let S=this._length+c.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=c.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,r,c){if(!(r<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let $=r-1;$>=0;$--)this.set(e+$+c,this.get(e+$));let S=e+r+c-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S>22,r&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):c]}set(e,r){this._data[e*Tc+1]=r[0],r[1].length>1?(this._combined[e]=r[1],this._data[e*Tc+0]=e|2097152|r[2]<<22):this._data[e*Tc+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(e){return this._data[e*Tc+0]>>22}hasWidth(e){return this._data[e*Tc+0]&12582912}getFg(e){return this._data[e*Tc+1]}getBg(e){return this._data[e*Tc+2]}hasContent(e){return this._data[e*Tc+0]&4194303}getCodePoint(e){let r=this._data[e*Tc+0];return r&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):r&2097151}isCombined(e){return this._data[e*Tc+0]&2097152}getString(e){let r=this._data[e*Tc+0];return r&2097152?this._combined[e]:r&2097151?i_(r&2097151):""}isProtected(e){return this._data[e*Tc+2]&536870912}loadCell(e,r){return rT=e*Tc,r.content=this._data[rT+0],r.fg=this._data[rT+1],r.bg=this._data[rT+2],r.content&2097152&&(r.combinedData=this._combined[e]),r.bg&268435456&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){r.content&2097152&&(this._combined[e]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*Tc+0]=r.content,this._data[e*Tc+1]=r.fg,this._data[e*Tc+2]=r.bg}setCellFromCodepoint(e,r,c,S){S.bg&268435456&&(this._extendedAttrs[e]=S.extended),this._data[e*Tc+0]=r|c<<22,this._data[e*Tc+1]=S.fg,this._data[e*Tc+2]=S.bg}addCodepointToCell(e,r,c){let S=this._data[e*Tc+0];S&2097152?this._combined[e]+=i_(r):S&2097151?(this._combined[e]=i_(S&2097151)+i_(r),S&=-2097152,S|=2097152):S=r|1<<22,c&&(S&=-12582913,S|=c<<22),this._data[e*Tc+0]=S}insertCells(e,r,c){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,c),r=0;--$)this.setCell(e+r+$,this.loadCell(e+$,S));for(let $=0;$this.length){if(this._data.buffer.byteLength>=c*4)this._data=new Uint32Array(this._data.buffer,0,c);else{let S=new Uint32Array(c);S.set(this._data),this._data=S}for(let S=this.length;S=e&&delete this._combined[ue]}let $=Object.keys(this._extendedAttrs);for(let Z=0;Z<$.length;Z++){let ue=parseInt($[Z],10);ue>=e&&delete this._extendedAttrs[ue]}}return this.length=e,c*4*tM=0;--e)if(this._data[e*Tc+0]&4194303)return e+(this._data[e*Tc+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Tc+0]&4194303||this._data[e*Tc+2]&50331648)return e+(this._data[e*Tc+0]>>22);return 0}copyCellsFrom(e,r,c,S,$){let Z=e._data;if($)for(let xe=S-1;xe>=0;xe--){for(let Se=0;Se=r&&(this._combined[Se-r+c]=e._combined[Se])}}translateToString(e,r,c,S){r=r??0,c=c??this.length,e&&(c=Math.min(c,this.getTrimmedLength())),S&&(S.length=0);let $="";for(;r>22||1}return S&&S.push(r),$}};function R7e(t,e,r,c,S,$){let Z=[];for(let ue=0;ue=ue&&c0&&(Zt>it||Ne[Zt].getTrimmedLength()===0);Zt--)Dt++;Dt>0&&(Z.push(ue+Ne.length-Dt),Z.push(Dt)),ue+=Ne.length-1}return Z}function F7e(t,e){let r=[],c=0,S=e[c],$=0;for(let Z=0;ZK5(t,Se,e)).reduce((xe,Se)=>xe+Se),$=0,Z=0,ue=0;for(;uexe&&($-=xe,Z++);let Se=t[Z].getWidth($-1)===2;Se&&$--;let Ne=Se?r-1:r;c.push(Ne),ue+=Ne}return c}function K5(t,e,r){if(e===t.length-1)return t[e].getTrimmedLength();let c=!t[e].hasContent(r-1)&&t[e].getWidth(r-1)===1,S=t[e+1].getWidth(0)===2;return c&&S?r-1:r}var wV=class kV{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=kV._nextId++,this._onDispose=this.register(new Es),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),$x(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};wV._nextId=1;var U7e=wV,Bp={},bx=Bp.B;Bp[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Bp.A={"#":"£"};Bp.B=void 0;Bp[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Bp.C=Bp[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Bp.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Bp.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Bp.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Bp.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Bp.E=Bp[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Bp.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Bp.H=Bp[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Bp["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var qF=4294967295,GF=class{constructor(t,e,r){this._hasScrollback=t,this._optionsService=e,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_p.clone(),this.savedCharset=bx,this.markers=[],this._nullCell=bg.fromCharData([0,jH,1,0]),this._whitespaceCell=bg.fromCharData([0,c_,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new i8,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new WF(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new QT),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new QT),this._whitespaceCell}getBlankLine(t,e){return new l5(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&tqF?qF:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=_p);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new WF(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let r=this.getNullCell(_p),c=0,S=this._getCorrectBufferLength(e);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+$+1?(this.ybase--,$++,this.ydisp>0&&this.ydisp--):this.lines.push(new l5(t,r)));else for(let Z=this._rows;Z>e;Z--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S0&&(this.lines.trimStart(Z),this.ybase=Math.max(this.ybase-Z,0),this.ydisp=Math.max(this.ydisp-Z,0),this.savedY=Math.max(this.savedY-Z,0)),this.lines.maxLength=S}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),$&&(this.y+=$),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let $=0;$.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let r=this._optionsService.rawOptions.reflowCursorLine,c=R7e(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(_p),r);if(c.length>0){let S=F7e(this.lines,c);N7e(this.lines,S.layout),this._reflowLargerAdjustViewport(t,e,S.countRemoved)}}_reflowLargerAdjustViewport(t,e,r){let c=this.getNullCell(_p),S=r;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;Z--){let ue=this.lines.get(Z);if(!ue||!ue.isWrapped&&ue.getTrimmedLength()<=t)continue;let xe=[ue];for(;ue.isWrapped&&Z>0;)ue=this.lines.get(--Z),xe.unshift(ue);if(!r){let ni=this.ybase+this.y;if(ni>=Z&&ni0&&(S.push({start:Z+xe.length+$,newLines:bt}),$+=bt.length),xe.push(...bt);let wt=Ne.length-1,Dt=Ne[wt];Dt===0&&(wt--,Dt=Ne[wt]);let Zt=xe.length-it-1,Mr=Se;for(;Zt>=0;){let ni=Math.min(Mr,Dt);if(xe[wt]===void 0)break;if(xe[wt].copyCellsFrom(xe[Zt],Mr-ni,Dt-ni,ni,!0),Dt-=ni,Dt===0&&(wt--,Dt=Ne[wt]),Mr-=ni,Mr===0){Zt--;let or=Math.max(Zt,0);Mr=K5(xe,or,this._cols)}}for(let ni=0;ni0;)this.ybase===0?this.y0){let Z=[],ue=[];for(let Dt=0;Dt=0;Dt--)if(it&&it.start>Se+pt){for(let Zt=it.newLines.length-1;Zt>=0;Zt--)this.lines.set(Dt--,it.newLines[Zt]);Dt++,Z.push({index:Se+1,amount:it.newLines.length}),pt+=it.newLines.length,it=S[++Ne]}else this.lines.set(Dt,ue[Se--]);let bt=0;for(let Dt=Z.length-1;Dt>=0;Dt--)Z[Dt].index+=bt,this.lines.onInsertEmitter.fire(Z[Dt]),bt+=Z[Dt].amount;let wt=Math.max(0,xe+$-this.lines.maxLength);wt>0&&this.lines.onTrimEmitter.fire(wt)}}translateBufferLineToString(t,e,r=0,c){let S=this.lines.get(t);return S?S.translateToString(e,r,c):""}getWrappedRangeForLine(t){let e=t,r=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;r+10;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e{e.line-=r,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(r=>{e.line>=r.index&&(e.line+=r.amount)})),e.register(this.lines.onDelete(r=>{e.line>=r.index&&e.liner.index&&(e.line-=r.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},$7e=class extends Sc{constructor(e,r){super(),this._optionsService=e,this._bufferService=r,this._onBufferActivate=this._register(new Es),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new GF(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new GF(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,r){this._normal.resize(e,r),this._alt.resize(e,r),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},TV=2,SV=1,N9=class extends Sc{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new Es),this.onResize=this._onResize.event,this._onScroll=this._register(new Es),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,TV),this.rows=Math.max(t.rawOptions.rows||0,SV),this.buffers=this._register(new $7e(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let r=this.cols!==t,c=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:r,rowsChanged:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let r=this.buffer,c;c=this._cachedBlankLine,(!c||c.length!==this.cols||c.getFg(0)!==t.fg||c.getBg(0)!==t.bg)&&(c=r.getBlankLine(t,e),this._cachedBlankLine=c),c.isWrapped=e;let S=r.ybase+r.scrollTop,$=r.ybase+r.scrollBottom;if(r.scrollTop===0){let Z=r.lines.isFull;$===r.lines.length-1?Z?r.lines.recycle().copyFrom(c):r.lines.push(c.clone()):r.lines.splice($+1,0,c.clone()),Z?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let Z=$-S+1;r.lines.shiftElements(S+1,Z-1,-1),r.lines.set($,c.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(t,e){let r=this.buffer;if(t<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else t+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let c=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+t,r.ybase),0),c!==r.ydisp&&(e||this._onScroll.fire(r.ydisp))}};N9=Wd([cl(0,lm)],N9);var y2={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:r8,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},H7e=["normal","bold","100","200","300","400","500","600","700","800","900"],V7e=class extends Sc{constructor(e){super(),this._onOptionChange=this._register(new Es),this.onOptionChange=this._onOptionChange.event;let r={...y2};for(let c in e)if(c in r)try{let S=e[c];r[c]=this._sanitizeAndValidateOption(c,S)}catch(S){console.error(S)}this.rawOptions=r,this.options={...r},this._setupOptions(),this._register(cd(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,r){return this.onOptionChange(c=>{c===e&&r(this.rawOptions[e])})}onMultipleOptionChange(e,r){return this.onOptionChange(c=>{e.indexOf(c)!==-1&&r()})}_setupOptions(){let e=c=>{if(!(c in y2))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},r=(c,S)=>{if(!(c in y2))throw new Error(`No option with key "${c}"`);S=this._sanitizeAndValidateOption(c,S),this.rawOptions[c]!==S&&(this.rawOptions[c]=S,this._onOptionChange.fire(c))};for(let c in this.rawOptions){let S={get:e.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this.options,c,S)}}_sanitizeAndValidateOption(e,r){switch(e){case"cursorStyle":if(r||(r=y2[e]),!W7e(r))throw new Error(`"${r}" is not a valid value for ${e}`);break;case"wordSeparator":r||(r=y2[e]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=H7e.includes(r)?r:y2[e];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${e} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(r*10)/10));break;case"scrollback":if(r=Math.min(r,4294967295),r<0)throw new Error(`${e} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${e} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{};break}return r}};function W7e(t){return t==="block"||t==="underline"||t==="bar"}function u5(t,e=5){if(typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let c in t)r[c]=e<=1?t[c]:t[c]&&u5(t[c],e-1);return r}var ZF=Object.freeze({insertMode:!1}),KF=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),j9=class extends Sc{constructor(e,r,c){super(),this._bufferService=e,this._logService=r,this._optionsService=c,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Es),this.onData=this._onData.event,this._onUserInput=this._register(new Es),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Es),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Es),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=u5(ZF),this.decPrivateModes=u5(KF)}reset(){this.modes=u5(ZF),this.decPrivateModes=u5(KF)}triggerDataEvent(e,r=!1){if(this._optionsService.rawOptions.disableStdin)return;let c=this._bufferService.buffer;r&&this._optionsService.rawOptions.scrollOnUserInput&&c.ybase!==c.ydisp&&this._onRequestScrollToBottom.fire(),r&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(S=>S.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onBinary.fire(e))}};j9=Wd([cl(0,sm),cl(1,WH),cl(2,lm)],j9);var YF={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function rM(t,e){let r=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(r|=64,r|=t.action):(r|=t.button&3,t.button&4&&(r|=64),t.button&8&&(r|=128),t.action===32?r|=32:t.action===0&&!e&&(r|=3)),r}var iM=String.fromCharCode,XF={DEFAULT:t=>{let e=[rM(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${iM(e[0])}${iM(e[1])}${iM(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${rM(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${rM(t,!0)};${t.x};${t.y}${e}`}},U9=class extends Sc{constructor(t,e,r){super(),this._bufferService=t,this._coreService=e,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Es),this.onProtocolChange=this._onProtocolChange.event;for(let c of Object.keys(YF))this.addProtocol(c,YF[c]);for(let c of Object.keys(XF))this.addEncoding(c,XF[c]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,r){if(t.deltaY===0||t.shiftKey||e===void 0||r===void 0)return 0;let c=e/r,S=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(S/=c+0,Math.abs(t.deltaY)<50&&(S*=.3),this._wheelPartialScroll+=S,S=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(S*=this._bufferService.rows),S}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,r){if(r){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};U9=Wd([cl(0,sm),cl(1,Zx),cl(2,lm)],U9);var nM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],q7e=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Pp;function G7e(t,e){let r=0,c=e.length-1,S;if(te[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,r){let c=this.wcwidth(e),S=c===0&&r!==0;if(S){let $=Mx.extractWidth(r);$===0?S=!1:$>c&&(c=$)}return Mx.createPropertyValue(0,c,S)}},Mx=class ST{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Es,this.onChange=this._onChange.event;let e=new Z7e;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,r,c=!1){return(e&16777215)<<3|(r&3)<<1|(c?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let r=0,c=0,S=e.length;for(let $=0;$=S)return r+this.wcwidth(Z);let Se=e.charCodeAt($);56320<=Se&&Se<=57343?Z=(Z-55296)*1024+Se-56320+65536:r+=this.wcwidth(Se)}let ue=this.charProperties(Z,c),xe=ST.extractWidth(ue);ST.extractShouldJoin(ue)&&(xe-=ST.extractWidth(c)),r+=xe,c=ue}return r}charProperties(e,r){return this._activeProvider.charProperties(e,r)}},K7e=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,r){this._charsets[e]=r,this.glevel===e&&(this.charset=r)}};function JF(t){let e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),r=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);r&&e&&(r.isWrapped=e[3]!==0&&e[3]!==32)}var G3=2147483647,Y7e=256,CV=class $9{constructor(e=32,r=32){if(this.maxLength=e,this.maxSubParamsLength=r,r>Y7e)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let r=new $9;if(!e.length)return r;for(let c=Array.isArray(e[0])?1:0;c>8,S=this._subParamsIdx[r]&255;S-c>0&&e.push(Array.prototype.slice.call(this._subParams,c,S))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>G3?G3:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>G3?G3:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let r=this._subParamsIdx[e]>>8,c=this._subParamsIdx[e]&255;return c-r>0?this._subParams.subarray(r,c):null}getSubParamsAll(){let e={};for(let r=0;r>8,S=this._subParamsIdx[r]&255;S-c>0&&(e[r]=this._subParams.slice(c,S))}return e}addDigit(e){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let c=this._digitIsSub?this._subParams:this.params,S=c[r-1];c[r-1]=~S?Math.min(S*10+e,G3):e}},Z3=[],X7e=class{constructor(){this._state=0,this._active=Z3,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,r){this._handlers[e]===void 0&&(this._handlers[e]=[]);let c=this._handlers[e];return c.push(r),{dispose:()=>{let S=c.indexOf(r);S!==-1&&c.splice(S,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Z3}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Z3,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Z3,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,r,c){if(!this._active.length)this._handlerFb(this._id,"PUT",H8(e,r,c));else for(let S=this._active.length-1;S>=0;S--)this._active[S].put(e,r,c)}start(){this.reset(),this._state=1}put(e,r,c){if(this._state!==3){if(this._state===1)for(;r0&&this._put(e,r,c)}}end(e,r=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let c=!1,S=this._active.length-1,$=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,c=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&c===!1){for(;S>=0&&(c=this._active[S].end(e),c!==!0);S--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,c;S--}for(;S>=0;S--)if(c=this._active[S].end(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,c}this._active=Z3,this._id=-1,this._state=0}}},Vm=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,r,c){this._hitLimit||(this._data+=H8(e,r,c),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let r=!1;if(this._hitLimit)r=!1;else if(e&&(r=this._handler(this._data),r instanceof Promise))return r.then(c=>(this._data="",this._hitLimit=!1,c));return this._data="",this._hitLimit=!1,r}},K3=[],J7e=class{constructor(){this._handlers=Object.create(null),this._active=K3,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=K3}registerHandler(e,r){this._handlers[e]===void 0&&(this._handlers[e]=[]);let c=this._handlers[e];return c.push(r),{dispose:()=>{let S=c.indexOf(r);S!==-1&&c.splice(S,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=K3,this._ident=0}hook(e,r){if(this.reset(),this._ident=e,this._active=this._handlers[e]||K3,!this._active.length)this._handlerFb(this._ident,"HOOK",r);else for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(r)}put(e,r,c){if(!this._active.length)this._handlerFb(this._ident,"PUT",H8(e,r,c));else for(let S=this._active.length-1;S>=0;S--)this._active[S].put(e,r,c)}unhook(e,r=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let c=!1,S=this._active.length-1,$=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,c=r,$=this._stack.fallThrough,this._stack.paused=!1),!$&&c===!1){for(;S>=0&&(c=this._active[S].unhook(e),c!==!0);S--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,c;S--}for(;S>=0;S--)if(c=this._active[S].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,c}this._active=K3,this._ident=0}},c5=new CV;c5.addParam(0);var QF=class{constructor(t){this._handler=t,this._data="",this._params=c5,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():c5,this._data="",this._hitLimit=!1}put(t,e,r){this._hitLimit||(this._data+=H8(t,e,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(r=>(this._params=c5,this._data="",this._hitLimit=!1,r));return this._params=c5,this._data="",this._hitLimit=!1,e}},Q7e=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,r){this.table.fill(e<<4|r)}add(e,r,c,S){this.table[r<<8|e]=c<<4|S}addMany(e,r,c,S){for(let $=0;$xe),r=(ue,xe)=>e.slice(ue,xe),c=r(32,127),S=r(0,24);S.push(25),S.push.apply(S,r(28,32));let $=r(0,14),Z;t.setDefault(1,0),t.addMany(c,0,2,0);for(Z in $)t.addMany([24,26,153,154],Z,3,0),t.addMany(r(128,144),Z,3,0),t.addMany(r(144,152),Z,3,0),t.add(156,Z,0,0),t.add(27,Z,11,1),t.add(157,Z,4,8),t.addMany([152,158,159],Z,0,7),t.add(155,Z,11,3),t.add(144,Z,11,9);return t.addMany(S,0,3,0),t.addMany(S,1,3,1),t.add(127,1,0,1),t.addMany(S,8,0,8),t.addMany(S,3,3,3),t.add(127,3,0,3),t.addMany(S,4,3,4),t.add(127,4,0,4),t.addMany(S,6,3,6),t.addMany(S,5,3,5),t.add(127,5,0,5),t.addMany(S,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(c,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(r(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(c,7,0,7),t.addMany(S,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(r(64,127),3,7,0),t.addMany(r(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(r(48,60),4,8,4),t.addMany(r(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(r(32,64),6,0,6),t.add(127,6,0,6),t.addMany(r(64,127),6,0,0),t.addMany(r(32,48),3,9,5),t.addMany(r(32,48),5,9,5),t.addMany(r(48,64),5,0,6),t.addMany(r(64,127),5,7,0),t.addMany(r(32,48),4,9,5),t.addMany(r(32,48),1,9,2),t.addMany(r(32,48),2,9,2),t.addMany(r(48,127),2,10,0),t.addMany(r(48,80),1,10,0),t.addMany(r(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(r(96,127),1,10,0),t.add(80,1,11,9),t.addMany(S,9,0,9),t.add(127,9,0,9),t.addMany(r(28,32),9,0,9),t.addMany(r(32,48),9,9,12),t.addMany(r(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(S,11,0,11),t.addMany(r(32,128),11,0,11),t.addMany(r(28,32),11,0,11),t.addMany(S,10,0,10),t.add(127,10,0,10),t.addMany(r(28,32),10,0,10),t.addMany(r(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(r(32,48),10,9,12),t.addMany(S,12,0,12),t.add(127,12,0,12),t.addMany(r(28,32),12,0,12),t.addMany(r(32,48),12,9,12),t.addMany(r(48,64),12,0,11),t.addMany(r(64,127),12,12,13),t.addMany(r(64,127),10,12,13),t.addMany(r(64,127),9,12,13),t.addMany(S,13,13,13),t.addMany(c,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(mg,0,2,0),t.add(mg,8,5,8),t.add(mg,6,0,6),t.add(mg,11,0,11),t.add(mg,13,13,13),t}(),tMe=class extends Sc{constructor(e=eMe){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new CV,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(r,c,S)=>{},this._executeHandlerFb=r=>{},this._csiHandlerFb=(r,c)=>{},this._escHandlerFb=r=>{},this._errorHandlerFb=r=>r,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(cd(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new X7e),this._dcsParser=this._register(new J7e),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,r=[64,126]){let c=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=e.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let $=0;$Z||Z>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=Z}}if(e.final.length!==1)throw new Error("final must be a single byte");let S=e.final.charCodeAt(0);if(r[0]>S||S>r[1])throw new Error(`final must be in range ${r[0]} .. ${r[1]}`);return c<<=8,c|=S,c}identToString(e){let r=[];for(;e;)r.push(String.fromCharCode(e&255)),e>>=8;return r.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,r){let c=this._identifier(e,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);let S=this._escHandlers[c];return S.push(r),{dispose:()=>{let $=S.indexOf(r);$!==-1&&S.splice($,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,r){this._executeHandlers[e.charCodeAt(0)]=r}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,r){let c=this._identifier(e);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);let S=this._csiHandlers[c];return S.push(r),{dispose:()=>{let $=S.indexOf(r);$!==-1&&S.splice($,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,r){return this._dcsParser.registerHandler(this._identifier(e),r)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,r){return this._oscParser.registerHandler(e,r)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,r,c,S,$){this._parseStack.state=e,this._parseStack.handlers=r,this._parseStack.handlerPos=c,this._parseStack.transition=S,this._parseStack.chunkPos=$}parse(e,r,c){let S=0,$=0,Z=0,ue;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,Z=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let xe=this._parseStack.handlers,Se=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&Se>-1){for(;Se>=0&&(ue=xe[Se](this._params),ue!==!0);Se--)if(ue instanceof Promise)return this._parseStack.handlerPos=Se,ue}this._parseStack.handlers=[];break;case 4:if(c===!1&&Se>-1){for(;Se>=0&&(ue=xe[Se](),ue!==!0);Se--)if(ue instanceof Promise)return this._parseStack.handlerPos=Se,ue}this._parseStack.handlers=[];break;case 6:if(S=e[this._parseStack.chunkPos],ue=this._dcsParser.unhook(S!==24&&S!==26,c),ue)return ue;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=e[this._parseStack.chunkPos],ue=this._oscParser.end(S!==24&&S!==26,c),ue)return ue;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,Z=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let xe=Z;xe>4){case 2:for(let bt=xe+1;;++bt){if(bt>=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=r||(S=e[bt])<32||S>126&&S=0&&(ue=Se[Ne](this._params),ue!==!0);Ne--)if(ue instanceof Promise)return this._preserveStack(3,Se,Ne,$,xe),ue;Ne<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++xe47&&S<60);xe--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:let it=this._escHandlers[this._collect<<8|S],pt=it?it.length-1:-1;for(;pt>=0&&(ue=it[pt](),ue!==!0);pt--)if(ue instanceof Promise)return this._preserveStack(4,it,pt,$,xe),ue;pt<0&&this._escHandlerFb(this._collect<<8|S),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|S,this._params);break;case 13:for(let bt=xe+1;;++bt)if(bt>=r||(S=e[bt])===24||S===26||S===27||S>127&&S=r||(S=e[bt])<32||S>127&&S>4:$>>8}return c}}function aM(t,e){let r=t.toString(16),c=r.length<2?"0"+r:r;switch(e){case 4:return r[0];case 8:return c;case 12:return(c+c).slice(0,3);default:return c+c}}function nMe(t,e=16){let[r,c,S]=t;return`rgb:${aM(r,e)}/${aM(c,e)}/${aM(S,e)}`}var aMe={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$y=131072,tN=10;function rN(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var iN=5e3,nN=0,oMe=class extends Sc{constructor(t,e,r,c,S,$,Z,ue,xe=new tMe){super(),this._bufferService=t,this._charsetService=e,this._coreService=r,this._logService=c,this._optionsService=S,this._oscLinkService=$,this._coreMouseService=Z,this._unicodeService=ue,this._parser=xe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new SCe,this._utf8Decoder=new CCe,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_p.clone(),this._eraseAttrDataInternal=_p.clone(),this._onRequestBell=this._register(new Es),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Es),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Es),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Es),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Es),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Es),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Es),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Es),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Es),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Es),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Es),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Es),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Es),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new H9(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(Se=>this._activeBuffer=Se.activeBuffer)),this._parser.setCsiHandlerFallback((Se,Ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(Se),params:Ne.toArray()})}),this._parser.setEscHandlerFallback(Se=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(Se)})}),this._parser.setExecuteHandlerFallback(Se=>{this._logService.debug("Unknown EXECUTE code: ",{code:Se})}),this._parser.setOscHandlerFallback((Se,Ne,it)=>{this._logService.debug("Unknown OSC code: ",{identifier:Se,action:Ne,data:it})}),this._parser.setDcsHandlerFallback((Se,Ne,it)=>{Ne==="HOOK"&&(it=it.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(Se),action:Ne,payload:it})}),this._parser.setPrintHandler((Se,Ne,it)=>this.print(Se,Ne,it)),this._parser.registerCsiHandler({final:"@"},Se=>this.insertChars(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},Se=>this.scrollLeft(Se)),this._parser.registerCsiHandler({final:"A"},Se=>this.cursorUp(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},Se=>this.scrollRight(Se)),this._parser.registerCsiHandler({final:"B"},Se=>this.cursorDown(Se)),this._parser.registerCsiHandler({final:"C"},Se=>this.cursorForward(Se)),this._parser.registerCsiHandler({final:"D"},Se=>this.cursorBackward(Se)),this._parser.registerCsiHandler({final:"E"},Se=>this.cursorNextLine(Se)),this._parser.registerCsiHandler({final:"F"},Se=>this.cursorPrecedingLine(Se)),this._parser.registerCsiHandler({final:"G"},Se=>this.cursorCharAbsolute(Se)),this._parser.registerCsiHandler({final:"H"},Se=>this.cursorPosition(Se)),this._parser.registerCsiHandler({final:"I"},Se=>this.cursorForwardTab(Se)),this._parser.registerCsiHandler({final:"J"},Se=>this.eraseInDisplay(Se,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},Se=>this.eraseInDisplay(Se,!0)),this._parser.registerCsiHandler({final:"K"},Se=>this.eraseInLine(Se,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},Se=>this.eraseInLine(Se,!0)),this._parser.registerCsiHandler({final:"L"},Se=>this.insertLines(Se)),this._parser.registerCsiHandler({final:"M"},Se=>this.deleteLines(Se)),this._parser.registerCsiHandler({final:"P"},Se=>this.deleteChars(Se)),this._parser.registerCsiHandler({final:"S"},Se=>this.scrollUp(Se)),this._parser.registerCsiHandler({final:"T"},Se=>this.scrollDown(Se)),this._parser.registerCsiHandler({final:"X"},Se=>this.eraseChars(Se)),this._parser.registerCsiHandler({final:"Z"},Se=>this.cursorBackwardTab(Se)),this._parser.registerCsiHandler({final:"`"},Se=>this.charPosAbsolute(Se)),this._parser.registerCsiHandler({final:"a"},Se=>this.hPositionRelative(Se)),this._parser.registerCsiHandler({final:"b"},Se=>this.repeatPrecedingCharacter(Se)),this._parser.registerCsiHandler({final:"c"},Se=>this.sendDeviceAttributesPrimary(Se)),this._parser.registerCsiHandler({prefix:">",final:"c"},Se=>this.sendDeviceAttributesSecondary(Se)),this._parser.registerCsiHandler({final:"d"},Se=>this.linePosAbsolute(Se)),this._parser.registerCsiHandler({final:"e"},Se=>this.vPositionRelative(Se)),this._parser.registerCsiHandler({final:"f"},Se=>this.hVPosition(Se)),this._parser.registerCsiHandler({final:"g"},Se=>this.tabClear(Se)),this._parser.registerCsiHandler({final:"h"},Se=>this.setMode(Se)),this._parser.registerCsiHandler({prefix:"?",final:"h"},Se=>this.setModePrivate(Se)),this._parser.registerCsiHandler({final:"l"},Se=>this.resetMode(Se)),this._parser.registerCsiHandler({prefix:"?",final:"l"},Se=>this.resetModePrivate(Se)),this._parser.registerCsiHandler({final:"m"},Se=>this.charAttributes(Se)),this._parser.registerCsiHandler({final:"n"},Se=>this.deviceStatus(Se)),this._parser.registerCsiHandler({prefix:"?",final:"n"},Se=>this.deviceStatusPrivate(Se)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},Se=>this.softReset(Se)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},Se=>this.setCursorStyle(Se)),this._parser.registerCsiHandler({final:"r"},Se=>this.setScrollRegion(Se)),this._parser.registerCsiHandler({final:"s"},Se=>this.saveCursor(Se)),this._parser.registerCsiHandler({final:"t"},Se=>this.windowOptions(Se)),this._parser.registerCsiHandler({final:"u"},Se=>this.restoreCursor(Se)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},Se=>this.insertColumns(Se)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},Se=>this.deleteColumns(Se)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},Se=>this.selectProtected(Se)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},Se=>this.requestMode(Se,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},Se=>this.requestMode(Se,!1)),this._parser.setExecuteHandler(Uo.BEL,()=>this.bell()),this._parser.setExecuteHandler(Uo.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Uo.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Uo.BS,()=>this.backspace()),this._parser.setExecuteHandler(Uo.HT,()=>this.tab()),this._parser.setExecuteHandler(Uo.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Uo.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(kT.IND,()=>this.index()),this._parser.setExecuteHandler(kT.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(kT.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Vm(Se=>(this.setTitle(Se),this.setIconName(Se),!0))),this._parser.registerOscHandler(1,new Vm(Se=>this.setIconName(Se))),this._parser.registerOscHandler(2,new Vm(Se=>this.setTitle(Se))),this._parser.registerOscHandler(4,new Vm(Se=>this.setOrReportIndexedColor(Se))),this._parser.registerOscHandler(8,new Vm(Se=>this.setHyperlink(Se))),this._parser.registerOscHandler(10,new Vm(Se=>this.setOrReportFgColor(Se))),this._parser.registerOscHandler(11,new Vm(Se=>this.setOrReportBgColor(Se))),this._parser.registerOscHandler(12,new Vm(Se=>this.setOrReportCursorColor(Se))),this._parser.registerOscHandler(104,new Vm(Se=>this.restoreIndexedColor(Se))),this._parser.registerOscHandler(110,new Vm(Se=>this.restoreFgColor(Se))),this._parser.registerOscHandler(111,new Vm(Se=>this.restoreBgColor(Se))),this._parser.registerOscHandler(112,new Vm(Se=>this.restoreCursorColor(Se))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let Se in Bp)this._parser.registerEscHandler({intermediates:"(",final:Se},()=>this.selectCharset("("+Se)),this._parser.registerEscHandler({intermediates:")",final:Se},()=>this.selectCharset(")"+Se)),this._parser.registerEscHandler({intermediates:"*",final:Se},()=>this.selectCharset("*"+Se)),this._parser.registerEscHandler({intermediates:"+",final:Se},()=>this.selectCharset("+"+Se)),this._parser.registerEscHandler({intermediates:"-",final:Se},()=>this.selectCharset("-"+Se)),this._parser.registerEscHandler({intermediates:".",final:Se},()=>this.selectCharset("."+Se)),this._parser.registerEscHandler({intermediates:"/",final:Se},()=>this.selectCharset("/"+Se));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(Se=>(this._logService.error("Parsing error: ",Se),Se)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new QF((Se,Ne)=>this.requestStatusString(Se,Ne)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,r,c){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=r,this._parseStack.position=c}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),iN))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${iN} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let r,c=this._activeBuffer.x,S=this._activeBuffer.y,$=0,Z=this._parseStack.paused;if(Z){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(r),r;c=this._parseStack.cursorStartX,S=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>$y&&($=this._parseStack.position+$y)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,Se=>String.fromCharCode(Se)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(Se=>Se.charCodeAt(0)):t),this._parseBuffer.length$y)for(let Se=$;Se0&&it.getWidth(this._activeBuffer.x-1)===2&&it.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Ne);let pt=this._parser.precedingJoinState;for(let bt=e;btue){if(xe){let Mr=it,ze=this._activeBuffer.x-Zt;for(this._activeBuffer.x=Zt,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),it=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Zt>0&&it instanceof l5&&it.copyCellsFrom(Mr,ze,0,Zt,!1);ze=0;)it.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ne);continue}if(Se&&(it.insertCells(this._activeBuffer.x,S-Zt,this._activeBuffer.getNullCell(Ne)),it.getWidth(ue-1)===2&&it.setCellFromCodepoint(ue-1,0,1,Ne)),it.setCellFromCodepoint(this._activeBuffer.x++,c,S,Ne),S>0)for(;--S;)it.setCellFromCodepoint(this._activeBuffer.x++,0,0,Ne)}this._parser.precedingJoinState=pt,this._activeBuffer.x0&&it.getWidth(this._activeBuffer.x)===0&&!it.hasContent(this._activeBuffer.x)&&it.setCellFromCodepoint(this._activeBuffer.x,0,1,Ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,r=>rN(r.params[0],this._optionsService.rawOptions.windowOptions)?e(r):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new QF(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Vm(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,r,c=!1,S=!1){let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);$.replaceCells(e,r,this._activeBuffer.getNullCell(this._eraseAttrData()),S),c&&($.isWrapped=!1)}_resetBufferLine(t,e=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),r.isWrapped=!1)}eraseInDisplay(t,e=!1){this._restrictCursor(this._bufferService.cols);let r;switch(t.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);r=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let c=this._activeBuffer.lines.length-this._bufferService.rows;c>0&&(this._activeBuffer.lines.trimStart(c),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-c,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-c,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let xe=ue;for(let Se=1;Se0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Uo.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Uo.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Uo.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Uo.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Uo.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e(Dt[Dt.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",Dt[Dt.SET=1]="SET",Dt[Dt.RESET=2]="RESET",Dt[Dt.PERMANENTLY_SET=3]="PERMANENTLY_SET",Dt[Dt.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(r||={});let c=this._coreService.decPrivateModes,{activeProtocol:S,activeEncoding:$}=this._coreMouseService,Z=this._coreService,{buffers:ue,cols:xe}=this._bufferService,{active:Se,alt:Ne}=ue,it=this._optionsService.rawOptions,pt=(Dt,Zt)=>(Z.triggerDataEvent(`${Uo.ESC}[${e?"":"?"}${Dt};${Zt}$y`),!0),bt=Dt=>Dt?1:2,wt=t.params[0];return e?wt===2?pt(wt,4):wt===4?pt(wt,bt(Z.modes.insertMode)):wt===12?pt(wt,3):wt===20?pt(wt,bt(it.convertEol)):pt(wt,0):wt===1?pt(wt,bt(c.applicationCursorKeys)):wt===3?pt(wt,it.windowOptions.setWinLines?xe===80?2:xe===132?1:0:0):wt===6?pt(wt,bt(c.origin)):wt===7?pt(wt,bt(c.wraparound)):wt===8?pt(wt,3):wt===9?pt(wt,bt(S==="X10")):wt===12?pt(wt,bt(it.cursorBlink)):wt===25?pt(wt,bt(!Z.isCursorHidden)):wt===45?pt(wt,bt(c.reverseWraparound)):wt===66?pt(wt,bt(c.applicationKeypad)):wt===67?pt(wt,4):wt===1e3?pt(wt,bt(S==="VT200")):wt===1002?pt(wt,bt(S==="DRAG")):wt===1003?pt(wt,bt(S==="ANY")):wt===1004?pt(wt,bt(c.sendFocus)):wt===1005?pt(wt,4):wt===1006?pt(wt,bt($==="SGR")):wt===1015?pt(wt,4):wt===1016?pt(wt,bt($==="SGR_PIXELS")):wt===1048?pt(wt,1):wt===47||wt===1047||wt===1049?pt(wt,bt(Se===Ne)):wt===2004?pt(wt,bt(c.bracketedPasteMode)):wt===2026?pt(wt,bt(c.synchronizedOutput)):pt(wt,0)}_updateAttrColor(t,e,r,c,S){return e===2?(t|=50331648,t&=-16777216,t|=h4.fromColorRGB([r,c,S])):e===5&&(t&=-50331904,t|=33554432|r&255),t}_extractColor(t,e,r){let c=[0,0,-1,0,0,0],S=0,$=0;do{if(c[$+S]=t.params[e+$],t.hasSubParams(e+$)){let Z=t.getSubParams(e+$),ue=0;do c[1]===5&&(S=1),c[$+ue+1+S]=Z[ue];while(++ue=2||c[1]===2&&$+S>=5)break;c[1]&&(S=1)}while(++$+e5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=_p.fg,t.bg=_p.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,r,c=this._curAttrData;for(let S=0;S=30&&r<=37?(c.fg&=-50331904,c.fg|=16777216|r-30):r>=40&&r<=47?(c.bg&=-50331904,c.bg|=16777216|r-40):r>=90&&r<=97?(c.fg&=-50331904,c.fg|=16777216|r-90|8):r>=100&&r<=107?(c.bg&=-50331904,c.bg|=16777216|r-100|8):r===0?this._processSGR0(c):r===1?c.fg|=134217728:r===3?c.bg|=67108864:r===4?(c.fg|=268435456,this._processUnderline(t.hasSubParams(S)?t.getSubParams(S)[0]:1,c)):r===5?c.fg|=536870912:r===7?c.fg|=67108864:r===8?c.fg|=1073741824:r===9?c.fg|=2147483648:r===2?c.bg|=134217728:r===21?this._processUnderline(2,c):r===22?(c.fg&=-134217729,c.bg&=-134217729):r===23?c.bg&=-67108865:r===24?(c.fg&=-268435457,this._processUnderline(0,c)):r===25?c.fg&=-536870913:r===27?c.fg&=-67108865:r===28?c.fg&=-1073741825:r===29?c.fg&=2147483647:r===39?(c.fg&=-67108864,c.fg|=_p.fg&16777215):r===49?(c.bg&=-67108864,c.bg|=_p.bg&16777215):r===38||r===48||r===58?S+=this._extractColor(t,S,c):r===53?c.bg|=1073741824:r===55?c.bg&=-1073741825:r===59?(c.extended=c.extended.clone(),c.extended.underlineColor=-1,c.updateExtended()):r===100?(c.fg&=-67108864,c.fg|=_p.fg&16777215,c.bg&=-67108864,c.bg|=_p.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${Uo.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Uo.ESC}[${e};${r}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Uo.ESC}[?${e};${r}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_p.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=e%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(t){let e=t.params[0]||1,r;return(t.length<2||(r=t.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(t){if(!rN(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Uo.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>tN&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>tN&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],r=t.split(";");for(;r.length>1;){let c=r.shift(),S=r.shift();if(/^\d+$/.exec(c)){let $=parseInt(c);if(aN($))if(S==="?")e.push({type:0,index:$});else{let Z=eN(S);Z&&e.push({type:1,index:$,color:Z})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let r=t.slice(0,e).trim(),c=t.slice(e+1);return c?this._createHyperlink(r,c):r.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let r=t.split(":"),c,S=r.findIndex($=>$.startsWith("id="));return S!==-1&&(c=r[S].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:c,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let r=t.split(";");for(let c=0;c=this._specialColors.length);++c,++e)if(r[c]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let S=eN(r[c]);S&&this._onColor.fire([{type:1,index:this._specialColors[e],color:S}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],r=t.split(";");for(let c=0;c=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_p.clone(),this._eraseAttrDataInternal=_p.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new bg;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e(this._coreService.triggerDataEvent(`${Uo.ESC}${Z}${Uo.ESC}\\`),!0),c=this._bufferService.buffer,S=this._optionsService.rawOptions;return r(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${c.scrollTop+1};${c.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[S.cursorStyle]-(S.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},H9=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){tthis.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(nN=t,t=e,e=nN),tthis.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};H9=Wd([cl(0,sm)],H9);function aN(t){return 0<=t&&t<256}var sMe=5e7,oN=12,lMe=50,uMe=class extends Sc{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Es),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,r){if(r!==void 0&&this._syncCalls>r){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let c;for(;c=this._writeBuffer.shift();){this._action(c);let S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,r){if(this._pendingData>sMe)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(r),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(r)}_innerWrite(e=0,r=!0){let c=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let S=this._writeBuffer[this._bufferOffset],$=this._action(S,r);if($){let ue=xe=>performance.now()-c>=oN?setTimeout(()=>this._innerWrite(0,xe)):this._innerWrite(c,xe);$.catch(xe=>(queueMicrotask(()=>{throw xe}),Promise.resolve(!1))).then(ue);return}let Z=this._callbacks[this._bufferOffset];if(Z&&Z(),this._bufferOffset++,this._pendingData-=S.length,performance.now()-c>=oN)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>lMe&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},V9=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let r=this._bufferService.buffer;if(e.id===void 0){let xe=r.addMarker(r.ybase+r.y),Se={data:e,id:this._nextId++,lines:[xe]};return xe.onDispose(()=>this._removeMarkerFromLink(Se,xe)),this._dataByLinkId.set(Se.id,Se),Se.id}let c=e,S=this._getEntryIdKey(c),$=this._entriesWithId.get(S);if($)return this.addLineToLink($.id,r.ybase+r.y),$.id;let Z=r.addMarker(r.ybase+r.y),ue={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[Z]};return Z.onDispose(()=>this._removeMarkerFromLink(ue,Z)),this._entriesWithId.set(ue.key,ue),this._dataByLinkId.set(ue.id,ue),ue.id}addLineToLink(e,r){let c=this._dataByLinkId.get(e);if(c&&c.lines.every(S=>S.line!==r)){let S=this._bufferService.buffer.addMarker(r);c.lines.push(S),S.onDispose(()=>this._removeMarkerFromLink(c,S))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,r){let c=e.lines.indexOf(r);c!==-1&&(e.lines.splice(c,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};V9=Wd([cl(0,sm)],V9);var sN=!1,cMe=class extends Sc{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new W2),this._onBinary=this._register(new Es),this.onBinary=this._onBinary.event,this._onData=this._register(new Es),this.onData=this._onData.event,this._onLineFeed=this._register(new Es),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Es),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Es),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Es),this._instantiationService=new z7e,this.optionsService=this._register(new V7e(e)),this._instantiationService.setService(lm,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(N9)),this._instantiationService.setService(sm,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(F9)),this._instantiationService.setService(WH,this._logService),this.coreService=this._register(this._instantiationService.createInstance(j9)),this._instantiationService.setService(Zx,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(U9)),this._instantiationService.setService(VH,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Mx)),this._instantiationService.setService(LCe,this.unicodeService),this._charsetService=this._instantiationService.createInstance(K7e),this._instantiationService.setService(ECe,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(V9),this._instantiationService.setService(qH,this._oscLinkService),this._inputHandler=this._register(new oMe(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(x0.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(x0.forward(this._bufferService.onResize,this._onResize)),this._register(x0.forward(this.coreService.onData,this._onData)),this._register(x0.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new uMe((r,c)=>this._inputHandler.parse(r,c))),this._register(x0.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Es),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let r in e)this.optionsService.options[r]=e[r]}write(e,r){this._writeBuffer.write(e,r)}writeSync(e,r){this._logService.logLevel<=3&&!sN&&(this._logService.warn("writeSync is unreliable and will be removed soon."),sN=!0),this._writeBuffer.writeSync(e,r)}input(e,r=!0){this.coreService.triggerDataEvent(e,r)}resize(e,r){isNaN(e)||isNaN(r)||(e=Math.max(e,TV),r=Math.max(r,SV),this._bufferService.resize(e,r))}scroll(e,r=!1){this._bufferService.scroll(e,r)}scrollLines(e,r){this._bufferService.scrollLines(e,r)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let r=e-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}registerEscHandler(e,r){return this._inputHandler.registerEscHandler(e,r)}registerDcsHandler(e,r){return this._inputHandler.registerDcsHandler(e,r)}registerCsiHandler(e,r){return this._inputHandler.registerCsiHandler(e,r)}registerOscHandler(e,r){return this._inputHandler.registerOscHandler(e,r)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,r=this.optionsService.rawOptions.windowsPty;r&&r.buildNumber!==void 0&&r.buildNumber!==void 0?e=r.backend==="conpty"&&r.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(JF.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(JF(this._bufferService),!1))),this._windowsWrappingHeuristics.value=cd(()=>{for(let r of e)r.dispose()})}}},hMe={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function fMe(t,e,r,c){let S={type:0,cancel:!1,key:void 0},$=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?S.key=Uo.ESC+"OA":S.key=Uo.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?S.key=Uo.ESC+"OD":S.key=Uo.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?S.key=Uo.ESC+"OC":S.key=Uo.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?S.key=Uo.ESC+"OB":S.key=Uo.ESC+"[B");break;case 8:S.key=t.ctrlKey?"\b":Uo.DEL,t.altKey&&(S.key=Uo.ESC+S.key);break;case 9:if(t.shiftKey){S.key=Uo.ESC+"[Z";break}S.key=Uo.HT,S.cancel=!0;break;case 13:S.key=t.altKey?Uo.ESC+Uo.CR:Uo.CR,S.cancel=!0;break;case 27:S.key=Uo.ESC,t.altKey&&(S.key=Uo.ESC+Uo.ESC),S.cancel=!0;break;case 37:if(t.metaKey)break;$?S.key=Uo.ESC+"[1;"+($+1)+"D":e?S.key=Uo.ESC+"OD":S.key=Uo.ESC+"[D";break;case 39:if(t.metaKey)break;$?S.key=Uo.ESC+"[1;"+($+1)+"C":e?S.key=Uo.ESC+"OC":S.key=Uo.ESC+"[C";break;case 38:if(t.metaKey)break;$?S.key=Uo.ESC+"[1;"+($+1)+"A":e?S.key=Uo.ESC+"OA":S.key=Uo.ESC+"[A";break;case 40:if(t.metaKey)break;$?S.key=Uo.ESC+"[1;"+($+1)+"B":e?S.key=Uo.ESC+"OB":S.key=Uo.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(S.key=Uo.ESC+"[2~");break;case 46:$?S.key=Uo.ESC+"[3;"+($+1)+"~":S.key=Uo.ESC+"[3~";break;case 36:$?S.key=Uo.ESC+"[1;"+($+1)+"H":e?S.key=Uo.ESC+"OH":S.key=Uo.ESC+"[H";break;case 35:$?S.key=Uo.ESC+"[1;"+($+1)+"F":e?S.key=Uo.ESC+"OF":S.key=Uo.ESC+"[F";break;case 33:t.shiftKey?S.type=2:t.ctrlKey?S.key=Uo.ESC+"[5;"+($+1)+"~":S.key=Uo.ESC+"[5~";break;case 34:t.shiftKey?S.type=3:t.ctrlKey?S.key=Uo.ESC+"[6;"+($+1)+"~":S.key=Uo.ESC+"[6~";break;case 112:$?S.key=Uo.ESC+"[1;"+($+1)+"P":S.key=Uo.ESC+"OP";break;case 113:$?S.key=Uo.ESC+"[1;"+($+1)+"Q":S.key=Uo.ESC+"OQ";break;case 114:$?S.key=Uo.ESC+"[1;"+($+1)+"R":S.key=Uo.ESC+"OR";break;case 115:$?S.key=Uo.ESC+"[1;"+($+1)+"S":S.key=Uo.ESC+"OS";break;case 116:$?S.key=Uo.ESC+"[15;"+($+1)+"~":S.key=Uo.ESC+"[15~";break;case 117:$?S.key=Uo.ESC+"[17;"+($+1)+"~":S.key=Uo.ESC+"[17~";break;case 118:$?S.key=Uo.ESC+"[18;"+($+1)+"~":S.key=Uo.ESC+"[18~";break;case 119:$?S.key=Uo.ESC+"[19;"+($+1)+"~":S.key=Uo.ESC+"[19~";break;case 120:$?S.key=Uo.ESC+"[20;"+($+1)+"~":S.key=Uo.ESC+"[20~";break;case 121:$?S.key=Uo.ESC+"[21;"+($+1)+"~":S.key=Uo.ESC+"[21~";break;case 122:$?S.key=Uo.ESC+"[23;"+($+1)+"~":S.key=Uo.ESC+"[23~";break;case 123:$?S.key=Uo.ESC+"[24;"+($+1)+"~":S.key=Uo.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?S.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?S.key=Uo.NUL:t.keyCode>=51&&t.keyCode<=55?S.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?S.key=Uo.DEL:t.keyCode===219?S.key=Uo.ESC:t.keyCode===220?S.key=Uo.FS:t.keyCode===221&&(S.key=Uo.GS);else if((!r||c)&&t.altKey&&!t.metaKey){let Z=hMe[t.keyCode]?.[t.shiftKey?1:0];if(Z)S.key=Uo.ESC+Z;else if(t.keyCode>=65&&t.keyCode<=90){let ue=t.ctrlKey?t.keyCode-64:t.keyCode+32,xe=String.fromCharCode(ue);t.shiftKey&&(xe=xe.toUpperCase()),S.key=Uo.ESC+xe}else if(t.keyCode===32)S.key=Uo.ESC+(t.ctrlKey?Uo.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let ue=t.code.slice(3,4);t.shiftKey||(ue=ue.toLowerCase()),S.key=Uo.ESC+ue,S.cancel=!0}}else r&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(S.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?S.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(S.key=Uo.US),t.key==="@"&&(S.key=Uo.NUL));break}return S}var op=0,dMe=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new i8,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new i8,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort(($,Z)=>this._getKey($)-this._getKey(Z)),r=0,c=0,S=new Array(this._array.length+this._insertedValues.length);for(let $=0;$=this._array.length||this._getKey(e[r])<=this._getKey(this._array[c])?(S[$]=e[r],r++):S[$]=this._array[c++];this._array=S,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let r=this._getKey(e);if(r===void 0||(op=this._search(r),op===-1)||this._getKey(this._array[op])!==r)return!1;do if(this._array[op]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(op),!0;while(++op$-Z),r=0,c=new Array(this._array.length-e.length),S=0;for(let $=0;$0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(op=this._search(e),!(op<0||op>=this._array.length)&&this._getKey(this._array[op])===e))do yield this._array[op];while(++op=this._array.length)&&this._getKey(this._array[op])===e))do r(this._array[op]);while(++op=r;){let S=r+c>>1,$=this._getKey(this._array[S]);if($>e)c=S-1;else if($0&&this._getKey(this._array[S-1])===e;)S--;return S}}return r}},oM=0,lN=0,pMe=class extends Sc{constructor(){super(),this._decorations=new dMe(t=>t?.marker.line),this._onDecorationRegistered=this._register(new Es),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Es),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(cd(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new mMe(t);if(e){let r=e.marker.onDispose(()=>e.dispose()),c=e.onDispose(()=>{c.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),r.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,r){let c=0,S=0;for(let $ of this._decorations.getKeyIterator(e))c=$.options.x??0,S=c+($.options.width??1),t>=c&&t{oM=S.options.x??0,lN=oM+(S.options.width??1),t>=oM&&t=this._debounceThresholdMS)this._lastRefreshMs=S,this._innerRefresh();else if(!this._additionalRefreshRequested){let $=S-this._lastRefreshMs,Z=this._debounceThresholdMS-$;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},Z)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),r=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,r)}},uN=20,n8=class extends Sc{constructor(t,e,r,c){super(),this._terminal=t,this._coreBrowserService=r,this._renderService=c,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let S=this._coreBrowserService.mainDocument;this._accessibilityContainer=S.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=S.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let $=0;$this._handleBoundaryFocus($,0),this._bottomBoundaryFocusListener=$=>this._handleBoundaryFocus($,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=S.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new vMe(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize($=>this._handleResize($.rows))),this._register(this._terminal.onRender($=>this._refreshRows($.start,$.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar($=>this._handleChar($))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this._register(this._terminal.onA11yTab($=>this._handleTab($))),this._register(this._terminal.onKey($=>this._handleKey($.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Uu(S,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(cd(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===uN+1&&(this._liveRegion.textContent+=c9.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let r=this._terminal.buffer,c=r.lines.length.toString();for(let S=t;S<=e;S++){let $=r.lines.get(r.ydisp+S),Z=[],ue=$?.translateToString(!0,void 0,void 0,Z)||"",xe=(r.ydisp+S+1).toString(),Se=this._rowElements[S];Se&&(ue.length===0?(Se.textContent=" ",this._rowColumns.set(Se,[0,1])):(Se.textContent=ue,this._rowColumns.set(Se,Z)),Se.setAttribute("aria-posinset",xe),Se.setAttribute("aria-setsize",c),this._alignRowWidth(Se))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let r=t.target,c=this._rowElements[e===0?1:this._rowElements.length-2],S=r.getAttribute("aria-posinset"),$=e===0?"1":`${this._terminal.buffer.lines.length}`;if(S===$||t.relatedTarget!==c)return;let Z,ue;if(e===0?(Z=r,ue=this._rowElements.pop(),this._rowContainer.removeChild(ue)):(Z=this._rowElements.shift(),ue=r,this._rowContainer.removeChild(Z)),Z.removeEventListener("focus",this._topBoundaryFocusListener),ue.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let xe=this._createAccessibilityTreeNode();this._rowElements.unshift(xe),this._rowContainer.insertAdjacentElement("afterbegin",xe)}else{let xe=this._createAccessibilityTreeNode();this._rowElements.push(xe),this._rowContainer.appendChild(xe)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},r={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===r.node&&e.offset>r.offset)&&([e,r]=[r,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let c=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(c)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:c,offset:c.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let S=({node:ue,offset:xe})=>{let Se=ue instanceof Text?ue.parentNode:ue,Ne=parseInt(Se?.getAttribute("aria-posinset"),10)-1;if(isNaN(Ne))return console.warn("row is invalid. Race condition?"),null;let it=this._rowColumns.get(Se);if(!it)return console.warn("columns is null. Race condition?"),null;let pt=xe=this._terminal.cols&&(++Ne,pt=0),{row:Ne,column:pt}},$=S(e),Z=S(r);if(!(!$||!Z)){if($.row>Z.row||$.row===Z.row&&$.column>=Z.column)throw new Error("invalid range");this._terminal.select($.column,$.row,(Z.row-$.row)*this._terminal.cols-$.column+Z.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;et;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t{$x(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Uu(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Uu(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Uu(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Uu(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let r=t.composedPath();for(let c=0;c{c?.forEach(S=>{S.link.dispose&&S.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let r=!1;for(let[c,S]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(c)&&(r=this._checkLinkProviderResult(c,t,r)):S.provideLinks(t.y,$=>{if(this._isMouseOut)return;let Z=$?.map(ue=>({link:ue}));this._activeProviderReplies?.set(c,Z),r=this._checkLinkProviderResult(c,t,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let r=new Set;for(let c=0;ct?this._bufferService.cols:Z.link.range.end.x;for(let Se=ue;Se<=xe;Se++){if(r.has(Se)){S.splice($--,1);break}r.add(Se)}}}}_checkLinkProviderResult(t,e,r){if(!this._activeProviderReplies)return r;let c=this._activeProviderReplies.get(t),S=!1;for(let $=0;$this._linkAtPosition(Z.link,e));$&&(r=!0,this._handleNewLink($))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let $=0;$this._linkAtPosition(ue.link,e));if(Z){r=!0,this._handleNewLink(Z);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&yMe(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,$x(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:r=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:r=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let c=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(c,S),this._lastMouseEvent)){let $=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);$&&this._askForLink($,!1)}})))}_linkHover(t,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(r,e.text)}_fireUnderlineEvent(t,e){let r=t.range,c=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-c-1,r.end.x,r.end.y-c-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(t,e,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(r,e.text)}_linkAtPosition(t,e){let r=t.range.start.y*this._bufferService.cols+t.range.start.x,c=t.range.end.y*this._bufferService.cols+t.range.end.x,S=e.y*this._bufferService.cols+e.x;return r<=S&&S<=c}_positionFromMouseEvent(t,e,r){let c=r.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,r,c,S){return{x1:t,y1:e,x2:r,y2:c,cols:this._bufferService.cols,fg:S}}};W9=Wd([cl(1,iL),cl(2,G1),cl(3,sm),cl(4,ZH)],W9);function yMe(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var _Me=class extends cMe{constructor(e={}){super(e),this._linkifier=this._register(new W2),this.browser=dV,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new W2),this._onCursorMove=this._register(new Es),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Es),this.onKey=this._onKey.event,this._onRender=this._register(new Es),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Es),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Es),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Es),this.onBell=this._onBell.event,this._onFocus=this._register(new Es),this._onBlur=this._register(new Es),this._onA11yCharEmitter=this._register(new Es),this._onA11yTabEmitter=this._register(new Es),this._onWillOpen=this._register(new Es),this._setup(),this._decorationService=this._instantiationService.createInstance(pMe),this._instantiationService.setService(f4,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(l7e),this._instantiationService.setService(ZH,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f9)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(r=>this.refresh(r?.start??0,r?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(r=>this._reportWindowsOptions(r))),this._register(this._inputHandler.onColor(r=>this._handleColorEvent(r))),this._register(x0.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(x0.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(x0.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(x0.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(r=>this._afterResize(r.cols,r.rows))),this._register(cd(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let r of e){let c,S="";switch(r.index){case 256:c="foreground",S="10";break;case 257:c="background",S="11";break;case 258:c="cursor",S="12";break;default:c="ansi",S="4;"+r.index}switch(r.type){case 0:let $=Zf.toColorRGB(c==="ansi"?this._themeService.colors.ansi[r.index]:this._themeService.colors[c]);this.coreService.triggerDataEvent(`${Uo.ESC}]${S};${nMe($)}${hV.ST}`);break;case 1:if(c==="ansi")this._themeService.modifyColors(Z=>Z.ansi[r.index]=bp.toColor(...r.color));else{let Z=c;this._themeService.modifyColors(ue=>ue[Z]=bp.toColor(...r.color))}break;case 2:this._themeService.restoreColor(r.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(n8,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Uo.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Uo.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,r=this.buffer.lines.get(e);if(!r)return;let c=Math.min(this.buffer.x,this.cols-1),S=this._renderService.dimensions.css.cell.height,$=r.getWidth(c),Z=this._renderService.dimensions.css.cell.width*$,ue=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=c*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=ue+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=S+"px",this.textarea.style.lineHeight=S+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Uu(this.element,"copy",r=>{this.hasSelection()&&kCe(r,this._selectionService)}));let e=r=>TCe(r,this.textarea,this.coreService,this.optionsService);this._register(Uu(this.textarea,"paste",e)),this._register(Uu(this.element,"paste",e)),pV?this._register(Uu(this.element,"mousedown",r=>{r.button===2&&_F(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Uu(this.element,"contextmenu",r=>{_F(r,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),hL&&this._register(Uu(this.element,"auxclick",r=>{r.button===1&&NH(r,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Uu(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Uu(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Uu(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Uu(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Uu(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Uu(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Uu(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let r=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Uu(this.screenElement,"mousemove",$=>this.updateCursorStyle($))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement);let c=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",u9.get()),vV||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>c.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(o7e,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(q1,this._coreBrowserService),this._register(Uu(this.textarea,"focus",$=>this._handleTextAreaFocus($))),this._register(Uu(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(D9,this._document,this._helperContainer),this._instantiationService.setService(V8,this._charSizeService),this._themeService=this._instantiationService.createInstance(R9),this._instantiationService.setService(Y2,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(t8),this._instantiationService.setService(GH,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(O9,this.rows,this.screenElement)),this._instantiationService.setService(G1,this._renderService),this._register(this._renderService.onRenderedViewportChange($=>this._onRender.fire($))),this.onResize($=>this._renderService.resize($.cols,$.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(L9,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(z9),this._instantiationService.setService(iL,this._mouseService);let S=this._linkifier.value=this._register(this._instantiationService.createInstance(W9,this.screenElement));this.element.appendChild(r);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(M9,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines($=>{super.scrollLines($,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(B9,this.element,this.screenElement,S)),this._instantiationService.setService(ICe,this._selectionService),this._register(this._selectionService.onRequestScrollLines($=>this.scrollLines($.amount,$.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw($=>this._renderService.handleSelectionChanged($.start,$.end,$.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection($=>{this.textarea.value=$,this.textarea.focus(),this.textarea.select()})),this._register(x0.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(E9,this.screenElement)),this._register(Uu(this.element,"mousedown",$=>this._selectionService.handleMouseDown($))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(n8,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",$=>this._handleScreenReaderModeOptionChange($))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(e8,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",$=>{!this._overviewRulerRenderer&&$&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(e8,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(I9,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,r=this.element;function c(Z){let ue=e._mouseService.getMouseReportCoords(Z,e.screenElement);if(!ue)return!1;let xe,Se;switch(Z.overrideType||Z.type){case"mousemove":Se=32,Z.buttons===void 0?(xe=3,Z.button!==void 0&&(xe=Z.button<3?Z.button:3)):xe=Z.buttons&1?0:Z.buttons&4?1:Z.buttons&2?2:3;break;case"mouseup":Se=0,xe=Z.button<3?Z.button:3;break;case"mousedown":Se=1,xe=Z.button<3?Z.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(Z)===!1)return!1;let Ne=Z.deltaY;if(Ne===0||e.coreMouseService.consumeWheelEvent(Z,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;Se=Ne<0?0:1,xe=4;break;default:return!1}return Se===void 0||xe===void 0||xe>4?!1:e.coreMouseService.triggerMouseEvent({col:ue.col,row:ue.row,x:ue.x,y:ue.y,button:xe,action:Se,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}let S={mouseup:null,wheel:null,mousedrag:null,mousemove:null},$={mouseup:Z=>(c(Z),Z.buttons||(this._document.removeEventListener("mouseup",S.mouseup),S.mousedrag&&this._document.removeEventListener("mousemove",S.mousedrag)),this.cancel(Z)),wheel:Z=>(c(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&c(Z)},mousemove:Z=>{Z.buttons||c(Z)}};this._register(this.coreMouseService.onProtocolChange(Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),Z&8?S.mousemove||(r.addEventListener("mousemove",$.mousemove),S.mousemove=$.mousemove):(r.removeEventListener("mousemove",S.mousemove),S.mousemove=null),Z&16?S.wheel||(r.addEventListener("wheel",$.wheel,{passive:!1}),S.wheel=$.wheel):(r.removeEventListener("wheel",S.wheel),S.wheel=null),Z&2?S.mouseup||(S.mouseup=$.mouseup):(this._document.removeEventListener("mouseup",S.mouseup),S.mouseup=null),Z&4?S.mousedrag||(S.mousedrag=$.mousedrag):(this._document.removeEventListener("mousemove",S.mousedrag),S.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Uu(r,"mousedown",Z=>{if(Z.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(Z)))return c(Z),S.mouseup&&this._document.addEventListener("mouseup",S.mouseup),S.mousedrag&&this._document.addEventListener("mousemove",S.mousedrag),this.cancel(Z)})),this._register(Uu(r,"wheel",Z=>{if(!S.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){if(Z.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(Z,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(Z,!0);let ue=Uo.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(ue,!0),this.cancel(Z,!0)}}},{passive:!1}))}refresh(e,r){this._renderService?.refreshRows(e,r)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,r){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,r),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let r=e-this._bufferService.buffer.ydisp;r!==0&&this.scrollLines(r)}paste(e){FH(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let r=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),r}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,r,c){this._selectionService.setSelection(e,r,c)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,r){this._selectionService?.selectLines(e,r)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let r=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!r&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!r&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let c=fMe(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),c.type===3||c.type===2){let S=this.rows-1;return this.scrollLines(c.type===2?-S:S),this.cancel(e,!0)}if(c.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(c.cancel&&this.cancel(e,!0),!c.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((c.key===Uo.ETX||c.key===Uo.CR)&&(this.textarea.value=""),this._onKey.fire({key:c.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(c.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,r){let c=e.isMac&&!this.options.macOptionIsMeta&&r.altKey&&!r.ctrlKey&&!r.metaKey||e.isWindows&&r.altKey&&r.ctrlKey&&!r.metaKey||e.isWindows&&r.getModifierState("AltGraph");return r.type==="keypress"?c:c&&(!r.keyCode||r.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(xMe(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let r;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)r=e.charCode;else if(e.which===null||e.which===void 0)r=e.keyCode;else if(e.which!==0&&e.charCode!==0)r=e.which;else return!1;return!r||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(r=String.fromCharCode(r),this._onKey.fire({key:r,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let r=e.data;return this.coreService.triggerDataEvent(r,!0),this.cancel(e),!0}return!1}resize(e,r){if(e===this.cols&&r===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,r)}_afterResize(e,r){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,r){let c={instance:r,dispose:r.dispose,isDisposed:!1};this._addons.push(c),r.dispose=()=>this._wrappedAddonDispose(c),r.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let r=-1;for(let c=0;c=this._line.length))return r?(this._line.loadCell(e,r),r):this._line.loadCell(e,new bg)}translateToString(e,r,c){return this._line.translateToString(e,r,c)}},cN=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new wMe(e)}getNullCell(){return new bg}},kMe=class extends Sc{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new Es),this.onBufferChange=this._onBufferChange.event,this._normal=new cN(this._core.buffers.normal,"normal"),this._alternate=new cN(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},TMe=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,r=>e(r.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(r,c)=>e(r,c.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},SMe=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},CMe=["cols","rows"],gv=0,AMe=class extends Sc{constructor(t){super(),this._core=this._register(new _Me(t)),this._addonManager=this._register(new bMe),this._publicOptions={...this._core.options};let e=c=>this._core.options[c],r=(c,S)=>{this._checkReadonlyOptions(c),this._core.options[c]=S};for(let c in this._core.options){let S={get:e.bind(this,c),set:r.bind(this,c)};Object.defineProperty(this._publicOptions,c,S)}}_checkReadonlyOptions(t){if(CMe.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new TMe(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new SMe(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new kMe(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,r){this._verifyIntegers(t,e,r),this._core.select(t,e,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r +`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return u9.get()},set promptLabel(t){u9.set(t)},get tooMuchOutput(){return c9.get()},set tooMuchOutput(t){c9.set(t)}}}_verifyIntegers(...t){for(gv of t)if(gv===1/0||isNaN(gv)||gv%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(gv of t)if(gv&&(gv===1/0||isNaN(gv)||gv%1!==0||gv<0))throw new Error("This API only accepts positive integers")}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4025,7 +4025,7 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var eMe=2,tMe=1,rMe=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(r.getPropertyValue("height")),S=Math.max(0,parseInt(r.getPropertyValue("width"))),H=window.getComputedStyle(this._terminal.element),Z={top:parseInt(H.getPropertyValue("padding-top")),bottom:parseInt(H.getPropertyValue("padding-bottom")),right:parseInt(H.getPropertyValue("padding-right")),left:parseInt(H.getPropertyValue("padding-left"))},ue=Z.top+Z.bottom,be=Z.right+Z.left,Se=c-ue,Re=S-be-e;return{cols:Math.max(eMe,Math.floor(Re/t.css.cell.width)),rows:Math.max(tMe,Math.floor(Se/t.css.cell.height))}}};/** + */var MMe=2,EMe=1,LMe=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(r.getPropertyValue("height")),S=Math.max(0,parseInt(r.getPropertyValue("width"))),$=window.getComputedStyle(this._terminal.element),Z={top:parseInt($.getPropertyValue("padding-top")),bottom:parseInt($.getPropertyValue("padding-bottom")),right:parseInt($.getPropertyValue("padding-right")),left:parseInt($.getPropertyValue("padding-left"))},ue=Z.top+Z.bottom,xe=Z.right+Z.left,Se=c-ue,Ne=S-xe-e;return{cols:Math.max(MMe,Math.floor(Ne/t.css.cell.width)),rows:Math.max(EMe,Math.floor(Se/t.css.cell.height))}}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4036,7 +4036,7 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var iMe=class{constructor(t,e,r,c={}){this._terminal=t,this._regex=e,this._handler=r,this._options=c}provideLinks(t,e){let r=aMe.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(r))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(r,c)=>{if(this._options.hover){let{range:S}=e;this._options.hover(r,c,S)}},e))}};function nMe(t){try{let e=new URL(t),r=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var aMe=class TT{static computeLink(e,r,c,S){let H=new RegExp(r.source,(r.flags||"")+"g"),[Z,ue]=TT._getWindowedLineStrings(e-1,c),be=Z.join(""),Se,Re=[];for(;Se=H.exec(be);){let Xe=Se[0];if(!nMe(Xe))continue;let[vt,bt]=TT._mapStrIdx(c,ue,0,Se.index),[kt,Dt]=TT._mapStrIdx(c,vt,bt,Xe.length);if(vt===-1||bt===-1||kt===-1||Dt===-1)continue;let rr={start:{x:bt+1,y:vt+1},end:{x:Dt,y:kt+1}};Re.push({range:rr,text:Xe,activate:S})}return Re}static _getWindowedLineStrings(e,r){let c,S=e,H=e,Z=0,ue="",be=[];if(c=r.buffer.active.getLine(e)){let Se=c.translateToString(!0);if(c.isWrapped&&Se[0]!==" "){for(Z=0;(c=r.buffer.active.getLine(--S))&&Z<2048&&(ue=c.translateToString(!0),Z+=ue.length,be.push(ue),!(!c.isWrapped||ue.indexOf(" ")!==-1)););be.reverse()}for(be.push(Se),Z=0;(c=r.buffer.active.getLine(++H))&&c.isWrapped&&Z<2048&&(ue=c.translateToString(!0),Z+=ue.length,be.push(ue),ue.indexOf(" ")===-1););}return[be,S]}static _mapStrIdx(e,r,c,S){let H=e.buffer.active,Z=H.getNullCell(),ue=c;for(;S;){let be=H.getLine(r);if(!be)return[-1,-1];for(let Se=ue;Se`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function sMe(t,e){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var lMe=class{constructor(e=sMe,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,c=r.urlRegex||oMe;this._linkProvider=this._terminal.registerLinkProvider(new iMe(this._terminal,c,this._handler,r))}dispose(){this._linkProvider?.dispose()}};/** + */var PMe=class{constructor(t,e,r,c={}){this._terminal=t,this._regex=e,this._handler=r,this._options=c}provideLinks(t,e){let r=DMe.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(r))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(r,c)=>{if(this._options.hover){let{range:S}=e;this._options.hover(r,c,S)}},e))}};function IMe(t){try{let e=new URL(t),r=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var DMe=class CT{static computeLink(e,r,c,S){let $=new RegExp(r.source,(r.flags||"")+"g"),[Z,ue]=CT._getWindowedLineStrings(e-1,c),xe=Z.join(""),Se,Ne=[];for(;Se=$.exec(xe);){let it=Se[0];if(!IMe(it))continue;let[pt,bt]=CT._mapStrIdx(c,ue,0,Se.index),[wt,Dt]=CT._mapStrIdx(c,pt,bt,it.length);if(pt===-1||bt===-1||wt===-1||Dt===-1)continue;let Zt={start:{x:bt+1,y:pt+1},end:{x:Dt,y:wt+1}};Ne.push({range:Zt,text:it,activate:S})}return Ne}static _getWindowedLineStrings(e,r){let c,S=e,$=e,Z=0,ue="",xe=[];if(c=r.buffer.active.getLine(e)){let Se=c.translateToString(!0);if(c.isWrapped&&Se[0]!==" "){for(Z=0;(c=r.buffer.active.getLine(--S))&&Z<2048&&(ue=c.translateToString(!0),Z+=ue.length,xe.push(ue),!(!c.isWrapped||ue.indexOf(" ")!==-1)););xe.reverse()}for(xe.push(Se),Z=0;(c=r.buffer.active.getLine(++$))&&c.isWrapped&&Z<2048&&(ue=c.translateToString(!0),Z+=ue.length,xe.push(ue),ue.indexOf(" ")===-1););}return[xe,S]}static _mapStrIdx(e,r,c,S){let $=e.buffer.active,Z=$.getNullCell(),ue=c;for(;S;){let xe=$.getLine(r);if(!xe)return[-1,-1];for(let Se=ue;Se`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function OMe(t,e){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var BMe=class{constructor(e=OMe,r={}){this._handler=e,this._options=r}activate(e){this._terminal=e;let r=this._options,c=r.urlRegex||zMe;this._linkProvider=this._terminal.registerLinkProvider(new PMe(this._terminal,c,this._handler,r))}dispose(){this._linkProvider?.dispose()}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4047,13 +4047,13 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var uMe=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?uN.isErrorNoTelemetry(t)?new uN(t.message+` + */var RMe=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?hN.isErrorNoTelemetry(t)?new hN(t.message+` `+t.stack):new Error(t.message+` -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},cMe=new uMe;function aM(t){hMe(t)||cMe.onUnexpectedError(t)}var V9="Canceled";function hMe(t){return t instanceof fMe?!0:t instanceof Error&&t.name===V9&&t.message===V9}var fMe=class extends Error{constructor(){super(V9),this.name=this.message}},uN=class W9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof W9)return e;let r=new W9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},dMe;(t=>{function e(H){return H<0}t.isLessThan=e;function r(H){return H<=0}t.isLessThanOrEqual=r;function c(H){return H>0}t.isGreaterThan=c;function S(H){return H===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(dMe||={});function pMe(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var TV;(t=>{function e(ur){return ur&&typeof ur=="object"&&typeof ur[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(ur){yield ur}t.single=S;function H(ur){return e(ur)?ur:S(ur)}t.wrap=H;function Z(ur){return ur||r}t.from=Z;function*ue(ur){for(let Ir=ur.length-1;Ir>=0;Ir--)yield ur[Ir]}t.reverse=ue;function be(ur){return!ur||ur[Symbol.iterator]().next().done===!0}t.isEmpty=be;function Se(ur){return ur[Symbol.iterator]().next().value}t.first=Se;function Re(ur,Ir){let Ti=0;for(let _i of ur)if(Ir(_i,Ti++))return!0;return!1}t.some=Re;function Xe(ur,Ir){for(let Ti of ur)if(Ir(Ti))return Ti}t.find=Xe;function*vt(ur,Ir){for(let Ti of ur)Ir(Ti)&&(yield Ti)}t.filter=vt;function*bt(ur,Ir){let Ti=0;for(let _i of ur)yield Ir(_i,Ti++)}t.map=bt;function*kt(ur,Ir){let Ti=0;for(let _i of ur)yield*Ir(_i,Ti++)}t.flatMap=kt;function*Dt(...ur){for(let Ir of ur)yield*Ir}t.concat=Dt;function rr(ur,Ir,Ti){let _i=Ti;for(let Ci of ur)_i=Ir(_i,Ci);return _i}t.reduce=rr;function*Er(ur,Ir,Ti=ur.length){for(Ir<0&&(Ir+=ur.length),Ti<0?Ti+=ur.length:Ti>ur.length&&(Ti=ur.length);Ir1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function SV(...t){return Y2(()=>C5(t))}function Y2(t){return{dispose:pMe(()=>{t()})}}var CV=class AV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{C5(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?AV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};CV.DISABLE_DISPOSED_WARNING=!1;var cL=CV,m_=class{constructor(){this._store=new cL,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};m_.None=Object.freeze({dispose(){}});var iS=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},mMe=globalThis.performance&&typeof globalThis.performance.now=="function",gMe=class MV{static create(e){return new MV(e)}constructor(e){this._now=mMe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},hL;(t=>{t.None=()=>m_.None;function e(vr,dr){return Xe(vr,()=>{},0,void 0,!0,void 0,dr)}t.defer=e;function r(vr){return(dr,Ar=null,ti)=>{let Xr=!1,ei;return ei=vr(Di=>{if(!Xr)return ei?ei.dispose():Xr=!0,dr.call(Ar,Di)},null,ti),Xr&&ei.dispose(),ei}}t.once=r;function c(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>ti.call(Xr,dr(Di)),null,ei),Ar)}t.map=c;function S(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>{dr(Di),ti.call(Xr,Di)},null,ei),Ar)}t.forEach=S;function H(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>dr(Di)&&ti.call(Xr,Di),null,ei),Ar)}t.filter=H;function Z(vr){return vr}t.signal=Z;function ue(...vr){return(dr,Ar=null,ti)=>{let Xr=SV(...vr.map(ei=>ei(Di=>dr.call(Ar,Di))));return Re(Xr,ti)}}t.any=ue;function be(vr,dr,Ar,ti){let Xr=Ar;return c(vr,ei=>(Xr=dr(Xr,ei),Xr),ti)}t.reduce=be;function Se(vr,dr){let Ar,ti={onWillAddFirstListener(){Ar=vr(Xr.fire,Xr)},onDidRemoveLastListener(){Ar?.dispose()}},Xr=new kv(ti);return dr?.add(Xr),Xr.event}function Re(vr,dr){return dr instanceof Array?dr.push(vr):dr&&dr.add(vr),vr}function Xe(vr,dr,Ar=100,ti=!1,Xr=!1,ei,Di){let qn,Qn,ka,Ta=0,so,Yn={leakWarningThreshold:ei,onWillAddFirstListener(){qn=vr(an=>{Ta++,Qn=dr(Qn,an),ti&&!ka&&(sn.fire(Qn),Qn=void 0),so=()=>{let zn=Qn;Qn=void 0,ka=void 0,(!ti||Ta>1)&&sn.fire(zn),Ta=0},typeof Ar=="number"?(clearTimeout(ka),ka=setTimeout(so,Ar)):ka===void 0&&(ka=0,queueMicrotask(so))})},onWillRemoveListener(){Xr&&Ta>0&&so?.()},onDidRemoveLastListener(){so=void 0,qn.dispose()}},sn=new kv(Yn);return Di?.add(sn),sn.event}t.debounce=Xe;function vt(vr,dr=0,Ar){return t.debounce(vr,(ti,Xr)=>ti?(ti.push(Xr),ti):[Xr],dr,void 0,!0,void 0,Ar)}t.accumulate=vt;function bt(vr,dr=(ti,Xr)=>ti===Xr,Ar){let ti=!0,Xr;return H(vr,ei=>{let Di=ti||!dr(ei,Xr);return ti=!1,Xr=ei,Di},Ar)}t.latch=bt;function kt(vr,dr,Ar){return[t.filter(vr,dr,Ar),t.filter(vr,ti=>!dr(ti),Ar)]}t.split=kt;function Dt(vr,dr=!1,Ar=[],ti){let Xr=Ar.slice(),ei=vr(Qn=>{Xr?Xr.push(Qn):qn.fire(Qn)});ti&&ti.add(ei);let Di=()=>{Xr?.forEach(Qn=>qn.fire(Qn)),Xr=null},qn=new kv({onWillAddFirstListener(){ei||(ei=vr(Qn=>qn.fire(Qn)),ti&&ti.add(ei))},onDidAddFirstListener(){Xr&&(dr?setTimeout(Di):Di())},onDidRemoveLastListener(){ei&&ei.dispose(),ei=null}});return ti&&ti.add(qn),qn.event}t.buffer=Dt;function rr(vr,dr){return(Ar,ti,Xr)=>{let ei=dr(new Fe);return vr(function(Di){let qn=ei.evaluate(Di);qn!==Er&&Ar.call(ti,qn)},void 0,Xr)}}t.chain=rr;let Er=Symbol("HaltChainable");class Fe{constructor(){this.steps=[]}map(dr){return this.steps.push(dr),this}forEach(dr){return this.steps.push(Ar=>(dr(Ar),Ar)),this}filter(dr){return this.steps.push(Ar=>dr(Ar)?Ar:Er),this}reduce(dr,Ar){let ti=Ar;return this.steps.push(Xr=>(ti=dr(ti,Xr),ti)),this}latch(dr=(Ar,ti)=>Ar===ti){let Ar=!0,ti;return this.steps.push(Xr=>{let ei=Ar||!dr(Xr,ti);return Ar=!1,ti=Xr,ei?Xr:Er}),this}evaluate(dr){for(let Ar of this.steps)if(dr=Ar(dr),dr===Er)break;return dr}}function wi(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.on(dr,ti),ei=()=>vr.removeListener(dr,ti),Di=new kv({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromNodeEventEmitter=wi;function ur(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.addEventListener(dr,ti),ei=()=>vr.removeEventListener(dr,ti),Di=new kv({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromDOMEventEmitter=ur;function Ir(vr){return new Promise(dr=>r(vr)(dr))}t.toPromise=Ir;function Ti(vr){let dr=new kv;return vr.then(Ar=>{dr.fire(Ar)},()=>{dr.fire(void 0)}).finally(()=>{dr.dispose()}),dr.event}t.fromPromise=Ti;function _i(vr,dr){return vr(Ar=>dr.fire(Ar))}t.forward=_i;function Ci(vr,dr,Ar){return dr(Ar),vr(ti=>dr(ti))}t.runAndSubscribe=Ci;class ii{constructor(dr,Ar){this._observable=dr,this._counter=0,this._hasChanged=!1;let ti={onWillAddFirstListener:()=>{dr.addObserver(this)},onDidRemoveLastListener:()=>{dr.removeObserver(this)}};this.emitter=new kv(ti),Ar&&Ar.add(this.emitter)}beginUpdate(dr){this._counter++}handlePossibleChange(dr){}handleChange(dr,Ar){this._hasChanged=!0}endUpdate(dr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ji(vr,dr){return new ii(vr,dr).emitter.event}t.fromObservable=Ji;function vi(vr){return(dr,Ar,ti)=>{let Xr=0,ei=!1,Di={beginUpdate(){Xr++},endUpdate(){Xr--,Xr===0&&(vr.reportChanges(),ei&&(ei=!1,dr.call(Ar)))},handlePossibleChange(){},handleChange(){ei=!0}};vr.addObserver(Di),vr.reportChanges();let qn={dispose(){vr.removeObserver(Di)}};return ti instanceof cL?ti.add(qn):Array.isArray(ti)&&ti.push(qn),qn}}t.fromObservableLight=vi})(hL||={});var q9=class G9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${G9._idPool++}`,G9.all.add(this)}start(e){this._stopWatch=new gMe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};q9.all=new Set,q9._idPool=0;var vMe=q9,yMe=-1,EV=class LV{constructor(e,r,c=(LV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let H=this._stacks.get(e.value)||0;this._stacks.set(e.value,H-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},FMe=new RMe;function sM(t){NMe(t)||FMe.onUnexpectedError(t)}var q9="Canceled";function NMe(t){return t instanceof jMe?!0:t instanceof Error&&t.name===q9&&t.message===q9}var jMe=class extends Error{constructor(){super(q9),this.name=this.message}},hN=class G9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof G9)return e;let r=new G9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},UMe;(t=>{function e($){return $<0}t.isLessThan=e;function r($){return $<=0}t.isLessThanOrEqual=r;function c($){return $>0}t.isGreaterThan=c;function S($){return $===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(UMe||={});function $Me(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var AV;(t=>{function e(or){return or&&typeof or=="object"&&typeof or[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(or){yield or}t.single=S;function $(or){return e(or)?or:S(or)}t.wrap=$;function Z(or){return or||r}t.from=Z;function*ue(or){for(let Cr=or.length-1;Cr>=0;Cr--)yield or[Cr]}t.reverse=ue;function xe(or){return!or||or[Symbol.iterator]().next().done===!0}t.isEmpty=xe;function Se(or){return or[Symbol.iterator]().next().value}t.first=Se;function Ne(or,Cr){let gi=0;for(let Si of or)if(Cr(Si,gi++))return!0;return!1}t.some=Ne;function it(or,Cr){for(let gi of or)if(Cr(gi))return gi}t.find=it;function*pt(or,Cr){for(let gi of or)Cr(gi)&&(yield gi)}t.filter=pt;function*bt(or,Cr){let gi=0;for(let Si of or)yield Cr(Si,gi++)}t.map=bt;function*wt(or,Cr){let gi=0;for(let Si of or)yield*Cr(Si,gi++)}t.flatMap=wt;function*Dt(...or){for(let Cr of or)yield*Cr}t.concat=Dt;function Zt(or,Cr,gi){let Si=gi;for(let Ci of or)Si=Cr(Si,Ci);return Si}t.reduce=Zt;function*Mr(or,Cr,gi=or.length){for(Cr<0&&(Cr+=or.length),gi<0?gi+=or.length:gi>or.length&&(gi=or.length);Cr1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function MV(...t){return J2(()=>M5(t))}function J2(t){return{dispose:$Me(()=>{t()})}}var EV=class LV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{M5(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?LV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};EV.DISABLE_DISPOSED_WARNING=!1;var fL=EV,__=class{constructor(){this._store=new fL,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};__.None=Object.freeze({dispose(){}});var a8=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},HMe=globalThis.performance&&typeof globalThis.performance.now=="function",VMe=class PV{static create(e){return new PV(e)}constructor(e){this._now=HMe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},dL;(t=>{t.None=()=>__.None;function e(gr,fr){return it(gr,()=>{},0,void 0,!0,void 0,fr)}t.defer=e;function r(gr){return(fr,Sr=null,ei)=>{let Jr=!1,ti;return ti=gr(Di=>{if(!Jr)return ti?ti.dispose():Jr=!0,fr.call(Sr,Di)},null,ei),Jr&&ti.dispose(),ti}}t.once=r;function c(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>ei.call(Jr,fr(Di)),null,ti),Sr)}t.map=c;function S(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>{fr(Di),ei.call(Jr,Di)},null,ti),Sr)}t.forEach=S;function $(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>fr(Di)&&ei.call(Jr,Di),null,ti),Sr)}t.filter=$;function Z(gr){return gr}t.signal=Z;function ue(...gr){return(fr,Sr=null,ei)=>{let Jr=MV(...gr.map(ti=>ti(Di=>fr.call(Sr,Di))));return Ne(Jr,ei)}}t.any=ue;function xe(gr,fr,Sr,ei){let Jr=Sr;return c(gr,ti=>(Jr=fr(Jr,ti),Jr),ei)}t.reduce=xe;function Se(gr,fr){let Sr,ei={onWillAddFirstListener(){Sr=gr(Jr.fire,Jr)},onDidRemoveLastListener(){Sr?.dispose()}},Jr=new kv(ei);return fr?.add(Jr),Jr.event}function Ne(gr,fr){return fr instanceof Array?fr.push(gr):fr&&fr.add(gr),gr}function it(gr,fr,Sr=100,ei=!1,Jr=!1,ti,Di){let En,Zn,ga,ya=0,ro,qn={leakWarningThreshold:ti,onWillAddFirstListener(){En=gr(nn=>{ya++,Zn=fr(Zn,nn),ei&&!ga&&(ln.fire(Zn),Zn=void 0),ro=()=>{let On=Zn;Zn=void 0,ga=void 0,(!ei||ya>1)&&ln.fire(On),ya=0},typeof Sr=="number"?(clearTimeout(ga),ga=setTimeout(ro,Sr)):ga===void 0&&(ga=0,queueMicrotask(ro))})},onWillRemoveListener(){Jr&&ya>0&&ro?.()},onDidRemoveLastListener(){ro=void 0,En.dispose()}},ln=new kv(qn);return Di?.add(ln),ln.event}t.debounce=it;function pt(gr,fr=0,Sr){return t.debounce(gr,(ei,Jr)=>ei?(ei.push(Jr),ei):[Jr],fr,void 0,!0,void 0,Sr)}t.accumulate=pt;function bt(gr,fr=(ei,Jr)=>ei===Jr,Sr){let ei=!0,Jr;return $(gr,ti=>{let Di=ei||!fr(ti,Jr);return ei=!1,Jr=ti,Di},Sr)}t.latch=bt;function wt(gr,fr,Sr){return[t.filter(gr,fr,Sr),t.filter(gr,ei=>!fr(ei),Sr)]}t.split=wt;function Dt(gr,fr=!1,Sr=[],ei){let Jr=Sr.slice(),ti=gr(Zn=>{Jr?Jr.push(Zn):En.fire(Zn)});ei&&ei.add(ti);let Di=()=>{Jr?.forEach(Zn=>En.fire(Zn)),Jr=null},En=new kv({onWillAddFirstListener(){ti||(ti=gr(Zn=>En.fire(Zn)),ei&&ei.add(ti))},onDidAddFirstListener(){Jr&&(fr?setTimeout(Di):Di())},onDidRemoveLastListener(){ti&&ti.dispose(),ti=null}});return ei&&ei.add(En),En.event}t.buffer=Dt;function Zt(gr,fr){return(Sr,ei,Jr)=>{let ti=fr(new ze);return gr(function(Di){let En=ti.evaluate(Di);En!==Mr&&Sr.call(ei,En)},void 0,Jr)}}t.chain=Zt;let Mr=Symbol("HaltChainable");class ze{constructor(){this.steps=[]}map(fr){return this.steps.push(fr),this}forEach(fr){return this.steps.push(Sr=>(fr(Sr),Sr)),this}filter(fr){return this.steps.push(Sr=>fr(Sr)?Sr:Mr),this}reduce(fr,Sr){let ei=Sr;return this.steps.push(Jr=>(ei=fr(ei,Jr),ei)),this}latch(fr=(Sr,ei)=>Sr===ei){let Sr=!0,ei;return this.steps.push(Jr=>{let ti=Sr||!fr(Jr,ei);return Sr=!1,ei=Jr,ti?Jr:Mr}),this}evaluate(fr){for(let Sr of this.steps)if(fr=Sr(fr),fr===Mr)break;return fr}}function ni(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.on(fr,ei),ti=()=>gr.removeListener(fr,ei),Di=new kv({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromNodeEventEmitter=ni;function or(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.addEventListener(fr,ei),ti=()=>gr.removeEventListener(fr,ei),Di=new kv({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromDOMEventEmitter=or;function Cr(gr){return new Promise(fr=>r(gr)(fr))}t.toPromise=Cr;function gi(gr){let fr=new kv;return gr.then(Sr=>{fr.fire(Sr)},()=>{fr.fire(void 0)}).finally(()=>{fr.dispose()}),fr.event}t.fromPromise=gi;function Si(gr,fr){return gr(Sr=>fr.fire(Sr))}t.forward=Si;function Ci(gr,fr,Sr){return fr(Sr),gr(ei=>fr(ei))}t.runAndSubscribe=Ci;class ri{constructor(fr,Sr){this._observable=fr,this._counter=0,this._hasChanged=!1;let ei={onWillAddFirstListener:()=>{fr.addObserver(this)},onDidRemoveLastListener:()=>{fr.removeObserver(this)}};this.emitter=new kv(ei),Sr&&Sr.add(this.emitter)}beginUpdate(fr){this._counter++}handlePossibleChange(fr){}handleChange(fr,Sr){this._hasChanged=!0}endUpdate(fr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function on(gr,fr){return new ri(gr,fr).emitter.event}t.fromObservable=on;function yi(gr){return(fr,Sr,ei)=>{let Jr=0,ti=!1,Di={beginUpdate(){Jr++},endUpdate(){Jr--,Jr===0&&(gr.reportChanges(),ti&&(ti=!1,fr.call(Sr)))},handlePossibleChange(){},handleChange(){ti=!0}};gr.addObserver(Di),gr.reportChanges();let En={dispose(){gr.removeObserver(Di)}};return ei instanceof fL?ei.add(En):Array.isArray(ei)&&ei.push(En),En}}t.fromObservableLight=yi})(dL||={});var Z9=class K9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${K9._idPool++}`,K9.all.add(this)}start(e){this._stopWatch=new VMe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Z9.all=new Set,Z9._idPool=0;var WMe=Z9,qMe=-1,IV=class DV{constructor(e,r,c=(DV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let $=this._stacks.get(e.value)||0;this._stacks.set(e.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let be=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new wMe(`${ue}. HINT: Stack shows most frequent listener (${be[1]}-times)`,be[0]);return(this._options?.onListenerError||aM)(Se),m_.None}if(this._disposed)return m_.None;r&&(e=e.bind(r));let S=new oM(e),H;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=xMe.create(),H=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof oM?(this._deliveryQueue??=new CMe,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=Y2(()=>{H?.(),this._removeListener(S)});return c instanceof cL?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*TMe<=r.length){let H=0;for(let Z=0;Z0}},CMe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},IV=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),AMe;(t=>{function e(r){return r===t.None||r===t.Cancelled||r instanceof MMe?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:hL.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:IV})})(AMe||={});var MMe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?IV:(this._emitter||(this._emitter=new kv),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},T2="en",sM=!1,tT,ST=T2,cN=T2,EMe,C1,Ix=globalThis,qm;typeof Ix.vscode<"u"&&typeof Ix.vscode.process<"u"?qm=Ix.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qm=process);var LMe=typeof qm?.versions?.electron=="string",PMe=LMe&&qm?.type==="renderer";if(typeof qm=="object"){qm.platform,qm.platform,sM=qm.platform==="linux",sM&&qm.env.SNAP&&qm.env.SNAP_REVISION,qm.env.CI||qm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tT=T2,ST=T2;let t=qm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);tT=e.userLocale,cN=e.osLocale,ST=e.resolvedLanguage||T2,EMe=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!PMe?(C1=navigator.userAgent,C1.indexOf("Windows")>=0,C1.indexOf("Macintosh")>=0,(C1.indexOf("Macintosh")>=0||C1.indexOf("iPad")>=0||C1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,sM=C1.indexOf("Linux")>=0,C1?.indexOf("Mobi")>=0,ST=globalThis._VSCODE_NLS_LANGUAGE||T2,tT=navigator.language.toLowerCase(),cN=tT):console.error("Unable to resolve platform.");var Bv=C1,Uy=ST,IMe;(t=>{function e(){return Uy}t.value=e;function r(){return Uy.length===2?Uy==="en":Uy.length>=3?Uy[0]==="e"&&Uy[1]==="n"&&Uy[2]==="-":!1}t.isDefaultVariant=r;function c(){return Uy==="en"}t.isDefault=c})(IMe||={});var DMe=typeof Ix.postMessage=="function"&&!Ix.importScripts;(()=>{if(DMe){let t=[];Ix.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),Ix.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var zMe=!!(Bv&&Bv.indexOf("Chrome")>=0);Bv&&Bv.indexOf("Firefox")>=0;!zMe&&Bv&&Bv.indexOf("Safari")>=0;Bv&&Bv.indexOf("Edg/")>=0;Bv&&Bv.indexOf("Android")>=0;function DV(t,e=0,r){let c=setTimeout(()=>{t()},e);return Y2(()=>{clearTimeout(c)})}var OMe;(t=>{async function e(c){let S,H=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return H}t.settled=e;function r(c){return new Promise(async(S,H)=>{try{await c(S,H)}catch(Z){H(Z)}})}t.withAsyncBody=r})(OMe||={});var hN=class hg{static fromArray(e){return new hg(r=>{r.emitMany(e)})}static fromPromise(e){return new hg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new hg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new hg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new kv,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new hg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return hg.map(this,e)}static filter(e,r){return new hg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return hg.filter(this,e)}static coalesce(e){return hg.filter(e,r=>!!r)}coalesce(){return hg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return hg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};hN.EMPTY=hN.fromArray([]);var BMe=class extends m_{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new iS),this._linesCacheDisposables=this._register(new iS),this._register(Y2(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=SV(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=DV(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,r){this._linesCache&&(this._linesCache[e]=r)}translateBufferLineToStringWithWrap(e,r){let c=[],S=[0],H=this._terminal.buffer.active.getLine(e);for(;H;){let Z=this._terminal.buffer.active.getLine(e+1),ue=Z?Z.isWrapped:!1,be=H.translateToString(!ue&&r);if(ue&&Z){let Se=H.getCell(H.length-1);Se&&Se.getCode()===0&&Se.getWidth()===1&&Z.getCell(0)?.getWidth()===2&&(be=be.slice(0,-1))}if(c.push(be),ue)S.push(S[S.length-1]+be.length);else break;e++,H=Z}return[c.join(""),S]}},RMe=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return this._lastSearchOptions?e?this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord:!1:!0}shouldUpdateHighlighting(e,r){return r?.decorations?this._cachedSearchTerm===void 0||e!==this._cachedSearchTerm||this.didOptionsChange(r):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},FMe=class{constructor(e,r){this._terminal=e,this._lineCache=r}find(e,r,c,S){if(!e||e.length===0){this._terminal.clearSelection();return}if(c>this._terminal.cols)throw new Error(`Invalid col: ${c} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let H={startRow:r,startCol:c},Z=this._findInLine(e,H,S);if(!Z)for(let ue=r+1;ue=0&&(be.startRow=Re,Se=this._findInLine(e,be,r,ue),!Se);Re--);}if(!Se&&H!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let Re=this._terminal.buffer.active.baseY+this._terminal.rows-1;Re>=H&&(be.startRow=Re,Se=this._findInLine(e,be,r,ue),!Se);Re--);return Se}_isWholeWord(e,r,c){return(e===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[e-1]))&&(e+c.length===r.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[e+c.length]))}_findInLine(e,r,c={},S=!1){let H=r.startRow,Z=r.startCol;if(this._terminal.buffer.active.getLine(H)?.isWrapped){if(S){r.startCol+=this._terminal.cols;return}return r.startRow--,r.startCol+=this._terminal.cols,this._findInLine(e,r,c)}let ue=this._lineCache.getLineFromCache(H);ue||(ue=this._lineCache.translateBufferLineToStringWithWrap(H,!0),this._lineCache.setLineInCache(H,ue));let[be,Se]=ue,Re=this._bufferColsToStringOffset(H,Z),Xe=e,vt=be;c.regex||(Xe=c.caseSensitive?e:e.toLowerCase(),vt=c.caseSensitive?be:be.toLowerCase());let bt=-1;if(c.regex){let kt=RegExp(Xe,c.caseSensitive?"g":"gi"),Dt;if(S)for(;Dt=kt.exec(vt.slice(0,Re));)bt=kt.lastIndex-Dt[0].length,e=Dt[0],kt.lastIndex-=e.length-1;else Dt=kt.exec(vt.slice(Re)),Dt&&Dt[0].length>0&&(bt=Re+(kt.lastIndex-Dt[0].length),e=Dt[0])}else S?Re-Xe.length>=0&&(bt=vt.lastIndexOf(Xe,Re-Xe.length)):bt=vt.indexOf(Xe,Re);if(bt>=0){if(c.wholeWord&&!this._isWholeWord(bt,vt,e))return;let kt=0;for(;kt=Se[kt+1];)kt++;let Dt=kt;for(;Dt=Se[Dt+1];)Dt++;let rr=bt-Se[kt],Er=bt+e.length-Se[Dt],Fe=this._stringLengthToBufferSize(H+kt,rr),wi=this._stringLengthToBufferSize(H+Dt,Er)-Fe+this._terminal.cols*(Dt-kt);return{term:e,col:Fe,row:H+kt,size:wi}}}_stringLengthToBufferSize(e,r){let c=this._terminal.buffer.active.getLine(e);if(!c)return 0;for(let S=0;S1&&(r-=Z.length-1);let ue=c.getCell(S+1);ue&&ue.getWidth()===0&&r++}return r}_bufferColsToStringOffset(e,r){let c=e,S=0,H=this._terminal.buffer.active.getLine(c);for(;r>0&&H;){for(let Z=0;Zthis.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let r of t){let c=this._createResultDecorations(r,e,!1);if(c)for(let S of c)this._storeDecoration(S,r)}}createActiveDecoration(t,e){let r=this._createResultDecorations(t,e,!0);if(r)return{decorations:r,match:t,dispose(){C5(r)}}}clearHighlightDecorations(){C5(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,r){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),r&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,r){let c=[],S=t.col,H=t.size,Z=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;H>0;){let be=Math.min(this._terminal.cols-S,H);c.push([Z,S,be]),S=0,H-=be,Z++}let ue=[];for(let be of c){let Se=this._terminal.registerMarker(be[0]),Re=this._terminal.registerDecoration({marker:Se,x:be[1],width:be[2],backgroundColor:r?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(Se.line)?void 0:{color:r?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(Re){let Xe=[];Xe.push(Se),Xe.push(Re.onRender(vt=>this._applyStyles(vt,r?e.activeMatchBorder:e.matchBorder,!1))),Xe.push(Re.onDispose(()=>C5(Xe))),ue.push(Re)}}return ue.length===0?void 0:ue}},jMe=class extends m_{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new kv)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;ethis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Y2(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=DV(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let c=this._findNextAndSelect(t,e,r);return this._fireResults(e),this._state.cachedSearchTerm=t,c}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],c,S=this._engine.find(t,0,0,e);for(;S&&(c?.row!==S.row||c?.col!==S.col)&&!(r.length>=this._highlightLimit);)c=S,r.push(c),S=this._engine.find(t,c.col+c.term.length>=this._terminal.cols?c.row+1:c.row,c.col+c.term.length>=this._terminal.cols?0:c.col+1,e);this._resultTracker.updateResults(r,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(r,e.decorations)}_findNextAndSelect(t,e,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let c=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(c,e?.decorations,r?.noScroll)}findPrevious(t,e,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let c=this._findPreviousAndSelect(t,e,r);return this._fireResults(e),this._state.cachedSearchTerm=t,c}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let c=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(c,e?.decorations,r?.noScroll)}_selectResult(t,e,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let c=this._decorationManager.createActiveDecoration(t,e);c&&(this._resultTracker.selectedDecoration=c)}if(!r&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.row{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let xe=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new YMe(`${ue}. HINT: Stack shows most frequent listener (${xe[1]}-times)`,xe[0]);return(this._options?.onListenerError||sM)(Se),__.None}if(this._disposed)return __.None;r&&(e=e.bind(r));let S=new lM(e),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=ZMe.create(),$=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof lM?(this._deliveryQueue??=new e9e,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=J2(()=>{$?.(),this._removeListener(S)});return c instanceof fL?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*JMe<=r.length){let $=0;for(let Z=0;Z0}},e9e=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},OV=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),t9e;(t=>{function e(r){return r===t.None||r===t.Cancelled||r instanceof r9e?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:dL.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:OV})})(t9e||={});var r9e=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?OV:(this._emitter||(this._emitter=new kv),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},S2="en",uM=!1,iT,AT=S2,fN=S2,i9e,S1,Ox=globalThis,qm;typeof Ox.vscode<"u"&&typeof Ox.vscode.process<"u"?qm=Ox.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(qm=process);var n9e=typeof qm?.versions?.electron=="string",a9e=n9e&&qm?.type==="renderer";if(typeof qm=="object"){qm.platform,qm.platform,uM=qm.platform==="linux",uM&&qm.env.SNAP&&qm.env.SNAP_REVISION,qm.env.CI||qm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,iT=S2,AT=S2;let t=qm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);iT=e.userLocale,fN=e.osLocale,AT=e.resolvedLanguage||S2,i9e=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!a9e?(S1=navigator.userAgent,S1.indexOf("Windows")>=0,S1.indexOf("Macintosh")>=0,(S1.indexOf("Macintosh")>=0||S1.indexOf("iPad")>=0||S1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,uM=S1.indexOf("Linux")>=0,S1?.indexOf("Mobi")>=0,AT=globalThis._VSCODE_NLS_LANGUAGE||S2,iT=navigator.language.toLowerCase(),fN=iT):console.error("Unable to resolve platform.");var Ov=S1,Hy=AT,o9e;(t=>{function e(){return Hy}t.value=e;function r(){return Hy.length===2?Hy==="en":Hy.length>=3?Hy[0]==="e"&&Hy[1]==="n"&&Hy[2]==="-":!1}t.isDefaultVariant=r;function c(){return Hy==="en"}t.isDefault=c})(o9e||={});var s9e=typeof Ox.postMessage=="function"&&!Ox.importScripts;(()=>{if(s9e){let t=[];Ox.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),Ox.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var l9e=!!(Ov&&Ov.indexOf("Chrome")>=0);Ov&&Ov.indexOf("Firefox")>=0;!l9e&&Ov&&Ov.indexOf("Safari")>=0;Ov&&Ov.indexOf("Edg/")>=0;Ov&&Ov.indexOf("Android")>=0;function BV(t,e=0,r){let c=setTimeout(()=>{t()},e);return J2(()=>{clearTimeout(c)})}var u9e;(t=>{async function e(c){let S,$=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return $}t.settled=e;function r(c){return new Promise(async(S,$)=>{try{await c(S,$)}catch(Z){$(Z)}})}t.withAsyncBody=r})(u9e||={});var dN=class fg{static fromArray(e){return new fg(r=>{r.emitMany(e)})}static fromPromise(e){return new fg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new fg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new fg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new kv,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new fg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return fg.map(this,e)}static filter(e,r){return new fg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return fg.filter(this,e)}static coalesce(e){return fg.filter(e,r=>!!r)}coalesce(){return fg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return fg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};dN.EMPTY=dN.fromArray([]);var c9e=class extends __{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new a8),this._linesCacheDisposables=this._register(new a8),this._register(J2(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=MV(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=BV(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,r){this._linesCache&&(this._linesCache[e]=r)}translateBufferLineToStringWithWrap(e,r){let c=[],S=[0],$=this._terminal.buffer.active.getLine(e);for(;$;){let Z=this._terminal.buffer.active.getLine(e+1),ue=Z?Z.isWrapped:!1,xe=$.translateToString(!ue&&r);if(ue&&Z){let Se=$.getCell($.length-1);Se&&Se.getCode()===0&&Se.getWidth()===1&&Z.getCell(0)?.getWidth()===2&&(xe=xe.slice(0,-1))}if(c.push(xe),ue)S.push(S[S.length-1]+xe.length);else break;e++,$=Z}return[c.join(""),S]}},h9e=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return this._lastSearchOptions?e?this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord:!1:!0}shouldUpdateHighlighting(e,r){return r?.decorations?this._cachedSearchTerm===void 0||e!==this._cachedSearchTerm||this.didOptionsChange(r):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},f9e=class{constructor(e,r){this._terminal=e,this._lineCache=r}find(e,r,c,S){if(!e||e.length===0){this._terminal.clearSelection();return}if(c>this._terminal.cols)throw new Error(`Invalid col: ${c} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let $={startRow:r,startCol:c},Z=this._findInLine(e,$,S);if(!Z)for(let ue=r+1;ue=0&&(xe.startRow=Ne,Se=this._findInLine(e,xe,r,ue),!Se);Ne--);}if(!Se&&$!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let Ne=this._terminal.buffer.active.baseY+this._terminal.rows-1;Ne>=$&&(xe.startRow=Ne,Se=this._findInLine(e,xe,r,ue),!Se);Ne--);return Se}_isWholeWord(e,r,c){return(e===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[e-1]))&&(e+c.length===r.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(r[e+c.length]))}_findInLine(e,r,c={},S=!1){let $=r.startRow,Z=r.startCol;if(this._terminal.buffer.active.getLine($)?.isWrapped){if(S){r.startCol+=this._terminal.cols;return}return r.startRow--,r.startCol+=this._terminal.cols,this._findInLine(e,r,c)}let ue=this._lineCache.getLineFromCache($);ue||(ue=this._lineCache.translateBufferLineToStringWithWrap($,!0),this._lineCache.setLineInCache($,ue));let[xe,Se]=ue,Ne=this._bufferColsToStringOffset($,Z),it=e,pt=xe;c.regex||(it=c.caseSensitive?e:e.toLowerCase(),pt=c.caseSensitive?xe:xe.toLowerCase());let bt=-1;if(c.regex){let wt=RegExp(it,c.caseSensitive?"g":"gi"),Dt;if(S)for(;Dt=wt.exec(pt.slice(0,Ne));)bt=wt.lastIndex-Dt[0].length,e=Dt[0],wt.lastIndex-=e.length-1;else Dt=wt.exec(pt.slice(Ne)),Dt&&Dt[0].length>0&&(bt=Ne+(wt.lastIndex-Dt[0].length),e=Dt[0])}else S?Ne-it.length>=0&&(bt=pt.lastIndexOf(it,Ne-it.length)):bt=pt.indexOf(it,Ne);if(bt>=0){if(c.wholeWord&&!this._isWholeWord(bt,pt,e))return;let wt=0;for(;wt=Se[wt+1];)wt++;let Dt=wt;for(;Dt=Se[Dt+1];)Dt++;let Zt=bt-Se[wt],Mr=bt+e.length-Se[Dt],ze=this._stringLengthToBufferSize($+wt,Zt),ni=this._stringLengthToBufferSize($+Dt,Mr)-ze+this._terminal.cols*(Dt-wt);return{term:e,col:ze,row:$+wt,size:ni}}}_stringLengthToBufferSize(e,r){let c=this._terminal.buffer.active.getLine(e);if(!c)return 0;for(let S=0;S1&&(r-=Z.length-1);let ue=c.getCell(S+1);ue&&ue.getWidth()===0&&r++}return r}_bufferColsToStringOffset(e,r){let c=e,S=0,$=this._terminal.buffer.active.getLine(c);for(;r>0&&$;){for(let Z=0;Zthis.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let r of t){let c=this._createResultDecorations(r,e,!1);if(c)for(let S of c)this._storeDecoration(S,r)}}createActiveDecoration(t,e){let r=this._createResultDecorations(t,e,!0);if(r)return{decorations:r,match:t,dispose(){M5(r)}}}clearHighlightDecorations(){M5(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,r){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),r&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,r){let c=[],S=t.col,$=t.size,Z=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;$>0;){let xe=Math.min(this._terminal.cols-S,$);c.push([Z,S,xe]),S=0,$-=xe,Z++}let ue=[];for(let xe of c){let Se=this._terminal.registerMarker(xe[0]),Ne=this._terminal.registerDecoration({marker:Se,x:xe[1],width:xe[2],backgroundColor:r?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(Se.line)?void 0:{color:r?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(Ne){let it=[];it.push(Se),it.push(Ne.onRender(pt=>this._applyStyles(pt,r?e.activeMatchBorder:e.matchBorder,!1))),it.push(Ne.onDispose(()=>M5(it))),ue.push(Ne)}}return ue.length===0?void 0:ue}},p9e=class extends __{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new kv)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;ethis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(J2(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=BV(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let c=this._findNextAndSelect(t,e,r);return this._fireResults(e),this._state.cachedSearchTerm=t,c}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],c,S=this._engine.find(t,0,0,e);for(;S&&(c?.row!==S.row||c?.col!==S.col)&&!(r.length>=this._highlightLimit);)c=S,r.push(c),S=this._engine.find(t,c.col+c.term.length>=this._terminal.cols?c.row+1:c.row,c.col+c.term.length>=this._terminal.cols?0:c.col+1,e);this._resultTracker.updateResults(r,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(r,e.decorations)}_findNextAndSelect(t,e,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let c=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(c,e?.decorations,r?.noScroll)}findPrevious(t,e,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let c=this._findPreviousAndSelect(t,e,r);return this._fireResults(e),this._state.cachedSearchTerm=t,c}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let c=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(c,e?.decorations,r?.noScroll)}_selectResult(t,e,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let c=this._decorationManager.createActiveDecoration(t,e);c&&(this._resultTracker.selectedDecoration=c)}if(!r&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.rowe[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,r){let c=this.wcwidth(e),S=c===0&&r!==0;if(S){let H=aS.extractWidth(r);H===0?S=!1:H>c&&(c=H)}return aS.createPropertyValue(0,c,S)}},WMe=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?fN.isErrorNoTelemetry(t)?new fN(t.message+` + */var cM=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],g9e=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Ip;function v9e(t,e){let r=0,c=e.length-1,S;if(te[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,r){let c=this.wcwidth(e),S=c===0&&r!==0;if(S){let $=s8.extractWidth(r);$===0?S=!1:$>c&&(c=$)}return s8.createPropertyValue(0,c,S)}},_9e=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?pN.isErrorNoTelemetry(t)?new pN(t.message+` `+t.stack):new Error(t.message+` -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},qMe=new WMe;function uM(t){GMe(t)||qMe.onUnexpectedError(t)}var Z9="Canceled";function GMe(t){return t instanceof ZMe?!0:t instanceof Error&&t.name===Z9&&t.message===Z9}var ZMe=class extends Error{constructor(){super(Z9),this.name=this.message}},fN=class K9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof K9)return e;let r=new K9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function KMe(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var YMe;(t=>{function e(H){return H<0}t.isLessThan=e;function r(H){return H<=0}t.isLessThanOrEqual=r;function c(H){return H>0}t.isGreaterThan=c;function S(H){return H===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(YMe||={});var zV;(t=>{function e(ur){return ur&&typeof ur=="object"&&typeof ur[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(ur){yield ur}t.single=S;function H(ur){return e(ur)?ur:S(ur)}t.wrap=H;function Z(ur){return ur||r}t.from=Z;function*ue(ur){for(let Ir=ur.length-1;Ir>=0;Ir--)yield ur[Ir]}t.reverse=ue;function be(ur){return!ur||ur[Symbol.iterator]().next().done===!0}t.isEmpty=be;function Se(ur){return ur[Symbol.iterator]().next().value}t.first=Se;function Re(ur,Ir){let Ti=0;for(let _i of ur)if(Ir(_i,Ti++))return!0;return!1}t.some=Re;function Xe(ur,Ir){for(let Ti of ur)if(Ir(Ti))return Ti}t.find=Xe;function*vt(ur,Ir){for(let Ti of ur)Ir(Ti)&&(yield Ti)}t.filter=vt;function*bt(ur,Ir){let Ti=0;for(let _i of ur)yield Ir(_i,Ti++)}t.map=bt;function*kt(ur,Ir){let Ti=0;for(let _i of ur)yield*Ir(_i,Ti++)}t.flatMap=kt;function*Dt(...ur){for(let Ir of ur)yield*Ir}t.concat=Dt;function rr(ur,Ir,Ti){let _i=Ti;for(let Ci of ur)_i=Ir(_i,Ci);return _i}t.reduce=rr;function*Er(ur,Ir,Ti=ur.length){for(Ir<0&&(Ir+=ur.length),Ti<0?Ti+=ur.length:Ti>ur.length&&(Ti=ur.length);Ir1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function XMe(...t){return BV(()=>OV(t))}function BV(t){return{dispose:KMe(()=>{t()})}}var RV=class FV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{OV(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?FV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};RV.DISABLE_DISPOSED_WARNING=!1;var fL=RV,nS=class{constructor(){this._store=new fL,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};nS.None=Object.freeze({dispose(){}});var JMe=globalThis.performance&&typeof globalThis.performance.now=="function",QMe=class NV{static create(e){return new NV(e)}constructor(e){this._now=JMe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},e9e;(t=>{t.None=()=>nS.None;function e(vr,dr){return Xe(vr,()=>{},0,void 0,!0,void 0,dr)}t.defer=e;function r(vr){return(dr,Ar=null,ti)=>{let Xr=!1,ei;return ei=vr(Di=>{if(!Xr)return ei?ei.dispose():Xr=!0,dr.call(Ar,Di)},null,ti),Xr&&ei.dispose(),ei}}t.once=r;function c(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>ti.call(Xr,dr(Di)),null,ei),Ar)}t.map=c;function S(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>{dr(Di),ti.call(Xr,Di)},null,ei),Ar)}t.forEach=S;function H(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>dr(Di)&&ti.call(Xr,Di),null,ei),Ar)}t.filter=H;function Z(vr){return vr}t.signal=Z;function ue(...vr){return(dr,Ar=null,ti)=>{let Xr=XMe(...vr.map(ei=>ei(Di=>dr.call(Ar,Di))));return Re(Xr,ti)}}t.any=ue;function be(vr,dr,Ar,ti){let Xr=Ar;return c(vr,ei=>(Xr=dr(Xr,ei),Xr),ti)}t.reduce=be;function Se(vr,dr){let Ar,ti={onWillAddFirstListener(){Ar=vr(Xr.fire,Xr)},onDidRemoveLastListener(){Ar?.dispose()}},Xr=new qy(ti);return dr?.add(Xr),Xr.event}function Re(vr,dr){return dr instanceof Array?dr.push(vr):dr&&dr.add(vr),vr}function Xe(vr,dr,Ar=100,ti=!1,Xr=!1,ei,Di){let qn,Qn,ka,Ta=0,so,Yn={leakWarningThreshold:ei,onWillAddFirstListener(){qn=vr(an=>{Ta++,Qn=dr(Qn,an),ti&&!ka&&(sn.fire(Qn),Qn=void 0),so=()=>{let zn=Qn;Qn=void 0,ka=void 0,(!ti||Ta>1)&&sn.fire(zn),Ta=0},typeof Ar=="number"?(clearTimeout(ka),ka=setTimeout(so,Ar)):ka===void 0&&(ka=0,queueMicrotask(so))})},onWillRemoveListener(){Xr&&Ta>0&&so?.()},onDidRemoveLastListener(){so=void 0,qn.dispose()}},sn=new qy(Yn);return Di?.add(sn),sn.event}t.debounce=Xe;function vt(vr,dr=0,Ar){return t.debounce(vr,(ti,Xr)=>ti?(ti.push(Xr),ti):[Xr],dr,void 0,!0,void 0,Ar)}t.accumulate=vt;function bt(vr,dr=(ti,Xr)=>ti===Xr,Ar){let ti=!0,Xr;return H(vr,ei=>{let Di=ti||!dr(ei,Xr);return ti=!1,Xr=ei,Di},Ar)}t.latch=bt;function kt(vr,dr,Ar){return[t.filter(vr,dr,Ar),t.filter(vr,ti=>!dr(ti),Ar)]}t.split=kt;function Dt(vr,dr=!1,Ar=[],ti){let Xr=Ar.slice(),ei=vr(Qn=>{Xr?Xr.push(Qn):qn.fire(Qn)});ti&&ti.add(ei);let Di=()=>{Xr?.forEach(Qn=>qn.fire(Qn)),Xr=null},qn=new qy({onWillAddFirstListener(){ei||(ei=vr(Qn=>qn.fire(Qn)),ti&&ti.add(ei))},onDidAddFirstListener(){Xr&&(dr?setTimeout(Di):Di())},onDidRemoveLastListener(){ei&&ei.dispose(),ei=null}});return ti&&ti.add(qn),qn.event}t.buffer=Dt;function rr(vr,dr){return(Ar,ti,Xr)=>{let ei=dr(new Fe);return vr(function(Di){let qn=ei.evaluate(Di);qn!==Er&&Ar.call(ti,qn)},void 0,Xr)}}t.chain=rr;let Er=Symbol("HaltChainable");class Fe{constructor(){this.steps=[]}map(dr){return this.steps.push(dr),this}forEach(dr){return this.steps.push(Ar=>(dr(Ar),Ar)),this}filter(dr){return this.steps.push(Ar=>dr(Ar)?Ar:Er),this}reduce(dr,Ar){let ti=Ar;return this.steps.push(Xr=>(ti=dr(ti,Xr),ti)),this}latch(dr=(Ar,ti)=>Ar===ti){let Ar=!0,ti;return this.steps.push(Xr=>{let ei=Ar||!dr(Xr,ti);return Ar=!1,ti=Xr,ei?Xr:Er}),this}evaluate(dr){for(let Ar of this.steps)if(dr=Ar(dr),dr===Er)break;return dr}}function wi(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.on(dr,ti),ei=()=>vr.removeListener(dr,ti),Di=new qy({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromNodeEventEmitter=wi;function ur(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.addEventListener(dr,ti),ei=()=>vr.removeEventListener(dr,ti),Di=new qy({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromDOMEventEmitter=ur;function Ir(vr){return new Promise(dr=>r(vr)(dr))}t.toPromise=Ir;function Ti(vr){let dr=new qy;return vr.then(Ar=>{dr.fire(Ar)},()=>{dr.fire(void 0)}).finally(()=>{dr.dispose()}),dr.event}t.fromPromise=Ti;function _i(vr,dr){return vr(Ar=>dr.fire(Ar))}t.forward=_i;function Ci(vr,dr,Ar){return dr(Ar),vr(ti=>dr(ti))}t.runAndSubscribe=Ci;class ii{constructor(dr,Ar){this._observable=dr,this._counter=0,this._hasChanged=!1;let ti={onWillAddFirstListener:()=>{dr.addObserver(this)},onDidRemoveLastListener:()=>{dr.removeObserver(this)}};this.emitter=new qy(ti),Ar&&Ar.add(this.emitter)}beginUpdate(dr){this._counter++}handlePossibleChange(dr){}handleChange(dr,Ar){this._hasChanged=!0}endUpdate(dr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ji(vr,dr){return new ii(vr,dr).emitter.event}t.fromObservable=Ji;function vi(vr){return(dr,Ar,ti)=>{let Xr=0,ei=!1,Di={beginUpdate(){Xr++},endUpdate(){Xr--,Xr===0&&(vr.reportChanges(),ei&&(ei=!1,dr.call(Ar)))},handlePossibleChange(){},handleChange(){ei=!0}};vr.addObserver(Di),vr.reportChanges();let qn={dispose(){vr.removeObserver(Di)}};return ti instanceof fL?ti.add(qn):Array.isArray(ti)&&ti.push(qn),qn}}t.fromObservableLight=vi})(e9e||={});var Y9=class X9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${X9._idPool++}`,X9.all.add(this)}start(e){this._stopWatch=new QMe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Y9.all=new Set,Y9._idPool=0;var t9e=Y9,r9e=-1,jV=class UV{constructor(e,r,c=(UV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let H=this._stacks.get(e.value)||0;this._stacks.set(e.value,H-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},x9e=new _9e;function hM(t){b9e(t)||x9e.onUnexpectedError(t)}var Y9="Canceled";function b9e(t){return t instanceof w9e?!0:t instanceof Error&&t.name===Y9&&t.message===Y9}var w9e=class extends Error{constructor(){super(Y9),this.name=this.message}},pN=class X9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof X9)return e;let r=new X9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function k9e(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var T9e;(t=>{function e($){return $<0}t.isLessThan=e;function r($){return $<=0}t.isLessThanOrEqual=r;function c($){return $>0}t.isGreaterThan=c;function S($){return $===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(T9e||={});var RV;(t=>{function e(or){return or&&typeof or=="object"&&typeof or[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(or){yield or}t.single=S;function $(or){return e(or)?or:S(or)}t.wrap=$;function Z(or){return or||r}t.from=Z;function*ue(or){for(let Cr=or.length-1;Cr>=0;Cr--)yield or[Cr]}t.reverse=ue;function xe(or){return!or||or[Symbol.iterator]().next().done===!0}t.isEmpty=xe;function Se(or){return or[Symbol.iterator]().next().value}t.first=Se;function Ne(or,Cr){let gi=0;for(let Si of or)if(Cr(Si,gi++))return!0;return!1}t.some=Ne;function it(or,Cr){for(let gi of or)if(Cr(gi))return gi}t.find=it;function*pt(or,Cr){for(let gi of or)Cr(gi)&&(yield gi)}t.filter=pt;function*bt(or,Cr){let gi=0;for(let Si of or)yield Cr(Si,gi++)}t.map=bt;function*wt(or,Cr){let gi=0;for(let Si of or)yield*Cr(Si,gi++)}t.flatMap=wt;function*Dt(...or){for(let Cr of or)yield*Cr}t.concat=Dt;function Zt(or,Cr,gi){let Si=gi;for(let Ci of or)Si=Cr(Si,Ci);return Si}t.reduce=Zt;function*Mr(or,Cr,gi=or.length){for(Cr<0&&(Cr+=or.length),gi<0?gi+=or.length:gi>or.length&&(gi=or.length);Cr1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function S9e(...t){return NV(()=>FV(t))}function NV(t){return{dispose:k9e(()=>{t()})}}var jV=class UV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{FV(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?UV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};jV.DISABLE_DISPOSED_WARNING=!1;var pL=jV,o8=class{constructor(){this._store=new pL,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};o8.None=Object.freeze({dispose(){}});var C9e=globalThis.performance&&typeof globalThis.performance.now=="function",A9e=class $V{static create(e){return new $V(e)}constructor(e){this._now=C9e&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},M9e;(t=>{t.None=()=>o8.None;function e(gr,fr){return it(gr,()=>{},0,void 0,!0,void 0,fr)}t.defer=e;function r(gr){return(fr,Sr=null,ei)=>{let Jr=!1,ti;return ti=gr(Di=>{if(!Jr)return ti?ti.dispose():Jr=!0,fr.call(Sr,Di)},null,ei),Jr&&ti.dispose(),ti}}t.once=r;function c(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>ei.call(Jr,fr(Di)),null,ti),Sr)}t.map=c;function S(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>{fr(Di),ei.call(Jr,Di)},null,ti),Sr)}t.forEach=S;function $(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>fr(Di)&&ei.call(Jr,Di),null,ti),Sr)}t.filter=$;function Z(gr){return gr}t.signal=Z;function ue(...gr){return(fr,Sr=null,ei)=>{let Jr=S9e(...gr.map(ti=>ti(Di=>fr.call(Sr,Di))));return Ne(Jr,ei)}}t.any=ue;function xe(gr,fr,Sr,ei){let Jr=Sr;return c(gr,ti=>(Jr=fr(Jr,ti),Jr),ei)}t.reduce=xe;function Se(gr,fr){let Sr,ei={onWillAddFirstListener(){Sr=gr(Jr.fire,Jr)},onDidRemoveLastListener(){Sr?.dispose()}},Jr=new Ky(ei);return fr?.add(Jr),Jr.event}function Ne(gr,fr){return fr instanceof Array?fr.push(gr):fr&&fr.add(gr),gr}function it(gr,fr,Sr=100,ei=!1,Jr=!1,ti,Di){let En,Zn,ga,ya=0,ro,qn={leakWarningThreshold:ti,onWillAddFirstListener(){En=gr(nn=>{ya++,Zn=fr(Zn,nn),ei&&!ga&&(ln.fire(Zn),Zn=void 0),ro=()=>{let On=Zn;Zn=void 0,ga=void 0,(!ei||ya>1)&&ln.fire(On),ya=0},typeof Sr=="number"?(clearTimeout(ga),ga=setTimeout(ro,Sr)):ga===void 0&&(ga=0,queueMicrotask(ro))})},onWillRemoveListener(){Jr&&ya>0&&ro?.()},onDidRemoveLastListener(){ro=void 0,En.dispose()}},ln=new Ky(qn);return Di?.add(ln),ln.event}t.debounce=it;function pt(gr,fr=0,Sr){return t.debounce(gr,(ei,Jr)=>ei?(ei.push(Jr),ei):[Jr],fr,void 0,!0,void 0,Sr)}t.accumulate=pt;function bt(gr,fr=(ei,Jr)=>ei===Jr,Sr){let ei=!0,Jr;return $(gr,ti=>{let Di=ei||!fr(ti,Jr);return ei=!1,Jr=ti,Di},Sr)}t.latch=bt;function wt(gr,fr,Sr){return[t.filter(gr,fr,Sr),t.filter(gr,ei=>!fr(ei),Sr)]}t.split=wt;function Dt(gr,fr=!1,Sr=[],ei){let Jr=Sr.slice(),ti=gr(Zn=>{Jr?Jr.push(Zn):En.fire(Zn)});ei&&ei.add(ti);let Di=()=>{Jr?.forEach(Zn=>En.fire(Zn)),Jr=null},En=new Ky({onWillAddFirstListener(){ti||(ti=gr(Zn=>En.fire(Zn)),ei&&ei.add(ti))},onDidAddFirstListener(){Jr&&(fr?setTimeout(Di):Di())},onDidRemoveLastListener(){ti&&ti.dispose(),ti=null}});return ei&&ei.add(En),En.event}t.buffer=Dt;function Zt(gr,fr){return(Sr,ei,Jr)=>{let ti=fr(new ze);return gr(function(Di){let En=ti.evaluate(Di);En!==Mr&&Sr.call(ei,En)},void 0,Jr)}}t.chain=Zt;let Mr=Symbol("HaltChainable");class ze{constructor(){this.steps=[]}map(fr){return this.steps.push(fr),this}forEach(fr){return this.steps.push(Sr=>(fr(Sr),Sr)),this}filter(fr){return this.steps.push(Sr=>fr(Sr)?Sr:Mr),this}reduce(fr,Sr){let ei=Sr;return this.steps.push(Jr=>(ei=fr(ei,Jr),ei)),this}latch(fr=(Sr,ei)=>Sr===ei){let Sr=!0,ei;return this.steps.push(Jr=>{let ti=Sr||!fr(Jr,ei);return Sr=!1,ei=Jr,ti?Jr:Mr}),this}evaluate(fr){for(let Sr of this.steps)if(fr=Sr(fr),fr===Mr)break;return fr}}function ni(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.on(fr,ei),ti=()=>gr.removeListener(fr,ei),Di=new Ky({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromNodeEventEmitter=ni;function or(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.addEventListener(fr,ei),ti=()=>gr.removeEventListener(fr,ei),Di=new Ky({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromDOMEventEmitter=or;function Cr(gr){return new Promise(fr=>r(gr)(fr))}t.toPromise=Cr;function gi(gr){let fr=new Ky;return gr.then(Sr=>{fr.fire(Sr)},()=>{fr.fire(void 0)}).finally(()=>{fr.dispose()}),fr.event}t.fromPromise=gi;function Si(gr,fr){return gr(Sr=>fr.fire(Sr))}t.forward=Si;function Ci(gr,fr,Sr){return fr(Sr),gr(ei=>fr(ei))}t.runAndSubscribe=Ci;class ri{constructor(fr,Sr){this._observable=fr,this._counter=0,this._hasChanged=!1;let ei={onWillAddFirstListener:()=>{fr.addObserver(this)},onDidRemoveLastListener:()=>{fr.removeObserver(this)}};this.emitter=new Ky(ei),Sr&&Sr.add(this.emitter)}beginUpdate(fr){this._counter++}handlePossibleChange(fr){}handleChange(fr,Sr){this._hasChanged=!0}endUpdate(fr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function on(gr,fr){return new ri(gr,fr).emitter.event}t.fromObservable=on;function yi(gr){return(fr,Sr,ei)=>{let Jr=0,ti=!1,Di={beginUpdate(){Jr++},endUpdate(){Jr--,Jr===0&&(gr.reportChanges(),ti&&(ti=!1,fr.call(Sr)))},handlePossibleChange(){},handleChange(){ti=!0}};gr.addObserver(Di),gr.reportChanges();let En={dispose(){gr.removeObserver(Di)}};return ei instanceof pL?ei.add(En):Array.isArray(ei)&&ei.push(En),En}}t.fromObservableLight=yi})(M9e||={});var J9=class Q9{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Q9._idPool++}`,Q9.all.add(this)}start(e){this._stopWatch=new A9e,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};J9.all=new Set,J9._idPool=0;var E9e=J9,L9e=-1,HV=class VV{constructor(e,r,c=(VV._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let $=this._stacks.get(e.value)||0;this._stacks.set(e.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let be=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new o9e(`${ue}. HINT: Stack shows most frequent listener (${be[1]}-times)`,be[0]);return(this._options?.onListenerError||uM)(Se),nS.None}if(this._disposed)return nS.None;r&&(e=e.bind(r));let S=new cM(e),H;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=n9e.create(),H=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof cM?(this._deliveryQueue??=new c9e,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=BV(()=>{H?.(),this._removeListener(S)});return c instanceof fL?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*l9e<=r.length){let H=0;for(let Z=0;Z0}},c9e=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},aS=class CT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new qy,this.onChange=this._onChange.event;let e=new VMe;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,r,c=!1){return(e&16777215)<<3|(r&3)<<1|(c?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let r=0,c=0,S=e.length;for(let H=0;H=S)return r+this.wcwidth(Z);let Se=e.charCodeAt(H);56320<=Se&&Se<=57343?Z=(Z-55296)*1024+Se-56320+65536:r+=this.wcwidth(Se)}let ue=this.charProperties(Z,c),be=CT.extractWidth(ue);CT.extractShouldJoin(ue)&&(be-=CT.extractWidth(c)),r+=be,c=ue}return r}charProperties(e,r){return this._activeProvider.charProperties(e,r)}},hM=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],h9e=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],fM=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],f9e=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],_1;function dN(t,e){let r=0,c=e.length-1,S;if(te[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(tr&&(r=S)}return aS.createPropertyValue(0,r,c)}},p9e=class{activate(t){t.unicode.register(new d9e)}dispose(){}};/** +`))}},D9e=class extends Error{constructor(e,r){super(e),this.name="ListenerLeakError",this.stack=r}},z9e=class extends Error{constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},O9e=0,fM=class{constructor(t){this.value=t,this.id=O9e++}},B9e=2,R9e,Ky=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new P9e(e?.onListenerError??hM,this._options?.leakWarningThreshold??L9e):void 0,this._perfMon=this._options?._profName?new E9e(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,r,c)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let ue=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(ue);let xe=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],Se=new z9e(`${ue}. HINT: Stack shows most frequent listener (${xe[1]}-times)`,xe[0]);return(this._options?.onListenerError||hM)(Se),o8.None}if(this._disposed)return o8.None;r&&(e=e.bind(r));let S=new fM(e),$;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(S.stack=I9e.create(),$=this._leakageMon.check(S.stack,this._size+1)),this._listeners?this._listeners instanceof fM?(this._deliveryQueue??=new F9e,this._listeners=[this._listeners,S]):this._listeners.push(S):(this._options?.onWillAddFirstListener?.(this),this._listeners=S,this._options?.onDidAddFirstListener?.(this)),this._size++;let Z=NV(()=>{$?.(),this._removeListener(S)});return c instanceof pL?c.add(Z):Array.isArray(c)&&c.push(Z),Z},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let r=this._listeners,c=r.indexOf(e);if(c===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[c]=void 0;let S=this._deliveryQueue.current===this;if(this._size*B9e<=r.length){let $=0;for(let Z=0;Z0}},F9e=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},s8=class MT{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ky,this.onChange=this._onChange.event;let e=new y9e;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,r,c=!1){return(e&16777215)<<3|(r&3)<<1|(c?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let r=0,c=0,S=e.length;for(let $=0;$=S)return r+this.wcwidth(Z);let Se=e.charCodeAt($);56320<=Se&&Se<=57343?Z=(Z-55296)*1024+Se-56320+65536:r+=this.wcwidth(Se)}let ue=this.charProperties(Z,c),xe=MT.extractWidth(ue);MT.extractShouldJoin(ue)&&(xe-=MT.extractWidth(c)),r+=xe,c=ue}return r}charProperties(e,r){return this._activeProvider.charProperties(e,r)}},dM=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],N9e=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],pM=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],j9e=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],y1;function mN(t,e){let r=0,c=e.length-1,S;if(te[c][1])return!1;for(;c>=r;)if(S=r+c>>1,t>e[S][1])r=S+1;else if(tr&&(r=S)}return s8.createPropertyValue(0,r,c)}},$9e=class{activate(t){t.unicode.register(new U9e)}dispose(){}};/** * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. * @license MIT * @@ -4081,13 +4081,13 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard - */var m9e=(t,e,r,c)=>{for(var S=e,H=t.length-1,Z;H>=0;H--)(Z=t[H])&&(S=Z(S)||S);return S},g9e=(t,e)=>(r,c)=>e(r,c,t),v9e=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?pN.isErrorNoTelemetry(t)?new pN(t.message+` + */var H9e=(t,e,r,c)=>{for(var S=e,$=t.length-1,Z;$>=0;$--)(Z=t[$])&&(S=Z(S)||S);return S},V9e=(t,e)=>(r,c)=>e(r,c,t),W9e=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?gN.isErrorNoTelemetry(t)?new gN(t.message+` `+t.stack):new Error(t.message+` -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},y9e=new v9e;function dM(t){_9e(t)||y9e.onUnexpectedError(t)}var J9="Canceled";function _9e(t){return t instanceof x9e?!0:t instanceof Error&&t.name===J9&&t.message===J9}var x9e=class extends Error{constructor(){super(J9),this.name=this.message}},pN=class Q9 extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Q9)return e;let r=new Q9;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},b9e;(t=>{function e(H){return H<0}t.isLessThan=e;function r(H){return H<=0}t.isLessThanOrEqual=r;function c(H){return H>0}t.isGreaterThan=c;function S(H){return H===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(b9e||={});function w9e(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var HV;(t=>{function e(ur){return ur&&typeof ur=="object"&&typeof ur[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(ur){yield ur}t.single=S;function H(ur){return e(ur)?ur:S(ur)}t.wrap=H;function Z(ur){return ur||r}t.from=Z;function*ue(ur){for(let Ir=ur.length-1;Ir>=0;Ir--)yield ur[Ir]}t.reverse=ue;function be(ur){return!ur||ur[Symbol.iterator]().next().done===!0}t.isEmpty=be;function Se(ur){return ur[Symbol.iterator]().next().value}t.first=Se;function Re(ur,Ir){let Ti=0;for(let _i of ur)if(Ir(_i,Ti++))return!0;return!1}t.some=Re;function Xe(ur,Ir){for(let Ti of ur)if(Ir(Ti))return Ti}t.find=Xe;function*vt(ur,Ir){for(let Ti of ur)Ir(Ti)&&(yield Ti)}t.filter=vt;function*bt(ur,Ir){let Ti=0;for(let _i of ur)yield Ir(_i,Ti++)}t.map=bt;function*kt(ur,Ir){let Ti=0;for(let _i of ur)yield*Ir(_i,Ti++)}t.flatMap=kt;function*Dt(...ur){for(let Ir of ur)yield*Ir}t.concat=Dt;function rr(ur,Ir,Ti){let _i=Ti;for(let Ci of ur)_i=Ir(_i,Ci);return _i}t.reduce=rr;function*Er(ur,Ir,Ti=ur.length){for(Ir<0&&(Ir+=ur.length),Ti<0?Ti+=ur.length:Ti>ur.length&&(Ti=ur.length);Ir1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function WV(...t){return j0(()=>VV(t))}function j0(t){return{dispose:w9e(()=>{t()})}}var qV=class GV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{VV(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?GV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};qV.DISABLE_DISPOSED_WARNING=!1;var D2=qV,Ug=class{constructor(){this._store=new D2,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Ug.None=Object.freeze({dispose(){}});var Z3=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},dL=typeof process<"u"&&"title"in process,WS=dL?"node":navigator.userAgent,k9e=dL?"node":navigator.platform,T9e=WS.includes("Firefox"),S9e=WS.includes("Edge"),ZV=/^((?!chrome|android).)*safari/i.test(WS);function C9e(){if(!ZV)return 0;let t=WS.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}k9e.indexOf("Linux")>=0;var A9e="",r0=0,i0=0,n0=0,Ud=0,fg={css:"#00000000",rgba:0},am;(t=>{function e(S,H,Z,ue){return ue!==void 0?`#${hx(S)}${hx(H)}${hx(Z)}${hx(ue)}`:`#${hx(S)}${hx(H)}${hx(Z)}`}t.toCss=e;function r(S,H,Z,ue=255){return(S<<24|H<<16|Z<<8|ue)>>>0}t.toRgba=r;function c(S,H,Z,ue){return{css:t.toCss(S,H,Z,ue),rgba:t.toRgba(S,H,Z,ue)}}t.toColor=c})(am||={});var u5;(t=>{function e(be,Se){if(Ud=(Se.rgba&255)/255,Ud===1)return{css:Se.css,rgba:Se.rgba};let Re=Se.rgba>>24&255,Xe=Se.rgba>>16&255,vt=Se.rgba>>8&255,bt=be.rgba>>24&255,kt=be.rgba>>16&255,Dt=be.rgba>>8&255;r0=bt+Math.round((Re-bt)*Ud),i0=kt+Math.round((Xe-kt)*Ud),n0=Dt+Math.round((vt-Dt)*Ud);let rr=am.toCss(r0,i0,n0),Er=am.toRgba(r0,i0,n0);return{css:rr,rgba:Er}}t.blend=e;function r(be){return(be.rgba&255)===255}t.isOpaque=r;function c(be,Se,Re){let Xe=Dx.ensureContrastRatio(be.rgba,Se.rgba,Re);if(Xe)return am.toColor(Xe>>24&255,Xe>>16&255,Xe>>8&255)}t.ensureContrastRatio=c;function S(be){let Se=(be.rgba|255)>>>0;return[r0,i0,n0]=Dx.toChannels(Se),{css:am.toCss(r0,i0,n0),rgba:Se}}t.opaque=S;function H(be,Se){return Ud=Math.round(Se*255),[r0,i0,n0]=Dx.toChannels(be.rgba),{css:am.toCss(r0,i0,n0,Ud),rgba:am.toRgba(r0,i0,n0,Ud)}}t.opacity=H;function Z(be,Se){return Ud=be.rgba&255,H(be,Ud*Se/255)}t.multiplyOpacity=Z;function ue(be){return[be.rgba>>24&255,be.rgba>>16&255,be.rgba>>8&255]}t.toColorRGB=ue})(u5||={});var M9e;(t=>{let e,r;try{let S=document.createElement("canvas");S.width=1,S.height=1;let H=S.getContext("2d",{willReadFrequently:!0});H&&(e=H,e.globalCompositeOperation="copy",r=e.createLinearGradient(0,0,1,1))}catch{}function c(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return r0=parseInt(S.slice(1,2).repeat(2),16),i0=parseInt(S.slice(2,3).repeat(2),16),n0=parseInt(S.slice(3,4).repeat(2),16),am.toColor(r0,i0,n0);case 5:return r0=parseInt(S.slice(1,2).repeat(2),16),i0=parseInt(S.slice(2,3).repeat(2),16),n0=parseInt(S.slice(3,4).repeat(2),16),Ud=parseInt(S.slice(4,5).repeat(2),16),am.toColor(r0,i0,n0,Ud);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}let H=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(H)return r0=parseInt(H[1]),i0=parseInt(H[2]),n0=parseInt(H[3]),Ud=Math.round((H[5]===void 0?1:parseFloat(H[5]))*255),am.toColor(r0,i0,n0,Ud);if(!e||!r)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=r,e.fillStyle=S,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[r0,i0,n0,Ud]=e.getImageData(0,0,1,1).data,Ud!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:am.toRgba(r0,i0,n0,Ud),css:S}}t.toColor=c})(M9e||={});var tm;(t=>{function e(c){return r(c>>16&255,c>>8&255,c&255)}t.relativeLuminance=e;function r(c,S,H){let Z=c/255,ue=S/255,be=H/255,Se=Z<=.03928?Z/12.92:Math.pow((Z+.055)/1.055,2.4),Re=ue<=.03928?ue/12.92:Math.pow((ue+.055)/1.055,2.4),Xe=be<=.03928?be/12.92:Math.pow((be+.055)/1.055,2.4);return Se*.2126+Re*.7152+Xe*.0722}t.relativeLuminance2=r})(tm||={});var Dx;(t=>{function e(Z,ue){if(Ud=(ue&255)/255,Ud===1)return ue;let be=ue>>24&255,Se=ue>>16&255,Re=ue>>8&255,Xe=Z>>24&255,vt=Z>>16&255,bt=Z>>8&255;return r0=Xe+Math.round((be-Xe)*Ud),i0=vt+Math.round((Se-vt)*Ud),n0=bt+Math.round((Re-bt)*Ud),am.toRgba(r0,i0,n0)}t.blend=e;function r(Z,ue,be){let Se=tm.relativeLuminance(Z>>8),Re=tm.relativeLuminance(ue>>8);if(x1(Se,Re)>8));if(kt>8));return kt>rr?bt:Dt}return bt}let Xe=S(Z,ue,be),vt=x1(Se,tm.relativeLuminance(Xe>>8));if(vt>8));return vt>kt?Xe:bt}return Xe}}t.ensureContrastRatio=r;function c(Z,ue,be){let Se=Z>>24&255,Re=Z>>16&255,Xe=Z>>8&255,vt=ue>>24&255,bt=ue>>16&255,kt=ue>>8&255,Dt=x1(tm.relativeLuminance2(vt,bt,kt),tm.relativeLuminance2(Se,Re,Xe));for(;Dt0||bt>0||kt>0);)vt-=Math.max(0,Math.ceil(vt*.1)),bt-=Math.max(0,Math.ceil(bt*.1)),kt-=Math.max(0,Math.ceil(kt*.1)),Dt=x1(tm.relativeLuminance2(vt,bt,kt),tm.relativeLuminance2(Se,Re,Xe));return(vt<<24|bt<<16|kt<<8|255)>>>0}t.reduceLuminance=c;function S(Z,ue,be){let Se=Z>>24&255,Re=Z>>16&255,Xe=Z>>8&255,vt=ue>>24&255,bt=ue>>16&255,kt=ue>>8&255,Dt=x1(tm.relativeLuminance2(vt,bt,kt),tm.relativeLuminance2(Se,Re,Xe));for(;Dt>>0}t.increaseLuminance=S;function H(Z){return[Z>>24&255,Z>>16&255,Z>>8&255,Z&255]}t.toChannels=H})(Dx||={});function hx(t){let e=t.toString(16);return e.length<2?"0"+e:e}function x1(t,e){return t=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function D9e(t,e,r,c){return e===1&&r>Math.ceil(c*1.5)&&t!==void 0&&t>255&&!I9e(t)&&!pL(t)&&!L9e(t)}function KV(t){return pL(t)||P9e(t)}function z9e(){return{css:{canvas:rT(),cell:rT()},device:{canvas:rT(),cell:rT(),char:{width:0,height:0,left:0,top:0}}}}function rT(){return{width:0,height:0}}function O9e(t,e,r=0){return(t-(Math.round(e)*2-r))%(Math.round(e)*2)}var v0=0,Xp=0,vv=!1,b1=!1,iT=!1,km,pM=0,B9e=class{constructor(t,e,r,c,S,H){this._terminal=t,this._optionService=e,this._selectionRenderModel=r,this._decorationService=c,this._coreBrowserService=S,this._themeService=H,this.result={fg:0,bg:0,ext:0}}resolve(t,e,r,c){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Xp=0,v0=0,b1=!1,vv=!1,iT=!1,km=this._themeService.colors,pM=0,t.getCode()!==0&&t.extended.underlineStyle===4){let S=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));pM=e*c%(Math.round(S)*2)}if(this._decorationService.forEachDecorationAtCell(e,r,"bottom",S=>{S.backgroundColorRGB&&(Xp=S.backgroundColorRGB.rgba>>8&16777215,b1=!0),S.foregroundColorRGB&&(v0=S.foregroundColorRGB.rgba>>8&16777215,vv=!0)}),iT=this._selectionRenderModel.isCellSelected(this._terminal,e,r),iT){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Xp=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xp=(this.result.fg&16777215)<<8|255;break;case 0:default:Xp=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Xp=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xp=(this.result.bg&16777215)<<8|255;break}Xp=Dx.blend(Xp,(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Xp=(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(b1=!0,km.selectionForeground&&(v0=km.selectionForeground.rgba>>8&16777215,vv=!0),KV(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)v0=(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:v0=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:v0=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:v0=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:v0=(this.result.fg&16777215)<<8|255;break;case 0:default:v0=this._themeService.colors.foreground.rgba}v0=Dx.blend(v0,(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}vv=!0}}this._decorationService.forEachDecorationAtCell(e,r,"top",S=>{S.backgroundColorRGB&&(Xp=S.backgroundColorRGB.rgba>>8&16777215,b1=!0),S.foregroundColorRGB&&(v0=S.foregroundColorRGB.rgba>>8&16777215,vv=!0)}),b1&&(iT?Xp=t.bg&-16777216&-134217729|Xp|50331648:Xp=t.bg&-16777216|Xp|50331648),vv&&(v0=t.fg&-16777216&-67108865|v0|50331648),this.result.fg&67108864&&(b1&&!vv&&((this.result.bg&50331648)===0?v0=this.result.fg&-134217728|km.background.rgba>>8&16777215&16777215|50331648:v0=this.result.fg&-134217728|this.result.bg&67108863,vv=!0),!b1&&vv&&((this.result.fg&50331648)===0?Xp=this.result.bg&-67108864|km.foreground.rgba>>8&16777215&16777215|50331648:Xp=this.result.bg&-67108864|this.result.fg&67108863,b1=!0)),km=void 0,this.result.bg=b1?Xp:this.result.bg,this.result.fg=vv?v0:this.result.fg,this.result.ext&=536870911,this.result.ext|=pM<<29&3758096384}},R9e=.5,YV=T9e||S9e?"bottom":"ideographic",F9e={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},N9e={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},j9e={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},Z5={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Z5[""]=Z5[""];Z5[""]=Z5[""];function U9e(t,e,r,c,S,H,Z,ue){let be=F9e[e];if(be)return $9e(t,be,r,c,S,H),!0;let Se=N9e[e];if(Se)return H9e(t,Se,r,c,S,H),!0;let Re=j9e[e];if(Re)return V9e(t,Re,r,c,S,H,ue),!0;let Xe=Z5[e];return Xe?(W9e(t,Xe,r,c,S,H,Z,ue),!0):!1}function $9e(t,e,r,c,S,H){for(let Z=0;Z7&&parseInt(ue.slice(7,9),16)||1;else if(ue.startsWith("rgba"))[kt,Dt,rr,Er]=ue.substring(5,ue.length-1).split(",").map(Fe=>parseFloat(Fe));else throw new Error(`Unexpected fillStyle color format "${ue}" when drawing pattern glyph`);for(let Fe=0;Fet.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function JV(t,e,r,c,S,H,Z,ue=0,be=0){let Se=t.map(Re=>parseFloat(Re)||parseInt(Re));if(Se.length<2)throw new Error("Too few arguments for instruction");for(let Re=0;ReS){c-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-e))}ms`),this._start();return}c=S}this.clear()}},q9e=class extends QV{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},G9e=class extends QV{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Z9e=!dL&&"requestIdleCallback"in window?G9e:q9e,S2=class eW{constructor(){this.fg=0,this.bg=0,this.extended=new tW}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new eW;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},tW=class rW{constructor(e=0,r=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new rW(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},K9e=globalThis.performance&&typeof globalThis.performance.now=="function",Y9e=class iW{static create(e){return new iW(e)}constructor(e){this._now=K9e&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},R1;(t=>{t.None=()=>Ug.None;function e(vr,dr){return Xe(vr,()=>{},0,void 0,!0,void 0,dr)}t.defer=e;function r(vr){return(dr,Ar=null,ti)=>{let Xr=!1,ei;return ei=vr(Di=>{if(!Xr)return ei?ei.dispose():Xr=!0,dr.call(Ar,Di)},null,ti),Xr&&ei.dispose(),ei}}t.once=r;function c(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>ti.call(Xr,dr(Di)),null,ei),Ar)}t.map=c;function S(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>{dr(Di),ti.call(Xr,Di)},null,ei),Ar)}t.forEach=S;function H(vr,dr,Ar){return Se((ti,Xr=null,ei)=>vr(Di=>dr(Di)&&ti.call(Xr,Di),null,ei),Ar)}t.filter=H;function Z(vr){return vr}t.signal=Z;function ue(...vr){return(dr,Ar=null,ti)=>{let Xr=WV(...vr.map(ei=>ei(Di=>dr.call(Ar,Di))));return Re(Xr,ti)}}t.any=ue;function be(vr,dr,Ar,ti){let Xr=Ar;return c(vr,ei=>(Xr=dr(Xr,ei),Xr),ti)}t.reduce=be;function Se(vr,dr){let Ar,ti={onWillAddFirstListener(){Ar=vr(Xr.fire,Xr)},onDidRemoveLastListener(){Ar?.dispose()}},Xr=new Kf(ti);return dr?.add(Xr),Xr.event}function Re(vr,dr){return dr instanceof Array?dr.push(vr):dr&&dr.add(vr),vr}function Xe(vr,dr,Ar=100,ti=!1,Xr=!1,ei,Di){let qn,Qn,ka,Ta=0,so,Yn={leakWarningThreshold:ei,onWillAddFirstListener(){qn=vr(an=>{Ta++,Qn=dr(Qn,an),ti&&!ka&&(sn.fire(Qn),Qn=void 0),so=()=>{let zn=Qn;Qn=void 0,ka=void 0,(!ti||Ta>1)&&sn.fire(zn),Ta=0},typeof Ar=="number"?(clearTimeout(ka),ka=setTimeout(so,Ar)):ka===void 0&&(ka=0,queueMicrotask(so))})},onWillRemoveListener(){Xr&&Ta>0&&so?.()},onDidRemoveLastListener(){so=void 0,qn.dispose()}},sn=new Kf(Yn);return Di?.add(sn),sn.event}t.debounce=Xe;function vt(vr,dr=0,Ar){return t.debounce(vr,(ti,Xr)=>ti?(ti.push(Xr),ti):[Xr],dr,void 0,!0,void 0,Ar)}t.accumulate=vt;function bt(vr,dr=(ti,Xr)=>ti===Xr,Ar){let ti=!0,Xr;return H(vr,ei=>{let Di=ti||!dr(ei,Xr);return ti=!1,Xr=ei,Di},Ar)}t.latch=bt;function kt(vr,dr,Ar){return[t.filter(vr,dr,Ar),t.filter(vr,ti=>!dr(ti),Ar)]}t.split=kt;function Dt(vr,dr=!1,Ar=[],ti){let Xr=Ar.slice(),ei=vr(Qn=>{Xr?Xr.push(Qn):qn.fire(Qn)});ti&&ti.add(ei);let Di=()=>{Xr?.forEach(Qn=>qn.fire(Qn)),Xr=null},qn=new Kf({onWillAddFirstListener(){ei||(ei=vr(Qn=>qn.fire(Qn)),ti&&ti.add(ei))},onDidAddFirstListener(){Xr&&(dr?setTimeout(Di):Di())},onDidRemoveLastListener(){ei&&ei.dispose(),ei=null}});return ti&&ti.add(qn),qn.event}t.buffer=Dt;function rr(vr,dr){return(Ar,ti,Xr)=>{let ei=dr(new Fe);return vr(function(Di){let qn=ei.evaluate(Di);qn!==Er&&Ar.call(ti,qn)},void 0,Xr)}}t.chain=rr;let Er=Symbol("HaltChainable");class Fe{constructor(){this.steps=[]}map(dr){return this.steps.push(dr),this}forEach(dr){return this.steps.push(Ar=>(dr(Ar),Ar)),this}filter(dr){return this.steps.push(Ar=>dr(Ar)?Ar:Er),this}reduce(dr,Ar){let ti=Ar;return this.steps.push(Xr=>(ti=dr(ti,Xr),ti)),this}latch(dr=(Ar,ti)=>Ar===ti){let Ar=!0,ti;return this.steps.push(Xr=>{let ei=Ar||!dr(Xr,ti);return Ar=!1,ti=Xr,ei?Xr:Er}),this}evaluate(dr){for(let Ar of this.steps)if(dr=Ar(dr),dr===Er)break;return dr}}function wi(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.on(dr,ti),ei=()=>vr.removeListener(dr,ti),Di=new Kf({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromNodeEventEmitter=wi;function ur(vr,dr,Ar=ti=>ti){let ti=(...qn)=>Di.fire(Ar(...qn)),Xr=()=>vr.addEventListener(dr,ti),ei=()=>vr.removeEventListener(dr,ti),Di=new Kf({onWillAddFirstListener:Xr,onDidRemoveLastListener:ei});return Di.event}t.fromDOMEventEmitter=ur;function Ir(vr){return new Promise(dr=>r(vr)(dr))}t.toPromise=Ir;function Ti(vr){let dr=new Kf;return vr.then(Ar=>{dr.fire(Ar)},()=>{dr.fire(void 0)}).finally(()=>{dr.dispose()}),dr.event}t.fromPromise=Ti;function _i(vr,dr){return vr(Ar=>dr.fire(Ar))}t.forward=_i;function Ci(vr,dr,Ar){return dr(Ar),vr(ti=>dr(ti))}t.runAndSubscribe=Ci;class ii{constructor(dr,Ar){this._observable=dr,this._counter=0,this._hasChanged=!1;let ti={onWillAddFirstListener:()=>{dr.addObserver(this)},onDidRemoveLastListener:()=>{dr.removeObserver(this)}};this.emitter=new Kf(ti),Ar&&Ar.add(this.emitter)}beginUpdate(dr){this._counter++}handlePossibleChange(dr){}handleChange(dr,Ar){this._hasChanged=!0}endUpdate(dr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ji(vr,dr){return new ii(vr,dr).emitter.event}t.fromObservable=Ji;function vi(vr){return(dr,Ar,ti)=>{let Xr=0,ei=!1,Di={beginUpdate(){Xr++},endUpdate(){Xr--,Xr===0&&(vr.reportChanges(),ei&&(ei=!1,dr.call(Ar)))},handlePossibleChange(){},handleChange(){ei=!0}};vr.addObserver(Di),vr.reportChanges();let qn={dispose(){vr.removeObserver(Di)}};return ti instanceof D2?ti.add(qn):Array.isArray(ti)&&ti.push(qn),qn}}t.fromObservableLight=vi})(R1||={});var eE=class tE{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${tE._idPool++}`,tE.all.add(this)}start(e){this._stopWatch=new Y9e,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};eE.all=new Set,eE._idPool=0;var X9e=eE,J9e=-1,nW=class aW{constructor(e,r,c=(aW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let H=this._stacks.get(e.value)||0;this._stacks.set(e.value,H-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},q9e=new W9e;function mM(t){G9e(t)||q9e.onUnexpectedError(t)}var eE="Canceled";function G9e(t){return t instanceof Z9e?!0:t instanceof Error&&t.name===eE&&t.message===eE}var Z9e=class extends Error{constructor(){super(eE),this.name=this.message}},gN=class tE extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof tE)return e;let r=new tE;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},K9e;(t=>{function e($){return $<0}t.isLessThan=e;function r($){return $<=0}t.isLessThanOrEqual=r;function c($){return $>0}t.isGreaterThan=c;function S($){return $===0}t.isNeitherLessOrGreaterThan=S,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(K9e||={});function Y9e(t,e){let r=this,c=!1,S;return function(){return c||(c=!0,e||(S=t.apply(r,arguments))),S}}var qV;(t=>{function e(or){return or&&typeof or=="object"&&typeof or[Symbol.iterator]=="function"}t.is=e;let r=Object.freeze([]);function c(){return r}t.empty=c;function*S(or){yield or}t.single=S;function $(or){return e(or)?or:S(or)}t.wrap=$;function Z(or){return or||r}t.from=Z;function*ue(or){for(let Cr=or.length-1;Cr>=0;Cr--)yield or[Cr]}t.reverse=ue;function xe(or){return!or||or[Symbol.iterator]().next().done===!0}t.isEmpty=xe;function Se(or){return or[Symbol.iterator]().next().value}t.first=Se;function Ne(or,Cr){let gi=0;for(let Si of or)if(Cr(Si,gi++))return!0;return!1}t.some=Ne;function it(or,Cr){for(let gi of or)if(Cr(gi))return gi}t.find=it;function*pt(or,Cr){for(let gi of or)Cr(gi)&&(yield gi)}t.filter=pt;function*bt(or,Cr){let gi=0;for(let Si of or)yield Cr(Si,gi++)}t.map=bt;function*wt(or,Cr){let gi=0;for(let Si of or)yield*Cr(Si,gi++)}t.flatMap=wt;function*Dt(...or){for(let Cr of or)yield*Cr}t.concat=Dt;function Zt(or,Cr,gi){let Si=gi;for(let Ci of or)Si=Cr(Si,Ci);return Si}t.reduce=Zt;function*Mr(or,Cr,gi=or.length){for(Cr<0&&(Cr+=or.length),gi<0?gi+=or.length:gi>or.length&&(gi=or.length);Cr1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function ZV(...t){return j0(()=>GV(t))}function j0(t){return{dispose:Y9e(()=>{t()})}}var KV=class YV{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{GV(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?YV.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};KV.DISABLE_DISPOSED_WARNING=!1;var z2=KV,Ug=class{constructor(){this._store=new z2,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Ug.None=Object.freeze({dispose(){}});var Y3=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},mL=typeof process<"u"&&"title"in process,G8=mL?"node":navigator.userAgent,X9e=mL?"node":navigator.platform,J9e=G8.includes("Firefox"),Q9e=G8.includes("Edge"),XV=/^((?!chrome|android).)*safari/i.test(G8);function eEe(){if(!XV)return 0;let t=G8.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}X9e.indexOf("Linux")>=0;var tEe="",i0=0,n0=0,a0=0,$d=0,dg={css:"#00000000",rgba:0},am;(t=>{function e(S,$,Z,ue){return ue!==void 0?`#${mx(S)}${mx($)}${mx(Z)}${mx(ue)}`:`#${mx(S)}${mx($)}${mx(Z)}`}t.toCss=e;function r(S,$,Z,ue=255){return(S<<24|$<<16|Z<<8|ue)>>>0}t.toRgba=r;function c(S,$,Z,ue){return{css:t.toCss(S,$,Z,ue),rgba:t.toRgba(S,$,Z,ue)}}t.toColor=c})(am||={});var h5;(t=>{function e(xe,Se){if($d=(Se.rgba&255)/255,$d===1)return{css:Se.css,rgba:Se.rgba};let Ne=Se.rgba>>24&255,it=Se.rgba>>16&255,pt=Se.rgba>>8&255,bt=xe.rgba>>24&255,wt=xe.rgba>>16&255,Dt=xe.rgba>>8&255;i0=bt+Math.round((Ne-bt)*$d),n0=wt+Math.round((it-wt)*$d),a0=Dt+Math.round((pt-Dt)*$d);let Zt=am.toCss(i0,n0,a0),Mr=am.toRgba(i0,n0,a0);return{css:Zt,rgba:Mr}}t.blend=e;function r(xe){return(xe.rgba&255)===255}t.isOpaque=r;function c(xe,Se,Ne){let it=Bx.ensureContrastRatio(xe.rgba,Se.rgba,Ne);if(it)return am.toColor(it>>24&255,it>>16&255,it>>8&255)}t.ensureContrastRatio=c;function S(xe){let Se=(xe.rgba|255)>>>0;return[i0,n0,a0]=Bx.toChannels(Se),{css:am.toCss(i0,n0,a0),rgba:Se}}t.opaque=S;function $(xe,Se){return $d=Math.round(Se*255),[i0,n0,a0]=Bx.toChannels(xe.rgba),{css:am.toCss(i0,n0,a0,$d),rgba:am.toRgba(i0,n0,a0,$d)}}t.opacity=$;function Z(xe,Se){return $d=xe.rgba&255,$(xe,$d*Se/255)}t.multiplyOpacity=Z;function ue(xe){return[xe.rgba>>24&255,xe.rgba>>16&255,xe.rgba>>8&255]}t.toColorRGB=ue})(h5||={});var rEe;(t=>{let e,r;try{let S=document.createElement("canvas");S.width=1,S.height=1;let $=S.getContext("2d",{willReadFrequently:!0});$&&(e=$,e.globalCompositeOperation="copy",r=e.createLinearGradient(0,0,1,1))}catch{}function c(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return i0=parseInt(S.slice(1,2).repeat(2),16),n0=parseInt(S.slice(2,3).repeat(2),16),a0=parseInt(S.slice(3,4).repeat(2),16),am.toColor(i0,n0,a0);case 5:return i0=parseInt(S.slice(1,2).repeat(2),16),n0=parseInt(S.slice(2,3).repeat(2),16),a0=parseInt(S.slice(3,4).repeat(2),16),$d=parseInt(S.slice(4,5).repeat(2),16),am.toColor(i0,n0,a0,$d);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}let $=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if($)return i0=parseInt($[1]),n0=parseInt($[2]),a0=parseInt($[3]),$d=Math.round(($[5]===void 0?1:parseFloat($[5]))*255),am.toColor(i0,n0,a0,$d);if(!e||!r)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=r,e.fillStyle=S,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[i0,n0,a0,$d]=e.getImageData(0,0,1,1).data,$d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:am.toRgba(i0,n0,a0,$d),css:S}}t.toColor=c})(rEe||={});var tm;(t=>{function e(c){return r(c>>16&255,c>>8&255,c&255)}t.relativeLuminance=e;function r(c,S,$){let Z=c/255,ue=S/255,xe=$/255,Se=Z<=.03928?Z/12.92:Math.pow((Z+.055)/1.055,2.4),Ne=ue<=.03928?ue/12.92:Math.pow((ue+.055)/1.055,2.4),it=xe<=.03928?xe/12.92:Math.pow((xe+.055)/1.055,2.4);return Se*.2126+Ne*.7152+it*.0722}t.relativeLuminance2=r})(tm||={});var Bx;(t=>{function e(Z,ue){if($d=(ue&255)/255,$d===1)return ue;let xe=ue>>24&255,Se=ue>>16&255,Ne=ue>>8&255,it=Z>>24&255,pt=Z>>16&255,bt=Z>>8&255;return i0=it+Math.round((xe-it)*$d),n0=pt+Math.round((Se-pt)*$d),a0=bt+Math.round((Ne-bt)*$d),am.toRgba(i0,n0,a0)}t.blend=e;function r(Z,ue,xe){let Se=tm.relativeLuminance(Z>>8),Ne=tm.relativeLuminance(ue>>8);if(_1(Se,Ne)>8));if(wt>8));return wt>Zt?bt:Dt}return bt}let it=S(Z,ue,xe),pt=_1(Se,tm.relativeLuminance(it>>8));if(pt>8));return pt>wt?it:bt}return it}}t.ensureContrastRatio=r;function c(Z,ue,xe){let Se=Z>>24&255,Ne=Z>>16&255,it=Z>>8&255,pt=ue>>24&255,bt=ue>>16&255,wt=ue>>8&255,Dt=_1(tm.relativeLuminance2(pt,bt,wt),tm.relativeLuminance2(Se,Ne,it));for(;Dt0||bt>0||wt>0);)pt-=Math.max(0,Math.ceil(pt*.1)),bt-=Math.max(0,Math.ceil(bt*.1)),wt-=Math.max(0,Math.ceil(wt*.1)),Dt=_1(tm.relativeLuminance2(pt,bt,wt),tm.relativeLuminance2(Se,Ne,it));return(pt<<24|bt<<16|wt<<8|255)>>>0}t.reduceLuminance=c;function S(Z,ue,xe){let Se=Z>>24&255,Ne=Z>>16&255,it=Z>>8&255,pt=ue>>24&255,bt=ue>>16&255,wt=ue>>8&255,Dt=_1(tm.relativeLuminance2(pt,bt,wt),tm.relativeLuminance2(Se,Ne,it));for(;Dt>>0}t.increaseLuminance=S;function $(Z){return[Z>>24&255,Z>>16&255,Z>>8&255,Z&255]}t.toChannels=$})(Bx||={});function mx(t){let e=t.toString(16);return e.length<2?"0"+e:e}function _1(t,e){return t=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function sEe(t,e,r,c){return e===1&&r>Math.ceil(c*1.5)&&t!==void 0&&t>255&&!oEe(t)&&!gL(t)&&!nEe(t)}function JV(t){return gL(t)||aEe(t)}function lEe(){return{css:{canvas:nT(),cell:nT()},device:{canvas:nT(),cell:nT(),char:{width:0,height:0,left:0,top:0}}}}function nT(){return{width:0,height:0}}function uEe(t,e,r=0){return(t-(Math.round(e)*2-r))%(Math.round(e)*2)}var y0=0,Jp=0,vv=!1,x1=!1,aT=!1,km,gM=0,cEe=class{constructor(t,e,r,c,S,$){this._terminal=t,this._optionService=e,this._selectionRenderModel=r,this._decorationService=c,this._coreBrowserService=S,this._themeService=$,this.result={fg:0,bg:0,ext:0}}resolve(t,e,r,c){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Jp=0,y0=0,x1=!1,vv=!1,aT=!1,km=this._themeService.colors,gM=0,t.getCode()!==0&&t.extended.underlineStyle===4){let S=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));gM=e*c%(Math.round(S)*2)}if(this._decorationService.forEachDecorationAtCell(e,r,"bottom",S=>{S.backgroundColorRGB&&(Jp=S.backgroundColorRGB.rgba>>8&16777215,x1=!0),S.foregroundColorRGB&&(y0=S.foregroundColorRGB.rgba>>8&16777215,vv=!0)}),aT=this._selectionRenderModel.isCellSelected(this._terminal,e,r),aT){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Jp=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Jp=(this.result.fg&16777215)<<8|255;break;case 0:default:Jp=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Jp=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Jp=(this.result.bg&16777215)<<8|255;break}Jp=Bx.blend(Jp,(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Jp=(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(x1=!0,km.selectionForeground&&(y0=km.selectionForeground.rgba>>8&16777215,vv=!0),JV(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)y0=(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:y0=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:y0=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:y0=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:y0=(this.result.fg&16777215)<<8|255;break;case 0:default:y0=this._themeService.colors.foreground.rgba}y0=Bx.blend(y0,(this._coreBrowserService.isFocused?km.selectionBackgroundOpaque:km.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}vv=!0}}this._decorationService.forEachDecorationAtCell(e,r,"top",S=>{S.backgroundColorRGB&&(Jp=S.backgroundColorRGB.rgba>>8&16777215,x1=!0),S.foregroundColorRGB&&(y0=S.foregroundColorRGB.rgba>>8&16777215,vv=!0)}),x1&&(aT?Jp=t.bg&-16777216&-134217729|Jp|50331648:Jp=t.bg&-16777216|Jp|50331648),vv&&(y0=t.fg&-16777216&-67108865|y0|50331648),this.result.fg&67108864&&(x1&&!vv&&((this.result.bg&50331648)===0?y0=this.result.fg&-134217728|km.background.rgba>>8&16777215&16777215|50331648:y0=this.result.fg&-134217728|this.result.bg&67108863,vv=!0),!x1&&vv&&((this.result.fg&50331648)===0?Jp=this.result.bg&-67108864|km.foreground.rgba>>8&16777215&16777215|50331648:Jp=this.result.bg&-67108864|this.result.fg&67108863,x1=!0)),km=void 0,this.result.bg=x1?Jp:this.result.bg,this.result.fg=vv?y0:this.result.fg,this.result.ext&=536870911,this.result.ext|=gM<<29&3758096384}},hEe=.5,QV=J9e||Q9e?"bottom":"ideographic",fEe={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},dEe={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},pEe={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},Y5={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Y5[""]=Y5[""];Y5[""]=Y5[""];function mEe(t,e,r,c,S,$,Z,ue){let xe=fEe[e];if(xe)return gEe(t,xe,r,c,S,$),!0;let Se=dEe[e];if(Se)return vEe(t,Se,r,c,S,$),!0;let Ne=pEe[e];if(Ne)return yEe(t,Ne,r,c,S,$,ue),!0;let it=Y5[e];return it?(_Ee(t,it,r,c,S,$,Z,ue),!0):!1}function gEe(t,e,r,c,S,$){for(let Z=0;Z7&&parseInt(ue.slice(7,9),16)||1;else if(ue.startsWith("rgba"))[wt,Dt,Zt,Mr]=ue.substring(5,ue.length-1).split(",").map(ze=>parseFloat(ze));else throw new Error(`Unexpected fillStyle color format "${ue}" when drawing pattern glyph`);for(let ze=0;zet.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function tW(t,e,r,c,S,$,Z,ue=0,xe=0){let Se=t.map(Ne=>parseFloat(Ne)||parseInt(Ne));if(Se.length<2)throw new Error("Too few arguments for instruction");for(let Ne=0;NeS){c-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-e))}ms`),this._start();return}c=S}this.clear()}},xEe=class extends rW{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},bEe=class extends rW{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},wEe=!mL&&"requestIdleCallback"in window?bEe:xEe,C2=class iW{constructor(){this.fg=0,this.bg=0,this.extended=new nW}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new iW;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},nW=class aW{constructor(e=0,r=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new aW(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},kEe=globalThis.performance&&typeof globalThis.performance.now=="function",TEe=class oW{static create(e){return new oW(e)}constructor(e){this._now=kEe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},F1;(t=>{t.None=()=>Ug.None;function e(gr,fr){return it(gr,()=>{},0,void 0,!0,void 0,fr)}t.defer=e;function r(gr){return(fr,Sr=null,ei)=>{let Jr=!1,ti;return ti=gr(Di=>{if(!Jr)return ti?ti.dispose():Jr=!0,fr.call(Sr,Di)},null,ei),Jr&&ti.dispose(),ti}}t.once=r;function c(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>ei.call(Jr,fr(Di)),null,ti),Sr)}t.map=c;function S(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>{fr(Di),ei.call(Jr,Di)},null,ti),Sr)}t.forEach=S;function $(gr,fr,Sr){return Se((ei,Jr=null,ti)=>gr(Di=>fr(Di)&&ei.call(Jr,Di),null,ti),Sr)}t.filter=$;function Z(gr){return gr}t.signal=Z;function ue(...gr){return(fr,Sr=null,ei)=>{let Jr=ZV(...gr.map(ti=>ti(Di=>fr.call(Sr,Di))));return Ne(Jr,ei)}}t.any=ue;function xe(gr,fr,Sr,ei){let Jr=Sr;return c(gr,ti=>(Jr=fr(Jr,ti),Jr),ei)}t.reduce=xe;function Se(gr,fr){let Sr,ei={onWillAddFirstListener(){Sr=gr(Jr.fire,Jr)},onDidRemoveLastListener(){Sr?.dispose()}},Jr=new Yf(ei);return fr?.add(Jr),Jr.event}function Ne(gr,fr){return fr instanceof Array?fr.push(gr):fr&&fr.add(gr),gr}function it(gr,fr,Sr=100,ei=!1,Jr=!1,ti,Di){let En,Zn,ga,ya=0,ro,qn={leakWarningThreshold:ti,onWillAddFirstListener(){En=gr(nn=>{ya++,Zn=fr(Zn,nn),ei&&!ga&&(ln.fire(Zn),Zn=void 0),ro=()=>{let On=Zn;Zn=void 0,ga=void 0,(!ei||ya>1)&&ln.fire(On),ya=0},typeof Sr=="number"?(clearTimeout(ga),ga=setTimeout(ro,Sr)):ga===void 0&&(ga=0,queueMicrotask(ro))})},onWillRemoveListener(){Jr&&ya>0&&ro?.()},onDidRemoveLastListener(){ro=void 0,En.dispose()}},ln=new Yf(qn);return Di?.add(ln),ln.event}t.debounce=it;function pt(gr,fr=0,Sr){return t.debounce(gr,(ei,Jr)=>ei?(ei.push(Jr),ei):[Jr],fr,void 0,!0,void 0,Sr)}t.accumulate=pt;function bt(gr,fr=(ei,Jr)=>ei===Jr,Sr){let ei=!0,Jr;return $(gr,ti=>{let Di=ei||!fr(ti,Jr);return ei=!1,Jr=ti,Di},Sr)}t.latch=bt;function wt(gr,fr,Sr){return[t.filter(gr,fr,Sr),t.filter(gr,ei=>!fr(ei),Sr)]}t.split=wt;function Dt(gr,fr=!1,Sr=[],ei){let Jr=Sr.slice(),ti=gr(Zn=>{Jr?Jr.push(Zn):En.fire(Zn)});ei&&ei.add(ti);let Di=()=>{Jr?.forEach(Zn=>En.fire(Zn)),Jr=null},En=new Yf({onWillAddFirstListener(){ti||(ti=gr(Zn=>En.fire(Zn)),ei&&ei.add(ti))},onDidAddFirstListener(){Jr&&(fr?setTimeout(Di):Di())},onDidRemoveLastListener(){ti&&ti.dispose(),ti=null}});return ei&&ei.add(En),En.event}t.buffer=Dt;function Zt(gr,fr){return(Sr,ei,Jr)=>{let ti=fr(new ze);return gr(function(Di){let En=ti.evaluate(Di);En!==Mr&&Sr.call(ei,En)},void 0,Jr)}}t.chain=Zt;let Mr=Symbol("HaltChainable");class ze{constructor(){this.steps=[]}map(fr){return this.steps.push(fr),this}forEach(fr){return this.steps.push(Sr=>(fr(Sr),Sr)),this}filter(fr){return this.steps.push(Sr=>fr(Sr)?Sr:Mr),this}reduce(fr,Sr){let ei=Sr;return this.steps.push(Jr=>(ei=fr(ei,Jr),ei)),this}latch(fr=(Sr,ei)=>Sr===ei){let Sr=!0,ei;return this.steps.push(Jr=>{let ti=Sr||!fr(Jr,ei);return Sr=!1,ei=Jr,ti?Jr:Mr}),this}evaluate(fr){for(let Sr of this.steps)if(fr=Sr(fr),fr===Mr)break;return fr}}function ni(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.on(fr,ei),ti=()=>gr.removeListener(fr,ei),Di=new Yf({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromNodeEventEmitter=ni;function or(gr,fr,Sr=ei=>ei){let ei=(...En)=>Di.fire(Sr(...En)),Jr=()=>gr.addEventListener(fr,ei),ti=()=>gr.removeEventListener(fr,ei),Di=new Yf({onWillAddFirstListener:Jr,onDidRemoveLastListener:ti});return Di.event}t.fromDOMEventEmitter=or;function Cr(gr){return new Promise(fr=>r(gr)(fr))}t.toPromise=Cr;function gi(gr){let fr=new Yf;return gr.then(Sr=>{fr.fire(Sr)},()=>{fr.fire(void 0)}).finally(()=>{fr.dispose()}),fr.event}t.fromPromise=gi;function Si(gr,fr){return gr(Sr=>fr.fire(Sr))}t.forward=Si;function Ci(gr,fr,Sr){return fr(Sr),gr(ei=>fr(ei))}t.runAndSubscribe=Ci;class ri{constructor(fr,Sr){this._observable=fr,this._counter=0,this._hasChanged=!1;let ei={onWillAddFirstListener:()=>{fr.addObserver(this)},onDidRemoveLastListener:()=>{fr.removeObserver(this)}};this.emitter=new Yf(ei),Sr&&Sr.add(this.emitter)}beginUpdate(fr){this._counter++}handlePossibleChange(fr){}handleChange(fr,Sr){this._hasChanged=!0}endUpdate(fr){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function on(gr,fr){return new ri(gr,fr).emitter.event}t.fromObservable=on;function yi(gr){return(fr,Sr,ei)=>{let Jr=0,ti=!1,Di={beginUpdate(){Jr++},endUpdate(){Jr--,Jr===0&&(gr.reportChanges(),ti&&(ti=!1,fr.call(Sr)))},handlePossibleChange(){},handleChange(){ti=!0}};gr.addObserver(Di),gr.reportChanges();let En={dispose(){gr.removeObserver(Di)}};return ei instanceof z2?ei.add(En):Array.isArray(ei)&&ei.push(En),En}}t.fromObservableLight=yi})(F1||={});var rE=class iE{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${iE._idPool++}`,iE.all.add(this)}start(e){this._stopWatch=new TEe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};rE.all=new Set,rE._idPool=0;var SEe=rE,CEe=-1,sW=class lW{constructor(e,r,c=(lW._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=c,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let c=this.threshold;if(c<=0||r{let $=this._stacks.get(e.value)||0;this._stacks.set(e.value,$-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[c,S]of this._stacks)(!e||r{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let Z=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(Z);let ue=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],be=new rEe(`${Z}. HINT: Stack shows most frequent listener (${ue[1]}-times)`,ue[0]);return(this._options?.onListenerError||dM)(be),Ug.None}if(this._disposed)return Ug.None;e&&(t=t.bind(e));let c=new mM(t),S;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(c.stack=eEe.create(),S=this._leakageMon.check(c.stack,this._size+1)),this._listeners?this._listeners instanceof mM?(this._deliveryQueue??=new oEe,this._listeners=[this._listeners,c]):this._listeners.push(c):(this._options?.onWillAddFirstListener?.(this),this._listeners=c,this._options?.onDidAddFirstListener?.(this)),this._size++;let H=j0(()=>{S?.(),this._removeListener(c)});return r instanceof D2?r.add(H):Array.isArray(r)&&r.push(H),H},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,r=e.indexOf(t);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[r]=void 0;let c=this._deliveryQueue.current===this;if(this._size*nEe<=e.length){let S=0;for(let H=0;H0}},oEe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},_N={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},K3=2,Y3,Gy=class w2{constructor(e,r,c){this._document=e,this._config=r,this._unicodeService=c,this._didWarmUp=!1,this._cacheMap=new yN,this._cacheMapCombined=new yN,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new S2,this._textureSize=512,this._onAddTextureAtlasCanvas=new Kf,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Kf,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=sW(e,this._config.deviceCellWidth*4+K3*2,this._config.deviceCellHeight+K3*2),this._tmpCtx=_p(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new Z9e;for(let r=33;r<126;r++)e.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let c=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,c)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w2.maxAtlasPages&&this._pages.length>=Math.max(4,w2.maxAtlasPages)){let r=this._pages.filter(Se=>Se.canvas.width*2<=(w2.maxTextureSize||4096)).sort((Se,Re)=>Re.canvas.width!==Se.canvas.width?Re.canvas.width-Se.canvas.width:Re.percentageUsed-Se.percentageUsed),c=-1,S=0;for(let Se=0;SeSe.glyphs[0].texturePage).sort((Se,Re)=>Se>Re?1:-1),ue=this.pages.length-H.length,be=this._mergePages(H,ue);be.version++;for(let Se=Z.length-1;Se>=0;Se--)this._deletePage(Z[Se]);this.pages.push(be),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(be.canvas)}let e=new gM(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,r){let c=e[0].canvas.width*2,S=new gM(this._document,c,e);for(let[H,Z]of e.entries()){let ue=H*Z.canvas.width%c,be=Math.floor(H/2)*Z.canvas.height;S.ctx.drawImage(Z.canvas,ue,be);for(let Re of Z.glyphs)Re.texturePage=r,Re.sizeClipSpace.x=Re.size.x/c,Re.sizeClipSpace.y=Re.size.y/c,Re.texturePosition.x+=ue,Re.texturePosition.y+=be,Re.texturePositionClipSpace.x=Re.texturePosition.x/c,Re.texturePositionClipSpace.y=Re.texturePosition.y/c;this._onRemoveTextureAtlasCanvas.fire(Z.canvas);let Se=this._activePages.indexOf(Z);Se!==-1&&this._activePages.splice(Se,1)}return S}_deletePage(e){this._pages.splice(e,1);for(let r=e;r=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,r,c,S){if(this._config.allowTransparency)return fg;let H;switch(e){case 16777216:case 33554432:H=this._getColorFromAnsiIndex(r);break;case 50331648:let Z=S2.toColorRGB(r);H=am.toColor(Z[0],Z[1],Z[2]);break;case 0:default:c?H=u5.opaque(this._config.colors.foreground):H=this._config.colors.background;break}return this._config.allowTransparency||(H=u5.opaque(H)),H}_getForegroundColor(e,r,c,S,H,Z,ue,be,Se,Re){let Xe=this._getMinimumContrastColor(e,r,c,S,H,Z,ue,Se,be,Re);if(Xe)return Xe;let vt;switch(H){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Se&&Z<8&&(Z+=8),vt=this._getColorFromAnsiIndex(Z);break;case 50331648:let bt=S2.toColorRGB(Z);vt=am.toColor(bt[0],bt[1],bt[2]);break;case 0:default:ue?vt=this._config.colors.background:vt=this._config.colors.foreground}return this._config.allowTransparency&&(vt=u5.opaque(vt)),be&&(vt=u5.multiplyOpacity(vt,R9e)),vt}_resolveBackgroundRgba(e,r,c){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return c?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,r,c,S){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return c?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,r,c,S,H,Z,ue,be,Se,Re){if(this._config.minimumContrastRatio===1||Re)return;let Xe=this._getContrastCache(Se),vt=Xe.getColor(e,S);if(vt!==void 0)return vt||void 0;let bt=this._resolveBackgroundRgba(r,c,ue),kt=this._resolveForegroundRgba(H,Z,ue,be),Dt=Dx.ensureContrastRatio(bt,kt,this._config.minimumContrastRatio/(Se?2:1));if(!Dt){Xe.setColor(e,S,null);return}let rr=am.toColor(Dt>>24&255,Dt>>16&255,Dt>>8&255);return Xe.setColor(e,S,rr),rr}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,r,c,S,H,Z){let ue=typeof e=="number"?String.fromCharCode(e):e;Z&&this._tmpCanvas.parentElement!==Z&&(this._tmpCanvas.style.display="none",Z.append(this._tmpCanvas));let be=Math.min(this._config.deviceCellWidth*Math.max(ue.length,2)+K3*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=Qn?Qn*2-an:Qn-an;an>=Qn||Xi===0?(this._tmpCtx.setLineDash([Math.round(Qn),Math.round(Qn)]),this._tmpCtx.moveTo(Ra+Xi,so),this._tmpCtx.lineTo(Ya,so)):(this._tmpCtx.setLineDash([Math.round(Qn),Math.round(Qn)]),this._tmpCtx.moveTo(Ra,so),this._tmpCtx.lineTo(Ra+Xi,so),this._tmpCtx.moveTo(Ra+Xi+Qn,so),this._tmpCtx.lineTo(Ya,so)),an=O9e(Ya-Ra,Qn,an);break;case 5:let oo=.6,go=.3,ko=Ya-Ra,ss=Math.floor(oo*ko),ys=Math.floor(go*ko),ns=ko-ss-ys;this._tmpCtx.setLineDash([ss,ys,ns]),this._tmpCtx.moveTo(Ra,so),this._tmpCtx.lineTo(Ya,so);break;case 1:default:this._tmpCtx.moveTo(Ra,so),this._tmpCtx.lineTo(Ya,so);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!vr&&this._config.fontSize>=12&&!this._config.allowTransparency&&ue!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let zn=this._tmpCtx.measureText(ue);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in zn&&zn.actualBoundingBoxDescent>0){this._tmpCtx.save();let Ra=new Path2D;Ra.rect(Ta,so-Math.ceil(Qn/2),this._config.deviceCellWidth*Ar,sn-so+Math.ceil(Qn/2)),this._tmpCtx.clip(Ra),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=Ir.css,this._tmpCtx.strokeText(ue,vi,vi+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(rr){let Qn=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ka=Qn%2===1?.5:0;this._tmpCtx.lineWidth=Qn,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(vi,vi+ka),this._tmpCtx.lineTo(vi+this._config.deviceCharWidth*Ar,vi+ka),this._tmpCtx.stroke()}if(vr||this._tmpCtx.fillText(ue,vi,vi+this._config.deviceCharHeight),ue==="_"&&!this._config.allowTransparency){let Qn=vM(this._tmpCtx.getImageData(vi,vi,this._config.deviceCellWidth,this._config.deviceCellHeight),Ir,Ji,dr);if(Qn)for(let ka=1;ka<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=Ir.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(ue,vi,vi+this._config.deviceCharHeight-ka),Qn=vM(this._tmpCtx.getImageData(vi,vi,this._config.deviceCellWidth,this._config.deviceCellHeight),Ir,Ji,dr),!!Qn);ka++);}if(Dt){let Qn=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ka=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=Qn,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(vi,vi+Math.floor(this._config.deviceCharHeight/2)-ka),this._tmpCtx.lineTo(vi+this._config.deviceCharWidth*Ar,vi+Math.floor(this._config.deviceCharHeight/2)-ka),this._tmpCtx.stroke()}this._tmpCtx.restore();let ti=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),Xr;if(this._config.allowTransparency?Xr=sEe(ti):Xr=vM(ti,Ir,Ji,dr),Xr)return _N;let ei=this._findGlyphBoundingBox(ti,this._workBoundingBox,be,ii,vr,vi),Di,qn;for(;;){if(this._activePages.length===0){let Qn=this._createNewPage();Di=Qn,qn=Qn.currentRow,qn.height=ei.size.y;break}Di=this._activePages[this._activePages.length-1],qn=Di.currentRow;for(let Qn of this._activePages)ei.size.y<=Qn.currentRow.height&&(Di=Qn,qn=Qn.currentRow);for(let Qn=this._activePages.length-1;Qn>=0;Qn--)for(let ka of this._activePages[Qn].fixedRows)ka.height<=qn.height&&ei.size.y<=ka.height&&(Di=this._activePages[Qn],qn=ka);if(ei.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new gM(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Di=this._overflowSizePage,qn=this._overflowSizePage.currentRow,qn.x+ei.size.x>=Di.canvas.width&&(qn.x=0,qn.y+=qn.height,qn.height=0);break}if(qn.y+ei.size.y>=Di.canvas.height||qn.height>ei.size.y+2){let Qn=!1;if(Di.currentRow.y+Di.currentRow.height+ei.size.y>=Di.canvas.height){let ka;for(let Ta of this._activePages)if(Ta.currentRow.y+Ta.currentRow.height+ei.size.y=w2.maxAtlasPages&&qn.y+ei.size.y<=Di.canvas.height&&qn.height>=ei.size.y&&qn.x+ei.size.x<=Di.canvas.width)Qn=!0;else{let Ta=this._createNewPage();Di=Ta,qn=Ta.currentRow,qn.height=ei.size.y,Qn=!0}}Qn||(Di.currentRow.height>0&&Di.fixedRows.push(Di.currentRow),qn={x:0,y:Di.currentRow.y+Di.currentRow.height,height:ei.size.y},Di.fixedRows.push(qn),Di.currentRow={x:0,y:qn.y+qn.height,height:0})}if(qn.x+ei.size.x<=Di.canvas.width)break;qn===Di.currentRow?(qn.x=0,qn.y+=qn.height,qn.height=0):Di.fixedRows.splice(Di.fixedRows.indexOf(qn),1)}return ei.texturePage=this._pages.indexOf(Di),ei.texturePosition.x=qn.x,ei.texturePosition.y=qn.y,ei.texturePositionClipSpace.x=qn.x/Di.canvas.width,ei.texturePositionClipSpace.y=qn.y/Di.canvas.height,ei.sizeClipSpace.x/=Di.canvas.width,ei.sizeClipSpace.y/=Di.canvas.height,qn.height=Math.max(qn.height,ei.size.y),qn.x+=ei.size.x,Di.ctx.putImageData(ti,ei.texturePosition.x-this._workBoundingBox.left,ei.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ei.size.x,ei.size.y),Di.addGlyph(ei),Di.version++,ei}_findGlyphBoundingBox(e,r,c,S,H,Z){r.top=0;let ue=S?this._config.deviceCellHeight:this._tmpCanvas.height,be=S?this._config.deviceCellWidth:c,Se=!1;for(let Re=0;Re=Z;Re--){for(let Xe=0;Xe=0;Re--){for(let Xe=0;Xe>>24,H=e.rgba>>>16&255,Z=e.rgba>>>8&255,ue=r.rgba>>>24,be=r.rgba>>>16&255,Se=r.rgba>>>8&255,Re=Math.floor((Math.abs(S-ue)+Math.abs(H-be)+Math.abs(Z-Se))/12),Xe=!0;for(let vt=0;vt0)return!1;return!0}function sW(t,e,r){let c=t.createElement("canvas");return c.width=e,c.height=r,c}function lEe(t,e,r,c,S,H,Z,ue){let be={foreground:H.foreground,background:H.background,cursor:fg,cursorAccent:fg,selectionForeground:fg,selectionBackgroundTransparent:fg,selectionBackgroundOpaque:fg,selectionInactiveBackgroundTransparent:fg,selectionInactiveBackgroundOpaque:fg,overviewRulerBorder:fg,scrollbarSliderBackground:fg,scrollbarSliderHoverBackground:fg,scrollbarSliderActiveBackground:fg,ansi:H.ansi.slice(),contrastCache:H.contrastCache,halfContrastCache:H.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:Z,deviceMaxTextureSize:ue,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:r,deviceCharHeight:c,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:be}}function xN(t,e){for(let r=0;r=0){if(xN(bt.config,Se))return bt.atlas;bt.ownedBy.length===1?(bt.atlas.dispose(),mg.splice(vt,1)):bt.ownedBy.splice(kt,1);break}}for(let vt=0;vt{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=nT){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=nT-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=nT-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},nT)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function wN(t,e,r){let c=new e.ResizeObserver(S=>{let H=S.find(be=>be.target===t);if(!H)return;if(!("devicePixelContentBoxSize"in H)){c?.disconnect(),c=void 0;return}let Z=H.devicePixelContentBoxSize[0].inlineSize,ue=H.devicePixelContentBoxSize[0].blockSize;Z>0&&ue>0&&r(Z,ue)});try{c.observe(t,{box:["device-pixel-content-box"]})}catch{c.disconnect(),c=void 0}return j0(()=>c?.disconnect())}function hEe(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var kN=class uW extends S2{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new tW,this.combinedData=""}static fromCharData(e){let r=new uW;return r.setFromCharData(e),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?hEe(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let r=!1;if(e[1].length>2)r=!0;else if(e[1].length===2){let c=e[1].charCodeAt(0);if(55296<=c&&c<=56319){let S=e[1].charCodeAt(1);56320<=S&&S<=57343?this.content=(c-55296)*1024+S-56320+65536|e[2]<<22:r=!0}else r=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;r&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},cW=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function hW(t,e,r){let c=_p(t.createProgram());if(t.attachShader(c,_p(TN(t,t.VERTEX_SHADER,e))),t.attachShader(c,_p(TN(t,t.FRAGMENT_SHADER,r))),t.linkProgram(c),t.getProgramParameter(c,t.LINK_STATUS))return c;console.error(t.getProgramInfoLog(c)),t.deleteProgram(c)}function TN(t,e,r){let c=_p(t.createShader(e));if(t.shaderSource(c,r),t.compileShader(c),t.getShaderParameter(c,t.COMPILE_STATUS))return c;console.error(t.getShaderInfoLog(c)),t.deleteShader(c)}function fEe(t,e){let r=Math.min(t.length*2,e),c=new Float32Array(r);for(let S=0;S{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let Z=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(Z);let ue=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],xe=new LEe(`${Z}. HINT: Stack shows most frequent listener (${ue[1]}-times)`,ue[0]);return(this._options?.onListenerError||mM)(xe),Ug.None}if(this._disposed)return Ug.None;e&&(t=t.bind(e));let c=new vM(t),S;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(c.stack=MEe.create(),S=this._leakageMon.check(c.stack,this._size+1)),this._listeners?this._listeners instanceof vM?(this._deliveryQueue??=new zEe,this._listeners=[this._listeners,c]):this._listeners.push(c):(this._options?.onWillAddFirstListener?.(this),this._listeners=c,this._options?.onDidAddFirstListener?.(this)),this._size++;let $=j0(()=>{S?.(),this._removeListener(c)});return r instanceof z2?r.add($):Array.isArray(r)&&r.push($),$},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,r=e.indexOf(t);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[r]=void 0;let c=this._deliveryQueue.current===this;if(this._size*IEe<=e.length){let S=0;for(let $=0;$0}},zEe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,r){this.i=0,this.end=r,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bN={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},X3=2,J3,Yy=class k2{constructor(e,r,c){this._document=e,this._config=r,this._unicodeService=c,this._didWarmUp=!1,this._cacheMap=new xN,this._cacheMapCombined=new xN,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new C2,this._textureSize=512,this._onAddTextureAtlasCanvas=new Yf,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Yf,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=cW(e,this._config.deviceCellWidth*4+X3*2,this._config.deviceCellHeight+X3*2),this._tmpCtx=xp(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new wEe;for(let r=33;r<126;r++)e.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let c=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,c)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(k2.maxAtlasPages&&this._pages.length>=Math.max(4,k2.maxAtlasPages)){let r=this._pages.filter(Se=>Se.canvas.width*2<=(k2.maxTextureSize||4096)).sort((Se,Ne)=>Ne.canvas.width!==Se.canvas.width?Ne.canvas.width-Se.canvas.width:Ne.percentageUsed-Se.percentageUsed),c=-1,S=0;for(let Se=0;SeSe.glyphs[0].texturePage).sort((Se,Ne)=>Se>Ne?1:-1),ue=this.pages.length-$.length,xe=this._mergePages($,ue);xe.version++;for(let Se=Z.length-1;Se>=0;Se--)this._deletePage(Z[Se]);this.pages.push(xe),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(xe.canvas)}let e=new yM(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,r){let c=e[0].canvas.width*2,S=new yM(this._document,c,e);for(let[$,Z]of e.entries()){let ue=$*Z.canvas.width%c,xe=Math.floor($/2)*Z.canvas.height;S.ctx.drawImage(Z.canvas,ue,xe);for(let Ne of Z.glyphs)Ne.texturePage=r,Ne.sizeClipSpace.x=Ne.size.x/c,Ne.sizeClipSpace.y=Ne.size.y/c,Ne.texturePosition.x+=ue,Ne.texturePosition.y+=xe,Ne.texturePositionClipSpace.x=Ne.texturePosition.x/c,Ne.texturePositionClipSpace.y=Ne.texturePosition.y/c;this._onRemoveTextureAtlasCanvas.fire(Z.canvas);let Se=this._activePages.indexOf(Z);Se!==-1&&this._activePages.splice(Se,1)}return S}_deletePage(e){this._pages.splice(e,1);for(let r=e;r=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,r,c,S){if(this._config.allowTransparency)return dg;let $;switch(e){case 16777216:case 33554432:$=this._getColorFromAnsiIndex(r);break;case 50331648:let Z=C2.toColorRGB(r);$=am.toColor(Z[0],Z[1],Z[2]);break;case 0:default:c?$=h5.opaque(this._config.colors.foreground):$=this._config.colors.background;break}return this._config.allowTransparency||($=h5.opaque($)),$}_getForegroundColor(e,r,c,S,$,Z,ue,xe,Se,Ne){let it=this._getMinimumContrastColor(e,r,c,S,$,Z,ue,Se,xe,Ne);if(it)return it;let pt;switch($){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&Se&&Z<8&&(Z+=8),pt=this._getColorFromAnsiIndex(Z);break;case 50331648:let bt=C2.toColorRGB(Z);pt=am.toColor(bt[0],bt[1],bt[2]);break;case 0:default:ue?pt=this._config.colors.background:pt=this._config.colors.foreground}return this._config.allowTransparency&&(pt=h5.opaque(pt)),xe&&(pt=h5.multiplyOpacity(pt,hEe)),pt}_resolveBackgroundRgba(e,r,c){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return c?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,r,c,S){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;case 0:default:return c?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,r,c,S,$,Z,ue,xe,Se,Ne){if(this._config.minimumContrastRatio===1||Ne)return;let it=this._getContrastCache(Se),pt=it.getColor(e,S);if(pt!==void 0)return pt||void 0;let bt=this._resolveBackgroundRgba(r,c,ue),wt=this._resolveForegroundRgba($,Z,ue,xe),Dt=Bx.ensureContrastRatio(bt,wt,this._config.minimumContrastRatio/(Se?2:1));if(!Dt){it.setColor(e,S,null);return}let Zt=am.toColor(Dt>>24&255,Dt>>16&255,Dt>>8&255);return it.setColor(e,S,Zt),Zt}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,r,c,S,$,Z){let ue=typeof e=="number"?String.fromCharCode(e):e;Z&&this._tmpCanvas.parentElement!==Z&&(this._tmpCanvas.style.display="none",Z.append(this._tmpCanvas));let xe=Math.min(this._config.deviceCellWidth*Math.max(ue.length,2)+X3*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=Zn?Zn*2-nn:Zn-nn;nn>=Zn||Xi===0?(this._tmpCtx.setLineDash([Math.round(Zn),Math.round(Zn)]),this._tmpCtx.moveTo(Ra+Xi,ro),this._tmpCtx.lineTo(Xa,ro)):(this._tmpCtx.setLineDash([Math.round(Zn),Math.round(Zn)]),this._tmpCtx.moveTo(Ra,ro),this._tmpCtx.lineTo(Ra+Xi,ro),this._tmpCtx.moveTo(Ra+Xi+Zn,ro),this._tmpCtx.lineTo(Xa,ro)),nn=uEe(Xa-Ra,Zn,nn);break;case 5:let so=.6,go=.3,ko=Xa-Ra,ss=Math.floor(so*ko),ys=Math.floor(go*ko),ns=ko-ss-ys;this._tmpCtx.setLineDash([ss,ys,ns]),this._tmpCtx.moveTo(Ra,ro),this._tmpCtx.lineTo(Xa,ro);break;case 1:default:this._tmpCtx.moveTo(Ra,ro),this._tmpCtx.lineTo(Xa,ro);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!gr&&this._config.fontSize>=12&&!this._config.allowTransparency&&ue!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let On=this._tmpCtx.measureText(ue);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in On&&On.actualBoundingBoxDescent>0){this._tmpCtx.save();let Ra=new Path2D;Ra.rect(ya,ro-Math.ceil(Zn/2),this._config.deviceCellWidth*Sr,ln-ro+Math.ceil(Zn/2)),this._tmpCtx.clip(Ra),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=Cr.css,this._tmpCtx.strokeText(ue,yi,yi+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Zt){let Zn=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ga=Zn%2===1?.5:0;this._tmpCtx.lineWidth=Zn,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(yi,yi+ga),this._tmpCtx.lineTo(yi+this._config.deviceCharWidth*Sr,yi+ga),this._tmpCtx.stroke()}if(gr||this._tmpCtx.fillText(ue,yi,yi+this._config.deviceCharHeight),ue==="_"&&!this._config.allowTransparency){let Zn=_M(this._tmpCtx.getImageData(yi,yi,this._config.deviceCellWidth,this._config.deviceCellHeight),Cr,on,fr);if(Zn)for(let ga=1;ga<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=Cr.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(ue,yi,yi+this._config.deviceCharHeight-ga),Zn=_M(this._tmpCtx.getImageData(yi,yi,this._config.deviceCellWidth,this._config.deviceCellHeight),Cr,on,fr),!!Zn);ga++);}if(Dt){let Zn=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ga=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=Zn,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(yi,yi+Math.floor(this._config.deviceCharHeight/2)-ga),this._tmpCtx.lineTo(yi+this._config.deviceCharWidth*Sr,yi+Math.floor(this._config.deviceCharHeight/2)-ga),this._tmpCtx.stroke()}this._tmpCtx.restore();let ei=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),Jr;if(this._config.allowTransparency?Jr=OEe(ei):Jr=_M(ei,Cr,on,fr),Jr)return bN;let ti=this._findGlyphBoundingBox(ei,this._workBoundingBox,xe,ri,gr,yi),Di,En;for(;;){if(this._activePages.length===0){let Zn=this._createNewPage();Di=Zn,En=Zn.currentRow,En.height=ti.size.y;break}Di=this._activePages[this._activePages.length-1],En=Di.currentRow;for(let Zn of this._activePages)ti.size.y<=Zn.currentRow.height&&(Di=Zn,En=Zn.currentRow);for(let Zn=this._activePages.length-1;Zn>=0;Zn--)for(let ga of this._activePages[Zn].fixedRows)ga.height<=En.height&&ti.size.y<=ga.height&&(Di=this._activePages[Zn],En=ga);if(ti.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new yM(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Di=this._overflowSizePage,En=this._overflowSizePage.currentRow,En.x+ti.size.x>=Di.canvas.width&&(En.x=0,En.y+=En.height,En.height=0);break}if(En.y+ti.size.y>=Di.canvas.height||En.height>ti.size.y+2){let Zn=!1;if(Di.currentRow.y+Di.currentRow.height+ti.size.y>=Di.canvas.height){let ga;for(let ya of this._activePages)if(ya.currentRow.y+ya.currentRow.height+ti.size.y=k2.maxAtlasPages&&En.y+ti.size.y<=Di.canvas.height&&En.height>=ti.size.y&&En.x+ti.size.x<=Di.canvas.width)Zn=!0;else{let ya=this._createNewPage();Di=ya,En=ya.currentRow,En.height=ti.size.y,Zn=!0}}Zn||(Di.currentRow.height>0&&Di.fixedRows.push(Di.currentRow),En={x:0,y:Di.currentRow.y+Di.currentRow.height,height:ti.size.y},Di.fixedRows.push(En),Di.currentRow={x:0,y:En.y+En.height,height:0})}if(En.x+ti.size.x<=Di.canvas.width)break;En===Di.currentRow?(En.x=0,En.y+=En.height,En.height=0):Di.fixedRows.splice(Di.fixedRows.indexOf(En),1)}return ti.texturePage=this._pages.indexOf(Di),ti.texturePosition.x=En.x,ti.texturePosition.y=En.y,ti.texturePositionClipSpace.x=En.x/Di.canvas.width,ti.texturePositionClipSpace.y=En.y/Di.canvas.height,ti.sizeClipSpace.x/=Di.canvas.width,ti.sizeClipSpace.y/=Di.canvas.height,En.height=Math.max(En.height,ti.size.y),En.x+=ti.size.x,Di.ctx.putImageData(ei,ti.texturePosition.x-this._workBoundingBox.left,ti.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ti.size.x,ti.size.y),Di.addGlyph(ti),Di.version++,ti}_findGlyphBoundingBox(e,r,c,S,$,Z){r.top=0;let ue=S?this._config.deviceCellHeight:this._tmpCanvas.height,xe=S?this._config.deviceCellWidth:c,Se=!1;for(let Ne=0;Ne=Z;Ne--){for(let it=0;it=0;Ne--){for(let it=0;it>>24,$=e.rgba>>>16&255,Z=e.rgba>>>8&255,ue=r.rgba>>>24,xe=r.rgba>>>16&255,Se=r.rgba>>>8&255,Ne=Math.floor((Math.abs(S-ue)+Math.abs($-xe)+Math.abs(Z-Se))/12),it=!0;for(let pt=0;pt0)return!1;return!0}function cW(t,e,r){let c=t.createElement("canvas");return c.width=e,c.height=r,c}function BEe(t,e,r,c,S,$,Z,ue){let xe={foreground:$.foreground,background:$.background,cursor:dg,cursorAccent:dg,selectionForeground:dg,selectionBackgroundTransparent:dg,selectionBackgroundOpaque:dg,selectionInactiveBackgroundTransparent:dg,selectionInactiveBackgroundOpaque:dg,overviewRulerBorder:dg,scrollbarSliderBackground:dg,scrollbarSliderHoverBackground:dg,scrollbarSliderActiveBackground:dg,ansi:$.ansi.slice(),contrastCache:$.contrastCache,halfContrastCache:$.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:Z,deviceMaxTextureSize:ue,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:r,deviceCharHeight:c,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:xe}}function wN(t,e){for(let r=0;r=0){if(wN(bt.config,Se))return bt.atlas;bt.ownedBy.length===1?(bt.atlas.dispose(),gg.splice(pt,1)):bt.ownedBy.splice(wt,1);break}}for(let pt=0;pt{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=oT){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=oT-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=oT-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},oT)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function TN(t,e,r){let c=new e.ResizeObserver(S=>{let $=S.find(xe=>xe.target===t);if(!$)return;if(!("devicePixelContentBoxSize"in $)){c?.disconnect(),c=void 0;return}let Z=$.devicePixelContentBoxSize[0].inlineSize,ue=$.devicePixelContentBoxSize[0].blockSize;Z>0&&ue>0&&r(Z,ue)});try{c.observe(t,{box:["device-pixel-content-box"]})}catch{c.disconnect(),c=void 0}return j0(()=>c?.disconnect())}function NEe(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var SN=class fW extends C2{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new nW,this.combinedData=""}static fromCharData(e){let r=new fW;return r.setFromCharData(e),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?NEe(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let r=!1;if(e[1].length>2)r=!0;else if(e[1].length===2){let c=e[1].charCodeAt(0);if(55296<=c&&c<=56319){let S=e[1].charCodeAt(1);56320<=S&&S<=57343?this.content=(c-55296)*1024+S-56320+65536|e[2]<<22:r=!0}else r=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;r&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},dW=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function pW(t,e,r){let c=xp(t.createProgram());if(t.attachShader(c,xp(CN(t,t.VERTEX_SHADER,e))),t.attachShader(c,xp(CN(t,t.FRAGMENT_SHADER,r))),t.linkProgram(c),t.getProgramParameter(c,t.LINK_STATUS))return c;console.error(t.getProgramInfoLog(c)),t.deleteProgram(c)}function CN(t,e,r){let c=xp(t.createShader(e));if(t.shaderSource(c,r),t.compileShader(c),t.getShaderParameter(c,t.COMPILE_STATUS))return c;console.error(t.getShaderInfoLog(c)),t.deleteShader(c)}function jEe(t,e){let r=Math.min(t.length*2,e),c=new Float32Array(r);for(let S=0;SS.deleteProgram(this._program))),this._projectionLocation=_p(S.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=_p(S.getUniformLocation(this._program,"u_resolution")),this._textureLocation=_p(S.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let H=new Float32Array([0,0,1,0,0,1,1,1]),Z=S.createBuffer();this._register(j0(()=>S.deleteBuffer(Z))),S.bindBuffer(S.ARRAY_BUFFER,Z),S.bufferData(S.ARRAY_BUFFER,H,S.STATIC_DRAW),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let ue=new Uint8Array([0,1,2,3]),be=S.createBuffer();this._register(j0(()=>S.deleteBuffer(be))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,be),S.bufferData(S.ELEMENT_ARRAY_BUFFER,ue,S.STATIC_DRAW),this._attributesBuffer=_p(S.createBuffer()),this._register(j0(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,2,S.FLOAT,!1,y2,0),S.vertexAttribDivisor(2,1),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,S.FLOAT,!1,y2,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(3,1),S.enableVertexAttribArray(4),S.vertexAttribPointer(4,1,S.FLOAT,!1,y2,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(4,1),S.enableVertexAttribArray(5),S.vertexAttribPointer(5,2,S.FLOAT,!1,y2,5*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(5,1),S.enableVertexAttribArray(6),S.vertexAttribPointer(6,2,S.FLOAT,!1,y2,7*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(6,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,y2,9*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.useProgram(this._program);let Se=new Int32Array(Gy.maxAtlasPages);for(let Re=0;ReS.deleteTexture(Xe.texture))),S.activeTexture(S.TEXTURE0+Re),S.bindTexture(S.TEXTURE_2D,Xe.texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Re]=Xe}S.enable(S.BLEND),S.blendFunc(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,r,c,S,H,Z,ue,be){this._updateCell(this._vertices.attributes,t,e,r,c,S,H,Z,ue,be)}_updateCell(t,e,r,c,S,H,Z,ue,be,Se){if(Fd=(r*this._terminal.cols+e)*Zy,c===0||c===void 0){t.fill(0,Fd,Fd+Zy-1-gEe);return}this._atlas&&(ue&&ue.length>1?qf=this._atlas.getRasterizedGlyphCombinedChar(ue,S,H,Z,!1,this._terminal.element):qf=this._atlas.getRasterizedGlyph(c,S,H,Z,!1,this._terminal.element),yM=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),S!==Se&&qf.offset.x>yM?(X3=qf.offset.x-yM,t[Fd]=-(qf.offset.x-X3)+this._dimensions.device.char.left,t[Fd+1]=-qf.offset.y+this._dimensions.device.char.top,t[Fd+2]=(qf.size.x-X3)/this._dimensions.device.canvas.width,t[Fd+3]=qf.size.y/this._dimensions.device.canvas.height,t[Fd+4]=qf.texturePage,t[Fd+5]=qf.texturePositionClipSpace.x+X3/this._atlas.pages[qf.texturePage].canvas.width,t[Fd+6]=qf.texturePositionClipSpace.y,t[Fd+7]=qf.sizeClipSpace.x-X3/this._atlas.pages[qf.texturePage].canvas.width,t[Fd+8]=qf.sizeClipSpace.y):(t[Fd]=-qf.offset.x+this._dimensions.device.char.left,t[Fd+1]=-qf.offset.y+this._dimensions.device.char.top,t[Fd+2]=qf.size.x/this._dimensions.device.canvas.width,t[Fd+3]=qf.size.y/this._dimensions.device.canvas.height,t[Fd+4]=qf.texturePage,t[Fd+5]=qf.texturePositionClipSpace.x,t[Fd+6]=qf.texturePositionClipSpace.y,t[Fd+7]=qf.sizeClipSpace.x,t[Fd+8]=qf.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&D9e(c,be,qf.size.x,this._dimensions.device.cell.width)&&(t[Fd+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*Zy;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let r=0;for(;r=t.rows||be<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=c,this.viewportStartRow=H,this.viewportEndRow=Z,this.viewportCappedStartRow=ue,this.viewportCappedEndRow=be,this.startCol=e[0],this.endCol=r[0]}isCellSelected(t,e,r){return this.hasSelection?(r-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&r>=this.viewportCappedStartRow&&e=this.viewportCappedStartRow&&e>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&e=this.startCol):!1}};function _Ee(){return new yEe}var oS=4,AT=1,MT=2,_M=3,xEe=2147483648,bEe=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=_Ee()}resize(t,e){let r=t*e*oS;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},wEe=`#version 300 es +}`}var Xy=11,_2=Xy*Float32Array.BYTES_PER_ELEMENT,VEe=2,Nd=0,Gf,xM=0,Q3=0,WEe=class extends Ug{constructor(t,e,r,c){super(),this._terminal=t,this._gl=e,this._dimensions=r,this._optionsService=c,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let S=this._gl;Yy.maxAtlasPages===void 0&&(Yy.maxAtlasPages=Math.min(32,xp(S.getParameter(S.MAX_TEXTURE_IMAGE_UNITS))),Yy.maxTextureSize=xp(S.getParameter(S.MAX_TEXTURE_SIZE))),this._program=xp(pW(S,$Ee,HEe(Yy.maxAtlasPages))),this._register(j0(()=>S.deleteProgram(this._program))),this._projectionLocation=xp(S.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=xp(S.getUniformLocation(this._program,"u_resolution")),this._textureLocation=xp(S.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),Z=S.createBuffer();this._register(j0(()=>S.deleteBuffer(Z))),S.bindBuffer(S.ARRAY_BUFFER,Z),S.bufferData(S.ARRAY_BUFFER,$,S.STATIC_DRAW),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let ue=new Uint8Array([0,1,2,3]),xe=S.createBuffer();this._register(j0(()=>S.deleteBuffer(xe))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,xe),S.bufferData(S.ELEMENT_ARRAY_BUFFER,ue,S.STATIC_DRAW),this._attributesBuffer=xp(S.createBuffer()),this._register(j0(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,2,S.FLOAT,!1,_2,0),S.vertexAttribDivisor(2,1),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,S.FLOAT,!1,_2,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(3,1),S.enableVertexAttribArray(4),S.vertexAttribPointer(4,1,S.FLOAT,!1,_2,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(4,1),S.enableVertexAttribArray(5),S.vertexAttribPointer(5,2,S.FLOAT,!1,_2,5*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(5,1),S.enableVertexAttribArray(6),S.vertexAttribPointer(6,2,S.FLOAT,!1,_2,7*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(6,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,_2,9*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.useProgram(this._program);let Se=new Int32Array(Yy.maxAtlasPages);for(let Ne=0;NeS.deleteTexture(it.texture))),S.activeTexture(S.TEXTURE0+Ne),S.bindTexture(S.TEXTURE_2D,it.texture),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Ne]=it}S.enable(S.BLEND),S.blendFunc(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,r,c,S,$,Z,ue,xe){this._updateCell(this._vertices.attributes,t,e,r,c,S,$,Z,ue,xe)}_updateCell(t,e,r,c,S,$,Z,ue,xe,Se){if(Nd=(r*this._terminal.cols+e)*Xy,c===0||c===void 0){t.fill(0,Nd,Nd+Xy-1-VEe);return}this._atlas&&(ue&&ue.length>1?Gf=this._atlas.getRasterizedGlyphCombinedChar(ue,S,$,Z,!1,this._terminal.element):Gf=this._atlas.getRasterizedGlyph(c,S,$,Z,!1,this._terminal.element),xM=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),S!==Se&&Gf.offset.x>xM?(Q3=Gf.offset.x-xM,t[Nd]=-(Gf.offset.x-Q3)+this._dimensions.device.char.left,t[Nd+1]=-Gf.offset.y+this._dimensions.device.char.top,t[Nd+2]=(Gf.size.x-Q3)/this._dimensions.device.canvas.width,t[Nd+3]=Gf.size.y/this._dimensions.device.canvas.height,t[Nd+4]=Gf.texturePage,t[Nd+5]=Gf.texturePositionClipSpace.x+Q3/this._atlas.pages[Gf.texturePage].canvas.width,t[Nd+6]=Gf.texturePositionClipSpace.y,t[Nd+7]=Gf.sizeClipSpace.x-Q3/this._atlas.pages[Gf.texturePage].canvas.width,t[Nd+8]=Gf.sizeClipSpace.y):(t[Nd]=-Gf.offset.x+this._dimensions.device.char.left,t[Nd+1]=-Gf.offset.y+this._dimensions.device.char.top,t[Nd+2]=Gf.size.x/this._dimensions.device.canvas.width,t[Nd+3]=Gf.size.y/this._dimensions.device.canvas.height,t[Nd+4]=Gf.texturePage,t[Nd+5]=Gf.texturePositionClipSpace.x,t[Nd+6]=Gf.texturePositionClipSpace.y,t[Nd+7]=Gf.sizeClipSpace.x,t[Nd+8]=Gf.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&sEe(c,xe,Gf.size.x,this._dimensions.device.cell.width)&&(t[Nd+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*Xy;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let r=0;for(;r=t.rows||xe<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=c,this.viewportStartRow=$,this.viewportEndRow=Z,this.viewportCappedStartRow=ue,this.viewportCappedEndRow=xe,this.startCol=e[0],this.endCol=r[0]}isCellSelected(t,e,r){return this.hasSelection?(r-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&r>=this.viewportCappedStartRow&&e=this.viewportCappedStartRow&&e>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r=this.startCol&&e=this.startCol):!1}};function GEe(){return new qEe}var l8=4,ET=1,LT=2,bM=3,ZEe=2147483648,KEe=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=GEe()}resize(t,e){let r=t*e*l8;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},YEe=`#version 300 es layout (location = 0) in vec2 a_position; layout (location = 1) in vec2 a_size; layout (location = 2) in vec4 a_color; @@ -4135,7 +4135,7 @@ void main() { vec2 zeroToOne = a_position + (a_unitquad * a_size); gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); v_color = a_color; -}`,kEe=`#version 300 es +}`,XEe=`#version 300 es precision lowp float; in vec4 v_color; @@ -4144,31 +4144,31 @@ out vec4 outColor; void main() { outColor = v_color; -}`,E1=8,xM=E1*Float32Array.BYTES_PER_ELEMENT,TEe=20*E1,SN=class{constructor(){this.attributes=new Float32Array(TEe),this.count=0}},w1=0,CN=0,AN=0,MN=0,EN=0,LN=0,PN=0,SEe=class extends Ug{constructor(t,e,r,c){super(),this._terminal=t,this._gl=e,this._dimensions=r,this._themeService=c,this._vertices=new SN,this._verticesCursor=new SN;let S=this._gl;this._program=_p(hW(S,wEe,kEe)),this._register(j0(()=>S.deleteProgram(this._program))),this._projectionLocation=_p(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let H=new Float32Array([0,0,1,0,0,1,1,1]),Z=S.createBuffer();this._register(j0(()=>S.deleteBuffer(Z))),S.bindBuffer(S.ARRAY_BUFFER,Z),S.bufferData(S.ARRAY_BUFFER,H,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let ue=new Uint8Array([0,1,2,3]),be=S.createBuffer();this._register(j0(()=>S.deleteBuffer(be))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,be),S.bufferData(S.ELEMENT_ARRAY_BUFFER,ue,S.STATIC_DRAW),this._attributesBuffer=_p(S.createBuffer()),this._register(j0(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,xM,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,xM,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,xM,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(c.colors),this._register(this._themeService.onChangeColors(Se=>{this._updateCachedColors(Se),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,cW),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,r=this._vertices,c=1,S,H,Z,ue,be,Se,Re,Xe,vt,bt,kt;for(S=0;S>24&255)/255,EN=(w1>>16&255)/255,LN=(w1>>8&255)/255,PN=1,this._addRectangle(t.attributes,e,CN,AN,(H-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,MN,EN,LN,PN)}_addRectangle(t,e,r,c,S,H,Z,ue,be,Se){t[e]=r/this._dimensions.device.canvas.width,t[e+1]=c/this._dimensions.device.canvas.height,t[e+2]=S/this._dimensions.device.canvas.width,t[e+3]=H/this._dimensions.device.canvas.height,t[e+4]=Z,t[e+5]=ue,t[e+6]=be,t[e+7]=Se}_addRectangleFloat(t,e,r,c,S,H,Z){t[e]=r/this._dimensions.device.canvas.width,t[e+1]=c/this._dimensions.device.canvas.height,t[e+2]=S/this._dimensions.device.canvas.width,t[e+3]=H/this._dimensions.device.canvas.height,t[e+4]=Z[0],t[e+5]=Z[1],t[e+6]=Z[2],t[e+7]=Z[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},CEe=class extends Ug{constructor(t,e,r,c,S,H,Z,ue){super(),this._container=e,this._alpha=S,this._coreBrowserService=H,this._optionsService=Z,this._themeService=ue,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=c.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(be=>{this._refreshCharAtlas(t,be),this.reset(t)})),this._register(j0(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=_p(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,r){}handleSelectionChanged(t,e,r,c=!1){}_setTransparency(t,e){if(e===this._alpha)return;let r=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=lW(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,r=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,r,c){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,c*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,c*this._deviceCellHeight))}_fillCharTrueColor(t,e,r,c){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=YV,this._clipCell(r,c,e.getWidth()),this._ctx.fillText(e.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,c*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,r){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,r){let c=e?t.options.fontWeightBold:t.options.fontWeight;return`${r?"italic":""} ${c} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},AEe=class extends CEe{constructor(t,e,r,c,S,H,Z){super(r,t,"link",e,!0,S,H,Z),this._register(c.onShowLinkUnderline(ue=>this._handleShowLinkUnderline(ue))),this._register(c.onHideLinkUnderline(ue=>this._handleHideLinkUnderline(ue)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&uEe(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e=0;X2.indexOf("AppleWebKit")>=0;var EEe=X2.indexOf("Chrome")>=0;!EEe&&X2.indexOf("Safari")>=0;X2.indexOf("Electron/")>=0;X2.indexOf("Android")>=0;var bM=!1;if(typeof Cx.matchMedia=="function"){let t=Cx.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Cx.matchMedia("(display-mode: fullscreen)");bM=t.matches,MEe(Cx,t,({matches:r})=>{bM&&e.matches||(bM=r)})}var C2="en",wM=!1,dW=!1,aT,ET=C2,IN=C2,LEe,A1,zx=globalThis,Gm;typeof zx.vscode<"u"&&typeof zx.vscode.process<"u"?Gm=zx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Gm=process);var PEe=typeof Gm?.versions?.electron=="string",IEe=PEe&&Gm?.type==="renderer";if(typeof Gm=="object"){Gm.platform,Gm.platform,wM=Gm.platform==="linux",wM&&Gm.env.SNAP&&Gm.env.SNAP_REVISION,Gm.env.CI||Gm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,aT=C2,ET=C2;let t=Gm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);aT=e.userLocale,IN=e.osLocale,ET=e.resolvedLanguage||C2,LEe=e.languagePack?.translationsConfigFile}catch{}dW=!0}else typeof navigator=="object"&&!IEe?(A1=navigator.userAgent,A1.indexOf("Windows")>=0,A1.indexOf("Macintosh")>=0,(A1.indexOf("Macintosh")>=0||A1.indexOf("iPad")>=0||A1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,wM=A1.indexOf("Linux")>=0,A1?.indexOf("Mobi")>=0,ET=globalThis._VSCODE_NLS_LANGUAGE||C2,aT=navigator.language.toLowerCase(),IN=aT):console.error("Unable to resolve platform.");var DN=dW,Rv=A1,$y=ET,DEe;(t=>{function e(){return $y}t.value=e;function r(){return $y.length===2?$y==="en":$y.length>=3?$y[0]==="e"&&$y[1]==="n"&&$y[2]==="-":!1}t.isDefaultVariant=r;function c(){return $y==="en"}t.isDefault=c})(DEe||={});var zEe=typeof zx.postMessage=="function"&&!zx.importScripts;(()=>{if(zEe){let t=[];zx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),zx.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var OEe=!!(Rv&&Rv.indexOf("Chrome")>=0);Rv&&Rv.indexOf("Firefox")>=0;!OEe&&Rv&&Rv.indexOf("Safari")>=0;Rv&&Rv.indexOf("Edg/")>=0;Rv&&Rv.indexOf("Android")>=0;var _2=typeof navigator=="object"?navigator:{};DN||document.queryCommandSupported&&document.queryCommandSupported("copy")||_2&&_2.clipboard&&_2.clipboard.writeText,DN||_2&&_2.clipboard&&_2.clipboard.readText;var mL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},kM=new mL,zN=new mL,ON=new mL;new Array(230);var BEe;(t=>{function e(ue){return kM.keyCodeToStr(ue)}t.toString=e;function r(ue){return kM.strToKeyCode(ue)}t.fromString=r;function c(ue){return zN.keyCodeToStr(ue)}t.toUserSettingsUS=c;function S(ue){return ON.keyCodeToStr(ue)}t.toUserSettingsGeneral=S;function H(ue){return zN.strToKeyCode(ue)||ON.strToKeyCode(ue)}t.fromUserSettings=H;function Z(ue){if(ue>=98&&ue<=113)return null;switch(ue){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return kM.keyCodeToStr(ue)}t.toElectronAccelerator=Z})(BEe||={});var pW=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),REe;(t=>{function e(r){return r===t.None||r===t.Cancelled||r instanceof FEe?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:R1.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:pW})})(REe||={});var FEe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?pW:(this._emitter||(this._emitter=new Kf),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},NEe;(t=>{async function e(c){let S,H=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return H}t.settled=e;function r(c){return new Promise(async(S,H)=>{try{await c(S,H)}catch(Z){H(Z)}})}t.withAsyncBody=r})(NEe||={});var BN=class dg{static fromArray(e){return new dg(r=>{r.emitMany(e)})}static fromPromise(e){return new dg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new dg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new dg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Kf,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new dg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return dg.map(this,e)}static filter(e,r){return new dg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return dg.filter(this,e)}static coalesce(e){return dg.filter(e,r=>!!r)}coalesce(){return dg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return dg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};BN.EMPTY=BN.fromArray([]);var{getWindow:jEe}=function(){let t=new Map,e={window:Cx,disposables:new D2};t.set(Cx.vscodeWindowId,e);let r=new Kf,c=new Kf,S=new Kf;function H(Z,ue){return(typeof Z=="number"?t.get(Z):void 0)??(ue?e:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:S.event,onDidUnregisterWindow:c.event,registerWindow(Z){if(t.has(Z.vscodeWindowId))return Ug.None;let ue=new D2,be={window:Z,disposables:ue.add(new D2)};return t.set(Z.vscodeWindowId,be),ue.add(j0(()=>{t.delete(Z.vscodeWindowId),c.fire(Z)})),ue.add(iE(Z,$Ee.BEFORE_UNLOAD,()=>{S.fire(Z)})),r.fire(be),ue},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(Z){return Z.vscodeWindowId},hasWindow(Z){return t.has(Z)},getWindowById:H,getWindow(Z){let ue=Z;if(ue?.ownerDocument?.defaultView)return ue.ownerDocument.defaultView.window;let be=Z;return be?.view?be.view.window:Cx},getDocument(Z){return jEe(Z).document}}}(),UEe=class{constructor(t,e,r,c){this._node=t,this._type=e,this._handler=r,this._options=c||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function iE(t,e,r,c){return new UEe(t,e,r,c)}var $Ee={BEFORE_UNLOAD:"beforeunload"},HEe=class extends Ug{constructor(t,e,r,c,S,H,Z,ue,be){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=r,this._coreBrowserService=c,this._coreService=S,this._decorationService=H,this._optionsService=Z,this._themeService=ue,this._cursorBlinkStateManager=new Z3,this._charAtlasDisposable=this._register(new Z3),this._observerDisposable=this._register(new Z3),this._model=new bEe,this._workCell=new kN,this._workCell2=new kN,this._rectangleRenderer=this._register(new Z3),this._glyphRenderer=this._register(new Z3),this._onChangeTextureAtlas=this._register(new Kf),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Kf),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Kf),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Kf),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Kf),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let Se={antialias:!1,depth:!1,preserveDrawingBuffer:be};if(this._gl=this._canvas.getContext("webgl2",Se),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new B9e(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new AEe(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,Z,this._themeService)],this.dimensions=z9e(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(Z.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(iE(this._canvas,"webglcontextlost",Re=>{console.log("webglcontextlost event received"),Re.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Re)},3e3)})),this._register(iE(this._canvas,"webglcontextrestored",Re=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,bN(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=wN(this._canvas,this._coreBrowserService.window,(Re,Xe)=>this._setCanvasDevicePixelDimensions(Re,Xe)),this._register(this._coreBrowserService.onWindowChange(Re=>{this._observerDisposable.value=wN(this._canvas,Re,(Xe,vt)=>this._setCanvasDevicePixelDimensions(Xe,vt))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(j0(()=>{for(let Re of this._renderLayers)Re.dispose();this._canvas.parentElement?.removeChild(this._canvas),bN(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,r){for(let c of this._renderLayers)c.handleSelectionChanged(this._terminal,t,e,r);this._model.selection.update(this._core,t,e,r),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new SEe(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new vEe(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=lW(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=WV(R1.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),R1.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new cEe(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let r=this._core,c=this._workCell,S,H,Z,ue,be,Se,Re=0,Xe=!0,vt,bt,kt,Dt,rr,Er,Fe,wi,ur;t=RN(t,r.rows-1,0),e=RN(e,r.rows-1,0);let Ir=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",Ti=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_i=Ti-r.buffer.ydisp,Ci=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),ii=-1,Ji=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let vi=!1;for(H=t;H<=e;H++)for(Z=H+r.buffer.ydisp,ue=r.buffer.lines.get(Z),this._model.lineLengths[H]=0,kt=Ti===Z,Re=0,be=this._characterJoinerService.getJoinedCharacters(Z),wi=0;wi=Re,vt=wi,be.length>0&&wi===be[0][0]&&Xe){bt=be.shift();let vr=this._model.selection.isCellSelected(this._terminal,bt[0],Z);for(Fe=bt[0]+1;Fe=bt[1],Xe?(Se=!0,c=new VEe(c,ue.translateToString(!0,bt[0],bt[1]),bt[1]-bt[0]),vt=bt[1]-1):Re=bt[1]}if(Dt=c.getChars(),rr=c.getCode(),Fe=(H*r.cols+wi)*oS,this._cellColorResolver.resolve(c,wi,Z,this.dimensions.device.cell.width),Ji&&Z===Ti&&(wi===Ci&&(this._model.cursor={x:Ci,y:_i,width:c.getWidth(),style:this._coreBrowserService.isFocused?Ir:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},ii=Ci+c.getWidth()-1),wi>=Ci&&wi<=ii&&(this._coreBrowserService.isFocused&&Ir==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),rr!==0&&(this._model.lineLengths[H]=wi+1),!(this._model.cells[Fe]===rr&&this._model.cells[Fe+AT]===this._cellColorResolver.result.bg&&this._model.cells[Fe+MT]===this._cellColorResolver.result.fg&&this._model.cells[Fe+_M]===this._cellColorResolver.result.ext)&&(vi=!0,Dt.length>1&&(rr|=xEe),this._model.cells[Fe]=rr,this._model.cells[Fe+AT]=this._cellColorResolver.result.bg,this._model.cells[Fe+MT]=this._cellColorResolver.result.fg,this._model.cells[Fe+_M]=this._cellColorResolver.result.ext,Er=c.getWidth(),this._glyphRenderer.value.updateCell(wi,H,rr,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Dt,Er,S),Se)){for(c=this._workCell,wi++;wi<=vt;wi++)ur=(H*r.cols+wi)*oS,this._glyphRenderer.value.updateCell(wi,H,0,0,0,0,A9e,0,0),this._model.cells[ur]=0,this._model.cells[ur+AT]=this._cellColorResolver.result.bg,this._model.cells[ur+MT]=this._cellColorResolver.result.fg,this._model.cells[ur+_M]=this._cellColorResolver.result.ext;wi--}}vi&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},VEe=class extends S2{constructor(t,e,r){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function RN(t,e,r=0){return Math.max(Math.min(t,e),r)}var FN="di$target",NN="di$dependencies",TM=new Map;function Fv(t){if(TM.has(t))return TM.get(t);let e=function(r,c,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");WEe(e,r,S)};return e._id=t,TM.set(t,e),e}function WEe(t,e,r){e[FN]===e?e[NN].push({id:t,index:r}):(e[NN]=[{id:t,index:r}],e[FN]=e)}Fv("BufferService");Fv("CoreMouseService");Fv("CoreService");Fv("CharsetService");Fv("InstantiationService");Fv("LogService");var qEe=Fv("OptionsService");Fv("OscLinkService");Fv("UnicodeService");Fv("DecorationService");var GEe={trace:0,debug:1,info:2,warn:3,error:4,off:5},ZEe="xterm.js: ",jN=class extends Ug{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=GEe[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;ethis.activate(t)));return}this._terminal=t;let r=e.coreService,c=e.optionsService,S=e,H=S._renderService,Z=S._characterJoinerService,ue=S._charSizeService,be=S._coreBrowserService,Se=S._decorationService;S._logService;let Re=S._themeService;this._renderer=this._register(new HEe(t,Z,ue,be,r,Se,c,Re,this._preserveDrawingBuffer)),this._register(R1.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(R1.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(R1.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(R1.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),H.setRenderer(this._renderer),this._register(j0(()=>{if(this._terminal._core._store._isDisposed)return;let Xe=this._terminal._core._renderService;Xe.setRenderer(this._terminal._core._createRenderer()),Xe.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};class V0{aliases;usage;matches(e){const r=e.toLowerCase();return r===this.name.toLowerCase()||(this.aliases?.some(c=>r===c.toLowerCase())??!1)}writeLine(e,r,c){c?e.writeln(`${c}${r}\x1B[0m`):e.writeln(r)}writeSuccess(e,r){e.writeln(`\x1B[1;32m✓\x1B[0m ${r}`)}writeError(e,r){e.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${r}`)}writeInfo(e,r){e.writeln(`\x1B[90m${r}\x1B[0m`)}startLoading(e,r){const c=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];let S=0,H=!0;const Z=setInterval(()=>{if(!H){clearInterval(Z);return}e.write(`\r\x1B[36m${c[S]}\x1B[0m ${r}`),S=(S+1)%c.length},80);return()=>{H=!1,clearInterval(Z),e.write("\r\x1B[K")}}}class YEe extends V0{constructor(e){super(),this.commands=e}name="help";description="Show available commands";aliases=["?","h"];execute({term:e,writePrompt:r}){e.writeln(""),e.writeln("\x1B[1;33mAvailable Commands:\x1B[0m"),e.writeln(""),this.commands.forEach(c=>{const S=c.aliases?.length?` (${c.aliases.join(", ")})`:"";e.writeln(` \x1B[1;36m${c.name.padEnd(15)}\x1B[0m ${c.description}${S}`)}),e.writeln(""),e.writeln("\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m"),r()}}class XEe extends V0{name="clear";description="Clear terminal screen";aliases=["cls"];execute({term:e,writePrompt:r}){e.clear(),r()}}class JEe extends V0{name="status";description="Show repeater status";aliases=["st"];async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching status...");try{const S=await zs.get("/stats");c();const H=S.success&&S.data?S.data:S;if(H&&typeof H=="object"){this.writeSuccess(e,"Repeater Status:"),e.writeln("");for(const[Z,ue]of Object.entries(H))e.writeln(` \x1B[36m${Z.padEnd(20)}\x1B[0m ${ue}`)}else this.writeError(e,"No status data available")}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch status")}r()}}class QEe extends V0{name="uptime";description="Show system uptime";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching uptime...");try{const S=await zs.get("/stats");c();const Z=(S.data||S).uptime_seconds||0,ue=this.formatUptime(Z);this.writeSuccess(e,ue)}catch(S){c(),this.writeError(e,`Failed to get uptime: ${S}`)}r()}formatUptime(e){const r=Math.floor(e/86400),c=Math.floor(e%86400/3600),S=Math.floor(e%3600/60);return r>0?`${r}d ${c}h ${S}m`:c>0?`${c}h ${S}m`:`${S}m`}}class eLe extends V0{name="packets";description="Show packet statistics";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching packet stats...");try{const S=await zs.get("/stats");c();const H=S.data||S;this.writeLine(e,""),this.isMobile()?(this.writeLine(e," \x1B[1;36mPacket Statistics\x1B[0m"),this.writeLine(e," \x1B[90mRX:\x1B[0m "+(H.rx_count||0)),this.writeLine(e," \x1B[90mTX:\x1B[0m "+(H.tx_count||0)),this.writeLine(e," \x1B[90mForward:\x1B[0m "+(H.forwarded_count||0)),this.writeLine(e," \x1B[90mDropped:\x1B[0m "+(H.dropped_count||0))):(this.writeLine(e," \x1B[36m┌──────────┬──────────┐\x1B[0m"),this.writeLine(e," \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m"),this.writeLine(e," \x1B[36m├──────────┼──────────┤\x1B[0m"),this.writeLine(e,` \x1B[36m│\x1B[0m RX \x1B[36m│\x1B[0m ${String(H.rx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m TX \x1B[36m│\x1B[0m ${String(H.tx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Forward \x1B[36m│\x1B[0m ${String(H.forwarded_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Dropped \x1B[36m│\x1B[0m ${String(H.dropped_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e," \x1B[36m└──────────┴──────────┘\x1B[0m")),this.writeLine(e,"")}catch(S){c(),this.writeError(e,`Failed to get packet stats: ${S}`)}r()}}class tLe extends V0{name="board";description="Show board information";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching board info...");try{const S=await zs.get("/stats");c();const Z=(S.data||S).board_info||"pyMC_Repeater (Linux/RPi)";this.writeSuccess(e,Z)}catch{c(),this.writeSuccess(e,"pyMC_Repeater (Linux/RPi)")}r()}}class rLe extends V0{name="advert";description="Send neighbor advert immediately";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Sending advert...");try{const S=await zs.post("/send_advert",{},{timeout:1e4});c(),S.success?this.writeSuccess(e,S.data||"Advert sent successfully"):this.writeError(e,S.error||"Failed to send advert")}catch(S){c(),this.writeError(e,`Failed to send advert: ${S}`)}r()}}class iLe extends V0{name="get";description="Get configuration values (name, freq, tx, mode, duty, etc.)";matches(e){return e.toLowerCase().startsWith("get ")}async execute({term:e,args:r,writePrompt:c}){const S=r[0]?.toLowerCase();if(!S){this.writeError(e,"Usage: get "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[36mname\x1B[0m Node name"),this.writeLine(e," \x1B[36mrole\x1B[0m Node role"),this.writeLine(e," \x1B[36mlat\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon\x1B[0m Longitude"),this.writeLine(e," \x1B[36mfreq\x1B[0m Frequency (MHz)"),this.writeLine(e," \x1B[36mtx\x1B[0m TX power (dBm)"),this.writeLine(e," \x1B[36mbw\x1B[0m Bandwidth (kHz)"),this.writeLine(e," \x1B[36msf\x1B[0m Spreading factor"),this.writeLine(e," \x1B[36mcr\x1B[0m Coding rate"),this.writeLine(e," \x1B[36mradio\x1B[0m All radio settings"),this.writeLine(e," \x1B[36mtxdelay\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay\x1B[0m Direct TX delay"),this.writeLine(e," \x1B[36mrxdelay\x1B[0m RX delay base"),this.writeLine(e," \x1B[36maf\x1B[0m Airtime factor"),this.writeLine(e," \x1B[36mmode\x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mrepeat\x1B[0m Repeat on/off"),this.writeLine(e," \x1B[36mflood.max\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval\x1B[0m Advert interval"),this.writeLine(e," \x1B[36mduty\x1B[0m Duty cycle enabled"),this.writeLine(e," \x1B[36mduty.max\x1B[0m Max airtime %"),this.writeLine(e," \x1B[36mpublic.key\x1B[0m Public key"),this.writeLine(e,""),c();return}const H=this.startLoading(e,"Fetching configuration...");try{const Z=await zs.get("/stats");H();const ue=Z.data||Z,be=ue.config||{},Se=be.radio||{},Re=be.repeater||{},Xe=be.delays||{},vt=be.duty_cycle||{};let bt="";switch(S){case"name":bt=be.node_name||"Unknown";break;case"role":bt="repeater";break;case"lat":bt=Re.latitude!=null?String(Re.latitude):"not set";break;case"lon":bt=Re.longitude!=null?String(Re.longitude):"not set";break;case"freq":bt=Se.frequency?`${(Se.frequency/1e6).toFixed(3)} MHz`:"?";break;case"tx":bt=Se.tx_power!=null?`${Se.tx_power}dBm`:"?";break;case"bw":bt=Se.bandwidth?`${Se.bandwidth/1e3} kHz`:"?";break;case"sf":bt=Se.spreading_factor!=null?String(Se.spreading_factor):"?";break;case"cr":bt=Se.coding_rate!=null?`4/${Se.coding_rate}`:"?";break;case"radio":if(Se.frequency){this.writeSuccess(e,"Radio Configuration:"),this.writeLine(e,""),this.writeLine(e,` \x1B[36mFrequency:\x1B[0m ${(Se.frequency/1e6).toFixed(3)} MHz`),this.writeLine(e,` \x1B[36mBandwidth:\x1B[0m ${Se.bandwidth/1e3} kHz`),this.writeLine(e,` \x1B[36mSpreading Factor:\x1B[0m ${Se.spreading_factor}`),this.writeLine(e,` \x1B[36mCoding Rate:\x1B[0m 4/${Se.coding_rate}`),this.writeLine(e,` \x1B[36mTX Power:\x1B[0m ${Se.tx_power}dBm`),this.writeLine(e,""),c();return}else bt="Radio configuration not available";break;case"af":case"txdelay":bt=Xe.tx_delay_factor!=null?String(Xe.tx_delay_factor):"\x1B[90mnot set (default: 1.0)\x1B[0m";break;case"direct.txdelay":bt=Xe.direct_tx_delay_factor!=null?String(Xe.direct_tx_delay_factor):"\x1B[90mnot set (default: 0.5)\x1B[0m";break;case"rxdelay":bt=Xe.rx_delay_base!=null?`${Xe.rx_delay_base}s`:"\x1B[90mnot set (default: 0.0s)\x1B[0m";break;case"mode":bt=Re.mode!=null?Re.mode:"\x1B[90mnot set (default: forward)\x1B[0m";break;case"repeat":Re.mode!=null?bt=Re.mode==="forward"?"on":"off":bt="\x1B[90mnot set (default: on)\x1B[0m";break;case"flood.max":bt=Re.max_flood_hops!=null?String(Re.max_flood_hops):"\x1B[90mnot set (default: 3)\x1B[0m";break;case"flood.advert.interval":bt=Re.send_advert_interval_hours!=null?`${Re.send_advert_interval_hours}h`:"\x1B[90mnot set\x1B[0m";break;case"advert.interval":bt=Re.advert_interval_minutes!=null?`${Re.advert_interval_minutes}m`:"\x1B[90mnot set (default: 120m)\x1B[0m";break;case"duty":case"duty.enabled":bt=vt.enforcement_enabled!=null?vt.enforcement_enabled?"on":"off":"\x1B[90mnot set (default: off)\x1B[0m";break;case"duty.max":bt=vt.max_airtime_percent!=null?`${vt.max_airtime_percent}%`:"\x1B[90mnot set\x1B[0m";break;case"public.key":bt=ue.public_key||"\x1B[90mnot available\x1B[0m";break;case"prv.key":this.writeWarning(e,"Private key not exposed via API for security"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),c();return;case"guest.password":case"allow.read.only":this.writeWarning(e,"Security settings not exposed via API"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),c();return;default:this.writeError(e,`Unknown parameter: ${S}`),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeInfo(e," Identity: name, role, lat, lon"),this.writeInfo(e," Radio: freq, tx, bw, sf, cr, radio"),this.writeInfo(e," Timing: txdelay, direct.txdelay, rxdelay, af"),this.writeInfo(e," Repeater: mode, repeat, flood.max, advert.interval"),this.writeInfo(e," Duty: duty, duty.max"),this.writeInfo(e," Security: public.key"),c();return}this.writeSuccess(e,bt)}catch(Z){H(),this.writeError(e,`Failed to get ${S}: ${Z}`)}c()}writeWarning(e,r){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class nLe extends V0{name="set";description="Set configuration values (tx, txdelay, mode, duty, etc.)";matches(e){return e.toLowerCase().startsWith("set ")}async execute({term:e,args:r,writePrompt:c}){const S=r[0]?.toLowerCase(),H=r.slice(1).join(" ").trim();if(!S){this.writeError(e,"Usage: set "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRadio:\x1B[0m"),this.writeLine(e," \x1B[36mtx <2-30>\x1B[0m TX power in dBm"),this.writeLine(e," \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*"),this.writeLine(e," \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*"),this.writeLine(e," \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*"),this.writeLine(e," \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*"),this.writeLine(e,""),this.writeLine(e," \x1B[33mTiming:\x1B[0m"),this.writeLine(e," \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor"),this.writeLine(e," \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)"),this.writeLine(e,""),this.writeLine(e," \x1B[33mIdentity:\x1B[0m"),this.writeLine(e," \x1B[36mname \x1B[0m Node name"),this.writeLine(e," \x1B[36mlat <-90 to 90>\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon <-180 to 180>\x1B[0m Longitude"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRepeater:\x1B[0m"),this.writeLine(e," \x1B[36mmode \x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mduty \x1B[0m Duty cycle enforcement"),this.writeLine(e," \x1B[36mflood.max <0-64>\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval \x1B[0m Local advert interval"),this.writeLine(e,""),c();return}const Z=this.startLoading(e,"Updating configuration...");try{let ue;switch(S){case"tx":{const Se=parseInt(H);if(isNaN(Se)||Se<2||Se>30){Z(),this.writeError(e,"TX power must be 2-30 dBm"),c();return}ue=await zs.post("/update_radio_config",{tx_power:Se},{timeout:3e4});break}case"freq":{const Se=parseFloat(H);if(isNaN(Se)||Se<100||Se>1e3){Z(),this.writeError(e,"Frequency must be 100-1000 MHz"),c();return}ue=await zs.post("/update_radio_config",{frequency:Se*1e6},{timeout:3e4});break}case"bw":{const Se=parseFloat(H),Re=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(Se)||!Re.includes(Se)){Z(),this.writeError(e,`Bandwidth must be one of: ${Re.join(", ")} kHz`),c();return}ue=await zs.post("/update_radio_config",{bandwidth:Se*1e3},{timeout:3e4});break}case"sf":{const Se=parseInt(H);if(isNaN(Se)||Se<5||Se>12){Z(),this.writeError(e,"Spreading factor must be 5-12"),c();return}ue=await zs.post("/update_radio_config",{spreading_factor:Se},{timeout:3e4});break}case"cr":{const Se=parseInt(H);if(isNaN(Se)||Se<5||Se>8){Z(),this.writeError(e,"Coding rate must be 5-8 (for 4/5 to 4/8)"),c();return}ue=await zs.post("/update_radio_config",{coding_rate:Se},{timeout:3e4});break}case"af":case"txdelay":{const Se=parseFloat(H);if(isNaN(Se)||Se<0||Se>5){Z(),this.writeError(e,"TX delay factor must be 0.0-5.0"),c();return}ue=await zs.post("/update_radio_config",{tx_delay_factor:Se},{timeout:3e4});break}case"direct.txdelay":{const Se=parseFloat(H);if(isNaN(Se)||Se<0||Se>5){Z(),this.writeError(e,"Direct TX delay factor must be 0.0-5.0"),c();return}ue=await zs.post("/update_radio_config",{direct_tx_delay_factor:Se},{timeout:3e4});break}case"rxdelay":{const Se=parseFloat(H);if(isNaN(Se)||Se<0){Z(),this.writeError(e,"RX delay must be >= 0"),c();return}ue=await zs.post("/update_radio_config",{rx_delay_base:Se},{timeout:3e4});break}case"name":{if(!H.trim()){Z(),this.writeError(e,"Node name cannot be empty"),c();return}ue=await zs.post("/update_radio_config",{node_name:H.trim()},{timeout:3e4});break}case"lat":{const Se=parseFloat(H);if(isNaN(Se)||Se<-90||Se>90){Z(),this.writeError(e,"Latitude must be -90 to 90"),c();return}ue=await zs.post("/update_radio_config",{latitude:Se},{timeout:3e4});break}case"lon":{const Se=parseFloat(H);if(isNaN(Se)||Se<-180||Se>180){Z(),this.writeError(e,"Longitude must be -180 to 180"),c();return}ue=await zs.post("/update_radio_config",{longitude:Se},{timeout:3e4});break}case"mode":{const Se=H.toLowerCase();if(Se!=="forward"&&Se!=="monitor"){Z(),this.writeError(e,'Mode must be "forward" or "monitor"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mforward\x1B[0m - Forward packets"),this.writeLine(e," \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)"),c();return}ue=await zs.post("/set_mode",{mode:Se},{timeout:3e4}),ue.data&&(ue.data.applied=[`mode=${Se}`],ue.data.persisted=!0,ue.data.live_update=!0);break}case"duty":{const Se=H.toLowerCase();if(Se!=="on"&&Se!=="off"){Z(),this.writeError(e,'Duty cycle must be "on" or "off"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mon\x1B[0m - Enable duty cycle enforcement"),this.writeLine(e," \x1B[36moff\x1B[0m - Disable duty cycle enforcement"),c();return}const Re=Se==="on";ue=await zs.post("/set_duty_cycle",{enabled:Re},{timeout:3e4}),ue.data&&(ue.data.applied=[`duty=${Se}`],ue.data.persisted=!0,ue.data.live_update=!0);break}case"flood.max":{const Se=parseInt(H);if(isNaN(Se)||Se<0||Se>64){Z(),this.writeError(e,"Max flood hops must be 0-64"),c();return}ue=await zs.post("/update_radio_config",{max_flood_hops:Se},{timeout:3e4});break}case"flood.advert.interval":{const Se=parseInt(H);if(isNaN(Se)||Se!==0&&(Se<3||Se>48)){Z(),this.writeError(e,"Flood advert interval must be 0 (off) or 3-48 hours"),c();return}ue=await zs.post("/update_radio_config",{flood_advert_interval_hours:Se},{timeout:3e4});break}case"advert.interval":{const Se=parseInt(H);if(isNaN(Se)||Se!==0&&(Se<1||Se>10080)){Z(),this.writeError(e,"Advert interval must be 0 (off) or 1-10080 minutes"),c();return}ue=await zs.post("/update_radio_config",{advert_interval_minutes:Se},{timeout:3e4});break}case"log":Z(),this.writeWarning(e,"Log level configuration not yet implemented"),this.writeInfo(e,"Backend endpoint /set_log_level does not exist"),c();return;default:Z(),this.writeError(e,`Unknown parameter: ${S}`),this.writeLine(e,""),this.writeInfo(e,'Type "set" without arguments to see available parameters'),c();return}Z();const be=ue.data||ue;ue.success?(be.applied&&be.applied.length>0?this.writeSuccess(e,`Configuration updated: ${be.applied.join(", ")}`):this.writeSuccess(e,"Configuration updated"),be.restart_required?(this.writeLine(e,""),this.writeWarning(e,"⚠ Service restart required for changes to take effect"),this.writeInfo(e,"Run: sudo systemctl restart pymc_repeater")):be.message&&!be.live_update&&(this.writeLine(e,""),this.writeInfo(e,be.message))):this.writeError(e,ue.error||"Failed to update configuration")}catch(ue){Z(),this.writeError(e,`Failed to update ${S}: ${ue}`)}this.writeLine(e,""),c()}writeWarning(e,r){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class aLe extends V0{name="identities";description="List all identities";aliases=["id","ids"];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching identities...");try{const S=await zs.getIdentities();c();let H=[];if(S.success&&S.data){const Z=S.data,ue=Z.registered||[],be=Z.configured||[];H=be.length>0?be:ue}else Array.isArray(S)&&(H=S);H.length===0?this.writeInfo(e,"No identities found"):(this.writeSuccess(e,`Found \x1B[1m${H.length}\x1B[0m identit${H.length===1?"y":"ies"}`),e.writeln(""),this.isMobile()?H.forEach((Z,ue)=>{e.writeln(`\x1B[1;36m[${ue+1}] ${Z.name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mType:\x1B[0m ${Z.type||"-"}`),e.writeln(` \x1B[90mHash:\x1B[0m ${Z.hash||"-"}`),e.writeln(` \x1B[90mAddress:\x1B[0m ${Z.address||"-"}`),e.writeln(` \x1B[90mRegistered:\x1B[0m ${Z.registered?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ue{const be=(ue+1).toString().padEnd(2),Se=(Z.name||"Unnamed").padEnd(27),Re=(Z.type||"-").padEnd(13),Xe=(Z.hash||"-").padEnd(4),vt=(Z.address||"-").padEnd(7),bt=(Z.registered?"yes":"no").padEnd(10);e.writeln(`\x1B[36m│\x1B[0m ${be} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Re} \x1B[36m│\x1B[0m ${Xe} \x1B[36m│\x1B[0m ${vt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m")))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch identities")}r()}}class oLe extends V0{name="keys";description="List transport keys";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching transport keys...");try{const S=await zs.getTransportKeys();c();const H=S.success&&S.data?S.data:S,Z=Array.isArray(H)?H:[];Z.length===0?this.writeInfo(e,"No transport keys found"):(this.writeSuccess(e,`Found \x1B[1m${Z.length}\x1B[0m transport key${Z.length===1?"":"s"}`),e.writeln(""),Z.forEach((ue,be)=>{e.writeln(`\x1B[36m${(be+1).toString().padStart(2)}.\x1B[0m \x1B[1m${ue.name||"Unnamed"}\x1B[0m`),ue.flood_policy&&e.writeln(` Policy: \x1B[90m${ue.flood_policy}\x1B[0m`),ue.parent_id&&e.writeln(` Parent: \x1B[90m${ue.parent_id}\x1B[0m`),be{if(e.writeln(`\x1B[1;36m[${ue+1}] ${Z.node_name||"Unknown"}\x1B[0m`),e.writeln(` \x1B[90mPubKey:\x1B[0m ${Z.pubkey?.substring(0,8)||"----"}`),e.writeln(` \x1B[90mType:\x1B[0m ${Z.contact_type||"-"}`),Z.last_seen){const be=new Date(Z.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});e.writeln(` \x1B[90mLast Seen:\x1B[0m ${be}`)}Z.rssi&&e.writeln(` \x1B[90mRSSI:\x1B[0m ${Z.rssi}`),Z.snr&&e.writeln(` \x1B[90mSNR:\x1B[0m ${Z.snr}`),e.writeln(` \x1B[90mAdverts:\x1B[0m ${Z.advert_count||0}`),e.writeln(` \x1B[90mDirect:\x1B[0m ${Z.zero_hop?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ue{const be=(ue+1).toString().padEnd(2),Se=(Z.node_name||"Unknown").padEnd(20),Re=(Z.pubkey?.substring(0,4)||"----").padEnd(6),Xe=(Z.contact_type||"-").padEnd(12),vt=Z.last_seen?new Date(Z.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).padEnd(20):"-".padEnd(20),bt=(Z.rssi?`${Z.rssi}`:"-").padEnd(8),kt=(Z.snr?`${Z.snr}`:"-").padEnd(4),Dt=(Z.advert_count?.toString()||"0").padEnd(6),rr=(Z.zero_hop?"yes":"no").padEnd(6);e.writeln(`\x1B[36m│\x1B[0m ${be} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Re} \x1B[36m│\x1B[0m ${Xe} \x1B[36m│\x1B[0m ${vt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m ${kt} \x1B[36m│\x1B[0m ${Dt} \x1B[36m│\x1B[0m ${rr} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m")),H.length>10&&(e.writeln(""),e.writeln(`\x1B[90m... and ${H.length-10} more neighbors\x1B[0m`)))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch neighbors")}r()}}class lLe extends V0{name="acl";description="Show ACL statistics";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching ACL stats...");try{const S=await zs.getACLStats();c();const H=S.success&&S.data?S.data:S;if(H&&typeof H=="object"){this.writeSuccess(e,"ACL Statistics:"),e.writeln("");const Z=(ue,be=" ")=>{if(typeof ue=="object"&&ue!==null&&!Array.isArray(ue))for(const[Se,Re]of Object.entries(ue))typeof Re=="object"&&Re!==null?(e.writeln(`${be}\x1B[90m${Se}:\x1B[0m`),Z(Re,be+" ")):e.writeln(`${be}\x1B[90m${Se.padEnd(18)}\x1B[0m ${Re}`);else e.writeln(`${be}${ue}`)};for(const[ue,be]of Object.entries(H))typeof be=="object"&&be!==null?(e.writeln(` \x1B[36m${ue}\x1B[0m`),Z(be," ")):e.writeln(` \x1B[36m${ue.padEnd(20)}\x1B[0m ${be}`)}else this.writeError(e,"No ACL data available")}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch ACL stats")}r()}}class uLe extends V0{name="rooms";description="List room servers";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching room stats...");try{const S=await zs.getRoomStats();c();let H=[];S.success&&S.data?H=S.data.rooms||(Array.isArray(S.data)?S.data:[]):Array.isArray(S)&&(H=S),H.length===0?this.writeInfo(e,"No room servers found"):(this.writeSuccess(e,`Found \x1B[1m${H.length}\x1B[0m room server${H.length===1?"":"s"}`),e.writeln(""),this.isMobile()?H.forEach((Z,ue)=>{e.writeln(`\x1B[1;36m[${ue+1}] ${Z.room_name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mMessages:\x1B[0m ${Z.total_messages||0}`),e.writeln(` \x1B[90mTotal Clients:\x1B[0m ${Z.total_clients||0}`),e.writeln(` \x1B[90mActive Clients:\x1B[0m ${Z.active_clients||0}`),e.writeln(` \x1B[90mSync:\x1B[0m ${Z.sync_running?"\x1B[32mrunning\x1B[0m":"\x1B[31mstopped\x1B[0m"}`),ue{const be=(ue+1).toString().padEnd(2),Se=(Z.room_name||"Unnamed").padEnd(27),Re=(Z.total_messages?.toString()||"0").padEnd(8),Xe=(Z.total_clients?.toString()||"0").padEnd(12),vt=(Z.active_clients?.toString()||"0").padEnd(14),bt=(Z.sync_running?"running":"stopped").padEnd(8);e.writeln(`\x1B[36m│\x1B[0m ${be} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Re} \x1B[36m│\x1B[0m ${Xe} \x1B[36m│\x1B[0m ${vt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m")))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch room stats")}r()}}class cLe extends V0{name="restart";description="Restart the pymc-repeater service";aliases=["reboot"];matches(e){const r=e.toLowerCase();return r==="restart"||r==="reboot"}async execute({term:e,writePrompt:r}){this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ This will restart the repeater service!\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Attempting to restart service...");const c=this.startLoading(e,"Restarting...");try{const S=await zs.post("/restart_service",{},{timeout:1e4});c(),S.success?(this.writeLine(e,""),this.writeSuccess(e,S.message||"Service restart initiated"),this.writeLine(e,""),this.writeInfo(e,"The service will restart momentarily. You may need to refresh this page.")):(this.writeLine(e,""),this.writeError(e,"Restart failed: "+(S.error||S.message||"Unknown error")),this.writeLine(e,""),this.writeInfo(e,"You may need to manually restart: sudo systemctl restart pymc-repeater"))}catch(S){c(),this.writeLine(e,"");const H=S;if(H.code==="ERR_NETWORK"||H.message?.includes("Network error")||H.message?.includes("ECONNRESET")||H.code==="ECONNRESET"){this.writeSuccess(e,"Service restart initiated successfully"),this.writeLine(e,""),await this.waitForServiceRestart(e,r);return}else H.code==="ECONNABORTED"||H.message?.includes("timeout")?(this.writeLine(e,"\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Refresh the page in a few seconds to reconnect.")):H.response?.status===403||H.response?.status===401?(this.writeError(e,"Permission denied. Polkit rules may need configuration."),this.writeLine(e,""),this.writeInfo(e,"Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;Se--)e.write(`\r\x1B[36m⏳\x1B[0m Restarting service... ${Se}s`),await new Promise(Re=>setTimeout(Re,1e3));e.write("\r\x1B[K");let Z=4,ue=0;const be="\r\x1B[36m⏳\x1B[0m Verifying restart (attempt ";for(;Z<20;){ue++,e.write(`${be}${ue})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){e.write("\r\x1B[K"),this.writeLine(e,""),this.writeSuccess(e,`Service is back online! (took ~${Z}s)`),this.writeLine(e,""),r();return}}catch(Se){const Re=Se;Re.code&&!["ERR_NETWORK","ECONNREFUSED","ECONNRESET"].includes(Re.code)&&e.write(`[${Re.code}] `)}await new Promise(Se=>setTimeout(Se,1*1e3)),Z+=1}e.write("\r\x1B[K"),this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"The service may still be starting. Try: status"),this.writeLine(e,""),r()}}class hLe extends V0{name="ping";description="Ping a neighbor node to measure latency and signal quality";usage="ping [timeout_seconds]";async execute({term:e,args:r,writePrompt:c}){if(r.length===0){this.writeError(e,"Missing target node"),e.writeln(""),this.writeInfo(e,`Usage: ${this.usage}`),e.writeln(""),this.writeInfo(e,"Examples:"),this.writeInfo(e," ping MyNeighbor - Ping node by name"),this.writeInfo(e," ping 0xb5 - Ping node by pubkey hash"),this.writeInfo(e," ping MyNeighbor 20 - Ping with 20s timeout"),c();return}const S=r[0],H=r.length>1?parseInt(r[1]):10;if(isNaN(H)||H<1||H>60){this.writeError(e,"Invalid timeout. Must be between 1-60 seconds"),c();return}let Z=null;const ue=S.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(ue)Z=`0x${ue[2].padStart(2,"0")}`;else{const Se=this.startLoading(e,"Resolving target...");try{const Re=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];let Xe=!1;for(const vt of Re)try{const bt=await zs.get("/adverts_by_contact_type",{contact_type:vt,hours:168}),kt=bt.success&&bt.data?bt.data:bt,rr=(Array.isArray(kt)?kt:[]).find(Er=>Er.node_name&&Er.node_name.toLowerCase()===S.toLowerCase());if(rr&&rr.pubkey){Z=`0x${rr.pubkey.substring(0,2)}`,Xe=!0;break}}catch{continue}if(Se(),!Xe){this.writeError(e,`Node '${S}' not found in neighbors`),e.writeln(""),this.writeInfo(e,"Try: neighbors - to list available nodes"),c();return}}catch(Re){Se(),this.writeError(e,`Failed to resolve target: ${Re}`),c();return}}this.writeLine(e,`\x1B[36mPinging ${S} (${Z}) with ${H}s timeout...\x1B[0m`),e.writeln("");const be=this.startLoading(e,"Waiting for response...");try{const Se=await zs.pingNeighbor(Z,H);if(be(),Se.success&&Se.data){const Re=Se.data;this.writeSuccess(e,`Reply from ${S} (${Re.target_id})`),e.writeln("");let Xe="\x1B[32m";if(Re.rtt_ms>500?Xe="\x1B[31m":Re.rtt_ms>250&&(Xe="\x1B[33m"),e.writeln(` \x1B[1mRound-Trip Time:\x1B[0m ${Xe}${Re.rtt_ms.toFixed(2)} ms\x1B[0m`),e.writeln(` \x1B[1mRSSI:\x1B[0m ${Re.rssi} dBm`),e.writeln(` \x1B[1mSNR:\x1B[0m ${Re.snr_db} dB`),Re.path&&Re.path.length>0){const kt=Re.path.join(" → "),Dt=Re.path.length;e.writeln(` \x1B[1mPath:\x1B[0m ${kt}`),e.writeln(` \x1B[1mHops:\x1B[0m ${Dt}`)}e.writeln("");let vt="Excellent",bt="\x1B[32m";Re.rtt_ms>500||Re.rssi<-120?(vt="Poor",bt="\x1B[31m"):Re.rtt_ms>250||Re.rssi<-100?(vt="Fair",bt="\x1B[33m"):(Re.rtt_ms>100||Re.rssi<-80)&&(vt="Good",bt="\x1B[36m"),e.writeln(` \x1B[1mLink Quality:\x1B[0m ${bt}${vt}\x1B[0m`)}else this.writeError(e,Se.error||"Ping failed")}catch(Se){be(),this.writeError(e,`Ping failed: ${Se.message||Se}`)}e.writeln(""),c()}}async function UN(){try{const t=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"],e=[];for(const r of t)try{const c=await zs.get("/adverts_by_contact_type",{contact_type:r,hours:168}),S=c.success&&c.data?c.data:c;(Array.isArray(S)?S:[]).forEach(Z=>{Z.node_name&&!e.includes(Z.node_name)&&e.push(Z.node_name)})}catch{continue}return e.sort()}catch{return[]}}class fLe{commands=[];constructor(){const e=new XEe,r=new JEe,c=new QEe,S=new eLe,H=new tLe,Z=new rLe,ue=new iLe,be=new nLe,Se=new aLe,Re=new oLe,Xe=new sLe,vt=new lLe,bt=new uLe,kt=new cLe,Dt=new hLe,rr=new YEe([e,r,c,S,H,Z,ue,be,Se,Re,Xe,vt,bt,kt,Dt]);this.commands=[rr,e,r,c,S,H,Z,ue,be,Se,Re,Xe,vt,bt,kt,Dt]}findCommand(e){return this.commands.find(r=>r.matches(e))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(e=>e.name)}}const dLe={class:"space-y-4 md:space-y-6"},pLe={class:"glass-card rounded-[15px] p-3 md:p-4"},mLe={class:"flex items-center justify-between"},gLe={class:"flex items-center gap-2 md:gap-3"},vLe=["title"],yLe={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},_Le={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},xLe={class:"hidden sm:inline"},bLe=["title"],wLe={class:"hidden sm:inline"},kLe=["title"],TLe={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},SLe={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},CLe={class:"hidden sm:inline"},ALe={key:0,class:"glass-card rounded-[15px] p-4"},MLe={class:"flex items-center gap-3"},ELe=["onKeydown"],LLe={key:1,class:"absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2"},PLe=Uu({name:"TerminalView",__name:"Terminal",setup(t){const e=vn(null),r=vn(null),c=vn(null),S=vn(""),H=vn(!1),Z=vn(!1),ue=vn(!1),be=vn(!1),Se=vn(!1);vn(0);let Re=null,Xe=null,vt=null,bt="";const kt=[];let Dt=-1,rr="";const Er=new fLe,Fe=Er.getCommandNames();let wi=[],ur=0;const Ir={get:["name","role","lat","lon","freq","tx","bw","sf","cr","radio","txdelay","direct.txdelay","rxdelay","af","mode","repeat","flood.max","advert.interval","duty","duty.max","public.key"],set:["tx","freq","bw","sf","cr","txdelay","direct.txdelay","rxdelay","name","lat","lon","mode","duty","flood.max","advert.interval","flood.advert.interval"],ping:[]},Ti={set:{mode:["forward","monitor"],duty:["on","off"]}},_i={get:{name:"Node name",role:"Node role",lat:"Latitude",lon:"Longitude",freq:"Frequency (MHz)",tx:"TX power (dBm)",bw:"Bandwidth (kHz)",sf:"Spreading factor",cr:"Coding rate",radio:"All radio settings",txdelay:"TX delay factor","direct.txdelay":"Direct TX delay",rxdelay:"RX delay base",af:"Airtime factor",mode:"Repeater mode",repeat:"Repeat on/off","flood.max":"Max flood hops","advert.interval":"Advert interval",duty:"Duty cycle enabled","duty.max":"Max airtime %","public.key":"Public key"},set:{tx:"TX power (2-30 dBm)",freq:"Frequency (100-1000 MHz) *restart required*",bw:"Bandwidth (7.8-500 kHz) *restart required*",sf:"Spreading factor (5-12) *restart required*",cr:"Coding rate (5-8) *restart required*",txdelay:"TX delay factor (0.0-5.0)","direct.txdelay":"Direct TX delay (0.0-5.0)",rxdelay:"RX delay base (>= 0)",name:"Node name",lat:"Latitude (-90 to 90)",lon:"Longitude (-180 to 180)",mode:"Repeater mode (forward/monitor)",duty:"Duty cycle (on/off)","flood.max":"Max flood hops (0-64)","advert.interval":"Advert interval (0 or 1-10080 mins)","flood.advert.interval":"Flood advert (0 or 3-48 hrs)"},ping:{}};ud(()=>{if(!e.value)return;ue.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const Yn=window.innerWidth<768;Re=new Q7e({cursorBlink:!1,cursorStyle:"underline",cursorWidth:3,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',fontSize:Yn?11:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:ue.value,theme:{background:"transparent",foreground:"#e0e0e0",cursor:"#00d9ff",cursorAccent:"#000000",selectionBackground:"#00d9ff40",selectionForeground:"#ffffff",black:"#000000",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd93d",blue:"#00d9ff",magenta:"#e599f7",cyan:"#00d9ff",white:"#e0e0e0",brightBlack:"#6c757d",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#74c0fc",brightMagenta:"#f3a6ff",brightCyan:"#3bc9db",brightWhite:"#ffffff"},scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),Xe=new rMe,Re.loadAddon(Xe);try{const Ra=new KEe;Re.loadAddon(Ra)}catch{console.warn("WebGL addon failed to load, falling back to canvas renderer")}const sn=new lMe((Ra,Ya)=>{window.open(Ya,"_blank")});Re.loadAddon(sn);const an=new p9e;if(Re.loadAddon(an),Re.unicode.activeVersion="11",vt=new UMe,Re.loadAddon(vt),Re.open(e.value),Xe.fit(),Re.focus(),ue.value&&r.value){const Ra=r.value,Ya=()=>{Ra.focus({preventScroll:!1})};e.value?.addEventListener("click",Ya),e.value?.addEventListener("touchstart",Ya),Ra.addEventListener("input",()=>{setTimeout(()=>{Re?.scrollToBottom()},10)}),Dv(()=>{e.value?.removeEventListener("click",Ya),e.value?.removeEventListener("touchstart",Ya)})}Re.writeln(""),Re.writeln("\x1B[1;37m ██████ ██ ██ ███ ███ ██████\x1B[0m"),Re.writeln("\x1B[1;37m ██ ██ ██ ██ ████ ████ ██ \x1B[0m"),Re.writeln("\x1B[1;37m ██████ ████ ██ ████ ██ ██ \x1B[0m"),Re.writeln("\x1B[1;37m ██ ██ ██ ██ ██ ██ \x1B[0m"),Re.writeln("\x1B[1;37m ██ ██ ██ ██ ██████\x1B[0m"),Re.writeln(""),Re.writeln("\x1B[1;36m Repeater Terminal\x1B[0m"),Re.writeln(""),Re.writeln("\x1B[90m Type \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),Re.writeln(""),Ci(),Re.onData(Ra=>{vi(Ra)});const zn=new ResizeObserver(()=>{Xe?.fit()});zn.observe(e.value),Dv(()=>{zn.disconnect(),Re?.dispose()})});const Ci=()=>{Re?.write(`\r -\x1B[1;36m❯\x1B[0m `)},ii=Yn=>{if(!(!Re||!Yn)){Re.write(`\x1B[90m${Yn}\x1B[0m`);for(let sn=0;sn{if(!(!Re||!rr)){for(let Yn=0;Yn{if(!Re)return;const sn=Yn.charCodeAt(0);if(sn===13){Ji(),Re.write(`\r -`),bt.trim()?(dr(bt.trim()),kt.push(bt.trim()),Dt=kt.length):Ci(),bt="";return}if(sn===127){bt.length>0&&(Ji(),bt=bt.slice(0,-1),Re.write("\b \b"),vr());return}if(sn===3){Ji(),Re.write(`^C\r -`),bt="",Ci();return}if(sn===12){Re.clear(),bt="",Ci();return}if(sn===6){H.value=!H.value;return}if(Yn==="\x1B[A"){kt.length>0&&Dt>0&&(Ji(),Dt--,Re.write("\r\x1B[K"),Ci(),bt=kt[Dt],Re.write(bt));return}if(Yn==="\x1B[B"){Ji(),Dt2&&Ti[Ra]){const _a=zn[1]?.toLowerCase(),Ur=zn.slice(2).join(" ").toLowerCase(),Mi=Ti[Ra][_a];if(Mi){const Xi=Mi.filter(oo=>oo.toLowerCase().startsWith(Ur));if(Xi.length===1){const oo=zn.slice(2).join(" "),go=Xi[0].slice(oo.length);bt+=go,Re.write(go)}else Xi.length>1&&(Re.write(`\r +}`,M1=8,wM=M1*Float32Array.BYTES_PER_ELEMENT,JEe=20*M1,AN=class{constructor(){this.attributes=new Float32Array(JEe),this.count=0}},b1=0,MN=0,EN=0,LN=0,PN=0,IN=0,DN=0,QEe=class extends Ug{constructor(t,e,r,c){super(),this._terminal=t,this._gl=e,this._dimensions=r,this._themeService=c,this._vertices=new AN,this._verticesCursor=new AN;let S=this._gl;this._program=xp(pW(S,YEe,XEe)),this._register(j0(()=>S.deleteProgram(this._program))),this._projectionLocation=xp(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);let $=new Float32Array([0,0,1,0,0,1,1,1]),Z=S.createBuffer();this._register(j0(()=>S.deleteBuffer(Z))),S.bindBuffer(S.ARRAY_BUFFER,Z),S.bufferData(S.ARRAY_BUFFER,$,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let ue=new Uint8Array([0,1,2,3]),xe=S.createBuffer();this._register(j0(()=>S.deleteBuffer(xe))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,xe),S.bufferData(S.ELEMENT_ARRAY_BUFFER,ue,S.STATIC_DRAW),this._attributesBuffer=xp(S.createBuffer()),this._register(j0(()=>S.deleteBuffer(this._attributesBuffer))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,wM,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,wM,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,wM,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(c.colors),this._register(this._themeService.onChangeColors(Se=>{this._updateCachedColors(Se),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,dW),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,r=this._vertices,c=1,S,$,Z,ue,xe,Se,Ne,it,pt,bt,wt;for(S=0;S>24&255)/255,PN=(b1>>16&255)/255,IN=(b1>>8&255)/255,DN=1,this._addRectangle(t.attributes,e,MN,EN,($-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,LN,PN,IN,DN)}_addRectangle(t,e,r,c,S,$,Z,ue,xe,Se){t[e]=r/this._dimensions.device.canvas.width,t[e+1]=c/this._dimensions.device.canvas.height,t[e+2]=S/this._dimensions.device.canvas.width,t[e+3]=$/this._dimensions.device.canvas.height,t[e+4]=Z,t[e+5]=ue,t[e+6]=xe,t[e+7]=Se}_addRectangleFloat(t,e,r,c,S,$,Z){t[e]=r/this._dimensions.device.canvas.width,t[e+1]=c/this._dimensions.device.canvas.height,t[e+2]=S/this._dimensions.device.canvas.width,t[e+3]=$/this._dimensions.device.canvas.height,t[e+4]=Z[0],t[e+5]=Z[1],t[e+6]=Z[2],t[e+7]=Z[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},eLe=class extends Ug{constructor(t,e,r,c,S,$,Z,ue){super(),this._container=e,this._alpha=S,this._coreBrowserService=$,this._optionsService=Z,this._themeService=ue,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=c.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(xe=>{this._refreshCharAtlas(t,xe),this.reset(t)})),this._register(j0(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=xp(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,r){}handleSelectionChanged(t,e,r,c=!1){}_setTransparency(t,e){if(e===this._alpha)return;let r=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=hW(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,r=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,r,c){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,c*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,c*this._deviceCellHeight))}_fillCharTrueColor(t,e,r,c){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=QV,this._clipCell(r,c,e.getWidth()),this._ctx.fillText(e.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,c*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,r){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,r){let c=e?t.options.fontWeightBold:t.options.fontWeight;return`${r?"italic":""} ${c} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},tLe=class extends eLe{constructor(t,e,r,c,S,$,Z){super(r,t,"link",e,!0,S,$,Z),this._register(c.onShowLinkUnderline(ue=>this._handleShowLinkUnderline(ue))),this._register(c.onHideLinkUnderline(ue=>this._handleHideLinkUnderline(ue)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&REe(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e=0;Q2.indexOf("AppleWebKit")>=0;var iLe=Q2.indexOf("Chrome")>=0;!iLe&&Q2.indexOf("Safari")>=0;Q2.indexOf("Electron/")>=0;Q2.indexOf("Android")>=0;var kM=!1;if(typeof Ex.matchMedia=="function"){let t=Ex.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Ex.matchMedia("(display-mode: fullscreen)");kM=t.matches,rLe(Ex,t,({matches:r})=>{kM&&e.matches||(kM=r)})}var A2="en",TM=!1,gW=!1,sT,PT=A2,zN=A2,nLe,C1,Rx=globalThis,Gm;typeof Rx.vscode<"u"&&typeof Rx.vscode.process<"u"?Gm=Rx.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Gm=process);var aLe=typeof Gm?.versions?.electron=="string",oLe=aLe&&Gm?.type==="renderer";if(typeof Gm=="object"){Gm.platform,Gm.platform,TM=Gm.platform==="linux",TM&&Gm.env.SNAP&&Gm.env.SNAP_REVISION,Gm.env.CI||Gm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sT=A2,PT=A2;let t=Gm.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);sT=e.userLocale,zN=e.osLocale,PT=e.resolvedLanguage||A2,nLe=e.languagePack?.translationsConfigFile}catch{}gW=!0}else typeof navigator=="object"&&!oLe?(C1=navigator.userAgent,C1.indexOf("Windows")>=0,C1.indexOf("Macintosh")>=0,(C1.indexOf("Macintosh")>=0||C1.indexOf("iPad")>=0||C1.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,TM=C1.indexOf("Linux")>=0,C1?.indexOf("Mobi")>=0,PT=globalThis._VSCODE_NLS_LANGUAGE||A2,sT=navigator.language.toLowerCase(),zN=sT):console.error("Unable to resolve platform.");var ON=gW,Bv=C1,Vy=PT,sLe;(t=>{function e(){return Vy}t.value=e;function r(){return Vy.length===2?Vy==="en":Vy.length>=3?Vy[0]==="e"&&Vy[1]==="n"&&Vy[2]==="-":!1}t.isDefaultVariant=r;function c(){return Vy==="en"}t.isDefault=c})(sLe||={});var lLe=typeof Rx.postMessage=="function"&&!Rx.importScripts;(()=>{if(lLe){let t=[];Rx.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let c=0,S=t.length;c{let c=++e;t.push({id:c,callback:r}),Rx.postMessage({vscodeScheduleAsyncWork:c},"*")}}return t=>setTimeout(t)})();var uLe=!!(Bv&&Bv.indexOf("Chrome")>=0);Bv&&Bv.indexOf("Firefox")>=0;!uLe&&Bv&&Bv.indexOf("Safari")>=0;Bv&&Bv.indexOf("Edg/")>=0;Bv&&Bv.indexOf("Android")>=0;var x2=typeof navigator=="object"?navigator:{};ON||document.queryCommandSupported&&document.queryCommandSupported("copy")||x2&&x2.clipboard&&x2.clipboard.writeText,ON||x2&&x2.clipboard&&x2.clipboard.readText;var vL=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},SM=new vL,BN=new vL,RN=new vL;new Array(230);var cLe;(t=>{function e(ue){return SM.keyCodeToStr(ue)}t.toString=e;function r(ue){return SM.strToKeyCode(ue)}t.fromString=r;function c(ue){return BN.keyCodeToStr(ue)}t.toUserSettingsUS=c;function S(ue){return RN.keyCodeToStr(ue)}t.toUserSettingsGeneral=S;function $(ue){return BN.strToKeyCode(ue)||RN.strToKeyCode(ue)}t.fromUserSettings=$;function Z(ue){if(ue>=98&&ue<=113)return null;switch(ue){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return SM.keyCodeToStr(ue)}t.toElectronAccelerator=Z})(cLe||={});var vW=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),hLe;(t=>{function e(r){return r===t.None||r===t.Cancelled||r instanceof fLe?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:F1.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vW})})(hLe||={});var fLe=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?vW:(this._emitter||(this._emitter=new Yf),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},dLe;(t=>{async function e(c){let S,$=await Promise.all(c.map(Z=>Z.then(ue=>ue,ue=>{S||(S=ue)})));if(typeof S<"u")throw S;return $}t.settled=e;function r(c){return new Promise(async(S,$)=>{try{await c(S,$)}catch(Z){$(Z)}})}t.withAsyncBody=r})(dLe||={});var FN=class pg{static fromArray(e){return new pg(r=>{r.emitMany(e)})}static fromPromise(e){return new pg(async r=>{r.emitMany(await e)})}static fromPromises(e){return new pg(async r=>{await Promise.all(e.map(async c=>r.emitOne(await c)))})}static merge(e){return new pg(async r=>{await Promise.all(e.map(async c=>{for await(let S of c)r.emitOne(S)}))})}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Yf,queueMicrotask(async()=>{let c={emitOne:S=>this.emitOne(S),emitMany:S=>this.emitMany(S),reject:S=>this.reject(S)};try{await Promise.resolve(e(c)),this.resolve()}catch(S){this.reject(S)}finally{c.emitOne=void 0,c.emitMany=void 0,c.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,r){return new pg(async c=>{for await(let S of e)c.emitOne(r(S))})}map(e){return pg.map(this,e)}static filter(e,r){return new pg(async c=>{for await(let S of e)r(S)&&c.emitOne(S)})}filter(e){return pg.filter(this,e)}static coalesce(e){return pg.filter(e,r=>!!r)}coalesce(){return pg.coalesce(this)}static async toPromise(e){let r=[];for await(let c of e)r.push(c);return r}toPromise(){return pg.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};FN.EMPTY=FN.fromArray([]);var{getWindow:pLe}=function(){let t=new Map,e={window:Ex,disposables:new z2};t.set(Ex.vscodeWindowId,e);let r=new Yf,c=new Yf,S=new Yf;function $(Z,ue){return(typeof Z=="number"?t.get(Z):void 0)??(ue?e:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:S.event,onDidUnregisterWindow:c.event,registerWindow(Z){if(t.has(Z.vscodeWindowId))return Ug.None;let ue=new z2,xe={window:Z,disposables:ue.add(new z2)};return t.set(Z.vscodeWindowId,xe),ue.add(j0(()=>{t.delete(Z.vscodeWindowId),c.fire(Z)})),ue.add(aE(Z,gLe.BEFORE_UNLOAD,()=>{S.fire(Z)})),r.fire(xe),ue},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(Z){return Z.vscodeWindowId},hasWindow(Z){return t.has(Z)},getWindowById:$,getWindow(Z){let ue=Z;if(ue?.ownerDocument?.defaultView)return ue.ownerDocument.defaultView.window;let xe=Z;return xe?.view?xe.view.window:Ex},getDocument(Z){return pLe(Z).document}}}(),mLe=class{constructor(t,e,r,c){this._node=t,this._type=e,this._handler=r,this._options=c||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function aE(t,e,r,c){return new mLe(t,e,r,c)}var gLe={BEFORE_UNLOAD:"beforeunload"},vLe=class extends Ug{constructor(t,e,r,c,S,$,Z,ue,xe){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=r,this._coreBrowserService=c,this._coreService=S,this._decorationService=$,this._optionsService=Z,this._themeService=ue,this._cursorBlinkStateManager=new Y3,this._charAtlasDisposable=this._register(new Y3),this._observerDisposable=this._register(new Y3),this._model=new KEe,this._workCell=new SN,this._workCell2=new SN,this._rectangleRenderer=this._register(new Y3),this._glyphRenderer=this._register(new Y3),this._onChangeTextureAtlas=this._register(new Yf),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Yf),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Yf),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Yf),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Yf),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let Se={antialias:!1,depth:!1,preserveDrawingBuffer:xe};if(this._gl=this._canvas.getContext("webgl2",Se),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new cEe(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tLe(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,Z,this._themeService)],this.dimensions=lEe(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(Z.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(aE(this._canvas,"webglcontextlost",Ne=>{console.log("webglcontextlost event received"),Ne.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(Ne)},3e3)})),this._register(aE(this._canvas,"webglcontextrestored",Ne=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,kN(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=TN(this._canvas,this._coreBrowserService.window,(Ne,it)=>this._setCanvasDevicePixelDimensions(Ne,it)),this._register(this._coreBrowserService.onWindowChange(Ne=>{this._observerDisposable.value=TN(this._canvas,Ne,(it,pt)=>this._setCanvasDevicePixelDimensions(it,pt))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(j0(()=>{for(let Ne of this._renderLayers)Ne.dispose();this._canvas.parentElement?.removeChild(this._canvas),kN(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,r){for(let c of this._renderLayers)c.handleSelectionChanged(this._terminal,t,e,r);this._model.selection.update(this._core,t,e,r),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new QEe(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new WEe(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=hW(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=ZV(F1.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),F1.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new FEe(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let r=this._core,c=this._workCell,S,$,Z,ue,xe,Se,Ne=0,it=!0,pt,bt,wt,Dt,Zt,Mr,ze,ni,or;t=NN(t,r.rows-1,0),e=NN(e,r.rows-1,0);let Cr=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",gi=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Si=gi-r.buffer.ydisp,Ci=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),ri=-1,on=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let yi=!1;for($=t;$<=e;$++)for(Z=$+r.buffer.ydisp,ue=r.buffer.lines.get(Z),this._model.lineLengths[$]=0,wt=gi===Z,Ne=0,xe=this._characterJoinerService.getJoinedCharacters(Z),ni=0;ni=Ne,pt=ni,xe.length>0&&ni===xe[0][0]&&it){bt=xe.shift();let gr=this._model.selection.isCellSelected(this._terminal,bt[0],Z);for(ze=bt[0]+1;ze=bt[1],it?(Se=!0,c=new yLe(c,ue.translateToString(!0,bt[0],bt[1]),bt[1]-bt[0]),pt=bt[1]-1):Ne=bt[1]}if(Dt=c.getChars(),Zt=c.getCode(),ze=($*r.cols+ni)*l8,this._cellColorResolver.resolve(c,ni,Z,this.dimensions.device.cell.width),on&&Z===gi&&(ni===Ci&&(this._model.cursor={x:Ci,y:Si,width:c.getWidth(),style:this._coreBrowserService.isFocused?Cr:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},ri=Ci+c.getWidth()-1),ni>=Ci&&ni<=ri&&(this._coreBrowserService.isFocused&&Cr==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),Zt!==0&&(this._model.lineLengths[$]=ni+1),!(this._model.cells[ze]===Zt&&this._model.cells[ze+ET]===this._cellColorResolver.result.bg&&this._model.cells[ze+LT]===this._cellColorResolver.result.fg&&this._model.cells[ze+bM]===this._cellColorResolver.result.ext)&&(yi=!0,Dt.length>1&&(Zt|=ZEe),this._model.cells[ze]=Zt,this._model.cells[ze+ET]=this._cellColorResolver.result.bg,this._model.cells[ze+LT]=this._cellColorResolver.result.fg,this._model.cells[ze+bM]=this._cellColorResolver.result.ext,Mr=c.getWidth(),this._glyphRenderer.value.updateCell(ni,$,Zt,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Dt,Mr,S),Se)){for(c=this._workCell,ni++;ni<=pt;ni++)or=($*r.cols+ni)*l8,this._glyphRenderer.value.updateCell(ni,$,0,0,0,0,tEe,0,0),this._model.cells[or]=0,this._model.cells[or+ET]=this._cellColorResolver.result.bg,this._model.cells[or+LT]=this._cellColorResolver.result.fg,this._model.cells[or+bM]=this._cellColorResolver.result.ext;ni--}}yi&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},yLe=class extends C2{constructor(t,e,r){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function NN(t,e,r=0){return Math.max(Math.min(t,e),r)}var jN="di$target",UN="di$dependencies",CM=new Map;function Rv(t){if(CM.has(t))return CM.get(t);let e=function(r,c,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");_Le(e,r,S)};return e._id=t,CM.set(t,e),e}function _Le(t,e,r){e[jN]===e?e[UN].push({id:t,index:r}):(e[UN]=[{id:t,index:r}],e[jN]=e)}Rv("BufferService");Rv("CoreMouseService");Rv("CoreService");Rv("CharsetService");Rv("InstantiationService");Rv("LogService");var xLe=Rv("OptionsService");Rv("OscLinkService");Rv("UnicodeService");Rv("DecorationService");var bLe={trace:0,debug:1,info:2,warn:3,error:4,off:5},wLe="xterm.js: ",$N=class extends Ug{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=bLe[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;ethis.activate(t)));return}this._terminal=t;let r=e.coreService,c=e.optionsService,S=e,$=S._renderService,Z=S._characterJoinerService,ue=S._charSizeService,xe=S._coreBrowserService,Se=S._decorationService;S._logService;let Ne=S._themeService;this._renderer=this._register(new vLe(t,Z,ue,xe,r,Se,c,Ne,this._preserveDrawingBuffer)),this._register(F1.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(F1.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(F1.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(F1.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),$.setRenderer(this._renderer),this._register(j0(()=>{if(this._terminal._core._store._isDisposed)return;let it=this._terminal._core._renderService;it.setRenderer(this._terminal._core._createRenderer()),it.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};class V0{aliases;usage;matches(e){const r=e.toLowerCase();return r===this.name.toLowerCase()||(this.aliases?.some(c=>r===c.toLowerCase())??!1)}writeLine(e,r,c){c?e.writeln(`${c}${r}\x1B[0m`):e.writeln(r)}writeSuccess(e,r){e.writeln(`\x1B[1;32m✓\x1B[0m ${r}`)}writeError(e,r){e.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${r}`)}writeInfo(e,r){e.writeln(`\x1B[90m${r}\x1B[0m`)}startLoading(e,r){const c=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];let S=0,$=!0;const Z=setInterval(()=>{if(!$){clearInterval(Z);return}e.write(`\r\x1B[36m${c[S]}\x1B[0m ${r}`),S=(S+1)%c.length},80);return()=>{$=!1,clearInterval(Z),e.write("\r\x1B[K")}}}class TLe extends V0{constructor(e){super(),this.commands=e}name="help";description="Show available commands";aliases=["?","h"];execute({term:e,writePrompt:r}){e.writeln(""),e.writeln("\x1B[1;33mAvailable Commands:\x1B[0m"),e.writeln(""),this.commands.forEach(c=>{const S=c.aliases?.length?` (${c.aliases.join(", ")})`:"";e.writeln(` \x1B[1;36m${c.name.padEnd(15)}\x1B[0m ${c.description}${S}`)}),e.writeln(""),e.writeln("\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m"),r()}}class SLe extends V0{name="clear";description="Clear terminal screen";aliases=["cls"];execute({term:e,writePrompt:r}){e.clear(),r()}}class CLe extends V0{name="status";description="Show repeater status";aliases=["st"];async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching status...");try{const S=await bs.get("/stats");c();const $=S.success&&S.data?S.data:S;if($&&typeof $=="object"){this.writeSuccess(e,"Repeater Status:"),e.writeln("");for(const[Z,ue]of Object.entries($))e.writeln(` \x1B[36m${Z.padEnd(20)}\x1B[0m ${ue}`)}else this.writeError(e,"No status data available")}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch status")}r()}}class ALe extends V0{name="uptime";description="Show system uptime";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching uptime...");try{const S=await bs.get("/stats");c();const Z=(S.data||S).uptime_seconds||0,ue=this.formatUptime(Z);this.writeSuccess(e,ue)}catch(S){c(),this.writeError(e,`Failed to get uptime: ${S}`)}r()}formatUptime(e){const r=Math.floor(e/86400),c=Math.floor(e%86400/3600),S=Math.floor(e%3600/60);return r>0?`${r}d ${c}h ${S}m`:c>0?`${c}h ${S}m`:`${S}m`}}class MLe extends V0{name="packets";description="Show packet statistics";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching packet stats...");try{const S=await bs.get("/stats");c();const $=S.data||S;this.writeLine(e,""),this.isMobile()?(this.writeLine(e," \x1B[1;36mPacket Statistics\x1B[0m"),this.writeLine(e," \x1B[90mRX:\x1B[0m "+($.rx_count||0)),this.writeLine(e," \x1B[90mTX:\x1B[0m "+($.tx_count||0)),this.writeLine(e," \x1B[90mForward:\x1B[0m "+($.forwarded_count||0)),this.writeLine(e," \x1B[90mDropped:\x1B[0m "+($.dropped_count||0))):(this.writeLine(e," \x1B[36m┌──────────┬──────────┐\x1B[0m"),this.writeLine(e," \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m"),this.writeLine(e," \x1B[36m├──────────┼──────────┤\x1B[0m"),this.writeLine(e,` \x1B[36m│\x1B[0m RX \x1B[36m│\x1B[0m ${String($.rx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m TX \x1B[36m│\x1B[0m ${String($.tx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Forward \x1B[36m│\x1B[0m ${String($.forwarded_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Dropped \x1B[36m│\x1B[0m ${String($.dropped_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e," \x1B[36m└──────────┴──────────┘\x1B[0m")),this.writeLine(e,"")}catch(S){c(),this.writeError(e,`Failed to get packet stats: ${S}`)}r()}}class ELe extends V0{name="board";description="Show board information";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching board info...");try{const S=await bs.get("/stats");c();const Z=(S.data||S).board_info||"pyMC_Repeater (Linux/RPi)";this.writeSuccess(e,Z)}catch{c(),this.writeSuccess(e,"pyMC_Repeater (Linux/RPi)")}r()}}class LLe extends V0{name="advert";description="Send neighbor advert immediately";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Sending advert...");try{const S=await bs.post("/send_advert",{},{timeout:1e4});c(),S.success?this.writeSuccess(e,S.data||"Advert sent successfully"):this.writeError(e,S.error||"Failed to send advert")}catch(S){c(),this.writeError(e,`Failed to send advert: ${S}`)}r()}}class PLe extends V0{name="get";description="Get configuration values (name, freq, tx, mode, duty, etc.)";matches(e){const r=e.toLowerCase();return r==="get"||r.startsWith("get ")}async execute({term:e,args:r,writePrompt:c}){const S=r[0]?.toLowerCase();if(!S){this.writeError(e,"Usage: get "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[36mname\x1B[0m Node name"),this.writeLine(e," \x1B[36mrole\x1B[0m Node role"),this.writeLine(e," \x1B[36mlat\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon\x1B[0m Longitude"),this.writeLine(e," \x1B[36mfreq\x1B[0m Frequency (MHz)"),this.writeLine(e," \x1B[36mtx\x1B[0m TX power (dBm)"),this.writeLine(e," \x1B[36mbw\x1B[0m Bandwidth (kHz)"),this.writeLine(e," \x1B[36msf\x1B[0m Spreading factor"),this.writeLine(e," \x1B[36mcr\x1B[0m Coding rate"),this.writeLine(e," \x1B[36mradio\x1B[0m All radio settings"),this.writeLine(e," \x1B[36mtxdelay\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay\x1B[0m Direct TX delay"),this.writeLine(e," \x1B[36mrxdelay\x1B[0m RX delay base"),this.writeLine(e," \x1B[36maf\x1B[0m Airtime factor"),this.writeLine(e," \x1B[36mmode\x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mrepeat\x1B[0m Repeat on/off"),this.writeLine(e," \x1B[36mflood.max\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval\x1B[0m Advert interval"),this.writeLine(e," \x1B[36mduty\x1B[0m Duty cycle enabled"),this.writeLine(e," \x1B[36mduty.max\x1B[0m Max airtime %"),this.writeLine(e," \x1B[36mpublic.key\x1B[0m Public key"),this.writeLine(e,""),c();return}const $=this.startLoading(e,"Fetching configuration...");try{const Z=await bs.get("/stats");$();const ue=Z.data||Z,xe=ue.config||{},Se=xe.radio||{},Ne=xe.repeater||{},it=xe.delays||{},pt=xe.duty_cycle||{};let bt="";switch(S){case"name":bt=xe.node_name||"Unknown";break;case"role":bt="repeater";break;case"lat":bt=Ne.latitude!=null?String(Ne.latitude):"not set";break;case"lon":bt=Ne.longitude!=null?String(Ne.longitude):"not set";break;case"freq":bt=Se.frequency?`${(Se.frequency/1e6).toFixed(3)} MHz`:"?";break;case"tx":bt=Se.tx_power!=null?`${Se.tx_power}dBm`:"?";break;case"bw":bt=Se.bandwidth?`${Se.bandwidth/1e3} kHz`:"?";break;case"sf":bt=Se.spreading_factor!=null?String(Se.spreading_factor):"?";break;case"cr":bt=Se.coding_rate!=null?`4/${Se.coding_rate}`:"?";break;case"radio":if(Se.frequency){this.writeSuccess(e,"Radio Configuration:"),this.writeLine(e,""),this.writeLine(e,` \x1B[36mFrequency:\x1B[0m ${(Se.frequency/1e6).toFixed(3)} MHz`),this.writeLine(e,` \x1B[36mBandwidth:\x1B[0m ${Se.bandwidth/1e3} kHz`),this.writeLine(e,` \x1B[36mSpreading Factor:\x1B[0m ${Se.spreading_factor}`),this.writeLine(e,` \x1B[36mCoding Rate:\x1B[0m 4/${Se.coding_rate}`),this.writeLine(e,` \x1B[36mTX Power:\x1B[0m ${Se.tx_power}dBm`),this.writeLine(e,""),c();return}else bt="Radio configuration not available";break;case"af":case"txdelay":bt=it.tx_delay_factor!=null?String(it.tx_delay_factor):"\x1B[90mnot set (default: 1.0)\x1B[0m";break;case"direct.txdelay":bt=it.direct_tx_delay_factor!=null?String(it.direct_tx_delay_factor):"\x1B[90mnot set (default: 0.5)\x1B[0m";break;case"rxdelay":bt=it.rx_delay_base!=null?`${it.rx_delay_base}s`:"\x1B[90mnot set (default: 0.0s)\x1B[0m";break;case"mode":bt=Ne.mode!=null?Ne.mode:"\x1B[90mnot set (default: forward)\x1B[0m";break;case"repeat":Ne.mode!=null?bt=Ne.mode==="forward"?"on":"off":bt="\x1B[90mnot set (default: on)\x1B[0m";break;case"flood.max":bt=Ne.max_flood_hops!=null?String(Ne.max_flood_hops):"\x1B[90mnot set (default: 3)\x1B[0m";break;case"flood.advert.interval":bt=Ne.send_advert_interval_hours!=null?`${Ne.send_advert_interval_hours}h`:"\x1B[90mnot set\x1B[0m";break;case"advert.interval":bt=Ne.advert_interval_minutes!=null?`${Ne.advert_interval_minutes}m`:"\x1B[90mnot set (default: 120m)\x1B[0m";break;case"duty":case"duty.enabled":bt=pt.enforcement_enabled!=null?pt.enforcement_enabled?"on":"off":"\x1B[90mnot set (default: off)\x1B[0m";break;case"duty.max":bt=pt.max_airtime_percent!=null?`${pt.max_airtime_percent}%`:"\x1B[90mnot set\x1B[0m";break;case"public.key":bt=ue.public_key||"\x1B[90mnot available\x1B[0m";break;case"prv.key":this.writeWarning(e,"Private key not exposed via API for security"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),c();return;case"guest.password":case"allow.read.only":this.writeWarning(e,"Security settings not exposed via API"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),c();return;default:this.writeError(e,`Unknown parameter: ${S}`),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeInfo(e," Identity: name, role, lat, lon"),this.writeInfo(e," Radio: freq, tx, bw, sf, cr, radio"),this.writeInfo(e," Timing: txdelay, direct.txdelay, rxdelay, af"),this.writeInfo(e," Repeater: mode, repeat, flood.max, advert.interval"),this.writeInfo(e," Duty: duty, duty.max"),this.writeInfo(e," Security: public.key"),c();return}this.writeSuccess(e,bt)}catch(Z){$(),this.writeError(e,`Failed to get ${S}: ${Z}`)}c()}writeWarning(e,r){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class ILe extends V0{name="set";description="Set configuration values (tx, txdelay, mode, duty, etc.)";matches(e){const r=e.toLowerCase();return r==="set"||r.startsWith("set ")}async execute({term:e,args:r,writePrompt:c}){const S=r[0]?.toLowerCase(),$=r.slice(1).join(" ").trim();if(!S){this.writeError(e,"Usage: set "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRadio:\x1B[0m"),this.writeLine(e," \x1B[36mtx <2-30>\x1B[0m TX power in dBm"),this.writeLine(e," \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*"),this.writeLine(e," \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*"),this.writeLine(e," \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*"),this.writeLine(e," \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*"),this.writeLine(e,""),this.writeLine(e," \x1B[33mTiming:\x1B[0m"),this.writeLine(e," \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor"),this.writeLine(e," \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)"),this.writeLine(e,""),this.writeLine(e," \x1B[33mIdentity:\x1B[0m"),this.writeLine(e," \x1B[36mname \x1B[0m Node name"),this.writeLine(e," \x1B[36mlat <-90 to 90>\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon <-180 to 180>\x1B[0m Longitude"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRepeater:\x1B[0m"),this.writeLine(e," \x1B[36mmode \x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mduty \x1B[0m Duty cycle enforcement"),this.writeLine(e," \x1B[36mflood.max <0-64>\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval \x1B[0m Local advert interval"),this.writeLine(e,""),c();return}const Z=this.startLoading(e,"Updating configuration...");try{let ue;switch(S){case"tx":{const Se=parseInt($);if(isNaN(Se)||Se<2||Se>30){Z(),this.writeError(e,"TX power must be 2-30 dBm"),c();return}ue=await bs.post("/update_radio_config",{tx_power:Se},{timeout:3e4});break}case"freq":{const Se=parseFloat($);if(isNaN(Se)||Se<100||Se>1e3){Z(),this.writeError(e,"Frequency must be 100-1000 MHz"),c();return}ue=await bs.post("/update_radio_config",{frequency:Se*1e6},{timeout:3e4});break}case"bw":{const Se=parseFloat($),Ne=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(Se)||!Ne.includes(Se)){Z(),this.writeError(e,`Bandwidth must be one of: ${Ne.join(", ")} kHz`),c();return}ue=await bs.post("/update_radio_config",{bandwidth:Se*1e3},{timeout:3e4});break}case"sf":{const Se=parseInt($);if(isNaN(Se)||Se<5||Se>12){Z(),this.writeError(e,"Spreading factor must be 5-12"),c();return}ue=await bs.post("/update_radio_config",{spreading_factor:Se},{timeout:3e4});break}case"cr":{const Se=parseInt($);if(isNaN(Se)||Se<5||Se>8){Z(),this.writeError(e,"Coding rate must be 5-8 (for 4/5 to 4/8)"),c();return}ue=await bs.post("/update_radio_config",{coding_rate:Se},{timeout:3e4});break}case"af":case"txdelay":{const Se=parseFloat($);if(isNaN(Se)||Se<0||Se>5){Z(),this.writeError(e,"TX delay factor must be 0.0-5.0"),c();return}ue=await bs.post("/update_radio_config",{tx_delay_factor:Se},{timeout:3e4});break}case"direct.txdelay":{const Se=parseFloat($);if(isNaN(Se)||Se<0||Se>5){Z(),this.writeError(e,"Direct TX delay factor must be 0.0-5.0"),c();return}ue=await bs.post("/update_radio_config",{direct_tx_delay_factor:Se},{timeout:3e4});break}case"rxdelay":{const Se=parseFloat($);if(isNaN(Se)||Se<0){Z(),this.writeError(e,"RX delay must be >= 0"),c();return}ue=await bs.post("/update_radio_config",{rx_delay_base:Se},{timeout:3e4});break}case"name":{if(!$.trim()){Z(),this.writeError(e,"Node name cannot be empty"),c();return}ue=await bs.post("/update_radio_config",{node_name:$.trim()},{timeout:3e4});break}case"lat":{const Se=parseFloat($);if(isNaN(Se)||Se<-90||Se>90){Z(),this.writeError(e,"Latitude must be -90 to 90"),c();return}ue=await bs.post("/update_radio_config",{latitude:Se},{timeout:3e4});break}case"lon":{const Se=parseFloat($);if(isNaN(Se)||Se<-180||Se>180){Z(),this.writeError(e,"Longitude must be -180 to 180"),c();return}ue=await bs.post("/update_radio_config",{longitude:Se},{timeout:3e4});break}case"mode":{const Se=$.toLowerCase();if(Se!=="forward"&&Se!=="monitor"){Z(),this.writeError(e,'Mode must be "forward" or "monitor"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mforward\x1B[0m - Forward packets"),this.writeLine(e," \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)"),c();return}ue=await bs.post("/set_mode",{mode:Se},{timeout:3e4}),ue.data&&(ue.data.applied=[`mode=${Se}`],ue.data.persisted=!0,ue.data.live_update=!0);break}case"duty":{const Se=$.toLowerCase();if(Se!=="on"&&Se!=="off"){Z(),this.writeError(e,'Duty cycle must be "on" or "off"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mon\x1B[0m - Enable duty cycle enforcement"),this.writeLine(e," \x1B[36moff\x1B[0m - Disable duty cycle enforcement"),c();return}const Ne=Se==="on";ue=await bs.post("/set_duty_cycle",{enabled:Ne},{timeout:3e4}),ue.data&&(ue.data.applied=[`duty=${Se}`],ue.data.persisted=!0,ue.data.live_update=!0);break}case"flood.max":{const Se=parseInt($);if(isNaN(Se)||Se<0||Se>64){Z(),this.writeError(e,"Max flood hops must be 0-64"),c();return}ue=await bs.post("/update_radio_config",{max_flood_hops:Se},{timeout:3e4});break}case"flood.advert.interval":{const Se=parseInt($);if(isNaN(Se)||Se!==0&&(Se<3||Se>48)){Z(),this.writeError(e,"Flood advert interval must be 0 (off) or 3-48 hours"),c();return}ue=await bs.post("/update_radio_config",{flood_advert_interval_hours:Se},{timeout:3e4});break}case"advert.interval":{const Se=parseInt($);if(isNaN(Se)||Se!==0&&(Se<1||Se>10080)){Z(),this.writeError(e,"Advert interval must be 0 (off) or 1-10080 minutes"),c();return}ue=await bs.post("/update_radio_config",{advert_interval_minutes:Se},{timeout:3e4});break}case"log":Z(),this.writeWarning(e,"Log level configuration not yet implemented"),this.writeInfo(e,"Backend endpoint /set_log_level does not exist"),c();return;default:Z(),this.writeError(e,`Unknown parameter: ${S}`),this.writeLine(e,""),this.writeInfo(e,'Type "set" without arguments to see available parameters'),c();return}Z();const xe=ue.data||ue;ue.success?(xe.applied&&xe.applied.length>0?this.writeSuccess(e,`Configuration updated: ${xe.applied.join(", ")}`):this.writeSuccess(e,"Configuration updated"),xe.restart_required?(this.writeLine(e,""),this.writeWarning(e,"⚠ Service restart required for changes to take effect"),this.writeInfo(e,"Run: sudo systemctl restart pymc_repeater")):xe.message&&!xe.live_update&&(this.writeLine(e,""),this.writeInfo(e,xe.message))):this.writeError(e,ue.error||"Failed to update configuration")}catch(ue){Z(),this.writeError(e,`Failed to update ${S}: ${ue}`)}this.writeLine(e,""),c()}writeWarning(e,r){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${r}`)}}class DLe extends V0{name="identities";description="List all identities";aliases=["id","ids"];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching identities...");try{const S=await bs.getIdentities();c();let $=[];if(S.success&&S.data){const Z=S.data,ue=Z.registered||[],xe=Z.configured||[];$=xe.length>0?xe:ue}else Array.isArray(S)&&($=S);$.length===0?this.writeInfo(e,"No identities found"):(this.writeSuccess(e,`Found \x1B[1m${$.length}\x1B[0m identit${$.length===1?"y":"ies"}`),e.writeln(""),this.isMobile()?$.forEach((Z,ue)=>{e.writeln(`\x1B[1;36m[${ue+1}] ${Z.name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mType:\x1B[0m ${Z.type||"-"}`),e.writeln(` \x1B[90mHash:\x1B[0m ${Z.hash||"-"}`),e.writeln(` \x1B[90mAddress:\x1B[0m ${Z.address||"-"}`),e.writeln(` \x1B[90mRegistered:\x1B[0m ${Z.registered?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ue<$.length-1&&e.writeln("")}):(e.writeln("\x1B[36m┌────┬─────────────────────────────┬───────────────┬──────┬─────────┬────────────┐\x1B[0m"),e.writeln("\x1B[36m│ # │ Name │ Type │ Hash │ Address │ Registered │\x1B[0m"),e.writeln("\x1B[36m├────┼─────────────────────────────┼───────────────┼──────┼─────────┼────────────┤\x1B[0m"),$.forEach((Z,ue)=>{const xe=(ue+1).toString().padEnd(2),Se=(Z.name||"Unnamed").padEnd(27),Ne=(Z.type||"-").padEnd(13),it=(Z.hash||"-").padEnd(4),pt=(Z.address||"-").padEnd(7),bt=(Z.registered?"yes":"no").padEnd(10);e.writeln(`\x1B[36m│\x1B[0m ${xe} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Ne} \x1B[36m│\x1B[0m ${it} \x1B[36m│\x1B[0m ${pt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m")))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch identities")}r()}}class zLe extends V0{name="keys";description="List transport keys";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching transport keys...");try{const S=await bs.getTransportKeys();c();const $=S.success&&S.data?S.data:S,Z=Array.isArray($)?$:[];Z.length===0?this.writeInfo(e,"No transport keys found"):(this.writeSuccess(e,`Found \x1B[1m${Z.length}\x1B[0m transport key${Z.length===1?"":"s"}`),e.writeln(""),Z.forEach((ue,xe)=>{e.writeln(`\x1B[36m${(xe+1).toString().padStart(2)}.\x1B[0m \x1B[1m${ue.name||"Unnamed"}\x1B[0m`),ue.flood_policy&&e.writeln(` Policy: \x1B[90m${ue.flood_policy}\x1B[0m`),ue.parent_id&&e.writeln(` Parent: \x1B[90m${ue.parent_id}\x1B[0m`),xe{if(e.writeln(`\x1B[1;36m[${ue+1}] ${Z.node_name||"Unknown"}\x1B[0m`),e.writeln(` \x1B[90mPubKey:\x1B[0m ${Z.pubkey?.substring(0,8)||"----"}`),e.writeln(` \x1B[90mType:\x1B[0m ${Z.contact_type||"-"}`),Z.last_seen){const xe=new Date(Z.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});e.writeln(` \x1B[90mLast Seen:\x1B[0m ${xe}`)}Z.rssi&&e.writeln(` \x1B[90mRSSI:\x1B[0m ${Z.rssi}`),Z.snr&&e.writeln(` \x1B[90mSNR:\x1B[0m ${Z.snr}`),e.writeln(` \x1B[90mAdverts:\x1B[0m ${Z.advert_count||0}`),e.writeln(` \x1B[90mDirect:\x1B[0m ${Z.zero_hop?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),ue{const xe=(ue+1).toString().padEnd(2),Se=(Z.node_name||"Unknown").padEnd(20),Ne=(Z.pubkey?.substring(0,4)||"----").padEnd(6),it=(Z.contact_type||"-").padEnd(12),pt=Z.last_seen?new Date(Z.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).padEnd(20):"-".padEnd(20),bt=(Z.rssi?`${Z.rssi}`:"-").padEnd(8),wt=(Z.snr?`${Z.snr}`:"-").padEnd(4),Dt=(Z.advert_count?.toString()||"0").padEnd(6),Zt=(Z.zero_hop?"yes":"no").padEnd(6);e.writeln(`\x1B[36m│\x1B[0m ${xe} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Ne} \x1B[36m│\x1B[0m ${it} \x1B[36m│\x1B[0m ${pt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m ${wt} \x1B[36m│\x1B[0m ${Dt} \x1B[36m│\x1B[0m ${Zt} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m")),$.length>10&&(e.writeln(""),e.writeln(`\x1B[90m... and ${$.length-10} more neighbors\x1B[0m`)))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch neighbors")}r()}}class BLe extends V0{name="acl";description="Show ACL statistics";async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching ACL stats...");try{const S=await bs.getACLStats();c();const $=S.success&&S.data?S.data:S;if($&&typeof $=="object"){this.writeSuccess(e,"ACL Statistics:"),e.writeln("");const Z=(ue,xe=" ")=>{if(typeof ue=="object"&&ue!==null&&!Array.isArray(ue))for(const[Se,Ne]of Object.entries(ue))typeof Ne=="object"&&Ne!==null?(e.writeln(`${xe}\x1B[90m${Se}:\x1B[0m`),Z(Ne,xe+" ")):e.writeln(`${xe}\x1B[90m${Se.padEnd(18)}\x1B[0m ${Ne}`);else e.writeln(`${xe}${ue}`)};for(const[ue,xe]of Object.entries($))typeof xe=="object"&&xe!==null?(e.writeln(` \x1B[36m${ue}\x1B[0m`),Z(xe," ")):e.writeln(` \x1B[36m${ue.padEnd(20)}\x1B[0m ${xe}`)}else this.writeError(e,"No ACL data available")}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch ACL stats")}r()}}class RLe extends V0{name="rooms";description="List room servers";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:r}){const c=this.startLoading(e,"Fetching room stats...");try{const S=await bs.getRoomStats();c();let $=[];S.success&&S.data?$=S.data.rooms||(Array.isArray(S.data)?S.data:[]):Array.isArray(S)&&($=S),$.length===0?this.writeInfo(e,"No room servers found"):(this.writeSuccess(e,`Found \x1B[1m${$.length}\x1B[0m room server${$.length===1?"":"s"}`),e.writeln(""),this.isMobile()?$.forEach((Z,ue)=>{e.writeln(`\x1B[1;36m[${ue+1}] ${Z.room_name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mMessages:\x1B[0m ${Z.total_messages||0}`),e.writeln(` \x1B[90mTotal Clients:\x1B[0m ${Z.total_clients||0}`),e.writeln(` \x1B[90mActive Clients:\x1B[0m ${Z.active_clients||0}`),e.writeln(` \x1B[90mSync:\x1B[0m ${Z.sync_running?"\x1B[32mrunning\x1B[0m":"\x1B[31mstopped\x1B[0m"}`),ue<$.length-1&&e.writeln("")}):(e.writeln("\x1B[36m┌────┬─────────────────────────────┬──────────┬──────────────┬────────────────┬──────────┐\x1B[0m"),e.writeln("\x1B[36m│ # │ Room Name │ Messages │ Total Clients│ Active Clients │ Sync │\x1B[0m"),e.writeln("\x1B[36m├────┼─────────────────────────────┼──────────┼──────────────┼────────────────┼──────────┤\x1B[0m"),$.forEach((Z,ue)=>{const xe=(ue+1).toString().padEnd(2),Se=(Z.room_name||"Unnamed").padEnd(27),Ne=(Z.total_messages?.toString()||"0").padEnd(8),it=(Z.total_clients?.toString()||"0").padEnd(12),pt=(Z.active_clients?.toString()||"0").padEnd(14),bt=(Z.sync_running?"running":"stopped").padEnd(8);e.writeln(`\x1B[36m│\x1B[0m ${xe} \x1B[36m│\x1B[0m \x1B[1m${Se}\x1B[0m \x1B[36m│\x1B[0m ${Ne} \x1B[36m│\x1B[0m ${it} \x1B[36m│\x1B[0m ${pt} \x1B[36m│\x1B[0m ${bt} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m")))}catch(S){c(),this.writeError(e,S instanceof Error?S.message:"Failed to fetch room stats")}r()}}class FLe extends V0{name="restart";description="Restart the pymc-repeater service";aliases=["reboot"];matches(e){const r=e.toLowerCase();return r==="restart"||r==="reboot"}async execute({term:e,writePrompt:r}){this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ This will restart the repeater service!\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Attempting to restart service...");const c=this.startLoading(e,"Restarting...");try{const S=await bs.post("/restart_service",{},{timeout:1e4});c(),S.success?(this.writeLine(e,""),this.writeSuccess(e,S.message||"Service restart initiated"),this.writeLine(e,""),this.writeInfo(e,"The service will restart momentarily. You may need to refresh this page.")):(this.writeLine(e,""),this.writeError(e,"Restart failed: "+(S.error||S.message||"Unknown error")),this.writeLine(e,""),this.writeInfo(e,"You may need to manually restart: sudo systemctl restart pymc-repeater"))}catch(S){c(),this.writeLine(e,"");const $=S;if($.code==="ERR_NETWORK"||$.message?.includes("Network error")||$.message?.includes("ECONNRESET")||$.code==="ECONNRESET"){this.writeSuccess(e,"Service restart initiated successfully"),this.writeLine(e,""),await this.waitForServiceRestart(e,r);return}else $.code==="ECONNABORTED"||$.message?.includes("timeout")?(this.writeLine(e,"\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Refresh the page in a few seconds to reconnect.")):$.response?.status===403||$.response?.status===401?(this.writeError(e,"Permission denied. Polkit rules may need configuration."),this.writeLine(e,""),this.writeInfo(e,"Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;Se--)e.write(`\r\x1B[36m⏳\x1B[0m Restarting service... ${Se}s`),await new Promise(Ne=>setTimeout(Ne,1e3));e.write("\r\x1B[K");let Z=4,ue=0;const xe="\r\x1B[36m⏳\x1B[0m Verifying restart (attempt ";for(;Z<20;){ue++,e.write(`${xe}${ue})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){e.write("\r\x1B[K"),this.writeLine(e,""),this.writeSuccess(e,`Service is back online! (took ~${Z}s)`),this.writeLine(e,""),r();return}}catch(Se){const Ne=Se;Ne.code&&!["ERR_NETWORK","ECONNREFUSED","ECONNRESET"].includes(Ne.code)&&e.write(`[${Ne.code}] `)}await new Promise(Se=>setTimeout(Se,1*1e3)),Z+=1}e.write("\r\x1B[K"),this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"The service may still be starting. Try: status"),this.writeLine(e,""),r()}}class NLe extends V0{name="ping";description="Ping a neighbor node to measure latency and signal quality";usage="ping [timeout_seconds]";async execute({term:e,args:r,writePrompt:c}){if(r.length===0){this.writeError(e,"Missing target node"),e.writeln(""),this.writeInfo(e,`Usage: ${this.usage}`),e.writeln(""),this.writeInfo(e,"Examples:"),this.writeInfo(e," ping MyNeighbor - Ping node by name"),this.writeInfo(e," ping 0xb5 - Ping node by pubkey hash"),this.writeInfo(e," ping MyNeighbor 20 - Ping with 20s timeout"),c();return}const S=r[0],$=r.length>1?parseInt(r[1]):10;if(isNaN($)||$<1||$>60){this.writeError(e,"Invalid timeout. Must be between 1-60 seconds"),c();return}let Z=null;const ue=S.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(ue)Z=`0x${ue[2].padStart(2,"0")}`;else{const Se=this.startLoading(e,"Resolving target...");try{const Ne=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];let it=!1;for(const pt of Ne)try{const bt=await bs.get("/adverts_by_contact_type",{contact_type:pt,hours:168}),wt=bt.success&&bt.data?bt.data:bt,Zt=(Array.isArray(wt)?wt:[]).find(Mr=>Mr.node_name&&Mr.node_name.toLowerCase()===S.toLowerCase());if(Zt&&Zt.pubkey){Z=`0x${Zt.pubkey.substring(0,2)}`,it=!0;break}}catch{continue}if(Se(),!it){this.writeError(e,`Node '${S}' not found in neighbors`),e.writeln(""),this.writeInfo(e,"Try: neighbors - to list available nodes"),c();return}}catch(Ne){Se(),this.writeError(e,`Failed to resolve target: ${Ne}`),c();return}}this.writeLine(e,`\x1B[36mPinging ${S} (${Z}) with ${$}s timeout...\x1B[0m`),e.writeln("");const xe=this.startLoading(e,"Waiting for response...");try{const Se=await bs.pingNeighbor(Z,$);if(xe(),Se.success&&Se.data){const Ne=Se.data;this.writeSuccess(e,`Reply from ${S} (${Ne.target_id})`),e.writeln("");let it="\x1B[32m";if(Ne.rtt_ms>500?it="\x1B[31m":Ne.rtt_ms>250&&(it="\x1B[33m"),e.writeln(` \x1B[1mRound-Trip Time:\x1B[0m ${it}${Ne.rtt_ms.toFixed(2)} ms\x1B[0m`),e.writeln(` \x1B[1mRSSI:\x1B[0m ${Ne.rssi} dBm`),e.writeln(` \x1B[1mSNR:\x1B[0m ${Ne.snr_db} dB`),Ne.path&&Ne.path.length>0){const wt=Ne.path.join(" → "),Dt=Ne.path.length;e.writeln(` \x1B[1mPath:\x1B[0m ${wt}`),e.writeln(` \x1B[1mHops:\x1B[0m ${Dt}`)}e.writeln("");let pt="Excellent",bt="\x1B[32m";Ne.rtt_ms>500||Ne.rssi<-120?(pt="Poor",bt="\x1B[31m"):Ne.rtt_ms>250||Ne.rssi<-100?(pt="Fair",bt="\x1B[33m"):(Ne.rtt_ms>100||Ne.rssi<-80)&&(pt="Good",bt="\x1B[36m"),e.writeln(` \x1B[1mLink Quality:\x1B[0m ${bt}${pt}\x1B[0m`)}else this.writeError(e,Se.error||"Ping failed")}catch(Se){xe(),this.writeError(e,`Ping failed: ${Se.message||Se}`)}e.writeln(""),c()}}async function HN(){try{const t=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"],e=[];for(const r of t)try{const c=await bs.get("/adverts_by_contact_type",{contact_type:r,hours:168}),S=c.success&&c.data?c.data:c;(Array.isArray(S)?S:[]).forEach(Z=>{Z.node_name&&!e.includes(Z.node_name)&&e.push(Z.node_name)})}catch{continue}return e.sort()}catch{return[]}}class jLe{commands=[];constructor(){const e=new SLe,r=new CLe,c=new ALe,S=new MLe,$=new ELe,Z=new LLe,ue=new PLe,xe=new ILe,Se=new DLe,Ne=new zLe,it=new OLe,pt=new BLe,bt=new RLe,wt=new FLe,Dt=new NLe,Zt=new TLe([e,r,c,S,$,Z,ue,xe,Se,Ne,it,pt,bt,wt,Dt]);this.commands=[Zt,e,r,c,S,$,Z,ue,xe,Se,Ne,it,pt,bt,wt,Dt]}findCommand(e){return this.commands.find(r=>r.matches(e))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(e=>e.name)}}const ULe={class:"space-y-4 md:space-y-6"},$Le={class:"glass-card rounded-[15px] p-3 md:p-4"},HLe={class:"flex items-center justify-between"},VLe={class:"flex items-center gap-2 md:gap-3"},WLe=["title"],qLe={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},GLe={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ZLe={class:"hidden sm:inline"},KLe=["title"],YLe={class:"hidden sm:inline"},XLe=["title"],JLe={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},QLe={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ePe={class:"hidden sm:inline"},tPe={key:0,class:"glass-card rounded-[15px] p-4"},rPe={class:"flex items-center gap-3"},iPe=["onKeydown"],nPe={key:1,class:"absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2"},aPe=Bu({name:"TerminalView",__name:"Terminal",setup(t){const e=fn(null),r=fn(null),c=fn(null),S=fn(""),$=fn(!1),Z=fn(!1),ue=fn(!1),xe=fn(!1),Se=fn(!1);fn(0);let Ne=null,it=null,pt=null,bt="";const wt=[];let Dt=-1,Zt="";const Mr=new jLe,ze=Mr.getCommandNames();let ni=[],or=0;const Cr={get:["name","role","lat","lon","freq","tx","bw","sf","cr","radio","txdelay","direct.txdelay","rxdelay","af","mode","repeat","flood.max","advert.interval","duty","duty.max","public.key"],set:["tx","freq","bw","sf","cr","txdelay","direct.txdelay","rxdelay","name","lat","lon","mode","duty","flood.max","advert.interval","flood.advert.interval"],ping:[]},gi={set:{mode:["forward","monitor"],duty:["on","off"]}},Si={get:{name:"Node name",role:"Node role",lat:"Latitude",lon:"Longitude",freq:"Frequency (MHz)",tx:"TX power (dBm)",bw:"Bandwidth (kHz)",sf:"Spreading factor",cr:"Coding rate",radio:"All radio settings",txdelay:"TX delay factor","direct.txdelay":"Direct TX delay",rxdelay:"RX delay base",af:"Airtime factor",mode:"Repeater mode",repeat:"Repeat on/off","flood.max":"Max flood hops","advert.interval":"Advert interval",duty:"Duty cycle enabled","duty.max":"Max airtime %","public.key":"Public key"},set:{tx:"TX power (2-30 dBm)",freq:"Frequency (100-1000 MHz) *restart required*",bw:"Bandwidth (7.8-500 kHz) *restart required*",sf:"Spreading factor (5-12) *restart required*",cr:"Coding rate (5-8) *restart required*",txdelay:"TX delay factor (0.0-5.0)","direct.txdelay":"Direct TX delay (0.0-5.0)",rxdelay:"RX delay base (>= 0)",name:"Node name",lat:"Latitude (-90 to 90)",lon:"Longitude (-180 to 180)",mode:"Repeater mode (forward/monitor)",duty:"Duty cycle (on/off)","flood.max":"Max flood hops (0-64)","advert.interval":"Advert interval (0 or 1-10080 mins)","flood.advert.interval":"Flood advert (0 or 3-48 hrs)"},ping:{}};Jf(()=>{if(!e.value)return;ue.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const qn=window.innerWidth<768;Ne=new AMe({cursorBlink:!1,cursorStyle:"underline",cursorWidth:3,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',fontSize:qn?11:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:ue.value,theme:{background:"transparent",foreground:"#e0e0e0",cursor:"#00d9ff",cursorAccent:"#000000",selectionBackground:"#00d9ff40",selectionForeground:"#ffffff",black:"#000000",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd93d",blue:"#00d9ff",magenta:"#e599f7",cyan:"#00d9ff",white:"#e0e0e0",brightBlack:"#6c757d",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#74c0fc",brightMagenta:"#f3a6ff",brightCyan:"#3bc9db",brightWhite:"#ffffff"},scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),it=new LMe,Ne.loadAddon(it);try{const Ra=new kLe;Ne.loadAddon(Ra)}catch{console.warn("WebGL addon failed to load, falling back to canvas renderer")}const ln=new BMe((Ra,Xa)=>{window.open(Xa,"_blank")});Ne.loadAddon(ln);const nn=new $9e;if(Ne.loadAddon(nn),Ne.unicode.activeVersion="11",pt=new m9e,Ne.loadAddon(pt),Ne.open(e.value),it.fit(),Ne.focus(),ue.value&&r.value){const Ra=r.value,Xa=()=>{Ra.focus({preventScroll:!1})};e.value?.addEventListener("click",Xa),e.value?.addEventListener("touchstart",Xa),Ra.addEventListener("input",()=>{setTimeout(()=>{Ne?.scrollToBottom()},10)}),Iv(()=>{e.value?.removeEventListener("click",Xa),e.value?.removeEventListener("touchstart",Xa)})}Ne.writeln(""),Ne.writeln("\x1B[1;37m ██████ ██ ██ ███ ███ ██████\x1B[0m"),Ne.writeln("\x1B[1;37m ██ ██ ██ ██ ████ ████ ██ \x1B[0m"),Ne.writeln("\x1B[1;37m ██████ ████ ██ ████ ██ ██ \x1B[0m"),Ne.writeln("\x1B[1;37m ██ ██ ██ ██ ██ ██ \x1B[0m"),Ne.writeln("\x1B[1;37m ██ ██ ██ ██ ██████\x1B[0m"),Ne.writeln(""),Ne.writeln("\x1B[1;36m Repeater Terminal\x1B[0m"),Ne.writeln(""),Ne.writeln("\x1B[90m Type \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),Ne.writeln(""),Ci(),Ne.onData(Ra=>{yi(Ra)});const On=new ResizeObserver(()=>{it?.fit()});On.observe(e.value),Iv(()=>{On.disconnect(),Ne?.dispose()})});const Ci=()=>{Ne?.write(`\r +\x1B[1;36m❯\x1B[0m `)},ri=qn=>{if(!(!Ne||!qn)){Ne.write(`\x1B[90m${qn}\x1B[0m`);for(let ln=0;ln{if(!(!Ne||!Zt)){for(let qn=0;qn{if(!Ne)return;const ln=qn.charCodeAt(0);if(ln===13){on(),Ne.write(`\r +`),bt.trim()?(fr(bt.trim()),wt.push(bt.trim()),Dt=wt.length):Ci(),bt="";return}if(ln===127){bt.length>0&&(on(),bt=bt.slice(0,-1),Ne.write("\b \b"),gr());return}if(ln===3){on(),Ne.write(`^C\r +`),bt="",Ci();return}if(ln===12){Ne.clear(),bt="",Ci();return}if(ln===6){$.value=!$.value;return}if(qn==="\x1B[A"){wt.length>0&&Dt>0&&(on(),Dt--,Ne.write("\r\x1B[K"),Ci(),bt=wt[Dt],Ne.write(bt));return}if(qn==="\x1B[B"){on(),Dt2&&gi[Ra]){const xa=On[1]?.toLowerCase(),$r=On.slice(2).join(" ").toLowerCase(),Mi=gi[Ra][xa];if(Mi){const Xi=Mi.filter(so=>so.toLowerCase().startsWith($r));if(Xi.length===1){const so=On.slice(2).join(" "),go=Xi[0].slice(so.length);bt+=go,Ne.write(go)}else Xi.length>1&&(Ne.write(`\r \r \x1B[33mAvailable values:\x1B[0m\r \r -`),Xi.forEach(oo=>{Re.writeln(` \x1B[36m${oo}\x1B[0m`)}),Ci(),Re.write(bt));return}}if(zn.length>1&&Ir[Ra]){if(Ra==="ping"){const Mi=zn.slice(1).join(" ").toLowerCase(),Xi=Date.now();Xi-ur>3e4&&UN().then(go=>{wi=go,ur=Xi,Ir.ping=go});const oo=wi.filter(go=>go.toLowerCase().startsWith(Mi));if(oo.length===1){const go=zn.slice(1).join(" "),ko=oo[0].slice(go.length)+" ";bt+=ko,Re.write(ko)}else oo.length>1?(Re.write(`\r +`),Xi.forEach(so=>{Ne.writeln(` \x1B[36m${so}\x1B[0m`)}),Ci(),Ne.write(bt));return}}if(On.length>1&&Cr[Ra]){if(Ra==="ping"){const Mi=On.slice(1).join(" ").toLowerCase(),Xi=Date.now();Xi-or>3e4&&HN().then(go=>{ni=go,or=Xi,Cr.ping=go});const so=ni.filter(go=>go.toLowerCase().startsWith(Mi));if(so.length===1){const go=On.slice(1).join(" "),ko=so[0].slice(go.length)+" ";bt+=ko,Ne.write(ko)}else so.length>1?(Ne.write(`\r \r \x1B[33mAvailable neighbors:\x1B[0m\r \r -`),oo.forEach(go=>{Re.writeln(` \x1B[36m${go}\x1B[0m`)}),Ci(),Re.write(bt)):wi.length===0&&Mi===""&&(Re.write(`\r +`),so.forEach(go=>{Ne.writeln(` \x1B[36m${go}\x1B[0m`)}),Ci(),Ne.write(bt)):ni.length===0&&Mi===""&&(Ne.write(`\r \r \x1B[33mFetching neighbors...\x1B[0m\r -`),UN().then(go=>{wi=go,ur=Xi,Ir.ping=go,Re.write(`\r +`),HN().then(go=>{ni=go,or=Xi,Cr.ping=go,Ne.write(`\r \x1B[33mAvailable neighbors:\x1B[0m\r \r -`),go.forEach(ko=>{Re.writeln(` \x1B[36m${ko}\x1B[0m`)}),Ci(),Re.write(bt)}).catch(()=>{Re.write(`\r +`),go.forEach(ko=>{Ne.writeln(` \x1B[36m${ko}\x1B[0m`)}),Ci(),Ne.write(bt)}).catch(()=>{Ne.write(`\r \x1B[31mFailed to fetch neighbors\x1B[0m\r -`),Ci(),Re.write(bt)}));return}const _a=zn.slice(1).join(" ").toLowerCase(),Ur=Ir[Ra].filter(Mi=>Mi.toLowerCase().startsWith(_a));if(Ur.length===1){const Mi=zn.slice(1).join(" "),Xi=Ur[0].slice(Mi.length)+" ";bt+=Xi,Re.write(Xi)}else if(Ur.length>1){Re.write(`\r +`),Ci(),Ne.write(bt)}));return}const xa=On.slice(1).join(" ").toLowerCase(),$r=Cr[Ra].filter(Mi=>Mi.toLowerCase().startsWith(xa));if($r.length===1){const Mi=On.slice(1).join(" "),Xi=$r[0].slice(Mi.length)+" ";bt+=Xi,Ne.write(Xi)}else if($r.length>1){Ne.write(`\r \r \x1B[33mAvailable parameters:\x1B[0m\r \r -`);const Mi=_i[Ra]||{};Ur.forEach(Xi=>{const oo=Mi[Xi]||"",go=Xi.padEnd(20);Re.writeln(` \x1B[36m${go}\x1B[0m\x1B[90m${oo}\x1B[0m`)}),Ci(),Re.write(bt)}return}const zo=Er.getAllCommands().filter(_a=>!!(_a.name.toLowerCase().startsWith(an)||_a.aliases?.some(Ur=>Ur.toLowerCase().startsWith(an))));if(zo.length===1){const _a=zo[0].name.slice(bt.length)+" ";bt+=_a,Re.write(_a)}else zo.length>1&&(Re.write(`\r +`);const Mi=Si[Ra]||{};$r.forEach(Xi=>{const so=Mi[Xi]||"",go=Xi.padEnd(20);Ne.writeln(` \x1B[36m${go}\x1B[0m\x1B[90m${so}\x1B[0m`)}),Ci(),Ne.write(bt)}return}const zo=Mr.getAllCommands().filter(xa=>!!(xa.name.toLowerCase().startsWith(nn)||xa.aliases?.some($r=>$r.toLowerCase().startsWith(nn))));if(zo.length===1){const xa=zo[0].name.slice(bt.length)+" ";bt+=xa,Ne.write(xa)}else zo.length>1&&(Ne.write(`\r \r \x1B[33mAvailable commands:\x1B[0m\r \r -`),zo.forEach(_a=>{const Ur=_a.aliases&&_a.aliases.length>0?` (${_a.aliases.join(", ")})`:"";Re.writeln(` \x1B[36m${_a.name.padEnd(15)}\x1B[0m ${_a.description}${Ur}`)}),Ci(),Re.write(bt));return}sn>=32&&sn<127&&(Ji(),bt+=Yn,Re.write(Yn),ue.value||vr())},vr=()=>{if(bt.length===0){rr="";return}const Yn=Fe.filter(sn=>sn.startsWith(bt.toLowerCase()));Yn.length===1&&Yn[0]!==bt?(rr=Yn[0].slice(bt.length),ii(rr)):rr=""},dr=async Yn=>{if(!Re)return;const sn=Yn.trim(),[an,...zn]=sn.split(/\s+/),Ra=Er.findCommand(an);if(Ra)try{await Ra.execute({term:Re,args:zn,writePrompt:Ci})}catch(Ya){console.error("Command execution error:",Ya),Re.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${Ya instanceof Error?Ya.message:"Command failed"}`),Ci()}else Re.writeln(`\x1B[1;31m✗ Unknown command:\x1B[0m ${an}`),Re.writeln("\x1B[90mType \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),Ci()},Ar=()=>{!vt||!S.value||vt.findNext(S.value,{caseSensitive:!1})},ti=()=>{!vt||!S.value||vt.findPrevious(S.value,{caseSensitive:!1})},Xr=()=>{H.value=!1,S.value="",Re?.focus()},ei=async()=>{if(c.value){if(be.value)try{document.exitFullscreen&&await document.exitFullscreen(),be.value=!1}catch(Yn){console.error("Failed to exit fullscreen:",Yn)}else try{c.value.requestFullscreen&&await c.value.requestFullscreen(),be.value=!0,setTimeout(()=>{ue.value&&r.value?r.value.focus():Re&&Re.focus()},100)}catch(Yn){console.error("Failed to enter fullscreen:",Yn)}setTimeout(()=>{Xe?.fit()},100)}},Di=()=>{Se.value=!Se.value,Se.value&&ue.value&&setTimeout(()=>{window.scrollTo(0,1)},100),setTimeout(()=>{ue.value&&r.value?r.value.focus():Re?.focus(),Xe?.fit()},150)},qn=()=>{Se.value=!1,setTimeout(()=>{Xe?.fit()},100)};typeof document<"u"&&(document.addEventListener("fullscreenchange",()=>{be.value=!!document.fullscreenElement,setTimeout(()=>Xe?.fit(),100)}),document.addEventListener("keydown",Yn=>{Yn.key==="Escape"&&Se.value&&!be.value&&qn()}),document.addEventListener("keydown",Yn=>{Yn.key==="Escape"&&Se.value&&!be.value&&qn()}));const Qn=()=>{ue.value&&r.value&&r.value.focus()},ka=Yn=>{const sn=Yn.target,an=sn.value;if(an&&Re){const zn=an.slice(-1);vi(zn)}sn.value=""},Ta=()=>{Re&&vi("\r"),r.value&&(r.value.value="")},so=()=>{Re&&vi(""),r.value&&(r.value.value="")};return(Yn,sn)=>(Wr(),Qr("div",dLe,[Le("div",pLe,[Le("div",mLe,[sn[8]||(sn[8]=Le("div",null,[Le("h1",{class:"text-white text-lg md:text-xl font-semibold"},"Terminal"),Le("p",{class:"text-dark-text text-sm hidden md:block"},"Interactive command-line interface")],-1)),Le("div",gLe,[ue.value?(Wr(),Qr("button",{key:0,onClick:Di,class:"flex items-center gap-2 px-3 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:Se.value?"Exit fullscreen":"Enter fullscreen"},[Se.value?(Wr(),Qr("svg",_Le,sn[3]||(sn[3]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Wr(),Qr("svg",yLe,sn[2]||(sn[2]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Le("span",xLe,Si(Se.value?"Exit":"Fullscreen"),1)],8,vLe)):Ma("",!0),ue.value?Ma("",!0):(Wr(),Qr("button",{key:1,onClick:Di,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:Se.value?"Exit full window":"Full window"},[sn[4]||(sn[4]=Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1)),Le("span",wLe,Si(Se.value?"Exit Window":"Full Window"),1)],8,bLe)),ue.value?Ma("",!0):(Wr(),Qr("button",{key:2,onClick:ei,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:be.value?"Exit fullscreen":"Fullscreen"},[be.value?(Wr(),Qr("svg",SLe,sn[6]||(sn[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(Wr(),Qr("svg",TLe,sn[5]||(sn[5]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Le("span",CLe,Si(be.value?"Exit Full":"Fullscreen"),1)],8,kLe)),Le("button",{onClick:sn[0]||(sn[0]=an=>H.value=!H.value),class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors"},sn[7]||(sn[7]=[Le("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),Le("span",{class:"hidden sm:inline"},"Search",-1)]))])])]),H.value?(Wr(),Qr("div",ALe,[Le("div",MLe,[Sl(Le("input",{"onUpdate:modelValue":sn[1]||(sn[1]=an=>S.value=an),onKeydown:[bx(Ar,["enter"]),bx(Xr,["esc"])],type:"text",placeholder:"Search terminal output...",class:"flex-1 px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 outline-none focus:border-primary/50 transition-colors"},null,544),[[sc,S.value]]),Le("button",{onClick:ti,class:"px-3 py-2 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg text-white transition-colors",title:"Previous (Shift+Enter)"}," ↑ "),Le("button",{onClick:Ar,class:"px-3 py-2 bg-primary/20 hover:bg-primary/30 border border-primary/50 rounded-lg text-primary transition-colors",title:"Next (Enter)"}," ↓ "),Le("button",{onClick:Xr,class:"px-3 py-2 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg text-white transition-colors"}," ✕ ")])])):Ma("",!0),Le("div",{ref_key:"terminalContainerRef",ref:c,class:eo(["glass-card rounded-[15px] overflow-hidden relative",{"fullscreen-terminal":be.value,"full-window-terminal":Se.value}])},[Se.value&&!be.value?(Wr(),Qr("button",{key:0,onClick:qn,class:"absolute top-4 right-4 z-50 p-2 bg-black/80 backdrop-blur-sm hover:bg-black/90 text-white border border-white/20 rounded-lg transition-colors",title:"Exit full window (ESC)"},sn[9]||(sn[9]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))):Ma("",!0),Le("div",{ref_key:"terminalRef",ref:e,class:eo(["terminal-container",{"fullscreen-content":be.value}]),onClick:Qn,onTouchstart:Qn},[ue.value?(Wr(),Qr("input",{key:0,ref_key:"mobileInputRef",ref:r,type:"text",class:"mobile-keyboard-input",onInput:ka,onKeydown:[bx(Yf(Ta,["prevent"]),["enter"]),bx(so,["delete"])],inputmode:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},null,40,ELe)):Ma("",!0)],34),Z.value?(Wr(),Qr("div",LLe,sn[10]||(sn[10]=[Le("div",{class:"w-2 h-2 bg-primary rounded-full animate-pulse"},null,-1),Le("span",{class:"text-primary text-sm font-medium"},"Processing...",-1)]))):Ma("",!0)],2)]))}}),ILe=kh(PLe,[["__scopeId","data-v-8d4a6a2a"]]),DLe=Uu({name:"HelpView",__name:"Help",setup(t){return(e,r)=>(Wr(),Qr("div",null,r[0]||(r[0]=[qc('

Help & Documentation

pyMC Repeater Wiki

Access documentation, setup guides, troubleshooting tips, and community resources on our official wiki.

Visit Wiki Documentation
Opens in a new tab
',1)])))}}),zLe={class:"bg-[#1A1E1F] border border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},OLe={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},BLe={class:"text-red-400 text-sm"},RLe={key:1,class:"bg-green-500/10 border border-green-500/30 rounded-lg p-3"},FLe={class:"text-green-400 text-sm"},NLe={class:"flex justify-end gap-3 mt-6"},jLe=["disabled"],ULe=["disabled"],$Le={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},HLe=Uu({name:"ChangePasswordModal",__name:"ChangePasswordModal",props:{isOpen:{type:Boolean},canSkip:{type:Boolean,default:!0}},emits:["close","success"],setup(t,{emit:e}){const r=e,c=vn(""),S=vn(""),H=vn(""),Z=vn(!1),ue=vn(""),be=vn(""),Se=()=>{Z.value||r("close")},Re=()=>{r("close")},Xe=async()=>{if(ue.value="",be.value="",S.value.length<8){ue.value="New password must be at least 8 characters long";return}if(S.value!==H.value){ue.value="Passwords do not match";return}if(S.value===c.value){ue.value="New password must be different from current password";return}Z.value=!0;try{const bt=(await J2.post("/auth/change_password",{current_password:c.value,new_password:S.value})).data;bt&&bt.success?(be.value=bt.message||"Password changed successfully!",setTimeout(()=>{r("success"),r("close")},1500)):ue.value=bt?.error||"Failed to change password"}catch(vt){console.error("Password change error:",vt),ue.value=vt.response?.data?.error||"Failed to change password. Please try again."}finally{Z.value=!1}};return(vt,bt)=>vt.isOpen?(Wr(),Qr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:Yf(Se,["self"])},[Le("div",zLe,[bt[6]||(bt[6]=Le("h3",{class:"text-xl font-semibold text-white mb-2"},"Change Default Password",-1)),bt[7]||(bt[7]=Le("p",{class:"text-white/70 text-sm mb-6"}," You're using the default password. Please change it to secure your account. ",-1)),Le("form",{onSubmit:Yf(Xe,["prevent"]),class:"space-y-4"},[Le("div",null,[bt[3]||(bt[3]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Current Password",-1)),Sl(Le("input",{"onUpdate:modelValue":bt[0]||(bt[0]=kt=>c.value=kt),type:"password",required:"",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter current password"},null,512),[[sc,c.value]])]),Le("div",null,[bt[4]||(bt[4]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"New Password",-1)),Sl(Le("input",{"onUpdate:modelValue":bt[1]||(bt[1]=kt=>S.value=kt),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter new password (min 8 characters)"},null,512),[[sc,S.value]])]),Le("div",null,[bt[5]||(bt[5]=Le("label",{class:"block text-sm font-medium text-white/70 mb-2"},"Confirm New Password",-1)),Sl(Le("input",{"onUpdate:modelValue":bt[2]||(bt[2]=kt=>H.value=kt),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white/5 border border-white/10 rounded-lg text-white placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Confirm new password"},null,512),[[sc,H.value]])]),ue.value?(Wr(),Qr("div",OLe,[Le("p",BLe,Si(ue.value),1)])):Ma("",!0),be.value?(Wr(),Qr("div",RLe,[Le("p",FLe,Si(be.value),1)])):Ma("",!0),Le("div",NLe,[vt.canSkip?(Wr(),Qr("button",{key:0,type:"button",onClick:Re,disabled:Z.value,class:"px-4 py-2 bg-white/5 hover:bg-white/10 text-white rounded-lg border border-white/10 transition-colors disabled:opacity-50"}," Skip for Now ",8,jLe)):Ma("",!0),Le("button",{type:"submit",disabled:Z.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2"},[Z.value?(Wr(),Qr("div",$Le)):Ma("",!0),ul(" "+Si(Z.value?"Changing...":"Change Password"),1)],8,ULe)])],32)])])):Ma("",!0)}}),VLe={},WLe={width:"23",height:"25",viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function qLe(t,e){return Wr(),Qr("svg",WLe,e[0]||(e[0]=[Le("path",{d:"M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z",fill:"white"},null,-1),Le("path",{d:"M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z",fill:"white"},null,-1)]))}const mW=kh(VLe,[["render",qLe]]),GLe={},ZLe={width:"17",height:"24",viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function KLe(t,e){return Wr(),Qr("svg",ZLe,e[0]||(e[0]=[qc('',12)]))}const gW=kh(GLe,[["render",KLe]]),YLe={class:"min-h-screen bg-dark-bg overflow-hidden relative flex items-start sm:items-center justify-center p-2 sm:p-4 pt-8 sm:pt-4"},XLe={class:"login-card relative z-10 w-full max-w-md p-6 sm:p-10 rounded-[16px] sm:rounded-[24px] border-0 sm:border sm:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)] backdrop-blur-xl"},JLe={class:"relative login-content"},QLe={class:"form-group"},ePe={class:"relative"},tPe=["disabled"],rPe={class:"form-group"},iPe={class:"relative"},nPe=["disabled"],aPe={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-[12px] p-2.5 sm:p-3.5 backdrop-blur-sm animate-shake"},oPe={class:"text-red-400 text-xs sm:text-sm font-medium"},sPe=["disabled"],lPe={key:0,class:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white border-t-transparent rounded-full animate-spin"},uPe={key:1,class:"w-4 h-4 sm:w-5 sm:h-5 group-hover:translate-x-1 transition-transform duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},cPe={class:"relative"},hPe={class:"mt-6 sm:mt-8 pt-4 sm:pt-6 border-t border-white/10"},fPe={class:"flex items-center justify-center gap-3"},dPe={href:"https://github.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"GitHub"},pPe={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"Buy Me a Coffee"},mPe=Uu({name:"LoginView",__name:"Login",setup(t){const e=J5(),r=vn("admin"),c=vn(""),S=vn(!1),H=vn(""),Z=vn(!1),ue=vn(!1),be=async()=>{H.value="",S.value=!0;try{const Xe=JU(),bt=(await J2.post("/auth/login",{username:r.value,password:c.value,client_id:Xe})).data;bt.success&&bt.token?c.value==="admin123"?(ZM(bt.token),ue.value=!0,Z.value=!0):(ZM(bt.token),e.push("/")):H.value=bt.error||"Login failed"}catch(Xe){console.error("Login error:",Xe);const vt=Xe;H.value=vt.response?.data?.error||"Connection error. Please try again."}finally{S.value=!1}},Se=()=>{Z.value=!1,e.push("/")},Re=()=>{Z.value=!1,ue.value&&e.push("/")};return(Xe,vt)=>(Wr(),Qr("div",YLe,[vt[9]||(vt[9]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-screen pointer-events-none"},null,-1)),vt[10]||(vt[10]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-screen pointer-events-none"},null,-1)),vt[11]||(vt[11]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-screen pointer-events-none"},null,-1)),Le("div",XLe,[vt[8]||(vt[8]=Le("div",{class:"absolute inset-0 rounded-[24px] bg-gradient-to-br from-primary/5 to-transparent pointer-events-none"},null,-1)),Le("div",JLe,[vt[7]||(vt[7]=qc('
MeshCore

pyMC Repeater

Sign in to access your dashboard

',1)),Le("form",{onSubmit:Yf(be,["prevent"]),class:"space-y-4 sm:space-y-5"},[Le("div",QLe,[vt[3]||(vt[3]=Le("label",{for:"username",class:"block text-white/90 text-xs sm:text-sm font-medium mb-2"}," Username ",-1)),Le("div",ePe,[Sl(Le("input",{id:"username","onUpdate:modelValue":vt[0]||(vt[0]=bt=>r.value=bt),type:"text",autocomplete:"username",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] bg-white/5 border border-white/10 text-white text-sm placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white/10 transition-all duration-300",placeholder:"Enter username",disabled:S.value},null,8,tPe),[[sc,r.value]]),vt[2]||(vt[2]=Le("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),Le("div",rPe,[vt[5]||(vt[5]=Le("label",{for:"password",class:"block text-white/90 text-xs sm:text-sm font-medium mb-2"}," Password ",-1)),Le("div",iPe,[Sl(Le("input",{id:"password","onUpdate:modelValue":vt[1]||(vt[1]=bt=>c.value=bt),type:"password",autocomplete:"current-password",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] bg-white/5 border border-white/10 text-white text-sm placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white/10 transition-all duration-300",placeholder:"Enter password",disabled:S.value},null,8,nPe),[[sc,c.value]]),vt[4]||(vt[4]=Le("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),H.value?(Wr(),Qr("div",aPe,[Le("p",oPe,Si(H.value),1)])):Ma("",!0),Le("button",{type:"submit",disabled:S.value,class:"button-glass w-full relative overflow-hidden bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 active:scale-[0.98] text-white font-semibold py-3 sm:py-4 px-4 rounded-[12px] transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 sm:gap-2.5 group mt-6 sm:mt-8 text-sm sm:text-base"},[S.value?(Wr(),Qr("div",lPe)):(Wr(),Qr("svg",uPe,vt[6]||(vt[6]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"},null,-1)]))),Le("span",cPe,Si(S.value?"Signing in...":"Sign In"),1)],8,sPe)],32),Le("div",hPe,[Le("div",fPe,[Le("a",dPe,[il(mW,{class:"w-4 h-4 sm:w-5 sm:h-5 text-white/60 group-hover:text-primary transition-colors"})]),Le("a",pPe,[il(gW,{class:"w-4 h-4 sm:w-5 sm:h-5 text-white/60 group-hover:text-yellow-500 transition-colors"})])])])])]),il(HLe,{"is-open":Z.value,"can-skip":!0,onClose:Re,onSuccess:Se},null,8,["is-open"])]))}}),gPe=kh(mPe,[["__scopeId","data-v-79c5750f"]]),vPe=SS("setup",()=>{const t=vn(1),e=vn(5),r=vn(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),c=vn(null),S=vn(null),H=vn(""),Z=vn(""),ue=vn(!1),be=vn({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),Se=vn([]),Re=vn([]),Xe=vn(!1),vt=vn(!1),bt=vn(null),kt=Do(()=>{switch(t.value){case 1:return!0;case 2:return r.value.trim().length>0;case 3:return c.value!==null;case 4:return ue.value?be.value.frequency&&be.value.spreading_factor&&be.value.bandwidth&&be.value.coding_rate:S.value!==null;case 5:return H.value.length>=6&&H.value===Z.value;default:return!1}}),Dt=Do(()=>t.value>1),rr=Do(()=>t.value===e.value);async function Er(){Xe.value=!0,bt.value=null;try{const ii=await(await fetch("/api/hardware_options")).json();if(ii.error)throw new Error(ii.error);Se.value=ii.hardware||[]}catch(Ci){bt.value=Ci instanceof Error?Ci.message:"Failed to load hardware options",console.error("Error fetching hardware options:",Ci)}finally{Xe.value=!1}}async function Fe(){Xe.value=!0,bt.value=null;try{const ii=await(await fetch("/api/radio_presets")).json();if(ii.error)throw new Error(ii.error);Re.value=ii.presets||[]}catch(Ci){bt.value=Ci instanceof Error?Ci.message:"Failed to load radio presets",console.error("Error fetching radio presets:",Ci)}finally{Xe.value=!1}}async function wi(){if(!kt.value)return{success:!1,error:"Please complete all required fields"};vt.value=!0,bt.value=null;try{const Ci=ue.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:be.value.frequency,spreading_factor:be.value.spreading_factor,bandwidth:be.value.bandwidth,coding_rate:be.value.coding_rate}:S.value,Ji=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:r.value.trim(),hardware_key:c.value?.key,radio_preset:Ci,admin_password:H.value})})).json();if(!Ji.success)throw new Error(Ji.error||"Setup failed");return{success:!0,data:Ji}}catch(Ci){const ii=Ci instanceof Error?Ci.message:"Failed to complete setup";return bt.value=ii,{success:!1,error:ii}}finally{vt.value=!1}}function ur(){kt.value&&t.value=1&&Ci<=e.value&&(t.value=Ci)}function _i(){t.value=1,r.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,c.value=null,S.value=null,ue.value=!1,be.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},H.value="",Z.value="",bt.value=null}return{currentStep:t,totalSteps:e,nodeName:r,selectedHardware:c,selectedRadioPreset:S,useCustomRadio:ue,customRadio:be,adminPassword:H,confirmPassword:Z,hardwareOptions:Se,radioPresets:Re,isLoading:Xe,isSubmitting:vt,error:bt,canGoNext:kt,canGoBack:Dt,isLastStep:rr,fetchHardwareOptions:Er,fetchRadioPresets:Fe,completeSetup:wi,nextStep:ur,previousStep:Ir,goToStep:Ti,reset:_i}}),yPe={class:"min-h-screen bg-dark-bg overflow-hidden relative flex items-center justify-center p-4"},_Pe={class:"w-full max-w-4xl relative z-10"},xPe={class:"mb-8"},bPe={class:"flex justify-between mb-2"},wPe={class:"text-white/70 text-sm"},kPe={class:"text-white/70 text-sm"},TPe={class:"h-2 bg-white/10 rounded-full overflow-hidden"},SPe={class:"glass-card rounded-[20px] p-6 sm:p-8 md:p-12"},CPe={class:"flex justify-center mb-8"},APe={class:"flex gap-2"},MPe={class:"mb-8"},EPe={class:"text-2xl sm:text-3xl font-bold text-white mb-2 text-center"},LPe={key:0,class:"space-y-6 mt-8"},PPe={key:1,class:"space-y-6 mt-8"},IPe={class:"max-w-md mx-auto"},DPe={key:2,class:"space-y-6 mt-8"},zPe={key:0,class:"text-center text-white/50"},OPe={key:1,class:"text-center text-white/50"},BPe={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},RPe=["onClick"],FPe={class:"font-medium text-white mb-1"},NPe={class:"text-sm text-white/60"},jPe={key:3,class:"space-y-6 mt-8"},UPe={key:0,class:"text-center text-white/50"},$Pe={key:1,class:"text-center text-white/50"},HPe={key:2,class:"max-w-5xl mx-auto"},VPe={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},WPe=["onClick"],qPe={class:"relative z-10"},GPe={class:"font-medium text-white mb-1 flex items-start justify-between gap-2"},ZPe={class:"flex items-center gap-2"},KPe={class:"text-2xl"},YPe={key:0,class:"text-primary flex-shrink-0"},XPe={class:"text-xs text-white/60 mb-3"},JPe={class:"grid grid-cols-2 gap-2 text-xs"},QPe={class:"bg-white/5 rounded px-2 py-1"},eIe={class:"text-white/80 font-medium"},tIe={class:"bg-white/5 rounded px-2 py-1"},rIe={class:"text-white/80 font-medium"},iIe={class:"bg-white/5 rounded px-2 py-1"},nIe={class:"text-white/80 font-medium"},aIe={class:"bg-white/5 rounded px-2 py-1"},oIe={class:"text-white/80 font-medium"},sIe={class:"border-t border-white/10 pt-6"},lIe={class:"flex items-center justify-between mb-2"},uIe={key:0,class:"text-primary"},cIe={key:0,class:"mt-4 grid grid-cols-2 gap-4"},hIe={key:4,class:"space-y-6 mt-8"},fIe={class:"max-w-md mx-auto space-y-4"},dIe={key:0,class:"text-red-400 text-sm"},pIe={key:0,class:"mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-200"},mIe={class:"flex justify-between gap-4"},gIe={key:1},vIe=["disabled"],yIe={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},_Ie={key:1},xIe={key:2},bIe={key:3},wIe={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kIe={class:"flex justify-center mb-6"},TIe={key:0,class:"w-16 h-16 rounded-full bg-green-500/20 flex items-center justify-center"},SIe={key:1,class:"w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center"},CIe={class:"text-2xl font-bold text-white text-center mb-4"},AIe={class:"text-white/70 text-center mb-6"},MIe=Uu({name:"SetupView",__name:"Setup",setup(t){const e=vPe(),r=J5(),c=vn(!1),S=vn(""),H=vn(""),Z=vn("success"),ue=bt=>{const kt=bt.toLowerCase();return kt.includes("australia")?"🇦🇺":kt.includes("eu")||kt.includes("uk")?"🇪🇺":kt.includes("czech")?"🇨🇿":kt.includes("new zealand")?"🇳🇿":kt.includes("portugal")?"🇵🇹":kt.includes("switzerland")?"🇨🇭":kt.includes("usa")||kt.includes("canada")?"🇺🇸":kt.includes("vietnam")?"🇻🇳":"🌍"};ud(async()=>{await Promise.all([e.fetchHardwareOptions(),e.fetchRadioPresets()])});const be=Do(()=>e.currentStep/e.totalSteps*100);async function Se(){if(e.isLastStep){const bt=await e.completeSetup();bt.success?(Z.value="success",S.value="Setup Complete!",H.value="Your repeater has been configured successfully. The service is restarting now...",c.value=!0,setTimeout(()=>{c.value=!1,r.push("/login")},5e3)):(Z.value="error",S.value="Setup Failed",H.value=bt.error||"An unknown error occurred",c.value=!0)}else e.nextStep()}function Re(){e.previousStep()}function Xe(){c.value=!1,Z.value==="success"&&r.push("/login")}const vt=["Welcome","Repeater Name","Hardware Selection","Radio Configuration","Security Setup"];return(bt,kt)=>(Wr(),Qr("div",yPe,[kt[36]||(kt[36]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-screen pointer-events-none"},null,-1)),kt[37]||(kt[37]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-screen pointer-events-none"},null,-1)),kt[38]||(kt[38]=Le("div",{class:"absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] bg-gradient-to-b from-cyan-400/30 to-cyan-200/15 blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-screen pointer-events-none"},null,-1)),Le("div",_Pe,[Le("div",xPe,[Le("div",bPe,[Le("span",wPe,"Step "+Si(Po(e).currentStep)+" of "+Si(Po(e).totalSteps),1),Le("span",kPe,Si(Math.round(be.value))+"% Complete",1)]),Le("div",TPe,[Le("div",{class:"h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500",style:om({width:`${be.value}%`})},null,4)])]),Le("div",SPe,[Le("div",CPe,[Le("div",APe,[(Wr(!0),Qr(js,null,au(Po(e).totalSteps,Dt=>(Wr(),Qr("div",{key:Dt,class:eo(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all",Dt===Po(e).currentStep?"bg-primary text-white":Dt

Welcome to your pyMC Repeater! Let's get you set up in just a few steps.

You'll configure:

  • Repeater name and identification
  • Hardware board selection
  • Radio frequency and settings
  • Admin password for secure access
',1)]))):Po(e).currentStep===2?(Wr(),Qr("div",PPe,[kt[12]||(kt[12]=Le("p",{class:"text-white/70 text-center mb-6"}," Choose a unique name for your repeater. This will be used for identification on the mesh network. ",-1)),Le("div",IPe,[kt[10]||(kt[10]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Repeater Name",-1)),Sl(Le("input",{"onUpdate:modelValue":kt[0]||(kt[0]=Dt=>Po(e).nodeName=Dt),type:"text",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-3 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"e.g., pyRpt0001",maxlength:"32"},null,512),[[sc,Po(e).nodeName]]),kt[11]||(kt[11]=Le("p",{class:"text-white/50 text-xs mt-2"}," Use letters, numbers, hyphens, or underscores (3-32 characters) ",-1))])])):Po(e).currentStep===3?(Wr(),Qr("div",DPe,[kt[13]||(kt[13]=Le("p",{class:"text-white/70 text-center mb-6"}," Select your hardware board type ",-1)),Po(e).isLoading?(Wr(),Qr("div",zPe," Loading hardware options... ")):Po(e).hardwareOptions.length===0?(Wr(),Qr("div",OPe," No hardware options available ")):(Wr(),Qr("div",BPe,[(Wr(!0),Qr(js,null,au(Po(e).hardwareOptions,Dt=>(Wr(),Qr("button",{key:Dt.key,onClick:rr=>Po(e).selectedHardware=Dt,class:eo(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",Po(e).selectedHardware?.key===Dt.key?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-white/5 border-white/10 hover:bg-white/10 hover:border-white/20"])},[Le("div",FPe,Si(Dt.name),1),Le("div",NPe,Si(Dt.description||Dt.key),1)],10,RPe))),128))]))])):Po(e).currentStep===4?(Wr(),Qr("div",jPe,[kt[28]||(kt[28]=Le("p",{class:"text-white/70 text-center mb-6"}," Choose a radio configuration preset for your region or create a custom configuration ",-1)),Po(e).isLoading?(Wr(),Qr("div",UPe," Loading radio presets... ")):Po(e).radioPresets.length===0?(Wr(),Qr("div",$Pe," No radio presets available ")):(Wr(),Qr("div",HPe,[Le("div",VPe,[(Wr(!0),Qr(js,null,au(Po(e).radioPresets,Dt=>(Wr(),Qr("button",{key:Dt.title,onClick:rr=>{Po(e).selectedRadioPreset=Dt,Po(e).useCustomRadio=!1},class:eo(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden",!Po(e).useCustomRadio&&Po(e).selectedRadioPreset?.title===Dt.title?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-white/5 border-white/10 hover:bg-white/10 hover:border-white/20"])},[Le("div",qPe,[Le("div",GPe,[Le("span",ZPe,[Le("span",KPe,Si(ue(Dt.title)),1),Le("span",null,Si(Dt.title),1)]),!Po(e).useCustomRadio&&Po(e).selectedRadioPreset?.title===Dt.title?(Wr(),Qr("div",YPe,kt[14]||(kt[14]=[Le("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[Le("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):Ma("",!0)]),Le("div",XPe,Si(Dt.description),1),Le("div",JPe,[Le("div",QPe,[kt[15]||(kt[15]=Le("div",{class:"text-white/40"},"Freq",-1)),Le("div",eIe,Si(Dt.frequency),1)]),Le("div",tIe,[kt[16]||(kt[16]=Le("div",{class:"text-white/40"},"BW",-1)),Le("div",rIe,Si(Dt.bandwidth),1)]),Le("div",iIe,[kt[17]||(kt[17]=Le("div",{class:"text-white/40"},"SF",-1)),Le("div",nIe,Si(Dt.spreading_factor),1)]),Le("div",aIe,[kt[18]||(kt[18]=Le("div",{class:"text-white/40"},"CR",-1)),Le("div",oIe,Si(Dt.coding_rate),1)])])])],10,WPe))),128))]),Le("div",sIe,[Le("button",{onClick:kt[1]||(kt[1]=Dt=>{Po(e).useCustomRadio=!Po(e).useCustomRadio,Po(e).useCustomRadio&&(Po(e).selectedRadioPreset=null)}),class:eo(["w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",Po(e).useCustomRadio?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-white/5 border-white/10 hover:bg-white/10 hover:border-white/20"])},[Le("div",lIe,[kt[20]||(kt[20]=Le("div",{class:"font-medium text-white flex items-center gap-2"},[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})]),ul(" Custom Configuration ")],-1)),Po(e).useCustomRadio?(Wr(),Qr("div",uIe,kt[19]||(kt[19]=[Le("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[Le("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):Ma("",!0)]),kt[21]||(kt[21]=Le("div",{class:"text-xs text-white/60"},"Manually configure frequency, bandwidth, spreading factor, and coding rate",-1))],2),il(Rx,{name:"slide"},{default:Iv(()=>[Po(e).useCustomRadio?(Wr(),Qr("div",cIe,[Le("div",null,[kt[22]||(kt[22]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Frequency (MHz)",-1)),Sl(Le("input",{"onUpdate:modelValue":kt[2]||(kt[2]=Dt=>Po(e).customRadio.frequency=Dt),type:"number",step:"0.1",class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-2.5 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"915.0"},null,512),[[sc,Po(e).customRadio.frequency]])]),Le("div",null,[kt[23]||(kt[23]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Bandwidth (kHz)",-1)),Sl(Le("input",{"onUpdate:modelValue":kt[3]||(kt[3]=Dt=>Po(e).customRadio.bandwidth=Dt),type:"number",class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-2.5 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"125"},null,512),[[sc,Po(e).customRadio.bandwidth]])]),Le("div",null,[kt[25]||(kt[25]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Spreading Factor",-1)),Sl(Le("select",{"onUpdate:modelValue":kt[4]||(kt[4]=Dt=>Po(e).customRadio.spreading_factor=Dt),class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-2.5 text-white focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},kt[24]||(kt[24]=[Le("option",{value:"7"},"7",-1),Le("option",{value:"8"},"8",-1),Le("option",{value:"9"},"9",-1),Le("option",{value:"10"},"10",-1),Le("option",{value:"11"},"11",-1),Le("option",{value:"12"},"12",-1)]),512),[[_g,Po(e).customRadio.spreading_factor]])]),Le("div",null,[kt[27]||(kt[27]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Coding Rate",-1)),Sl(Le("select",{"onUpdate:modelValue":kt[5]||(kt[5]=Dt=>Po(e).customRadio.coding_rate=Dt),class:"w-full bg-white/5 border border-white/10 rounded-[12px] px-4 py-2.5 text-white focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},kt[26]||(kt[26]=[Le("option",{value:"5"},"4/5",-1),Le("option",{value:"6"},"4/6",-1),Le("option",{value:"7"},"4/7",-1),Le("option",{value:"8"},"4/8",-1)]),512),[[_g,Po(e).customRadio.coding_rate]])])])):Ma("",!0)]),_:1})])]))])):Po(e).currentStep===5?(Wr(),Qr("div",hIe,[kt[32]||(kt[32]=Le("p",{class:"text-white/70 text-center mb-6"}," Set a secure admin password to protect your repeater ",-1)),Le("div",fIe,[Le("div",null,[kt[29]||(kt[29]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Admin Password",-1)),Sl(Le("input",{"onUpdate:modelValue":kt[6]||(kt[6]=Dt=>Po(e).adminPassword=Dt),type:"password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-3 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Enter password (min 6 characters)",minlength:"6"},null,512),[[sc,Po(e).adminPassword]])]),Le("div",null,[kt[30]||(kt[30]=Le("label",{class:"block text-white/90 text-sm font-medium mb-2"},"Confirm Password",-1)),Sl(Le("input",{"onUpdate:modelValue":kt[7]||(kt[7]=Dt=>Po(e).confirmPassword=Dt),type:"password",class:"w-full bg-white/5 border border-white/10 rounded-lg px-4 py-3 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Confirm password"},null,512),[[sc,Po(e).confirmPassword]])]),Po(e).adminPassword&&Po(e).confirmPassword&&Po(e).adminPassword!==Po(e).confirmPassword?(Wr(),Qr("div",dIe," Passwords do not match ")):Ma("",!0),kt[31]||(kt[31]=Le("div",{class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-200"},[Le("strong",null,"Important:"),ul(" Remember this password - you'll need it to access the dashboard. ")],-1))])])):Ma("",!0)]),Po(e).error?(Wr(),Qr("div",pIe,Si(Po(e).error),1)):Ma("",!0),Le("div",mIe,[Po(e).canGoBack?(Wr(),Qr("button",{key:0,onClick:Re,class:"px-6 py-3 rounded-[12px] bg-white/5 border border-white/10 text-white hover:bg-white/10 hover:border-white/20 transition-all duration-300 font-medium"}," Back ")):(Wr(),Qr("div",gIe)),Le("button",{onClick:Se,disabled:!Po(e).canGoNext||Po(e).isSubmitting,class:eo(["px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",Po(e).canGoNext&&!Po(e).isSubmitting?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white border border-primary/30 hover:border-primary/50":"bg-white/5 text-white/40 border border-white/10"])},[Po(e).isSubmitting?(Wr(),Qr("div",yIe)):Ma("",!0),Po(e).isSubmitting?(Wr(),Qr("span",_Ie,"Setting up...")):Po(e).isLastStep?(Wr(),Qr("span",xIe,"Complete Setup")):(Wr(),Qr("span",bIe,"Next")),!Po(e).isSubmitting&&!Po(e).isLastStep?(Wr(),Qr("svg",wIe,kt[33]||(kt[33]=[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]))):Ma("",!0)],10,vIe)])])]),il(Rx,{name:"modal"},{default:Iv(()=>[c.value?(Wr(),Qr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:Xe},[Le("div",{class:"glass-card max-w-md w-full p-8 rounded-[24px] border border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]",onClick:kt[8]||(kt[8]=Yf(()=>{},["stop"]))},[Le("div",kIe,[Z.value==="success"?(Wr(),Qr("div",TIe,kt[34]||(kt[34]=[Le("svg",{class:"w-8 h-8 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):(Wr(),Qr("div",SIe,kt[35]||(kt[35]=[Le("svg",{class:"w-8 h-8 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])))]),Le("h3",CIe,Si(S.value),1),Le("p",AIe,Si(H.value),1),Le("button",{onClick:Xe,class:eo(["w-full px-6 py-3 rounded-lg font-medium transition-all",Z.value==="success"?"bg-gradient-to-r from-primary/20 to-primary/10 hover:from-primary/30 hover:to-primary/20 text-white":"bg-gradient-to-r from-red-500/20 to-red-500/10 hover:from-red-500/30 hover:to-red-500/20 text-white"])},Si(Z.value==="success"?"Continue to Login":"Close"),3)])])):Ma("",!0)]),_:1})]))}}),EIe=kh(MIe,[["__scopeId","data-v-5f6343d4"]]),U1=fse({history:Voe("/"),routes:[{path:"/setup",name:"setup",component:EIe,meta:{requiresAuth:!1,requiresSetup:!1}},{path:"/login",name:"login",component:gPe,meta:{requiresAuth:!1}},{path:"/",name:"dashboard",component:vde,meta:{requiresAuth:!0}},{path:"/neighbors",name:"neighbors",component:B0e,meta:{requiresAuth:!0}},{path:"/statistics",name:"statistics",component:Sbe,meta:{requiresAuth:!0}},{path:"/system-stats",name:"system-stats",component:L2e,meta:{requiresAuth:!0}},{path:"/configuration",name:"configuration",component:p6e,meta:{requiresAuth:!0}},{path:"/cad-calibration",name:"cad-calibration",component:$6e,meta:{requiresAuth:!0}},{path:"/sessions",name:"sessions",component:rTe,meta:{requiresAuth:!0}},{path:"/room-servers",name:"room-servers",component:T8e,meta:{requiresAuth:!0}},{path:"/logs",name:"logs",component:V8e,meta:{requiresAuth:!0}},{path:"/terminal",name:"terminal",component:ILe,meta:{requiresAuth:!0}},{path:"/help",name:"help",component:DLe,meta:{requiresAuth:!0}}]});async function $N(){try{const t=await fetch("/api/needs_setup",{headers:{Accept:"application/json"}});if(!t.ok)return console.error("Setup check failed:",t.status),!1;const e=await t.json();return console.log("Setup status check:",e),e.needs_setup===!0}catch(t){return console.error("Error checking setup status:",t),!1}}U1.beforeEach(async(t,e,r)=>{const c=t.meta.requiresAuth!==!1,S=QU();if(t.path!=="/setup"&&await $N()){r("/setup");return}if(t.path==="/setup"&&!await $N()){r("/login");return}c&&!S?r("/login"):t.path==="/login"&&S?r("/"):r()});const LIe="/api",PIe="",IIe=LIe,gL=PIe;let SM=!1,J3=null;async function vW(){return SM&&J3||(SM=!0,J3=(async()=>{try{const t=Hx();if(!t)throw new Error("No token to refresh");const e=JU(),r=await sd.post(`${gL}/auth/refresh`,{client_id:e},{headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});if(r.data.success&&r.data.token){const c=r.data.token;return ZM(c),console.log("Token refreshed successfully"),c}else throw new Error("Token refresh failed")}catch(t){throw console.error("Token refresh error:",t),q2(),U1.push("/login"),t}finally{SM=!1,J3=null}})()),J3}const xx=sd.create({baseURL:IIe,timeout:5e3,headers:{"Content-Type":"application/json"}}),J2=sd.create({baseURL:gL,timeout:5e3,headers:{"Content-Type":"application/json"}});J2.interceptors.request.use(async t=>{if(t.url?.includes("/auth/login")||t.url?.includes("/auth/refresh"))return t;const e=Hx();if(e){if(t$())try{const r=await vW();return t.headers.Authorization=`Bearer ${r}`,t}catch(r){return Promise.reject(r)}if(e$())return q2(),U1.push("/login"),Promise.reject(new Error("Token expired"));t.headers.Authorization=`Bearer ${e}`}return t},t=>(console.error("Auth API Request Error:",t),Promise.reject(t)));J2.interceptors.response.use(t=>t,t=>(t.response?.status===401&&(q2(),U1.currentRoute.value.path!=="/login"&&U1.push("/login")),console.error("Auth API Response Error:",t.response?.data||t.message),Promise.reject(t)));xx.interceptors.request.use(async t=>{if(t.url?.includes("/auth/login"))return t;const e=Hx();if(e){if(t$())try{const r=await vW();return t.headers.Authorization=`Bearer ${r}`,t}catch(r){return Promise.reject(r)}if(e$())return q2(),U1.push("/login"),Promise.reject(new Error("Token expired"));t.headers.Authorization=`Bearer ${e}`}return t},t=>(console.error("API Request Error:",t),Promise.reject(t)));xx.interceptors.response.use(t=>t,t=>(t.response?.status===401&&(q2(),U1.currentRoute.value.path!=="/login"&&U1.push("/login")),console.error("API Response Error:",t.response?.data||t.message),Promise.reject(t)));class zs{static async get(e,r){try{return(await xx.get(e,{params:r})).data}catch(c){throw this.handleError(c)}}static async post(e,r,c){try{return(await xx.post(e,r,c)).data}catch(S){throw this.handleError(S)}}static async put(e,r,c){try{return(await xx.put(e,r,c)).data}catch(S){throw this.handleError(S)}}static async delete(e,r){try{return(await xx.delete(e,r)).data}catch(c){throw this.handleError(c)}}static async getTransportKeys(){return this.get("transport_keys")}static async sendAdvert(){return this.post("send_advert",{},{headers:{"Content-Type":"application/json"}})}static async createTransportKey(e,r,c,S,H){const Z={name:e,flood_policy:r,parent_id:S,last_used:H};return c!==void 0&&(Z.transport_key=c),this.post("transport_keys",Z)}static async getTransportKey(e){return this.get(`transport_key/${e}`)}static async updateTransportKey(e,r,c,S,H,Z){return this.put(`transport_key/${e}`,{name:r,flood_policy:c,transport_key:S,parent_id:H,last_used:Z})}static async deleteTransportKey(e){return this.delete(`transport_key/${e}`)}static async updateGlobalFloodPolicy(e){return this.post("global_flood_policy",{global_flood_allow:e})}static async getLogs(){try{return(await xx.get("logs")).data}catch(e){throw this.handleError(e)}}static async deleteAdvert(e){return this.delete(`advert/${e}`)}static async pingNeighbor(e,r=10){return this.post("ping_neighbor",{target_id:e,timeout:r})}static async getIdentities(){return this.get("identities")}static async getIdentity(e){return this.get("identity",{name:e})}static async createIdentity(e){return this.post("create_identity",e)}static async updateIdentity(e){return this.put("update_identity",e)}static async deleteIdentity(e){return this.delete(`delete_identity?name=${encodeURIComponent(e)}`)}static async sendRoomServerAdvert(e){return this.post("send_room_server_advert",{name:e})}static async getACLInfo(){return this.get("acl_info")}static async getACLClients(e){return this.get("acl_clients",e)}static async removeACLClient(e){return this.post("acl_remove_client",e)}static async getACLStats(){return this.get("acl_stats")}static async getRoomMessages(e){return this.get("room_messages",e)}static async postRoomMessage(e){return this.post("room_post_message",e)}static async deleteRoomMessage(e){return this.delete(`room_message?room_name=${encodeURIComponent(e.room_name)}&message_id=${e.message_id}`)}static async clearRoomMessages(e){return this.delete(`room_messages?room_name=${encodeURIComponent(e)}`)}static async getRoomStats(e){return this.get("room_stats",e?{room_name:e}:void 0)}static async getRoomClients(e){return this.get("room_clients",{room_name:e})}static handleError(e){if(sd.isAxiosError(e)){if(e.response){const r=e.response.data?.error||e.response.data?.message||`HTTP ${e.response.status}`;return new Error(r)}else if(e.request)return new Error("Network error - no response received")}return new Error(e instanceof Error?e.message:"Unknown error occurred")}}const kg=SS("system",()=>{const t=vn(null),e=vn(!1),r=vn(null),c=vn(null),S=vn("forward"),H=vn(!0),Z=vn(0),ue=vn(10),be=vn(!1),Se=Do(()=>t.value?.config?.node_name??"Unknown"),Re=Do(()=>{const dr=t.value?.public_key;return!dr||dr==="Unknown"?"Unknown":dr.length>=16?`${dr.slice(0,8)} ... ${dr.slice(-8)}`:`${dr}`}),Xe=Do(()=>t.value!==null),vt=Do(()=>t.value?.version??"Unknown"),bt=Do(()=>t.value?.core_version??"Unknown"),kt=Do(()=>t.value?.noise_floor_dbm??null),Dt=Do(()=>ue.value>0?Math.min(Z.value/ue.value*100,100):0),rr=Do(()=>S.value==="monitor"?{text:"Monitor Mode",title:"Monitoring only - not forwarding packets"}:H.value?{text:"Active",title:"Forwarding with duty cycle enforcement"}:{text:"No Limits",title:"Forwarding without duty cycle enforcement"}),Er=Do(()=>S.value==="monitor"?{active:!1,warning:!0}:{active:!0,warning:!1}),Fe=Do(()=>H.value?{active:!0,warning:!1}:{active:!1,warning:!0}),wi=dr=>{be.value=dr};async function ur(){try{e.value=!0,r.value=null;const dr=await zs.get("/stats");if(dr.success&&dr.data)return t.value=dr.data,c.value=new Date,Ir(dr.data),dr.data;if(dr&&"version"in dr){const Ar=dr;return t.value=Ar,c.value=new Date,Ir(Ar),Ar}else throw new Error(dr.error||"Failed to fetch stats")}catch(dr){throw r.value=dr instanceof Error?dr.message:"Unknown error occurred",console.error("Error fetching stats:",dr),dr}finally{e.value=!1}}function Ir(dr){if(dr.config){const ti=dr.config.repeater?.mode;(ti==="forward"||ti==="monitor")&&(S.value=ti);const Xr=dr.config.duty_cycle;if(Xr){H.value=Xr.enforcement_enabled!==!1;const ei=Xr.max_airtime_percent;typeof ei=="number"?ue.value=ei:ei&&typeof ei=="object"&&"parsedValue"in ei&&(ue.value=ei.parsedValue||10)}}const Ar=dr.utilization_percent;typeof Ar=="number"?Z.value=Ar:Ar&&typeof Ar=="object"&&"parsedValue"in Ar&&(Z.value=Ar.parsedValue||0)}async function Ti(dr){try{const Ar=await zs.post("/set_mode",{mode:dr});if(Ar.success)return S.value=dr,!0;throw new Error(Ar.error||"Failed to set mode")}catch(Ar){throw r.value=Ar instanceof Error?Ar.message:"Unknown error occurred",console.error("Error setting mode:",Ar),Ar}}async function _i(dr){try{const Ar=await zs.post("/set_duty_cycle",{enabled:dr});if(Ar.success)return H.value=dr,!0;throw new Error(Ar.error||"Failed to set duty cycle")}catch(Ar){throw r.value=Ar instanceof Error?Ar.message:"Unknown error occurred",console.error("Error setting duty cycle:",Ar),Ar}}async function Ci(){try{const dr=await zs.post("/send_advert",{},{timeout:1e4});if(dr.success)return console.log("Advertisement sent successfully:",dr.data),!0;throw new Error(dr.error||"Failed to send advert")}catch(dr){throw r.value=dr instanceof Error?dr.message:"Unknown error occurred",console.error("Error sending advert:",dr),dr}}async function ii(){const dr=S.value==="forward"?"monitor":"forward";return await Ti(dr)}async function Ji(){return await _i(!H.value)}async function vi(dr=5e3){await ur();const Ar=setInterval(async()=>{try{await ur()}catch(ti){console.error("Auto-refresh error:",ti)}},dr);return()=>clearInterval(Ar)}function vr(){t.value=null,r.value=null,c.value=null,e.value=!1,S.value="forward",H.value=!0,Z.value=0,ue.value=10}return{stats:t,isLoading:e,error:r,lastUpdated:c,currentMode:S,dutyCycleEnabled:H,dutyCycleUtilization:Z,dutyCycleMax:ue,cadCalibrationRunning:be,nodeName:Se,pubKey:Re,hasStats:Xe,version:vt,coreVersion:bt,noiseFloorDbm:kt,dutyCyclePercentage:Dt,statusBadge:rr,modeButtonState:Er,dutyCycleButtonState:Fe,fetchStats:ur,setMode:Ti,setDutyCycle:_i,sendAdvert:Ci,toggleMode:ii,toggleDutyCycle:Ji,startAutoRefresh:vi,reset:vr,setCadCalibrationRunning:wi}}),DIe={class:"glass-card-green p-5 relative overflow-hidden"},zIe={key:0,class:"absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg"},OIe={class:"flex items-baseline gap-2 mb-8"},BIe={class:"text-primary text-2xl font-medium"},RIe={class:"absolute bottom-0 left-5 w-[196px] h-[30px]",viewBox:"0 0 196 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},FIe=["d"],NIe=["d"],jIe=["cy"],UIe=Uu({__name:"RFNoiseFloor",setup(t){const e=i4(),r=kg(),c=vn(null),S=Re=>{if(Re.length<2)return"";const Xe=196,vt=30,bt=4,kt=-125,rr=-105-kt;let Er="";return Re.forEach((Fe,wi)=>{const ur=wi/(Re.length-1)*Xe,Ir=(Fe-kt)/rr,Ti=vt-Ir*(vt-bt*2)-bt;if(wi===0)Er+=`M ${ur} ${Ti}`;else{const Ci=((wi-1)/(Re.length-1)*Xe+ur)/2;Er+=` Q ${Ci} ${Ti} ${ur} ${Ti}`}}),Er},H=async()=>{try{await Promise.all([e.fetchNoiseFloorHistory({hours:1}),e.fetchNoiseFloorStats({hours:1})])}catch(Re){console.error("Error fetching noise floor data:",Re)}};ud(()=>{H(),c.value=window.setInterval(H,5e3)}),$g(()=>{c.value&&clearInterval(c.value)});const Z=Do(()=>{const Re=e.noiseFloorSparklineData;return Re&&Re.length>0?Re[Re.length-1]:e.noiseFloorStats?.avg_noise_floor??-116}),ue=Do(()=>e.noiseFloorSparklineData),be=Do(()=>S(ue.value)),Se=Do(()=>{if(ue.value.length===0)return 15;const Re=ue.value[ue.value.length-1],Xe=-125,bt=-105-Xe;return 30-(Re-Xe)/bt*22-4});return(Re,Xe)=>(Wr(),Qr("div",DIe,[Po(r).cadCalibrationRunning?(Wr(),Qr("div",zIe,Xe[0]||(Xe[0]=[qc('
CAD Calibration

In Progress

',1)]))):Ma("",!0),Xe[4]||(Xe[4]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"RF NOISE FLOOR",-1)),Le("div",OIe,[Le("span",BIe,Si(Z.value),1),Xe[1]||(Xe[1]=Le("span",{class:"text-dark-text text-xs uppercase"},"dBm",-1))]),(Wr(),Qr("svg",RIe,[Xe[3]||(Xe[3]=qc('',1)),ue.value.length>1?(Wr(),Qr("path",{key:0,d:`${be.value} L 196 30 L 0 30 Z`,fill:"url(#rf-noise-gradient)",class:"transition-all duration-500 ease-out"},null,8,FIe)):Ma("",!0),ue.value.length>1?(Wr(),Qr("path",{key:1,d:be.value,stroke:"#B1FFFF","stroke-width":"2",fill:"none",filter:"url(#line-glow)",class:"transition-all duration-500 ease-out"},null,8,NIe)):Ma("",!0),ue.value.length>0?(Wr(),Qr("circle",{key:2,cx:196,cy:Se.value,r:"2",fill:"#B1FFFF",class:"animate-pulse"},Xe[2]||(Xe[2]=[Le("animate",{attributeName:"r",values:"2;3;2",dur:"2s",repeatCount:"indefinite"},null,-1)]),8,jIe)):Ma("",!0)]))]))}}),yW=kh(UIe,[["__scopeId","data-v-ad12b3cb"]]),$Ie={},HIe={width:"800px",height:"800px",viewBox:"0 -1.5 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",class:"w-full h-full"};function VIe(t,e){return Wr(),Qr("svg",HIe,e[0]||(e[0]=[Le("g",{id:"Page-1",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[Le("g",{transform:"translate(-420.000000, -3641.000000)",fill:"currentColor"},[Le("g",{id:"icons",transform:"translate(56.000000, 160.000000)"},[Le("path",{d:"M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831",id:"radio_tower-[#1019]"})])])],-1)]))}const WIe=kh($Ie,[["render",VIe]]),qIe={class:"text-center"},GIe={class:"relative flex items-center justify-center mb-8"},ZIe={class:"relative w-32 h-32"},KIe={class:"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2"},YIe={key:0,class:"absolute inset-0 flex items-center justify-center"},XIe={key:1,class:"absolute inset-0 flex items-center justify-center"},JIe={key:2,class:"absolute inset-0"},QIe={class:"mb-6"},eDe={key:0,class:"text-white text-lg"},tDe={key:1,class:"text-accent-green text-lg font-medium"},rDe={key:2,class:"text-secondary text-lg"},iDe={key:3,class:"text-accent-red text-lg"},nDe={key:4,class:"text-dark-text"},aDe={key:5,class:"mt-3"},oDe={key:0,class:"text-secondary text-sm"},sDe={key:1,class:"text-accent-red text-sm"},lDe={key:0,class:"flex gap-3"},uDe={key:1,class:"text-dark-text text-sm"},cDe=Uu({name:"AdvertModal",__name:"AdvertModal",props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:["close","send"],setup(t,{emit:e}){const r=t,c=e,S=vn(!1),H=vn(!1),Z=vn(!1);w0(()=>r.isOpen,Re=>{Re?(S.value=!0,setTimeout(()=>{H.value=!0},50)):(H.value=!1,Z.value=!1,setTimeout(()=>{S.value=!1},300))},{immediate:!0}),w0(()=>r.isLoading,Re=>{Re||setTimeout(()=>{Z.value=!1},1e3)});const ue=()=>{r.isLoading||c("close")},be=()=>{r.isLoading||(Z.value=!0,c("send"))},Se=Re=>Re?.includes("Network error - no response received")||Re?.includes("timeout");return(Re,Xe)=>(Wr(),Sd(gS,{to:"body"},[S.value?(Wr(),Qr("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:Yf(ue,["self"])},[Le("div",{class:eo(["absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",H.value?"opacity-100":"opacity-0"])},null,2),Le("div",{class:eo(["relative glass-card rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300",H.value?"scale-100 opacity-100":"scale-95 opacity-0"])},[Re.isLoading?Ma("",!0):(Wr(),Qr("button",{key:0,onClick:ue,class:"absolute top-4 right-4 text-dark-text hover:text-white transition-colors p-2"},Xe[0]||(Xe[0]=[Le("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Le("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))),Le("div",qIe,[Xe[6]||(Xe[6]=Le("h2",{class:"text-white text-xl font-semibold mb-6"},"Send Advertisement",-1)),Le("div",GIe,[Le("div",ZIe,[Le("div",KIe,[il(WIe,{class:eo(["w-16 h-16 transition-all duration-500",[Re.isLoading?"animate-pulse":"",Re.isSuccess?"text-accent-green":Re.error&&!Se(Re.error)?"text-accent-red":"text-primary"]]),style:om({filter:Re.isLoading?"drop-shadow(0 0 8px currentColor)":Re.isSuccess?"drop-shadow(0 0 8px #A5E5B6)":Re.error&&!Se(Re.error)?"drop-shadow(0 0 8px #FB787B)":"drop-shadow(0 0 4px #AAE8E8)"})},null,8,["class","style"])]),Re.isLoading||Re.isSuccess?(Wr(),Qr("div",YIe,[Le("div",{class:eo(["absolute w-16 h-16 rounded-full border-2 animate-ping",[Re.isSuccess?"border-accent-green/60":"border-primary/60"]]),style:{"animation-duration":"1.5s"}},null,2),Le("div",{class:eo(["absolute w-24 h-24 rounded-full border-2 animate-ping",[Re.isSuccess?"border-accent-green/40":"border-primary/40"]]),style:{"animation-duration":"2s","animation-delay":"0.3s"}},null,2),Le("div",{class:eo(["absolute w-32 h-32 rounded-full border-2 animate-ping",[Re.isSuccess?"border-accent-green/20":"border-primary/20"]]),style:{"animation-duration":"2.5s","animation-delay":"0.6s"}},null,2)])):Ma("",!0),Z.value?(Wr(),Qr("div",XIe,Xe[1]||(Xe[1]=[Le("div",{class:"absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast"},null,-1),Le("div",{class:"absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast",style:{"animation-delay":"0.1s"}},null,-1),Le("div",{class:"absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast",style:{"animation-delay":"0.2s"}},null,-1),Le("div",{class:"absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast",style:{"animation-delay":"0.3s"}},null,-1)]))):Ma("",!0),Re.isLoading||Re.isSuccess?(Wr(),Qr("div",JIe,[Le("div",{class:eo(["absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Re.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"0.5s"}},Xe[2]||(Xe[2]=[Le("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Le("div",{class:eo(["absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Re.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1s"}},Xe[3]||(Xe[3]=[Le("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Le("div",{class:eo(["absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Re.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"1.5s",transform:"translateY(-50%)"}},Xe[4]||(Xe[4]=[Le("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2),Le("div",{class:eo(["absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse",[Re.isSuccess?"bg-accent-green shadow-lg shadow-accent-green/50":"bg-primary/70 shadow-lg shadow-primary/30"]]),style:{"animation-delay":"2s"}},Xe[5]||(Xe[5]=[Le("div",{class:"w-2 h-2 bg-white rounded-full mx-auto mt-1"},null,-1)]),2)])):Ma("",!0)])]),Le("div",QIe,[Re.isLoading?(Wr(),Qr("p",eDe," Broadcasting advertisement... ")):Re.isSuccess?(Wr(),Qr("p",tDe," Advertisement sent successfully! ")):Re.error&&Se(Re.error)?(Wr(),Qr("p",rDe," Advertisement likely sent ")):Re.error?(Wr(),Qr("p",iDe," Failed to send advertisement ")):(Wr(),Qr("p",nDe," This will broadcast your node's presence to nearby nodes. ")),Re.error?(Wr(),Qr("div",aDe,[Se(Re.error)?(Wr(),Qr("p",oDe," Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. ")):(Wr(),Qr("p",sDe,Si(Re.error),1))])):Ma("",!0)]),!Re.isLoading&&!Re.isSuccess?(Wr(),Qr("div",lDe,[Le("button",{onClick:ue,class:"flex-1 glass-card border border-dark-border hover:border-primary rounded-[10px] px-6 py-3 text-dark-text hover:text-white transition-all duration-200"}," Cancel "),Le("button",{onClick:be,class:eo(["flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg",[Re.error&&Se(Re.error)?"bg-secondary hover:bg-secondary/90 text-dark-bg hover:shadow-secondary/20":"bg-primary hover:bg-primary/90 text-dark-bg hover:shadow-primary/20"]])},Si(Re.error&&Se(Re.error)?"Try Again":"Send Advertisement"),3)])):Ma("",!0),Re.isSuccess?(Wr(),Qr("div",uDe," Closing automatically... ")):Ma("",!0)])],2)])):Ma("",!0)]))}}),_W=kh(cDe,[["__scopeId","data-v-a5eb8c7f"]]),hDe={},fDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function dDe(t,e){return Wr(),Qr("svg",fDe,e[0]||(e[0]=[qc('',2)]))}const sS=kh(hDe,[["render",dDe]]),pDe={},mDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function gDe(t,e){return Wr(),Qr("svg",mDe,e[0]||(e[0]=[qc('',9)]))}const xW=kh(pDe,[["render",gDe]]),vDe={},yDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _De(t,e){return Wr(),Qr("svg",yDe,e[0]||(e[0]=[qc('',2)]))}const bW=kh(vDe,[["render",_De]]),xDe={},bDe={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function wDe(t,e){return Wr(),Qr("svg",bDe,e[0]||(e[0]=[Le("path",{d:"M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z",fill:"white"},null,-1)]))}const wW=kh(xDe,[["render",wDe]]),kDe={},TDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function SDe(t,e){return Wr(),Qr("svg",TDe,e[0]||(e[0]=[Le("path",{d:"M12.25 0H1.75C1.28587 0 0.840752 0.184375 0.512563 0.512563C0.184375 0.840752 0 1.28587 0 1.75V12.25C0 12.7141 0.184375 13.1592 0.512563 13.4874C0.840752 13.8156 1.28587 14 1.75 14H12.25C12.7141 14 13.1592 13.8156 13.4874 13.4874C13.8156 13.1592 14 12.7141 14 12.25V1.75C14 1.28587 13.8156 0.840752 13.4874 0.512563C13.1592 0.184375 12.7141 0 12.25 0ZM12.8333 12.25C12.8333 12.4047 12.7719 12.5531 12.6625 12.6625C12.5531 12.7719 12.4047 12.8333 12.25 12.8333H1.75C1.59529 12.8333 1.44692 12.7719 1.33752 12.6625C1.22812 12.5531 1.16667 12.4047 1.16667 12.25V1.75C1.16667 1.59529 1.22812 1.44692 1.33752 1.33752C1.44692 1.22812 1.59529 1.16667 1.75 1.16667H12.25C12.4047 1.16667 12.5531 1.22812 12.6625 1.33752C12.7719 1.44692 12.8333 1.59529 12.8333 1.75V12.25ZM3.23583 7.41317L5.23583 9.41317C5.29134 9.46685 5.35738 9.50892 5.43004 9.53689C5.5027 9.56485 5.58055 9.57812 5.65892 9.57579C5.73729 9.57347 5.81418 9.5556 5.88513 9.52325C5.95608 9.4909 6.01963 9.44476 6.07175 9.38792C6.12387 9.33108 6.16351 9.26467 6.18833 9.19237C6.21315 9.12007 6.22263 9.04335 6.21618 8.96725C6.20973 8.89115 6.18746 8.81722 6.15078 8.74965C6.11411 8.68207 6.06376 8.62223 6.00292 8.57383L4.66708 7.23617L6.00292 5.90033C6.10827 5.78972 6.16669 5.64161 6.16522 5.48792C6.16375 5.33423 6.10251 5.1873 5.99491 5.07882C5.88731 4.97034 5.74082 4.90791 5.58716 4.90522C5.4335 4.90254 5.28489 4.95982 5.17367 5.06417L3.17367 7.06417C3.06317 7.17386 3.00063 7.32313 3.00063 7.47867C3.00063 7.63421 3.06317 7.78348 3.17367 7.89317L3.23583 7.41317ZM8.75 10.5H7.58333C7.4286 10.5 7.28025 10.5615 7.17085 10.6709C7.06146 10.7803 7 10.9286 7 11.0833C7 11.2381 7.06146 11.3864 7.17085 11.4958C7.28025 11.6052 7.4286 11.6667 7.58333 11.6667H8.75C8.90473 11.6667 9.05308 11.6052 9.16248 11.4958C9.27188 11.3864 9.33333 11.2381 9.33333 11.0833C9.33333 10.9286 9.27188 10.7803 9.16248 10.6709C9.05308 10.5615 8.90473 10.5 8.75 10.5Z",fill:"white"},null,-1)]))}const kW=kh(kDe,[["render",SDe]]),CDe={},ADe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function MDe(t,e){return Wr(),Qr("svg",ADe,e[0]||(e[0]=[qc('',2)]))}const TW=kh(CDe,[["render",MDe]]),EDe={name:"SystemIcon"},LDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function PDe(t,e,r,c,S,H){return Wr(),Qr("svg",LDe,e[0]||(e[0]=[qc('',5)]))}const lS=kh(EDe,[["render",PDe]]),IDe={},DDe={width:"11",height:"14",viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function zDe(t,e){return Wr(),Qr("svg",DDe,e[0]||(e[0]=[Le("path",{d:"M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z",fill:"white"},null,-1),Le("path",{d:"M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z",fill:"white"},null,-1)]))}const SW=kh(IDe,[["render",zDe]]),ODe={},BDe={width:"11",height:"13",viewBox:"0 0 11 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function RDe(t,e){return Wr(),Qr("svg",BDe,e[0]||(e[0]=[Le("path",{d:"M6.77889 9.16667H10.1122V12.5M4.11222 3.83333H0.77889V0.5M10.3906 4.50227C10.0168 3.57711 9.39097 2.77536 8.58423 2.18815C7.77749 1.60094 6.82233 1.25168 5.82707 1.18034C4.8318 1.109 3.83627 1.31827 2.95402 1.78441C2.07177 2.25055 1.3381 2.95503 0.836182 3.81742M0.500244 8.49805C0.874034 9.42321 1.49986 10.225 2.30661 10.8122C3.11335 11.3994 4.06948 11.7482 5.06474 11.8195C6.06001 11.8909 7.05473 11.6816 7.93697 11.2155C8.81922 10.7494 9.55239 10.045 10.0543 9.18262",stroke:"white","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const CW=kh(ODe,[["render",RDe]]),FDe={},NDe={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jDe(t,e){return Wr(),Qr("svg",NDe,e[0]||(e[0]=[qc('',2)]))}const AW=kh(FDe,[["render",jDe]]),UDe={class:"w-[285px] flex-shrink-0 p-[15px] hidden lg:block"},$De={class:"glass-card h-full p-6"},HDe={class:"mb-12"},VDe={class:"text-[#C3C3C3] text-sm"},WDe=["title"],qDe={class:"text-[#C3C3C3] text-sm mt-1"},GDe={class:"mb-8"},ZDe={class:"mb-8"},KDe={class:"space-y-2"},YDe=["onClick"],XDe={class:"mb-8"},JDe={class:"space-y-2"},QDe=["onClick"],eze={class:"mb-8"},tze={class:"space-y-2"},rze=["onClick"],ize={class:"mb-8"},nze={class:"space-y-2"},aze=["onClick"],oze=["disabled"],sze={class:"flex items-center gap-3"},lze=["disabled"],uze={class:"flex items-center gap-3"},cze={class:"mb-4"},hze={class:"flex items-center gap-2"},fze={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},dze={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},pze={key:0,class:"mb-4"},mze={class:"text-dark-text text-xs mb-2"},gze={class:"text-white"},vze={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},yze={class:"flex items-center justify-between"},_ze={class:"flex items-center gap-2 text-dark-text text-xs"},xze={class:"flex items-center gap-2"},bze={href:"https://github.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 hover:border-primary/50 transition-all duration-300 hover:scale-105 group",title:"GitHub"},wze={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 hover:border-yellow-500/50 transition-all duration-300 hover:scale-105 group",title:"Buy Me a Coffee"},kze=Uu({name:"SidebarNav",__name:"Sidebar",setup(t){const e=J5(),r=SE(),c=kg(),S=vn(!1),H=vn(!1),Z=vn(!1),ue=vn(!1),be=vn(!1),Se=vn(null);let Re=null;ud(async()=>{Re=await c.startAutoRefresh(5e3)}),Dv(()=>{Re&&Re()});const Xe={dashboard:xW,neighbors:SW,statistics:TW,"system-stats":lS,sessions:lS,configuration:sS,"room-servers":sS,logs:wW,terminal:kW,help:bW},vt=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"System Stats",icon:"system-stats",route:"/system-stats"},{name:"Sessions",icon:"sessions",route:"/sessions"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Terminal",icon:"terminal",route:"/terminal"},{name:"Room Servers",icon:"room-servers",route:"/room-servers"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],bt=Do(()=>Ir=>r.path===Ir),kt=Ir=>{e.push(Ir)},Dt=async()=>{S.value=!0,Se.value=null;try{await c.sendAdvert(),be.value=!0,setTimeout(()=>{rr()},2e3)}catch(Ir){Se.value=Ir instanceof Error?Ir.message:"Unknown error occurred",console.error("Failed to send advert:",Ir)}finally{S.value=!1}},rr=()=>{ue.value=!1,be.value=!1,Se.value=null,S.value=!1},Er=async()=>{if(!H.value){H.value=!0;try{await c.toggleMode()}catch(Ir){console.error("Failed to toggle mode:",Ir)}finally{H.value=!1}}},Fe=async()=>{if(!Z.value){Z.value=!0;try{await c.toggleDutyCycle()}catch(Ir){console.error("Failed to toggle duty cycle:",Ir)}finally{Z.value=!1}}},wi=vn(new Date().toLocaleTimeString());setInterval(()=>{wi.value=new Date().toLocaleTimeString()},1e3);const ur=Do(()=>{const Ir=c.dutyCyclePercentage;let Ti="#A5E5B6";return Ir>90?Ti="#FB787B":Ir>70&&(Ti="#FFC246"),{width:Ir===0?"2px":`${Math.max(Ir,2)}%`,backgroundColor:Ti}});return(Ir,Ti)=>(Wr(),Qr(js,null,[Le("aside",UDe,[Le("div",$De,[Le("div",HDe,[Ti[1]||(Ti[1]=Le("div",{class:"mb-2 flex justify-center"},[Le("img",{src:AU,alt:"MeshCore",class:"h-4 opacity-80"})],-1)),Ti[2]||(Ti[2]=Le("h1",{class:"text-white text-[22px] font-extrabold tracking-tight mb-3 text-center",style:{"font-family":"system-ui, -apple-system, sans-serif"}},"pyMC Repeater",-1)),Le("p",VDe,[ul(Si(Po(c).nodeName)+" ",1),Le("span",{class:eo(["inline-block w-2 h-2 rounded-full ml-2",Po(c).statusBadge.text==="Active"?"bg-accent-green":Po(c).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Po(c).statusBadge.title},null,10,WDe)]),Le("p",qDe,"<"+Si(Po(c).pubKey)+">",1)]),Ti[13]||(Ti[13]=Le("div",{class:"border-t border-dark-border mb-6"},null,-1)),Le("div",GDe,[Ti[4]||(Ti[4]=Le("p",{class:"text-dark-text text-xs uppercase mb-4"},"Actions",-1)),Le("button",{onClick:Ti[0]||(Ti[0]=_i=>ue.value=!0),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors"},Ti[3]||(Ti[3]=[Le("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),ul(" Send Advert ",-1)]))]),Le("div",ZDe,[Ti[5]||(Ti[5]=Le("p",{class:"text-dark-text text-xs uppercase mb-4"},"Monitoring",-1)),Le("div",KDe,[(Wr(!0),Qr(js,null,au(vt.slice(0,3),_i=>(Wr(),Qr("button",{key:_i.name,onClick:Ci=>kt(_i.route),class:eo([bt.value(_i.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(Xe[_i.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(_i.name),1)],10,YDe))),128))])]),Le("div",XDe,[Ti[6]||(Ti[6]=Le("p",{class:"text-dark-text text-xs uppercase mb-4"},"System",-1)),Le("div",JDe,[(Wr(!0),Qr(js,null,au(vt.slice(3,7),_i=>(Wr(),Qr("button",{key:_i.name,onClick:Ci=>kt(_i.route),class:eo([bt.value(_i.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(Xe[_i.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(_i.name),1)],10,QDe))),128))])]),Le("div",eze,[Ti[7]||(Ti[7]=Le("p",{class:"text-dark-text text-xs uppercase mb-4"},"Room Servers",-1)),Le("div",tze,[(Wr(!0),Qr(js,null,au(vt.slice(7,8),_i=>(Wr(),Qr("button",{key:_i.name,onClick:Ci=>kt(_i.route),class:eo([bt.value(_i.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(Xe[_i.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(_i.name),1)],10,rze))),128))])]),Le("div",ize,[Ti[8]||(Ti[8]=Le("p",{class:"text-dark-text text-xs uppercase mb-4"},"Other",-1)),Le("div",nze,[(Wr(!0),Qr(js,null,au(vt.slice(8),_i=>(Wr(),Qr("button",{key:_i.name,onClick:Ci=>kt(_i.route),class:eo([bt.value(_i.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(Xe[_i.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(_i.name),1)],10,aze))),128))])]),il(yW,{"current-value":Po(c).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-6"},null,8,["current-value"]),Le("button",{onClick:Er,disabled:H.value,class:eo(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Po(c).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Le("div",sze,[il(CW,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),Ti[9]||(Ti[9]=Le("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),Le("span",{class:eo(["text-xs font-medium group-hover:text-white transition-colors",Po(c).modeButtonState.warning?"text-accent-red":"text-accent-green"])},Si(H.value?"Changing...":Po(c).currentMode.charAt(0).toUpperCase()+Po(c).currentMode.slice(1)),3)],10,oze),Le("button",{onClick:Fe,disabled:Z.value,class:eo(["p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group",Po(c).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Le("div",uze,[il(AW,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),Ti[10]||(Ti[10]=Le("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),Le("span",{class:eo(["text-xs font-medium group-hover:text-white transition-colors",Po(c).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},Si(Z.value?"Changing...":Po(c).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,lze),Le("div",cze,[Le("div",hze,[Le("span",fze," R:v"+Si(Po(c).version),1),Le("span",dze," C:v"+Si(Po(c).coreVersion),1)])]),Ti[14]||(Ti[14]=Le("div",{class:"border-t border-accent-green mb-4"},null,-1)),Po(c).dutyCycleEnabled?(Wr(),Qr("div",pze,[Le("p",mze,[Ti[11]||(Ti[11]=ul(" Duty Cycle: ",-1)),Le("span",gze,Si(Po(c).dutyCycleUtilization.toFixed(1))+"% / "+Si(Po(c).dutyCycleMax.toFixed(1))+"%",1)]),Le("div",vze,[Le("div",{class:"h-full rounded-full transition-all duration-300",style:om(ur.value)},null,4)])])):Ma("",!0),Le("div",yze,[Le("div",_ze,[Ti[12]||(Ti[12]=Le("svg",{class:"w-3 h-3",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z",fill:"currentColor"})],-1)),ul(" Last Updated: "+Si(wi.value),1)]),Le("div",xze,[Le("a",bze,[il(mW,{class:"w-3.5 h-3.5 text-dark-text group-hover:text-primary transition-colors"})]),Le("a",wze,[il(gW,{class:"w-3.5 h-3.5 text-dark-text group-hover:text-yellow-500 transition-colors"})])])])])]),il(_W,{isOpen:ue.value,isLoading:S.value,isSuccess:be.value,error:Se.value,onClose:rr,onSend:Dt},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),Tze={key:0,class:"fixed inset-0 z-[1010] lg:hidden"},Sze={class:"absolute left-0 top-0 bottom-0 w-72 p-4"},Cze={class:"bg-black/20 backdrop-blur-xl border border-white/10 rounded-2xl h-full p-6 overflow-auto shadow-2xl"},Aze={class:"mb-6 flex items-center justify-between"},Mze={class:"text-[#C3C3C3] text-sm"},Eze=["title"],Lze={class:"text-[#C3C3C3] text-sm mt-1"},Pze={class:"mb-4"},Ize={class:"mb-4"},Dze={class:"space-y-2 mb-3"},zze=["onClick"],Oze={class:"mb-4"},Bze={class:"space-y-2 mb-3"},Rze=["onClick"],Fze={class:"mb-4"},Nze={class:"space-y-2 mb-3"},jze=["onClick"],Uze={class:"mb-4"},$ze={class:"space-y-2 mb-3"},Hze=["onClick"],Vze=["disabled"],Wze={class:"flex items-center gap-3"},qze=["disabled"],Gze={class:"flex items-center gap-3"},Zze={class:"mb-4"},Kze={class:"flex items-center gap-2"},Yze={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Xze={class:"glass-card px-2 py-1 text-dark-text text-xs font-medium rounded border border-dark-border"},Jze={key:0,class:"mb-4"},Qze={class:"text-dark-text text-xs mb-2"},eOe={class:"text-white"},tOe={class:"w-full h-1 bg-white/10 rounded-full overflow-hidden"},rOe={class:"text-dark-text text-xs"},iOe=Uu({name:"MobileSidebar",__name:"MobileSidebar",props:{showMobileSidebar:{type:Boolean}},emits:["update:showMobileSidebar","close"],setup(t,{emit:e}){const r=e,c=J5(),S=SE(),H=kg(),Z=vn(!1),ue=vn(!1),be=vn(!1),Se=vn(!1),Re=vn(!1),Xe=vn(null);let vt=null;ud(async()=>{vt=await H.startAutoRefresh(5e3)}),Dv(()=>{vt&&vt()});const bt={dashboard:xW,neighbors:SW,statistics:TW,"system-stats":lS,sessions:lS,configuration:sS,"room-servers":sS,logs:wW,terminal:kW,help:bW},kt=[{name:"Dashboard",icon:"dashboard",route:"/"},{name:"Neighbors",icon:"neighbors",route:"/neighbors"},{name:"Statistics",icon:"statistics",route:"/statistics"},{name:"System Stats",icon:"system-stats",route:"/system-stats"},{name:"Sessions",icon:"sessions",route:"/sessions"},{name:"Configuration",icon:"configuration",route:"/configuration"},{name:"Terminal",icon:"terminal",route:"/terminal"},{name:"Room Servers",icon:"room-servers",route:"/room-servers"},{name:"Logs",icon:"logs",route:"/logs"},{name:"Help",icon:"help",route:"/help"}],Dt=Do(()=>Ci=>S.path===Ci),rr=Ci=>{c.push(Ci),Er()},Er=()=>{r("update:showMobileSidebar",!1)},Fe=async()=>{Z.value=!0,Xe.value=null;try{await H.sendAdvert(),Re.value=!0,setTimeout(()=>{wi()},2e3)}catch(Ci){Xe.value=Ci instanceof Error?Ci.message:"Unknown error occurred",console.error("Failed to send advert:",Ci)}finally{Z.value=!1}},wi=()=>{Se.value=!1,Re.value=!1,Xe.value=null,Z.value=!1},ur=async()=>{if(!ue.value){ue.value=!0;try{await H.toggleMode()}catch(Ci){console.error("Failed to toggle mode:",Ci)}finally{ue.value=!1}}},Ir=async()=>{if(!be.value){be.value=!0;try{await H.toggleDutyCycle()}catch(Ci){console.error("Failed to toggle duty cycle:",Ci)}finally{be.value=!1}}},Ti=vn(new Date().toLocaleTimeString());setInterval(()=>{Ti.value=new Date().toLocaleTimeString()},1e3);const _i=Do(()=>{const Ci=H.dutyCyclePercentage;let ii="#A5E5B6";return Ci>90?ii="#FB787B":Ci>70&&(ii="#FFC246"),{width:Ci===0?"2px":`${Math.max(Ci,2)}%`,backgroundColor:ii}});return(Ci,ii)=>(Wr(),Qr(js,null,[Ci.showMobileSidebar?(Wr(),Qr("div",Tze,[Le("div",{class:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:Er}),Le("div",Sze,[Le("div",Cze,[Le("div",Aze,[Le("div",null,[ii[1]||(ii[1]=Le("h1",{class:"text-white text-[20px] font-bold"},"pyMC Repeater",-1)),Le("p",Mze,[ul(Si(Po(H).nodeName)+" ",1),Le("span",{class:eo(["inline-block w-2 h-2 rounded-full ml-2",Po(H).statusBadge.text==="Active"?"bg-accent-green":Po(H).statusBadge.text==="Monitor Mode"?"bg-secondary":"bg-accent-red"]),title:Po(H).statusBadge.title},null,10,Eze)]),Le("p",Lze,"<"+Si(Po(H).pubKey)+">",1)]),Le("button",{onClick:Er,class:"text-dark-text"},"✕")]),ii[11]||(ii[11]=Le("div",{class:"border-t border-dark-border mb-4"},null,-1)),Le("div",Pze,[ii[3]||(ii[3]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"Actions",-1)),Le("button",{onClick:ii[0]||(ii[0]=Ji=>{Se.value=!0,Er()}),class:"w-full bg-white rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] hover:bg-gray-100 transition-colors mb-2"},ii[2]||(ii[2]=[Le("svg",{class:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z",fill:"#212122"})],-1),ul(" Send Advert ",-1)]))]),Le("div",Ize,[ii[4]||(ii[4]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"Monitoring",-1)),Le("div",Dze,[(Wr(!0),Qr(js,null,au(kt.slice(0,3),Ji=>(Wr(),Qr("button",{key:Ji.name,onClick:vi=>rr(Ji.route),class:eo([Dt.value(Ji.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(bt[Ji.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(Ji.name),1)],10,zze))),128))])]),Le("div",Oze,[ii[5]||(ii[5]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"System",-1)),Le("div",Bze,[(Wr(!0),Qr(js,null,au(kt.slice(3,7),Ji=>(Wr(),Qr("button",{key:Ji.name,onClick:vi=>rr(Ji.route),class:eo([Dt.value(Ji.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(bt[Ji.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(Ji.name),1)],10,Rze))),128))])]),Le("div",Fze,[ii[6]||(ii[6]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"Room Servers",-1)),Le("div",Nze,[(Wr(!0),Qr(js,null,au(kt.slice(7,8),Ji=>(Wr(),Qr("button",{key:Ji.name,onClick:vi=>rr(Ji.route),class:eo([Dt.value(Ji.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(bt[Ji.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(Ji.name),1)],10,jze))),128))])]),Le("div",Uze,[ii[7]||(ii[7]=Le("p",{class:"text-dark-text text-xs uppercase mb-2"},"Other",-1)),Le("div",$ze,[(Wr(!0),Qr(js,null,au(kt.slice(8),Ji=>(Wr(),Qr("button",{key:Ji.name,onClick:vi=>rr(Ji.route),class:eo([Dt.value(Ji.route)?"bg-primary/20 shadow-[0_0_6px_0_rgba(170,232,232,0.20)] text-primary":"text-white hover:bg-white/5","w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm transition-all"])},[(Wr(),Sd(r_(bt[Ji.icon]),{class:"w-3.5 h-3.5"})),ul(" "+Si(Ji.name),1)],10,Hze))),128))])]),il(yW,{"current-value":Po(H).noiseFloorDbm||-116,"update-interval":3e3,class:"mb-4"},null,8,["current-value"]),Le("button",{onClick:ur,disabled:ue.value,class:eo(["p-4 flex items-center justify-between mb-3 w-full transition-all duration-200 cursor-pointer group",Po(H).modeButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Le("div",Wze,[il(CW,{class:"w-4 h-4 text-white group-hover:text-primary transition-colors"}),ii[8]||(ii[8]=Le("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Mode",-1))]),Le("span",{class:eo(["text-xs font-medium group-hover:text-white transition-colors",Po(H).modeButtonState.warning?"text-accent-red":"text-accent-green"])},Si(ue.value?"Changing...":Po(H).currentMode.charAt(0).toUpperCase()+Po(H).currentMode.slice(1)),3)],10,Vze),Le("button",{onClick:Ir,disabled:be.value,class:eo(["p-4 flex items-center justify-between mb-3 w-full transition-all duration-200 cursor-pointer group",Po(H).dutyCycleButtonState.warning?"glass-card-orange hover:bg-accent-red/10":"glass-card-green hover:bg-accent-green/10"])},[Le("div",Gze,[il(AW,{class:"w-3.5 h-3.5 text-white group-hover:text-primary transition-colors"}),ii[9]||(ii[9]=Le("span",{class:"text-white text-sm group-hover:text-primary transition-colors"},"Duty Cycle",-1))]),Le("span",{class:eo(["text-xs font-medium group-hover:text-white transition-colors",Po(H).dutyCycleButtonState.warning?"text-accent-red":"text-primary"])},Si(be.value?"Changing...":Po(H).dutyCycleEnabled?"Enabled":"Disabled"),3)],10,qze),Le("div",Zze,[Le("div",Kze,[Le("span",Yze," R:v"+Si(Po(H).version),1),Le("span",Xze," C:v"+Si(Po(H).coreVersion),1)])]),ii[12]||(ii[12]=Le("div",{class:"border-t border-accent-green mb-4"},null,-1)),Po(H).dutyCycleEnabled?(Wr(),Qr("div",Jze,[Le("p",Qze,[ii[10]||(ii[10]=ul(" Duty Cycle: ",-1)),Le("span",eOe,Si(Po(H).dutyCycleUtilization.toFixed(1))+"% / "+Si(Po(H).dutyCycleMax.toFixed(1))+"%",1)]),Le("div",tOe,[Le("div",{class:"h-full rounded-full transition-all duration-300",style:om(_i.value)},null,4)])])):Ma("",!0),Le("p",rOe,"Last Updated: "+Si(Ti.value),1)])])])):Ma("",!0),il(_W,{isOpen:Se.value,isLoading:Z.value,isSuccess:Re.value,error:Xe.value,onClose:wi,onSend:Fe},null,8,["isOpen","isLoading","isSuccess","error"])],64))}}),nOe={class:"glass-card p-3 sm:p-6 mb-5 rounded-[20px] relative z-10"},aOe={class:"flex justify-between"},oOe={class:"flex items-center gap-3"},sOe={class:"hidden sm:block"},lOe={class:"text-white text-2xl lg:text-[35px] font-bold mb-1 sm:mb-2"},uOe={class:"flex items-start gap-3"},cOe={class:"text-right mr-2 sm:mr-4",style:{"min-width":"180px","min-height":"60px"}},hOe={key:0,class:"flex items-center gap-2 justify-end"},fOe={key:1,class:"space-y-1"},dOe={class:"text-dark-text text-xs sm:text-sm"},pOe={class:"text-primary font-medium"},mOe={key:0,class:"text-xs text-dark-text/80",style:{"min-height":"16px"}},gOe={key:0},vOe={key:1,class:"text-xs text-dark-text/60 hidden sm:block",style:{"min-height":"16px"}},yOe={key:2},_Oe={key:0,class:"text-xs text-dark-text/60 hidden sm:block",style:{"min-height":"16px"}},xOe={class:"flex items-center justify-between mb-3"},bOe={class:"flex items-center gap-2"},wOe=["disabled"],kOe=["disabled"],TOe={class:"space-y-3 text-sm"},SOe={key:0,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},COe={class:"flex items-center justify-between"},AOe={class:"text-accent-red font-bold"},MOe={class:"text-xs text-gray-400 mt-1"},EOe={key:1,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-accent-green"},LOe={class:"flex items-center justify-between"},POe={class:"text-accent-green font-bold"},IOe={key:0,class:"text-xs text-gray-400 mt-1"},DOe={key:2,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10"},zOe={key:3,class:"bg-[#0B1014] p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red"},OOe={class:"text-xs text-gray-400"},BOe={class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 border-l-2 border-l-primary"},ROe={class:"flex items-center justify-between"},FOe={class:"text-primary font-bold"},NOe={key:0,class:"text-xs text-gray-400 mt-1"},jOe={class:"flex items-center justify-between"},UOe={class:"text-white font-medium"},$Oe={key:0,class:"mt-2"},HOe={class:"text-xs text-gray-400"},VOe={class:"text-gray-300"},WOe={key:4,class:"bg-[#0B1014] p-4 rounded-lg border border-white/10 text-center"},qOe={key:5,class:"bg-[#0B1014] p-3 rounded-lg border border-white/10 text-center"},GOe=Uu({name:"TopBar",__name:"TopBar",emits:["toggleMobileSidebar"],setup(t,{emit:e}){const r=e,c=J5(),S=kg(),H=vn(!1),Z=vn(null),ue=vn({hasUpdate:!1,currentVersion:"",latestVersion:"",isChecking:!1,lastChecked:null,error:null}),be=vn({}),Se=vn(!0),Re=vn(null),Xe=vn($le()||"User"),vt=["Chat Node","Repeater","Room Server"];function bt(vi){const vr=vi.target;Z.value&&!Z.value.contains(vr)&&(H.value=!1)}const kt=async()=>{try{Se.value=!0;const vi={};for(const vr of vt)try{const dr=await zs.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(vr)}&hours=168`);dr.success&&Array.isArray(dr.data)?vi[vr]=dr.data:vi[vr]=[]}catch(dr){console.error(`Error fetching ${vr} nodes:`,dr),vi[vr]=[]}be.value=vi,Re.value=new Date}catch(vi){console.error("Error updating tracked nodes:",vi)}finally{Se.value=!1}},Dt=async()=>{if(!ue.value.isChecking)try{ue.value.isChecking=!0,ue.value.error=null,await S.fetchStats();const vi=S.version;if(!vi||vi==="Unknown"){ue.value.error="Unable to determine current version";return}const dr=await fetch("https://raw.githubusercontent.com/rightup/pyMC_Repeater/main/repeater/__init__.py");if(!dr.ok)throw new Error(`GitHub request failed: ${dr.status}`);const ti=(await dr.text()).match(/__version__\s*=\s*["']([^"']+)["']/);if(!ti)throw new Error("Could not parse version from GitHub file");const Xr=ti[1];ue.value.currentVersion=vi,ue.value.latestVersion=Xr,ue.value.lastChecked=new Date,ue.value.hasUpdate=vi!==Xr}catch(vi){console.error("Error checking for updates:",vi),ue.value.error=vi instanceof Error?vi.message:"Failed to check for updates"}finally{ue.value.isChecking=!1}},rr=()=>{q2(),c.push("/login")},Er=Do(()=>Object.values(be.value).reduce((vr,dr)=>vr+dr.length,0)),Fe=Do(()=>vt.map(vr=>({type:vr,count:be.value[vr]?.length||0})).filter(vr=>vr.count>0)),wi=Do(()=>ue.value.hasUpdate||Er.value>0),ur=vi=>({"Chat Node":"text-blue-400",Repeater:"text-accent-green","Room Server":"text-accent-purple"})[vi]||"text-gray-400",Ir=vi=>{const vr=be.value[vi]||[];return vr.length===0?"None":vr.reduce((Ar,ti)=>ti.last_seen>Ar.last_seen?ti:Ar,vr[0]).node_name||"Unknown Node"};let Ti=null,_i=null;const Ci=()=>{Ti&&clearInterval(Ti),Ti=setInterval(()=>{kt()},3e4),_i&&clearInterval(_i),_i=setInterval(()=>{Dt()},6e5)},ii=()=>{Ti&&(clearInterval(Ti),Ti=null),_i&&(clearInterval(_i),_i=null)};ud(()=>{document.addEventListener("click",bt),kt(),Dt(),Ci()}),$g(()=>{document.removeEventListener("click",bt),ii()});const Ji=()=>{r("toggleMobileSidebar")};return(vi,vr)=>(Wr(),Qr("div",nOe,[Le("div",aOe,[Le("div",oOe,[Le("button",{onClick:Ji,class:"lg:hidden w-10 h-10 rounded bg-[#1A1E1F] flex items-center justify-center hover:bg-[#2A2E2F] transition-colors"},vr[2]||(vr[2]=[Le("svg",{class:"w-5 h-5 text-white",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Le("path",{d:"M3 6h14M3 10h14M3 14h14",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])),Le("div",sOe,[Le("h1",lOe,"Hi "+Si(Xe.value)+"👋",1)])]),Le("div",uOe,[Le("div",cOe,[Se.value?(Wr(),Qr("div",hOe,vr[3]||(vr[3]=[Le("div",{class:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary"},null,-1),Le("p",{class:"text-dark-text text-xs sm:text-sm"},"Loading...",-1)]))):Er.value>0?(Wr(),Qr("div",fOe,[Le("p",dOe,[vr[4]||(vr[4]=ul(" Tracking: ",-1)),Le("span",pOe,Si(Er.value)+" node"+Si(Er.value===1?"":"s"),1)]),Fe.value.length>0?(Wr(),Qr("div",mOe,[(Wr(!0),Qr(js,null,au(Fe.value,(dr,Ar)=>(Wr(),Qr("span",{key:dr.type,class:"inline"},[ul(Si(dr.count)+" "+Si(dr.type)+Si(dr.count===1?"":"s"),1),Ar